@oruga-ui/oruga-next
Advanced tools
Comparing version 0.5.4 to 0.5.5
@@ -8,7 +8,7 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
require('./FormElementMixin-2afcfa9f.js'); | ||
require('./Input-21e5e5c6.js'); | ||
var Autocomplete = require('./Autocomplete-9d7d5440.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
require('./FormElementMixin-05fe9429.js'); | ||
require('./Input-8f93ca24.js'); | ||
var Autocomplete = require('./Autocomplete-56467e08.js'); | ||
@@ -15,0 +15,0 @@ var index = { |
@@ -8,5 +8,5 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
var Button = require('./Button-68442b8e.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
var Button = require('./Button-fa8f3d38.js'); | ||
@@ -13,0 +13,0 @@ var index = { |
@@ -8,5 +8,5 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var Icon = require('./Icon-0d0ce1f1.js'); | ||
var InjectedChildMixin = require('./InjectedChildMixin-f4516d85.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var Icon = require('./Icon-045712e4.js'); | ||
var InjectedChildMixin = require('./InjectedChildMixin-bcb07e69.js'); | ||
@@ -34,3 +34,3 @@ /** | ||
type: Number, | ||
default: () => { helpers.getValueByPath(config.getOptions(), 'carousel.interval', 3500); } | ||
default: () => { return helpers.getValueByPath(config.getOptions(), 'carousel.interval', 3500); } | ||
}, | ||
@@ -37,0 +37,0 @@ hasDrag: { |
@@ -8,5 +8,5 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./CheckRadioMixin-2a894e60.js'); | ||
var Checkbox = require('./Checkbox-6d520b60.js'); | ||
var Checkbox = require('./Checkbox-fcd749a1.js'); | ||
@@ -13,0 +13,0 @@ var index = { |
@@ -8,3 +8,3 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
@@ -88,4 +88,3 @@ /** | ||
class: this.computedClass('contentClass', 'o-clps__content'), | ||
'id': this.ariaId, | ||
'aria-expanded': this.isOpen | ||
'id': this.ariaId | ||
}, this.$slots.default()), [[vue.vShow, this.isOpen]])); | ||
@@ -92,0 +91,0 @@ return vue.h('div', { class: this.computedClass('rootClass', 'o-clps') }, (this.position === 'top' ? [trigger, content] : [content, trigger])); |
@@ -8,12 +8,12 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
require('./FormElementMixin-2afcfa9f.js'); | ||
require('./Input-21e5e5c6.js'); | ||
require('./MatchMediaMixin-24ebe809.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
require('./FormElementMixin-05fe9429.js'); | ||
require('./Input-8f93ca24.js'); | ||
require('./MatchMediaMixin-b52dbd16.js'); | ||
require('./trapFocus-cf475da4.js'); | ||
require('./DropdownItem-abad1c3a.js'); | ||
require('./Field-9e85e2f9.js'); | ||
require('./Select-4bfd767a.js'); | ||
var Datepicker = require('./Datepicker-528de5b0.js'); | ||
require('./DropdownItem-a05a36ae.js'); | ||
require('./Field-627f0694.js'); | ||
require('./Select-cb8f0ca3.js'); | ||
var Datepicker = require('./Datepicker-d3159868.js'); | ||
@@ -20,0 +20,0 @@ var index = { |
@@ -8,13 +8,13 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
var FormElementMixin = require('./FormElementMixin-2afcfa9f.js'); | ||
require('./Input-21e5e5c6.js'); | ||
require('./MatchMediaMixin-24ebe809.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
var FormElementMixin = require('./FormElementMixin-05fe9429.js'); | ||
require('./Input-8f93ca24.js'); | ||
require('./MatchMediaMixin-b52dbd16.js'); | ||
require('./trapFocus-cf475da4.js'); | ||
require('./DropdownItem-abad1c3a.js'); | ||
require('./Field-9e85e2f9.js'); | ||
require('./Select-4bfd767a.js'); | ||
var Datepicker = require('./Datepicker-528de5b0.js'); | ||
var Timepicker = require('./Timepicker-f704f5ff.js'); | ||
require('./DropdownItem-a05a36ae.js'); | ||
require('./Field-627f0694.js'); | ||
require('./Select-cb8f0ca3.js'); | ||
var Datepicker = require('./Datepicker-d3159868.js'); | ||
var Timepicker = require('./Timepicker-73cf9888.js'); | ||
@@ -46,2 +46,3 @@ const AM = 'AM'; | ||
}, | ||
size: String, | ||
placeholder: String, | ||
@@ -48,0 +49,0 @@ disabled: Boolean, |
@@ -8,6 +8,6 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./MatchMediaMixin-24ebe809.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./MatchMediaMixin-b52dbd16.js'); | ||
require('./trapFocus-cf475da4.js'); | ||
var DropdownItem = require('./DropdownItem-abad1c3a.js'); | ||
var DropdownItem = require('./DropdownItem-a05a36ae.js'); | ||
@@ -14,0 +14,0 @@ var index = { |
@@ -8,5 +8,5 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./MatchMediaMixin-24ebe809.js'); | ||
var Field = require('./Field-9e85e2f9.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./MatchMediaMixin-b52dbd16.js'); | ||
var Field = require('./Field-627f0694.js'); | ||
@@ -13,0 +13,0 @@ var index = { |
@@ -154,20 +154,4 @@ 'use strict'; | ||
return value; | ||
// eslint-disable-next-line | ||
return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&'); | ||
} | ||
function multiColumnSort(inputArray, sortingPriority) { | ||
// clone it to prevent the any watchers from triggering every sorting iteration | ||
const array = JSON.parse(JSON.stringify(inputArray)); | ||
const fieldSorter = (fields) => (a, b) => fields.map((o) => { | ||
let dir = 1; | ||
if (o[0] === '-') { | ||
dir = -1; | ||
o = o.substring(1); | ||
} | ||
const aValue = getValueByPath(a, o); | ||
const bValue = getValueByPath(b, o); | ||
return aValue > bValue ? dir : aValue < bValue ? -(dir) : 0; | ||
}).reduce((p, n) => p || n, 0); | ||
return array.sort(fieldSorter(sortingPriority)); | ||
} | ||
function createNewEvent(eventName) { | ||
@@ -193,8 +177,2 @@ let event; | ||
} | ||
/** | ||
* Return month names according to a specified locale | ||
* @param {String} locale A bcp47 localerouter. undefined will use the user browser locale | ||
* @param {String} format long (ex. March), short (ex. Mar) or narrow (M) | ||
* @return {Array<String>} An array of month names | ||
*/ | ||
function getMonthNames(locale = undefined, format = 'long') { | ||
@@ -210,9 +188,2 @@ const dates = []; | ||
} | ||
/** | ||
* Return weekday names according to a specified locale | ||
* @param {String} locale A bcp47 localerouter. undefined will use the user browser locale | ||
* @param {Number} first day of week index | ||
* @param {String} format long (ex. Thursday), short (ex. Thu) or narrow (T) | ||
* @return {Array<String>} An array of weekday names | ||
*/ | ||
function getWeekdayNames(locale = undefined, firstDayOfWeek = 0, format = 'narrow') { | ||
@@ -307,2 +278,5 @@ const dates = []; | ||
} | ||
function isClient() { | ||
return typeof window !== 'undefined'; | ||
} | ||
@@ -323,2 +297,3 @@ exports.blankIfUndefined = blankIfUndefined; | ||
exports.indexOf = indexOf; | ||
exports.isClient = isClient; | ||
exports.isDefined = isDefined; | ||
@@ -329,3 +304,2 @@ exports.isMobile = isMobile; | ||
exports.mod = mod; | ||
exports.multiColumnSort = multiColumnSort; | ||
exports.removeDiacriticsFromString = removeDiacriticsFromString; | ||
@@ -332,0 +306,0 @@ exports.removeElement = removeElement; |
@@ -8,4 +8,4 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var Icon = require('./Icon-0d0ce1f1.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var Icon = require('./Icon-045712e4.js'); | ||
@@ -12,0 +12,0 @@ var index = { |
@@ -8,24 +8,24 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
require('./FormElementMixin-2afcfa9f.js'); | ||
require('./Input-21e5e5c6.js'); | ||
require('./Autocomplete-9d7d5440.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
require('./FormElementMixin-05fe9429.js'); | ||
require('./Input-8f93ca24.js'); | ||
require('./Autocomplete-56467e08.js'); | ||
var autocomplete = require('./autocomplete.js'); | ||
require('./Button-68442b8e.js'); | ||
require('./Button-fa8f3d38.js'); | ||
var button = require('./button.js'); | ||
require('./InjectedChildMixin-f4516d85.js'); | ||
require('./InjectedChildMixin-bcb07e69.js'); | ||
var carousel = require('./carousel.js'); | ||
require('./CheckRadioMixin-2a894e60.js'); | ||
require('./Checkbox-6d520b60.js'); | ||
require('./Checkbox-fcd749a1.js'); | ||
var checkbox = require('./checkbox.js'); | ||
var collapse = require('./collapse.js'); | ||
require('./MatchMediaMixin-24ebe809.js'); | ||
require('./MatchMediaMixin-b52dbd16.js'); | ||
require('./trapFocus-cf475da4.js'); | ||
require('./DropdownItem-abad1c3a.js'); | ||
require('./Field-9e85e2f9.js'); | ||
require('./Select-4bfd767a.js'); | ||
require('./Datepicker-528de5b0.js'); | ||
require('./DropdownItem-a05a36ae.js'); | ||
require('./Field-627f0694.js'); | ||
require('./Select-cb8f0ca3.js'); | ||
require('./Datepicker-d3159868.js'); | ||
var datepicker = require('./datepicker.js'); | ||
require('./Timepicker-f704f5ff.js'); | ||
require('./Timepicker-73cf9888.js'); | ||
var datetimepicker = require('./datetimepicker.js'); | ||
@@ -38,7 +38,7 @@ var dropdown = require('./dropdown.js'); | ||
require('./ssr-4e5033ea.js'); | ||
require('./Loading-3c69adc5.js'); | ||
require('./Loading-83d138c4.js'); | ||
var loading = require('./loading.js'); | ||
var modal = require('./modal.js'); | ||
var notification = require('./notification.js'); | ||
require('./Pagination-29b64b69.js'); | ||
require('./Pagination-8d97c72c.js'); | ||
var pagination = require('./pagination.js'); | ||
@@ -49,6 +49,6 @@ var radio = require('./radio.js'); | ||
var sidebar = require('./sidebar.js'); | ||
require('./Tooltip-7fbd3df3.js'); | ||
require('./Tooltip-69a35f64.js'); | ||
var slider = require('./slider.js'); | ||
require('./SlotComponent-b10f11e8.js'); | ||
require('./TabbedChildMixin-458b8586.js'); | ||
require('./TabbedChildMixin-e9ae0191.js'); | ||
var steps = require('./steps.js'); | ||
@@ -55,0 +55,0 @@ var _switch = require('./switch.js'); |
@@ -8,6 +8,6 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
require('./FormElementMixin-2afcfa9f.js'); | ||
var Input = require('./Input-21e5e5c6.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
require('./FormElementMixin-05fe9429.js'); | ||
var Input = require('./Input-8f93ca24.js'); | ||
@@ -14,0 +14,0 @@ var index = { |
@@ -8,7 +8,7 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var Icon = require('./Icon-0d0ce1f1.js'); | ||
var FormElementMixin = require('./FormElementMixin-2afcfa9f.js'); | ||
require('./Input-21e5e5c6.js'); | ||
var Autocomplete = require('./Autocomplete-9d7d5440.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var Icon = require('./Icon-045712e4.js'); | ||
var FormElementMixin = require('./FormElementMixin-05fe9429.js'); | ||
require('./Input-8f93ca24.js'); | ||
var Autocomplete = require('./Autocomplete-56467e08.js'); | ||
@@ -15,0 +15,0 @@ /** |
@@ -8,6 +8,6 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
require('./ssr-4e5033ea.js'); | ||
var Loading = require('./Loading-3c69adc5.js'); | ||
var Loading = require('./Loading-83d138c4.js'); | ||
@@ -21,6 +21,13 @@ let localVueInstance; | ||
const propsData = helpers.merge(defaultParam, params); | ||
let resolve, reject; | ||
propsData.promise = new Promise((p1, p2) => { | ||
resolve = p1; | ||
reject = p2; | ||
}); | ||
propsData.programmatic = { resolve, reject }; | ||
const app = localVueInstance || config.VueInstance; | ||
const vnode = vue.createVNode(Loading.script, propsData); | ||
vnode.appContext = app._context; | ||
return vue.render(vnode, document.createElement('div')); | ||
vue.render(vnode, document.createElement('div')); | ||
return vnode.component.proxy; | ||
} | ||
@@ -27,0 +34,0 @@ }; |
@@ -8,5 +8,5 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var Icon = require('./Icon-0d0ce1f1.js'); | ||
var MatchMediaMixin = require('./MatchMediaMixin-24ebe809.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var Icon = require('./Icon-045712e4.js'); | ||
var MatchMediaMixin = require('./MatchMediaMixin-b52dbd16.js'); | ||
var trapFocus = require('./trapFocus-cf475da4.js'); | ||
@@ -38,3 +38,6 @@ | ||
content: String, | ||
programmatic: Boolean, | ||
/** @ignore */ | ||
programmatic: [Boolean, Object], | ||
/** @ignore */ | ||
promise: Object, | ||
/** Props to be binded to the injected component */ | ||
@@ -240,3 +243,3 @@ props: Object, | ||
this.onCancel.apply(null, arguments); | ||
this.close(); | ||
this.close({ action: 'cancel', method }); | ||
}, | ||
@@ -256,2 +259,5 @@ /** | ||
if (this.programmatic) { | ||
if (this.programmatic.resolve) { | ||
this.programmatic.resolve.apply(null, arguments); | ||
} | ||
window.requestAnimationFrame(() => { | ||
@@ -395,6 +401,13 @@ helpers.removeElement(this.$el); | ||
const propsData = helpers.merge(defaultParam, newParams); | ||
let resolve, reject; | ||
propsData.promise = new Promise((p1, p2) => { | ||
resolve = p1; | ||
reject = p2; | ||
}); | ||
propsData.programmatic = { resolve, reject }; | ||
const app = localVueInstance || config.VueInstance; | ||
const vnode = vue.createVNode(script, propsData); | ||
vnode.appContext = app._context; | ||
return vue.render(vnode, document.createElement('div')); | ||
vue.render(vnode, document.createElement('div')); | ||
return vnode.component.proxy; | ||
} | ||
@@ -401,0 +414,0 @@ }; |
@@ -8,4 +8,4 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var Icon = require('./Icon-0d0ce1f1.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var Icon = require('./Icon-045712e4.js'); | ||
@@ -101,3 +101,3 @@ var MessageMixin = { | ||
this.isActive = false; | ||
this.$emit('close'); | ||
this.$emit('close', ...arguments); | ||
this.$emit('update:active', false); | ||
@@ -112,3 +112,3 @@ }, | ||
if (this.isActive) { | ||
this.close(); | ||
this.close({ action: 'close', method: 'timeout' }); | ||
} | ||
@@ -232,3 +232,6 @@ }, this.duration); | ||
type: "button", | ||
onClick: _cache[1] || (_cache[1] = (...args) => _ctx.close(...args)), | ||
onClick: _cache[1] || (_cache[1] = $event => _ctx.close({ | ||
action: 'close', | ||
method: 'x' | ||
})), | ||
"aria-label": $props.ariaCloseLabel | ||
@@ -302,3 +305,3 @@ }, [vue.createVNode(_component_o_icon, { | ||
default: () => { | ||
helpers.getValueByPath(config.getOptions(), 'notification.duration', 1000); | ||
return helpers.getValueByPath(config.getOptions(), 'notification.duration', 1000); | ||
} | ||
@@ -310,3 +313,3 @@ }, | ||
default: () => { | ||
helpers.getValueByPath(config.getOptions(), 'notification.noticeQueue', undefined); | ||
return helpers.getValueByPath(config.getOptions(), 'notification.noticeQueue', undefined); | ||
} | ||
@@ -338,5 +341,9 @@ }, | ||
default: () => { | ||
helpers.getValueByPath(config.getOptions(), 'notification.containerElement', undefined); | ||
return helpers.getValueByPath(config.getOptions(), 'notification.containerElement', undefined); | ||
} | ||
}, | ||
/** @ignore */ | ||
programmatic: [Boolean, Object], | ||
/** @ignore */ | ||
promise: Object, | ||
/** Callback function to call after close (programmatically close or user canceled) */ | ||
@@ -400,2 +407,5 @@ onClose: { | ||
this.onClose.apply(null, arguments); | ||
if (this.programmatic && this.programmatic.resolve) { | ||
this.programmatic.resolve.apply(null, arguments); | ||
} | ||
// Timeout for the animation complete before destroying | ||
@@ -438,3 +448,3 @@ setTimeout(() => { | ||
timeoutCallback() { | ||
return this.close(); | ||
return this.close({ action: 'close', method: 'timeout' }); | ||
} | ||
@@ -475,3 +485,3 @@ }, | ||
timeoutCallback() { | ||
return this.$refs.notification.close(); | ||
return this.$refs.notification.close({ action: 'close', method: 'timeout' }); | ||
} | ||
@@ -522,2 +532,8 @@ } | ||
const propsData = helpers.merge(defaultParam, newParams); | ||
let resolve, reject; | ||
propsData.promise = new Promise((p1, p2) => { | ||
resolve = p1; | ||
reject = p2; | ||
}); | ||
propsData.programmatic = { resolve, reject }; | ||
const app = localVueInstance || config.VueInstance; | ||
@@ -529,3 +545,4 @@ propsData.propsNotification = Object.assign({}, propsData); | ||
vnode.appContext = app._context; | ||
return vue.render(vnode, document.createElement('div')); | ||
vue.render(vnode, document.createElement('div')); | ||
return vnode.component.proxy; | ||
} | ||
@@ -532,0 +549,0 @@ }; |
@@ -8,6 +8,6 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
require('./MatchMediaMixin-24ebe809.js'); | ||
var Pagination = require('./Pagination-29b64b69.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
require('./MatchMediaMixin-b52dbd16.js'); | ||
var Pagination = require('./Pagination-8d97c72c.js'); | ||
@@ -14,0 +14,0 @@ var index = { |
@@ -8,3 +8,3 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var CheckRadioMixin = require('./CheckRadioMixin-2a894e60.js'); | ||
@@ -11,0 +11,0 @@ |
@@ -8,6 +8,6 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
require('./FormElementMixin-2afcfa9f.js'); | ||
var Select = require('./Select-4bfd767a.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
require('./FormElementMixin-05fe9429.js'); | ||
var Select = require('./Select-cb8f0ca3.js'); | ||
@@ -14,0 +14,0 @@ var index = { |
@@ -8,4 +8,4 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var MatchMediaMixin = require('./MatchMediaMixin-24ebe809.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var MatchMediaMixin = require('./MatchMediaMixin-b52dbd16.js'); | ||
@@ -187,18 +187,2 @@ /** | ||
/** | ||
* White-listed items to not close when clicked. | ||
* Add sidebar content and all children. | ||
*/ | ||
whiteList() { | ||
const whiteList = []; | ||
whiteList.push(this.$refs.sidebarContent); | ||
// Add all chidren from dropdown | ||
if (this.$refs.sidebarContent !== undefined) { | ||
const children = this.$refs.sidebarContent.querySelectorAll('*'); | ||
for (const child of children) { | ||
whiteList.push(child); | ||
} | ||
} | ||
return whiteList; | ||
}, | ||
/** | ||
* Keypress event that is bound to the document. | ||
@@ -235,9 +219,8 @@ */ | ||
clickedOutside(event) { | ||
if (this.isFixed) { | ||
if (this.isOpen && !this.animating) { | ||
if (this.whiteList().indexOf(event.target) < 0) { | ||
this.cancel('outside'); | ||
} | ||
} | ||
if (!this.isFixed || !this.isOpen || this.animating) { | ||
return; | ||
} | ||
if (!event.composedPath().includes(this.$refs.sidebarContent)) { | ||
this.cancel('outside'); | ||
} | ||
}, | ||
@@ -244,0 +227,0 @@ /** |
@@ -8,3 +8,3 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
@@ -11,0 +11,0 @@ /** |
@@ -8,4 +8,4 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var Tooltip = require('./Tooltip-7fbd3df3.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var Tooltip = require('./Tooltip-69a35f64.js'); | ||
@@ -12,0 +12,0 @@ var script = vue.defineComponent({ |
@@ -8,9 +8,9 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var Icon = require('./Icon-0d0ce1f1.js'); | ||
var Button = require('./Button-68442b8e.js'); | ||
require('./InjectedChildMixin-f4516d85.js'); | ||
var MatchMediaMixin = require('./MatchMediaMixin-24ebe809.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var Icon = require('./Icon-045712e4.js'); | ||
var Button = require('./Button-fa8f3d38.js'); | ||
require('./InjectedChildMixin-bcb07e69.js'); | ||
var MatchMediaMixin = require('./MatchMediaMixin-b52dbd16.js'); | ||
require('./SlotComponent-b10f11e8.js'); | ||
var TabbedChildMixin = require('./TabbedChildMixin-458b8586.js'); | ||
var TabbedChildMixin = require('./TabbedChildMixin-e9ae0191.js'); | ||
@@ -17,0 +17,0 @@ /** |
@@ -8,3 +8,3 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
@@ -11,0 +11,0 @@ /** |
@@ -8,7 +8,7 @@ 'use strict'; | ||
var config = require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
require('./InjectedChildMixin-f4516d85.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
require('./InjectedChildMixin-bcb07e69.js'); | ||
require('./SlotComponent-b10f11e8.js'); | ||
var TabbedChildMixin = require('./TabbedChildMixin-458b8586.js'); | ||
var TabbedChildMixin = require('./TabbedChildMixin-e9ae0191.js'); | ||
@@ -102,3 +102,4 @@ /** | ||
class: _ctx.navClasses, | ||
role: "tablist" | ||
role: "tablist", | ||
"aria-orientation": _ctx.vertical ? 'vertical' : 'horizontal' | ||
}, [vue.renderSlot(_ctx.$slots, "start"), (vue.openBlock(true), vue.createBlock(vue.Fragment, null, vue.renderList(_ctx.items, childItem => { | ||
@@ -108,3 +109,6 @@ return vue.withDirectives((vue.openBlock(), vue.createBlock("div", { | ||
onKeydown: [_cache[1] || (_cache[1] = vue.withKeys(vue.withModifiers((...args) => _ctx.prev(...args), ["prevent"]), ["left"])), _cache[2] || (_cache[2] = vue.withKeys(vue.withModifiers((...args) => _ctx.next(...args), ["prevent"]), ["right"])), _cache[3] || (_cache[3] = vue.withKeys(vue.withModifiers((...args) => _ctx.prev(...args), ["prevent"]), ["up"])), _cache[4] || (_cache[4] = vue.withKeys(vue.withModifiers((...args) => _ctx.next(...args), ["prevent"]), ["down"])), _cache[5] || (_cache[5] = vue.withKeys(vue.withModifiers((...args) => _ctx.homePressed(...args), ["prevent"]), ["home"])), _cache[6] || (_cache[6] = vue.withKeys(vue.withModifiers((...args) => _ctx.endPressed(...args), ["prevent"]), ["end"]))], | ||
class: _ctx.itemWrapperClasses | ||
class: _ctx.itemWrapperClasses, | ||
role: "tab", | ||
"aria-controls": `${childItem.value}-content`, | ||
"aria-selected": `${childItem.isActive}` | ||
}, [childItem.$slots.header ? vue.createVNode(_component_o_slot_component, { | ||
@@ -115,3 +119,2 @@ key: 0, | ||
name: "header", | ||
role: "tab", | ||
onClick: $event => _ctx.childClick(childItem), | ||
@@ -124,3 +127,2 @@ onKeydown: [vue.withKeys(vue.withModifiers(_ctx.prev, ["prevent"]), ["left"]), vue.withKeys(vue.withModifiers(_ctx.next, ["prevent"]), ["right"]), vue.withKeys(vue.withModifiers(_ctx.prev, ["prevent"]), ["up"]), vue.withKeys(vue.withModifiers(_ctx.next, ["prevent"]), ["down"]), vue.withKeys(vue.withModifiers(_ctx.homePressed, ["prevent"]), ["home"]), vue.withKeys(vue.withModifiers(_ctx.endPressed, ["prevent"]), ["end"])], | ||
key: 1, | ||
role: "tab", | ||
onClick: $event => _ctx.childClick(childItem), | ||
@@ -145,10 +147,10 @@ class: childItem.headerClasses | ||
/* PROPS, DYNAMIC_SLOTS */ | ||
, ["onClick", "class"]))], 34 | ||
/* CLASS, HYDRATE_EVENTS */ | ||
)), [[vue.vShow, childItem.visible]]); | ||
, ["onClick", "class"]))], 42 | ||
/* CLASS, PROPS, HYDRATE_EVENTS */ | ||
, ["aria-controls", "aria-selected"])), [[vue.vShow, childItem.visible]]); | ||
}), 128 | ||
/* KEYED_FRAGMENT */ | ||
)), vue.renderSlot(_ctx.$slots, "end")], 2 | ||
/* CLASS */ | ||
), vue.createVNode("section", { | ||
)), vue.renderSlot(_ctx.$slots, "end")], 10 | ||
/* CLASS, PROPS */ | ||
, ["aria-orientation"]), vue.createVNode("section", { | ||
class: _ctx.contentClasses | ||
@@ -155,0 +157,0 @@ }, [vue.renderSlot(_ctx.$slots, "default")], 2 |
@@ -8,11 +8,11 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
require('./Icon-0d0ce1f1.js'); | ||
require('./FormElementMixin-2afcfa9f.js'); | ||
require('./Input-21e5e5c6.js'); | ||
require('./MatchMediaMixin-24ebe809.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
require('./Icon-045712e4.js'); | ||
require('./FormElementMixin-05fe9429.js'); | ||
require('./Input-8f93ca24.js'); | ||
require('./MatchMediaMixin-b52dbd16.js'); | ||
require('./trapFocus-cf475da4.js'); | ||
require('./DropdownItem-abad1c3a.js'); | ||
require('./Select-4bfd767a.js'); | ||
var Timepicker = require('./Timepicker-f704f5ff.js'); | ||
require('./DropdownItem-a05a36ae.js'); | ||
require('./Select-cb8f0ca3.js'); | ||
var Timepicker = require('./Timepicker-73cf9888.js'); | ||
@@ -19,0 +19,0 @@ var index = { |
@@ -8,4 +8,4 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var Tooltip = require('./Tooltip-7fbd3df3.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var Tooltip = require('./Tooltip-69a35f64.js'); | ||
@@ -12,0 +12,0 @@ var index = { |
@@ -8,4 +8,4 @@ 'use strict'; | ||
require('./config.js'); | ||
var plugins = require('./plugins-4daeb0ab.js'); | ||
var FormElementMixin = require('./FormElementMixin-2afcfa9f.js'); | ||
var plugins = require('./plugins-513bb3fa.js'); | ||
var FormElementMixin = require('./FormElementMixin-05fe9429.js'); | ||
var ssr = require('./ssr-4e5033ea.js'); | ||
@@ -12,0 +12,0 @@ |
{ | ||
"name": "@oruga-ui/oruga-next", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"homepage": "https://oruga.io", | ||
@@ -5,0 +5,0 @@ "description": "UI components for Vue.js and CSS framework agnostic", |
@@ -20,3 +20,3 @@ <p align="center"> | ||
<a href="https://www.npmjs.com/package/@oruga-ui/oruga"><img src="https://img.shields.io/npm/dt/@oruga-ui/oruga.svg" /></a> | ||
<a href="https://circleci.com/gh/oruga-ui/oruga"><img src="https://img.shields.io/circleci/project/github/oruga-ui/oruga.svg?style=flat-square" /><a> | ||
<a href="https://github.com/oruga-ui/oruga/actions"><img src="https://github.com/oruga-ui/oruga/actions/workflows/build.yml/badge.svg" /><a> | ||
<a href="https://codecov.io/gh/oruga-ui/oruga"><img src="https://img.shields.io/codecov/c/github/oruga-ui/oruga.svg?style=flat-square" /></a> | ||
@@ -23,0 +23,0 @@ <a href="https://discord.gg/RuKuBYN"><img src="https://img.shields.io/badge/chat-on%20discord-7289DA.svg?logo=discord" /></a> |
@@ -12,3 +12,3 @@ import { App, ComponentPropsOptions, createVNode, Plugin, render } from 'vue' | ||
const LoadingProgrammatic = { | ||
open(params: Readonly<ComponentPropsOptions>) { | ||
open(params: Readonly<ComponentPropsOptions>) : InstanceType<typeof Loading> { | ||
const defaultParam = { | ||
@@ -18,7 +18,13 @@ programmatic: true | ||
const propsData = merge(defaultParam, params) | ||
let resolve, reject; | ||
propsData.promise = new Promise((p1, p2) => { | ||
resolve = p1 | ||
reject = p2 | ||
}) | ||
propsData.programmatic = {resolve, reject} | ||
const app = localVueInstance || VueInstance | ||
const vnode = createVNode(Loading, propsData) | ||
vnode.appContext = app._context | ||
return render(vnode, document.createElement('div')) | ||
render(vnode, document.createElement('div')) | ||
return vnode.component.proxy as InstanceType<typeof Loading> | ||
} | ||
@@ -25,0 +31,0 @@ } |
@@ -12,3 +12,3 @@ import { App, createVNode, DefineComponent, Plugin, render } from 'vue' | ||
const ModalProgrammatic = { | ||
open(params: OModal | string) { | ||
open(params: OModal | string) : InstanceType<typeof Modal> { | ||
let newParams | ||
@@ -32,2 +32,8 @@ if (typeof params === 'string') { | ||
const propsData = merge(defaultParam, newParams) | ||
let resolve, reject; | ||
propsData.promise = new Promise((p1, p2) => { | ||
resolve = p1 | ||
reject = p2 | ||
}) | ||
propsData.programmatic = {resolve, reject} | ||
@@ -37,3 +43,4 @@ const app = localVueInstance || VueInstance | ||
vnode.appContext = app._context | ||
return render(vnode, document.createElement('div')) | ||
render(vnode, document.createElement('div')) | ||
return vnode.component.proxy as InstanceType<typeof Modal> | ||
} | ||
@@ -40,0 +47,0 @@ } |
@@ -16,3 +16,3 @@ import Notification from './Notification.vue' | ||
const NotificationProgrammatic = { | ||
open(params) { | ||
open(params) : InstanceType<typeof NotificationNotice>{ | ||
let newParams | ||
@@ -40,2 +40,8 @@ if (typeof params === 'string') { | ||
const propsData = merge(defaultParam, newParams) | ||
let resolve, reject; | ||
propsData.promise = new Promise((p1, p2) => { | ||
resolve = p1 | ||
reject = p2 | ||
}) | ||
propsData.programmatic = {resolve, reject} | ||
@@ -48,3 +54,4 @@ const app = localVueInstance || VueInstance | ||
vnode.appContext = app._context | ||
return render(vnode, document.createElement('div')) | ||
render(vnode, document.createElement('div')) | ||
return vnode.component.proxy as InstanceType<typeof NotificationNotice> | ||
} | ||
@@ -51,0 +58,0 @@ } |
@@ -168,20 +168,5 @@ /** | ||
if (!value) return value | ||
// eslint-disable-next-line | ||
return value.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, '\\$&') | ||
} | ||
export function multiColumnSort(inputArray, sortingPriority) { | ||
// clone it to prevent the any watchers from triggering every sorting iteration | ||
const array = JSON.parse(JSON.stringify(inputArray)) | ||
const fieldSorter = (fields) => (a, b) => fields.map((o) => { | ||
let dir = 1 | ||
if (o[0] === '-') { dir = -1; o = o.substring(1) } | ||
const aValue = getValueByPath(a, o) | ||
const bValue = getValueByPath(b, o) | ||
return aValue > bValue ? dir : aValue < bValue ? -(dir) : 0 | ||
}).reduce((p, n) => p || n, 0) | ||
return array.sort(fieldSorter(sortingPriority)) | ||
} | ||
export function createNewEvent(eventName: string) { | ||
@@ -206,3 +191,3 @@ let event: any | ||
export function defaultIfUndefined(value, defaultValue) { | ||
export function defaultIfUndefined(value: any, defaultValue: any) { | ||
return typeof value !== 'undefined' && value !== null ? value : defaultValue | ||
@@ -217,3 +202,6 @@ } | ||
*/ | ||
export function getMonthNames(locale: string = undefined, format: string = 'long'): string[] { | ||
type monthType = "numeric" | "2-digit" | "long" | "short" | "narrow" | undefined | ||
export function getMonthNames(locale: string = undefined, format: monthType = 'long'): string[] { | ||
const dates = [] | ||
@@ -237,3 +225,6 @@ for (let i = 0; i < 12; i++) { | ||
*/ | ||
export function getWeekdayNames(locale: string = undefined, firstDayOfWeek: number = 0, format: string = 'narrow'): string[] { | ||
type weekdayType = "long" | "short" | "narrow" | undefined; | ||
export function getWeekdayNames(locale: string = undefined, firstDayOfWeek: number = 0, format: weekdayType = 'narrow'): string[] { | ||
const dates = [] | ||
@@ -330,1 +321,5 @@ for (let i = 1, j = 0; j < 7; i++) { | ||
} | ||
export function isClient() { | ||
return typeof window !== 'undefined' | ||
} |
import { defineComponent, DefineComponent } from 'vue' | ||
import { hasFlag } from './helpers' | ||
import { defaultIfUndefined, hasFlag } from './helpers' | ||
@@ -16,3 +16,3 @@ const sorted = 1 | ||
created() { | ||
this.newValue = typeof this.value === 'undefined' ? this.parent._nextSequence() : this.value | ||
this.newValue = defaultIfUndefined(this.value, this.parent._nextSequence()) | ||
if (!this.parent) { | ||
@@ -22,3 +22,3 @@ if (!hasFlag(flags, optional)) { | ||
} | ||
} else if (this.parent._registerItem) { | ||
} else { | ||
this.parent._registerItem(this) | ||
@@ -28,3 +28,3 @@ } | ||
beforeUnmount() { | ||
if (this.parent && this.parent._unregisterItem) { | ||
if (this.parent) { | ||
this.parent._unregisterItem(this) | ||
@@ -31,0 +31,0 @@ } |
@@ -91,3 +91,3 @@ import Icon from '../components/icon/Icon.vue' | ||
this.isActive = false | ||
this.$emit('close') | ||
this.$emit('close', ...arguments) | ||
this.$emit('update:active', false) | ||
@@ -102,3 +102,3 @@ }, | ||
if (this.isActive) { | ||
this.close() | ||
this.close({action: 'close', method: 'timeout'}) | ||
} | ||
@@ -105,0 +105,0 @@ }, this.duration) |
@@ -17,3 +17,3 @@ import { getOptions } from './config' | ||
default: () => { | ||
getValueByPath(getOptions(), 'notification.duration', 1000) | ||
return getValueByPath(getOptions(), 'notification.duration', 1000) | ||
} | ||
@@ -25,3 +25,3 @@ }, | ||
default: () => { | ||
getValueByPath(getOptions(), 'notification.noticeQueue', undefined) | ||
return getValueByPath(getOptions(), 'notification.noticeQueue', undefined) | ||
} | ||
@@ -53,5 +53,9 @@ }, | ||
default: () => { | ||
getValueByPath(getOptions(), 'notification.containerElement', undefined) | ||
return getValueByPath(getOptions(), 'notification.containerElement', undefined) | ||
} | ||
}, | ||
/** @ignore */ | ||
programmatic: [Boolean, Object], | ||
/** @ignore */ | ||
promise: Object, | ||
/** Callback function to call after close (programmatically close or user canceled) */ | ||
@@ -119,2 +123,6 @@ onClose: { | ||
if (this.programmatic && this.programmatic.resolve) { | ||
this.programmatic.resolve.apply(null, arguments) | ||
} | ||
// Timeout for the animation complete before destroying | ||
@@ -165,3 +173,3 @@ setTimeout(() => { | ||
timeoutCallback() { | ||
return this.close() | ||
return this.close({action: 'close', method: 'timeout'}) | ||
} | ||
@@ -168,0 +176,0 @@ }, |
@@ -28,15 +28,15 @@ import { defineComponent, DefineComponent } from 'vue' | ||
_registerItem(item) { | ||
this.$nextTick(() => { | ||
item.index = this.childItems.length | ||
this.childItems.push(item) | ||
}) | ||
item.index = this.childItems.length | ||
this.childItems.push(item) | ||
if (this.$el) { | ||
this.$nextTick(() => { | ||
const ids = this.childItems.map(it => `[data-id="${itemName}-${it.newValue}"]`).join(',') | ||
const sortedIds = Array.from(this.$el.querySelectorAll(ids)).map( | ||
(el: any) => el.getAttribute('data-id').replace(`${itemName}-`, '')) | ||
this.childItems.forEach(it => it.index = sortedIds.indexOf(`${it.newValue}`)) | ||
}) | ||
} | ||
}, | ||
_unregisterItem(item) { | ||
this.$nextTick(() => { | ||
this.childItems = this.childItems.filter((i) => i !== item) | ||
let index = 0 | ||
this.childItems.forEach(it => { | ||
it.index = index++ | ||
}) | ||
}) | ||
this.childItems = this.childItems.filter((i) => i !== item) | ||
}, | ||
@@ -43,0 +43,0 @@ _nextSequence() { |
@@ -8,2 +8,6 @@ import { defineComponent, h, Transition, vShow, withDirectives } from 'vue' | ||
/** | ||
* Item value (it will be used as v-model of wrapper component) | ||
*/ | ||
value: [String, Number], | ||
/** | ||
* Item label | ||
@@ -28,11 +32,5 @@ */ | ||
/** | ||
* Item value (it will be used as v-model of wrapper component) | ||
*/ | ||
value: [String, Number], | ||
/** | ||
* Header class of the item | ||
*/ | ||
headerClass: { | ||
type: [String, Array, Object] | ||
} | ||
headerClass: [String, Array, Object] | ||
}, | ||
@@ -81,3 +79,4 @@ data() { | ||
{ | ||
class: this.elementClasses | ||
class: this.elementClasses, | ||
'data-id': `${parentCmp}-${this.newValue}` | ||
}, | ||
@@ -84,0 +83,0 @@ content |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
4219153
78163