@pequity/squirrel 6.0.13 → 6.1.0
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/cjs/chunks/p-action-bar.js +4 -4
- package/dist/cjs/chunks/p-btn.js +204 -0
- package/dist/cjs/chunks/p-select-btn.js +5 -4
- package/dist/cjs/index.js +28 -23
- package/dist/cjs/inputClasses.js +6 -4
- package/dist/cjs/p-btn.js +2 -169
- package/dist/es/chunks/p-action-bar.js +8 -8
- package/dist/es/chunks/p-btn.js +205 -0
- package/dist/es/chunks/p-select-btn.js +5 -4
- package/dist/es/index.js +65 -60
- package/dist/es/inputClasses.js +6 -4
- package/dist/es/p-btn.js +2 -169
- package/dist/squirrel/components/p-btn/p-btn.vue.d.ts +106 -46
- package/dist/squirrel/components/p-card/p-card.vue.d.ts +27 -14
- package/dist/squirrel/components/p-checkbox/p-checkbox.vue.d.ts +43 -12
- package/dist/squirrel/components/p-close-btn/p-close-btn.vue.d.ts +1 -1
- package/dist/squirrel/components/p-drawer/p-drawer.vue.d.ts +1 -1
- package/dist/squirrel/components/p-dropdown-select/p-dropdown-select.vue.d.ts +15 -422
- package/dist/squirrel/components/p-file-upload/p-file-upload.vue.d.ts +1 -3
- package/dist/squirrel/components/p-info-icon/p-info-icon.vue.d.ts +13 -11
- package/dist/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue.d.ts +39 -14
- package/dist/squirrel/components/p-input/p-input.vue.d.ts +2 -2
- package/dist/squirrel/components/p-input-number/p-input-number.vue.d.ts +2 -2
- package/dist/squirrel/components/p-input-search/p-input-search.vue.d.ts +2 -2
- package/dist/squirrel/components/p-link/p-link.vue.d.ts +17 -13
- package/dist/squirrel/components/p-loading/p-loading.vue.d.ts +1 -3
- package/dist/squirrel/components/p-modal/p-modal.vue.d.ts +240 -22
- package/dist/squirrel/components/p-pagination-info/p-pagination-info.vue.d.ts +77 -10
- package/dist/squirrel/components/p-select/p-select.vue.d.ts +116 -14
- package/dist/squirrel/components/p-select-btn/p-select-btn.vue.d.ts +37 -13
- package/dist/squirrel/components/p-select-list/p-select-list.vue.d.ts +14 -418
- package/dist/squirrel/components/p-table/p-table.vue.d.ts +61 -19
- package/dist/squirrel/components/p-table-header-cell/p-table-header-cell.vue.d.ts +1 -1
- package/dist/squirrel/components/p-table-loader/p-table-loader.vue.d.ts +1 -1
- package/dist/squirrel/components/p-table-td/p-table-td.vue.d.ts +23 -11
- package/dist/squirrel/components/p-tabs/p-tabs.vue.d.ts +1 -1
- package/dist/squirrel/components/p-textarea/p-textarea.vue.d.ts +1 -1
- package/dist/squirrel/components/p-toggle/p-toggle.vue.d.ts +1 -1
- package/dist/squirrel/utils/inputClasses.d.ts +75 -25
- package/dist/squirrel/utils/inputClassesMixin.d.ts +1 -1
- package/dist/squirrel.css +2 -9
- package/package.json +25 -24
- package/squirrel/assets/squirrel.css +1 -1
- package/squirrel/components/p-action-bar/p-action-bar.stories.js +1 -2
- package/squirrel/components/p-btn/p-btn.spec.js +227 -161
- package/squirrel/components/p-btn/p-btn.stories.js +32 -8
- package/squirrel/components/p-btn/p-btn.vue +106 -73
- package/squirrel/components/p-dropdown/p-dropdown.vue +0 -1
- package/squirrel/components/p-file-upload/p-file-upload.vue +6 -16
- package/squirrel/components/p-inline-date-picker/p-inline-date-picker.vue +1 -1
- package/squirrel/components/p-select/p-select.spec.js +1 -1
- package/squirrel/components/p-select-btn/p-select-btn.stories.js +45 -4
- package/squirrel/components/p-select-btn/p-select-btn.vue +2 -2
- package/squirrel/components/p-tabs/p-tabs.stories.js +2 -2
- package/squirrel/composables/useInputClasses.spec.js +3 -3
- package/squirrel/utils/inputClasses.ts +6 -4
- package/squirrel/utils/inputClassesMixin.spec.js +3 -3
- package/squirrel/assets/file-upload-drag-over-icon.svg +0 -5
- package/squirrel/assets/file-upload-upload-icon.svg +0 -5
- package/squirrel/assets/file-upload-x-icon-hover.svg +0 -8
- package/squirrel/assets/file-upload-x-icon.svg +0 -8
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
const
|
|
3
|
+
const pBtn_vue_vue_type_script_setup_true_lang = require("./p-btn.js");
|
|
4
4
|
const pCloseBtn = require("../p-close-btn.js");
|
|
5
5
|
const pDropdown = require("../p-dropdown.js");
|
|
6
6
|
const pIcon_vue_vue_type_script_setup_true_lang = require("./p-icon.js");
|
|
@@ -45,7 +45,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
45
45
|
return vue.openBlock(), vue.createElementBlock(vue.Fragment, {
|
|
46
46
|
key: `action-${actionOrMenu.label}`
|
|
47
47
|
}, [
|
|
48
|
-
!actionOrMenu.subActions ? (vue.openBlock(), vue.createBlock(
|
|
48
|
+
!actionOrMenu.subActions ? (vue.openBlock(), vue.createBlock(pBtn_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
49
49
|
key: 0,
|
|
50
50
|
size: "sm",
|
|
51
51
|
type: "secondary-ghost-dark",
|
|
@@ -78,7 +78,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
78
78
|
return vue.openBlock(), vue.createElementBlock("div", {
|
|
79
79
|
key: `subaction-${subaction.name}`
|
|
80
80
|
}, [
|
|
81
|
-
vue.createVNode(
|
|
81
|
+
vue.createVNode(pBtn_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
82
82
|
size: "sm",
|
|
83
83
|
class: "w-full",
|
|
84
84
|
type: "secondary-ghost-dark",
|
|
@@ -106,7 +106,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
106
106
|
])
|
|
107
107
|
]),
|
|
108
108
|
default: vue.withCtx(() => [
|
|
109
|
-
vue.createVNode(
|
|
109
|
+
vue.createVNode(pBtn_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
110
110
|
size: "sm",
|
|
111
111
|
type: "secondary-ghost-dark"
|
|
112
112
|
}, {
|
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const pBtn_types = require("./p-btn.types.js");
|
|
4
|
+
const pIcon_vue_vue_type_script_setup_true_lang = require("./p-icon.js");
|
|
5
|
+
const pRingLoader_vue_vue_type_script_setup_true_lang = require("./p-ring-loader.js");
|
|
6
|
+
const link = require("../link.js");
|
|
7
|
+
const sanitization = require("../sanitization.js");
|
|
8
|
+
const index = require("./index.js");
|
|
9
|
+
const _hoisted_1 = ["href", "disabled", "aria-disabled"];
|
|
10
|
+
const _hoisted_2 = { class: "slot-wrapper empty:hidden" };
|
|
11
|
+
const btnClasses = {
|
|
12
|
+
slots: {
|
|
13
|
+
button: "relative inline-block rounded font-medium outline-none disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-default aria-disabled:opacity-50",
|
|
14
|
+
content: "flex items-center justify-center has-[.slot-wrapper:empty]:gap-0",
|
|
15
|
+
loader: "absolute bottom-0 left-0 right-0 top-0 flex items-center justify-center font-medium",
|
|
16
|
+
icon: "shrink-0"
|
|
17
|
+
},
|
|
18
|
+
variants: {
|
|
19
|
+
type: {
|
|
20
|
+
primary: {
|
|
21
|
+
button: "bg-primary text-surface hover:bg-accent active:bg-p-blue-80",
|
|
22
|
+
loader: "text-surface"
|
|
23
|
+
},
|
|
24
|
+
secondary: {
|
|
25
|
+
button: "bg-p-gray-20 hover:bg-p-gray-30 active:bg-p-gray-40",
|
|
26
|
+
loader: "text-p-purple-60"
|
|
27
|
+
},
|
|
28
|
+
"primary-outline": {
|
|
29
|
+
button: "bg-p-blue-10 text-p-purple-60 ring-1 ring-inset ring-p-purple-60 hover:bg-p-gray-20",
|
|
30
|
+
loader: "text-p-purple-60"
|
|
31
|
+
},
|
|
32
|
+
"secondary-outline": {
|
|
33
|
+
button: "bg-surface text-p-purple-60 ring-1 ring-inset ring-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-10",
|
|
34
|
+
loader: "text-p-purple-60"
|
|
35
|
+
},
|
|
36
|
+
"secondary-outline-blue": {
|
|
37
|
+
button: "bg-surface text-p-purple-60 ring-1 ring-inset ring-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-15 aria-selected:text-p-blue-60",
|
|
38
|
+
loader: "text-p-purple-60"
|
|
39
|
+
},
|
|
40
|
+
error: { button: "bg-p-red-40 text-white hover:bg-p-red-50", loader: "text-white" },
|
|
41
|
+
success: { button: "bg-p-green-40 text-white hover:bg-p-green-50", loader: "text-white" },
|
|
42
|
+
"primary-link": { button: "bg-transparent text-primary underline hover:text-accent", loader: "text-p-blue-60" },
|
|
43
|
+
"secondary-ghost": { button: "text-on-surface hover:bg-p-gray-20", loader: "text-p-purple-60" },
|
|
44
|
+
"secondary-ghost-dark": { button: "text-white hover:bg-p-purple-50", loader: "text-p-blue-15" }
|
|
45
|
+
},
|
|
46
|
+
size: {
|
|
47
|
+
sm: {
|
|
48
|
+
button: "px-2 has-[.slot-wrapper:empty]:px-1 py-1 text-sm",
|
|
49
|
+
content: "gap-1",
|
|
50
|
+
icon: "text-lg"
|
|
51
|
+
},
|
|
52
|
+
md: {
|
|
53
|
+
button: "px-6 has-[.slot-wrapper:empty]:px-2 py-2 text-base",
|
|
54
|
+
content: "gap-2",
|
|
55
|
+
icon: "text-xl"
|
|
56
|
+
},
|
|
57
|
+
lg: {
|
|
58
|
+
button: "px-6 has-[.slot-wrapper:empty]:px-2.5 py-2.5 text-lg",
|
|
59
|
+
content: "gap-2.5",
|
|
60
|
+
icon: "text-2xl"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
},
|
|
64
|
+
defaultVariants: {
|
|
65
|
+
type: "primary",
|
|
66
|
+
size: "md"
|
|
67
|
+
}
|
|
68
|
+
};
|
|
69
|
+
const btn = index.ce(btnClasses);
|
|
70
|
+
const BUTTON_TYPES = Object.keys(btnClasses.variants.type);
|
|
71
|
+
const BUTTON_NATIVE_TYPES = ["button", "submit", "reset"];
|
|
72
|
+
const LOADER_SIZES = { sm: 24, md: 30, lg: 40 };
|
|
73
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
74
|
+
...{
|
|
75
|
+
name: "PBtn",
|
|
76
|
+
inheritAttrs: false
|
|
77
|
+
},
|
|
78
|
+
__name: "p-btn",
|
|
79
|
+
props: {
|
|
80
|
+
/**
|
|
81
|
+
* The button style e.g primary, secondary, primary-outline, secondary-outline, error, success, primary-link
|
|
82
|
+
*/
|
|
83
|
+
type: {
|
|
84
|
+
type: String,
|
|
85
|
+
default: "primary",
|
|
86
|
+
validator(value) {
|
|
87
|
+
return BUTTON_TYPES.includes(value);
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
/**
|
|
91
|
+
* The button native type e.g button, submit, reset
|
|
92
|
+
*/
|
|
93
|
+
nativeType: {
|
|
94
|
+
type: String,
|
|
95
|
+
default: "button",
|
|
96
|
+
validator(value) {
|
|
97
|
+
return BUTTON_NATIVE_TYPES.includes(value);
|
|
98
|
+
}
|
|
99
|
+
},
|
|
100
|
+
/**
|
|
101
|
+
* The button size e.g sm, md, lg
|
|
102
|
+
*/
|
|
103
|
+
size: {
|
|
104
|
+
type: String,
|
|
105
|
+
default: "md",
|
|
106
|
+
validator(value) {
|
|
107
|
+
return pBtn_types.SIZES.includes(value);
|
|
108
|
+
}
|
|
109
|
+
},
|
|
110
|
+
/**
|
|
111
|
+
* Whether the button is loading
|
|
112
|
+
*/
|
|
113
|
+
loading: {
|
|
114
|
+
type: Boolean,
|
|
115
|
+
default: false
|
|
116
|
+
},
|
|
117
|
+
/**
|
|
118
|
+
* Whether the button is selected (sets aria-selected attribute)
|
|
119
|
+
*/
|
|
120
|
+
selected: {
|
|
121
|
+
type: Boolean,
|
|
122
|
+
default: false
|
|
123
|
+
},
|
|
124
|
+
/**
|
|
125
|
+
* Exactly as the `to` prop in `RouterLink`, when used, it renders a link that triggers a navigation on click.
|
|
126
|
+
* See https://router.vuejs.org/api/#RouteLocationRaw
|
|
127
|
+
*/
|
|
128
|
+
to: {
|
|
129
|
+
type: [Object, String],
|
|
130
|
+
default: ""
|
|
131
|
+
},
|
|
132
|
+
/**
|
|
133
|
+
* The icon to display on the button
|
|
134
|
+
*/
|
|
135
|
+
icon: {
|
|
136
|
+
type: String,
|
|
137
|
+
default: ""
|
|
138
|
+
},
|
|
139
|
+
iconRight: {
|
|
140
|
+
type: String,
|
|
141
|
+
default: ""
|
|
142
|
+
}
|
|
143
|
+
},
|
|
144
|
+
setup(__props) {
|
|
145
|
+
const props = __props;
|
|
146
|
+
const classes = vue.computed(() => {
|
|
147
|
+
const { button, content, loader, icon } = btn({
|
|
148
|
+
type: props.type,
|
|
149
|
+
size: props.size
|
|
150
|
+
});
|
|
151
|
+
return { button: button(), content: content(), loader: loader(), icon: icon() };
|
|
152
|
+
});
|
|
153
|
+
const loaderSize = vue.computed(() => {
|
|
154
|
+
return Number(`${LOADER_SIZES[props.size]}`);
|
|
155
|
+
});
|
|
156
|
+
return (_ctx, _cache) => {
|
|
157
|
+
return typeof __props.to === "string" && vue.unref(link.isExternalLink)(__props.to) ? (vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
158
|
+
href: vue.unref(sanitization.sanitizeUrl)(__props.to),
|
|
159
|
+
target: "_blank",
|
|
160
|
+
class: classes.value.button,
|
|
161
|
+
disabled: !!_ctx.$attrs.disabled ? true : null,
|
|
162
|
+
"aria-disabled": !!_ctx.$attrs.disabled
|
|
163
|
+
}), [
|
|
164
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
165
|
+
], 16, _hoisted_1)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(__props.to ? "RouterLink" : "button"), vue.mergeProps({
|
|
166
|
+
key: 1,
|
|
167
|
+
type: __props.to ? null : __props.nativeType,
|
|
168
|
+
to: __props.to ? __props.to : null,
|
|
169
|
+
"aria-selected": __props.selected,
|
|
170
|
+
class: classes.value.button
|
|
171
|
+
}, _ctx.$attrs, {
|
|
172
|
+
disabled: !!_ctx.$attrs.disabled || __props.loading ? true : null,
|
|
173
|
+
"aria-disabled": _ctx.$attrs.disabled
|
|
174
|
+
}), {
|
|
175
|
+
default: vue.withCtx(() => [
|
|
176
|
+
vue.createElementVNode("div", {
|
|
177
|
+
class: vue.normalizeClass([{ invisible: __props.loading }, classes.value.content])
|
|
178
|
+
}, [
|
|
179
|
+
__props.icon ? (vue.openBlock(), vue.createBlock(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
180
|
+
key: 0,
|
|
181
|
+
icon: __props.icon,
|
|
182
|
+
class: vue.normalizeClass(classes.value.icon)
|
|
183
|
+
}, null, 8, ["icon", "class"])) : vue.createCommentVNode("", true),
|
|
184
|
+
vue.createElementVNode("span", _hoisted_2, [
|
|
185
|
+
vue.renderSlot(_ctx.$slots, "default")
|
|
186
|
+
]),
|
|
187
|
+
__props.iconRight ? (vue.openBlock(), vue.createBlock(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
188
|
+
key: 1,
|
|
189
|
+
icon: __props.iconRight,
|
|
190
|
+
class: vue.normalizeClass(classes.value.icon)
|
|
191
|
+
}, null, 8, ["icon", "class"])) : vue.createCommentVNode("", true)
|
|
192
|
+
], 2),
|
|
193
|
+
__props.loading ? (vue.openBlock(), vue.createBlock(pRingLoader_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
194
|
+
key: 0,
|
|
195
|
+
size: loaderSize.value,
|
|
196
|
+
class: vue.normalizeClass(classes.value.loader)
|
|
197
|
+
}, null, 8, ["size", "class"])) : vue.createCommentVNode("", true)
|
|
198
|
+
]),
|
|
199
|
+
_: 3
|
|
200
|
+
}, 16, ["type", "to", "aria-selected", "class", "disabled", "aria-disabled"]));
|
|
201
|
+
};
|
|
202
|
+
}
|
|
203
|
+
});
|
|
204
|
+
exports._sfc_main = _sfc_main;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
const vue = require("vue");
|
|
3
|
-
const
|
|
3
|
+
const pBtn_vue_vue_type_script_setup_true_lang = require("./p-btn.js");
|
|
4
4
|
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
5
5
|
...{
|
|
6
6
|
name: "PSelectBtn"
|
|
@@ -63,13 +63,14 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
63
63
|
}, [
|
|
64
64
|
(vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(_ctx.items, (item, index) => {
|
|
65
65
|
return vue.withDirectives((vue.openBlock(), vue.createElementBlock("div", {
|
|
66
|
-
key: item[_ctx.itemValue],
|
|
66
|
+
key: String(item[_ctx.itemValue]),
|
|
67
67
|
class: vue.normalizeClass(["inline-flex", { "*:px-0 *:py-0": _ctx.noPadding, grow: _ctx.grow }])
|
|
68
68
|
}, [
|
|
69
|
-
vue.createVNode(
|
|
69
|
+
vue.createVNode(pBtn_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
70
70
|
size: _ctx.size,
|
|
71
71
|
type: "secondary-outline-blue",
|
|
72
72
|
disabled: item.disabled,
|
|
73
|
+
icon: String(item.icon),
|
|
73
74
|
class: vue.normalizeClass({
|
|
74
75
|
"rounded-none": index !== 0 && index !== _ctx.items.length - 1 && _ctx.items.length > 1,
|
|
75
76
|
"rounded-br-none rounded-tr-none": index === 0 && _ctx.items.length > 1,
|
|
@@ -89,7 +90,7 @@ const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
|
89
90
|
])
|
|
90
91
|
]),
|
|
91
92
|
_: 2
|
|
92
|
-
}, 1032, ["size", "disabled", "class", "selected", "onClick"])
|
|
93
|
+
}, 1032, ["size", "disabled", "icon", "class", "selected", "onClick"])
|
|
93
94
|
], 2)), [
|
|
94
95
|
[_directive_tooltip, { content: tooltipText(item) }]
|
|
95
96
|
]);
|
package/dist/cjs/index.js
CHANGED
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
|
3
3
|
const pActionBar_vue_vue_type_script_setup_true_lang = require("./chunks/p-action-bar.js");
|
|
4
4
|
const pAlert = require("./p-alert.js");
|
|
5
5
|
const pAvatar = require("./p-avatar.js");
|
|
6
|
-
const
|
|
6
|
+
const pBtn_vue_vue_type_script_setup_true_lang = require("./chunks/p-btn.js");
|
|
7
7
|
const pCard_vue_vue_type_script_setup_true_lang = require("./chunks/p-card.js");
|
|
8
8
|
const pCheckbox = require("./p-checkbox.js");
|
|
9
9
|
const pChips = require("./p-chips.js");
|
|
@@ -13,13 +13,12 @@ const pDrawer = require("./p-drawer.js");
|
|
|
13
13
|
const pDropdown = require("./p-dropdown.js");
|
|
14
14
|
const pDropdownSelect_vue_vue_type_script_setup_true_lang = require("./chunks/p-dropdown-select.js");
|
|
15
15
|
const vue = require("vue");
|
|
16
|
-
const pFileUpload
|
|
16
|
+
const pFileUpload = require("./p-file-upload.js");
|
|
17
|
+
const pIcon_vue_vue_type_script_setup_true_lang = require("./chunks/p-icon.js");
|
|
17
18
|
const useInputClasses = require("./useInputClasses.js");
|
|
18
19
|
const lodashEs = require("lodash-es");
|
|
19
20
|
const vueToastification = require("vue-toastification");
|
|
20
|
-
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
21
21
|
const pIcon = require("./p-icon.js");
|
|
22
|
-
const pIcon_vue_vue_type_script_setup_true_lang = require("./chunks/p-icon.js");
|
|
23
22
|
const pInfoIcon_vue_vue_type_script_setup_true_lang = require("./chunks/p-info-icon.js");
|
|
24
23
|
const pInlineDatePicker_vue_vue_type_script_setup_true_lang = require("./chunks/p-inline-date-picker.js");
|
|
25
24
|
const pInput = require("./p-input.js");
|
|
@@ -46,6 +45,7 @@ const pSkeletonLoader = require("./p-skeleton-loader.js");
|
|
|
46
45
|
const pTable$1 = require("./p-table.js");
|
|
47
46
|
const usePTableColResize = require("./usePTableColResize.js");
|
|
48
47
|
const pTableHeaderCell = require("./p-table-header-cell.js");
|
|
48
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
49
49
|
const usePTableRowVirtualizer = require("./usePTableRowVirtualizer.js");
|
|
50
50
|
const pTableFilterIcon = require("./p-table-filter-icon.js");
|
|
51
51
|
const pTableLoader_vue_vue_type_script_setup_true_lang = require("./chunks/p-table-loader.js");
|
|
@@ -66,8 +66,6 @@ const pagination = require("./pagination.js");
|
|
|
66
66
|
const sanitization = require("./sanitization.js");
|
|
67
67
|
const tailwind = require("./tailwind.js");
|
|
68
68
|
const index = require("./chunks/index.js");
|
|
69
|
-
const _imports_0$1 = "data:image/svg+xml,%3csvg%20width='20'%20height='20'%20viewBox='0%200%2020%2020'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M5.8335%206.25016L10.0002%202.0835L14.1668%206.25016'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M10%202.0835V13.7502'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3cpath%20d='M2.91675%2015V18.3333H17.0834V15'%20stroke='%23767189'%20stroke-width='1.25'%20/%3e%3c/svg%3e";
|
|
70
|
-
const _imports_1$1 = "data:image/svg+xml,%3csvg%20width='48'%20height='48'%20viewBox='0%200%2048%2048'%20fill='none'%20xmlns='http://www.w3.org/2000/svg'%3e%3cpath%20d='M33%2012H14V44H42V21L33%2012Z'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M9%2036H6V4H25L28%207'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3cpath%20d='M37%2030H19M28%2021V39'%20stroke='%231A123B'%20stroke-width='3'%20/%3e%3c/svg%3e";
|
|
71
69
|
const _hoisted_1$3 = ["data-has-error"];
|
|
72
70
|
const _hoisted_2$3 = {
|
|
73
71
|
key: 0,
|
|
@@ -182,7 +180,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
182
180
|
}
|
|
183
181
|
if (props.fileTypes.length === 0) ;
|
|
184
182
|
else {
|
|
185
|
-
const extension = pFileUpload
|
|
183
|
+
const extension = pFileUpload.getFileExtension(fileName) ? `.${pFileUpload.getFileExtension(fileName)}` : "";
|
|
186
184
|
const isValidExtension = extension ? props.fileTypes.includes(extension) : false;
|
|
187
185
|
if (!isValidExtension) {
|
|
188
186
|
toast.error(`${extension} files are not allowed.`);
|
|
@@ -190,7 +188,7 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
190
188
|
}
|
|
191
189
|
}
|
|
192
190
|
if ((file.size || 0) > props.maxSizeInBytes) {
|
|
193
|
-
toast.error(`File size of ${fileName} exceeds ${pFileUpload
|
|
191
|
+
toast.error(`File size of ${fileName} exceeds ${pFileUpload.formatBytes(props.maxSizeInBytes)}.`);
|
|
194
192
|
continue;
|
|
195
193
|
}
|
|
196
194
|
res.push(file);
|
|
@@ -259,19 +257,21 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
259
257
|
}, [
|
|
260
258
|
!maxFilesReached.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_2$3, [
|
|
261
259
|
!isDraggingOver.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3$3, [
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
260
|
+
vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
261
|
+
icon: "upload",
|
|
262
|
+
width: "32",
|
|
263
|
+
class: "text-p-gray-50"
|
|
264
|
+
}),
|
|
266
265
|
vue.createElementVNode("div", _hoisted_4$3, [
|
|
267
266
|
_cache[3] || (_cache[3] = vue.createTextVNode(" Drag or ")),
|
|
268
267
|
vue.createElementVNode("span", _hoisted_5$3, "select " + vue.toDisplayString(fileWord.value), 1)
|
|
269
268
|
])
|
|
270
269
|
])) : (vue.openBlock(), vue.createElementBlock("div", _hoisted_6$3, [
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
270
|
+
vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
271
|
+
icon: "tdesign:drag-drop",
|
|
272
|
+
width: "32",
|
|
273
|
+
class: "text-primary"
|
|
274
|
+
}),
|
|
275
275
|
vue.createElementVNode("div", _hoisted_7, "Drop " + vue.toDisplayString(fileWord.value), 1)
|
|
276
276
|
])),
|
|
277
277
|
vue.createElementVNode("input", {
|
|
@@ -304,9 +304,15 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
304
304
|
title: file.name
|
|
305
305
|
}, vue.toDisplayString(file.name), 9, _hoisted_10),
|
|
306
306
|
vue.createElementVNode("button", {
|
|
307
|
-
class: "
|
|
307
|
+
class: "h-5 shrink-0 cursor-pointer overflow-hidden",
|
|
308
308
|
onClick: vue.withModifiers(($event) => removeFile(index2), ["stop"])
|
|
309
|
-
},
|
|
309
|
+
}, [
|
|
310
|
+
vue.createVNode(pIcon_vue_vue_type_script_setup_true_lang._sfc_main, {
|
|
311
|
+
icon: "weui:close2-outlined",
|
|
312
|
+
width: "20",
|
|
313
|
+
class: "text-p-gray-60 hover:text-on-error"
|
|
314
|
+
})
|
|
315
|
+
], 8, _hoisted_11)
|
|
310
316
|
], 2);
|
|
311
317
|
}), 128))
|
|
312
318
|
])
|
|
@@ -316,12 +322,11 @@ const _sfc_main$3 = /* @__PURE__ */ vue.defineComponent({
|
|
|
316
322
|
}, vue.toDisplayString(__props.errorMsg), 3), [
|
|
317
323
|
[vue.vShow, __props.errorMsg]
|
|
318
324
|
]),
|
|
319
|
-
vue.createElementVNode("div", _hoisted_12, vue.toDisplayString(__props.multiple ? `Max ${__props.maxNumberOfFiles}` : "One") + " " + vue.toDisplayString(acceptFileTypes.value) + " " + vue.toDisplayString(__props.multiple ? "files" : "file") + " with size less than " + vue.toDisplayString(vue.unref(pFileUpload
|
|
325
|
+
vue.createElementVNode("div", _hoisted_12, vue.toDisplayString(__props.multiple ? `Max ${__props.maxNumberOfFiles}` : "One") + " " + vue.toDisplayString(acceptFileTypes.value) + " " + vue.toDisplayString(__props.multiple ? "files" : "file") + " with size less than " + vue.toDisplayString(vue.unref(pFileUpload.formatBytes)(__props.maxSizeInBytes)) + " " + vue.toDisplayString(__props.multiple ? "each" : ""), 1)
|
|
320
326
|
], 10, _hoisted_1$3);
|
|
321
327
|
};
|
|
322
328
|
}
|
|
323
329
|
});
|
|
324
|
-
const pFileUpload = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main$3, [["__scopeId", "data-v-216025be"]]);
|
|
325
330
|
const _hoisted_1$2 = ["data-has-error"];
|
|
326
331
|
const _hoisted_2$2 = { class: "text-p-purple-60" };
|
|
327
332
|
const _hoisted_3$2 = { class: "flex flex-row" };
|
|
@@ -957,7 +962,7 @@ const pTableSort = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main
|
|
|
957
962
|
exports.PActionBar = pActionBar_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
958
963
|
exports.PAlert = pAlert;
|
|
959
964
|
exports.PAvatar = pAvatar;
|
|
960
|
-
exports.PBtn =
|
|
965
|
+
exports.PBtn = pBtn_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
961
966
|
exports.PCard = pCard_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
962
967
|
exports.PCheckbox = pCheckbox;
|
|
963
968
|
exports.PChips = pChips;
|
|
@@ -966,9 +971,9 @@ exports.PDatePicker = pDatePicker_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
|
966
971
|
exports.PDrawer = pDrawer;
|
|
967
972
|
exports.PDropdown = pDropdown;
|
|
968
973
|
exports.PDropdownSelect = pDropdownSelect_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
974
|
+
exports.PIcon = pIcon_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
969
975
|
exports.useInputClasses = useInputClasses.useInputClasses;
|
|
970
976
|
exports.P_ICON_ALIASES = pIcon.P_ICON_ALIASES;
|
|
971
|
-
exports.PIcon = pIcon_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
972
977
|
exports.PInfoIcon = pInfoIcon_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
973
978
|
exports.PInlineDatePicker = pInlineDatePicker_vue_vue_type_script_setup_true_lang._sfc_main;
|
|
974
979
|
exports.PInput = pInput;
|
|
@@ -1027,7 +1032,7 @@ exports.createTV = index.fe;
|
|
|
1027
1032
|
exports.defaultConfig = index.ie;
|
|
1028
1033
|
exports.tv = index.ce;
|
|
1029
1034
|
exports.voidEmpty = index.x;
|
|
1030
|
-
exports.PFileUpload =
|
|
1035
|
+
exports.PFileUpload = _sfc_main$3;
|
|
1031
1036
|
exports.PSelectList = _sfc_main$2;
|
|
1032
1037
|
exports.PTable = pTable;
|
|
1033
1038
|
exports.PTableSort = pTableSort;
|
package/dist/cjs/inputClasses.js
CHANGED
|
@@ -39,7 +39,9 @@ const inputClasses = index.ce({
|
|
|
39
39
|
}
|
|
40
40
|
},
|
|
41
41
|
rounded: {
|
|
42
|
-
true:
|
|
42
|
+
true: {
|
|
43
|
+
input: "rounded-full"
|
|
44
|
+
}
|
|
43
45
|
}
|
|
44
46
|
},
|
|
45
47
|
compoundVariants: [
|
|
@@ -111,13 +113,13 @@ const selectClasses = index.ce({
|
|
|
111
113
|
variants: {
|
|
112
114
|
size: {
|
|
113
115
|
sm: {
|
|
114
|
-
input: "bg-[right_0.675rem_center] pr-8"
|
|
116
|
+
input: "bg-[position:right_0.675rem_center] pr-8"
|
|
115
117
|
},
|
|
116
118
|
md: {
|
|
117
|
-
input: "bg-[right_1rem_center] pr-10"
|
|
119
|
+
input: "bg-[position:right_1rem_center] pr-10"
|
|
118
120
|
},
|
|
119
121
|
lg: {
|
|
120
|
-
input: "bg-[right_1.25rem_center] pr-12"
|
|
122
|
+
input: "bg-[position:right_1.25rem_center] pr-12"
|
|
121
123
|
}
|
|
122
124
|
}
|
|
123
125
|
}
|
package/dist/cjs/p-btn.js
CHANGED
|
@@ -1,170 +1,3 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
const
|
|
3
|
-
|
|
4
|
-
const link = require("./link.js");
|
|
5
|
-
const sanitization = require("./sanitization.js");
|
|
6
|
-
const index = require("./chunks/index.js");
|
|
7
|
-
const vue = require("vue");
|
|
8
|
-
const vueRouter = require("vue-router");
|
|
9
|
-
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
10
|
-
const btnClasses = {
|
|
11
|
-
slots: {
|
|
12
|
-
button: "relative inline-block rounded font-medium outline-none disabled:pointer-events-none disabled:cursor-default disabled:opacity-50 aria-disabled:pointer-events-none aria-disabled:cursor-default aria-disabled:opacity-50",
|
|
13
|
-
loader: "absolute bottom-0 left-0 right-0 top-0 flex items-center justify-center font-medium"
|
|
14
|
-
},
|
|
15
|
-
variants: {
|
|
16
|
-
type: {
|
|
17
|
-
primary: {
|
|
18
|
-
button: "bg-primary text-surface hover:bg-accent active:bg-p-blue-80",
|
|
19
|
-
loader: "text-surface"
|
|
20
|
-
},
|
|
21
|
-
secondary: {
|
|
22
|
-
button: "bg-p-gray-20 hover:bg-p-gray-30 active:bg-p-gray-40",
|
|
23
|
-
loader: "text-p-purple-60"
|
|
24
|
-
},
|
|
25
|
-
"primary-outline": {
|
|
26
|
-
button: "bg-p-blue-10 text-p-purple-60 ring-1 ring-inset ring-p-purple-60 hover:bg-p-gray-20",
|
|
27
|
-
loader: "text-p-purple-60"
|
|
28
|
-
},
|
|
29
|
-
"secondary-outline": {
|
|
30
|
-
button: "bg-surface text-p-purple-60 ring-1 ring-inset ring-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-10",
|
|
31
|
-
loader: "text-p-purple-60"
|
|
32
|
-
},
|
|
33
|
-
"secondary-outline-blue": {
|
|
34
|
-
button: "bg-surface text-p-purple-60 ring-1 ring-inset ring-p-gray-30 hover:bg-p-blue-10 aria-selected:bg-p-blue-15 aria-selected:text-p-blue-60",
|
|
35
|
-
loader: "text-p-purple-60"
|
|
36
|
-
},
|
|
37
|
-
error: { button: "bg-p-red-40 text-white hover:bg-p-red-50", loader: "text-white" },
|
|
38
|
-
success: { button: "bg-p-green-40 text-white hover:bg-p-green-50", loader: "text-white" },
|
|
39
|
-
"primary-link": { button: "bg-transparent text-primary underline hover:text-accent", loader: "text-p-blue-60" },
|
|
40
|
-
"secondary-ghost": { button: "text-on-surface hover:bg-p-gray-20", loader: "text-p-purple-60" },
|
|
41
|
-
"secondary-ghost-dark": { button: "text-white hover:bg-p-purple-50", loader: "text-p-blue-15" }
|
|
42
|
-
},
|
|
43
|
-
size: {
|
|
44
|
-
sm: { button: "px-2 py-1 text-sm" },
|
|
45
|
-
md: { button: "px-6 py-2 text-base" },
|
|
46
|
-
lg: { button: "px-6 py-2.5 text-lg" }
|
|
47
|
-
}
|
|
48
|
-
},
|
|
49
|
-
defaultVariants: {
|
|
50
|
-
type: "primary",
|
|
51
|
-
size: "md"
|
|
52
|
-
}
|
|
53
|
-
};
|
|
54
|
-
const btn = index.ce(btnClasses);
|
|
55
|
-
const BUTTON_TYPES = Object.keys(btnClasses.variants.type);
|
|
56
|
-
const BUTTON_NATIVE_TYPES = ["button", "submit", "reset"];
|
|
57
|
-
const LOADER_SIZES = { sm: 24, md: 30, lg: 40 };
|
|
58
|
-
const _sfc_main = vue.defineComponent({
|
|
59
|
-
name: "PBtn",
|
|
60
|
-
components: {
|
|
61
|
-
PRingLoader: pRingLoader_vue_vue_type_script_setup_true_lang._sfc_main,
|
|
62
|
-
RouterLink: vueRouter.RouterLink
|
|
63
|
-
},
|
|
64
|
-
inheritAttrs: false,
|
|
65
|
-
props: {
|
|
66
|
-
/**
|
|
67
|
-
* The button style e.g primary, secondary, primary-outline, secondary-outline, error, success, primary-link
|
|
68
|
-
*/
|
|
69
|
-
type: {
|
|
70
|
-
type: String,
|
|
71
|
-
default: "primary",
|
|
72
|
-
validator(value) {
|
|
73
|
-
return BUTTON_TYPES.includes(value);
|
|
74
|
-
}
|
|
75
|
-
},
|
|
76
|
-
/**
|
|
77
|
-
* The button native type e.g button, submit, reset
|
|
78
|
-
*/
|
|
79
|
-
nativeType: {
|
|
80
|
-
type: String,
|
|
81
|
-
default: "button",
|
|
82
|
-
validator(value) {
|
|
83
|
-
return BUTTON_NATIVE_TYPES.includes(value);
|
|
84
|
-
}
|
|
85
|
-
},
|
|
86
|
-
/**
|
|
87
|
-
* The button size e.g sm, md, lg
|
|
88
|
-
*/
|
|
89
|
-
size: {
|
|
90
|
-
type: String,
|
|
91
|
-
default: "md",
|
|
92
|
-
validator(value) {
|
|
93
|
-
return pBtn_types.SIZES.includes(value);
|
|
94
|
-
}
|
|
95
|
-
},
|
|
96
|
-
/**
|
|
97
|
-
* Whether the button is loading
|
|
98
|
-
*/
|
|
99
|
-
loading: {
|
|
100
|
-
type: Boolean,
|
|
101
|
-
default: false
|
|
102
|
-
},
|
|
103
|
-
/**
|
|
104
|
-
* Whether the button is selected (sets aria-selected attribute)
|
|
105
|
-
*/
|
|
106
|
-
selected: {
|
|
107
|
-
type: Boolean,
|
|
108
|
-
default: false
|
|
109
|
-
},
|
|
110
|
-
/**
|
|
111
|
-
* Exactly as the `to` prop in `RouterLink`, when used, it renders a link that triggers a navigation on click.
|
|
112
|
-
* See https://router.vuejs.org/api/#RouteLocationRaw
|
|
113
|
-
*/
|
|
114
|
-
to: {
|
|
115
|
-
type: [Object, String],
|
|
116
|
-
default: ""
|
|
117
|
-
}
|
|
118
|
-
},
|
|
119
|
-
computed: {
|
|
120
|
-
classes() {
|
|
121
|
-
const { button, loader } = btn({ type: this.type, size: this.size });
|
|
122
|
-
return { button: button(), loader: loader() };
|
|
123
|
-
},
|
|
124
|
-
loaderSize() {
|
|
125
|
-
return Number(`${LOADER_SIZES[this.size]}`);
|
|
126
|
-
}
|
|
127
|
-
},
|
|
128
|
-
methods: {
|
|
129
|
-
isExternalLink: link.isExternalLink,
|
|
130
|
-
sanitizeUrl: sanitization.sanitizeUrl
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
const _hoisted_1 = ["href", "disabled", "aria-disabled"];
|
|
134
|
-
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
135
|
-
const _component_PRingLoader = vue.resolveComponent("PRingLoader");
|
|
136
|
-
return typeof _ctx.to === "string" && _ctx.isExternalLink(_ctx.to) ? (vue.openBlock(), vue.createElementBlock("a", vue.mergeProps({ key: 0 }, _ctx.$attrs, {
|
|
137
|
-
href: _ctx.sanitizeUrl(_ctx.to),
|
|
138
|
-
target: "_blank",
|
|
139
|
-
class: _ctx.classes.button,
|
|
140
|
-
disabled: !!_ctx.$attrs.disabled ? true : null,
|
|
141
|
-
"aria-disabled": !!_ctx.$attrs.disabled
|
|
142
|
-
}), [
|
|
143
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
144
|
-
], 16, _hoisted_1)) : (vue.openBlock(), vue.createBlock(vue.resolveDynamicComponent(_ctx.to ? "RouterLink" : "button"), vue.mergeProps({
|
|
145
|
-
key: 1,
|
|
146
|
-
type: _ctx.to ? null : _ctx.nativeType,
|
|
147
|
-
to: _ctx.to ? _ctx.to : null,
|
|
148
|
-
"aria-selected": _ctx.selected,
|
|
149
|
-
class: _ctx.classes.button
|
|
150
|
-
}, _ctx.$attrs, {
|
|
151
|
-
disabled: !!_ctx.$attrs.disabled || _ctx.loading ? true : null,
|
|
152
|
-
"aria-disabled": _ctx.$attrs.disabled
|
|
153
|
-
}), {
|
|
154
|
-
default: vue.withCtx(() => [
|
|
155
|
-
vue.createElementVNode("div", {
|
|
156
|
-
class: vue.normalizeClass({ invisible: _ctx.loading })
|
|
157
|
-
}, [
|
|
158
|
-
vue.renderSlot(_ctx.$slots, "default")
|
|
159
|
-
], 2),
|
|
160
|
-
_ctx.loading ? (vue.openBlock(), vue.createBlock(_component_PRingLoader, {
|
|
161
|
-
key: 0,
|
|
162
|
-
size: _ctx.loaderSize,
|
|
163
|
-
class: vue.normalizeClass(_ctx.classes.loader)
|
|
164
|
-
}, null, 8, ["size", "class"])) : vue.createCommentVNode("", true)
|
|
165
|
-
]),
|
|
166
|
-
_: 3
|
|
167
|
-
}, 16, ["type", "to", "aria-selected", "class", "disabled", "aria-disabled"]));
|
|
168
|
-
}
|
|
169
|
-
const PBtn = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
170
|
-
module.exports = PBtn;
|
|
2
|
+
const pBtn_vue_vue_type_script_setup_true_lang = require("./chunks/p-btn.js");
|
|
3
|
+
module.exports = pBtn_vue_vue_type_script_setup_true_lang._sfc_main;
|