primevue 4.3.9 → 4.4.1

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.
Files changed (101) hide show
  1. package/autocomplete/AutoComplete.vue +19 -4
  2. package/autocomplete/BaseAutoComplete.vue +4 -0
  3. package/autocomplete/index.d.ts +20 -0
  4. package/autocomplete/index.mjs +35 -8
  5. package/autocomplete/index.mjs.map +1 -1
  6. package/autocomplete/style/index.d.ts +4 -0
  7. package/autocomplete/style/index.mjs +3 -1
  8. package/autocomplete/style/index.mjs.map +1 -1
  9. package/cascadeselect/CascadeSelect.vue +1 -1
  10. package/cascadeselect/index.mjs +1 -1
  11. package/cascadeselect/index.mjs.map +1 -1
  12. package/checkbox/Checkbox.vue +15 -2
  13. package/checkbox/index.mjs +14 -2
  14. package/checkbox/index.mjs.map +1 -1
  15. package/colorpicker/ColorPicker.vue +3 -4
  16. package/colorpicker/index.mjs +3 -3
  17. package/colorpicker/index.mjs.map +1 -1
  18. package/confirmdialog/ConfirmDialog.vue +1 -1
  19. package/confirmdialog/index.d.ts +5 -0
  20. package/confirmdialog/index.mjs +3 -2
  21. package/confirmdialog/index.mjs.map +1 -1
  22. package/datatable/ColumnFilter.vue +1 -1
  23. package/datatable/DataTable.vue +2 -2
  24. package/datatable/HeaderCheckbox.vue +3 -3
  25. package/datatable/index.mjs +13 -4
  26. package/datatable/index.mjs.map +1 -1
  27. package/datepicker/BaseDatePicker.vue +8 -0
  28. package/datepicker/DatePicker.vue +225 -105
  29. package/datepicker/index.d.ts +43 -2
  30. package/datepicker/index.mjs +303 -186
  31. package/datepicker/index.mjs.map +1 -1
  32. package/datepicker/style/index.d.ts +4 -0
  33. package/datepicker/style/index.mjs +5 -2
  34. package/datepicker/style/index.mjs.map +1 -1
  35. package/drawer/BaseDrawer.vue +4 -0
  36. package/drawer/Drawer.vue +5 -5
  37. package/drawer/index.d.ts +5 -0
  38. package/drawer/index.mjs +11 -7
  39. package/drawer/index.mjs.map +1 -1
  40. package/editor/Editor.vue +5 -1
  41. package/editor/index.mjs +5 -0
  42. package/editor/index.mjs.map +1 -1
  43. package/image/index.d.ts +5 -11
  44. package/inputmask/InputMask.vue +1 -2
  45. package/inputmask/index.mjs +1 -1
  46. package/inputmask/index.mjs.map +1 -1
  47. package/inputnumber/BaseInputNumber.vue +4 -0
  48. package/inputnumber/InputNumber.vue +30 -5
  49. package/inputnumber/index.d.ts +20 -0
  50. package/inputnumber/index.mjs +45 -7
  51. package/inputnumber/index.mjs.map +1 -1
  52. package/inputnumber/style/index.mjs +1 -0
  53. package/inputnumber/style/index.mjs.map +1 -1
  54. package/inputotp/InputOtp.vue +7 -3
  55. package/inputotp/index.mjs +6 -3
  56. package/inputotp/index.mjs.map +1 -1
  57. package/listbox/Listbox.vue +1 -1
  58. package/listbox/index.mjs +1 -1
  59. package/listbox/index.mjs.map +1 -1
  60. package/menu/Menu.vue +2 -2
  61. package/menu/index.mjs +1 -1
  62. package/menu/index.mjs.map +1 -1
  63. package/multiselect/MultiSelect.vue +10 -6
  64. package/multiselect/index.mjs +15 -11
  65. package/multiselect/index.mjs.map +1 -1
  66. package/package.json +5 -5
  67. package/panel/Panel.vue +1 -1
  68. package/panel/index.d.ts +4 -0
  69. package/panel/index.mjs +2 -1
  70. package/panel/index.mjs.map +1 -1
  71. package/password/BasePassword.vue +4 -0
  72. package/password/Password.vue +14 -2
  73. package/password/index.d.ts +20 -0
  74. package/password/index.mjs +26 -3
  75. package/password/index.mjs.map +1 -1
  76. package/password/style/index.d.ts +4 -0
  77. package/password/style/index.mjs +1 -0
  78. package/password/style/index.mjs.map +1 -1
  79. package/select/Select.vue +2 -1
  80. package/select/index.mjs +2 -1
  81. package/select/index.mjs.map +1 -1
  82. package/speeddial/SpeedDial.vue +1 -1
  83. package/speeddial/index.mjs +1 -1
  84. package/speeddial/index.mjs.map +1 -1
  85. package/splitbutton/SplitButton.vue +1 -1
  86. package/splitbutton/index.mjs +1 -1
  87. package/splitbutton/index.mjs.map +1 -1
  88. package/tree/BaseTree.vue +20 -0
  89. package/tree/Tree.vue +236 -4
  90. package/tree/TreeNode.vue +295 -3
  91. package/tree/index.d.ts +140 -0
  92. package/tree/index.mjs +637 -27
  93. package/tree/index.mjs.map +1 -1
  94. package/tree/style/index.mjs +9 -4
  95. package/tree/style/index.mjs.map +1 -1
  96. package/treenode/index.d.ts +12 -0
  97. package/treeselect/TreeSelect.vue +3 -2
  98. package/treeselect/index.mjs +6 -5
  99. package/treeselect/index.mjs.map +1 -1
  100. package/umd/primevue.min.js +1 -1
  101. package/web-types.json +1 -1
@@ -23,7 +23,7 @@
23
23
  aria-haspopup="listbox"
24
24
  aria-autocomplete="list"
25
25
  :aria-expanded="overlayVisible"
26
- :aria-controls="panelId"
26
+ :aria-controls="overlayVisible ? panelId : undefined"
27
27
  :aria-activedescendant="focused ? focusedOptionId : undefined"
28
28
  @focus="onFocus"
29
29
  @blur="onBlur"
@@ -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
- Chip
1139
+ TimesIcon
1125
1140
  },
1126
1141
  directives: {
1127
1142
  ripple: Ripple
@@ -62,6 +62,10 @@ export default {
62
62
  type: Boolean,
63
63
  default: false
64
64
  },
65
+ showClear: {
66
+ type: Boolean,
67
+ default: false
68
+ },
65
69
  inputId: {
66
70
  type: String,
67
71
  default: null
@@ -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
  /**
@@ -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
- Chip: Chip
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");
@@ -1153,7 +1171,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1153
1171
  "aria-haspopup": "listbox",
1154
1172
  "aria-autocomplete": "list",
1155
1173
  "aria-expanded": $data.overlayVisible,
1156
- "aria-controls": $options.panelId,
1174
+ "aria-controls": $data.overlayVisible ? $options.panelId : undefined,
1157
1175
  "aria-activedescendant": $data.focused ? $options.focusedOptionId : undefined,
1158
1176
  onFocus: $options.onFocus,
1159
1177
  onBlur: $options.onBlur,
@@ -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), _ctx.multiple ? (openBlock(), createElementBlock("ul", mergeProps({
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: 2,
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: 3,
1338
+ key: 4,
1312
1339
  role: "status",
1313
1340
  "aria-live": "polite",
1314
1341
  "class": "p-hidden-accessible"