@pequity/squirrel 1.0.20 → 1.0.21-beta.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 (146) hide show
  1. package/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -0
  2. package/dist/cjs/chunks/p-action-bar.js +60 -0
  3. package/dist/cjs/chunks/p-card.js +28 -0
  4. package/dist/cjs/chunks/p-checkbox.js +24 -0
  5. package/dist/cjs/chunks/p-dropdown-select.js +414 -0
  6. package/dist/cjs/chunks/p-input-percent.js +53 -0
  7. package/dist/cjs/chunks/p-pagination-info.js +66 -0
  8. package/dist/cjs/chunks/p-pagination.js +122 -0
  9. package/dist/cjs/chunks/p-ring-loader.js +81 -0
  10. package/dist/cjs/chunks/p-select-btn.js +97 -0
  11. package/dist/cjs/chunks/p-select.js +123 -0
  12. package/dist/cjs/chunks/p-table-loader.js +70 -0
  13. package/dist/cjs/chunks/p-tabs.js +52 -0
  14. package/dist/cjs/config.js +105 -0
  15. package/dist/cjs/currency.js +9 -0
  16. package/dist/cjs/dom.js +27 -0
  17. package/dist/cjs/index.js +976 -0
  18. package/dist/cjs/inputClassesMixin.js +50 -0
  19. package/dist/cjs/inputClassesShared.js +76 -0
  20. package/dist/cjs/listKeyboardNavigation.js +110 -0
  21. package/dist/cjs/number.js +9 -0
  22. package/dist/cjs/object.js +4 -0
  23. package/dist/cjs/p-action-bar.js +3 -0
  24. package/dist/cjs/p-alert.js +65 -0
  25. package/dist/cjs/p-avatar.js +71 -0
  26. package/dist/cjs/p-btn.js +361 -0
  27. package/dist/cjs/p-card.js +3 -0
  28. package/dist/cjs/p-checkbox.js +3 -0
  29. package/dist/cjs/p-chips.js +110 -0
  30. package/dist/cjs/p-close-btn.js +36 -0
  31. package/dist/cjs/p-date-picker.js +139 -0
  32. package/dist/cjs/p-drawer.js +253 -0
  33. package/dist/cjs/p-dropdown-select.js +3 -0
  34. package/dist/cjs/p-dropdown.js +138 -0
  35. package/dist/cjs/p-file-upload.js +21 -0
  36. package/dist/cjs/p-info-icon.js +35 -0
  37. package/dist/cjs/p-inline-date-picker.js +142 -0
  38. package/dist/cjs/p-input-number.js +146 -0
  39. package/dist/cjs/p-input-percent.js +3 -0
  40. package/dist/cjs/p-input-search.js +110 -0
  41. package/dist/cjs/p-input.js +89 -0
  42. package/dist/cjs/p-loading.js +38 -0
  43. package/dist/cjs/p-modal.js +369 -0
  44. package/dist/cjs/p-pagination-info.js +3 -0
  45. package/dist/cjs/p-pagination.js +3 -0
  46. package/dist/cjs/p-progress-bar.js +41 -0
  47. package/dist/cjs/p-ring-loader.js +3 -0
  48. package/dist/cjs/p-select-btn.js +3 -0
  49. package/dist/cjs/p-select-list.js +4 -0
  50. package/dist/cjs/p-select-pill.js +111 -0
  51. package/dist/cjs/p-select.js +3 -0
  52. package/dist/cjs/p-skeleton-loader.js +73 -0
  53. package/dist/cjs/p-table-filter-icon.js +20 -0
  54. package/dist/cjs/p-table-header-cell.js +75 -0
  55. package/dist/cjs/p-table-loader.js +3 -0
  56. package/dist/cjs/p-table-sort.js +8 -0
  57. package/dist/cjs/p-table-td.js +88 -0
  58. package/dist/cjs/p-table.js +12 -0
  59. package/dist/cjs/p-tabs.js +3 -0
  60. package/dist/cjs/p-textarea.js +73 -0
  61. package/dist/cjs/p-toggle.js +114 -0
  62. package/dist/cjs/pagination.js +29 -0
  63. package/dist/cjs/string.js +12 -0
  64. package/dist/cjs/tailwind.js +4353 -0
  65. package/dist/cjs/text.js +16 -0
  66. package/dist/cjs/useInputClasses.js +44 -0
  67. package/dist/cjs/usePLoading.js +35 -0
  68. package/dist/cjs/usePModal.js +21 -0
  69. package/dist/cjs/usePTableColResize.js +81 -0
  70. package/dist/cjs/usePTableRowVirtualizer.js +31 -0
  71. package/dist/cjs/useSelectList.js +256 -0
  72. package/dist/es/chunks/_plugin-vue_export-helper.js +10 -0
  73. package/dist/es/chunks/p-action-bar.js +61 -0
  74. package/dist/es/chunks/p-card.js +29 -0
  75. package/dist/es/chunks/p-checkbox.js +25 -0
  76. package/dist/es/chunks/p-dropdown-select.js +415 -0
  77. package/dist/es/chunks/p-input-percent.js +54 -0
  78. package/dist/es/chunks/p-pagination-info.js +67 -0
  79. package/dist/es/chunks/p-pagination.js +123 -0
  80. package/dist/es/chunks/p-ring-loader.js +82 -0
  81. package/dist/es/chunks/p-select-btn.js +98 -0
  82. package/dist/es/chunks/p-select.js +124 -0
  83. package/dist/es/chunks/p-table-loader.js +71 -0
  84. package/dist/es/chunks/p-tabs.js +53 -0
  85. package/dist/es/config.js +105 -0
  86. package/dist/es/currency.js +9 -0
  87. package/dist/es/dom.js +27 -0
  88. package/dist/es/index.js +978 -0
  89. package/dist/es/inputClassesMixin.js +51 -0
  90. package/dist/es/inputClassesShared.js +76 -0
  91. package/dist/es/listKeyboardNavigation.js +110 -0
  92. package/dist/es/number.js +9 -0
  93. package/dist/es/object.js +4 -0
  94. package/dist/es/p-action-bar.js +4 -0
  95. package/dist/es/p-alert.js +66 -0
  96. package/dist/es/p-avatar.js +72 -0
  97. package/dist/es/p-btn.js +362 -0
  98. package/dist/es/p-card.js +4 -0
  99. package/dist/es/p-checkbox.js +4 -0
  100. package/dist/es/p-chips.js +111 -0
  101. package/dist/es/p-close-btn.js +37 -0
  102. package/dist/es/p-date-picker.js +140 -0
  103. package/dist/es/p-drawer.js +254 -0
  104. package/dist/es/p-dropdown-select.js +4 -0
  105. package/dist/es/p-dropdown.js +139 -0
  106. package/dist/es/p-file-upload.js +21 -0
  107. package/dist/es/p-info-icon.js +36 -0
  108. package/dist/es/p-inline-date-picker.js +143 -0
  109. package/dist/es/p-input-number.js +147 -0
  110. package/dist/es/p-input-percent.js +4 -0
  111. package/dist/es/p-input-search.js +111 -0
  112. package/dist/es/p-input.js +90 -0
  113. package/dist/es/p-loading.js +39 -0
  114. package/dist/es/p-modal.js +370 -0
  115. package/dist/es/p-pagination-info.js +4 -0
  116. package/dist/es/p-pagination.js +4 -0
  117. package/dist/es/p-progress-bar.js +42 -0
  118. package/dist/es/p-ring-loader.js +4 -0
  119. package/dist/es/p-select-btn.js +4 -0
  120. package/dist/es/p-select-list.js +4 -0
  121. package/dist/es/p-select-pill.js +112 -0
  122. package/dist/es/p-select.js +4 -0
  123. package/dist/es/p-skeleton-loader.js +74 -0
  124. package/dist/es/p-table-filter-icon.js +21 -0
  125. package/dist/es/p-table-header-cell.js +76 -0
  126. package/dist/es/p-table-loader.js +4 -0
  127. package/dist/es/p-table-sort.js +8 -0
  128. package/dist/es/p-table-td.js +89 -0
  129. package/dist/es/p-table.js +12 -0
  130. package/dist/es/p-tabs.js +4 -0
  131. package/dist/es/p-textarea.js +74 -0
  132. package/dist/es/p-toggle.js +115 -0
  133. package/dist/es/pagination.js +29 -0
  134. package/dist/es/string.js +12 -0
  135. package/dist/es/tailwind.js +4353 -0
  136. package/dist/es/text.js +16 -0
  137. package/dist/es/useInputClasses.js +44 -0
  138. package/dist/es/usePLoading.js +35 -0
  139. package/dist/es/usePModal.js +21 -0
  140. package/dist/es/usePTableColResize.js +81 -0
  141. package/dist/es/usePTableRowVirtualizer.js +31 -0
  142. package/dist/es/useSelectList.js +256 -0
  143. package/dist/style.css +2124 -1
  144. package/package.json +26 -24
  145. package/dist/squirrel.cjs.js +0 -5
  146. package/dist/squirrel.es.js +0 -8220
