@pequity/squirrel 8.4.0 → 8.4.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.
- package/dist/cjs/chunks/index.js +3 -4
- package/dist/cjs/chunks/p-dropdown-select.js +13 -14
- package/dist/cjs/chunks/p-icon.js +13 -16
- package/dist/cjs/chunks/p-steps.js +58 -0
- package/dist/cjs/dom.js +1 -2
- package/dist/cjs/index.js +36 -89
- package/dist/cjs/listKeyboardNavigation.js +2 -2
- package/dist/cjs/p-dropdown.js +1 -2
- package/dist/cjs/p-file-upload.js +1 -2
- package/dist/cjs/p-input-search.js +1 -2
- package/dist/cjs/p-modal.js +4 -7
- package/dist/cjs/p-skeleton-loader.js +1 -4
- package/dist/cjs/p-steps.js +2 -0
- package/dist/cjs/usePLoading.js +2 -8
- package/dist/cjs/usePTableColResize.js +1 -2
- package/dist/cjs/usePTableRowVirtualizer.js +2 -2
- package/dist/cjs/useSelectList.js +13 -21
- package/dist/es/chunks/index.js +3 -4
- package/dist/es/chunks/p-dropdown-select.js +15 -16
- package/dist/es/chunks/p-icon.js +13 -16
- package/dist/es/chunks/p-steps.js +59 -0
- package/dist/es/dom.js +1 -2
- package/dist/es/index.js +69 -122
- package/dist/es/listKeyboardNavigation.js +2 -2
- package/dist/es/p-dropdown-select.js +1 -1
- package/dist/es/p-dropdown.js +1 -2
- package/dist/es/p-file-upload.js +1 -2
- package/dist/es/p-input-search.js +1 -2
- package/dist/es/p-modal.js +4 -7
- package/dist/es/p-skeleton-loader.js +1 -4
- package/dist/es/p-steps.js +4 -1
- package/dist/es/usePLoading.js +2 -8
- package/dist/es/usePTableColResize.js +1 -2
- package/dist/es/usePTableRowVirtualizer.js +2 -2
- package/dist/es/useSelectList.js +13 -21
- package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +2 -2
- package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +2 -2
- package/dist/squirrel/components/p-input/p-input.vue.d.ts +1 -1
- package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +2 -2
- package/dist/squirrel/components/p-link/p-link.vue.d.ts +2 -2
- package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +6 -6
- package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +2 -2
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +1 -1
- package/dist/squirrel.css +74 -74
- package/package.json +30 -33
- package/squirrel/components/p-action-bar/p-action-bar.stories.js +4 -3
- package/squirrel/components/p-dropdown-select/p-dropdown-select.spec.js +38 -29
- package/squirrel/components/p-dropdown-select/p-dropdown-select.vue +4 -7
- package/squirrel/components/p-input-number/p-input-number.stories.js +2 -1
- package/squirrel/components/p-select-list/p-select-list.spec.js +22 -4
- package/squirrel/components/p-select-list/p-select-list.vue +3 -2
- package/squirrel/components/p-select-list/useSelectList.ts +2 -2
- package/squirrel/components/p-tabs/p-tabs.stories.js +2 -1
package/dist/es/index.js
CHANGED
|
@@ -9,38 +9,39 @@ import { default as default4 } from "./p-close-btn.js";
|
|
|
9
9
|
import { _ as _6 } from "./chunks/p-date-picker.js";
|
|
10
10
|
import { default as default5 } from "./p-drawer.js";
|
|
11
11
|
import { default as default6 } from "./p-dropdown.js";
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
12
|
+
import { _ as _imports_0$1 } from "./chunks/p-dropdown-select.js";
|
|
13
|
+
import { a } from "./chunks/p-dropdown-select.js";
|
|
14
14
|
import { defineComponent, shallowRef, ref, computed, onMounted, createElementBlock, openBlock, normalizeClass, createCommentVNode, createElementVNode, withDirectives, unref, toDisplayString, withModifiers, createVNode, createTextVNode, Fragment, renderList, vShow, useAttrs, resolveDirective, normalizeStyle, isRef, renderSlot, provide, onBeforeUnmount, watch, mergeProps, toHandlers, createBlock, withCtx } from "vue";
|
|
15
15
|
import { formatBytes, getFileExtension } from "./p-file-upload.js";
|
|
16
|
-
import { _ as _sfc_main$
|
|
16
|
+
import { _ as _sfc_main$4 } from "./chunks/p-icon.js";
|
|
17
17
|
import { useInputClasses } from "./useInputClasses.js";
|
|
18
|
-
import { uniq,
|
|
18
|
+
import { uniq, kebabCase } from "lodash-es";
|
|
19
19
|
import { useToast } from "vue-toastification";
|
|
20
20
|
import { P_ICON_ALIASES } from "./p-icon.js";
|
|
21
|
-
import { _ as
|
|
22
|
-
import { _ as
|
|
23
|
-
import { _ as
|
|
24
|
-
import { _ as
|
|
25
|
-
import { _ as
|
|
21
|
+
import { _ as _7 } from "./chunks/p-info-icon.js";
|
|
22
|
+
import { _ as _8 } from "./chunks/p-inline-date-picker.js";
|
|
23
|
+
import { _ as _9 } from "./chunks/p-input.js";
|
|
24
|
+
import { _ as _10 } from "./chunks/p-input-number.js";
|
|
25
|
+
import { _ as _11 } from "./chunks/p-input-percent.js";
|
|
26
26
|
import PInputSearch from "./p-input-search.js";
|
|
27
|
-
import { _ as
|
|
27
|
+
import { _ as _12 } from "./chunks/p-link.js";
|
|
28
28
|
import { default as default7 } from "./p-loading.js";
|
|
29
29
|
import { usePLoading } from "./usePLoading.js";
|
|
30
30
|
import { default as default8 } from "./p-modal.js";
|
|
31
31
|
import { usePModal } from "./usePModal.js";
|
|
32
|
-
import { _ as
|
|
33
|
-
import { _ as
|
|
34
|
-
import { _ as
|
|
35
|
-
import { _ as
|
|
36
|
-
import { _ as
|
|
37
|
-
import { _ as
|
|
32
|
+
import { _ as _13 } from "./chunks/p-pagination.js";
|
|
33
|
+
import { _ as _14 } from "./chunks/p-pagination-info.js";
|
|
34
|
+
import { _ as _15 } from "./chunks/p-progress-bar.js";
|
|
35
|
+
import { _ as _16 } from "./chunks/p-ring-loader.js";
|
|
36
|
+
import { _ as _17 } from "./chunks/p-select.js";
|
|
37
|
+
import { _ as _18 } from "./chunks/p-select-btn.js";
|
|
38
38
|
import { SIZES } from "./p-select-list.js";
|
|
39
39
|
import { useSelectList } from "./useSelectList.js";
|
|
40
40
|
import { toString } from "./string.js";
|
|
41
41
|
import { splitStringForHighlight } from "./text.js";
|
|
42
42
|
import { default as default9 } from "./p-select-pill.js";
|
|
43
43
|
import { default as default10 } from "./p-skeleton-loader.js";
|
|
44
|
+
import { _ as _19 } from "./chunks/p-steps.js";
|
|
44
45
|
import { colsInjectionKey, isFirstColFixedInjectionKey, isLastColFixedInjectionKey, isColsResizableInjectionKey } from "./p-table.js";
|
|
45
46
|
import { MIN_WIDTH_COL_RESIZE } from "./p-table.js";
|
|
46
47
|
import { usePTableColResize } from "./usePTableColResize.js";
|
|
@@ -65,12 +66,12 @@ import { isObject } from "./object.js";
|
|
|
65
66
|
import { createPagingRange } from "./pagination.js";
|
|
66
67
|
import { sanitizeUrl } from "./sanitization.js";
|
|
67
68
|
import { M, N, f, i, c, x } from "./chunks/index.js";
|
|
68
|
-
const _hoisted_1$
|
|
69
|
-
const _hoisted_2$
|
|
69
|
+
const _hoisted_1$3 = ["data-has-error"];
|
|
70
|
+
const _hoisted_2$3 = {
|
|
70
71
|
key: 0,
|
|
71
72
|
class: "flex h-28 flex-col items-center justify-center"
|
|
72
73
|
};
|
|
73
|
-
const _hoisted_3$
|
|
74
|
+
const _hoisted_3$3 = {
|
|
74
75
|
key: 0,
|
|
75
76
|
class: "flex flex-col items-center"
|
|
76
77
|
};
|
|
@@ -80,13 +81,13 @@ const _hoisted_6$3 = {
|
|
|
80
81
|
key: 1,
|
|
81
82
|
class: "flex flex-col items-center"
|
|
82
83
|
};
|
|
83
|
-
const _hoisted_7$
|
|
84
|
+
const _hoisted_7$2 = { class: "mt-2 text-p-purple-60" };
|
|
84
85
|
const _hoisted_8 = ["accept", "multiple", "disabled"];
|
|
85
86
|
const _hoisted_9 = { class: "max-h-48 overflow-y-auto overflow-x-hidden" };
|
|
86
87
|
const _hoisted_10 = ["title"];
|
|
87
88
|
const _hoisted_11 = ["onClick"];
|
|
88
89
|
const _hoisted_12 = { class: "mt-1 text-xs text-p-gray-40" };
|
|
89
|
-
const _sfc_main$
|
|
90
|
+
const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
90
91
|
...{
|
|
91
92
|
name: "PFileUpload"
|
|
92
93
|
},
|
|
@@ -197,8 +198,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
197
198
|
return res;
|
|
198
199
|
};
|
|
199
200
|
const uploadFile = (e) => {
|
|
200
|
-
|
|
201
|
-
const f2 = ((_a = e.target) == null ? void 0 : _a.files) || ((_b = e.dataTransfer) == null ? void 0 : _b.files);
|
|
201
|
+
const f2 = e.target?.files || e.dataTransfer?.files;
|
|
202
202
|
if (!f2) {
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
@@ -256,9 +256,9 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
256
256
|
onDrop: withModifiers(onDrop, ["prevent", "stop"]),
|
|
257
257
|
onClick: openFileDialog
|
|
258
258
|
}, [
|
|
259
|
-
!maxFilesReached.value ? (openBlock(), createElementBlock("div", _hoisted_2$
|
|
260
|
-
!isDraggingOver.value ? (openBlock(), createElementBlock("div", _hoisted_3$
|
|
261
|
-
createVNode(_sfc_main$
|
|
259
|
+
!maxFilesReached.value ? (openBlock(), createElementBlock("div", _hoisted_2$3, [
|
|
260
|
+
!isDraggingOver.value ? (openBlock(), createElementBlock("div", _hoisted_3$3, [
|
|
261
|
+
createVNode(_sfc_main$4, {
|
|
262
262
|
icon: "upload",
|
|
263
263
|
width: "32",
|
|
264
264
|
class: "text-p-gray-50"
|
|
@@ -268,12 +268,12 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
268
268
|
createElementVNode("span", _hoisted_5$3, "select " + toDisplayString(fileWord.value), 1)
|
|
269
269
|
])
|
|
270
270
|
])) : (openBlock(), createElementBlock("div", _hoisted_6$3, [
|
|
271
|
-
createVNode(_sfc_main$
|
|
271
|
+
createVNode(_sfc_main$4, {
|
|
272
272
|
icon: "tdesign:drag-drop",
|
|
273
273
|
width: "32",
|
|
274
274
|
class: "text-primary"
|
|
275
275
|
}),
|
|
276
|
-
createElementVNode("div", _hoisted_7$
|
|
276
|
+
createElementVNode("div", _hoisted_7$2, "Drop " + toDisplayString(fileWord.value), 1)
|
|
277
277
|
])),
|
|
278
278
|
createElementVNode("input", {
|
|
279
279
|
ref_key: "fileInputRef",
|
|
@@ -308,7 +308,7 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
308
308
|
class: "h-5 shrink-0 cursor-pointer overflow-hidden",
|
|
309
309
|
onClick: withModifiers(($event) => removeFile(index), ["stop"])
|
|
310
310
|
}, [
|
|
311
|
-
createVNode(_sfc_main$
|
|
311
|
+
createVNode(_sfc_main$4, {
|
|
312
312
|
icon: "weui:close2-outlined",
|
|
313
313
|
width: "20",
|
|
314
314
|
class: "text-p-gray-60 hover:text-on-error"
|
|
@@ -324,13 +324,13 @@ const _sfc_main$4 = /* @__PURE__ */ defineComponent({
|
|
|
324
324
|
[vShow, __props.errorMsg]
|
|
325
325
|
]),
|
|
326
326
|
createElementVNode("div", _hoisted_12, toDisplayString(__props.multiple ? `Max ${__props.maxNumberOfFiles}` : "One") + " " + toDisplayString(acceptFileTypes.value) + " " + toDisplayString(__props.multiple ? "files" : "file") + " with size less than " + toDisplayString(unref(formatBytes)(__props.maxSizeInBytes)) + " " + toDisplayString(__props.multiple ? "each" : ""), 1)
|
|
327
|
-
], 10, _hoisted_1$
|
|
327
|
+
], 10, _hoisted_1$3);
|
|
328
328
|
};
|
|
329
329
|
}
|
|
330
330
|
});
|
|
331
|
-
const _hoisted_1$
|
|
332
|
-
const _hoisted_2$
|
|
333
|
-
const _hoisted_3$
|
|
331
|
+
const _hoisted_1$2 = ["data-has-error"];
|
|
332
|
+
const _hoisted_2$2 = { class: "text-p-purple-60" };
|
|
333
|
+
const _hoisted_3$2 = { class: "flex flex-row" };
|
|
334
334
|
const _hoisted_4$2 = ["onClick"];
|
|
335
335
|
const _hoisted_5$2 = ["title"];
|
|
336
336
|
const _hoisted_6$2 = {
|
|
@@ -338,7 +338,11 @@ const _hoisted_6$2 = {
|
|
|
338
338
|
class: "ml-auto fill-p-purple-60 pl-2",
|
|
339
339
|
src: _imports_0$1
|
|
340
340
|
};
|
|
341
|
-
const
|
|
341
|
+
const _hoisted_7$1 = {
|
|
342
|
+
key: 1,
|
|
343
|
+
class: "ml-auto h-4 w-[26px] pl-2"
|
|
344
|
+
};
|
|
345
|
+
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
342
346
|
...{
|
|
343
347
|
name: "PSelectList",
|
|
344
348
|
inheritAttrs: false
|
|
@@ -506,12 +510,11 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
506
510
|
} = useSelectList(props, inputSearch, virtualizerRef, emit);
|
|
507
511
|
const style = computed(() => $attrs.style);
|
|
508
512
|
onMounted(async () => {
|
|
509
|
-
|
|
510
|
-
const actionsContainerHeight = ((_a = actionsContainer.value) == null ? void 0 : _a.clientHeight) || 0;
|
|
513
|
+
const actionsContainerHeight = actionsContainer.value?.clientHeight || 0;
|
|
511
514
|
scrollerStyle.value = { maxHeight: `${computedItemSize.value * props.itemsVisible - actionsContainerHeight}px` };
|
|
512
515
|
putSelectedItemsOnTop();
|
|
513
516
|
if (props.searchable) {
|
|
514
|
-
props.focusSearchOnMount &&
|
|
517
|
+
props.focusSearchOnMount && inputSearch.value?.$el.querySelector("input").focus();
|
|
515
518
|
} else {
|
|
516
519
|
setupNavigationSvc();
|
|
517
520
|
}
|
|
@@ -546,8 +549,8 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
546
549
|
ref: actionsContainer,
|
|
547
550
|
class: "flex flex-row justify-between text-xs font-semibold text-primary"
|
|
548
551
|
}, [
|
|
549
|
-
createElementVNode("p", _hoisted_2$
|
|
550
|
-
createElementVNode("div", _hoisted_3$
|
|
552
|
+
createElementVNode("p", _hoisted_2$2, toDisplayString(unref(computedItems).length) + " items", 1),
|
|
553
|
+
createElementVNode("div", _hoisted_3$2, [
|
|
551
554
|
unref(computedItems).length === unref(internalItems).length ? (openBlock(), createElementBlock("a", {
|
|
552
555
|
key: 0,
|
|
553
556
|
class: normalizeClass([
|
|
@@ -611,13 +614,13 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
611
614
|
class: normalizeClass([
|
|
612
615
|
unref(LIST_ITEM_CLASS),
|
|
613
616
|
{
|
|
614
|
-
[unref(LIST_ITEM_ACTIVE_CLASS)]: unref(isSelected)(unref(getValue)(row.index))
|
|
615
|
-
|
|
616
|
-
|
|
617
|
+
[unref(LIST_ITEM_ACTIVE_CLASS)]: unref(isSelected)(unref(getValue)(row.index))
|
|
618
|
+
},
|
|
619
|
+
unref(isDisabled)(unref(computedItems)[row.index]) ? unref(LIST_ITEM_DISABLED_CLASS) : "cursor-pointer"
|
|
617
620
|
]),
|
|
618
621
|
"p-select-list-option-item": "",
|
|
619
622
|
style: normalizeStyle(listItemStyle.value),
|
|
620
|
-
onClick: ($event) => unref(select)($event, unref(getValue)(row.index))
|
|
623
|
+
onClick: ($event) => !unref(isDisabled)(unref(computedItems)[row.index]) && unref(select)($event, unref(getValue)(row.index))
|
|
621
624
|
}, [
|
|
622
625
|
createElementVNode("div", {
|
|
623
626
|
class: normalizeClass(["flex items-center", { [unref(SIZES)[__props.size]]: !__props.itemSize }])
|
|
@@ -639,7 +642,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
639
642
|
}), 128))
|
|
640
643
|
], 8, _hoisted_5$2)
|
|
641
644
|
]),
|
|
642
|
-
unref(isSelected)(unref(getValue)(row.index)) ? (openBlock(), createElementBlock("img", _hoisted_6$2)) :
|
|
645
|
+
unref(isSelected)(unref(getValue)(row.index)) ? (openBlock(), createElementBlock("img", _hoisted_6$2)) : (openBlock(), createElementBlock("div", _hoisted_7$1))
|
|
643
646
|
], 2)
|
|
644
647
|
], 14, _hoisted_4$2)), [
|
|
645
648
|
[_directive_close_popper, __props.closePopperOnSelect && !__props.multiple]
|
|
@@ -659,60 +662,7 @@ const _sfc_main$3 = /* @__PURE__ */ defineComponent({
|
|
|
659
662
|
}, toDisplayString(__props.errorMsg), 3), [
|
|
660
663
|
[vShow, __props.errorMsg]
|
|
661
664
|
])
|
|
662
|
-
], 14, _hoisted_1$
|
|
663
|
-
};
|
|
664
|
-
}
|
|
665
|
-
});
|
|
666
|
-
const _hoisted_1$2 = { class: "flex items-center gap-2" };
|
|
667
|
-
const _hoisted_2$2 = ["data-state", "onClick"];
|
|
668
|
-
const _hoisted_3$2 = {
|
|
669
|
-
key: 0,
|
|
670
|
-
class: "flex items-center"
|
|
671
|
-
};
|
|
672
|
-
const _sfc_main$2 = /* @__PURE__ */ defineComponent({
|
|
673
|
-
...{
|
|
674
|
-
name: "PSteps"
|
|
675
|
-
},
|
|
676
|
-
__name: "p-steps",
|
|
677
|
-
props: {
|
|
678
|
-
activeStep: { default: null },
|
|
679
|
-
steps: { default: () => [] },
|
|
680
|
-
clickable: { type: Boolean, default: false }
|
|
681
|
-
},
|
|
682
|
-
emits: ["click:step"],
|
|
683
|
-
setup(__props, { emit: __emit }) {
|
|
684
|
-
const props = __props;
|
|
685
|
-
const emit = __emit;
|
|
686
|
-
const activeStepIndex = computed(() => props.steps.findIndex((s) => s.value === props.activeStep));
|
|
687
|
-
const stepClasses = (step, stepIndex) => {
|
|
688
|
-
if (step.value === props.activeStep) {
|
|
689
|
-
return "border-p-blue-50 bg-p-blue-50 text-surface";
|
|
690
|
-
}
|
|
691
|
-
if (activeStepIndex.value < stepIndex) {
|
|
692
|
-
return "border-p-gray-30 text-p-gray-30";
|
|
693
|
-
}
|
|
694
|
-
return "border-p-blue-50 text-p-blue-50";
|
|
695
|
-
};
|
|
696
|
-
return (_ctx, _cache) => {
|
|
697
|
-
return openBlock(), createElementBlock("div", _hoisted_1$2, [
|
|
698
|
-
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.steps, (step, i2) => {
|
|
699
|
-
return openBlock(), createElementBlock(Fragment, {
|
|
700
|
-
key: step.value
|
|
701
|
-
}, [
|
|
702
|
-
createElementVNode("div", {
|
|
703
|
-
class: normalizeClass(["text-nowrap rounded-full border px-4 py-1 text-sm font-semibold", [stepClasses(step, i2), { "cursor-pointer": _ctx.clickable && !step.disabled }]]),
|
|
704
|
-
"data-state": step.value === _ctx.activeStep ? "active" : "inactive",
|
|
705
|
-
onClick: ($event) => emit("click:step", step, i2)
|
|
706
|
-
}, toDisplayString(step.text || unref(startCase)(String(step.value))), 11, _hoisted_2$2),
|
|
707
|
-
i2 < _ctx.steps.length - 1 ? (openBlock(), createElementBlock("div", _hoisted_3$2, [
|
|
708
|
-
createVNode(_sfc_main$5, {
|
|
709
|
-
icon: "material-symbols:arrow-right-alt-rounded",
|
|
710
|
-
class: normalizeClass([activeStepIndex.value <= i2 ? "text-p-gray-30" : "text-p-blue-50"])
|
|
711
|
-
}, null, 8, ["class"])
|
|
712
|
-
])) : createCommentVNode("", true)
|
|
713
|
-
], 64);
|
|
714
|
-
}), 128))
|
|
715
|
-
]);
|
|
665
|
+
], 14, _hoisted_1$2);
|
|
716
666
|
};
|
|
717
667
|
}
|
|
718
668
|
});
|
|
@@ -826,12 +776,10 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
826
776
|
return "";
|
|
827
777
|
};
|
|
828
778
|
onMounted(() => {
|
|
829
|
-
|
|
830
|
-
(_a = scrollWrapper.value) == null ? void 0 : _a.addEventListener("scroll", emitScroll, true);
|
|
779
|
+
scrollWrapper.value?.addEventListener("scroll", emitScroll, true);
|
|
831
780
|
});
|
|
832
781
|
onBeforeUnmount(() => {
|
|
833
|
-
|
|
834
|
-
(_a = scrollWrapper.value) == null ? void 0 : _a.removeEventListener("scroll", emitScroll, true);
|
|
782
|
+
scrollWrapper.value?.removeEventListener("scroll", emitScroll, true);
|
|
835
783
|
});
|
|
836
784
|
watch(isColResizing, (nV) => {
|
|
837
785
|
if (nV === false && colResizingWidth.value > 0) {
|
|
@@ -842,7 +790,6 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
842
790
|
tbodyElement
|
|
843
791
|
});
|
|
844
792
|
return (_ctx, _cache) => {
|
|
845
|
-
var _a, _b;
|
|
846
793
|
return openBlock(), createElementBlock("div", {
|
|
847
794
|
ref_key: "scrollWrapper",
|
|
848
795
|
ref: scrollWrapper,
|
|
@@ -852,9 +799,9 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
|
852
799
|
key: 0,
|
|
853
800
|
class: "fixed z-[100] w-1 cursor-col-resize bg-p-gray-30",
|
|
854
801
|
style: normalizeStyle({
|
|
855
|
-
top: `${
|
|
802
|
+
top: `${scrollWrapper.value?.offsetTop}px`,
|
|
856
803
|
left: unref(colResizeHandleLeft),
|
|
857
|
-
height: `${
|
|
804
|
+
height: `${scrollWrapper.value?.offsetHeight}px`
|
|
858
805
|
}),
|
|
859
806
|
"data-resize-y-axis": ""
|
|
860
807
|
}, null, 4)) : createCommentVNode("", true),
|
|
@@ -1051,29 +998,29 @@ export {
|
|
|
1051
998
|
_6 as PDatePicker,
|
|
1052
999
|
default5 as PDrawer,
|
|
1053
1000
|
default6 as PDropdown,
|
|
1054
|
-
|
|
1055
|
-
_sfc_main$
|
|
1001
|
+
a as PDropdownSelect,
|
|
1002
|
+
_sfc_main$3 as PFileUpload,
|
|
1056
1003
|
default11 as PFilterIcon,
|
|
1057
|
-
_sfc_main$
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1004
|
+
_sfc_main$4 as PIcon,
|
|
1005
|
+
_7 as PInfoIcon,
|
|
1006
|
+
_8 as PInlineDatePicker,
|
|
1007
|
+
_9 as PInput,
|
|
1008
|
+
_10 as PInputNumber,
|
|
1009
|
+
_11 as PInputPercent,
|
|
1063
1010
|
PInputSearch,
|
|
1064
|
-
|
|
1011
|
+
_12 as PLink,
|
|
1065
1012
|
default7 as PLoading,
|
|
1066
1013
|
default8 as PModal,
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
_sfc_main$
|
|
1014
|
+
_13 as PPagination,
|
|
1015
|
+
_14 as PPaginationInfo,
|
|
1016
|
+
_15 as PProgressBar,
|
|
1017
|
+
_16 as PRingLoader,
|
|
1018
|
+
_17 as PSelect,
|
|
1019
|
+
_18 as PSelectBtn,
|
|
1020
|
+
_sfc_main$2 as PSelectList,
|
|
1074
1021
|
default9 as PSelectPill,
|
|
1075
1022
|
default10 as PSkeletonLoader,
|
|
1076
|
-
|
|
1023
|
+
_19 as PSteps,
|
|
1077
1024
|
pTable as PTable,
|
|
1078
1025
|
PTableHeaderCell,
|
|
1079
1026
|
_20 as PTableLoader,
|
|
@@ -43,7 +43,7 @@ const setupListKeyboardNavigation = (options) => {
|
|
|
43
43
|
};
|
|
44
44
|
const setFocusedItem = (el) => {
|
|
45
45
|
clearFocusedState();
|
|
46
|
-
el
|
|
46
|
+
el?.classList.add(itemFocusClass);
|
|
47
47
|
};
|
|
48
48
|
const listKeydown = (e) => {
|
|
49
49
|
if ([ARROW_UP_KEY, ARROW_DOWN_KEY].includes(e.key)) {
|
|
@@ -61,7 +61,7 @@ const setupListKeyboardNavigation = (options) => {
|
|
|
61
61
|
if (getFocusedItem()) {
|
|
62
62
|
e.preventDefault();
|
|
63
63
|
const focusedItem = getFocusedItem();
|
|
64
|
-
const el = itemSelectSelector ? focusedItem
|
|
64
|
+
const el = itemSelectSelector ? focusedItem?.querySelector(itemSelectSelector) : getFocusedItem();
|
|
65
65
|
itemSelectEvents.forEach((e2) => {
|
|
66
66
|
const event = new Event(e2);
|
|
67
67
|
if (el) {
|
package/dist/es/p-dropdown.js
CHANGED
|
@@ -78,8 +78,7 @@ const _sfc_main = defineComponent({
|
|
|
78
78
|
e.key === ESCAPE_KEY && this.$refs.vPopper.$refs.popper.hide();
|
|
79
79
|
},
|
|
80
80
|
destroy() {
|
|
81
|
-
|
|
82
|
-
(_a = this.navigationSvc) == null ? void 0 : _a.destroy();
|
|
81
|
+
this.navigationSvc?.destroy();
|
|
83
82
|
document.removeEventListener("keydown", this.popoverEscKeydown);
|
|
84
83
|
},
|
|
85
84
|
async updateReference(newReference) {
|
package/dist/es/p-file-upload.js
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
const getFileExtension = (fileName) => {
|
|
2
|
-
var _a;
|
|
3
2
|
if (!fileName || !fileName.includes(".")) {
|
|
4
3
|
return "";
|
|
5
4
|
}
|
|
6
|
-
return
|
|
5
|
+
return fileName.split(".").pop()?.toLowerCase();
|
|
7
6
|
};
|
|
8
7
|
const formatBytes = (bytes, decimals = 2) => {
|
|
9
8
|
if (!+bytes || bytes <= 0) {
|
|
@@ -60,8 +60,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
60
60
|
const clearSearch = () => {
|
|
61
61
|
query.value = "";
|
|
62
62
|
requestAnimationFrame(() => {
|
|
63
|
-
|
|
64
|
-
(_a = input.value) == null ? void 0 : _a.$el.querySelector("input").focus();
|
|
63
|
+
input.value?.$el.querySelector("input").focus();
|
|
65
64
|
});
|
|
66
65
|
};
|
|
67
66
|
const keydownEnter = () => {
|
package/dist/es/p-modal.js
CHANGED
|
@@ -127,8 +127,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
127
127
|
}
|
|
128
128
|
});
|
|
129
129
|
onMounted(() => {
|
|
130
|
-
|
|
131
|
-
id.value = "pm-" + ((_a = getCurrentInstance()) == null ? void 0 : _a.uid);
|
|
130
|
+
id.value = "pm-" + getCurrentInstance()?.uid;
|
|
132
131
|
const valueToWatch = !props.name ? () => props.modelValue : () => modal.state.modals[props.name];
|
|
133
132
|
watch(
|
|
134
133
|
valueToWatch,
|
|
@@ -164,12 +163,11 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
164
163
|
}
|
|
165
164
|
};
|
|
166
165
|
const keydown = (e) => {
|
|
167
|
-
var _a;
|
|
168
166
|
if (e.which === 27 || e.keyCode === 27) {
|
|
169
167
|
close();
|
|
170
168
|
}
|
|
171
169
|
if (e.which === 9 || e.keyCode === 9) {
|
|
172
|
-
const all = [].slice.call(
|
|
170
|
+
const all = [].slice.call(pmWrapper.value?.querySelectorAll(FOCUSABLE_ELEMENTS)).filter(function(el) {
|
|
173
171
|
return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
|
|
174
172
|
});
|
|
175
173
|
if (e.shiftKey) {
|
|
@@ -236,7 +234,6 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
236
234
|
}
|
|
237
235
|
nextTick(() => {
|
|
238
236
|
window.requestAnimationFrame(() => {
|
|
239
|
-
var _a, _b;
|
|
240
237
|
const lastZindex = getTopZindex();
|
|
241
238
|
if (lastZindex > 0) {
|
|
242
239
|
const all = getAllVisibleWrappers();
|
|
@@ -244,7 +241,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
244
241
|
const wrapper = all[i];
|
|
245
242
|
if (parseInt(wrapper.style.zIndex) === lastZindex) {
|
|
246
243
|
if (wrapper.contains(elToFocus.value)) {
|
|
247
|
-
|
|
244
|
+
elToFocus.value?.focus();
|
|
248
245
|
} else {
|
|
249
246
|
handleFocus(wrapper);
|
|
250
247
|
}
|
|
@@ -253,7 +250,7 @@ const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
|
253
250
|
}
|
|
254
251
|
} else {
|
|
255
252
|
if (document.body.contains(elToFocus.value)) {
|
|
256
|
-
|
|
253
|
+
elToFocus.value?.focus();
|
|
257
254
|
}
|
|
258
255
|
}
|
|
259
256
|
animatingZIndex = 0;
|
|
@@ -13,10 +13,7 @@ const isHexColor = (hexColor) => {
|
|
|
13
13
|
const hex = hexColor.replace("#", "");
|
|
14
14
|
return typeof hexColor === "string" && hexColor.startsWith("#") && hex.length === 6 && !isNaN(Number("0x" + hex));
|
|
15
15
|
};
|
|
16
|
-
const hexToRgb = (hex) => {
|
|
17
|
-
var _a;
|
|
18
|
-
return `${(_a = hex.match(/\w\w/g)) == null ? void 0 : _a.map((x) => +`0x${x}`)}`;
|
|
19
|
-
};
|
|
16
|
+
const hexToRgb = (hex) => `${hex.match(/\w\w/g)?.map((x) => +`0x${x}`)}`;
|
|
20
17
|
const _sfc_main = defineComponent({
|
|
21
18
|
name: "PSkeletonLoader",
|
|
22
19
|
props: {
|
package/dist/es/p-steps.js
CHANGED
package/dist/es/usePLoading.js
CHANGED
|
@@ -2,14 +2,8 @@ import { ref, computed, getCurrentScope, onScopeDispose, markRaw } from "vue";
|
|
|
2
2
|
const LOADING_TEXT = "Loading...";
|
|
3
3
|
const show = ref(false);
|
|
4
4
|
const loadingItems = ref([]);
|
|
5
|
-
const content = computed(() =>
|
|
6
|
-
|
|
7
|
-
return (_a = loadingItems.value[loadingItems.value.length - 1]) == null ? void 0 : _a.content;
|
|
8
|
-
});
|
|
9
|
-
const props = computed(() => {
|
|
10
|
-
var _a;
|
|
11
|
-
return (_a = loadingItems.value[loadingItems.value.length - 1]) == null ? void 0 : _a.props;
|
|
12
|
-
});
|
|
5
|
+
const content = computed(() => loadingItems.value[loadingItems.value.length - 1]?.content);
|
|
6
|
+
const props = computed(() => loadingItems.value[loadingItems.value.length - 1]?.props);
|
|
13
7
|
const usePLoading = (options) => {
|
|
14
8
|
const { delay } = { delay: 200, ...options };
|
|
15
9
|
const scope = getCurrentScope();
|
|
@@ -34,9 +34,8 @@ const usePTableColResize = (options) => {
|
|
|
34
34
|
document.body.classList.remove("cursor-col-resize");
|
|
35
35
|
};
|
|
36
36
|
const colResizeFitToData = (colIndex) => {
|
|
37
|
-
var _a;
|
|
38
37
|
isColResizing.value = true;
|
|
39
|
-
const tds =
|
|
38
|
+
const tds = ths.value[colIndex].closest("table")?.querySelectorAll("tbody tr td:nth-child(" + (colIndex + 1) + ") div.w-max");
|
|
40
39
|
if (!tds) {
|
|
41
40
|
return;
|
|
42
41
|
}
|
|
@@ -14,10 +14,10 @@ const usePTableRowVirtualizer = (options) => {
|
|
|
14
14
|
const virtualRows = computed(() => virtualizer.value.getVirtualItems());
|
|
15
15
|
const paddingTop = computed(() => virtualRows.value.length > 0 ? virtualRows.value[0].start : 0);
|
|
16
16
|
const paddingBottom = computed(
|
|
17
|
-
() => virtualRows.value.length > 0 ?
|
|
17
|
+
() => virtualRows.value.length > 0 ? virtualizer?.value.getTotalSize() - virtualRows.value[virtualRows.value.length - 1].end : 0
|
|
18
18
|
);
|
|
19
19
|
const measureElement = (cmp) => {
|
|
20
|
-
const el = isRef(cmp) ? unref(cmp) : cmp
|
|
20
|
+
const el = isRef(cmp) ? unref(cmp) : cmp?.$el;
|
|
21
21
|
nextTick(() => {
|
|
22
22
|
if (!el) {
|
|
23
23
|
return;
|
package/dist/es/useSelectList.js
CHANGED
|
@@ -26,9 +26,9 @@ const createInternalValue = (modelValue, valueIsObject, multiple, itemValue, int
|
|
|
26
26
|
const nextFrame = () => new Promise((resolve) => requestAnimationFrame(() => requestAnimationFrame(resolve)));
|
|
27
27
|
const nextLoop = (ms) => new Promise((resolve) => setTimeout(resolve, ms || 0));
|
|
28
28
|
const LIST_ITEM_SIZES = { sm: 32, md: 40, lg: 48 };
|
|
29
|
-
const LIST_ITEM_CLASS = "clear-both block w-full
|
|
29
|
+
const LIST_ITEM_CLASS = "clear-both block w-full whitespace-nowrap py-1 px-3 text-left text-sm font-medium hover:bg-p-blue-10";
|
|
30
30
|
const LIST_ITEM_ACTIVE_CLASS = "selected";
|
|
31
|
-
const LIST_ITEM_DISABLED_CLASS = "opacity-30
|
|
31
|
+
const LIST_ITEM_DISABLED_CLASS = "opacity-30 cursor-default";
|
|
32
32
|
const useSelectList = (props, inputSearch, virtualizerRef, emit) => {
|
|
33
33
|
let navigationSvc = null;
|
|
34
34
|
const internalItems = ref([]);
|
|
@@ -63,14 +63,8 @@ const useSelectList = (props, inputSearch, virtualizerRef, emit) => {
|
|
|
63
63
|
};
|
|
64
64
|
})
|
|
65
65
|
);
|
|
66
|
-
const getValue = (index) =>
|
|
67
|
-
|
|
68
|
-
return (_a = computedItems.value[index]) == null ? void 0 : _a[props.itemValue];
|
|
69
|
-
};
|
|
70
|
-
const getText = (index) => {
|
|
71
|
-
var _a;
|
|
72
|
-
return (_a = computedItems.value[index]) == null ? void 0 : _a[props.itemText];
|
|
73
|
-
};
|
|
66
|
+
const getValue = (index) => computedItems.value[index]?.[props.itemValue];
|
|
67
|
+
const getText = (index) => computedItems.value[index]?.[props.itemText];
|
|
74
68
|
watch(
|
|
75
69
|
() => props.modelValue,
|
|
76
70
|
(nV) => {
|
|
@@ -105,7 +99,7 @@ const useSelectList = (props, inputSearch, virtualizerRef, emit) => {
|
|
|
105
99
|
}
|
|
106
100
|
});
|
|
107
101
|
onUnmounted(() => {
|
|
108
|
-
navigationSvc
|
|
102
|
+
navigationSvc?.destroy();
|
|
109
103
|
navigationSvc = null;
|
|
110
104
|
});
|
|
111
105
|
const putSelectedItemsOnTop = () => {
|
|
@@ -126,10 +120,9 @@ const useSelectList = (props, inputSearch, virtualizerRef, emit) => {
|
|
|
126
120
|
}
|
|
127
121
|
};
|
|
128
122
|
const select = async (e, val) => {
|
|
129
|
-
var _a, _b;
|
|
130
123
|
const el = e.currentTarget;
|
|
131
|
-
if (props.multiple && props.searchable && document.activeElement !==
|
|
132
|
-
|
|
124
|
+
if (props.multiple && props.searchable && document.activeElement !== inputSearch.value?.$el.querySelector("input")) {
|
|
125
|
+
inputSearch.value?.$el.querySelector("input").focus();
|
|
133
126
|
}
|
|
134
127
|
if (props.multiple) {
|
|
135
128
|
if (!isSelected(val)) {
|
|
@@ -141,7 +134,7 @@ const useSelectList = (props, inputSearch, virtualizerRef, emit) => {
|
|
|
141
134
|
emit("update:modelValue", props.valueIsObject ? getItemByValue(val) : val);
|
|
142
135
|
}
|
|
143
136
|
await nextTick();
|
|
144
|
-
navigationSvc
|
|
137
|
+
navigationSvc?.setFocusedItem(el.parentElement);
|
|
145
138
|
emit("select", val);
|
|
146
139
|
};
|
|
147
140
|
const toArrOfObjIfNeeded = (arr) => {
|
|
@@ -173,22 +166,21 @@ const useSelectList = (props, inputSearch, virtualizerRef, emit) => {
|
|
|
173
166
|
}
|
|
174
167
|
};
|
|
175
168
|
const destroyNavigationSvc = () => {
|
|
176
|
-
navigationSvc
|
|
169
|
+
navigationSvc?.destroy();
|
|
177
170
|
navigationSvc = null;
|
|
178
171
|
};
|
|
179
172
|
const onFocus = async () => {
|
|
180
173
|
setupNavigationSvc();
|
|
181
174
|
};
|
|
182
175
|
const onMousemove = () => {
|
|
183
|
-
navigationSvc
|
|
176
|
+
navigationSvc?.clearFocusedState();
|
|
184
177
|
};
|
|
185
178
|
const scrollScrollerToTop = async () => {
|
|
186
179
|
rowVirtualizer.value.scrollToOffset(0);
|
|
187
180
|
await nextFrame();
|
|
188
181
|
};
|
|
189
182
|
const scrollToActiveItem = async (options) => {
|
|
190
|
-
|
|
191
|
-
if (options == null ? void 0 : options.wait) {
|
|
183
|
+
if (options?.wait) {
|
|
192
184
|
await nextLoop(options.wait);
|
|
193
185
|
}
|
|
194
186
|
const activeIndex = getActiveItemIndex();
|
|
@@ -198,8 +190,8 @@ const useSelectList = (props, inputSearch, virtualizerRef, emit) => {
|
|
|
198
190
|
});
|
|
199
191
|
await nextLoop();
|
|
200
192
|
await nextFrame();
|
|
201
|
-
const activeEl =
|
|
202
|
-
navigationSvc
|
|
193
|
+
const activeEl = virtualizerRef.value?.querySelector(`.${LIST_ITEM_ACTIVE_CLASS}`);
|
|
194
|
+
navigationSvc?.setFocusedItem(activeEl?.parentNode);
|
|
203
195
|
}
|
|
204
196
|
};
|
|
205
197
|
const getActiveItemIndex = () => {
|
|
@@ -333,9 +333,9 @@ declare const _default: __VLS_WithSlots<import("vue").DefineComponent<import("vu
|
|
|
333
333
|
};
|
|
334
334
|
}>> & Readonly<{}>, {
|
|
335
335
|
icon: "delete" | "edit" | "send" | "settings" | "empty" | "chevron-left" | "chevron-right" | "chevron-up" | "chevron-down" | "ok-circle" | "cancel-circle" | "ok" | "cancel" | "ok-bold" | "cancel-bold" | "archive" | "lock" | "drag-horizontal" | "email" | "location" | "calendar" | "save" | "copy" | "plus" | "add" | "more" | "filters" | "bar-chart" | "list" | "formula" | "refresh" | "download" | "upload" | "info" | "search" | (string & {});
|
|
336
|
-
size: "sm" | "md" | "lg";
|
|
337
336
|
type: ButtonType;
|
|
338
|
-
|
|
337
|
+
size: "sm" | "md" | "lg";
|
|
338
|
+
nativeType: "button" | "submit" | "reset";
|
|
339
339
|
loading: boolean;
|
|
340
340
|
selected: boolean;
|
|
341
341
|
to: string | import("vue-router").RouteLocationAsRelativeGeneric | import("vue-router").RouteLocationAsPathGeneric;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
type Props = {
|
|
2
2
|
text?: string | null;
|
|
3
3
|
};
|
|
4
|
-
declare var
|
|
4
|
+
declare var __VLS_12: {};
|
|
5
5
|
type __VLS_Slots = {} & {
|
|
6
|
-
default?: (props: typeof
|
|
6
|
+
default?: (props: typeof __VLS_12) => any;
|
|
7
7
|
};
|
|
8
8
|
declare const __VLS_component: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
9
9
|
text: string | null;
|