primevue 4.0.7 → 4.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/autocomplete/AutoComplete.vue +50 -50
- package/autocomplete/index.d.ts +5 -1
- package/autocomplete/index.mjs +11 -8
- package/autocomplete/index.mjs.map +1 -1
- package/autocomplete/style/index.d.ts +4 -0
- package/autocomplete/style/index.mjs +3 -2
- package/autocomplete/style/index.mjs.map +1 -1
- package/button/BaseButton.vue +2 -2
- package/button/Button.vue +1 -1
- package/button/index.d.ts +2 -2
- package/button/index.mjs +7 -6
- package/button/index.mjs.map +1 -1
- package/carousel/Carousel.vue +2 -7
- package/carousel/index.mjs +2 -7
- package/carousel/index.mjs.map +1 -1
- package/carousel/style/index.mjs +1 -1
- package/carousel/style/index.mjs.map +1 -1
- package/cascadeselect/BaseCascadeSelect.vue +4 -0
- package/cascadeselect/CascadeSelect.vue +53 -10
- package/cascadeselect/CascadeSelectSub.vue +24 -27
- package/cascadeselect/index.d.ts +41 -1
- package/cascadeselect/index.mjs +114 -73
- package/cascadeselect/index.mjs.map +1 -1
- package/cascadeselect/style/index.mjs +13 -6
- package/cascadeselect/style/index.mjs.map +1 -1
- package/colorpicker/BaseColorPicker.vue +2 -1
- package/colorpicker/ColorPicker.vue +3 -3
- package/colorpicker/index.d.ts +6 -1
- package/colorpicker/index.mjs +11 -4
- package/colorpicker/index.mjs.map +1 -1
- package/config/index.d.ts +9 -3
- package/confirmationoptions/index.d.ts +12 -0
- package/confirmdialog/ConfirmDialog.vue +11 -1
- package/confirmdialog/index.d.ts +3 -7
- package/confirmdialog/index.mjs +12 -2
- package/confirmdialog/index.mjs.map +1 -1
- package/contextmenu/BaseContextMenu.vue +4 -0
- package/contextmenu/ContextMenu.vue +37 -10
- package/contextmenu/index.d.ts +10 -5
- package/contextmenu/index.mjs +57 -28
- package/contextmenu/index.mjs.map +1 -1
- package/contextmenu/style/index.mjs +10 -5
- package/contextmenu/style/index.mjs.map +1 -1
- package/datatable/BaseDataTable.vue +4 -0
- package/datatable/DataTable.vue +5 -10
- package/datatable/HeaderCheckbox.vue +1 -1
- package/datatable/TableBody.vue +1 -1
- package/datatable/TableHeader.vue +51 -51
- package/datatable/index.d.ts +5 -0
- package/datatable/index.mjs +90 -87
- package/datatable/index.mjs.map +1 -1
- package/datatable/style/index.mjs +1 -1
- package/datatable/style/index.mjs.map +1 -1
- package/datepicker/DatePicker.vue +13 -11
- package/datepicker/index.d.ts +2 -10
- package/datepicker/index.mjs +12 -10
- package/datepicker/index.mjs.map +1 -1
- package/datepicker/style/index.mjs +3 -3
- package/datepicker/style/index.mjs.map +1 -1
- package/dialog/Dialog.vue +4 -10
- package/dialog/index.mjs +3 -10
- package/dialog/index.mjs.map +1 -1
- package/drawer/index.d.ts +5 -1
- package/fieldset/index.d.ts +2 -6
- package/fileupload/index.d.ts +1 -1
- package/floatlabel/BaseFloatLabel.vue +6 -1
- package/floatlabel/index.d.ts +7 -2
- package/floatlabel/index.mjs +6 -1
- package/floatlabel/index.mjs.map +1 -1
- package/floatlabel/style/index.d.ts +2 -2
- package/floatlabel/style/index.mjs +10 -2
- package/floatlabel/style/index.mjs.map +1 -1
- package/focustrap/index.d.ts +1 -1
- package/galleria/index.d.ts +8 -8
- package/galleria/style/index.mjs +2 -2
- package/galleria/style/index.mjs.map +1 -1
- package/iftalabel/BaseIftaLabel.vue +16 -0
- package/iftalabel/IftaLabel.vue +15 -0
- package/iftalabel/index.d.ts +130 -0
- package/iftalabel/index.mjs +32 -0
- package/iftalabel/index.mjs.map +1 -0
- package/iftalabel/package.json +11 -0
- package/iftalabel/style/index.d.ts +19 -0
- package/iftalabel/style/index.mjs +17 -0
- package/iftalabel/style/index.mjs.map +1 -0
- package/iftalabel/style/package.json +6 -0
- package/imagecompare/BaseImageCompare.vue +30 -0
- package/imagecompare/ImageCompare.vue +24 -0
- package/imagecompare/index.d.ts +149 -0
- package/imagecompare/index.mjs +61 -0
- package/imagecompare/index.mjs.map +1 -0
- package/imagecompare/package.json +11 -0
- package/imagecompare/style/index.d.ts +23 -0
- package/imagecompare/style/index.mjs +18 -0
- package/imagecompare/style/index.mjs.map +1 -0
- package/imagecompare/style/package.json +6 -0
- package/inputgroup/BaseInputGroup.vue +0 -6
- package/inputgroup/InputGroup.vue +1 -10
- package/inputgroup/index.d.ts +0 -5
- package/inputgroup/index.mjs +1 -18
- package/inputgroup/index.mjs.map +1 -1
- package/inputgroup/style/index.mjs +2 -7
- package/inputgroup/style/index.mjs.map +1 -1
- package/inputmask/InputMask.vue +23 -17
- package/inputmask/index.mjs +21 -16
- package/inputmask/index.mjs.map +1 -1
- package/inputnumber/InputNumber.vue +2 -2
- package/inputnumber/index.d.ts +1 -1
- package/inputnumber/index.mjs +2 -2
- package/inputnumber/index.mjs.map +1 -1
- package/inputnumber/style/index.mjs +2 -2
- package/inputnumber/style/index.mjs.map +1 -1
- package/inputotp/BaseInputOtp.vue +1 -1
- package/inputotp/InputOtp.vue +6 -12
- package/inputotp/index.d.ts +2 -2
- package/inputotp/index.mjs +11 -12
- package/inputotp/index.mjs.map +1 -1
- package/inputotp/style/index.mjs +1 -1
- package/inputotp/style/index.mjs.map +1 -1
- package/inputtext/style/index.mjs +1 -1
- package/inputtext/style/index.mjs.map +1 -1
- package/keyfilter/index.d.ts +153 -0
- package/keyfilter/index.mjs +127 -0
- package/keyfilter/index.mjs.map +1 -0
- package/keyfilter/package.json +5 -0
- package/keyfilter/style/index.d.ts +14 -0
- package/keyfilter/style/index.mjs +8 -0
- package/keyfilter/style/index.mjs.map +1 -0
- package/keyfilter/style/package.json +6 -0
- package/megamenu/MegaMenu.vue +4 -4
- package/megamenu/index.d.ts +4 -0
- package/megamenu/index.mjs +2 -2
- package/megamenu/index.mjs.map +1 -1
- package/message/Message.vue +3 -19
- package/message/index.mjs +4 -20
- package/message/index.mjs.map +1 -1
- package/multiselect/BaseMultiSelect.vue +1 -5
- package/multiselect/MultiSelect.vue +16 -14
- package/multiselect/index.d.ts +2 -20
- package/multiselect/index.mjs +15 -17
- package/multiselect/index.mjs.map +1 -1
- package/multiselect/style/index.mjs +1 -1
- package/multiselect/style/index.mjs.map +1 -1
- package/orderlist/OrderList.vue +4 -8
- package/orderlist/index.d.ts +1 -5
- package/orderlist/index.mjs +3 -7
- package/orderlist/index.mjs.map +1 -1
- package/package.json +5 -5
- package/paginator/JumpToPageInput.vue +1 -1
- package/paginator/Paginator.vue +4 -16
- package/paginator/index.d.ts +1 -1
- package/paginator/index.mjs +4 -21
- package/paginator/index.mjs.map +1 -1
- package/paginator/style/index.d.ts +1 -1
- package/paginator/style/index.mjs +1 -1
- package/paginator/style/index.mjs.map +1 -1
- package/panelmenu/index.d.ts +1 -1
- package/password/BasePassword.vue +4 -0
- package/password/Password.vue +4 -3
- package/password/index.d.ts +6 -1
- package/password/index.mjs +10 -5
- package/password/index.mjs.map +1 -1
- package/password/style/index.mjs +1 -1
- package/password/style/index.mjs.map +1 -1
- package/picklist/PickList.vue +4 -8
- package/picklist/index.d.ts +1 -13
- package/picklist/index.mjs +3 -7
- package/picklist/index.mjs.map +1 -1
- package/popover/Popover.vue +4 -10
- package/popover/index.d.ts +1 -1
- package/popover/index.mjs +3 -9
- package/popover/index.mjs.map +1 -1
- package/progressspinner/index.d.ts +1 -1
- package/rating/style/index.mjs +1 -1
- package/rating/style/index.mjs.map +1 -1
- package/scrolltop/ScrollTop.vue +2 -9
- package/scrolltop/index.d.ts +1 -6
- package/scrolltop/index.mjs +3 -9
- package/scrolltop/index.mjs.map +1 -1
- package/select/Select.vue +13 -6
- package/select/index.mjs +54 -45
- package/select/index.mjs.map +1 -1
- package/select/style/index.mjs +1 -1
- package/select/style/index.mjs.map +1 -1
- package/speeddial/SpeedDial.vue +3 -1
- package/speeddial/index.d.ts +16 -1
- package/speeddial/index.mjs +10 -5
- package/speeddial/index.mjs.map +1 -1
- package/splitter/Splitter.vue +31 -25
- package/splitter/index.d.ts +8 -1
- package/splitter/index.mjs +28 -22
- package/splitter/index.mjs.map +1 -1
- package/tieredmenu/BaseTieredMenu.vue +4 -0
- package/tieredmenu/TieredMenu.vue +31 -4
- package/tieredmenu/TieredMenuSub.vue +3 -1
- package/tieredmenu/index.d.ts +5 -0
- package/tieredmenu/index.mjs +63 -34
- package/tieredmenu/index.mjs.map +1 -1
- package/tieredmenu/style/index.mjs +5 -4
- package/tieredmenu/style/index.mjs.map +1 -1
- package/toast/Toast.vue +2 -9
- package/toast/index.mjs +1 -8
- package/toast/index.mjs.map +1 -1
- package/toggleswitch/ToggleSwitch.vue +5 -1
- package/toggleswitch/index.d.ts +17 -1
- package/toggleswitch/index.mjs +7 -3
- package/toggleswitch/index.mjs.map +1 -1
- package/toggleswitch/style/index.d.ts +9 -1
- package/toggleswitch/style/index.mjs +3 -2
- package/toggleswitch/style/index.mjs.map +1 -1
- package/tooltip/index.mjs +6 -1
- package/tooltip/index.mjs.map +1 -1
- package/tree/BaseTree.vue +1 -1
- package/tree/Tree.vue +4 -2
- package/tree/TreeNode.vue +16 -4
- package/tree/index.d.ts +52 -3
- package/tree/index.mjs +23 -10
- package/tree/index.mjs.map +1 -1
- package/treeselect/BaseTreeSelect.vue +36 -0
- package/treeselect/TreeSelect.vue +31 -16
- package/treeselect/index.d.ts +73 -4
- package/treeselect/index.mjs +82 -25
- package/treeselect/index.mjs.map +1 -1
- package/treeselect/style/index.mjs +1 -1
- package/treeselect/style/index.mjs.map +1 -1
- package/treetable/BaseTreeTable.vue +8 -0
- package/treetable/TreeTable.vue +19 -11
- package/treetable/TreeTableRow.vue +28 -2
- package/treetable/index.d.ts +34 -0
- package/treetable/index.mjs +63 -19
- package/treetable/index.mjs.map +1 -1
- package/treetable/style/index.mjs +5 -3
- package/treetable/style/index.mjs.map +1 -1
- package/umd/primevue.min.js +1 -1
- package/vetur-attributes.json +3 -3
- package/virtualscroller/style/index.mjs +3 -1
- package/virtualscroller/style/index.mjs.map +1 -1
- package/web-types.json +4 -4
package/cascadeselect/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { focus, addStyle, relativePosition, getOuterWidth, absolutePosition, isTouchDevice, findSingle } from '@primeuix/utils/dom';
|
|
2
2
|
import { resolveFieldData, isNotEmpty, isString, isPrintableCharacter, isEmpty, findLastIndex, equals } from '@primeuix/utils/object';
|
|
3
3
|
import { ZIndex } from '@primeuix/utils/zindex';
|
|
4
4
|
import { UniqueComponentId, ConnectedOverlayScrollHandler } from '@primevue/core/utils';
|
|
@@ -10,7 +10,7 @@ import Portal from 'primevue/portal';
|
|
|
10
10
|
import BaseComponent from '@primevue/core/basecomponent';
|
|
11
11
|
import CascadeSelectStyle from 'primevue/cascadeselect/style';
|
|
12
12
|
import Ripple from 'primevue/ripple';
|
|
13
|
-
import { resolveComponent, resolveDirective, openBlock, createElementBlock, mergeProps, Fragment, renderList, withDirectives, createBlock, resolveDynamicComponent, toDisplayString,
|
|
13
|
+
import { resolveComponent, resolveDirective, openBlock, createElementBlock, mergeProps, Fragment, renderList, withDirectives, createBlock, resolveDynamicComponent, toDisplayString, normalizeClass, createCommentVNode, createElementVNode, renderSlot, createTextVNode, createVNode, withCtx, Transition } from 'vue';
|
|
14
14
|
|
|
15
15
|
var script$2 = {
|
|
16
16
|
name: 'BaseCascadeSelect',
|
|
@@ -24,6 +24,10 @@ var script$2 = {
|
|
|
24
24
|
optionGroupLabel: null,
|
|
25
25
|
optionGroupChildren: null,
|
|
26
26
|
placeholder: String,
|
|
27
|
+
breakpoint: {
|
|
28
|
+
type: String,
|
|
29
|
+
"default": '960px'
|
|
30
|
+
},
|
|
27
31
|
variant: {
|
|
28
32
|
type: String,
|
|
29
33
|
"default": null
|
|
@@ -160,7 +164,7 @@ var script$1 = {
|
|
|
160
164
|
name: 'CascadeSelectSub',
|
|
161
165
|
hostName: 'CascadeSelect',
|
|
162
166
|
"extends": BaseComponent,
|
|
163
|
-
emits: ['option-change', 'option-focus-change'],
|
|
167
|
+
emits: ['option-change', 'option-focus-change', 'option-focus-enter-change'],
|
|
164
168
|
container: null,
|
|
165
169
|
props: {
|
|
166
170
|
selectId: String,
|
|
@@ -177,25 +181,7 @@ var script$1 = {
|
|
|
177
181
|
},
|
|
178
182
|
activeOptionPath: Array,
|
|
179
183
|
level: Number,
|
|
180
|
-
templates: null
|
|
181
|
-
isParentMount: Boolean
|
|
182
|
-
},
|
|
183
|
-
data: function data() {
|
|
184
|
-
return {
|
|
185
|
-
mounted: false
|
|
186
|
-
};
|
|
187
|
-
},
|
|
188
|
-
watch: {
|
|
189
|
-
isParentMount: {
|
|
190
|
-
handler: function handler(newValue) {
|
|
191
|
-
newValue && nestedPosition(this.container, this.level);
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
},
|
|
195
|
-
mounted: function mounted() {
|
|
196
|
-
// entering order correction when an option is selected
|
|
197
|
-
(this.isParentMount || this.level === 0) && nestedPosition(this.container, this.level);
|
|
198
|
-
this.mounted = true;
|
|
184
|
+
templates: null
|
|
199
185
|
},
|
|
200
186
|
methods: {
|
|
201
187
|
getOptionId: function getOptionId(processedOption) {
|
|
@@ -253,6 +239,12 @@ var script$1 = {
|
|
|
253
239
|
isFocus: true
|
|
254
240
|
});
|
|
255
241
|
},
|
|
242
|
+
onOptionMouseEnter: function onOptionMouseEnter(event, processedOption) {
|
|
243
|
+
this.$emit('option-focus-enter-change', {
|
|
244
|
+
originalEvent: event,
|
|
245
|
+
processedOption: processedOption
|
|
246
|
+
});
|
|
247
|
+
},
|
|
256
248
|
onOptionMouseMove: function onOptionMouseMove(event, processedOption) {
|
|
257
249
|
this.$emit('option-focus-change', {
|
|
258
250
|
originalEvent: event,
|
|
@@ -265,6 +257,9 @@ var script$1 = {
|
|
|
265
257
|
onOptionFocusChange: function onOptionFocusChange(event) {
|
|
266
258
|
this.$emit('option-focus-change', event);
|
|
267
259
|
},
|
|
260
|
+
onOptionFocusEnterChange: function onOptionFocusEnterChange(event) {
|
|
261
|
+
this.$emit('option-focus-enter-change', event);
|
|
262
|
+
},
|
|
268
263
|
containerRef: function containerRef(el) {
|
|
269
264
|
this.container = el;
|
|
270
265
|
},
|
|
@@ -281,7 +276,7 @@ var script$1 = {
|
|
|
281
276
|
};
|
|
282
277
|
|
|
283
278
|
var _hoisted_1$1 = ["id", "aria-label", "aria-selected", "aria-expanded", "aria-level", "aria-setsize", "aria-posinset", "data-p-option-group", "data-p-active", "data-p-focus", "data-p-disabled"];
|
|
284
|
-
var _hoisted_2 = ["onClick", "onMousemove"];
|
|
279
|
+
var _hoisted_2 = ["onClick", "onMouseenter", "onMousemove"];
|
|
285
280
|
function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
286
281
|
var _component_AngleRightIcon = resolveComponent("AngleRightIcon");
|
|
287
282
|
var _component_CascadeSelectSub = resolveComponent("CascadeSelectSub", true);
|
|
@@ -314,6 +309,9 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
314
309
|
onClick: function onClick($event) {
|
|
315
310
|
return $options.onOptionClick($event, processedOption);
|
|
316
311
|
},
|
|
312
|
+
onMouseenter: function onMouseenter($event) {
|
|
313
|
+
return $options.onOptionMouseEnter($event, processedOption);
|
|
314
|
+
},
|
|
317
315
|
onMousemove: function onMousemove($event) {
|
|
318
316
|
return $options.onOptionMouseMove($event, processedOption);
|
|
319
317
|
},
|
|
@@ -326,12 +324,13 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
326
324
|
key: 1,
|
|
327
325
|
"class": _ctx.cx('optionText'),
|
|
328
326
|
ref_for: true
|
|
329
|
-
}, $options.getPTOptions(processedOption, index, 'optionText')), toDisplayString($options.getOptionLabelToRender(processedOption)), 17)), $options.isOptionGroup(processedOption) ? (openBlock(), createElementBlock(
|
|
330
|
-
key: 2
|
|
327
|
+
}, $options.getPTOptions(processedOption, index, 'optionText')), toDisplayString($options.getOptionLabelToRender(processedOption)), 17)), $options.isOptionGroup(processedOption) ? (openBlock(), createElementBlock("span", {
|
|
328
|
+
key: 2,
|
|
329
|
+
"class": normalizeClass(_ctx.cx('groupIconContainer'))
|
|
331
330
|
}, [$props.templates['optiongroupicon'] ? (openBlock(), createBlock(resolveDynamicComponent($props.templates['optiongroupicon']), {
|
|
332
331
|
key: 0,
|
|
333
|
-
"
|
|
334
|
-
})) : $props.optionGroupIcon ? (openBlock(), createElementBlock("span", mergeProps({
|
|
332
|
+
"class": normalizeClass(_ctx.cx('groupIcon'))
|
|
333
|
+
}, null, 8, ["class"])) : $props.optionGroupIcon ? (openBlock(), createElementBlock("span", mergeProps({
|
|
335
334
|
key: 1,
|
|
336
335
|
"class": [_ctx.cx('groupIcon'), $props.optionGroupIcon],
|
|
337
336
|
"aria-hidden": "true",
|
|
@@ -341,7 +340,7 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
341
340
|
"class": _ctx.cx('groupIcon'),
|
|
342
341
|
"aria-hidden": "true",
|
|
343
342
|
ref_for: true
|
|
344
|
-
}, $options.getPTOptions(processedOption, index, 'groupIcon')), null, 16, ["class"]))],
|
|
343
|
+
}, $options.getPTOptions(processedOption, index, 'groupIcon')), null, 16, ["class"]))], 2)) : createCommentVNode("", true)], 16, _hoisted_2)), [[_directive_ripple]]), $options.isOptionGroup(processedOption) && $options.isOptionActive(processedOption) ? (openBlock(), createBlock(_component_CascadeSelectSub, {
|
|
345
344
|
key: 0,
|
|
346
345
|
role: "group",
|
|
347
346
|
"class": normalizeClass(_ctx.cx('optionList')),
|
|
@@ -359,10 +358,10 @@ function render$1(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
359
358
|
optionGroupChildren: $props.optionGroupChildren,
|
|
360
359
|
onOptionChange: $options.onOptionChange,
|
|
361
360
|
onOptionFocusChange: $options.onOptionFocusChange,
|
|
361
|
+
onOptionFocusEnterChange: $options.onOptionFocusEnterChange,
|
|
362
362
|
pt: _ctx.pt,
|
|
363
|
-
unstyled: _ctx.unstyled
|
|
364
|
-
|
|
365
|
-
}, null, 8, ["class", "selectId", "focusedOptionId", "options", "activeOptionPath", "level", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "onOptionChange", "onOptionFocusChange", "pt", "unstyled", "isParentMount"])) : createCommentVNode("", true)], 16, _hoisted_1$1);
|
|
363
|
+
unstyled: _ctx.unstyled
|
|
364
|
+
}, null, 8, ["class", "selectId", "focusedOptionId", "options", "activeOptionPath", "level", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "onOptionChange", "onOptionFocusChange", "onOptionFocusEnterChange", "pt", "unstyled"])) : createCommentVNode("", true)], 16, _hoisted_1$1);
|
|
366
365
|
}), 128))], 16);
|
|
367
366
|
}
|
|
368
367
|
|
|
@@ -379,6 +378,7 @@ var script = {
|
|
|
379
378
|
}
|
|
380
379
|
},
|
|
381
380
|
outsideClickListener: null,
|
|
381
|
+
matchMediaListener: null,
|
|
382
382
|
scrollHandler: null,
|
|
383
383
|
resizeListener: null,
|
|
384
384
|
overlay: null,
|
|
@@ -396,7 +396,10 @@ var script = {
|
|
|
396
396
|
},
|
|
397
397
|
activeOptionPath: [],
|
|
398
398
|
overlayVisible: false,
|
|
399
|
-
dirty: false
|
|
399
|
+
dirty: false,
|
|
400
|
+
mobileActive: false,
|
|
401
|
+
query: null,
|
|
402
|
+
queryMatches: false
|
|
400
403
|
};
|
|
401
404
|
},
|
|
402
405
|
watch: {
|
|
@@ -410,10 +413,12 @@ var script = {
|
|
|
410
413
|
mounted: function mounted() {
|
|
411
414
|
this.id = this.id || UniqueComponentId();
|
|
412
415
|
this.autoUpdateModel();
|
|
416
|
+
this.bindMatchMediaListener();
|
|
413
417
|
},
|
|
414
418
|
beforeUnmount: function beforeUnmount() {
|
|
415
419
|
this.unbindOutsideClickListener();
|
|
416
420
|
this.unbindResizeListener();
|
|
421
|
+
this.unbindMatchMediaListener();
|
|
417
422
|
if (this.scrollHandler) {
|
|
418
423
|
this.scrollHandler.destroy();
|
|
419
424
|
this.scrollHandler = null;
|
|
@@ -422,6 +427,9 @@ var script = {
|
|
|
422
427
|
ZIndex.clear(this.overlay);
|
|
423
428
|
this.overlay = null;
|
|
424
429
|
}
|
|
430
|
+
if (this.mobileActive) {
|
|
431
|
+
this.mobileActive = false;
|
|
432
|
+
}
|
|
425
433
|
},
|
|
426
434
|
methods: {
|
|
427
435
|
getOptionLabel: function getOptionLabel(option) {
|
|
@@ -561,12 +569,14 @@ var script = {
|
|
|
561
569
|
this.clicked = false;
|
|
562
570
|
},
|
|
563
571
|
onOptionChange: function onOptionChange(event) {
|
|
572
|
+
var isSelectable = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
|
|
564
573
|
var originalEvent = event.originalEvent,
|
|
565
574
|
processedOption = event.processedOption,
|
|
566
575
|
isFocus = event.isFocus,
|
|
567
576
|
isHide = event.isHide;
|
|
568
577
|
if (isEmpty(processedOption)) return;
|
|
569
578
|
var index = processedOption.index,
|
|
579
|
+
key = processedOption.key,
|
|
570
580
|
level = processedOption.level,
|
|
571
581
|
parentKey = processedOption.parentKey,
|
|
572
582
|
children = processedOption.children;
|
|
@@ -574,14 +584,10 @@ var script = {
|
|
|
574
584
|
var root = isEmpty(processedOption.parent);
|
|
575
585
|
var selected = this.isSelected(processedOption);
|
|
576
586
|
if (selected) {
|
|
577
|
-
var _index = processedOption.index,
|
|
578
|
-
key = processedOption.key,
|
|
579
|
-
_level = processedOption.level,
|
|
580
|
-
_parentKey = processedOption.parentKey;
|
|
581
587
|
this.focusedOptionInfo = {
|
|
582
|
-
index:
|
|
583
|
-
level:
|
|
584
|
-
parentKey:
|
|
588
|
+
index: index,
|
|
589
|
+
level: level,
|
|
590
|
+
parentKey: parentKey
|
|
585
591
|
};
|
|
586
592
|
this.activeOptionPath = this.activeOptionPath.filter(function (p) {
|
|
587
593
|
return key !== p.key && key.startsWith(p.key);
|
|
@@ -589,7 +595,7 @@ var script = {
|
|
|
589
595
|
this.dirty = !root;
|
|
590
596
|
} else {
|
|
591
597
|
var activeOptionPath = this.activeOptionPath.filter(function (p) {
|
|
592
|
-
return p.parentKey !== parentKey;
|
|
598
|
+
return p.parentKey !== parentKey && p.parentKey !== key;
|
|
593
599
|
});
|
|
594
600
|
activeOptionPath.push(processedOption);
|
|
595
601
|
this.focusedOptionInfo = {
|
|
@@ -599,10 +605,15 @@ var script = {
|
|
|
599
605
|
};
|
|
600
606
|
this.activeOptionPath = activeOptionPath;
|
|
601
607
|
}
|
|
602
|
-
|
|
608
|
+
if (grouped) {
|
|
609
|
+
this.dirty = true;
|
|
610
|
+
this.onOptionGroupSelect(originalEvent, processedOption);
|
|
611
|
+
} else {
|
|
612
|
+
isSelectable && this.onOptionSelect(originalEvent, processedOption, isHide);
|
|
613
|
+
}
|
|
603
614
|
isFocus && focus(this.$refs.focusInput);
|
|
604
615
|
},
|
|
605
|
-
|
|
616
|
+
onOptionFocusMoveChange: function onOptionFocusMoveChange(event) {
|
|
606
617
|
if (this.focusOnHover) {
|
|
607
618
|
var originalEvent = event.originalEvent,
|
|
608
619
|
processedOption = event.processedOption;
|
|
@@ -617,6 +628,11 @@ var script = {
|
|
|
617
628
|
this.changeFocusedOptionIndex(originalEvent, index);
|
|
618
629
|
}
|
|
619
630
|
},
|
|
631
|
+
onOptionFocusChangeEnter: function onOptionFocusChangeEnter(event) {
|
|
632
|
+
if (this.dirty) {
|
|
633
|
+
this.onOptionChange(event, false);
|
|
634
|
+
}
|
|
635
|
+
},
|
|
620
636
|
onOptionSelect: function onOptionSelect(event, processedOption) {
|
|
621
637
|
var isHide = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : true;
|
|
622
638
|
var value = this.getOptionValue(processedOption === null || processedOption === void 0 ? void 0 : processedOption.option);
|
|
@@ -865,6 +881,25 @@ var script = {
|
|
|
865
881
|
this.resizeListener = null;
|
|
866
882
|
}
|
|
867
883
|
},
|
|
884
|
+
bindMatchMediaListener: function bindMatchMediaListener() {
|
|
885
|
+
var _this6 = this;
|
|
886
|
+
if (!this.matchMediaListener) {
|
|
887
|
+
var query = matchMedia("(max-width: ".concat(this.breakpoint, ")"));
|
|
888
|
+
this.query = query;
|
|
889
|
+
this.queryMatches = query.matches;
|
|
890
|
+
this.matchMediaListener = function () {
|
|
891
|
+
_this6.queryMatches = query.matches;
|
|
892
|
+
_this6.mobileActive = false;
|
|
893
|
+
};
|
|
894
|
+
this.query.addEventListener('change', this.matchMediaListener);
|
|
895
|
+
}
|
|
896
|
+
},
|
|
897
|
+
unbindMatchMediaListener: function unbindMatchMediaListener() {
|
|
898
|
+
if (this.matchMediaListener) {
|
|
899
|
+
this.query.removeEventListener('change', this.matchMediaListener);
|
|
900
|
+
this.matchMediaListener = null;
|
|
901
|
+
}
|
|
902
|
+
},
|
|
868
903
|
isOptionMatched: function isOptionMatched(processedOption) {
|
|
869
904
|
var _this$getProccessedOp;
|
|
870
905
|
return this.isValidOption(processedOption) && ((_this$getProccessedOp = this.getProccessedOptionLabel(processedOption)) === null || _this$getProccessedOp === void 0 ? void 0 : _this$getProccessedOp.toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale)));
|
|
@@ -881,35 +916,35 @@ var script = {
|
|
|
881
916
|
});
|
|
882
917
|
},
|
|
883
918
|
findFirstOptionIndex: function findFirstOptionIndex() {
|
|
884
|
-
var
|
|
919
|
+
var _this7 = this;
|
|
885
920
|
return this.visibleOptions.findIndex(function (processedOption) {
|
|
886
|
-
return
|
|
921
|
+
return _this7.isValidOption(processedOption);
|
|
887
922
|
});
|
|
888
923
|
},
|
|
889
924
|
findLastOptionIndex: function findLastOptionIndex() {
|
|
890
|
-
var
|
|
925
|
+
var _this8 = this;
|
|
891
926
|
return findLastIndex(this.visibleOptions, function (processedOption) {
|
|
892
|
-
return
|
|
927
|
+
return _this8.isValidOption(processedOption);
|
|
893
928
|
});
|
|
894
929
|
},
|
|
895
930
|
findNextOptionIndex: function findNextOptionIndex(index) {
|
|
896
|
-
var
|
|
931
|
+
var _this9 = this;
|
|
897
932
|
var matchedOptionIndex = index < this.visibleOptions.length - 1 ? this.visibleOptions.slice(index + 1).findIndex(function (processedOption) {
|
|
898
|
-
return
|
|
933
|
+
return _this9.isValidOption(processedOption);
|
|
899
934
|
}) : -1;
|
|
900
935
|
return matchedOptionIndex > -1 ? matchedOptionIndex + index + 1 : index;
|
|
901
936
|
},
|
|
902
937
|
findPrevOptionIndex: function findPrevOptionIndex(index) {
|
|
903
|
-
var
|
|
938
|
+
var _this10 = this;
|
|
904
939
|
var matchedOptionIndex = index > 0 ? findLastIndex(this.visibleOptions.slice(0, index), function (processedOption) {
|
|
905
|
-
return
|
|
940
|
+
return _this10.isValidOption(processedOption);
|
|
906
941
|
}) : -1;
|
|
907
942
|
return matchedOptionIndex > -1 ? matchedOptionIndex : index;
|
|
908
943
|
},
|
|
909
944
|
findSelectedOptionIndex: function findSelectedOptionIndex() {
|
|
910
|
-
var
|
|
945
|
+
var _this11 = this;
|
|
911
946
|
return this.visibleOptions.findIndex(function (processedOption) {
|
|
912
|
-
return
|
|
947
|
+
return _this11.isValidSelectedOption(processedOption);
|
|
913
948
|
});
|
|
914
949
|
},
|
|
915
950
|
findFirstFocusedOptionIndex: function findFirstFocusedOptionIndex() {
|
|
@@ -938,21 +973,21 @@ var script = {
|
|
|
938
973
|
}
|
|
939
974
|
},
|
|
940
975
|
searchOptions: function searchOptions(event, _char) {
|
|
941
|
-
var
|
|
976
|
+
var _this12 = this;
|
|
942
977
|
this.searchValue = (this.searchValue || '') + _char;
|
|
943
978
|
var optionIndex = -1;
|
|
944
979
|
var matched = false;
|
|
945
980
|
if (isNotEmpty(this.searchValue)) {
|
|
946
981
|
if (this.focusedOptionInfo.index !== -1) {
|
|
947
982
|
optionIndex = this.visibleOptions.slice(this.focusedOptionInfo.index).findIndex(function (processedOption) {
|
|
948
|
-
return
|
|
983
|
+
return _this12.isOptionMatched(processedOption);
|
|
949
984
|
});
|
|
950
985
|
optionIndex = optionIndex === -1 ? this.visibleOptions.slice(0, this.focusedOptionInfo.index).findIndex(function (processedOption) {
|
|
951
|
-
return
|
|
986
|
+
return _this12.isOptionMatched(processedOption);
|
|
952
987
|
}) : optionIndex + this.focusedOptionInfo.index;
|
|
953
988
|
} else {
|
|
954
989
|
optionIndex = this.visibleOptions.findIndex(function (processedOption) {
|
|
955
|
-
return
|
|
990
|
+
return _this12.isOptionMatched(processedOption);
|
|
956
991
|
});
|
|
957
992
|
}
|
|
958
993
|
if (optionIndex !== -1) {
|
|
@@ -969,8 +1004,8 @@ var script = {
|
|
|
969
1004
|
clearTimeout(this.searchTimeout);
|
|
970
1005
|
}
|
|
971
1006
|
this.searchTimeout = setTimeout(function () {
|
|
972
|
-
|
|
973
|
-
|
|
1007
|
+
_this12.searchValue = '';
|
|
1008
|
+
_this12.searchTimeout = null;
|
|
974
1009
|
}, 500);
|
|
975
1010
|
return matched;
|
|
976
1011
|
},
|
|
@@ -988,11 +1023,11 @@ var script = {
|
|
|
988
1023
|
}
|
|
989
1024
|
},
|
|
990
1025
|
scrollInView: function scrollInView() {
|
|
991
|
-
var
|
|
1026
|
+
var _this13 = this;
|
|
992
1027
|
var index = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : -1;
|
|
993
1028
|
this.$nextTick(function () {
|
|
994
|
-
var id = index !== -1 ? "".concat(
|
|
995
|
-
var element = findSingle(
|
|
1029
|
+
var id = index !== -1 ? "".concat(_this13.id, "_").concat(index) : _this13.focusedOptionId;
|
|
1030
|
+
var element = findSingle(_this13.list, "li[id=\"".concat(id, "\"]"));
|
|
996
1031
|
if (element) {
|
|
997
1032
|
element.scrollIntoView && element.scrollIntoView({
|
|
998
1033
|
block: 'nearest',
|
|
@@ -1023,7 +1058,7 @@ var script = {
|
|
|
1023
1058
|
});
|
|
1024
1059
|
},
|
|
1025
1060
|
createProcessedOptions: function createProcessedOptions(options) {
|
|
1026
|
-
var
|
|
1061
|
+
var _this14 = this;
|
|
1027
1062
|
var level = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1028
1063
|
var parent = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
1029
1064
|
var parentKey = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : '';
|
|
@@ -1038,7 +1073,7 @@ var script = {
|
|
|
1038
1073
|
parent: parent,
|
|
1039
1074
|
parentKey: parentKey
|
|
1040
1075
|
};
|
|
1041
|
-
newOption['children'] =
|
|
1076
|
+
newOption['children'] = _this14.createProcessedOptions(_this14.getOptionGroupChildren(option, level), level + 1, newOption, key);
|
|
1042
1077
|
processedOptions.push(newOption);
|
|
1043
1078
|
});
|
|
1044
1079
|
return processedOptions;
|
|
@@ -1064,9 +1099,9 @@ var script = {
|
|
|
1064
1099
|
return this.createProcessedOptions(this.options || []);
|
|
1065
1100
|
},
|
|
1066
1101
|
visibleOptions: function visibleOptions() {
|
|
1067
|
-
var
|
|
1102
|
+
var _this15 = this;
|
|
1068
1103
|
var processedOption = this.activeOptionPath.find(function (p) {
|
|
1069
|
-
return p.key ===
|
|
1104
|
+
return p.key === _this15.focusedOptionInfo.parentKey;
|
|
1070
1105
|
});
|
|
1071
1106
|
return processedOption ? processedOption.children : this.processedOptions;
|
|
1072
1107
|
},
|
|
@@ -1169,8 +1204,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1169
1204
|
})], 16), createElementVNode("div", mergeProps({
|
|
1170
1205
|
"class": _ctx.cx('dropdown'),
|
|
1171
1206
|
role: "button",
|
|
1172
|
-
tabindex: "-1"
|
|
1173
|
-
"aria-hidden": "true"
|
|
1207
|
+
tabindex: "-1"
|
|
1174
1208
|
}, _ctx.ptm('dropdown')), [_ctx.loading ? renderSlot(_ctx.$slots, "loadingicon", {
|
|
1175
1209
|
key: 0,
|
|
1176
1210
|
"class": normalizeClass(_ctx.cx('loadingIcon'))
|
|
@@ -1222,7 +1256,10 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1222
1256
|
onKeydown: _cache[4] || (_cache[4] = function () {
|
|
1223
1257
|
return $options.onOverlayKeyDown && $options.onOverlayKeyDown.apply($options, arguments);
|
|
1224
1258
|
})
|
|
1225
|
-
}, _objectSpread(_objectSpread(_objectSpread({}, _ctx.panelProps), _ctx.overlayProps), _ctx.ptm('overlay'))), [
|
|
1259
|
+
}, _objectSpread(_objectSpread(_objectSpread({}, _ctx.panelProps), _ctx.overlayProps), _ctx.ptm('overlay'))), [renderSlot(_ctx.$slots, "header", {
|
|
1260
|
+
value: _ctx.modelValue,
|
|
1261
|
+
options: _ctx.options
|
|
1262
|
+
}), createElementVNode("div", mergeProps({
|
|
1226
1263
|
"class": _ctx.cx('listContainer')
|
|
1227
1264
|
}, _ctx.ptm('listContainer')), [createVNode(_component_CascadeSelectSub, {
|
|
1228
1265
|
id: $data.id + '_tree',
|
|
@@ -1241,21 +1278,25 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1241
1278
|
optionGroupLabel: _ctx.optionGroupLabel,
|
|
1242
1279
|
optionGroupChildren: _ctx.optionGroupChildren,
|
|
1243
1280
|
onOptionChange: $options.onOptionChange,
|
|
1244
|
-
|
|
1281
|
+
onOptionFocusMoveChange: $options.onOptionFocusMoveChange,
|
|
1282
|
+
onOptionFocusEnterChange: $options.onOptionFocusChangeEnter,
|
|
1245
1283
|
pt: _ctx.pt,
|
|
1246
1284
|
unstyled: _ctx.unstyled
|
|
1247
|
-
}, null, 8, ["id", "selectId", "focusedOptionId", "options", "activeOptionPath", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "onOptionChange", "
|
|
1285
|
+
}, null, 8, ["id", "selectId", "focusedOptionId", "options", "activeOptionPath", "templates", "optionLabel", "optionValue", "optionDisabled", "optionGroupIcon", "optionGroupLabel", "optionGroupChildren", "onOptionChange", "onOptionFocusMoveChange", "onOptionFocusEnterChange", "pt", "unstyled"])], 16), createElementVNode("span", mergeProps({
|
|
1248
1286
|
role: "status",
|
|
1249
1287
|
"aria-live": "polite",
|
|
1250
1288
|
"class": "p-hidden-accessible"
|
|
1251
1289
|
}, _ctx.ptm('hiddenSelectedMessage'), {
|
|
1252
1290
|
"data-p-hidden-accessible": true
|
|
1253
|
-
}), toDisplayString($options.selectedMessageText), 17)
|
|
1291
|
+
}), toDisplayString($options.selectedMessageText), 17), renderSlot(_ctx.$slots, "footer", {
|
|
1292
|
+
value: _ctx.modelValue,
|
|
1293
|
+
options: _ctx.options
|
|
1294
|
+
})], 16)) : createCommentVNode("", true)];
|
|
1254
1295
|
}),
|
|
1255
|
-
_:
|
|
1296
|
+
_: 3
|
|
1256
1297
|
}, 16, ["onEnter", "onAfterEnter", "onLeave", "onAfterLeave"])];
|
|
1257
1298
|
}),
|
|
1258
|
-
_:
|
|
1299
|
+
_: 3
|
|
1259
1300
|
}, 8, ["appendTo"])], 16);
|
|
1260
1301
|
}
|
|
1261
1302
|
|