vlite3 1.1.2 → 1.1.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/components/AttachmentsList/AttachmentsList.vue.d.ts +1 -1
- package/components/AttachmentsList/AttachmentsList.vue.js +237 -163
- package/components/Avatar.vue.js +1 -1
- package/components/AvatarUploader/AvatarUploader.vue.js +40 -37
- package/components/Button.vue.js +30 -28
- package/components/Carousel/Carousel.vue.d.ts +2 -2
- package/components/CategoryManager/CategoryManager.vue.d.ts +10 -2
- package/components/CategoryManager/CategoryManager.vue.js +137 -118
- package/components/CategoryManager/CategoryNode.vue.d.ts +2 -0
- package/components/CategoryManager/CategoryNode.vue.js +93 -88
- package/components/Chat/ChatBubble.vue.js +22 -22
- package/components/CheckBox.vue.js +29 -28
- package/components/CommandPalette/CommandPaletteContent.vue2.js +1 -1
- package/components/CommandPalette/{CommandPaletteItem.vue.js → CommandPaletteItem.vue2.js} +1 -1
- package/components/ConfirmationModal.vue.js +30 -28
- package/components/CopyButton.vue.d.ts +50 -0
- package/components/CopyButton.vue.js +69 -0
- package/components/CopyButton.vue2.js +4 -0
- package/components/DataTable/DataTable.vue.js +44 -44
- package/components/DatePicker.vue.js +41 -35
- package/components/DateRangePicker.vue.js +18 -17
- package/components/Dropdown/Dropdown.vue.d.ts +3 -0
- package/components/Dropdown/Dropdown.vue.js +117 -115
- package/components/Dropdown/DropdownBooleanItem.vue.js +16 -15
- package/components/Dropdown/DropdownItem.vue.js +21 -20
- package/components/Dropdown/DropdownMenu.vue.js +1 -1
- package/components/Dropdown/DropdownMenu.vue2.js +13 -12
- package/components/Dropdown/DropdownTrigger.vue.d.ts +2 -0
- package/components/Dropdown/DropdownTrigger.vue.js +10 -6
- package/components/Dropdown/composables/useDropdownHydration.d.ts +2 -0
- package/components/Dropdown/composables/useDropdownSelection.d.ts +1 -0
- package/components/Dropdown/composables/useDropdownSelection.js +46 -31
- package/components/FilePicker/FilePicker.vue.js +93 -90
- package/components/Form/CustomFields.vue.js +2 -2
- package/components/Form/Form.vue.js +2 -2
- package/components/Form/Form.vue2.js +68 -64
- package/components/Form/FormField.vue.js +204 -148
- package/components/Form/FormFields.vue.js +2 -2
- package/components/Form/FormFields.vue2.js +28 -27
- package/components/Form/types.d.ts +2 -2
- package/components/Form/utils/form.utils.d.ts +3 -3
- package/components/Form/utils/form.utils.js +37 -37
- package/components/Input.vue.js +64 -62
- package/components/Invoice/Invoice.vue.js +9 -7
- package/components/Invoice/InvoiceTotals.vue.d.ts +14 -0
- package/components/Invoice/InvoiceTotals.vue.js +86 -0
- package/components/Invoice/InvoiceTotals.vue2.js +4 -0
- package/components/Invoice/InvoiceVariant1.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant1.vue.js +194 -207
- package/components/Invoice/InvoiceVariant2.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant2.vue.js +109 -118
- package/components/Invoice/InvoiceVariant3.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant3.vue.js +157 -167
- package/components/Invoice/InvoiceVariant4.vue.d.ts +3 -1
- package/components/Invoice/InvoiceVariant4.vue.js +192 -202
- package/components/Invoice/index.d.ts +1 -0
- package/components/Invoice/types.d.ts +22 -0
- package/components/Masonry/Masonry.vue.d.ts +1 -1
- package/components/Modal.vue.js +1 -1
- package/components/Modal.vue2.js +60 -54
- package/components/MultiSelect/MultiSelect.vue.js +47 -46
- package/components/MultiSelect/composables/useMultiSelectHydration.d.ts +2 -0
- package/components/NavbarCommandPalette.vue.js +1 -1
- package/components/NumberInput.vue.js +2 -2
- package/components/NumberInput.vue2.js +121 -116
- package/components/PricingPlan/PricingPlan.vue.d.ts +1 -1
- package/components/SidePanel.vue.js +2 -2
- package/components/SidePanel.vue2.js +58 -52
- package/components/Stats/StatItem.vue.js +96 -91
- package/components/Stats/types.d.ts +1 -0
- package/components/Switch.vue.d.ts +6 -1
- package/components/Switch.vue.js +61 -24
- package/components/TagInput/TagInput.vue.d.ts +187 -0
- package/components/TagInput/TagInput.vue.js +113 -0
- package/components/TagInput/TagInput.vue2.js +4 -0
- package/components/TagInput/index.d.ts +1 -0
- package/components/Textarea.vue.js +19 -18
- package/components/ThumbnailSelector/ThumbnailSelector.vue.js +2 -2
- package/components/ThumbnailSelector/ThumbnailSelector.vue2.js +19 -16
- package/core/config.d.ts +36 -0
- package/index.d.ts +2 -0
- package/index.js +130 -124
- package/package.json +1 -1
- package/style.css +616 -1
- package/types/button.d.ts +1 -1
- package/types/styles.d.ts +1 -0
- package/utils/functions.js +9 -9
package/components/Input.vue.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import { defineComponent as Y, computed as
|
|
1
|
+
import { defineComponent as Y, computed as d, useSlots as Z, ref as v, onMounted as _, nextTick as B, openBlock as r, createElementBlock as s, normalizeClass as u, createBlock as j, withCtx as ee, createTextVNode as R, toDisplayString as w, createCommentVNode as i, createElementVNode as A, renderSlot as M, createVNode as C } from "vue";
|
|
2
2
|
import g from "./Icon.vue.js";
|
|
3
3
|
import te from "./Label.vue.js";
|
|
4
4
|
import le from "./Textarea.vue.js";
|
|
5
5
|
import { $t as E } from "../utils/i18n.js";
|
|
6
|
-
const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly", "min", "max"], ae = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 z-20" }, fe = /* @__PURE__ */ Y({
|
|
6
|
+
const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly", "min", "max", "data-testid"], ae = { class: "absolute right-3 top-1/2 -translate-y-1/2 flex items-center justify-center gap-2 z-20" }, fe = /* @__PURE__ */ Y({
|
|
7
7
|
__name: "Input",
|
|
8
8
|
props: {
|
|
9
9
|
modelValue: { default: "" },
|
|
@@ -39,16 +39,16 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
|
|
|
39
39
|
},
|
|
40
40
|
emits: ["update:modelValue", "focus", "blur", "change", "click:icon", "click:icon-right"],
|
|
41
41
|
setup(t, { emit: D }) {
|
|
42
|
-
const e = t, c = D,
|
|
42
|
+
const e = t, c = D, a = d(() => e.labelI18n ? E(e.labelI18n) : e.label), S = d(
|
|
43
43
|
() => e.placeholderI18n ? E(e.placeholderI18n) : e.placeholder
|
|
44
|
-
),
|
|
44
|
+
), y = Z(), m = v(null), x = v(!1), h = v(!1), H = d(() => e.type === "password" && x.value ? "text" : e.type), k = d(() => e.modelValue !== "" && e.modelValue !== null && e.modelValue !== void 0), $ = d(() => b.value || k.value || h.value), p = d(() => !!e.addonLeft || !!y["addon-left"]), V = d(() => !!e.addonRight || !!y["addon-right"]), U = d(() => [
|
|
45
45
|
"relative w-full",
|
|
46
46
|
e.class,
|
|
47
47
|
e.labelPosition === "left" ? "flex items-center gap-4" : "",
|
|
48
48
|
e.labelPosition === "right" ? "flex flex-row-reverse items-center gap-4" : "space-y-2"
|
|
49
|
-
].join(" ")), W =
|
|
49
|
+
].join(" ")), W = d(() => ["relative flex w-full items-stretch", e.labelPosition !== "top" ? "flex-1" : ""].join(
|
|
50
50
|
" "
|
|
51
|
-
)),
|
|
51
|
+
)), L = d(() => {
|
|
52
52
|
const l = "block w-full bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground/70 disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none relative focus:z-10", n = {
|
|
53
53
|
solid: "bg-muted border-transparent focus-visible:border-black",
|
|
54
54
|
outline: "border border-input focus-visible:border-black",
|
|
@@ -69,7 +69,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
|
|
|
69
69
|
"2xl": "rounded-2xl",
|
|
70
70
|
full: "rounded-full"
|
|
71
71
|
}[e.rounded];
|
|
72
|
-
p.value && (e.rounded === "md" ? o = "rounded-r-md rounded-l-none" : e.rounded === "sm" ? o = "rounded-r-sm rounded-l-none" : e.rounded === "lg" ? o = "rounded-r-lg rounded-l-none" : e.rounded === "full" ? o = "rounded-r-full rounded-l-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-r-").replace("rounded-l-", ""))),
|
|
72
|
+
p.value && (e.rounded === "md" ? o = "rounded-r-md rounded-l-none" : e.rounded === "sm" ? o = "rounded-r-sm rounded-l-none" : e.rounded === "lg" ? o = "rounded-r-lg rounded-l-none" : e.rounded === "full" ? o = "rounded-r-full rounded-l-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-r-").replace("rounded-l-", ""))), V.value && (p.value ? o = "rounded-none" : e.rounded === "md" ? o = "rounded-l-md rounded-r-none" : e.rounded === "sm" ? o = "rounded-l-sm rounded-r-none" : e.rounded === "lg" ? o = "rounded-l-lg rounded-r-none" : e.rounded === "full" ? o = "rounded-l-full rounded-r-none" : e.rounded !== "none" && (o = o.replace("rounded-", "rounded-l-").replace("rounded-r-", ""))), e.variant === "outline-b" && (o = "rounded-none");
|
|
73
73
|
const T = e.variant === "outline-b" || e.variant === "transparent";
|
|
74
74
|
return e.variant, [
|
|
75
75
|
l,
|
|
@@ -78,12 +78,12 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
|
|
|
78
78
|
o,
|
|
79
79
|
e.error ? "border-destructive focus-visible:ring-destructive" : "",
|
|
80
80
|
e.icon ? "pl-9" : T && !p.value ? "pl-0" : "",
|
|
81
|
-
e.showClearButton &&
|
|
81
|
+
e.showClearButton && k.value || e.type === "password" || e.loading || e.iconRight ? "pr-9" : T && !V.value ? "pr-0" : "",
|
|
82
82
|
// Keyframe name used to detect browser autofill via animationstart event
|
|
83
83
|
e.variant === "floating" ? "autofill-detect" : "",
|
|
84
84
|
e.inputClass
|
|
85
85
|
].join(" ");
|
|
86
|
-
}),
|
|
86
|
+
}), I = {
|
|
87
87
|
sm: "text-xs",
|
|
88
88
|
md: "text-sm",
|
|
89
89
|
lg: "text-base"
|
|
@@ -96,8 +96,8 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
|
|
|
96
96
|
n ? "-mr-px" : "-ml-px",
|
|
97
97
|
"z-10"
|
|
98
98
|
].join(" ");
|
|
99
|
-
}, q =
|
|
100
|
-
const l = !!
|
|
99
|
+
}, q = d(() => {
|
|
100
|
+
const l = !!y["addon-left"];
|
|
101
101
|
return [
|
|
102
102
|
"flex items-center justify-center whitespace-nowrap",
|
|
103
103
|
l ? `border-none ${P("left")}` : `bg-muted border border-input border-r-0! px-3 text-muted-foreground ${{
|
|
@@ -109,12 +109,12 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
|
|
|
109
109
|
xl: "rounded-l-xl",
|
|
110
110
|
"2xl": "rounded-l-2xl"
|
|
111
111
|
}[e.rounded] || "rounded-l-md"}`,
|
|
112
|
-
l ? "" :
|
|
112
|
+
l ? "" : I[e.size],
|
|
113
113
|
e.addonLeftClass,
|
|
114
114
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
115
115
|
].join(" ");
|
|
116
|
-
}), G =
|
|
117
|
-
const l = !!
|
|
116
|
+
}), G = d(() => {
|
|
117
|
+
const l = !!y["addon-right"];
|
|
118
118
|
return [
|
|
119
119
|
"flex items-center justify-center whitespace-nowrap",
|
|
120
120
|
l ? `border-none ${P("right")}` : `bg-muted border border-input border-l-0! px-3 text-muted-foreground ${{
|
|
@@ -126,7 +126,7 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
|
|
|
126
126
|
xl: "rounded-r-xl",
|
|
127
127
|
"2xl": "rounded-r-2xl"
|
|
128
128
|
}[e.rounded] || "rounded-r-md"}`,
|
|
129
|
-
l ? "" :
|
|
129
|
+
l ? "" : I[e.size],
|
|
130
130
|
e.addonRightClass,
|
|
131
131
|
e.disabled ? "opacity-50 cursor-not-allowed" : ""
|
|
132
132
|
].join(" ");
|
|
@@ -137,12 +137,12 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
|
|
|
137
137
|
const n = l.target;
|
|
138
138
|
c("change", n.value);
|
|
139
139
|
}, O = () => {
|
|
140
|
-
e.disabled || e.readonly || (
|
|
140
|
+
e.disabled || e.readonly || (x.value = !x.value);
|
|
141
141
|
}, Q = () => {
|
|
142
|
-
e.disabled || e.readonly || (c("update:modelValue", ""),
|
|
142
|
+
e.disabled || e.readonly || (c("update:modelValue", ""), B(() => {
|
|
143
143
|
m.value?.focus();
|
|
144
144
|
}));
|
|
145
|
-
}, b = v(!1),
|
|
145
|
+
}, b = v(!1), z = v(!1), F = (l) => {
|
|
146
146
|
b.value = !0, c("focus", l);
|
|
147
147
|
}, N = (l) => {
|
|
148
148
|
b.value = !1, c("blur", l);
|
|
@@ -150,143 +150,145 @@ const ne = ["for"], oe = ["type", "value", "placeholder", "disabled", "readonly"
|
|
|
150
150
|
l.animationName === "onAutoFillStart" ? h.value = !0 : l.animationName === "onAutoFillCancel" && (h.value = !1);
|
|
151
151
|
};
|
|
152
152
|
return _(() => {
|
|
153
|
-
e.autofocus &&
|
|
153
|
+
e.autofocus && B(() => {
|
|
154
154
|
setTimeout(() => {
|
|
155
155
|
m.value?.focus(), b.value = !0;
|
|
156
156
|
}, 100);
|
|
157
|
-
}),
|
|
157
|
+
}), B(() => {
|
|
158
158
|
m.value && m.value.value && !e.modelValue && (h.value = !0);
|
|
159
159
|
});
|
|
160
|
-
}), (l, n) => (
|
|
161
|
-
class:
|
|
160
|
+
}), (l, n) => (r(), s("div", {
|
|
161
|
+
class: u(U.value)
|
|
162
162
|
}, [
|
|
163
|
-
|
|
163
|
+
a.value && t.variant !== "floating" ? (r(), j(te, {
|
|
164
164
|
key: 0,
|
|
165
|
-
for:
|
|
166
|
-
class:
|
|
165
|
+
for: a.value,
|
|
166
|
+
class: u(["mb-1.5", t.labelPosition !== "top" ? "mb-0" : ""].join(" "))
|
|
167
167
|
}, {
|
|
168
168
|
default: ee(() => [
|
|
169
|
-
|
|
169
|
+
R(w(a.value), 1)
|
|
170
170
|
]),
|
|
171
171
|
_: 1
|
|
172
172
|
}, 8, ["for", "class"])) : i("", !0),
|
|
173
173
|
A("div", {
|
|
174
|
-
class:
|
|
174
|
+
class: u(W.value)
|
|
175
175
|
}, [
|
|
176
|
-
p.value ? (
|
|
176
|
+
p.value ? (r(), s("div", {
|
|
177
177
|
key: 0,
|
|
178
|
-
class:
|
|
178
|
+
class: u(q.value)
|
|
179
179
|
}, [
|
|
180
180
|
M(l.$slots, "addon-left", {}, () => [
|
|
181
|
-
|
|
181
|
+
R(w(t.addonLeft), 1)
|
|
182
182
|
])
|
|
183
183
|
], 2)) : i("", !0),
|
|
184
184
|
A("div", {
|
|
185
185
|
class: "relative w-full",
|
|
186
|
-
onMouseenter: n[2] || (n[2] = (f) =>
|
|
187
|
-
onMouseleave: n[3] || (n[3] = (f) =>
|
|
186
|
+
onMouseenter: n[2] || (n[2] = (f) => z.value = !0),
|
|
187
|
+
onMouseleave: n[3] || (n[3] = (f) => z.value = !1)
|
|
188
188
|
}, [
|
|
189
|
-
|
|
189
|
+
a.value && t.variant === "floating" ? (r(), s("label", {
|
|
190
190
|
key: 0,
|
|
191
|
-
for:
|
|
192
|
-
class:
|
|
191
|
+
for: a.value,
|
|
192
|
+
class: u([
|
|
193
193
|
"absolute transition-all duration-200 ease-in-out pointer-events-none z-20",
|
|
194
|
-
|
|
194
|
+
$.value ? "-top-2.5 left-3 text-xs bg-background px-1 text-black shadow-[0_4px_4px_-4px_bg-background] translate-y-0" : t.type === "textarea" ? `top-2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"} translate-y-0` : `top-1/2 -translate-y-1/2 text-sm text-muted-foreground/70 ${t.icon ? "left-9" : "left-3"}`
|
|
195
195
|
])
|
|
196
|
-
}, w(
|
|
197
|
-
t.type === "textarea" ? (
|
|
196
|
+
}, w(a.value), 11, ne)) : i("", !0),
|
|
197
|
+
t.type === "textarea" ? (r(), j(le, {
|
|
198
198
|
key: 1,
|
|
199
199
|
"model-value": String(t.modelValue),
|
|
200
|
-
placeholder: t.variant === "floating" &&
|
|
200
|
+
placeholder: t.variant === "floating" && a.value && !$.value ? "" : S.value,
|
|
201
201
|
disabled: t.disabled,
|
|
202
202
|
readonly: t.readonly,
|
|
203
203
|
rows: t.rows,
|
|
204
|
-
class:
|
|
204
|
+
class: u(L.value),
|
|
205
205
|
"onUpdate:modelValue": n[0] || (n[0] = (f) => c("update:modelValue", f)),
|
|
206
206
|
onBlur: N,
|
|
207
|
-
onFocus: F
|
|
208
|
-
|
|
207
|
+
onFocus: F,
|
|
208
|
+
"data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `input-${l.$attrs.name}` : a.value ? `input-${a.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "textarea")
|
|
209
|
+
}, null, 8, ["model-value", "placeholder", "disabled", "readonly", "rows", "class", "data-testid"])) : (r(), s("input", {
|
|
209
210
|
key: 2,
|
|
210
211
|
ref_key: "inputRef",
|
|
211
212
|
ref: m,
|
|
212
213
|
type: H.value,
|
|
213
214
|
value: t.modelValue,
|
|
214
|
-
placeholder: t.variant === "floating" &&
|
|
215
|
+
placeholder: t.variant === "floating" && a.value && !$.value ? "" : S.value,
|
|
215
216
|
disabled: t.disabled,
|
|
216
217
|
readonly: t.readonly,
|
|
217
218
|
min: t.min,
|
|
218
219
|
max: t.max,
|
|
219
|
-
class:
|
|
220
|
+
class: u(L.value),
|
|
220
221
|
onInput: J,
|
|
221
222
|
onChange: K,
|
|
222
223
|
onBlur: N,
|
|
223
224
|
onFocus: F,
|
|
224
|
-
onAnimationstart: X
|
|
225
|
+
onAnimationstart: X,
|
|
226
|
+
"data-testid": l.$attrs["data-testid"] || (l.$attrs.name ? `input-${l.$attrs.name}` : a.value ? `input-${a.value.toString().toLowerCase().replace(/[^a-z0-9]+/g, "-")}` : "input")
|
|
225
227
|
}, null, 42, oe)),
|
|
226
|
-
t.icon ? (
|
|
228
|
+
t.icon ? (r(), s("div", {
|
|
227
229
|
key: 3,
|
|
228
230
|
tabindex: "-1",
|
|
229
|
-
class:
|
|
231
|
+
class: u([
|
|
230
232
|
"absolute left-3 top-1/2 -translate-y-1/2 flex items-center justify-center text-muted-foreground z-20 pointer-events-none",
|
|
231
233
|
t.disabled ? "opacity-50" : ""
|
|
232
234
|
])
|
|
233
235
|
}, [
|
|
234
|
-
|
|
236
|
+
C(g, {
|
|
235
237
|
icon: t.icon,
|
|
236
|
-
class:
|
|
238
|
+
class: u(["h-4 w-4", t.iconClass])
|
|
237
239
|
}, null, 8, ["icon", "class"])
|
|
238
240
|
], 2)) : i("", !0),
|
|
239
241
|
A("div", ae, [
|
|
240
|
-
t.loading ? (
|
|
242
|
+
t.loading ? (r(), j(g, {
|
|
241
243
|
key: 0,
|
|
242
244
|
icon: "lucide:loader-2",
|
|
243
245
|
class: "h-4 w-4 animate-spin text-muted-foreground"
|
|
244
|
-
})) : t.iconRight ? (
|
|
246
|
+
})) : t.iconRight ? (r(), s("div", {
|
|
245
247
|
key: 1,
|
|
246
248
|
tabindex: "-1",
|
|
247
|
-
class:
|
|
249
|
+
class: u([
|
|
248
250
|
"flex items-center justify-center text-muted-foreground",
|
|
249
251
|
t.disabled ? "opacity-50 cursor-not-allowed" : "cursor-pointer hover:text-foreground"
|
|
250
252
|
]),
|
|
251
253
|
onClick: n[1] || (n[1] = (f) => !t.disabled && !t.readonly && c("click:icon-right", f))
|
|
252
254
|
}, [
|
|
253
|
-
|
|
255
|
+
C(g, {
|
|
254
256
|
icon: t.iconRight,
|
|
255
|
-
class:
|
|
257
|
+
class: u(["h-4 w-4", t.iconRightClass])
|
|
256
258
|
}, null, 8, ["icon", "class"])
|
|
257
259
|
], 2)) : i("", !0),
|
|
258
|
-
t.type === "password" && !t.disabled && !t.readonly ? (
|
|
260
|
+
t.type === "password" && !t.disabled && !t.readonly ? (r(), s("button", {
|
|
259
261
|
key: 2,
|
|
260
262
|
type: "button",
|
|
261
263
|
tabindex: "-1",
|
|
262
264
|
class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none",
|
|
263
265
|
onClick: O
|
|
264
266
|
}, [
|
|
265
|
-
|
|
266
|
-
icon:
|
|
267
|
+
C(g, {
|
|
268
|
+
icon: x.value ? "lucide:eye-off" : "lucide:eye",
|
|
267
269
|
class: "h-4 w-4"
|
|
268
270
|
}, null, 8, ["icon"])
|
|
269
271
|
])) : i("", !0),
|
|
270
|
-
t.showClearButton &&
|
|
272
|
+
t.showClearButton && k.value && !t.disabled && !t.readonly && !t.loading && t.type !== "textarea" && t.type !== "password" && (b.value || z.value) ? (r(), s("button", {
|
|
271
273
|
key: 3,
|
|
272
274
|
type: "button",
|
|
273
275
|
tabindex: "-1",
|
|
274
276
|
class: "flex items-center justify-center text-muted-foreground hover:text-foreground focus:outline-none transition-opacity duration-200",
|
|
275
277
|
onClick: Q
|
|
276
278
|
}, [
|
|
277
|
-
|
|
279
|
+
C(g, {
|
|
278
280
|
icon: "lucide:x-circle",
|
|
279
281
|
class: "h-4 w-4"
|
|
280
282
|
})
|
|
281
283
|
])) : i("", !0)
|
|
282
284
|
])
|
|
283
285
|
], 32),
|
|
284
|
-
|
|
286
|
+
V.value ? (r(), s("div", {
|
|
285
287
|
key: 1,
|
|
286
|
-
class:
|
|
288
|
+
class: u(G.value)
|
|
287
289
|
}, [
|
|
288
290
|
M(l.$slots, "addon-right", {}, () => [
|
|
289
|
-
|
|
291
|
+
R(w(t.addonRight), 1)
|
|
290
292
|
])
|
|
291
293
|
], 2)) : i("", !0)
|
|
292
294
|
], 2)
|
|
@@ -1,19 +1,20 @@
|
|
|
1
|
-
import { defineComponent as
|
|
1
|
+
import { defineComponent as i, computed as e, openBlock as s, createBlock as p, resolveDynamicComponent as m } from "vue";
|
|
2
2
|
import { getComponentConfig as u } from "../../utils/configUtils.js";
|
|
3
3
|
import d from "./InvoiceVariant1.vue.js";
|
|
4
4
|
import f from "./InvoiceVariant2.vue.js";
|
|
5
5
|
import v from "./InvoiceVariant3.vue.js";
|
|
6
6
|
import _ from "./InvoiceVariant4.vue.js";
|
|
7
|
-
const k = /* @__PURE__ */
|
|
7
|
+
const k = /* @__PURE__ */ i({
|
|
8
8
|
__name: "Invoice",
|
|
9
9
|
props: {
|
|
10
10
|
data: {},
|
|
11
11
|
variant: {},
|
|
12
12
|
compact: { type: Boolean },
|
|
13
|
-
displayBarcodeValue: { type: Boolean }
|
|
13
|
+
displayBarcodeValue: { type: Boolean },
|
|
14
|
+
labels: {}
|
|
14
15
|
},
|
|
15
16
|
setup(r) {
|
|
16
|
-
const a = r, o = u("invoice") || {}, t = e(() => a.variant ?? o.variant ?? "Variant1"), n = e(() => a.compact ?? o.compact ?? !1), c = e(() => a.displayBarcodeValue ?? o.displayBarcodeValue ?? !1),
|
|
17
|
+
const a = r, o = u("invoice") || {}, t = e(() => a.variant ?? o.variant ?? "Variant1"), n = e(() => a.compact ?? o.compact ?? !1), c = e(() => a.displayBarcodeValue ?? o.displayBarcodeValue ?? !1), l = e(() => {
|
|
17
18
|
switch (t.value) {
|
|
18
19
|
case "Variant2":
|
|
19
20
|
return f;
|
|
@@ -25,12 +26,13 @@ const k = /* @__PURE__ */ l({
|
|
|
25
26
|
return d;
|
|
26
27
|
}
|
|
27
28
|
});
|
|
28
|
-
return (V, y) => (
|
|
29
|
+
return (V, y) => (s(), p(m(l.value), {
|
|
29
30
|
data: a.data,
|
|
30
31
|
variant: t.value,
|
|
31
32
|
compact: n.value,
|
|
32
|
-
"display-barcode-value": c.value
|
|
33
|
-
|
|
33
|
+
"display-barcode-value": c.value,
|
|
34
|
+
labels: a.labels
|
|
35
|
+
}, null, 8, ["data", "variant", "compact", "display-barcode-value", "labels"]));
|
|
34
36
|
}
|
|
35
37
|
});
|
|
36
38
|
export {
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { InvoiceTotal, InvoiceVariant } from './types';
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
totals: InvoiceTotal[];
|
|
4
|
+
compact?: boolean;
|
|
5
|
+
variant?: InvoiceVariant | 'default';
|
|
6
|
+
/** Optional custom class to override the container wrapper styles */
|
|
7
|
+
containerClass?: string | any[] | Record<string, boolean>;
|
|
8
|
+
};
|
|
9
|
+
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
|
+
variant: InvoiceVariant | "default";
|
|
11
|
+
compact: boolean;
|
|
12
|
+
containerClass: string | any[] | Record<string, boolean>;
|
|
13
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, HTMLDivElement>;
|
|
14
|
+
export default _default;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
import { defineComponent as m, computed as p, openBlock as r, createElementBlock as n, normalizeClass as s, Fragment as d, renderList as x, createElementVNode as f, toDisplayString as b, createVNode as y, unref as g } from "vue";
|
|
2
|
+
import v from "../Price/Price.vue.js";
|
|
3
|
+
const _ = /* @__PURE__ */ m({
|
|
4
|
+
__name: "InvoiceTotals",
|
|
5
|
+
props: {
|
|
6
|
+
totals: {},
|
|
7
|
+
compact: { type: Boolean, default: !1 },
|
|
8
|
+
variant: { default: "default" },
|
|
9
|
+
containerClass: { default: void 0 }
|
|
10
|
+
},
|
|
11
|
+
setup(o) {
|
|
12
|
+
const t = o, c = p(() => {
|
|
13
|
+
if (t.containerClass !== void 0) return t.containerClass;
|
|
14
|
+
switch (t.variant) {
|
|
15
|
+
case "Variant1":
|
|
16
|
+
return t.compact ? "space-y-1.5" : "space-y-2";
|
|
17
|
+
case "Variant2":
|
|
18
|
+
return t.compact ? "px-4 py-2.5 space-y-1" : "px-5 py-3 space-y-1.5";
|
|
19
|
+
case "Variant3":
|
|
20
|
+
return t.compact ? "w-full max-w-[200px] space-y-1 text-xs" : "w-full max-w-[240px] space-y-1.5 text-xs";
|
|
21
|
+
case "Variant4":
|
|
22
|
+
return [
|
|
23
|
+
"border border-border rounded-lg",
|
|
24
|
+
t.compact ? "p-4 space-y-2" : "p-5 space-y-2.5"
|
|
25
|
+
];
|
|
26
|
+
default:
|
|
27
|
+
return t.compact ? "space-y-1.5" : "space-y-2";
|
|
28
|
+
}
|
|
29
|
+
}), i = (e) => {
|
|
30
|
+
if (e.isGrandTotal)
|
|
31
|
+
switch (t.variant) {
|
|
32
|
+
case "Variant1":
|
|
33
|
+
default:
|
|
34
|
+
return [
|
|
35
|
+
"border-t border-border font-black text-foreground",
|
|
36
|
+
t.compact ? "pt-2 mt-1 text-base" : "pt-3 mt-2 text-lg"
|
|
37
|
+
];
|
|
38
|
+
case "Variant2":
|
|
39
|
+
return [
|
|
40
|
+
"border-t border-border font-bold text-foreground",
|
|
41
|
+
t.compact ? "mt-1.5 pt-1.5 text-sm" : "mt-2 pt-2 text-base"
|
|
42
|
+
];
|
|
43
|
+
case "Variant3":
|
|
44
|
+
return [
|
|
45
|
+
"border-t border-gray-300 font-bold text-gray-900",
|
|
46
|
+
t.compact ? "pt-1.5 mt-1.5 text-sm" : "pt-2 mt-2 text-sm"
|
|
47
|
+
];
|
|
48
|
+
case "Variant4":
|
|
49
|
+
return [
|
|
50
|
+
"border-t border-gray-300 font-black text-gray-900",
|
|
51
|
+
t.compact ? "pt-2.5 mt-1 text-base" : "pt-3 mt-1.5 text-lg"
|
|
52
|
+
];
|
|
53
|
+
}
|
|
54
|
+
else
|
|
55
|
+
switch (t.variant) {
|
|
56
|
+
case "Variant1":
|
|
57
|
+
default:
|
|
58
|
+
return ["text-muted-foreground font-medium", t.compact ? "text-xs" : "text-sm"];
|
|
59
|
+
case "Variant2":
|
|
60
|
+
return ["font-medium text-muted-foreground", t.compact ? "text-xs" : "text-sm"];
|
|
61
|
+
case "Variant3":
|
|
62
|
+
return ["text-muted-foreground font-medium"];
|
|
63
|
+
case "Variant4":
|
|
64
|
+
return ["font-semibold text-muted-foreground", t.compact ? "text-xs" : "text-sm"];
|
|
65
|
+
}
|
|
66
|
+
}, l = (e) => e.isGrandTotal && (t.variant === "Variant1" || t.variant === "Variant4" || t.variant === "default") ? "uppercase tracking-widest text-xs" : "";
|
|
67
|
+
return (e, V) => (r(), n("div", {
|
|
68
|
+
class: s(["vl-invoice-totals", c.value])
|
|
69
|
+
}, [
|
|
70
|
+
(r(!0), n(d, null, x(o.totals, (a, u) => (r(), n("div", {
|
|
71
|
+
key: u,
|
|
72
|
+
class: s(["flex justify-between items-center", i(a)])
|
|
73
|
+
}, [
|
|
74
|
+
f("span", {
|
|
75
|
+
class: s(l(a))
|
|
76
|
+
}, b(a.label), 3),
|
|
77
|
+
y(g(v), {
|
|
78
|
+
value: a.value
|
|
79
|
+
}, null, 8, ["value"])
|
|
80
|
+
], 2))), 128))
|
|
81
|
+
], 2));
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
export {
|
|
85
|
+
_ as default
|
|
86
|
+
};
|
|
@@ -1,10 +1,12 @@
|
|
|
1
|
-
import { InvoiceData } from './types';
|
|
1
|
+
import { InvoiceData, InvoiceLabels } from './types';
|
|
2
2
|
type __VLS_Props = {
|
|
3
3
|
data: InvoiceData;
|
|
4
4
|
/** Reduces padding, spacing, and font sizes for print-friendly output */
|
|
5
5
|
compact?: boolean;
|
|
6
6
|
/** Toggles the display of the barcode text value underneath the bars */
|
|
7
7
|
displayBarcodeValue?: boolean;
|
|
8
|
+
/** Custom text labels for static UI strings */
|
|
9
|
+
labels?: InvoiceLabels;
|
|
8
10
|
};
|
|
9
11
|
declare const _default: import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
10
12
|
compact: boolean;
|