@pequity/squirrel 1.0.20-beta.2 → 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 -561
- 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
package/dist/es/p-textarea.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineComponent
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import inputClassesMixin from "./inputClassesMixin.js";
|
|
2
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, toDisplayString, createCommentVNode, createElementVNode, mergeProps, withDirectives, vShow } from "vue";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
|
+
const _sfc_main = defineComponent({
|
|
5
5
|
name: "PTextarea",
|
|
6
|
-
mixins: [
|
|
7
|
-
inheritAttrs:
|
|
6
|
+
mixins: [inputClassesMixin],
|
|
7
|
+
inheritAttrs: false,
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: {
|
|
10
10
|
type: [String, Number],
|
|
@@ -20,14 +20,14 @@ const $ = u({
|
|
|
20
20
|
},
|
|
21
21
|
required: {
|
|
22
22
|
type: Boolean,
|
|
23
|
-
default:
|
|
23
|
+
default: false
|
|
24
24
|
}
|
|
25
25
|
},
|
|
26
26
|
emits: ["update:modelValue"],
|
|
27
27
|
computed: {
|
|
28
28
|
attrs() {
|
|
29
|
-
const { class:
|
|
30
|
-
return
|
|
29
|
+
const { class: classes, style, ...rest } = this.$attrs;
|
|
30
|
+
return rest;
|
|
31
31
|
},
|
|
32
32
|
style() {
|
|
33
33
|
return this.$attrs.style;
|
|
@@ -35,38 +35,40 @@ const $ = u({
|
|
|
35
35
|
},
|
|
36
36
|
methods: {
|
|
37
37
|
updateValue(e) {
|
|
38
|
-
const
|
|
39
|
-
this.$emit("update:modelValue",
|
|
38
|
+
const target = e.target;
|
|
39
|
+
this.$emit("update:modelValue", target.value);
|
|
40
40
|
}
|
|
41
41
|
}
|
|
42
|
-
})
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
42
|
+
});
|
|
43
|
+
const _hoisted_1 = ["data-has-error"];
|
|
44
|
+
const _hoisted_2 = ["value"];
|
|
45
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
46
|
+
return openBlock(), createElementBlock("div", {
|
|
47
|
+
class: normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
|
|
48
|
+
"data-has-error": !!_ctx.errorMsg,
|
|
49
|
+
style: normalizeStyle(_ctx.style)
|
|
48
50
|
}, [
|
|
49
|
-
|
|
50
|
-
label:
|
|
51
|
-
labelClasses:
|
|
51
|
+
renderSlot(_ctx.$slots, "label", {
|
|
52
|
+
label: _ctx.label,
|
|
53
|
+
labelClasses: _ctx.labelClasses
|
|
52
54
|
}, () => [
|
|
53
|
-
|
|
55
|
+
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
54
56
|
key: 0,
|
|
55
|
-
class:
|
|
56
|
-
},
|
|
57
|
+
class: normalizeClass(_ctx.labelClasses)
|
|
58
|
+
}, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true)
|
|
57
59
|
]),
|
|
58
|
-
|
|
59
|
-
class:
|
|
60
|
-
onInput:
|
|
61
|
-
}), " ", 16,
|
|
62
|
-
|
|
63
|
-
class:
|
|
64
|
-
},
|
|
65
|
-
[
|
|
60
|
+
createElementVNode("textarea", mergeProps({ value: _ctx.modelValue }, _ctx.attrs, {
|
|
61
|
+
class: _ctx.textareaClasses,
|
|
62
|
+
onInput: _cache[0] || (_cache[0] = (...args) => _ctx.updateValue && _ctx.updateValue(...args))
|
|
63
|
+
}), " ", 16, _hoisted_2),
|
|
64
|
+
withDirectives(createElementVNode("div", {
|
|
65
|
+
class: normalizeClass(_ctx.errorMsgClasses)
|
|
66
|
+
}, toDisplayString(_ctx.errorMsg), 3), [
|
|
67
|
+
[vShow, _ctx.errorMsg]
|
|
66
68
|
])
|
|
67
|
-
], 14,
|
|
69
|
+
], 14, _hoisted_1);
|
|
68
70
|
}
|
|
69
|
-
const
|
|
71
|
+
const pTextarea = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
70
72
|
export {
|
|
71
|
-
|
|
73
|
+
pTextarea as default
|
|
72
74
|
};
|
package/dist/es/p-toggle.js
CHANGED
|
@@ -1,11 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import { defineComponent
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
5
|
-
sm:
|
|
6
|
-
md:
|
|
7
|
-
lg:
|
|
8
|
-
}
|
|
1
|
+
import inputClassesMixin from "./inputClassesMixin.js";
|
|
2
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, createElementVNode, mergeProps, renderSlot, toDisplayString, createCommentVNode, withDirectives, vShow } from "vue";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
|
+
const TOGGLE_SIZES = {
|
|
5
|
+
sm: `w-9 h-5 after:top-[2px] after:left-[2px] after:h-4 after:w-4`,
|
|
6
|
+
md: `w-11 h-6 after:top-[2px] after:left-[2px] after:h-5 after:w-5`,
|
|
7
|
+
lg: `w-[52px] h-7 after:top-0.5 after:left-[2px] after:h-6 after:w-6`
|
|
8
|
+
};
|
|
9
|
+
const TOGGLE_CLASSES = [
|
|
9
10
|
"shadow-inner-toggle",
|
|
10
11
|
"bg-p-gray-30",
|
|
11
12
|
"transition-all",
|
|
@@ -22,13 +23,14 @@ const y = {
|
|
|
22
23
|
"peer-checked:bg-primary",
|
|
23
24
|
"peer-disabled:bg-p-blue-10",
|
|
24
25
|
"peer-disabled:after:border-p-blue-10"
|
|
25
|
-
].join(" ")
|
|
26
|
-
|
|
27
|
-
|
|
26
|
+
].join(" ");
|
|
27
|
+
const _sfc_main = defineComponent({
|
|
28
|
+
mixins: [inputClassesMixin],
|
|
29
|
+
inheritAttrs: false,
|
|
28
30
|
props: {
|
|
29
31
|
modelValue: {
|
|
30
32
|
type: Boolean,
|
|
31
|
-
default:
|
|
33
|
+
default: false
|
|
32
34
|
},
|
|
33
35
|
label: {
|
|
34
36
|
type: String,
|
|
@@ -40,21 +42,22 @@ const y = {
|
|
|
40
42
|
},
|
|
41
43
|
required: {
|
|
42
44
|
type: Boolean,
|
|
43
|
-
default:
|
|
45
|
+
default: false
|
|
44
46
|
}
|
|
45
47
|
},
|
|
46
48
|
emits: ["update:modelValue"],
|
|
47
49
|
computed: {
|
|
48
50
|
toggleClasses() {
|
|
49
|
-
const
|
|
50
|
-
|
|
51
|
+
const base = `${TOGGLE_CLASSES} ${TOGGLE_SIZES[this.size]}`;
|
|
52
|
+
const res = this.errorMsg ? `${base} border border-on-error` : base;
|
|
53
|
+
return res;
|
|
51
54
|
},
|
|
52
55
|
toggleLabelClasses() {
|
|
53
56
|
return `${this.labelClasses.replace("mb-1", "")} ml-2`;
|
|
54
57
|
},
|
|
55
58
|
attrs() {
|
|
56
|
-
const { style
|
|
57
|
-
return
|
|
59
|
+
const { style, class: classes, "data-testid": dataTestId, ...rest } = this.$attrs;
|
|
60
|
+
return rest;
|
|
58
61
|
},
|
|
59
62
|
style() {
|
|
60
63
|
return this.$attrs.style;
|
|
@@ -62,49 +65,51 @@ const y = {
|
|
|
62
65
|
},
|
|
63
66
|
methods: {
|
|
64
67
|
change(e) {
|
|
65
|
-
const
|
|
66
|
-
this.$emit("update:modelValue",
|
|
68
|
+
const target = e.target;
|
|
69
|
+
this.$emit("update:modelValue", target.checked);
|
|
67
70
|
}
|
|
68
71
|
}
|
|
69
|
-
})
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
72
|
+
});
|
|
73
|
+
const _hoisted_1 = ["aria-checked", "data-testid"];
|
|
74
|
+
const _hoisted_2 = ["checked"];
|
|
75
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
76
|
+
return openBlock(), createElementBlock("div", {
|
|
77
|
+
class: normalizeClass(["inline-flex flex-col", _ctx.$attrs.class]),
|
|
78
|
+
style: normalizeStyle(_ctx.style),
|
|
74
79
|
role: "switch",
|
|
75
|
-
"aria-checked":
|
|
76
|
-
"data-testid":
|
|
80
|
+
"aria-checked": _ctx.modelValue ? "true" : "false",
|
|
81
|
+
"data-testid": _ctx.$attrs["data-testid"]
|
|
77
82
|
}, [
|
|
78
|
-
|
|
79
|
-
class:
|
|
83
|
+
createElementVNode("label", {
|
|
84
|
+
class: normalizeClass(["relative inline-flex items-center", { "cursor-pointer": !_ctx.$attrs.disabled }])
|
|
80
85
|
}, [
|
|
81
|
-
|
|
86
|
+
createElementVNode("input", mergeProps({
|
|
82
87
|
type: "checkbox",
|
|
83
|
-
checked:
|
|
88
|
+
checked: _ctx.modelValue,
|
|
84
89
|
class: "peer sr-only"
|
|
85
|
-
}, { ...
|
|
86
|
-
}, onChange:
|
|
87
|
-
|
|
88
|
-
class:
|
|
90
|
+
}, { ..._ctx.attrs, input: () => {
|
|
91
|
+
}, onChange: _ctx.change }), null, 16, _hoisted_2),
|
|
92
|
+
createElementVNode("div", {
|
|
93
|
+
class: normalizeClass(_ctx.toggleClasses)
|
|
89
94
|
}, null, 2),
|
|
90
|
-
|
|
91
|
-
label:
|
|
92
|
-
labelClasses:
|
|
95
|
+
renderSlot(_ctx.$slots, "label", {
|
|
96
|
+
label: _ctx.label,
|
|
97
|
+
labelClasses: _ctx.toggleLabelClasses
|
|
93
98
|
}, () => [
|
|
94
|
-
|
|
99
|
+
_ctx.label ? (openBlock(), createElementBlock("span", {
|
|
95
100
|
key: 0,
|
|
96
|
-
class:
|
|
97
|
-
},
|
|
98
|
-
],
|
|
101
|
+
class: normalizeClass(_ctx.toggleLabelClasses)
|
|
102
|
+
}, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true)
|
|
103
|
+
], true)
|
|
99
104
|
], 2),
|
|
100
|
-
|
|
101
|
-
class:
|
|
102
|
-
},
|
|
103
|
-
[
|
|
105
|
+
withDirectives(createElementVNode("div", {
|
|
106
|
+
class: normalizeClass(_ctx.errorMsgClasses)
|
|
107
|
+
}, toDisplayString(_ctx.errorMsg), 3), [
|
|
108
|
+
[vShow, _ctx.errorMsg]
|
|
104
109
|
])
|
|
105
|
-
], 14,
|
|
110
|
+
], 14, _hoisted_1);
|
|
106
111
|
}
|
|
107
|
-
const
|
|
112
|
+
const pToggle = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-e222188e"]]);
|
|
108
113
|
export {
|
|
109
|
-
|
|
114
|
+
pToggle as default
|
|
110
115
|
};
|
package/dist/es/pagination.js
CHANGED
|
@@ -1,12 +1,29 @@
|
|
|
1
|
-
const
|
|
2
|
-
const
|
|
3
|
-
|
|
1
|
+
const createPagingRange = (currentPage, totalPageNumber, offset = 2, separator = "...") => {
|
|
2
|
+
const currentPageNumber = currentPage || 1;
|
|
3
|
+
const offsetNumber = currentPageNumber <= offset || currentPageNumber > totalPageNumber - offset ? offset : offset - 1;
|
|
4
|
+
const numbersList = [];
|
|
5
|
+
const numbersListWithDots = [];
|
|
6
|
+
if (totalPageNumber <= 1 || totalPageNumber === void 0)
|
|
4
7
|
return [1];
|
|
5
|
-
|
|
6
|
-
for (let
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
numbersList.push(1);
|
|
9
|
+
for (let i = currentPageNumber - offsetNumber; i <= currentPageNumber + offsetNumber; i++) {
|
|
10
|
+
if (i < totalPageNumber && i > 1) {
|
|
11
|
+
numbersList.push(i);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
numbersList.push(totalPageNumber);
|
|
15
|
+
numbersList.reduce((acc, curr) => {
|
|
16
|
+
if (acc === 1) {
|
|
17
|
+
numbersListWithDots.push(acc);
|
|
18
|
+
}
|
|
19
|
+
if (curr - acc !== 1) {
|
|
20
|
+
numbersListWithDots.push(separator);
|
|
21
|
+
}
|
|
22
|
+
numbersListWithDots.push(curr);
|
|
23
|
+
return curr;
|
|
24
|
+
});
|
|
25
|
+
return numbersListWithDots;
|
|
9
26
|
};
|
|
10
27
|
export {
|
|
11
|
-
|
|
28
|
+
createPagingRange
|
|
12
29
|
};
|
package/dist/es/string.js
CHANGED
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
const
|
|
1
|
+
const toString = (value) => {
|
|
2
|
+
if (typeof value === "number" && (!isFinite(value) || isNaN(value))) {
|
|
3
|
+
return "";
|
|
4
|
+
}
|
|
5
|
+
if (typeof value !== "string" && typeof value !== "number") {
|
|
6
|
+
return "";
|
|
7
|
+
}
|
|
8
|
+
return String(value);
|
|
9
|
+
};
|
|
2
10
|
export {
|
|
3
|
-
|
|
11
|
+
toString
|
|
4
12
|
};
|