primevue 4.3.8 → 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.
Files changed (118) hide show
  1. package/autocomplete/AutoComplete.vue +18 -3
  2. package/autocomplete/BaseAutoComplete.vue +4 -0
  3. package/autocomplete/index.d.ts +20 -0
  4. package/autocomplete/index.mjs +34 -7
  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 +5 -6
  16. package/colorpicker/index.mjs +5 -5
  17. package/colorpicker/index.mjs.map +1 -1
  18. package/column/index.d.ts +2 -2
  19. package/confirmdialog/ConfirmDialog.vue +1 -1
  20. package/confirmdialog/index.d.ts +5 -0
  21. package/confirmdialog/index.mjs +3 -2
  22. package/confirmdialog/index.mjs.map +1 -1
  23. package/datatable/BodyCell.vue +1 -1
  24. package/datatable/ColumnFilter.vue +1 -1
  25. package/datatable/DataTable.vue +6 -3
  26. package/datatable/HeaderCheckbox.vue +3 -3
  27. package/datatable/index.mjs +19 -9
  28. package/datatable/index.mjs.map +1 -1
  29. package/datepicker/BaseDatePicker.vue +8 -0
  30. package/datepicker/DatePicker.vue +200 -82
  31. package/datepicker/index.d.ts +25 -0
  32. package/datepicker/index.mjs +263 -155
  33. package/datepicker/index.mjs.map +1 -1
  34. package/datepicker/style/index.d.ts +4 -0
  35. package/datepicker/style/index.mjs +5 -2
  36. package/datepicker/style/index.mjs.map +1 -1
  37. package/dialog/Dialog.vue +1 -1
  38. package/dialog/index.d.ts +5 -0
  39. package/dialog/index.mjs +2 -1
  40. package/dialog/index.mjs.map +1 -1
  41. package/drawer/BaseDrawer.vue +4 -0
  42. package/drawer/Drawer.vue +4 -4
  43. package/drawer/index.d.ts +5 -0
  44. package/drawer/index.mjs +8 -4
  45. package/drawer/index.mjs.map +1 -1
  46. package/editor/Editor.vue +5 -1
  47. package/editor/index.mjs +5 -0
  48. package/editor/index.mjs.map +1 -1
  49. package/fileupload/FileUpload.vue +2 -2
  50. package/fileupload/index.mjs +2 -2
  51. package/fileupload/index.mjs.map +1 -1
  52. package/image/index.d.ts +5 -11
  53. package/inputmask/InputMask.vue +1 -2
  54. package/inputmask/index.mjs +1 -1
  55. package/inputmask/index.mjs.map +1 -1
  56. package/inputnumber/BaseInputNumber.vue +4 -0
  57. package/inputnumber/InputNumber.vue +33 -5
  58. package/inputnumber/index.d.ts +20 -0
  59. package/inputnumber/index.mjs +48 -7
  60. package/inputnumber/index.mjs.map +1 -1
  61. package/inputnumber/style/index.mjs +1 -0
  62. package/inputnumber/style/index.mjs.map +1 -1
  63. package/inputotp/InputOtp.vue +7 -3
  64. package/inputotp/index.mjs +6 -3
  65. package/inputotp/index.mjs.map +1 -1
  66. package/keyfilter/index.mjs +14 -1
  67. package/keyfilter/index.mjs.map +1 -1
  68. package/listbox/Listbox.vue +8 -14
  69. package/listbox/index.mjs +13 -19
  70. package/listbox/index.mjs.map +1 -1
  71. package/multiselect/MultiSelect.vue +15 -12
  72. package/multiselect/index.mjs +21 -18
  73. package/multiselect/index.mjs.map +1 -1
  74. package/package.json +5 -5
  75. package/panel/Panel.vue +1 -1
  76. package/panel/index.d.ts +4 -0
  77. package/panel/index.mjs +2 -1
  78. package/panel/index.mjs.map +1 -1
  79. package/password/BasePassword.vue +4 -0
  80. package/password/Password.vue +12 -1
  81. package/password/index.d.ts +20 -0
  82. package/password/index.mjs +23 -1
  83. package/password/index.mjs.map +1 -1
  84. package/password/style/index.d.ts +4 -0
  85. package/password/style/index.mjs +1 -0
  86. package/password/style/index.mjs.map +1 -1
  87. package/select/Select.vue +5 -4
  88. package/select/index.mjs +6 -5
  89. package/select/index.mjs.map +1 -1
  90. package/tab/Tab.vue +0 -1
  91. package/tab/index.mjs +0 -1
  92. package/tab/index.mjs.map +1 -1
  93. package/togglebutton/BaseToggleButton.vue +0 -4
  94. package/togglebutton/index.d.ts +0 -5
  95. package/togglebutton/index.mjs +0 -4
  96. package/togglebutton/index.mjs.map +1 -1
  97. package/tooltip/index.mjs +5 -1
  98. package/tooltip/index.mjs.map +1 -1
  99. package/tree/BaseTree.vue +16 -0
  100. package/tree/Tree.vue +179 -4
  101. package/tree/TreeNode.vue +225 -3
  102. package/tree/index.d.ts +65 -0
  103. package/tree/index.mjs +499 -22
  104. package/tree/index.mjs.map +1 -1
  105. package/tree/style/index.mjs +9 -4
  106. package/tree/style/index.mjs.map +1 -1
  107. package/treenode/index.d.ts +12 -0
  108. package/treeselect/TreeSelect.vue +2 -2
  109. package/treeselect/index.mjs +2 -2
  110. package/treeselect/index.mjs.map +1 -1
  111. package/treetable/TreeTable.vue +15 -1
  112. package/treetable/index.d.ts +58 -4
  113. package/treetable/index.mjs +19 -6
  114. package/treetable/index.mjs.map +1 -1
  115. package/umd/primevue.min.js +1 -1
  116. package/vetur-attributes.json +0 -4
  117. package/vetur-tags.json +0 -1
  118. package/web-types.json +1 -11
