@pequity/squirrel 1.0.20 → 1.0.21

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 (146) hide show
  1. package/dist/cjs/chunks/_plugin-vue_export-helper.js +9 -0
  2. package/dist/cjs/chunks/p-action-bar.js +60 -0
  3. package/dist/cjs/chunks/p-card.js +28 -0
  4. package/dist/cjs/chunks/p-checkbox.js +24 -0
  5. package/dist/cjs/chunks/p-dropdown-select.js +414 -0
  6. package/dist/cjs/chunks/p-input-percent.js +53 -0
  7. package/dist/cjs/chunks/p-pagination-info.js +66 -0
  8. package/dist/cjs/chunks/p-pagination.js +122 -0
  9. package/dist/cjs/chunks/p-ring-loader.js +81 -0
  10. package/dist/cjs/chunks/p-select-btn.js +97 -0
  11. package/dist/cjs/chunks/p-select.js +123 -0
  12. package/dist/cjs/chunks/p-table-loader.js +70 -0
  13. package/dist/cjs/chunks/p-tabs.js +52 -0
  14. package/dist/cjs/config.js +105 -0
  15. package/dist/cjs/currency.js +9 -0
  16. package/dist/cjs/dom.js +27 -0
  17. package/dist/cjs/index.js +976 -0
  18. package/dist/cjs/inputClassesMixin.js +50 -0
  19. package/dist/cjs/inputClassesShared.js +76 -0
  20. package/dist/cjs/listKeyboardNavigation.js +110 -0
  21. package/dist/cjs/number.js +9 -0
  22. package/dist/cjs/object.js +4 -0
  23. package/dist/cjs/p-action-bar.js +3 -0
  24. package/dist/cjs/p-alert.js +65 -0
  25. package/dist/cjs/p-avatar.js +71 -0
  26. package/dist/cjs/p-btn.js +361 -0
  27. package/dist/cjs/p-card.js +3 -0
  28. package/dist/cjs/p-checkbox.js +3 -0
  29. package/dist/cjs/p-chips.js +110 -0
  30. package/dist/cjs/p-close-btn.js +36 -0
  31. package/dist/cjs/p-date-picker.js +139 -0
  32. package/dist/cjs/p-drawer.js +253 -0
  33. package/dist/cjs/p-dropdown-select.js +3 -0
  34. package/dist/cjs/p-dropdown.js +138 -0
  35. package/dist/cjs/p-file-upload.js +21 -0
  36. package/dist/cjs/p-info-icon.js +35 -0
  37. package/dist/cjs/p-inline-date-picker.js +142 -0
  38. package/dist/cjs/p-input-number.js +146 -0
  39. package/dist/cjs/p-input-percent.js +3 -0
  40. package/dist/cjs/p-input-search.js +110 -0
  41. package/dist/cjs/p-input.js +89 -0
  42. package/dist/cjs/p-loading.js +38 -0
  43. package/dist/cjs/p-modal.js +369 -0
  44. package/dist/cjs/p-pagination-info.js +3 -0
  45. package/dist/cjs/p-pagination.js +3 -0
  46. package/dist/cjs/p-progress-bar.js +41 -0
  47. package/dist/cjs/p-ring-loader.js +3 -0
  48. package/dist/cjs/p-select-btn.js +3 -0
  49. package/dist/cjs/p-select-list.js +4 -0
  50. package/dist/cjs/p-select-pill.js +111 -0
  51. package/dist/cjs/p-select.js +3 -0
  52. package/dist/cjs/p-skeleton-loader.js +73 -0
  53. package/dist/cjs/p-table-filter-icon.js +20 -0
  54. package/dist/cjs/p-table-header-cell.js +75 -0
  55. package/dist/cjs/p-table-loader.js +3 -0
  56. package/dist/cjs/p-table-sort.js +8 -0
  57. package/dist/cjs/p-table-td.js +88 -0
  58. package/dist/cjs/p-table.js +12 -0
  59. package/dist/cjs/p-tabs.js +3 -0
  60. package/dist/cjs/p-textarea.js +73 -0
  61. package/dist/cjs/p-toggle.js +114 -0
  62. package/dist/cjs/pagination.js +29 -0
  63. package/dist/cjs/string.js +12 -0
  64. package/dist/cjs/tailwind.js +4353 -0
  65. package/dist/cjs/text.js +16 -0
  66. package/dist/cjs/useInputClasses.js +44 -0
  67. package/dist/cjs/usePLoading.js +35 -0
  68. package/dist/cjs/usePModal.js +21 -0
  69. package/dist/cjs/usePTableColResize.js +81 -0
  70. package/dist/cjs/usePTableRowVirtualizer.js +31 -0
  71. package/dist/cjs/useSelectList.js +256 -0
  72. package/dist/es/chunks/_plugin-vue_export-helper.js +10 -0
  73. package/dist/es/chunks/p-action-bar.js +61 -0
  74. package/dist/es/chunks/p-card.js +29 -0
  75. package/dist/es/chunks/p-checkbox.js +25 -0
  76. package/dist/es/chunks/p-dropdown-select.js +415 -0
  77. package/dist/es/chunks/p-input-percent.js +54 -0
  78. package/dist/es/chunks/p-pagination-info.js +67 -0
  79. package/dist/es/chunks/p-pagination.js +123 -0
  80. package/dist/es/chunks/p-ring-loader.js +82 -0
  81. package/dist/es/chunks/p-select-btn.js +98 -0
  82. package/dist/es/chunks/p-select.js +124 -0
  83. package/dist/es/chunks/p-table-loader.js +71 -0
  84. package/dist/es/chunks/p-tabs.js +53 -0
  85. package/dist/es/config.js +105 -0
  86. package/dist/es/currency.js +9 -0
  87. package/dist/es/dom.js +27 -0
  88. package/dist/es/index.js +978 -0
  89. package/dist/es/inputClassesMixin.js +51 -0
  90. package/dist/es/inputClassesShared.js +76 -0
  91. package/dist/es/listKeyboardNavigation.js +110 -0
  92. package/dist/es/number.js +9 -0
  93. package/dist/es/object.js +4 -0
  94. package/dist/es/p-action-bar.js +4 -0
  95. package/dist/es/p-alert.js +66 -0
  96. package/dist/es/p-avatar.js +72 -0
  97. package/dist/es/p-btn.js +362 -0
  98. package/dist/es/p-card.js +4 -0
  99. package/dist/es/p-checkbox.js +4 -0
  100. package/dist/es/p-chips.js +111 -0
  101. package/dist/es/p-close-btn.js +37 -0
  102. package/dist/es/p-date-picker.js +140 -0
  103. package/dist/es/p-drawer.js +254 -0
  104. package/dist/es/p-dropdown-select.js +4 -0
  105. package/dist/es/p-dropdown.js +139 -0
  106. package/dist/es/p-file-upload.js +21 -0
  107. package/dist/es/p-info-icon.js +36 -0
  108. package/dist/es/p-inline-date-picker.js +143 -0
  109. package/dist/es/p-input-number.js +147 -0
  110. package/dist/es/p-input-percent.js +4 -0
  111. package/dist/es/p-input-search.js +111 -0
  112. package/dist/es/p-input.js +90 -0
  113. package/dist/es/p-loading.js +39 -0
  114. package/dist/es/p-modal.js +370 -0
  115. package/dist/es/p-pagination-info.js +4 -0
  116. package/dist/es/p-pagination.js +4 -0
  117. package/dist/es/p-progress-bar.js +42 -0
  118. package/dist/es/p-ring-loader.js +4 -0
  119. package/dist/es/p-select-btn.js +4 -0
  120. package/dist/es/p-select-list.js +4 -0
  121. package/dist/es/p-select-pill.js +112 -0
  122. package/dist/es/p-select.js +4 -0
  123. package/dist/es/p-skeleton-loader.js +74 -0
  124. package/dist/es/p-table-filter-icon.js +21 -0
  125. package/dist/es/p-table-header-cell.js +76 -0
  126. package/dist/es/p-table-loader.js +4 -0
  127. package/dist/es/p-table-sort.js +8 -0
  128. package/dist/es/p-table-td.js +89 -0
  129. package/dist/es/p-table.js +12 -0
  130. package/dist/es/p-tabs.js +4 -0
  131. package/dist/es/p-textarea.js +74 -0
  132. package/dist/es/p-toggle.js +115 -0
  133. package/dist/es/pagination.js +29 -0
  134. package/dist/es/string.js +12 -0
  135. package/dist/es/tailwind.js +4353 -0
  136. package/dist/es/text.js +16 -0
  137. package/dist/es/useInputClasses.js +44 -0
  138. package/dist/es/usePLoading.js +35 -0
  139. package/dist/es/usePModal.js +21 -0
  140. package/dist/es/usePTableColResize.js +81 -0
  141. package/dist/es/usePTableRowVirtualizer.js +31 -0
  142. package/dist/es/useSelectList.js +256 -0
  143. package/dist/style.css +2124 -1
  144. package/package.json +26 -24
  145. package/dist/squirrel.cjs.js +0 -5
  146. package/dist/squirrel.es.js +0 -8220
