primevue 4.3.0 → 4.3.2

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 (176) hide show
  1. package/accordionheader/AccordionHeader.vue +8 -2
  2. package/accordionheader/index.mjs +8 -1
  3. package/accordionheader/index.mjs.map +1 -1
  4. package/autocomplete/AutoComplete.vue +16 -6
  5. package/autocomplete/index.d.ts +3 -3
  6. package/autocomplete/index.mjs +17 -4
  7. package/autocomplete/index.mjs.map +1 -1
  8. package/avatar/Avatar.vue +13 -4
  9. package/avatar/index.d.ts +3 -3
  10. package/avatar/index.mjs +26 -6
  11. package/avatar/index.mjs.map +1 -1
  12. package/badge/Badge.vue +13 -2
  13. package/badge/index.d.ts +1 -1
  14. package/badge/index.mjs +18 -3
  15. package/badge/index.mjs.map +1 -1
  16. package/blockui/BlockUI.vue +15 -4
  17. package/blockui/index.mjs +13 -4
  18. package/blockui/index.mjs.map +1 -1
  19. package/button/Button.vue +30 -3
  20. package/button/index.d.ts +3 -7
  21. package/button/index.mjs +28 -9
  22. package/button/index.mjs.map +1 -1
  23. package/cascadeselect/index.d.ts +2 -2
  24. package/checkbox/Checkbox.vue +14 -4
  25. package/checkbox/index.d.ts +2 -2
  26. package/checkbox/index.mjs +27 -6
  27. package/checkbox/index.mjs.map +1 -1
  28. package/chip/Chip.vue +9 -1
  29. package/chip/index.mjs +12 -2
  30. package/chip/index.mjs.map +1 -1
  31. package/colorpicker/ColorPicker.vue +10 -2
  32. package/colorpicker/index.d.ts +1 -1
  33. package/colorpicker/index.mjs +9 -2
  34. package/colorpicker/index.mjs.map +1 -1
  35. package/column/index.d.ts +3 -3
  36. package/columngroup/index.d.ts +2 -2
  37. package/confirmationoptions/index.d.ts +1 -1
  38. package/confirmpopup/ConfirmPopup.vue +2 -2
  39. package/confirmpopup/index.mjs +2 -2
  40. package/confirmpopup/index.mjs.map +1 -1
  41. package/datatable/BodyCell.vue +3 -1
  42. package/datatable/BodyRow.vue +2 -0
  43. package/datatable/index.d.ts +10 -10
  44. package/datatable/index.mjs +7 -2
  45. package/datatable/index.mjs.map +1 -1
  46. package/dataview/index.d.ts +3 -3
  47. package/datepicker/DatePicker.vue +1 -3
  48. package/datepicker/index.d.ts +6 -6
  49. package/datepicker/index.mjs +21 -24
  50. package/datepicker/index.mjs.map +1 -1
  51. package/dialog/Dialog.vue +48 -39
  52. package/dialog/index.d.ts +26 -1
  53. package/dialog/index.mjs +73 -50
  54. package/dialog/index.mjs.map +1 -1
  55. package/divider/Divider.vue +13 -3
  56. package/divider/index.d.ts +4 -4
  57. package/divider/index.mjs +18 -5
  58. package/divider/index.mjs.map +1 -1
  59. package/dock/index.d.ts +4 -4
  60. package/drawer/index.d.ts +2 -2
  61. package/fieldset/Fieldset.vue +8 -2
  62. package/fieldset/index.mjs +20 -10
  63. package/fieldset/index.mjs.map +1 -1
  64. package/fileupload/index.d.ts +2 -2
  65. package/floatlabel/index.d.ts +2 -2
  66. package/galleria/GalleriaItem.vue +8 -9
  67. package/galleria/index.d.ts +3 -3
  68. package/galleria/index.mjs +8 -8
  69. package/galleria/index.mjs.map +1 -1
  70. package/inputchips/index.d.ts +2 -2
  71. package/inputmask/InputMask.vue +15 -1
  72. package/inputmask/index.d.ts +3 -3
  73. package/inputmask/index.mjs +12 -1
  74. package/inputmask/index.mjs.map +1 -1
  75. package/inputnumber/InputNumber.vue +28 -6
  76. package/inputnumber/index.d.ts +6 -6
  77. package/inputnumber/index.mjs +43 -19
  78. package/inputnumber/index.mjs.map +1 -1
  79. package/inputotp/index.d.ts +3 -3
  80. package/inputtext/InputText.vue +10 -1
  81. package/inputtext/index.d.ts +3 -3
  82. package/inputtext/index.mjs +14 -1
  83. package/inputtext/index.mjs.map +1 -1
  84. package/knob/Knob.vue +1 -1
  85. package/knob/index.mjs +1 -1
  86. package/knob/index.mjs.map +1 -1
  87. package/megamenu/index.d.ts +2 -2
  88. package/message/Message.vue +16 -7
  89. package/message/index.d.ts +2 -2
  90. package/message/index.mjs +35 -13
  91. package/message/index.mjs.map +1 -1
  92. package/multiselect/MultiSelect.vue +5 -1
  93. package/multiselect/index.d.ts +3 -3
  94. package/multiselect/index.mjs +4 -1
  95. package/multiselect/index.mjs.map +1 -1
  96. package/organizationchart/index.d.ts +2 -2
  97. package/overlaybadge/index.d.ts +1 -1
  98. package/package.json +3 -3
  99. package/panel/Panel.vue +29 -22
  100. package/panel/index.d.ts +22 -2
  101. package/panel/index.mjs +55 -31
  102. package/panel/index.mjs.map +1 -1
  103. package/password/index.d.ts +2 -2
  104. package/popover/Popover.vue +2 -2
  105. package/popover/index.mjs +2 -2
  106. package/popover/index.mjs.map +1 -1
  107. package/progressbar/ProgressBar.vue +11 -4
  108. package/progressbar/index.mjs +24 -6
  109. package/progressbar/index.mjs.map +1 -1
  110. package/radiobutton/RadioButton.vue +13 -3
  111. package/radiobutton/index.d.ts +3 -3
  112. package/radiobutton/index.mjs +24 -4
  113. package/radiobutton/index.mjs.map +1 -1
  114. package/rating/Rating.vue +19 -2
  115. package/rating/index.mjs +28 -7
  116. package/rating/index.mjs.map +1 -1
  117. package/scrolltop/index.d.ts +2 -2
  118. package/select/Select.vue +8 -4
  119. package/select/index.d.ts +2 -2
  120. package/select/index.mjs +9 -5
  121. package/select/index.mjs.map +1 -1
  122. package/selectbutton/SelectButton.vue +26 -9
  123. package/selectbutton/index.d.ts +2 -2
  124. package/selectbutton/index.mjs +30 -10
  125. package/selectbutton/index.mjs.map +1 -1
  126. package/skeleton/Skeleton.vue +7 -1
  127. package/skeleton/index.d.ts +3 -3
  128. package/skeleton/index.mjs +12 -1
  129. package/skeleton/index.mjs.map +1 -1
  130. package/slider/Slider.vue +11 -2
  131. package/slider/index.d.ts +2 -2
  132. package/slider/index.mjs +27 -8
  133. package/slider/index.mjs.map +1 -1
  134. package/speeddial/index.d.ts +5 -5
  135. package/splitbutton/index.d.ts +1 -1
  136. package/splitter/index.d.ts +3 -3
  137. package/stepper/index.d.ts +4 -0
  138. package/tab/Tab.vue +8 -2
  139. package/tab/index.mjs +9 -1
  140. package/tab/index.mjs.map +1 -1
  141. package/tablist/TabList.vue +10 -2
  142. package/tablist/index.mjs +20 -8
  143. package/tablist/index.mjs.map +1 -1
  144. package/tag/Tag.vue +11 -2
  145. package/tag/index.mjs +17 -3
  146. package/tag/index.mjs.map +1 -1
  147. package/textarea/Textarea.vue +10 -1
  148. package/textarea/index.d.ts +3 -3
  149. package/textarea/index.mjs +14 -1
  150. package/textarea/index.mjs.map +1 -1
  151. package/timeline/Timeline.vue +16 -7
  152. package/timeline/index.d.ts +3 -3
  153. package/timeline/index.mjs +42 -11
  154. package/timeline/index.mjs.map +1 -1
  155. package/toast/Toast.vue +10 -1
  156. package/toast/ToastMessage.vue +29 -19
  157. package/toast/index.d.ts +2 -2
  158. package/toast/index.mjs +77 -38
  159. package/toast/index.mjs.map +1 -1
  160. package/togglebutton/ToggleButton.vue +10 -1
  161. package/togglebutton/index.d.ts +3 -3
  162. package/togglebutton/index.mjs +19 -4
  163. package/togglebutton/index.mjs.map +1 -1
  164. package/toggleswitch/ToggleSwitch.vue +11 -3
  165. package/toggleswitch/index.mjs +20 -5
  166. package/toggleswitch/index.mjs.map +1 -1
  167. package/tooltip/index.mjs +0 -6
  168. package/tooltip/index.mjs.map +1 -1
  169. package/tree/index.d.ts +3 -3
  170. package/treeselect/index.d.ts +6 -6
  171. package/treetable/index.d.ts +7 -7
  172. package/treetable/style/index.mjs +2 -3
  173. package/treetable/style/index.mjs.map +1 -1
  174. package/umd/primevue.min.js +1 -1
  175. package/virtualscroller/index.d.ts +2 -2
  176. package/web-types.json +1 -1