@@ -34,7 +34,7 @@
34
34
  <span>{{ label }}</span>
35
35
  </template>
36
36
  <template v-else>
37
- <span v-for="item of d_value" :key="getLabelByValue(item)" :class="cx('chipItem')" v-bind="ptm('chipItem')">
37
+ <span v-for="(item, idx) of d_value" :key="`chip-${optionValue ? item : getLabelByValue(item)}_${idx}`" :class="cx('chipItem')" v-bind="ptm('chipItem')">
38
38
  <slot name="chip" :value="item" :removeCallback="(event) => removeOption(event, item)">
39
39
  <!-- TODO: removetokenicon and removeTokenIcon deprecated since v4.0. Use chipicon slot and chipIcon prop-->
40
40
  <Chip :class="cx('pcChip')" :label="getLabelByValue(item)" :removeIcon="chipIcon || removeTokenIcon" removable :unstyled="unstyled" @remove="removeOption($event, item)" :pt="ptm('pcChip')">
@@ -331,8 +331,9 @@ export default {
331
331
  return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;
332
332
  },
333
333
  isOptionGroup(option) {
334
- return this.optionGroupLabel && option.optionGroup && option.group;
334
+ return !!(this.optionGroupLabel && option.optionGroup && option.group);
335
335
  },
336
+
336
337
  getOptionGroupLabel(optionGroup) {
337
338
  return resolveFieldData(optionGroup, this.optionGroupLabel);
338
339
  },