@@ -0,0 +1,122 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const pSkeletonLoader = require("../p-skeleton-loader.js");
4
+ const pagination = require("../pagination.js");
5
+ const _imports_0 = "data:image/svg+xml,%3csvg%20width='8'%20height='12'%20viewBox='0%200%208%2012'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M0.25%205.99968C0.25%205.64968%200.4%205.34968%200.65%205.14968L6.25%200.249681C6.65%20-0.100319%207.2%20-0.0503187%207.55%200.349681C7.85%200.749681%207.85%201.29968%207.45%201.59968L2.55%205.89968C2.5%205.94968%202.5%205.99968%202.55%206.04968L7.45%2010.3497C7.85%2010.6997%207.9%2011.2497%207.55%2011.6497C7.2%2012.0497%206.65%2012.0997%206.25%2011.7497C6.25%2011.7497%206.25%2011.7497%206.2%2011.6997L0.65%206.84968C0.4%206.64968%200.25%206.29968%200.25%205.99968Z'%20fill='%23918da1'%20/%3e%3c/svg%3e";
6
+ const _imports_1 = "data:image/svg+xml,%3csvg%20width='8'%20height='14'%20viewBox='0%200%208%2014'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M7.75695%206.98136C7.75695%207.33136%207.60695%207.63136%207.35695%207.83136L1.75695%2012.7814C1.35695%2013.1314%200.756947%2013.0814%200.456947%2012.6814C0.156947%2012.2814%200.156947%2011.7314%200.556947%2011.3814L5.45695%207.08136C5.50695%207.03136%205.50695%206.98136%205.45695%206.88136L0.556947%202.58136C0.156947%202.23136%200.156947%201.63136%200.506947%201.28136C0.856947%200.931361%201.40695%200.881361%201.80695%201.18136L7.40695%206.08136C7.60695%206.33136%207.75695%206.63136%207.75695%206.98136Z'%20fill='%23918da1'%20/%3e%3c/svg%3e";
7
+ const _hoisted_1 = {
8
+ key: 1,
9
+ class: "flex text-p-gray-40"
10
+ };
11
+ const _hoisted_2 = /* @__PURE__ */ vue.createElementVNode("img", { src: _imports_0 }, null, -1);
12
+ const _hoisted_3 = [
13
+ _hoisted_2
14
+ ];
15
+ const _hoisted_4 = ["onClick"];
16
+ const _hoisted_5 = { class: "flex" };
17
+ const _hoisted_6 = ["aria-label"];
18
+ const _hoisted_7 = /* @__PURE__ */ vue.createElementVNode("img", { src: _imports_1 }, null, -1);
19
+ const _hoisted_8 = [
20
+ _hoisted_7
21
+ ];
22
+ const DOTS = "...";
23
+ const BTN_CLASS = "w-6 h-6 flex justify-center items-center mx-1 font-semibold text-sm leading-none";
24
+ const BTN_ACTIVE_CLASS = "text-p-purple-60 bg-p-gray-30 rounded-lg";
25
+ const BTN_INACTIVE_CLASS = "cursor-pointer";
26
+ const ARROW_ACTIVE_CLASS = "cursor-pointer";
27
+ const ARROW_INACTIVE_CLASS = "opacity-50";
28
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
29
+ ...{ name: "PPagination" },
30
+ __name: "p-pagination",
31
+ props: {
32
+ /**
33
+ * The current page.
34
+ */
35
+ modelValue: {
36
+ type: Number,
37
+ default: null
38
+ },
39
+ /**
40
+ * The amount of data pagination should iterate through.
41
+ */
42
+ count: {
43
+ type: Number,
44
+ default: 0
45
+ },
46
+ /**
47
+ * The amount of data to be displayed at 1 page. Used to calculate the length of pagination.
48
+ */
49
+ pageSize: {
50
+ type: Number,
51
+ default: 10
52
+ },
53
+ /**
54
+ * The amount of pages to be displayed before and after the current page.
55
+ */
56
+ pageOffset: {
57
+ type: Number,
58
+ default: 2
59
+ },
60
+ /**
61
+ * Whether the pagination is loading.
62
+ */
63
+ loading: {
64
+ type: Boolean,
65
+ default: false
66
+ }
67
+ },
68
+ emits: ["update:modelValue"],
69
+ setup(__props, { emit: __emit }) {
70
+ const emit = __emit;
71
+ const props = __props;
72
+ const pageCount = vue.computed(() => {
73
+ return props.count && Math.ceil(props.count / props.pageSize);
74
+ });
75
+ const pages = vue.computed(() => {
76
+ return pagination.createPagingRange(Number(props.modelValue), pageCount.value, props.pageOffset, DOTS);
77
+ });
78
+ const setPage = (page) => {
79
+ if (page >= 1 && page <= pageCount.value) {
80
+ emit("update:modelValue", page);
81
+ }
82
+ };
83
+ return (_ctx, _cache) => {
84
+ return vue.openBlock(), vue.createElementBlock(vue.Fragment, null, [
85
+ __props.loading ? (vue.openBlock(), vue.createBlock(pSkeletonLoader, {
86
+ key: 0,
87
+ class: "h-6 w-56"
88
+ })) : vue.createCommentVNode("", true),
89
+ !__props.loading && pages.value.length > 1 ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
90
+ vue.createElementVNode("div", {
91
+ class: vue.normalizeClass([BTN_CLASS, Number(__props.modelValue) <= 1 ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
92
+ "aria-label": "go to the previous page",
93
+ onClick: _cache[0] || (_cache[0] = ($event) => setPage(Number(__props.modelValue) - 1))
94
+ }, _hoisted_3, 2),
95
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(pages.value, (page, index) => {
96
+ return vue.openBlock(), vue.createElementBlock("div", {
97
+ key: index,
98
+ onClick: ($event) => setPage(Number(page))
99
+ }, [
100
+ vue.createElementVNode("div", _hoisted_5, [
101
+ page !== DOTS ? (vue.openBlock(), vue.createElementBlock("div", {
102
+ key: 0,
103
+ class: vue.normalizeClass([BTN_CLASS, page === __props.modelValue ? BTN_ACTIVE_CLASS : BTN_INACTIVE_CLASS]),
104
+ "aria-label": `go to page ${page}`
105
+ }, vue.toDisplayString(page), 11, _hoisted_6)) : (vue.openBlock(), vue.createElementBlock("div", {
106
+ key: 1,
107
+ class: vue.normalizeClass(BTN_CLASS)
108
+ }, vue.toDisplayString(DOTS)))
109
+ ])
110
+ ], 8, _hoisted_4);
111
+ }), 128)),
112
+ vue.createElementVNode("div", {
113
+ class: vue.normalizeClass([BTN_CLASS, __props.modelValue === pageCount.value ? ARROW_INACTIVE_CLASS : ARROW_ACTIVE_CLASS]),
114
+ "aria-label": "go to the next page",
115
+ onClick: _cache[1] || (_cache[1] = ($event) => setPage(Number(__props.modelValue) + 1))
116
+ }, _hoisted_8, 2)
117
+ ])) : vue.createCommentVNode("", true)
118
+ ], 64);
119
+ };
120
+ }
121
+ });
122
+ exports._sfc_main = _sfc_main;
@@ -0,0 +1,81 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const tailwind = require("../tailwind.js");
4
+ const INNER_DIV_CLASS = "block animate-spin absolute box-border rounded-full w-4/5 h-4/5 m-[10%]";
5
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
6
+ ...{
7
+ name: "PRingLoader"
8
+ },
9
+ __name: "p-ring-loader",
10
+ props: {
11
+ size: {
12
+ type: Number,
13
+ default: 80
14
+ },
15
+ color: {
16
+ type: String,
17
+ default: tailwind.getColor("primary")
18
+ },
19
+ duration: {
20
+ type: String,
21
+ default: "1.2s",
22
+ validator(value) {
23
+ const res = /^\d*\.?\d+(s|ms)$/;
24
+ return res.test(value);
25
+ }
26
+ }
27
+ },
28
+ setup(__props) {
29
+ const calcPropertyValue = (propName, originalValue, modificator) => {
30
+ var _a, _b;
31
+ const computedStyle = {};
32
+ const timeQuantityOuter = (_a = originalValue.match(/^\d*\.?\d+/)) == null ? void 0 : _a[0];
33
+ const timeUnit = ((_b = originalValue.match(/s|(ms)$/)) == null ? void 0 : _b[0]) || "s";
34
+ const timeQuantityInner = Math.round(Number(timeQuantityOuter) * 1e3 * modificator) / 1e3;
35
+ computedStyle[propName] = timeQuantityInner + timeUnit;
36
+ return computedStyle;
37
+ };
38
+ const props = __props;
39
+ const spinnerStyle = vue.computed(() => {
40
+ return {
41
+ borderWidth: `${props.size * 0.1}px`,
42
+ borderColor: `${props.color} transparent transparent transparent`,
43
+ animationDuration: props.duration,
44
+ animationTimingFunction: "cubic-bezier(0.5, 0, 0.5, 1)"
45
+ };
46
+ });
47
+ const animDiv1 = vue.computed(() => {
48
+ return calcPropertyValue("animationDelay", props.duration, -0.375);
49
+ });
50
+ const animDiv2 = vue.computed(() => {
51
+ return calcPropertyValue("animationDelay", props.duration, -0.25);
52
+ });
53
+ const animDiv3 = vue.computed(() => {
54
+ return calcPropertyValue("animationDelay", props.duration, -0.125);
55
+ });
56
+ return (_ctx, _cache) => {
57
+ return vue.openBlock(), vue.createElementBlock("div", {
58
+ class: "relative inline-block",
59
+ style: vue.normalizeStyle({ width: `${__props.size}px`, height: `${__props.size}px` })
60
+ }, [
61
+ vue.createElementVNode("div", {
62
+ class: vue.normalizeClass(INNER_DIV_CLASS),
63
+ style: vue.normalizeStyle([spinnerStyle.value, animDiv1.value])
64
+ }, null, 4),
65
+ vue.createElementVNode("div", {
66
+ class: vue.normalizeClass(INNER_DIV_CLASS),
67
+ style: vue.normalizeStyle([spinnerStyle.value, animDiv2.value])
68
+ }, null, 4),
69
+ vue.createElementVNode("div", {
70
+ class: vue.normalizeClass(INNER_DIV_CLASS),
71
+ style: vue.normalizeStyle([spinnerStyle.value, animDiv3.value])
72
+ }, null, 4),
73
+ vue.createElementVNode("div", {
74
+ class: vue.normalizeClass(INNER_DIV_CLASS),
75
+ style: vue.normalizeStyle([spinnerStyle.value])
76
+ }, null, 4)
77
+ ], 4);
78
+ };
79
+ }
80
+ });
81
+ exports._sfc_main = _sfc_main;
@@ -0,0 +1,97 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const pBtn = require("../p-btn.js");
4
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
5
+ ...{
6
+ name: "PBtnGroup"
7
+ },
8
+ __name: "p-select-btn",
9
+ props: {
10
+ modelValue: { default: null },
11
+ items: { default: () => [] },
12
+ itemValue: { default: "value" },
13
+ itemText: { default: "text" },
14
+ itemTooltipText: { default: "text" },
15
+ size: { default: "md" },
16
+ showTooltip: { type: Boolean, default: false },
17
+ highlightSelected: { type: Boolean, default: true },
18
+ grow: { type: Boolean, default: false },
19
+ multiple: { type: Boolean, default: false },
20
+ noPadding: { type: Boolean, default: false }
21
+ },
22
+ emits: ["update:modelValue"],
23
+ setup(__props, { emit: __emit }) {
24
+ const emit = __emit;
25
+ const props = __props;
26
+ const tooltipText = (item) => {
27
+ return props.showTooltip ? item[props.itemTooltipText] : "";
28
+ };
29
+ const select = (item) => {
30
+ if (!props.multiple) {
31
+ emit("update:modelValue", item[props.itemValue]);
32
+ } else {
33
+ if (Array.isArray(props.modelValue)) {
34
+ const val = item[props.itemValue];
35
+ const index = props.modelValue.findIndex((i) => i[props.itemValue] === val);
36
+ if (index !== -1) {
37
+ emit(
38
+ "update:modelValue",
39
+ props.modelValue.filter((i) => i[props.itemValue] !== val)
40
+ );
41
+ } else {
42
+ emit("update:modelValue", [...props.modelValue, item]);
43
+ }
44
+ } else {
45
+ emit("update:modelValue", [item]);
46
+ }
47
+ }
48
+ };
49
+ const isSelected = (item) => {
50
+ if (!props.multiple) {
51
+ return props.modelValue === item[props.itemValue];
52
+ } else {
53
+ if (Array.isArray(props.modelValue)) {
54
+ const index = props.modelValue.findIndex((i) => i[props.itemValue] === item[props.itemValue]);
55
+ return index !== -1;
56
+ }
57
+ }
58
+ };
59
+ return (_ctx, _cache) => {
60
+ const _directive_tooltip = vue.resolveDirective("tooltip");
61
+ return vue.openBlock(), vue.createElementBlock("div", {
62
+ class: vue.normalizeClass({ flex: _ctx.grow, "*:px-0 *:py-0": _ctx.noPadding })
63
+ }, [
64
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.items, (item, index) => {
65
+ return vue.withDirectives((vue.openBlock(), vue.createBlock(pBtn, {
66
+ key: item[_ctx.itemValue],
67
+ size: _ctx.size,
68
+ type: "secondary-outline-blue",
69
+ disabled: item.disabled,
70
+ class: vue.normalizeClass({
71
+ "rounded-none": index !== 0 && index !== _ctx.items.length - 1,
72
+ "rounded-br-none rounded-tr-none": index === 0,
73
+ "rounded-bl-none rounded-tl-none": index === _ctx.items.length - 1,
74
+ "-mr-0.5": index !== _ctx.items.length - 1,
75
+ "flex-1": _ctx.grow
76
+ }),
77
+ selected: isSelected(item) && _ctx.highlightSelected,
78
+ onClick: ($event) => select(item)
79
+ }, {
80
+ default: vue.withCtx(() => [
81
+ vue.renderSlot(_ctx.$slots, `btn-${index}`, {
82
+ item,
83
+ isSelected: isSelected(item)
84
+ }, () => [
85
+ vue.createTextVNode(vue.toDisplayString(item[_ctx.itemText]), 1)
86
+ ])
87
+ ]),
88
+ _: 2
89
+ }, 1032, ["size", "disabled", "class", "selected", "onClick"])), [
90
+ [_directive_tooltip, { content: tooltipText(item) }]
91
+ ]);
92
+ }), 128))
93
+ ], 2);
94
+ };
95
+ }
96
+ });
97
+ exports._sfc_main = _sfc_main;
@@ -0,0 +1,123 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const inputClassesShared = require("../inputClassesShared.js");
4
+ const useInputClasses = require("../useInputClasses.js");
5
+ const _hoisted_1 = ["data-has-error"];
6
+ const _hoisted_2 = ["value"];
7
+ const _hoisted_3 = ["value"];
8
+ const nullValue = "___null_value___";
9
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
+ ...{
11
+ name: "PSelect",
12
+ inheritAttrs: false
13
+ },
14
+ __name: "p-select",
15
+ props: {
16
+ modelValue: {
17
+ type: [String, Number, Boolean, null],
18
+ default: ""
19
+ },
20
+ items: {
21
+ type: Array,
22
+ default: () => []
23
+ },
24
+ label: {
25
+ type: String,
26
+ default: ""
27
+ },
28
+ errorMsg: {
29
+ type: String,
30
+ default: ""
31
+ },
32
+ required: {
33
+ type: Boolean,
34
+ default: false
35
+ },
36
+ size: {
37
+ type: String,
38
+ default: "md",
39
+ validator(value) {
40
+ return Object.keys(inputClassesShared.INPUT_SIZES).includes(value);
41
+ }
42
+ },
43
+ itemText: {
44
+ type: String,
45
+ default: "text"
46
+ },
47
+ itemValue: {
48
+ type: [String, Number, Boolean, null],
49
+ default: "value"
50
+ }
51
+ },
52
+ emits: ["update:modelValue"],
53
+ setup(__props, { emit: __emit }) {
54
+ const emit = __emit;
55
+ const props = __props;
56
+ const $attrs = vue.useAttrs();
57
+ const { labelClasses, selectClasses, errorMsgClasses } = useInputClasses.useInputClasses(props);
58
+ const innerValue = vue.computed({
59
+ get: () => {
60
+ if (props.modelValue === null) {
61
+ return nullValue;
62
+ }
63
+ return props.modelValue;
64
+ },
65
+ set: (v) => emit("update:modelValue", v)
66
+ });
67
+ const attrs = vue.computed(() => {
68
+ const { class: classes, style: style2, ...rest } = $attrs;
69
+ return rest;
70
+ });
71
+ const style = vue.computed(() => $attrs.style);
72
+ const innerOptions = vue.computed(() => {
73
+ return props.items.map((item) => {
74
+ return {
75
+ value: item[props.itemValue] === null ? nullValue : item[props.itemValue],
76
+ text: item[props.itemText]
77
+ };
78
+ });
79
+ });
80
+ const onChange = (e) => {
81
+ const value = e.target.value;
82
+ if (value === nullValue) {
83
+ emit("update:modelValue", null);
84
+ return;
85
+ }
86
+ emit("update:modelValue", ["true", "false"].includes(value) ? value === "true" : value);
87
+ };
88
+ return (_ctx, _cache) => {
89
+ return vue.openBlock(), vue.createElementBlock("div", {
90
+ class: vue.normalizeClass([{ hidden: vue.unref($attrs).hidden }, vue.unref($attrs).class]),
91
+ "data-has-error": !!__props.errorMsg,
92
+ style: vue.normalizeStyle(style.value)
93
+ }, [
94
+ vue.renderSlot(_ctx.$slots, "label", {
95
+ label: __props.label,
96
+ labelClasses: vue.unref(labelClasses)
97
+ }, () => [
98
+ __props.label ? (vue.openBlock(), vue.createElementBlock("label", {
99
+ key: 0,
100
+ class: vue.normalizeClass(vue.unref(labelClasses))
101
+ }, vue.toDisplayString(__props.label), 3)) : vue.createCommentVNode("", true)
102
+ ]),
103
+ vue.createElementVNode("select", vue.mergeProps({ class: vue.unref(selectClasses) }, attrs.value, {
104
+ value: innerValue.value,
105
+ onChange
106
+ }), [
107
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(innerOptions.value, (o) => {
108
+ return vue.openBlock(), vue.createElementBlock("option", {
109
+ key: String(o.value),
110
+ value: o.value
111
+ }, vue.toDisplayString(o.text), 9, _hoisted_3);
112
+ }), 128))
113
+ ], 16, _hoisted_2),
114
+ vue.withDirectives(vue.createElementVNode("div", {
115
+ class: vue.normalizeClass(vue.unref(errorMsgClasses))
116
+ }, vue.toDisplayString(__props.errorMsg), 3), [
117
+ [vue.vShow, __props.errorMsg]
118
+ ])
119
+ ], 14, _hoisted_1);
120
+ };
121
+ }
122
+ });
123
+ exports._sfc_main = _sfc_main;
@@ -0,0 +1,70 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const pSkeletonLoader = require("../p-skeleton-loader.js");
4
+ const _hoisted_1 = { class: "block overflow-hidden border border-p-gray-30" };
5
+ const _hoisted_2 = { class: "mb-0 w-full bg-surface" };
6
+ const _hoisted_3 = { class: "relative border-b border-p-gray-30 px-4 py-2" };
7
+ const _hoisted_4 = { class: "skeleton-fade" };
8
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
9
+ ...{
10
+ name: "PTableLoader"
11
+ },
12
+ __name: "p-table-loader",
13
+ props: {
14
+ rows: {
15
+ type: [Number, String],
16
+ default: 4
17
+ },
18
+ columns: {
19
+ type: [Number, String],
20
+ default: 6
21
+ },
22
+ tdClasses: {
23
+ type: String,
24
+ default: "px-4 py-5"
25
+ },
26
+ tdSkeletonClasses: {
27
+ type: String,
28
+ default: "h-5"
29
+ }
30
+ },
31
+ setup(__props) {
32
+ return (_ctx, _cache) => {
33
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
34
+ vue.createElementVNode("table", _hoisted_2, [
35
+ vue.createElementVNode("thead", null, [
36
+ vue.createElementVNode("tr", null, [
37
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Number(__props.columns), (col) => {
38
+ return vue.openBlock(), vue.createElementBlock("th", {
39
+ key: col,
40
+ class: "bg-surface p-0"
41
+ }, [
42
+ vue.createElementVNode("div", _hoisted_3, [
43
+ vue.createVNode(pSkeletonLoader, { class: "h-5" })
44
+ ])
45
+ ]);
46
+ }), 128))
47
+ ])
48
+ ]),
49
+ vue.createElementVNode("tbody", _hoisted_4, [
50
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Number(__props.rows), (i) => {
51
+ return vue.openBlock(), vue.createElementBlock("tr", { key: i }, [
52
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(Number(__props.columns), (col) => {
53
+ return vue.openBlock(), vue.createElementBlock("td", {
54
+ key: col,
55
+ class: vue.normalizeClass([__props.tdClasses, "border-b border-p-blue-15"])
56
+ }, [
57
+ vue.createVNode(pSkeletonLoader, {
58
+ class: vue.normalizeClass(__props.tdSkeletonClasses)
59
+ }, null, 8, ["class"])
60
+ ], 2);
61
+ }), 128))
62
+ ]);
63
+ }), 128))
64
+ ])
65
+ ])
66
+ ]);
67
+ };
68
+ }
69
+ });
70
+ exports._sfc_main = _sfc_main;
@@ -0,0 +1,52 @@
1
+ "use strict";
2
+ const vue = require("vue");
3
+ const _hoisted_1 = { class: "flex items-center gap-2" };
4
+ const _hoisted_2 = { key: 0 };
5
+ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
6
+ __name: "p-tabs",
7
+ props: {
8
+ tabs: {
9
+ type: Array,
10
+ required: true
11
+ },
12
+ activeTab: {
13
+ type: String,
14
+ required: true
15
+ },
16
+ tabsLeftPadding: {
17
+ type: Number,
18
+ default: 0
19
+ }
20
+ },
21
+ emits: ["click:tab"],
22
+ setup(__props) {
23
+ return (_ctx, _cache) => {
24
+ return vue.openBlock(), vue.createElementBlock("div", {
25
+ class: "flex gap-4 border-b border-p-gray-30 text-base font-semibold",
26
+ style: vue.normalizeStyle({ paddingLeft: `${__props.tabsLeftPadding}px` })
27
+ }, [
28
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(__props.tabs, (tabData) => {
29
+ return vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tabData.to ? "RouterLink" : "div"), vue.mergeProps({
30
+ key: `tab-${tabData.name}`
31
+ }, tabData.to ? { to: tabData.to } : {}, {
32
+ class: [[__props.activeTab === tabData.name ? "border-primary text-primary" : "border-transparent text-p-gray-40"], "group cursor-pointer border-b-2 pb-3 hover:border-primary hover:text-primary"],
33
+ onClick: ($event) => _ctx.$emit("click:tab", tabData.name)
34
+ }), {
35
+ default: vue.withCtx(() => [
36
+ vue.createElementVNode("div", _hoisted_1, [
37
+ tabData.icon ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2, [
38
+ (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(tabData.icon), {
39
+ class: vue.normalizeClass(["group-hover:fill-primary", [__props.activeTab === tabData.name ? "fill-primary" : "fill-p-gray-40"]])
40
+ }, null, 8, ["class"]))
41
+ ])) : vue.createCommentVNode("", true),
42
+ vue.createElementVNode("div", null, vue.toDisplayString(tabData.title), 1)
43
+ ])
44
+ ]),
45
+ _: 2
46
+ }, 1040, ["class", "onClick"]);
47
+ }), 128))
48
+ ], 4);
49
+ };
50
+ }
51
+ });
52
+ exports._sfc_main = _sfc_main;
@@ -0,0 +1,105 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const config = {
4
+ content: ["./index.html", "./squirrel/**/*.{vue,js,ts,jsx,tsx,mdx}", "./src/**/*.{vue,js,ts,jsx,tsx,mdx}"],
5
+ theme: {
6
+ colors: {
7
+ transparent: "transparent",
8
+ current: "currentColor",
9
+ /* Design system colors */
10
+ white: "#fff",
11
+ black: "#000",
12
+ night: "var(--color-night)",
13
+ "barley-white": "var(--color-barley-white)",
14
+ "horses-neck": "var(--color-horses-neck)",
15
+ "active-blue": "var(--color-active-blue)",
16
+ /* Pequity colors */
17
+ "p-gray": {
18
+ 10: "var(--color-p-gray-10)",
19
+ 20: "var(--color-p-gray-20)",
20
+ 30: "var(--color-p-gray-30)",
21
+ 40: "var(--color-p-gray-40)",
22
+ 50: "var(--color-p-gray-50)",
23
+ 60: "var(--color-p-gray-60)",
24
+ 70: "var(--color-p-gray-70)",
25
+ 80: "var(--color-p-gray-80)",
26
+ 90: "var(--color-p-gray-90)",
27
+ 100: "var(--color-p-gray-100)"
28
+ },
29
+ "p-blue": {
30
+ 10: "var(--color-p-blue-10)",
31
+ 15: "var(--color-p-blue-15)",
32
+ 20: "var(--color-p-blue-20)",
33
+ 30: "var(--color-p-blue-30)",
34
+ 40: "var(--color-p-blue-40)",
35
+ 50: "var(--color-p-blue-50)",
36
+ 60: "var(--color-p-blue-60)",
37
+ 70: "var(--color-p-blue-70)",
38
+ 80: "var(--color-p-blue-80)"
39
+ },
40
+ "p-purple": {
41
+ 10: "var(--color-p-purple-10)",
42
+ 20: "var(--color-p-purple-20)",
43
+ 30: "var(--color-p-purple-30)",
44
+ 40: "var(--color-p-purple-40)",
45
+ 50: "var(--color-p-purple-50)",
46
+ 60: "var(--color-p-purple-60)"
47
+ },
48
+ "p-green": {
49
+ 10: "var(--color-p-green-10)",
50
+ 20: "var(--color-p-green-20)",
51
+ 30: "var(--color-p-green-30)",
52
+ 40: "var(--color-p-green-40)",
53
+ 50: "var(--color-p-green-50)"
54
+ },
55
+ "p-red": {
56
+ 10: "var(--color-p-red-10)",
57
+ 20: "var(--color-p-red-20)",
58
+ 30: "var(--color-p-red-30)",
59
+ 40: "var(--color-p-red-40)",
60
+ 50: "var(--color-p-red-50)"
61
+ },
62
+ /* Aliases */
63
+ primary: "var(--color-primary)",
64
+ accent: "var(--color-accent)",
65
+ surface: "var(--color-surface)",
66
+ "on-surface": "var(--color-on-surface)",
67
+ error: "var(--color-error)",
68
+ "on-error": "var(--color-on-error)",
69
+ info: "var(--color-info)",
70
+ "on-info": "var(--color-on-info)",
71
+ success: "var(--color-success)",
72
+ "on-success": "var(--color-on-success)",
73
+ warning: "var(--color-warning)",
74
+ "on-warning": "var(--color-on-warning)"
75
+ },
76
+ fontFamily: {
77
+ sans: ["Inter", "Helvetica", "Arial", "sans-serif"]
78
+ },
79
+ fontSize: {
80
+ xs: "0.75rem",
81
+ sm: "0.875rem",
82
+ base: "1rem",
83
+ lg: "1.125rem",
84
+ xl: "1.25rem",
85
+ "2xl": "1.5rem",
86
+ "3xl": "1.875rem",
87
+ "4xl": "2.25rem",
88
+ "5xl": "3rem",
89
+ "6xl": "4rem"
90
+ },
91
+ extend: {
92
+ borderColor: {
93
+ DEFAULT: "var(--color-p-gray-30)"
94
+ },
95
+ spacing: {
96
+ 7.5: "1.875rem"
97
+ },
98
+ zIndex: {
99
+ 110: "110"
100
+ },
101
+ screens: {}
102
+ }
103
+ }
104
+ };
105
+ exports.config = config;
@@ -0,0 +1,9 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
+ const CURRENCY_INPUT_DEFAULTS = Object.freeze({
4
+ currency: null,
5
+ precision: 0,
6
+ locale: "en-US",
7
+ allowNegative: false
8
+ });
9
+ exports.CURRENCY_INPUT_DEFAULTS = CURRENCY_INPUT_DEFAULTS;