vlite3 0.4.4 → 0.4.7

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.
Files changed (109) hide show
  1. package/components/Accordion/AccordionItem.vue.js +33 -32
  2. package/components/Accordion/types.d.ts +2 -0
  3. package/components/Alert.vue.d.ts +2 -0
  4. package/components/Alert.vue.js +38 -36
  5. package/components/AvatarUploader/AvatarUploader.vue.d.ts +1 -1
  6. package/components/AvatarUploader/AvatarUploader.vue.js +25 -24
  7. package/components/Button.vue.d.ts +1 -1
  8. package/components/Button.vue.js +37 -35
  9. package/components/CheckBox.vue.d.ts +1 -0
  10. package/components/CheckBox.vue.js +40 -40
  11. package/components/Chip/Chip.vue.js +55 -55
  12. package/components/Chip/types.d.ts +1 -0
  13. package/components/ChoiceBox/ChoiceBox.vue.d.ts +5 -0
  14. package/components/ChoiceBox/ChoiceBox.vue.js +61 -58
  15. package/components/ColorPicker/ColorPicker.vue.js +3 -2
  16. package/components/ConfirmationModal.vue.d.ts +4 -2
  17. package/components/ConfirmationModal.vue.js +48 -33
  18. package/components/DataList/DataList.vue.d.ts +0 -2
  19. package/components/DataList/DataList.vue.js +39 -35
  20. package/components/DataList/types.d.ts +2 -0
  21. package/components/DataTable/DataTable.vue.d.ts +0 -5
  22. package/components/DataTable/DataTable.vue.js +177 -158
  23. package/components/DataTable/DataTableHeader.vue.js +15 -14
  24. package/components/DataTable/DataTableToolbar.vue.d.ts +1 -1
  25. package/components/DataTable/DataTableToolbar.vue.js +30 -23
  26. package/components/DataTable/types.d.ts +4 -0
  27. package/components/DatePicker.vue.d.ts +1 -0
  28. package/components/DatePicker.vue.js +32 -25
  29. package/components/Dropdown/DropdownBooleanItem.vue.js +18 -17
  30. package/components/Dropdown/DropdownGroupedLayout.vue.js +28 -27
  31. package/components/Dropdown/DropdownItem.vue.js +24 -23
  32. package/components/Dropdown/DropdownMenu.vue.js +100 -91
  33. package/components/Dropdown/composables/useDropdownNavigation.js +24 -23
  34. package/components/Dropdown/composables/useDropdownSelection.js +19 -17
  35. package/components/Empty/Empty.vue.d.ts +2 -2
  36. package/components/Empty/Empty.vue.js +32 -18
  37. package/components/FilePicker/FilePicker.vue.d.ts +3 -1
  38. package/components/FilePicker/FilePicker.vue.js +140 -127
  39. package/components/FileTree/FileTree.vue.js +68 -58
  40. package/components/FileTree/FileTreeNode.vue.js +35 -34
  41. package/components/FileTree/types.d.ts +3 -0
  42. package/components/Form/CustomFields.vue.d.ts +3 -1
  43. package/components/Form/CustomFields.vue.js +2 -2
  44. package/components/Form/CustomFields.vue2.js +92 -80
  45. package/components/Form/Form.vue.d.ts +1 -1
  46. package/components/Form/FormField.vue.d.ts +1 -1
  47. package/components/Form/FormField.vue.js +60 -59
  48. package/components/Form/FormFields.vue.js +2 -2
  49. package/components/Form/FormFields.vue2.js +58 -57
  50. package/components/Form/composables/useForm.js +91 -88
  51. package/components/Form/types.d.ts +4 -0
  52. package/components/Form/utils/form.utils.js +104 -98
  53. package/components/GoogleLogin.vue.d.ts +1 -1
  54. package/components/GoogleLogin.vue.js +39 -32
  55. package/components/Heatmap/Heatmap.vue2.js +3 -2
  56. package/components/IconPicker.vue.d.ts +2 -0
  57. package/components/IconPicker.vue.js +37 -29
  58. package/components/Input.vue.d.ts +1 -1
  59. package/components/Input.vue.js +96 -98
  60. package/components/Kanban/KanbanBoard.vue.js +1 -1
  61. package/components/Kanban/KanbanBoard.vue2.js +55 -54
  62. package/components/Kanban/types.d.ts +1 -0
  63. package/components/Masonry/Masonry.vue2.js +3 -2
  64. package/components/Modal.vue.d.ts +2 -0
  65. package/components/Modal.vue.js +62 -57
  66. package/components/MultiSelect/MultiSelect.vue.d.ts +1 -1
  67. package/components/MultiSelect/MultiSelect.vue.js +61 -54
  68. package/components/Navbar/Navbar.vue.js +46 -46
  69. package/components/Pagination/Pagination.vue.js +116 -97
  70. package/components/PricingPlan/PricingPlanItem.vue.js +60 -47
  71. package/components/PricingPlan/types.d.ts +5 -0
  72. package/components/Screen/Screen.vue.d.ts +0 -4
  73. package/components/Screen/Screen.vue.js +231 -189
  74. package/components/Screen/ScreenFilter.vue.js +73 -63
  75. package/components/Screen/types.d.ts +5 -0
  76. package/components/SidePanel.vue.d.ts +2 -0
  77. package/components/SidePanel.vue.js +140 -5
  78. package/components/SidePanel.vue2.js +2 -135
  79. package/components/SidebarMenu/SidebarMenuItem.vue.js +131 -130
  80. package/components/SidebarMenu/types.d.ts +1 -0
  81. package/components/Slider.vue.d.ts +1 -0
  82. package/components/Slider.vue.js +71 -69
  83. package/components/Switch.vue.d.ts +1 -0
  84. package/components/Switch.vue.js +23 -18
  85. package/components/Tabes/Tabes.vue.js +20 -19
  86. package/components/Tabes/types.d.ts +1 -0
  87. package/components/Textarea.vue.d.ts +1 -0
  88. package/components/Textarea.vue.js +18 -16
  89. package/components/ThemeToggle.vue.js +24 -14
  90. package/components/Timeline.vue.js +68 -82
  91. package/components/ToastNotification.vue.js +2 -2
  92. package/components/Tooltip.vue.d.ts +4 -3
  93. package/components/Tooltip.vue.js +17 -15
  94. package/components/Workbook/Sheet.vue.js +80 -71
  95. package/components/Workbook/WorkbookAddButton.vue.js +14 -10
  96. package/components/Workbook/types.d.ts +1 -0
  97. package/core/config.d.ts +2 -0
  98. package/index.d.ts +1 -0
  99. package/index.js +28 -26
  100. package/package.json +1 -1
  101. package/style.css +1 -2
  102. package/types/button.d.ts +1 -0
  103. package/types/config.type.d.ts +10 -0
  104. package/types/form.type.d.ts +2 -0
  105. package/types/styles.d.ts +3 -0
  106. package/types/timeline.type.d.ts +2 -0
  107. package/utils/i18n.d.ts +8 -0
  108. package/utils/i18n.js +5 -0
  109. package/utils/index.d.ts +1 -0
