@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-select-pill.js
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, createElementVNode, Fragment, renderList, normalizeClass, toDisplayString, createCommentVNode } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
3
|
+
const SIZES = { sm: "h-7 px-4 text-xs", md: "h-9 px-5 text-sm", lg: "h-11 px-7 text-base" };
|
|
4
|
+
const ACTIVE_CLASS = "text-p-purple-60";
|
|
5
|
+
const getOffsetValues = (container) => {
|
|
6
|
+
const el = container.cloneNode(true);
|
|
7
|
+
el.style.visibility = "hidden";
|
|
8
|
+
document.body.appendChild(el);
|
|
9
|
+
const activeBtn = el.querySelector(`button.${ACTIVE_CLASS}`);
|
|
10
|
+
const res = { width: `${activeBtn.offsetWidth}px`, left: `${activeBtn.offsetLeft}px` };
|
|
11
|
+
document.body.removeChild(el);
|
|
12
|
+
return res;
|
|
13
|
+
};
|
|
14
|
+
const _sfc_main = defineComponent({
|
|
9
15
|
props: {
|
|
10
16
|
modelValue: {
|
|
11
17
|
type: [String, Number],
|
|
@@ -30,16 +36,16 @@ const u = { sm: "h-7 px-4 text-xs", md: "h-9 px-5 text-sm", lg: "h-11 px-7 text-
|
|
|
30
36
|
size: {
|
|
31
37
|
type: String,
|
|
32
38
|
default: "md",
|
|
33
|
-
validator(
|
|
34
|
-
return Object.keys(
|
|
39
|
+
validator(value) {
|
|
40
|
+
return Object.keys(SIZES).includes(value);
|
|
35
41
|
}
|
|
36
42
|
}
|
|
37
43
|
},
|
|
38
44
|
emits: ["update:modelValue"],
|
|
39
45
|
data() {
|
|
40
46
|
return {
|
|
41
|
-
SIZES
|
|
42
|
-
ACTIVE_CLASS
|
|
47
|
+
SIZES,
|
|
48
|
+
ACTIVE_CLASS
|
|
43
49
|
};
|
|
44
50
|
},
|
|
45
51
|
watch: {
|
|
@@ -47,49 +53,60 @@ const u = { sm: "h-7 px-4 text-xs", md: "h-9 px-5 text-sm", lg: "h-11 px-7 text-
|
|
|
47
53
|
handler() {
|
|
48
54
|
setTimeout(() => this.setPillStyle(), 60);
|
|
49
55
|
},
|
|
50
|
-
immediate:
|
|
56
|
+
immediate: true
|
|
51
57
|
}
|
|
52
58
|
},
|
|
53
59
|
methods: {
|
|
54
|
-
click(e,
|
|
55
|
-
|
|
60
|
+
click(e, option) {
|
|
61
|
+
if (!option.disabled) {
|
|
62
|
+
this.$emit("update:modelValue", option[this.itemValue]);
|
|
63
|
+
}
|
|
56
64
|
},
|
|
57
65
|
setPillStyle() {
|
|
58
|
-
const
|
|
59
|
-
if (!
|
|
66
|
+
const el = this.$el.querySelector(`button.${ACTIVE_CLASS}`);
|
|
67
|
+
if (!el) {
|
|
60
68
|
return;
|
|
61
|
-
|
|
62
|
-
|
|
69
|
+
}
|
|
70
|
+
const dimensions = el.offsetWidth !== 0 ? { left: `${el.offsetLeft}px`, width: `${el.offsetWidth}px` } : getOffsetValues(this.$el);
|
|
71
|
+
this.$refs.pill.style.left = dimensions.left;
|
|
72
|
+
this.$refs.pill.style.width = dimensions.width;
|
|
63
73
|
}
|
|
64
74
|
}
|
|
65
|
-
})
|
|
75
|
+
});
|
|
76
|
+
const _hoisted_1 = { class: "relative inline-flex rounded-full border-2 border-p-gray-30 bg-p-gray-30 text-center font-semibold text-p-gray-50" };
|
|
77
|
+
const _hoisted_2 = {
|
|
66
78
|
ref: "pill",
|
|
67
79
|
class: "absolute left-0 top-0 inline-block h-full rounded-full bg-surface duration-200 ease-in-out"
|
|
68
|
-
}
|
|
80
|
+
};
|
|
81
|
+
const _hoisted_3 = ["disabled", "onClick"];
|
|
82
|
+
const _hoisted_4 = { class: "flex" };
|
|
83
|
+
const _hoisted_5 = {
|
|
69
84
|
key: 0,
|
|
70
85
|
class: "pl-1 opacity-50"
|
|
71
86
|
};
|
|
72
|
-
function
|
|
73
|
-
return
|
|
74
|
-
|
|
75
|
-
(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
87
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
88
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
89
|
+
createElementVNode("div", _hoisted_2, null, 512),
|
|
90
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items, (o) => {
|
|
91
|
+
return openBlock(), createElementBlock("button", {
|
|
92
|
+
key: o[_ctx.itemValue],
|
|
93
|
+
disabled: o.disabled,
|
|
94
|
+
class: normalizeClass(["z-10 duration-700", [
|
|
95
|
+
_ctx.SIZES[_ctx.size],
|
|
96
|
+
_ctx.modelValue === o[_ctx.itemValue] ? `${_ctx.ACTIVE_CLASS} hover:text-p-purple-70` : "hover:text-p-gray-60",
|
|
97
|
+
{ "opacity-25": o.disabled }
|
|
98
|
+
]]),
|
|
99
|
+
onClick: ($event) => _ctx.click($event, o)
|
|
100
|
+
}, [
|
|
101
|
+
createElementVNode("div", _hoisted_4, [
|
|
102
|
+
createElementVNode("div", null, toDisplayString(o[_ctx.itemText]), 1),
|
|
103
|
+
o[_ctx.itemSubtext] ? (openBlock(), createElementBlock("div", _hoisted_5, toDisplayString(o[_ctx.itemSubtext]), 1)) : createCommentVNode("", true)
|
|
104
|
+
])
|
|
105
|
+
], 10, _hoisted_3);
|
|
106
|
+
}), 128))
|
|
90
107
|
]);
|
|
91
108
|
}
|
|
92
|
-
const
|
|
109
|
+
const pSelectPill = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
93
110
|
export {
|
|
94
|
-
|
|
111
|
+
pSelectPill as default
|
|
95
112
|
};
|
package/dist/es/p-select.js
CHANGED
|
@@ -1,25 +1,30 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, normalizeClass, createElementVNode, normalizeStyle, renderSlot } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
3
|
+
const LOADER_TYPES = {
|
|
4
4
|
rectangle: "rectangle",
|
|
5
5
|
circle: "circle"
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
[
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
return
|
|
15
|
-
}
|
|
6
|
+
};
|
|
7
|
+
const LOADER_CSS_CLASSES = {
|
|
8
|
+
[LOADER_TYPES.rectangle]: "rounded",
|
|
9
|
+
[LOADER_TYPES.circle]: "rounded-full"
|
|
10
|
+
};
|
|
11
|
+
const SHIMMER_COLOR = "#ffffff";
|
|
12
|
+
const isHexColor = (hexColor) => {
|
|
13
|
+
const hex = hexColor.replace("#", "");
|
|
14
|
+
return typeof hexColor === "string" && hexColor.startsWith("#") && hex.length === 6 && !isNaN(Number("0x" + hex));
|
|
15
|
+
};
|
|
16
|
+
const hexToRgb = (hex) => {
|
|
17
|
+
var _a;
|
|
18
|
+
return `${(_a = hex.match(/\w\w/g)) == null ? void 0 : _a.map((x) => +`0x${x}`)}`;
|
|
19
|
+
};
|
|
20
|
+
const _sfc_main = defineComponent({
|
|
16
21
|
name: "PSkeletonLoader",
|
|
17
22
|
props: {
|
|
18
23
|
type: {
|
|
19
24
|
type: String,
|
|
20
|
-
default:
|
|
21
|
-
validator(
|
|
22
|
-
return Object.values(
|
|
25
|
+
default: LOADER_TYPES.rectangle,
|
|
26
|
+
validator(value) {
|
|
27
|
+
return Object.values(LOADER_TYPES).includes(value);
|
|
23
28
|
}
|
|
24
29
|
},
|
|
25
30
|
bgClass: {
|
|
@@ -32,38 +37,38 @@ const r = {
|
|
|
32
37
|
},
|
|
33
38
|
shimmerColor: {
|
|
34
39
|
type: String,
|
|
35
|
-
default:
|
|
40
|
+
default: SHIMMER_COLOR
|
|
36
41
|
}
|
|
37
42
|
},
|
|
38
43
|
data() {
|
|
39
44
|
return {
|
|
40
|
-
LOADER_TYPES
|
|
45
|
+
LOADER_TYPES
|
|
41
46
|
};
|
|
42
47
|
},
|
|
43
48
|
computed: {
|
|
44
49
|
shimmerStyle() {
|
|
45
|
-
const
|
|
50
|
+
const rgb = isHexColor(this.shimmerColor) ? hexToRgb(this.shimmerColor) : SHIMMER_COLOR;
|
|
46
51
|
return {
|
|
47
|
-
backgroundImage: `linear-gradient(90deg, rgba(${
|
|
52
|
+
backgroundImage: `linear-gradient(90deg, rgba(${rgb}, 0) 0%, rgba(${rgb}, 0.2) 20%, rgba(${rgb}, 0.5) 60%, rgba(${rgb}, 0))`
|
|
48
53
|
};
|
|
49
54
|
},
|
|
50
55
|
loaderClass() {
|
|
51
|
-
return this.cssClass ? this.cssClass :
|
|
56
|
+
return this.cssClass ? this.cssClass : LOADER_CSS_CLASSES[this.type];
|
|
52
57
|
}
|
|
53
58
|
}
|
|
54
59
|
});
|
|
55
|
-
function
|
|
56
|
-
return
|
|
57
|
-
class:
|
|
60
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
61
|
+
return openBlock(), createElementBlock("div", {
|
|
62
|
+
class: normalizeClass([_ctx.bgClass, _ctx.loaderClass, "relative overflow-hidden"])
|
|
58
63
|
}, [
|
|
59
|
-
|
|
64
|
+
createElementVNode("div", {
|
|
60
65
|
class: "shimmer absolute bottom-0 left-0 right-0 top-0",
|
|
61
|
-
style:
|
|
66
|
+
style: normalizeStyle(_ctx.shimmerStyle)
|
|
62
67
|
}, null, 4),
|
|
63
|
-
|
|
68
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
64
69
|
], 2);
|
|
65
70
|
}
|
|
66
|
-
const
|
|
71
|
+
const PSkeletonLoader = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-53e537dc"]]);
|
|
67
72
|
export {
|
|
68
|
-
|
|
73
|
+
PSkeletonLoader as default
|
|
69
74
|
};
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
1
|
+
import { defineComponent, openBlock, createElementBlock, mergeProps } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
3
|
+
const _sfc_main = defineComponent({
|
|
4
4
|
name: "PTableFilterIcon",
|
|
5
|
-
inheritAttrs:
|
|
5
|
+
inheritAttrs: false,
|
|
6
6
|
props: {
|
|
7
7
|
active: {
|
|
8
8
|
type: Boolean,
|
|
9
|
-
default:
|
|
9
|
+
default: false
|
|
10
10
|
}
|
|
11
11
|
}
|
|
12
12
|
});
|
|
13
|
-
function
|
|
14
|
-
return
|
|
15
|
-
class: ["h-5 w-5 shrink-0 cursor-pointer filter", { active:
|
|
16
|
-
},
|
|
13
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
14
|
+
return openBlock(), createElementBlock("div", mergeProps({
|
|
15
|
+
class: ["h-5 w-5 shrink-0 cursor-pointer filter", { active: _ctx.active }]
|
|
16
|
+
}, _ctx.$attrs), null, 16);
|
|
17
17
|
}
|
|
18
|
-
const
|
|
18
|
+
const PTableFilterIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cbac2434"]]);
|
|
19
19
|
export {
|
|
20
|
-
|
|
20
|
+
PTableFilterIcon as default
|
|
21
21
|
};
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { defineComponent
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
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({
|
|
6
7
|
name: "PTableHeaderCell",
|
|
7
8
|
components: {
|
|
8
|
-
PTableFilterIcon
|
|
9
|
-
PInfoIcon
|
|
9
|
+
PTableFilterIcon,
|
|
10
|
+
PInfoIcon
|
|
10
11
|
},
|
|
11
12
|
props: {
|
|
12
13
|
text: {
|
|
@@ -19,11 +20,11 @@ const I = "text-xs leading-5 font-bold uppercase truncate shrink", k = d({
|
|
|
19
20
|
},
|
|
20
21
|
filterActive: {
|
|
21
22
|
type: Boolean,
|
|
22
|
-
default:
|
|
23
|
+
default: false
|
|
23
24
|
},
|
|
24
25
|
showFilterIcon: {
|
|
25
26
|
type: Boolean,
|
|
26
|
-
default:
|
|
27
|
+
default: false
|
|
27
28
|
},
|
|
28
29
|
tooltipText: {
|
|
29
30
|
type: String,
|
|
@@ -33,39 +34,43 @@ const I = "text-xs leading-5 font-bold uppercase truncate shrink", k = d({
|
|
|
33
34
|
emits: ["click-filter-icon"],
|
|
34
35
|
data() {
|
|
35
36
|
return {
|
|
36
|
-
DEFAULT_CLASSES
|
|
37
|
+
DEFAULT_CLASSES
|
|
37
38
|
};
|
|
38
39
|
}
|
|
39
|
-
})
|
|
40
|
+
});
|
|
41
|
+
const _hoisted_1 = { class: "flex items-center overflow-hidden" };
|
|
42
|
+
const _hoisted_2 = ["title"];
|
|
43
|
+
const _hoisted_3 = {
|
|
40
44
|
key: 0,
|
|
41
45
|
class: "relative ml-1 mr-auto h-3 w-3 shrink-0"
|
|
42
46
|
};
|
|
43
|
-
function
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
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 }
|
|
52
57
|
]),
|
|
53
|
-
title:
|
|
54
|
-
},
|
|
55
|
-
|
|
56
|
-
|
|
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, {
|
|
57
62
|
key: 0,
|
|
58
|
-
text:
|
|
59
|
-
}, null, 8, ["text"])) :
|
|
60
|
-
])) :
|
|
61
|
-
|
|
62
|
-
class:
|
|
63
|
-
active:
|
|
64
|
-
onClick:
|
|
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))
|
|
65
70
|
}, null, 8, ["class", "active"])
|
|
66
71
|
]);
|
|
67
72
|
}
|
|
68
|
-
const
|
|
73
|
+
const PTableHeaderCell = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
69
74
|
export {
|
|
70
|
-
|
|
75
|
+
PTableHeaderCell as default
|
|
71
76
|
};
|
package/dist/es/p-table-sort.js
CHANGED
package/dist/es/p-table-td.js
CHANGED
|
@@ -1,42 +1,89 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { colsInjectionKey
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
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 = {
|
|
5
7
|
key: 0,
|
|
6
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"
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
inheritAttrs:
|
|
9
|
+
};
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
...{ name: "PTableTd", inheritAttrs: false },
|
|
10
12
|
__name: "p-table-td",
|
|
11
13
|
props: {
|
|
12
14
|
colIndex: {},
|
|
13
|
-
isEditable: { type: Boolean, default:
|
|
14
|
-
isSelected: { type: Boolean, default:
|
|
15
|
+
isEditable: { type: Boolean, default: false },
|
|
16
|
+
isSelected: { type: Boolean, default: false }
|
|
15
17
|
},
|
|
16
|
-
setup(
|
|
17
|
-
const
|
|
18
|
-
|
|
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 = [
|
|
19
30
|
// Common classes for all cells
|
|
20
31
|
"p-0 h-full text-sm"
|
|
21
32
|
];
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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;
|
|
26
70
|
});
|
|
27
|
-
return (
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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
|
+
};
|
|
38
84
|
}
|
|
39
|
-
})
|
|
85
|
+
});
|
|
86
|
+
const pTableTd = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-50608a90"]]);
|
|
40
87
|
export {
|
|
41
|
-
|
|
88
|
+
pTableTd as default
|
|
42
89
|
};
|
package/dist/es/p-table.js
CHANGED
|
@@ -1,8 +1,12 @@
|
|
|
1
|
-
const
|
|
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;
|
|
2
6
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
7
|
+
MIN_WIDTH_COL_RESIZE,
|
|
8
|
+
colsInjectionKey,
|
|
9
|
+
isColsResizableInjectionKey,
|
|
10
|
+
isFirstColFixedInjectionKey,
|
|
11
|
+
isLastColFixedInjectionKey
|
|
8
12
|
};
|
package/dist/es/p-tabs.js
CHANGED