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
|
@@ -30,7 +30,7 @@
|
|
|
30
30
|
{{ label }}
|
|
31
31
|
</slot>
|
|
32
32
|
</span>
|
|
33
|
-
<div :class="cx('dropdown')" role="button" tabindex="-1"
|
|
33
|
+
<div :class="cx('dropdown')" role="button" tabindex="-1" v-bind="ptm('dropdown')">
|
|
34
34
|
<slot v-if="loading" name="loadingicon" :class="cx('loadingIcon')">
|
|
35
35
|
<span v-if="loadingIcon" :class="[cx('loadingIcon'), 'pi-spin', loadingIcon]" aria-hidden="true" v-bind="ptm('loadingIcon')" />
|
|
36
36
|
<SpinnerIcon v-else :class="cx('loadingIcon')" spin aria-hidden="true" v-bind="ptm('loadingIcon')" />
|
|
@@ -53,6 +53,7 @@
|
|
|
53
53
|
@keydown="onOverlayKeyDown"
|
|
54
54
|
v-bind="{ ...panelProps, ...overlayProps, ...ptm('overlay') }"
|
|
55
55
|
>
|
|
56
|
+
<slot name="header" :value="modelValue" :options="options" />
|
|
56
57
|
<div :class="cx('listContainer')" v-bind="ptm('listContainer')">
|
|
57
58
|
<CascadeSelectSub
|
|
58
59
|
:id="id + '_tree'"
|
|
@@ -71,7 +72,8 @@
|
|
|
71
72
|
:optionGroupLabel="optionGroupLabel"
|
|
72
73
|
:optionGroupChildren="optionGroupChildren"
|
|
73
74
|
@option-change="onOptionChange"
|
|
74
|
-
@option-focus-change="
|
|
75
|
+
@option-focus-move-change="onOptionFocusMoveChange"
|
|
76
|
+
@option-focus-enter-change="onOptionFocusChangeEnter"
|
|
75
77
|
:pt="pt"
|
|
76
78
|
:unstyled="unstyled"
|
|
77
79
|
/>
|
|
@@ -79,6 +81,7 @@
|
|
|
79
81
|
<span role="status" aria-live="polite" class="p-hidden-accessible" v-bind="ptm('hiddenSelectedMessage')" :data-p-hidden-accessible="true">
|
|
80
82
|
{{ selectedMessageText }}
|
|
81
83
|
</span>
|
|
84
|
+
<slot name="footer" :value="modelValue" :options="options" />
|
|
82
85
|
</div>
|
|
83
86
|
</transition>
|
|
84
87
|
</Portal>
|
|
@@ -107,6 +110,7 @@ export default {
|
|
|
107
110
|
$pcFluid: { default: null }
|
|
108
111
|
},
|
|
109
112
|
outsideClickListener: null,
|
|
113
|
+
matchMediaListener: null,
|
|
110
114
|
scrollHandler: null,
|
|
111
115
|
resizeListener: null,
|
|
112
116
|
overlay: null,
|
|
@@ -120,7 +124,10 @@ export default {
|
|
|
120
124
|
focusedOptionInfo: { index: -1, level: 0, parentKey: '' },
|
|
121
125
|
activeOptionPath: [],
|
|
122
126
|
overlayVisible: false,
|
|
123
|
-
dirty: false
|
|
127
|
+
dirty: false,
|
|
128
|
+
mobileActive: false,
|
|
129
|
+
query: null,
|
|
130
|
+
queryMatches: false
|
|
124
131
|
};
|
|
125
132
|
},
|
|
126
133
|
watch: {
|
|
@@ -134,10 +141,12 @@ export default {
|
|
|
134
141
|
mounted() {
|
|
135
142
|
this.id = this.id || UniqueComponentId();
|
|
136
143
|
this.autoUpdateModel();
|
|
144
|
+
this.bindMatchMediaListener();
|
|
137
145
|
},
|
|
138
146
|
beforeUnmount() {
|
|
139
147
|
this.unbindOutsideClickListener();
|
|
140
148
|
this.unbindResizeListener();
|
|
149
|
+
this.unbindMatchMediaListener();
|
|
141
150
|
|
|
142
151
|
if (this.scrollHandler) {
|
|
143
152
|
this.scrollHandler.destroy();
|
|
@@ -148,6 +157,10 @@ export default {
|
|
|
148
157
|
ZIndex.clear(this.overlay);
|
|
149
158
|
this.overlay = null;
|
|
150
159
|
}
|
|
160
|
+
|
|
161
|
+
if (this.mobileActive) {
|
|
162
|
+
this.mobileActive = false;
|
|
163
|
+
}
|
|
151
164
|
},
|
|
152
165
|
methods: {
|
|
153
166
|
getOptionLabel(option) {
|
|
@@ -291,25 +304,23 @@ export default {
|
|
|
291
304
|
|
|
292
305
|
this.clicked = false;
|
|
293
306
|
},
|
|
294
|
-
onOptionChange(event) {
|
|
307
|
+
onOptionChange(event, isSelectable = true) {
|
|
295
308
|
const { originalEvent, processedOption, isFocus, isHide } = event;
|
|
296
309
|
|
|
297
310
|
if (isEmpty(processedOption)) return;
|
|
298
311
|
|
|
299
|
-
const { index, level, parentKey, children } = processedOption;
|
|
312
|
+
const { index, key, level, parentKey, children } = processedOption;
|
|
300
313
|
const grouped = isNotEmpty(children);
|
|
301
314
|
const root = isEmpty(processedOption.parent);
|
|
302
315
|
const selected = this.isSelected(processedOption);
|
|
303
316
|
|
|
304
317
|
if (selected) {
|
|
305
|
-
const { index, key, level, parentKey } = processedOption;
|
|
306
|
-
|
|
307
318
|
this.focusedOptionInfo = { index, level, parentKey };
|
|
308
319
|
this.activeOptionPath = this.activeOptionPath.filter((p) => key !== p.key && key.startsWith(p.key));
|
|
309
320
|
|
|
310
321
|
this.dirty = !root;
|
|
311
322
|
} else {
|
|
312
|
-
const activeOptionPath = this.activeOptionPath.filter((p) => p.parentKey !== parentKey);
|
|
323
|
+
const activeOptionPath = this.activeOptionPath.filter((p) => p.parentKey !== parentKey && p.parentKey !== key);
|
|
313
324
|
|
|
314
325
|
activeOptionPath.push(processedOption);
|
|
315
326
|
|
|
@@ -317,10 +328,16 @@ export default {
|
|
|
317
328
|
this.activeOptionPath = activeOptionPath;
|
|
318
329
|
}
|
|
319
330
|
|
|
320
|
-
|
|
331
|
+
if (grouped) {
|
|
332
|
+
this.dirty = true;
|
|
333
|
+
this.onOptionGroupSelect(originalEvent, processedOption);
|
|
334
|
+
} else {
|
|
335
|
+
isSelectable && this.onOptionSelect(originalEvent, processedOption, isHide);
|
|
336
|
+
}
|
|
337
|
+
|
|
321
338
|
isFocus && focus(this.$refs.focusInput);
|
|
322
339
|
},
|
|
323
|
-
|
|
340
|
+
onOptionFocusMoveChange(event) {
|
|
324
341
|
if (this.focusOnHover) {
|
|
325
342
|
const { originalEvent, processedOption } = event;
|
|
326
343
|
const { index, level, parentKey } = processedOption;
|
|
@@ -329,6 +346,11 @@ export default {
|
|
|
329
346
|
this.changeFocusedOptionIndex(originalEvent, index);
|
|
330
347
|
}
|
|
331
348
|
},
|
|
349
|
+
onOptionFocusChangeEnter(event) {
|
|
350
|
+
if (this.dirty) {
|
|
351
|
+
this.onOptionChange(event, false);
|
|
352
|
+
}
|
|
353
|
+
},
|
|
332
354
|
onOptionSelect(event, processedOption, isHide = true) {
|
|
333
355
|
const value = this.getOptionValue(processedOption?.option);
|
|
334
356
|
|
|
@@ -569,6 +591,27 @@ export default {
|
|
|
569
591
|
this.resizeListener = null;
|
|
570
592
|
}
|
|
571
593
|
},
|
|
594
|
+
bindMatchMediaListener() {
|
|
595
|
+
if (!this.matchMediaListener) {
|
|
596
|
+
const query = matchMedia(`(max-width: ${this.breakpoint})`);
|
|
597
|
+
|
|
598
|
+
this.query = query;
|
|
599
|
+
this.queryMatches = query.matches;
|
|
600
|
+
|
|
601
|
+
this.matchMediaListener = () => {
|
|
602
|
+
this.queryMatches = query.matches;
|
|
603
|
+
this.mobileActive = false;
|
|
604
|
+
};
|
|
605
|
+
|
|
606
|
+
this.query.addEventListener('change', this.matchMediaListener);
|
|
607
|
+
}
|
|
608
|
+
},
|
|
609
|
+
unbindMatchMediaListener() {
|
|
610
|
+
if (this.matchMediaListener) {
|
|
611
|
+
this.query.removeEventListener('change', this.matchMediaListener);
|
|
612
|
+
this.matchMediaListener = null;
|
|
613
|
+
}
|
|
614
|
+
},
|
|
572
615
|
isOptionMatched(processedOption) {
|
|
573
616
|
return this.isValidOption(processedOption) && this.getProccessedOptionLabel(processedOption)?.toLocaleLowerCase(this.searchLocale).startsWith(this.searchValue.toLocaleLowerCase(this.searchLocale));
|
|
574
617
|
},
|
|
@@ -17,13 +17,22 @@
|
|
|
17
17
|
:data-p-focus="isOptionFocused(processedOption)"
|
|
18
18
|
:data-p-disabled="isOptionDisabled(processedOption)"
|
|
19
19
|
>
|
|
20
|
-
<div
|
|
20
|
+
<div
|
|
21
|
+
v-ripple
|
|
22
|
+
:class="cx('optionContent')"
|
|
23
|
+
@click="onOptionClick($event, processedOption)"
|
|
24
|
+
@mouseenter="onOptionMouseEnter($event, processedOption)"
|
|
25
|
+
@mousemove="onOptionMouseMove($event, processedOption)"
|
|
26
|
+
v-bind="getPTOptions(processedOption, index, 'optionContent')"
|
|
27
|
+
>
|
|
21
28
|
<component v-if="templates['option']" :is="templates['option']" :option="processedOption.option" :selected="isOptionGroup(processedOption) ? false : isOptionSelected(processedOption)" />
|
|
22
29
|
<span v-else :class="cx('optionText')" v-bind="getPTOptions(processedOption, index, 'optionText')">{{ getOptionLabelToRender(processedOption) }}</span>
|
|
23
30
|
<template v-if="isOptionGroup(processedOption)">
|
|
24
|
-
<
|
|
25
|
-
|
|
26
|
-
|
|
31
|
+
<span :class="cx('groupIconContainer')">
|
|
32
|
+
<component v-if="templates['optiongroupicon']" :is="templates['optiongroupicon']" :class="cx('groupIcon')" />
|
|
33
|
+
<span v-else-if="optionGroupIcon" :class="[cx('groupIcon'), optionGroupIcon]" aria-hidden="true" v-bind="getPTOptions(processedOption, index, 'groupIcon')" />
|
|
34
|
+
<AngleRightIcon v-else :class="cx('groupIcon')" aria-hidden="true" v-bind="getPTOptions(processedOption, index, 'groupIcon')" />
|
|
35
|
+
</span>
|
|
27
36
|
</template>
|
|
28
37
|
</div>
|
|
29
38
|
<CascadeSelectSub
|
|
@@ -44,9 +53,9 @@
|
|
|
44
53
|
:optionGroupChildren="optionGroupChildren"
|
|
45
54
|
@option-change="onOptionChange"
|
|
46
55
|
@option-focus-change="onOptionFocusChange"
|
|
56
|
+
@option-focus-enter-change="onOptionFocusEnterChange"
|
|
47
57
|
:pt="pt"
|
|
48
58
|
:unstyled="unstyled"
|
|
49
|
-
:isParentMount="mounted"
|
|
50
59
|
/>
|
|
51
60
|
</li>
|
|
52
61
|
</template>
|
|
@@ -54,9 +63,8 @@
|
|
|
54
63
|
</template>
|
|
55
64
|
|
|
56
65
|
<script>
|
|
66
|
+
import { isNotEmpty, resolveFieldData } from '@primeuix/utils/object';
|
|
57
67
|
import BaseComponent from '@primevue/core/basecomponent';
|
|
58
|
-
import { nestedPosition } from '@primeuix/utils/dom';
|
|
59
|
-
import { resolveFieldData, isNotEmpty } from '@primeuix/utils/object';
|
|
60
68
|
import AngleRightIcon from '@primevue/icons/angleright';
|
|
61
69
|
import Ripple from 'primevue/ripple';
|
|
62
70
|
|
|
@@ -64,7 +72,7 @@ export default {
|
|
|
64
72
|
name: 'CascadeSelectSub',
|
|
65
73
|
hostName: 'CascadeSelect',
|
|
66
74
|
extends: BaseComponent,
|
|
67
|
-
emits: ['option-change', 'option-focus-change'],
|
|
75
|
+
emits: ['option-change', 'option-focus-change', 'option-focus-enter-change'],
|
|
68
76
|
container: null,
|
|
69
77
|
props: {
|
|
70
78
|
selectId: String,
|
|
@@ -81,26 +89,9 @@ export default {
|
|
|
81
89
|
},
|
|
82
90
|
activeOptionPath: Array,
|
|
83
91
|
level: Number,
|
|
84
|
-
templates: null
|
|
85
|
-
isParentMount: Boolean
|
|
86
|
-
},
|
|
87
|
-
data() {
|
|
88
|
-
return {
|
|
89
|
-
mounted: false
|
|
90
|
-
};
|
|
91
|
-
},
|
|
92
|
-
watch: {
|
|
93
|
-
isParentMount: {
|
|
94
|
-
handler(newValue) {
|
|
95
|
-
newValue && nestedPosition(this.container, this.level);
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
},
|
|
99
|
-
mounted() {
|
|
100
|
-
// entering order correction when an option is selected
|
|
101
|
-
(this.isParentMount || this.level === 0) && nestedPosition(this.container, this.level);
|
|
102
|
-
this.mounted = true;
|
|
92
|
+
templates: null
|
|
103
93
|
},
|
|
94
|
+
|
|
104
95
|
methods: {
|
|
105
96
|
getOptionId(processedOption) {
|
|
106
97
|
return `${this.selectId}_${processedOption.key}`;
|
|
@@ -151,6 +142,9 @@ export default {
|
|
|
151
142
|
onOptionClick(event, processedOption) {
|
|
152
143
|
this.$emit('option-change', { originalEvent: event, processedOption, isFocus: true });
|
|
153
144
|
},
|
|
145
|
+
onOptionMouseEnter(event, processedOption) {
|
|
146
|
+
this.$emit('option-focus-enter-change', { originalEvent: event, processedOption });
|
|
147
|
+
},
|
|
154
148
|
onOptionMouseMove(event, processedOption) {
|
|
155
149
|
this.$emit('option-focus-change', { originalEvent: event, processedOption });
|
|
156
150
|
},
|
|
@@ -160,6 +154,9 @@ export default {
|
|
|
160
154
|
onOptionFocusChange(event) {
|
|
161
155
|
this.$emit('option-focus-change', event);
|
|
162
156
|
},
|
|
157
|
+
onOptionFocusEnterChange(event) {
|
|
158
|
+
this.$emit('option-focus-enter-change', event);
|
|
159
|
+
},
|
|
163
160
|
containerRef(el) {
|
|
164
161
|
this.container = el;
|
|
165
162
|
},
|
package/cascadeselect/index.d.ts
CHANGED
|
@@ -128,6 +128,10 @@ export interface CascadeSelectPassThroughOptions {
|
|
|
128
128
|
* Used to pass attributes to the option list's DOM element.
|
|
129
129
|
*/
|
|
130
130
|
optionList?: CascadeSelectPassThroughOptionType;
|
|
131
|
+
/**
|
|
132
|
+
* Used to pass attributes to the group icon container's DOM element.
|
|
133
|
+
*/
|
|
134
|
+
groupIconContainer?: CascadeSelectPassThroughOptionType;
|
|
131
135
|
/**
|
|
132
136
|
* Used to pass attributes to the group icon's DOM element.
|
|
133
137
|
*/
|
|
@@ -287,6 +291,11 @@ export interface CascadeSelectProps {
|
|
|
287
291
|
* Default text to display when no option is selected.
|
|
288
292
|
*/
|
|
289
293
|
placeholder?: string | undefined;
|
|
294
|
+
/**
|
|
295
|
+
* The breakpoint to define the maximum width boundary.
|
|
296
|
+
* @defaultValue 960px
|
|
297
|
+
*/
|
|
298
|
+
breakpoint?: string | undefined;
|
|
290
299
|
/**
|
|
291
300
|
* When present, it specifies that the component should have invalid state style.
|
|
292
301
|
* @defaultValue false
|
|
@@ -496,7 +505,38 @@ export interface CascadeSelectSlots {
|
|
|
496
505
|
/**
|
|
497
506
|
* Custom option group icon template.
|
|
498
507
|
*/
|
|
499
|
-
optiongroupicon(
|
|
508
|
+
optiongroupicon(scope: {
|
|
509
|
+
/**
|
|
510
|
+
* Style class of the icon.
|
|
511
|
+
*/
|
|
512
|
+
class: string;
|
|
513
|
+
}): VNode[];
|
|
514
|
+
/**
|
|
515
|
+
* Custom header template.
|
|
516
|
+
*/
|
|
517
|
+
header(scope: {
|
|
518
|
+
/**
|
|
519
|
+
* Current value
|
|
520
|
+
*/
|
|
521
|
+
value: any;
|
|
522
|
+
/**
|
|
523
|
+
* Options of the component
|
|
524
|
+
*/
|
|
525
|
+
options: any[];
|
|
526
|
+
}): VNode[];
|
|
527
|
+
/**
|
|
528
|
+
* Custom footer template.
|
|
529
|
+
*/
|
|
530
|
+
footer(scope: {
|
|
531
|
+
/**
|
|
532
|
+
* Current value
|
|
533
|
+
*/
|
|
534
|
+
value: any;
|
|
535
|
+
/**
|
|
536
|
+
* Options of the component
|
|
537
|
+
*/
|
|
538
|
+
options: any[];
|
|
539
|
+
}): VNode[];
|
|
500
540
|
}
|
|
501
541
|
|
|
502
542
|
/**
|