@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
package/dist/es/p-btn.js DELETED
@@ -1,362 +0,0 @@
1
- import { _ as _sfc_main$1 } from "./chunks/p-ring-loader.js";
2
- import { getColorDeep } from "./tailwind.js";
3
- import { defineComponent, reactive, inject, computed, h, unref, getCurrentInstance, watchEffect, resolveComponent, openBlock, createElementBlock, mergeProps, renderSlot, createBlock, resolveDynamicComponent, withCtx, createElementVNode, normalizeClass, normalizeStyle, createCommentVNode } from "vue";
4
- import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
5
- /*!
6
- * vue-router v4.3.0
7
- * (c) 2024 Eduardo San Martin Morote
8
- * @license MIT
9
- */
10
- const isBrowser = typeof document !== "undefined";
11
- const noop = () => {
12
- };
13
- const isArray = Array.isArray;
14
- function isSameRouteRecord(a, b) {
15
- return (a.aliasOf || a) === (b.aliasOf || b);
16
- }
17
- function isSameRouteLocationParams(a, b) {
18
- if (Object.keys(a).length !== Object.keys(b).length)
19
- return false;
20
- for (const key in a) {
21
- if (!isSameRouteLocationParamsValue(a[key], b[key]))
22
- return false;
23
- }
24
- return true;
25
- }
26
- function isSameRouteLocationParamsValue(a, b) {
27
- return isArray(a) ? isEquivalentArray(a, b) : isArray(b) ? isEquivalentArray(b, a) : a === b;
28
- }
29
- function isEquivalentArray(a, b) {
30
- return isArray(b) ? a.length === b.length && a.every((value, i) => value === b[i]) : a.length === 1 && a[0] === b;
31
- }
32
- var NavigationType;
33
- (function(NavigationType2) {
34
- NavigationType2["pop"] = "pop";
35
- NavigationType2["push"] = "push";
36
- })(NavigationType || (NavigationType = {}));
37
- var NavigationDirection;
38
- (function(NavigationDirection2) {
39
- NavigationDirection2["back"] = "back";
40
- NavigationDirection2["forward"] = "forward";
41
- NavigationDirection2["unknown"] = "";
42
- })(NavigationDirection || (NavigationDirection = {}));
43
- Symbol(process.env.NODE_ENV !== "production" ? "navigation failure" : "");
44
- var NavigationFailureType;
45
- (function(NavigationFailureType2) {
46
- NavigationFailureType2[NavigationFailureType2["aborted"] = 4] = "aborted";
47
- NavigationFailureType2[NavigationFailureType2["cancelled"] = 8] = "cancelled";
48
- NavigationFailureType2[NavigationFailureType2["duplicated"] = 16] = "duplicated";
49
- })(NavigationFailureType || (NavigationFailureType = {}));
50
- Symbol(process.env.NODE_ENV !== "production" ? "router view location matched" : "");
51
- Symbol(process.env.NODE_ENV !== "production" ? "router view depth" : "");
52
- const routerKey = Symbol(process.env.NODE_ENV !== "production" ? "router" : "");
53
- const routeLocationKey = Symbol(process.env.NODE_ENV !== "production" ? "route location" : "");
54
- Symbol(process.env.NODE_ENV !== "production" ? "router view location" : "");
55
- function useLink(props) {
56
- const router = inject(routerKey);
57
- const currentRoute = inject(routeLocationKey);
58
- const route = computed(() => router.resolve(unref(props.to)));
59
- const activeRecordIndex = computed(() => {
60
- const { matched } = route.value;
61
- const { length } = matched;
62
- const routeMatched = matched[length - 1];
63
- const currentMatched = currentRoute.matched;
64
- if (!routeMatched || !currentMatched.length)
65
- return -1;
66
- const index = currentMatched.findIndex(isSameRouteRecord.bind(null, routeMatched));
67
- if (index > -1)
68
- return index;
69
- const parentRecordPath = getOriginalPath(matched[length - 2]);
70
- return (
71
- // we are dealing with nested routes
72
- length > 1 && // if the parent and matched route have the same path, this link is
73
- // referring to the empty child. Or we currently are on a different
74
- // child of the same parent
75
- getOriginalPath(routeMatched) === parentRecordPath && // avoid comparing the child with its parent
76
- currentMatched[currentMatched.length - 1].path !== parentRecordPath ? currentMatched.findIndex(isSameRouteRecord.bind(null, matched[length - 2])) : index
77
- );
78
- });
79
- const isActive = computed(() => activeRecordIndex.value > -1 && includesParams(currentRoute.params, route.value.params));
80
- const isExactActive = computed(() => activeRecordIndex.value > -1 && activeRecordIndex.value === currentRoute.matched.length - 1 && isSameRouteLocationParams(currentRoute.params, route.value.params));
81
- function navigate(e = {}) {
82
- if (guardEvent(e)) {
83
- return router[unref(props.replace) ? "replace" : "push"](
84
- unref(props.to)
85
- // avoid uncaught errors are they are logged anyway
86
- ).catch(noop);
87
- }
88
- return Promise.resolve();
89
- }
90
- if ((process.env.NODE_ENV !== "production" || false) && isBrowser) {
91
- const instance = getCurrentInstance();
92
- if (instance) {
93
- const linkContextDevtools = {
94
- route: route.value,
95
- isActive: isActive.value,
96
- isExactActive: isExactActive.value
97
- };
98
- instance.__vrl_devtools = instance.__vrl_devtools || [];
99
- instance.__vrl_devtools.push(linkContextDevtools);
100
- watchEffect(() => {
101
- linkContextDevtools.route = route.value;
102
- linkContextDevtools.isActive = isActive.value;
103
- linkContextDevtools.isExactActive = isExactActive.value;
104
- }, { flush: "post" });
105
- }
106
- }
107
- return {
108
- route,
109
- href: computed(() => route.value.href),
110
- isActive,
111
- isExactActive,
112
- navigate
113
- };
114
- }
115
- const RouterLinkImpl = /* @__PURE__ */ defineComponent({
116
- name: "RouterLink",
117
- compatConfig: { MODE: 3 },
118
- props: {
119
- to: {
120
- type: [String, Object],
121
- required: true
122
- },
123
- replace: Boolean,
124
- activeClass: String,
125
- // inactiveClass: String,
126
- exactActiveClass: String,
127
- custom: Boolean,
128
- ariaCurrentValue: {
129
- type: String,
130
- default: "page"
131
- }
132
- },
133
- useLink,
134
- setup(props, { slots }) {
135
- const link = reactive(useLink(props));
136
- const { options } = inject(routerKey);
137
- const elClass = computed(() => ({
138
- [getLinkClass(props.activeClass, options.linkActiveClass, "router-link-active")]: link.isActive,
139
- // [getLinkClass(
140
- // props.inactiveClass,
141
- // options.linkInactiveClass,
142
- // 'router-link-inactive'
143
- // )]: !link.isExactActive,
144
- [getLinkClass(props.exactActiveClass, options.linkExactActiveClass, "router-link-exact-active")]: link.isExactActive
145
- }));
146
- return () => {
147
- const children = slots.default && slots.default(link);
148
- return props.custom ? children : h("a", {
149
- "aria-current": link.isExactActive ? props.ariaCurrentValue : null,
150
- href: link.href,
151
- // this would override user added attrs but Vue will still add
152
- // the listener, so we end up triggering both
153
- onClick: link.navigate,
154
- class: elClass.value
155
- }, children);
156
- };
157
- }
158
- });
159
- const RouterLink = RouterLinkImpl;
160
- function guardEvent(e) {
161
- if (e.metaKey || e.altKey || e.ctrlKey || e.shiftKey)
162
- return;
163
- if (e.defaultPrevented)
164
- return;
165
- if (e.button !== void 0 && e.button !== 0)
166
- return;
167
- if (e.currentTarget && e.currentTarget.getAttribute) {
168
- const target = e.currentTarget.getAttribute("target");
169
- if (/\b_blank\b/i.test(target))
170
- return;
171
- }
172
- if (e.preventDefault)
173
- e.preventDefault();
174
- return true;
175
- }
176
- function includesParams(outer, inner) {
177
- for (const key in inner) {
178
- const innerValue = inner[key];
179
- const outerValue = outer[key];
180
- if (typeof innerValue === "string") {
181
- if (innerValue !== outerValue)
182
- return false;
183
- } else {
184
- if (!isArray(outerValue) || outerValue.length !== innerValue.length || innerValue.some((value, i) => value !== outerValue[i]))
185
- return false;
186
- }
187
- }
188
- return true;
189
- }
190
- function getOriginalPath(record) {
191
- return record ? record.aliasOf ? record.aliasOf.path : record.path : "";
192
- }
193
- const getLinkClass = (propClass, globalClass, defaultClass) => propClass != null ? propClass : globalClass != null ? globalClass : defaultClass;
194
- const BUTTON_TYPES = {
195
- PRIMARY: "primary",
196
- SECONDARY: "secondary",
197
- PRIMARY_OUTLINE: "primary-outline",
198
- SECONDARY_OUTLINE: "secondary-outline",
199
- SECONDARY_OUTLINE_BLUE: "secondary-outline-blue",
200
- ERROR: "error",
201
- SUCCESS: "success",
202
- PRIMARY_LINK: "primary-link",
203
- SECONDARY_GHOST: "secondary-ghost",
204
- SECONDARY_GHOST_DARK: "secondary-ghost-dark"
205
- };
206
- const BUTTON_NATIVE_TYPES = ["button", "submit", "reset"];
207
- const DEFAULT_CLASSES = `relative inline-block outline-none disabled:opacity-50 disabled:cursor-default disabled:pointer-events-none`;
208
- const BUTTON_CLASSES = {
209
- [BUTTON_TYPES.PRIMARY]: "text-surface bg-primary hover:bg-accent active:bg-p-blue-80",
210
- [BUTTON_TYPES.SECONDARY]: "bg-p-gray-20 hover:bg-p-gray-30 active:bg-p-gray-40",
211
- [BUTTON_TYPES.PRIMARY_OUTLINE]: "text-p-purple-60 bg-p-blue-10 border border-p-purple-60 hover:bg-p-gray-20 focus:ring-1 focus:ring-p-purple-60",
212
- [BUTTON_TYPES.SECONDARY_OUTLINE]: "text-p-purple-60 bg-surface border border-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-10",
213
- [BUTTON_TYPES.SECONDARY_OUTLINE_BLUE]: "text-p-purple-60 bg-surface border border-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-15 aria-selected:text-p-blue-60",
214
- [BUTTON_TYPES.ERROR]: "text-white bg-p-red-40 hover:bg-p-red-50",
215
- [BUTTON_TYPES.SUCCESS]: "text-white bg-p-green-40 hover:bg-p-green-50",
216
- [BUTTON_TYPES.PRIMARY_LINK]: "text-primary bg-transparent hover:text-accent underline",
217
- [BUTTON_TYPES.SECONDARY_GHOST]: "text-on-surface hover:bg-p-gray-20",
218
- [BUTTON_TYPES.SECONDARY_GHOST_DARK]: "text-white hover:bg-p-purple-50"
219
- };
220
- const BUTTON_SIZES = {
221
- sm: "py-1 px-2 rounded font-medium text-sm",
222
- md: "py-2 px-6 rounded font-medium text-base",
223
- lg: "py-3 px-6 rounded font-medium text-lg"
224
- };
225
- const LOADER_SIZES = {
226
- sm: 24,
227
- md: 30,
228
- lg: 40
229
- };
230
- const LOADER_COLORS = {
231
- [BUTTON_TYPES.PRIMARY]: "p-blue-15",
232
- [BUTTON_TYPES.SECONDARY]: "p-purple-60",
233
- [BUTTON_TYPES.PRIMARY_OUTLINE]: "p-blue-60",
234
- [BUTTON_TYPES.SECONDARY_OUTLINE]: "p-purple-60",
235
- [BUTTON_TYPES.SECONDARY_OUTLINE_BLUE]: "p-purple-60",
236
- [BUTTON_TYPES.ERROR]: "p-blue-15",
237
- [BUTTON_TYPES.SUCCESS]: "p-blue-15",
238
- [BUTTON_TYPES.PRIMARY_LINK]: "p-blue-60",
239
- [BUTTON_TYPES.SECONDARY_GHOST]: "p-purple-60",
240
- [BUTTON_TYPES.SECONDARY_GHOST_DARK]: "p-blue-15"
241
- };
242
- const _sfc_main = defineComponent({
243
- name: "PBtn",
244
- components: {
245
- PRingLoader: _sfc_main$1,
246
- RouterLink
247
- },
248
- inheritAttrs: false,
249
- props: {
250
- /**
251
- * The button style e.g primary, secondary, primary-outline, secondary-outline, error, success, primary-link
252
- */
253
- type: {
254
- type: String,
255
- default: "primary",
256
- validator(value) {
257
- return Object.values(BUTTON_TYPES).includes(value);
258
- }
259
- },
260
- /**
261
- * The button native type e.g button, submit, reset
262
- */
263
- nativeType: {
264
- type: String,
265
- default: "button",
266
- validator(value) {
267
- return BUTTON_NATIVE_TYPES.includes(value);
268
- }
269
- },
270
- /**
271
- * The button size e.g sm, md, lg
272
- */
273
- size: {
274
- type: String,
275
- default: "md",
276
- validator(value) {
277
- return Object.keys(BUTTON_SIZES).includes(value);
278
- }
279
- },
280
- /**
281
- * Whether the button is loading
282
- */
283
- loading: {
284
- type: Boolean,
285
- default: false
286
- },
287
- /**
288
- * Whether the button is selected (sets aria-selected attribute)
289
- */
290
- selected: {
291
- type: Boolean,
292
- default: false
293
- },
294
- /**
295
- * Exactly as the `to` prop in `RouterLink`, when used, it renders a link that triggers a navigation on click.
296
- * See https://router.vuejs.org/api/#RouteLocationRaw
297
- */
298
- to: {
299
- type: [Object, String],
300
- default: ""
301
- }
302
- },
303
- data() {
304
- return {
305
- loaderStyle: { position: "absolute" }
306
- };
307
- },
308
- computed: {
309
- classes() {
310
- return `${DEFAULT_CLASSES} ${BUTTON_SIZES[this.size]} ${BUTTON_CLASSES[this.type]}`;
311
- },
312
- loaderSize() {
313
- return Number(`${LOADER_SIZES[this.size]}`);
314
- },
315
- loaderColor() {
316
- const type = LOADER_COLORS[this.type];
317
- return getColorDeep(type);
318
- },
319
- isExternalLink() {
320
- return typeof this.to === "string" && this.to.startsWith("http");
321
- }
322
- }
323
- });
324
- const _hoisted_1 = ["href"];
325
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
326
- const _component_PRingLoader = resolveComponent("PRingLoader");
327
- return _ctx.isExternalLink ? (openBlock(), createElementBlock("a", mergeProps({ key: 0 }, _ctx.$attrs, {
328
- href: _ctx.to,
329
- target: "_blank",
330
- class: _ctx.classes
331
- }), [
332
- renderSlot(_ctx.$slots, "default")
333
- ], 16, _hoisted_1)) : (openBlock(), createBlock(resolveDynamicComponent(_ctx.to ? "RouterLink" : "button"), mergeProps({
334
- key: 1,
335
- type: _ctx.to ? null : _ctx.nativeType,
336
- to: _ctx.to ? _ctx.to : null,
337
- "aria-selected": _ctx.selected,
338
- class: _ctx.classes
339
- }, _ctx.$attrs, {
340
- disabled: _ctx.$attrs.disabled || _ctx.loading
341
- }), {
342
- default: withCtx(() => [
343
- createElementVNode("div", {
344
- class: normalizeClass({ invisible: _ctx.loading })
345
- }, [
346
- renderSlot(_ctx.$slots, "default")
347
- ], 2),
348
- _ctx.loading ? (openBlock(), createBlock(_component_PRingLoader, {
349
- key: 0,
350
- style: normalizeStyle(_ctx.loaderStyle),
351
- color: _ctx.loaderColor,
352
- size: _ctx.loaderSize,
353
- class: "left-0 right-0 top-0 ml-auto mr-auto pt-1"
354
- }, null, 8, ["style", "color", "size"])) : createCommentVNode("", true)
355
- ]),
356
- _: 3
357
- }, 16, ["type", "to", "aria-selected", "class", "disabled"]));
358
- }
359
- const PBtn = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
360
- export {
361
- PBtn as default
362
- };
package/dist/es/p-card.js DELETED
@@ -1,4 +0,0 @@
1
- import { _ as _sfc_main } from "./chunks/p-card.js";
2
- export {
3
- _sfc_main as default
4
- };
@@ -1,4 +0,0 @@
1
- import { _ as _sfc_main } from "./chunks/p-checkbox.js";
2
- export {
3
- _sfc_main as default
4
- };
@@ -1,111 +0,0 @@
1
- import { defineComponent, openBlock, createElementBlock, createElementVNode, renderSlot, Fragment, renderList, toDisplayString, withDirectives, vShow, pushScopeId, popScopeId } from "vue";
2
- import { isObject } from "lodash-es";
3
- import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
4
- const _sfc_main = defineComponent({
5
- name: "PChips",
6
- props: {
7
- items: {
8
- type: Array,
9
- default: () => [],
10
- required: true
11
- },
12
- itemText: {
13
- type: String,
14
- default: "text"
15
- }
16
- },
17
- emits: ["click:chip", "click:overflow"],
18
- data() {
19
- return {
20
- maxChipsDisplayed: 1
21
- };
22
- },
23
- watch: {
24
- items() {
25
- this.resizeFilterChips();
26
- }
27
- },
28
- mounted() {
29
- this.resizeFilterChips();
30
- this.$nextTick(() => {
31
- window.addEventListener("resize", this.resizeFilterChips);
32
- });
33
- },
34
- beforeUnmount() {
35
- window.removeEventListener("resize", this.resizeFilterChips);
36
- },
37
- methods: {
38
- resizeFilterChips() {
39
- this.maxChipsDisplayed = this.items.length;
40
- this.$nextTick(() => {
41
- if (!this.$refs.filterChipsRowInner) {
42
- return;
43
- }
44
- const filterChipsRowElement = this.$refs.filterChipsRow;
45
- const filterChipsRowInnerElement = this.$refs.filterChipsRowInner;
46
- const afterSlotContainerElement = this.$refs.afterSlotContainer;
47
- const beforeSlotContainerElement = this.$refs.beforeSlotContainer;
48
- const chips = filterChipsRowInnerElement.children;
49
- let totalInnerWidth = 0;
50
- const overflowChipWidth = 42;
51
- const totalExtraWidth = beforeSlotContainerElement.offsetWidth + afterSlotContainerElement.offsetWidth + overflowChipWidth;
52
- for (let i = 0; i < chips.length; i++) {
53
- totalInnerWidth += chips[i].offsetWidth;
54
- if (totalInnerWidth + totalExtraWidth >= filterChipsRowElement.offsetWidth) {
55
- this.maxChipsDisplayed = i;
56
- break;
57
- }
58
- }
59
- });
60
- },
61
- getItemText(item) {
62
- return typeof item === "string" ? item : isObject(item) ? item[this.itemText] : "";
63
- }
64
- }
65
- });
66
- const _withScopeId = (n) => (pushScopeId("data-v-40bc335f"), n = n(), popScopeId(), n);
67
- const _hoisted_1 = {
68
- ref: "filterChipsRow",
69
- class: "flex w-full items-center"
70
- };
71
- const _hoisted_2 = { ref: "beforeSlotContainer" };
72
- const _hoisted_3 = {
73
- ref: "filterChipsRowInner",
74
- class: "flex divide-x divide-p-blue-30 overflow-hidden rounded-md border border-p-blue-30 text-xs font-medium text-p-purple-60"
75
- };
76
- const _hoisted_4 = ["onClick"];
77
- const _hoisted_5 = { class: "inline-block truncate" };
78
- const _hoisted_6 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("i", { class: "bg-cross ml-2 inline-block h-1.5 w-1.5" }, null, -1));
79
- const _hoisted_7 = { ref: "afterSlotContainer" };
80
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
81
- return openBlock(), createElementBlock("div", _hoisted_1, [
82
- createElementVNode("div", _hoisted_2, [
83
- renderSlot(_ctx.$slots, "before", {}, void 0, true)
84
- ], 512),
85
- createElementVNode("div", _hoisted_3, [
86
- (openBlock(true), createElementBlock(Fragment, null, renderList(_ctx.items.slice(0, _ctx.maxChipsDisplayed), (item, idx) => {
87
- return openBlock(), createElementBlock("div", {
88
- key: `${_ctx.getItemText(item)}_${idx}`,
89
- class: "flex cursor-pointer items-center px-3 py-1 hover:bg-p-blue-20",
90
- onClick: ($event) => _ctx.$emit("click:chip", item)
91
- }, [
92
- createElementVNode("div", _hoisted_5, toDisplayString(_ctx.getItemText(item)), 1),
93
- _hoisted_6
94
- ], 8, _hoisted_4);
95
- }), 128)),
96
- withDirectives(createElementVNode("div", {
97
- class: "cursor-pointer px-3 py-1 hover:bg-p-blue-20",
98
- onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click:overflow"))
99
- }, " +" + toDisplayString(_ctx.items.length - _ctx.maxChipsDisplayed), 513), [
100
- [vShow, _ctx.items.length > _ctx.maxChipsDisplayed]
101
- ])
102
- ], 512),
103
- createElementVNode("div", _hoisted_7, [
104
- renderSlot(_ctx.$slots, "after", {}, void 0, true)
105
- ], 512)
106
- ], 512);
107
- }
108
- const pChips = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-40bc335f"]]);
109
- export {
110
- pChips as default
111
- };
@@ -1,37 +0,0 @@
1
- import { defineComponent, openBlock, createElementBlock, normalizeClass, createElementVNode } from "vue";
2
- import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
3
- const _sfc_main = /* @__PURE__ */ defineComponent({
4
- __name: "p-close-btn",
5
- props: {
6
- variant: {
7
- type: String,
8
- default: "transparent"
9
- }
10
- },
11
- setup(__props) {
12
- const variantClasses = {
13
- transparent: ["bg-transparent", "hover:bg-p-gray-20"],
14
- gray: ["bg-p-gray-10", "hover:bg-p-gray-20"],
15
- dark: ["bg-transparent"]
16
- };
17
- const iconClass = {
18
- transparent: "x-black-icon",
19
- gray: "x-black-icon",
20
- dark: "x-white-icon"
21
- };
22
- return (_ctx, _cache) => {
23
- return openBlock(), createElementBlock("button", {
24
- type: "button",
25
- class: normalizeClass(["inline-flex h-8 w-8 cursor-pointer items-center justify-center rounded focus:outline-none disabled:cursor-default disabled:opacity-30 disabled:hover:bg-white", variantClasses[__props.variant]])
26
- }, [
27
- createElementVNode("i", {
28
- class: normalizeClass(["block h-3 w-3 bg-center bg-no-repeat", iconClass[__props.variant]])
29
- }, null, 2)
30
- ], 2);
31
- };
32
- }
33
- });
34
- const PCloseBtn = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-f61993bb"]]);
35
- export {
36
- PCloseBtn as default
37
- };
@@ -1,140 +0,0 @@
1
- import dayjs from "dayjs";
2
- import inputClassesMixin from "./inputClassesMixin.js";
3
- import { DatePicker } from "v-calendar";
4
- import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, toDisplayString, createCommentVNode, createVNode, withCtx, createElementVNode, mergeProps, toHandlers, withDirectives, vShow } from "vue";
5
- import { isString, isDate } from "lodash-es";
6
- import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
7
- const selectAttribute = { highlight: { class: "bg-primary", contentClass: "text-white" } };
8
- const DEFAULT_MASKS = {
9
- // The mask for the input
10
- input: "DD-MMM-YYYY",
11
- // The mask for the model value
12
- data: "YYYY-MM-DD"
13
- };
14
- const _sfc_main = defineComponent({
15
- name: "PDatePicker",
16
- components: {
17
- DatePicker
18
- },
19
- mixins: [inputClassesMixin],
20
- inheritAttrs: false,
21
- props: {
22
- modelValue: {
23
- type: String,
24
- default: ""
25
- },
26
- label: {
27
- type: String,
28
- default: ""
29
- },
30
- errorMsg: {
31
- type: String,
32
- default: ""
33
- },
34
- required: {
35
- type: Boolean,
36
- default: false
37
- },
38
- minDate: {
39
- type: Date,
40
- default: null
41
- },
42
- maxDate: {
43
- type: Date,
44
- default: null
45
- },
46
- timezone: {
47
- type: String,
48
- default: ""
49
- }
50
- },
51
- emits: ["update:modelValue"],
52
- data() {
53
- return {
54
- // innerValue is a Date object
55
- innerValue: null,
56
- stopWatch: false,
57
- selectAttribute
58
- };
59
- },
60
- computed: {
61
- displayPlaceholder() {
62
- return isString(this.$attrs.placeholder) ? this.$attrs.placeholder : this.masks.input;
63
- },
64
- masks() {
65
- return Object.assign(DEFAULT_MASKS, this.$attrs.masks);
66
- },
67
- attrs() {
68
- const { class: classes, style, ...rest } = this.$attrs;
69
- return rest;
70
- },
71
- style() {
72
- return this.$attrs.style;
73
- }
74
- },
75
- watch: {
76
- modelValue: {
77
- handler(nV) {
78
- if (!this.stopWatch) {
79
- this.innerValue = nV ? dayjs(nV, this.masks.data).toDate() : null;
80
- }
81
- },
82
- immediate: true
83
- },
84
- innerValue(nV) {
85
- const toEmit = isDate(nV) && nV.toString() !== "Invalid Date" ? dayjs(nV).format(this.masks.data) : null;
86
- this.stopWatch = true;
87
- this.$emit("update:modelValue", toEmit);
88
- this.$nextTick(() => {
89
- this.stopWatch = false;
90
- });
91
- }
92
- }
93
- });
94
- const _hoisted_1 = ["data-has-error"];
95
- const _hoisted_2 = ["value", "placeholder"];
96
- function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
97
- const _component_DatePicker = resolveComponent("DatePicker");
98
- return openBlock(), createElementBlock("div", {
99
- class: normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
100
- "data-has-error": !!_ctx.errorMsg,
101
- style: normalizeStyle(_ctx.style)
102
- }, [
103
- renderSlot(_ctx.$slots, "label", {
104
- label: _ctx.label,
105
- labelClasses: _ctx.labelClasses
106
- }, () => [
107
- _ctx.label ? (openBlock(), createElementBlock("label", {
108
- key: 0,
109
- class: normalizeClass(_ctx.labelClasses)
110
- }, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true)
111
- ]),
112
- createVNode(_component_DatePicker, {
113
- modelValue: _ctx.innerValue,
114
- "onUpdate:modelValue": _cache[0] || (_cache[0] = ($event) => _ctx.innerValue = $event),
115
- "select-attribute": _ctx.selectAttribute,
116
- popover: { visibility: "click", placement: "auto" },
117
- "min-date": _ctx.minDate || null,
118
- "max-date": _ctx.maxDate || null,
119
- masks: _ctx.masks,
120
- timezone: _ctx.timezone
121
- }, {
122
- default: withCtx(({ inputValue, inputEvents }) => [
123
- createElementVNode("input", mergeProps({
124
- class: [_ctx.inputClasses, { "cursor-pointer": !_ctx.attrs.disabled }],
125
- value: inputValue
126
- }, _ctx.attrs, { placeholder: _ctx.displayPlaceholder }, toHandlers(inputEvents, true)), null, 16, _hoisted_2)
127
- ]),
128
- _: 1
129
- }, 8, ["modelValue", "select-attribute", "min-date", "max-date", "masks", "timezone"]),
130
- withDirectives(createElementVNode("div", {
131
- class: normalizeClass(_ctx.errorMsgClasses)
132
- }, toDisplayString(_ctx.errorMsg), 3), [
133
- [vShow, _ctx.errorMsg]
134
- ])
135
- ], 14, _hoisted_1);
136
- }
137
- const pDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
138
- export {
139
- pDatePicker as default
140
- };