primevue 3.48.0 → 3.48.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 (140) hide show
  1. package/config/PrimeVue.d.ts +1 -1
  2. package/core/core.js +25 -17
  3. package/core/core.min.js +2 -2
  4. package/dropdown/Dropdown.vue +1 -0
  5. package/dropdown/dropdown.cjs.js +10 -7
  6. package/dropdown/dropdown.cjs.min.js +1 -1
  7. package/dropdown/dropdown.esm.js +10 -7
  8. package/dropdown/dropdown.esm.min.js +1 -1
  9. package/dropdown/dropdown.js +10 -7
  10. package/dropdown/dropdown.min.js +1 -1
  11. package/floatlabel/FloatLabel.d.ts +0 -4
  12. package/inputswitch/InputSwitch.d.ts +0 -5
  13. package/multiselect/MultiSelect.vue +1 -0
  14. package/multiselect/multiselect.cjs.js +11 -8
  15. package/multiselect/multiselect.cjs.min.js +1 -1
  16. package/multiselect/multiselect.esm.js +11 -8
  17. package/multiselect/multiselect.esm.min.js +1 -1
  18. package/multiselect/multiselect.js +11 -8
  19. package/multiselect/multiselect.min.js +1 -1
  20. package/package.json +1 -1
  21. package/resources/themes/arya-blue/theme.css +11 -16
  22. package/resources/themes/arya-green/theme.css +11 -16
  23. package/resources/themes/arya-orange/theme.css +11 -16
  24. package/resources/themes/arya-purple/theme.css +11 -16
  25. package/resources/themes/aura-dark-amber/theme.css +16 -21
  26. package/resources/themes/aura-dark-blue/theme.css +16 -21
  27. package/resources/themes/aura-dark-cyan/theme.css +16 -21
  28. package/resources/themes/aura-dark-green/theme.css +16 -21
  29. package/resources/themes/aura-dark-indigo/theme.css +16 -21
  30. package/resources/themes/aura-dark-lime/theme.css +16 -21
  31. package/resources/themes/aura-dark-noir/theme.css +16 -21
  32. package/resources/themes/aura-dark-pink/theme.css +16 -21
  33. package/resources/themes/aura-dark-purple/theme.css +16 -21
  34. package/resources/themes/aura-dark-teal/theme.css +16 -21
  35. package/resources/themes/aura-light-amber/theme.css +16 -24
  36. package/resources/themes/aura-light-blue/theme.css +16 -24
  37. package/resources/themes/aura-light-cyan/theme.css +16 -24
  38. package/resources/themes/aura-light-green/theme.css +16 -24
  39. package/resources/themes/aura-light-indigo/theme.css +16 -24
  40. package/resources/themes/aura-light-lime/theme.css +16 -24
  41. package/resources/themes/aura-light-noir/theme.css +16 -24
  42. package/resources/themes/aura-light-pink/theme.css +16 -24
  43. package/resources/themes/aura-light-purple/theme.css +16 -24
  44. package/resources/themes/aura-light-teal/theme.css +16 -24
  45. package/resources/themes/bootstrap4-dark-blue/theme.css +11 -16
  46. package/resources/themes/bootstrap4-dark-purple/theme.css +11 -16
  47. package/resources/themes/bootstrap4-light-blue/theme.css +11 -16
  48. package/resources/themes/bootstrap4-light-purple/theme.css +11 -16
  49. package/resources/themes/fluent-light/theme.css +11 -16
  50. package/resources/themes/lara-dark-amber/theme.css +11 -16
  51. package/resources/themes/lara-dark-blue/theme.css +11 -16
  52. package/resources/themes/lara-dark-cyan/theme.css +11 -16
  53. package/resources/themes/lara-dark-green/theme.css +11 -16
  54. package/resources/themes/lara-dark-indigo/theme.css +11 -16
  55. package/resources/themes/lara-dark-pink/theme.css +11 -16
  56. package/resources/themes/lara-dark-purple/theme.css +11 -16
  57. package/resources/themes/lara-dark-teal/theme.css +11 -16
  58. package/resources/themes/lara-light-amber/theme.css +11 -16
  59. package/resources/themes/lara-light-blue/theme.css +11 -16
  60. package/resources/themes/lara-light-cyan/theme.css +11 -16
  61. package/resources/themes/lara-light-green/theme.css +11 -16
  62. package/resources/themes/lara-light-indigo/theme.css +11 -16
  63. package/resources/themes/lara-light-pink/theme.css +11 -16
  64. package/resources/themes/lara-light-purple/theme.css +11 -16
  65. package/resources/themes/lara-light-teal/theme.css +11 -16
  66. package/resources/themes/luna-amber/theme.css +11 -16
  67. package/resources/themes/luna-blue/theme.css +11 -16
  68. package/resources/themes/luna-green/theme.css +11 -16
  69. package/resources/themes/luna-pink/theme.css +11 -16
  70. package/resources/themes/md-dark-deeppurple/theme.css +11 -16
  71. package/resources/themes/md-dark-indigo/theme.css +11 -16
  72. package/resources/themes/md-light-deeppurple/theme.css +11 -16
  73. package/resources/themes/md-light-indigo/theme.css +11 -16
  74. package/resources/themes/mdc-dark-deeppurple/theme.css +11 -16
  75. package/resources/themes/mdc-dark-indigo/theme.css +11 -16
  76. package/resources/themes/mdc-light-deeppurple/theme.css +11 -16
  77. package/resources/themes/mdc-light-indigo/theme.css +11 -16
  78. package/resources/themes/mira/theme.css +11 -16
  79. package/resources/themes/nano/theme.css +11 -16
  80. package/resources/themes/nova/theme.css +11 -16
  81. package/resources/themes/nova-accent/theme.css +11 -16
  82. package/resources/themes/nova-alt/theme.css +11 -16
  83. package/resources/themes/nova-vue/theme.css +11 -16
  84. package/resources/themes/rhea/theme.css +11 -16
  85. package/resources/themes/saga-blue/theme.css +11 -16
  86. package/resources/themes/saga-green/theme.css +11 -16
  87. package/resources/themes/saga-orange/theme.css +11 -16
  88. package/resources/themes/saga-purple/theme.css +11 -16
  89. package/resources/themes/soho-dark/theme.css +11 -16
  90. package/resources/themes/soho-light/theme.css +11 -16
  91. package/resources/themes/tailwind-light/theme.css +11 -16
  92. package/resources/themes/vela-blue/theme.css +11 -16
  93. package/resources/themes/vela-green/theme.css +11 -16
  94. package/resources/themes/vela-orange/theme.css +11 -16
  95. package/resources/themes/vela-purple/theme.css +11 -16
  96. package/resources/themes/viva-dark/theme.css +11 -16
  97. package/resources/themes/viva-light/theme.css +11 -16
  98. package/splitter/Splitter.vue +7 -5
  99. package/splitter/splitter.cjs.js +7 -5
  100. package/splitter/splitter.cjs.min.js +1 -1
  101. package/splitter/splitter.esm.js +7 -5
  102. package/splitter/splitter.esm.min.js +1 -1
  103. package/splitter/splitter.js +7 -5
  104. package/splitter/splitter.min.js +1 -1
  105. package/virtualscroller/VirtualScroller.vue +8 -4
  106. package/virtualscroller/virtualscroller.cjs.js +15 -10
  107. package/virtualscroller/virtualscroller.cjs.min.js +1 -1
  108. package/virtualscroller/virtualscroller.esm.js +15 -10
  109. package/virtualscroller/virtualscroller.esm.min.js +1 -1
  110. package/virtualscroller/virtualscroller.js +15 -10
  111. package/virtualscroller/virtualscroller.min.js +1 -1
  112. package/web-types.json +1 -1
  113. package/step/BaseStep.vue +0 -18
  114. package/step/Step.vue +0 -12
  115. package/step/step.cjs.js +0 -37
  116. package/step/step.cjs.min.js +0 -1
  117. package/step/step.esm.js +0 -30
  118. package/step/step.esm.min.js +0 -1
  119. package/step/step.js +0 -37
  120. package/step/step.min.js +0 -1
  121. package/step/style/stepstyle.cjs.js +0 -5
  122. package/step/style/stepstyle.cjs.min.js +0 -1
  123. package/step/style/stepstyle.esm.js +0 -3
  124. package/step/style/stepstyle.esm.min.js +0 -1
  125. package/step/style/stepstyle.js +0 -10
  126. package/step/style/stepstyle.min.js +0 -1
  127. package/stepper/BaseStepper.vue +0 -25
  128. package/stepper/Stepper.vue +0 -234
  129. package/stepper/stepper.cjs.js +0 -271
  130. package/stepper/stepper.cjs.min.js +0 -1
  131. package/stepper/stepper.esm.js +0 -264
  132. package/stepper/stepper.esm.min.js +0 -1
  133. package/stepper/stepper.js +0 -270
  134. package/stepper/stepper.min.js +0 -1
  135. package/stepper/style/stepperstyle.cjs.js +0 -50
  136. package/stepper/style/stepperstyle.cjs.min.js +0 -1
  137. package/stepper/style/stepperstyle.esm.js +0 -44
  138. package/stepper/style/stepperstyle.esm.min.js +0 -1
  139. package/stepper/style/stepperstyle.js +0 -53
  140. package/stepper/style/stepperstyle.min.js +0 -1