@@ -1,5 +1,5 @@
1
1
  <template>
2
- <div :class="cx('root')" role="group" :aria-labelledby="ariaLabelledby" v-bind="ptmi('root')">
2
+ <div :class="cx('root')" role="group" :aria-labelledby="ariaLabelledby" v-bind="ptmi('root')" :data-p="dataP">
3
3
  <template v-for="(option, index) of options" :key="getOptionRenderKey(option)">
4
4
  <ToggleButton
5
5
  :modelValue="isSelected(option)"
@@ -8,7 +8,7 @@
8
8
  :disabled="disabled || isOptionDisabled(option)"
9
9
  :unstyled="unstyled"
10
10
  :size="size"
11
- :readonly="!allowEmpty && isSelected(option)"
11
+ :readonly="isOptionReadonly(option)"
12
12
  @change="onOptionSelect($event, option, index)"
13
13
  :pt="ptm('pcToggleButton')"
14
14
  >
@@ -23,6 +23,7 @@
23
23
  </template>
24
24
 
25
25
  <script>
26
+ import { cn } from '@primeuix/utils';
26
27
  import { equals, resolveFieldData } from '@primeuix/utils/object';
27
28
  import Ripple from 'primevue/ripple';
28
29
  import ToggleButton from 'primevue/togglebutton';