@@ -496,10 +497,9 @@ export default {
496
497
 
497
498
  let selected = this.isSelected(option);
498
499
  let value = null;
499
- const _value = this.getOptionValue(option) !== '' ? this.getOptionValue(option) : this.getOptionLabel(option);
500
500
 
501
- if (selected) value = this.d_value.filter((val) => !equals(val, _value, this.equalityKey));
502
- else value = [...(this.d_value || []), _value];
501
+ if (selected) value = this.d_value.filter((val) => !equals(val, this.getOptionValue(option), this.equalityKey));
502
+ else value = [...(this.d_value || []), this.getOptionValue(option)];
503
503
 
504
504
  this.updateModel(event, value);
505
505
  index !== -1 && (this.focusedOptionIndex = index);
@@ -830,9 +830,9 @@ export default {
830
830
  },
831
831
  getLabelByValue(value) {
832
832
  const options = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];
833
- const matchedOption = options.find((option) => !this.isOptionGroup(option) && equals(this.getOptionValue(option) !== '' ? this.getOptionValue(option) : this.getOptionLabel(option), value, this.equalityKey));
833
+ const matchedOption = options.find((option) => !this.isOptionGroup(option) && equals(this.getOptionValue(option), value, this.equalityKey));
834
834
 
835
- return matchedOption ? this.getOptionLabel(matchedOption) : null;
835
+ return this.getOptionLabel(matchedOption);
836
836
  },
