@gspa/ui 0.1.3 → 0.2.0
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 +35 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-B3TkBTvG.js +205 -0
- package/dist/Button.vue_vue_type_script_setup_true_lang-DZxttvYH.cjs +1 -0
- package/dist/DataTable.css +1 -0
- package/dist/DataTableToolBar.css +1 -0
- package/dist/FormField.vue_vue_type_script_setup_true_lang-DimMUyA-.js +205 -0
- package/dist/FormField.vue_vue_type_script_setup_true_lang-mEO-VA6R.cjs +1 -0
- package/dist/Header.css +1 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-C1OQn24h.cjs +1 -0
- package/dist/Input.vue_vue_type_script_setup_true_lang-CpBoY97r.js +137 -0
- package/dist/Loader.css +1 -0
- package/dist/ReminderConfig.css +1 -0
- package/dist/ReusableForm.css +1 -0
- package/dist/Sidebar.css +1 -0
- package/dist/Toast.css +1 -0
- package/dist/_plugin-vue_export-helper-BHFhmbuH.cjs +1 -0
- package/dist/_plugin-vue_export-helper-CHgC5LLL.js +9 -0
- package/dist/components/Accordion.cjs +1 -0
- package/dist/components/Accordion.js +192 -0
- package/dist/components/AccordionItem.cjs +1 -0
- package/dist/components/AccordionItem.js +109 -0
- package/dist/components/AddReminderModal.cjs +1 -0
- package/dist/components/AddReminderModal.js +107 -0
- package/dist/components/Alert.cjs +1 -0
- package/dist/components/Alert.js +227 -0
- package/dist/components/Avatar.cjs +1 -0
- package/dist/components/Avatar.js +86 -0
- package/dist/components/Badge.cjs +1 -0
- package/dist/components/Badge.js +109 -0
- package/dist/components/Breadcrumb.cjs +1 -0
- package/dist/components/Breadcrumb.js +72 -0
- package/dist/components/Button.cjs +1 -0
- package/dist/components/Button.js +4 -0
- package/dist/components/ButtonGroup.cjs +1 -0
- package/dist/components/ButtonGroup.js +46 -0
- package/dist/components/Calendar.cjs +1 -0
- package/dist/components/Calendar.js +341 -0
- package/dist/components/Card.cjs +1 -0
- package/dist/components/Card.js +316 -0
- package/dist/components/CardBody.cjs +1 -0
- package/dist/components/CardBody.js +34 -0
- package/dist/components/CardContent.cjs +1 -0
- package/dist/components/CardContent.js +17 -0
- package/dist/components/CardFooter.cjs +1 -0
- package/dist/components/CardFooter.js +34 -0
- package/dist/components/CardHeader.cjs +1 -0
- package/dist/components/CardHeader.js +91 -0
- package/dist/components/CardTitle.cjs +1 -0
- package/dist/components/CardTitle.js +17 -0
- package/dist/components/Checkbox.cjs +1 -0
- package/dist/components/Checkbox.js +185 -0
- package/dist/components/CircularProgress.cjs +1 -0
- package/dist/components/CircularProgress.js +141 -0
- package/dist/components/DataTable.cjs +1 -0
- package/dist/components/DataTable.js +863 -0
- package/dist/components/DataTableCell.cjs +1 -0
- package/dist/components/DataTableCell.js +95 -0
- package/dist/components/DataTableFilters.cjs +1 -0
- package/dist/components/DataTableFilters.js +519 -0
- package/dist/components/DataTableHeader.cjs +1 -0
- package/dist/components/DataTableHeader.js +116 -0
- package/dist/components/DataTablePagination.cjs +1 -0
- package/dist/components/DataTablePagination.js +290 -0
- package/dist/components/DataTableRow.cjs +1 -0
- package/dist/components/DataTableRow.js +199 -0
- package/dist/components/DataTableToolBar.cjs +1 -0
- package/dist/components/DataTableToolBar.js +477 -0
- package/dist/components/DatePicker.cjs +1 -0
- package/dist/components/DatePicker.js +401 -0
- package/dist/components/Divider.cjs +1 -0
- package/dist/components/Divider.js +103 -0
- package/dist/components/Dropdown.cjs +1 -0
- package/dist/components/Dropdown.js +104 -0
- package/dist/components/DropdownItem.cjs +1 -0
- package/dist/components/DropdownItem.js +60 -0
- package/dist/components/EventsCalendar.cjs +1 -0
- package/dist/components/EventsCalendar.js +863 -0
- package/dist/components/FileUpload.cjs +1 -0
- package/dist/components/FileUpload.js +195 -0
- package/dist/components/FilterDrawer.cjs +1 -0
- package/dist/components/FilterDrawer.js +412 -0
- package/dist/components/Footer.cjs +1 -0
- package/dist/components/Footer.js +157 -0
- package/dist/components/FormField.cjs +1 -0
- package/dist/components/FormField.js +4 -0
- package/dist/components/Graph.cjs +1 -0
- package/dist/components/Graph.js +164 -0
- package/dist/components/GraphFilters.cjs +1 -0
- package/dist/components/GraphFilters.js +305 -0
- package/dist/components/Header.cjs +1 -0
- package/dist/components/Header.js +674 -0
- package/dist/components/Icon.cjs +1 -0
- package/dist/components/Icon.js +58 -0
- package/dist/components/Image.cjs +1 -0
- package/dist/components/Image.js +112 -0
- package/dist/components/Input.cjs +1 -0
- package/dist/components/Input.js +4 -0
- package/dist/components/InputGroup.cjs +1 -0
- package/dist/components/InputGroup.js +45 -0
- package/dist/components/Label.cjs +1 -0
- package/dist/components/Label.js +46 -0
- package/dist/components/Link.cjs +1 -0
- package/dist/components/Link.js +119 -0
- package/dist/components/ListItem.cjs +1 -0
- package/dist/components/ListItem.js +89 -0
- package/dist/components/Loader.cjs +1 -0
- package/dist/components/Loader.js +154 -0
- package/dist/components/Logo.cjs +1 -0
- package/dist/components/Logo.js +67 -0
- package/dist/components/MenuItem.cjs +1 -0
- package/dist/components/MenuItem.js +66 -0
- package/dist/components/Modal.cjs +1 -0
- package/dist/components/Modal.js +110 -0
- package/dist/components/ModalBody.cjs +1 -0
- package/dist/components/ModalBody.js +33 -0
- package/dist/components/ModalFooter.cjs +1 -0
- package/dist/components/ModalFooter.js +33 -0
- package/dist/components/ModalHeader.cjs +1 -0
- package/dist/components/ModalHeader.js +24 -0
- package/dist/components/MultiSelect.cjs +1 -0
- package/dist/components/MultiSelect.js +211 -0
- package/dist/components/Notification.cjs +1 -0
- package/dist/components/Notification.js +121 -0
- package/dist/components/Option.cjs +1 -0
- package/dist/components/Option.js +44 -0
- package/dist/components/Progress.cjs +1 -0
- package/dist/components/Progress.js +77 -0
- package/dist/components/ProgressBar.cjs +1 -0
- package/dist/components/ProgressBar.js +101 -0
- package/dist/components/Radio.cjs +1 -0
- package/dist/components/Radio.js +81 -0
- package/dist/components/RailNav.cjs +1 -0
- package/dist/components/RailNav.js +124 -0
- package/dist/components/ReminderConfig.cjs +1 -0
- package/dist/components/ReminderConfig.js +375 -0
- package/dist/components/ReusableForm.cjs +1 -0
- package/dist/components/ReusableForm.js +686 -0
- package/dist/components/ReusableFormModal.cjs +1 -0
- package/dist/components/ReusableFormModal.js +112 -0
- package/dist/components/RightDrawer.cjs +1 -0
- package/dist/components/RightDrawer.js +143 -0
- package/dist/components/Search.cjs +1 -0
- package/dist/components/Search.js +252 -0
- package/dist/components/Select.cjs +1 -0
- package/dist/components/Select.js +243 -0
- package/dist/components/Sidebar.cjs +1 -0
- package/dist/components/Sidebar.js +372 -0
- package/dist/components/Slider.cjs +1 -0
- package/dist/components/Slider.js +42 -0
- package/dist/components/Spinner.cjs +1 -0
- package/dist/components/Spinner.js +87 -0
- package/dist/components/Stepper.cjs +1 -0
- package/dist/components/Stepper.js +12 -0
- package/dist/components/StepperItem.cjs +1 -0
- package/dist/components/StepperItem.js +33 -0
- package/dist/components/Switch.cjs +1 -0
- package/dist/components/Switch.js +112 -0
- package/dist/components/Tab.cjs +1 -0
- package/dist/components/Tab.js +134 -0
- package/dist/components/TabPanel.cjs +1 -0
- package/dist/components/TabPanel.js +49 -0
- package/dist/components/Text.cjs +1 -0
- package/dist/components/Text.js +84 -0
- package/dist/components/Textarea.cjs +1 -0
- package/dist/components/Textarea.js +102 -0
- package/dist/components/ThemeConfigurator.cjs +1 -0
- package/dist/components/ThemeConfigurator.js +73 -0
- package/dist/components/Timeline.cjs +1 -0
- package/dist/components/Timeline.js +24 -0
- package/dist/components/TimelineItem.cjs +1 -0
- package/dist/components/TimelineItem.js +63 -0
- package/dist/components/Toast.cjs +1 -0
- package/dist/components/Toast.js +231 -0
- package/dist/components/Tooltip.cjs +1 -0
- package/dist/components/Tooltip.js +124 -0
- package/dist/components/Typography.cjs +1 -0
- package/dist/components/Typography.js +267 -0
- package/dist/components/charts/BarChart.cjs +1 -0
- package/dist/components/charts/BarChart.js +323 -0
- package/dist/components/charts/LineChart.cjs +1 -0
- package/dist/components/charts/LineChart.js +322 -0
- package/dist/components/charts/PieChart.cjs +1 -0
- package/dist/components/charts/PieChart.js +311 -0
- package/dist/components/charts/StackedBarChart.cjs +1 -0
- package/dist/components/charts/StackedBarChart.js +348 -0
- package/dist/components/widgets/DashboardWidget.cjs +1 -0
- package/dist/components/widgets/DashboardWidget.js +309 -0
- package/dist/directives/tooltip.cjs +47 -0
- package/dist/directives/tooltip.js +115 -0
- package/dist/gspa-ui.css +1 -1
- package/dist/index.cjs +1 -0
- package/dist/index.esm.js +315 -19546
- package/dist/layouts/AuthLayout.cjs +1 -0
- package/dist/layouts/AuthLayout.js +188 -0
- package/dist/layouts/DashboardLayout.cjs +1 -0
- package/dist/layouts/DashboardLayout.js +244 -0
- package/dist/layouts/DefaultLayout.cjs +1 -0
- package/dist/layouts/DefaultLayout.js +94 -0
- package/dist/layouts/ErrorLayout.cjs +1 -0
- package/dist/layouts/ErrorLayout.js +452 -0
- package/dist/lib/auth.cjs +1 -0
- package/dist/lib/auth.js +4 -0
- package/dist/lib/form-field.cjs +1 -0
- package/dist/lib/form-field.js +4 -0
- package/dist/lib/icon.cjs +1 -0
- package/dist/lib/icon.js +4 -0
- package/dist/lib/theme.cjs +1 -0
- package/dist/lib/theme.js +145 -0
- package/dist/lib/toast.cjs +1 -0
- package/dist/lib/toast.js +81 -0
- package/dist/src/components/Alert.vue.d.ts.map +1 -1
- package/dist/src/components/Button.vue.d.ts +127 -29
- package/dist/src/components/Button.vue.d.ts.map +1 -1
- package/dist/src/components/Checkbox.vue.d.ts +2 -2
- package/dist/src/components/DataTable.vue.d.ts +1 -1
- package/dist/src/components/FormField.vue.d.ts +106 -38
- package/dist/src/components/FormField.vue.d.ts.map +1 -1
- package/dist/src/components/Icon.vue.d.ts.map +1 -1
- package/dist/src/components/Input.vue.d.ts +137 -33
- package/dist/src/components/Input.vue.d.ts.map +1 -1
- package/dist/src/components/ReusableForm.vue.d.ts +1 -1
- package/dist/src/components/ReusableForm.vue.d.ts.map +1 -1
- package/dist/src/components/ReusableFormModal.vue.d.ts +1 -1
- package/dist/src/components/Textarea.vue.d.ts +2 -2
- package/dist/src/index.d.ts +9 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/layouts/AuthLayout.vue.d.ts +2 -0
- package/dist/src/layouts/AuthLayout.vue.d.ts.map +1 -1
- package/dist/src/lib/form-field.d.ts +2 -0
- package/dist/src/lib/form-field.d.ts.map +1 -0
- package/dist/src/lib/icon.d.ts +2 -0
- package/dist/src/lib/icon.d.ts.map +1 -0
- package/dist/src/lib/theme.d.ts +4 -0
- package/dist/src/lib/theme.d.ts.map +1 -1
- package/dist/src/types.d.ts +44 -0
- package/dist/src/types.d.ts.map +1 -0
- package/dist/styles/auth-layout.css +1 -0
- package/dist/styles/button.css +1 -0
- package/dist/styles/form-field.css +1 -0
- package/dist/styles/input.css +1 -0
- package/dist/styles/tokens.css +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/dist/utils/cn.cjs +1 -0
- package/dist/utils/cn.js +7 -0
- package/package.json +45 -8
- package/dist/index.js +0 -605
- package/dist/src/__tests__/Alert.spec.d.ts +0 -2
- package/dist/src/__tests__/Alert.spec.d.ts.map +0 -1
- package/dist/src/__tests__/App.spec.d.ts +0 -2
- package/dist/src/__tests__/App.spec.d.ts.map +0 -1
- package/dist/src/__tests__/AuthLayout.spec.d.ts +0 -2
- package/dist/src/__tests__/AuthLayout.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Badge.spec.d.ts +0 -2
- package/dist/src/__tests__/Badge.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Button.spec.d.ts +0 -2
- package/dist/src/__tests__/Button.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Card.spec.d.ts +0 -2
- package/dist/src/__tests__/Card.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Checkbox.spec.d.ts +0 -2
- package/dist/src/__tests__/Checkbox.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Dropdown.spec.d.ts +0 -2
- package/dist/src/__tests__/Dropdown.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Input.spec.d.ts +0 -2
- package/dist/src/__tests__/Input.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Modal.spec.d.ts +0 -2
- package/dist/src/__tests__/Modal.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Radio.spec.d.ts +0 -2
- package/dist/src/__tests__/Radio.spec.d.ts.map +0 -1
- package/dist/src/__tests__/ReusableForm.spec.d.ts +0 -2
- package/dist/src/__tests__/ReusableForm.spec.d.ts.map +0 -1
- package/dist/src/__tests__/Tabs.spec.d.ts +0 -2
- package/dist/src/__tests__/Tabs.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/CardIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/CardIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/FormIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/FormIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/ModalIntegration.spec.d.ts.map +0 -1
- package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts +0 -2
- package/dist/src/__tests__/integration/NavigationIntegration.spec.d.ts.map +0 -1
|
@@ -0,0 +1,477 @@
|
|
|
1
|
+
import { ref as v, computed as i, watch as be, onMounted as ge, onUnmounted as ye, resolveComponent as pe, createElementBlock as r, openBlock as s, createElementVNode as a, createBlock as h, createCommentVNode as u, normalizeClass as d, toDisplayString as f, Fragment as C, renderList as B, withCtx as O, createTextVNode as F, createVNode as m, withModifiers as z, Teleport as he, withDirectives as ke, normalizeStyle as xe, vShow as Ce, renderSlot as S, h as w } from "vue";
|
|
2
|
+
import { _ as N } from "../Button.vue_vue_type_script_setup_true_lang-B3TkBTvG.js";
|
|
3
|
+
import H from "./Icon.js";
|
|
4
|
+
import Be from "./FilterDrawer.js";
|
|
5
|
+
import { cva as $ } from "class-variance-authority";
|
|
6
|
+
import { cn as k } from "../utils/cn.js";
|
|
7
|
+
import { _ as we } from "../_plugin-vue_export-helper-CHgC5LLL.js";
|
|
8
|
+
const $e = { class: "flex flex-col rounded-2xl mb-2 px-2" }, Re = { class: "flex items-center gap-3" }, Ae = {
|
|
9
|
+
key: 0,
|
|
10
|
+
class: "flex items-center gap-3"
|
|
11
|
+
}, Fe = { class: "text-sm ui-text" }, Se = { class: "flex items-center gap-2" }, Te = { class: "flex items-center gap-3" }, Ie = ["title", "onClick"], Le = {
|
|
12
|
+
key: 1,
|
|
13
|
+
class: "relative"
|
|
14
|
+
}, Ve = { class: "p-3" }, Me = { class: "space-y-1" }, je = { class: "flex items-center gap-2 cursor-pointer w-full" }, De = ["checked", "onChange"], Ee = ["disabled"], Oe = {
|
|
15
|
+
key: 3,
|
|
16
|
+
class: "flex items-center gap-2"
|
|
17
|
+
}, ze = {
|
|
18
|
+
key: 4,
|
|
19
|
+
class: "relative"
|
|
20
|
+
}, Ne = ["value", "placeholder"], He = {
|
|
21
|
+
key: 0,
|
|
22
|
+
class: "inline-flex items-center justify-center min-w-5 h-5 rounded-full text-xs ui-primary-bg text-white px-1"
|
|
23
|
+
}, Pe = {
|
|
24
|
+
key: 7,
|
|
25
|
+
class: "flex items-center gap-2"
|
|
26
|
+
}, qe = {
|
|
27
|
+
key: 1,
|
|
28
|
+
class: "mt-2 px-3 py-2 border ui-border-strong rounded-lg flex flex-wrap items-center gap-2 ui-surface"
|
|
29
|
+
}, Qe = ["onClick"], Ue = [
|
|
30
|
+
{
|
|
31
|
+
key: "delete",
|
|
32
|
+
label: "Delete",
|
|
33
|
+
icon: {
|
|
34
|
+
render() {
|
|
35
|
+
return w("svg", {
|
|
36
|
+
fill: "none",
|
|
37
|
+
viewBox: "0 0 24 24",
|
|
38
|
+
"stroke-width": "1.5",
|
|
39
|
+
stroke: "currentColor"
|
|
40
|
+
}, [
|
|
41
|
+
w("path", {
|
|
42
|
+
"stroke-linecap": "round",
|
|
43
|
+
"stroke-linejoin": "round",
|
|
44
|
+
d: "m14.74 9-.346 9m-4.788 0L9.26 9m9.968-3.21c.342.052.682.107 1.022.166m-1.022-.165L18.16 19.673a2.25 2.25 0 0 1-2.244 2.077H8.084a2.25 2.25 0 0 1-2.244-2.077L4.772 5.79m14.456 0a48.108 48.108 0 0 0-3.478-.397m-12 .562c.34-.059.68-.114 1.022-.165m0 0a48.11 48.11 0 0 1 3.478-.397m7.5 0v-.916c0-1.18-.91-2.164-2.09-2.201a51.964 51.964 0 0 0-3.32 0c-1.18.037-2.09 1.022-2.09 2.201v.916m7.5 0a48.667 48.667 0 0 0-7.5 0"
|
|
45
|
+
})
|
|
46
|
+
]);
|
|
47
|
+
}
|
|
48
|
+
},
|
|
49
|
+
variant: "danger"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
key: "edit",
|
|
53
|
+
label: "Edit",
|
|
54
|
+
icon: {
|
|
55
|
+
render() {
|
|
56
|
+
return w("svg", {
|
|
57
|
+
fill: "none",
|
|
58
|
+
viewBox: "0 0 24 24",
|
|
59
|
+
"stroke-width": "1.5",
|
|
60
|
+
stroke: "currentColor"
|
|
61
|
+
}, [
|
|
62
|
+
w("path", {
|
|
63
|
+
"stroke-linecap": "round",
|
|
64
|
+
"stroke-linejoin": "round",
|
|
65
|
+
d: "m16.862 4.487 1.687-1.688a1.875 1.875 0 1 1 2.652 2.652L10.582 16.07a4.5 4.5 0 0 1-1.897 1.13L6 18l.8-2.685a4.5 4.5 0 0 1 1.13-1.897l8.932-8.931Zm0 0L19.5 7.125M18 14v4.75A2.25 2.25 0 0 1 15.75 21H5.25A2.25 2.25 0 0 1 3 18.75V8.25A2.25 2.25 0 0 1 5.25 6H10"
|
|
66
|
+
})
|
|
67
|
+
]);
|
|
68
|
+
}
|
|
69
|
+
},
|
|
70
|
+
variant: "primary"
|
|
71
|
+
}
|
|
72
|
+
], Ze = {
|
|
73
|
+
name: "DataTableToolBar"
|
|
74
|
+
}, Ge = /* @__PURE__ */ Object.assign(Ze, {
|
|
75
|
+
props: {
|
|
76
|
+
selectedItems: { type: Array, default: () => [] },
|
|
77
|
+
totalItems: { type: Number, default: 0 },
|
|
78
|
+
itemLabel: { type: String, default: "items" },
|
|
79
|
+
showTableInfo: { type: Boolean, default: !1 },
|
|
80
|
+
showItemCount: { type: Boolean, default: !1 },
|
|
81
|
+
bulkActions: { type: Array, default: () => Ue },
|
|
82
|
+
showDensityToggle: { type: Boolean, default: !0 },
|
|
83
|
+
showColumnToggle: { type: Boolean, default: !0 },
|
|
84
|
+
showRefresh: { type: Boolean, default: !0 },
|
|
85
|
+
showSearch: { type: Boolean, default: !0 },
|
|
86
|
+
searchQuery: { type: String, default: "" },
|
|
87
|
+
searchPlaceholder: { type: String, default: "Search..." },
|
|
88
|
+
addButton: { type: Object, default: () => ({}) },
|
|
89
|
+
isRefreshing: { type: Boolean, default: !1 },
|
|
90
|
+
density: {
|
|
91
|
+
type: String,
|
|
92
|
+
default: "compact",
|
|
93
|
+
validator: (t) => ["compact", "normal", "comfortable"].includes(t)
|
|
94
|
+
},
|
|
95
|
+
toggleableColumns: { type: Array, default: () => [] },
|
|
96
|
+
visibleColumns: { type: Array, default: () => [] },
|
|
97
|
+
variant: {
|
|
98
|
+
type: String,
|
|
99
|
+
default: "default",
|
|
100
|
+
validator: (t) => ["default", "minimal", "bordered"].includes(t)
|
|
101
|
+
},
|
|
102
|
+
padding: {
|
|
103
|
+
type: String,
|
|
104
|
+
default: "normal",
|
|
105
|
+
validator: (t) => ["compact", "normal", "comfortable"].includes(t)
|
|
106
|
+
},
|
|
107
|
+
themeScope: {
|
|
108
|
+
type: String,
|
|
109
|
+
default: "default",
|
|
110
|
+
validator: (t) => ["default", "module"].includes(t)
|
|
111
|
+
},
|
|
112
|
+
activeFilters: {
|
|
113
|
+
type: Array,
|
|
114
|
+
default: () => []
|
|
115
|
+
},
|
|
116
|
+
enableFilters: {
|
|
117
|
+
type: Boolean,
|
|
118
|
+
default: !1
|
|
119
|
+
},
|
|
120
|
+
filterFields: {
|
|
121
|
+
type: Array,
|
|
122
|
+
default: () => []
|
|
123
|
+
},
|
|
124
|
+
filterRules: {
|
|
125
|
+
type: Object,
|
|
126
|
+
default: () => ({ logic: "all", rules: [] })
|
|
127
|
+
},
|
|
128
|
+
defaultFilterRules: {
|
|
129
|
+
type: Object,
|
|
130
|
+
default: () => ({ logic: "all", rules: [] })
|
|
131
|
+
}
|
|
132
|
+
},
|
|
133
|
+
emits: [
|
|
134
|
+
"bulk-action",
|
|
135
|
+
"update:density",
|
|
136
|
+
"toggle-column",
|
|
137
|
+
"refresh",
|
|
138
|
+
"update:search-query",
|
|
139
|
+
"add",
|
|
140
|
+
"add-button-click",
|
|
141
|
+
"update:filterRules"
|
|
142
|
+
],
|
|
143
|
+
setup(t, { emit: P }) {
|
|
144
|
+
const n = t, b = P, g = v(!1), R = v(!1), T = v(!1), y = v(null), A = v(null), I = v({}), L = i(() => n.selectedItems.length), V = i(() => Object.keys(n.addButton || {}).length > 0), q = i(() => V.value ? n.addButton.permission === void 0 ? !0 : typeof n.addButton.permission == "function" ? n.addButton.permission() : !!n.addButton.permission : !1), M = i(() => !V.value || !q.value ? !1 : typeof n.addButton.visible == "function" ? n.addButton.visible() : n.addButton.visible === void 0 ? !0 : !!n.addButton.visible), j = i(() => M.value ? typeof n.addButton.disabled == "function" ? n.addButton.disabled() : !!n.addButton.disabled : !0), Q = i(() => n.addButton.tooltip || n.addButton.label || "Add new item"), U = [
|
|
145
|
+
{ value: "compact", label: "Compact", icon: ["fas", "minus"] },
|
|
146
|
+
{ value: "normal", label: "Normal", icon: ["fas", "bars"] },
|
|
147
|
+
{ value: "comfortable", label: "Comfortable", icon: ["fas", "bars-staggered"] }
|
|
148
|
+
], Z = $("flex items-center justify-between border ui-border-strong rounded-2xl", {
|
|
149
|
+
variants: {
|
|
150
|
+
variant: {
|
|
151
|
+
default: "ui-border-strong",
|
|
152
|
+
minimal: "bg-transparent ui-border-strong",
|
|
153
|
+
bordered: " ui-border-strong"
|
|
154
|
+
},
|
|
155
|
+
padding: {
|
|
156
|
+
compact: "p-2",
|
|
157
|
+
normal: "p-4",
|
|
158
|
+
comfortable: "p-6"
|
|
159
|
+
}
|
|
160
|
+
},
|
|
161
|
+
defaultVariants: {
|
|
162
|
+
variant: "default",
|
|
163
|
+
padding: "normal"
|
|
164
|
+
}
|
|
165
|
+
}), G = $("px-3 py-1.5 text-sm font-medium rounded-md flex items-center gap-1 transition-colors ", {
|
|
166
|
+
variants: {
|
|
167
|
+
variant: {
|
|
168
|
+
danger: "ui-danger ui-danger-bg hover:bg-(--ui-danger-soft) border border-(--ui-danger-soft)",
|
|
169
|
+
primary: "ui-primary ui-primary-soft hover:bg-(--ui-primary-soft) border border-(--ui-primary-soft)",
|
|
170
|
+
secondary: "ui-text ui-bg hover:bg-(--ui-bg) border ui-border-strong"
|
|
171
|
+
}
|
|
172
|
+
},
|
|
173
|
+
defaultVariants: {
|
|
174
|
+
variant: "secondary"
|
|
175
|
+
}
|
|
176
|
+
}), J = $("p-2 border ui-border-strong transition-colors ", {
|
|
177
|
+
variants: {
|
|
178
|
+
active: {
|
|
179
|
+
true: "ui-primary-soft ui-primary border-(--ui-primary-soft)",
|
|
180
|
+
false: "ui-surface ui-text hover:bg-(--ui-surface)"
|
|
181
|
+
},
|
|
182
|
+
position: {
|
|
183
|
+
first: "rounded-l-md border-r-0",
|
|
184
|
+
middle: "border-x-0",
|
|
185
|
+
last: "rounded-r-md border-l-0"
|
|
186
|
+
}
|
|
187
|
+
},
|
|
188
|
+
defaultVariants: {
|
|
189
|
+
active: !1,
|
|
190
|
+
position: "middle"
|
|
191
|
+
}
|
|
192
|
+
}), K = $("px-3 py-2 text-sm border ui-border-strong rounded-md flex items-center gap-2 transition-colors ", {
|
|
193
|
+
variants: {
|
|
194
|
+
state: {
|
|
195
|
+
normal: "ui-text hover:text-(--ui-text) hover:bg-(--ui-surface)",
|
|
196
|
+
refreshing: "ui-text opacity-75 cursor-not-allowed"
|
|
197
|
+
}
|
|
198
|
+
},
|
|
199
|
+
defaultVariants: {
|
|
200
|
+
state: "normal"
|
|
201
|
+
}
|
|
202
|
+
}), W = i(
|
|
203
|
+
() => k(
|
|
204
|
+
Z({
|
|
205
|
+
variant: n.variant,
|
|
206
|
+
padding: n.padding
|
|
207
|
+
}),
|
|
208
|
+
n.themeScope === "module" && "kv-module-themed-toolbar"
|
|
209
|
+
)
|
|
210
|
+
), X = i(() => "text-md ui-text"), Y = i(() => "flex items-center"), _ = i(
|
|
211
|
+
() => "flex items-center gap-2 px-3 py-2 text-sm ui-text hover:text-(--ui-text) border ui-border-strong rounded-md hover:brightness-105 transition-colors focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:ring-offset-1"
|
|
212
|
+
), ee = i(
|
|
213
|
+
() => "ui-bg rounded-lg shadow-lg z-[9999] max-h-64 overflow-y-auto"
|
|
214
|
+
), te = i(
|
|
215
|
+
() => "text-xs font-medium ui-text uppercase tracking-wider mb-2 border-b ui-border-strong pb-2"
|
|
216
|
+
), le = i(
|
|
217
|
+
() => "py-1 hover:bg-(--ui-surface) rounded transition-colors"
|
|
218
|
+
), oe = i(
|
|
219
|
+
() => "w-4 h-4 rounded ui-border-strong ui-primary focus:ring-(--ui-primary) focus:ring-2 focus:ring-offset-1"
|
|
220
|
+
), ne = i(
|
|
221
|
+
() => "text-sm ui-text flex-1 select-none"
|
|
222
|
+
), se = i(
|
|
223
|
+
() => "w-72 pl-9 pr-3 py-2 text-sm border ui-border-strong rounded-md ui-surface ui-text placeholder:text-(--ui-text-muted) focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-transparent transition-all"
|
|
224
|
+
), p = () => {
|
|
225
|
+
if (!y.value) return;
|
|
226
|
+
const e = y.value.getBoundingClientRect(), l = 224, c = Math.max(12, e.right - l);
|
|
227
|
+
I.value = {
|
|
228
|
+
position: "fixed",
|
|
229
|
+
top: `${e.bottom + 6}px`,
|
|
230
|
+
left: `${c}px`,
|
|
231
|
+
width: `${l}px`,
|
|
232
|
+
zIndex: 9999
|
|
233
|
+
};
|
|
234
|
+
}, D = (e) => {
|
|
235
|
+
y.value && A.value && !y.value.contains(e.target) && !A.value.contains(e.target) && (g.value = !1);
|
|
236
|
+
}, re = () => {
|
|
237
|
+
g.value = !g.value, g.value && p();
|
|
238
|
+
}, ae = (e) => k(G({ variant: e.variant || "secondary" })), ie = (e) => {
|
|
239
|
+
let l = "middle";
|
|
240
|
+
return e === "compact" ? l = "first" : e === "comfortable" && (l = "last"), k(J({
|
|
241
|
+
active: n.density === e,
|
|
242
|
+
position: l
|
|
243
|
+
}));
|
|
244
|
+
}, ue = () => k(K({
|
|
245
|
+
state: n.isRefreshing ? "refreshing" : "normal"
|
|
246
|
+
})), de = () => k("w-4 h-4", {
|
|
247
|
+
"animate-spin": n.isRefreshing
|
|
248
|
+
}), ce = (e) => n.visibleColumns.includes(e), fe = (e, l) => {
|
|
249
|
+
b("toggle-column", { column: e, visible: l });
|
|
250
|
+
}, me = () => {
|
|
251
|
+
j.value || (b("add"), b("add-button-click", n.addButton), typeof n.addButton.onClick == "function" && n.addButton.onClick());
|
|
252
|
+
}, E = i(
|
|
253
|
+
() => (n.filterRules?.rules || []).map((e) => ({
|
|
254
|
+
id: e.id,
|
|
255
|
+
label: e.label,
|
|
256
|
+
value: typeof e.value == "object" ? `${e.value.from || ""}${e.value.from || e.value.to ? " to " : ""}${e.value.to || ""}` : String(e.value ?? "")
|
|
257
|
+
}))
|
|
258
|
+
), ve = (e) => {
|
|
259
|
+
const l = Array.isArray(n.filterRules?.rules) ? n.filterRules.rules : [];
|
|
260
|
+
b("update:filterRules", {
|
|
261
|
+
logic: n.filterRules?.logic || "all",
|
|
262
|
+
rules: l.filter((c) => c.id !== e)
|
|
263
|
+
});
|
|
264
|
+
};
|
|
265
|
+
return be(
|
|
266
|
+
() => n.defaultFilterRules,
|
|
267
|
+
(e) => {
|
|
268
|
+
if (T.value || !n.enableFilters) return;
|
|
269
|
+
const l = Array.isArray(e?.rules) ? e.rules : [];
|
|
270
|
+
l.length !== 0 && (b("update:filterRules", {
|
|
271
|
+
logic: e?.logic || "all",
|
|
272
|
+
rules: l
|
|
273
|
+
}), T.value = !0);
|
|
274
|
+
},
|
|
275
|
+
{ immediate: !0, deep: !0 }
|
|
276
|
+
), ge(() => {
|
|
277
|
+
document.addEventListener("click", D), window.addEventListener("scroll", p, !0), window.addEventListener("resize", p);
|
|
278
|
+
}), ye(() => {
|
|
279
|
+
document.removeEventListener("click", D), window.removeEventListener("scroll", p, !0), window.removeEventListener("resize", p);
|
|
280
|
+
}), (e, l) => {
|
|
281
|
+
const c = pe("font-awesome-icon");
|
|
282
|
+
return s(), r("div", $e, [
|
|
283
|
+
a("div", {
|
|
284
|
+
class: d(W.value)
|
|
285
|
+
}, [
|
|
286
|
+
a("div", Re, [
|
|
287
|
+
L.value > 0 ? (s(), r("div", Ae, [
|
|
288
|
+
a("span", Fe, f(L.value) + " selected ", 1),
|
|
289
|
+
a("div", Se, [
|
|
290
|
+
(s(!0), r(C, null, B(t.bulkActions, (o) => (s(), h(N, {
|
|
291
|
+
key: o.key,
|
|
292
|
+
class: d(ae(o)),
|
|
293
|
+
onClick: (x) => e.$emit("bulk-action", { action: o.key, items: t.selectedItems })
|
|
294
|
+
}, {
|
|
295
|
+
default: O(() => [
|
|
296
|
+
o.icon ? (s(), h(c, {
|
|
297
|
+
key: 0,
|
|
298
|
+
icon: o.icon,
|
|
299
|
+
class: "w-4 h-4"
|
|
300
|
+
}, null, 8, ["icon"])) : u("", !0),
|
|
301
|
+
F(" " + f(o.label), 1)
|
|
302
|
+
]),
|
|
303
|
+
_: 2
|
|
304
|
+
}, 1032, ["class", "onClick"]))), 128))
|
|
305
|
+
])
|
|
306
|
+
])) : t.showItemCount && t.totalItems > 0 ? (s(), r("div", {
|
|
307
|
+
key: 1,
|
|
308
|
+
class: d(X.value)
|
|
309
|
+
}, f(t.totalItems) + " " + f(t.itemLabel), 3)) : u("", !0)
|
|
310
|
+
]),
|
|
311
|
+
a("div", Te, [
|
|
312
|
+
t.showDensityToggle ? (s(), r("div", {
|
|
313
|
+
key: 0,
|
|
314
|
+
class: d(Y.value)
|
|
315
|
+
}, [
|
|
316
|
+
(s(), r(C, null, B(U, (o) => a("button", {
|
|
317
|
+
key: o.value,
|
|
318
|
+
class: d(ie(o.value)),
|
|
319
|
+
title: o.label,
|
|
320
|
+
type: "button",
|
|
321
|
+
onClick: (x) => e.$emit("update:density", o.value)
|
|
322
|
+
}, [
|
|
323
|
+
m(c, {
|
|
324
|
+
icon: o.icon,
|
|
325
|
+
class: "w-4 h-4"
|
|
326
|
+
}, null, 8, ["icon"])
|
|
327
|
+
], 10, Ie)), 64))
|
|
328
|
+
], 2)) : u("", !0),
|
|
329
|
+
t.showColumnToggle ? (s(), r("div", Le, [
|
|
330
|
+
a("button", {
|
|
331
|
+
ref_key: "columnToggleButton",
|
|
332
|
+
ref: y,
|
|
333
|
+
class: d(_.value),
|
|
334
|
+
type: "button",
|
|
335
|
+
onClick: z(re, ["stop"])
|
|
336
|
+
}, [
|
|
337
|
+
m(c, {
|
|
338
|
+
icon: "columns",
|
|
339
|
+
class: "w-4 h-4"
|
|
340
|
+
}),
|
|
341
|
+
l[7] || (l[7] = a("span", null, "Columns", -1))
|
|
342
|
+
], 2),
|
|
343
|
+
(s(), h(he, { to: "body" }, [
|
|
344
|
+
ke(a("div", {
|
|
345
|
+
ref_key: "columnMenu",
|
|
346
|
+
ref: A,
|
|
347
|
+
class: d(ee.value),
|
|
348
|
+
style: xe(I.value),
|
|
349
|
+
onClick: l[0] || (l[0] = z(() => {
|
|
350
|
+
}, ["stop"]))
|
|
351
|
+
}, [
|
|
352
|
+
a("div", Ve, [
|
|
353
|
+
a("div", {
|
|
354
|
+
class: d(te.value)
|
|
355
|
+
}, " Show Columns ", 2),
|
|
356
|
+
a("div", Me, [
|
|
357
|
+
(s(!0), r(C, null, B(t.toggleableColumns, (o) => (s(), r("div", {
|
|
358
|
+
key: o.key,
|
|
359
|
+
class: d(le.value)
|
|
360
|
+
}, [
|
|
361
|
+
a("label", je, [
|
|
362
|
+
a("input", {
|
|
363
|
+
type: "checkbox",
|
|
364
|
+
checked: ce(o.key),
|
|
365
|
+
class: d(oe.value),
|
|
366
|
+
onChange: (x) => fe(o.key, x.target.checked)
|
|
367
|
+
}, null, 42, De),
|
|
368
|
+
a("span", {
|
|
369
|
+
class: d(ne.value)
|
|
370
|
+
}, f(o.label), 3)
|
|
371
|
+
])
|
|
372
|
+
], 2))), 128))
|
|
373
|
+
])
|
|
374
|
+
])
|
|
375
|
+
], 6), [
|
|
376
|
+
[Ce, g.value]
|
|
377
|
+
])
|
|
378
|
+
]))
|
|
379
|
+
])) : u("", !0),
|
|
380
|
+
t.showRefresh ? (s(), r("button", {
|
|
381
|
+
key: 2,
|
|
382
|
+
disabled: t.isRefreshing,
|
|
383
|
+
class: d(ue()),
|
|
384
|
+
type: "button",
|
|
385
|
+
onClick: l[1] || (l[1] = (o) => e.$emit("refresh"))
|
|
386
|
+
}, [
|
|
387
|
+
m(c, {
|
|
388
|
+
icon: "sync",
|
|
389
|
+
class: d(de())
|
|
390
|
+
}, null, 8, ["class"]),
|
|
391
|
+
l[8] || (l[8] = a("span", null, "Refresh", -1))
|
|
392
|
+
], 10, Ee)) : u("", !0),
|
|
393
|
+
e.$slots.actions ? (s(), r("div", Oe, [
|
|
394
|
+
S(e.$slots, "actions", {}, void 0, !0)
|
|
395
|
+
])) : u("", !0),
|
|
396
|
+
t.showSearch ? (s(), r("div", ze, [
|
|
397
|
+
m(c, {
|
|
398
|
+
icon: "search",
|
|
399
|
+
class: "pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 w-3.5 h-3.5 ui-text-soft"
|
|
400
|
+
}),
|
|
401
|
+
a("input", {
|
|
402
|
+
value: t.searchQuery,
|
|
403
|
+
type: "text",
|
|
404
|
+
placeholder: t.searchPlaceholder,
|
|
405
|
+
class: d(se.value),
|
|
406
|
+
onInput: l[2] || (l[2] = (o) => e.$emit("update:search-query", o.target.value))
|
|
407
|
+
}, null, 42, Ne)
|
|
408
|
+
])) : u("", !0),
|
|
409
|
+
M.value ? (s(), h(N, {
|
|
410
|
+
key: 5,
|
|
411
|
+
variant: t.addButton.variant || "success",
|
|
412
|
+
disabled: j.value,
|
|
413
|
+
title: Q.value,
|
|
414
|
+
onClick: me
|
|
415
|
+
}, {
|
|
416
|
+
default: O(() => [
|
|
417
|
+
m(H, {
|
|
418
|
+
icon: t.addButton.icon || "plus"
|
|
419
|
+
}, null, 8, ["icon"]),
|
|
420
|
+
a("span", null, f(t.addButton.label || "Add"), 1)
|
|
421
|
+
]),
|
|
422
|
+
_: 1
|
|
423
|
+
}, 8, ["variant", "disabled", "title"])) : u("", !0),
|
|
424
|
+
t.enableFilters ? (s(), r("button", {
|
|
425
|
+
key: 6,
|
|
426
|
+
class: "px-3 py-2 text-sm border ui-border-strong rounded-md hover:bg-(--ui-surface) flex items-center gap-2",
|
|
427
|
+
onClick: l[3] || (l[3] = (o) => R.value = !0)
|
|
428
|
+
}, [
|
|
429
|
+
m(c, { icon: "filter" }),
|
|
430
|
+
l[9] || (l[9] = F(" Filter ", -1)),
|
|
431
|
+
(t.filterRules.rules || []).length ? (s(), r("span", He, f((t.filterRules.rules || []).length), 1)) : u("", !0)
|
|
432
|
+
])) : u("", !0),
|
|
433
|
+
e.$slots["actions-after-add"] ? (s(), r("div", Pe, [
|
|
434
|
+
S(e.$slots, "actions-after-add", {}, void 0, !0)
|
|
435
|
+
])) : u("", !0)
|
|
436
|
+
])
|
|
437
|
+
], 2),
|
|
438
|
+
t.enableFilters ? (s(), h(Be, {
|
|
439
|
+
key: 0,
|
|
440
|
+
open: R.value,
|
|
441
|
+
fields: t.filterFields,
|
|
442
|
+
"model-value": t.filterRules,
|
|
443
|
+
"onUpdate:modelValue": l[4] || (l[4] = (o) => e.$emit("update:filterRules", o)),
|
|
444
|
+
onClose: l[5] || (l[5] = (o) => R.value = !1)
|
|
445
|
+
}, null, 8, ["open", "fields", "model-value"])) : u("", !0),
|
|
446
|
+
(t.enableFilters ? E.value.length > 0 : t.activeFilters.length > 0) ? (s(), r("div", qe, [
|
|
447
|
+
l[10] || (l[10] = a("span", { class: "text-sm ui-text-soft" }, "Filters:", -1)),
|
|
448
|
+
(s(!0), r(C, null, B(t.enableFilters ? E.value : t.activeFilters, (o) => (s(), r("span", {
|
|
449
|
+
key: o.id || `${o.label}-${o.value}`,
|
|
450
|
+
class: "inline-flex items-center gap-1 px-2 py-1 rounded-md text-sm border ui-border-strong ui-text"
|
|
451
|
+
}, [
|
|
452
|
+
F(f(o.label) + ": " + f(o.value) + " ", 1),
|
|
453
|
+
t.enableFilters && o.id ? (s(), r("button", {
|
|
454
|
+
key: 0,
|
|
455
|
+
class: "ml-1 ui-text-soft hover:ui-primary",
|
|
456
|
+
onClick: (x) => ve(o.id)
|
|
457
|
+
}, [
|
|
458
|
+
m(H, {
|
|
459
|
+
icon: "xmark",
|
|
460
|
+
class: "w-3 h-3"
|
|
461
|
+
})
|
|
462
|
+
], 8, Qe)) : u("", !0)
|
|
463
|
+
]))), 128)),
|
|
464
|
+
t.enableFilters ? (s(), r("button", {
|
|
465
|
+
key: 0,
|
|
466
|
+
class: "ml-1 px-2 py-1 text-sm border border-(--ui-primary) rounded-md ui-primary hover:bg-(--ui-primary-soft)",
|
|
467
|
+
onClick: l[6] || (l[6] = (o) => e.$emit("update:filterRules", { logic: t.defaultFilterRules?.logic || "all", rules: t.defaultFilterRules?.rules || [] }))
|
|
468
|
+
}, " Clear filter ")) : u("", !0),
|
|
469
|
+
S(e.$slots, "active-filter-actions", {}, void 0, !0)
|
|
470
|
+
])) : u("", !0)
|
|
471
|
+
]);
|
|
472
|
+
};
|
|
473
|
+
}
|
|
474
|
+
}), tt = /* @__PURE__ */ we(Ge, [["__scopeId", "data-v-b6fc1eb4"]]);
|
|
475
|
+
export {
|
|
476
|
+
tt as default
|
|
477
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const e=require("vue"),K={class:"relative w-full bg-(--ui-surface) rounded-md"},Q={class:"relative"},X=["id","value","disabled","placeholder","required","aria-describedby"],Z={class:"flex items-center justify-between mb-3"},ee={class:"text-sm font-semibold ui-text"},te={class:"grid grid-cols-7 gap-1 mb-1"},ne={class:"grid grid-cols-7 gap-1"},oe=["disabled","onClick"],re={key:0,class:"mt-3 pt-2 border-t ui-border"},ae={key:0,class:"border-l pl-3 ui-border"},le={class:"max-h-[260px] overflow-y-auto pr-1 space-y-1"},ie=["onClick"],se={__name:"DatePicker",props:{id:String,modelValue:[String,Date],disabled:Boolean,required:Boolean,min:[String,Date],max:[String,Date],placeholder:{type:String,default:"Select date"},format:{type:String,default:"DD/MM/YYYY"},clearable:{type:Boolean,default:!0},showToday:{type:Boolean,default:!0},ariaDescribedby:String,customValidation:{type:Function,default:null},disabledDates:{type:[Array,Function],default:null},enableTime:{type:Boolean,default:!1},minuteInterval:{type:Number,default:1}},emits:["update:modelValue","validation-error"],setup(s,{emit:L}){const a=s,v=L,m=e.ref(!1),x=e.ref(null),D=e.ref(null),w=e.ref({}),f=new Date,l=e.ref(f.getMonth()),i=e.ref(f.getFullYear()),u=e.ref(null),b=e.ref(!1),y=e.ref("00:00"),H=["Su","Mo","Tu","We","Th","Fr","Sa"],R=e.computed(()=>new Date(i.value,l.value).toLocaleString("default",{month:"long"})),E=e.computed(()=>new Date(i.value,l.value+1,0).getDate()),j=e.computed(()=>new Date(i.value,l.value,1).getDay()),B=e.computed(()=>{const o=new Date(i.value,l.value,0).getDate(),t=j.value;return Array.from({length:t},(n,r)=>o-t+r+1)}),A=e.computed(()=>{const o=B.value.length+E.value,t=o%7===0?0:7-o%7;return Array.from({length:t},(n,r)=>r+1)}),S=e.computed(()=>u.value?a.enableTime?q(u.value):V(u.value):""),P=e.computed(()=>{const o=Math.min(60,Math.max(1,Number(a.minuteInterval)||1)),t=[];for(let n=0;n<24;n++)for(let r=0;r<60;r+=o){const d=String(n).padStart(2,"0"),c=String(r).padStart(2,"0");t.push(`${d}:${c}`)}return t});function V(o){if(!o)return"";const t=new Date(o),n=String(t.getMonth()+1).padStart(2,"0"),r=String(t.getDate()).padStart(2,"0"),d=t.getFullYear();return a.format.replace("MM",n).replace("DD",r).replace("YYYY",d)}function q(o){const t=V(o),n=String(o.getHours()).padStart(2,"0"),r=String(o.getMinutes()).padStart(2,"0");return`${t} ${n}:${r}`}function h(o){if(!o)return null;if(o instanceof Date)return o;if(typeof o=="string"){if(o.includes("T")){const[r,d]=o.split("T"),c=h(r);if(!c)return null;const[g="00",p="00"]=(d||"").slice(0,5).split(":");return c.setHours(parseInt(g,10)||0,parseInt(p,10)||0,0,0),c}const n=o.split("-");if(n.length===3){const r=parseInt(n[0],10),d=parseInt(n[1],10)-1,c=parseInt(n[2],10);return new Date(r,d,c)}}const t=new Date(o);return isNaN(t.getTime())?null:t}function O(o){return f.getDate()===o&&f.getMonth()===l.value&&f.getFullYear()===i.value}function M(o){if(!u.value)return!1;const t=new Date(u.value);return t.getDate()===o&&t.getMonth()===l.value&&t.getFullYear()===i.value}function k(o){const t=new Date(i.value,l.value,o);if(a.min){const n=h(a.min);if(n&&t<n)return!0}if(a.max){const n=h(a.max);if(n&&t>n)return!0}if(a.disabledDates){if(typeof a.disabledDates=="function")return a.disabledDates(t);if(Array.isArray(a.disabledDates))return a.disabledDates.some(n=>{const r=h(n);return r&&r.getTime()===t.getTime()})}return!!(a.customValidation&&a.customValidation(t))}function N(o){if(!o)return b.value=!1,v("validation-error",null),!0;if(a.customValidation){const t=a.customValidation(o);if(t)return b.value=!0,v("validation-error",t),!1}return b.value=!1,v("validation-error",null),!0}async function C(){await e.nextTick();const o=D.value||(a.id?document.getElementById(a.id):null);if(!o||!x.value)return;const t=o.getBoundingClientRect(),n=320,r=window.innerHeight-t.bottom,d=t.top,c=8;let g,p;r>=n||r>d?g=t.bottom+c:g=t.top-n-c,p=t.left;const I=256;p+I>window.innerWidth&&(p=window.innerWidth-I-16),p<16&&(p=16),w.value={top:`${g}px`,left:`${p}px`}}async function W(){a.disabled||(m.value=!m.value,m.value&&await C())}function T(){m.value=!1}function _(){l.value===0?(l.value=11,i.value--):l.value--}function U(){l.value===11?(l.value=0,i.value++):l.value++}function $(o){if(k(o))return;const t=new Date(i.value,l.value,o);N(t)&&(u.value=t,Y(t),setTimeout(()=>{a.enableTime||(m.value=!1)},150))}function Y(o){const t=o.getFullYear(),n=String(o.getMonth()+1).padStart(2,"0"),r=String(o.getDate()).padStart(2,"0");if(!a.enableTime){v("update:modelValue",`${t}-${n}-${r}`);return}const[d="00",c="00"]=y.value.split(":"),g=`${t}-${n}-${r}T${d}:${c}`;v("update:modelValue",g)}function G(){l.value=f.getMonth(),i.value=f.getFullYear(),$(f.getDate())}function J(){u.value=null,y.value="00:00",b.value=!1,v("update:modelValue",""),v("validation-error",null)}e.watch(()=>a.modelValue,o=>{if(o){const t=h(o);if(t){u.value=t;const n=String(t.getHours()).padStart(2,"0"),r=String(t.getMinutes()).padStart(2,"0");y.value=`${n}:${r}`,l.value=t.getMonth(),i.value=t.getFullYear(),N(t)}}else u.value=null,b.value=!1},{immediate:!0}),e.watch(y,o=>{if(!a.enableTime||!u.value)return;const[t="00",n="00"]=(o||"00:00").split(":");u.value.setHours(parseInt(t,10)||0,parseInt(n,10)||0,0,0),Y(u.value)});function F(){m.value&&C()}function z(o){o.key==="Escape"&&m.value&&T()}return e.onMounted(()=>{document.addEventListener("keydown",z),window.addEventListener("resize",F)}),e.onBeforeUnmount(()=>{document.removeEventListener("keydown",z),window.removeEventListener("resize",F)}),(o,t)=>(e.openBlock(),e.createElementBlock("div",K,[e.createElementVNode("div",Q,[e.createElementVNode("input",{id:s.id,ref_key:"inputRef",ref:D,type:"text",value:S.value,readonly:"",disabled:s.disabled,placeholder:s.placeholder,required:s.required,"aria-describedby":s.ariaDescribedby,class:e.normalizeClass(["w-full px-3 py-2 pr-10 border rounded-md ui-surface ui-text placeholder-slate-400 text-sm ","focus:outline-none focus:ring-2 focus:ring-(--ui-primary) focus:border-(--ui-primary) cursor-pointer transition-colors","disabled:bg-(--ui-bg) disabled:text-(--ui-text) disabled:cursor-not-allowed",b.value?"border-(--ui-danger) focus:ring-(--ui-danger) focus:border-(--ui-danger)":"ui-border"]),onClick:W},null,10,X),t[2]||(t[2]=e.createElementVNode("div",{class:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none"},[e.createElementVNode("svg",{class:"w-4 h-4 ui-text",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z"})])],-1)),s.clearable&&S.value&&!s.disabled?(e.openBlock(),e.createElementBlock("button",{key:0,type:"button",class:"absolute right-9 top-1/2 -translate-y-1/2 p-1 hover:bg-(--ui-bg) rounded transition-colors","aria-label":"Clear date",onClick:e.withModifiers(J,["stop"])},[...t[1]||(t[1]=[e.createElementVNode("svg",{class:"w-3.5 h-3.5 ui-text",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M6 18L18 6M6 6l12 12"})],-1)])])):e.createCommentVNode("",!0)]),(e.openBlock(),e.createBlock(e.Teleport,{to:"body"},[e.createVNode(e.Transition,{"enter-active-class":"transition ease-out duration-100","enter-from-class":"transform opacity-0 scale-95","enter-to-class":"transform opacity-100 scale-100","leave-active-class":"transition ease-in duration-75","leave-from-class":"transform opacity-100 scale-100","leave-to-class":"transform opacity-0 scale-95"},{default:e.withCtx(()=>[m.value?(e.openBlock(),e.createElementBlock("div",{key:0,ref_key:"calendarRef",ref:x,style:e.normalizeStyle(w.value),class:e.normalizeClass(["fixed z-10000 rounded-lg shadow-xl p-3 ui-surface ui-border-strong",s.enableTime?"w-[420px]":"w-64"]),onClick:t[0]||(t[0]=e.withModifiers(()=>{},["stop"]))},[e.createElementVNode("div",{class:e.normalizeClass(s.enableTime?"grid grid-cols-[1fr_124px] gap-3":"block")},[e.createElementVNode("div",null,[e.createElementVNode("div",Z,[e.createElementVNode("button",{type:"button",class:"p-1.5 rounded hover:bg-(--ui-bg) transition-colors","aria-label":"Previous Month",onClick:_},[...t[3]||(t[3]=[e.createElementVNode("svg",{class:"w-4 h-4 ui-text",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M15 18l-6-6 6-6"})],-1)])]),e.createElementVNode("div",ee,e.toDisplayString(R.value)+" "+e.toDisplayString(i.value),1),e.createElementVNode("button",{type:"button",class:"p-1.5 rounded hover:bg-(--ui-bg) transition-colors","aria-label":"Next Month",onClick:U},[...t[4]||(t[4]=[e.createElementVNode("svg",{class:"w-4 h-4 ui-text",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24"},[e.createElementVNode("path",{"stroke-linecap":"round","stroke-linejoin":"round","stroke-width":"2",d:"M9 18l6-6-6-6"})],-1)])])]),e.createElementVNode("div",te,[(e.openBlock(),e.createElementBlock(e.Fragment,null,e.renderList(H,n=>e.createElementVNode("div",{key:n,class:"text-center text-xs font-medium ui-text py-1"},e.toDisplayString(n),1)),64))]),e.createElementVNode("div",ne,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(B.value,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:"prev-"+r,class:"text-center text-xs ui-text py-1.5"},e.toDisplayString(n),1))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(E.value,n=>(e.openBlock(),e.createElementBlock("button",{key:n,type:"button",disabled:k(n),class:e.normalizeClass(["w-8 h-8 rounded text-xs font-medium transition-colors",O(n)&&!M(n)?"ui-primary-soft ui-primary ring-1 ring-(--ui-primary)":"",M(n)?"ui-primary-bg ui-text hover:bg-(--ui-primary)":"ui-text hover:bg-(--ui-bg)",k(n)?"ui-text cursor-not-allowed hover:bg-transparent line-through":"cursor-pointer"]),onClick:r=>$(n)},e.toDisplayString(n),11,oe))),128)),(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(A.value,(n,r)=>(e.openBlock(),e.createElementBlock("div",{key:"next-"+r,class:"text-center text-xs ui-text py-1.5"},e.toDisplayString(n),1))),128))]),s.showToday?(e.openBlock(),e.createElementBlock("div",re,[e.createElementVNode("button",{type:"button",class:"w-full px-3 py-1.5 text-xs font-medium ui-primary hover:bg-(--ui-primary-soft) rounded transition-colors",onClick:G}," Today ")])):e.createCommentVNode("",!0)]),s.enableTime?(e.openBlock(),e.createElementBlock("div",ae,[t[5]||(t[5]=e.createElementVNode("div",{class:"text-xs font-semibold ui-text mb-2"},"Time",-1)),e.createElementVNode("div",le,[(e.openBlock(!0),e.createElementBlock(e.Fragment,null,e.renderList(P.value,n=>(e.openBlock(),e.createElementBlock("button",{key:n,type:"button",class:e.normalizeClass(["w-full px-2 py-1.5 text-left text-sm rounded transition-colors",n===y.value?"ui-primary-bg ui-text":"ui-text hover:bg-(--ui-bg)"]),onClick:r=>y.value=n},e.toDisplayString(n),11,ie))),128))])])):e.createCommentVNode("",!0)],2)],6)):e.createCommentVNode("",!0)]),_:1}),m.value?(e.openBlock(),e.createElementBlock("div",{key:0,class:"fixed inset-0 z-9999",onClick:T})):e.createCommentVNode("",!0)]))]))}};exports.default=se;
|