@pequity/squirrel 1.0.20-beta.3 → 1.0.20

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (146) hide show
  1. package/dist/squirrel.cjs.js +5 -0
  2. package/dist/squirrel.es.js +8220 -0
  3. package/dist/style.css +1 -2124
  4. package/package.json +20 -22
  5. package/dist/cjs/chunks/_plugin-vue_export-helper.js +0 -9
  6. package/dist/cjs/chunks/p-action-bar.js +0 -60
  7. package/dist/cjs/chunks/p-card.js +0 -28
  8. package/dist/cjs/chunks/p-checkbox.js +0 -24
  9. package/dist/cjs/chunks/p-dropdown-select.js +0 -414
  10. package/dist/cjs/chunks/p-input-percent.js +0 -53
  11. package/dist/cjs/chunks/p-pagination-info.js +0 -66
  12. package/dist/cjs/chunks/p-pagination.js +0 -122
  13. package/dist/cjs/chunks/p-ring-loader.js +0 -81
  14. package/dist/cjs/chunks/p-select-btn.js +0 -97
  15. package/dist/cjs/chunks/p-select.js +0 -123
  16. package/dist/cjs/chunks/p-table-loader.js +0 -70
  17. package/dist/cjs/chunks/p-tabs.js +0 -52
  18. package/dist/cjs/config.js +0 -105
  19. package/dist/cjs/currency.js +0 -9
  20. package/dist/cjs/dom.js +0 -27
  21. package/dist/cjs/index.js +0 -976
  22. package/dist/cjs/inputClassesMixin.js +0 -50
  23. package/dist/cjs/inputClassesShared.js +0 -76
  24. package/dist/cjs/listKeyboardNavigation.js +0 -110
  25. package/dist/cjs/number.js +0 -9
  26. package/dist/cjs/object.js +0 -4
  27. package/dist/cjs/p-action-bar.js +0 -3
  28. package/dist/cjs/p-alert.js +0 -65
  29. package/dist/cjs/p-avatar.js +0 -71
  30. package/dist/cjs/p-btn.js +0 -361
  31. package/dist/cjs/p-card.js +0 -3
  32. package/dist/cjs/p-checkbox.js +0 -3
  33. package/dist/cjs/p-chips.js +0 -110
  34. package/dist/cjs/p-close-btn.js +0 -36
  35. package/dist/cjs/p-date-picker.js +0 -139
  36. package/dist/cjs/p-drawer.js +0 -253
  37. package/dist/cjs/p-dropdown-select.js +0 -3
  38. package/dist/cjs/p-dropdown.js +0 -138
  39. package/dist/cjs/p-file-upload.js +0 -21
  40. package/dist/cjs/p-info-icon.js +0 -35
  41. package/dist/cjs/p-inline-date-picker.js +0 -142
  42. package/dist/cjs/p-input-number.js +0 -146
  43. package/dist/cjs/p-input-percent.js +0 -3
  44. package/dist/cjs/p-input-search.js +0 -110
  45. package/dist/cjs/p-input.js +0 -89
  46. package/dist/cjs/p-loading.js +0 -38
  47. package/dist/cjs/p-modal.js +0 -369
  48. package/dist/cjs/p-pagination-info.js +0 -3
  49. package/dist/cjs/p-pagination.js +0 -3
  50. package/dist/cjs/p-progress-bar.js +0 -41
  51. package/dist/cjs/p-ring-loader.js +0 -3
  52. package/dist/cjs/p-select-btn.js +0 -3
  53. package/dist/cjs/p-select-list.js +0 -4
  54. package/dist/cjs/p-select-pill.js +0 -111
  55. package/dist/cjs/p-select.js +0 -3
  56. package/dist/cjs/p-skeleton-loader.js +0 -73
  57. package/dist/cjs/p-table-filter-icon.js +0 -20
  58. package/dist/cjs/p-table-header-cell.js +0 -75
  59. package/dist/cjs/p-table-loader.js +0 -3
  60. package/dist/cjs/p-table-sort.js +0 -8
  61. package/dist/cjs/p-table-td.js +0 -88
  62. package/dist/cjs/p-table.js +0 -12
  63. package/dist/cjs/p-tabs.js +0 -3
  64. package/dist/cjs/p-textarea.js +0 -73
  65. package/dist/cjs/p-toggle.js +0 -114
  66. package/dist/cjs/pagination.js +0 -29
  67. package/dist/cjs/string.js +0 -12
  68. package/dist/cjs/tailwind.js +0 -4353
  69. package/dist/cjs/text.js +0 -16
  70. package/dist/cjs/useInputClasses.js +0 -44
  71. package/dist/cjs/usePLoading.js +0 -35
  72. package/dist/cjs/usePModal.js +0 -21
  73. package/dist/cjs/usePTableColResize.js +0 -81
  74. package/dist/cjs/usePTableRowVirtualizer.js +0 -31
  75. package/dist/cjs/useSelectList.js +0 -256
  76. package/dist/es/chunks/_plugin-vue_export-helper.js +0 -10
  77. package/dist/es/chunks/p-action-bar.js +0 -61
  78. package/dist/es/chunks/p-card.js +0 -29
  79. package/dist/es/chunks/p-checkbox.js +0 -25
  80. package/dist/es/chunks/p-dropdown-select.js +0 -415
  81. package/dist/es/chunks/p-input-percent.js +0 -54
  82. package/dist/es/chunks/p-pagination-info.js +0 -67
  83. package/dist/es/chunks/p-pagination.js +0 -123
  84. package/dist/es/chunks/p-ring-loader.js +0 -82
  85. package/dist/es/chunks/p-select-btn.js +0 -98
  86. package/dist/es/chunks/p-select.js +0 -124
  87. package/dist/es/chunks/p-table-loader.js +0 -71
  88. package/dist/es/chunks/p-tabs.js +0 -53
  89. package/dist/es/config.js +0 -105
  90. package/dist/es/currency.js +0 -9
  91. package/dist/es/dom.js +0 -27
  92. package/dist/es/index.js +0 -978
  93. package/dist/es/inputClassesMixin.js +0 -51
  94. package/dist/es/inputClassesShared.js +0 -76
  95. package/dist/es/listKeyboardNavigation.js +0 -110
  96. package/dist/es/number.js +0 -9
  97. package/dist/es/object.js +0 -4
  98. package/dist/es/p-action-bar.js +0 -4
  99. package/dist/es/p-alert.js +0 -66
  100. package/dist/es/p-avatar.js +0 -72
  101. package/dist/es/p-btn.js +0 -362
  102. package/dist/es/p-card.js +0 -4
  103. package/dist/es/p-checkbox.js +0 -4
  104. package/dist/es/p-chips.js +0 -111
  105. package/dist/es/p-close-btn.js +0 -37
  106. package/dist/es/p-date-picker.js +0 -140
  107. package/dist/es/p-drawer.js +0 -254
  108. package/dist/es/p-dropdown-select.js +0 -4
  109. package/dist/es/p-dropdown.js +0 -139
  110. package/dist/es/p-file-upload.js +0 -21
  111. package/dist/es/p-info-icon.js +0 -36
  112. package/dist/es/p-inline-date-picker.js +0 -143
  113. package/dist/es/p-input-number.js +0 -147
  114. package/dist/es/p-input-percent.js +0 -4
  115. package/dist/es/p-input-search.js +0 -111
  116. package/dist/es/p-input.js +0 -90
  117. package/dist/es/p-loading.js +0 -39
  118. package/dist/es/p-modal.js +0 -370
  119. package/dist/es/p-pagination-info.js +0 -4
  120. package/dist/es/p-pagination.js +0 -4
  121. package/dist/es/p-progress-bar.js +0 -42
  122. package/dist/es/p-ring-loader.js +0 -4
  123. package/dist/es/p-select-btn.js +0 -4
  124. package/dist/es/p-select-list.js +0 -4
  125. package/dist/es/p-select-pill.js +0 -112
  126. package/dist/es/p-select.js +0 -4
  127. package/dist/es/p-skeleton-loader.js +0 -74
  128. package/dist/es/p-table-filter-icon.js +0 -21
  129. package/dist/es/p-table-header-cell.js +0 -76
  130. package/dist/es/p-table-loader.js +0 -4
  131. package/dist/es/p-table-sort.js +0 -8
  132. package/dist/es/p-table-td.js +0 -89
  133. package/dist/es/p-table.js +0 -12
  134. package/dist/es/p-tabs.js +0 -4
  135. package/dist/es/p-textarea.js +0 -74
  136. package/dist/es/p-toggle.js +0 -115
  137. package/dist/es/pagination.js +0 -29
  138. package/dist/es/string.js +0 -12
  139. package/dist/es/tailwind.js +0 -4353
  140. package/dist/es/text.js +0 -16
  141. package/dist/es/useInputClasses.js +0 -44
  142. package/dist/es/usePLoading.js +0 -35
  143. package/dist/es/usePModal.js +0 -21
  144. package/dist/es/usePTableColResize.js +0 -81
  145. package/dist/es/usePTableRowVirtualizer.js +0 -31
  146. package/dist/es/useSelectList.js +0 -256
