@pequity/squirrel 1.0.20-beta.2 → 1.0.20-beta.3
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/_plugin-vue_export-helper.js +9 -1
- package/dist/cjs/chunks/p-action-bar.js +60 -1
- package/dist/cjs/chunks/p-card.js +28 -1
- package/dist/cjs/chunks/p-checkbox.js +24 -1
- package/dist/cjs/chunks/p-dropdown-select.js +414 -1
- package/dist/cjs/chunks/p-input-percent.js +53 -1
- package/dist/cjs/chunks/p-pagination-info.js +66 -1
- package/dist/cjs/chunks/p-pagination.js +122 -1
- package/dist/cjs/chunks/p-ring-loader.js +81 -1
- package/dist/cjs/chunks/p-select-btn.js +97 -1
- package/dist/cjs/chunks/p-select.js +123 -1
- package/dist/cjs/chunks/p-table-loader.js +70 -1
- package/dist/cjs/chunks/p-tabs.js +52 -1
- package/dist/cjs/config.js +105 -1
- package/dist/cjs/currency.js +9 -1
- package/dist/cjs/dom.js +27 -1
- package/dist/cjs/index.js +976 -1
- package/dist/cjs/inputClassesMixin.js +50 -1
- package/dist/cjs/inputClassesShared.js +76 -1
- package/dist/cjs/listKeyboardNavigation.js +110 -1
- package/dist/cjs/number.js +9 -1
- package/dist/cjs/object.js +4 -1
- package/dist/cjs/p-action-bar.js +3 -1
- package/dist/cjs/p-alert.js +65 -1
- package/dist/cjs/p-avatar.js +71 -1
- package/dist/cjs/p-btn.js +358 -2
- package/dist/cjs/p-card.js +3 -1
- package/dist/cjs/p-checkbox.js +3 -1
- package/dist/cjs/p-chips.js +110 -1
- package/dist/cjs/p-close-btn.js +36 -1
- package/dist/cjs/p-date-picker.js +139 -1
- package/dist/cjs/p-drawer.js +253 -1
- package/dist/cjs/p-dropdown-select.js +3 -1
- package/dist/cjs/p-dropdown.js +138 -1
- package/dist/cjs/p-file-upload.js +21 -1
- package/dist/cjs/p-info-icon.js +35 -1
- package/dist/cjs/p-inline-date-picker.js +142 -1
- package/dist/cjs/p-input-number.js +146 -1
- package/dist/cjs/p-input-percent.js +3 -1
- package/dist/cjs/p-input-search.js +110 -1
- package/dist/cjs/p-input.js +89 -1
- package/dist/cjs/p-loading.js +38 -1
- package/dist/cjs/p-modal.js +369 -1
- package/dist/cjs/p-pagination-info.js +3 -1
- package/dist/cjs/p-pagination.js +3 -1
- package/dist/cjs/p-progress-bar.js +41 -1
- package/dist/cjs/p-ring-loader.js +3 -1
- package/dist/cjs/p-select-btn.js +3 -1
- package/dist/cjs/p-select-list.js +4 -1
- package/dist/cjs/p-select-pill.js +111 -1
- package/dist/cjs/p-select.js +3 -1
- package/dist/cjs/p-skeleton-loader.js +73 -1
- package/dist/cjs/p-table-filter-icon.js +20 -1
- package/dist/cjs/p-table-header-cell.js +75 -1
- package/dist/cjs/p-table-loader.js +3 -1
- package/dist/cjs/p-table-sort.js +8 -1
- package/dist/cjs/p-table-td.js +88 -1
- package/dist/cjs/p-table.js +12 -1
- package/dist/cjs/p-tabs.js +3 -1
- package/dist/cjs/p-textarea.js +73 -1
- package/dist/cjs/p-toggle.js +114 -1
- package/dist/cjs/pagination.js +29 -1
- package/dist/cjs/string.js +12 -1
- package/dist/cjs/tailwind.js +4353 -1
- package/dist/cjs/text.js +16 -1
- package/dist/cjs/useInputClasses.js +44 -1
- package/dist/cjs/usePLoading.js +35 -1
- package/dist/cjs/usePModal.js +21 -1
- package/dist/cjs/usePTableColResize.js +81 -1
- package/dist/cjs/usePTableRowVirtualizer.js +31 -1
- package/dist/cjs/useSelectList.js +256 -1
- package/dist/es/chunks/_plugin-vue_export-helper.js +7 -6
- package/dist/es/chunks/p-action-bar.js +45 -36
- package/dist/es/chunks/p-card.js +18 -14
- package/dist/es/chunks/p-checkbox.js +14 -11
- package/dist/es/chunks/p-dropdown-select.js +232 -183
- package/dist/es/chunks/p-input-percent.js +34 -25
- package/dist/es/chunks/p-pagination-info.js +30 -24
- package/dist/es/chunks/p-pagination.js +78 -48
- package/dist/es/chunks/p-ring-loader.js +63 -40
- package/dist/es/chunks/p-select-btn.js +80 -59
- package/dist/es/chunks/p-select.js +81 -54
- package/dist/es/chunks/p-table-loader.js +46 -32
- package/dist/es/chunks/p-tabs.js +35 -29
- package/dist/es/config.js +2 -2
- package/dist/es/currency.js +3 -3
- package/dist/es/dom.js +24 -12
- package/dist/es/index.js +703 -561
- package/dist/es/inputClassesMixin.js +20 -14
- package/dist/es/inputClassesShared.js +60 -45
- package/dist/es/listKeyboardNavigation.js +86 -36
- package/dist/es/number.js +7 -2
- package/dist/es/object.js +2 -2
- package/dist/es/p-action-bar.js +2 -2
- package/dist/es/p-alert.js +35 -30
- package/dist/es/p-avatar.js +30 -27
- package/dist/es/p-btn.js +209 -164
- package/dist/es/p-card.js +2 -2
- package/dist/es/p-checkbox.js +2 -2
- package/dist/es/p-chips.js +60 -40
- package/dist/es/p-close-btn.js +20 -16
- package/dist/es/p-date-picker.js +66 -58
- package/dist/es/p-drawer.js +108 -89
- package/dist/es/p-dropdown-select.js +2 -2
- package/dist/es/p-dropdown.js +52 -33
- package/dist/es/p-file-upload.js +17 -9
- package/dist/es/p-info-icon.js +21 -16
- package/dist/es/p-inline-date-picker.js +64 -53
- package/dist/es/p-input-number.js +84 -66
- package/dist/es/p-input-percent.js +2 -2
- package/dist/es/p-input-search.js +43 -41
- package/dist/es/p-input.js +51 -45
- package/dist/es/p-loading.js +31 -22
- package/dist/es/p-modal.js +261 -174
- package/dist/es/p-pagination-info.js +2 -2
- package/dist/es/p-pagination.js +2 -2
- package/dist/es/p-progress-bar.js +26 -23
- package/dist/es/p-ring-loader.js +2 -2
- package/dist/es/p-select-btn.js +2 -2
- package/dist/es/p-select-list.js +2 -2
- package/dist/es/p-select-pill.js +58 -41
- package/dist/es/p-select.js +2 -2
- package/dist/es/p-skeleton-loader.js +34 -29
- package/dist/es/p-table-filter-icon.js +11 -11
- package/dist/es/p-table-header-cell.js +38 -33
- package/dist/es/p-table-loader.js +2 -2
- package/dist/es/p-table-sort.js +2 -2
- package/dist/es/p-table-td.js +76 -29
- package/dist/es/p-table.js +10 -6
- package/dist/es/p-tabs.js +2 -2
- package/dist/es/p-textarea.js +36 -34
- package/dist/es/p-toggle.js +53 -48
- package/dist/es/pagination.js +25 -8
- package/dist/es/string.js +10 -2
- package/dist/es/tailwind.js +1660 -1101
- package/dist/es/text.js +13 -8
- package/dist/es/useInputClasses.js +38 -22
- package/dist/es/usePLoading.js +31 -15
- package/dist/es/usePModal.js +15 -12
- package/dist/es/usePTableColResize.js +71 -39
- package/dist/es/usePTableRowVirtualizer.js +24 -15
- package/dist/es/useSelectList.js +234 -121
- package/dist/style.css +2124 -1
- package/package.json +1 -1
package/dist/es/p-drawer.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import { defineComponent
|
|
4
|
-
import { _ as
|
|
5
|
-
const
|
|
1
|
+
import PAlert from "./p-alert.js";
|
|
2
|
+
import PCloseBtn from "./p-close-btn.js";
|
|
3
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, Teleport, createVNode, Transition, withCtx, withDirectives, createElementVNode, normalizeClass, normalizeStyle, vShow, renderSlot, createCommentVNode, createElementBlock, toDisplayString } from "vue";
|
|
4
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
5
|
+
const _sfc_main = defineComponent({
|
|
6
6
|
name: "PDrawer",
|
|
7
7
|
components: {
|
|
8
|
-
PAlert
|
|
9
|
-
PCloseBtn
|
|
8
|
+
PAlert,
|
|
9
|
+
PCloseBtn
|
|
10
10
|
},
|
|
11
11
|
props: {
|
|
12
12
|
appendTo: {
|
|
@@ -19,7 +19,7 @@ const S = $({
|
|
|
19
19
|
},
|
|
20
20
|
disabled: {
|
|
21
21
|
type: Boolean,
|
|
22
|
-
default:
|
|
22
|
+
default: false
|
|
23
23
|
},
|
|
24
24
|
errorMsg: {
|
|
25
25
|
type: String,
|
|
@@ -51,11 +51,11 @@ const S = $({
|
|
|
51
51
|
},
|
|
52
52
|
live: {
|
|
53
53
|
type: Boolean,
|
|
54
|
-
default:
|
|
54
|
+
default: false
|
|
55
55
|
},
|
|
56
56
|
modelValue: {
|
|
57
57
|
type: Boolean,
|
|
58
|
-
default:
|
|
58
|
+
default: false
|
|
59
59
|
},
|
|
60
60
|
closeLabel: {
|
|
61
61
|
type: String,
|
|
@@ -63,19 +63,19 @@ const S = $({
|
|
|
63
63
|
},
|
|
64
64
|
showBackdrop: {
|
|
65
65
|
type: Boolean,
|
|
66
|
-
default:
|
|
66
|
+
default: false
|
|
67
67
|
},
|
|
68
68
|
enableClose: {
|
|
69
69
|
type: Boolean,
|
|
70
|
-
default:
|
|
70
|
+
default: true
|
|
71
71
|
}
|
|
72
72
|
},
|
|
73
73
|
emits: ["update:modelValue", "before-open", "opening", "opened", "before-close", "closing", "closed"],
|
|
74
74
|
data() {
|
|
75
75
|
return {
|
|
76
76
|
id: null,
|
|
77
|
-
show:
|
|
78
|
-
mount:
|
|
77
|
+
show: false,
|
|
78
|
+
mount: false
|
|
79
79
|
};
|
|
80
80
|
},
|
|
81
81
|
computed: {
|
|
@@ -87,22 +87,32 @@ const S = $({
|
|
|
87
87
|
}
|
|
88
88
|
},
|
|
89
89
|
created() {
|
|
90
|
-
|
|
90
|
+
if (this.live) {
|
|
91
|
+
this.mount = true;
|
|
92
|
+
}
|
|
91
93
|
},
|
|
92
94
|
mounted() {
|
|
93
|
-
this.id = "drawer-" + this.$.uid
|
|
95
|
+
this.id = "drawer-" + this.$.uid;
|
|
96
|
+
this.$watch(
|
|
94
97
|
"modelValue",
|
|
95
|
-
(
|
|
96
|
-
|
|
97
|
-
this.
|
|
98
|
-
|
|
98
|
+
(newVal) => {
|
|
99
|
+
if (newVal) {
|
|
100
|
+
this.mount = true;
|
|
101
|
+
this.$nextTick(() => {
|
|
102
|
+
this.show = true;
|
|
103
|
+
});
|
|
104
|
+
} else {
|
|
105
|
+
this.show = false;
|
|
106
|
+
}
|
|
99
107
|
},
|
|
100
|
-
{ immediate:
|
|
108
|
+
{ immediate: true }
|
|
101
109
|
);
|
|
102
110
|
},
|
|
103
111
|
methods: {
|
|
104
112
|
close() {
|
|
105
|
-
this.enableClose ===
|
|
113
|
+
if (this.enableClose === true) {
|
|
114
|
+
this.$emit("update:modelValue", false);
|
|
115
|
+
}
|
|
106
116
|
},
|
|
107
117
|
beforeOpen() {
|
|
108
118
|
this.$emit("before-open");
|
|
@@ -120,116 +130,125 @@ const S = $({
|
|
|
120
130
|
this.$emit("closing");
|
|
121
131
|
},
|
|
122
132
|
closed() {
|
|
123
|
-
|
|
133
|
+
if (!this.live) {
|
|
134
|
+
this.mount = false;
|
|
135
|
+
}
|
|
136
|
+
this.$nextTick(() => {
|
|
124
137
|
this.$emit("closed");
|
|
125
138
|
});
|
|
126
139
|
}
|
|
127
140
|
}
|
|
128
|
-
})
|
|
141
|
+
});
|
|
142
|
+
const _hoisted_1 = ["data-drawer-id", "aria-label", "aria-describedby", "aria-labelledby"];
|
|
143
|
+
const _hoisted_2 = ["id"];
|
|
144
|
+
const _hoisted_3 = {
|
|
129
145
|
key: 0,
|
|
130
146
|
class: "px-6 pt-6"
|
|
131
|
-
}
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
147
|
+
};
|
|
148
|
+
const _hoisted_4 = { class: "whitespace-pre-line" };
|
|
149
|
+
const _hoisted_5 = { class: "footer p-6" };
|
|
150
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
151
|
+
const _component_PCloseBtn = resolveComponent("PCloseBtn");
|
|
152
|
+
const _component_PAlert = resolveComponent("PAlert");
|
|
153
|
+
return _ctx.mount ? (openBlock(), createBlock(Teleport, {
|
|
135
154
|
key: 0,
|
|
136
|
-
to:
|
|
155
|
+
to: _ctx.appendTo
|
|
137
156
|
}, [
|
|
138
|
-
|
|
157
|
+
createVNode(Transition, {
|
|
139
158
|
name: "pd-backdrop-transition",
|
|
140
159
|
"enter-active-class": "fadeIn",
|
|
141
160
|
"leave-active-class": "fadeOut"
|
|
142
161
|
}, {
|
|
143
|
-
default:
|
|
144
|
-
|
|
145
|
-
class:
|
|
146
|
-
style:
|
|
162
|
+
default: withCtx(() => [
|
|
163
|
+
withDirectives(createElementVNode("div", {
|
|
164
|
+
class: normalizeClass(["fixed bottom-0 left-0 right-0 top-0 bg-black bg-opacity-20", { "cursor-pointer": _ctx.enableClose }]),
|
|
165
|
+
style: normalizeStyle({ "z-index": _ctx.zIndex - 1 }),
|
|
147
166
|
tabindex: "-1",
|
|
148
|
-
onClick:
|
|
167
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
|
|
149
168
|
}, null, 6), [
|
|
150
|
-
[
|
|
169
|
+
[vShow, _ctx.show && _ctx.showBackdrop]
|
|
151
170
|
])
|
|
152
171
|
]),
|
|
153
172
|
_: 1
|
|
154
173
|
}),
|
|
155
|
-
|
|
174
|
+
createVNode(Transition, {
|
|
156
175
|
name: "drawer-transition",
|
|
157
|
-
"enter-active-class":
|
|
158
|
-
"leave-active-class":
|
|
159
|
-
onBeforeEnter:
|
|
160
|
-
onEnter:
|
|
161
|
-
onAfterEnter:
|
|
162
|
-
onBeforeLeave:
|
|
163
|
-
onLeave:
|
|
164
|
-
onAfterLeave:
|
|
176
|
+
"enter-active-class": _ctx.transitionInClass,
|
|
177
|
+
"leave-active-class": _ctx.transitionOutClass,
|
|
178
|
+
onBeforeEnter: _ctx.beforeOpen,
|
|
179
|
+
onEnter: _ctx.opening,
|
|
180
|
+
onAfterEnter: _ctx.opened,
|
|
181
|
+
onBeforeLeave: _ctx.beforeClose,
|
|
182
|
+
onLeave: _ctx.closing,
|
|
183
|
+
onAfterLeave: _ctx.closed
|
|
165
184
|
}, {
|
|
166
|
-
default:
|
|
167
|
-
|
|
168
|
-
"data-drawer-id":
|
|
185
|
+
default: withCtx(() => [
|
|
186
|
+
withDirectives(createElementVNode("div", {
|
|
187
|
+
"data-drawer-id": _ctx.id,
|
|
169
188
|
tabindex: "-1",
|
|
170
|
-
class:
|
|
171
|
-
style:
|
|
189
|
+
class: normalizeClass([_ctx.drawerClass, _ctx.position === "right" ? "drawer-right" : "drawer-left"]),
|
|
190
|
+
style: normalizeStyle({ "z-index": _ctx.zIndex, ..._ctx.drawerStyle }),
|
|
172
191
|
role: "dialog",
|
|
173
|
-
"aria-label":
|
|
192
|
+
"aria-label": _ctx.title,
|
|
174
193
|
"aria-modal": "false",
|
|
175
|
-
"aria-describedby": `${
|
|
176
|
-
"aria-labelledby": `${
|
|
194
|
+
"aria-describedby": `${_ctx.id}-content`,
|
|
195
|
+
"aria-labelledby": `${_ctx.id}-title`
|
|
177
196
|
}, [
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
class:
|
|
197
|
+
renderSlot(_ctx.$slots, "title-wrapper", {}, () => [
|
|
198
|
+
createElementVNode("div", {
|
|
199
|
+
class: normalizeClass([
|
|
181
200
|
"flex items-center border-b border-p-gray-30 px-6 pb-4 pt-4",
|
|
182
|
-
{ "flex-row-reverse":
|
|
201
|
+
{ "flex-row-reverse": _ctx.position === "right" }
|
|
183
202
|
])
|
|
184
203
|
}, [
|
|
185
|
-
|
|
204
|
+
_ctx.enableClose ? (openBlock(), createBlock(_component_PCloseBtn, {
|
|
186
205
|
key: 0,
|
|
187
|
-
"aria-label":
|
|
206
|
+
"aria-label": _ctx.closeLabel,
|
|
188
207
|
class: "flex-0",
|
|
189
|
-
disabled:
|
|
190
|
-
onClick:
|
|
191
|
-
}, null, 8, ["aria-label", "disabled", "onClick"])) :
|
|
192
|
-
|
|
193
|
-
|
|
208
|
+
disabled: _ctx.disabled,
|
|
209
|
+
onClick: _ctx.close
|
|
210
|
+
}, null, 8, ["aria-label", "disabled", "onClick"])) : createCommentVNode("", true),
|
|
211
|
+
renderSlot(_ctx.$slots, "title", {}, () => [
|
|
212
|
+
_ctx.title ? (openBlock(), createElementBlock("h3", {
|
|
194
213
|
key: 0,
|
|
195
|
-
id: `${
|
|
196
|
-
class:
|
|
197
|
-
},
|
|
198
|
-
],
|
|
214
|
+
id: `${_ctx.id}-title`,
|
|
215
|
+
class: normalizeClass(["flex-1 text-xl font-medium", { "text-right": _ctx.position === "left" }])
|
|
216
|
+
}, toDisplayString(_ctx.title), 11, _hoisted_2)) : createCommentVNode("", true)
|
|
217
|
+
], true)
|
|
199
218
|
], 2)
|
|
200
|
-
],
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
default:
|
|
204
|
-
|
|
219
|
+
], true),
|
|
220
|
+
_ctx.errorMsg ? (openBlock(), createElementBlock("div", _hoisted_3, [
|
|
221
|
+
createVNode(_component_PAlert, { type: "error" }, {
|
|
222
|
+
default: withCtx(() => [
|
|
223
|
+
createElementVNode("div", _hoisted_4, toDisplayString(_ctx.errorMsg), 1)
|
|
205
224
|
]),
|
|
206
225
|
_: 1
|
|
207
226
|
})
|
|
208
|
-
])) :
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
class:
|
|
227
|
+
])) : createCommentVNode("", true),
|
|
228
|
+
renderSlot(_ctx.$slots, "content-wrapper", {}, () => [
|
|
229
|
+
createElementVNode("div", {
|
|
230
|
+
class: normalizeClass([
|
|
212
231
|
"relative grow overflow-y-auto overflow-x-hidden px-6 pt-6",
|
|
213
|
-
{ "pointer-events-none opacity-50":
|
|
232
|
+
{ "pointer-events-none opacity-50": _ctx.disabled }
|
|
214
233
|
])
|
|
215
234
|
}, [
|
|
216
|
-
|
|
235
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
217
236
|
], 2)
|
|
218
|
-
],
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
237
|
+
], true),
|
|
238
|
+
renderSlot(_ctx.$slots, "footer-wrapper", {}, () => [
|
|
239
|
+
createElementVNode("div", _hoisted_5, [
|
|
240
|
+
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
222
241
|
])
|
|
223
|
-
],
|
|
224
|
-
], 14,
|
|
225
|
-
[
|
|
242
|
+
], true)
|
|
243
|
+
], 14, _hoisted_1), [
|
|
244
|
+
[vShow, _ctx.show]
|
|
226
245
|
])
|
|
227
246
|
]),
|
|
228
247
|
_: 3
|
|
229
248
|
}, 8, ["enter-active-class", "leave-active-class", "onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])
|
|
230
|
-
], 8, ["to"])) :
|
|
249
|
+
], 8, ["to"])) : createCommentVNode("", true);
|
|
231
250
|
}
|
|
232
|
-
const
|
|
251
|
+
const pDrawer = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a0b8be1e"]]);
|
|
233
252
|
export {
|
|
234
|
-
|
|
253
|
+
pDrawer as default
|
|
235
254
|
};
|
package/dist/es/p-dropdown.js
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { setupListKeyboardNavigation
|
|
2
|
-
import { defineComponent
|
|
3
|
-
import { _ as
|
|
4
|
-
const
|
|
1
|
+
import { setupListKeyboardNavigation } from "./listKeyboardNavigation.js";
|
|
2
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, mergeProps, createSlots, renderList, withCtx, renderSlot, normalizeProps, guardReactiveProps } from "vue";
|
|
3
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
4
|
+
const ESCAPE_KEY = "Escape";
|
|
5
|
+
const _sfc_main = defineComponent({
|
|
5
6
|
name: "PDropdown",
|
|
6
|
-
inheritAttrs:
|
|
7
|
+
inheritAttrs: false,
|
|
7
8
|
props: {
|
|
8
9
|
/**
|
|
9
10
|
* Enables navigation for `.dropdown-item` using the up/down keys.
|
|
@@ -11,14 +12,14 @@ const g = "Escape", $ = p({
|
|
|
11
12
|
*/
|
|
12
13
|
enableArrowNavigation: {
|
|
13
14
|
type: Boolean,
|
|
14
|
-
default:
|
|
15
|
+
default: true
|
|
15
16
|
},
|
|
16
17
|
/**
|
|
17
18
|
* Enables closing the dropdown with the Escape key.
|
|
18
19
|
*/
|
|
19
20
|
enableCloseOnEsc: {
|
|
20
21
|
type: Boolean,
|
|
21
|
-
default:
|
|
22
|
+
default: true
|
|
22
23
|
},
|
|
23
24
|
/**
|
|
24
25
|
* The selector that the arrow navigation function will use to
|
|
@@ -58,23 +59,31 @@ const g = "Escape", $ = p({
|
|
|
58
59
|
return {
|
|
59
60
|
defaultAttrs: {
|
|
60
61
|
triggers: ["click"],
|
|
61
|
-
"auto-hide":
|
|
62
|
+
"auto-hide": true,
|
|
62
63
|
theme: "p-dropdown-theme",
|
|
63
64
|
"popper-class": "dropdown",
|
|
64
65
|
placement: "bottom-start",
|
|
65
66
|
distance: 4,
|
|
66
67
|
delay: 0,
|
|
67
|
-
handleResize:
|
|
68
|
+
handleResize: true
|
|
68
69
|
},
|
|
69
70
|
navigationSvc: null
|
|
70
71
|
};
|
|
71
72
|
},
|
|
72
73
|
watch: {
|
|
73
74
|
reference: {
|
|
74
|
-
async handler(
|
|
75
|
-
if (
|
|
76
|
-
const
|
|
77
|
-
|
|
75
|
+
async handler(nV, oV) {
|
|
76
|
+
if (nV && oV !== nV) {
|
|
77
|
+
const popper = this.$refs.vPopper.$refs.popper;
|
|
78
|
+
if (popper) {
|
|
79
|
+
popper.$_detachPopperNode();
|
|
80
|
+
if (popper.shown) {
|
|
81
|
+
popper.hide({ skipDelay: true });
|
|
82
|
+
}
|
|
83
|
+
if (this.reference) {
|
|
84
|
+
popper.$_referenceNode = this.reference;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
78
87
|
}
|
|
79
88
|
}
|
|
80
89
|
}
|
|
@@ -87,34 +96,44 @@ const g = "Escape", $ = p({
|
|
|
87
96
|
},
|
|
88
97
|
methods: {
|
|
89
98
|
onShow() {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
99
|
+
if (this.enableArrowNavigation) {
|
|
100
|
+
if (this.navigationSvc) {
|
|
101
|
+
this.navigationSvc.init();
|
|
102
|
+
} else {
|
|
103
|
+
this.navigationSvc = setupListKeyboardNavigation({
|
|
104
|
+
itemContainer: this.$refs.vPopper.$refs.popperContent.$el
|
|
105
|
+
});
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
this.enableCloseOnEsc && document.addEventListener("keydown", this.popoverEscKeydown);
|
|
93
109
|
},
|
|
94
110
|
popoverEscKeydown(e) {
|
|
95
|
-
e.key ===
|
|
111
|
+
e.key === ESCAPE_KEY && this.$refs.vPopper.$refs.popper.hide();
|
|
96
112
|
},
|
|
97
113
|
destroy() {
|
|
98
|
-
var
|
|
99
|
-
(
|
|
114
|
+
var _a;
|
|
115
|
+
(_a = this.navigationSvc) == null ? void 0 : _a.destroy();
|
|
116
|
+
document.removeEventListener("keydown", this.popoverEscKeydown);
|
|
100
117
|
}
|
|
101
118
|
}
|
|
102
119
|
});
|
|
103
|
-
function
|
|
104
|
-
const
|
|
105
|
-
return
|
|
106
|
-
onShow:
|
|
107
|
-
onHide:
|
|
108
|
-
}),
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
120
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
121
|
+
const _component_VDropdown = resolveComponent("VDropdown");
|
|
122
|
+
return openBlock(), createBlock(_component_VDropdown, mergeProps({ ref: "vPopper" }, { ..._ctx.defaultAttrs, ..._ctx.$attrs }, {
|
|
123
|
+
onShow: _ctx.onShow,
|
|
124
|
+
onHide: _ctx.destroy
|
|
125
|
+
}), createSlots({ _: 2 }, [
|
|
126
|
+
renderList(_ctx.$slots, (_, slot) => {
|
|
127
|
+
return {
|
|
128
|
+
name: slot,
|
|
129
|
+
fn: withCtx((scope) => [
|
|
130
|
+
renderSlot(_ctx.$slots, slot, normalizeProps(guardReactiveProps(scope || {})))
|
|
131
|
+
])
|
|
132
|
+
};
|
|
133
|
+
})
|
|
115
134
|
]), 1040, ["onShow", "onHide"]);
|
|
116
135
|
}
|
|
117
|
-
const
|
|
136
|
+
const PDropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
118
137
|
export {
|
|
119
|
-
|
|
138
|
+
PDropdown as default
|
|
120
139
|
};
|
package/dist/es/p-file-upload.js
CHANGED
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
const
|
|
2
|
-
var
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
const getFileExtension = (fileName) => {
|
|
2
|
+
var _a;
|
|
3
|
+
if (!fileName || !fileName.includes(".")) {
|
|
4
|
+
return "";
|
|
5
|
+
}
|
|
6
|
+
return (_a = fileName.split(".").pop()) == null ? void 0 : _a.toLowerCase();
|
|
7
|
+
};
|
|
8
|
+
const formatBytes = (bytes, decimals = 2) => {
|
|
9
|
+
if (!+bytes || bytes <= 0) {
|
|
6
10
|
return "0 B";
|
|
7
|
-
|
|
8
|
-
|
|
11
|
+
}
|
|
12
|
+
const k = 1e3;
|
|
13
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
14
|
+
const sizes = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
15
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
16
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
|
|
9
17
|
};
|
|
10
18
|
export {
|
|
11
|
-
|
|
12
|
-
|
|
19
|
+
formatBytes,
|
|
20
|
+
getFileExtension
|
|
13
21
|
};
|
package/dist/es/p-info-icon.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
|
-
import { defineComponent
|
|
2
|
-
import { _ as
|
|
3
|
-
const
|
|
4
|
-
|
|
1
|
+
import { defineComponent, resolveComponent, openBlock, createBlock, withCtx, renderSlot, createTextVNode, toDisplayString, pushScopeId, popScopeId, createElementVNode } from "vue";
|
|
2
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
3
|
+
const _withScopeId = (n) => (pushScopeId("data-v-189b159e"), n = n(), popScopeId(), n);
|
|
4
|
+
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ createElementVNode("i", { class: "bg-info-circle-icon block h-3 w-3" }, null, -1));
|
|
5
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
+
...{
|
|
7
|
+
name: "PInfoIcon"
|
|
8
|
+
},
|
|
5
9
|
__name: "p-info-icon",
|
|
6
10
|
props: {
|
|
7
11
|
text: {
|
|
@@ -9,23 +13,24 @@ const u = (o) => (_("data-v-189b159e"), o = o(), d(), o), I = /* @__PURE__ */ u(
|
|
|
9
13
|
default: ""
|
|
10
14
|
}
|
|
11
15
|
},
|
|
12
|
-
setup(
|
|
13
|
-
return (
|
|
14
|
-
const
|
|
15
|
-
return
|
|
16
|
-
popper:
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
],
|
|
16
|
+
setup(__props) {
|
|
17
|
+
return (_ctx, _cache) => {
|
|
18
|
+
const _component_VTooltip = resolveComponent("VTooltip");
|
|
19
|
+
return openBlock(), createBlock(_component_VTooltip, null, {
|
|
20
|
+
popper: withCtx(() => [
|
|
21
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
22
|
+
createTextVNode(toDisplayString(__props.text), 1)
|
|
23
|
+
], true)
|
|
20
24
|
]),
|
|
21
|
-
default:
|
|
22
|
-
|
|
25
|
+
default: withCtx(() => [
|
|
26
|
+
_hoisted_1
|
|
23
27
|
]),
|
|
24
28
|
_: 3
|
|
25
29
|
});
|
|
26
30
|
};
|
|
27
31
|
}
|
|
28
|
-
})
|
|
32
|
+
});
|
|
33
|
+
const PInfoIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-189b159e"]]);
|
|
29
34
|
export {
|
|
30
|
-
|
|
35
|
+
PInfoIcon as default
|
|
31
36
|
};
|