@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.
Files changed (144) hide show
  1. package/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -1
  2. package/dist/cjs/chunks/p-action-bar.js +60 -1
  3. package/dist/cjs/chunks/p-card.js +28 -1
  4. package/dist/cjs/chunks/p-checkbox.js +24 -1
  5. package/dist/cjs/chunks/p-dropdown-select.js +414 -1
  6. package/dist/cjs/chunks/p-input-percent.js +53 -1
  7. package/dist/cjs/chunks/p-pagination-info.js +66 -1
  8. package/dist/cjs/chunks/p-pagination.js +122 -1
  9. package/dist/cjs/chunks/p-ring-loader.js +81 -1
  10. package/dist/cjs/chunks/p-select-btn.js +97 -1
  11. package/dist/cjs/chunks/p-select.js +123 -1
  12. package/dist/cjs/chunks/p-table-loader.js +70 -1
  13. package/dist/cjs/chunks/p-tabs.js +52 -1
  14. package/dist/cjs/config.js +105 -1
  15. package/dist/cjs/currency.js +9 -1
  16. package/dist/cjs/dom.js +27 -1
  17. package/dist/cjs/index.js +976 -1
  18. package/dist/cjs/inputClassesMixin.js +50 -1
  19. package/dist/cjs/inputClassesShared.js +76 -1
  20. package/dist/cjs/listKeyboardNavigation.js +110 -1
  21. package/dist/cjs/number.js +9 -1
  22. package/dist/cjs/object.js +4 -1
  23. package/dist/cjs/p-action-bar.js +3 -1
  24. package/dist/cjs/p-alert.js +65 -1
  25. package/dist/cjs/p-avatar.js +71 -1
  26. package/dist/cjs/p-btn.js +358 -2
  27. package/dist/cjs/p-card.js +3 -1
  28. package/dist/cjs/p-checkbox.js +3 -1
  29. package/dist/cjs/p-chips.js +110 -1
  30. package/dist/cjs/p-close-btn.js +36 -1
  31. package/dist/cjs/p-date-picker.js +139 -1
  32. package/dist/cjs/p-drawer.js +253 -1
  33. package/dist/cjs/p-dropdown-select.js +3 -1
  34. package/dist/cjs/p-dropdown.js +138 -1
  35. package/dist/cjs/p-file-upload.js +21 -1
  36. package/dist/cjs/p-info-icon.js +35 -1
  37. package/dist/cjs/p-inline-date-picker.js +142 -1
  38. package/dist/cjs/p-input-number.js +146 -1
  39. package/dist/cjs/p-input-percent.js +3 -1
  40. package/dist/cjs/p-input-search.js +110 -1
  41. package/dist/cjs/p-input.js +89 -1
  42. package/dist/cjs/p-loading.js +38 -1
  43. package/dist/cjs/p-modal.js +369 -1
  44. package/dist/cjs/p-pagination-info.js +3 -1
  45. package/dist/cjs/p-pagination.js +3 -1
  46. package/dist/cjs/p-progress-bar.js +41 -1
  47. package/dist/cjs/p-ring-loader.js +3 -1
  48. package/dist/cjs/p-select-btn.js +3 -1
  49. package/dist/cjs/p-select-list.js +4 -1
  50. package/dist/cjs/p-select-pill.js +111 -1
  51. package/dist/cjs/p-select.js +3 -1
  52. package/dist/cjs/p-skeleton-loader.js +73 -1
  53. package/dist/cjs/p-table-filter-icon.js +20 -1
  54. package/dist/cjs/p-table-header-cell.js +75 -1
  55. package/dist/cjs/p-table-loader.js +3 -1
  56. package/dist/cjs/p-table-sort.js +8 -1
  57. package/dist/cjs/p-table-td.js +88 -1
  58. package/dist/cjs/p-table.js +12 -1
  59. package/dist/cjs/p-tabs.js +3 -1
  60. package/dist/cjs/p-textarea.js +73 -1
  61. package/dist/cjs/p-toggle.js +114 -1
  62. package/dist/cjs/pagination.js +29 -1
  63. package/dist/cjs/string.js +12 -1
  64. package/dist/cjs/tailwind.js +4353 -1
  65. package/dist/cjs/text.js +16 -1
  66. package/dist/cjs/useInputClasses.js +44 -1
  67. package/dist/cjs/usePLoading.js +35 -1
  68. package/dist/cjs/usePModal.js +21 -1
  69. package/dist/cjs/usePTableColResize.js +81 -1
  70. package/dist/cjs/usePTableRowVirtualizer.js +31 -1
  71. package/dist/cjs/useSelectList.js +256 -1
  72. package/dist/es/chunks/_plugin-vue_export-helper.js +7 -6
  73. package/dist/es/chunks/p-action-bar.js +45 -36
  74. package/dist/es/chunks/p-card.js +18 -14
  75. package/dist/es/chunks/p-checkbox.js +14 -11
  76. package/dist/es/chunks/p-dropdown-select.js +232 -183
  77. package/dist/es/chunks/p-input-percent.js +34 -25
  78. package/dist/es/chunks/p-pagination-info.js +30 -24
  79. package/dist/es/chunks/p-pagination.js +78 -48
  80. package/dist/es/chunks/p-ring-loader.js +63 -40
  81. package/dist/es/chunks/p-select-btn.js +80 -59
  82. package/dist/es/chunks/p-select.js +81 -54
  83. package/dist/es/chunks/p-table-loader.js +46 -32
  84. package/dist/es/chunks/p-tabs.js +35 -29
  85. package/dist/es/config.js +2 -2
  86. package/dist/es/currency.js +3 -3
  87. package/dist/es/dom.js +24 -12
  88. package/dist/es/index.js +703 -561
  89. package/dist/es/inputClassesMixin.js +20 -14
  90. package/dist/es/inputClassesShared.js +60 -45
  91. package/dist/es/listKeyboardNavigation.js +86 -36
  92. package/dist/es/number.js +7 -2
  93. package/dist/es/object.js +2 -2
  94. package/dist/es/p-action-bar.js +2 -2
  95. package/dist/es/p-alert.js +35 -30
  96. package/dist/es/p-avatar.js +30 -27
  97. package/dist/es/p-btn.js +209 -164
  98. package/dist/es/p-card.js +2 -2
  99. package/dist/es/p-checkbox.js +2 -2
  100. package/dist/es/p-chips.js +60 -40
  101. package/dist/es/p-close-btn.js +20 -16
  102. package/dist/es/p-date-picker.js +66 -58
  103. package/dist/es/p-drawer.js +108 -89
  104. package/dist/es/p-dropdown-select.js +2 -2
  105. package/dist/es/p-dropdown.js +52 -33
  106. package/dist/es/p-file-upload.js +17 -9
  107. package/dist/es/p-info-icon.js +21 -16
  108. package/dist/es/p-inline-date-picker.js +64 -53
  109. package/dist/es/p-input-number.js +84 -66
  110. package/dist/es/p-input-percent.js +2 -2
  111. package/dist/es/p-input-search.js +43 -41
  112. package/dist/es/p-input.js +51 -45
  113. package/dist/es/p-loading.js +31 -22
  114. package/dist/es/p-modal.js +261 -174
  115. package/dist/es/p-pagination-info.js +2 -2
  116. package/dist/es/p-pagination.js +2 -2
  117. package/dist/es/p-progress-bar.js +26 -23
  118. package/dist/es/p-ring-loader.js +2 -2
  119. package/dist/es/p-select-btn.js +2 -2
  120. package/dist/es/p-select-list.js +2 -2
  121. package/dist/es/p-select-pill.js +58 -41
  122. package/dist/es/p-select.js +2 -2
  123. package/dist/es/p-skeleton-loader.js +34 -29
  124. package/dist/es/p-table-filter-icon.js +11 -11
  125. package/dist/es/p-table-header-cell.js +38 -33
  126. package/dist/es/p-table-loader.js +2 -2
  127. package/dist/es/p-table-sort.js +2 -2
  128. package/dist/es/p-table-td.js +76 -29
  129. package/dist/es/p-table.js +10 -6
  130. package/dist/es/p-tabs.js +2 -2
  131. package/dist/es/p-textarea.js +36 -34
  132. package/dist/es/p-toggle.js +53 -48
  133. package/dist/es/pagination.js +25 -8
  134. package/dist/es/string.js +10 -2
  135. package/dist/es/tailwind.js +1660 -1101
  136. package/dist/es/text.js +13 -8
  137. package/dist/es/useInputClasses.js +38 -22
  138. package/dist/es/usePLoading.js +31 -15
  139. package/dist/es/usePModal.js +15 -12
  140. package/dist/es/usePTableColResize.js +71 -39
  141. package/dist/es/usePTableRowVirtualizer.js +24 -15
  142. package/dist/es/useSelectList.js +234 -121
  143. package/dist/style.css +2124 -1
  144. package/package.json +1 -1
