@pequity/squirrel 1.0.20-beta.1 → 1.0.20-beta.3
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/_plugin-vue_export-helper.js +9 -1
- package/dist/cjs/chunks/p-action-bar.js +60 -1
- package/dist/cjs/chunks/p-card.js +28 -1
- package/dist/cjs/chunks/p-checkbox.js +24 -1
- package/dist/cjs/chunks/p-dropdown-select.js +414 -1
- package/dist/cjs/chunks/p-input-percent.js +53 -1
- package/dist/cjs/chunks/p-pagination-info.js +66 -1
- package/dist/cjs/chunks/p-pagination.js +122 -1
- package/dist/cjs/chunks/p-ring-loader.js +81 -1
- package/dist/cjs/chunks/p-select-btn.js +97 -1
- package/dist/cjs/chunks/p-select.js +123 -1
- package/dist/cjs/chunks/p-table-loader.js +70 -1
- package/dist/cjs/chunks/p-tabs.js +52 -1
- package/dist/cjs/config.js +105 -1
- package/dist/cjs/currency.js +9 -1
- package/dist/cjs/dom.js +27 -1
- package/dist/cjs/index.js +976 -1
- package/dist/cjs/inputClassesMixin.js +50 -1
- package/dist/cjs/inputClassesShared.js +76 -1
- package/dist/cjs/listKeyboardNavigation.js +110 -1
- package/dist/cjs/number.js +9 -1
- package/dist/cjs/object.js +4 -1
- package/dist/cjs/p-action-bar.js +3 -1
- package/dist/cjs/p-alert.js +65 -1
- package/dist/cjs/p-avatar.js +71 -1
- package/dist/cjs/p-btn.js +358 -2
- package/dist/cjs/p-card.js +3 -1
- package/dist/cjs/p-checkbox.js +3 -1
- package/dist/cjs/p-chips.js +110 -1
- package/dist/cjs/p-close-btn.js +36 -1
- package/dist/cjs/p-date-picker.js +139 -1
- package/dist/cjs/p-drawer.js +253 -1
- package/dist/cjs/p-dropdown-select.js +3 -1
- package/dist/cjs/p-dropdown.js +138 -1
- package/dist/cjs/p-file-upload.js +21 -1
- package/dist/cjs/p-info-icon.js +35 -1
- package/dist/cjs/p-inline-date-picker.js +142 -1
- package/dist/cjs/p-input-number.js +146 -1
- package/dist/cjs/p-input-percent.js +3 -1
- package/dist/cjs/p-input-search.js +110 -1
- package/dist/cjs/p-input.js +89 -1
- package/dist/cjs/p-loading.js +38 -1
- package/dist/cjs/p-modal.js +369 -1
- package/dist/cjs/p-pagination-info.js +3 -1
- package/dist/cjs/p-pagination.js +3 -1
- package/dist/cjs/p-progress-bar.js +41 -1
- package/dist/cjs/p-ring-loader.js +3 -1
- package/dist/cjs/p-select-btn.js +3 -1
- package/dist/cjs/p-select-list.js +4 -1
- package/dist/cjs/p-select-pill.js +111 -1
- package/dist/cjs/p-select.js +3 -1
- package/dist/cjs/p-skeleton-loader.js +73 -1
- package/dist/cjs/p-table-filter-icon.js +20 -1
- package/dist/cjs/p-table-header-cell.js +75 -1
- package/dist/cjs/p-table-loader.js +3 -1
- package/dist/cjs/p-table-sort.js +8 -1
- package/dist/cjs/p-table-td.js +88 -1
- package/dist/cjs/p-table.js +12 -1
- package/dist/cjs/p-tabs.js +3 -1
- package/dist/cjs/p-textarea.js +73 -1
- package/dist/cjs/p-toggle.js +114 -1
- package/dist/cjs/pagination.js +29 -1
- package/dist/cjs/string.js +12 -1
- package/dist/cjs/tailwind.js +4353 -1
- package/dist/cjs/text.js +16 -1
- package/dist/cjs/useInputClasses.js +44 -1
- package/dist/cjs/usePLoading.js +35 -1
- package/dist/cjs/usePModal.js +21 -1
- package/dist/cjs/usePTableColResize.js +81 -1
- package/dist/cjs/usePTableRowVirtualizer.js +31 -1
- package/dist/cjs/useSelectList.js +256 -1
- package/dist/es/chunks/_plugin-vue_export-helper.js +7 -6
- package/dist/es/chunks/p-action-bar.js +45 -36
- package/dist/es/chunks/p-card.js +18 -14
- package/dist/es/chunks/p-checkbox.js +14 -11
- package/dist/es/chunks/p-dropdown-select.js +232 -183
- package/dist/es/chunks/p-input-percent.js +34 -25
- package/dist/es/chunks/p-pagination-info.js +30 -24
- package/dist/es/chunks/p-pagination.js +78 -48
- package/dist/es/chunks/p-ring-loader.js +63 -40
- package/dist/es/chunks/p-select-btn.js +80 -59
- package/dist/es/chunks/p-select.js +81 -54
- package/dist/es/chunks/p-table-loader.js +46 -32
- package/dist/es/chunks/p-tabs.js +35 -29
- package/dist/es/config.js +2 -2
- package/dist/es/currency.js +3 -3
- package/dist/es/dom.js +24 -12
- package/dist/es/index.js +703 -519
- package/dist/es/inputClassesMixin.js +20 -14
- package/dist/es/inputClassesShared.js +60 -45
- package/dist/es/listKeyboardNavigation.js +86 -36
- package/dist/es/number.js +7 -2
- package/dist/es/object.js +2 -2
- package/dist/es/p-action-bar.js +2 -2
- package/dist/es/p-alert.js +35 -30
- package/dist/es/p-avatar.js +30 -27
- package/dist/es/p-btn.js +209 -164
- package/dist/es/p-card.js +2 -2
- package/dist/es/p-checkbox.js +2 -2
- package/dist/es/p-chips.js +60 -40
- package/dist/es/p-close-btn.js +20 -16
- package/dist/es/p-date-picker.js +66 -58
- package/dist/es/p-drawer.js +108 -89
- package/dist/es/p-dropdown-select.js +2 -2
- package/dist/es/p-dropdown.js +52 -33
- package/dist/es/p-file-upload.js +17 -9
- package/dist/es/p-info-icon.js +21 -16
- package/dist/es/p-inline-date-picker.js +64 -53
- package/dist/es/p-input-number.js +84 -66
- package/dist/es/p-input-percent.js +2 -2
- package/dist/es/p-input-search.js +43 -41
- package/dist/es/p-input.js +51 -45
- package/dist/es/p-loading.js +31 -22
- package/dist/es/p-modal.js +261 -174
- package/dist/es/p-pagination-info.js +2 -2
- package/dist/es/p-pagination.js +2 -2
- package/dist/es/p-progress-bar.js +26 -23
- package/dist/es/p-ring-loader.js +2 -2
- package/dist/es/p-select-btn.js +2 -2
- package/dist/es/p-select-list.js +2 -2
- package/dist/es/p-select-pill.js +58 -41
- package/dist/es/p-select.js +2 -2
- package/dist/es/p-skeleton-loader.js +34 -29
- package/dist/es/p-table-filter-icon.js +11 -11
- package/dist/es/p-table-header-cell.js +38 -33
- package/dist/es/p-table-loader.js +2 -2
- package/dist/es/p-table-sort.js +2 -2
- package/dist/es/p-table-td.js +76 -29
- package/dist/es/p-table.js +10 -6
- package/dist/es/p-tabs.js +2 -2
- package/dist/es/p-textarea.js +36 -34
- package/dist/es/p-toggle.js +53 -48
- package/dist/es/pagination.js +25 -8
- package/dist/es/string.js +10 -2
- package/dist/es/tailwind.js +1660 -1101
- package/dist/es/text.js +13 -8
- package/dist/es/useInputClasses.js +38 -22
- package/dist/es/usePLoading.js +31 -15
- package/dist/es/usePModal.js +15 -12
- package/dist/es/usePTableColResize.js +71 -39
- package/dist/es/usePTableRowVirtualizer.js +24 -15
- package/dist/es/useSelectList.js +234 -121
- package/dist/style.css +2124 -1
- package/package.json +1 -1
|
@@ -1 +1,75 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const pInfoIcon = require("./p-info-icon.js");
|
|
3
|
+
const pTableFilterIcon = require("./p-table-filter-icon.js");
|
|
4
|
+
const vue = require("vue");
|
|
5
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
6
|
+
const DEFAULT_CLASSES = `text-xs leading-5 font-bold uppercase truncate shrink`;
|
|
7
|
+
const _sfc_main = vue.defineComponent({
|
|
8
|
+
name: "PTableHeaderCell",
|
|
9
|
+
components: {
|
|
10
|
+
PTableFilterIcon: pTableFilterIcon,
|
|
11
|
+
PInfoIcon: pInfoIcon
|
|
12
|
+
},
|
|
13
|
+
props: {
|
|
14
|
+
text: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
textClass: {
|
|
19
|
+
type: [String, Object, Array],
|
|
20
|
+
default: "text-left"
|
|
21
|
+
},
|
|
22
|
+
filterActive: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
},
|
|
26
|
+
showFilterIcon: {
|
|
27
|
+
type: Boolean,
|
|
28
|
+
default: false
|
|
29
|
+
},
|
|
30
|
+
tooltipText: {
|
|
31
|
+
type: String,
|
|
32
|
+
default: ""
|
|
33
|
+
}
|
|
34
|
+
},
|
|
35
|
+
emits: ["click-filter-icon"],
|
|
36
|
+
data() {
|
|
37
|
+
return {
|
|
38
|
+
DEFAULT_CLASSES
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
const _hoisted_1 = { class: "flex items-center overflow-hidden" };
|
|
43
|
+
const _hoisted_2 = ["title"];
|
|
44
|
+
const _hoisted_3 = {
|
|
45
|
+
key: 0,
|
|
46
|
+
class: "relative ml-1 mr-auto h-3 w-3 shrink-0"
|
|
47
|
+
};
|
|
48
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
49
|
+
const _component_PInfoIcon = vue.resolveComponent("PInfoIcon");
|
|
50
|
+
const _component_PTableFilterIcon = vue.resolveComponent("PTableFilterIcon");
|
|
51
|
+
return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
|
|
52
|
+
vue.createElementVNode("div", {
|
|
53
|
+
class: vue.normalizeClass([
|
|
54
|
+
_ctx.DEFAULT_CLASSES,
|
|
55
|
+
_ctx.textClass,
|
|
56
|
+
_ctx.filterActive ? "text-active-blue" : "text-p-purple-60",
|
|
57
|
+
{ "mr-auto": !_ctx.tooltipText }
|
|
58
|
+
]),
|
|
59
|
+
title: _ctx.text
|
|
60
|
+
}, vue.toDisplayString(_ctx.text), 11, _hoisted_2),
|
|
61
|
+
_ctx.tooltipText ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
|
62
|
+
_ctx.tooltipText ? (vue.openBlock(), vue.createBlock(_component_PInfoIcon, {
|
|
63
|
+
key: 0,
|
|
64
|
+
text: _ctx.tooltipText
|
|
65
|
+
}, null, 8, ["text"])) : vue.createCommentVNode("", true)
|
|
66
|
+
])) : vue.createCommentVNode("", true),
|
|
67
|
+
vue.createVNode(_component_PTableFilterIcon, {
|
|
68
|
+
class: vue.normalizeClass(["ml-2", { hidden: !_ctx.showFilterIcon }]),
|
|
69
|
+
active: _ctx.filterActive,
|
|
70
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click-filter-icon", $event, _ctx.filterActive))
|
|
71
|
+
}, null, 8, ["class", "active"])
|
|
72
|
+
]);
|
|
73
|
+
}
|
|
74
|
+
const PTableHeaderCell = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
75
|
+
module.exports = PTableHeaderCell;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const pTableLoader_vue_vue_type_script_setup_true_lang = require("./chunks/p-table-loader.js");
|
|
3
|
+
module.exports = pTableLoader_vue_vue_type_script_setup_true_lang._sfc_main;
|
package/dist/cjs/p-table-sort.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const SORTING_TYPES = Object.freeze({
|
|
4
|
+
NO_SORTING: "noSorting",
|
|
5
|
+
ASC: "asc",
|
|
6
|
+
DESC: "desc"
|
|
7
|
+
});
|
|
8
|
+
exports.SORTING_TYPES = SORTING_TYPES;
|
package/dist/cjs/p-table-td.js
CHANGED
|
@@ -1 +1,88 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const pTable = require("./p-table.js");
|
|
4
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
5
|
+
const _withScopeId = (n) => (vue.pushScopeId("data-v-50608a90"), n = n(), vue.popScopeId(), n);
|
|
6
|
+
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("div", { class: "dropdown-anchor" }, null, -1));
|
|
7
|
+
const _hoisted_2 = {
|
|
8
|
+
key: 0,
|
|
9
|
+
class: "min-w-[80px] border-l border-p-gray-30 bg-gradient-to-r from-white via-p-gray-10 to-p-gray-10"
|
|
10
|
+
};
|
|
11
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
12
|
+
...{ name: "PTableTd", inheritAttrs: false },
|
|
13
|
+
__name: "p-table-td",
|
|
14
|
+
props: {
|
|
15
|
+
colIndex: {},
|
|
16
|
+
isEditable: { type: Boolean, default: false },
|
|
17
|
+
isSelected: { type: Boolean, default: false }
|
|
18
|
+
},
|
|
19
|
+
setup(__props) {
|
|
20
|
+
const props = __props;
|
|
21
|
+
const cols = vue.inject(pTable.colsInjectionKey, vue.ref([]));
|
|
22
|
+
const isFirstColFixed = vue.inject(pTable.isFirstColFixedInjectionKey, vue.ref(false));
|
|
23
|
+
const isLastColFixed = vue.inject(pTable.isLastColFixedInjectionKey, vue.ref(false));
|
|
24
|
+
const isColsResizable = vue.inject(pTable.isColsResizableInjectionKey, vue.ref(false));
|
|
25
|
+
const isFirstCol = vue.computed(() => props.colIndex === 0);
|
|
26
|
+
const isSecondCol = vue.computed(() => props.colIndex === 1);
|
|
27
|
+
const isNextToLastCol = vue.computed(() => props.colIndex === cols.value.length - 2);
|
|
28
|
+
const isLastCol = vue.computed(() => props.colIndex === cols.value.length - 1);
|
|
29
|
+
const tdClass = vue.computed(() => {
|
|
30
|
+
const res = [
|
|
31
|
+
// Common classes for all cells
|
|
32
|
+
"p-0 h-full text-sm"
|
|
33
|
+
];
|
|
34
|
+
if (props.isEditable) {
|
|
35
|
+
res.push("cursor-pointer");
|
|
36
|
+
}
|
|
37
|
+
if (isFirstColFixed.value && isFirstCol.value) {
|
|
38
|
+
res.push("td-col-fixed-border-b");
|
|
39
|
+
res.push("first:sticky first:left-0 first:z-10");
|
|
40
|
+
} else if (isLastColFixed.value && isLastCol.value) {
|
|
41
|
+
res.push("td-col-fixed-border-b", "last:sticky last:right-0 last:z-10");
|
|
42
|
+
} else {
|
|
43
|
+
res.push("border-b border-p-gray-30");
|
|
44
|
+
}
|
|
45
|
+
if (props.isSelected) {
|
|
46
|
+
res.push("bg-p-blue-15 group-hover/row:bg-p-blue-15");
|
|
47
|
+
} else {
|
|
48
|
+
res.push("bg-white group-hover/row:bg-p-blue-10");
|
|
49
|
+
}
|
|
50
|
+
return res;
|
|
51
|
+
});
|
|
52
|
+
const innerDivClass = vue.computed(() => {
|
|
53
|
+
const res = ["py-2"];
|
|
54
|
+
const currentColIsFirstColFixed = isFirstColFixed.value && isFirstCol.value;
|
|
55
|
+
const currentColIsLastColFixed = isLastColFixed.value && isLastCol.value;
|
|
56
|
+
if (!currentColIsFirstColFixed && !currentColIsLastColFixed) {
|
|
57
|
+
res.push("w-max");
|
|
58
|
+
}
|
|
59
|
+
if (currentColIsFirstColFixed) {
|
|
60
|
+
res.push("td-shadow-right flex flex-col h-full justify-center px-3");
|
|
61
|
+
} else if (currentColIsLastColFixed) {
|
|
62
|
+
res.push("td-shadow-left flex flex-col h-full justify-center px-3");
|
|
63
|
+
} else if (isFirstColFixed.value && isSecondCol.value) {
|
|
64
|
+
res.push("pl-4 pr-2");
|
|
65
|
+
} else if (isLastColFixed.value && isNextToLastCol.value) {
|
|
66
|
+
res.push("pr-4 pl-2");
|
|
67
|
+
} else {
|
|
68
|
+
res.push("px-2");
|
|
69
|
+
}
|
|
70
|
+
return res;
|
|
71
|
+
});
|
|
72
|
+
return (_ctx, _cache) => {
|
|
73
|
+
return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
|
|
74
|
+
vue.createElementVNode("td", vue.mergeProps({ class: tdClass.value }, _ctx.$attrs), [
|
|
75
|
+
_hoisted_1,
|
|
76
|
+
vue.createElementVNode("div", {
|
|
77
|
+
class: vue.normalizeClass(innerDivClass.value)
|
|
78
|
+
}, [
|
|
79
|
+
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
80
|
+
], 2)
|
|
81
|
+
], 16),
|
|
82
|
+
vue.unref(isColsResizable) && isLastCol.value && !vue.unref(isLastColFixed) ? (vue.openBlock(), vue.createElementBlock("td", _hoisted_2)) : vue.createCommentVNode("", true)
|
|
83
|
+
], 64);
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
const pTableTd = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-50608a90"]]);
|
|
88
|
+
module.exports = pTableTd;
|
package/dist/cjs/p-table.js
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const colsInjectionKey = Symbol("cols");
|
|
4
|
+
const isFirstColFixedInjectionKey = Symbol("isFirstColFixed");
|
|
5
|
+
const isLastColFixedInjectionKey = Symbol("isLastColFixed");
|
|
6
|
+
const isColsResizableInjectionKey = Symbol("isColsResizable");
|
|
7
|
+
const MIN_WIDTH_COL_RESIZE = 80;
|
|
8
|
+
exports.MIN_WIDTH_COL_RESIZE = MIN_WIDTH_COL_RESIZE;
|
|
9
|
+
exports.colsInjectionKey = colsInjectionKey;
|
|
10
|
+
exports.isColsResizableInjectionKey = isColsResizableInjectionKey;
|
|
11
|
+
exports.isFirstColFixedInjectionKey = isFirstColFixedInjectionKey;
|
|
12
|
+
exports.isLastColFixedInjectionKey = isLastColFixedInjectionKey;
|
package/dist/cjs/p-tabs.js
CHANGED
package/dist/cjs/p-textarea.js
CHANGED
|
@@ -1 +1,73 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const inputClassesMixin = require("./inputClassesMixin.js");
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
5
|
+
const _sfc_main = vue.defineComponent({
|
|
6
|
+
name: "PTextarea",
|
|
7
|
+
mixins: [inputClassesMixin],
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
props: {
|
|
10
|
+
modelValue: {
|
|
11
|
+
type: [String, Number],
|
|
12
|
+
default: ""
|
|
13
|
+
},
|
|
14
|
+
label: {
|
|
15
|
+
type: String,
|
|
16
|
+
default: ""
|
|
17
|
+
},
|
|
18
|
+
errorMsg: {
|
|
19
|
+
type: String,
|
|
20
|
+
default: ""
|
|
21
|
+
},
|
|
22
|
+
required: {
|
|
23
|
+
type: Boolean,
|
|
24
|
+
default: false
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
emits: ["update:modelValue"],
|
|
28
|
+
computed: {
|
|
29
|
+
attrs() {
|
|
30
|
+
const { class: classes, style, ...rest } = this.$attrs;
|
|
31
|
+
return rest;
|
|
32
|
+
},
|
|
33
|
+
style() {
|
|
34
|
+
return this.$attrs.style;
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
methods: {
|
|
38
|
+
updateValue(e) {
|
|
39
|
+
const target = e.target;
|
|
40
|
+
this.$emit("update:modelValue", target.value);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
});
|
|
44
|
+
const _hoisted_1 = ["data-has-error"];
|
|
45
|
+
const _hoisted_2 = ["value"];
|
|
46
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
47
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
48
|
+
class: vue.normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
|
|
49
|
+
"data-has-error": !!_ctx.errorMsg,
|
|
50
|
+
style: vue.normalizeStyle(_ctx.style)
|
|
51
|
+
}, [
|
|
52
|
+
vue.renderSlot(_ctx.$slots, "label", {
|
|
53
|
+
label: _ctx.label,
|
|
54
|
+
labelClasses: _ctx.labelClasses
|
|
55
|
+
}, () => [
|
|
56
|
+
_ctx.label ? (vue.openBlock(), vue.createElementBlock("label", {
|
|
57
|
+
key: 0,
|
|
58
|
+
class: vue.normalizeClass(_ctx.labelClasses)
|
|
59
|
+
}, vue.toDisplayString(_ctx.label), 3)) : vue.createCommentVNode("", true)
|
|
60
|
+
]),
|
|
61
|
+
vue.createElementVNode("textarea", vue.mergeProps({ value: _ctx.modelValue }, _ctx.attrs, {
|
|
62
|
+
class: _ctx.textareaClasses,
|
|
63
|
+
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.updateValue && _ctx.updateValue(...args))
|
|
64
|
+
}), " ", 16, _hoisted_2),
|
|
65
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
66
|
+
class: vue.normalizeClass(_ctx.errorMsgClasses)
|
|
67
|
+
}, vue.toDisplayString(_ctx.errorMsg), 3), [
|
|
68
|
+
[vue.vShow, _ctx.errorMsg]
|
|
69
|
+
])
|
|
70
|
+
], 14, _hoisted_1);
|
|
71
|
+
}
|
|
72
|
+
const pTextarea = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
73
|
+
module.exports = pTextarea;
|
package/dist/cjs/p-toggle.js
CHANGED
|
@@ -1 +1,114 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const inputClassesMixin = require("./inputClassesMixin.js");
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
5
|
+
const TOGGLE_SIZES = {
|
|
6
|
+
sm: `w-9 h-5 after:top-[2px] after:left-[2px] after:h-4 after:w-4`,
|
|
7
|
+
md: `w-11 h-6 after:top-[2px] after:left-[2px] after:h-5 after:w-5`,
|
|
8
|
+
lg: `w-[52px] h-7 after:top-0.5 after:left-[2px] after:h-6 after:w-6`
|
|
9
|
+
};
|
|
10
|
+
const TOGGLE_CLASSES = [
|
|
11
|
+
"shadow-inner-toggle",
|
|
12
|
+
"bg-p-gray-30",
|
|
13
|
+
"transition-all",
|
|
14
|
+
"duration-300",
|
|
15
|
+
"rounded-full",
|
|
16
|
+
"peer-checked:after:translate-x-full",
|
|
17
|
+
"peer-checked:after:border-white",
|
|
18
|
+
"after:content-['']",
|
|
19
|
+
"after:absolute",
|
|
20
|
+
"after:bg-white",
|
|
21
|
+
"after:rounded-full",
|
|
22
|
+
"after:transition-all",
|
|
23
|
+
"after:duration-300",
|
|
24
|
+
"peer-checked:bg-primary",
|
|
25
|
+
"peer-disabled:bg-p-blue-10",
|
|
26
|
+
"peer-disabled:after:border-p-blue-10"
|
|
27
|
+
].join(" ");
|
|
28
|
+
const _sfc_main = vue.defineComponent({
|
|
29
|
+
mixins: [inputClassesMixin],
|
|
30
|
+
inheritAttrs: false,
|
|
31
|
+
props: {
|
|
32
|
+
modelValue: {
|
|
33
|
+
type: Boolean,
|
|
34
|
+
default: false
|
|
35
|
+
},
|
|
36
|
+
label: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: ""
|
|
39
|
+
},
|
|
40
|
+
errorMsg: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: ""
|
|
43
|
+
},
|
|
44
|
+
required: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: false
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
emits: ["update:modelValue"],
|
|
50
|
+
computed: {
|
|
51
|
+
toggleClasses() {
|
|
52
|
+
const base = `${TOGGLE_CLASSES} ${TOGGLE_SIZES[this.size]}`;
|
|
53
|
+
const res = this.errorMsg ? `${base} border border-on-error` : base;
|
|
54
|
+
return res;
|
|
55
|
+
},
|
|
56
|
+
toggleLabelClasses() {
|
|
57
|
+
return `${this.labelClasses.replace("mb-1", "")} ml-2`;
|
|
58
|
+
},
|
|
59
|
+
attrs() {
|
|
60
|
+
const { style, class: classes, "data-testid": dataTestId, ...rest } = this.$attrs;
|
|
61
|
+
return rest;
|
|
62
|
+
},
|
|
63
|
+
style() {
|
|
64
|
+
return this.$attrs.style;
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
methods: {
|
|
68
|
+
change(e) {
|
|
69
|
+
const target = e.target;
|
|
70
|
+
this.$emit("update:modelValue", target.checked);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
const _hoisted_1 = ["aria-checked", "data-testid"];
|
|
75
|
+
const _hoisted_2 = ["checked"];
|
|
76
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
77
|
+
return vue.openBlock(), vue.createElementBlock("div", {
|
|
78
|
+
class: vue.normalizeClass(["inline-flex flex-col", _ctx.$attrs.class]),
|
|
79
|
+
style: vue.normalizeStyle(_ctx.style),
|
|
80
|
+
role: "switch",
|
|
81
|
+
"aria-checked": _ctx.modelValue ? "true" : "false",
|
|
82
|
+
"data-testid": _ctx.$attrs["data-testid"]
|
|
83
|
+
}, [
|
|
84
|
+
vue.createElementVNode("label", {
|
|
85
|
+
class: vue.normalizeClass(["relative inline-flex items-center", { "cursor-pointer": !_ctx.$attrs.disabled }])
|
|
86
|
+
}, [
|
|
87
|
+
vue.createElementVNode("input", vue.mergeProps({
|
|
88
|
+
type: "checkbox",
|
|
89
|
+
checked: _ctx.modelValue,
|
|
90
|
+
class: "peer sr-only"
|
|
91
|
+
}, { ..._ctx.attrs, input: () => {
|
|
92
|
+
}, onChange: _ctx.change }), null, 16, _hoisted_2),
|
|
93
|
+
vue.createElementVNode("div", {
|
|
94
|
+
class: vue.normalizeClass(_ctx.toggleClasses)
|
|
95
|
+
}, null, 2),
|
|
96
|
+
vue.renderSlot(_ctx.$slots, "label", {
|
|
97
|
+
label: _ctx.label,
|
|
98
|
+
labelClasses: _ctx.toggleLabelClasses
|
|
99
|
+
}, () => [
|
|
100
|
+
_ctx.label ? (vue.openBlock(), vue.createElementBlock("span", {
|
|
101
|
+
key: 0,
|
|
102
|
+
class: vue.normalizeClass(_ctx.toggleLabelClasses)
|
|
103
|
+
}, vue.toDisplayString(_ctx.label), 3)) : vue.createCommentVNode("", true)
|
|
104
|
+
], true)
|
|
105
|
+
], 2),
|
|
106
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
107
|
+
class: vue.normalizeClass(_ctx.errorMsgClasses)
|
|
108
|
+
}, vue.toDisplayString(_ctx.errorMsg), 3), [
|
|
109
|
+
[vue.vShow, _ctx.errorMsg]
|
|
110
|
+
])
|
|
111
|
+
], 14, _hoisted_1);
|
|
112
|
+
}
|
|
113
|
+
const pToggle = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e222188e"]]);
|
|
114
|
+
module.exports = pToggle;
|
package/dist/cjs/pagination.js
CHANGED
|
@@ -1 +1,29 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const createPagingRange = (currentPage, totalPageNumber, offset = 2, separator = "...") => {
|
|
4
|
+
const currentPageNumber = currentPage || 1;
|
|
5
|
+
const offsetNumber = currentPageNumber <= offset || currentPageNumber > totalPageNumber - offset ? offset : offset - 1;
|
|
6
|
+
const numbersList = [];
|
|
7
|
+
const numbersListWithDots = [];
|
|
8
|
+
if (totalPageNumber <= 1 || totalPageNumber === void 0)
|
|
9
|
+
return [1];
|
|
10
|
+
numbersList.push(1);
|
|
11
|
+
for (let i = currentPageNumber - offsetNumber; i <= currentPageNumber + offsetNumber; i++) {
|
|
12
|
+
if (i < totalPageNumber && i > 1) {
|
|
13
|
+
numbersList.push(i);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
numbersList.push(totalPageNumber);
|
|
17
|
+
numbersList.reduce((acc, curr) => {
|
|
18
|
+
if (acc === 1) {
|
|
19
|
+
numbersListWithDots.push(acc);
|
|
20
|
+
}
|
|
21
|
+
if (curr - acc !== 1) {
|
|
22
|
+
numbersListWithDots.push(separator);
|
|
23
|
+
}
|
|
24
|
+
numbersListWithDots.push(curr);
|
|
25
|
+
return curr;
|
|
26
|
+
});
|
|
27
|
+
return numbersListWithDots;
|
|
28
|
+
};
|
|
29
|
+
exports.createPagingRange = createPagingRange;
|
package/dist/cjs/string.js
CHANGED
|
@@ -1 +1,12 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const toString = (value) => {
|
|
4
|
+
if (typeof value === "number" && (!isFinite(value) || isNaN(value))) {
|
|
5
|
+
return "";
|
|
6
|
+
}
|
|
7
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
8
|
+
return "";
|
|
9
|
+
}
|
|
10
|
+
return String(value);
|
|
11
|
+
};
|
|
12
|
+
exports.toString = toString;
|