vlite3 0.4.8 → 0.5.2
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/README.md +201 -100
- package/_virtual/Barcode.js +4 -0
- package/_virtual/CODE128.js +4 -0
- package/_virtual/CODE128A.js +4 -0
- package/_virtual/CODE128B.js +4 -0
- package/_virtual/CODE128C.js +4 -0
- package/_virtual/CODE128_AUTO.js +4 -0
- package/_virtual/CODE93.js +4 -0
- package/_virtual/CODE93FullASCII.js +4 -0
- package/_virtual/EAN.js +4 -0
- package/_virtual/EAN13.js +4 -0
- package/_virtual/EAN2.js +4 -0
- package/_virtual/EAN5.js +4 -0
- package/_virtual/EAN8.js +4 -0
- package/_virtual/ErrorHandler.js +4 -0
- package/_virtual/FileSaver.min.js +5 -0
- package/_virtual/FileSaver.min2.js +4 -0
- package/_virtual/ITF.js +4 -0
- package/_virtual/ITF14.js +4 -0
- package/_virtual/JsBarcode.js +7 -0
- package/_virtual/MSI.js +4 -0
- package/_virtual/MSI10.js +4 -0
- package/_virtual/MSI1010.js +4 -0
- package/_virtual/MSI11.js +4 -0
- package/_virtual/MSI1110.js +4 -0
- package/_virtual/UPC.js +4 -0
- package/_virtual/UPCE.js +4 -0
- package/_virtual/_commonjsHelpers.js +8 -0
- package/_virtual/alignment-pattern.js +4 -0
- package/_virtual/auto.js +4 -0
- package/_virtual/browser.js +7 -0
- package/_virtual/browser2.js +4 -0
- package/_virtual/canvas.js +4 -0
- package/_virtual/canvas2.js +4 -0
- package/_virtual/checksums.js +4 -0
- package/_virtual/constants.js +4 -0
- package/_virtual/constants2.js +4 -0
- package/_virtual/constants3.js +4 -0
- package/_virtual/constants4.js +4 -0
- package/_virtual/defaults.js +4 -0
- package/_virtual/dijkstra.js +4 -0
- package/_virtual/encoder.js +4 -0
- package/_virtual/error-correction-code.js +4 -0
- package/_virtual/error-correction-level.js +4 -0
- package/_virtual/exceptions.js +4 -0
- package/_virtual/finder-pattern.js +4 -0
- package/_virtual/fixOptions.js +4 -0
- package/_virtual/format-info.js +4 -0
- package/_virtual/galois-field.js +4 -0
- package/_virtual/getOptionsFromElement.js +4 -0
- package/_virtual/getRenderProperties.js +4 -0
- package/_virtual/index.js +4 -0
- package/_virtual/index10.js +4 -0
- package/_virtual/index11.js +4 -0
- package/_virtual/index2.js +4 -0
- package/_virtual/index3.js +4 -0
- package/_virtual/index4.js +4 -0
- package/_virtual/index5.js +4 -0
- package/_virtual/index6.js +4 -0
- package/_virtual/index7.js +4 -0
- package/_virtual/index8.js +4 -0
- package/_virtual/index9.js +4 -0
- package/_virtual/linearizeEncodings.js +4 -0
- package/_virtual/mask-pattern.js +4 -0
- package/_virtual/merge.js +4 -0
- package/_virtual/mode.js +4 -0
- package/_virtual/object.js +4 -0
- package/_virtual/optionsFromStrings.js +4 -0
- package/_virtual/papaparse.min.js +7 -0
- package/_virtual/papaparse.min2.js +4 -0
- package/_virtual/polynomial.js +4 -0
- package/_virtual/qrcode.js +4 -0
- package/_virtual/regex.js +4 -0
- package/_virtual/segments.js +4 -0
- package/_virtual/shared.js +4 -0
- package/_virtual/svg-tag.js +4 -0
- package/_virtual/svg.js +4 -0
- package/_virtual/utils.js +4 -0
- package/_virtual/utils2.js +4 -0
- package/_virtual/version-check.js +4 -0
- package/_virtual/version.js +4 -0
- package/components/Accordion/Accordion.vue.d.ts +7 -7
- package/components/Accordion/AccordionItem.vue.d.ts +4 -4
- package/components/Accordion/AccordionTrigger.vue.d.ts +2 -2
- package/components/Alert.vue.d.ts +1 -1
- package/components/Avatar.vue.d.ts +2 -2
- package/components/Avatar.vue.js +2 -2
- package/components/AvatarUploader/AvatarUploader.vue.d.ts +5 -5
- package/components/Badge.vue.d.ts +1 -1
- package/components/Barcode/Barcode.vue.d.ts +22 -0
- package/components/Barcode/Barcode.vue.js +58 -0
- package/components/Barcode/Barcode.vue2.js +4 -0
- package/components/Barcode/index.d.ts +2 -0
- package/components/Barcode/types.d.ts +5 -0
- package/components/Barcode/types.js +15 -0
- package/components/Breadcrumb/Breadcrumb.vue.d.ts +23 -0
- package/components/Breadcrumb/Breadcrumb.vue.js +7 -0
- package/components/Breadcrumb/Breadcrumb.vue2.js +84 -0
- package/components/Breadcrumb/BreadcrumbItem.vue.d.ts +27 -0
- package/components/Breadcrumb/BreadcrumbItem.vue.js +7 -0
- package/components/Breadcrumb/BreadcrumbItem.vue2.js +50 -0
- package/components/Breadcrumb/index.d.ts +3 -0
- package/components/Breadcrumb/types.d.ts +19 -0
- package/components/Button.vue.d.ts +4 -4
- package/components/Button.vue.js +32 -29
- package/components/ButtonGroup.vue.d.ts +1 -1
- package/components/Carousel/Carousel.vue.d.ts +58 -58
- package/components/CheckBox.vue.d.ts +2 -2
- package/components/Chip/Chip.vue.d.ts +3 -3
- package/components/ChoiceBox/ChoiceBox.vue.d.ts +4 -4
- package/components/ColorPicker/ColorPicker.vue.d.ts +3 -3
- package/components/ColorPicker/index.d.ts +1 -0
- package/components/CommandPaletteContent.vue.d.ts +15 -0
- package/components/CommandPaletteContent.vue.js +7 -0
- package/components/CommandPaletteContent.vue2.js +287 -0
- package/components/ConfirmationModal.vue.js +12 -10
- package/components/DataList/DataList.vue.d.ts +2 -2
- package/components/DataTable/DataTable.vue.d.ts +6 -6
- package/components/DataTable/DataTableRow.vue.d.ts +3 -3
- package/components/DatePicker.vue.d.ts +2 -2
- package/components/DatePicker.vue.js +7 -7
- package/components/DateRangePicker.vue.d.ts +29 -0
- package/components/DateRangePicker.vue.js +231 -0
- package/components/DateRangePicker.vue2.js +4 -0
- package/components/Dropdown/Dropdown.vue.d.ts +11 -6
- package/components/Dropdown/Dropdown.vue.js +147 -109
- package/components/Dropdown/DropdownBooleanItem.vue.js +9 -8
- package/components/Dropdown/DropdownGroupedLayout.vue.d.ts +1 -1
- package/components/Dropdown/DropdownGroupedLayout.vue.js +35 -34
- package/components/Dropdown/DropdownItem.vue.js +11 -10
- package/components/Dropdown/DropdownMenu.vue.d.ts +5 -3
- package/components/Dropdown/DropdownMenu.vue.js +114 -111
- package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
- package/components/Dropdown/DropdownTrigger.vue.js +9 -7
- package/components/ExportData/ExportData.vue.d.ts +16 -0
- package/components/ExportData/ExportData.vue.js +135 -0
- package/components/ExportData/ExportData.vue2.js +4 -0
- package/components/ExportData/index.d.ts +2 -0
- package/components/ExportData/types.d.ts +17 -0
- package/components/FilePicker/FilePicker.vue.d.ts +5 -5
- package/components/Form/CustomFields.vue.d.ts +6 -6
- package/components/Form/CustomFields.vue.js +1 -1
- package/components/Form/Form.vue.d.ts +4 -5
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +221 -178
- package/components/Form/FormField.vue.d.ts +4 -3
- package/components/Form/FormField.vue.js +70 -62
- package/components/Form/FormFields.vue.d.ts +3 -1
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +105 -59
- package/components/GoogleLogin.vue.d.ts +2 -2
- package/components/Icon.vue.d.ts +2 -0
- package/components/Icon.vue.js +12 -11
- package/components/ImportData/ImportData.vue.d.ts +31 -0
- package/components/ImportData/ImportData.vue.js +242 -0
- package/components/ImportData/ImportData.vue2.js +4 -0
- package/components/ImportData/ImportStep1.vue.d.ts +23 -0
- package/components/ImportData/ImportStep1.vue.js +162 -0
- package/components/ImportData/ImportStep1.vue2.js +4 -0
- package/components/ImportData/ImportStep2.vue.d.ts +20 -0
- package/components/ImportData/ImportStep2.vue.js +98 -0
- package/components/ImportData/ImportStep2.vue2.js +4 -0
- package/components/ImportData/ImportStep3.vue.d.ts +6 -0
- package/components/ImportData/ImportStep3.vue.js +98 -0
- package/components/ImportData/ImportStep3.vue2.js +4 -0
- package/components/ImportData/ImportStep4.vue.d.ts +6 -0
- package/components/ImportData/ImportStep4.vue.js +139 -0
- package/components/ImportData/ImportStep4.vue2.js +4 -0
- package/components/ImportData/index.d.ts +2 -0
- package/components/ImportData/types.d.ts +51 -0
- package/components/Input.vue.d.ts +9 -9
- package/components/Input.vue.js +137 -120
- package/components/List/List.vue.d.ts +18 -0
- package/components/List/List.vue.js +189 -0
- package/components/List/List.vue2.js +4 -0
- package/components/List/ListFieldRow.vue.d.ts +35 -0
- package/components/List/ListFieldRow.vue.js +119 -0
- package/components/List/ListFieldRow.vue2.js +4 -0
- package/components/List/index.d.ts +4 -0
- package/components/List/types.d.ts +1 -0
- package/components/List/utils.d.ts +9 -0
- package/components/List/utils.js +64 -0
- package/components/Masonry/Masonry.vue.d.ts +2 -2
- package/components/Modal.vue.js +5 -122
- package/components/Modal.vue2.js +133 -2
- package/components/MultiSelect/MultiSelect.vue.d.ts +12 -9
- package/components/MultiSelect/MultiSelect.vue.js +101 -64
- package/components/Navbar/Navbar.vue.d.ts +48 -9
- package/components/Navbar/Navbar.vue.js +418 -146
- package/components/Navbar/NavbarItem.vue.d.ts +2 -2
- package/components/Navbar/NavbarTabs.vue.d.ts +21 -0
- package/components/Navbar/NavbarTabs.vue.js +179 -0
- package/components/Navbar/NavbarTabs.vue3.js +5 -0
- package/components/Navbar/index.d.ts +3 -0
- package/components/NavbarCommandPalette.vue.d.ts +48 -0
- package/components/NumberInput.vue.d.ts +8 -8
- package/components/OTPInput/OTPInput.vue.d.ts +7 -7
- package/components/Pagination/Pagination.vue.d.ts +1 -1
- package/components/PermissionMatrix/PermissionEditor.vue.d.ts +36 -0
- package/components/PermissionMatrix/PermissionEditor.vue.js +323 -0
- package/components/PermissionMatrix/PermissionEditor.vue2.js +4 -0
- package/components/PermissionMatrix/PermissionMatrix.vue.d.ts +15 -0
- package/components/PermissionMatrix/PermissionMatrix.vue.js +7 -0
- package/components/PermissionMatrix/PermissionMatrix.vue2.js +245 -0
- package/components/PermissionMatrix/index.d.ts +3 -0
- package/components/PermissionMatrix/types.d.ts +59 -0
- package/components/PricingPlan/PricingPlan.vue.d.ts +3 -3
- package/components/ProgressBar/ProgressBar.vue.d.ts +3 -3
- package/components/QRCode/QRCode.vue.d.ts +15 -0
- package/components/QRCode/QRCode.vue.js +38 -0
- package/components/QRCode/QRCode.vue2.js +4 -0
- package/components/QRCode/index.d.ts +1 -0
- package/components/Screen/Screen.vue.d.ts +232 -5
- package/components/Screen/Screen.vue.js +423 -271
- package/components/Screen/ScreenFilter.vue.d.ts +2 -2
- package/components/Screen/ScreenFilter.vue.js +9 -9
- package/components/Screen/types.d.ts +12 -0
- package/components/SidePanel.vue.d.ts +2 -2
- package/components/SidebarMenu/SidebarMenu.vue.d.ts +15 -2
- package/components/SidebarMenu/SidebarMenu.vue.js +117 -47
- package/components/SidebarMenu/SidebarMenuItem.vue.d.ts +2 -0
- package/components/SidebarMenu/SidebarMenuItem.vue.js +192 -175
- package/components/SidebarMenu/types.d.ts +32 -5
- package/components/Slider.vue.d.ts +2 -2
- package/components/Spinner/Spinner.vue.d.ts +2 -2
- package/components/Stats/Stats.vue.d.ts +14 -0
- package/components/Stats/Stats.vue.js +307 -0
- package/components/Stats/Stats.vue2.js +4 -0
- package/components/Stats/index.d.ts +2 -0
- package/components/Stats/types.d.ts +32 -0
- package/components/Switch.vue.d.ts +2 -1
- package/components/Switch.vue.js +4 -2
- package/components/Tabes/Tabes.vue.d.ts +3 -3
- package/components/Tabes/Tabes.vue.js +60 -57
- package/components/Tabes/types.d.ts +5 -0
- package/components/Textarea.vue.d.ts +3 -3
- package/components/{Timeline.vue.d.ts → Timeline/Timeline.vue.d.ts} +23 -2
- package/components/Timeline/Timeline.vue.js +92 -0
- package/components/Timeline/TimelineIndicator.vue.d.ts +9 -0
- package/components/Timeline/TimelineIndicator.vue.js +68 -0
- package/components/Timeline/TimelineIndicator.vue2.js +4 -0
- package/components/Timeline/TimelineItem.vue.d.ts +56 -0
- package/components/Timeline/TimelineItem.vue.js +173 -0
- package/components/Timeline/TimelineItem.vue2.js +4 -0
- package/components/Timeline/index.d.ts +3 -0
- package/components/Tooltip.vue.d.ts +2 -2
- package/components/Workbook/Sheet.vue.d.ts +2 -2
- package/components/Workbook/Workbook.vue.d.ts +3 -3
- package/components/index.d.ts +62 -0
- package/composables/useBreadcrumb.d.ts +17 -0
- package/composables/useBreadcrumb.js +27 -0
- package/core/config.d.ts +34 -0
- package/core/config.js +10 -7
- package/core/index.js +15 -8
- package/index.d.ts +55 -44
- package/index.js +243 -200
- package/package.json +12 -2
- package/router.d.ts +2 -0
- package/style.css +7 -5
- package/types/button.d.ts +1 -1
- package/types/config.type.d.ts +35 -0
- package/types/form.type.d.ts +3 -1
- package/types/index.d.ts +2 -1
- package/types/list.type.d.ts +57 -0
- package/types/navbar.type.d.ts +38 -1
- package/types/timeline.type.d.ts +14 -4
- package/components/Timeline.vue.js +0 -160
- /package/components/{Timeline.vue2.js → Timeline/Timeline.vue2.js} +0 -0
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { defineComponent as k, ref as w, computed as i, openBlock as n, createElementBlock as o, normalizeClass as c, createElementVNode as u, createBlock as y, createCommentVNode as p, toDisplayString as g, renderSlot as C, resolveDynamicComponent as B, Fragment as S, createVNode as T } from "vue";
|
|
2
|
+
import h from "../Icon.vue.js";
|
|
3
|
+
import { $t as L } from "../../utils/i18n.js";
|
|
4
|
+
import { getObjectValue as V, formatNumber as j, formatPrice as H, formatDate as f, getStatusColorClass as N } from "./utils.js";
|
|
5
|
+
const $ = { class: "flex items-center gap-1.5 shrink-0 min-w-0 max-w-[48%]" }, M = { class: "text-sm font-medium text-gray-800 truncate leading-snug" }, D = { class: "flex items-center justify-end gap-2 min-w-0 flex-1" }, I = ["innerHTML"], E = {
|
|
6
|
+
key: 1,
|
|
7
|
+
class: "text-sm text-gray-600 tracking-widest select-none",
|
|
8
|
+
"aria-hidden": "true"
|
|
9
|
+
}, F = ["aria-label"], O = ["src", "alt"], z = ["innerHTML"], G = /* @__PURE__ */ k({
|
|
10
|
+
__name: "ListFieldRow",
|
|
11
|
+
props: {
|
|
12
|
+
field: {},
|
|
13
|
+
data: {},
|
|
14
|
+
isLast: { type: Boolean, default: !1 },
|
|
15
|
+
showBorderBottom: { type: Boolean, default: !0 },
|
|
16
|
+
variant: { default: "default" },
|
|
17
|
+
showColon: { type: Boolean, default: !0 },
|
|
18
|
+
index: { default: 0 }
|
|
19
|
+
},
|
|
20
|
+
setup(a) {
|
|
21
|
+
const e = a, s = w(!1), d = i(() => V(e.field.key, e.data)), r = i(() => {
|
|
22
|
+
const t = d.value;
|
|
23
|
+
if (e.field.format)
|
|
24
|
+
return e.field.format(t, e.data);
|
|
25
|
+
if (t == null || t === "")
|
|
26
|
+
return e.field.emptyText ?? "--";
|
|
27
|
+
switch (e.field.type) {
|
|
28
|
+
case "date":
|
|
29
|
+
return f(t, !1);
|
|
30
|
+
case "dateTime":
|
|
31
|
+
return f(t, !0);
|
|
32
|
+
case "time":
|
|
33
|
+
return f(t, !0);
|
|
34
|
+
case "price":
|
|
35
|
+
return H(t);
|
|
36
|
+
case "number":
|
|
37
|
+
return j(t);
|
|
38
|
+
case "boolean":
|
|
39
|
+
return t ? "Yes" : "No";
|
|
40
|
+
default:
|
|
41
|
+
return String(t);
|
|
42
|
+
}
|
|
43
|
+
}), m = i(
|
|
44
|
+
() => e.field.titleI18n ? L(e.field.titleI18n) : e.field.title ?? e.field.key
|
|
45
|
+
), v = i(() => {
|
|
46
|
+
const t = [];
|
|
47
|
+
if (e.field.addStatusColor) {
|
|
48
|
+
const l = N(r.value);
|
|
49
|
+
l && t.push(l);
|
|
50
|
+
}
|
|
51
|
+
if (e.field.class)
|
|
52
|
+
if (typeof e.field.class == "function") {
|
|
53
|
+
const l = e.field.class(d.value, e.data);
|
|
54
|
+
l && t.push(l);
|
|
55
|
+
} else
|
|
56
|
+
t.push(e.field.class);
|
|
57
|
+
return t.join(" ");
|
|
58
|
+
}), b = i(() => e.field.type === "image"), x = i(() => e.variant === "striped" && e.index % 2 !== 0);
|
|
59
|
+
return (t, l) => (n(), o("div", {
|
|
60
|
+
class: c(["list-field-row flex justify-between gap-3 px-3 py-2.5 transition-colors", [
|
|
61
|
+
a.showBorderBottom && !a.isLast ? "border-b border-border" : "",
|
|
62
|
+
x.value ? "bg-muted/40" : "",
|
|
63
|
+
a.variant === "compact" ? "py-1.5!" : "",
|
|
64
|
+
a.variant === "minimal" ? "px-0!" : ""
|
|
65
|
+
]]),
|
|
66
|
+
role: "row"
|
|
67
|
+
}, [
|
|
68
|
+
u("div", $, [
|
|
69
|
+
a.field.icon ? (n(), y(h, {
|
|
70
|
+
key: 0,
|
|
71
|
+
icon: a.field.icon,
|
|
72
|
+
class: "w-3.5 h-3.5 text-gray-800 shrink-0"
|
|
73
|
+
}, null, 8, ["icon"])) : p("", !0),
|
|
74
|
+
u("span", M, g(m.value) + g(a.showColon ? ":" : ""), 1)
|
|
75
|
+
]),
|
|
76
|
+
u("div", D, [
|
|
77
|
+
t.$slots[a.field.key] ? C(t.$slots, a.field.key, {
|
|
78
|
+
key: 0,
|
|
79
|
+
value: d.value,
|
|
80
|
+
resolved: r.value,
|
|
81
|
+
data: a.data
|
|
82
|
+
}) : a.field.component ? (n(), y(B(a.field.component), {
|
|
83
|
+
key: 1,
|
|
84
|
+
data: a.data,
|
|
85
|
+
value: d.value
|
|
86
|
+
}, null, 8, ["data", "value"])) : a.field.isSensitive ? (n(), o(S, { key: 2 }, [
|
|
87
|
+
s.value ? (n(), o("span", {
|
|
88
|
+
key: 0,
|
|
89
|
+
class: c(["text-sm text-gray-600 text-right break-words", v.value]),
|
|
90
|
+
innerHTML: r.value
|
|
91
|
+
}, null, 10, I)) : (n(), o("span", E, " •••••••• ")),
|
|
92
|
+
u("button", {
|
|
93
|
+
type: "button",
|
|
94
|
+
class: "shrink-0 p-1 rounded-full text-muted-foreground hover:text-foreground hover:bg-muted transition-colors outline-none focus-visible:ring-2 focus-visible:ring-primary/50",
|
|
95
|
+
"aria-label": s.value ? "Hide value" : "Show value",
|
|
96
|
+
onClick: l[0] || (l[0] = (P) => s.value = !s.value)
|
|
97
|
+
}, [
|
|
98
|
+
T(h, {
|
|
99
|
+
icon: s.value ? "lucide:eye-off" : "lucide:eye",
|
|
100
|
+
class: "w-3.5 h-3.5"
|
|
101
|
+
}, null, 8, ["icon"])
|
|
102
|
+
], 8, F)
|
|
103
|
+
], 64)) : b.value ? (n(), o("img", {
|
|
104
|
+
key: 3,
|
|
105
|
+
src: r.value,
|
|
106
|
+
alt: m.value,
|
|
107
|
+
class: "w-8 h-8 rounded-full object-cover border border-border"
|
|
108
|
+
}, null, 8, O)) : (n(), o("span", {
|
|
109
|
+
key: 4,
|
|
110
|
+
class: c(["text-sm text-gray-900 text-right break-words leading-snug", v.value]),
|
|
111
|
+
innerHTML: r.value
|
|
112
|
+
}, null, 10, z))
|
|
113
|
+
])
|
|
114
|
+
], 2));
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
export {
|
|
118
|
+
G as default
|
|
119
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { ListField, ListProps, ListVariant, ListColumns, ListFieldType, } from '../../types/list.type';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolves a dot-notation path from a nested object.
|
|
3
|
+
* e.g. getObjectValue('location.city', data) => 'New York'
|
|
4
|
+
*/
|
|
5
|
+
export declare function getObjectValue(path: string, obj: Record<string, any>): any;
|
|
6
|
+
export declare function getStatusColorClass(value: any): string;
|
|
7
|
+
export declare function formatDate(value: any, hasTime?: boolean): string;
|
|
8
|
+
export declare function formatPrice(value: any): string;
|
|
9
|
+
export declare function formatNumber(value: any): string;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
function u(t, e) {
|
|
2
|
+
if (!(!t || !e))
|
|
3
|
+
return t.includes(".") ? t.split(".").reduce((r, n) => r?.[n], e) : e[t];
|
|
4
|
+
}
|
|
5
|
+
const i = {
|
|
6
|
+
active: "text-success-dark font-medium",
|
|
7
|
+
inactive: "text-muted-foreground",
|
|
8
|
+
pending: "text-warning-dark font-medium",
|
|
9
|
+
completed: "text-success-dark font-medium",
|
|
10
|
+
cancelled: "text-danger-dark font-medium",
|
|
11
|
+
failed: "text-danger-dark font-medium",
|
|
12
|
+
success: "text-success-dark font-medium",
|
|
13
|
+
error: "text-danger-dark font-medium",
|
|
14
|
+
warning: "text-warning-dark font-medium",
|
|
15
|
+
info: "text-info-dark font-medium",
|
|
16
|
+
high: "text-danger-dark font-medium",
|
|
17
|
+
medium: "text-warning-dark font-medium",
|
|
18
|
+
low: "text-muted-foreground",
|
|
19
|
+
yes: "text-success-dark font-medium",
|
|
20
|
+
no: "text-danger-dark font-medium",
|
|
21
|
+
true: "text-success-dark font-medium",
|
|
22
|
+
false: "text-danger-dark font-medium",
|
|
23
|
+
enabled: "text-success-dark font-medium",
|
|
24
|
+
disabled: "text-muted-foreground"
|
|
25
|
+
};
|
|
26
|
+
function d(t) {
|
|
27
|
+
if (t == null) return "";
|
|
28
|
+
const e = String(t).toLowerCase().replace(/[-_\s]/g, "");
|
|
29
|
+
return i[e] || "";
|
|
30
|
+
}
|
|
31
|
+
function m(t, e = !1) {
|
|
32
|
+
if (!t) return "--";
|
|
33
|
+
try {
|
|
34
|
+
const r = new Date(t);
|
|
35
|
+
return isNaN(r.getTime()) ? String(t) : e ? r.toLocaleString("en-US", {
|
|
36
|
+
year: "numeric",
|
|
37
|
+
month: "short",
|
|
38
|
+
day: "numeric",
|
|
39
|
+
hour: "2-digit",
|
|
40
|
+
minute: "2-digit"
|
|
41
|
+
}) : r.toLocaleDateString("en-US", {
|
|
42
|
+
year: "numeric",
|
|
43
|
+
month: "short",
|
|
44
|
+
day: "numeric"
|
|
45
|
+
});
|
|
46
|
+
} catch {
|
|
47
|
+
return String(t);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
function o(t) {
|
|
51
|
+
const e = Number(t);
|
|
52
|
+
return isNaN(e) ? String(t ?? "--") : new Intl.NumberFormat("en-US", { style: "currency", currency: "USD" }).format(e);
|
|
53
|
+
}
|
|
54
|
+
function a(t) {
|
|
55
|
+
const e = Number(t);
|
|
56
|
+
return isNaN(e) ? String(t ?? "--") : new Intl.NumberFormat("en-US").format(e);
|
|
57
|
+
}
|
|
58
|
+
export {
|
|
59
|
+
m as formatDate,
|
|
60
|
+
a as formatNumber,
|
|
61
|
+
o as formatPrice,
|
|
62
|
+
u as getObjectValue,
|
|
63
|
+
d as getStatusColorClass
|
|
64
|
+
};
|
|
@@ -15,10 +15,10 @@ declare function __VLS_template(): {
|
|
|
15
15
|
};
|
|
16
16
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
17
17
|
declare const __VLS_component: import('vue').DefineComponent<MasonryProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<MasonryProps> & Readonly<{}>, {
|
|
18
|
-
gap: number;
|
|
19
18
|
tag: string;
|
|
20
|
-
cols: number | Record<string | number, number>;
|
|
21
19
|
itemKey: string;
|
|
20
|
+
gap: number;
|
|
21
|
+
cols: number | Record<string | number, number>;
|
|
22
22
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
23
23
|
containerRef: unknown;
|
|
24
24
|
}, any>;
|
package/components/Modal.vue.js
CHANGED
|
@@ -1,124 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
import
|
|
4
|
-
|
|
5
|
-
const M = {
|
|
6
|
-
key: 0,
|
|
7
|
-
class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
|
|
8
|
-
}, W = { class: "text-lg font-semibold leading-none tracking-tight" }, A = {
|
|
9
|
-
key: 0,
|
|
10
|
-
class: "text-sm text-muted-foreground mb-6.5"
|
|
11
|
-
}, H = /* @__PURE__ */ O({
|
|
12
|
-
inheritAttrs: !1,
|
|
13
|
-
__name: "Modal",
|
|
14
|
-
props: {
|
|
15
|
-
show: { type: Boolean, default: !1 },
|
|
16
|
-
title: {},
|
|
17
|
-
titleI18n: {},
|
|
18
|
-
maxWidth: { default: "sm:max-w-lg" },
|
|
19
|
-
closeOutside: { type: Boolean, default: !0 },
|
|
20
|
-
backdrop: { type: Boolean, default: !0 },
|
|
21
|
-
description: {},
|
|
22
|
-
descriptionI18n: {},
|
|
23
|
-
triggerClass: {},
|
|
24
|
-
bodyClass: {},
|
|
25
|
-
headerClass: {},
|
|
26
|
-
footerClass: {},
|
|
27
|
-
body: {},
|
|
28
|
-
bodyProps: {}
|
|
29
|
-
},
|
|
30
|
-
emits: ["close", "update:show", "onOpen"],
|
|
31
|
-
setup(t, { emit: w }) {
|
|
32
|
-
const o = t, u = w, r = S(o.show);
|
|
33
|
-
b(
|
|
34
|
-
() => o.show,
|
|
35
|
-
(e) => {
|
|
36
|
-
r.value = e, e && u("onOpen");
|
|
37
|
-
}
|
|
38
|
-
);
|
|
39
|
-
const $ = () => {
|
|
40
|
-
r.value = !0;
|
|
41
|
-
}, s = () => {
|
|
42
|
-
r.value = !1, u("update:show", !1), u("close");
|
|
43
|
-
};
|
|
44
|
-
z("modal-context", { close: s });
|
|
45
|
-
const B = () => {
|
|
46
|
-
o.closeOutside && s();
|
|
47
|
-
}, { onKeyStroke: I } = K();
|
|
48
|
-
I("Escape", s), b(r, (e) => {
|
|
49
|
-
e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
|
|
50
|
-
}), D(() => {
|
|
51
|
-
document.body.style.overflow = "";
|
|
52
|
-
});
|
|
53
|
-
const f = p(() => o.titleI18n ? C(o.titleI18n) : o.title), m = p(() => o.descriptionI18n ? C(o.descriptionI18n) : o.description);
|
|
54
|
-
return (e, y) => (l(), a(E, null, [
|
|
55
|
-
n("span", v({
|
|
56
|
-
onClick: h($, ["stop"]),
|
|
57
|
-
class: `${t.triggerClass}`
|
|
58
|
-
}, e.$attrs), [
|
|
59
|
-
c(e.$slots, "trigger", {}, () => [
|
|
60
|
-
t.body ? c(e.$slots, "default", { key: 0 }) : i("", !0)
|
|
61
|
-
])
|
|
62
|
-
], 16),
|
|
63
|
-
(l(), g(N, { to: "body" }, [
|
|
64
|
-
x(P, {
|
|
65
|
-
"enter-active-class": "transition duration-200 ease-out",
|
|
66
|
-
"enter-from-class": "opacity-0",
|
|
67
|
-
"enter-to-class": "opacity-100",
|
|
68
|
-
"leave-active-class": "transition duration-150 ease-in",
|
|
69
|
-
"leave-from-class": "opacity-100",
|
|
70
|
-
"leave-to-class": "opacity-0"
|
|
71
|
-
}, {
|
|
72
|
-
default: T(() => [
|
|
73
|
-
r.value ? (l(), a("div", {
|
|
74
|
-
key: 0,
|
|
75
|
-
class: d(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4", t.backdrop && "backdrop-blur-[2px]"]),
|
|
76
|
-
onClick: B
|
|
77
|
-
}, [
|
|
78
|
-
n("div", {
|
|
79
|
-
class: d(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh]", [t.maxWidth]]),
|
|
80
|
-
onClick: y[0] || (y[0] = h(() => {
|
|
81
|
-
}, ["stop"]))
|
|
82
|
-
}, [
|
|
83
|
-
f.value ? (l(), a("div", M, [
|
|
84
|
-
n("div", {
|
|
85
|
-
class: d(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
|
|
86
|
-
}, [
|
|
87
|
-
n("h3", W, k(f.value), 1),
|
|
88
|
-
x(j, {
|
|
89
|
-
rounded: "full",
|
|
90
|
-
size: "sm",
|
|
91
|
-
icon: "lucide:x",
|
|
92
|
-
variant: "ghost",
|
|
93
|
-
class: "hover:bg-gray-250/25!",
|
|
94
|
-
onClick: s
|
|
95
|
-
})
|
|
96
|
-
], 2)
|
|
97
|
-
])) : i("", !0),
|
|
98
|
-
n("div", {
|
|
99
|
-
class: d(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0", t.bodyClass])
|
|
100
|
-
}, [
|
|
101
|
-
m.value ? (l(), a("p", A, k(m.value), 1)) : i("", !0),
|
|
102
|
-
t.body ? (l(), g(V(t.body), v({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: s }), null, 16)) : c(e.$slots, "default", {
|
|
103
|
-
key: 2,
|
|
104
|
-
close: s
|
|
105
|
-
})
|
|
106
|
-
], 2),
|
|
107
|
-
e.$slots.footer ? (l(), a("div", {
|
|
108
|
-
key: 1,
|
|
109
|
-
class: d([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
|
|
110
|
-
}, [
|
|
111
|
-
c(e.$slots, "footer", { close: s })
|
|
112
|
-
], 2)) : i("", !0)
|
|
113
|
-
], 2)
|
|
114
|
-
], 2)) : i("", !0)
|
|
115
|
-
]),
|
|
116
|
-
_: 3
|
|
117
|
-
})
|
|
118
|
-
]))
|
|
119
|
-
], 64));
|
|
120
|
-
}
|
|
121
|
-
});
|
|
1
|
+
import o from "./Modal.vue2.js";
|
|
2
|
+
/* empty css */
|
|
3
|
+
import t from "../_virtual/_plugin-vue_export-helper.js";
|
|
4
|
+
const m = /* @__PURE__ */ t(o, [["__scopeId", "data-v-32c213fd"]]);
|
|
122
5
|
export {
|
|
123
|
-
|
|
6
|
+
m as default
|
|
124
7
|
};
|
package/components/Modal.vue2.js
CHANGED
|
@@ -1,4 +1,135 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { defineComponent as E, ref as b, watch as g, provide as N, onUnmounted as P, computed as k, openBlock as l, createElementBlock as r, Fragment as V, createElementVNode as d, mergeProps as x, withModifiers as C, renderSlot as u, createCommentVNode as c, createBlock as w, Teleport as j, createVNode as $, Transition as K, withCtx as M, normalizeClass as a, toDisplayString as B, resolveDynamicComponent as W } from "vue";
|
|
2
|
+
import A from "./Button.vue.js";
|
|
3
|
+
import { useKeyStroke as F } from "../composables/useKeyStroke.js";
|
|
4
|
+
import { $t as T } from "../utils/i18n.js";
|
|
5
|
+
const U = {
|
|
6
|
+
key: 0,
|
|
7
|
+
class: "flex-none flex flex-col space-y-1.5 pb-0 border-b border-border/90"
|
|
8
|
+
}, q = { class: "text-lg font-semibold leading-none tracking-tight" }, G = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "text-sm text-muted-foreground mb-6.5"
|
|
11
|
+
}, R = /* @__PURE__ */ E({
|
|
12
|
+
inheritAttrs: !1,
|
|
13
|
+
__name: "Modal",
|
|
14
|
+
props: {
|
|
15
|
+
show: { type: Boolean, default: !1 },
|
|
16
|
+
title: {},
|
|
17
|
+
titleI18n: {},
|
|
18
|
+
maxWidth: { default: "sm:max-w-lg" },
|
|
19
|
+
closeOutside: { type: Boolean, default: !0 },
|
|
20
|
+
backdrop: { type: Boolean, default: !0 },
|
|
21
|
+
description: {},
|
|
22
|
+
descriptionI18n: {},
|
|
23
|
+
triggerClass: {},
|
|
24
|
+
bodyClass: {},
|
|
25
|
+
headerClass: {},
|
|
26
|
+
footerClass: {},
|
|
27
|
+
body: {},
|
|
28
|
+
bodyProps: {}
|
|
29
|
+
},
|
|
30
|
+
emits: ["close", "update:show", "onOpen"],
|
|
31
|
+
setup(t, { emit: I }) {
|
|
32
|
+
const o = t, f = I, i = b(o.show), y = b(!1), m = b(!1);
|
|
33
|
+
let n = null;
|
|
34
|
+
g(
|
|
35
|
+
() => o.show,
|
|
36
|
+
(e) => {
|
|
37
|
+
i.value = e, e && f("onOpen");
|
|
38
|
+
}
|
|
39
|
+
);
|
|
40
|
+
const S = () => {
|
|
41
|
+
i.value = !0;
|
|
42
|
+
}, O = (e) => {
|
|
43
|
+
y.value = e;
|
|
44
|
+
}, s = () => {
|
|
45
|
+
if (y.value) {
|
|
46
|
+
m.value = !0, n && clearTimeout(n), n = setTimeout(() => {
|
|
47
|
+
m.value = !1;
|
|
48
|
+
}, 1e3);
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
i.value = !1, f("update:show", !1), f("close");
|
|
52
|
+
};
|
|
53
|
+
N("modal-context", { close: s, setSubmitting: O });
|
|
54
|
+
const z = () => {
|
|
55
|
+
o.closeOutside && s();
|
|
56
|
+
}, { onKeyStroke: D } = F();
|
|
57
|
+
D("Escape", s), g(i, (e) => {
|
|
58
|
+
e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
|
|
59
|
+
}), P(() => {
|
|
60
|
+
document.body.style.overflow = "", n && clearTimeout(n);
|
|
61
|
+
});
|
|
62
|
+
const p = k(() => o.titleI18n ? T(o.titleI18n) : o.title), v = k(
|
|
63
|
+
() => o.descriptionI18n ? T(o.descriptionI18n) : o.description
|
|
64
|
+
);
|
|
65
|
+
return (e, h) => (l(), r(V, null, [
|
|
66
|
+
d("span", x({
|
|
67
|
+
onClick: C(S, ["stop"]),
|
|
68
|
+
class: `${t.triggerClass}`
|
|
69
|
+
}, e.$attrs), [
|
|
70
|
+
u(e.$slots, "trigger", {}, () => [
|
|
71
|
+
t.body ? u(e.$slots, "default", { key: 0 }, void 0, !0) : c("", !0)
|
|
72
|
+
], !0)
|
|
73
|
+
], 16),
|
|
74
|
+
(l(), w(j, { to: "body" }, [
|
|
75
|
+
$(K, {
|
|
76
|
+
"enter-active-class": "transition duration-200 ease-out",
|
|
77
|
+
"enter-from-class": "opacity-0",
|
|
78
|
+
"enter-to-class": "opacity-100",
|
|
79
|
+
"leave-active-class": "transition duration-150 ease-in",
|
|
80
|
+
"leave-from-class": "opacity-100",
|
|
81
|
+
"leave-to-class": "opacity-0"
|
|
82
|
+
}, {
|
|
83
|
+
default: M(() => [
|
|
84
|
+
i.value ? (l(), r("div", {
|
|
85
|
+
key: 0,
|
|
86
|
+
class: a(["fixed inset-0 z-50 flex items-center justify-center bg-[#00000051] p-4", t.backdrop && "backdrop-blur-[2px]"]),
|
|
87
|
+
onClick: z
|
|
88
|
+
}, [
|
|
89
|
+
d("div", {
|
|
90
|
+
class: a(["modal-body relative w-full rounded border border-border/60 bg-body shadow-lg text-foreground flex flex-col max-h-[85vh] sm:max-h-[90vh]", [t.maxWidth]]),
|
|
91
|
+
onClick: h[0] || (h[0] = C(() => {
|
|
92
|
+
}, ["stop"]))
|
|
93
|
+
}, [
|
|
94
|
+
p.value ? (l(), r("div", U, [
|
|
95
|
+
d("div", {
|
|
96
|
+
class: a(["flex items-center justify-between py-2 px-4 rounded-t-md", t.headerClass])
|
|
97
|
+
}, [
|
|
98
|
+
d("h3", q, B(p.value), 1),
|
|
99
|
+
$(A, {
|
|
100
|
+
rounded: "full",
|
|
101
|
+
size: "sm",
|
|
102
|
+
icon: "lucide:x",
|
|
103
|
+
variant: "ghost",
|
|
104
|
+
class: a(["hover:bg-gray-250/25! transition-all", { "blink-bg": m.value }]),
|
|
105
|
+
onClick: s
|
|
106
|
+
}, null, 8, ["class"])
|
|
107
|
+
], 2)
|
|
108
|
+
])) : c("", !0),
|
|
109
|
+
d("div", {
|
|
110
|
+
class: a(["flex-1 overflow-y-auto px-4 pt-4 pb-3.5 min-h-0", t.bodyClass])
|
|
111
|
+
}, [
|
|
112
|
+
v.value ? (l(), r("p", G, B(v.value), 1)) : c("", !0),
|
|
113
|
+
t.body ? (l(), w(W(t.body), x({ key: 1 }, { ...t.bodyProps, ...e.$attrs }, { close: s }), null, 16)) : u(e.$slots, "default", {
|
|
114
|
+
key: 2,
|
|
115
|
+
close: s
|
|
116
|
+
}, void 0, !0)
|
|
117
|
+
], 2),
|
|
118
|
+
e.$slots.footer ? (l(), r("div", {
|
|
119
|
+
key: 1,
|
|
120
|
+
class: a([t.footerClass, "flex-none flex items-center px-4 py-3 border-t border-border/75 rounded-b-xl bg-body"])
|
|
121
|
+
}, [
|
|
122
|
+
u(e.$slots, "footer", { close: s }, void 0, !0)
|
|
123
|
+
], 2)) : c("", !0)
|
|
124
|
+
], 2)
|
|
125
|
+
], 2)) : c("", !0)
|
|
126
|
+
]),
|
|
127
|
+
_: 3
|
|
128
|
+
})
|
|
129
|
+
]))
|
|
130
|
+
], 64));
|
|
131
|
+
}
|
|
132
|
+
});
|
|
2
133
|
export {
|
|
3
|
-
|
|
134
|
+
R as default
|
|
4
135
|
};
|
|
@@ -1,40 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IDropdownOption } from '../../types';
|
|
2
2
|
interface Props {
|
|
3
3
|
modelValue?: any[];
|
|
4
|
-
options?:
|
|
4
|
+
options?: (IDropdownOption | string | number)[];
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
placeholderI18n?: string;
|
|
7
7
|
disabled?: boolean;
|
|
8
8
|
searchable?: boolean;
|
|
9
|
-
variant?: 'default' | 'outline' | 'solid';
|
|
9
|
+
variant?: 'default' | 'outline' | 'solid' | 'floating' | string;
|
|
10
10
|
size?: 'sm' | 'md' | 'lg';
|
|
11
11
|
maxVisible?: number;
|
|
12
12
|
loading?: boolean;
|
|
13
13
|
hasMore?: boolean;
|
|
14
14
|
remote?: boolean;
|
|
15
|
+
debounceTime?: number;
|
|
16
|
+
fetchSelected?: (ids: any[]) => Promise<IDropdownOption[]>;
|
|
15
17
|
layout?: 'default' | 'grouped';
|
|
16
18
|
}
|
|
17
19
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
18
20
|
search: (query: string) => any;
|
|
19
|
-
"update:modelValue": (value: any[]) => any;
|
|
20
21
|
change: (value: any[]) => any;
|
|
22
|
+
"update:modelValue": (value: any[]) => any;
|
|
21
23
|
"load-more": () => any;
|
|
22
24
|
}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{
|
|
23
25
|
onSearch?: (query: string) => any;
|
|
24
|
-
"onUpdate:modelValue"?: (value: any[]) => any;
|
|
25
26
|
onChange?: (value: any[]) => any;
|
|
27
|
+
"onUpdate:modelValue"?: (value: any[]) => any;
|
|
26
28
|
"onLoad-more"?: () => any;
|
|
27
29
|
}>, {
|
|
28
|
-
|
|
30
|
+
variant: "default" | "outline" | "solid" | "floating" | string;
|
|
29
31
|
size: "sm" | "md" | "lg";
|
|
30
|
-
|
|
31
|
-
modelValue: any[];
|
|
32
|
+
disabled: boolean;
|
|
32
33
|
loading: boolean;
|
|
33
|
-
|
|
34
|
+
modelValue: any[];
|
|
35
|
+
options: (IDropdownOption | string | number)[];
|
|
34
36
|
layout: "default" | "grouped";
|
|
35
37
|
hasMore: boolean;
|
|
36
38
|
searchable: boolean;
|
|
37
39
|
remote: boolean;
|
|
40
|
+
debounceTime: number;
|
|
38
41
|
maxVisible: number;
|
|
39
42
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, HTMLDivElement>;
|
|
40
43
|
export default _default;
|