@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
|
@@ -1 +1,139 @@
|
|
|
1
|
-
"use strict";
|
|
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;
|
package/dist/cjs/p-drawer.js
CHANGED
|
@@ -1 +1,253 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const pAlert = require("./p-alert.js");
|
|
3
|
+
const pCloseBtn = require("./p-close-btn.js");
|
|
4
|
+
const vue = require("vue");
|
|
5
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
6
|
+
const _sfc_main = vue.defineComponent({
|
|
7
|
+
name: "PDrawer",
|
|
8
|
+
components: {
|
|
9
|
+
PAlert: pAlert,
|
|
10
|
+
PCloseBtn: pCloseBtn
|
|
11
|
+
},
|
|
12
|
+
props: {
|
|
13
|
+
appendTo: {
|
|
14
|
+
type: String,
|
|
15
|
+
default: "body"
|
|
16
|
+
},
|
|
17
|
+
title: {
|
|
18
|
+
type: String,
|
|
19
|
+
default: ""
|
|
20
|
+
},
|
|
21
|
+
disabled: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: false
|
|
24
|
+
},
|
|
25
|
+
errorMsg: {
|
|
26
|
+
type: String,
|
|
27
|
+
default: ""
|
|
28
|
+
},
|
|
29
|
+
position: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: "right"
|
|
32
|
+
},
|
|
33
|
+
zIndex: {
|
|
34
|
+
type: Number,
|
|
35
|
+
default: 900
|
|
36
|
+
},
|
|
37
|
+
drawerStyle: {
|
|
38
|
+
type: Object,
|
|
39
|
+
default: () => ({})
|
|
40
|
+
},
|
|
41
|
+
drawerClass: {
|
|
42
|
+
type: String,
|
|
43
|
+
default: "drawer"
|
|
44
|
+
},
|
|
45
|
+
inClass: {
|
|
46
|
+
type: String,
|
|
47
|
+
default: ""
|
|
48
|
+
},
|
|
49
|
+
outClass: {
|
|
50
|
+
type: String,
|
|
51
|
+
default: ""
|
|
52
|
+
},
|
|
53
|
+
live: {
|
|
54
|
+
type: Boolean,
|
|
55
|
+
default: false
|
|
56
|
+
},
|
|
57
|
+
modelValue: {
|
|
58
|
+
type: Boolean,
|
|
59
|
+
default: false
|
|
60
|
+
},
|
|
61
|
+
closeLabel: {
|
|
62
|
+
type: String,
|
|
63
|
+
default: "Close"
|
|
64
|
+
},
|
|
65
|
+
showBackdrop: {
|
|
66
|
+
type: Boolean,
|
|
67
|
+
default: false
|
|
68
|
+
},
|
|
69
|
+
enableClose: {
|
|
70
|
+
type: Boolean,
|
|
71
|
+
default: true
|
|
72
|
+
}
|
|
73
|
+
},
|
|
74
|
+
emits: ["update:modelValue", "before-open", "opening", "opened", "before-close", "closing", "closed"],
|
|
75
|
+
data() {
|
|
76
|
+
return {
|
|
77
|
+
id: null,
|
|
78
|
+
show: false,
|
|
79
|
+
mount: false
|
|
80
|
+
};
|
|
81
|
+
},
|
|
82
|
+
computed: {
|
|
83
|
+
transitionInClass() {
|
|
84
|
+
return this.inClass || this.position === "right" ? "slideInRight" : "slideInLeft";
|
|
85
|
+
},
|
|
86
|
+
transitionOutClass() {
|
|
87
|
+
return this.outClass || this.position === "right" ? "slideOutRight" : "slideOutLeft";
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
created() {
|
|
91
|
+
if (this.live) {
|
|
92
|
+
this.mount = true;
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
mounted() {
|
|
96
|
+
this.id = "drawer-" + this.$.uid;
|
|
97
|
+
this.$watch(
|
|
98
|
+
"modelValue",
|
|
99
|
+
(newVal) => {
|
|
100
|
+
if (newVal) {
|
|
101
|
+
this.mount = true;
|
|
102
|
+
this.$nextTick(() => {
|
|
103
|
+
this.show = true;
|
|
104
|
+
});
|
|
105
|
+
} else {
|
|
106
|
+
this.show = false;
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
{ immediate: true }
|
|
110
|
+
);
|
|
111
|
+
},
|
|
112
|
+
methods: {
|
|
113
|
+
close() {
|
|
114
|
+
if (this.enableClose === true) {
|
|
115
|
+
this.$emit("update:modelValue", false);
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
beforeOpen() {
|
|
119
|
+
this.$emit("before-open");
|
|
120
|
+
},
|
|
121
|
+
opening() {
|
|
122
|
+
this.$emit("opening");
|
|
123
|
+
},
|
|
124
|
+
opened() {
|
|
125
|
+
this.$emit("opened");
|
|
126
|
+
},
|
|
127
|
+
beforeClose() {
|
|
128
|
+
this.$emit("before-close");
|
|
129
|
+
},
|
|
130
|
+
closing() {
|
|
131
|
+
this.$emit("closing");
|
|
132
|
+
},
|
|
133
|
+
closed() {
|
|
134
|
+
if (!this.live) {
|
|
135
|
+
this.mount = false;
|
|
136
|
+
}
|
|
137
|
+
this.$nextTick(() => {
|
|
138
|
+
this.$emit("closed");
|
|
139
|
+
});
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
const _hoisted_1 = ["data-drawer-id", "aria-label", "aria-describedby", "aria-labelledby"];
|
|
144
|
+
const _hoisted_2 = ["id"];
|
|
145
|
+
const _hoisted_3 = {
|
|
146
|
+
key: 0,
|
|
147
|
+
class: "px-6 pt-6"
|
|
148
|
+
};
|
|
149
|
+
const _hoisted_4 = { class: "whitespace-pre-line" };
|
|
150
|
+
const _hoisted_5 = { class: "footer p-6" };
|
|
151
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
152
|
+
const _component_PCloseBtn = vue.resolveComponent("PCloseBtn");
|
|
153
|
+
const _component_PAlert = vue.resolveComponent("PAlert");
|
|
154
|
+
return _ctx.mount ? (vue.openBlock(), vue.createBlock(vue.Teleport, {
|
|
155
|
+
key: 0,
|
|
156
|
+
to: _ctx.appendTo
|
|
157
|
+
}, [
|
|
158
|
+
vue.createVNode(vue.Transition, {
|
|
159
|
+
name: "pd-backdrop-transition",
|
|
160
|
+
"enter-active-class": "fadeIn",
|
|
161
|
+
"leave-active-class": "fadeOut"
|
|
162
|
+
}, {
|
|
163
|
+
default: vue.withCtx(() => [
|
|
164
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
165
|
+
class: vue.normalizeClass(["fixed bottom-0 left-0 right-0 top-0 bg-black bg-opacity-20", { "cursor-pointer": _ctx.enableClose }]),
|
|
166
|
+
style: vue.normalizeStyle({ "z-index": _ctx.zIndex - 1 }),
|
|
167
|
+
tabindex: "-1",
|
|
168
|
+
onClick: _cache[0] || (_cache[0] = (...args) => _ctx.close && _ctx.close(...args))
|
|
169
|
+
}, null, 6), [
|
|
170
|
+
[vue.vShow, _ctx.show && _ctx.showBackdrop]
|
|
171
|
+
])
|
|
172
|
+
]),
|
|
173
|
+
_: 1
|
|
174
|
+
}),
|
|
175
|
+
vue.createVNode(vue.Transition, {
|
|
176
|
+
name: "drawer-transition",
|
|
177
|
+
"enter-active-class": _ctx.transitionInClass,
|
|
178
|
+
"leave-active-class": _ctx.transitionOutClass,
|
|
179
|
+
onBeforeEnter: _ctx.beforeOpen,
|
|
180
|
+
onEnter: _ctx.opening,
|
|
181
|
+
onAfterEnter: _ctx.opened,
|
|
182
|
+
onBeforeLeave: _ctx.beforeClose,
|
|
183
|
+
onLeave: _ctx.closing,
|
|
184
|
+
onAfterLeave: _ctx.closed
|
|
185
|
+
}, {
|
|
186
|
+
default: vue.withCtx(() => [
|
|
187
|
+
vue.withDirectives(vue.createElementVNode("div", {
|
|
188
|
+
"data-drawer-id": _ctx.id,
|
|
189
|
+
tabindex: "-1",
|
|
190
|
+
class: vue.normalizeClass([_ctx.drawerClass, _ctx.position === "right" ? "drawer-right" : "drawer-left"]),
|
|
191
|
+
style: vue.normalizeStyle({ "z-index": _ctx.zIndex, ..._ctx.drawerStyle }),
|
|
192
|
+
role: "dialog",
|
|
193
|
+
"aria-label": _ctx.title,
|
|
194
|
+
"aria-modal": "false",
|
|
195
|
+
"aria-describedby": `${_ctx.id}-content`,
|
|
196
|
+
"aria-labelledby": `${_ctx.id}-title`
|
|
197
|
+
}, [
|
|
198
|
+
vue.renderSlot(_ctx.$slots, "title-wrapper", {}, () => [
|
|
199
|
+
vue.createElementVNode("div", {
|
|
200
|
+
class: vue.normalizeClass([
|
|
201
|
+
"flex items-center border-b border-p-gray-30 px-6 pb-4 pt-4",
|
|
202
|
+
{ "flex-row-reverse": _ctx.position === "right" }
|
|
203
|
+
])
|
|
204
|
+
}, [
|
|
205
|
+
_ctx.enableClose ? (vue.openBlock(), vue.createBlock(_component_PCloseBtn, {
|
|
206
|
+
key: 0,
|
|
207
|
+
"aria-label": _ctx.closeLabel,
|
|
208
|
+
class: "flex-0",
|
|
209
|
+
disabled: _ctx.disabled,
|
|
210
|
+
onClick: _ctx.close
|
|
211
|
+
}, null, 8, ["aria-label", "disabled", "onClick"])) : vue.createCommentVNode("", true),
|
|
212
|
+
vue.renderSlot(_ctx.$slots, "title", {}, () => [
|
|
213
|
+
_ctx.title ? (vue.openBlock(), vue.createElementBlock("h3", {
|
|
214
|
+
key: 0,
|
|
215
|
+
id: `${_ctx.id}-title`,
|
|
216
|
+
class: vue.normalizeClass(["flex-1 text-xl font-medium", { "text-right": _ctx.position === "left" }])
|
|
217
|
+
}, vue.toDisplayString(_ctx.title), 11, _hoisted_2)) : vue.createCommentVNode("", true)
|
|
218
|
+
], true)
|
|
219
|
+
], 2)
|
|
220
|
+
], true),
|
|
221
|
+
_ctx.errorMsg ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
|
|
222
|
+
vue.createVNode(_component_PAlert, { type: "error" }, {
|
|
223
|
+
default: vue.withCtx(() => [
|
|
224
|
+
vue.createElementVNode("div", _hoisted_4, vue.toDisplayString(_ctx.errorMsg), 1)
|
|
225
|
+
]),
|
|
226
|
+
_: 1
|
|
227
|
+
})
|
|
228
|
+
])) : vue.createCommentVNode("", true),
|
|
229
|
+
vue.renderSlot(_ctx.$slots, "content-wrapper", {}, () => [
|
|
230
|
+
vue.createElementVNode("div", {
|
|
231
|
+
class: vue.normalizeClass([
|
|
232
|
+
"relative grow overflow-y-auto overflow-x-hidden px-6 pt-6",
|
|
233
|
+
{ "pointer-events-none opacity-50": _ctx.disabled }
|
|
234
|
+
])
|
|
235
|
+
}, [
|
|
236
|
+
vue.renderSlot(_ctx.$slots, "default", {}, void 0, true)
|
|
237
|
+
], 2)
|
|
238
|
+
], true),
|
|
239
|
+
vue.renderSlot(_ctx.$slots, "footer-wrapper", {}, () => [
|
|
240
|
+
vue.createElementVNode("div", _hoisted_5, [
|
|
241
|
+
vue.renderSlot(_ctx.$slots, "footer", {}, void 0, true)
|
|
242
|
+
])
|
|
243
|
+
], true)
|
|
244
|
+
], 14, _hoisted_1), [
|
|
245
|
+
[vue.vShow, _ctx.show]
|
|
246
|
+
])
|
|
247
|
+
]),
|
|
248
|
+
_: 3
|
|
249
|
+
}, 8, ["enter-active-class", "leave-active-class", "onBeforeEnter", "onEnter", "onAfterEnter", "onBeforeLeave", "onLeave", "onAfterLeave"])
|
|
250
|
+
], 8, ["to"])) : vue.createCommentVNode("", true);
|
|
251
|
+
}
|
|
252
|
+
const pDrawer = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render], ["__scopeId", "data-v-a0b8be1e"]]);
|
|
253
|
+
module.exports = pDrawer;
|
|
@@ -1 +1,3 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const pDropdownSelect_vue_vue_type_script_setup_true_lang = require("./chunks/p-dropdown-select.js");
|
|
3
|
+
module.exports = pDropdownSelect_vue_vue_type_script_setup_true_lang._sfc_main;
|
package/dist/cjs/p-dropdown.js
CHANGED
|
@@ -1 +1,138 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const listKeyboardNavigation = require("./listKeyboardNavigation.js");
|
|
3
|
+
const vue = require("vue");
|
|
4
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
5
|
+
const ESCAPE_KEY = "Escape";
|
|
6
|
+
const _sfc_main = vue.defineComponent({
|
|
7
|
+
name: "PDropdown",
|
|
8
|
+
inheritAttrs: false,
|
|
9
|
+
props: {
|
|
10
|
+
/**
|
|
11
|
+
* Enables navigation for `.dropdown-item` using the up/down keys.
|
|
12
|
+
* This can be set to false when we're creating a generic popover.
|
|
13
|
+
*/
|
|
14
|
+
enableArrowNavigation: {
|
|
15
|
+
type: Boolean,
|
|
16
|
+
default: true
|
|
17
|
+
},
|
|
18
|
+
/**
|
|
19
|
+
* Enables closing the dropdown with the Escape key.
|
|
20
|
+
*/
|
|
21
|
+
enableCloseOnEsc: {
|
|
22
|
+
type: Boolean,
|
|
23
|
+
default: true
|
|
24
|
+
},
|
|
25
|
+
/**
|
|
26
|
+
* The selector that the arrow navigation function will use to
|
|
27
|
+
* match the items in the list.
|
|
28
|
+
*/
|
|
29
|
+
itemSelector: {
|
|
30
|
+
type: String,
|
|
31
|
+
default: ".dropdown-item:not(.disabled), .dropdown-item:not(:disabled)"
|
|
32
|
+
},
|
|
33
|
+
/**
|
|
34
|
+
* The CSS class of the "focused" dropdown item
|
|
35
|
+
*/
|
|
36
|
+
itemFocusClass: {
|
|
37
|
+
type: String,
|
|
38
|
+
default: "focus"
|
|
39
|
+
},
|
|
40
|
+
/**
|
|
41
|
+
* v-tooltip wraps the popper trigger with a div that has `display: inline-block` set by default.
|
|
42
|
+
* This prop is used to override the CSS style of that wrapper div
|
|
43
|
+
*/
|
|
44
|
+
triggerStyle: {
|
|
45
|
+
type: Object,
|
|
46
|
+
default: () => ({
|
|
47
|
+
display: "inline-block"
|
|
48
|
+
})
|
|
49
|
+
},
|
|
50
|
+
/**
|
|
51
|
+
* Custom reference element that is used to position the popper.
|
|
52
|
+
* Can be changed at runtime to create a dynamically positioned dropdown.
|
|
53
|
+
*/
|
|
54
|
+
reference: {
|
|
55
|
+
type: HTMLElement,
|
|
56
|
+
default: null
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
data() {
|
|
60
|
+
return {
|
|
61
|
+
defaultAttrs: {
|
|
62
|
+
triggers: ["click"],
|
|
63
|
+
"auto-hide": true,
|
|
64
|
+
theme: "p-dropdown-theme",
|
|
65
|
+
"popper-class": "dropdown",
|
|
66
|
+
placement: "bottom-start",
|
|
67
|
+
distance: 4,
|
|
68
|
+
delay: 0,
|
|
69
|
+
handleResize: true
|
|
70
|
+
},
|
|
71
|
+
navigationSvc: null
|
|
72
|
+
};
|
|
73
|
+
},
|
|
74
|
+
watch: {
|
|
75
|
+
reference: {
|
|
76
|
+
async handler(nV, oV) {
|
|
77
|
+
if (nV && oV !== nV) {
|
|
78
|
+
const popper = this.$refs.vPopper.$refs.popper;
|
|
79
|
+
if (popper) {
|
|
80
|
+
popper.$_detachPopperNode();
|
|
81
|
+
if (popper.shown) {
|
|
82
|
+
popper.hide({ skipDelay: true });
|
|
83
|
+
}
|
|
84
|
+
if (this.reference) {
|
|
85
|
+
popper.$_referenceNode = this.reference;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
},
|
|
92
|
+
mounted() {
|
|
93
|
+
Object.assign(this.$refs.vPopper.$refs.popper.$el.style, this.triggerStyle);
|
|
94
|
+
},
|
|
95
|
+
beforeUnmount() {
|
|
96
|
+
this.destroy();
|
|
97
|
+
},
|
|
98
|
+
methods: {
|
|
99
|
+
onShow() {
|
|
100
|
+
if (this.enableArrowNavigation) {
|
|
101
|
+
if (this.navigationSvc) {
|
|
102
|
+
this.navigationSvc.init();
|
|
103
|
+
} else {
|
|
104
|
+
this.navigationSvc = listKeyboardNavigation.setupListKeyboardNavigation({
|
|
105
|
+
itemContainer: this.$refs.vPopper.$refs.popperContent.$el
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
this.enableCloseOnEsc && document.addEventListener("keydown", this.popoverEscKeydown);
|
|
110
|
+
},
|
|
111
|
+
popoverEscKeydown(e) {
|
|
112
|
+
e.key === ESCAPE_KEY && this.$refs.vPopper.$refs.popper.hide();
|
|
113
|
+
},
|
|
114
|
+
destroy() {
|
|
115
|
+
var _a;
|
|
116
|
+
(_a = this.navigationSvc) == null ? void 0 : _a.destroy();
|
|
117
|
+
document.removeEventListener("keydown", this.popoverEscKeydown);
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
function _sfc_render(_ctx, _cache, $props, $setup, $data, $options) {
|
|
122
|
+
const _component_VDropdown = vue.resolveComponent("VDropdown");
|
|
123
|
+
return vue.openBlock(), vue.createBlock(_component_VDropdown, vue.mergeProps({ ref: "vPopper" }, { ..._ctx.defaultAttrs, ..._ctx.$attrs }, {
|
|
124
|
+
onShow: _ctx.onShow,
|
|
125
|
+
onHide: _ctx.destroy
|
|
126
|
+
}), vue.createSlots({ _: 2 }, [
|
|
127
|
+
vue.renderList(_ctx.$slots, (_, slot) => {
|
|
128
|
+
return {
|
|
129
|
+
name: slot,
|
|
130
|
+
fn: vue.withCtx((scope) => [
|
|
131
|
+
vue.renderSlot(_ctx.$slots, slot, vue.normalizeProps(vue.guardReactiveProps(scope || {})))
|
|
132
|
+
])
|
|
133
|
+
};
|
|
134
|
+
})
|
|
135
|
+
]), 1040, ["onShow", "onHide"]);
|
|
136
|
+
}
|
|
137
|
+
const PDropdown = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["render", _sfc_render]]);
|
|
138
|
+
module.exports = PDropdown;
|
|
@@ -1 +1,21 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
3
|
+
const getFileExtension = (fileName) => {
|
|
4
|
+
var _a;
|
|
5
|
+
if (!fileName || !fileName.includes(".")) {
|
|
6
|
+
return "";
|
|
7
|
+
}
|
|
8
|
+
return (_a = fileName.split(".").pop()) == null ? void 0 : _a.toLowerCase();
|
|
9
|
+
};
|
|
10
|
+
const formatBytes = (bytes, decimals = 2) => {
|
|
11
|
+
if (!+bytes || bytes <= 0) {
|
|
12
|
+
return "0 B";
|
|
13
|
+
}
|
|
14
|
+
const k = 1e3;
|
|
15
|
+
const dm = decimals < 0 ? 0 : decimals;
|
|
16
|
+
const sizes = ["B", "KB", "MB", "GB", "TB", "PB"];
|
|
17
|
+
const i = Math.floor(Math.log(bytes) / Math.log(k));
|
|
18
|
+
return `${parseFloat((bytes / Math.pow(k, i)).toFixed(dm))} ${sizes[i]}`;
|
|
19
|
+
};
|
|
20
|
+
exports.formatBytes = formatBytes;
|
|
21
|
+
exports.getFileExtension = getFileExtension;
|
package/dist/cjs/p-info-icon.js
CHANGED
|
@@ -1 +1,35 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";
|
|
2
|
+
const vue = require("vue");
|
|
3
|
+
const _pluginVue_exportHelper = require("./chunks/_plugin-vue_export-helper.js");
|
|
4
|
+
const _withScopeId = (n) => (vue.pushScopeId("data-v-189b159e"), n = n(), vue.popScopeId(), n);
|
|
5
|
+
const _hoisted_1 = /* @__PURE__ */ _withScopeId(() => /* @__PURE__ */ vue.createElementVNode("i", { class: "bg-info-circle-icon block h-3 w-3" }, null, -1));
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ vue.defineComponent({
|
|
7
|
+
...{
|
|
8
|
+
name: "PInfoIcon"
|
|
9
|
+
},
|
|
10
|
+
__name: "p-info-icon",
|
|
11
|
+
props: {
|
|
12
|
+
text: {
|
|
13
|
+
type: String,
|
|
14
|
+
default: ""
|
|
15
|
+
}
|
|
16
|
+
},
|
|
17
|
+
setup(__props) {
|
|
18
|
+
return (_ctx, _cache) => {
|
|
19
|
+
const _component_VTooltip = vue.resolveComponent("VTooltip");
|
|
20
|
+
return vue.openBlock(), vue.createBlock(_component_VTooltip, null, {
|
|
21
|
+
popper: vue.withCtx(() => [
|
|
22
|
+
vue.renderSlot(_ctx.$slots, "default", {}, () => [
|
|
23
|
+
vue.createTextVNode(vue.toDisplayString(__props.text), 1)
|
|
24
|
+
], true)
|
|
25
|
+
]),
|
|
26
|
+
default: vue.withCtx(() => [
|
|
27
|
+
_hoisted_1
|
|
28
|
+
]),
|
|
29
|
+
_: 3
|
|
30
|
+
});
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
});
|
|
34
|
+
const PInfoIcon = /* @__PURE__ */ _pluginVue_exportHelper._export_sfc(_sfc_main, [["__scopeId", "data-v-189b159e"]]);
|
|
35
|
+
module.exports = PInfoIcon;
|