@pequity/squirrel 1.0.20 → 1.0.21
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 -0
- package/dist/cjs/chunks/p-action-bar.js +60 -0
- package/dist/cjs/chunks/p-card.js +28 -0
- package/dist/cjs/chunks/p-checkbox.js +24 -0
- package/dist/cjs/chunks/p-dropdown-select.js +414 -0
- package/dist/cjs/chunks/p-input-percent.js +53 -0
- package/dist/cjs/chunks/p-pagination-info.js +66 -0
- package/dist/cjs/chunks/p-pagination.js +122 -0
- package/dist/cjs/chunks/p-ring-loader.js +81 -0
- package/dist/cjs/chunks/p-select-btn.js +97 -0
- package/dist/cjs/chunks/p-select.js +123 -0
- package/dist/cjs/chunks/p-table-loader.js +70 -0
- package/dist/cjs/chunks/p-tabs.js +52 -0
- package/dist/cjs/config.js +105 -0
- package/dist/cjs/currency.js +9 -0
- package/dist/cjs/dom.js +27 -0
- package/dist/cjs/index.js +976 -0
- package/dist/cjs/inputClassesMixin.js +50 -0
- package/dist/cjs/inputClassesShared.js +76 -0
- package/dist/cjs/listKeyboardNavigation.js +110 -0
- package/dist/cjs/number.js +9 -0
- package/dist/cjs/object.js +4 -0
- package/dist/cjs/p-action-bar.js +3 -0
- package/dist/cjs/p-alert.js +65 -0
- package/dist/cjs/p-avatar.js +71 -0
- package/dist/cjs/p-btn.js +361 -0
- package/dist/cjs/p-card.js +3 -0
- package/dist/cjs/p-checkbox.js +3 -0
- package/dist/cjs/p-chips.js +110 -0
- package/dist/cjs/p-close-btn.js +36 -0
- package/dist/cjs/p-date-picker.js +139 -0
- package/dist/cjs/p-drawer.js +253 -0
- package/dist/cjs/p-dropdown-select.js +3 -0
- package/dist/cjs/p-dropdown.js +138 -0
- package/dist/cjs/p-file-upload.js +21 -0
- package/dist/cjs/p-info-icon.js +35 -0
- package/dist/cjs/p-inline-date-picker.js +142 -0
- package/dist/cjs/p-input-number.js +146 -0
- package/dist/cjs/p-input-percent.js +3 -0
- package/dist/cjs/p-input-search.js +110 -0
- package/dist/cjs/p-input.js +89 -0
- package/dist/cjs/p-loading.js +38 -0
- package/dist/cjs/p-modal.js +369 -0
- package/dist/cjs/p-pagination-info.js +3 -0
- package/dist/cjs/p-pagination.js +3 -0
- package/dist/cjs/p-progress-bar.js +41 -0
- package/dist/cjs/p-ring-loader.js +3 -0
- package/dist/cjs/p-select-btn.js +3 -0
- package/dist/cjs/p-select-list.js +4 -0
- package/dist/cjs/p-select-pill.js +111 -0
- package/dist/cjs/p-select.js +3 -0
- package/dist/cjs/p-skeleton-loader.js +73 -0
- package/dist/cjs/p-table-filter-icon.js +20 -0
- package/dist/cjs/p-table-header-cell.js +75 -0
- package/dist/cjs/p-table-loader.js +3 -0
- package/dist/cjs/p-table-sort.js +8 -0
- package/dist/cjs/p-table-td.js +88 -0
- package/dist/cjs/p-table.js +12 -0
- package/dist/cjs/p-tabs.js +3 -0
- package/dist/cjs/p-textarea.js +73 -0
- package/dist/cjs/p-toggle.js +114 -0
- package/dist/cjs/pagination.js +29 -0
- package/dist/cjs/string.js +12 -0
- package/dist/cjs/tailwind.js +4353 -0
- package/dist/cjs/text.js +16 -0
- package/dist/cjs/useInputClasses.js +44 -0
- package/dist/cjs/usePLoading.js +35 -0
- package/dist/cjs/usePModal.js +21 -0
- package/dist/cjs/usePTableColResize.js +81 -0
- package/dist/cjs/usePTableRowVirtualizer.js +31 -0
- package/dist/cjs/useSelectList.js +256 -0
- package/dist/es/chunks/_plugin-vue_export-helper.js +10 -0
- package/dist/es/chunks/p-action-bar.js +61 -0
- package/dist/es/chunks/p-card.js +29 -0
- package/dist/es/chunks/p-checkbox.js +25 -0
- package/dist/es/chunks/p-dropdown-select.js +415 -0
- package/dist/es/chunks/p-input-percent.js +54 -0
- package/dist/es/chunks/p-pagination-info.js +67 -0
- package/dist/es/chunks/p-pagination.js +123 -0
- package/dist/es/chunks/p-ring-loader.js +82 -0
- package/dist/es/chunks/p-select-btn.js +98 -0
- package/dist/es/chunks/p-select.js +124 -0
- package/dist/es/chunks/p-table-loader.js +71 -0
- package/dist/es/chunks/p-tabs.js +53 -0
- package/dist/es/config.js +105 -0
- package/dist/es/currency.js +9 -0
- package/dist/es/dom.js +27 -0
- package/dist/es/index.js +978 -0
- package/dist/es/inputClassesMixin.js +51 -0
- package/dist/es/inputClassesShared.js +76 -0
- package/dist/es/listKeyboardNavigation.js +110 -0
- package/dist/es/number.js +9 -0
- package/dist/es/object.js +4 -0
- package/dist/es/p-action-bar.js +4 -0
- package/dist/es/p-alert.js +66 -0
- package/dist/es/p-avatar.js +72 -0
- package/dist/es/p-btn.js +362 -0
- package/dist/es/p-card.js +4 -0
- package/dist/es/p-checkbox.js +4 -0
- package/dist/es/p-chips.js +111 -0
- package/dist/es/p-close-btn.js +37 -0
- package/dist/es/p-date-picker.js +140 -0
- package/dist/es/p-drawer.js +254 -0
- package/dist/es/p-dropdown-select.js +4 -0
- package/dist/es/p-dropdown.js +139 -0
- package/dist/es/p-file-upload.js +21 -0
- package/dist/es/p-info-icon.js +36 -0
- package/dist/es/p-inline-date-picker.js +143 -0
- package/dist/es/p-input-number.js +147 -0
- package/dist/es/p-input-percent.js +4 -0
- package/dist/es/p-input-search.js +111 -0
- package/dist/es/p-input.js +90 -0
- package/dist/es/p-loading.js +39 -0
- package/dist/es/p-modal.js +370 -0
- package/dist/es/p-pagination-info.js +4 -0
- package/dist/es/p-pagination.js +4 -0
- package/dist/es/p-progress-bar.js +42 -0
- package/dist/es/p-ring-loader.js +4 -0
- package/dist/es/p-select-btn.js +4 -0
- package/dist/es/p-select-list.js +4 -0
- package/dist/es/p-select-pill.js +112 -0
- package/dist/es/p-select.js +4 -0
- package/dist/es/p-skeleton-loader.js +74 -0
- package/dist/es/p-table-filter-icon.js +21 -0
- package/dist/es/p-table-header-cell.js +76 -0
- package/dist/es/p-table-loader.js +4 -0
- package/dist/es/p-table-sort.js +8 -0
- package/dist/es/p-table-td.js +89 -0
- package/dist/es/p-table.js +12 -0
- package/dist/es/p-tabs.js +4 -0
- package/dist/es/p-textarea.js +74 -0
- package/dist/es/p-toggle.js +115 -0
- package/dist/es/pagination.js +29 -0
- package/dist/es/string.js +12 -0
- package/dist/es/tailwind.js +4353 -0
- package/dist/es/text.js +16 -0
- package/dist/es/useInputClasses.js +44 -0
- package/dist/es/usePLoading.js +35 -0
- package/dist/es/usePModal.js +21 -0
- package/dist/es/usePTableColResize.js +81 -0
- package/dist/es/usePTableRowVirtualizer.js +31 -0
- package/dist/es/useSelectList.js +256 -0
- package/dist/style.css +2124 -1
- package/package.json +26 -24
- package/dist/squirrel.cjs.js +0 -5
- package/dist/squirrel.es.js +0 -8220
|
@@ -0,0 +1,254 @@
|
|
|
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
|
+
name: "PDrawer",
|
|
7
|
+
components: {
|
|
8
|
+
PAlert,
|
|
9
|
+
PCloseBtn
|
|
10
|
+
},
|
|
11
|
+
props: {
|
|
12
|
+
appendTo: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: "body"
|
|
15
|
+
},
|
|
16
|
+
title: {
|
|
17
|
+
type: String,
|
|
18
|
+
default: ""
|
|
19
|
+
},
|
|
20
|
+
disabled: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: false
|
|
23
|
+
},
|
|
24
|
+
errorMsg: {
|
|
25
|
+
type: String,
|
|
26
|
+
default: ""
|
|
27
|
+
},
|
|
28
|
+
position: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: "right"
|
|
31
|
+
},
|
|
32
|
+
zIndex: {
|
|
33
|
+
type: Number,
|
|
34
|
+
default: 900
|
|
35
|
+
},
|
|
36
|
+
drawerStyle: {
|
|
37
|
+
type: Object,
|
|
38
|
+
default: () => ({})
|
|
39
|
+
},
|
|
40
|
+
drawerClass: {
|
|
41
|
+
type: String,
|
|
42
|
+
default: "drawer"
|
|
43
|
+
},
|
|
44
|
+
inClass: {
|
|
45
|
+
type: String,
|
|
46
|
+
default: ""
|
|
47
|
+
},
|
|
48
|
+
outClass: {
|
|
49
|
+
type: String,
|
|
50
|
+
default: ""
|
|
51
|
+
},
|
|
52
|
+
live: {
|
|
53
|
+
type: Boolean,
|
|
54
|
+
default: false
|
|
55
|
+
},
|
|
56
|
+
modelValue: {
|
|
57
|
+
type: Boolean,
|
|
58
|
+
default: false
|
|
59
|
+
},
|
|
60
|
+
closeLabel: {
|
|
61
|
+
type: String,
|
|
62
|
+
default: "Close"
|
|
63
|
+
},
|
|
64
|
+
showBackdrop: {
|
|
65
|
+
type: Boolean,
|
|
66
|
+
default: false
|
|
67
|
+
},
|
|
68
|
+
enableClose: {
|
|
69
|
+
type: Boolean,
|
|
70
|
+
default: true
|
|
71
|
+
}
|
|
72
|
+
},
|
|
73
|
+
emits: ["update:modelValue", "before-open", "opening", "opened", "before-close", "closing", "closed"],
|
|
74
|
+
data() {
|
|
75
|
+
return {
|
|
76
|
+
id: null,
|
|
77
|
+
show: false,
|
|
78
|
+
mount: false
|
|
79
|
+
};
|
|
80
|
+
},
|
|
81
|
+
computed: {
|
|
82
|
+
transitionInClass() {
|
|
83
|
+
return this.inClass || this.position === "right" ? "slideInRight" : "slideInLeft";
|
|
84
|
+
},
|
|
85
|
+
transitionOutClass() {
|
|
86
|
+
return this.outClass || this.position === "right" ? "slideOutRight" : "slideOutLeft";
|
|
87
|
+
}
|
|
88
|
+
},
|
|
89
|
+
created() {
|
|
90
|
+
if (this.live) {
|
|
91
|
+
this.mount = true;
|
|
92
|
+
}
|
|
93
|
+
},
|
|
94
|
+
mounted() {
|
|
95
|
+
this.id = "drawer-" + this.$.uid;
|
|
96
|
+
this.$watch(
|
|
97
|
+
"modelValue",
|
|
98
|
+
(newVal) => {
|
|
99
|
+
if (newVal) {
|
|
100
|
+
this.mount = true;
|
|
101
|
+
this.$nextTick(() => {
|
|
102
|
+
this.show = true;
|
|
103
|
+
});
|
|
104
|
+
} else {
|
|
105
|
+
this.show = false;
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
{ immediate: true }
|
|
109
|
+
);
|
|
110
|
+
},
|
|
111
|
+
methods: {
|
|
112
|
+
close() {
|
|
113
|
+
if (this.enableClose === true) {
|
|
114
|
+
this.$emit("update:modelValue", false);
|
|
115
|
+
}
|
|
116
|
+
},
|
|
117
|
+
beforeOpen() {
|
|
118
|
+
this.$emit("before-open");
|
|
119
|
+
},
|
|
120
|
+
opening() {
|
|
121
|
+
this.$emit("opening");
|
|
122
|
+
},
|
|
123
|
+
opened() {
|
|
124
|
+
this.$emit("opened");
|
|
125
|
+
},
|
|
126
|
+
beforeClose() {
|
|
127
|
+
this.$emit("before-close");
|
|
128
|
+
},
|
|
129
|
+
closing() {
|
|
130
|
+
this.$emit("closing");
|
|
131
|
+
},
|
|
132
|
+
closed() {
|
|
133
|
+
if (!this.live) {
|
|
134
|
+
this.mount = false;
|
|
135
|
+
}
|
|
136
|
+
this.$nextTick(() => {
|
|
137
|
+
this.$emit("closed");
|
|
138
|
+
});
|
|
139
|
+
}
|
|
140
|
+
}
|
|
141
|
+
});
|
|
142
|
+
const _hoisted_1 = ["data-drawer-id", "aria-label", "aria-describedby", "aria-labelledby"];
|
|
143
|
+
const _hoisted_2 = ["id"];
|
|
144
|
+
const _hoisted_3 = {
|
|
145
|
+
key: 0,
|
|
146
|
+
class: "px-6 pt-6"
|
|
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, {
|
|
154
|
+
key: 0,
|
|
155
|
+
to: _ctx.appendTo
|
|
156
|
+
}, [
|
|
157
|
+
createVNode(Transition, {
|
|
158
|
+
name: "pd-backdrop-transition",
|
|
159
|
+
"enter-active-class": "fadeIn",
|
|
160
|
+
"leave-active-class": "fadeOut"
|
|
161
|
+
}, {
|
|
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 }),
|
|
166
|
+
tabindex: "-1",
|
|
167
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
|
|
168
|
+
}, null, 6), [
|
|
169
|
+
[vShow, _ctx.show && _ctx.showBackdrop]
|
|
170
|
+
])
|
|
171
|
+
]),
|
|
172
|
+
_: 1
|
|
173
|
+
}),
|
|
174
|
+
createVNode(Transition, {
|
|
175
|
+
name: "drawer-transition",
|
|
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
|
|
184
|
+
}, {
|
|
185
|
+
default: withCtx(() => [
|
|
186
|
+
withDirectives(createElementVNode("div", {
|
|
187
|
+
"data-drawer-id": _ctx.id,
|
|
188
|
+
tabindex: "-1",
|
|
189
|
+
class: normalizeClass([_ctx.drawerClass, _ctx.position === "right" ? "drawer-right" : "drawer-left"]),
|
|
190
|
+
style: normalizeStyle({ "z-index": _ctx.zIndex, ..._ctx.drawerStyle }),
|
|
191
|
+
role: "dialog",
|
|
192
|
+
"aria-label": _ctx.title,
|
|
193
|
+
"aria-modal": "false",
|
|
194
|
+
"aria-describedby": `${_ctx.id}-content`,
|
|
195
|
+
"aria-labelledby": `${_ctx.id}-title`
|
|
196
|
+
}, [
|
|
197
|
+
renderSlot(_ctx.$slots, "title-wrapper", {}, () => [
|
|
198
|
+
createElementVNode("div", {
|
|
199
|
+
class: normalizeClass([
|
|
200
|
+
"flex items-center border-b border-p-gray-30 px-6 pb-4 pt-4",
|
|
201
|
+
{ "flex-row-reverse": _ctx.position === "right" }
|
|
202
|
+
])
|
|
203
|
+
}, [
|
|
204
|
+
_ctx.enableClose ? (openBlock(), createBlock(_component_PCloseBtn, {
|
|
205
|
+
key: 0,
|
|
206
|
+
"aria-label": _ctx.closeLabel,
|
|
207
|
+
class: "flex-0",
|
|
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", {
|
|
213
|
+
key: 0,
|
|
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)
|
|
218
|
+
], 2)
|
|
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)
|
|
224
|
+
]),
|
|
225
|
+
_: 1
|
|
226
|
+
})
|
|
227
|
+
])) : createCommentVNode("", true),
|
|
228
|
+
renderSlot(_ctx.$slots, "content-wrapper", {}, () => [
|
|
229
|
+
createElementVNode("div", {
|
|
230
|
+
class: normalizeClass([
|
|
231
|
+
"relative grow overflow-y-auto overflow-x-hidden px-6 pt-6",
|
|
232
|
+
{ "pointer-events-none opacity-50": _ctx.disabled }
|
|
233
|
+
])
|
|
234
|
+
}, [
|
|
235
|
+
renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
236
|
+
], 2)
|
|
237
|
+
], true),
|
|
238
|
+
renderSlot(_ctx.$slots, "footer-wrapper", {}, () => [
|
|
239
|
+
createElementVNode("div", _hoisted_5, [
|
|
240
|
+
renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
241
|
+
])
|
|
242
|
+
], true)
|
|
243
|
+
], 14, _hoisted_1), [
|
|
244
|
+
[vShow, _ctx.show]
|
|
245
|
+
])
|
|
246
|
+
]),
|
|
247
|
+
_: 3
|
|
248
|
+
}, 8, ["enter-active-class", "leave-active-class", "onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])
|
|
249
|
+
], 8, ["to"])) : createCommentVNode("", true);
|
|
250
|
+
}
|
|
251
|
+
const pDrawer = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a0b8be1e"]]);
|
|
252
|
+
export {
|
|
253
|
+
pDrawer as default
|
|
254
|
+
};
|
|
@@ -0,0 +1,139 @@
|
|
|
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({
|
|
6
|
+
name: "PDropdown",
|
|
7
|
+
inheritAttrs: false,
|
|
8
|
+
props: {
|
|
9
|
+
/**
|
|
10
|
+
* Enables navigation for `.dropdown-item` using the up/down keys.
|
|
11
|
+
* This can be set to false when we're creating a generic popover.
|
|
12
|
+
*/
|
|
13
|
+
enableArrowNavigation: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: true
|
|
16
|
+
},
|
|
17
|
+
/**
|
|
18
|
+
* Enables closing the dropdown with the Escape key.
|
|
19
|
+
*/
|
|
20
|
+
enableCloseOnEsc: {
|
|
21
|
+
type: Boolean,
|
|
22
|
+
default: true
|
|
23
|
+
},
|
|
24
|
+
/**
|
|
25
|
+
* The selector that the arrow navigation function will use to
|
|
26
|
+
* match the items in the list.
|
|
27
|
+
*/
|
|
28
|
+
itemSelector: {
|
|
29
|
+
type: String,
|
|
30
|
+
default: ".dropdown-item:not(.disabled), .dropdown-item:not(:disabled)"
|
|
31
|
+
},
|
|
32
|
+
/**
|
|
33
|
+
* The CSS class of the "focused" dropdown item
|
|
34
|
+
*/
|
|
35
|
+
itemFocusClass: {
|
|
36
|
+
type: String,
|
|
37
|
+
default: "focus"
|
|
38
|
+
},
|
|
39
|
+
/**
|
|
40
|
+
* v-tooltip wraps the popper trigger with a div that has `display: inline-block` set by default.
|
|
41
|
+
* This prop is used to override the CSS style of that wrapper div
|
|
42
|
+
*/
|
|
43
|
+
triggerStyle: {
|
|
44
|
+
type: Object,
|
|
45
|
+
default: () => ({
|
|
46
|
+
display: "inline-block"
|
|
47
|
+
})
|
|
48
|
+
},
|
|
49
|
+
/**
|
|
50
|
+
* Custom reference element that is used to position the popper.
|
|
51
|
+
* Can be changed at runtime to create a dynamically positioned dropdown.
|
|
52
|
+
*/
|
|
53
|
+
reference: {
|
|
54
|
+
type: HTMLElement,
|
|
55
|
+
default: null
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
data() {
|
|
59
|
+
return {
|
|
60
|
+
defaultAttrs: {
|
|
61
|
+
triggers: ["click"],
|
|
62
|
+
"auto-hide": true,
|
|
63
|
+
theme: "p-dropdown-theme",
|
|
64
|
+
"popper-class": "dropdown",
|
|
65
|
+
placement: "bottom-start",
|
|
66
|
+
distance: 4,
|
|
67
|
+
delay: 0,
|
|
68
|
+
handleResize: true
|
|
69
|
+
},
|
|
70
|
+
navigationSvc: null
|
|
71
|
+
};
|
|
72
|
+
},
|
|
73
|
+
watch: {
|
|
74
|
+
reference: {
|
|
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
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
mounted() {
|
|
92
|
+
Object.assign(this.$refs.vPopper.$refs.popper.$el.style, this.triggerStyle);
|
|
93
|
+
},
|
|
94
|
+
beforeUnmount() {
|
|
95
|
+
this.destroy();
|
|
96
|
+
},
|
|
97
|
+
methods: {
|
|
98
|
+
onShow() {
|
|
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);
|
|
109
|
+
},
|
|
110
|
+
popoverEscKeydown(e) {
|
|
111
|
+
e.key === ESCAPE_KEY && this.$refs.vPopper.$refs.popper.hide();
|
|
112
|
+
},
|
|
113
|
+
destroy() {
|
|
114
|
+
var _a;
|
|
115
|
+
(_a = this.navigationSvc) == null ? void 0 : _a.destroy();
|
|
116
|
+
document.removeEventListener("keydown", this.popoverEscKeydown);
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
});
|
|
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
|
+
})
|
|
134
|
+
]), 1040, ["onShow", "onHide"]);
|
|
135
|
+
}
|
|
136
|
+
const PDropdown = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
137
|
+
export {
|
|
138
|
+
PDropdown as default
|
|
139
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
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) {
|
|
10
|
+
return "0 B";
|
|
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]}`;
|
|
17
|
+
};
|
|
18
|
+
export {
|
|
19
|
+
formatBytes,
|
|
20
|
+
getFileExtension
|
|
21
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
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
|
+
},
|
|
9
|
+
__name: "p-info-icon",
|
|
10
|
+
props: {
|
|
11
|
+
text: {
|
|
12
|
+
type: String,
|
|
13
|
+
default: ""
|
|
14
|
+
}
|
|
15
|
+
},
|
|
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)
|
|
24
|
+
]),
|
|
25
|
+
default: withCtx(() => [
|
|
26
|
+
_hoisted_1
|
|
27
|
+
]),
|
|
28
|
+
_: 3
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const PInfoIcon = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-189b159e"]]);
|
|
34
|
+
export {
|
|
35
|
+
PInfoIcon as default
|
|
36
|
+
};
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import dayjs from "dayjs";
|
|
2
|
+
import inputClassesMixin from "./inputClassesMixin.js";
|
|
3
|
+
import { DatePicker } from "v-calendar";
|
|
4
|
+
import { defineComponent, resolveComponent, openBlock, createElementBlock, normalizeClass, normalizeStyle, renderSlot, toDisplayString, createCommentVNode, createVNode, mergeProps, withDirectives, createElementVNode, vShow } from "vue";
|
|
5
|
+
import { _ as _export_sfc } from "./chunks/_plugin-vue_export-helper.js";
|
|
6
|
+
const selectAttribute = { highlight: { class: "bg-primary", contentClass: "text-white" } };
|
|
7
|
+
const DEFAULT_MASKS = {
|
|
8
|
+
// The mask for the input
|
|
9
|
+
input: "DD-MMM-YYYY",
|
|
10
|
+
// The mask for the model value
|
|
11
|
+
data: "YYYY-MM-DD"
|
|
12
|
+
};
|
|
13
|
+
const _sfc_main = defineComponent({
|
|
14
|
+
name: "PInlineDatePicker",
|
|
15
|
+
components: {
|
|
16
|
+
DatePicker
|
|
17
|
+
},
|
|
18
|
+
mixins: [inputClassesMixin],
|
|
19
|
+
inheritAttrs: false,
|
|
20
|
+
props: {
|
|
21
|
+
modelValue: {
|
|
22
|
+
type: String,
|
|
23
|
+
default: ""
|
|
24
|
+
},
|
|
25
|
+
label: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
errorMsg: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ""
|
|
32
|
+
},
|
|
33
|
+
required: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: false
|
|
36
|
+
},
|
|
37
|
+
minDate: {
|
|
38
|
+
type: Date,
|
|
39
|
+
default: null
|
|
40
|
+
},
|
|
41
|
+
maxDate: {
|
|
42
|
+
type: Date,
|
|
43
|
+
default: null
|
|
44
|
+
},
|
|
45
|
+
timezone: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ""
|
|
48
|
+
}
|
|
49
|
+
},
|
|
50
|
+
emits: ["update:modelValue"],
|
|
51
|
+
data() {
|
|
52
|
+
return {
|
|
53
|
+
// innerValue is a Date object
|
|
54
|
+
innerValue: null,
|
|
55
|
+
selectAttribute
|
|
56
|
+
};
|
|
57
|
+
},
|
|
58
|
+
computed: {
|
|
59
|
+
masks() {
|
|
60
|
+
return Object.assign(DEFAULT_MASKS, this.$attrs.masks);
|
|
61
|
+
},
|
|
62
|
+
attrs() {
|
|
63
|
+
const { class: classes, style, ...rest } = this.$attrs;
|
|
64
|
+
return rest;
|
|
65
|
+
},
|
|
66
|
+
listeners() {
|
|
67
|
+
return Object.keys(this.$attrs).reduce((acc, curr) => {
|
|
68
|
+
if (curr.startsWith("on")) {
|
|
69
|
+
return { ...acc, [curr]: this.$attrs[curr] };
|
|
70
|
+
} else {
|
|
71
|
+
return acc;
|
|
72
|
+
}
|
|
73
|
+
}, {});
|
|
74
|
+
},
|
|
75
|
+
style() {
|
|
76
|
+
return this.$attrs.style;
|
|
77
|
+
},
|
|
78
|
+
styleDatepicker() {
|
|
79
|
+
return this.errorMsg ? { border: "1px solid var(--color-on-error)" } : {};
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
watch: {
|
|
83
|
+
modelValue: {
|
|
84
|
+
handler(nV) {
|
|
85
|
+
const date = dayjs(nV, this.masks.data).toDate();
|
|
86
|
+
if (nV && date.toString() === "Invalid Date") {
|
|
87
|
+
this.$emit("update:modelValue", null);
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
this.innerValue = nV ? dayjs(nV, this.masks.data).toDate() : null;
|
|
91
|
+
const datepicker = this.$refs.datepicker;
|
|
92
|
+
if (datepicker && this.innerValue) {
|
|
93
|
+
datepicker.move(this.innerValue);
|
|
94
|
+
}
|
|
95
|
+
},
|
|
96
|
+
immediate: true
|
|
97
|
+
}
|
|
98
|
+
},
|
|
99
|
+
methods: {
|
|
100
|
+
dayclick(e) {
|
|
101
|
+
this.$emit("update:modelValue", e.id);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
});
|
|
105
|
+
const _hoisted_1 = ["data-has-error"];
|
|
106
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
107
|
+
const _component_DatePicker = resolveComponent("DatePicker");
|
|
108
|
+
return openBlock(), createElementBlock("div", {
|
|
109
|
+
class: normalizeClass([{ hidden: _ctx.$attrs.hidden }, _ctx.$attrs.class]),
|
|
110
|
+
"data-has-error": !!_ctx.errorMsg,
|
|
111
|
+
style: normalizeStyle(_ctx.style)
|
|
112
|
+
}, [
|
|
113
|
+
renderSlot(_ctx.$slots, "label", {
|
|
114
|
+
label: _ctx.label,
|
|
115
|
+
labelClasses: _ctx.labelClasses
|
|
116
|
+
}, () => [
|
|
117
|
+
_ctx.label ? (openBlock(), createElementBlock("label", {
|
|
118
|
+
key: 0,
|
|
119
|
+
class: normalizeClass(_ctx.labelClasses)
|
|
120
|
+
}, toDisplayString(_ctx.label), 3)) : createCommentVNode("", true)
|
|
121
|
+
]),
|
|
122
|
+
createVNode(_component_DatePicker, mergeProps({
|
|
123
|
+
ref: "datepicker",
|
|
124
|
+
class: { "pointer-events-none opacity-70": _ctx.$attrs.disabled },
|
|
125
|
+
"model-value": _ctx.innerValue,
|
|
126
|
+
"select-attribute": _ctx.selectAttribute,
|
|
127
|
+
"min-date": _ctx.minDate || null,
|
|
128
|
+
"max-date": _ctx.maxDate || null,
|
|
129
|
+
masks: _ctx.masks,
|
|
130
|
+
style: _ctx.styleDatepicker,
|
|
131
|
+
timezone: _ctx.timezone
|
|
132
|
+
}, _ctx.listeners, { onDayclick: _ctx.dayclick }), null, 16, ["class", "model-value", "select-attribute", "min-date", "max-date", "masks", "style", "timezone", "onDayclick"]),
|
|
133
|
+
withDirectives(createElementVNode("div", {
|
|
134
|
+
class: normalizeClass(_ctx.errorMsgClasses)
|
|
135
|
+
}, toDisplayString(_ctx.errorMsg), 3), [
|
|
136
|
+
[vShow, _ctx.errorMsg]
|
|
137
|
+
])
|
|
138
|
+
], 14, _hoisted_1);
|
|
139
|
+
}
|
|
140
|
+
const pInlineDatePicker = /* @__PURE__ */ _export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
141
|
+
export {
|
|
142
|
+
pInlineDatePicker as default
|
|
143
|
+
};
|