@@ -0,0 +1,369 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const pAlert = require("./p-alert.js");
4
+ const pCloseBtn = require("./p-close-btn.js");
5
+ const usePModal = require("./usePModal.js");
6
+ const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
7
+ const _hoisted_1 = ["data-pm-backdrop-id"];
8
+ const _hoisted_2 = ["data-pm-wrapper-id", "aria-label", "aria-describedby", "aria-labelledby"];
9
+ const _hoisted_3 = ["data-pm-id"];
10
+ const _hoisted_4 = { class: "flex pb-4 pl-8 pr-4 pt-4" };
11
+ const _hoisted_5 = ["id"];
12
+ const _hoisted_6 = { class: "ml-auto" };
13
+ const _hoisted_7 = {
14
+ key: 0,
15
+ class: "mb-4 px-8"
16
+ };
17
+ const _hoisted_8 = ["id"];
18
+ const _hoisted_9 = { class: "mt-6 px-8 pt-6" };
19
+ const FOCUSABLE_ELEMENTS = 'a[href], area[href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), button:not([disabled]), [tabindex]:not([tabindex="-1"])';
20
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
21
+ ...{
22
+ name: "PModal"
23
+ },
24
+ __name: "p-modal",
25
+ props: {
26
+ name: {
27
+ type: String,
28
+ default: ""
29
+ },
30
+ title: {
31
+ type: String,
32
+ default: ""
33
+ },
34
+ baseZindex: {
35
+ type: Number,
36
+ default: 1051
37
+ },
38
+ bgClass: {
39
+ type: [String, Object, Array],
40
+ default: "fixed bottom-0 left-0 right-0 top-0 bg-black bg-opacity-20"
41
+ },
42
+ wrapperClass: {
43
+ type: [String, Object, Array],
44
+ default: "fixed bottom-0 left-0 right-0 top-0 flex flex-col items-center justify-center overflow-y-auto overflow-x-hidden outline-none"
45
+ },
46
+ modalClass: {
47
+ type: [String, Object, Array],
48
+ default: "pm relative flex flex-col rounded-2xl pb-6 cursor-default bg-surface shadow-xl"
49
+ },
50
+ modalStyle: {
51
+ type: [String, Object, Array],
52
+ default: ""
53
+ },
54
+ inClass: {
55
+ type: String,
56
+ default: "slideInTop"
57
+ },
58
+ outClass: {
59
+ type: String,
60
+ default: "slideOutTop"
61
+ },
62
+ bgInClass: {
63
+ type: String,
64
+ default: "fadeIn"
65
+ },
66
+ bgOutClass: {
67
+ type: String,
68
+ default: "fadeOut"
69
+ },
70
+ appendTo: {
71
+ type: String,
72
+ default: "body"
73
+ },
74
+ live: {
75
+ type: Boolean,
76
+ default: false
77
+ },
78
+ enableClose: {
79
+ type: Boolean,
80
+ default: true
81
+ },
82
+ modelValue: {
83
+ type: Boolean,
84
+ default: false
85
+ },
86
+ closeLabel: {
87
+ type: String,
88
+ default: "Close"
89
+ },
90
+ disabled: {
91
+ type: Boolean,
92
+ default: false
93
+ },
94
+ errorMsg: {
95
+ type: String,
96
+ default: ""
97
+ },
98
+ maxWidth: {
99
+ type: String,
100
+ default: "500px"
101
+ }
102
+ },
103
+ emits: [
104
+ "before-open",
105
+ "opening",
106
+ "opened",
107
+ "before-close",
108
+ "closing",
109
+ "closed",
110
+ "update:modelValue"
111
+ ],
112
+ setup(__props, { emit: __emit }) {
113
+ vue.useCssVars((_ctx) => ({
114
+ "8a536574": __props.maxWidth
115
+ }));
116
+ let animatingZIndex = 0;
117
+ const emit = __emit;
118
+ const props = __props;
119
+ const modal = usePModal.usePModal();
120
+ const zIndex = vue.ref(0);
121
+ const id = vue.ref("");
122
+ const show = vue.ref(false);
123
+ const mount = vue.ref(false);
124
+ const elToFocus = vue.ref(null);
125
+ const pmWrapper = vue.ref(null);
126
+ vue.onBeforeMount(() => {
127
+ if (props.live) {
128
+ mount.value = true;
129
+ }
130
+ });
131
+ vue.onMounted(() => {
132
+ var _a;
133
+ id.value = "pm-" + ((_a = vue.getCurrentInstance()) == null ? void 0 : _a.uid);
134
+ const valueToWatch = !props.name ? () => props.modelValue : () => modal.state.modals[props.name];
135
+ vue.watch(
136
+ valueToWatch,
137
+ (newVal) => {
138
+ if (newVal) {
139
+ mount.value = true;
140
+ vue.nextTick(() => {
141
+ show.value = true;
142
+ });
143
+ } else {
144
+ show.value = false;
145
+ }
146
+ },
147
+ {
148
+ immediate: true
149
+ }
150
+ );
151
+ });
152
+ vue.onBeforeUnmount(() => {
153
+ elToFocus.value = null;
154
+ props.name && modal.hide(props.name);
155
+ });
156
+ const close = () => {
157
+ if (props.enableClose === true) {
158
+ emit("update:modelValue", false);
159
+ props.name && modal.hide(props.name);
160
+ }
161
+ };
162
+ const clickOutside = (e) => {
163
+ if (e.target === pmWrapper.value) {
164
+ close();
165
+ }
166
+ };
167
+ const keydown = (e) => {
168
+ var _a;
169
+ if (e.which === 27 || e.keyCode === 27) {
170
+ close();
171
+ }
172
+ if (e.which === 9 || e.keyCode === 9) {
173
+ const all = [].slice.call((_a = pmWrapper.value) == null ? void 0 : _a.querySelectorAll(FOCUSABLE_ELEMENTS)).filter(function(el) {
174
+ return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
175
+ });
176
+ if (e.shiftKey) {
177
+ if (e.target === all[0] || e.target === pmWrapper.value) {
178
+ e.preventDefault();
179
+ all[all.length - 1].focus();
180
+ }
181
+ } else {
182
+ if (e.target === all[all.length - 1]) {
183
+ e.preventDefault();
184
+ all[0].focus();
185
+ }
186
+ }
187
+ }
188
+ };
189
+ const getAllVisibleWrappers = () => {
190
+ return [].slice.call(document.querySelectorAll("[data-pm-wrapper-id]")).filter((w) => w.style.display !== "none");
191
+ };
192
+ const getTopZindex = () => {
193
+ return getAllVisibleWrappers().reduce((acc, curr) => {
194
+ return parseInt(curr.style.zIndex) > acc ? parseInt(curr.style.zIndex) : acc;
195
+ }, 0);
196
+ };
197
+ const handleFocus = (wrapper) => {
198
+ const autofocus = wrapper.querySelector("[autofocus]");
199
+ if (autofocus) {
200
+ autofocus.focus();
201
+ } else {
202
+ const focusable = wrapper.querySelectorAll(FOCUSABLE_ELEMENTS);
203
+ focusable.length ? focusable[0].focus() : wrapper.focus();
204
+ }
205
+ };
206
+ const beforeOpen = () => {
207
+ elToFocus.value = document.activeElement;
208
+ const lastZindex = getTopZindex();
209
+ if (animatingZIndex) {
210
+ zIndex.value = animatingZIndex + 2;
211
+ } else {
212
+ zIndex.value = lastZindex === 0 ? props.baseZindex : lastZindex + 2;
213
+ }
214
+ animatingZIndex = zIndex.value;
215
+ emit("before-open");
216
+ };
217
+ const opening = () => {
218
+ emit("opening");
219
+ };
220
+ const afterOpen = () => {
221
+ handleFocus(pmWrapper.value);
222
+ emit("opened");
223
+ };
224
+ const beforeClose = () => {
225
+ emit("before-close");
226
+ };
227
+ const closing = () => {
228
+ emit("closing");
229
+ };
230
+ const afterClose = () => {
231
+ zIndex.value = 0;
232
+ if (!props.live) {
233
+ mount.value = false;
234
+ }
235
+ vue.nextTick(() => {
236
+ window.requestAnimationFrame(() => {
237
+ var _a, _b;
238
+ const lastZindex = getTopZindex();
239
+ if (lastZindex > 0) {
240
+ const all = getAllVisibleWrappers();
241
+ for (let i = 0; i < all.length; i++) {
242
+ const wrapper = all[i];
243
+ if (parseInt(wrapper.style.zIndex) === lastZindex) {
244
+ if (wrapper.contains(elToFocus.value)) {
245
+ (_a = elToFocus.value) == null ? void 0 : _a.focus();
246
+ } else {
247
+ handleFocus(wrapper);
248
+ }
249
+ break;
250
+ }
251
+ }
252
+ } else {
253
+ if (document.body.contains(elToFocus.value)) {
254
+ (_b = elToFocus.value) == null ? void 0 : _b.focus();
255
+ }
256
+ }
257
+ animatingZIndex = 0;
258
+ emit("closed");
259
+ });
260
+ });
261
+ };
262
+ return (_ctx, _cache) => {
263
+ return mount.value ? (vue.openBlock(), vue.createBlock(vue.Teleport, {
264
+ key: 0,
265
+ to: __props.appendTo
266
+ }, [
267
+ vue.createVNode(vue.Transition, {
268
+ name: "pm-backdrop-transition",
269
+ "enter-active-class": __props.bgInClass,
270
+ "leave-active-class": __props.bgOutClass
271
+ }, {
272
+ default: vue.withCtx(() => [
273
+ vue.withDirectives(vue.createElementVNode("div", {
274
+ "data-pm-backdrop-id": id.value,
275
+ class: vue.normalizeClass(__props.bgClass),
276
+ style: vue.normalizeStyle({ "z-index": zIndex.value - 1 })
277
+ }, null, 14, _hoisted_1), [
278
+ [vue.vShow, show.value]
279
+ ])
280
+ ]),
281
+ _: 1
282
+ }, 8, ["enter-active-class", "leave-active-class"]),
283
+ vue.createVNode(vue.Transition, {
284
+ name: "pm-transition",
285
+ "enter-active-class": __props.inClass,
286
+ "leave-active-class": __props.outClass,
287
+ onBeforeEnter: beforeOpen,
288
+ onEnter: opening,
289
+ onAfterEnter: afterOpen,
290
+ onBeforeLeave: beforeClose,
291
+ onLeave: closing,
292
+ onAfterLeave: afterClose
293
+ }, {
294
+ default: vue.withCtx(() => [
295
+ vue.withDirectives(vue.createElementVNode("div", {
296
+ ref_key: "pmWrapper",
297
+ ref: pmWrapper,
298
+ "data-pm-wrapper-id": id.value,
299
+ tabindex: "-1",
300
+ class: vue.normalizeClass(__props.wrapperClass),
301
+ style: vue.normalizeStyle({ "z-index": zIndex.value, cursor: __props.enableClose ? "pointer" : "default" }),
302
+ role: "dialog",
303
+ "aria-label": __props.title,
304
+ "aria-modal": "true",
305
+ "aria-describedby": `${id.value}-content`,
306
+ "aria-labelledby": `${id.value}-title`,
307
+ onClick: _cache[0] || (_cache[0] = ($event) => clickOutside($event)),
308
+ onKeydown: _cache[1] || (_cache[1] = ($event) => keydown($event))
309
+ }, [
310
+ vue.createElementVNode("div", {
311
+ ref: "pm",
312
+ "data-pm-id": id.value,
313
+ class: vue.normalizeClass(__props.modalClass),
314
+ style: vue.normalizeStyle(__props.modalStyle)
315
+ }, [
316
+ vue.renderSlot(_ctx.$slots, "title-wrapper", {}, () => [
317
+ vue.createElementVNode("div", _hoisted_4, [
318
+ __props.title ? (vue.openBlock(), vue.createElementBlock("h3", {
319
+ key: 0,
320
+ id: `${id.value}-title`,
321
+ class: "mr-auto pt-4 text-xl font-semibold"
322
+ }, vue.toDisplayString(__props.title), 9, _hoisted_5)) : vue.createCommentVNode("", true),
323
+ vue.createElementVNode("div", _hoisted_6, [
324
+ __props.enableClose ? (vue.openBlock(), vue.createBlock(pCloseBtn, {
325
+ key: 0,
326
+ disabled: __props.disabled,
327
+ "aria-label": __props.closeLabel,
328
+ onClick: vue.withModifiers(close, ["prevent"])
329
+ }, null, 8, ["disabled", "aria-label"])) : vue.createCommentVNode("", true)
330
+ ])
331
+ ])
332
+ ], true),
333
+ __props.errorMsg ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_7, [
334
+ vue.createVNode(pAlert, { type: "error" }, {
335
+ default: vue.withCtx(() => [
336
+ vue.createTextVNode(vue.toDisplayString(__props.errorMsg), 1)
337
+ ]),
338
+ _: 1
339
+ })
340
+ ])) : vue.createCommentVNode("", true),
341
+ vue.renderSlot(_ctx.$slots, "content-wrapper", {}, () => [
342
+ vue.createElementVNode("div", {
343
+ id: `${id.value}-content`,
344
+ class: vue.normalizeClass([
345
+ "relative grow overflow-y-auto overflow-x-hidden px-8",
346
+ { "pointer-events-none opacity-50": __props.disabled }
347
+ ])
348
+ }, [
349
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
350
+ ], 10, _hoisted_8)
351
+ ], true),
352
+ _ctx.$slots["footer"] ? vue.renderSlot(_ctx.$slots, "footer-wrapper", { key: 1 }, () => [
353
+ vue.createElementVNode("div", _hoisted_9, [
354
+ vue.renderSlot(_ctx.$slots, "footer", {}, void 0, true)
355
+ ])
356
+ ], true) : vue.createCommentVNode("", true)
357
+ ], 14, _hoisted_3)
358
+ ], 46, _hoisted_2), [
359
+ [vue.vShow, show.value]
360
+ ])
361
+ ]),
362
+ _: 3
363
+ }, 8, ["enter-active-class", "leave-active-class"])
364
+ ], 8, ["to"])) : vue.createCommentVNode("", true);
365
+ };
366
+ }
367
+ });
368
+ const pModal = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-ee599a02"]]);
369
+ module.exports = pModal;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const pPaginationInfo_vue_vue_type_script_setup_true_lang = require("./chunks/p-pagination-info.js");
3
+ module.exports = pPaginationInfo_vue_vue_type_script_setup_true_lang._sfc_main;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const pPagination_vue_vue_type_script_setup_true_lang = require("./chunks/p-pagination.js");
3
+ module.exports = pPagination_vue_vue_type_script_setup_true_lang._sfc_main;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
4
+ const _sfc_main = vue.defineComponent({
5
+ name: "PProgressBar",
6
+ props: {
7
+ total: {
8
+ type: Number,
9
+ required: true
10
+ },
11
+ items: {
12
+ type: Array,
13
+ required: true
14
+ }
15
+ }
16
+ });
17
+ const _hoisted_1 = {
18
+ class: "flex justify-start overflow-hidden rounded bg-p-blue-20",
19
+ role: "progressbar"
20
+ };
21
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
22
+ const _directive_tooltip = vue.resolveDirective("tooltip");
23
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
24
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.items, (item) => {
25
+ return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
26
+ key: `progress-value-${item.color}`,
27
+ class: "h-full",
28
+ style: vue.normalizeStyle({ width: `${item.value / _ctx.total * 100}%`, background: item.color })
29
+ }, null, 4)), [
30
+ [
31
+ _directive_tooltip,
32
+ item.label,
33
+ void 0,
34
+ { top: true }
35
+ ]
36
+ ]);
37
+ }), 128))
38
+ ]);
39
+ }
40
+ const pProgressBar = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
41
+ module.exports = pProgressBar;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const pRingLoader_vue_vue_type_script_setup_true_lang = require("./chunks/p-ring-loader.js");
3
+ module.exports = pRingLoader_vue_vue_type_script_setup_true_lang._sfc_main;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const pSelectBtn_vue_vue_type_script_setup_true_lang = require("./chunks/p-select-btn.js");
3
+ module.exports = pSelectBtn_vue_vue_type_script_setup_true_lang._sfc_main;
@@ -0,0 +1,4 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const SIZES = { sm: `h-8 text-sm`, md: `h-10 text-base`, lg: `h-12 text-lg` };
4
+ exports.SIZES = SIZES;
@@ -0,0 +1,111 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
4
+ const SIZES = { sm: "h-7 px-4 text-xs", md: "h-9 px-5 text-sm", lg: "h-11 px-7 text-base" };
5
+ const ACTIVE_CLASS = "text-p-purple-60";
6
+ const getOffsetValues = (container) => {
7
+ const el = container.cloneNode(true);
8
+ el.style.visibility = "hidden";
9
+ document.body.appendChild(el);
10
+ const activeBtn = el.querySelector(`button.${ACTIVE_CLASS}`);
11
+ const res = { width: `${activeBtn.offsetWidth}px`, left: `${activeBtn.offsetLeft}px` };
12
+ document.body.removeChild(el);
13
+ return res;
14
+ };
15
+ const _sfc_main = vue.defineComponent({
16
+ props: {
17
+ modelValue: {
18
+ type: [String, Number],
19
+ default: ""
20
+ },
21
+ items: {
22
+ type: Array,
23
+ default: () => []
24
+ },
25
+ itemText: {
26
+ type: String,
27
+ default: "text"
28
+ },
29
+ itemSubtext: {
30
+ type: String,
31
+ default: "subtext"
32
+ },
33
+ itemValue: {
34
+ type: [String, Number],
35
+ default: "value"
36
+ },
37
+ size: {
38
+ type: String,
39
+ default: "md",
40
+ validator(value) {
41
+ return Object.keys(SIZES).includes(value);
42
+ }
43
+ }
44
+ },
45
+ emits: ["update:modelValue"],
46
+ data() {
47
+ return {
48
+ SIZES,
49
+ ACTIVE_CLASS
50
+ };
51
+ },
52
+ watch: {
53
+ modelValue: {
54
+ handler() {
55
+ setTimeout(() => this.setPillStyle(), 60);
56
+ },
57
+ immediate: true
58
+ }
59
+ },
60
+ methods: {
61
+ click(e, option) {
62
+ if (!option.disabled) {
63
+ this.$emit("update:modelValue", option[this.itemValue]);
64
+ }
65
+ },
66
+ setPillStyle() {
67
+ const el = this.$el.querySelector(`button.${ACTIVE_CLASS}`);
68
+ if (!el) {
69
+ return;
70
+ }
71
+ const dimensions = el.offsetWidth !== 0 ? { left: `${el.offsetLeft}px`, width: `${el.offsetWidth}px` } : getOffsetValues(this.$el);
72
+ this.$refs.pill.style.left = dimensions.left;
73
+ this.$refs.pill.style.width = dimensions.width;
74
+ }
75
+ }
76
+ });
77
+ const _hoisted_1 = { class: "relative inline-flex rounded-full border-2 border-p-gray-30 bg-p-gray-30 text-center font-semibold text-p-gray-50" };
78
+ const _hoisted_2 = {
79
+ ref: "pill",
80
+ class: "absolute left-0 top-0 inline-block h-full rounded-full bg-surface duration-200 ease-in-out"
81
+ };
82
+ const _hoisted_3 = ["disabled", "onClick"];
83
+ const _hoisted_4 = { class: "flex" };
84
+ const _hoisted_5 = {
85
+ key: 0,
86
+ class: "pl-1 opacity-50"
87
+ };
88
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
89
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
90
+ vue.createElementVNode("div", _hoisted_2, null, 512),
91
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.items, (o) => {
92
+ return vue.openBlock(), vue.createElementBlock("button", {
93
+ key: o[_ctx.itemValue],
94
+ disabled: o.disabled,
95
+ class: vue.normalizeClass(["z-10 duration-700", [
96
+ _ctx.SIZES[_ctx.size],
97
+ _ctx.modelValue === o[_ctx.itemValue] ? `${_ctx.ACTIVE_CLASS} hover:text-p-purple-70` : "hover:text-p-gray-60",
98
+ { "opacity-25": o.disabled }
99
+ ]]),
100
+ onClick: ($event) => _ctx.click($event, o)
101
+ }, [
102
+ vue.createElementVNode("div", _hoisted_4, [
103
+ vue.createElementVNode("div", null, vue.toDisplayString(o[_ctx.itemText]), 1),
104
+ o[_ctx.itemSubtext] ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_5, vue.toDisplayString(o[_ctx.itemSubtext]), 1)) : vue.createCommentVNode("", true)
105
+ ])
106
+ ], 10, _hoisted_3);
107
+ }), 128))
108
+ ]);
109
+ }
110
+ const pSelectPill = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
111
+ module.exports = pSelectPill;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ const pSelect_vue_vue_type_script_setup_true_lang = require("./chunks/p-select.js");
3
+ module.exports = pSelect_vue_vue_type_script_setup_true_lang._sfc_main;
@@ -0,0 +1,73 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
4
+ const LOADER_TYPES = {
5
+ rectangle: "rectangle",
6
+ circle: "circle"
7
+ };
8
+ const LOADER_CSS_CLASSES = {
9
+ [LOADER_TYPES.rectangle]: "rounded",
10
+ [LOADER_TYPES.circle]: "rounded-full"
11
+ };
12
+ const SHIMMER_COLOR = "#ffffff";
13
+ const isHexColor = (hexColor) => {
14
+ const hex = hexColor.replace("#", "");
15
+ return typeof hexColor === "string" && hexColor.startsWith("#") && hex.length === 6 && !isNaN(Number("0x" + hex));
16
+ };
17
+ const hexToRgb = (hex) => {
18
+ var _a;
19
+ return `${(_a = hex.match(/\w\w/g)) == null ? void 0 : _a.map((x) => +`0x${x}`)}`;
20
+ };
21
+ const _sfc_main = vue.defineComponent({
22
+ name: "PSkeletonLoader",
23
+ props: {
24
+ type: {
25
+ type: String,
26
+ default: LOADER_TYPES.rectangle,
27
+ validator(value) {
28
+ return Object.values(LOADER_TYPES).includes(value);
29
+ }
30
+ },
31
+ bgClass: {
32
+ type: String,
33
+ default: "bg-p-gray-30"
34
+ },
35
+ cssClass: {
36
+ type: String,
37
+ default: ""
38
+ },
39
+ shimmerColor: {
40
+ type: String,
41
+ default: SHIMMER_COLOR
42
+ }
43
+ },
44
+ data() {
45
+ return {
46
+ LOADER_TYPES
47
+ };
48
+ },
49
+ computed: {
50
+ shimmerStyle() {
51
+ const rgb = isHexColor(this.shimmerColor) ? hexToRgb(this.shimmerColor) : SHIMMER_COLOR;
52
+ return {
53
+ backgroundImage: `linear-gradient(90deg, rgba(${rgb}, 0) 0%, rgba(${rgb}, 0.2) 20%, rgba(${rgb}, 0.5) 60%, rgba(${rgb}, 0))`
54
+ };
55
+ },
56
+ loaderClass() {
57
+ return this.cssClass ? this.cssClass : LOADER_CSS_CLASSES[this.type];
58
+ }
59
+ }
60
+ });
61
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
62
+ return vue.openBlock(), vue.createElementBlock("div", {
63
+ class: vue.normalizeClass([_ctx.bgClass, _ctx.loaderClass, "relative overflow-hidden"])
64
+ }, [
65
+ vue.createElementVNode("div", {
66
+ class: "shimmer absolute bottom-0 left-0 right-0 top-0",
67
+ style: vue.normalizeStyle(_ctx.shimmerStyle)
68
+ }, null, 4),
69
+ vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
70
+ ], 2);
71
+ }
72
+ const PSkeletonLoader = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-53e537dc"]]);
73
+ module.exports = PSkeletonLoader;
@@ -0,0 +1,20 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
4
+ const _sfc_main = vue.defineComponent({
5
+ name: "PTableFilterIcon",
6
+ inheritAttrs: false,
7
+ props: {
8
+ active: {
9
+ type: Boolean,
10
+ default: false
11
+ }
12
+ }
13
+ });
14
+ function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
15
+ return vue.openBlock(), vue.createElementBlock("div", vue.mergeProps({
16
+ class: ["h-5 w-5 shrink-0 cursor-pointer filter", { active: _ctx.active }]
17
+ }, _ctx.$attrs), null, 16);
18
+ }
19
+ const PTableFilterIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cbac2434"]]);
20
+ module.exports = PTableFilterIcon;