@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
|
@@ -1,10 +1,14 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import
|
|
3
|
-
import { isNumber
|
|
4
|
-
const
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, withCtx, createElementVNode, normalizeClass } from "vue";
|
|
2
|
+
import PInputNumber from "../p-input-number.js";
|
|
3
|
+
import { isNumber } from "lodash-es";
|
|
4
|
+
const _hoisted_1 = /* @__PURE__ */ createElementVNode("div", null, "%", -1);
|
|
5
|
+
const _hoisted_2 = [
|
|
6
|
+
_hoisted_1
|
|
7
|
+
];
|
|
8
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
9
|
+
...{
|
|
10
|
+
name: "PInputPercent"
|
|
11
|
+
},
|
|
8
12
|
__name: "p-input-percent",
|
|
9
13
|
props: {
|
|
10
14
|
modelValue: {
|
|
@@ -17,29 +21,34 @@ const _ = /* @__PURE__ */ u("div", null, "%", -1), b = [
|
|
|
17
21
|
}
|
|
18
22
|
},
|
|
19
23
|
emits: ["update:modelValue"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
24
|
+
setup(__props, { emit: __emit }) {
|
|
25
|
+
const prefixClasses = {
|
|
22
26
|
sm: "text-sm h-8 left-2",
|
|
23
27
|
md: "text-base h-10 left-3",
|
|
24
28
|
lg: "text-lg h-12 left-5"
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
29
|
+
};
|
|
30
|
+
const props = __props;
|
|
31
|
+
const emit = __emit;
|
|
32
|
+
const convertedValue = computed({
|
|
33
|
+
get: () => isNumber(props.modelValue) ? props.modelValue * 100 : props.modelValue,
|
|
34
|
+
set: (nV) => emit("update:modelValue", isNumber(nV) ? nV / 100 : nV)
|
|
28
35
|
});
|
|
29
|
-
return (
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
36
|
+
return (_ctx, _cache) => {
|
|
37
|
+
return openBlock(), createBlock(PInputNumber, {
|
|
38
|
+
modelValue: convertedValue.value,
|
|
39
|
+
"onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => convertedValue.value = $event),
|
|
40
|
+
size: __props.size
|
|
41
|
+
}, {
|
|
42
|
+
prefix: withCtx(() => [
|
|
43
|
+
createElementVNode("div", {
|
|
44
|
+
class: normalizeClass(["absolute flex items-center", prefixClasses[__props.size]])
|
|
45
|
+
}, _hoisted_2, 2)
|
|
46
|
+
]),
|
|
47
|
+
_: 1
|
|
48
|
+
}, 8, ["modelValue", "size"]);
|
|
49
|
+
};
|
|
41
50
|
}
|
|
42
51
|
});
|
|
43
52
|
export {
|
|
44
|
-
|
|
53
|
+
_sfc_main as _
|
|
45
54
|
};
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent, computed, openBlock, createBlock, createElementBlock, Fragment, createTextVNode, toDisplayString, renderSlot } from "vue";
|
|
2
|
+
import PSkeletonLoader from "../p-skeleton-loader.js";
|
|
3
|
+
const _hoisted_1 = {
|
|
4
4
|
key: 1,
|
|
5
5
|
class: "text-sm font-medium text-p-gray-40"
|
|
6
|
-
}
|
|
7
|
-
|
|
6
|
+
};
|
|
7
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
8
|
+
...{ name: "PPaginationInfo" },
|
|
8
9
|
__name: "p-pagination-info",
|
|
9
10
|
props: {
|
|
10
11
|
/**
|
|
@@ -33,29 +34,34 @@ const y = {
|
|
|
33
34
|
*/
|
|
34
35
|
loading: {
|
|
35
36
|
type: Boolean,
|
|
36
|
-
default:
|
|
37
|
+
default: false
|
|
37
38
|
}
|
|
38
39
|
},
|
|
39
|
-
setup(
|
|
40
|
-
const
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
40
|
+
setup(__props) {
|
|
41
|
+
const props = __props;
|
|
42
|
+
const from = computed(() => {
|
|
43
|
+
const maxNumOfPages = Math.ceil(props.count / props.pageSize);
|
|
44
|
+
const currentPage = props.currentPage > maxNumOfPages ? maxNumOfPages : props.currentPage;
|
|
45
|
+
return (currentPage - 1) * props.pageSize + 1;
|
|
46
|
+
});
|
|
47
|
+
const to = computed(() => {
|
|
48
|
+
const to2 = props.currentPage * props.pageSize;
|
|
49
|
+
return to2 >= props.count ? props.count : to2;
|
|
46
50
|
});
|
|
47
|
-
return (
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
51
|
+
return (_ctx, _cache) => {
|
|
52
|
+
return __props.loading ? (openBlock(), createBlock(PSkeletonLoader, {
|
|
53
|
+
key: 0,
|
|
54
|
+
class: "h-6 w-56"
|
|
55
|
+
})) : (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
56
|
+
__props.count ? (openBlock(), createElementBlock(Fragment, { key: 0 }, [
|
|
57
|
+
createTextVNode("Showing " + toDisplayString(from.value) + " to " + toDisplayString(to.value) + " of " + toDisplayString(__props.count) + " results", 1)
|
|
58
|
+
], 64)) : renderSlot(_ctx.$slots, "no-results", { key: 1 }, () => [
|
|
59
|
+
createTextVNode("No results found")
|
|
60
|
+
])
|
|
61
|
+
]));
|
|
62
|
+
};
|
|
57
63
|
}
|
|
58
64
|
});
|
|
59
65
|
export {
|
|
60
|
-
|
|
66
|
+
_sfc_main as _
|
|
61
67
|
};
|
|
@@ -1,15 +1,31 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import
|
|
3
|
-
import { createPagingRange
|
|
4
|
-
const
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, Fragment, createBlock, createCommentVNode, createElementVNode, normalizeClass, renderList, toDisplayString } from "vue";
|
|
2
|
+
import PSkeletonLoader from "../p-skeleton-loader.js";
|
|
3
|
+
import { createPagingRange } from "../pagination.js";
|
|
4
|
+
const _imports_0 = "data:image/svg+xml,%3csvg%20width='8'%20height='12'%20viewBox='0%200%208%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.25%205.99968C0.25%205.64968%200.4%205.34968%200.65%205.14968L6.25%200.249681C6.65%20-0.100319%207.2%20-0.0503187%207.55%200.349681C7.85%200.749681%207.85%201.29968%207.45%201.59968L2.55%205.89968C2.5%205.94968%202.5%205.99968%202.55%206.04968L7.45%2010.3497C7.85%2010.6997%207.9%2011.2497%207.55%2011.6497C7.2%2012.0497%206.65%2012.0997%206.25%2011.7497C6.25%2011.7497%206.25%2011.7497%206.2%2011.6997L0.65%206.84968C0.4%206.64968%200.25%206.29968%200.25%205.99968Z'%20fill='%23918da1'%20/%3e%3c/svg%3e";
|
|
5
|
+
const _imports_1 = "data:image/svg+xml,%3csvg%20width='8'%20height='14'%20viewBox='0%200%208%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75695%206.98136C7.75695%207.33136%207.60695%207.63136%207.35695%207.83136L1.75695%2012.7814C1.35695%2013.1314%200.756947%2013.0814%200.456947%2012.6814C0.156947%2012.2814%200.156947%2011.7314%200.556947%2011.3814L5.45695%207.08136C5.50695%207.03136%205.50695%206.98136%205.45695%206.88136L0.556947%202.58136C0.156947%202.23136%200.156947%201.63136%200.506947%201.28136C0.856947%200.931361%201.40695%200.881361%201.80695%201.18136L7.40695%206.08136C7.60695%206.33136%207.75695%206.63136%207.75695%206.98136Z'%20fill='%23918da1'%20/%3e%3c/svg%3e";
|
|
6
|
+
const _hoisted_1 = {
|
|
5
7
|
key: 1,
|
|
6
8
|
class: "flex text-p-gray-40"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
]
|
|
12
|
-
|
|
9
|
+
};
|
|
10
|
+
const _hoisted_2 = /* @__PURE__ */ createElementVNode("img", { src: _imports_0 }, null, -1);
|
|
11
|
+
const _hoisted_3 = [
|
|
12
|
+
_hoisted_2
|
|
13
|
+
];
|
|
14
|
+
const _hoisted_4 = ["onClick"];
|
|
15
|
+
const _hoisted_5 = { class: "flex" };
|
|
16
|
+
const _hoisted_6 = ["aria-label"];
|
|
17
|
+
const _hoisted_7 = /* @__PURE__ */ createElementVNode("img", { src: _imports_1 }, null, -1);
|
|
18
|
+
const _hoisted_8 = [
|
|
19
|
+
_hoisted_7
|
|
20
|
+
];
|
|
21
|
+
const DOTS = "...";
|
|
22
|
+
const BTN_CLASS = "w-6 h-6 flex justify-center items-center mx-1 font-semibold text-sm leading-none";
|
|
23
|
+
const BTN_ACTIVE_CLASS = "text-p-purple-60 bg-p-gray-30 rounded-lg";
|
|
24
|
+
const BTN_INACTIVE_CLASS = "cursor-pointer";
|
|
25
|
+
const ARROW_ACTIVE_CLASS = "cursor-pointer";
|
|
26
|
+
const ARROW_INACTIVE_CLASS = "opacity-50";
|
|
27
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
28
|
+
...{ name: "PPagination" },
|
|
13
29
|
__name: "p-pagination",
|
|
14
30
|
props: {
|
|
15
31
|
/**
|
|
@@ -45,49 +61,63 @@ const k = "data:image/svg+xml,%3csvg%20width='8'%20height='12'%20viewBox='0%200%
|
|
|
45
61
|
*/
|
|
46
62
|
loading: {
|
|
47
63
|
type: Boolean,
|
|
48
|
-
default:
|
|
64
|
+
default: false
|
|
49
65
|
}
|
|
50
66
|
},
|
|
51
67
|
emits: ["update:modelValue"],
|
|
52
|
-
setup(
|
|
53
|
-
const
|
|
54
|
-
|
|
68
|
+
setup(__props, { emit: __emit }) {
|
|
69
|
+
const emit = __emit;
|
|
70
|
+
const props = __props;
|
|
71
|
+
const pageCount = computed(() => {
|
|
72
|
+
return props.count && Math.ceil(props.count / props.pageSize);
|
|
73
|
+
});
|
|
74
|
+
const pages = computed(() => {
|
|
75
|
+
return createPagingRange(Number(props.modelValue), pageCount.value, props.pageOffset, DOTS);
|
|
76
|
+
});
|
|
77
|
+
const setPage = (page) => {
|
|
78
|
+
if (page >= 1 && page <= pageCount.value) {
|
|
79
|
+
emit("update:modelValue", page);
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
return (_ctx, _cache) => {
|
|
83
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
84
|
+
__props.loading ? (openBlock(), createBlock(PSkeletonLoader, {
|
|
85
|
+
key: 0,
|
|
86
|
+
class: "h-6 w-56"
|
|
87
|
+
})) : createCommentVNode("", true),
|
|
88
|
+
!__props.loading && pages.value.length > 1 ? (openBlock(), createElementBlock("div", _hoisted_1, [
|
|
89
|
+
createElementVNode("div", {
|
|
90
|
+
class: normalizeClass([BTN_CLASS, Number(__props.modelValue) <= 1 ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
|
|
91
|
+
"aria-label": "go to the previous page",
|
|
92
|
+
onClick: _cache[0] || (_cache[0] = ($event) => setPage(Number(__props.modelValue) - 1))
|
|
93
|
+
}, _hoisted_3, 2),
|
|
94
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(pages.value, (page, index) => {
|
|
95
|
+
return openBlock(), createElementBlock("div", {
|
|
96
|
+
key: index,
|
|
97
|
+
onClick: ($event) => setPage(Number(page))
|
|
98
|
+
}, [
|
|
99
|
+
createElementVNode("div", _hoisted_5, [
|
|
100
|
+
page !== DOTS ? (openBlock(), createElementBlock("div", {
|
|
101
|
+
key: 0,
|
|
102
|
+
class: normalizeClass([BTN_CLASS, page === __props.modelValue ? BTN_ACTIVE_CLASS : BTN_INACTIVE_CLASS]),
|
|
103
|
+
"aria-label": `go to page ${page}`
|
|
104
|
+
}, toDisplayString(page), 11, _hoisted_6)) : (openBlock(), createElementBlock("div", {
|
|
105
|
+
key: 1,
|
|
106
|
+
class: normalizeClass(BTN_CLASS)
|
|
107
|
+
}, toDisplayString(DOTS)))
|
|
108
|
+
])
|
|
109
|
+
], 8, _hoisted_4);
|
|
110
|
+
}), 128)),
|
|
111
|
+
createElementVNode("div", {
|
|
112
|
+
class: normalizeClass([BTN_CLASS, __props.modelValue === pageCount.value ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
|
|
113
|
+
"aria-label": "go to the next page",
|
|
114
|
+
onClick: _cache[1] || (_cache[1] = ($event) => setPage(Number(__props.modelValue) + 1))
|
|
115
|
+
}, _hoisted_8, 2)
|
|
116
|
+
])) : createCommentVNode("", true)
|
|
117
|
+
], 64);
|
|
55
118
|
};
|
|
56
|
-
return (s, i) => (o(), l(p, null, [
|
|
57
|
-
e.loading ? (o(), L(V, {
|
|
58
|
-
key: 0,
|
|
59
|
-
class: "h-6 w-56"
|
|
60
|
-
})) : v("", !0),
|
|
61
|
-
!e.loading && g.value.length > 1 ? (o(), l("div", B, [
|
|
62
|
-
a("div", {
|
|
63
|
-
class: r([c, Number(e.modelValue) <= 1 ? _ : h]),
|
|
64
|
-
"aria-label": "go to the previous page",
|
|
65
|
-
onClick: i[0] || (i[0] = (t) => d(Number(e.modelValue) - 1))
|
|
66
|
-
}, E, 2),
|
|
67
|
-
(o(!0), l(p, null, S(g.value, (t, b) => (o(), l("div", {
|
|
68
|
-
key: b,
|
|
69
|
-
onClick: (D) => d(Number(t))
|
|
70
|
-
}, [
|
|
71
|
-
a("div", O, [
|
|
72
|
-
t !== m ? (o(), l("div", {
|
|
73
|
-
key: 0,
|
|
74
|
-
class: r([c, t === e.modelValue ? z : M]),
|
|
75
|
-
"aria-label": `go to page ${t}`
|
|
76
|
-
}, f(t), 11, P)) : (o(), l("div", {
|
|
77
|
-
key: 1,
|
|
78
|
-
class: r(c)
|
|
79
|
-
}, f(m)))
|
|
80
|
-
])
|
|
81
|
-
], 8, I))), 128)),
|
|
82
|
-
a("div", {
|
|
83
|
-
class: r([c, e.modelValue === u.value ? _ : h]),
|
|
84
|
-
"aria-label": "go to the next page",
|
|
85
|
-
onClick: i[1] || (i[1] = (t) => d(Number(e.modelValue) + 1))
|
|
86
|
-
}, $, 2)
|
|
87
|
-
])) : v("", !0)
|
|
88
|
-
], 64));
|
|
89
119
|
}
|
|
90
120
|
});
|
|
91
121
|
export {
|
|
92
|
-
|
|
122
|
+
_sfc_main as _
|
|
93
123
|
};
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { getColor
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, normalizeStyle, createElementVNode, normalizeClass } from "vue";
|
|
2
|
+
import { getColor } from "../tailwind.js";
|
|
3
|
+
const INNER_DIV_CLASS = "block animate-spin absolute box-border rounded-full w-4/5 h-4/5 m-[10%]";
|
|
4
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
5
|
+
...{
|
|
6
|
+
name: "PRingLoader"
|
|
7
|
+
},
|
|
5
8
|
__name: "p-ring-loader",
|
|
6
9
|
props: {
|
|
7
10
|
size: {
|
|
@@ -10,50 +13,70 @@ const s = "block animate-spin absolute box-border rounded-full w-4/5 h-4/5 m-[10
|
|
|
10
13
|
},
|
|
11
14
|
color: {
|
|
12
15
|
type: String,
|
|
13
|
-
default:
|
|
16
|
+
default: getColor("primary")
|
|
14
17
|
},
|
|
15
18
|
duration: {
|
|
16
19
|
type: String,
|
|
17
20
|
default: "1.2s",
|
|
18
|
-
validator(
|
|
19
|
-
|
|
21
|
+
validator(value) {
|
|
22
|
+
const res = /^\d*\.?\d+(s|ms)$/;
|
|
23
|
+
return res.test(value);
|
|
20
24
|
}
|
|
21
25
|
}
|
|
22
26
|
},
|
|
23
|
-
setup(
|
|
24
|
-
const
|
|
25
|
-
var
|
|
26
|
-
const
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
27
|
+
setup(__props) {
|
|
28
|
+
const calcPropertyValue = (propName, originalValue, modificator) => {
|
|
29
|
+
var _a, _b;
|
|
30
|
+
const computedStyle = {};
|
|
31
|
+
const timeQuantityOuter = (_a = originalValue.match(/^\d*\.?\d+/)) == null ? void 0 : _a[0];
|
|
32
|
+
const timeUnit = ((_b = originalValue.match(/s|(ms)$/)) == null ? void 0 : _b[0]) || "s";
|
|
33
|
+
const timeQuantityInner = Math.round(Number(timeQuantityOuter) * 1e3 * modificator) / 1e3;
|
|
34
|
+
computedStyle[propName] = timeQuantityInner + timeUnit;
|
|
35
|
+
return computedStyle;
|
|
36
|
+
};
|
|
37
|
+
const props = __props;
|
|
38
|
+
const spinnerStyle = computed(() => {
|
|
39
|
+
return {
|
|
40
|
+
borderWidth: `${props.size * 0.1}px`,
|
|
41
|
+
borderColor: `${props.color} transparent transparent transparent`,
|
|
42
|
+
animationDuration: props.duration,
|
|
43
|
+
animationTimingFunction: "cubic-bezier(0.5, 0, 0.5, 1)"
|
|
44
|
+
};
|
|
45
|
+
});
|
|
46
|
+
const animDiv1 = computed(() => {
|
|
47
|
+
return calcPropertyValue("animationDelay", props.duration, -0.375);
|
|
48
|
+
});
|
|
49
|
+
const animDiv2 = computed(() => {
|
|
50
|
+
return calcPropertyValue("animationDelay", props.duration, -0.25);
|
|
51
|
+
});
|
|
52
|
+
const animDiv3 = computed(() => {
|
|
53
|
+
return calcPropertyValue("animationDelay", props.duration, -0.125);
|
|
54
|
+
});
|
|
55
|
+
return (_ctx, _cache) => {
|
|
56
|
+
return openBlock(), createElementBlock("div", {
|
|
57
|
+
class: "relative inline-block",
|
|
58
|
+
style: normalizeStyle({ width: `${__props.size}px`, height: `${__props.size}px` })
|
|
59
|
+
}, [
|
|
60
|
+
createElementVNode("div", {
|
|
61
|
+
class: normalizeClass(INNER_DIV_CLASS),
|
|
62
|
+
style: normalizeStyle([spinnerStyle.value, animDiv1.value])
|
|
63
|
+
}, null, 4),
|
|
64
|
+
createElementVNode("div", {
|
|
65
|
+
class: normalizeClass(INNER_DIV_CLASS),
|
|
66
|
+
style: normalizeStyle([spinnerStyle.value, animDiv2.value])
|
|
67
|
+
}, null, 4),
|
|
68
|
+
createElementVNode("div", {
|
|
69
|
+
class: normalizeClass(INNER_DIV_CLASS),
|
|
70
|
+
style: normalizeStyle([spinnerStyle.value, animDiv3.value])
|
|
71
|
+
}, null, 4),
|
|
72
|
+
createElementVNode("div", {
|
|
73
|
+
class: normalizeClass(INNER_DIV_CLASS),
|
|
74
|
+
style: normalizeStyle([spinnerStyle.value])
|
|
75
|
+
}, null, 4)
|
|
76
|
+
], 4);
|
|
77
|
+
};
|
|
55
78
|
}
|
|
56
79
|
});
|
|
57
80
|
export {
|
|
58
|
-
_
|
|
81
|
+
_sfc_main as _
|
|
59
82
|
};
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
import { defineComponent, resolveDirective, openBlock, createElementBlock, normalizeClass, Fragment, renderList, withDirectives, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString } from "vue";
|
|
2
|
+
import PBtn from "../p-btn.js";
|
|
3
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
4
|
+
...{
|
|
5
|
+
name: "PBtnGroup"
|
|
6
|
+
},
|
|
5
7
|
__name: "p-select-btn",
|
|
6
8
|
props: {
|
|
7
9
|
modelValue: { default: null },
|
|
@@ -10,68 +12,87 @@ const P = /* @__PURE__ */ V({
|
|
|
10
12
|
itemText: { default: "text" },
|
|
11
13
|
itemTooltipText: { default: "text" },
|
|
12
14
|
size: { default: "md" },
|
|
13
|
-
showTooltip: { type: Boolean, default:
|
|
14
|
-
highlightSelected: { type: Boolean, default:
|
|
15
|
-
grow: { type: Boolean, default:
|
|
16
|
-
multiple: { type: Boolean, default:
|
|
17
|
-
noPadding: { type: Boolean, default:
|
|
15
|
+
showTooltip: { type: Boolean, default: false },
|
|
16
|
+
highlightSelected: { type: Boolean, default: true },
|
|
17
|
+
grow: { type: Boolean, default: false },
|
|
18
|
+
multiple: { type: Boolean, default: false },
|
|
19
|
+
noPadding: { type: Boolean, default: false }
|
|
18
20
|
},
|
|
19
21
|
emits: ["update:modelValue"],
|
|
20
|
-
setup(
|
|
21
|
-
const
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
22
|
+
setup(__props, { emit: __emit }) {
|
|
23
|
+
const emit = __emit;
|
|
24
|
+
const props = __props;
|
|
25
|
+
const tooltipText = (item) => {
|
|
26
|
+
return props.showTooltip ? item[props.itemTooltipText] : "";
|
|
27
|
+
};
|
|
28
|
+
const select = (item) => {
|
|
29
|
+
if (!props.multiple) {
|
|
30
|
+
emit("update:modelValue", item[props.itemValue]);
|
|
31
|
+
} else {
|
|
32
|
+
if (Array.isArray(props.modelValue)) {
|
|
33
|
+
const val = item[props.itemValue];
|
|
34
|
+
const index = props.modelValue.findIndex((i) => i[props.itemValue] === val);
|
|
35
|
+
if (index !== -1) {
|
|
36
|
+
emit(
|
|
37
|
+
"update:modelValue",
|
|
38
|
+
props.modelValue.filter((i) => i[props.itemValue] !== val)
|
|
39
|
+
);
|
|
40
|
+
} else {
|
|
41
|
+
emit("update:modelValue", [...props.modelValue, item]);
|
|
42
|
+
}
|
|
43
|
+
} else {
|
|
44
|
+
emit("update:modelValue", [item]);
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
const isSelected = (item) => {
|
|
49
|
+
if (!props.multiple) {
|
|
50
|
+
return props.modelValue === item[props.itemValue];
|
|
51
|
+
} else {
|
|
52
|
+
if (Array.isArray(props.modelValue)) {
|
|
53
|
+
const index = props.modelValue.findIndex((i) => i[props.itemValue] === item[props.itemValue]);
|
|
54
|
+
return index !== -1;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
38
57
|
};
|
|
39
|
-
return (
|
|
40
|
-
const
|
|
41
|
-
return
|
|
42
|
-
class:
|
|
58
|
+
return (_ctx, _cache) => {
|
|
59
|
+
const _directive_tooltip = resolveDirective("tooltip");
|
|
60
|
+
return openBlock(), createElementBlock("div", {
|
|
61
|
+
class: normalizeClass({ flex: _ctx.grow, "*:px-0 *:py-0": _ctx.noPadding })
|
|
43
62
|
}, [
|
|
44
|
-
(
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
[
|
|
70
|
-
|
|
63
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (item, index) => {
|
|
64
|
+
return withDirectives((openBlock(), createBlock(PBtn, {
|
|
65
|
+
key: item[_ctx.itemValue],
|
|
66
|
+
size: _ctx.size,
|
|
67
|
+
type: "secondary-outline-blue",
|
|
68
|
+
disabled: item.disabled,
|
|
69
|
+
class: normalizeClass({
|
|
70
|
+
"rounded-none": index !== 0 && index !== _ctx.items.length - 1,
|
|
71
|
+
"rounded-br-none rounded-tr-none": index === 0,
|
|
72
|
+
"rounded-bl-none rounded-tl-none": index === _ctx.items.length - 1,
|
|
73
|
+
"-mr-0.5": index !== _ctx.items.length - 1,
|
|
74
|
+
"flex-1": _ctx.grow
|
|
75
|
+
}),
|
|
76
|
+
selected: isSelected(item) && _ctx.highlightSelected,
|
|
77
|
+
onClick: ($event) => select(item)
|
|
78
|
+
}, {
|
|
79
|
+
default: withCtx(() => [
|
|
80
|
+
renderSlot(_ctx.$slots, `btn-${index}`, {
|
|
81
|
+
item,
|
|
82
|
+
isSelected: isSelected(item)
|
|
83
|
+
}, () => [
|
|
84
|
+
createTextVNode(toDisplayString(item[_ctx.itemText]), 1)
|
|
85
|
+
])
|
|
86
|
+
]),
|
|
87
|
+
_: 2
|
|
88
|
+
}, 1032, ["size", "disabled", "class", "selected", "onClick"])), [
|
|
89
|
+
[_directive_tooltip, { content: tooltipText(item) }]
|
|
90
|
+
]);
|
|
91
|
+
}), 128))
|
|
71
92
|
], 2);
|
|
72
93
|
};
|
|
73
94
|
}
|
|
74
95
|
});
|
|
75
96
|
export {
|
|
76
|
-
|
|
97
|
+
_sfc_main as _
|
|
77
98
|
};
|