@rebilly/revel 13.6.2 → 13.6.4
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/CHANGELOG.md +3 -3
- package/dist/_virtual/_plugin-vue_export-helper.mjs +8 -0
- package/dist/_virtual/_rolldown/runtime.mjs +27 -0
- package/dist/_virtual/builtin_esm-external-require-moment.mjs +9 -0
- package/dist/common/datetime-formats.mjs +22 -0
- package/dist/common/helpers/capitalize-first-letter.mjs +6 -0
- package/dist/common/helpers/format-date.mjs +7 -0
- package/dist/common/helpers/get-shadow-parent.mjs +6 -0
- package/dist/common/helpers/index.d.ts +1 -2
- package/dist/common/helpers/is-kebab-case.mjs +7 -0
- package/dist/common/helpers/is-mobile.mjs +5 -0
- package/dist/common/helpers/is-object.mjs +6 -0
- package/dist/common/helpers/sentence-case.mjs +33 -0
- package/dist/common/helpers/un-camel-case.mjs +7 -0
- package/dist/common/helpers/un-kebab-case.mjs +7 -0
- package/dist/components/index.mjs +81 -0
- package/dist/components/r-alert/r-alert.vue.mjs +6 -0
- package/dist/components/r-alert/r-alert.vue_vue_type_script_setup_true_lang.mjs +58 -0
- package/dist/components/r-avatar/r-avatar.vue.mjs +6 -0
- package/dist/components/r-avatar/r-avatar.vue_vue_type_script_setup_true_lang.mjs +56 -0
- package/dist/components/r-badge/r-badge.vue.mjs +6 -0
- package/dist/components/r-badge/r-badge.vue_vue_type_script_setup_true_lang.mjs +34 -0
- package/dist/components/r-button/r-button.vue.mjs +6 -0
- package/dist/components/r-button/r-button.vue_vue_type_script_setup_true_lang.mjs +119 -0
- package/dist/components/r-button-group/r-button-group.vue.mjs +6 -0
- package/dist/components/r-button-group/r-button-group.vue_vue_type_script_setup_true_lang.mjs +18 -0
- package/dist/components/r-checkbox/r-checkbox.vue.mjs +7 -0
- package/dist/components/r-checkbox/r-checkbox.vue_vue_type_script_setup_true_lang.mjs +77 -0
- package/dist/components/r-date-input/calendar-presets.mjs +85 -0
- package/dist/components/r-date-input/r-calendar.vue.mjs +5 -0
- package/dist/components/r-date-input/r-calendar.vue_vue_type_script_setup_true_lang.mjs +108 -0
- package/dist/components/r-date-input/r-date-input.vue.mjs +6 -0
- package/dist/components/r-date-input/r-date-input.vue_vue_type_script_setup_true_lang.mjs +136 -0
- package/dist/components/r-date-input/r-date-range-button-group.vue.mjs +6 -0
- package/dist/components/r-date-input/r-date-range-button-group.vue_vue_type_script_setup_true_lang.mjs +159 -0
- package/dist/components/r-date-input/r-range-calendar.vue.mjs +5 -0
- package/dist/components/r-date-input/r-range-calendar.vue_vue_type_script_setup_true_lang.mjs +116 -0
- package/dist/components/r-date-input/shared-calendar-options.mjs +41 -0
- package/dist/components/r-date-range/components/calendar.vue.mjs +5 -0
- package/dist/components/r-date-range/components/calendar.vue_vue_type_script_setup_true_lang.mjs +80 -0
- package/dist/components/r-date-range/components/inputs.vue.mjs +5 -0
- package/dist/components/r-date-range/components/inputs.vue_vue_type_script_setup_true_lang.mjs +405 -0
- package/dist/components/r-date-range/components/month.vue.mjs +5 -0
- package/dist/components/r-date-range/components/month.vue_vue_type_script_setup_true_lang.mjs +65 -0
- package/dist/components/r-date-range/components/popup.vue.mjs +5 -0
- package/dist/components/r-date-range/components/popup.vue_vue_type_script_setup_true_lang.mjs +163 -0
- package/dist/components/r-date-range/components/presets.vue.mjs +5 -0
- package/dist/components/r-date-range/components/presets.vue_vue_type_script_setup_true_lang.mjs +40 -0
- package/dist/components/r-date-range/components/trigger.vue.mjs +5 -0
- package/dist/components/r-date-range/components/trigger.vue_vue_type_script_setup_true_lang.mjs +81 -0
- package/dist/components/r-date-range/r-date-range.vue.mjs +6 -0
- package/dist/components/r-date-range/r-date-range.vue_vue_type_script_setup_true_lang.mjs +231 -0
- package/dist/components/r-date-range/resolve-effective-date-boundary.mjs +17 -0
- package/dist/components/r-date-range/use-calendar.mjs +87 -0
- package/dist/components/r-date-range/use-date-range-state.mjs +129 -0
- package/dist/components/r-field-group/r-field-group.vue.mjs +11 -0
- package/dist/components/r-field-label/r-field-label.vue.mjs +6 -0
- package/dist/components/r-field-label/r-field-label.vue_vue_type_script_setup_true_lang.mjs +33 -0
- package/dist/components/r-file-dropzone/pretty-file-name-format.mjs +28 -0
- package/dist/components/r-file-dropzone/pretty-file-size-format.mjs +15 -0
- package/dist/components/r-file-dropzone/r-file-dropzone-gallery-item.vue.mjs +5 -0
- package/dist/components/r-file-dropzone/r-file-dropzone-gallery-item.vue_vue_type_script_setup_true_lang.mjs +47 -0
- package/dist/components/r-file-dropzone/r-file-dropzone-gallery.vue.mjs +5 -0
- package/dist/components/r-file-dropzone/r-file-dropzone-gallery.vue_vue_type_script_setup_true_lang.mjs +18 -0
- package/dist/components/r-file-dropzone/r-file-dropzone-list.vue.mjs +5 -0
- package/dist/components/r-file-dropzone/r-file-dropzone-list.vue_vue_type_script_setup_true_lang.mjs +28 -0
- package/dist/components/r-file-dropzone/r-file-dropzone.vue.mjs +6 -0
- package/dist/components/r-file-dropzone/r-file-dropzone.vue_vue_type_script_setup_true_lang.mjs +174 -0
- package/dist/components/r-file-dropzone/types.mjs +6 -0
- package/dist/components/r-file-upload/r-file-upload.vue.mjs +6 -0
- package/dist/components/r-file-upload/r-file-upload.vue_vue_type_script_setup_true_lang.mjs +57 -0
- package/dist/components/r-flex/r-flex-item.vue.mjs +6 -0
- package/dist/components/r-flex/r-flex-item.vue_vue_type_script_setup_true_lang.mjs +28 -0
- package/dist/components/r-flex/r-flex.vue.mjs +6 -0
- package/dist/components/r-flex/r-flex.vue_vue_type_script_setup_true_lang.mjs +45 -0
- package/dist/components/r-grid/r-grid-cell.vue.mjs +6 -0
- package/dist/components/r-grid/r-grid-cell.vue_vue_type_script_setup_true_lang.mjs +46 -0
- package/dist/components/r-grid/r-grid.vue.mjs +6 -0
- package/dist/components/r-grid/r-grid.vue_vue_type_script_setup_true_lang.mjs +34 -0
- package/dist/components/r-icon/r-icon-sprites-16.mjs +811 -0
- package/dist/components/r-icon/r-icon-sprites-20.mjs +811 -0
- package/dist/components/r-icon/r-icon-sprites-24.mjs +811 -0
- package/dist/components/r-icon/r-icon-sprites-32.mjs +811 -0
- package/dist/components/r-icon/r-icon-sprites.mjs +170 -0
- package/dist/components/r-icon/r-icon.vue.mjs +6 -0
- package/dist/components/r-icon/r-icon.vue_vue_type_script_setup_true_lang.mjs +34 -0
- package/dist/components/r-img/r-img.vue.mjs +6 -0
- package/dist/components/r-img/r-img.vue_vue_type_script_setup_true_lang.mjs +42 -0
- package/dist/components/r-input/r-input.vue.mjs +6 -0
- package/dist/components/r-input/r-input.vue_vue_type_script_setup_true_lang.mjs +351 -0
- package/dist/components/r-input-errors/r-input-errors.vue.mjs +5 -0
- package/dist/components/r-input-errors/r-input-errors.vue_vue_type_script_setup_true_lang.mjs +22 -0
- package/dist/components/r-loader/r-loader.vue.mjs +6 -0
- package/dist/components/r-loader/r-loader.vue_vue_type_script_setup_true_lang.mjs +54 -0
- package/dist/components/r-modal/r-modal.vue.mjs +6 -0
- package/dist/components/r-modal/r-modal.vue_vue_type_script_setup_true_lang.mjs +128 -0
- package/dist/components/r-month-picker/months.mjs +17 -0
- package/dist/components/r-month-picker/r-month-picker.vue.mjs +6 -0
- package/dist/components/r-month-picker/r-month-picker.vue_vue_type_script_setup_true_lang.mjs +143 -0
- package/dist/components/r-multistep/r-multistep.vue.mjs +6 -0
- package/dist/components/r-multistep/r-multistep.vue_vue_type_script_setup_true_lang.mjs +66 -0
- package/dist/components/r-multistep/r-step.vue.mjs +6 -0
- package/dist/components/r-multistep/r-step.vue_vue_type_script_setup_true_lang.mjs +30 -0
- package/dist/components/r-pagination/r-pagination.vue.mjs +5 -0
- package/dist/components/r-pagination/r-pagination.vue_vue_type_script_setup_true_lang.mjs +61 -0
- package/dist/components/r-pagination-control/r-pagination-control.vue.mjs +6 -0
- package/dist/components/r-pagination-control/r-pagination-control.vue_vue_type_script_setup_true_lang.mjs +69 -0
- package/dist/components/r-popper/r-popper.vue.mjs +6 -0
- package/dist/components/r-popper/r-popper.vue_vue_type_script_setup_true_lang.mjs +252 -0
- package/dist/components/r-radio/r-radio.vue.mjs +7 -0
- package/dist/components/r-radio/r-radio.vue_vue_type_script_setup_true_lang.mjs +66 -0
- package/dist/components/r-repeater/r-repeater.vue.mjs +5 -0
- package/dist/components/r-repeater/r-repeater.vue_vue_type_script_setup_true_lang.mjs +50 -0
- package/dist/components/r-select/async-extension.mjs +171 -0
- package/dist/components/r-select/r-select.vue.mjs +245 -0
- package/dist/components/r-select/r-select.vue_vue_type_script_lang.mjs +599 -0
- package/dist/components/r-tabs/r-tab.vue.mjs +21 -0
- package/dist/components/r-tabs/r-tab.vue_vue_type_script_lang.mjs +84 -0
- package/dist/components/r-tabs/r-tabs.vue.mjs +72 -0
- package/dist/components/r-tabs/r-tabs.vue_vue_type_script_lang.mjs +140 -0
- package/dist/components/r-tile/r-tile-content.vue.mjs +6 -0
- package/dist/components/r-tile/r-tile-content.vue_vue_type_script_setup_true_lang.mjs +24 -0
- package/dist/components/r-tile/r-tile.vue.mjs +6 -0
- package/dist/components/r-tile/r-tile.vue_vue_type_script_setup_true_lang.mjs +26 -0
- package/dist/components/r-toast/default-error-handler.mjs +36 -0
- package/dist/components/r-toast/r-toast-manager.mjs +52 -0
- package/dist/components/r-toast/r-toast.vue.mjs +6 -0
- package/dist/components/r-toast/r-toast.vue_vue_type_script_setup_true_lang.mjs +96 -0
- package/dist/components/r-toast/types.mjs +6 -0
- package/dist/components/r-toggle/r-toggle.vue.mjs +6 -0
- package/dist/components/r-toggle/r-toggle.vue_vue_type_script_setup_true_lang.mjs +52 -0
- package/dist/composables/use-validate.mjs +20 -0
- package/dist/directives/index.mjs +14 -0
- package/dist/directives/r-click-outside/r-click-outside.mjs +13 -0
- package/dist/directives/r-content/r-content.mjs +12 -0
- package/dist/directives/r-lazy.mjs +19 -0
- package/dist/directives/r-tooltip/r-tooltip.mjs +51 -0
- package/dist/index.mjs +58 -0
- package/dist/revel.umd.js +3 -3
- package/dist/styles/index.mjs +5 -0
- package/dist/styles/tokens.mjs +220 -0
- package/dist/vendor/@angelblanco/v-calendar/dist/es/index.mjs +5106 -0
- package/dist/vendor/@popperjs/core/lib/createPopper.mjs +109 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/contains.mjs +16 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getBoundingClientRect.mjs +23 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getClippingRect.mjs +37 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getCompositeRect.mjs +31 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getComputedStyle.mjs +7 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getDocumentElement.mjs +7 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getDocumentRect.mjs +17 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getHTMLElementScroll.mjs +9 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getLayoutRect.mjs +13 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getNodeName.mjs +6 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getNodeScroll.mjs +10 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getOffsetParent.mjs +28 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getParentNode.mjs +9 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getScrollParent.mjs +14 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getViewportRect.mjs +21 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getWindow.mjs +11 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getWindowScroll.mjs +11 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/getWindowScrollBarX.mjs +9 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/instanceOf.mjs +13 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/isLayoutViewport.mjs +7 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/isScrollParent.mjs +8 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/isTableElement.mjs +11 -0
- package/dist/vendor/@popperjs/core/lib/dom-utils/listScrollParents.mjs +12 -0
- package/dist/vendor/@popperjs/core/lib/enums.mjs +26 -0
- package/dist/vendor/@popperjs/core/lib/modifiers/applyStyles.mjs +45 -0
- package/dist/vendor/@popperjs/core/lib/modifiers/arrow.mjs +35 -0
- package/dist/vendor/@popperjs/core/lib/modifiers/computeStyles.mjs +88 -0
- package/dist/vendor/@popperjs/core/lib/modifiers/eventListeners.mjs +23 -0
- package/dist/vendor/@popperjs/core/lib/modifiers/flip.mjs +69 -0
- package/dist/vendor/@popperjs/core/lib/modifiers/hide.mjs +45 -0
- package/dist/vendor/@popperjs/core/lib/modifiers/offset.mjs +28 -0
- package/dist/vendor/@popperjs/core/lib/modifiers/popperOffsets.mjs +20 -0
- package/dist/vendor/@popperjs/core/lib/modifiers/preventOverflow.mjs +52 -0
- package/dist/vendor/@popperjs/core/lib/popper.mjs +25 -0
- package/dist/vendor/@popperjs/core/lib/utils/computeAutoPlacement.mjs +27 -0
- package/dist/vendor/@popperjs/core/lib/utils/computeOffsets.mjs +51 -0
- package/dist/vendor/@popperjs/core/lib/utils/debounce.mjs +13 -0
- package/dist/vendor/@popperjs/core/lib/utils/detectOverflow.mjs +34 -0
- package/dist/vendor/@popperjs/core/lib/utils/expandToHashMap.mjs +8 -0
- package/dist/vendor/@popperjs/core/lib/utils/getAltAxis.mjs +6 -0
- package/dist/vendor/@popperjs/core/lib/utils/getBasePlacement.mjs +6 -0
- package/dist/vendor/@popperjs/core/lib/utils/getFreshSideObject.mjs +11 -0
- package/dist/vendor/@popperjs/core/lib/utils/getMainAxisFromPlacement.mjs +6 -0
- package/dist/vendor/@popperjs/core/lib/utils/getOppositePlacement.mjs +14 -0
- package/dist/vendor/@popperjs/core/lib/utils/getOppositeVariationPlacement.mjs +12 -0
- package/dist/vendor/@popperjs/core/lib/utils/getVariation.mjs +6 -0
- package/dist/vendor/@popperjs/core/lib/utils/math.mjs +4 -0
- package/dist/vendor/@popperjs/core/lib/utils/mergeByName.mjs +15 -0
- package/dist/vendor/@popperjs/core/lib/utils/mergePaddingObject.mjs +7 -0
- package/dist/vendor/@popperjs/core/lib/utils/orderModifiers.mjs +29 -0
- package/dist/vendor/@popperjs/core/lib/utils/rectToClientRect.mjs +11 -0
- package/dist/vendor/@popperjs/core/lib/utils/userAgent.mjs +9 -0
- package/dist/vendor/@popperjs/core/lib/utils/within.mjs +11 -0
- package/dist/vendor/es-toolkit/dist/_internal/globalThis.mjs +6 -0
- package/dist/vendor/es-toolkit/dist/compat/_internal/getSymbols.mjs +6 -0
- package/dist/vendor/es-toolkit/dist/compat/_internal/getTag.mjs +6 -0
- package/dist/vendor/es-toolkit/dist/compat/_internal/tags.mjs +4 -0
- package/dist/vendor/es-toolkit/dist/compat/function/debounce.mjs +15 -0
- package/dist/vendor/es-toolkit/dist/compat/object/cloneDeep.mjs +7 -0
- package/dist/vendor/es-toolkit/dist/compat/object/cloneDeepWith.mjs +31 -0
- package/dist/vendor/es-toolkit/dist/function/debounce.mjs +26 -0
- package/dist/vendor/es-toolkit/dist/function/throttle.mjs +15 -0
- package/dist/vendor/es-toolkit/dist/object/cloneDeepWith.mjs +116 -0
- package/dist/vendor/es-toolkit/dist/predicate/isBuffer.mjs +7 -0
- package/dist/vendor/es-toolkit/dist/predicate/isPrimitive.mjs +6 -0
- package/dist/vendor/es-toolkit/dist/predicate/isTypedArray.mjs +6 -0
- package/dist/vendor/es-toolkit/dist/string/kebabCase.mjs +7 -0
- package/dist/vendor/es-toolkit/dist/string/words.mjs +7 -0
- package/dist/vendor/moment-timezone/data/packed/latest.json.mjs +19 -0
- package/dist/vendor/moment-timezone/index.mjs +10 -0
- package/dist/vendor/moment-timezone/moment-timezone.mjs +236 -0
- package/dist/vendor/nanoid/non-secure/index.mjs +8 -0
- package/package.json +10 -4
- package/dist/revel.mjs +0 -15886
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { __toESM as e } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_moment_timezone as t } from "../../vendor/moment-timezone/index.mjs";
|
|
3
|
+
import { computed as n, ref as r } from "vue";
|
|
4
|
+
//#region src/components/r-date-range/use-calendar.ts
|
|
5
|
+
var i = /* @__PURE__ */ e(t());
|
|
6
|
+
function a(e = {}) {
|
|
7
|
+
let { timezone: t = "UTC", minDate: a, maxDate: o, columns: s } = e, c = (0, i.default)().tz(t), l = r(c.year()), u = r(c.month());
|
|
8
|
+
function d(e, t, n, r) {
|
|
9
|
+
let i = new Date(e, t, n);
|
|
10
|
+
return {
|
|
11
|
+
date: i,
|
|
12
|
+
day: n,
|
|
13
|
+
month: t,
|
|
14
|
+
year: e,
|
|
15
|
+
isToday: b(i),
|
|
16
|
+
isCurrentMonth: r,
|
|
17
|
+
isDisabled: y(i)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function f(e, t) {
|
|
21
|
+
let n = new Date(e, t, 1), r = n.getFullYear(), a = n.getMonth(), o = new Date(r, a, 1).getDay(), s = [], c = [], l = new Date(r, a, 1 - o);
|
|
22
|
+
for (let e = 0; e < 42; e++) {
|
|
23
|
+
let t = new Date(l);
|
|
24
|
+
t.setDate(l.getDate() + e);
|
|
25
|
+
let n = t.getMonth() === a;
|
|
26
|
+
c.push(d(t.getFullYear(), t.getMonth(), t.getDate(), n)), c.length === 7 && (s.push(c), c = []);
|
|
27
|
+
}
|
|
28
|
+
return {
|
|
29
|
+
month: a,
|
|
30
|
+
year: r,
|
|
31
|
+
name: (0, i.default)({
|
|
32
|
+
year: r,
|
|
33
|
+
month: a
|
|
34
|
+
}).format("MMMM"),
|
|
35
|
+
weeks: s
|
|
36
|
+
};
|
|
37
|
+
}
|
|
38
|
+
let p = n(() => {
|
|
39
|
+
let e = s?.value ?? 2, t = [];
|
|
40
|
+
for (let n = 0; n < e; n++) t.push(f(l.value, u.value + n));
|
|
41
|
+
return t;
|
|
42
|
+
});
|
|
43
|
+
function m() {
|
|
44
|
+
u.value === 11 ? (u.value = 0, l.value++) : u.value++;
|
|
45
|
+
}
|
|
46
|
+
function h() {
|
|
47
|
+
u.value === 0 ? (u.value = 11, l.value--) : u.value--;
|
|
48
|
+
}
|
|
49
|
+
function g() {
|
|
50
|
+
l.value++;
|
|
51
|
+
}
|
|
52
|
+
function _() {
|
|
53
|
+
l.value--;
|
|
54
|
+
}
|
|
55
|
+
function v(e) {
|
|
56
|
+
l.value = e.getFullYear(), u.value = e.getMonth();
|
|
57
|
+
}
|
|
58
|
+
function y(e) {
|
|
59
|
+
if (a?.value) {
|
|
60
|
+
let t = new Date(a.value);
|
|
61
|
+
if (t.setHours(0, 0, 0, 0), e < t) return !0;
|
|
62
|
+
}
|
|
63
|
+
if (o?.value) {
|
|
64
|
+
let t = new Date(o.value);
|
|
65
|
+
if (t.setHours(23, 59, 59, 999), e > t) return !0;
|
|
66
|
+
}
|
|
67
|
+
return !1;
|
|
68
|
+
}
|
|
69
|
+
function b(e) {
|
|
70
|
+
let n = (0, i.default)().tz(t);
|
|
71
|
+
return e.getDate() === n.date() && e.getMonth() === n.month() && e.getFullYear() === n.year();
|
|
72
|
+
}
|
|
73
|
+
return {
|
|
74
|
+
currentYear: l,
|
|
75
|
+
currentMonth: u,
|
|
76
|
+
displayedMonths: p,
|
|
77
|
+
nextMonth: m,
|
|
78
|
+
prevMonth: h,
|
|
79
|
+
nextYear: g,
|
|
80
|
+
prevYear: _,
|
|
81
|
+
goToDate: v,
|
|
82
|
+
isDateDisabled: y,
|
|
83
|
+
isToday: b
|
|
84
|
+
};
|
|
85
|
+
}
|
|
86
|
+
//#endregion
|
|
87
|
+
export { a as useCalendar };
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { __toESM as e } from "../../_virtual/_rolldown/runtime.mjs";
|
|
2
|
+
import { require_moment_timezone as t } from "../../vendor/moment-timezone/index.mjs";
|
|
3
|
+
import { calendarPresetsLabels as n, getCalendarPresetPeriods as r } from "../r-date-input/calendar-presets.mjs";
|
|
4
|
+
import { computed as i, ref as a } from "vue";
|
|
5
|
+
//#region src/components/r-date-range/use-date-range-state.ts
|
|
6
|
+
var o = /* @__PURE__ */ e(t());
|
|
7
|
+
function s(e, t) {
|
|
8
|
+
return e.getDate() === t.getDate() && e.getMonth() === t.getMonth() && e.getFullYear() === t.getFullYear();
|
|
9
|
+
}
|
|
10
|
+
function c(e = {}) {
|
|
11
|
+
let { timezone: t = "UTC", showTimePicker: c = !0 } = e, l = a(null), u = a(null), d = a({
|
|
12
|
+
hours: 0,
|
|
13
|
+
minutes: 0
|
|
14
|
+
}), f = a({
|
|
15
|
+
hours: 23,
|
|
16
|
+
minutes: 59
|
|
17
|
+
}), p = a(null), m = a("start"), h = a(null), g = i(() => h.value ? n[h.value] ?? null : null), _ = i(() => l.value !== null);
|
|
18
|
+
function v(e) {
|
|
19
|
+
m.value === "start" || m.value === null || !l.value ? (l.value = e, u.value = null, m.value = "end", h.value = null) : m.value === "end" && (e < l.value ? (u.value = l.value, l.value = e) : u.value = e, m.value = "start", h.value = null);
|
|
20
|
+
}
|
|
21
|
+
function y(e) {
|
|
22
|
+
p.value = e;
|
|
23
|
+
}
|
|
24
|
+
function b(e) {
|
|
25
|
+
if (!l.value) return !1;
|
|
26
|
+
let t = u.value || p.value;
|
|
27
|
+
if (!t) return !1;
|
|
28
|
+
let n = l.value, r = t;
|
|
29
|
+
return r < n ? e >= r && e <= n : e >= n && e <= r;
|
|
30
|
+
}
|
|
31
|
+
function x(e) {
|
|
32
|
+
if (!l.value) return !1;
|
|
33
|
+
let t = u.value || p.value;
|
|
34
|
+
return t && t < l.value ? s(e, t) : s(e, l.value);
|
|
35
|
+
}
|
|
36
|
+
function S(e) {
|
|
37
|
+
let t = u.value || p.value;
|
|
38
|
+
return t ? l.value && t < l.value ? s(e, l.value) : s(e, t) : !1;
|
|
39
|
+
}
|
|
40
|
+
function C(e) {
|
|
41
|
+
l.value = new Date(e.start.year(), e.start.month(), e.start.date()), u.value = new Date(e.end.year(), e.end.month(), e.end.date()), d.value = {
|
|
42
|
+
hours: e.start.hours(),
|
|
43
|
+
minutes: e.start.minutes()
|
|
44
|
+
}, f.value = {
|
|
45
|
+
hours: e.end.hours(),
|
|
46
|
+
minutes: e.end.minutes()
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
function w(e) {
|
|
50
|
+
let n = r(t)[e];
|
|
51
|
+
n && (C(n), h.value = e, m.value = "start");
|
|
52
|
+
}
|
|
53
|
+
function T() {
|
|
54
|
+
if (!l.value) return null;
|
|
55
|
+
let e = u.value || l.value, n = o.default.tz({
|
|
56
|
+
year: l.value.getFullYear(),
|
|
57
|
+
month: l.value.getMonth(),
|
|
58
|
+
date: l.value.getDate(),
|
|
59
|
+
hour: c ? d.value.hours : 0,
|
|
60
|
+
minute: c ? d.value.minutes : 0,
|
|
61
|
+
second: 0
|
|
62
|
+
}, t), i = o.default.tz({
|
|
63
|
+
year: e.getFullYear(),
|
|
64
|
+
month: e.getMonth(),
|
|
65
|
+
date: e.getDate(),
|
|
66
|
+
hour: c ? f.value.hours : 23,
|
|
67
|
+
minute: c ? f.value.minutes : 59,
|
|
68
|
+
second: 59
|
|
69
|
+
}, t), a = r(t), s = h.value ? a[h.value] : null;
|
|
70
|
+
return {
|
|
71
|
+
start: n.toDate(),
|
|
72
|
+
end: i.toDate(),
|
|
73
|
+
isRelative: !!h.value,
|
|
74
|
+
relativeFilterValue: s?.relativeFilterValue ?? null
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function E(e) {
|
|
78
|
+
if (!e) O();
|
|
79
|
+
else {
|
|
80
|
+
if (e.relativeFilterValue) {
|
|
81
|
+
let n = r(t), i = Object.entries(n).find(([, t]) => t.relativeFilterValue === e.relativeFilterValue);
|
|
82
|
+
if (i) {
|
|
83
|
+
let [e, t] = i;
|
|
84
|
+
C(t), m.value = "start", h.value = e;
|
|
85
|
+
return;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
C({
|
|
89
|
+
start: (0, o.default)(e.start).tz(t),
|
|
90
|
+
end: (0, o.default)(e.end).tz(t)
|
|
91
|
+
}), m.value = "start", h.value = null;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
function D() {
|
|
95
|
+
l.value = null, u.value = null, d.value = {
|
|
96
|
+
hours: 0,
|
|
97
|
+
minutes: 0
|
|
98
|
+
}, f.value = {
|
|
99
|
+
hours: 23,
|
|
100
|
+
minutes: 59
|
|
101
|
+
}, p.value = null, m.value = "start", h.value = null;
|
|
102
|
+
}
|
|
103
|
+
function O() {
|
|
104
|
+
D();
|
|
105
|
+
}
|
|
106
|
+
return {
|
|
107
|
+
startDate: l,
|
|
108
|
+
endDate: u,
|
|
109
|
+
startTime: d,
|
|
110
|
+
endTime: f,
|
|
111
|
+
hoveredDate: p,
|
|
112
|
+
selectionMode: m,
|
|
113
|
+
selectedPreset: h,
|
|
114
|
+
selectedPresetLabel: g,
|
|
115
|
+
onDateClick: v,
|
|
116
|
+
onDateHover: y,
|
|
117
|
+
isInRange: b,
|
|
118
|
+
isRangeStart: x,
|
|
119
|
+
isRangeEnd: S,
|
|
120
|
+
applyPreset: w,
|
|
121
|
+
buildDateRange: T,
|
|
122
|
+
reset: D,
|
|
123
|
+
setFromDateRange: E,
|
|
124
|
+
clear: O,
|
|
125
|
+
hasSelection: _
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
//#endregion
|
|
129
|
+
export { c as useDateRangeState };
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* empty css */
|
|
2
|
+
import e from "../../_virtual/_plugin-vue_export-helper.mjs";
|
|
3
|
+
import { createElementBlock as t, openBlock as n, renderSlot as r } from "vue";
|
|
4
|
+
//#region src/components/r-field-group/r-field-group.vue
|
|
5
|
+
var i = {}, a = { class: "r-field-group" };
|
|
6
|
+
function o(e, i) {
|
|
7
|
+
return n(), t("div", a, [r(e.$slots, "default")]);
|
|
8
|
+
}
|
|
9
|
+
var s = /*#__PURE__*/ e(i, [["render", o]]);
|
|
10
|
+
//#endregion
|
|
11
|
+
export { s as default };
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { Fragment as e, createCommentVNode as t, createElementBlock as n, createElementVNode as r, defineComponent as i, openBlock as a, renderSlot as o, watchEffect as s } from "vue";
|
|
2
|
+
//#region src/components/r-field-label/r-field-label.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var c = ["for"], l = {
|
|
4
|
+
key: 0,
|
|
5
|
+
class: "r-field-label-required"
|
|
6
|
+
}, u = {
|
|
7
|
+
key: 1,
|
|
8
|
+
class: "r-field-label-optional"
|
|
9
|
+
}, d = /*@__PURE__*/ i({
|
|
10
|
+
__name: "r-field-label",
|
|
11
|
+
props: {
|
|
12
|
+
for: { default: void 0 },
|
|
13
|
+
required: {
|
|
14
|
+
type: Boolean,
|
|
15
|
+
default: !1
|
|
16
|
+
},
|
|
17
|
+
optional: {
|
|
18
|
+
type: Boolean,
|
|
19
|
+
default: !1
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
setup(i) {
|
|
23
|
+
let d = i;
|
|
24
|
+
return s(() => {
|
|
25
|
+
d.required && d.optional && console.warn("'required' and 'optional' are exclusive; neither marker is shown");
|
|
26
|
+
}), (i, s) => (a(), n("label", {
|
|
27
|
+
class: "r-field-label",
|
|
28
|
+
for: d.for
|
|
29
|
+
}, [o(i.$slots, "default"), d.required === d.optional ? t("", !0) : (a(), n(e, { key: 0 }, [d.required ? (a(), n("span", l, [...s[0] ||= [r("span", { "aria-hidden": "true" }, "*", -1), r("span", { class: "r-sr-only" }, "required", -1)]])) : (a(), n("span", u, "(optional)"))], 64))], 8, c));
|
|
30
|
+
}
|
|
31
|
+
});
|
|
32
|
+
//#endregion
|
|
33
|
+
export { d as default };
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//#region src/components/r-file-dropzone/pretty-file-name-format.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (!e) return null;
|
|
4
|
+
let t = {
|
|
5
|
+
"image/*": "All image types",
|
|
6
|
+
"video/*": "All video types",
|
|
7
|
+
"audio/*": "All audio types",
|
|
8
|
+
"image/jpeg": "JPEG",
|
|
9
|
+
"image/png": "PNG",
|
|
10
|
+
"image/gif": "GIF",
|
|
11
|
+
"image/webp": "WEBP",
|
|
12
|
+
"application/pdf": "PDF",
|
|
13
|
+
"application/zip": "ZIP",
|
|
14
|
+
"application/msword": "DOC",
|
|
15
|
+
"application/vnd.openxmlformats-officedocument.wordprocessingml.document": "DOCX",
|
|
16
|
+
".jpg": "JPG",
|
|
17
|
+
".jpeg": "JPEG",
|
|
18
|
+
".png": "PNG",
|
|
19
|
+
".gif": "GIF",
|
|
20
|
+
".svg": "SVG",
|
|
21
|
+
".webp": "WEBP",
|
|
22
|
+
".pdf": "PDF",
|
|
23
|
+
".zip": "ZIP"
|
|
24
|
+
};
|
|
25
|
+
return e.split(",").map((e) => t[e.trim()] ?? e.trim().replace(/^\./, "").toUpperCase()).join(", ");
|
|
26
|
+
}
|
|
27
|
+
//#endregion
|
|
28
|
+
export { e as prettyFileNameFormat };
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
//#region src/components/r-file-dropzone/pretty-file-size-format.ts
|
|
2
|
+
function e(e) {
|
|
3
|
+
if (typeof e != "number" || !Number.isFinite(e) || e < 0) return "0 B";
|
|
4
|
+
let t = [
|
|
5
|
+
"B",
|
|
6
|
+
"kB",
|
|
7
|
+
"MB",
|
|
8
|
+
"GB",
|
|
9
|
+
"TB"
|
|
10
|
+
], n = e, r = 0;
|
|
11
|
+
for (; n >= 1e3 && r < t.length - 1;) n /= 1e3, r++;
|
|
12
|
+
return Math.round(n * 10) >= 1e4 && r < t.length - 1 && (n /= 1e3, r++), `${n >= 10 || r === 0 ? Math.round(n).toString() : n.toFixed(1).replace(/\.0$/, "")} ${t[r]}`;
|
|
13
|
+
}
|
|
14
|
+
//#endregion
|
|
15
|
+
export { e as prettyFileSizeFormat };
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { isUploadedFile as e } from "./types.mjs";
|
|
2
|
+
import { computed as t, createElementBlock as n, createElementVNode as r, createVNode as i, defineComponent as a, onMounted as o, openBlock as s, ref as c, resolveComponent as l, toDisplayString as u, watch as d, withModifiers as f } from "vue";
|
|
3
|
+
//#region src/components/r-file-dropzone/r-file-dropzone-gallery-item.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var p = { class: "r-file-dropzone-gallery-item" }, m = {
|
|
5
|
+
key: 0,
|
|
6
|
+
class: "r-file-dropzone-gallery-item-image"
|
|
7
|
+
}, h = ["src"], g = {
|
|
8
|
+
key: 1,
|
|
9
|
+
class: "r-file-dropzone-gallery-item-icon"
|
|
10
|
+
}, _ = { class: "r-file-dropzone-gallery-item-overlay" }, v = { class: "r-file-dropzone-gallery-item-name" }, y = { class: "r-file-dropzone-gallery-item-action" }, b = /*@__PURE__*/ a({
|
|
11
|
+
__name: "r-file-dropzone-gallery-item",
|
|
12
|
+
props: { file: {} },
|
|
13
|
+
emits: ["remove"],
|
|
14
|
+
setup(a, { emit: b }) {
|
|
15
|
+
let x = a, S = b, C = c(""), w = t(() => !C.value);
|
|
16
|
+
function T() {
|
|
17
|
+
if (C.value &&= "", x.file.name) {
|
|
18
|
+
if (e(x.file)) C.value = x.file.url;
|
|
19
|
+
else if (x.file.image && x.file.image instanceof File && x.file.image.type.startsWith("image/")) {
|
|
20
|
+
let e = new FileReader();
|
|
21
|
+
e.readAsDataURL(x.file.image), e.onload = (e) => {
|
|
22
|
+
(e.target?.result).includes("image") && (C.value = e.target?.result);
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return o(T), d(() => x.file, T), (e, t) => {
|
|
28
|
+
let o = l("r-icon"), c = l("r-button");
|
|
29
|
+
return s(), n("div", p, [w.value ? (s(), n("div", g, [r("span", null, [i(o, {
|
|
30
|
+
icon: "file",
|
|
31
|
+
size: "32"
|
|
32
|
+
})])])) : (s(), n("div", m, [r("img", { src: C.value }, null, 8, h)])), r("div", _, [
|
|
33
|
+
t[1] ||= r("div", { class: "r-file-dropzone-gallery-item-overlay-bg" }, null, -1),
|
|
34
|
+
r("div", v, [r("small", null, u(a.file.name), 1)]),
|
|
35
|
+
r("div", y, [i(c, {
|
|
36
|
+
size: "small",
|
|
37
|
+
type: "danger",
|
|
38
|
+
icon: "trash",
|
|
39
|
+
fluid: "",
|
|
40
|
+
onClick: t[0] ||= f((e) => S("remove"), ["stop"])
|
|
41
|
+
})])
|
|
42
|
+
])]);
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
//#endregion
|
|
47
|
+
export { b as default };
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import e from "./r-file-dropzone-gallery-item.vue.mjs";
|
|
2
|
+
import { Fragment as t, createBlock as n, createElementBlock as r, defineComponent as i, openBlock as a, renderList as o } from "vue";
|
|
3
|
+
//#region src/components/r-file-dropzone/r-file-dropzone-gallery.vue?vue&type=script&setup=true&lang.ts
|
|
4
|
+
var s = { class: "r-file-dropzone-gallery" }, c = /*@__PURE__*/ i({
|
|
5
|
+
__name: "r-file-dropzone-gallery",
|
|
6
|
+
props: { files: {} },
|
|
7
|
+
emits: ["remove"],
|
|
8
|
+
setup(i, { emit: c }) {
|
|
9
|
+
let l = i, u = c;
|
|
10
|
+
return (i, c) => (a(), r("div", s, [(a(!0), r(t, null, o(l.files, (t, r) => (a(), n(e, {
|
|
11
|
+
key: t.name + r,
|
|
12
|
+
file: t,
|
|
13
|
+
onRemove: (e) => u("remove", r)
|
|
14
|
+
}, null, 8, ["file", "onRemove"]))), 128))]));
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
//#endregion
|
|
18
|
+
export { c as default };
|
package/dist/components/r-file-dropzone/r-file-dropzone-list.vue_vue_type_script_setup_true_lang.mjs
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Fragment as e, createElementBlock as t, createElementVNode as n, createVNode as r, defineComponent as i, openBlock as a, renderList as o, resolveComponent as s, toDisplayString as c, withModifiers as l } from "vue";
|
|
2
|
+
//#region src/components/r-file-dropzone/r-file-dropzone-list.vue?vue&type=script&setup=true&lang.ts
|
|
3
|
+
var u = { class: "r-file-dropzone-list" }, d = { class: "r-file-dropzone-list-item-name" }, f = { class: "r-file-dropzone-list-item-size r-text-muted" }, p = { class: "r-file-dropzone-list-item-delete" }, m = /*@__PURE__*/ i({
|
|
4
|
+
__name: "r-file-dropzone-list",
|
|
5
|
+
props: { files: {} },
|
|
6
|
+
emits: ["remove"],
|
|
7
|
+
setup(i, { emit: m }) {
|
|
8
|
+
let h = i, g = m;
|
|
9
|
+
return (i, m) => {
|
|
10
|
+
let _ = s("r-button");
|
|
11
|
+
return a(), t("div", u, [(a(!0), t(e, null, o(h.files, (e, i) => (a(), t("div", {
|
|
12
|
+
key: e.name + i,
|
|
13
|
+
class: "r-file-dropzone-list-item"
|
|
14
|
+
}, [
|
|
15
|
+
n("div", d, c(e.name), 1),
|
|
16
|
+
n("div", f, c(e.size), 1),
|
|
17
|
+
n("div", p, [r(_, {
|
|
18
|
+
type: "danger",
|
|
19
|
+
size: "small",
|
|
20
|
+
icon: "trash",
|
|
21
|
+
onClick: l((e) => g("remove", i), ["stop"])
|
|
22
|
+
}, null, 8, ["onClick"])])
|
|
23
|
+
]))), 128))]);
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
//#endregion
|
|
28
|
+
export { m as default };
|
package/dist/components/r-file-dropzone/r-file-dropzone.vue_vue_type_script_setup_true_lang.mjs
ADDED
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
import e from "../r-icon/r-icon.vue.mjs";
|
|
2
|
+
import t from "../r-button/r-button.vue.mjs";
|
|
3
|
+
import { useValidate as n } from "../../composables/use-validate.mjs";
|
|
4
|
+
import r from "./r-file-dropzone-list.vue.mjs";
|
|
5
|
+
import { isUploadedFile as i } from "./types.mjs";
|
|
6
|
+
import a from "./r-file-dropzone-gallery.vue.mjs";
|
|
7
|
+
import { prettyFileNameFormat as o } from "./pretty-file-name-format.mjs";
|
|
8
|
+
import { prettyFileSizeFormat as s } from "./pretty-file-size-format.mjs";
|
|
9
|
+
import { Fragment as c, computed as l, createBlock as u, createCommentVNode as d, createElementBlock as f, createElementVNode as p, createTextVNode as m, createVNode as h, defineComponent as g, normalizeClass as _, openBlock as v, reactive as y, renderList as b, renderSlot as x, toDisplayString as S, unref as C, useTemplateRef as w, withCtx as T, withModifiers as E } from "vue";
|
|
10
|
+
//#region src/components/r-file-dropzone/r-file-dropzone.vue?vue&type=script&setup=true&lang.ts
|
|
11
|
+
var D = { class: "r-file-dropzone-fields" }, O = { class: "r-file-dropzone-heading" }, ee = {
|
|
12
|
+
key: 0,
|
|
13
|
+
class: "r-mb-6 r-text-muted"
|
|
14
|
+
}, k = { class: "r-d-block" }, A = {
|
|
15
|
+
key: 0,
|
|
16
|
+
class: "r-file-dropzone-error-list"
|
|
17
|
+
}, j = { key: 0 }, M = { key: 1 }, N = [
|
|
18
|
+
"accept",
|
|
19
|
+
"multiple",
|
|
20
|
+
"disabled"
|
|
21
|
+
], P = {
|
|
22
|
+
key: 1,
|
|
23
|
+
class: "r-mt-7"
|
|
24
|
+
}, F = /*@__PURE__*/ g({
|
|
25
|
+
__name: "r-file-dropzone",
|
|
26
|
+
props: {
|
|
27
|
+
modelValue: {},
|
|
28
|
+
multiple: {
|
|
29
|
+
type: Boolean,
|
|
30
|
+
default: !1
|
|
31
|
+
},
|
|
32
|
+
accept: { default: "" },
|
|
33
|
+
disabled: {
|
|
34
|
+
type: Boolean,
|
|
35
|
+
default: !1
|
|
36
|
+
},
|
|
37
|
+
previewType: { default: "list" },
|
|
38
|
+
hidePreview: {
|
|
39
|
+
type: Boolean,
|
|
40
|
+
default: !1
|
|
41
|
+
},
|
|
42
|
+
maxFileSize: { default: void 0 },
|
|
43
|
+
validate: { default: null },
|
|
44
|
+
showValidateMessages: {
|
|
45
|
+
type: Boolean,
|
|
46
|
+
default: !1
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
emits: ["update:modelValue"],
|
|
50
|
+
setup(g, { emit: F }) {
|
|
51
|
+
let I = g, L = F, R = w("file-input"), { validateErrorMessages: z, isInvalid: B } = n(() => I.validate), V = y({
|
|
52
|
+
dropzoneHighlight: !1,
|
|
53
|
+
invalidFiles: []
|
|
54
|
+
}), H = l({
|
|
55
|
+
get() {
|
|
56
|
+
return Array.isArray(I.modelValue) ? I.modelValue : I.modelValue ? [I.modelValue] : [];
|
|
57
|
+
},
|
|
58
|
+
set(e) {
|
|
59
|
+
I.multiple ? L("update:modelValue", e) : L("update:modelValue", e[0] ?? null);
|
|
60
|
+
}
|
|
61
|
+
}), U = l(() => H.value.map(J)), W = l(() => I.hidePreview ? !1 : Array.isArray(I.modelValue) ? I.modelValue.length > 0 : !!I.modelValue), G = l(() => ({
|
|
62
|
+
"r-file-dropzone--highlight": V.dropzoneHighlight,
|
|
63
|
+
"r-is-disabled": I.disabled,
|
|
64
|
+
"r-is-error": B.value
|
|
65
|
+
})), K = l(() => !!I.maxFileSize || !!I.accept), q = l(() => !!V.invalidFiles.length || B.value && I.showValidateMessages);
|
|
66
|
+
function J(e) {
|
|
67
|
+
let t = s(e.size);
|
|
68
|
+
return i(e) ? {
|
|
69
|
+
...e,
|
|
70
|
+
size: t
|
|
71
|
+
} : {
|
|
72
|
+
name: e.name || "",
|
|
73
|
+
size: t,
|
|
74
|
+
image: e
|
|
75
|
+
};
|
|
76
|
+
}
|
|
77
|
+
function Y(e, t) {
|
|
78
|
+
return i(e) ? !0 : t.split(",").some((t) => {
|
|
79
|
+
let n = t.trim();
|
|
80
|
+
return n.startsWith(".") ? e.name.toLowerCase().endsWith(n.toLowerCase()) : n.endsWith("/*") ? e.type.startsWith(n.slice(0, -1)) : e.type === n;
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function X(e) {
|
|
84
|
+
return i(e) ? !0 : e.size <= I.maxFileSize * 1024 * 1024;
|
|
85
|
+
}
|
|
86
|
+
function Z(e) {
|
|
87
|
+
if (V.invalidFiles = [], !e || !e.length) return;
|
|
88
|
+
let t = I.accept ? Array.from(e).filter((e) => {
|
|
89
|
+
let t = Y(e, I.accept);
|
|
90
|
+
return t || V.invalidFiles.push({
|
|
91
|
+
name: e.name,
|
|
92
|
+
type: "format"
|
|
93
|
+
}), t;
|
|
94
|
+
}) : e, n = I.maxFileSize ? Array.from(t).filter((e) => {
|
|
95
|
+
let t = X(e);
|
|
96
|
+
return t || V.invalidFiles.push({
|
|
97
|
+
name: e.name,
|
|
98
|
+
type: "size"
|
|
99
|
+
}), t;
|
|
100
|
+
}) : t;
|
|
101
|
+
n.length !== 0 && (H.value = I.multiple ? [...H.value, ...n] : n);
|
|
102
|
+
}
|
|
103
|
+
function Q(e) {
|
|
104
|
+
V.dropzoneHighlight = !1, Z(e.target?.files), R.value && (R.value.value = "");
|
|
105
|
+
}
|
|
106
|
+
function te() {
|
|
107
|
+
I.disabled || (V.dropzoneHighlight = !0);
|
|
108
|
+
}
|
|
109
|
+
function ne(e) {
|
|
110
|
+
e.currentTarget.contains(e.relatedTarget) || (V.dropzoneHighlight = !1);
|
|
111
|
+
}
|
|
112
|
+
function re(e) {
|
|
113
|
+
V.dropzoneHighlight = !1, I.disabled || Z(e.dataTransfer?.files);
|
|
114
|
+
}
|
|
115
|
+
function $(e) {
|
|
116
|
+
H.value = H.value.filter((t, n) => n !== e);
|
|
117
|
+
}
|
|
118
|
+
return (n, i) => (v(), f("div", {
|
|
119
|
+
class: _(["r-file-dropzone", G.value]),
|
|
120
|
+
onDragover: E(te, ["prevent"]),
|
|
121
|
+
onDragleave: ne,
|
|
122
|
+
onDrop: E(re, ["prevent"])
|
|
123
|
+
}, [
|
|
124
|
+
x(n.$slots, "default", {}, () => [p("div", D, [
|
|
125
|
+
h(e, {
|
|
126
|
+
icon: "upload",
|
|
127
|
+
size: "32",
|
|
128
|
+
class: "r-mb-6"
|
|
129
|
+
}),
|
|
130
|
+
p("div", O, " Drag and drop " + S(I.multiple ? "files" : "file") + " here ", 1),
|
|
131
|
+
K.value ? (v(), f("div", ee, [p("small", k, [
|
|
132
|
+
I.accept ? (v(), f(c, { key: 0 }, [m(" Accepted file formats: " + S(C(o)(I.accept)), 1)], 64)) : d("", !0),
|
|
133
|
+
I.accept && I.maxFileSize ? (v(), f(c, { key: 1 }, [m(" \xA0.\xA0 ")], 64)) : d("", !0),
|
|
134
|
+
I.maxFileSize ? (v(), f(c, { key: 2 }, [m(" Max file size: " + S(I.maxFileSize) + " MB ", 1)], 64)) : d("", !0)
|
|
135
|
+
])])) : d("", !0),
|
|
136
|
+
i[1] ||= p("div", { class: "r-file-dropzone-or r-mb-5" }, [
|
|
137
|
+
p("hr"),
|
|
138
|
+
p("span", null, "or"),
|
|
139
|
+
p("hr")
|
|
140
|
+
], -1),
|
|
141
|
+
h(t, null, {
|
|
142
|
+
default: T(() => [...i[0] ||= [m("Browse files", -1)]]),
|
|
143
|
+
_: 1
|
|
144
|
+
})
|
|
145
|
+
])]),
|
|
146
|
+
q.value ? (v(), f("div", A, [(v(!0), f(c, null, b(C(z), (e, t) => (v(), f("div", {
|
|
147
|
+
key: t,
|
|
148
|
+
class: "r-file-dropzone-error-item"
|
|
149
|
+
}, S(e), 1))), 128)), (v(!0), f(c, null, b(V.invalidFiles, (e, t) => (v(), f("div", {
|
|
150
|
+
key: e.name + t,
|
|
151
|
+
class: "r-file-dropzone-error-item"
|
|
152
|
+
}, [e.type === "format" ? (v(), f("span", j, S(e.name) + ": Invalid file type, allowed file types: " + S(C(o)(I.accept)), 1)) : e.type === "size" ? (v(), f("span", M, S(e.name) + ": Invalid file size, file size should be smaller than " + S(I.maxFileSize) + " MB. ", 1)) : d("", !0)]))), 128))])) : d("", !0),
|
|
153
|
+
p("input", {
|
|
154
|
+
ref: "file-input",
|
|
155
|
+
type: "file",
|
|
156
|
+
accept: I.accept,
|
|
157
|
+
multiple: I.multiple,
|
|
158
|
+
disabled: I.disabled,
|
|
159
|
+
onChange: Q
|
|
160
|
+
}, null, 40, N),
|
|
161
|
+
W.value ? (v(), f("div", P, [I.previewType === "list" ? (v(), u(r, {
|
|
162
|
+
key: 0,
|
|
163
|
+
files: U.value,
|
|
164
|
+
onRemove: $
|
|
165
|
+
}, null, 8, ["files"])) : (v(), u(a, {
|
|
166
|
+
key: 1,
|
|
167
|
+
files: U.value,
|
|
168
|
+
onRemove: $
|
|
169
|
+
}, null, 8, ["files"]))])) : d("", !0)
|
|
170
|
+
], 34));
|
|
171
|
+
}
|
|
172
|
+
});
|
|
173
|
+
//#endregion
|
|
174
|
+
export { F as default };
|