837
837
  getSelectedItemsLabel() {
838
838
  let pattern = /{(.*?)}/;
@@ -878,7 +878,7 @@ export default {
878
878
  return equals(value1, value2, this.equalityKey);
879
879
  },
880
880
  isSelected(option) {
881
- const optionValue = this.getOptionValue(option) !== '' ? this.getOptionValue(option) : this.getOptionLabel(option);
881
+ const optionValue = this.getOptionValue(option);
882
882
 
883
883
  return (this.d_value || []).some((value) => this.isEquals(value, optionValue));
884
884
  },
@@ -1021,11 +1021,14 @@ export default {
1021
1021
  },
1022
1022
  flatOptions(options) {
1023
1023
  return (options || []).reduce((result, option, index) => {
1024
- result.push({ optionGroup: option, group: true, index });
1025
-
1026
1024
  const optionGroupChildren = this.getOptionGroupChildren(option);
1027
1025
 
1028
- optionGroupChildren && optionGroupChildren.forEach((o) => result.push(o));
1026
+ if (optionGroupChildren && Array.isArray(optionGroupChildren)) {
1027
+ result.push({ optionGroup: option, group: true, index });
1028
+ optionGroupChildren.forEach((o) => result.push(o));
1029
+ } else {
1030
+ result.push(option);
1031
+ }
1029
1032
 
1030
1033
  return result;
1031
1034
  }, []);
@@ -1150,7 +1153,7 @@ export default {
1150
1153
  return isEmpty(this.fluid) ? !!this.$pcFluid : this.fluid;
1151
1154
  },
1152
1155
  isClearIconVisible() {
1153
- return this.showClear && this.d_value && this.d_value.length && this.d_value != null && isNotEmpty(this.options);
1156
+ return this.showClear && this.d_value && this.d_value.length && this.d_value != null && isNotEmpty(this.options) && !this.disabled && !this.loading;
1154
1157
  },
1155
1158
  containerDataP() {
1156
1159
  return cn({
@@ -300,7 +300,7 @@ var script = {
300
300
  return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;
301
301
  },
302
302
  isOptionGroup: function isOptionGroup(option) {
303
- return this.optionGroupLabel && option.optionGroup && option.group;
303
+ return !!(this.optionGroupLabel && option.optionGroup && option.group);
304
304
  },
305
305
  getOptionGroupLabel: function getOptionGroupLabel(optionGroup) {
306
306
  return resolveFieldData(optionGroup, this.optionGroupLabel);
@@ -449,10 +449,9 @@ var script = {
449
449
  }
450
450
  var selected = this.isSelected(option);
451
451
  var value = null;
452
- var _value = this.getOptionValue(option) !== '' ? this.getOptionValue(option) : this.getOptionLabel(option);
453
452
  if (selected) value = this.d_value.filter(function (val) {
454
- return !equals(val, _value, _this4.equalityKey);
455
- });else value = [].concat(_toConsumableArray(this.d_value || []), [_value]);
453
+ return !equals(val, _this4.getOptionValue(option), _this4.equalityKey);
454
+ });else value = [].concat(_toConsumableArray(this.d_value || []), [this.getOptionValue(option)]);
456
455
  this.updateModel(event, value);
457
456
  index !== -1 && (this.focusedOptionIndex = index);
458
457
  isFocus && focus(this.$refs.focusInput);
@@ -755,9 +754,9 @@ var script = {
755
754
  var _this9 = this;
756
755
  var options = this.optionGroupLabel ? this.flatOptions(this.options) : this.options || [];
757
756
  var matchedOption = options.find(function (option) {
758
- return !_this9.isOptionGroup(option) && equals(_this9.getOptionValue(option) !== '' ? _this9.getOptionValue(option) : _this9.getOptionLabel(option), value, _this9.equalityKey);
757
+ return !_this9.isOptionGroup(option) && equals(_this9.getOptionValue(option), value, _this9.equalityKey);
759
758
  });
760
- return matchedOption ? this.getOptionLabel(matchedOption) : null;
759
+ return this.getOptionLabel(matchedOption);
761
760
  },
762
761
  getSelectedItemsLabel: function getSelectedItemsLabel() {
763
762
  var pattern = /{(.*?)}/;
@@ -812,7 +811,7 @@ var script = {
812
811
  },
813
812
  isSelected: function isSelected(option) {
814
813
  var _this10 = this;
815
- var optionValue = this.getOptionValue(option) !== '' ? this.getOptionValue(option) : this.getOptionLabel(option);
814
+ var optionValue = this.getOptionValue(option);
816
815
  return (this.d_value || []).some(function (value) {
817
816
  return _this10.isEquals(value, optionValue);
818
817
  });
@@ -987,15 +986,19 @@ var script = {
987
986
  flatOptions: function flatOptions(options) {
988
987
  var _this22 = this;
989
988
  return (options || []).reduce(function (result, option, index) {
990
- result.push({
991
- optionGroup: option,
992
- group: true,
993
- index: index
994
- });
995
989
  var optionGroupChildren = _this22.getOptionGroupChildren(option);
996
- optionGroupChildren && optionGroupChildren.forEach(function (o) {
997
- return result.push(o);
998
- });
990
+ if (optionGroupChildren && Array.isArray(optionGroupChildren)) {
991
+ result.push({
992
+ optionGroup: option,
993
+ group: true,
994
+ index: index
995
+ });
996
+ optionGroupChildren.forEach(function (o) {
997
+ return result.push(o);
998
+ });
999
+ } else {
1000
+ result.push(option);
1001
+ }
999
1002
  return result;
1000
1003
  }, []);
1001
1004
  },
@@ -1117,7 +1120,7 @@ var script = {
1117
1120
  return isEmpty(this.fluid) ? !!this.$pcFluid : this.fluid;
1118
1121
  },
1119
1122
  isClearIconVisible: function isClearIconVisible() {
1120
- return this.showClear && this.d_value && this.d_value.length && this.d_value != null && isNotEmpty(this.options);
1123
+ return this.showClear && this.d_value && this.d_value.length && this.d_value != null && isNotEmpty(this.options) && !this.disabled && !this.loading;
1121
1124
  },
1122
1125
  containerDataP: function containerDataP() {
1123
1126
  return cn(_defineProperty$1({
@@ -1238,9 +1241,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
1238
1241
  key: 1
1239
1242
  }, [$options.chipSelectedItems ? (openBlock(), createElementBlock("span", _hoisted_4, toDisplayString($options.label), 1)) : (openBlock(true), createElementBlock(Fragment, {
1240
1243
  key: 1
1241
- }, renderList(_ctx.d_value, function (item) {
1244
+ }, renderList(_ctx.d_value, function (item, idx) {
1242
1245
  return openBlock(), createElementBlock("span", mergeProps({
1243
- key: $options.getLabelByValue(item),
1246
+ key: "chip-".concat(_ctx.optionValue ? item : $options.getLabelByValue(item), "_").concat(idx),
1244
1247
  "class": _ctx.cx('chipItem')
1245
1248
  }, {
1246
1249
  ref_for: true