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