@@ -1,53 +0,0 @@
1
- "use strict";
2
- const vue = require("vue");
3
- const pInputNumber = require("../p-input-number.js");
4
- const lodashEs = require("lodash-es");
5
- const _hoisted_1 = /* @__PURE__ */ vue.createElementVNode("div", null, "%", -1);
6
- const _hoisted_2 = [
7
- _hoisted_1
8
- ];
9
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
10
- ...{
11
- name: "PInputPercent"
12
- },
13
- __name: "p-input-percent",
14
- props: {
15
- modelValue: {
16
- type: [Number, String],
17
- default: null
18
- },
19
- size: {
20
- type: String,
21
- default: "md"
22
- }
23
- },
24
- emits: ["update:modelValue"],
25
- setup(__props, { emit: __emit }) {
26
- const prefixClasses = {
27
- sm: "text-sm h-8 left-2",
28
- md: "text-base h-10 left-3",
29
- lg: "text-lg h-12 left-5"
30
- };
31
- const props = __props;
32
- const emit = __emit;
33
- const convertedValue = vue.computed({
34
- get: () => lodashEs.isNumber(props.modelValue) ? props.modelValue * 100 : props.modelValue,
35
- set: (nV) => emit("update:modelValue", lodashEs.isNumber(nV) ? nV / 100 : nV)
36
- });
37
- return (_ctx, _cache) => {
38
- return vue.openBlock(), vue.createBlock(pInputNumber, {
39
- modelValue: convertedValue.value,
40
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => convertedValue.value = $event),
41
- size: __props.size
42
- }, {
43
- prefix: vue.withCtx(() => [
44
- vue.createElementVNode("div", {
45
- class: vue.normalizeClass(["absolute flex items-center", prefixClasses[__props.size]])
46
- }, _hoisted_2, 2)
47
- ]),
48
- _: 1
49
- }, 8, ["modelValue", "size"]);
50
- };
51
- }
52
- });
53
- exports._sfc_main = _sfc_main;
@@ -1,66 +0,0 @@
1
- "use strict";
2
- const vue = require("vue");
3
- const pSkeletonLoader = require("../p-skeleton-loader.js");
4
- const _hoisted_1 = {
5
- key: 1,
6
- class: "text-sm font-medium text-p-gray-40"
7
- };
8
- const _sfc_main = /* @__PURE__ */ vue.defineComponent({
9
- ...{ name: "PPaginationInfo" },
10
- __name: "p-pagination-info",
11
- props: {
12
- /**
13
- * The current page.
14
- */
15
- currentPage: {
16
- type: Number,
17
- default: 0
18
- },
19
- /**
20
- * The amount of data pagination iterates through.
21
- */
22
- count: {
23
- type: Number,
24
- default: 0
25
- },
26
- /**
27
- * The amount of data to be displayed at 1 page. Used to calculate the `from` and `to` limits.
28
- */
29
- pageSize: {
30
- type: Number,
31
- default: 0
32
- },
33
- /**
34
- * Whether the pagination is loading.
35
- */
36
- loading: {
37
- type: Boolean,
38
- default: false
39
- }
40
- },
41
- setup(__props) {
42
- const props = __props;
43
- const from = vue.computed(() => {
44
- const maxNumOfPages = Math.ceil(props.count / props.pageSize);
45
- const currentPage = props.currentPage > maxNumOfPages ? maxNumOfPages : props.currentPage;
46
- return (currentPage - 1) * props.pageSize + 1;
47
- });
48
- const to = vue.computed(() => {
49
- const to2 = props.currentPage * props.pageSize;
50
- return to2 >= props.count ? props.count : to2;
51
- });
52
- return (_ctx, _cache) => {
53
- return __props.loading ? (vue.openBlock(), vue.createBlock(pSkeletonLoader, {
54
- key: 0,
55
- class: "h-6 w-56"
56
- })) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_1, [
57
- __props.count ? (vue.openBlock(), vue.createElementBlock(vue.Fragment, { key: 0 }, [
58
- vue.createTextVNode("Showing " + vue.toDisplayString(from.value) + " to " + vue.toDisplayString(to.value) + " of " + vue.toDisplayString(__props.count) + " results", 1)
59
- ], 64)) : vue.renderSlot(_ctx.$slots, "no-results", { key: 1 }, () => [
60
- vue.createTextVNode("No results found")
61
- ])
62
- ]));
63
- };
64
- }
65
- });
66
- exports._sfc_main = _sfc_main;
@@ -1,122 +0,0 @@
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;
@@ -1,81 +0,0 @@
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;
@@ -1,97 +0,0 @@
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;
@@ -1,123 +0,0 @@
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;
@@ -1,70 +0,0 @@
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;
@@ -1,52 +0,0 @@
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;