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