@@ -1,9 +1,10 @@
1
- import { defineComponent as b, ref as V, computed as F, openBlock as r, createBlock as a, withCtx as s, createElementVNode as t, createVNode as n, unref as v, toDisplayString as w, withModifiers as k } from "vue";
2
- import p from "../Button.vue.js";
3
- import C from "../Modal.vue.js";
4
- import O from "../Dropdown/Dropdown.vue.js";
5
- import f from "../Icon.vue.js";
6
- import x from "../Form/Form.vue.js";
1
+ import { defineComponent as $, ref as S, computed as p, openBlock as o, createBlock as a, withCtx as r, createElementVNode as l, createVNode as n, unref as w, toDisplayString as v, withModifiers as F } from "vue";
2
+ import f from "../Button.vue.js";
3
+ import j from "../Modal.vue.js";
4
+ import z from "../Dropdown/Dropdown.vue.js";
5
+ import h from "../Icon.vue.js";
6
+ import { $t as x } from "../../utils/i18n.js";
7
+ import C from "../Form/Form.vue.js";
7
8
  /* empty css */
8
9
  import "v-datepicker-lite";
9
10
  import "v-datepicker-lite/style.css";
@@ -15,7 +16,7 @@ import "iconify-icon-picker/style.css";
15
16
  /* empty css */