@@ -1,11 +1,17 @@
1
- import { defineComponent as f, openBlock as i, createElementBlock as s, createElementVNode as o, Fragment as m, renderList as c, normalizeClass as h, toDisplayString as a, createCommentVNode as y } from "vue";
2
- import { _ as b } from "./chunks/_plugin-vue_export-helper.js";
3
- const u = { sm: "h-7 px-4 text-xs", md: "h-9 px-5 text-sm", lg: "h-11 px-7 text-base" }, r = "text-p-purple-60", S = (e) => {
4
- const t = e.cloneNode(!0);
5
- t.style.visibility = "hidden", document.body.appendChild(t);
6
- const d = t.querySelector(`button.${r}`), n = { width: `${d.offsetWidth}px`, left: `${d.offsetLeft}px` };
7
- return document.body.removeChild(t), n;
8
- }, x = f({
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(e) {
34
- return Object.keys(u).includes(e);
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: u,
42
- ACTIVE_CLASS: r
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: !0
56
+ immediate: true
51
57
  }
52
58
  },
53
59
  methods: {
54
- click(e, t) {
55
- t.disabled || this.$emit("update:modelValue", t[this.itemValue]);
60
+ click(e, option) {
61
+ if (!option.disabled) {
62
+ this.$emit("update:modelValue", option[this.itemValue]);
63
+ }
56
64
  },
57
65
  setPillStyle() {
58
- const e = this.$el.querySelector(`button.${r}`);
59
- if (!e)
66
+ const el = this.$el.querySelector(`button.${ACTIVE_CLASS}`);
67
+ if (!el) {
60
68
  return;
61
- const t = e.offsetWidth !== 0 ? { left: `${e.offsetLeft}px`, width: `${e.offsetWidth}px` } : S(this.$el);
62
- this.$refs.pill.style.left = t.left, this.$refs.pill.style.width = t.width;
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
- }), $ = { class: "relative inline-flex rounded-full border-2 border-p-gray-30 bg-p-gray-30 text-center font-semibold text-p-gray-50" }, g = {
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
- }, V = ["disabled", "onClick"], v = { class: "flex" }, C = {
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 k(e, t, d, n, _, E) {
73
- return i(), s("div", $, [
74
- o("div", g, null, 512),
75
- (i(!0), s(m, null, c(e.items, (l) => (i(), s("button", {
76
- key: l[e.itemValue],
77
- disabled: l.disabled,
78
- class: h(["z-10 duration-700", [
79
- e.SIZES[e.size],
80
- e.modelValue === l[e.itemValue] ? `${e.ACTIVE_CLASS} hover:text-p-purple-70` : "hover:text-p-gray-60",
81
- { "opacity-25": l.disabled }
82
- ]]),
83
- onClick: (p) => e.click(p, l)
84
- }, [
85
- o("div", v, [
86
- o("div", null, a(l[e.itemText]), 1),
87
- l[e.itemSubtext] ? (i(), s("div", C, a(l[e.itemSubtext]), 1)) : y("", !0)
88
- ])
89
- ], 10, V))), 128))
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 L = /* @__PURE__ */ b(x, [["render", k]]);
109
+ const pSelectPill = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
93
110
  export {
94
- L as default
111
+ pSelectPill as default
95
112
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/p-select.js";
1
+ import { _ as _sfc_main } from "./chunks/p-select.js";
2
2
  export {
3
- f as default
3
+ _sfc_main as default
4
4
  };
@@ -1,25 +1,30 @@
1
- import { defineComponent as l, openBlock as o, createElementBlock as n, normalizeClass as i, createElementVNode as c, normalizeStyle as d, renderSlot as m } from "vue";
2
- import { _ as g } from "./chunks/_plugin-vue_export-helper.js";
3
- const r = {
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
- }, p = {
7
- [r.rectangle]: "rounded",
8
- [r.circle]: "rounded-full"
9
- }, a = "#ffffff", u = (e) => {
10
- const t = e.replace("#", "");
11
- return typeof e == "string" && e.startsWith("#") && t.length === 6 && !isNaN(+("0x" + t));
12
- }, f = (e) => {
13
- var t;
14
- return `${(t = e.match(/\w\w/g)) == null ? void 0 : t.map((s) => +`0x${s}`)}`;
15
- }, h = l({
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: r.rectangle,
21
- validator(e) {
22
- return Object.values(r).includes(e);
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: a
40
+ default: SHIMMER_COLOR
36
41
  }
37
42
  },
38
43
  data() {
39
44
  return {
40
- LOADER_TYPES: r
45
+ LOADER_TYPES
41
46
  };
42
47
  },
43
48
  computed: {
44
49
  shimmerStyle() {
45
- const e = u(this.shimmerColor) ? f(this.shimmerColor) : a;
50
+ const rgb = isHexColor(this.shimmerColor) ? hexToRgb(this.shimmerColor) : SHIMMER_COLOR;
46
51
  return {
47
- backgroundImage: `linear-gradient(90deg, rgba(${e}, 0) 0%, rgba(${e}, 0.2) 20%, rgba(${e}, 0.5) 60%, rgba(${e}, 0))`
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 : p[this.type];
56
+ return this.cssClass ? this.cssClass : LOADER_CSS_CLASSES[this.type];
52
57
  }
53
58
  }
54
59
  });
55
- function S(e, t, s, b, C, y) {
56
- return o(), n("div", {
57
- class: i([e.bgClass, e.loaderClass, "relative overflow-hidden"])
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
- c("div", {
64
+ createElementVNode("div", {
60
65
  class: "shimmer absolute bottom-0 left-0 right-0 top-0",
61
- style: d(e.shimmerStyle)
66
+ style: normalizeStyle(_ctx.shimmerStyle)
62
67
  }, null, 4),
63
- m(e.$slots, "default", {}, void 0, !0)
68
+ renderSlot(_ctx.$slots, "default", {}, void 0, true)
64
69
  ], 2);
65
70
  }
66
- const v = /* @__PURE__ */ g(h, [["render", S], ["__scopeId", "data-v-53e537dc"]]);
71
+ const PSkeletonLoader = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-53e537dc"]]);
67
72
  export {
68
- v as default
73
+ PSkeletonLoader as default
69
74
  };
@@ -1,21 +1,21 @@
1
- import { defineComponent as t, openBlock as r, createElementBlock as o, mergeProps as a } from "vue";
2
- import { _ as n } from "./chunks/_plugin-vue_export-helper.js";
3
- const s = t({
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: !1,
5
+ inheritAttrs: false,
6
6
  props: {
7
7
  active: {
8
8
  type: Boolean,
9
- default: !1
9
+ default: false
10
10
  }
11
11
  }
12
12
  });
13
- function c(e, i, l, p, f, d) {
14
- return r(), o("div", a({
15
- class: ["h-5 w-5 shrink-0 cursor-pointer filter", { active: e.active }]
16
- }, e.$attrs), null, 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 u = /* @__PURE__ */ n(s, [["render", c], ["__scopeId", "data-v-cbac2434"]]);
18
+ const PTableFilterIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-cbac2434"]]);
19
19
  export {
20
- u as default
20
+ PTableFilterIcon as default
21
21
  };
@@ -1,12 +1,13 @@
1
- import p from "./p-info-icon.js";
2
- import f from "./p-table-filter-icon.js";
3
- import { defineComponent as d, resolveComponent as l, openBlock as t, createElementBlock as n, createElementVNode as m, normalizeClass as i, toDisplayString as u, createBlock as v, createCommentVNode as r, createVNode as T } from "vue";
4
- import { _ as C } from "./chunks/_plugin-vue_export-helper.js";
5
- const I = "text-xs leading-5 font-bold uppercase truncate shrink", k = d({
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: f,
9
- PInfoIcon: p
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: !1
23
+ default: false
23
24
  },
24
25
  showFilterIcon: {
25
26
  type: Boolean,
26
- default: !1
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: I
37
+ DEFAULT_CLASSES
37
38
  };
38
39
  }
39
- }), S = { class: "flex items-center overflow-hidden" }, h = ["title"], y = {
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 A(e, o, b, x, P, F) {
44
- const a = l("PInfoIcon"), s = l("PTableFilterIcon");
45
- return t(), n("div", S, [
46
- m("div", {
47
- class: i([
48
- e.DEFAULT_CLASSES,
49
- e.textClass,
50
- e.filterActive ? "text-active-blue" : "text-p-purple-60",
51
- { "mr-auto": !e.tooltipText }
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: e.text
54
- }, u(e.text), 11, h),
55
- e.tooltipText ? (t(), n("div", y, [
56
- e.tooltipText ? (t(), v(a, {
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: e.tooltipText
59
- }, null, 8, ["text"])) : r("", !0)
60
- ])) : r("", !0),
61
- T(s, {
62
- class: i(["ml-2", { hidden: !e.showFilterIcon }]),
63
- active: e.filterActive,
64
- onClick: o[0] || (o[0] = (c) => e.$emit("click-filter-icon", c, e.filterActive))
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 $ = /* @__PURE__ */ C(k, [["render", A]]);
73
+ const PTableHeaderCell = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
69
74
  export {
70
- $ as default
75
+ PTableHeaderCell as default
71
76
  };
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/p-table-loader.js";
1
+ import { _ as _sfc_main } from "./chunks/p-table-loader.js";
2
2
  export {
3
- f as default
3
+ _sfc_main as default
4
4
  };
@@ -1,8 +1,8 @@
1
- const e = Object.freeze({
1
+ const SORTING_TYPES = Object.freeze({
2
2
  NO_SORTING: "noSorting",
3
3
  ASC: "asc",
4
4
  DESC: "desc"
5
5
  });
6
6
  export {
7
- e as SORTING_TYPES
7
+ SORTING_TYPES
8
8
  };
@@ -1,42 +1,89 @@
1
- import { defineComponent as I, inject as r, ref as a, computed as t, openBlock as h, createElementBlock as v, Fragment as _, createElementVNode as d, mergeProps as F, normalizeClass as w, renderSlot as j, unref as x, createCommentVNode as S, pushScopeId as k, popScopeId as z } from "vue";
2
- import { colsInjectionKey as L, isFirstColFixedInjectionKey as T, isLastColFixedInjectionKey as B, isColsResizableInjectionKey as E } from "./p-table.js";
3
- import { _ as K } from "./chunks/_plugin-vue_export-helper.js";
4
- const N = (l) => (k("data-v-50608a90"), l = l(), z(), l), P = /* @__PURE__ */ N(() => /* @__PURE__ */ d("div", { class: "dropdown-anchor" }, null, -1)), R = {
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
- }, V = /* @__PURE__ */ I({
8
- name: "PTableTd",
9
- inheritAttrs: !1,
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: !1 },
14
- isSelected: { type: Boolean, default: !1 }
15
+ isEditable: { type: Boolean, default: false },
16
+ isSelected: { type: Boolean, default: false }
15
17
  },
16
- setup(l) {
17
- const s = l, p = r(L, a([])), i = r(T, a(!1)), o = r(B, a(!1)), b = r(E, a(!1)), u = t(() => s.colIndex === 0), m = t(() => s.colIndex === 1), C = t(() => s.colIndex === p.value.length - 2), n = t(() => s.colIndex === p.value.length - 1), g = t(() => {
18
- const e = [
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
- return s.isEditable && e.push("cursor-pointer"), i.value && u.value ? (e.push("td-col-fixed-border-b"), e.push("first:sticky first:left-0 first:z-10")) : o.value && n.value ? e.push("td-col-fixed-border-b", "last:sticky last:right-0 last:z-10") : e.push("border-b border-p-gray-30"), s.isSelected ? e.push("bg-p-blue-15 group-hover/row:bg-p-blue-15") : e.push("bg-white group-hover/row:bg-p-blue-10"), e;
23
- }), y = t(() => {
24
- const e = ["py-2"], c = i.value && u.value, f = o.value && n.value;
25
- return !c && !f && e.push("w-max"), c ? e.push("td-shadow-right flex flex-col h-full justify-center px-3") : f ? e.push("td-shadow-left flex flex-col h-full justify-center px-3") : i.value && m.value ? e.push("pl-4 pr-2") : o.value && C.value ? e.push("pr-4 pl-2") : e.push("px-2"), e;
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 (e, c) => (h(), v(_, null, [
28
- d("td", F({ class: g.value }, e.$attrs), [
29
- P,
30
- d("div", {
31
- class: w(y.value)
32
- }, [
33
- j(e.$slots, "default", {}, void 0, !0)
34
- ], 2)
35
- ], 16),
36
- x(b) && n.value && !x(o) ? (h(), v("td", R)) : S("", !0)
37
- ], 64));
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
- }), q = /* @__PURE__ */ K(V, [["__scopeId", "data-v-50608a90"]]);
85
+ });
86
+ const pTableTd = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-50608a90"]]);
40
87
  export {
41
- q as default
88
+ pTableTd as default
42
89
  };
@@ -1,8 +1,12 @@
1
- const o = Symbol("cols"), s = Symbol("isFirstColFixed"), i = Symbol("isLastColFixed"), e = Symbol("isColsResizable"), l = 80;
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
- l as MIN_WIDTH_COL_RESIZE,
4
- o as colsInjectionKey,
5
- e as isColsResizableInjectionKey,
6
- s as isFirstColFixedInjectionKey,
7
- i as isLastColFixedInjectionKey
7
+ MIN_WIDTH_COL_RESIZE,
8
+ colsInjectionKey,
9
+ isColsResizableInjectionKey,
10
+ isFirstColFixedInjectionKey,
11
+ isLastColFixedInjectionKey
8
12
  };
package/dist/es/p-tabs.js CHANGED
@@ -1,4 +1,4 @@
1
- import { _ as f } from "./chunks/p-tabs.js";
1
+ import { _ as _sfc_main } from "./chunks/p-tabs.js";
2
2
  export {
3
- f as default
3
+ _sfc_main as default
4
4
  };