package/step/step.esm.js DELETED
@@ -1,30 +0,0 @@
1
- import BaseComponent from 'primevue/basecomponent';
2
- import StepStyle from 'primevue/step/style';
3
- import { renderSlot } from 'vue';
4
-
5
- var script$1 = {
6
- name: 'BaseStep',
7
- "extends": BaseComponent,
8
- props: {
9
- header: null,
10
- headerStyle: null,
11
- headerClass: null,
12
- contentStyle: null,
13
- contentClass: null,
14
- disabled: Boolean
15
- },
16
- style: StepStyle
17
- };
18
-
19
- var script = {
20
- name: 'Step',
21
- "extends": script$1
22
- };
23
-
24
- function render(_ctx, _cache, $props, $setup, $data, $options) {
25
- return renderSlot(_ctx.$slots, "default");
26
- }
27
-
28
- script.render = render;
29
-
30
- export { script as default };
@@ -1 +0,0 @@
1
- import e from"primevue/basecomponent";import t from"primevue/step/style";import{renderSlot as l}from"vue";var n={name:"Step",extends:{name:"BaseStep",extends:e,props:{header:null,headerStyle:null,headerClass:null,contentStyle:null,contentClass:null,disabled:Boolean},style:t}};n.render=function(e,t,n,r,o,s){return l(e.$slots,"default")};export{n as default};
package/step/step.js DELETED
@@ -1,37 +0,0 @@
1
- this.primevue = this.primevue || {};
2
- this.primevue.step = (function (BaseComponent, StepStyle, vue) {
3
- 'use strict';
4
-
5
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
6
-
7
- var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
8
- var StepStyle__default = /*#__PURE__*/_interopDefaultLegacy(StepStyle);
9
-
10
- var script$1 = {
11
- name: 'BaseStep',
12
- "extends": BaseComponent__default["default"],
13
- props: {
14
- header: null,
15
- headerStyle: null,
16
- headerClass: null,
17
- contentStyle: null,
18
- contentClass: null,
19
- disabled: Boolean
20
- },
21
- style: StepStyle__default["default"]
22
- };
23
-
24
- var script = {
25
- name: 'Step',
26
- "extends": script$1
27
- };
28
-
29
- function render(_ctx, _cache, $props, $setup, $data, $options) {
30
- return vue.renderSlot(_ctx.$slots, "default");
31
- }
32
-
33
- script.render = render;
34
-
35
- return script;
36
-
37
- })(primevue.basecomponent, StepStyle, Vue);
package/step/step.min.js DELETED
@@ -1 +0,0 @@
1
- this.primevue=this.primevue||{},this.primevue.step=function(e,t,n){"use strict";function l(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var u={name:"Step",extends:{name:"BaseStep",extends:l(e).default,props:{header:null,headerStyle:null,headerClass:null,contentStyle:null,contentClass:null,disabled:Boolean},style:l(t).default}};return u.render=function(e,t,l,u,r,s){return n.renderSlot(e.$slots,"default")},u}(primevue.basecomponent,StepStyle,Vue);
@@ -1,5 +0,0 @@
1
- 'use strict';
2
-
3
- var StepStyle = {};
4
-
5
- module.exports = StepStyle;
@@ -1 +0,0 @@
1
- "use strict";module.exports={};
@@ -1,3 +0,0 @@
1
- var StepStyle = {};
2
-
3
- export { StepStyle as default };
@@ -1 +0,0 @@
1
- var a={};export{a as default};
@@ -1,10 +0,0 @@
1
- this.primevue = this.primevue || {};
2
- this.primevue.step = this.primevue.step || {};
3
- this.primevue.step.style = (function () {
4
- 'use strict';
5
-
6
- var StepStyle = {};
7
-
8
- return StepStyle;
9
-
10
- })();
@@ -1 +0,0 @@
1
- this.primevue=this.primevue||{},this.primevue.step=this.primevue.step||{},this.primevue.step.style=function(){"use strict";return{}}();
@@ -1,25 +0,0 @@
1
- <script>
2
- import BaseComponent from 'primevue/basecomponent';
3
- import StepperStyle from 'primevue/stepper/style';
4
-
5
- export default {
6
- name: 'BaseStepper',
7
- extends: BaseComponent,
8
- props: {
9
- activeStep: {
10
- type: Number,
11
- default: 0
12
- },
13
- orientation: {
14
- type: String,
15
- default: 'horizontal'
16
- }
17
- },
18
- style: StepperStyle,
19
- provide() {
20
- return {
21
- $parentInstance: this
22
- };
23
- }
24
- };
25
- </script>
@@ -1,234 +0,0 @@
1
- <template>
2
- <div :class="cx('root')" role="tablist">
3
- <div :class="cx('navContent')">
4
- <ul ref="list" :class="cx('nav')">
5
- <li
6
- v-for="(step, index) of steps"
7
- :key="getStepKey(step, index)"
8
- :class="cx('step.header', { step, index })"
9
- :style="getStepProp(step, 'headerStyle')"
10
- :aria-current="isStepActive(index) ? 'step' : undefined"
11
- @click="onItemClick($event, step, index)"
12
- @keydown="onItemKeydown($event, step, index)"
13
- v-bind="{ ...getStepPT(step, 'root', index), ...getStepPT(step, 'header', index) }"
14
- data-pc-name="step"
15
- :data-p-highlight="isStepActive(index)"
16
- :data-p-disabled="getStepProp(step, 'disabled')"
17
- :data-pc-index="index"
18
- :data-p-active="isStepActive(index)"
19
- >
20
- <slot name="header">
21
- <span :class="cx('step.action')">
22
- <span :class="cx('step.step')">{{ index + 1 }}</span>
23
- <span :class="cx('step.title')">{{ getStepProp(step, 'header') }}</span>
24
- </span>
25
- </slot>
26
- </li>
27
- </ul>
28
- </div>
29
- <div :class="cx('stepContainer')">
30
- <template v-for="(step, index) of steps" :key="getStepKey(step, index)">
31
- <div
32
- v-if="isStepActive(index)"
33
- :id="getStepContentId(index)"
34
- :class="cx('step.content', { step })"
35
- :style="getStepProp(step, 'contentStyle')"
36
- role="tabpanel"
37
- :aria-labelledby="getStepHeaderActionId(index)"
38
- v-bind="{ ...getStepPT(step, 'root', index), ...getStepPT(step, 'content', index) }"
39
- data-pc-name="step"
40
- :data-pc-index="index"
41
- :data-p-active="isStepActive(index)"
42
- >
43
- <component :is="step"></component>
44
- </div>
45
- </template>
46
- </div>
47
- </div>
48
- </template>
49
-
50
- <script>
51
- import { UniqueComponentId } from 'primevue/utils';
52
- import { mergeProps } from 'vue';
53
- import BaseStepper from './BaseStepper.vue';
54
-
55
- export default {
56
- name: 'Stepper',
57
- extends: BaseStepper,
58
- emits: ['update:activeStep', 'step-change'],
59
- data() {
60
- return {
61
- id: this.$attrs.id,
62
- d_activeStep: this.activeStep
63
- };
64
- },
65
- watch: {
66
- '$attrs.id': function (newValue) {
67
- this.id = newValue || UniqueComponentId();
68
- },
69
- activeStep(newValue) {
70
- this.d_activeStep = newValue;
71
- }
72
- },
73
- mounted() {
74
- this.id = this.id || UniqueComponentId();
75
- },
76
- methods: {
77
- isStep(child) {
78
- return child.type.name === 'Step';
79
- },
80
- isStepActive(index) {
81
- return this.d_activeStep === index;
82
- },
83
- getStepProp(step, name) {
84
- return step.props ? step.props[name] : undefined;
85
- },
86
- getStepKey(step, index) {
87
- return this.getStepProp(step, 'header') || index;
88
- },
89
- getStepHeaderActionId(index) {
90
- return `${this.id}_${index}_header_action`;
91
- },
92
- getStepContentId(index) {
93
- return `${this.id}_${index}_content`;
94
- },
95
- getStepPT(step, key, index) {
96
- const count = this.steps.length;
97
- const stepMetaData = {
98
- props: step.props,
99
- parent: {
100
- instance: this,
101
- props: this.$props,
102
- state: this.$data
103
- },
104
- context: {
105
- index,
106
- count,
107
- first: index === 0,
108
- last: index === count - 1,
109
- active: this.isStepActive(index)
110
- }
111
- };
112
-
113
- return mergeProps(this.ptm(`step.${key}`, { step: stepMetaData }), this.ptm(`step.${key}`, stepMetaData), this.ptmo(this.getStepProp(step, 'pt'), key, stepMetaData));
114
- },
115
- onItemClick(event, step, index) {
116
- if (this.getStepProp(step, 'disabled') || this.readonly) {
117
- event.preventDefault();
118
-
119
- return;
120
- }
121
-
122
- if (index !== this.d_activeStep) {
123
- this.d_activeStep = index;
124
- this.$emit('update:activeStep', this.d_activeStep);
125
- }
126
-
127
- this.$emit('step-change', {
128
- originalEvent: event,
129
- index: index
130
- });
131
- },
132
- onItemKeydown(event, tab) {
133
- switch (event.code) {
134
- case 'ArrowRight': {
135
- this.navigateToNextItem(event.target);
136
- event.preventDefault();
137
- break;
138
- }
139
-
140
- case 'ArrowLeft': {
141
- this.navigateToPrevItem(event.target);
142
- event.preventDefault();
143
- break;
144
- }
145
-
146
- case 'Home': {
147
- this.navigateToFirstItem(event.target);
148
- event.preventDefault();
149
- break;
150
- }
151
-
152
- case 'End': {
153
- this.navigateToLastItem(event.target);
154
- event.preventDefault();
155
- break;
156
- }
157
-
158
- case 'Tab':
159
- //no op
160
- break;
161
-
162
- case 'Enter':
163
- case 'NumpadEnter':
164
-
165
- case 'Space': {
166
- this.onItemClick(event, step);
167
- event.preventDefault();
168
- break;
169
- }
170
-
171
- default:
172
- break;
173
- }
174
- },
175
- navigateToNextItem(target) {
176
- const nextItem = this.findNextItem(target);
177
-
178
- nextItem && this.setFocusToMenuitem(target, nextItem);
179
- },
180
- navigateToPrevItem(target) {
181
- const prevItem = this.findPrevItem(target);
182
-
183
- prevItem && this.setFocusToMenuitem(target, prevItem);
184
- },
185
- navigateToFirstItem(target) {
186
- const firstItem = this.findFirstItem(target);
187
-
188
- firstItem && this.setFocusToMenuitem(target, firstItem);
189
- },
190
- navigateToLastItem(target) {
191
- const lastItem = this.findLastItem(target);
192
-
193
- lastItem && this.setFocusToMenuitem(target, lastItem);
194
- },
195
- findNextItem(item) {
196
- const nextItem = item.parentElement.nextElementSibling;
197
-
198
- return nextItem ? nextItem.children[0] : null;
199
- },
200
- findPrevItem(item) {
201
- const prevItem = item.parentElement.previousElementSibling;
202
-
203
- return prevItem ? prevItem.children[0] : null;
204
- },
205
- findFirstItem() {
206
- const firstSibling = DomHandler.findSingle(this.$refs.list, '[data-pc-section="header"]');
207
-
208
- return firstSibling ? firstSibling.children[0] : null;
209
- },
210
- findLastItem() {
211
- const siblings = DomHandler.find(this.$refs.list, '[data-pc-section="header"]');
212
-
213
- return siblings ? siblings[siblings.length - 1].children[0] : null;
214
- }
215
- },
216
- computed: {
217
- steps() {
218
- return this.$slots.default().reduce((steps, child) => {
219
- if (this.isStep(child)) {
220
- steps.push(child);
221
- } else if (child.children && child.children instanceof Array) {
222
- child.children.forEach((nestedChild) => {
223
- if (this.isStep(nestedChild)) {
224
- steps.push(nestedChild);
225
- }
226
- });
227
- }
228
-
229
- return steps;
230
- }, []);
231
- }
232
- }
233
- };
234
- </script>
@@ -1,271 +0,0 @@
1
- 'use strict';
2
-
3
- var utils = require('primevue/utils');
4
- var vue = require('vue');
5
- var BaseComponent = require('primevue/basecomponent');
6
- var StepperStyle = require('primevue/stepper/style');
7
-
8
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
9
-
10
- var BaseComponent__default = /*#__PURE__*/_interopDefaultLegacy(BaseComponent);
11
- var StepperStyle__default = /*#__PURE__*/_interopDefaultLegacy(StepperStyle);
12
-
13
- var script$1 = {
14
- name: 'BaseStepper',
15
- "extends": BaseComponent__default["default"],
16
- props: {
17
- activeStep: {
18
- type: Number,
19
- "default": 0
20
- },
21
- orientation: {
22
- type: String,
23
- "default": 'horizontal'
24
- }
25
- },
26
- style: StepperStyle__default["default"],
27
- provide: function provide() {
28
- return {
29
- $parentInstance: this
30
- };
31
- }
32
- };
33
-
34
- var script = {
35
- name: 'Stepper',
36
- "extends": script$1,
37
- emits: ['update:activeStep', 'step-change'],
38
- data: function data() {
39
- return {
40
- id: this.$attrs.id,
41
- d_activeStep: this.activeStep
42
- };
43
- },
44
- watch: {
45
- '$attrs.id': function $attrsId(newValue) {
46
- this.id = newValue || utils.UniqueComponentId();
47
- },
48
- activeStep: function activeStep(newValue) {
49
- this.d_activeStep = newValue;
50
- }
51
- },
52
- mounted: function mounted() {
53
- this.id = this.id || utils.UniqueComponentId();
54
- },
55
- methods: {
56
- isStep: function isStep(child) {
57
- return child.type.name === 'Step';
58
- },
59
- isStepActive: function isStepActive(index) {
60
- return this.d_activeStep === index;
61
- },
62
- getStepProp: function getStepProp(step, name) {
63
- return step.props ? step.props[name] : undefined;
64
- },
65
- getStepKey: function getStepKey(step, index) {
66
- return this.getStepProp(step, 'header') || index;
67
- },
68
- getStepHeaderActionId: function getStepHeaderActionId(index) {
69
- return "".concat(this.id, "_").concat(index, "_header_action");
70
- },
71
- getStepContentId: function getStepContentId(index) {
72
- return "".concat(this.id, "_").concat(index, "_content");
73
- },
74
- getStepPT: function getStepPT(step, key, index) {
75
- var count = this.steps.length;
76
- var stepMetaData = {
77
- props: step.props,
78
- parent: {
79
- instance: this,
80
- props: this.$props,
81
- state: this.$data
82
- },
83
- context: {
84
- index: index,
85
- count: count,
86
- first: index === 0,
87
- last: index === count - 1,
88
- active: this.isStepActive(index)
89
- }
90
- };
91
- return vue.mergeProps(this.ptm("step.".concat(key), {
92
- step: stepMetaData
93
- }), this.ptm("step.".concat(key), stepMetaData), this.ptmo(this.getStepProp(step, 'pt'), key, stepMetaData));
94
- },
95
- onItemClick: function onItemClick(event, step, index) {
96
- if (this.getStepProp(step, 'disabled') || this.readonly) {
97
- event.preventDefault();
98
- return;
99
- }
100
- if (index !== this.d_activeStep) {
101
- this.d_activeStep = index;
102
- this.$emit('update:activeStep', this.d_activeStep);
103
- }
104
- this.$emit('step-change', {
105
- originalEvent: event,
106
- index: index
107
- });
108
- },
109
- onItemKeydown: function onItemKeydown(event, tab) {
110
- switch (event.code) {
111
- case 'ArrowRight':
112
- {
113
- this.navigateToNextItem(event.target);
114
- event.preventDefault();
115
- break;
116
- }
117
- case 'ArrowLeft':
118
- {
119
- this.navigateToPrevItem(event.target);
120
- event.preventDefault();
121
- break;
122
- }
123
- case 'Home':
124
- {
125
- this.navigateToFirstItem(event.target);
126
- event.preventDefault();
127
- break;
128
- }
129
- case 'End':
130
- {
131
- this.navigateToLastItem(event.target);
132
- event.preventDefault();
133
- break;
134
- }
135
- case 'Tab':
136
- //no op
137
- break;
138
- case 'Enter':
139
- case 'NumpadEnter':
140
- case 'Space':
141
- {
142
- this.onItemClick(event, step);
143
- event.preventDefault();
144
- break;
145
- }
146
- }
147
- },
148
- navigateToNextItem: function navigateToNextItem(target) {
149
- var nextItem = this.findNextItem(target);
150
- nextItem && this.setFocusToMenuitem(target, nextItem);
151
- },
152
- navigateToPrevItem: function navigateToPrevItem(target) {
153
- var prevItem = this.findPrevItem(target);
154
- prevItem && this.setFocusToMenuitem(target, prevItem);
155
- },
156
- navigateToFirstItem: function navigateToFirstItem(target) {
157
- var firstItem = this.findFirstItem(target);
158
- firstItem && this.setFocusToMenuitem(target, firstItem);
159
- },
160
- navigateToLastItem: function navigateToLastItem(target) {
161
- var lastItem = this.findLastItem(target);
162
- lastItem && this.setFocusToMenuitem(target, lastItem);
163
- },
164
- findNextItem: function findNextItem(item) {
165
- var nextItem = item.parentElement.nextElementSibling;
166
- return nextItem ? nextItem.children[0] : null;
167
- },
168
- findPrevItem: function findPrevItem(item) {
169
- var prevItem = item.parentElement.previousElementSibling;
170
- return prevItem ? prevItem.children[0] : null;
171
- },
172
- findFirstItem: function findFirstItem() {
173
- var firstSibling = DomHandler.findSingle(this.$refs.list, '[data-pc-section="header"]');
174
- return firstSibling ? firstSibling.children[0] : null;
175
- },
176
- findLastItem: function findLastItem() {
177
- var siblings = DomHandler.find(this.$refs.list, '[data-pc-section="header"]');
178
- return siblings ? siblings[siblings.length - 1].children[0] : null;
179
- }
180
- },
181
- computed: {
182
- steps: function steps() {
183
- var _this = this;
184
- return this.$slots["default"]().reduce(function (steps, child) {
185
- if (_this.isStep(child)) {
186
- steps.push(child);
187
- } else if (child.children && child.children instanceof Array) {
188
- child.children.forEach(function (nestedChild) {
189
- if (_this.isStep(nestedChild)) {
190
- steps.push(nestedChild);
191
- }
192
- });
193
- }
194
- return steps;
195
- }, []);
196
- }
197
- }
198
- };
199
-
200
- 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); }
201
- function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
202
- function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { _defineProperty(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
203
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
204
- function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : String(i); }
205
- 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 || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); }
206
- var _hoisted_1 = ["aria-current", "onClick", "onKeydown", "data-p-highlight", "data-p-disabled", "data-pc-index", "data-p-active"];
207
- var _hoisted_2 = ["id", "aria-labelledby", "data-pc-index", "data-p-active"];
208
- function render(_ctx, _cache, $props, $setup, $data, $options) {
209
- return vue.openBlock(), vue.createElementBlock("div", {
210
- "class": vue.normalizeClass(_ctx.cx('root')),
211
- role: "tablist"
212
- }, [vue.createElementVNode("div", {
213
- "class": vue.normalizeClass(_ctx.cx('navContent'))
214
- }, [vue.createElementVNode("ul", {
215
- ref: "list",
216
- "class": vue.normalizeClass(_ctx.cx('nav'))
217
- }, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.steps, function (step, index) {
218
- return vue.openBlock(), vue.createElementBlock("li", vue.mergeProps({
219
- key: $options.getStepKey(step, index),
220
- "class": _ctx.cx('step.header', {
221
- step: step,
222
- index: index
223
- }),
224
- style: $options.getStepProp(step, 'headerStyle'),
225
- "aria-current": $options.isStepActive(index) ? 'step' : undefined,
226
- onClick: function onClick($event) {
227
- return $options.onItemClick($event, step, index);
228
- },
229
- onKeydown: function onKeydown($event) {
230
- return $options.onItemKeydown($event, step, index);
231
- }
232
- }, _objectSpread(_objectSpread({}, $options.getStepPT(step, 'root', index)), $options.getStepPT(step, 'header', index)), {
233
- "data-pc-name": "step",
234
- "data-p-highlight": $options.isStepActive(index),
235
- "data-p-disabled": $options.getStepProp(step, 'disabled'),
236
- "data-pc-index": index,
237
- "data-p-active": $options.isStepActive(index)
238
- }), [vue.renderSlot(_ctx.$slots, "header", {}, function () {
239
- return [vue.createElementVNode("span", {
240
- "class": vue.normalizeClass(_ctx.cx('step.action'))
241
- }, [vue.createElementVNode("span", {
242
- "class": vue.normalizeClass(_ctx.cx('step.step'))
243
- }, vue.toDisplayString(index + 1), 3), vue.createElementVNode("span", {
244
- "class": vue.normalizeClass(_ctx.cx('step.title'))
245
- }, vue.toDisplayString($options.getStepProp(step, 'header')), 3)], 2)];
246
- })], 16, _hoisted_1);
247
- }), 128))], 2)], 2), vue.createElementVNode("div", {
248
- "class": vue.normalizeClass(_ctx.cx('stepContainer'))
249
- }, [(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList($options.steps, function (step, index) {
250
- return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
251
- key: $options.getStepKey(step, index)
252
- }, [$options.isStepActive(index) ? (vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
253
- key: 0,
254
- id: $options.getStepContentId(index),
255
- "class": _ctx.cx('step.content', {
256
- step: step
257
- }),
258
- style: $options.getStepProp(step, 'contentStyle'),
259
- role: "tabpanel",
260
- "aria-labelledby": $options.getStepHeaderActionId(index)
261
- }, _objectSpread(_objectSpread({}, $options.getStepPT(step, 'root', index)), $options.getStepPT(step, 'content', index)), {
262
- "data-pc-name": "step",
263
- "data-pc-index": index,
264
- "data-p-active": $options.isStepActive(index)
265
- }), [(vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(step)))], 16, _hoisted_2)) : vue.createCommentVNode("", true)], 64);
266
- }), 128))], 2)], 2);
267
- }
268
-
269
- script.render = render;
270
-
271
- module.exports = script;
@@ -1 +0,0 @@
1
- "use strict";var e=require("primevue/utils"),t=require("vue"),n=require("primevue/basecomponent"),r=require("primevue/stepper/style");function i(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var a={name:"Stepper",extends:{name:"BaseStepper",extends:i(n).default,props:{activeStep:{type:Number,default:0},orientation:{type:String,default:"horizontal"}},style:i(r).default,provide:function(){return{$parentInstance:this}}},emits:["update:activeStep","step-change"],data:function(){return{id:this.$attrs.id,d_activeStep:this.activeStep}},watch:{"$attrs.id":function(t){this.id=t||e.UniqueComponentId()},activeStep:function(e){this.d_activeStep=e}},mounted:function(){this.id=this.id||e.UniqueComponentId()},methods:{isStep:function(e){return"Step"===e.type.name},isStepActive:function(e){return this.d_activeStep===e},getStepProp:function(e,t){return e.props?e.props[t]:void 0},getStepKey:function(e,t){return this.getStepProp(e,"header")||t},getStepHeaderActionId:function(e){return"".concat(this.id,"_").concat(e,"_header_action")},getStepContentId:function(e){return"".concat(this.id,"_").concat(e,"_content")},getStepPT:function(e,n,r){var i=this.steps.length,a={props:e.props,parent:{instance:this,props:this.$props,state:this.$data},context:{index:r,count:i,first:0===r,last:r===i-1,active:this.isStepActive(r)}};return t.mergeProps(this.ptm("step.".concat(n),{step:a}),this.ptm("step.".concat(n),a),this.ptmo(this.getStepProp(e,"pt"),n,a))},onItemClick:function(e,t,n){this.getStepProp(t,"disabled")||this.readonly?e.preventDefault():(n!==this.d_activeStep&&(this.d_activeStep=n,this.$emit("update:activeStep",this.d_activeStep)),this.$emit("step-change",{originalEvent:e,index:n}))},onItemKeydown:function(e,t){switch(e.code){case"ArrowRight":this.navigateToNextItem(e.target),e.preventDefault();break;case"ArrowLeft":this.navigateToPrevItem(e.target),e.preventDefault();break;case"Home":this.navigateToFirstItem(e.target),e.preventDefault();break;case"End":this.navigateToLastItem(e.target),e.preventDefault();break;case"Tab":break;case"Enter":case"NumpadEnter":case"Space":this.onItemClick(e,step),e.preventDefault()}},navigateToNextItem:function(e){var t=this.findNextItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToPrevItem:function(e){var t=this.findPrevItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToFirstItem:function(e){var t=this.findFirstItem(e);t&&this.setFocusToMenuitem(e,t)},navigateToLastItem:function(e){var t=this.findLastItem(e);t&&this.setFocusToMenuitem(e,t)},findNextItem:function(e){var t=e.parentElement.nextElementSibling;return t?t.children[0]:null},findPrevItem:function(e){var t=e.parentElement.previousElementSibling;return t?t.children[0]:null},findFirstItem:function(){var e=DomHandler.findSingle(this.$refs.list,'[data-pc-section="header"]');return e?e.children[0]:null},findLastItem:function(){var e=DomHandler.find(this.$refs.list,'[data-pc-section="header"]');return e?e[e.length-1].children[0]:null}},computed:{steps:function(){var e=this;return this.$slots.default().reduce((function(t,n){return e.isStep(n)?t.push(n):n.children&&n.children instanceof Array&&n.children.forEach((function(n){e.isStep(n)&&t.push(n)})),t}),[])}}};function o(e){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},o(e)}function s(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter((function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable}))),n.push.apply(n,r)}return n}function c(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?s(Object(n),!0).forEach((function(t){p(e,t,n[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):s(Object(n)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))}))}return e}function p(e,t,n){var r;return(t="symbol"==o(r=l(t,"string"))?r:String(r))in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function l(e,t){if("object"!=o(e)||!e)return e;var n=e[Symbol.toPrimitive];if(void 0!==n){var r=n.call(e,t||"default");if("object"!=o(r))return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var u=["aria-current","onClick","onKeydown","data-p-highlight","data-p-disabled","data-pc-index","data-p-active"],d=["id","aria-labelledby","data-pc-index","data-p-active"];a.render=function(e,n,r,i,a,o){return t.openBlock(),t.createElementBlock("div",{class:t.normalizeClass(e.cx("root")),role:"tablist"},[t.createElementVNode("div",{class:t.normalizeClass(e.cx("navContent"))},[t.createElementVNode("ul",{ref:"list",class:t.normalizeClass(e.cx("nav"))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.steps,(function(n,r){return t.openBlock(),t.createElementBlock("li",t.mergeProps({key:o.getStepKey(n,r),class:e.cx("step.header",{step:n,index:r}),style:o.getStepProp(n,"headerStyle"),"aria-current":o.isStepActive(r)?"step":void 0,onClick:function(e){return o.onItemClick(e,n,r)},onKeydown:function(e){return o.onItemKeydown(e,n,r)}},c(c({},o.getStepPT(n,"root",r)),o.getStepPT(n,"header",r)),{"data-pc-name":"step","data-p-highlight":o.isStepActive(r),"data-p-disabled":o.getStepProp(n,"disabled"),"data-pc-index":r,"data-p-active":o.isStepActive(r)}),[t.renderSlot(e.$slots,"header",{},(function(){return[t.createElementVNode("span",{class:t.normalizeClass(e.cx("step.action"))},[t.createElementVNode("span",{class:t.normalizeClass(e.cx("step.step"))},t.toDisplayString(r+1),3),t.createElementVNode("span",{class:t.normalizeClass(e.cx("step.title"))},t.toDisplayString(o.getStepProp(n,"header")),3)],2)]}))],16,u)})),128))],2)],2),t.createElementVNode("div",{class:t.normalizeClass(e.cx("stepContainer"))},[(t.openBlock(!0),t.createElementBlock(t.Fragment,null,t.renderList(o.steps,(function(n,r){return t.openBlock(),t.createElementBlock(t.Fragment,{key:o.getStepKey(n,r)},[o.isStepActive(r)?(t.openBlock(),t.createElementBlock("div",t.mergeProps({key:0,id:o.getStepContentId(r),class:e.cx("step.content",{step:n}),style:o.getStepProp(n,"contentStyle"),role:"tabpanel","aria-labelledby":o.getStepHeaderActionId(r)},c(c({},o.getStepPT(n,"root",r)),o.getStepPT(n,"content",r)),{"data-pc-name":"step","data-pc-index":r,"data-p-active":o.isStepActive(r)}),[(t.openBlock(),t.createBlock(t.resolveDynamicComponent(n)))],16,d)):t.createCommentVNode("",!0)],64)})),128))],2)],2)},module.exports=a;