16
17
  /* empty css */
17
18
  import "../../core/config.js";
18
- const $ = { class: "" }, S = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-[85vh] overflow-y-auto bg-card rounded-md border border-border shadow-lg text-left" }, P = /* @__PURE__ */ b({
19
+ const B = { class: "" }, M = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-[85vh] overflow-y-auto bg-card rounded-md border border-border shadow-lg text-left" }, X = /* @__PURE__ */ $({
19
20
  __name: "ScreenFilter",
20
21
  props: {
21
22
  schema: {},
@@ -23,63 +24,72 @@ const $ = { class: "" }, S = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-
23
24
  type: { default: "modal" }
24
25
  },
25
26
  emits: ["update:modelValue", "change"],
26
- setup(i, { emit: y }) {
27
- const m = i, c = y, l = V(!1), d = F(() => m.modelValue ? Object.keys(m.modelValue).filter(
28
- (o) => m.modelValue[o] !== "" && m.modelValue[o] !== null && m.modelValue[o] !== void 0
29
- ).length : 0), h = (o) => {
30
- c("update:modelValue", o.values), c("change", o.values), l.value = !1;
31
- }, g = () => {
32
- c("update:modelValue", {}), c("change", {});
33
- };
34
- return (o, e) => i.type === "modal" ? (r(), a(C, {
27
+ setup(i, { emit: O }) {
28
+ const u = i, m = O, s = S(!1), d = p(() => u.modelValue ? Object.keys(u.modelValue).filter(
29
+ (e) => u.modelValue[e] !== "" && u.modelValue[e] !== null && u.modelValue[e] !== void 0
30
+ ).length : 0), k = (e) => {
31
+ m("update:modelValue", e.values), m("change", e.values), s.value = !1;
32
+ }, y = () => {
33
+ m("update:modelValue", {}), m("change", {});
34
+ }, g = p(() => {
35
+ const e = x("vlite.screen.filters");
36
+ return e !== "vlite.screen.filters" ? e : "Filters";
37
+ }), b = p(() => {
38
+ const e = x("vlite.screen.applyFilters");
39
+ return e !== "vlite.screen.applyFilters" ? e : "Apply Filters";
40
+ }), V = p(() => {
41
+ const e = x("vlite.screen.filter");
42
+ return e !== "vlite.screen.filter" ? e : "Filter";
43
+ });
44
+ return (e, t) => i.type === "modal" ? (o(), a(j, {
35
45
  key: 0,
36
- title: "Filters",
37
- show: l.value,
38
- "onUpdate:show": e[2] || (e[2] = (u) => l.value = u),
46
+ title: g.value,
47
+ show: s.value,
48
+ "onUpdate:show": t[2] || (t[2] = (c) => s.value = c),
39
49
  "max-width": "sm:max-w-md"
40
50
  }, {
41
- trigger: s(() => [
42
- d.value > 0 ? (r(), a(p, {
51
+ trigger: r(() => [
52
+ d.value > 0 ? (o(), a(f, {
43
53
  key: 0,
44
54
  variant: "secondary",
45
55
  class: "flex items-center gap-1.5 pl-3 pr-1.5 shrink-0",
46
- onClick: e[0] || (e[0] = (u) => l.value = !0)
56
+ onClick: t[0] || (t[0] = (c) => s.value = !0)
47
57
  }, {
48
- default: s(() => [
49
- n(f, {
58
+ default: r(() => [
59
+ n(h, {
50
60
  icon: "ci:filter",
51
61
  class: "w-4 h-4"
52
62
  }),
53
- t("span", null, "Filters (" + w(d.value) + ")", 1),
54
- t("div", {
55
- onClick: k(g, ["stop"]),
63
+ l("span", null, v(g.value) + " (" + v(d.value) + ")", 1),
64
+ l("div", {
65
+ onClick: F(y, ["stop"]),
56
66
  class: "ml-1 p-1 hover:bg-black/10 dark:hover:bg-white/10 rounded-full transition-colors cursor-pointer"
57
67
  }, [
58
- n(f, {
68
+ n(h, {
59
69
  icon: "lucide:x",
60
70
  class: "w-4 h-4"
61
71
  })
62
72
  ])
63
73
  ]),
64
74
  _: 1
65
- })) : (r(), a(p, {
75
+ })) : (o(), a(f, {
66
76
  key: 1,
67
77
  variant: "outline",
68
- onClick: e[1] || (e[1] = (u) => l.value = !0),
69
- title: "Filter",
78
+ onClick: t[1] || (t[1] = (c) => s.value = !0),
79
+ title: V.value,
70
80
  size: "lg",
71
81
  asIcon: "",
72
82
  class: "shrink-0 h-9! w-9!"
73
83
  }, {
74
- default: s(() => [...e[4] || (e[4] = [
75
- t("div", { class: "text-gray-800! h-4! w-4! flex items-center justify-center" }, [
76
- t("svg", {
84
+ default: r(() => [...t[4] || (t[4] = [
85
+ l("div", { class: "text-gray-800! h-4! w-4! flex items-center justify-center" }, [
86
+ l("svg", {
77
87
  xmlns: "http://www.w3.org/2000/svg",
78
88
  width: "1.132em",
79
89
  height: "1.132em",
80
90
  viewBox: "0 0 24 24"
81
91
  }, [
82
- t("path", {
92
+ l("path", {
83
93
  fill: "none",
84
94
  stroke: "currentColor",
85
95
  "stroke-linecap": "round",
@@ -91,73 +101,73 @@ const $ = { class: "" }, S = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-
91
101
  ], -1)
92
102
  ])]),
93
103
  _: 1
94
- }))
104
+ }, 8, ["title"]))
95
105
  ]),
96
- default: s(() => [
97
- t("div", $, [
98
- n(v(x), {
106
+ default: r(() => [
107
+ l("div", B, [
108
+ n(w(C), {
99
109
  schema: i.schema,
100
110
  values: i.modelValue,
101
- "submit-text": "Apply Filters",
102
- onOnSubmit: h
103
- }, null, 8, ["schema", "values"])
111
+ "submit-text": b.value,
112
+ onOnSubmit: k
113
+ }, null, 8, ["schema", "values", "submit-text"])
104
114
  ])
105
115
  ]),
106
116
  _: 1
107
- }, 8, ["show"])) : (r(), a(v(O), {
117
+ }, 8, ["title", "show"])) : (o(), a(w(z), {
108
118
  key: 1,
109
- isOpen: l.value,
110
- "onUpdate:isOpen": e[3] || (e[3] = (u) => l.value = u),
119
+ isOpen: s.value,
120
+ "onUpdate:isOpen": t[3] || (t[3] = (c) => s.value = c),
111
121
  "close-on-select": !1,
112
122
  position: "bottom-end",
113
123
  class: "w-auto"
114
124
  }, {
115
- trigger: s(() => [
116
- d.value > 0 ? (r(), a(p, {
125
+ trigger: r(() => [
126
+ d.value > 0 ? (o(), a(f, {
117
127
  key: 0,
118
128
  variant: "secondary",
119
129
  class: "flex items-center gap-1.5 pl-3 pr-1.5 shrink-0 bg-gray-150! hover:bg-gray-100!",
120
130
  style: { "pointer-events": "auto" }
121
131
  }, {
122
- default: s(() => [
123
- n(f, {
132
+ default: r(() => [
133
+ n(h, {
124
134
  icon: "ci:filter",
125
135
  class: "w-4 h-4"
126
136
  }),
127
- t("span", null, "Filters (" + w(d.value) + ")", 1),
128
- t("div", {
129
- onClick: k(g, ["stop"]),
137
+ l("span", null, v(g.value) + " (" + v(d.value) + ")", 1),
138
+ l("div", {
139
+ onClick: F(y, ["stop"]),
130
140
  class: "ml-1 p-1 hover:bg-black/10 dark:hover:bg-white/10 rounded-full transition-colors cursor-pointer"
131
141
  }, [
132
- n(f, {
142
+ n(h, {
133
143
  icon: "lucide:x",
134
144
  class: "w-4 h-4"
135
145
  })
136
146
  ])
137
147
  ]),
138
148
  _: 1
139
- })) : (r(), a(p, {
149
+ })) : (o(), a(f, {
140
150
  key: 1,
141
151
  variant: "outline",
142
152
  icon: "hugeicons:filter-add",
143
- title: "Filter",
153
+ title: V.value,
144
154
  size: "lg",
145
155
  class: "shrink-0 h-9! w-9!"
146
- }))
156
+ }, null, 8, ["title"]))
147
157
  ]),
148
- default: s(() => [
149
- t("div", S, [
150
- n(v(x), {
158
+ default: r(() => [
159
+ l("div", M, [
160
+ n(w(C), {
151
161
  schema: i.schema,
152
162
  values: i.modelValue,
153
- "submit-text": "Apply Filters",
163
+ "submit-text": b.value,
154
164
  "submit-props": {
155
165
  size: "sm",
156
166
  class: "w-full",
157
167
  textClass: "-text-fs-1!"
158
168
  },
159
- onOnSubmit: h
160
- }, null, 8, ["schema", "values"])
169
+ onOnSubmit: k
170
+ }, null, 8, ["schema", "values", "submit-text"])
161
171
  ])
162
172
  ]),
163
173
  _: 1
@@ -165,5 +175,5 @@ const $ = { class: "" }, S = { class: "py-3 px-3.5 w-[300px] sm:w-[320px] max-h-
165
175
  }
166
176
  });
167
177
  export {
168
- P as default
178
+ X as default
169
179
  };
@@ -6,6 +6,7 @@ export interface ScreenPaginationProps extends Omit<PaginationProps, 'currentPag
6
6
  }
7
7
  export interface AddBtnConfig {
8
8
  label?: string;
9
+ labelI18n?: string;
9
10
  icon?: string;
10
11
  variant?: ButtonVariant;
11
12
  to?: string | Record<string, any>;
@@ -19,7 +20,9 @@ export interface AddBtnConfig {
19
20
  export interface ScreenProps {
20
21
  name?: string;
21
22
  title?: string;
23
+ titleI18n?: string;
22
24
  description?: string;
25
+ descriptionI18n?: string;
23
26
  pageInfo?: PageInfo;
24
27
  data?: any[];
25
28
  loading?: boolean;
@@ -37,7 +40,9 @@ export interface ScreenProps {
37
40
  }) => void;
38
41
  paginationProps?: ScreenPaginationProps;
39
42
  emptyTitle?: string;
43
+ emptyTitleI18n?: string;
40
44
  emptyDescription?: string;
45
+ emptyDescriptionI18n?: string;
41
46
  emptyIcon?: string;
42
47
  addComponent?: Component | any;
43
48
  addBtn?: AddBtnConfig;
@@ -3,7 +3,9 @@ import { SidePanelPosition, SidePanelSize } from '../types';
3
3
  interface Props {
4
4
  show?: boolean;
5
5
  title?: string;
6
+ titleI18n?: string;
6
7
  description?: string;
8
+ descriptionI18n?: string;
7
9
  position?: SidePanelPosition;
8
10
  size?: SidePanelSize;
9
11
  closeOutside?: boolean;
@@ -1,7 +1,142 @@
1
- import o from "./SidePanel.vue2.js";
2
- /* empty css */
3
- import a from "../_virtual/_plugin-vue_export-helper.js";
4
- const f = /* @__PURE__ */ a(o, [["__scopeId", "data-v-495f8aa0"]]);
1
+ import { defineComponent as N, ref as P, watch as b, onUnmounted as D, computed as f, openBlock as s, createElementBlock as r, Fragment as T, createElementVNode as c, mergeProps as C, withModifiers as V, renderSlot as i, createCommentVNode as l, createBlock as y, Teleport as K, createVNode as h, Transition as k, withCtx as g, normalizeClass as d, toDisplayString as w, resolveDynamicComponent as j } from "vue";
2
+ import F from "./Button.vue.js";
3
+ import { useKeyStroke as L } from "../composables/useKeyStroke.js";
4
+ import { $t as x } from "../utils/i18n.js";
5
+ const M = { class: "text-lg font-bold text-foreground" }, U = {
6
+ key: 0,
7
+ class: "mt-1 text-sm text-muted-foreground"
8
+ }, Q = /* @__PURE__ */ N({
9
+ inheritAttrs: !1,
10
+ __name: "SidePanel",
11
+ props: {
12
+ show: { type: Boolean, default: !1 },
13
+ title: {},
14
+ titleI18n: {},
15
+ description: {},
16
+ descriptionI18n: {},
17
+ position: { default: "right" },
18
+ size: { default: "md" },
19
+ closeOutside: { type: Boolean, default: !0 },
20
+ hideCloseButton: { type: Boolean, default: !1 },
21
+ class: { default: "" },
22
+ overlayClass: { default: "" },
23
+ bodyClass: { default: "" },
24
+ headerClass: { default: "" },
25
+ triggerClass: { default: "" },
26
+ footerClass: { default: "" },
27
+ backdrop: { type: Boolean, default: !0 },
28
+ body: {},
29
+ bodyProps: {}
30
+ },
31
+ emits: ["close", "update:show", "onOpen", "onAfterOpen", "onAfterClose"],
32
+ setup(t, { emit: $ }) {
33
+ const o = t, m = $, a = P(o.show);
34
+ b(
35
+ () => o.show,
36
+ (e) => {
37
+ a.value = e, e && m("onOpen");
38
+ }
39
+ );
40
+ const B = () => {
41
+ a.value = !0;
42
+ }, n = () => {
43
+ a.value = !1, m("update:show", !1), m("close");
44
+ }, z = () => {
45
+ o.closeOutside && n();
46
+ }, { onKeyStroke: A } = L();
47
+ A("Escape", n), b(a, (e) => {
48
+ e ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
49
+ }), D(() => {
50
+ document.body.style.overflow = "";
51
+ });
52
+ const O = {
53
+ sm: "max-w-sm",
54
+ md: "max-w-md",
55
+ lg: "max-w-lg",
56
+ xl: "max-w-xl",
57
+ full: "max-w-full"
58
+ }, I = f(() => o.position === "left" ? "left-0" : "right-0"), S = f(() => o.position === "left" ? "slide-left" : "slide-right"), p = f(() => o.titleI18n ? x(o.titleI18n) : o.title), v = f(
59
+ () => o.descriptionI18n ? x(o.descriptionI18n) : o.description
60
+ );
61
+ return (e, u) => (s(), r(T, null, [
62
+ c("span", C({
63
+ onClick: V(B, ["stop"]),
64
+ class: `${t.triggerClass}`
65
+ }, e.$attrs), [
66
+ i(e.$slots, "trigger", {}, () => [
67
+ t.body ? i(e.$slots, "default", { key: 0 }) : l("", !0)
68
+ ])
69
+ ], 16),
70
+ (s(), y(K, { to: "body" }, [
71
+ h(k, {
72
+ "enter-active-class": "transition-opacity duration-300 ease-out",
73
+ "enter-from-class": "opacity-0",
74
+ "enter-to-class": "opacity-100",
75
+ "leave-active-class": "transition-opacity duration-200 ease-in",
76
+ "leave-from-class": "opacity-100",
77
+ "leave-to-class": "opacity-0"
78
+ }, {
79
+ default: g(() => [
80
+ a.value ? (s(), r("div", {
81
+ key: 0,
82
+ class: d(["fixed inset-0 z-50 bg-[#00000033]", [t.overlayClass, { "backdrop-blur-[2px]": t.backdrop }]]),
83
+ onClick: z
84
+ }, null, 2)) : l("", !0)
85
+ ]),
86
+ _: 1
87
+ }),
88
+ h(k, {
89
+ name: S.value,
90
+ onAfterEnter: u[0] || (u[0] = (E) => e.$emit("onAfterOpen")),
91
+ onAfterLeave: u[1] || (u[1] = (E) => e.$emit("onAfterClose"))
92
+ }, {
93
+ default: g(() => [
94
+ a.value ? (s(), r("div", {
95
+ key: 0,
96
+ class: d(["sidepanel-body fixed inset-y-0 z-50 flex flex-col bg-body shadow-sm border transition-transform duration-300 ease-in-out w-full", [O[t.size], I.value, o.class]])
97
+ }, [
98
+ p.value || e.$slots.header ? (s(), r("div", {
99
+ key: 0,
100
+ class: d([t.headerClass, "flex-none flex items-center justify-between px-6 py-2 border-b border-border"])
101
+ }, [
102
+ i(e.$slots, "header", {}, () => [
103
+ c("div", null, [
104
+ c("h3", M, w(p.value), 1),
105
+ v.value ? (s(), r("p", U, w(v.value), 1)) : l("", !0)
106
+ ])
107
+ ]),
108
+ t.hideCloseButton ? l("", !0) : (s(), y(F, {
109
+ key: 0,
110
+ rounded: "full",
111
+ size: "sm",
112
+ variant: "ghost",
113
+ icon: "lucide:x",
114
+ onClick: n,
115
+ class: "-mr-2"
116
+ }))
117
+ ], 2)) : l("", !0),
118
+ c("div", {
119
+ class: d(["flex-1 overflow-y-auto px-6 py-4", t.bodyClass])
120
+ }, [
121
+ t.body ? (s(), y(j(t.body), C({ key: 0 }, { ...t.bodyProps, ...e.$attrs }, { close: n }), null, 16)) : i(e.$slots, "default", {
122
+ key: 1,
123
+ close: n
124
+ })
125
+ ], 2),
126
+ e.$slots.footer ? (s(), r("div", {
127
+ key: 1,
128
+ class: d(["flex-none px-6 py-3 border-t border-border", t.footerClass])
129
+ }, [
130
+ i(e.$slots, "footer", { close: n })
131
+ ], 2)) : l("", !0)
132
+ ], 2)) : l("", !0)
133
+ ]),
134
+ _: 3
135
+ }, 8, ["name"])
136
+ ]))
137
+ ], 64));
138
+ }
139
+ });
5
140
  export {
6
- f as default
141
+ Q as default
7
142
  };
@@ -1,137 +1,4 @@
1
- import { defineComponent as S, ref as E, watch as y, onUnmounted as N, computed as v, openBlock as o, createElementBlock as r, Fragment as P, createElementVNode as f, mergeProps as b, withModifiers as V, renderSlot as i, createCommentVNode as s, createBlock as m, Teleport as D, createVNode as p, Transition as C, withCtx as h, normalizeClass as d, toDisplayString as k, resolveDynamicComponent as K } from "vue";
2
- import T from "./Button.vue.js";
3
- import { useKeyStroke as j } from "../composables/useKeyStroke.js";
4
- const F = { class: "text-lg font-bold text-foreground" }, L = {
5
- key: 0,
6
- class: "mt-1 text-sm text-muted-foreground"
7
- }, G = /* @__PURE__ */ S({
8
- inheritAttrs: !1,
9
- __name: "SidePanel",
10
- props: {
11
- show: { type: Boolean, default: !1 },
12
- title: {},
13
- description: {},
14
- position: { default: "right" },
15
- size: { default: "md" },
16
- closeOutside: { type: Boolean, default: !0 },
17
- hideCloseButton: { type: Boolean, default: !1 },
18
- class: { default: "" },
19
- overlayClass: { default: "" },
20
- bodyClass: { default: "" },
21
- headerClass: { default: "" },
22
- triggerClass: { default: "" },
23
- footerClass: { default: "" },
24
- backdrop: { type: Boolean, default: !0 },
25
- body: {},
26
- bodyProps: {}
27
- },
28
- emits: ["close", "update:show", "onOpen", "onAfterOpen", "onAfterClose"],
29
- setup(e, { emit: g }) {
30
- const l = e, c = g, a = E(l.show);
31
- y(
32
- () => l.show,
33
- (t) => {
34
- a.value = t, t && c("onOpen");
35
- }
36
- );
37
- const w = () => {
38
- a.value = !0;
39
- }, n = () => {
40
- a.value = !1, c("update:show", !1), c("close");
41
- }, x = () => {
42
- l.closeOutside && n();
43
- }, { onKeyStroke: $ } = j();
44
- $("Escape", n), y(a, (t) => {
45
- t ? document.body.style.overflow = "hidden" : document.body.style.overflow = "";
46
- }), N(() => {
47
- document.body.style.overflow = "";
48
- });
49
- const B = {
50
- sm: "max-w-sm",
51
- md: "max-w-md",
52
- lg: "max-w-lg",
53
- xl: "max-w-xl",
54
- full: "max-w-full"
55
- }, z = v(() => l.position === "left" ? "left-0" : "right-0"), A = v(() => l.position === "left" ? "slide-left" : "slide-right");
56
- return (t, u) => (o(), r(P, null, [
57
- f("span", b({
58
- onClick: V(w, ["stop"]),
59
- class: `${e.triggerClass}`
60
- }, t.$attrs), [
61
- i(t.$slots, "trigger", {}, () => [
62
- e.body ? i(t.$slots, "default", { key: 0 }, void 0, !0) : s("", !0)
63
- ], !0)
64
- ], 16),
65
- (o(), m(D, { to: "body" }, [
66
- p(C, {
67
- "enter-active-class": "transition-opacity duration-300 ease-out",
68
- "enter-from-class": "opacity-0",
69
- "enter-to-class": "opacity-100",
70
- "leave-active-class": "transition-opacity duration-200 ease-in",
71
- "leave-from-class": "opacity-100",
72
- "leave-to-class": "opacity-0"
73
- }, {
74
- default: h(() => [
75
- a.value ? (o(), r("div", {
76
- key: 0,
77
- class: d(["fixed inset-0 z-50 bg-[#00000033]", [e.overlayClass, { "backdrop-blur-[2px]": e.backdrop }]]),
78
- onClick: x
79
- }, null, 2)) : s("", !0)
80
- ]),
81
- _: 1
82
- }),
83
- p(C, {
84
- name: A.value,
85
- onAfterEnter: u[0] || (u[0] = (O) => t.$emit("onAfterOpen")),
86
- onAfterLeave: u[1] || (u[1] = (O) => t.$emit("onAfterClose"))
87
- }, {
88
- default: h(() => [
89
- a.value ? (o(), r("div", {
90
- key: 0,
91
- class: d(["sidepanel-body fixed inset-y-0 z-50 flex flex-col bg-body shadow-sm border transition-transform duration-300 ease-in-out w-full", [B[e.size], z.value, l.class]])
92
- }, [
93
- e.title || t.$slots.header ? (o(), r("div", {
94
- key: 0,
95
- class: d([e.headerClass, "flex-none flex items-center justify-between px-6 py-2 border-b border-border"])
96
- }, [
97
- i(t.$slots, "header", {}, () => [
98
- f("div", null, [
99
- f("h3", F, k(e.title), 1),
100
- e.description ? (o(), r("p", L, k(e.description), 1)) : s("", !0)
101
- ])
102
- ], !0),
103
- e.hideCloseButton ? s("", !0) : (o(), m(T, {
104
- key: 0,
105
- rounded: "full",
106
- size: "sm",
107
- variant: "ghost",
108
- icon: "lucide:x",
109
- onClick: n,
110
- class: "-mr-2"
111
- }))
112
- ], 2)) : s("", !0),
113
- f("div", {
114
- class: d(["flex-1 overflow-y-auto px-6 py-4", e.bodyClass])
115
- }, [
116
- e.body ? (o(), m(K(e.body), b({ key: 0 }, { ...e.bodyProps, ...t.$attrs }, { close: n }), null, 16)) : i(t.$slots, "default", {
117
- key: 1,
118
- close: n
119
- }, void 0, !0)
120
- ], 2),
121
- t.$slots.footer ? (o(), r("div", {
122
- key: 1,
123
- class: d(["flex-none px-6 py-3 border-t border-border", e.footerClass])
124
- }, [
125
- i(t.$slots, "footer", { close: n }, void 0, !0)
126
- ], 2)) : s("", !0)
127
- ], 2)) : s("", !0)
128
- ]),
129
- _: 3
130
- }, 8, ["name"])
131
- ]))
132
- ], 64));
133
- }
134
- });
1
+ import f from "./SidePanel.vue.js";
135
2
  export {
136
- G as default
3
+ f as default
137
4
  };