@@ -46,24 +47,35 @@ export default {
46
47
  isOptionDisabled(option) {
47
48
  return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;
48
49
  },
49
- onOptionSelect(event, option, index) {
50
- if (this.disabled || this.isOptionDisabled(option)) {
51
- return;
52
- }
50
+ isOptionReadonly(option) {
51
+ if (this.allowEmpty) return false;
53
52
 
54
53
  let selected = this.isSelected(option);
55
54
 
56
- if (selected && !this.allowEmpty) {
55
+ if (this.multiple) {
56
+ return selected && this.d_value.length === 1;
57
+ } else {
58
+ return selected;
59
+ }
60
+ },
61
+ onOptionSelect(event, option, index) {
62
+ if (this.disabled || this.isOptionDisabled(option) || this.isOptionReadonly(option)) {
57
63
  return;
58
64
  }
59
65
 
66
+ let selected = this.isSelected(option);
60
67
  let optionValue = this.getOptionValue(option);
61
68
  let newValue;
62
69
 
63
70
  if (this.multiple) {
64
- if (selected) newValue = this.d_value.filter((val) => !equals(val, optionValue, this.equalityKey));
65
- else newValue = this.d_value ? [...this.d_value, optionValue] : [optionValue];
71
+ if (selected) {
72
+ newValue = this.d_value.filter((val) => !equals(val, optionValue, this.equalityKey));
73
+ if (!this.allowEmpty && newValue.length === 0) return;
74
+ } else {
75
+ newValue = this.d_value ? [...this.d_value, optionValue] : [optionValue];
76
+ }
66
77
  } else {
78
+ if (selected && !this.allowEmpty) return;
67
79
  newValue = selected ? null : optionValue;
68
80
  }
69
81
 
@@ -93,6 +105,11 @@ export default {
93
105
  computed: {
94
106
  equalityKey() {
95
107
  return this.optionValue ? null : this.dataKey;
108
+ },
109
+ dataP() {
110
+ return cn({
111
+ invalid: this.$invalid
112
+ });
96
113
  }
97
114
  },
98
115
  directives: {
@@ -11,7 +11,7 @@ import type { ComponentHooks } from '@primevue/core/basecomponent';
11
11
  import type { PassThroughOptions } from 'primevue/passthrough';
12
12
  import { VNode } from 'vue';
13
13
  // import { ToggleButtonPassThroughOptions } from 'primevue/togglebutton';
14
- import type { DefineComponent, DesignToken, EmitFn, PassThrough } from '@primevue/core';
14
+ import type { DefineComponent, DesignToken, EmitFn, HintedString, PassThrough } from '@primevue/core';
15
15
 
16
16
  export declare type SelectButtonPassThroughOptionType = SelectButtonPassThroughAttributes | ((options: SelectButtonPassThroughMethodOptions) => SelectButtonPassThroughAttributes | string) | string | null | undefined;
17
17
 
@@ -184,7 +184,7 @@ export interface SelectButtonProps {
184
184
  /**
185
185
  * Defines the size of the component.
186
186
  */
187
- size?: 'small' | 'large' | undefined;
187
+ size?: HintedString<'small' | 'large'> | undefined;
188
188
  /**
189
189
  * Form control object, typically used for handling validation and form state.
190
190
  */
@@ -1,3 +1,4 @@
1
+ import { cn } from '@primeuix/utils';
1
2
  import { equals, resolveFieldData } from '@primeuix/utils/object';
2
3
  import Ripple from 'primevue/ripple';
3
4
  import ToggleButton from 'primevue/togglebutton';
@@ -62,22 +63,34 @@ var script = {
62
63
  isOptionDisabled: function isOptionDisabled(option) {
63
64
  return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;
64
65
  },
66
+ isOptionReadonly: function isOptionReadonly(option) {
67
+ if (this.allowEmpty) return false;
68
+ var selected = this.isSelected(option);
69
+ if (this.multiple) {
70
+ return selected && this.d_value.length === 1;
71
+ } else {
72
+ return selected;
73
+ }
74
+ },
65
75
  onOptionSelect: function onOptionSelect(event, option, index) {
66
76
  var _this = this;
67
- if (this.disabled || this.isOptionDisabled(option)) {
77
+ if (this.disabled || this.isOptionDisabled(option) || this.isOptionReadonly(option)) {
68
78
  return;
69
79
  }
70
80
  var selected = this.isSelected(option);
71
- if (selected && !this.allowEmpty) {
72
- return;
73
- }
74
81
  var optionValue = this.getOptionValue(option);
75
82
  var newValue;
76
83
  if (this.multiple) {
77
- if (selected) newValue = this.d_value.filter(function (val) {
78
- return !equals(val, optionValue, _this.equalityKey);
79
- });else newValue = this.d_value ? [].concat(_toConsumableArray(this.d_value), [optionValue]) : [optionValue];
84
+ if (selected) {
85
+ newValue = this.d_value.filter(function (val) {
86
+ return !equals(val, optionValue, _this.equalityKey);
87
+ });
88
+ if (!this.allowEmpty && newValue.length === 0) return;
89
+ } else {
90
+ newValue = this.d_value ? [].concat(_toConsumableArray(this.d_value), [optionValue]) : [optionValue];
91
+ }
80
92
  } else {
93
+ if (selected && !this.allowEmpty) return;
81
94
  newValue = selected ? null : optionValue;
82
95
  }
83
96
  this.writeValue(newValue, event);
@@ -116,6 +129,11 @@ var script = {
116
129
  computed: {
117
130
  equalityKey: function equalityKey() {
118
131
  return this.optionValue ? null : this.dataKey;
132
+ },
133
+ dataP: function dataP() {
134
+ return cn({
135
+ invalid: this.$invalid
136
+ });
119
137
  }
120
138
  },
121
139
  directives: {
@@ -126,14 +144,16 @@ var script = {
126
144
  }
127
145
  };
128
146
 
129
- var _hoisted_1 = ["aria-labelledby"];
147
+ var _hoisted_1 = ["aria-labelledby", "data-p"];
130
148
  function render(_ctx, _cache, $props, $setup, $data, $options) {
131
149
  var _component_ToggleButton = resolveComponent("ToggleButton");
132
150
  return openBlock(), createElementBlock("div", mergeProps({
133
151
  "class": _ctx.cx('root'),
134
152
  role: "group",
135
153
  "aria-labelledby": _ctx.ariaLabelledby
136
- }, _ctx.ptmi('root')), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, function (option, index) {
154
+ }, _ctx.ptmi('root'), {
155
+ "data-p": $options.dataP
156
+ }), [(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.options, function (option, index) {
137
157
  return openBlock(), createBlock(_component_ToggleButton, {
138
158
  key: $options.getOptionRenderKey(option),
139
159
  modelValue: $options.isSelected(option),
@@ -142,7 +162,7 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
142
162
  disabled: _ctx.disabled || $options.isOptionDisabled(option),
143
163
  unstyled: _ctx.unstyled,
144
164
  size: _ctx.size,
145
- readonly: !_ctx.allowEmpty && $options.isSelected(option),
165
+ readonly: $options.isOptionReadonly(option),
146
166
  onChange: function onChange($event) {
147
167
  return $options.onOptionSelect($event, option, index);
148
168
  },
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/selectbutton/BaseSelectButton.vue","../../src/selectbutton/SelectButton.vue","../../src/selectbutton/SelectButton.vue?vue&type=template&id=5eb80134&lang.js"],"sourcesContent":["<script>\nimport BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport SelectButtonStyle from 'primevue/selectbutton/style';\n\nexport default {\n name: 'BaseSelectButton',\n extends: BaseEditableHolder,\n props: {\n options: Array,\n optionLabel: null,\n optionValue: null,\n optionDisabled: null,\n multiple: Boolean,\n allowEmpty: {\n type: Boolean,\n default: true\n },\n dataKey: null,\n ariaLabelledby: {\n type: String,\n default: null\n },\n size: {\n type: String,\n default: null\n }\n },\n style: SelectButtonStyle,\n provide() {\n return {\n $pcSelectButton: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" role=\"group\" :aria-labelledby=\"ariaLabelledby\" v-bind=\"ptmi('root')\">\n <template v-for=\"(option, index) of options\" :key=\"getOptionRenderKey(option)\">\n <ToggleButton\n :modelValue=\"isSelected(option)\"\n :onLabel=\"getOptionLabel(option)\"\n :offLabel=\"getOptionLabel(option)\"\n :disabled=\"disabled || isOptionDisabled(option)\"\n :unstyled=\"unstyled\"\n :size=\"size\"\n :readonly=\"!allowEmpty && isSelected(option)\"\n @change=\"onOptionSelect($event, option, index)\"\n :pt=\"ptm('pcToggleButton')\"\n >\n <template v-if=\"$slots.option\" #default>\n <slot name=\"option\" :option=\"option\" :index=\"index\">\n <span v-bind=\"ptm('pcToggleButton')['label']\">{{ getOptionLabel(option) }}</span>\n </slot>\n </template>\n </ToggleButton>\n </template>\n </div>\n</template>\n\n<script>\nimport { equals, resolveFieldData } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport ToggleButton from 'primevue/togglebutton';\nimport BaseSelectButton from './BaseSelectButton.vue';\n\nexport default {\n name: 'SelectButton',\n extends: BaseSelectButton,\n inheritAttrs: false,\n emits: ['change'],\n methods: {\n getOptionLabel(option) {\n return this.optionLabel ? resolveFieldData(option, this.optionLabel) : option;\n },\n getOptionValue(option) {\n return this.optionValue ? resolveFieldData(option, this.optionValue) : option;\n },\n getOptionRenderKey(option) {\n return this.dataKey ? resolveFieldData(option, this.dataKey) : this.getOptionLabel(option);\n },\n isOptionDisabled(option) {\n return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;\n },\n onOptionSelect(event, option, index) {\n if (this.disabled || this.isOptionDisabled(option)) {\n return;\n }\n\n let selected = this.isSelected(option);\n\n if (selected && !this.allowEmpty) {\n return;\n }\n\n let optionValue = this.getOptionValue(option);\n let newValue;\n\n if (this.multiple) {\n if (selected) newValue = this.d_value.filter((val) => !equals(val, optionValue, this.equalityKey));\n else newValue = this.d_value ? [...this.d_value, optionValue] : [optionValue];\n } else {\n newValue = selected ? null : optionValue;\n }\n\n this.writeValue(newValue, event);\n this.$emit('change', { event: event, value: newValue });\n },\n isSelected(option) {\n let selected = false;\n let optionValue = this.getOptionValue(option);\n\n if (this.multiple) {\n if (this.d_value) {\n for (let val of this.d_value) {\n if (equals(val, optionValue, this.equalityKey)) {\n selected = true;\n break;\n }\n }\n }\n } else {\n selected = equals(this.d_value, optionValue, this.equalityKey);\n }\n\n return selected;\n }\n },\n computed: {\n equalityKey() {\n return this.optionValue ? null : this.dataKey;\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n ToggleButton\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" role=\"group\" :aria-labelledby=\"ariaLabelledby\" v-bind=\"ptmi('root')\">\n <template v-for=\"(option, index) of options\" :key=\"getOptionRenderKey(option)\">\n <ToggleButton\n :modelValue=\"isSelected(option)\"\n :onLabel=\"getOptionLabel(option)\"\n :offLabel=\"getOptionLabel(option)\"\n :disabled=\"disabled || isOptionDisabled(option)\"\n :unstyled=\"unstyled\"\n :size=\"size\"\n :readonly=\"!allowEmpty && isSelected(option)\"\n @change=\"onOptionSelect($event, option, index)\"\n :pt=\"ptm('pcToggleButton')\"\n >\n <template v-if=\"$slots.option\" #default>\n <slot name=\"option\" :option=\"option\" :index=\"index\">\n <span v-bind=\"ptm('pcToggleButton')['label']\">{{ getOptionLabel(option) }}</span>\n </slot>\n </template>\n </ToggleButton>\n </template>\n </div>\n</template>\n\n<script>\nimport { equals, resolveFieldData } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport ToggleButton from 'primevue/togglebutton';\nimport BaseSelectButton from './BaseSelectButton.vue';\n\nexport default {\n name: 'SelectButton',\n extends: BaseSelectButton,\n inheritAttrs: false,\n emits: ['change'],\n methods: {\n getOptionLabel(option) {\n return this.optionLabel ? resolveFieldData(option, this.optionLabel) : option;\n },\n getOptionValue(option) {\n return this.optionValue ? resolveFieldData(option, this.optionValue) : option;\n },\n getOptionRenderKey(option) {\n return this.dataKey ? resolveFieldData(option, this.dataKey) : this.getOptionLabel(option);\n },\n isOptionDisabled(option) {\n return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;\n },\n onOptionSelect(event, option, index) {\n if (this.disabled || this.isOptionDisabled(option)) {\n return;\n }\n\n let selected = this.isSelected(option);\n\n if (selected && !this.allowEmpty) {\n return;\n }\n\n let optionValue = this.getOptionValue(option);\n let newValue;\n\n if (this.multiple) {\n if (selected) newValue = this.d_value.filter((val) => !equals(val, optionValue, this.equalityKey));\n else newValue = this.d_value ? [...this.d_value, optionValue] : [optionValue];\n } else {\n newValue = selected ? null : optionValue;\n }\n\n this.writeValue(newValue, event);\n this.$emit('change', { event: event, value: newValue });\n },\n isSelected(option) {\n let selected = false;\n let optionValue = this.getOptionValue(option);\n\n if (this.multiple) {\n if (this.d_value) {\n for (let val of this.d_value) {\n if (equals(val, optionValue, this.equalityKey)) {\n selected = true;\n break;\n }\n }\n }\n } else {\n selected = equals(this.d_value, optionValue, this.equalityKey);\n }\n\n return selected;\n }\n },\n computed: {\n equalityKey() {\n return this.optionValue ? null : this.dataKey;\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n ToggleButton\n }\n};\n</script>\n"],"names":["name","BaseEditableHolder","props","options","Array","optionLabel","optionValue","optionDisabled","multiple","Boolean","allowEmpty","type","dataKey","ariaLabelledby","String","size","style","SelectButtonStyle","provide","$pcSelectButton","$parentInstance","BaseSelectButton","inheritAttrs","emits","methods","getOptionLabel","option","resolveFieldData","getOptionValue","getOptionRenderKey","isOptionDisabled","onOptionSelect","event","index","_this","disabled","selected","isSelected","newValue","d_value","filter","val","equals","equalityKey","concat","_toConsumableArray","writeValue","$emit","value","_iterator","_createForOfIteratorHelper","_step","s","n","done","err","e","f","computed","directives","ripple","Ripple","components","ToggleButton","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","role","ptmi","_Fragment","_renderList","_createBlock","_component_ToggleButton","key","$options","modelValue","onLabel","offLabel","unstyled","readonly","onChange","$event","pt","ptm","$slots","_renderSlot","_createElementVNode","ref_for","_toDisplayString"],"mappings":";;;;;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,kBAAkB;AACxB,EAAA,SAAA,EAASC,kBAAkB;AAC3BC,EAAAA,KAAK,EAAE;AACHC,IAAAA,OAAO,EAAEC,KAAK;AACdC,IAAAA,WAAW,EAAE,IAAI;AACjBC,IAAAA,WAAW,EAAE,IAAI;AACjBC,IAAAA,cAAc,EAAE,IAAI;AACpBC,IAAAA,QAAQ,EAAEC,OAAO;AACjBC,IAAAA,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AAAmB,MAAM,CAAC5D,MAAM;YAAG,SAAO;kBACnC,YAAA;QAAA,OAEM,CAFN6D,UAEM,CAAApB,IAAA,CAAAmB,MAAA,EAAA,QAAA,EAAA;AAFe5D,UAAAA,MAAM,EAAEA,MAAM;AAAGO,UAAAA,KAAK,EAAEA;WAA7C,YAAA;AAAA,UAAA,OAEM,CADFuD,kBAAA,CAAgF,QAAhFtB,UAAgF,CAAA;AAAAuB,YAAAA,OAAA,EAAA;WAAA,EAAlEtB,QAAG,CAAgC,gBAAA,CAAA,CAAA,OAAA,CAAA,CAAA,EAAAuB,eAAA,CAAAd,QAAA,CAAAnD,cAAc,CAACC,MAAM,CAAA,CAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/selectbutton/BaseSelectButton.vue","../../src/selectbutton/SelectButton.vue","../../src/selectbutton/SelectButton.vue?vue&type=template&id=d83aac12&lang.js"],"sourcesContent":["<script>\nimport BaseEditableHolder from '@primevue/core/baseeditableholder';\nimport SelectButtonStyle from 'primevue/selectbutton/style';\n\nexport default {\n name: 'BaseSelectButton',\n extends: BaseEditableHolder,\n props: {\n options: Array,\n optionLabel: null,\n optionValue: null,\n optionDisabled: null,\n multiple: Boolean,\n allowEmpty: {\n type: Boolean,\n default: true\n },\n dataKey: null,\n ariaLabelledby: {\n type: String,\n default: null\n },\n size: {\n type: String,\n default: null\n }\n },\n style: SelectButtonStyle,\n provide() {\n return {\n $pcSelectButton: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" role=\"group\" :aria-labelledby=\"ariaLabelledby\" v-bind=\"ptmi('root')\" :data-p=\"dataP\">\n <template v-for=\"(option, index) of options\" :key=\"getOptionRenderKey(option)\">\n <ToggleButton\n :modelValue=\"isSelected(option)\"\n :onLabel=\"getOptionLabel(option)\"\n :offLabel=\"getOptionLabel(option)\"\n :disabled=\"disabled || isOptionDisabled(option)\"\n :unstyled=\"unstyled\"\n :size=\"size\"\n :readonly=\"isOptionReadonly(option)\"\n @change=\"onOptionSelect($event, option, index)\"\n :pt=\"ptm('pcToggleButton')\"\n >\n <template v-if=\"$slots.option\" #default>\n <slot name=\"option\" :option=\"option\" :index=\"index\">\n <span v-bind=\"ptm('pcToggleButton')['label']\">{{ getOptionLabel(option) }}</span>\n </slot>\n </template>\n </ToggleButton>\n </template>\n </div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport { equals, resolveFieldData } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport ToggleButton from 'primevue/togglebutton';\nimport BaseSelectButton from './BaseSelectButton.vue';\n\nexport default {\n name: 'SelectButton',\n extends: BaseSelectButton,\n inheritAttrs: false,\n emits: ['change'],\n methods: {\n getOptionLabel(option) {\n return this.optionLabel ? resolveFieldData(option, this.optionLabel) : option;\n },\n getOptionValue(option) {\n return this.optionValue ? resolveFieldData(option, this.optionValue) : option;\n },\n getOptionRenderKey(option) {\n return this.dataKey ? resolveFieldData(option, this.dataKey) : this.getOptionLabel(option);\n },\n isOptionDisabled(option) {\n return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;\n },\n isOptionReadonly(option) {\n if (this.allowEmpty) return false;\n\n let selected = this.isSelected(option);\n\n if (this.multiple) {\n return selected && this.d_value.length === 1;\n } else {\n return selected;\n }\n },\n onOptionSelect(event, option, index) {\n if (this.disabled || this.isOptionDisabled(option) || this.isOptionReadonly(option)) {\n return;\n }\n\n let selected = this.isSelected(option);\n let optionValue = this.getOptionValue(option);\n let newValue;\n\n if (this.multiple) {\n if (selected) {\n newValue = this.d_value.filter((val) => !equals(val, optionValue, this.equalityKey));\n if (!this.allowEmpty && newValue.length === 0) return;\n } else {\n newValue = this.d_value ? [...this.d_value, optionValue] : [optionValue];\n }\n } else {\n if (selected && !this.allowEmpty) return;\n newValue = selected ? null : optionValue;\n }\n\n this.writeValue(newValue, event);\n this.$emit('change', { event: event, value: newValue });\n },\n isSelected(option) {\n let selected = false;\n let optionValue = this.getOptionValue(option);\n\n if (this.multiple) {\n if (this.d_value) {\n for (let val of this.d_value) {\n if (equals(val, optionValue, this.equalityKey)) {\n selected = true;\n break;\n }\n }\n }\n } else {\n selected = equals(this.d_value, optionValue, this.equalityKey);\n }\n\n return selected;\n }\n },\n computed: {\n equalityKey() {\n return this.optionValue ? null : this.dataKey;\n },\n dataP() {\n return cn({\n invalid: this.$invalid\n });\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n ToggleButton\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" role=\"group\" :aria-labelledby=\"ariaLabelledby\" v-bind=\"ptmi('root')\" :data-p=\"dataP\">\n <template v-for=\"(option, index) of options\" :key=\"getOptionRenderKey(option)\">\n <ToggleButton\n :modelValue=\"isSelected(option)\"\n :onLabel=\"getOptionLabel(option)\"\n :offLabel=\"getOptionLabel(option)\"\n :disabled=\"disabled || isOptionDisabled(option)\"\n :unstyled=\"unstyled\"\n :size=\"size\"\n :readonly=\"isOptionReadonly(option)\"\n @change=\"onOptionSelect($event, option, index)\"\n :pt=\"ptm('pcToggleButton')\"\n >\n <template v-if=\"$slots.option\" #default>\n <slot name=\"option\" :option=\"option\" :index=\"index\">\n <span v-bind=\"ptm('pcToggleButton')['label']\">{{ getOptionLabel(option) }}</span>\n </slot>\n </template>\n </ToggleButton>\n </template>\n </div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport { equals, resolveFieldData } from '@primeuix/utils/object';\nimport Ripple from 'primevue/ripple';\nimport ToggleButton from 'primevue/togglebutton';\nimport BaseSelectButton from './BaseSelectButton.vue';\n\nexport default {\n name: 'SelectButton',\n extends: BaseSelectButton,\n inheritAttrs: false,\n emits: ['change'],\n methods: {\n getOptionLabel(option) {\n return this.optionLabel ? resolveFieldData(option, this.optionLabel) : option;\n },\n getOptionValue(option) {\n return this.optionValue ? resolveFieldData(option, this.optionValue) : option;\n },\n getOptionRenderKey(option) {\n return this.dataKey ? resolveFieldData(option, this.dataKey) : this.getOptionLabel(option);\n },\n isOptionDisabled(option) {\n return this.optionDisabled ? resolveFieldData(option, this.optionDisabled) : false;\n },\n isOptionReadonly(option) {\n if (this.allowEmpty) return false;\n\n let selected = this.isSelected(option);\n\n if (this.multiple) {\n return selected && this.d_value.length === 1;\n } else {\n return selected;\n }\n },\n onOptionSelect(event, option, index) {\n if (this.disabled || this.isOptionDisabled(option) || this.isOptionReadonly(option)) {\n return;\n }\n\n let selected = this.isSelected(option);\n let optionValue = this.getOptionValue(option);\n let newValue;\n\n if (this.multiple) {\n if (selected) {\n newValue = this.d_value.filter((val) => !equals(val, optionValue, this.equalityKey));\n if (!this.allowEmpty && newValue.length === 0) return;\n } else {\n newValue = this.d_value ? [...this.d_value, optionValue] : [optionValue];\n }\n } else {\n if (selected && !this.allowEmpty) return;\n newValue = selected ? null : optionValue;\n }\n\n this.writeValue(newValue, event);\n this.$emit('change', { event: event, value: newValue });\n },\n isSelected(option) {\n let selected = false;\n let optionValue = this.getOptionValue(option);\n\n if (this.multiple) {\n if (this.d_value) {\n for (let val of this.d_value) {\n if (equals(val, optionValue, this.equalityKey)) {\n selected = true;\n break;\n }\n }\n }\n } else {\n selected = equals(this.d_value, optionValue, this.equalityKey);\n }\n\n return selected;\n }\n },\n computed: {\n equalityKey() {\n return this.optionValue ? null : this.dataKey;\n },\n dataP() {\n return cn({\n invalid: this.$invalid\n });\n }\n },\n directives: {\n ripple: Ripple\n },\n components: {\n ToggleButton\n }\n};\n</script>\n"],"names":["name","BaseEditableHolder","props","options","Array","optionLabel","optionValue","optionDisabled","multiple","Boolean","allowEmpty","type","dataKey","ariaLabelledby","String","size","style","SelectButtonStyle","provide","$pcSelectButton","$parentInstance","BaseSelectButton","inheritAttrs","emits","methods","getOptionLabel","option","resolveFieldData","getOptionValue","getOptionRenderKey","isOptionDisabled","isOptionReadonly","selected","isSelected","d_value","length","onOptionSelect","event","index","_this","disabled","newValue","filter","val","equals","equalityKey","concat","_toConsumableArray","writeValue","$emit","value","_iterator","_createForOfIteratorHelper","_step","s","n","done","err","e","f","computed","dataP","cn","invalid","$invalid","directives","ripple","Ripple","components","ToggleButton","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","role","ptmi","$options","_Fragment","_renderList","_createBlock","_component_ToggleButton","key","modelValue","onLabel","offLabel","unstyled","readonly","onChange","$event","pt","ptm","$slots","_renderSlot","_createElementVNode","ref_for","_toDisplayString"],"mappings":";;;;;;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,kBAAkB;AACxB,EAAA,SAAA,EAASC,kBAAkB;AAC3BC,EAAAA,KAAK,EAAE;AACHC,IAAAA,OAAO,EAAEC,KAAK;AACdC,IAAAA,WAAW,EAAE,IAAI;AACjBC,IAAAA,WAAW,EAAE,IAAI;AACjBC,IAAAA,cAAc,EAAE,IAAI;AACpBC,IAAAA,QAAQ,EAAEC,OAAO;AACjBC,IAAAA,UAAU,EAAE;AACRC,MAAAA,IAAI,EAAEF,OAAO;MACb,SAAS,EAAA;KACZ;AACDG,IAAAA,OAAO,EAAE,IAAI;AACbC,IAAAA,cAAc,EAAE;AACZF,MAAAA,IAAI,EAAEG,MAAM;MACZ,SAAS,EAAA;KACZ;AACDC,IAAAA,IAAI,EAAE;AACFJ,MAAAA,IAAI,EAAEG,MAAM;MACZ,SAAS,EAAA;AACb;GACH;AACDE,EAAAA,KAAK,EAAEC,iBAAiB;EACxBC,OAAO,EAAA,SAAPA,OAAOA,GAAG;IACN,OAAO;AACHC,MAAAA,eAAe,EAAE,IAAI;AACrBC,MAAAA,eAAe,EAAE;KACpB;AACL;AACJ,CAAC;;;;;;;;;ACHD,aAAe;AACXpB,EAAAA,IAAI,EAAE,cAAc;AACpB,EAAA,SAAA,EAASqB,QAAgB;AACzBC,EAAAA,YAAY,EAAE,KAAK;EACnBC,KAAK,EAAE,CAAC,QAAQ,CAAC;AACjBC,EAAAA,OAAO,EAAE;AACLC,IAAAA,cAAc,EAAdA,SAAAA,cAAcA,CAACC,MAAM,EA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AAO;kBACnC,YAAA;QAAA,OAEM,CAFNmE,UAEM,CAAApB,IAAA,CAAAmB,MAAA,EAAA,QAAA,EAAA;AAFelE,UAAAA,MAAM,EAAEA,MAAM;AAAGY,UAAAA,KAAK,EAAEA;WAA7C,YAAA;AAAA,UAAA,OAEM,CADFwD,kBAAA,CAAgF,QAAhFtB,UAAgF,CAAA;AAAAuB,YAAAA,OAAA,EAAA;WAAA,EAAlEtB,QAAG,CAAgC,gBAAA,CAAA,CAAA,OAAA,CAAA,CAAA,EAAAuB,eAAA,CAAAnB,QAAA,CAAApD,cAAc,CAACC,MAAM,CAAA,CAAA,EAAA,EAAA,CAAA;;;;;;;;;;;;"}
@@ -1,8 +1,9 @@
1
1
  <template>
2
- <div :class="cx('root')" :style="[sx('root'), containerStyle]" aria-hidden="true" v-bind="ptmi('root')"></div>
2
+ <div :class="cx('root')" :style="[sx('root'), containerStyle]" aria-hidden="true" v-bind="ptmi('root')" :data-p="dataP"></div>
3
3
  </template>
4
4
 
5
5
  <script>
6
+ import { cn } from '@primeuix/utils';
6
7
  import BaseSkeleton from './BaseSkeleton.vue';
7
8
 
8
9
  export default {
@@ -13,6 +14,11 @@ export default {
13
14
  containerStyle() {
14
15
  if (this.size) return { width: this.size, height: this.size, borderRadius: this.borderRadius };
15
16
  else return { width: this.width, height: this.height, borderRadius: this.borderRadius };
17
+ },
18
+ dataP() {
19
+ return cn({
20
+ [this.shape]: this.shape
21
+ });
16
22
  }
17
23
  }
18
24
  };
@@ -7,7 +7,7 @@
7
7
  * @module skeleton
8
8
  *
9
9
  */
10
- import type { DefineComponent, DesignToken, EmitFn, PassThrough } from '@primevue/core';
10
+ import type { DefineComponent, DesignToken, EmitFn, HintedString, PassThrough } from '@primevue/core';
11
11
  import type { ComponentHooks } from '@primevue/core/basecomponent';
12
12
  import type { PassThroughOptions } from 'primevue/passthrough';
13
13
 
@@ -70,7 +70,7 @@ export interface SkeletonProps {
70
70
  * Shape of the element.
71
71
  * @defaultValue rectangle
72
72
  */
73
- shape?: 'rectangle' | 'circle' | undefined;
73
+ shape?: HintedString<'rectangle' | 'circle'> | undefined;
74
74
  /**
75
75
  * Size of the Circle or Square.
76
76
  */
@@ -93,7 +93,7 @@ export interface SkeletonProps {
93
93
  * Type of the animation.
94
94
  * @defaultValue wave
95
95
  */
96
- animation?: 'wave' | 'none' | undefined;
96
+ animation?: HintedString<'wave' | 'none'> | undefined;
97
97
  /**
98
98
  * It generates scoped CSS variables using design tokens for the component.
99
99
  */
@@ -1,3 +1,4 @@
1
+ import { cn } from '@primeuix/utils';
1
2
  import BaseComponent from '@primevue/core/basecomponent';
2
3
  import SkeletonStyle from 'primevue/skeleton/style';
3
4
  import { createElementBlock, openBlock, mergeProps } from 'vue';
@@ -40,6 +41,10 @@ var script$1 = {
40
41
  }
41
42
  };
42
43
 
44
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
45
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; }
46
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
47
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
43
48
  var script = {
44
49
  name: 'Skeleton',
45
50
  "extends": script$1,
@@ -55,16 +60,22 @@ var script = {
55
60
  height: this.height,
56
61
  borderRadius: this.borderRadius
57
62
  };
63
+ },
64
+ dataP: function dataP() {
65
+ return cn(_defineProperty({}, this.shape, this.shape));
58
66
  }
59
67
  }
60
68
  };
61
69
 
70
+ var _hoisted_1 = ["data-p"];
62
71
  function render(_ctx, _cache, $props, $setup, $data, $options) {
63
72
  return openBlock(), createElementBlock("div", mergeProps({
64
73
  "class": _ctx.cx('root'),
65
74
  style: [_ctx.sx('root'), $options.containerStyle],
66
75
  "aria-hidden": "true"
67
- }, _ctx.ptmi('root')), null, 16);
76
+ }, _ctx.ptmi('root'), {
77
+ "data-p": $options.dataP
78
+ }), null, 16, _hoisted_1);
68
79
  }
69
80
 
70
81
  script.render = render;
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/skeleton/BaseSkeleton.vue","../../src/skeleton/Skeleton.vue","../../src/skeleton/Skeleton.vue?vue&type=template&id=c4ee700c&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport SkeletonStyle from 'primevue/skeleton/style';\n\nexport default {\n name: 'BaseSkeleton',\n extends: BaseComponent,\n props: {\n shape: {\n type: String,\n default: 'rectangle'\n },\n size: {\n type: String,\n default: null\n },\n width: {\n type: String,\n default: '100%'\n },\n height: {\n type: String,\n default: '1rem'\n },\n borderRadius: {\n type: String,\n default: null\n },\n animation: {\n type: String,\n default: 'wave'\n }\n },\n style: SkeletonStyle,\n provide() {\n return {\n $pcSkeleton: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :style=\"[sx('root'), containerStyle]\" aria-hidden=\"true\" v-bind=\"ptmi('root')\"></div>\n</template>\n\n<script>\nimport BaseSkeleton from './BaseSkeleton.vue';\n\nexport default {\n name: 'Skeleton',\n extends: BaseSkeleton,\n inheritAttrs: false,\n computed: {\n containerStyle() {\n if (this.size) return { width: this.size, height: this.size, borderRadius: this.borderRadius };\n else return { width: this.width, height: this.height, borderRadius: this.borderRadius };\n }\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :style=\"[sx('root'), containerStyle]\" aria-hidden=\"true\" v-bind=\"ptmi('root')\"></div>\n</template>\n\n<script>\nimport BaseSkeleton from './BaseSkeleton.vue';\n\nexport default {\n name: 'Skeleton',\n extends: BaseSkeleton,\n inheritAttrs: false,\n computed: {\n containerStyle() {\n if (this.size) return { width: this.size, height: this.size, borderRadius: this.borderRadius };\n else return { width: this.width, height: this.height, borderRadius: this.borderRadius };\n }\n }\n};\n</script>\n"],"names":["name","BaseComponent","props","shape","type","String","size","width","height","borderRadius","animation","style","SkeletonStyle","provide","$pcSkeleton","$parentInstance","BaseSkeleton","inheritAttrs","computed","containerStyle","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","sx","$options","ptmi"],"mappings":";;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,cAAc;AACpB,EAAA,SAAA,EAASC,aAAa;AACtBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,KAAK,EAAE;AACHC,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDC,IAAAA,IAAI,EAAE;AACFF,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDE,IAAAA,KAAK,EAAE;AACHH,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDG,IAAAA,MAAM,EAAE;AACJJ,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDI,IAAAA,YAAY,EAAE;AACVL,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDK,IAAAA,SAAS,EAAE;AACPN,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;AACb;GACH;AACDM,EAAAA,KAAK,EAAEC,aAAa;EACpBC,OAAO,EAAA,SAAPA,OAAOA,GAAG;IACN,OAAO;AACHC,MAAAA,WAAW,EAAE,IAAI;AACjBC,MAAAA,eAAe,EAAE;KACpB;AACL;AACJ,CAAC;;ACjCD,aAAe;AACXf,EAAAA,IAAI,EAAE,UAAU;AAChB,EAAA,SAAA,EAASgB,QAAY;AACrBC,EAAAA,YAAY,EAAE,KAAK;AACnBC,EAAAA,QAAQ,EAAE;IACNC,cAAc,EAAA,SAAdA,cAAcA,GAAG;AACb,MAAA,IAAI,IAAI,CAACb,IAAI,EAAE,OAAO;QAAEC,KAAK,EAAE,IAAI,CAACD,IAAI;QAAEE,MAAM,EAAE,IAAI,CAACF,IAAI;QAAEG,YAAY,EAAE,IAAI,CAACA;OAAc,CAAA,KACzF,OAAO;QAAEF,KAAK,EAAE,IAAI,CAACA,KAAK;QAAEC,MAAM,EAAE,IAAI,CAACA,MAAM;QAAEC,YAAY,EAAE,IAAI,CAACA;OAAc;AAC3F;AACJ;AACJ,CAAC;;;EChBG,OAAAW,SAAA,EAAA,EAAAC,kBAAA,CAA6G,OAA7GC,UAA6G,CAAA;AAAvG,IAAA,OAAA,EAAOC,IAAE,CAAAC,EAAA,CAAA,MAAA,CAAA;AAAWb,IAAAA,KAAK,EAAA,CAAGY,IAAE,CAAAE,EAAA,CAAA,MAAA,CAAA,EAAUC,QAAc,CAAAP,cAAA,CAAA;AAAG,IAAA,aAAW,EAAC;KAAeI,IAAI,CAAAI,IAAA,CAAA,MAAA,CAAA,CAAA,EAAA,IAAA,EAAA,EAAA,CAAA;;;;;;;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/skeleton/BaseSkeleton.vue","../../src/skeleton/Skeleton.vue","../../src/skeleton/Skeleton.vue?vue&type=template&id=18eef55c&lang.js"],"sourcesContent":["<script>\nimport BaseComponent from '@primevue/core/basecomponent';\nimport SkeletonStyle from 'primevue/skeleton/style';\n\nexport default {\n name: 'BaseSkeleton',\n extends: BaseComponent,\n props: {\n shape: {\n type: String,\n default: 'rectangle'\n },\n size: {\n type: String,\n default: null\n },\n width: {\n type: String,\n default: '100%'\n },\n height: {\n type: String,\n default: '1rem'\n },\n borderRadius: {\n type: String,\n default: null\n },\n animation: {\n type: String,\n default: 'wave'\n }\n },\n style: SkeletonStyle,\n provide() {\n return {\n $pcSkeleton: this,\n $parentInstance: this\n };\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :style=\"[sx('root'), containerStyle]\" aria-hidden=\"true\" v-bind=\"ptmi('root')\" :data-p=\"dataP\"></div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport BaseSkeleton from './BaseSkeleton.vue';\n\nexport default {\n name: 'Skeleton',\n extends: BaseSkeleton,\n inheritAttrs: false,\n computed: {\n containerStyle() {\n if (this.size) return { width: this.size, height: this.size, borderRadius: this.borderRadius };\n else return { width: this.width, height: this.height, borderRadius: this.borderRadius };\n },\n dataP() {\n return cn({\n [this.shape]: this.shape\n });\n }\n }\n};\n</script>\n","<template>\n <div :class=\"cx('root')\" :style=\"[sx('root'), containerStyle]\" aria-hidden=\"true\" v-bind=\"ptmi('root')\" :data-p=\"dataP\"></div>\n</template>\n\n<script>\nimport { cn } from '@primeuix/utils';\nimport BaseSkeleton from './BaseSkeleton.vue';\n\nexport default {\n name: 'Skeleton',\n extends: BaseSkeleton,\n inheritAttrs: false,\n computed: {\n containerStyle() {\n if (this.size) return { width: this.size, height: this.size, borderRadius: this.borderRadius };\n else return { width: this.width, height: this.height, borderRadius: this.borderRadius };\n },\n dataP() {\n return cn({\n [this.shape]: this.shape\n });\n }\n }\n};\n</script>\n"],"names":["name","BaseComponent","props","shape","type","String","size","width","height","borderRadius","animation","style","SkeletonStyle","provide","$pcSkeleton","$parentInstance","BaseSkeleton","inheritAttrs","computed","containerStyle","dataP","cn","_defineProperty","_openBlock","_createElementBlock","_mergeProps","_ctx","cx","sx","$options","ptmi","_hoisted_1"],"mappings":";;;;;AAIA,eAAe;AACXA,EAAAA,IAAI,EAAE,cAAc;AACpB,EAAA,SAAA,EAASC,aAAa;AACtBC,EAAAA,KAAK,EAAE;AACHC,IAAAA,KAAK,EAAE;AACHC,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDC,IAAAA,IAAI,EAAE;AACFF,MAAAA,IAAI,EAAEC,MAAM;MACZ,SAAS,EAAA;KACZ;AACDE,IAA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OC,IAAE,CAAAC,EAAA,CAAA,MAAA,CAAA;AAAWhB,IAAAA,KAAK,EAAA,CAAGe,IAAE,CAAAE,EAAA,CAAA,MAAA,CAAA,EAAUC,QAAc,CAAAV,cAAA,CAAA;AAAG,IAAA,aAAW,EAAC;KAAeO,IAAI,CAAAI,IAAA,CAAA,MAAA,CAAA,EAAA;IAAW,QAAM,EAAED,QAAK,CAAAT;AAAA,GAAA,CAAA,EAAA,IAAA,EAAA,EAAA,EAAAW,UAAA,CAAA;;;;;;;"}
package/slider/Slider.vue CHANGED
@@ -1,6 +1,6 @@
1
1
  <template>
2
- <div :class="cx('root')" @click="onBarClick" v-bind="ptmi('root')" :data-p-sliding="false">
3
- <span :class="cx('range')" :style="[sx('range'), rangeStyle()]" v-bind="ptm('range')"></span>
2
+ <div :class="cx('root')" @click="onBarClick" v-bind="ptmi('root')" :data-p-sliding="false" :data-p="dataP">
3
+ <span :class="cx('range')" :style="[sx('range'), rangeStyle()]" v-bind="ptm('range')" :data-p="dataP"></span>
4
4
  <span
5
5
  v-if="!range"
6
6
  :class="cx('handle')"
@@ -20,6 +20,7 @@
20
20
  :aria-label="ariaLabel"
21
21
  :aria-orientation="orientation"
22
22
  v-bind="ptm('handle')"
23
+ :data-p="dataP"
23
24
  ></span>
24
25
  <span
25
26
  v-if="range"
@@ -40,6 +41,7 @@
40
41
  :aria-label="ariaLabel"
41
42
  :aria-orientation="orientation"
42
43
  v-bind="ptm('startHandler')"
44
+ :data-p="dataP"
43
45
  ></span>
44
46
  <span
45
47
  v-if="range"
@@ -60,11 +62,13 @@
60
62
  :aria-label="ariaLabel"
61
63
  :aria-orientation="orientation"
62
64
  v-bind="ptm('endHandler')"
65
+ :data-p="dataP"
63
66
  ></span>
64
67
  </div>
65
68
  </template>
66
69
 
67
70
  <script>
71
+ import { cn } from '@primeuix/utils';
68
72
  import { getAttribute, getWindowScrollLeft, getWindowScrollTop, isRTL } from '@primeuix/utils/dom';
69
73
  import BaseSlider from './BaseSlider.vue';
70
74
 
@@ -359,6 +363,11 @@ export default {
359
363
  if (this.value[1] > this.max) return 100;
360
364
  else return ((this.value[1] - this.min) * 100) / (this.max - this.min);
361
365
  } else return 100;
366
+ },
367
+ dataP() {
368
+ return cn({
369
+ [this.orientation]: this.orientation
370
+ });
362
371
  }
363
372
  }
364
373
  };
package/slider/index.d.ts CHANGED
@@ -7,7 +7,7 @@
7
7
  * @module slider
8
8
  *
9
9
  */
10
- import type { DefineComponent, DesignToken, EmitFn, PassThrough } from '@primevue/core';
10
+ import type { DefineComponent, DesignToken, EmitFn, HintedString, PassThrough } from '@primevue/core';
11
11
  import type { ComponentHooks } from '@primevue/core/basecomponent';
12
12
  import type { PassThroughOptions } from 'primevue/passthrough';
13
13
 
@@ -123,7 +123,7 @@ export interface SliderProps {
123
123
  * Orientation of the slider.
124
124
  * @defaultValue horizontal
125
125
  */
126
- orientation?: 'horizontal' | 'vertical' | undefined;
126
+ orientation?: HintedString<'horizontal' | 'vertical'> | undefined;
127
127
  /**
128
128
  * Step factor to increment/decrement the value.
129
129
  * @defaultValue 1
package/slider/index.mjs CHANGED
@@ -1,3 +1,4 @@
1
+ import { cn } from '@primeuix/utils';
1
2
  import { getAttribute, isRTL, getWindowScrollLeft, getWindowScrollTop } from '@primeuix/utils/dom';
2
3
  import BaseEditableHolder from '@primevue/core/baseeditableholder';
3
4
  import SliderStyle from 'primevue/slider/style';
@@ -49,6 +50,10 @@ var script$1 = {
49
50
  }
50
51
  };
51
52
 
53
+ function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
54
+ function _defineProperty(e, r, t) { return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, { value: t, enumerable: true, configurable: true, writable: true }) : e[r] = t, e; }
55
+ function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
56
+ function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
52
57
  function _toConsumableArray(r) { return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread(); }
53
58
  function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
54
59
  function _unsupportedIterableToArray(r, a) { if (r) { if ("string" == typeof r) return _arrayLikeToArray(r, a); var t = {}.toString.call(r).slice(8, -1); return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0; } }
@@ -329,13 +334,18 @@ var script = {
329
334
  if (this.value && this.value.length === 2 && this.value[1] !== undefined) {
330
335
  if (this.value[1] > this.max) return 100;else return (this.value[1] - this.min) * 100 / (this.max - this.min);
331
336
  } else return 100;
337
+ },
338
+ dataP: function dataP() {
339
+ return cn(_defineProperty({}, this.orientation, this.orientation));
332
340
  }
333
341
  }
334
342
  };
335
343
 
336
- var _hoisted_1 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
337
- var _hoisted_2 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
338
- var _hoisted_3 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation"];
344
+ var _hoisted_1 = ["data-p"];
345
+ var _hoisted_2 = ["data-p"];
346
+ var _hoisted_3 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation", "data-p"];
347
+ var _hoisted_4 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation", "data-p"];
348
+ var _hoisted_5 = ["tabindex", "aria-valuemin", "aria-valuenow", "aria-valuemax", "aria-labelledby", "aria-label", "aria-orientation", "data-p"];
339
349
  function render(_ctx, _cache, $props, $setup, $data, $options) {
340
350
  return openBlock(), createElementBlock("div", mergeProps({
341
351
  "class": _ctx.cx('root'),
@@ -343,11 +353,14 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
343
353
  return $options.onBarClick && $options.onBarClick.apply($options, arguments);
344
354
  })
345
355
  }, _ctx.ptmi('root'), {
346
- "data-p-sliding": false
356
+ "data-p-sliding": false,
357
+ "data-p": $options.dataP
347
358
  }), [createElementVNode("span", mergeProps({
348
359
  "class": _ctx.cx('range'),
349
360
  style: [_ctx.sx('range'), $options.rangeStyle()]
350
- }, _ctx.ptm('range')), null, 16), !_ctx.range ? (openBlock(), createElementBlock("span", mergeProps({
361
+ }, _ctx.ptm('range'), {
362
+ "data-p": $options.dataP
363
+ }), null, 16, _hoisted_2), !_ctx.range ? (openBlock(), createElementBlock("span", mergeProps({
351
364
  key: 0,
352
365
  "class": _ctx.cx('handle'),
353
366
  style: [_ctx.sx('handle'), $options.handleStyle()],
@@ -377,7 +390,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
377
390
  "aria-labelledby": _ctx.ariaLabelledby,
378
391
  "aria-label": _ctx.ariaLabel,
379
392
  "aria-orientation": _ctx.orientation
380
- }, _ctx.ptm('handle')), null, 16, _hoisted_1)) : createCommentVNode("", true), _ctx.range ? (openBlock(), createElementBlock("span", mergeProps({
393
+ }, _ctx.ptm('handle'), {
394
+ "data-p": $options.dataP
395
+ }), null, 16, _hoisted_3)) : createCommentVNode("", true), _ctx.range ? (openBlock(), createElementBlock("span", mergeProps({
381
396
  key: 1,
382
397
  "class": _ctx.cx('handle'),
383
398
  style: [_ctx.sx('handle'), $options.rangeStartHandleStyle()],
@@ -407,7 +422,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
407
422
  "aria-labelledby": _ctx.ariaLabelledby,
408
423
  "aria-label": _ctx.ariaLabel,
409
424
  "aria-orientation": _ctx.orientation
410
- }, _ctx.ptm('startHandler')), null, 16, _hoisted_2)) : createCommentVNode("", true), _ctx.range ? (openBlock(), createElementBlock("span", mergeProps({
425
+ }, _ctx.ptm('startHandler'), {
426
+ "data-p": $options.dataP
427
+ }), null, 16, _hoisted_4)) : createCommentVNode("", true), _ctx.range ? (openBlock(), createElementBlock("span", mergeProps({
411
428
  key: 2,
412
429
  "class": _ctx.cx('handle'),
413
430
  style: [_ctx.sx('handle'), $options.rangeEndHandleStyle()],
@@ -437,7 +454,9 @@ function render(_ctx, _cache, $props, $setup, $data, $options) {
437
454
  "aria-labelledby": _ctx.ariaLabelledby,
438
455
  "aria-label": _ctx.ariaLabel,
439
456
  "aria-orientation": _ctx.orientation
440
- }, _ctx.ptm('endHandler')), null, 16, _hoisted_3)) : createCommentVNode("", true)], 16);
457
+ }, _ctx.ptm('endHandler'), {
458
+ "data-p": $options.dataP
459
+ }), null, 16, _hoisted_5)) : createCommentVNode("", true)], 16, _hoisted_1);
441
460
  }
442
461
 
443
462
  script.render = render;