finso-vue-components 0.4.10 → 0.4.12
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/dist/components/FDatePicker/FDatePicker.vue.d.ts +31 -0
- package/dist/components/FDatePicker/index.d.ts +2 -0
- package/dist/components/FTimePicker/FTimePicker.vue.d.ts +27 -0
- package/dist/components/FTimePicker/index.d.ts +2 -0
- package/dist/finso-vue-components.css +1 -1
- package/dist/finso-vue-components.js +427 -224
- package/dist/finso-vue-components.umd.cjs +1 -1
- package/dist/index.d.ts +8 -0
- package/package.json +1 -1
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { type GenericValidateFunction } from 'vee-validate';
|
|
2
|
+
export interface FDatePickerProps {
|
|
3
|
+
name: string;
|
|
4
|
+
rounded?: string;
|
|
5
|
+
variant?: 'outlined' | 'plain' | 'underlined' | 'filled' | 'solo' | 'solo-inverted' | 'solo-filled';
|
|
6
|
+
density?: 'default' | 'comfortable' | 'compact';
|
|
7
|
+
color?: string;
|
|
8
|
+
hideDetails?: boolean | 'auto';
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
modelValue?: string;
|
|
11
|
+
rules?: string | GenericValidateFunction<string>;
|
|
12
|
+
max?: unknown;
|
|
13
|
+
locale?: string;
|
|
14
|
+
firstDayOfWeek?: number;
|
|
15
|
+
dateFormat?: string;
|
|
16
|
+
}
|
|
17
|
+
declare const _default: import("vue").DefineComponent<FDatePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FDatePickerProps> & Readonly<{}>, {
|
|
18
|
+
color: string;
|
|
19
|
+
rounded: string;
|
|
20
|
+
density: "default" | "comfortable" | "compact";
|
|
21
|
+
variant: "outlined" | "plain" | "underlined" | "filled" | "solo" | "solo-inverted" | "solo-filled";
|
|
22
|
+
disabled: boolean;
|
|
23
|
+
hideDetails: boolean | "auto";
|
|
24
|
+
modelValue: string;
|
|
25
|
+
rules: string | GenericValidateFunction<string>;
|
|
26
|
+
max: undefined;
|
|
27
|
+
locale: string;
|
|
28
|
+
firstDayOfWeek: number;
|
|
29
|
+
dateFormat: string;
|
|
30
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
31
|
+
export default _default;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type GenericValidateFunction } from 'vee-validate';
|
|
2
|
+
export interface FTimePickerProps {
|
|
3
|
+
name: string;
|
|
4
|
+
rounded?: string;
|
|
5
|
+
variant?: 'outlined' | 'plain' | 'underlined' | 'filled' | 'solo' | 'solo-inverted' | 'solo-filled';
|
|
6
|
+
density?: 'default' | 'comfortable' | 'compact';
|
|
7
|
+
color?: string;
|
|
8
|
+
hideDetails?: boolean | 'auto';
|
|
9
|
+
readonly?: boolean;
|
|
10
|
+
modelValue?: string;
|
|
11
|
+
rules?: string | GenericValidateFunction<string>;
|
|
12
|
+
labelCancel?: string;
|
|
13
|
+
labelConfirm?: string;
|
|
14
|
+
}
|
|
15
|
+
declare const _default: import("vue").DefineComponent<FTimePickerProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FTimePickerProps> & Readonly<{}>, {
|
|
16
|
+
color: string;
|
|
17
|
+
rounded: string;
|
|
18
|
+
density: "default" | "comfortable" | "compact";
|
|
19
|
+
variant: "outlined" | "plain" | "underlined" | "filled" | "solo" | "solo-inverted" | "solo-filled";
|
|
20
|
+
readonly: boolean;
|
|
21
|
+
hideDetails: boolean | "auto";
|
|
22
|
+
modelValue: string;
|
|
23
|
+
rules: string | GenericValidateFunction<string>;
|
|
24
|
+
labelCancel: string;
|
|
25
|
+
labelConfirm: string;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
export default _default;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.f-data-table__logo[data-v-
|
|
1
|
+
.f-data-table__logo[data-v-ee2b82fa]{object-fit:contain}.f-data-table__actions[data-v-ee2b82fa]{display:flex;gap:4px;align-items:center;min-width:80px}[data-v-bd1f1133] .v-time-picker{min-height:540px}[data-v-6f068869] .v-picker-title{display:none}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { defineComponent as
|
|
2
|
-
import { VTextField as
|
|
3
|
-
import { vMaska as
|
|
4
|
-
import { useField as
|
|
5
|
-
const
|
|
1
|
+
import { defineComponent as x, resolveComponent as p, openBlock as v, createBlock as V, computed as $, withDirectives as re, unref as y, mergeProps as B, isRef as R, createSlots as E, renderList as j, withCtx as g, renderSlot as P, normalizeProps as Y, guardReactiveProps as H, useModel as U, ref as T, createElementBlock as I, resolveDynamicComponent as se, toHandlers as de, createVNode as _, toDisplayString as S, createTextVNode as G, createCommentVNode as O, createElementVNode as X, withModifiers as K, mergeModels as z, watch as ie, onMounted as ue } from "vue";
|
|
2
|
+
import { VTextField as Q, VTextarea as ce, VAutocomplete as me, VCheckbox as fe, VSelect as pe, VNumberInput as ve, VSwitch as ye } from "vuetify/components";
|
|
3
|
+
import { vMaska as ge } from "maska/vue";
|
|
4
|
+
import { useField as N } from "vee-validate";
|
|
5
|
+
const be = /* @__PURE__ */ x({
|
|
6
6
|
__name: "FButton",
|
|
7
7
|
props: {
|
|
8
8
|
color: { default: "primary" },
|
|
@@ -10,15 +10,15 @@ const ve = /* @__PURE__ */ _({
|
|
|
10
10
|
},
|
|
11
11
|
setup(t) {
|
|
12
12
|
const e = t;
|
|
13
|
-
return (
|
|
14
|
-
const
|
|
15
|
-
return
|
|
13
|
+
return (o, a) => {
|
|
14
|
+
const n = p("v-btn");
|
|
15
|
+
return v(), V(n, {
|
|
16
16
|
color: e.color,
|
|
17
17
|
rounded: e.rounded
|
|
18
18
|
}, null, 8, ["color", "rounded"]);
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
}),
|
|
21
|
+
}), he = /* @__PURE__ */ x({
|
|
22
22
|
name: "FTextField",
|
|
23
23
|
inheritAttrs: !1,
|
|
24
24
|
__name: "FTextField",
|
|
@@ -37,13 +37,13 @@ const ve = /* @__PURE__ */ _({
|
|
|
37
37
|
},
|
|
38
38
|
emits: ["clickAppendInner"],
|
|
39
39
|
setup(t) {
|
|
40
|
-
const e = t,
|
|
40
|
+
const e = t, o = $(() => e.rules), { errorMessage: a, value: n } = N(() => e.name, o, {
|
|
41
41
|
initialValue: e.modelValue,
|
|
42
42
|
syncVModel: !0
|
|
43
43
|
});
|
|
44
|
-
return (
|
|
45
|
-
modelValue:
|
|
46
|
-
"onUpdate:modelValue":
|
|
44
|
+
return (s, l) => re((v(), V(y(Q), B(s.$attrs, {
|
|
45
|
+
modelValue: y(n),
|
|
46
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => R(n) ? n.value = i : null),
|
|
47
47
|
name: e.name,
|
|
48
48
|
color: e.color,
|
|
49
49
|
density: e.density,
|
|
@@ -51,25 +51,25 @@ const ve = /* @__PURE__ */ _({
|
|
|
51
51
|
variant: e.variant,
|
|
52
52
|
clearable: e.clearable,
|
|
53
53
|
"hide-details": e.hideDetails,
|
|
54
|
-
"error-messages":
|
|
54
|
+
"error-messages": y(a),
|
|
55
55
|
"append-inner-icon": e.appendInnerIcon,
|
|
56
|
-
"onClick:appendInner":
|
|
57
|
-
}),
|
|
58
|
-
|
|
56
|
+
"onClick:appendInner": l[1] || (l[1] = (i) => s.$emit("clickAppendInner"))
|
|
57
|
+
}), E({ _: 2 }, [
|
|
58
|
+
j(s.$slots, (i, m) => ({
|
|
59
59
|
name: m,
|
|
60
|
-
fn:
|
|
61
|
-
|
|
60
|
+
fn: g((u) => [
|
|
61
|
+
P(s.$slots, m, Y(H(u ?? {})))
|
|
62
62
|
])
|
|
63
63
|
}))
|
|
64
64
|
]), 1040, ["modelValue", "name", "color", "density", "rounded", "variant", "clearable", "hide-details", "error-messages", "append-inner-icon"])), [
|
|
65
|
-
[
|
|
65
|
+
[y(ge), e.mask]
|
|
66
66
|
]);
|
|
67
67
|
}
|
|
68
|
-
}),
|
|
68
|
+
}), Ve = { key: 1 }, _e = { key: 4 }, Fe = { class: "f-data-table__actions" }, ke = { class: "text-h6" }, De = /* @__PURE__ */ x({
|
|
69
69
|
name: "FDataTable",
|
|
70
70
|
inheritAttrs: !1,
|
|
71
71
|
__name: "FDataTable",
|
|
72
|
-
props: /* @__PURE__ */
|
|
72
|
+
props: /* @__PURE__ */ z({
|
|
73
73
|
headers: {},
|
|
74
74
|
items: {},
|
|
75
75
|
loading: { type: Boolean, default: !1 },
|
|
@@ -103,49 +103,49 @@ const ve = /* @__PURE__ */ _({
|
|
|
103
103
|
sortBy: { default: () => [] },
|
|
104
104
|
sortByModifiers: {}
|
|
105
105
|
}),
|
|
106
|
-
emits: /* @__PURE__ */
|
|
106
|
+
emits: /* @__PURE__ */ z(["show-record", "delete-record"], ["update:page", "update:itemsPerPage", "update:sortBy"]),
|
|
107
107
|
setup(t, { emit: e }) {
|
|
108
|
-
const
|
|
109
|
-
function u(
|
|
110
|
-
return
|
|
108
|
+
const o = t, a = e, n = U(t, "page"), s = U(t, "itemsPerPage"), l = U(t, "sortBy"), i = T(!1), m = T(null);
|
|
109
|
+
function u(f, h) {
|
|
110
|
+
return h.split(".").reduce((A, L) => A == null ? void 0 : A[L], f);
|
|
111
111
|
}
|
|
112
|
-
function
|
|
113
|
-
return
|
|
112
|
+
function d(f) {
|
|
113
|
+
return f == null ? "" : new Intl.NumberFormat(o.moneyLocale, {
|
|
114
114
|
style: "currency",
|
|
115
|
-
currency:
|
|
116
|
-
}).format(
|
|
115
|
+
currency: o.moneyCurrency
|
|
116
|
+
}).format(f);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
if (!
|
|
120
|
-
const
|
|
121
|
-
return
|
|
118
|
+
function r(f) {
|
|
119
|
+
if (!f) return "";
|
|
120
|
+
const h = f.replace(/\D/g, "");
|
|
121
|
+
return h.length < 10 ? f : `(${h.substring(0, 3)}) ${h.substring(3, 6)} ${h.substring(6, 10)}`;
|
|
122
122
|
}
|
|
123
|
-
const
|
|
124
|
-
const
|
|
125
|
-
return Math.min(
|
|
126
|
-
}),
|
|
127
|
-
"click:row": (
|
|
128
|
-
a("show-record",
|
|
123
|
+
const C = $(() => {
|
|
124
|
+
const A = o.items.length === 0 ? 108 : o.items.length * 52 + 56;
|
|
125
|
+
return Math.min(A, o.maxHeight);
|
|
126
|
+
}), b = $(() => !o.canEditRecord && !o.canReadRecord ? {} : {
|
|
127
|
+
"click:row": (f, { item: h }) => {
|
|
128
|
+
a("show-record", h);
|
|
129
129
|
}
|
|
130
|
-
}),
|
|
131
|
-
() =>
|
|
132
|
-
),
|
|
133
|
-
function
|
|
134
|
-
|
|
130
|
+
}), k = $(
|
|
131
|
+
() => o.headers.filter((f) => f.type && f.key !== "actions")
|
|
132
|
+
), F = $(() => o.headers.some((f) => f.key === "actions"));
|
|
133
|
+
function w(f) {
|
|
134
|
+
o.showDeleteConfirm ? (m.value = f, i.value = !0) : a("delete-record", f);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
a("delete-record", m.value),
|
|
136
|
+
function M() {
|
|
137
|
+
a("delete-record", m.value), i.value = !1, m.value = null;
|
|
138
138
|
}
|
|
139
|
-
return (
|
|
140
|
-
const
|
|
141
|
-
return
|
|
142
|
-
(
|
|
143
|
-
page:
|
|
144
|
-
"onUpdate:page":
|
|
145
|
-
"items-per-page":
|
|
146
|
-
"onUpdate:itemsPerPage":
|
|
147
|
-
"sort-by":
|
|
148
|
-
"onUpdate:sortBy":
|
|
139
|
+
return (f, h) => {
|
|
140
|
+
const A = p("v-img"), L = p("v-avatar"), Z = p("v-chip"), ee = p("v-icon"), q = p("v-btn"), te = p("v-card-text"), le = p("v-spacer"), J = p("f-button"), ae = p("v-card-actions"), ne = p("f-dialog");
|
|
141
|
+
return v(), I("div", null, [
|
|
142
|
+
(v(), V(se(t.serverSide ? "v-data-table-server" : "v-data-table"), B(f.$attrs, {
|
|
143
|
+
page: n.value,
|
|
144
|
+
"onUpdate:page": h[0] || (h[0] = (c) => n.value = c),
|
|
145
|
+
"items-per-page": s.value,
|
|
146
|
+
"onUpdate:itemsPerPage": h[1] || (h[1] = (c) => s.value = c),
|
|
147
|
+
"sort-by": l.value,
|
|
148
|
+
"onUpdate:sortBy": h[2] || (h[2] = (c) => l.value = c),
|
|
149
149
|
class: "rounded-b-lg",
|
|
150
150
|
headers: t.headers,
|
|
151
151
|
items: t.items,
|
|
@@ -153,114 +153,114 @@ const ve = /* @__PURE__ */ _({
|
|
|
153
153
|
loading: t.loading,
|
|
154
154
|
hover: t.hover,
|
|
155
155
|
density: t.density,
|
|
156
|
-
height:
|
|
156
|
+
height: C.value,
|
|
157
157
|
"show-select": t.showSelect,
|
|
158
158
|
"items-per-page-text": t.labelItemsPerPage,
|
|
159
159
|
"no-data-text": t.labelNoData
|
|
160
|
-
},
|
|
161
|
-
|
|
162
|
-
name: `item.${
|
|
163
|
-
fn:
|
|
164
|
-
|
|
165
|
-
item:
|
|
166
|
-
value: u(
|
|
160
|
+
}, de(b.value)), E({ _: 2 }, [
|
|
161
|
+
j(k.value, (c) => ({
|
|
162
|
+
name: `item.${c.key}`,
|
|
163
|
+
fn: g(({ item: D }) => [
|
|
164
|
+
P(f.$slots, `item.${c.key}`, {
|
|
165
|
+
item: D,
|
|
166
|
+
value: u(D, c.key)
|
|
167
167
|
}, () => [
|
|
168
|
-
|
|
168
|
+
c.type === "image" ? (v(), V(L, {
|
|
169
169
|
key: 0,
|
|
170
170
|
rounded: "lg",
|
|
171
171
|
variant: "elevated",
|
|
172
172
|
color: "white"
|
|
173
173
|
}, {
|
|
174
|
-
default:
|
|
175
|
-
|
|
176
|
-
src: u(
|
|
174
|
+
default: g(() => [
|
|
175
|
+
_(A, {
|
|
176
|
+
src: u(D, c.key),
|
|
177
177
|
class: "f-data-table__logo"
|
|
178
178
|
}, null, 8, ["src"])
|
|
179
179
|
]),
|
|
180
180
|
_: 2
|
|
181
|
-
}, 1024)) :
|
|
181
|
+
}, 1024)) : c.type === "money" ? (v(), I("span", Ve, S(d(u(D, c.key))), 1)) : c.type === "status" ? (v(), V(Z, {
|
|
182
182
|
key: 2,
|
|
183
|
-
color: u(
|
|
183
|
+
color: u(D, c.key) ? "green-darken-1" : "red-darken-2",
|
|
184
184
|
size: "small"
|
|
185
185
|
}, {
|
|
186
|
-
default:
|
|
187
|
-
|
|
186
|
+
default: g(() => [
|
|
187
|
+
G(S(u(D, c.key) ? t.labelActive : t.labelPassive), 1)
|
|
188
188
|
]),
|
|
189
189
|
_: 2
|
|
190
|
-
}, 1032, ["color"])) :
|
|
190
|
+
}, 1032, ["color"])) : c.type === "boolean" ? (v(), V(ee, {
|
|
191
191
|
key: 3,
|
|
192
|
-
color: u(
|
|
192
|
+
color: u(D, c.key) ? "green-darken-1" : "red-darken-2"
|
|
193
193
|
}, {
|
|
194
|
-
default:
|
|
195
|
-
|
|
194
|
+
default: g(() => [
|
|
195
|
+
G(S(u(D, c.key) ? "mdi-check" : "mdi-close"), 1)
|
|
196
196
|
]),
|
|
197
197
|
_: 2
|
|
198
|
-
}, 1032, ["color"])) :
|
|
198
|
+
}, 1032, ["color"])) : c.type === "gsmNo" ? (v(), I("span", _e, S(r(u(D, c.key))), 1)) : O("", !0)
|
|
199
199
|
], !0)
|
|
200
200
|
])
|
|
201
201
|
})),
|
|
202
|
-
|
|
202
|
+
F.value ? {
|
|
203
203
|
name: "item.actions",
|
|
204
|
-
fn:
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
t.canEditRecord || t.canReadRecord ? (
|
|
204
|
+
fn: g(({ item: c }) => [
|
|
205
|
+
P(f.$slots, "item.actions", { item: c }, () => [
|
|
206
|
+
X("div", Fe, [
|
|
207
|
+
t.canEditRecord || t.canReadRecord ? (v(), V(q, {
|
|
208
208
|
key: 0,
|
|
209
209
|
color: "primary",
|
|
210
210
|
icon: "mdi-pencil-outline",
|
|
211
211
|
variant: "text",
|
|
212
212
|
size: "small",
|
|
213
|
-
onClick:
|
|
214
|
-
}, null, 8, ["onClick"])) :
|
|
215
|
-
t.canDeleteRecord ? (
|
|
213
|
+
onClick: K((D) => a("show-record", c), ["stop"])
|
|
214
|
+
}, null, 8, ["onClick"])) : O("", !0),
|
|
215
|
+
t.canDeleteRecord ? (v(), V(q, {
|
|
216
216
|
key: 1,
|
|
217
217
|
icon: "mdi-trash-can-outline",
|
|
218
218
|
variant: "text",
|
|
219
219
|
size: "small",
|
|
220
220
|
color: "red-darken-2",
|
|
221
|
-
onClick:
|
|
222
|
-
}, null, 8, ["onClick"])) :
|
|
221
|
+
onClick: K((D) => w(c), ["stop"])
|
|
222
|
+
}, null, 8, ["onClick"])) : O("", !0)
|
|
223
223
|
])
|
|
224
224
|
], !0)
|
|
225
225
|
]),
|
|
226
226
|
key: "0"
|
|
227
227
|
} : void 0,
|
|
228
|
-
|
|
229
|
-
name:
|
|
230
|
-
fn:
|
|
231
|
-
|
|
228
|
+
j(f.$slots, (c, D) => ({
|
|
229
|
+
name: D,
|
|
230
|
+
fn: g((oe) => [
|
|
231
|
+
P(f.$slots, D, Y(H(oe ?? {})), void 0, !0)
|
|
232
232
|
])
|
|
233
233
|
}))
|
|
234
234
|
]), 1040, ["page", "items-per-page", "sort-by", "headers", "items", "items-length", "loading", "hover", "density", "height", "show-select", "items-per-page-text", "no-data-text"])),
|
|
235
|
-
|
|
236
|
-
modelValue:
|
|
237
|
-
"onUpdate:modelValue":
|
|
235
|
+
_(ne, {
|
|
236
|
+
modelValue: i.value,
|
|
237
|
+
"onUpdate:modelValue": h[4] || (h[4] = (c) => i.value = c),
|
|
238
238
|
"max-width": "400",
|
|
239
239
|
"hide-close": !0
|
|
240
240
|
}, {
|
|
241
|
-
header:
|
|
242
|
-
|
|
241
|
+
header: g(() => [
|
|
242
|
+
X("div", ke, S(t.labelDeleteTitle), 1)
|
|
243
243
|
]),
|
|
244
|
-
default:
|
|
245
|
-
|
|
246
|
-
default:
|
|
247
|
-
|
|
244
|
+
default: g(() => [
|
|
245
|
+
_(te, null, {
|
|
246
|
+
default: g(() => [
|
|
247
|
+
G(S(t.deleteMessageFormatter && m.value ? t.deleteMessageFormatter(m.value) : t.labelDeleteMessage), 1)
|
|
248
248
|
]),
|
|
249
249
|
_: 1
|
|
250
250
|
}),
|
|
251
|
-
|
|
252
|
-
default:
|
|
253
|
-
|
|
254
|
-
|
|
251
|
+
_(ae, null, {
|
|
252
|
+
default: g(() => [
|
|
253
|
+
_(le),
|
|
254
|
+
_(J, {
|
|
255
255
|
variant: "plain",
|
|
256
256
|
color: "red-darken-2",
|
|
257
257
|
text: t.labelDeleteCancel,
|
|
258
|
-
onClick:
|
|
258
|
+
onClick: h[3] || (h[3] = (c) => i.value = !1)
|
|
259
259
|
}, null, 8, ["text"]),
|
|
260
|
-
|
|
260
|
+
_(J, {
|
|
261
261
|
variant: "tonal",
|
|
262
262
|
text: t.labelDeleteConfirm,
|
|
263
|
-
onClick:
|
|
263
|
+
onClick: M
|
|
264
264
|
}, null, 8, ["text"])
|
|
265
265
|
]),
|
|
266
266
|
_: 1
|
|
@@ -271,14 +271,14 @@ const ve = /* @__PURE__ */ _({
|
|
|
271
271
|
]);
|
|
272
272
|
};
|
|
273
273
|
}
|
|
274
|
-
}),
|
|
275
|
-
const
|
|
276
|
-
for (const [a,
|
|
277
|
-
|
|
278
|
-
return
|
|
279
|
-
},
|
|
280
|
-
var
|
|
281
|
-
const
|
|
274
|
+
}), W = (t, e) => {
|
|
275
|
+
const o = t.__vccOpts || t;
|
|
276
|
+
for (const [a, n] of e)
|
|
277
|
+
o[a] = n;
|
|
278
|
+
return o;
|
|
279
|
+
}, $e = /* @__PURE__ */ W(De, [["__scopeId", "data-v-ee2b82fa"]]);
|
|
280
|
+
var xe = /* @__PURE__ */ ((t) => (t.IMAGE = "image", t.MONEY = "money", t.STATUS = "status", t.BOOLEAN = "boolean", t.GSM_NO = "gsmNo", t))(xe || {});
|
|
281
|
+
const we = /* @__PURE__ */ x({
|
|
282
282
|
name: "FTextarea",
|
|
283
283
|
inheritAttrs: !1,
|
|
284
284
|
__name: "FTextarea",
|
|
@@ -296,13 +296,13 @@ const Be = /* @__PURE__ */ _({
|
|
|
296
296
|
rules: { type: [String, Function], default: "" }
|
|
297
297
|
},
|
|
298
298
|
setup(t) {
|
|
299
|
-
const e = t,
|
|
299
|
+
const e = t, o = $(() => e.rules), { errorMessage: a, value: n } = N(() => e.name, o, {
|
|
300
300
|
initialValue: e.modelValue,
|
|
301
301
|
syncVModel: !0
|
|
302
302
|
});
|
|
303
|
-
return (
|
|
304
|
-
modelValue:
|
|
305
|
-
"onUpdate:modelValue":
|
|
303
|
+
return (s, l) => (v(), V(y(ce), B(s.$attrs, {
|
|
304
|
+
modelValue: y(n),
|
|
305
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => R(n) ? n.value = i : null),
|
|
306
306
|
name: e.name,
|
|
307
307
|
rounded: e.rounded,
|
|
308
308
|
variant: e.variant,
|
|
@@ -312,10 +312,10 @@ const Be = /* @__PURE__ */ _({
|
|
|
312
312
|
label: e.label,
|
|
313
313
|
"hide-details": e.hideDetails,
|
|
314
314
|
"no-resize": e.noResize,
|
|
315
|
-
"error-messages":
|
|
315
|
+
"error-messages": y(a)
|
|
316
316
|
}), null, 16, ["modelValue", "name", "rounded", "variant", "rows", "density", "color", "label", "hide-details", "no-resize", "error-messages"]));
|
|
317
317
|
}
|
|
318
|
-
}),
|
|
318
|
+
}), Be = /* @__PURE__ */ x({
|
|
319
319
|
name: "FAutocomplete",
|
|
320
320
|
inheritAttrs: !1,
|
|
321
321
|
__name: "FAutocomplete",
|
|
@@ -335,18 +335,18 @@ const Be = /* @__PURE__ */ _({
|
|
|
335
335
|
},
|
|
336
336
|
emits: ["change"],
|
|
337
337
|
setup(t, { emit: e }) {
|
|
338
|
-
const
|
|
338
|
+
const o = e, a = t, n = $(() => a.rules), { errorMessage: s, value: l } = N(() => a.name, n, {
|
|
339
339
|
initialValue: a.modelValue,
|
|
340
340
|
syncVModel: !0
|
|
341
341
|
});
|
|
342
|
-
function
|
|
343
|
-
|
|
342
|
+
function i(m) {
|
|
343
|
+
o("change", m);
|
|
344
344
|
}
|
|
345
|
-
return (m, u) => (
|
|
346
|
-
modelValue:
|
|
345
|
+
return (m, u) => (v(), V(y(me), B(m.$attrs, {
|
|
346
|
+
modelValue: y(l),
|
|
347
347
|
"onUpdate:modelValue": [
|
|
348
|
-
u[0] || (u[0] = (
|
|
349
|
-
u[1] || (u[1] = (
|
|
348
|
+
u[0] || (u[0] = (d) => R(l) ? l.value = d : null),
|
|
349
|
+
u[1] || (u[1] = (d) => i(y(l)))
|
|
350
350
|
],
|
|
351
351
|
name: a.name,
|
|
352
352
|
items: a.items,
|
|
@@ -358,18 +358,18 @@ const Be = /* @__PURE__ */ _({
|
|
|
358
358
|
"hide-details": a.hideDetails,
|
|
359
359
|
"return-object": a.returnObject,
|
|
360
360
|
"no-data-text": a.noDataText,
|
|
361
|
-
"error-messages":
|
|
361
|
+
"error-messages": y(s),
|
|
362
362
|
"menu-props": { maxWidth: 0 }
|
|
363
|
-
}),
|
|
364
|
-
|
|
365
|
-
name:
|
|
366
|
-
fn:
|
|
367
|
-
|
|
363
|
+
}), E({ _: 2 }, [
|
|
364
|
+
j(m.$slots, (d, r) => ({
|
|
365
|
+
name: r,
|
|
366
|
+
fn: g((C) => [
|
|
367
|
+
P(m.$slots, r, Y(H(C ?? {})))
|
|
368
368
|
])
|
|
369
369
|
}))
|
|
370
370
|
]), 1040, ["modelValue", "name", "items", "rounded", "variant", "density", "color", "clearable", "hide-details", "return-object", "no-data-text", "error-messages"]));
|
|
371
371
|
}
|
|
372
|
-
}),
|
|
372
|
+
}), Ce = /* @__PURE__ */ x({
|
|
373
373
|
name: "FCheckbox",
|
|
374
374
|
inheritAttrs: !1,
|
|
375
375
|
__name: "FCheckbox",
|
|
@@ -381,14 +381,14 @@ const Be = /* @__PURE__ */ _({
|
|
|
381
381
|
},
|
|
382
382
|
setup(t) {
|
|
383
383
|
const e = t;
|
|
384
|
-
return (
|
|
384
|
+
return (o, a) => (v(), V(y(fe), B(o.$attrs, {
|
|
385
385
|
color: e.color,
|
|
386
386
|
"hide-details": e.hideDetails,
|
|
387
387
|
indeterminate: e.indeterminate,
|
|
388
388
|
density: e.density
|
|
389
389
|
}), null, 16, ["color", "hide-details", "indeterminate", "density"]));
|
|
390
390
|
}
|
|
391
|
-
}),
|
|
391
|
+
}), Me = /* @__PURE__ */ x({
|
|
392
392
|
name: "FCurrencyField",
|
|
393
393
|
inheritAttrs: !1,
|
|
394
394
|
__name: "FCurrencyField",
|
|
@@ -408,41 +408,41 @@ const Be = /* @__PURE__ */ _({
|
|
|
408
408
|
rules: { type: [String, Function], default: "" }
|
|
409
409
|
},
|
|
410
410
|
setup(t) {
|
|
411
|
-
const e = t,
|
|
411
|
+
const e = t, o = $(() => e.rules), { errorMessage: a, value: n } = N(() => e.name, o, {
|
|
412
412
|
initialValue: e.modelValue,
|
|
413
413
|
syncVModel: !0
|
|
414
|
-
}),
|
|
414
|
+
}), s = $(
|
|
415
415
|
() => new Intl.NumberFormat(e.locale, {
|
|
416
416
|
style: "currency",
|
|
417
417
|
currency: e.currency,
|
|
418
418
|
minimumFractionDigits: e.precision,
|
|
419
419
|
maximumFractionDigits: e.precision
|
|
420
420
|
})
|
|
421
|
-
),
|
|
422
|
-
function
|
|
423
|
-
return
|
|
421
|
+
), l = T(i(e.modelValue));
|
|
422
|
+
function i(b) {
|
|
423
|
+
return b == null || isNaN(b) ? "" : s.value.format(b);
|
|
424
424
|
}
|
|
425
|
-
function m(
|
|
426
|
-
const
|
|
427
|
-
return isNaN(
|
|
425
|
+
function m(b) {
|
|
426
|
+
const k = b.replace(/[^\d,.-]/g, "").replace(/\./g, "").replace(",", "."), F = parseFloat(k);
|
|
427
|
+
return isNaN(F) ? null : Math.round(F * Math.pow(10, e.precision)) / Math.pow(10, e.precision);
|
|
428
428
|
}
|
|
429
|
-
const u =
|
|
430
|
-
function
|
|
431
|
-
const
|
|
432
|
-
|
|
429
|
+
const u = T(!1);
|
|
430
|
+
function d(b) {
|
|
431
|
+
const k = b.target;
|
|
432
|
+
l.value = k.value, n.value = m(k.value);
|
|
433
433
|
}
|
|
434
|
-
function
|
|
435
|
-
u.value = !1,
|
|
434
|
+
function r() {
|
|
435
|
+
u.value = !1, l.value = i(n.value);
|
|
436
436
|
}
|
|
437
|
-
function
|
|
437
|
+
function C(b) {
|
|
438
438
|
u.value = !0;
|
|
439
|
-
const
|
|
440
|
-
|
|
439
|
+
const k = b.target, F = n.value;
|
|
440
|
+
F != null ? l.value = F.toFixed(e.precision).replace(".", ",") : l.value = "", setTimeout(() => k.select(), 0);
|
|
441
441
|
}
|
|
442
|
-
return
|
|
443
|
-
|
|
444
|
-
}), (
|
|
445
|
-
"model-value":
|
|
442
|
+
return ie(() => e.modelValue, (b) => {
|
|
443
|
+
n.value = b, u.value || (l.value = i(b));
|
|
444
|
+
}), (b, k) => (v(), V(y(Q), B(b.$attrs, {
|
|
445
|
+
"model-value": l.value,
|
|
446
446
|
name: e.name,
|
|
447
447
|
label: e.label,
|
|
448
448
|
readonly: e.readonly,
|
|
@@ -451,14 +451,14 @@ const Be = /* @__PURE__ */ _({
|
|
|
451
451
|
variant: e.variant,
|
|
452
452
|
density: e.density,
|
|
453
453
|
color: e.color,
|
|
454
|
-
"error-messages":
|
|
454
|
+
"error-messages": y(a),
|
|
455
455
|
inputmode: "decimal",
|
|
456
|
-
onInput:
|
|
457
|
-
onBlur:
|
|
458
|
-
onFocus:
|
|
456
|
+
onInput: d,
|
|
457
|
+
onBlur: r,
|
|
458
|
+
onFocus: C
|
|
459
459
|
}), null, 16, ["model-value", "name", "label", "readonly", "hide-details", "rounded", "variant", "density", "color", "error-messages"]));
|
|
460
460
|
}
|
|
461
|
-
}), Se = /* @__PURE__ */
|
|
461
|
+
}), Se = /* @__PURE__ */ x({
|
|
462
462
|
name: "FSelect",
|
|
463
463
|
inheritAttrs: !1,
|
|
464
464
|
__name: "FSelect",
|
|
@@ -475,13 +475,13 @@ const Be = /* @__PURE__ */ _({
|
|
|
475
475
|
rules: { type: [String, Function], default: "" }
|
|
476
476
|
},
|
|
477
477
|
setup(t) {
|
|
478
|
-
const e = t,
|
|
478
|
+
const e = t, o = $(() => e.rules), { errorMessage: a, value: n } = N(() => e.name, o, {
|
|
479
479
|
initialValue: e.modelValue,
|
|
480
480
|
syncVModel: !0
|
|
481
481
|
});
|
|
482
|
-
return (
|
|
483
|
-
modelValue:
|
|
484
|
-
"onUpdate:modelValue":
|
|
482
|
+
return (s, l) => (v(), V(y(pe), B(s.$attrs, {
|
|
483
|
+
modelValue: y(n),
|
|
484
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => R(n) ? n.value = i : null),
|
|
485
485
|
name: e.name,
|
|
486
486
|
items: e.items,
|
|
487
487
|
rounded: e.rounded,
|
|
@@ -490,17 +490,17 @@ const Be = /* @__PURE__ */ _({
|
|
|
490
490
|
color: e.color,
|
|
491
491
|
"hide-details": e.hideDetails,
|
|
492
492
|
"return-object": e.returnObject,
|
|
493
|
-
"error-messages":
|
|
494
|
-
}),
|
|
495
|
-
|
|
493
|
+
"error-messages": y(a)
|
|
494
|
+
}), E({ _: 2 }, [
|
|
495
|
+
j(s.$slots, (i, m) => ({
|
|
496
496
|
name: m,
|
|
497
|
-
fn:
|
|
498
|
-
|
|
497
|
+
fn: g((u) => [
|
|
498
|
+
P(s.$slots, m, Y(H(u ?? {})))
|
|
499
499
|
])
|
|
500
500
|
}))
|
|
501
501
|
]), 1040, ["modelValue", "name", "items", "rounded", "variant", "density", "color", "hide-details", "return-object", "error-messages"]));
|
|
502
502
|
}
|
|
503
|
-
}),
|
|
503
|
+
}), Pe = /* @__PURE__ */ x({
|
|
504
504
|
name: "FNumberField",
|
|
505
505
|
inheritAttrs: !1,
|
|
506
506
|
__name: "FNumberField",
|
|
@@ -524,13 +524,13 @@ const Be = /* @__PURE__ */ _({
|
|
|
524
524
|
rules: { type: [String, Function], default: "" }
|
|
525
525
|
},
|
|
526
526
|
setup(t) {
|
|
527
|
-
const e = t,
|
|
527
|
+
const e = t, o = $(() => e.rules), { errorMessage: a, value: n } = N(() => e.name, o, {
|
|
528
528
|
initialValue: e.modelValue,
|
|
529
529
|
syncVModel: !0
|
|
530
530
|
});
|
|
531
|
-
return (
|
|
532
|
-
modelValue:
|
|
533
|
-
"onUpdate:modelValue":
|
|
531
|
+
return (s, l) => (v(), V(y(ve), B(s.$attrs, {
|
|
532
|
+
modelValue: y(n),
|
|
533
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => R(n) ? n.value = i : null),
|
|
534
534
|
name: e.name,
|
|
535
535
|
color: e.color,
|
|
536
536
|
density: e.density,
|
|
@@ -546,14 +546,14 @@ const Be = /* @__PURE__ */ _({
|
|
|
546
546
|
min: e.min,
|
|
547
547
|
precision: e.precision,
|
|
548
548
|
inset: e.inset,
|
|
549
|
-
"error-messages":
|
|
549
|
+
"error-messages": y(a)
|
|
550
550
|
}), null, 16, ["modelValue", "name", "color", "density", "rounded", "variant", "control-variant", "hide-details", "placeholder", "label", "prefix", "disabled", "readonly", "min", "precision", "inset", "error-messages"]));
|
|
551
551
|
}
|
|
552
|
-
}),
|
|
552
|
+
}), Te = { key: 0 }, Ne = { key: 1 }, Ae = /* @__PURE__ */ x({
|
|
553
553
|
name: "FSwitch",
|
|
554
554
|
inheritAttrs: !1,
|
|
555
555
|
__name: "FSwitch",
|
|
556
|
-
props: /* @__PURE__ */
|
|
556
|
+
props: /* @__PURE__ */ z({
|
|
557
557
|
color: { default: "secondary" },
|
|
558
558
|
density: { default: "comfortable" },
|
|
559
559
|
hideDetails: { type: [Boolean, String], default: "auto" },
|
|
@@ -565,28 +565,28 @@ const Be = /* @__PURE__ */ _({
|
|
|
565
565
|
}),
|
|
566
566
|
emits: ["update:modelValue"],
|
|
567
567
|
setup(t) {
|
|
568
|
-
const e = t,
|
|
569
|
-
return (a,
|
|
570
|
-
modelValue:
|
|
571
|
-
"onUpdate:modelValue":
|
|
568
|
+
const e = t, o = U(t, "modelValue");
|
|
569
|
+
return (a, n) => (v(), V(y(ye), B(a.$attrs, {
|
|
570
|
+
modelValue: o.value,
|
|
571
|
+
"onUpdate:modelValue": n[0] || (n[0] = (s) => o.value = s),
|
|
572
572
|
color: e.color,
|
|
573
573
|
"hide-details": e.hideDetails,
|
|
574
574
|
density: e.density
|
|
575
|
-
}),
|
|
575
|
+
}), E({ _: 2 }, [
|
|
576
576
|
e.labelTrue || e.labelFalse ? {
|
|
577
577
|
name: "label",
|
|
578
|
-
fn:
|
|
579
|
-
|
|
578
|
+
fn: g(() => [
|
|
579
|
+
o.value ? (v(), I("span", Te, S(e.labelTrue), 1)) : (v(), I("span", Ne, S(e.labelFalse), 1))
|
|
580
580
|
]),
|
|
581
581
|
key: "0"
|
|
582
582
|
} : void 0
|
|
583
583
|
]), 1040, ["modelValue", "color", "hide-details", "density"]));
|
|
584
584
|
}
|
|
585
|
-
}),
|
|
585
|
+
}), Re = /* @__PURE__ */ x({
|
|
586
586
|
name: "FDialog",
|
|
587
587
|
inheritAttrs: !1,
|
|
588
588
|
__name: "FDialog",
|
|
589
|
-
props: /* @__PURE__ */
|
|
589
|
+
props: /* @__PURE__ */ z({
|
|
590
590
|
width: { default: 750 },
|
|
591
591
|
persistent: { type: Boolean, default: !0 },
|
|
592
592
|
transition: { default: "slide-y-transition" },
|
|
@@ -595,45 +595,45 @@ const Be = /* @__PURE__ */ _({
|
|
|
595
595
|
modelValue: { type: Boolean },
|
|
596
596
|
modelModifiers: {}
|
|
597
597
|
}),
|
|
598
|
-
emits: /* @__PURE__ */
|
|
598
|
+
emits: /* @__PURE__ */ z(["closeDialog"], ["update:modelValue"]),
|
|
599
599
|
setup(t) {
|
|
600
|
-
const e = t,
|
|
601
|
-
return (a,
|
|
602
|
-
const
|
|
603
|
-
return
|
|
604
|
-
modelValue:
|
|
605
|
-
"onUpdate:modelValue":
|
|
600
|
+
const e = t, o = U(t, "modelValue");
|
|
601
|
+
return (a, n) => {
|
|
602
|
+
const s = p("v-btn"), l = p("v-card-title"), i = p("v-divider"), m = p("v-card-text"), u = p("v-card"), d = p("v-dialog");
|
|
603
|
+
return v(), V(d, B(a.$attrs, {
|
|
604
|
+
modelValue: o.value,
|
|
605
|
+
"onUpdate:modelValue": n[1] || (n[1] = (r) => o.value = r),
|
|
606
606
|
transition: e.transition,
|
|
607
607
|
class: "f-dialog",
|
|
608
608
|
width: e.width,
|
|
609
609
|
persistent: e.persistent
|
|
610
610
|
}), {
|
|
611
|
-
default:
|
|
612
|
-
|
|
611
|
+
default: g(() => [
|
|
612
|
+
_(u, {
|
|
613
613
|
class: "f-dialog-card",
|
|
614
614
|
density: "default",
|
|
615
615
|
variant: "elevated",
|
|
616
616
|
rounded: "lg"
|
|
617
617
|
}, {
|
|
618
|
-
default:
|
|
619
|
-
|
|
620
|
-
default:
|
|
621
|
-
|
|
622
|
-
|
|
618
|
+
default: g(() => [
|
|
619
|
+
_(l, { class: "d-flex justify-space-between align-center" }, {
|
|
620
|
+
default: g(() => [
|
|
621
|
+
X("header", null, [
|
|
622
|
+
P(a.$slots, "header")
|
|
623
623
|
]),
|
|
624
|
-
e.hideClose ?
|
|
624
|
+
e.hideClose ? O("", !0) : (v(), V(s, {
|
|
625
625
|
key: 0,
|
|
626
626
|
icon: "mdi-close",
|
|
627
627
|
variant: "text",
|
|
628
|
-
onClick:
|
|
628
|
+
onClick: n[0] || (n[0] = (r) => a.$emit("closeDialog"))
|
|
629
629
|
}))
|
|
630
630
|
]),
|
|
631
631
|
_: 3
|
|
632
632
|
}),
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
default:
|
|
636
|
-
|
|
633
|
+
_(i),
|
|
634
|
+
_(m, { class: "py-4 px-1 overflow-auto overflow-x-hidden" }, {
|
|
635
|
+
default: g(() => [
|
|
636
|
+
P(a.$slots, "default")
|
|
637
637
|
]),
|
|
638
638
|
_: 3
|
|
639
639
|
})
|
|
@@ -645,23 +645,226 @@ const Be = /* @__PURE__ */ _({
|
|
|
645
645
|
}, 16, ["modelValue", "transition", "width", "persistent"]);
|
|
646
646
|
};
|
|
647
647
|
}
|
|
648
|
-
}),
|
|
648
|
+
}), Ue = {
|
|
649
|
+
class: "d-flex mt-5 mb-n6",
|
|
650
|
+
style: { width: "100%" }
|
|
651
|
+
}, Ie = /* @__PURE__ */ x({
|
|
652
|
+
name: "FTimePicker",
|
|
653
|
+
inheritAttrs: !1,
|
|
654
|
+
__name: "FTimePicker",
|
|
655
|
+
props: {
|
|
656
|
+
name: {},
|
|
657
|
+
rounded: { default: "lg" },
|
|
658
|
+
variant: { default: "outlined" },
|
|
659
|
+
density: { default: "compact" },
|
|
660
|
+
color: { default: "secondary" },
|
|
661
|
+
hideDetails: { type: [Boolean, String], default: "auto" },
|
|
662
|
+
readonly: { type: Boolean, default: !1 },
|
|
663
|
+
modelValue: { default: "" },
|
|
664
|
+
rules: { type: [String, Function], default: "" },
|
|
665
|
+
labelCancel: { default: "Cancel" },
|
|
666
|
+
labelConfirm: { default: "Confirm" }
|
|
667
|
+
},
|
|
668
|
+
setup(t) {
|
|
669
|
+
const e = t, o = $(() => e.rules), { errorMessage: a, value: n } = N(() => e.name, o, {
|
|
670
|
+
initialValue: e.modelValue || "",
|
|
671
|
+
syncVModel: !0
|
|
672
|
+
}), s = T(!1), l = T(n);
|
|
673
|
+
function i() {
|
|
674
|
+
n.value = l.value, s.value = !1;
|
|
675
|
+
}
|
|
676
|
+
function m(u) {
|
|
677
|
+
l.value && l.value.includes(":") && (l.value = u.toString().padStart(2, "0") + l.value.substring(l.value.indexOf(":")));
|
|
678
|
+
}
|
|
679
|
+
return (u, d) => {
|
|
680
|
+
const r = p("v-btn"), C = p("v-spacer"), b = p("v-time-picker"), k = p("v-menu"), F = p("v-text-field");
|
|
681
|
+
return v(), V(F, B(u.$attrs, {
|
|
682
|
+
modelValue: y(n),
|
|
683
|
+
"onUpdate:modelValue": d[4] || (d[4] = (w) => R(n) ? n.value = w : null),
|
|
684
|
+
"prepend-inner-icon": "mdi-clock-time-four-outline",
|
|
685
|
+
name: e.name,
|
|
686
|
+
active: s.value,
|
|
687
|
+
focus: s.value,
|
|
688
|
+
density: e.density,
|
|
689
|
+
rounded: e.rounded,
|
|
690
|
+
variant: e.variant,
|
|
691
|
+
"hide-details": e.hideDetails,
|
|
692
|
+
readonly: e.readonly,
|
|
693
|
+
"error-messages": y(a)
|
|
694
|
+
}), {
|
|
695
|
+
default: g(() => [
|
|
696
|
+
_(k, {
|
|
697
|
+
modelValue: s.value,
|
|
698
|
+
"onUpdate:modelValue": d[3] || (d[3] = (w) => s.value = w),
|
|
699
|
+
activator: "parent",
|
|
700
|
+
location: "center",
|
|
701
|
+
disabled: e.readonly,
|
|
702
|
+
"close-on-content-click": !1
|
|
703
|
+
}, {
|
|
704
|
+
default: g(() => [
|
|
705
|
+
s.value ? (v(), V(b, {
|
|
706
|
+
key: 0,
|
|
707
|
+
modelValue: l.value,
|
|
708
|
+
"onUpdate:modelValue": d[1] || (d[1] = (w) => l.value = w),
|
|
709
|
+
"full-width": "",
|
|
710
|
+
color: "secondary",
|
|
711
|
+
format: "24hr",
|
|
712
|
+
"onUpdate:hour": d[2] || (d[2] = (w) => m(w))
|
|
713
|
+
}, {
|
|
714
|
+
actions: g(() => [
|
|
715
|
+
X("div", Ue, [
|
|
716
|
+
_(r, {
|
|
717
|
+
variant: "text",
|
|
718
|
+
color: "gray",
|
|
719
|
+
text: e.labelCancel,
|
|
720
|
+
onClick: d[0] || (d[0] = (w) => s.value = !1)
|
|
721
|
+
}, null, 8, ["text"]),
|
|
722
|
+
_(C),
|
|
723
|
+
_(r, {
|
|
724
|
+
variant: "text",
|
|
725
|
+
text: e.labelConfirm,
|
|
726
|
+
onClick: i
|
|
727
|
+
}, null, 8, ["text"])
|
|
728
|
+
])
|
|
729
|
+
]),
|
|
730
|
+
_: 1
|
|
731
|
+
}, 8, ["modelValue"])) : O("", !0)
|
|
732
|
+
]),
|
|
733
|
+
_: 1
|
|
734
|
+
}, 8, ["modelValue", "disabled"])
|
|
735
|
+
]),
|
|
736
|
+
_: 1
|
|
737
|
+
}, 16, ["modelValue", "name", "active", "focus", "density", "rounded", "variant", "hide-details", "readonly", "error-messages"]);
|
|
738
|
+
};
|
|
739
|
+
}
|
|
740
|
+
}), Oe = /* @__PURE__ */ W(Ie, [["__scopeId", "data-v-bd1f1133"]]), je = { class: "position-relative" }, Xe = /* @__PURE__ */ x({
|
|
741
|
+
name: "FDatePicker",
|
|
742
|
+
inheritAttrs: !1,
|
|
743
|
+
__name: "FDatePicker",
|
|
744
|
+
props: {
|
|
745
|
+
name: {},
|
|
746
|
+
rounded: { default: "lg" },
|
|
747
|
+
variant: { default: "outlined" },
|
|
748
|
+
density: { default: "compact" },
|
|
749
|
+
color: { default: "secondary" },
|
|
750
|
+
hideDetails: { type: [Boolean, String], default: "auto" },
|
|
751
|
+
disabled: { type: Boolean, default: !1 },
|
|
752
|
+
modelValue: { default: "" },
|
|
753
|
+
rules: { type: [String, Function], default: "" },
|
|
754
|
+
max: { default: void 0 },
|
|
755
|
+
locale: { default: "en" },
|
|
756
|
+
firstDayOfWeek: { default: 1 },
|
|
757
|
+
dateFormat: { default: "DD/MM/YYYY" }
|
|
758
|
+
},
|
|
759
|
+
setup(t) {
|
|
760
|
+
const e = t, o = $(() => e.rules);
|
|
761
|
+
function a(d) {
|
|
762
|
+
if (!d) return "";
|
|
763
|
+
let r;
|
|
764
|
+
if (d instanceof Date)
|
|
765
|
+
r = d;
|
|
766
|
+
else {
|
|
767
|
+
const F = d.split("/");
|
|
768
|
+
F.length === 3 ? r = new Date(Number(F[2]), Number(F[1]) - 1, Number(F[0])) : r = new Date(d);
|
|
769
|
+
}
|
|
770
|
+
if (isNaN(r.getTime())) return "";
|
|
771
|
+
const C = `0${r.getDate()}`.slice(-2), b = `0${r.getMonth() + 1}`.slice(-2), k = r.getFullYear();
|
|
772
|
+
return `${C}/${b}/${k}`;
|
|
773
|
+
}
|
|
774
|
+
function n(d) {
|
|
775
|
+
if (!d) return null;
|
|
776
|
+
const r = d.split("/");
|
|
777
|
+
return r.length === 3 ? new Date(Number(r[2]), Number(r[1]) - 1, Number(r[0])) : null;
|
|
778
|
+
}
|
|
779
|
+
const { errorMessage: s, value: l } = N(() => e.name, o, {
|
|
780
|
+
initialValue: e.modelValue ? a(e.modelValue) : "",
|
|
781
|
+
syncVModel: !0
|
|
782
|
+
}), i = T(null), m = T(!1), u = (d) => {
|
|
783
|
+
l.value = a(d), m.value = !1;
|
|
784
|
+
};
|
|
785
|
+
return ue(() => {
|
|
786
|
+
i.value = e.modelValue ? n(e.modelValue) : null, l.value = e.modelValue ? a(e.modelValue) : "";
|
|
787
|
+
}), (d, r) => {
|
|
788
|
+
const C = p("v-text-field"), b = p("v-date-picker"), k = p("v-locale-provider"), F = p("v-btn"), w = p("v-menu");
|
|
789
|
+
return v(), V(w, {
|
|
790
|
+
modelValue: m.value,
|
|
791
|
+
"onUpdate:modelValue": r[4] || (r[4] = (M) => m.value = M),
|
|
792
|
+
location: "center",
|
|
793
|
+
disabled: e.disabled,
|
|
794
|
+
"close-on-content-click": !1
|
|
795
|
+
}, {
|
|
796
|
+
activator: g(({ props: M }) => [
|
|
797
|
+
_(C, B({ ...d.$attrs, ...M }, {
|
|
798
|
+
modelValue: y(l),
|
|
799
|
+
"onUpdate:modelValue": r[0] || (r[0] = (f) => R(l) ? l.value = f : null),
|
|
800
|
+
"prepend-inner-icon": "mdi-calendar-outline",
|
|
801
|
+
name: e.name,
|
|
802
|
+
density: e.density,
|
|
803
|
+
rounded: e.rounded,
|
|
804
|
+
variant: e.variant,
|
|
805
|
+
"hide-details": e.hideDetails,
|
|
806
|
+
color: e.color,
|
|
807
|
+
readonly: "",
|
|
808
|
+
"error-messages": y(s),
|
|
809
|
+
"onClick:clear": r[1] || (r[1] = (f) => l.value = "")
|
|
810
|
+
}), null, 16, ["modelValue", "name", "density", "rounded", "variant", "hide-details", "color", "error-messages"])
|
|
811
|
+
]),
|
|
812
|
+
default: g(() => [
|
|
813
|
+
X("div", je, [
|
|
814
|
+
_(k, {
|
|
815
|
+
locale: e.locale
|
|
816
|
+
}, {
|
|
817
|
+
default: g(() => [
|
|
818
|
+
_(b, {
|
|
819
|
+
modelValue: i.value,
|
|
820
|
+
"onUpdate:modelValue": [
|
|
821
|
+
r[2] || (r[2] = (M) => i.value = M),
|
|
822
|
+
u
|
|
823
|
+
],
|
|
824
|
+
title: "",
|
|
825
|
+
elevation: "10",
|
|
826
|
+
"first-day-of-week": e.firstDayOfWeek,
|
|
827
|
+
max: e.max,
|
|
828
|
+
color: e.color,
|
|
829
|
+
"show-adjacent-months": "",
|
|
830
|
+
rounded: e.rounded
|
|
831
|
+
}, null, 8, ["modelValue", "first-day-of-week", "max", "color", "rounded"])
|
|
832
|
+
]),
|
|
833
|
+
_: 1
|
|
834
|
+
}, 8, ["locale"]),
|
|
835
|
+
_(F, {
|
|
836
|
+
class: "position-absolute top-0 right-0",
|
|
837
|
+
color: "white",
|
|
838
|
+
icon: "mdi-close",
|
|
839
|
+
size: "small",
|
|
840
|
+
variant: "text",
|
|
841
|
+
onClick: r[3] || (r[3] = (M) => m.value = !1)
|
|
842
|
+
})
|
|
843
|
+
])
|
|
844
|
+
]),
|
|
845
|
+
_: 1
|
|
846
|
+
}, 8, ["modelValue", "disabled"]);
|
|
847
|
+
};
|
|
848
|
+
}
|
|
849
|
+
}), ze = /* @__PURE__ */ W(Xe, [["__scopeId", "data-v-6f068869"]]), Ge = {
|
|
649
850
|
install(t) {
|
|
650
|
-
t.component("FButton",
|
|
851
|
+
t.component("FButton", be), t.component("FTextField", he), t.component("FDataTable", $e), t.component("FTextarea", we), t.component("FAutocomplete", Be), t.component("FCheckbox", Ce), t.component("FCurrencyField", Me), t.component("FSelect", Se), t.component("FNumberField", Pe), t.component("FSwitch", Ae), t.component("FDialog", Re), t.component("FTimePicker", Oe), t.component("FDatePicker", ze);
|
|
651
852
|
}
|
|
652
853
|
};
|
|
653
854
|
export {
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
855
|
+
Be as FAutocomplete,
|
|
856
|
+
be as FButton,
|
|
857
|
+
Ce as FCheckbox,
|
|
858
|
+
Me as FCurrencyField,
|
|
859
|
+
$e as FDataTable,
|
|
860
|
+
xe as FDataTableHeaderType,
|
|
861
|
+
ze as FDatePicker,
|
|
862
|
+
Re as FDialog,
|
|
863
|
+
Pe as FNumberField,
|
|
662
864
|
Se as FSelect,
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
865
|
+
Ae as FSwitch,
|
|
866
|
+
he as FTextField,
|
|
867
|
+
we as FTextarea,
|
|
868
|
+
Oe as FTimePicker,
|
|
869
|
+
Ge as default
|
|
667
870
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(u,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vuetify/components"),require("maska/vue"),require("vee-validate")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components","maska/vue","vee-validate"],e):(u=typeof globalThis<"u"?globalThis:u||self,e(u.FinsoVueComponents={},u.Vue,u.VuetifyComponents,u.MaskaVue,u.VeeValidate))})(this,(function(u,e,V,z,F){"use strict";const w=e.defineComponent({__name:"FButton",props:{color:{default:"primary"},rounded:{type:[String,Number,Boolean],default:"lg"}},setup(o){const t=o;return(a,n)=>{const l=e.resolveComponent("v-btn");return e.openBlock(),e.createBlock(l,{color:t.color,rounded:t.rounded},null,8,["color","rounded"])}}}),S=e.defineComponent({name:"FTextField",inheritAttrs:!1,__name:"FTextField",props:{name:{},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},clearable:{type:Boolean,default:!0},hideDetails:{type:[Boolean,String],default:"auto"},appendInnerIcon:{default:""},mask:{default:""},modelValue:{default:""},rules:{type:[String,Function],default:""}},emits:["clickAppendInner"],setup(o){const t=o,a=e.computed(()=>t.rules),{errorMessage:n,value:l}=F.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,r)=>e.withDirectives((e.openBlock(),e.createBlock(e.unref(V.VTextField),e.mergeProps(c.$attrs,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=d=>e.isRef(l)?l.value=d:null),name:t.name,color:t.color,density:t.density,rounded:t.rounded,variant:t.variant,clearable:t.clearable,"hide-details":t.hideDetails,"error-messages":e.unref(n),"append-inner-icon":t.appendInnerIcon,"onClick:appendInner":r[1]||(r[1]=d=>c.$emit("clickAppendInner"))}),e.createSlots({_:2},[e.renderList(c.$slots,(d,f)=>({name:f,fn:e.withCtx(m=>[e.renderSlot(c.$slots,f,e.normalizeProps(e.guardReactiveProps(m??{})))])}))]),1040,["modelValue","name","color","density","rounded","variant","clearable","hide-details","error-messages","append-inner-icon"])),[[e.unref(z.vMaska),t.mask]])}}),O={key:1},X={key:4},L={class:"f-data-table__actions"},H={class:"text-h6"},x=((o,t)=>{const a=o.__vccOpts||o;for(const[n,l]of t)a[n]=l;return a})(e.defineComponent({name:"FDataTable",inheritAttrs:!1,__name:"FDataTable",props:e.mergeModels({headers:{},items:{},loading:{type:Boolean,default:!1},hover:{type:Boolean,default:!0},density:{default:"default"},maxHeight:{default:576},showSelect:{type:Boolean,default:!1},serverSide:{type:Boolean,default:!0},totalCount:{default:0},canEditRecord:{type:Boolean,default:!0},canDeleteRecord:{type:Boolean,default:!0},canReadRecord:{type:Boolean,default:!0},showDeleteConfirm:{type:Boolean,default:!0},labelActive:{default:"Active"},labelPassive:{default:"Passive"},labelDeleteTitle:{default:"Delete"},deleteMessageFormatter:{},labelDeleteMessage:{default:"Are you sure you want to delete this record?"},labelDeleteConfirm:{default:"Delete"},labelDeleteCancel:{default:"Cancel"},labelItemsPerPage:{default:"Items per page"},labelNoData:{default:"No data available"},moneyLocale:{default:"tr-TR"},moneyCurrency:{default:"TRY"},gsmPattern:{default:"(XXX) XXX XXXX"}},{page:{default:1},pageModifiers:{},itemsPerPage:{default:10},itemsPerPageModifiers:{},sortBy:{default:()=>[]},sortByModifiers:{}}),emits:e.mergeModels(["show-record","delete-record"],["update:page","update:itemsPerPage","update:sortBy"]),setup(o,{emit:t}){const a=o,n=t,l=e.useModel(o,"page"),c=e.useModel(o,"itemsPerPage"),r=e.useModel(o,"sortBy"),d=e.ref(!1),f=e.ref(null);function m(i,p){return p.split(".").reduce((C,D)=>C==null?void 0:C[D],i)}function h(i){return i==null?"":new Intl.NumberFormat(a.moneyLocale,{style:"currency",currency:a.moneyCurrency}).format(i)}function k(i){if(!i)return"";const p=i.replace(/\D/g,"");return p.length<10?i:`(${p.substring(0,3)}) ${p.substring(3,6)} ${p.substring(6,10)}`}const _=e.computed(()=>{const C=a.items.length===0?108:a.items.length*52+56;return Math.min(C,a.maxHeight)}),y=e.computed(()=>!a.canEditRecord&&!a.canReadRecord?{}:{"click:row":(i,{item:p})=>{n("show-record",p)}}),b=e.computed(()=>a.headers.filter(i=>i.type&&i.key!=="actions")),B=e.computed(()=>a.headers.some(i=>i.key==="actions"));function W(i){a.showDeleteConfirm?(f.value=i,d.value=!0):n("delete-record",i)}function J(){n("delete-record",f.value),d.value=!1,f.value=null}return(i,p)=>{const C=e.resolveComponent("v-img"),D=e.resolveComponent("v-avatar"),K=e.resolveComponent("v-chip"),Q=e.resolveComponent("v-icon"),U=e.resolveComponent("v-btn"),Z=e.resolveComponent("v-card-text"),v=e.resolveComponent("v-spacer"),j=e.resolveComponent("f-button"),ee=e.resolveComponent("v-card-actions"),te=e.resolveComponent("f-dialog");return e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.serverSide?"v-data-table-server":"v-data-table"),e.mergeProps(i.$attrs,{page:l.value,"onUpdate:page":p[0]||(p[0]=s=>l.value=s),"items-per-page":c.value,"onUpdate:itemsPerPage":p[1]||(p[1]=s=>c.value=s),"sort-by":r.value,"onUpdate:sortBy":p[2]||(p[2]=s=>r.value=s),class:"rounded-b-lg",headers:o.headers,items:o.items,"items-length":o.serverSide?o.totalCount:void 0,loading:o.loading,hover:o.hover,density:o.density,height:_.value,"show-select":o.showSelect,"items-per-page-text":o.labelItemsPerPage,"no-data-text":o.labelNoData},e.toHandlers(y.value)),e.createSlots({_:2},[e.renderList(b.value,s=>({name:`item.${s.key}`,fn:e.withCtx(({item:g})=>[e.renderSlot(i.$slots,`item.${s.key}`,{item:g,value:m(g,s.key)},()=>[s.type==="image"?(e.openBlock(),e.createBlock(D,{key:0,rounded:"lg",variant:"elevated",color:"white"},{default:e.withCtx(()=>[e.createVNode(C,{src:m(g,s.key),class:"f-data-table__logo"},null,8,["src"])]),_:2},1024)):s.type==="money"?(e.openBlock(),e.createElementBlock("span",O,e.toDisplayString(h(m(g,s.key))),1)):s.type==="status"?(e.openBlock(),e.createBlock(K,{key:2,color:m(g,s.key)?"green-darken-1":"red-darken-2",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(g,s.key)?o.labelActive:o.labelPassive),1)]),_:2},1032,["color"])):s.type==="boolean"?(e.openBlock(),e.createBlock(Q,{key:3,color:m(g,s.key)?"green-darken-1":"red-darken-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(g,s.key)?"mdi-check":"mdi-close"),1)]),_:2},1032,["color"])):s.type==="gsmNo"?(e.openBlock(),e.createElementBlock("span",X,e.toDisplayString(k(m(g,s.key))),1)):e.createCommentVNode("",!0)],!0)])})),B.value?{name:"item.actions",fn:e.withCtx(({item:s})=>[e.renderSlot(i.$slots,"item.actions",{item:s},()=>[e.createElementVNode("div",L,[o.canEditRecord||o.canReadRecord?(e.openBlock(),e.createBlock(U,{key:0,color:"primary",icon:"mdi-pencil-outline",variant:"text",size:"small",onClick:e.withModifiers(g=>n("show-record",s),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0),o.canDeleteRecord?(e.openBlock(),e.createBlock(U,{key:1,icon:"mdi-trash-can-outline",variant:"text",size:"small",color:"red-darken-2",onClick:e.withModifiers(g=>W(s),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0)])],!0)]),key:"0"}:void 0,e.renderList(i.$slots,(s,g)=>({name:g,fn:e.withCtx(oe=>[e.renderSlot(i.$slots,g,e.normalizeProps(e.guardReactiveProps(oe??{})),void 0,!0)])}))]),1040,["page","items-per-page","sort-by","headers","items","items-length","loading","hover","density","height","show-select","items-per-page-text","no-data-text"])),e.createVNode(te,{modelValue:d.value,"onUpdate:modelValue":p[4]||(p[4]=s=>d.value=s),"max-width":"400","hide-close":!0},{header:e.withCtx(()=>[e.createElementVNode("div",H,e.toDisplayString(o.labelDeleteTitle),1)]),default:e.withCtx(()=>[e.createVNode(Z,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.deleteMessageFormatter&&f.value?o.deleteMessageFormatter(f.value):o.labelDeleteMessage),1)]),_:1}),e.createVNode(ee,null,{default:e.withCtx(()=>[e.createVNode(v),e.createVNode(j,{variant:"plain",color:"red-darken-2",text:o.labelDeleteCancel,onClick:p[3]||(p[3]=s=>d.value=!1)},null,8,["text"]),e.createVNode(j,{variant:"tonal",text:o.labelDeleteConfirm,onClick:J},null,8,["text"])]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-f628243a"]]);var $=(o=>(o.IMAGE="image",o.MONEY="money",o.STATUS="status",o.BOOLEAN="boolean",o.GSM_NO="gsmNo",o))($||{});const M=e.defineComponent({name:"FTextarea",inheritAttrs:!1,__name:"FTextarea",props:{name:{},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},label:{default:""},hideDetails:{type:[Boolean,String],default:"auto"},noResize:{type:Boolean,default:!0},rows:{default:""},modelValue:{default:""},rules:{type:[String,Function],default:""}},setup(o){const t=o,a=e.computed(()=>t.rules),{errorMessage:n,value:l}=F.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,r)=>(e.openBlock(),e.createBlock(e.unref(V.VTextarea),e.mergeProps(c.$attrs,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=d=>e.isRef(l)?l.value=d:null),name:t.name,rounded:t.rounded,variant:t.variant,rows:t.rows,density:t.density,color:t.color,label:t.label,"hide-details":t.hideDetails,"no-resize":t.noResize,"error-messages":e.unref(n)}),null,16,["modelValue","name","rounded","variant","rows","density","color","label","hide-details","no-resize","error-messages"]))}}),N=e.defineComponent({name:"FAutocomplete",inheritAttrs:!1,__name:"FAutocomplete",props:{name:{},items:{default:()=>[]},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},clearable:{type:Boolean,default:!0},hideDetails:{type:[Boolean,String],default:"auto"},returnObject:{type:Boolean,default:!0},noDataText:{default:""},modelValue:{default:null},rules:{type:[String,Function],default:""}},emits:["change"],setup(o,{emit:t}){const a=t,n=o,l=e.computed(()=>n.rules),{errorMessage:c,value:r}=F.useField(()=>n.name,l,{initialValue:n.modelValue,syncVModel:!0});function d(f){a("change",f)}return(f,m)=>(e.openBlock(),e.createBlock(e.unref(V.VAutocomplete),e.mergeProps(f.$attrs,{modelValue:e.unref(r),"onUpdate:modelValue":[m[0]||(m[0]=h=>e.isRef(r)?r.value=h:null),m[1]||(m[1]=h=>d(e.unref(r)))],name:n.name,items:n.items,rounded:n.rounded,variant:n.variant,density:n.density,color:n.color,clearable:n.clearable,"hide-details":n.hideDetails,"return-object":n.returnObject,"no-data-text":n.noDataText,"error-messages":e.unref(c),"menu-props":{maxWidth:0}}),e.createSlots({_:2},[e.renderList(f.$slots,(h,k)=>({name:k,fn:e.withCtx(_=>[e.renderSlot(f.$slots,k,e.normalizeProps(e.guardReactiveProps(_??{})))])}))]),1040,["modelValue","name","items","rounded","variant","density","color","clearable","hide-details","return-object","no-data-text","error-messages"]))}}),P=e.defineComponent({name:"FCheckbox",inheritAttrs:!1,__name:"FCheckbox",props:{color:{default:"secondary"},hideDetails:{type:[Boolean,String],default:"auto"},indeterminate:{type:Boolean,default:!1},density:{default:"compact"}},setup(o){const t=o;return(a,n)=>(e.openBlock(),e.createBlock(e.unref(V.VCheckbox),e.mergeProps(a.$attrs,{color:t.color,"hide-details":t.hideDetails,indeterminate:t.indeterminate,density:t.density}),null,16,["color","hide-details","indeterminate","density"]))}}),R=e.defineComponent({name:"FCurrencyField",inheritAttrs:!1,__name:"FCurrencyField",props:{name:{},label:{default:""},readonly:{type:Boolean,default:!1},hideDetails:{type:[Boolean,String],default:"auto"},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},locale:{default:"tr-TR"},currency:{default:"TRY"},precision:{default:2},modelValue:{default:null},rules:{type:[String,Function],default:""}},setup(o){const t=o,a=e.computed(()=>t.rules),{errorMessage:n,value:l}=F.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0}),c=e.computed(()=>new Intl.NumberFormat(t.locale,{style:"currency",currency:t.currency,minimumFractionDigits:t.precision,maximumFractionDigits:t.precision})),r=e.ref(d(t.modelValue));function d(y){return y==null||isNaN(y)?"":c.value.format(y)}function f(y){const b=y.replace(/[^\d,.-]/g,"").replace(/\./g,"").replace(",","."),B=parseFloat(b);return isNaN(B)?null:Math.round(B*Math.pow(10,t.precision))/Math.pow(10,t.precision)}const m=e.ref(!1);function h(y){const b=y.target;r.value=b.value,l.value=f(b.value)}function k(){m.value=!1,r.value=d(l.value)}function _(y){m.value=!0;const b=y.target,B=l.value;B!=null?r.value=B.toFixed(t.precision).replace(".",","):r.value="",setTimeout(()=>b.select(),0)}return e.watch(()=>t.modelValue,y=>{l.value=y,m.value||(r.value=d(y))}),(y,b)=>(e.openBlock(),e.createBlock(e.unref(V.VTextField),e.mergeProps(y.$attrs,{"model-value":r.value,name:t.name,label:t.label,readonly:t.readonly,"hide-details":t.hideDetails,rounded:t.rounded,variant:t.variant,density:t.density,color:t.color,"error-messages":e.unref(n),inputmode:"decimal",onInput:h,onBlur:k,onFocus:_}),null,16,["model-value","name","label","readonly","hide-details","rounded","variant","density","color","error-messages"]))}}),T=e.defineComponent({name:"FSelect",inheritAttrs:!1,__name:"FSelect",props:{name:{},items:{default:()=>[]},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},hideDetails:{type:[Boolean,String],default:"auto"},returnObject:{type:Boolean,default:!1},modelValue:{default:""},rules:{type:[String,Function],default:""}},setup(o){const t=o,a=e.computed(()=>t.rules),{errorMessage:n,value:l}=F.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,r)=>(e.openBlock(),e.createBlock(e.unref(V.VSelect),e.mergeProps(c.$attrs,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=d=>e.isRef(l)?l.value=d:null),name:t.name,items:t.items,rounded:t.rounded,variant:t.variant,density:t.density,color:t.color,"hide-details":t.hideDetails,"return-object":t.returnObject,"error-messages":e.unref(n)}),e.createSlots({_:2},[e.renderList(c.$slots,(d,f)=>({name:f,fn:e.withCtx(m=>[e.renderSlot(c.$slots,f,e.normalizeProps(e.guardReactiveProps(m??{})))])}))]),1040,["modelValue","name","items","rounded","variant","density","color","hide-details","return-object","error-messages"]))}}),A=e.defineComponent({name:"FNumberField",inheritAttrs:!1,__name:"FNumberField",props:{name:{},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},controlVariant:{default:"stacked"},color:{default:"secondary"},label:{default:""},placeholder:{default:""},prefix:{default:""},hideDetails:{type:[Boolean,String],default:"auto"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},min:{default:0},precision:{default:0},inset:{type:Boolean,default:!0},modelValue:{default:-1},rules:{type:[String,Function],default:""}},setup(o){const t=o,a=e.computed(()=>t.rules),{errorMessage:n,value:l}=F.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,r)=>(e.openBlock(),e.createBlock(e.unref(V.VNumberInput),e.mergeProps(c.$attrs,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=d=>e.isRef(l)?l.value=d:null),name:t.name,color:t.color,density:t.density,rounded:t.rounded,variant:t.variant,"control-variant":t.controlVariant,"hide-details":t.hideDetails,placeholder:t.placeholder,label:t.label,prefix:t.prefix,disabled:t.disabled,readonly:t.readonly,min:t.min,precision:t.precision,inset:t.inset,"error-messages":e.unref(n)}),null,16,["modelValue","name","color","density","rounded","variant","control-variant","hide-details","placeholder","label","prefix","disabled","readonly","min","precision","inset","error-messages"]))}}),q={key:0},G={key:1},I=e.defineComponent({name:"FSwitch",inheritAttrs:!1,__name:"FSwitch",props:e.mergeModels({color:{default:"secondary"},density:{default:"comfortable"},hideDetails:{type:[Boolean,String],default:"auto"},labelTrue:{default:""},labelFalse:{default:""}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,a=e.useModel(o,"modelValue");return(n,l)=>(e.openBlock(),e.createBlock(e.unref(V.VSwitch),e.mergeProps(n.$attrs,{modelValue:a.value,"onUpdate:modelValue":l[0]||(l[0]=c=>a.value=c),color:t.color,"hide-details":t.hideDetails,density:t.density}),e.createSlots({_:2},[t.labelTrue||t.labelFalse?{name:"label",fn:e.withCtx(()=>[a.value?(e.openBlock(),e.createElementBlock("span",q,e.toDisplayString(t.labelTrue),1)):(e.openBlock(),e.createElementBlock("span",G,e.toDisplayString(t.labelFalse),1))]),key:"0"}:void 0]),1040,["modelValue","color","hide-details","density"]))}}),E=e.defineComponent({name:"FDialog",inheritAttrs:!1,__name:"FDialog",props:e.mergeModels({width:{default:750},persistent:{type:Boolean,default:!0},transition:{default:"slide-y-transition"},hideClose:{type:Boolean,default:!1}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["closeDialog"],["update:modelValue"]),setup(o){const t=o,a=e.useModel(o,"modelValue");return(n,l)=>{const c=e.resolveComponent("v-btn"),r=e.resolveComponent("v-card-title"),d=e.resolveComponent("v-divider"),f=e.resolveComponent("v-card-text"),m=e.resolveComponent("v-card"),h=e.resolveComponent("v-dialog");return e.openBlock(),e.createBlock(h,e.mergeProps(n.$attrs,{modelValue:a.value,"onUpdate:modelValue":l[1]||(l[1]=k=>a.value=k),transition:t.transition,class:"f-dialog",width:t.width,persistent:t.persistent}),{default:e.withCtx(()=>[e.createVNode(m,{class:"f-dialog-card",density:"default",variant:"elevated",rounded:"lg"},{default:e.withCtx(()=>[e.createVNode(r,{class:"d-flex justify-space-between align-center"},{default:e.withCtx(()=>[e.createElementVNode("header",null,[e.renderSlot(n.$slots,"header")]),t.hideClose?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(c,{key:0,icon:"mdi-close",variant:"text",onClick:l[0]||(l[0]=k=>n.$emit("closeDialog"))}))]),_:3}),e.createVNode(d),e.createVNode(f,{class:"py-4 px-1 overflow-auto overflow-x-hidden"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3})]),_:3})]),_:3},16,["modelValue","transition","width","persistent"])}}}),Y={install(o){o.component("FButton",w),o.component("FTextField",S),o.component("FDataTable",x),o.component("FTextarea",M),o.component("FAutocomplete",N),o.component("FCheckbox",P),o.component("FCurrencyField",R),o.component("FSelect",T),o.component("FNumberField",A),o.component("FSwitch",I),o.component("FDialog",E)}};u.FAutocomplete=N,u.FButton=w,u.FCheckbox=P,u.FCurrencyField=R,u.FDataTable=x,u.FDataTableHeaderType=$,u.FDialog=E,u.FNumberField=A,u.FSelect=T,u.FSwitch=I,u.FTextField=S,u.FTextarea=M,u.default=Y,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
1
|
+
(function(y,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue"),require("vuetify/components"),require("maska/vue"),require("vee-validate")):typeof define=="function"&&define.amd?define(["exports","vue","vuetify/components","maska/vue","vee-validate"],e):(y=typeof globalThis<"u"?globalThis:y||self,e(y.FinsoVueComponents={},y.Vue,y.VuetifyComponents,y.MaskaVue,y.VeeValidate))})(this,(function(y,e,F,Y,B){"use strict";const $=e.defineComponent({__name:"FButton",props:{color:{default:"primary"},rounded:{type:[String,Number,Boolean],default:"lg"}},setup(o){const t=o;return(r,n)=>{const a=e.resolveComponent("v-btn");return e.openBlock(),e.createBlock(a,{color:t.color,rounded:t.rounded},null,8,["color","rounded"])}}}),N=e.defineComponent({name:"FTextField",inheritAttrs:!1,__name:"FTextField",props:{name:{},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},clearable:{type:Boolean,default:!0},hideDetails:{type:[Boolean,String],default:"auto"},appendInnerIcon:{default:""},mask:{default:""},modelValue:{default:""},rules:{type:[String,Function],default:""}},emits:["clickAppendInner"],setup(o){const t=o,r=e.computed(()=>t.rules),{errorMessage:n,value:a}=B.useField(()=>t.name,r,{initialValue:t.modelValue,syncVModel:!0});return(s,l)=>e.withDirectives((e.openBlock(),e.createBlock(e.unref(F.VTextField),e.mergeProps(s.$attrs,{modelValue:e.unref(a),"onUpdate:modelValue":l[0]||(l[0]=c=>e.isRef(a)?a.value=c:null),name:t.name,color:t.color,density:t.density,rounded:t.rounded,variant:t.variant,clearable:t.clearable,"hide-details":t.hideDetails,"error-messages":e.unref(n),"append-inner-icon":t.appendInnerIcon,"onClick:appendInner":l[1]||(l[1]=c=>s.$emit("clickAppendInner"))}),e.createSlots({_:2},[e.renderList(s.$slots,(c,f)=>({name:f,fn:e.withCtx(m=>[e.renderSlot(s.$slots,f,e.normalizeProps(e.guardReactiveProps(m??{})))])}))]),1040,["modelValue","name","color","density","rounded","variant","clearable","hide-details","error-messages","append-inner-icon"])),[[e.unref(Y.vMaska),t.mask]])}}),H={key:1},q={key:4},G={class:"f-data-table__actions"},W={class:"text-h6"},J=e.defineComponent({name:"FDataTable",inheritAttrs:!1,__name:"FDataTable",props:e.mergeModels({headers:{},items:{},loading:{type:Boolean,default:!1},hover:{type:Boolean,default:!0},density:{default:"default"},maxHeight:{default:576},showSelect:{type:Boolean,default:!1},serverSide:{type:Boolean,default:!0},totalCount:{default:0},canEditRecord:{type:Boolean,default:!0},canDeleteRecord:{type:Boolean,default:!0},canReadRecord:{type:Boolean,default:!0},showDeleteConfirm:{type:Boolean,default:!0},labelActive:{default:"Active"},labelPassive:{default:"Passive"},labelDeleteTitle:{default:"Delete"},deleteMessageFormatter:{},labelDeleteMessage:{default:"Are you sure you want to delete this record?"},labelDeleteConfirm:{default:"Delete"},labelDeleteCancel:{default:"Cancel"},labelItemsPerPage:{default:"Items per page"},labelNoData:{default:"No data available"},moneyLocale:{default:"tr-TR"},moneyCurrency:{default:"TRY"},gsmPattern:{default:"(XXX) XXX XXXX"}},{page:{default:1},pageModifiers:{},itemsPerPage:{default:10},itemsPerPageModifiers:{},sortBy:{default:()=>[]},sortByModifiers:{}}),emits:e.mergeModels(["show-record","delete-record"],["update:page","update:itemsPerPage","update:sortBy"]),setup(o,{emit:t}){const r=o,n=t,a=e.useModel(o,"page"),s=e.useModel(o,"itemsPerPage"),l=e.useModel(o,"sortBy"),c=e.ref(!1),f=e.ref(null);function m(p,k){return k.split(".").reduce((w,S)=>w==null?void 0:w[S],p)}function i(p){return p==null?"":new Intl.NumberFormat(r.moneyLocale,{style:"currency",currency:r.moneyCurrency}).format(p)}function d(p){if(!p)return"";const k=p.replace(/\D/g,"");return k.length<10?p:`(${k.substring(0,3)}) ${k.substring(3,6)} ${k.substring(6,10)}`}const _=e.computed(()=>{const w=r.items.length===0?108:r.items.length*52+56;return Math.min(w,r.maxHeight)}),g=e.computed(()=>!r.canEditRecord&&!r.canReadRecord?{}:{"click:row":(p,{item:k})=>{n("show-record",k)}}),h=e.computed(()=>r.headers.filter(p=>p.type&&p.key!=="actions")),V=e.computed(()=>r.headers.some(p=>p.key==="actions"));function C(p){r.showDeleteConfirm?(f.value=p,c.value=!0):n("delete-record",p)}function D(){n("delete-record",f.value),c.value=!1,f.value=null}return(p,k)=>{const w=e.resolveComponent("v-img"),S=e.resolveComponent("v-avatar"),oe=e.resolveComponent("v-chip"),le=e.resolveComponent("v-icon"),X=e.resolveComponent("v-btn"),ne=e.resolveComponent("v-card-text"),ae=e.resolveComponent("v-spacer"),L=e.resolveComponent("f-button"),re=e.resolveComponent("v-card-actions"),de=e.resolveComponent("f-dialog");return e.openBlock(),e.createElementBlock("div",null,[(e.openBlock(),e.createBlock(e.resolveDynamicComponent(o.serverSide?"v-data-table-server":"v-data-table"),e.mergeProps(p.$attrs,{page:a.value,"onUpdate:page":k[0]||(k[0]=u=>a.value=u),"items-per-page":s.value,"onUpdate:itemsPerPage":k[1]||(k[1]=u=>s.value=u),"sort-by":l.value,"onUpdate:sortBy":k[2]||(k[2]=u=>l.value=u),class:"rounded-b-lg",headers:o.headers,items:o.items,"items-length":o.serverSide?o.totalCount:void 0,loading:o.loading,hover:o.hover,density:o.density,height:_.value,"show-select":o.showSelect,"items-per-page-text":o.labelItemsPerPage,"no-data-text":o.labelNoData},e.toHandlers(g.value)),e.createSlots({_:2},[e.renderList(h.value,u=>({name:`item.${u.key}`,fn:e.withCtx(({item:b})=>[e.renderSlot(p.$slots,`item.${u.key}`,{item:b,value:m(b,u.key)},()=>[u.type==="image"?(e.openBlock(),e.createBlock(S,{key:0,rounded:"lg",variant:"elevated",color:"white"},{default:e.withCtx(()=>[e.createVNode(w,{src:m(b,u.key),class:"f-data-table__logo"},null,8,["src"])]),_:2},1024)):u.type==="money"?(e.openBlock(),e.createElementBlock("span",H,e.toDisplayString(i(m(b,u.key))),1)):u.type==="status"?(e.openBlock(),e.createBlock(oe,{key:2,color:m(b,u.key)?"green-darken-1":"red-darken-2",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(b,u.key)?o.labelActive:o.labelPassive),1)]),_:2},1032,["color"])):u.type==="boolean"?(e.openBlock(),e.createBlock(le,{key:3,color:m(b,u.key)?"green-darken-1":"red-darken-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(b,u.key)?"mdi-check":"mdi-close"),1)]),_:2},1032,["color"])):u.type==="gsmNo"?(e.openBlock(),e.createElementBlock("span",q,e.toDisplayString(d(m(b,u.key))),1)):e.createCommentVNode("",!0)],!0)])})),V.value?{name:"item.actions",fn:e.withCtx(({item:u})=>[e.renderSlot(p.$slots,"item.actions",{item:u},()=>[e.createElementVNode("div",G,[o.canEditRecord||o.canReadRecord?(e.openBlock(),e.createBlock(X,{key:0,color:"primary",icon:"mdi-pencil-outline",variant:"text",size:"small",onClick:e.withModifiers(b=>n("show-record",u),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0),o.canDeleteRecord?(e.openBlock(),e.createBlock(X,{key:1,icon:"mdi-trash-can-outline",variant:"text",size:"small",color:"red-darken-2",onClick:e.withModifiers(b=>C(u),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0)])],!0)]),key:"0"}:void 0,e.renderList(p.$slots,(u,b)=>({name:b,fn:e.withCtx(se=>[e.renderSlot(p.$slots,b,e.normalizeProps(e.guardReactiveProps(se??{})),void 0,!0)])}))]),1040,["page","items-per-page","sort-by","headers","items","items-length","loading","hover","density","height","show-select","items-per-page-text","no-data-text"])),e.createVNode(de,{modelValue:c.value,"onUpdate:modelValue":k[4]||(k[4]=u=>c.value=u),"max-width":"400","hide-close":!0},{header:e.withCtx(()=>[e.createElementVNode("div",W,e.toDisplayString(o.labelDeleteTitle),1)]),default:e.withCtx(()=>[e.createVNode(ne,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.deleteMessageFormatter&&f.value?o.deleteMessageFormatter(f.value):o.labelDeleteMessage),1)]),_:1}),e.createVNode(re,null,{default:e.withCtx(()=>[e.createVNode(ae),e.createVNode(L,{variant:"plain",color:"red-darken-2",text:o.labelDeleteCancel,onClick:k[3]||(k[3]=u=>c.value=!1)},null,8,["text"]),e.createVNode(L,{variant:"tonal",text:o.labelDeleteConfirm,onClick:D},null,8,["text"])]),_:1})]),_:1},8,["modelValue"])])}}}),x=(o,t)=>{const r=o.__vccOpts||o;for(const[n,a]of t)r[n]=a;return r},M=x(J,[["__scopeId","data-v-ee2b82fa"]]);var P=(o=>(o.IMAGE="image",o.MONEY="money",o.STATUS="status",o.BOOLEAN="boolean",o.GSM_NO="gsmNo",o))(P||{});const T=e.defineComponent({name:"FTextarea",inheritAttrs:!1,__name:"FTextarea",props:{name:{},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},label:{default:""},hideDetails:{type:[Boolean,String],default:"auto"},noResize:{type:Boolean,default:!0},rows:{default:""},modelValue:{default:""},rules:{type:[String,Function],default:""}},setup(o){const t=o,r=e.computed(()=>t.rules),{errorMessage:n,value:a}=B.useField(()=>t.name,r,{initialValue:t.modelValue,syncVModel:!0});return(s,l)=>(e.openBlock(),e.createBlock(e.unref(F.VTextarea),e.mergeProps(s.$attrs,{modelValue:e.unref(a),"onUpdate:modelValue":l[0]||(l[0]=c=>e.isRef(a)?a.value=c:null),name:t.name,rounded:t.rounded,variant:t.variant,rows:t.rows,density:t.density,color:t.color,label:t.label,"hide-details":t.hideDetails,"no-resize":t.noResize,"error-messages":e.unref(n)}),null,16,["modelValue","name","rounded","variant","rows","density","color","label","hide-details","no-resize","error-messages"]))}}),R=e.defineComponent({name:"FAutocomplete",inheritAttrs:!1,__name:"FAutocomplete",props:{name:{},items:{default:()=>[]},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},clearable:{type:Boolean,default:!0},hideDetails:{type:[Boolean,String],default:"auto"},returnObject:{type:Boolean,default:!0},noDataText:{default:""},modelValue:{default:null},rules:{type:[String,Function],default:""}},emits:["change"],setup(o,{emit:t}){const r=t,n=o,a=e.computed(()=>n.rules),{errorMessage:s,value:l}=B.useField(()=>n.name,a,{initialValue:n.modelValue,syncVModel:!0});function c(f){r("change",f)}return(f,m)=>(e.openBlock(),e.createBlock(e.unref(F.VAutocomplete),e.mergeProps(f.$attrs,{modelValue:e.unref(l),"onUpdate:modelValue":[m[0]||(m[0]=i=>e.isRef(l)?l.value=i:null),m[1]||(m[1]=i=>c(e.unref(l)))],name:n.name,items:n.items,rounded:n.rounded,variant:n.variant,density:n.density,color:n.color,clearable:n.clearable,"hide-details":n.hideDetails,"return-object":n.returnObject,"no-data-text":n.noDataText,"error-messages":e.unref(s),"menu-props":{maxWidth:0}}),e.createSlots({_:2},[e.renderList(f.$slots,(i,d)=>({name:d,fn:e.withCtx(_=>[e.renderSlot(f.$slots,d,e.normalizeProps(e.guardReactiveProps(_??{})))])}))]),1040,["modelValue","name","items","rounded","variant","density","color","clearable","hide-details","return-object","no-data-text","error-messages"]))}}),A=e.defineComponent({name:"FCheckbox",inheritAttrs:!1,__name:"FCheckbox",props:{color:{default:"secondary"},hideDetails:{type:[Boolean,String],default:"auto"},indeterminate:{type:Boolean,default:!1},density:{default:"compact"}},setup(o){const t=o;return(r,n)=>(e.openBlock(),e.createBlock(e.unref(F.VCheckbox),e.mergeProps(r.$attrs,{color:t.color,"hide-details":t.hideDetails,indeterminate:t.indeterminate,density:t.density}),null,16,["color","hide-details","indeterminate","density"]))}}),U=e.defineComponent({name:"FCurrencyField",inheritAttrs:!1,__name:"FCurrencyField",props:{name:{},label:{default:""},readonly:{type:Boolean,default:!1},hideDetails:{type:[Boolean,String],default:"auto"},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},locale:{default:"tr-TR"},currency:{default:"TRY"},precision:{default:2},modelValue:{default:null},rules:{type:[String,Function],default:""}},setup(o){const t=o,r=e.computed(()=>t.rules),{errorMessage:n,value:a}=B.useField(()=>t.name,r,{initialValue:t.modelValue,syncVModel:!0}),s=e.computed(()=>new Intl.NumberFormat(t.locale,{style:"currency",currency:t.currency,minimumFractionDigits:t.precision,maximumFractionDigits:t.precision})),l=e.ref(c(t.modelValue));function c(g){return g==null||isNaN(g)?"":s.value.format(g)}function f(g){const h=g.replace(/[^\d,.-]/g,"").replace(/\./g,"").replace(",","."),V=parseFloat(h);return isNaN(V)?null:Math.round(V*Math.pow(10,t.precision))/Math.pow(10,t.precision)}const m=e.ref(!1);function i(g){const h=g.target;l.value=h.value,a.value=f(h.value)}function d(){m.value=!1,l.value=c(a.value)}function _(g){m.value=!0;const h=g.target,V=a.value;V!=null?l.value=V.toFixed(t.precision).replace(".",","):l.value="",setTimeout(()=>h.select(),0)}return e.watch(()=>t.modelValue,g=>{a.value=g,m.value||(l.value=c(g))}),(g,h)=>(e.openBlock(),e.createBlock(e.unref(F.VTextField),e.mergeProps(g.$attrs,{"model-value":l.value,name:t.name,label:t.label,readonly:t.readonly,"hide-details":t.hideDetails,rounded:t.rounded,variant:t.variant,density:t.density,color:t.color,"error-messages":e.unref(n),inputmode:"decimal",onInput:i,onBlur:d,onFocus:_}),null,16,["model-value","name","label","readonly","hide-details","rounded","variant","density","color","error-messages"]))}}),I=e.defineComponent({name:"FSelect",inheritAttrs:!1,__name:"FSelect",props:{name:{},items:{default:()=>[]},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},hideDetails:{type:[Boolean,String],default:"auto"},returnObject:{type:Boolean,default:!1},modelValue:{default:""},rules:{type:[String,Function],default:""}},setup(o){const t=o,r=e.computed(()=>t.rules),{errorMessage:n,value:a}=B.useField(()=>t.name,r,{initialValue:t.modelValue,syncVModel:!0});return(s,l)=>(e.openBlock(),e.createBlock(e.unref(F.VSelect),e.mergeProps(s.$attrs,{modelValue:e.unref(a),"onUpdate:modelValue":l[0]||(l[0]=c=>e.isRef(a)?a.value=c:null),name:t.name,items:t.items,rounded:t.rounded,variant:t.variant,density:t.density,color:t.color,"hide-details":t.hideDetails,"return-object":t.returnObject,"error-messages":e.unref(n)}),e.createSlots({_:2},[e.renderList(s.$slots,(c,f)=>({name:f,fn:e.withCtx(m=>[e.renderSlot(s.$slots,f,e.normalizeProps(e.guardReactiveProps(m??{})))])}))]),1040,["modelValue","name","items","rounded","variant","density","color","hide-details","return-object","error-messages"]))}}),E=e.defineComponent({name:"FNumberField",inheritAttrs:!1,__name:"FNumberField",props:{name:{},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},controlVariant:{default:"stacked"},color:{default:"secondary"},label:{default:""},placeholder:{default:""},prefix:{default:""},hideDetails:{type:[Boolean,String],default:"auto"},disabled:{type:Boolean,default:!1},readonly:{type:Boolean,default:!1},min:{default:0},precision:{default:0},inset:{type:Boolean,default:!0},modelValue:{default:-1},rules:{type:[String,Function],default:""}},setup(o){const t=o,r=e.computed(()=>t.rules),{errorMessage:n,value:a}=B.useField(()=>t.name,r,{initialValue:t.modelValue,syncVModel:!0});return(s,l)=>(e.openBlock(),e.createBlock(e.unref(F.VNumberInput),e.mergeProps(s.$attrs,{modelValue:e.unref(a),"onUpdate:modelValue":l[0]||(l[0]=c=>e.isRef(a)?a.value=c:null),name:t.name,color:t.color,density:t.density,rounded:t.rounded,variant:t.variant,"control-variant":t.controlVariant,"hide-details":t.hideDetails,placeholder:t.placeholder,label:t.label,prefix:t.prefix,disabled:t.disabled,readonly:t.readonly,min:t.min,precision:t.precision,inset:t.inset,"error-messages":e.unref(n)}),null,16,["modelValue","name","color","density","rounded","variant","control-variant","hide-details","placeholder","label","prefix","disabled","readonly","min","precision","inset","error-messages"]))}}),K={key:0},Q={key:1},O=e.defineComponent({name:"FSwitch",inheritAttrs:!1,__name:"FSwitch",props:e.mergeModels({color:{default:"secondary"},density:{default:"comfortable"},hideDetails:{type:[Boolean,String],default:"auto"},labelTrue:{default:""},labelFalse:{default:""}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:["update:modelValue"],setup(o){const t=o,r=e.useModel(o,"modelValue");return(n,a)=>(e.openBlock(),e.createBlock(e.unref(F.VSwitch),e.mergeProps(n.$attrs,{modelValue:r.value,"onUpdate:modelValue":a[0]||(a[0]=s=>r.value=s),color:t.color,"hide-details":t.hideDetails,density:t.density}),e.createSlots({_:2},[t.labelTrue||t.labelFalse?{name:"label",fn:e.withCtx(()=>[r.value?(e.openBlock(),e.createElementBlock("span",K,e.toDisplayString(t.labelTrue),1)):(e.openBlock(),e.createElementBlock("span",Q,e.toDisplayString(t.labelFalse),1))]),key:"0"}:void 0]),1040,["modelValue","color","hide-details","density"]))}}),j=e.defineComponent({name:"FDialog",inheritAttrs:!1,__name:"FDialog",props:e.mergeModels({width:{default:750},persistent:{type:Boolean,default:!0},transition:{default:"slide-y-transition"},hideClose:{type:Boolean,default:!1}},{modelValue:{type:Boolean},modelModifiers:{}}),emits:e.mergeModels(["closeDialog"],["update:modelValue"]),setup(o){const t=o,r=e.useModel(o,"modelValue");return(n,a)=>{const s=e.resolveComponent("v-btn"),l=e.resolveComponent("v-card-title"),c=e.resolveComponent("v-divider"),f=e.resolveComponent("v-card-text"),m=e.resolveComponent("v-card"),i=e.resolveComponent("v-dialog");return e.openBlock(),e.createBlock(i,e.mergeProps(n.$attrs,{modelValue:r.value,"onUpdate:modelValue":a[1]||(a[1]=d=>r.value=d),transition:t.transition,class:"f-dialog",width:t.width,persistent:t.persistent}),{default:e.withCtx(()=>[e.createVNode(m,{class:"f-dialog-card",density:"default",variant:"elevated",rounded:"lg"},{default:e.withCtx(()=>[e.createVNode(l,{class:"d-flex justify-space-between align-center"},{default:e.withCtx(()=>[e.createElementVNode("header",null,[e.renderSlot(n.$slots,"header")]),t.hideClose?e.createCommentVNode("",!0):(e.openBlock(),e.createBlock(s,{key:0,icon:"mdi-close",variant:"text",onClick:a[0]||(a[0]=d=>n.$emit("closeDialog"))}))]),_:3}),e.createVNode(c),e.createVNode(f,{class:"py-4 px-1 overflow-auto overflow-x-hidden"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default")]),_:3})]),_:3})]),_:3},16,["modelValue","transition","width","persistent"])}}}),Z={class:"d-flex mt-5 mb-n6",style:{width:"100%"}},z=x(e.defineComponent({name:"FTimePicker",inheritAttrs:!1,__name:"FTimePicker",props:{name:{},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},hideDetails:{type:[Boolean,String],default:"auto"},readonly:{type:Boolean,default:!1},modelValue:{default:""},rules:{type:[String,Function],default:""},labelCancel:{default:"Cancel"},labelConfirm:{default:"Confirm"}},setup(o){const t=o,r=e.computed(()=>t.rules),{errorMessage:n,value:a}=B.useField(()=>t.name,r,{initialValue:t.modelValue||"",syncVModel:!0}),s=e.ref(!1),l=e.ref(a);function c(){a.value=l.value,s.value=!1}function f(m){l.value&&l.value.includes(":")&&(l.value=m.toString().padStart(2,"0")+l.value.substring(l.value.indexOf(":")))}return(m,i)=>{const d=e.resolveComponent("v-btn"),_=e.resolveComponent("v-spacer"),g=e.resolveComponent("v-time-picker"),h=e.resolveComponent("v-menu"),V=e.resolveComponent("v-text-field");return e.openBlock(),e.createBlock(V,e.mergeProps(m.$attrs,{modelValue:e.unref(a),"onUpdate:modelValue":i[4]||(i[4]=C=>e.isRef(a)?a.value=C:null),"prepend-inner-icon":"mdi-clock-time-four-outline",name:t.name,active:s.value,focus:s.value,density:t.density,rounded:t.rounded,variant:t.variant,"hide-details":t.hideDetails,readonly:t.readonly,"error-messages":e.unref(n)}),{default:e.withCtx(()=>[e.createVNode(h,{modelValue:s.value,"onUpdate:modelValue":i[3]||(i[3]=C=>s.value=C),activator:"parent",location:"center",disabled:t.readonly,"close-on-content-click":!1},{default:e.withCtx(()=>[s.value?(e.openBlock(),e.createBlock(g,{key:0,modelValue:l.value,"onUpdate:modelValue":i[1]||(i[1]=C=>l.value=C),"full-width":"",color:"secondary",format:"24hr","onUpdate:hour":i[2]||(i[2]=C=>f(C))},{actions:e.withCtx(()=>[e.createElementVNode("div",Z,[e.createVNode(d,{variant:"text",color:"gray",text:t.labelCancel,onClick:i[0]||(i[0]=C=>s.value=!1)},null,8,["text"]),e.createVNode(_),e.createVNode(d,{variant:"text",text:t.labelConfirm,onClick:c},null,8,["text"])])]),_:1},8,["modelValue"])):e.createCommentVNode("",!0)]),_:1},8,["modelValue","disabled"])]),_:1},16,["modelValue","name","active","focus","density","rounded","variant","hide-details","readonly","error-messages"])}}}),[["__scopeId","data-v-bd1f1133"]]),ee={class:"position-relative"},v=x(e.defineComponent({name:"FDatePicker",inheritAttrs:!1,__name:"FDatePicker",props:{name:{},rounded:{default:"lg"},variant:{default:"outlined"},density:{default:"compact"},color:{default:"secondary"},hideDetails:{type:[Boolean,String],default:"auto"},disabled:{type:Boolean,default:!1},modelValue:{default:""},rules:{type:[String,Function],default:""},max:{default:void 0},locale:{default:"en"},firstDayOfWeek:{default:1},dateFormat:{default:"DD/MM/YYYY"}},setup(o){const t=o,r=e.computed(()=>t.rules);function n(i){if(!i)return"";let d;if(i instanceof Date)d=i;else{const V=i.split("/");V.length===3?d=new Date(Number(V[2]),Number(V[1])-1,Number(V[0])):d=new Date(i)}if(isNaN(d.getTime()))return"";const _=`0${d.getDate()}`.slice(-2),g=`0${d.getMonth()+1}`.slice(-2),h=d.getFullYear();return`${_}/${g}/${h}`}function a(i){if(!i)return null;const d=i.split("/");return d.length===3?new Date(Number(d[2]),Number(d[1])-1,Number(d[0])):null}const{errorMessage:s,value:l}=B.useField(()=>t.name,r,{initialValue:t.modelValue?n(t.modelValue):"",syncVModel:!0}),c=e.ref(null),f=e.ref(!1),m=i=>{l.value=n(i),f.value=!1};return e.onMounted(()=>{c.value=t.modelValue?a(t.modelValue):null,l.value=t.modelValue?n(t.modelValue):""}),(i,d)=>{const _=e.resolveComponent("v-text-field"),g=e.resolveComponent("v-date-picker"),h=e.resolveComponent("v-locale-provider"),V=e.resolveComponent("v-btn"),C=e.resolveComponent("v-menu");return e.openBlock(),e.createBlock(C,{modelValue:f.value,"onUpdate:modelValue":d[4]||(d[4]=D=>f.value=D),location:"center",disabled:t.disabled,"close-on-content-click":!1},{activator:e.withCtx(({props:D})=>[e.createVNode(_,e.mergeProps({...i.$attrs,...D},{modelValue:e.unref(l),"onUpdate:modelValue":d[0]||(d[0]=p=>e.isRef(l)?l.value=p:null),"prepend-inner-icon":"mdi-calendar-outline",name:t.name,density:t.density,rounded:t.rounded,variant:t.variant,"hide-details":t.hideDetails,color:t.color,readonly:"","error-messages":e.unref(s),"onClick:clear":d[1]||(d[1]=p=>l.value="")}),null,16,["modelValue","name","density","rounded","variant","hide-details","color","error-messages"])]),default:e.withCtx(()=>[e.createElementVNode("div",ee,[e.createVNode(h,{locale:t.locale},{default:e.withCtx(()=>[e.createVNode(g,{modelValue:c.value,"onUpdate:modelValue":[d[2]||(d[2]=D=>c.value=D),m],title:"",elevation:"10","first-day-of-week":t.firstDayOfWeek,max:t.max,color:t.color,"show-adjacent-months":"",rounded:t.rounded},null,8,["modelValue","first-day-of-week","max","color","rounded"])]),_:1},8,["locale"]),e.createVNode(V,{class:"position-absolute top-0 right-0",color:"white",icon:"mdi-close",size:"small",variant:"text",onClick:d[3]||(d[3]=D=>f.value=!1)})])]),_:1},8,["modelValue","disabled"])}}}),[["__scopeId","data-v-6f068869"]]),te={install(o){o.component("FButton",$),o.component("FTextField",N),o.component("FDataTable",M),o.component("FTextarea",T),o.component("FAutocomplete",R),o.component("FCheckbox",A),o.component("FCurrencyField",U),o.component("FSelect",I),o.component("FNumberField",E),o.component("FSwitch",O),o.component("FDialog",j),o.component("FTimePicker",z),o.component("FDatePicker",v)}};y.FAutocomplete=R,y.FButton=$,y.FCheckbox=A,y.FCurrencyField=U,y.FDataTable=M,y.FDataTableHeaderType=P,y.FDatePicker=v,y.FDialog=j,y.FNumberField=E,y.FSelect=I,y.FSwitch=O,y.FTextField=N,y.FTextarea=T,y.FTimePicker=z,y.default=te,Object.defineProperties(y,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,8 @@ export { FSelect } from './components/FSelect';
|
|
|
10
10
|
export { FNumberField } from './components/FNumberField';
|
|
11
11
|
export { FSwitch } from './components/FSwitch';
|
|
12
12
|
export { FDialog } from './components/FDialog';
|
|
13
|
+
export { FTimePicker } from './components/FTimePicker';
|
|
14
|
+
export { FDatePicker } from './components/FDatePicker';
|
|
13
15
|
export type { FButtonProps } from './components/FButton';
|
|
14
16
|
export type { FTextFieldProps } from './components/FTextField';
|
|
15
17
|
export type { FDataTableProps, FDataTableHeader } from './components/FDataTable';
|
|
@@ -21,6 +23,8 @@ export type { FSelectProps } from './components/FSelect';
|
|
|
21
23
|
export type { FNumberFieldProps } from './components/FNumberField';
|
|
22
24
|
export type { FSwitchProps } from './components/FSwitch';
|
|
23
25
|
export type { FDialogProps } from './components/FDialog';
|
|
26
|
+
export type { FTimePickerProps } from './components/FTimePicker';
|
|
27
|
+
export type { FDatePickerProps } from './components/FDatePicker';
|
|
24
28
|
import { FButton } from './components/FButton';
|
|
25
29
|
import { FTextField } from './components/FTextField';
|
|
26
30
|
import { FDataTable } from './components/FDataTable';
|
|
@@ -32,6 +36,8 @@ import { FSelect } from './components/FSelect';
|
|
|
32
36
|
import { FNumberField } from './components/FNumberField';
|
|
33
37
|
import { FSwitch } from './components/FSwitch';
|
|
34
38
|
import { FDialog } from './components/FDialog';
|
|
39
|
+
import { FTimePicker } from './components/FTimePicker';
|
|
40
|
+
import { FDatePicker } from './components/FDatePicker';
|
|
35
41
|
declare const FinsoComponents: Plugin;
|
|
36
42
|
export default FinsoComponents;
|
|
37
43
|
declare module 'vue' {
|
|
@@ -47,5 +53,7 @@ declare module 'vue' {
|
|
|
47
53
|
FNumberField: typeof FNumberField;
|
|
48
54
|
FSwitch: typeof FSwitch;
|
|
49
55
|
FDialog: typeof FDialog;
|
|
56
|
+
FTimePicker: typeof FTimePicker;
|
|
57
|
+
FDatePicker: typeof FDatePicker;
|
|
50
58
|
}
|
|
51
59
|
}
|