primevue 4.3.9 → 4.4.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 +18 -3
- package/autocomplete/BaseAutoComplete.vue +4 -0
- package/autocomplete/index.d.ts +20 -0
- package/autocomplete/index.mjs +34 -7
- package/autocomplete/index.mjs.map +1 -1
- package/autocomplete/style/index.d.ts +4 -0
- package/autocomplete/style/index.mjs +3 -1
- package/autocomplete/style/index.mjs.map +1 -1
- package/checkbox/Checkbox.vue +15 -2
- package/checkbox/index.mjs +14 -2
- package/checkbox/index.mjs.map +1 -1
- package/colorpicker/ColorPicker.vue +3 -4
- package/colorpicker/index.mjs +3 -3
- package/colorpicker/index.mjs.map +1 -1
- package/confirmdialog/ConfirmDialog.vue +1 -1
- package/confirmdialog/index.d.ts +5 -0
- package/confirmdialog/index.mjs +3 -2
- package/confirmdialog/index.mjs.map +1 -1
- package/datatable/DataTable.vue +2 -2
- package/datatable/HeaderCheckbox.vue +3 -3
- package/datatable/index.mjs +12 -3
- package/datatable/index.mjs.map +1 -1
- package/datepicker/BaseDatePicker.vue +8 -0
- package/datepicker/DatePicker.vue +199 -81
- package/datepicker/index.d.ts +25 -0
- package/datepicker/index.mjs +258 -150
- package/datepicker/index.mjs.map +1 -1
- package/datepicker/style/index.d.ts +4 -0
- package/datepicker/style/index.mjs +5 -2
- package/datepicker/style/index.mjs.map +1 -1
- package/drawer/BaseDrawer.vue +4 -0
- package/drawer/Drawer.vue +4 -4
- package/drawer/index.d.ts +5 -0
- package/drawer/index.mjs +8 -4
- package/drawer/index.mjs.map +1 -1
- package/editor/Editor.vue +5 -1
- package/editor/index.mjs +5 -0
- package/editor/index.mjs.map +1 -1
- package/image/index.d.ts +5 -11
- package/inputmask/InputMask.vue +1 -2
- package/inputmask/index.mjs +1 -1
- package/inputmask/index.mjs.map +1 -1
- package/inputnumber/BaseInputNumber.vue +4 -0
- package/inputnumber/InputNumber.vue +30 -5
- package/inputnumber/index.d.ts +20 -0
- package/inputnumber/index.mjs +45 -7
- package/inputnumber/index.mjs.map +1 -1
- package/inputnumber/style/index.mjs +1 -0
- package/inputnumber/style/index.mjs.map +1 -1
- package/inputotp/InputOtp.vue +7 -3
- package/inputotp/index.mjs +6 -3
- package/inputotp/index.mjs.map +1 -1
- package/listbox/Listbox.vue +1 -1
- package/listbox/index.mjs +1 -1
- package/listbox/index.mjs.map +1 -1
- package/multiselect/MultiSelect.vue +9 -5
- package/multiselect/index.mjs +14 -10
- package/multiselect/index.mjs.map +1 -1
- package/package.json +5 -5
- package/panel/Panel.vue +1 -1
- package/panel/index.d.ts +4 -0
- package/panel/index.mjs +2 -1
- package/panel/index.mjs.map +1 -1
- package/password/BasePassword.vue +4 -0
- package/password/Password.vue +12 -1
- package/password/index.d.ts +20 -0
- package/password/index.mjs +23 -1
- package/password/index.mjs.map +1 -1
- package/password/style/index.d.ts +4 -0
- package/password/style/index.mjs +1 -0
- package/password/style/index.mjs.map +1 -1
- package/select/Select.vue +1 -0
- package/select/index.mjs +1 -0
- package/select/index.mjs.map +1 -1
- package/tree/BaseTree.vue +16 -0
- package/tree/Tree.vue +179 -4
- package/tree/TreeNode.vue +225 -3
- package/tree/index.d.ts +65 -0
- package/tree/index.mjs +499 -22
- package/tree/index.mjs.map +1 -1
- package/tree/style/index.mjs +9 -4
- package/tree/style/index.mjs.map +1 -1
- package/treenode/index.d.ts +12 -0
- package/treeselect/TreeSelect.vue +1 -1
- package/treeselect/index.mjs +1 -1
- package/treeselect/index.mjs.map +1 -1
- package/umd/primevue.min.js +1 -1
- package/web-types.json +1 -1
|
@@ -34,6 +34,9 @@
|
|
|
34
34
|
:data-p-has-dropdown="dropdown"
|
|
35
35
|
:pt="ptm('pcInputText')"
|
|
36
36
|
/>
|
|
37
|
+
<slot v-if="isClearIconVisible" name="clearicon" :class="cx('clearIcon')" :clearCallback="onClearClick">
|
|
38
|
+
<TimesIcon :class="[cx('clearIcon')]" @click="onClearClick" v-bind="ptm('clearIcon')" />
|
|
39
|
+
</slot>
|
|
37
40
|
<ul
|
|
38
41
|
v-if="multiple"
|
|
39
42
|
ref="multiContainer"
|
|
@@ -110,7 +113,7 @@
|
|
|
110
113
|
</ul>
|
|
111
114
|
<slot v-if="searching || loading" :class="cx('loader')" :name="$slots.loader ? 'loader' : 'loadingicon'">
|
|
112
115
|
<i v-if="loader || loadingIcon" :class="['pi-spin', cx('loader'), loader, loadingIcon]" aria-hidden="true" :data-p-has-dropdown="dropdown" v-bind="ptm('loader')" />
|
|
113
|
-
<SpinnerIcon v-else :class="cx('loader')" spin aria-hidden="true" :data-p-has-dropdown="dropdown" v-bind="ptm('loader')" />
|
|
116
|
+
<SpinnerIcon v-else-if="loading" :class="cx('loader')" spin aria-hidden="true" :data-p-has-dropdown="dropdown" v-bind="ptm('loader')" />
|
|
114
117
|
</slot>
|
|
115
118
|
<slot :name="$slots.dropdown ? 'dropdown' : 'dropdownbutton'" :toggleCallback="(event) => onDropdownClick(event)">
|
|
116
119
|
<button
|
|
@@ -212,6 +215,7 @@ import { ZIndex } from '@primeuix/utils/zindex';
|
|
|
212
215
|
import { ConnectedOverlayScrollHandler } from '@primevue/core/utils';
|
|
213
216
|
import ChevronDownIcon from '@primevue/icons/chevrondown';
|
|
214
217
|
import SpinnerIcon from '@primevue/icons/spinner';
|
|
218
|
+
import TimesIcon from '@primevue/icons/times';
|
|
215
219
|
import Chip from 'primevue/chip';
|
|
216
220
|
import InputText from 'primevue/inputtext';
|
|
217
221
|
import OverlayEventBus from 'primevue/overlayeventbus';
|
|
@@ -453,6 +457,7 @@ export default {
|
|
|
453
457
|
}
|
|
454
458
|
|
|
455
459
|
if (query.length === 0) {
|
|
460
|
+
this.searching = false;
|
|
456
461
|
this.hide();
|
|
457
462
|
this.$emit('clear');
|
|
458
463
|
} else {
|
|
@@ -463,6 +468,7 @@ export default {
|
|
|
463
468
|
this.search(event, query, 'input');
|
|
464
469
|
}, this.delay);
|
|
465
470
|
} else {
|
|
471
|
+
this.searching = false;
|
|
466
472
|
this.hide();
|
|
467
473
|
}
|
|
468
474
|
}
|
|
@@ -592,11 +598,15 @@ export default {
|
|
|
592
598
|
const value = this.visibleOptions
|
|
593
599
|
.slice(rangeStart, rangeEnd + 1)
|
|
594
600
|
.filter((option) => this.isValidOption(option))
|
|
601
|
+
.filter((option) => !this.isSelected(option))
|
|
595
602
|
.map((option) => this.getOptionValue(option));
|
|
596
603
|
|
|
597
|
-
this.updateModel(event, value);
|
|
604
|
+
this.updateModel(event, [...(this.d_value || []), ...value]);
|
|
598
605
|
}
|
|
599
606
|
},
|
|
607
|
+
onClearClick(event) {
|
|
608
|
+
this.updateModel(event, null);
|
|
609
|
+
},
|
|
600
610
|
onOverlayClick(event) {
|
|
601
611
|
OverlayEventBus.emit('overlay-click', {
|
|
602
612
|
originalEvent: event,
|
|
@@ -941,6 +951,7 @@ export default {
|
|
|
941
951
|
}
|
|
942
952
|
|
|
943
953
|
this.searching = true;
|
|
954
|
+
this.show();
|
|
944
955
|
this.$emit('complete', { originalEvent: event, query });
|
|
945
956
|
},
|
|
946
957
|
removeOption(event, index) {
|
|
@@ -1084,6 +1095,9 @@ export default {
|
|
|
1084
1095
|
focusedMultipleOptionId() {
|
|
1085
1096
|
return this.focusedMultipleOptionIndex !== -1 ? `${this.$id}_multiple_option_${this.focusedMultipleOptionIndex}` : null;
|
|
1086
1097
|
},
|
|
1098
|
+
isClearIconVisible() {
|
|
1099
|
+
return this.showClear && this.$filled && !this.disabled && !this.loading;
|
|
1100
|
+
},
|
|
1087
1101
|
ariaSetSize() {
|
|
1088
1102
|
return this.visibleOptions.filter((option) => !this.isOptionGroup(option)).length;
|
|
1089
1103
|
},
|
|
@@ -1119,9 +1133,10 @@ export default {
|
|
|
1119
1133
|
InputText,
|
|
1120
1134
|
VirtualScroller,
|
|
1121
1135
|
Portal,
|
|
1136
|
+
Chip,
|
|
1122
1137
|
ChevronDownIcon,
|
|
1123
1138
|
SpinnerIcon,
|
|
1124
|
-
|
|
1139
|
+
TimesIcon
|
|
1125
1140
|
},
|
|
1126
1141
|
directives: {
|
|
1127
1142
|
ripple: Ripple
|
package/autocomplete/index.d.ts
CHANGED
|
@@ -177,6 +177,10 @@ export interface AutoCompletePassThroughOptions {
|
|
|
177
177
|
* Used to pass attributes to the loader's DOM element.
|
|
178
178
|
*/
|
|
179
179
|
loader?: AutoCompletePassThroughOptionType;
|
|
180
|
+
/**
|
|
181
|
+
* Used to pass attributes to the clear icon's DOM element.
|
|
182
|
+
*/
|
|
183
|
+
clearIcon?: AutoCompletePassThroughOptionType;
|
|
180
184
|
/**
|
|
181
185
|
* Used to pass attributes to the dropdown's DOM element.
|
|
182
186
|
*/
|
|
@@ -370,6 +374,11 @@ export interface AutoCompleteProps {
|
|
|
370
374
|
* @defaultValue false
|
|
371
375
|
*/
|
|
372
376
|
multiple?: boolean | undefined;
|
|
377
|
+
/**
|
|
378
|
+
* When enabled, a clear icon is displayed to clear the value.
|
|
379
|
+
* @defaultValue false
|
|
380
|
+
*/
|
|
381
|
+
showClear?: boolean | undefined;
|
|
373
382
|
/**
|
|
374
383
|
* Default text to display when no option is selected.
|
|
375
384
|
*/
|
|
@@ -779,6 +788,17 @@ export interface AutoCompleteSlots {
|
|
|
779
788
|
*/
|
|
780
789
|
toggleCallback: (event: Event) => void;
|
|
781
790
|
}): VNode[];
|
|
791
|
+
/**
|
|
792
|
+
* Custom clear icon template.
|
|
793
|
+
* @param {Object} scope - clear icon slot's params.
|
|
794
|
+
*/
|
|
795
|
+
clearicon(scope: {
|
|
796
|
+
/**
|
|
797
|
+
* Clear icon click function.
|
|
798
|
+
* @param {Event} event - Browser event
|
|
799
|
+
*/
|
|
800
|
+
clearCallback: (event: Event) => void;
|
|
801
|
+
}): VNode[];
|
|
782
802
|
}
|
|
783
803
|
|
|
784
804
|
/**
|
package/autocomplete/index.mjs
CHANGED
|
@@ -5,6 +5,7 @@ import { ZIndex } from '@primeuix/utils/zindex';
|
|
|
5
5
|
import { ConnectedOverlayScrollHandler } from '@primevue/core/utils';
|
|
6
6
|
import ChevronDownIcon from '@primevue/icons/chevrondown';
|
|
7
7
|
import SpinnerIcon from '@primevue/icons/spinner';
|
|
8
|
+
import TimesIcon from '@primevue/icons/times';
|
|
8
9
|
import Chip from 'primevue/chip';
|
|
9
10
|
import InputText from 'primevue/inputtext';
|
|
10
11
|
import OverlayEventBus from 'primevue/overlayeventbus';
|
|
@@ -75,6 +76,10 @@ var script$1 = {
|
|
|
75
76
|
type: Boolean,
|
|
76
77
|
"default": false
|
|
77
78
|
},
|
|
79
|
+
showClear: {
|
|
80
|
+
type: Boolean,
|
|
81
|
+
"default": false
|
|
82
|
+
},
|
|
78
83
|
inputId: {
|
|
79
84
|
type: String,
|
|
80
85
|
"default": null
|
|
@@ -414,6 +419,7 @@ var script = {
|
|
|
414
419
|
this.updateModel(event, query);
|
|
415
420
|
}
|
|
416
421
|
if (query.length === 0) {
|
|
422
|
+
this.searching = false;
|
|
417
423
|
this.hide();
|
|
418
424
|
this.$emit('clear');
|
|
419
425
|
} else {
|
|
@@ -423,6 +429,7 @@ var script = {
|
|
|
423
429
|
_this3.search(event, query, 'input');
|
|
424
430
|
}, this.delay);
|
|
425
431
|
} else {
|
|
432
|
+
this.searching = false;
|
|
426
433
|
this.hide();
|
|
427
434
|
}
|
|
428
435
|
}
|
|
@@ -547,12 +554,17 @@ var script = {
|
|
|
547
554
|
var rangeEnd = Math.max(start, end);
|
|
548
555
|
var value = this.visibleOptions.slice(rangeStart, rangeEnd + 1).filter(function (option) {
|
|
549
556
|
return _this5.isValidOption(option);
|
|
557
|
+
}).filter(function (option) {
|
|
558
|
+
return !_this5.isSelected(option);
|
|
550
559
|
}).map(function (option) {
|
|
551
560
|
return _this5.getOptionValue(option);
|
|
552
561
|
});
|
|
553
|
-
this.updateModel(event, value);
|
|
562
|
+
this.updateModel(event, [].concat(_toConsumableArray(this.d_value || []), _toConsumableArray(value)));
|
|
554
563
|
}
|
|
555
564
|
},
|
|
565
|
+
onClearClick: function onClearClick(event) {
|
|
566
|
+
this.updateModel(event, null);
|
|
567
|
+
},
|
|
556
568
|
onOverlayClick: function onOverlayClick(event) {
|
|
557
569
|
OverlayEventBus.emit('overlay-click', {
|
|
558
570
|
originalEvent: event,
|
|
@@ -887,6 +899,7 @@ var script = {
|
|
|
887
899
|
return;
|
|
888
900
|
}
|
|
889
901
|
this.searching = true;
|
|
902
|
+
this.show();
|
|
890
903
|
this.$emit('complete', {
|
|
891
904
|
originalEvent: event,
|
|
892
905
|
query: query
|
|
@@ -1055,6 +1068,9 @@ var script = {
|
|
|
1055
1068
|
focusedMultipleOptionId: function focusedMultipleOptionId() {
|
|
1056
1069
|
return this.focusedMultipleOptionIndex !== -1 ? "".concat(this.$id, "_multiple_option_").concat(this.focusedMultipleOptionIndex) : null;
|
|
1057
1070
|
},
|
|
1071
|
+
isClearIconVisible: function isClearIconVisible() {
|
|
1072
|
+
return this.showClear && this.$filled && !this.disabled && !this.loading;
|
|
1073
|
+
},
|
|
1058
1074
|
ariaSetSize: function ariaSetSize() {
|
|
1059
1075
|
var _this18 = this;
|
|
1060
1076
|
return this.visibleOptions.filter(function (option) {
|
|
@@ -1090,9 +1106,10 @@ var script = {
|
|
|
1090
1106
|
InputText: InputText,
|
|
1091
1107
|
VirtualScroller: VirtualScroller,
|
|
1092
1108
|
Portal: Portal,
|
|
1109
|
+
Chip: Chip,
|
|
1093
1110
|
ChevronDownIcon: ChevronDownIcon,
|
|
1094
1111
|
SpinnerIcon: SpinnerIcon,
|
|
1095
|
-
|
|
1112
|
+
TimesIcon: TimesIcon
|
|
1096
1113
|
},
|
|
1097
1114
|
directives: {
|
|
1098
1115
|
ripple: Ripple
|
|
@@ -1117,6 +1134,7 @@ var _hoisted_9 = ["id"];
|
|
|
1117
1134
|
var _hoisted_10 = ["id", "aria-label", "aria-selected", "aria-disabled", "aria-setsize", "aria-posinset", "onClick", "onMousemove", "data-p-selected", "data-p-focused", "data-p-disabled"];
|
|
1118
1135
|
function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
1119
1136
|
var _component_InputText = resolveComponent("InputText");
|
|
1137
|
+
var _component_TimesIcon = resolveComponent("TimesIcon");
|
|
1120
1138
|
var _component_Chip = resolveComponent("Chip");
|
|
1121
1139
|
var _component_SpinnerIcon = resolveComponent("SpinnerIcon");
|
|
1122
1140
|
var _component_VirtualScroller = resolveComponent("VirtualScroller");
|
|
@@ -1163,8 +1181,17 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1163
1181
|
unstyled: _ctx.unstyled,
|
|
1164
1182
|
"data-p-has-dropdown": _ctx.dropdown,
|
|
1165
1183
|
pt: _ctx.ptm('pcInputText')
|
|
1166
|
-
}, null, 8, ["id", "name", "class", "style", "defaultValue", "placeholder", "tabindex", "fluid", "disabled", "size", "invalid", "variant", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "onFocus", "onBlur", "onKeydown", "onInput", "onChange", "unstyled", "data-p-has-dropdown", "pt"])) : createCommentVNode("", true),
|
|
1184
|
+
}, null, 8, ["id", "name", "class", "style", "defaultValue", "placeholder", "tabindex", "fluid", "disabled", "size", "invalid", "variant", "aria-label", "aria-labelledby", "aria-expanded", "aria-controls", "aria-activedescendant", "onFocus", "onBlur", "onKeydown", "onInput", "onChange", "unstyled", "data-p-has-dropdown", "pt"])) : createCommentVNode("", true), $options.isClearIconVisible ? renderSlot(_ctx.$slots, "clearicon", {
|
|
1167
1185
|
key: 1,
|
|
1186
|
+
"class": normalizeClass(_ctx.cx('clearIcon')),
|
|
1187
|
+
clearCallback: $options.onClearClick
|
|
1188
|
+
}, function () {
|
|
1189
|
+
return [createVNode(_component_TimesIcon, mergeProps({
|
|
1190
|
+
"class": [_ctx.cx('clearIcon')],
|
|
1191
|
+
onClick: $options.onClearClick
|
|
1192
|
+
}, _ctx.ptm('clearIcon')), null, 16, ["class", "onClick"])];
|
|
1193
|
+
}) : createCommentVNode("", true), _ctx.multiple ? (openBlock(), createElementBlock("ul", mergeProps({
|
|
1194
|
+
key: 2,
|
|
1168
1195
|
ref: "multiContainer",
|
|
1169
1196
|
"class": _ctx.cx('inputMultiple'),
|
|
1170
1197
|
tabindex: "-1",
|
|
@@ -1268,7 +1295,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1268
1295
|
return $options.onChange && $options.onChange.apply($options, arguments);
|
|
1269
1296
|
})
|
|
1270
1297
|
}, _ctx.ptm('input')), null, 16, _hoisted_4)], 16)], 16, _hoisted_2)) : createCommentVNode("", true), $data.searching || _ctx.loading ? renderSlot(_ctx.$slots, _ctx.$slots.loader ? 'loader' : 'loadingicon', {
|
|
1271
|
-
key:
|
|
1298
|
+
key: 3,
|
|
1272
1299
|
"class": normalizeClass(_ctx.cx('loader'))
|
|
1273
1300
|
}, function () {
|
|
1274
1301
|
return [_ctx.loader || _ctx.loadingIcon ? (openBlock(), createElementBlock("i", mergeProps({
|
|
@@ -1276,13 +1303,13 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1276
1303
|
"class": ['pi-spin', _ctx.cx('loader'), _ctx.loader, _ctx.loadingIcon],
|
|
1277
1304
|
"aria-hidden": "true",
|
|
1278
1305
|
"data-p-has-dropdown": _ctx.dropdown
|
|
1279
|
-
}, _ctx.ptm('loader')), null, 16, _hoisted_5)) : (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
|
|
1306
|
+
}, _ctx.ptm('loader')), null, 16, _hoisted_5)) : _ctx.loading ? (openBlock(), createBlock(_component_SpinnerIcon, mergeProps({
|
|
1280
1307
|
key: 1,
|
|
1281
1308
|
"class": _ctx.cx('loader'),
|
|
1282
1309
|
spin: "",
|
|
1283
1310
|
"aria-hidden": "true",
|
|
1284
1311
|
"data-p-has-dropdown": _ctx.dropdown
|
|
1285
|
-
}, _ctx.ptm('loader')), null, 16, ["class", "data-p-has-dropdown"]))];
|
|
1312
|
+
}, _ctx.ptm('loader')), null, 16, ["class", "data-p-has-dropdown"])) : createCommentVNode("", true)];
|
|
1286
1313
|
}) : createCommentVNode("", true), renderSlot(_ctx.$slots, _ctx.$slots.dropdown ? 'dropdown' : 'dropdownbutton', {
|
|
1287
1314
|
toggleCallback: function toggleCallback(event) {
|
|
1288
1315
|
return $options.onDropdownClick(event);
|
|
@@ -1308,7 +1335,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
|
1308
1335
|
}, _ctx.ptm('dropdownIcon')), null, 16, ["class"]))];
|
|
1309
1336
|
})], 16, _hoisted_6)) : createCommentVNode("", true)];
|
|
1310
1337
|
}), _ctx.typeahead ? (openBlock(), createElementBlock("span", mergeProps({
|
|
1311
|
-
key:
|
|
1338
|
+
key: 4,
|
|
1312
1339
|
role: "status",
|
|
1313
1340
|
"aria-live": "polite",
|
|
1314
1341
|
"class": "p-hidden-accessible"
|