@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/cjs/chunks/index.js
CHANGED
|
@@ -45,7 +45,6 @@ const createClassGroupUtils = (config) => {
|
|
|
45
45
|
};
|
|
46
46
|
};
|
|
47
47
|
const getGroupRecursive = (classParts, classPartObject) => {
|
|
48
|
-
var _a;
|
|
49
48
|
if (classParts.length === 0) {
|
|
50
49
|
return classPartObject.classGroupId;
|
|
51
50
|
}
|
|
@@ -59,15 +58,15 @@ const getGroupRecursive = (classParts, classPartObject) => {
|
|
|
59
58
|
return void 0;
|
|
60
59
|
}
|
|
61
60
|
const classRest = classParts.join(CLASS_PART_SEPARATOR);
|
|
62
|
-
return
|
|
61
|
+
return classPartObject.validators.find(({
|
|
63
62
|
validator
|
|
64
|
-
}) => validator(classRest))
|
|
63
|
+
}) => validator(classRest))?.classGroupId;
|
|
65
64
|
};
|
|
66
65
|
const arbitraryPropertyRegex = /^\[(.+)\]$/;
|
|
67
66
|
const getGroupIdForArbitraryProperty = (className) => {
|
|
68
67
|
if (arbitraryPropertyRegex.test(className)) {
|
|
69
68
|
const arbitraryPropertyClassName = arbitraryPropertyRegex.exec(className)[1];
|
|
70
|
-
const property = arbitraryPropertyClassName
|
|
69
|
+
const property = arbitraryPropertyClassName?.substring(0, arbitraryPropertyClassName.indexOf(":"));
|
|
71
70
|
if (property) {
|
|
72
71
|
return "arbitrary.." + property;
|
|
73
72
|
}
|
|
@@ -38,6 +38,10 @@ const _hoisted_12 = {
|
|
|
38
38
|
class: "ml-auto fill-p-purple-60 pl-2",
|
|
39
39
|
src: _imports_0
|
|
40
40
|
};
|
|
41
|
+
const _hoisted_13 = {
|
|
42
|
+
key: 1,
|
|
43
|
+
class: "ml-auto h-4 w-[26px] pl-2"
|
|
44
|
+
};
|
|
41
45
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
42
46
|
...{
|
|
43
47
|
name: "PDropdownSelect",
|
|
@@ -260,9 +264,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
260
264
|
return rest;
|
|
261
265
|
});
|
|
262
266
|
const style = vue.computed(() => $attrs.style);
|
|
263
|
-
const selectableItemsCount = vue.computed(
|
|
264
|
-
() => internalItems.value.filter((item) => !isDisabled(item) || isSelected(item[props.itemValue])).length
|
|
265
|
-
);
|
|
266
267
|
vue.watch(
|
|
267
268
|
dropdownShow,
|
|
268
269
|
(nV) => {
|
|
@@ -285,23 +286,21 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
285
286
|
formControl.value && observer && observer.unobserve(formControl.value);
|
|
286
287
|
});
|
|
287
288
|
const onShow = async () => {
|
|
288
|
-
|
|
289
|
-
const actionsContainerHeight = ((_a = actionsContainer.value) == null ? void 0 : _a.clientHeight) || 0;
|
|
289
|
+
const actionsContainerHeight = actionsContainer.value?.clientHeight || 0;
|
|
290
290
|
scrollerStyle.value = { maxHeight: `${computedItemSize.value * props.itemsVisible - actionsContainerHeight}px` };
|
|
291
291
|
search.value = "";
|
|
292
292
|
setupNavigationSvc();
|
|
293
293
|
if (props.searchable) {
|
|
294
294
|
await nextLoop();
|
|
295
295
|
await nextFrame();
|
|
296
|
-
|
|
296
|
+
inputSearch.value?.$el.querySelector("input").focus();
|
|
297
297
|
}
|
|
298
298
|
scrollToActiveItem();
|
|
299
299
|
};
|
|
300
300
|
const onHide = () => {
|
|
301
|
-
var _a, _b;
|
|
302
301
|
dropdownShow.value = false;
|
|
303
302
|
destroyNavigationSvc();
|
|
304
|
-
|
|
303
|
+
formControl.value?.querySelector("button")?.focus();
|
|
305
304
|
};
|
|
306
305
|
const handleCreate = () => {
|
|
307
306
|
emit("create", search.value);
|
|
@@ -402,13 +401,13 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
402
401
|
class: vue.normalizeClass([
|
|
403
402
|
vue.unref(LIST_ITEM_CLASS),
|
|
404
403
|
{
|
|
405
|
-
[vue.unref(LIST_ITEM_ACTIVE_CLASS)]: vue.unref(isSelected)(vue.unref(getValue)(row.index))
|
|
406
|
-
|
|
407
|
-
|
|
404
|
+
[vue.unref(LIST_ITEM_ACTIVE_CLASS)]: vue.unref(isSelected)(vue.unref(getValue)(row.index))
|
|
405
|
+
},
|
|
406
|
+
vue.unref(isDisabled)(vue.unref(computedItems)[row.index]) ? vue.unref(LIST_ITEM_DISABLED_CLASS) : "cursor-pointer"
|
|
408
407
|
]),
|
|
409
408
|
"p-select-list-option-item": "",
|
|
410
409
|
style: vue.normalizeStyle(listItemStyle.value),
|
|
411
|
-
onClick: ($event) => vue.unref(select)($event, vue.unref(getValue)(row.index))
|
|
410
|
+
onClick: ($event) => !vue.unref(isDisabled)(vue.unref(computedItems)[row.index]) && vue.unref(select)($event, vue.unref(getValue)(row.index))
|
|
412
411
|
}, [
|
|
413
412
|
vue.createElementVNode("div", {
|
|
414
413
|
class: vue.normalizeClass(["flex items-center", { [vue.unref(pSelectList.SIZES)[__props.size]]: !__props.itemSize }])
|
|
@@ -430,7 +429,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
430
429
|
}), 128))
|
|
431
430
|
], 8, _hoisted_11)
|
|
432
431
|
]),
|
|
433
|
-
vue.unref(isSelected)(vue.unref(getValue)(row.index)) ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_12)) : vue.
|
|
432
|
+
vue.unref(isSelected)(vue.unref(getValue)(row.index)) ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_12)) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_13))
|
|
434
433
|
], 2)
|
|
435
434
|
], 14, _hoisted_10)), [
|
|
436
435
|
[_directive_close_popper, !__props.multiple]
|
|
@@ -502,7 +501,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
502
501
|
], 8, _hoisted_5)
|
|
503
502
|
], 2);
|
|
504
503
|
}), 128))
|
|
505
|
-
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, vue.toDisplayString(__props.multiple ? vue.unref(selectedItems).length ===
|
|
504
|
+
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6, vue.toDisplayString(__props.multiple ? vue.unref(selectedItems).length === vue.unref(computedItems).length ? "All options selected" : `${vue.unref(selectedItems).length} option${vue.unref(selectedItems).length > 1 ? "s" : ""} selected` : vue.unref(selectedItems)[0][__props.itemText]), 1))
|
|
506
505
|
]),
|
|
507
506
|
__props.clearable && vue.unref(selectedItems).length ? (vue.openBlock(), vue.createElementBlock("button", {
|
|
508
507
|
key: 2,
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
4
|
-
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
5
2
|
const vue = require("vue");
|
|
6
3
|
const pIcon = require("../p-icon.js");
|
|
7
4
|
/**
|
|
@@ -1742,24 +1739,24 @@ function defineIconifyIcon(name = "iconify-icon") {
|
|
|
1742
1739
|
"flip"
|
|
1743
1740
|
];
|
|
1744
1741
|
const IconifyIcon = class extends ParentClass {
|
|
1742
|
+
// Root
|
|
1743
|
+
_shadowRoot;
|
|
1744
|
+
// Initialised
|
|
1745
|
+
_initialised = false;
|
|
1746
|
+
// Icon state
|
|
1747
|
+
_state;
|
|
1748
|
+
// Attributes check queued
|
|
1749
|
+
_checkQueued = false;
|
|
1750
|
+
// Connected
|
|
1751
|
+
_connected = false;
|
|
1752
|
+
// Observer
|
|
1753
|
+
_observer = null;
|
|
1754
|
+
_visible = true;
|
|
1745
1755
|
/**
|
|
1746
1756
|
* Constructor
|
|
1747
1757
|
*/
|
|
1748
1758
|
constructor() {
|
|
1749
1759
|
super();
|
|
1750
|
-
// Root
|
|
1751
|
-
__publicField(this, "_shadowRoot");
|
|
1752
|
-
// Initialised
|
|
1753
|
-
__publicField(this, "_initialised", false);
|
|
1754
|
-
// Icon state
|
|
1755
|
-
__publicField(this, "_state");
|
|
1756
|
-
// Attributes check queued
|
|
1757
|
-
__publicField(this, "_checkQueued", false);
|
|
1758
|
-
// Connected
|
|
1759
|
-
__publicField(this, "_connected", false);
|
|
1760
|
-
// Observer
|
|
1761
|
-
__publicField(this, "_observer", null);
|
|
1762
|
-
__publicField(this, "_visible", true);
|
|
1763
1760
|
const root = this._shadowRoot = this.attachShadow({
|
|
1764
1761
|
mode: "open"
|
|
1765
1762
|
});
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const pIcon_vue_vue_type_script_setup_true_lang = require("./p-icon.js");
|
|
4
|
+
const lodashEs = require("lodash-es");
|
|
5
|
+
const _hoisted_1 = { class: "flex items-center gap-2" };
|
|
6
|
+
const _hoisted_2 = ["data-state", "onClick"];
|
|
7
|
+
const _hoisted_3 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "flex items-center"
|
|
10
|
+
};
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
12
|
+
...{
|
|
13
|
+
name: "PSteps"
|
|
14
|
+
},
|
|
15
|
+
__name: "p-steps",
|
|
16
|
+
props: {
|
|
17
|
+
activeStep: { default: null },
|
|
18
|
+
steps: { default: () => [] },
|
|
19
|
+
clickable: { type: Boolean, default: false }
|
|
20
|
+
},
|
|
21
|
+
emits: ["click:step"],
|
|
22
|
+
setup(__props, { emit: __emit }) {
|
|
23
|
+
const props = __props;
|
|
24
|
+
const emit = __emit;
|
|
25
|
+
const activeStepIndex = vue.computed(() => props.steps.findIndex((s) => s.value === props.activeStep));
|
|
26
|
+
const stepClasses = (step, stepIndex) => {
|
|
27
|
+
if (step.value === props.activeStep) {
|
|
28
|
+
return "border-p-blue-50 bg-p-blue-50 text-surface";
|
|
29
|
+
}
|
|
30
|
+
if (activeStepIndex.value < stepIndex) {
|
|
31
|
+
return "border-p-gray-30 text-p-gray-30";
|
|
32
|
+
}
|
|
33
|
+
return "border-p-blue-50 text-p-blue-50";
|
|
34
|
+
};
|
|
35
|
+
return (_ctx, _cache) => {
|
|
36
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
37
|
+
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.steps, (step, i) => {
|
|
38
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
39
|
+
key: step.value
|
|
40
|
+
}, [
|
|
41
|
+
vue.createElementVNode("div", {
|
|
42
|
+
class: vue.normalizeClass(["text-nowrap rounded-full border px-4 py-1 text-sm font-semibold", [stepClasses(step, i), { "cursor-pointer": _ctx.clickable && !step.disabled }]]),
|
|
43
|
+
"data-state": step.value === _ctx.activeStep ? "active" : "inactive",
|
|
44
|
+
onClick: ($event) => emit("click:step", step, i)
|
|
45
|
+
}, vue.toDisplayString(step.text || vue.unref(lodashEs.startCase)(String(step.value))), 11, _hoisted_2),
|
|
46
|
+
i < _ctx.steps.length - 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
|
47
|
+
vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
48
|
+
icon: "material-symbols:arrow-right-alt-rounded",
|
|
49
|
+
class: vue.normalizeClass([activeStepIndex.value <= i ? "text-p-gray-30" : "text-p-blue-50"])
|
|
50
|
+
}, null, 8, ["class"])
|
|
51
|
+
])) : vue.createCommentVNode("", true)
|
|
52
|
+
], 64);
|
|
53
|
+
}), 128))
|
|
54
|
+
]);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
exports._sfc_main = _sfc_main;
|
package/dist/cjs/dom.js
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const isVisible = (element) => {
|
|
4
|
-
var _a;
|
|
5
4
|
if (!(element instanceof Element)) {
|
|
6
5
|
throw Error("You must provide a DOM element.");
|
|
7
6
|
}
|
|
8
|
-
return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length) && window.getComputedStyle(element).visibility !== "hidden" && window.getComputedStyle(element).display !== "none" &&
|
|
7
|
+
return !!(element.offsetWidth || element.offsetHeight || element.getClientRects().length) && window.getComputedStyle(element).visibility !== "hidden" && window.getComputedStyle(element).display !== "none" && element.style?.transform.includes("translateY(-9999px)") === false;
|
|
9
8
|
};
|
|
10
9
|
const getNextActiveElement = (list, activeElement, shouldGetNext, isCycleAllowed) => {
|
|
11
10
|
const listLength = list.length;
|
package/dist/cjs/index.js
CHANGED
|
@@ -42,6 +42,7 @@ const string = require("./string.js");
|
|
|
42
42
|
const text = require("./text.js");
|
|
43
43
|
const pSelectPill = require("./p-select-pill.js");
|
|
44
44
|
const pSkeletonLoader = require("./p-skeleton-loader.js");
|
|
45
|
+
const pSteps_vue_vue_type_script_setup_true_lang = require("./chunks/p-steps.js");
|
|
45
46
|
const pTable$1 = require("./p-table.js");
|
|
46
47
|
const usePTableColResize = require("./usePTableColResize.js");
|
|
47
48
|
const pTableHeaderCell = require("./p-table-header-cell.js");
|
|
@@ -65,12 +66,12 @@ const object = require("./object.js");
|
|
|
65
66
|
const pagination = require("./pagination.js");
|
|
66
67
|
const sanitization = require("./sanitization.js");
|
|
67
68
|
const index = require("./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__ */ vue.defineComponent({
|
|
90
91
|
...{
|
|
91
92
|
name: "PFileUpload"
|
|
92
93
|
},
|
|
@@ -197,8 +198,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
197
198
|
return res;
|
|
198
199
|
};
|
|
199
200
|
const uploadFile = (e) => {
|
|
200
|
-
|
|
201
|
-
const f = ((_a = e.target) == null ? void 0 : _a.files) || ((_b = e.dataTransfer) == null ? void 0 : _b.files);
|
|
201
|
+
const f = e.target?.files || e.dataTransfer?.files;
|
|
202
202
|
if (!f) {
|
|
203
203
|
return;
|
|
204
204
|
}
|
|
@@ -256,8 +256,8 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
256
256
|
onDrop: vue.withModifiers(onDrop, ["prevent", "stop"]),
|
|
257
257
|
onClick: openFileDialog
|
|
258
258
|
}, [
|
|
259
|
-
!maxFilesReached.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$
|
|
260
|
-
!isDraggingOver.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$
|
|
259
|
+
!maxFilesReached.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
|
|
260
|
+
!isDraggingOver.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
|
|
261
261
|
vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
262
262
|
icon: "upload",
|
|
263
263
|
width: "32",
|
|
@@ -273,7 +273,7 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
273
273
|
width: "32",
|
|
274
274
|
class: "text-primary"
|
|
275
275
|
}),
|
|
276
|
-
vue.createElementVNode("div", _hoisted_7$
|
|
276
|
+
vue.createElementVNode("div", _hoisted_7$2, "Drop " + vue.toDisplayString(fileWord.value), 1)
|
|
277
277
|
])),
|
|
278
278
|
vue.createElementVNode("input", {
|
|
279
279
|
ref_key: "fileInputRef",
|
|
@@ -324,13 +324,13 @@ const _sfc_main$4 = /* @__PURE__ */ vue.defineComponent({
|
|
|
324
324
|
[vue.vShow, __props.errorMsg]
|
|
325
325
|
]),
|
|
326
326
|
vue.createElementVNode("div", _hoisted_12, vue.toDisplayString(__props.multiple ? `Max ${__props.maxNumberOfFiles}` : "One") + " " + vue.toDisplayString(acceptFileTypes.value) + " " + vue.toDisplayString(__props.multiple ? "files" : "file") + " with size less than " + vue.toDisplayString(vue.unref(pFileUpload.formatBytes)(__props.maxSizeInBytes)) + " " + vue.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: pDropdownSelect_vue_vue_type_script_setup_true_lang._imports_0
|
|
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__ */ vue.defineComponent({
|
|
342
346
|
...{
|
|
343
347
|
name: "PSelectList",
|
|
344
348
|
inheritAttrs: false
|
|
@@ -506,12 +510,11 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
506
510
|
} = useSelectList.useSelectList(props, inputSearch, virtualizerRef, emit);
|
|
507
511
|
const style = vue.computed(() => $attrs.style);
|
|
508
512
|
vue.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__ */ vue.defineComponent({
|
|
|
546
549
|
ref: actionsContainer,
|
|
547
550
|
class: "flex flex-row justify-between text-xs font-semibold text-primary"
|
|
548
551
|
}, [
|
|
549
|
-
vue.createElementVNode("p", _hoisted_2$
|
|
550
|
-
vue.createElementVNode("div", _hoisted_3$
|
|
552
|
+
vue.createElementVNode("p", _hoisted_2$2, vue.toDisplayString(vue.unref(computedItems).length) + " items", 1),
|
|
553
|
+
vue.createElementVNode("div", _hoisted_3$2, [
|
|
551
554
|
vue.unref(computedItems).length === vue.unref(internalItems).length ? (vue.openBlock(), vue.createElementBlock("a", {
|
|
552
555
|
key: 0,
|
|
553
556
|
class: vue.normalizeClass([
|
|
@@ -611,13 +614,13 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
611
614
|
class: vue.normalizeClass([
|
|
612
615
|
vue.unref(LIST_ITEM_CLASS),
|
|
613
616
|
{
|
|
614
|
-
[vue.unref(LIST_ITEM_ACTIVE_CLASS)]: vue.unref(isSelected)(vue.unref(getValue)(row.index))
|
|
615
|
-
|
|
616
|
-
|
|
617
|
+
[vue.unref(LIST_ITEM_ACTIVE_CLASS)]: vue.unref(isSelected)(vue.unref(getValue)(row.index))
|
|
618
|
+
},
|
|
619
|
+
vue.unref(isDisabled)(vue.unref(computedItems)[row.index]) ? vue.unref(LIST_ITEM_DISABLED_CLASS) : "cursor-pointer"
|
|
617
620
|
]),
|
|
618
621
|
"p-select-list-option-item": "",
|
|
619
622
|
style: vue.normalizeStyle(listItemStyle.value),
|
|
620
|
-
onClick: ($event) => vue.unref(select)($event, vue.unref(getValue)(row.index))
|
|
623
|
+
onClick: ($event) => !vue.unref(isDisabled)(vue.unref(computedItems)[row.index]) && vue.unref(select)($event, vue.unref(getValue)(row.index))
|
|
621
624
|
}, [
|
|
622
625
|
vue.createElementVNode("div", {
|
|
623
626
|
class: vue.normalizeClass(["flex items-center", { [vue.unref(pSelectList.SIZES)[__props.size]]: !__props.itemSize }])
|
|
@@ -639,7 +642,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
639
642
|
}), 128))
|
|
640
643
|
], 8, _hoisted_5$2)
|
|
641
644
|
]),
|
|
642
|
-
vue.unref(isSelected)(vue.unref(getValue)(row.index)) ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_6$2)) : vue.
|
|
645
|
+
vue.unref(isSelected)(vue.unref(getValue)(row.index)) ? (vue.openBlock(), vue.createElementBlock("img", _hoisted_6$2)) : (vue.openBlock(), vue.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__ */ vue.defineComponent({
|
|
|
659
662
|
}, vue.toDisplayString(__props.errorMsg), 3), [
|
|
660
663
|
[vue.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__ */ vue.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 = vue.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 vue.openBlock(), vue.createElementBlock("div", _hoisted_1$2, [
|
|
698
|
-
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.steps, (step, i) => {
|
|
699
|
-
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
700
|
-
key: step.value
|
|
701
|
-
}, [
|
|
702
|
-
vue.createElementVNode("div", {
|
|
703
|
-
class: vue.normalizeClass(["text-nowrap rounded-full border px-4 py-1 text-sm font-semibold", [stepClasses(step, i), { "cursor-pointer": _ctx.clickable && !step.disabled }]]),
|
|
704
|
-
"data-state": step.value === _ctx.activeStep ? "active" : "inactive",
|
|
705
|
-
onClick: ($event) => emit("click:step", step, i)
|
|
706
|
-
}, vue.toDisplayString(step.text || vue.unref(lodashEs.startCase)(String(step.value))), 11, _hoisted_2$2),
|
|
707
|
-
i < _ctx.steps.length - 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$2, [
|
|
708
|
-
vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
709
|
-
icon: "material-symbols:arrow-right-alt-rounded",
|
|
710
|
-
class: vue.normalizeClass([activeStepIndex.value <= i ? "text-p-gray-30" : "text-p-blue-50"])
|
|
711
|
-
}, null, 8, ["class"])
|
|
712
|
-
])) : vue.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__ */ vue.defineComponent({
|
|
|
826
776
|
return "";
|
|
827
777
|
};
|
|
828
778
|
vue.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
|
vue.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
|
vue.watch(isColResizing, (nV) => {
|
|
837
785
|
if (nV === false && colResizingWidth.value > 0) {
|
|
@@ -842,7 +790,6 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
842
790
|
tbodyElement
|
|
843
791
|
});
|
|
844
792
|
return (_ctx, _cache) => {
|
|
845
|
-
var _a, _b;
|
|
846
793
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
847
794
|
ref_key: "scrollWrapper",
|
|
848
795
|
ref: scrollWrapper,
|
|
@@ -852,9 +799,9 @@ const _sfc_main$1 = /* @__PURE__ */ vue.defineComponent({
|
|
|
852
799
|
key: 0,
|
|
853
800
|
class: "fixed z-[100] w-1 cursor-col-resize bg-p-gray-30",
|
|
854
801
|
style: vue.normalizeStyle({
|
|
855
|
-
top: `${
|
|
802
|
+
top: `${scrollWrapper.value?.offsetTop}px`,
|
|
856
803
|
left: vue.unref(colResizeHandleLeft),
|
|
857
|
-
height: `${
|
|
804
|
+
height: `${scrollWrapper.value?.offsetHeight}px`
|
|
858
805
|
}),
|
|
859
806
|
"data-resize-y-axis": ""
|
|
860
807
|
}, null, 4)) : vue.createCommentVNode("", true),
|
|
@@ -1074,6 +1021,7 @@ exports.toString = string.toString;
|
|
|
1074
1021
|
exports.splitStringForHighlight = text.splitStringForHighlight;
|
|
1075
1022
|
exports.PSelectPill = pSelectPill;
|
|
1076
1023
|
exports.PSkeletonLoader = pSkeletonLoader;
|
|
1024
|
+
exports.PSteps = pSteps_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
1077
1025
|
exports.MIN_WIDTH_COL_RESIZE = pTable$1.MIN_WIDTH_COL_RESIZE;
|
|
1078
1026
|
exports.colsInjectionKey = pTable$1.colsInjectionKey;
|
|
1079
1027
|
exports.isColsResizableInjectionKey = pTable$1.isColsResizableInjectionKey;
|
|
@@ -1107,8 +1055,7 @@ exports.createTV = index.fe;
|
|
|
1107
1055
|
exports.defaultConfig = index.ie;
|
|
1108
1056
|
exports.tv = index.ce;
|
|
1109
1057
|
exports.voidEmpty = index.x;
|
|
1110
|
-
exports.PFileUpload = _sfc_main$
|
|
1111
|
-
exports.PSelectList = _sfc_main$
|
|
1112
|
-
exports.PSteps = _sfc_main$2;
|
|
1058
|
+
exports.PFileUpload = _sfc_main$3;
|
|
1059
|
+
exports.PSelectList = _sfc_main$2;
|
|
1113
1060
|
exports.PTable = pTable;
|
|
1114
1061
|
exports.PTableSort = _sfc_main;
|
|
@@ -45,7 +45,7 @@ const setupListKeyboardNavigation = (options) => {
|
|
|
45
45
|
};
|
|
46
46
|
const setFocusedItem = (el) => {
|
|
47
47
|
clearFocusedState();
|
|
48
|
-
el
|
|
48
|
+
el?.classList.add(itemFocusClass);
|
|
49
49
|
};
|
|
50
50
|
const listKeydown = (e) => {
|
|
51
51
|
if ([ARROW_UP_KEY, ARROW_DOWN_KEY].includes(e.key)) {
|
|
@@ -63,7 +63,7 @@ const setupListKeyboardNavigation = (options) => {
|
|
|
63
63
|
if (getFocusedItem()) {
|
|
64
64
|
e.preventDefault();
|
|
65
65
|
const focusedItem = getFocusedItem();
|
|
66
|
-
const el = itemSelectSelector ? focusedItem
|
|
66
|
+
const el = itemSelectSelector ? focusedItem?.querySelector(itemSelectSelector) : getFocusedItem();
|
|
67
67
|
itemSelectEvents.forEach((e2) => {
|
|
68
68
|
const event = new Event(e2);
|
|
69
69
|
if (el) {
|
package/dist/cjs/p-dropdown.js
CHANGED
|
@@ -79,8 +79,7 @@ const _sfc_main = vue.defineComponent({
|
|
|
79
79
|
e.key === ESCAPE_KEY && this.$refs.vPopper.$refs.popper.hide();
|
|
80
80
|
},
|
|
81
81
|
destroy() {
|
|
82
|
-
|
|
83
|
-
(_a = this.navigationSvc) == null ? void 0 : _a.destroy();
|
|
82
|
+
this.navigationSvc?.destroy();
|
|
84
83
|
document.removeEventListener("keydown", this.popoverEscKeydown);
|
|
85
84
|
},
|
|
86
85
|
async updateReference(newReference) {
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
3
|
const getFileExtension = (fileName) => {
|
|
4
|
-
var _a;
|
|
5
4
|
if (!fileName || !fileName.includes(".")) {
|
|
6
5
|
return "";
|
|
7
6
|
}
|
|
8
|
-
return
|
|
7
|
+
return fileName.split(".").pop()?.toLowerCase();
|
|
9
8
|
};
|
|
10
9
|
const formatBytes = (bytes, decimals = 2) => {
|
|
11
10
|
if (!+bytes || bytes <= 0) {
|
|
@@ -61,8 +61,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
61
61
|
const clearSearch = () => {
|
|
62
62
|
query.value = "";
|
|
63
63
|
requestAnimationFrame(() => {
|
|
64
|
-
|
|
65
|
-
(_a = input.value) == null ? void 0 : _a.$el.querySelector("input").focus();
|
|
64
|
+
input.value?.$el.querySelector("input").focus();
|
|
66
65
|
});
|
|
67
66
|
};
|
|
68
67
|
const keydownEnter = () => {
|
package/dist/cjs/p-modal.js
CHANGED
|
@@ -128,8 +128,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
128
128
|
}
|
|
129
129
|
});
|
|
130
130
|
vue.onMounted(() => {
|
|
131
|
-
|
|
132
|
-
id.value = "pm-" + ((_a = vue.getCurrentInstance()) == null ? void 0 : _a.uid);
|
|
131
|
+
id.value = "pm-" + vue.getCurrentInstance()?.uid;
|
|
133
132
|
const valueToWatch = !props.name ? () => props.modelValue : () => modal.state.modals[props.name];
|
|
134
133
|
vue.watch(
|
|
135
134
|
valueToWatch,
|
|
@@ -165,12 +164,11 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
165
164
|
}
|
|
166
165
|
};
|
|
167
166
|
const keydown = (e) => {
|
|
168
|
-
var _a;
|
|
169
167
|
if (e.which === 27 || e.keyCode === 27) {
|
|
170
168
|
close();
|
|
171
169
|
}
|
|
172
170
|
if (e.which === 9 || e.keyCode === 9) {
|
|
173
|
-
const all = [].slice.call(
|
|
171
|
+
const all = [].slice.call(pmWrapper.value?.querySelectorAll(FOCUSABLE_ELEMENTS)).filter(function(el) {
|
|
174
172
|
return !!(el.offsetWidth || el.offsetHeight || el.getClientRects().length);
|
|
175
173
|
});
|
|
176
174
|
if (e.shiftKey) {
|
|
@@ -237,7 +235,6 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
237
235
|
}
|
|
238
236
|
vue.nextTick(() => {
|
|
239
237
|
window.requestAnimationFrame(() => {
|
|
240
|
-
var _a, _b;
|
|
241
238
|
const lastZindex = getTopZindex();
|
|
242
239
|
if (lastZindex > 0) {
|
|
243
240
|
const all = getAllVisibleWrappers();
|
|
@@ -245,7 +242,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
245
242
|
const wrapper = all[i];
|
|
246
243
|
if (parseInt(wrapper.style.zIndex) === lastZindex) {
|
|
247
244
|
if (wrapper.contains(elToFocus.value)) {
|
|
248
|
-
|
|
245
|
+
elToFocus.value?.focus();
|
|
249
246
|
} else {
|
|
250
247
|
handleFocus(wrapper);
|
|
251
248
|
}
|
|
@@ -254,7 +251,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
254
251
|
}
|
|
255
252
|
} else {
|
|
256
253
|
if (document.body.contains(elToFocus.value)) {
|
|
257
|
-
|
|
254
|
+
elToFocus.value?.focus();
|
|
258
255
|
}
|
|
259
256
|
}
|
|
260
257
|
animatingZIndex = 0;
|
|
@@ -14,10 +14,7 @@ const isHexColor = (hexColor) => {
|
|
|
14
14
|
const hex = hexColor.replace("#", "");
|
|
15
15
|
return typeof hexColor === "string" && hexColor.startsWith("#") && hex.length === 6 && !isNaN(Number("0x" + hex));
|
|
16
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
|
-
};
|
|
17
|
+
const hexToRgb = (hex) => `${hex.match(/\w\w/g)?.map((x) => +`0x${x}`)}`;
|
|
21
18
|
const _sfc_main = vue.defineComponent({
|
|
22
19
|
name: "PSkeletonLoader",
|
|
23
20
|
props: {
|
package/dist/cjs/p-steps.js
CHANGED
package/dist/cjs/usePLoading.js
CHANGED
|
@@ -4,14 +4,8 @@ const vue = require("vue");
|
|
|
4
4
|
const LOADING_TEXT = "Loading...";
|
|
5
5
|
const show = vue.ref(false);
|
|
6
6
|
const loadingItems = vue.ref([]);
|
|
7
|
-
const content = vue.computed(() =>
|
|
8
|
-
|
|
9
|
-
return (_a = loadingItems.value[loadingItems.value.length - 1]) == null ? void 0 : _a.content;
|
|
10
|
-
});
|
|
11
|
-
const props = vue.computed(() => {
|
|
12
|
-
var _a;
|
|
13
|
-
return (_a = loadingItems.value[loadingItems.value.length - 1]) == null ? void 0 : _a.props;
|
|
14
|
-
});
|
|
7
|
+
const content = vue.computed(() => loadingItems.value[loadingItems.value.length - 1]?.content);
|
|
8
|
+
const props = vue.computed(() => loadingItems.value[loadingItems.value.length - 1]?.props);
|
|
15
9
|
const usePLoading = (options) => {
|
|
16
10
|
const { delay } = { delay: 200, ...options };
|
|
17
11
|
const scope = vue.getCurrentScope();
|
|
@@ -36,9 +36,8 @@ const usePTableColResize = (options) => {
|
|
|
36
36
|
document.body.classList.remove("cursor-col-resize");
|
|
37
37
|
};
|
|
38
38
|
const colResizeFitToData = (colIndex) => {
|
|
39
|
-
var _a;
|
|
40
39
|
isColResizing.value = true;
|
|
41
|
-
const tds =
|
|
40
|
+
const tds = ths.value[colIndex].closest("table")?.querySelectorAll("tbody tr td:nth-child(" + (colIndex + 1) + ") div.w-max");
|
|
42
41
|
if (!tds) {
|
|
43
42
|
return;
|
|
44
43
|
}
|