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