finso-vue-components 0.4.5 → 0.4.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/FDataTable/FDataTable.vue.d.ts +1 -9
- package/dist/components/FDataTable/index.d.ts +3 -1
- package/dist/components/FDataTable/types.d.ts +15 -0
- package/dist/components/FDialog/FDialog.vue.d.ts +33 -0
- package/dist/components/FDialog/index.d.ts +2 -0
- package/dist/finso-vue-components.css +1 -1
- package/dist/finso-vue-components.js +268 -200
- package/dist/finso-vue-components.umd.cjs +1 -1
- package/dist/index.d.ts +6 -2
- package/package.json +1 -1
|
@@ -1,12 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
export interface FDataTableHeader {
|
|
3
|
-
title: string;
|
|
4
|
-
key: string;
|
|
5
|
-
align?: 'start' | 'center' | 'end';
|
|
6
|
-
sortable?: boolean;
|
|
7
|
-
width?: string | number;
|
|
8
|
-
type?: FDataTableHeaderType;
|
|
9
|
-
}
|
|
1
|
+
import type { FDataTableHeader } from './types';
|
|
10
2
|
export interface FDataTableProps {
|
|
11
3
|
headers: FDataTableHeader[];
|
|
12
4
|
items: Record<string, unknown>[];
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
export { default as FDataTable } from './FDataTable.vue';
|
|
2
|
-
export
|
|
2
|
+
export { FDataTableHeaderType } from './types';
|
|
3
|
+
export type { FDataTableHeader } from './types';
|
|
4
|
+
export type { FDataTableProps } from './FDataTable.vue';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export declare enum FDataTableHeaderType {
|
|
2
|
+
IMAGE = "image",
|
|
3
|
+
MONEY = "money",
|
|
4
|
+
STATUS = "status",
|
|
5
|
+
BOOLEAN = "boolean",
|
|
6
|
+
GSM_NO = "gsmNo"
|
|
7
|
+
}
|
|
8
|
+
export interface FDataTableHeader {
|
|
9
|
+
title: string;
|
|
10
|
+
key: string;
|
|
11
|
+
align?: 'start' | 'center' | 'end';
|
|
12
|
+
sortable?: boolean;
|
|
13
|
+
width?: string | number;
|
|
14
|
+
type?: FDataTableHeaderType;
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
export interface FDialogProps {
|
|
2
|
+
width?: number;
|
|
3
|
+
persistent?: boolean;
|
|
4
|
+
transition?: string;
|
|
5
|
+
}
|
|
6
|
+
type __VLS_Props = FDialogProps;
|
|
7
|
+
type __VLS_PublicProps = __VLS_Props & {
|
|
8
|
+
modelValue?: boolean;
|
|
9
|
+
};
|
|
10
|
+
declare var __VLS_14: {}, __VLS_32: {};
|
|
11
|
+
type __VLS_Slots = {} & {
|
|
12
|
+
header?: (props: typeof __VLS_14) => any;
|
|
13
|
+
} & {
|
|
14
|
+
default?: (props: typeof __VLS_32) => any;
|
|
15
|
+
};
|
|
16
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_PublicProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
|
+
"update:modelValue": (value: boolean | undefined) => any;
|
|
18
|
+
closeDialog: () => any;
|
|
19
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_PublicProps> & Readonly<{
|
|
20
|
+
"onUpdate:modelValue"?: ((value: boolean | undefined) => any) | undefined;
|
|
21
|
+
onCloseDialog?: (() => any) | undefined;
|
|
22
|
+
}>, {
|
|
23
|
+
width: number;
|
|
24
|
+
transition: string;
|
|
25
|
+
persistent: boolean;
|
|
26
|
+
}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
27
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
28
|
+
export default _default;
|
|
29
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
30
|
+
new (): {
|
|
31
|
+
$slots: S;
|
|
32
|
+
};
|
|
33
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
.f-data-table__logo[data-v-
|
|
1
|
+
.f-data-table__logo[data-v-e4c3ed73]{object-fit:contain}.f-data-table__actions[data-v-e4c3ed73]{display:flex;gap:4px;align-items:center}.f-dialog-card[data-v-5c571a9a]{border-radius:var(--dialog-radius)!important;border:2px solid rgba(255,255,255,.2)!important;background:rgb(var(--v-theme-surface))!important;overflow:hidden}
|
|
@@ -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 _, resolveComponent as y, openBlock as f, createBlock as b, computed as V, withDirectives as se, unref as p, mergeProps as D, isRef as U, createSlots as X, renderList as T, withCtx as m, renderSlot as S, normalizeProps as O, guardReactiveProps as z, useModel as N, ref as E, createElementBlock as P, resolveDynamicComponent as de, toHandlers as ie, createVNode as F, toDisplayString as k, createTextVNode as M, createCommentVNode as L, createElementVNode as Y, withModifiers as G, mergeModels as I, watch as ue } from "vue";
|
|
2
|
+
import { VTextField as W, 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 A } from "vee-validate";
|
|
5
|
+
const be = /* @__PURE__ */ _({
|
|
6
6
|
__name: "FButton",
|
|
7
7
|
props: {
|
|
8
8
|
color: { default: "primary" },
|
|
@@ -11,14 +11,14 @@ const ge = /* @__PURE__ */ k({
|
|
|
11
11
|
setup(t) {
|
|
12
12
|
const e = t;
|
|
13
13
|
return (n, a) => {
|
|
14
|
-
const l =
|
|
15
|
-
return f(),
|
|
14
|
+
const l = y("v-btn");
|
|
15
|
+
return f(), b(l, {
|
|
16
16
|
color: e.color,
|
|
17
17
|
rounded: e.rounded
|
|
18
18
|
}, null, 8, ["color", "rounded"]);
|
|
19
19
|
};
|
|
20
20
|
}
|
|
21
|
-
}),
|
|
21
|
+
}), he = /* @__PURE__ */ _({
|
|
22
22
|
name: "FTextField",
|
|
23
23
|
inheritAttrs: !1,
|
|
24
24
|
__name: "FTextField",
|
|
@@ -37,13 +37,13 @@ const ge = /* @__PURE__ */ k({
|
|
|
37
37
|
},
|
|
38
38
|
emits: ["clickAppendInner"],
|
|
39
39
|
setup(t) {
|
|
40
|
-
const e = t, n =
|
|
40
|
+
const e = t, n = V(() => e.rules), { errorMessage: a, value: l } = A(() => e.name, n, {
|
|
41
41
|
initialValue: e.modelValue,
|
|
42
42
|
syncVModel: !0
|
|
43
43
|
});
|
|
44
|
-
return (
|
|
45
|
-
modelValue:
|
|
46
|
-
"onUpdate:modelValue":
|
|
44
|
+
return (i, o) => se((f(), b(p(W), D(i.$attrs, {
|
|
45
|
+
modelValue: p(l),
|
|
46
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => U(l) ? l.value = s : null),
|
|
47
47
|
name: e.name,
|
|
48
48
|
color: e.color,
|
|
49
49
|
density: e.density,
|
|
@@ -51,25 +51,25 @@ const ge = /* @__PURE__ */ k({
|
|
|
51
51
|
variant: e.variant,
|
|
52
52
|
clearable: e.clearable,
|
|
53
53
|
"hide-details": e.hideDetails,
|
|
54
|
-
"error-messages":
|
|
54
|
+
"error-messages": p(a),
|
|
55
55
|
"append-inner-icon": e.appendInnerIcon,
|
|
56
|
-
"onClick:appendInner":
|
|
57
|
-
}),
|
|
58
|
-
|
|
59
|
-
name:
|
|
60
|
-
fn:
|
|
61
|
-
|
|
56
|
+
"onClick:appendInner": o[1] || (o[1] = (s) => i.$emit("clickAppendInner"))
|
|
57
|
+
}), X({ _: 2 }, [
|
|
58
|
+
T(i.$slots, (s, c) => ({
|
|
59
|
+
name: c,
|
|
60
|
+
fn: m((u) => [
|
|
61
|
+
S(i.$slots, c, O(z(u ?? {})))
|
|
62
62
|
])
|
|
63
63
|
}))
|
|
64
64
|
]), 1040, ["modelValue", "name", "color", "density", "rounded", "variant", "clearable", "hide-details", "error-messages", "append-inner-icon"])), [
|
|
65
|
-
[
|
|
65
|
+
[p(ge), e.mask]
|
|
66
66
|
]);
|
|
67
67
|
}
|
|
68
|
-
}),
|
|
68
|
+
}), Fe = { key: 1 }, Ve = { key: 4 }, _e = { class: "f-data-table__actions" }, ke = /* @__PURE__ */ _({
|
|
69
69
|
name: "FDataTable",
|
|
70
70
|
inheritAttrs: !1,
|
|
71
71
|
__name: "FDataTable",
|
|
72
|
-
props: /* @__PURE__ */
|
|
72
|
+
props: /* @__PURE__ */ I({
|
|
73
73
|
headers: {},
|
|
74
74
|
items: {},
|
|
75
75
|
loading: { type: Boolean, default: !1 },
|
|
@@ -103,49 +103,50 @@ const ge = /* @__PURE__ */ k({
|
|
|
103
103
|
sortBy: { default: () => [] },
|
|
104
104
|
sortByModifiers: {}
|
|
105
105
|
}),
|
|
106
|
-
emits: /* @__PURE__ */
|
|
106
|
+
emits: /* @__PURE__ */ I(["show-record", "delete-record"], ["update:page", "update:itemsPerPage", "update:sortBy"]),
|
|
107
107
|
setup(t, { emit: e }) {
|
|
108
|
-
const n = t, a = e, l =
|
|
109
|
-
function
|
|
110
|
-
return
|
|
108
|
+
const n = t, a = e, l = N(t, "page"), i = N(t, "itemsPerPage"), o = N(t, "sortBy"), s = E(!1), c = E(null);
|
|
109
|
+
function u(d, v) {
|
|
110
|
+
return v.split(".").reduce((C, H) => C == null ? void 0 : C[H], d);
|
|
111
111
|
}
|
|
112
|
-
function $(
|
|
113
|
-
return
|
|
112
|
+
function $(d) {
|
|
113
|
+
return d == null ? "" : new Intl.NumberFormat(n.moneyLocale, {
|
|
114
114
|
style: "currency",
|
|
115
115
|
currency: n.moneyCurrency
|
|
116
|
-
}).format(
|
|
116
|
+
}).format(d);
|
|
117
117
|
}
|
|
118
|
-
function
|
|
119
|
-
if (!
|
|
120
|
-
const
|
|
121
|
-
return
|
|
118
|
+
function B(d) {
|
|
119
|
+
if (!d) return "";
|
|
120
|
+
const v = d.replace(/\D/g, "");
|
|
121
|
+
return v.length < 10 ? d : `(${v.substring(0, 3)}) ${v.substring(3, 6)} ${v.substring(6, 10)}`;
|
|
122
122
|
}
|
|
123
|
-
const R =
|
|
124
|
-
const
|
|
125
|
-
return Math.min(
|
|
126
|
-
}),
|
|
127
|
-
"click:row": (
|
|
128
|
-
a("show-record",
|
|
123
|
+
const R = V(() => {
|
|
124
|
+
const C = n.items.length * 52 + 56;
|
|
125
|
+
return Math.min(C, n.maxHeight);
|
|
126
|
+
}), g = V(() => !n.canEditRecord && !n.canReadRecord ? {} : {
|
|
127
|
+
"click:row": (d, { item: v }) => {
|
|
128
|
+
a("show-record", v);
|
|
129
129
|
}
|
|
130
|
-
}),
|
|
131
|
-
() => n.headers.filter((
|
|
132
|
-
),
|
|
133
|
-
function
|
|
134
|
-
n.showDeleteConfirm ? (
|
|
130
|
+
}), w = V(
|
|
131
|
+
() => n.headers.filter((d) => d.type && d.key !== "actions")
|
|
132
|
+
), x = V(() => n.headers.some((d) => d.key === "actions"));
|
|
133
|
+
function J(d) {
|
|
134
|
+
n.showDeleteConfirm ? (c.value = d, s.value = !0) : a("delete-record", d);
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
a("delete-record",
|
|
136
|
+
function K() {
|
|
137
|
+
a("delete-record", c.value), s.value = !1, c.value = null;
|
|
138
138
|
}
|
|
139
|
-
return (
|
|
140
|
-
const
|
|
139
|
+
return (d, v) => {
|
|
140
|
+
const C = y("v-img"), H = y("v-avatar"), Q = y("v-chip"), Z = y("v-icon"), j = y("v-btn"), ee = y("v-card-title"), te = y("v-card-text"), ae = y("v-spacer"), le = y("v-card-actions"), ne = y("v-card"), oe = y("v-dialog");
|
|
141
141
|
return f(), P("div", null, [
|
|
142
|
-
(f(),
|
|
142
|
+
(f(), b(de(t.serverSide ? "v-data-table-server" : "v-data-table"), D(d.$attrs, {
|
|
143
143
|
page: l.value,
|
|
144
|
-
"onUpdate:page":
|
|
145
|
-
"items-per-page":
|
|
146
|
-
"onUpdate:itemsPerPage":
|
|
147
|
-
"sort-by":
|
|
148
|
-
"onUpdate:sortBy":
|
|
144
|
+
"onUpdate:page": v[0] || (v[0] = (r) => l.value = r),
|
|
145
|
+
"items-per-page": i.value,
|
|
146
|
+
"onUpdate:itemsPerPage": v[1] || (v[1] = (r) => i.value = r),
|
|
147
|
+
"sort-by": o.value,
|
|
148
|
+
"onUpdate:sortBy": v[2] || (v[2] = (r) => o.value = r),
|
|
149
|
+
class: "rounded-b-lg",
|
|
149
150
|
headers: t.headers,
|
|
150
151
|
items: t.items,
|
|
151
152
|
"items-length": t.serverSide ? t.totalCount : void 0,
|
|
@@ -156,118 +157,120 @@ const ge = /* @__PURE__ */ k({
|
|
|
156
157
|
"show-select": t.showSelect,
|
|
157
158
|
"items-per-page-text": t.labelItemsPerPage,
|
|
158
159
|
"no-data-text": t.labelNoData
|
|
159
|
-
},
|
|
160
|
-
|
|
161
|
-
name: `item.${
|
|
162
|
-
fn:
|
|
163
|
-
|
|
164
|
-
item:
|
|
165
|
-
value:
|
|
160
|
+
}, ie(g.value)), X({ _: 2 }, [
|
|
161
|
+
T(w.value, (r) => ({
|
|
162
|
+
name: `item.${r.key}`,
|
|
163
|
+
fn: m(({ item: h }) => [
|
|
164
|
+
S(d.$slots, `item.${r.key}`, {
|
|
165
|
+
item: h,
|
|
166
|
+
value: u(h, r.key)
|
|
166
167
|
}, () => [
|
|
167
|
-
|
|
168
|
+
r.type === "image" ? (f(), b(H, {
|
|
168
169
|
key: 0,
|
|
169
170
|
rounded: "lg",
|
|
170
|
-
variant: "elevated"
|
|
171
|
+
variant: "elevated",
|
|
172
|
+
color: "white"
|
|
171
173
|
}, {
|
|
172
|
-
default:
|
|
173
|
-
|
|
174
|
-
src:
|
|
174
|
+
default: m(() => [
|
|
175
|
+
F(C, {
|
|
176
|
+
src: u(h, r.key),
|
|
175
177
|
class: "f-data-table__logo"
|
|
176
178
|
}, null, 8, ["src"])
|
|
177
179
|
]),
|
|
178
180
|
_: 2
|
|
179
|
-
}, 1024)) :
|
|
181
|
+
}, 1024)) : r.type === "money" ? (f(), P("span", Fe, k($(u(h, r.key))), 1)) : r.type === "status" ? (f(), b(Q, {
|
|
180
182
|
key: 2,
|
|
181
|
-
color:
|
|
183
|
+
color: u(h, r.key) ? "green-darken-1" : "red-darken-2",
|
|
182
184
|
size: "small"
|
|
183
185
|
}, {
|
|
184
|
-
default:
|
|
185
|
-
|
|
186
|
+
default: m(() => [
|
|
187
|
+
M(k(u(h, r.key) ? t.labelActive : t.labelPassive), 1)
|
|
186
188
|
]),
|
|
187
189
|
_: 2
|
|
188
|
-
}, 1032, ["color"])) :
|
|
190
|
+
}, 1032, ["color"])) : r.type === "boolean" ? (f(), b(Z, {
|
|
189
191
|
key: 3,
|
|
190
|
-
color:
|
|
192
|
+
color: u(h, r.key) ? "green-darken-1" : "red-darken-2"
|
|
191
193
|
}, {
|
|
192
|
-
default:
|
|
193
|
-
|
|
194
|
+
default: m(() => [
|
|
195
|
+
M(k(u(h, r.key) ? "mdi-check" : "mdi-close"), 1)
|
|
194
196
|
]),
|
|
195
197
|
_: 2
|
|
196
|
-
}, 1032, ["color"])) :
|
|
198
|
+
}, 1032, ["color"])) : r.type === "gsmNo" ? (f(), P("span", Ve, k(B(u(h, r.key))), 1)) : L("", !0)
|
|
197
199
|
], !0)
|
|
198
200
|
])
|
|
199
201
|
})),
|
|
200
|
-
|
|
202
|
+
x.value ? {
|
|
201
203
|
name: "item.actions",
|
|
202
|
-
fn:
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
t.canEditRecord || t.canReadRecord ? (f(),
|
|
204
|
+
fn: m(({ item: r }) => [
|
|
205
|
+
S(d.$slots, "item.actions", { item: r }, () => [
|
|
206
|
+
Y("div", _e, [
|
|
207
|
+
t.canEditRecord || t.canReadRecord ? (f(), b(j, {
|
|
206
208
|
key: 0,
|
|
207
|
-
|
|
209
|
+
color: "primary",
|
|
210
|
+
icon: "mdi-pencil-outline",
|
|
208
211
|
variant: "text",
|
|
209
212
|
size: "small",
|
|
210
|
-
onClick:
|
|
211
|
-
}, null, 8, ["onClick"])) :
|
|
212
|
-
t.canDeleteRecord ? (f(),
|
|
213
|
+
onClick: G((h) => a("show-record", r), ["stop"])
|
|
214
|
+
}, null, 8, ["onClick"])) : L("", !0),
|
|
215
|
+
t.canDeleteRecord ? (f(), b(j, {
|
|
213
216
|
key: 1,
|
|
214
|
-
icon: "mdi-
|
|
217
|
+
icon: "mdi-trash-can-outline",
|
|
215
218
|
variant: "text",
|
|
216
219
|
size: "small",
|
|
217
220
|
color: "red-darken-2",
|
|
218
|
-
onClick:
|
|
219
|
-
}, null, 8, ["onClick"])) :
|
|
221
|
+
onClick: G((h) => J(r), ["stop"])
|
|
222
|
+
}, null, 8, ["onClick"])) : L("", !0)
|
|
220
223
|
])
|
|
221
224
|
], !0)
|
|
222
225
|
]),
|
|
223
226
|
key: "0"
|
|
224
227
|
} : void 0,
|
|
225
|
-
|
|
226
|
-
name:
|
|
227
|
-
fn:
|
|
228
|
-
|
|
228
|
+
T(d.$slots, (r, h) => ({
|
|
229
|
+
name: h,
|
|
230
|
+
fn: m((re) => [
|
|
231
|
+
S(d.$slots, h, O(z(re ?? {})), void 0, !0)
|
|
229
232
|
])
|
|
230
233
|
}))
|
|
231
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"])),
|
|
232
|
-
|
|
233
|
-
modelValue:
|
|
234
|
-
"onUpdate:modelValue":
|
|
235
|
+
F(oe, {
|
|
236
|
+
modelValue: s.value,
|
|
237
|
+
"onUpdate:modelValue": v[4] || (v[4] = (r) => s.value = r),
|
|
235
238
|
"max-width": "400"
|
|
236
239
|
}, {
|
|
237
|
-
default:
|
|
238
|
-
|
|
239
|
-
default:
|
|
240
|
-
|
|
241
|
-
default:
|
|
242
|
-
|
|
240
|
+
default: m(() => [
|
|
241
|
+
F(ne, null, {
|
|
242
|
+
default: m(() => [
|
|
243
|
+
F(ee, null, {
|
|
244
|
+
default: m(() => [
|
|
245
|
+
M(k(t.labelDeleteTitle), 1)
|
|
243
246
|
]),
|
|
244
247
|
_: 1
|
|
245
248
|
}),
|
|
246
|
-
|
|
247
|
-
default:
|
|
248
|
-
|
|
249
|
+
F(te, null, {
|
|
250
|
+
default: m(() => [
|
|
251
|
+
M(k(t.deleteMessageFormatter && c.value ? t.deleteMessageFormatter(c.value) : t.labelDeleteMessage), 1)
|
|
249
252
|
]),
|
|
250
253
|
_: 1
|
|
251
254
|
}),
|
|
252
|
-
|
|
253
|
-
default:
|
|
254
|
-
|
|
255
|
-
|
|
255
|
+
F(le, null, {
|
|
256
|
+
default: m(() => [
|
|
257
|
+
F(ae),
|
|
258
|
+
F(j, {
|
|
256
259
|
variant: "text",
|
|
257
|
-
onClick:
|
|
260
|
+
onClick: v[3] || (v[3] = (r) => s.value = !1)
|
|
258
261
|
}, {
|
|
259
|
-
default:
|
|
260
|
-
|
|
262
|
+
default: m(() => [
|
|
263
|
+
M(k(t.labelDeleteCancel), 1)
|
|
261
264
|
]),
|
|
262
265
|
_: 1
|
|
263
266
|
}),
|
|
264
|
-
|
|
267
|
+
F(j, {
|
|
265
268
|
color: "red-darken-2",
|
|
266
269
|
variant: "flat",
|
|
267
|
-
onClick:
|
|
270
|
+
onClick: K
|
|
268
271
|
}, {
|
|
269
|
-
default:
|
|
270
|
-
|
|
272
|
+
default: m(() => [
|
|
273
|
+
M(k(t.labelDeleteConfirm), 1)
|
|
271
274
|
]),
|
|
272
275
|
_: 1
|
|
273
276
|
})
|
|
@@ -283,12 +286,14 @@ const ge = /* @__PURE__ */ k({
|
|
|
283
286
|
]);
|
|
284
287
|
};
|
|
285
288
|
}
|
|
286
|
-
}),
|
|
289
|
+
}), q = (t, e) => {
|
|
287
290
|
const n = t.__vccOpts || t;
|
|
288
291
|
for (const [a, l] of e)
|
|
289
292
|
n[a] = l;
|
|
290
293
|
return n;
|
|
291
|
-
},
|
|
294
|
+
}, De = /* @__PURE__ */ q(ke, [["__scopeId", "data-v-e4c3ed73"]]);
|
|
295
|
+
var $e = /* @__PURE__ */ ((t) => (t.IMAGE = "image", t.MONEY = "money", t.STATUS = "status", t.BOOLEAN = "boolean", t.GSM_NO = "gsmNo", t))($e || {});
|
|
296
|
+
const Be = /* @__PURE__ */ _({
|
|
292
297
|
name: "FTextarea",
|
|
293
298
|
inheritAttrs: !1,
|
|
294
299
|
__name: "FTextarea",
|
|
@@ -306,13 +311,13 @@ const ge = /* @__PURE__ */ k({
|
|
|
306
311
|
rules: { type: [String, Function], default: "" }
|
|
307
312
|
},
|
|
308
313
|
setup(t) {
|
|
309
|
-
const e = t, n =
|
|
314
|
+
const e = t, n = V(() => e.rules), { errorMessage: a, value: l } = A(() => e.name, n, {
|
|
310
315
|
initialValue: e.modelValue,
|
|
311
316
|
syncVModel: !0
|
|
312
317
|
});
|
|
313
|
-
return (
|
|
314
|
-
modelValue:
|
|
315
|
-
"onUpdate:modelValue":
|
|
318
|
+
return (i, o) => (f(), b(p(ce), D(i.$attrs, {
|
|
319
|
+
modelValue: p(l),
|
|
320
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => U(l) ? l.value = s : null),
|
|
316
321
|
name: e.name,
|
|
317
322
|
rounded: e.rounded,
|
|
318
323
|
variant: e.variant,
|
|
@@ -322,10 +327,10 @@ const ge = /* @__PURE__ */ k({
|
|
|
322
327
|
label: e.label,
|
|
323
328
|
"hide-details": e.hideDetails,
|
|
324
329
|
"no-resize": e.noResize,
|
|
325
|
-
"error-messages":
|
|
330
|
+
"error-messages": p(a)
|
|
326
331
|
}), null, 16, ["modelValue", "name", "rounded", "variant", "rows", "density", "color", "label", "hide-details", "no-resize", "error-messages"]));
|
|
327
332
|
}
|
|
328
|
-
}),
|
|
333
|
+
}), we = /* @__PURE__ */ _({
|
|
329
334
|
name: "FAutocomplete",
|
|
330
335
|
inheritAttrs: !1,
|
|
331
336
|
__name: "FAutocomplete",
|
|
@@ -345,18 +350,18 @@ const ge = /* @__PURE__ */ k({
|
|
|
345
350
|
},
|
|
346
351
|
emits: ["change"],
|
|
347
352
|
setup(t, { emit: e }) {
|
|
348
|
-
const n = e, a = t, l =
|
|
353
|
+
const n = e, a = t, l = V(() => a.rules), { errorMessage: i, value: o } = A(() => a.name, l, {
|
|
349
354
|
initialValue: a.modelValue,
|
|
350
355
|
syncVModel: !0
|
|
351
356
|
});
|
|
352
|
-
function
|
|
353
|
-
n("change",
|
|
357
|
+
function s(c) {
|
|
358
|
+
n("change", c);
|
|
354
359
|
}
|
|
355
|
-
return (
|
|
356
|
-
modelValue:
|
|
360
|
+
return (c, u) => (f(), b(p(me), D(c.$attrs, {
|
|
361
|
+
modelValue: p(o),
|
|
357
362
|
"onUpdate:modelValue": [
|
|
358
|
-
|
|
359
|
-
|
|
363
|
+
u[0] || (u[0] = ($) => U(o) ? o.value = $ : null),
|
|
364
|
+
u[1] || (u[1] = ($) => s(p(o)))
|
|
360
365
|
],
|
|
361
366
|
name: a.name,
|
|
362
367
|
items: a.items,
|
|
@@ -368,18 +373,18 @@ const ge = /* @__PURE__ */ k({
|
|
|
368
373
|
"hide-details": a.hideDetails,
|
|
369
374
|
"return-object": a.returnObject,
|
|
370
375
|
"no-data-text": a.noDataText,
|
|
371
|
-
"error-messages":
|
|
376
|
+
"error-messages": p(i),
|
|
372
377
|
"menu-props": { maxWidth: 0 }
|
|
373
|
-
}),
|
|
374
|
-
|
|
375
|
-
name:
|
|
376
|
-
fn:
|
|
377
|
-
|
|
378
|
+
}), X({ _: 2 }, [
|
|
379
|
+
T(c.$slots, ($, B) => ({
|
|
380
|
+
name: B,
|
|
381
|
+
fn: m((R) => [
|
|
382
|
+
S(c.$slots, B, O(z(R ?? {})))
|
|
378
383
|
])
|
|
379
384
|
}))
|
|
380
385
|
]), 1040, ["modelValue", "name", "items", "rounded", "variant", "density", "color", "clearable", "hide-details", "return-object", "no-data-text", "error-messages"]));
|
|
381
386
|
}
|
|
382
|
-
}),
|
|
387
|
+
}), Se = /* @__PURE__ */ _({
|
|
383
388
|
name: "FCheckbox",
|
|
384
389
|
inheritAttrs: !1,
|
|
385
390
|
__name: "FCheckbox",
|
|
@@ -391,14 +396,14 @@ const ge = /* @__PURE__ */ k({
|
|
|
391
396
|
},
|
|
392
397
|
setup(t) {
|
|
393
398
|
const e = t;
|
|
394
|
-
return (n, a) => (f(),
|
|
399
|
+
return (n, a) => (f(), b(p(fe), D(n.$attrs, {
|
|
395
400
|
color: e.color,
|
|
396
401
|
"hide-details": e.hideDetails,
|
|
397
402
|
indeterminate: e.indeterminate,
|
|
398
403
|
density: e.density
|
|
399
404
|
}), null, 16, ["color", "hide-details", "indeterminate", "density"]));
|
|
400
405
|
}
|
|
401
|
-
}),
|
|
406
|
+
}), xe = /* @__PURE__ */ _({
|
|
402
407
|
name: "FCurrencyField",
|
|
403
408
|
inheritAttrs: !1,
|
|
404
409
|
__name: "FCurrencyField",
|
|
@@ -418,41 +423,41 @@ const ge = /* @__PURE__ */ k({
|
|
|
418
423
|
rules: { type: [String, Function], default: "" }
|
|
419
424
|
},
|
|
420
425
|
setup(t) {
|
|
421
|
-
const e = t, n =
|
|
426
|
+
const e = t, n = V(() => e.rules), { errorMessage: a, value: l } = A(() => e.name, n, {
|
|
422
427
|
initialValue: e.modelValue,
|
|
423
428
|
syncVModel: !0
|
|
424
|
-
}),
|
|
429
|
+
}), i = V(
|
|
425
430
|
() => new Intl.NumberFormat(e.locale, {
|
|
426
431
|
style: "currency",
|
|
427
432
|
currency: e.currency,
|
|
428
433
|
minimumFractionDigits: e.precision,
|
|
429
434
|
maximumFractionDigits: e.precision
|
|
430
435
|
})
|
|
431
|
-
),
|
|
432
|
-
function
|
|
433
|
-
return
|
|
436
|
+
), o = E(s(e.modelValue));
|
|
437
|
+
function s(g) {
|
|
438
|
+
return g == null || isNaN(g) ? "" : i.value.format(g);
|
|
434
439
|
}
|
|
435
|
-
function
|
|
436
|
-
const
|
|
437
|
-
return isNaN(
|
|
440
|
+
function c(g) {
|
|
441
|
+
const w = g.replace(/[^\d,.-]/g, "").replace(/\./g, "").replace(",", "."), x = parseFloat(w);
|
|
442
|
+
return isNaN(x) ? null : Math.round(x * Math.pow(10, e.precision)) / Math.pow(10, e.precision);
|
|
438
443
|
}
|
|
439
|
-
const
|
|
440
|
-
function $(
|
|
441
|
-
const
|
|
442
|
-
|
|
444
|
+
const u = E(!1);
|
|
445
|
+
function $(g) {
|
|
446
|
+
const w = g.target;
|
|
447
|
+
o.value = w.value, l.value = c(w.value);
|
|
443
448
|
}
|
|
444
|
-
function
|
|
445
|
-
|
|
449
|
+
function B() {
|
|
450
|
+
u.value = !1, o.value = s(l.value);
|
|
446
451
|
}
|
|
447
|
-
function R(
|
|
448
|
-
|
|
449
|
-
const
|
|
450
|
-
|
|
452
|
+
function R(g) {
|
|
453
|
+
u.value = !0;
|
|
454
|
+
const w = g.target, x = l.value;
|
|
455
|
+
x != null ? o.value = x.toFixed(e.precision).replace(".", ",") : o.value = "", setTimeout(() => w.select(), 0);
|
|
451
456
|
}
|
|
452
|
-
return ue(() => e.modelValue, (
|
|
453
|
-
l.value =
|
|
454
|
-
}), (
|
|
455
|
-
"model-value":
|
|
457
|
+
return ue(() => e.modelValue, (g) => {
|
|
458
|
+
l.value = g, u.value || (o.value = s(g));
|
|
459
|
+
}), (g, w) => (f(), b(p(W), D(g.$attrs, {
|
|
460
|
+
"model-value": o.value,
|
|
456
461
|
name: e.name,
|
|
457
462
|
label: e.label,
|
|
458
463
|
readonly: e.readonly,
|
|
@@ -461,14 +466,14 @@ const ge = /* @__PURE__ */ k({
|
|
|
461
466
|
variant: e.variant,
|
|
462
467
|
density: e.density,
|
|
463
468
|
color: e.color,
|
|
464
|
-
"error-messages":
|
|
469
|
+
"error-messages": p(a),
|
|
465
470
|
inputmode: "decimal",
|
|
466
471
|
onInput: $,
|
|
467
|
-
onBlur:
|
|
472
|
+
onBlur: B,
|
|
468
473
|
onFocus: R
|
|
469
474
|
}), null, 16, ["model-value", "name", "label", "readonly", "hide-details", "rounded", "variant", "density", "color", "error-messages"]));
|
|
470
475
|
}
|
|
471
|
-
}),
|
|
476
|
+
}), Ce = /* @__PURE__ */ _({
|
|
472
477
|
name: "FSelect",
|
|
473
478
|
inheritAttrs: !1,
|
|
474
479
|
__name: "FSelect",
|
|
@@ -485,13 +490,13 @@ const ge = /* @__PURE__ */ k({
|
|
|
485
490
|
rules: { type: [String, Function], default: "" }
|
|
486
491
|
},
|
|
487
492
|
setup(t) {
|
|
488
|
-
const e = t, n =
|
|
493
|
+
const e = t, n = V(() => e.rules), { errorMessage: a, value: l } = A(() => e.name, n, {
|
|
489
494
|
initialValue: e.modelValue,
|
|
490
495
|
syncVModel: !0
|
|
491
496
|
});
|
|
492
|
-
return (
|
|
493
|
-
modelValue:
|
|
494
|
-
"onUpdate:modelValue":
|
|
497
|
+
return (i, o) => (f(), b(p(pe), D(i.$attrs, {
|
|
498
|
+
modelValue: p(l),
|
|
499
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => U(l) ? l.value = s : null),
|
|
495
500
|
name: e.name,
|
|
496
501
|
items: e.items,
|
|
497
502
|
rounded: e.rounded,
|
|
@@ -500,17 +505,17 @@ const ge = /* @__PURE__ */ k({
|
|
|
500
505
|
color: e.color,
|
|
501
506
|
"hide-details": e.hideDetails,
|
|
502
507
|
"return-object": e.returnObject,
|
|
503
|
-
"error-messages":
|
|
504
|
-
}),
|
|
505
|
-
|
|
506
|
-
name:
|
|
507
|
-
fn:
|
|
508
|
-
|
|
508
|
+
"error-messages": p(a)
|
|
509
|
+
}), X({ _: 2 }, [
|
|
510
|
+
T(i.$slots, (s, c) => ({
|
|
511
|
+
name: c,
|
|
512
|
+
fn: m((u) => [
|
|
513
|
+
S(i.$slots, c, O(z(u ?? {})))
|
|
509
514
|
])
|
|
510
515
|
}))
|
|
511
516
|
]), 1040, ["modelValue", "name", "items", "rounded", "variant", "density", "color", "hide-details", "return-object", "error-messages"]));
|
|
512
517
|
}
|
|
513
|
-
}),
|
|
518
|
+
}), Me = /* @__PURE__ */ _({
|
|
514
519
|
name: "FNumberField",
|
|
515
520
|
inheritAttrs: !1,
|
|
516
521
|
__name: "FNumberField",
|
|
@@ -534,13 +539,13 @@ const ge = /* @__PURE__ */ k({
|
|
|
534
539
|
rules: { type: [String, Function], default: "" }
|
|
535
540
|
},
|
|
536
541
|
setup(t) {
|
|
537
|
-
const e = t, n =
|
|
542
|
+
const e = t, n = V(() => e.rules), { errorMessage: a, value: l } = A(() => e.name, n, {
|
|
538
543
|
initialValue: e.modelValue,
|
|
539
544
|
syncVModel: !0
|
|
540
545
|
});
|
|
541
|
-
return (
|
|
542
|
-
modelValue:
|
|
543
|
-
"onUpdate:modelValue":
|
|
546
|
+
return (i, o) => (f(), b(p(ve), D(i.$attrs, {
|
|
547
|
+
modelValue: p(l),
|
|
548
|
+
"onUpdate:modelValue": o[0] || (o[0] = (s) => U(l) ? l.value = s : null),
|
|
544
549
|
name: e.name,
|
|
545
550
|
color: e.color,
|
|
546
551
|
density: e.density,
|
|
@@ -556,14 +561,14 @@ const ge = /* @__PURE__ */ k({
|
|
|
556
561
|
min: e.min,
|
|
557
562
|
precision: e.precision,
|
|
558
563
|
inset: e.inset,
|
|
559
|
-
"error-messages":
|
|
564
|
+
"error-messages": p(a)
|
|
560
565
|
}), null, 16, ["modelValue", "name", "color", "density", "rounded", "variant", "control-variant", "hide-details", "placeholder", "label", "prefix", "disabled", "readonly", "min", "precision", "inset", "error-messages"]));
|
|
561
566
|
}
|
|
562
|
-
}),
|
|
567
|
+
}), Ae = { key: 0 }, Re = { key: 1 }, Ne = /* @__PURE__ */ _({
|
|
563
568
|
name: "FSwitch",
|
|
564
569
|
inheritAttrs: !1,
|
|
565
570
|
__name: "FSwitch",
|
|
566
|
-
props: /* @__PURE__ */
|
|
571
|
+
props: /* @__PURE__ */ I({
|
|
567
572
|
color: { default: "secondary" },
|
|
568
573
|
density: { default: "comfortable" },
|
|
569
574
|
hideDetails: { type: [Boolean, String], default: "auto" },
|
|
@@ -575,38 +580,101 @@ const ge = /* @__PURE__ */ k({
|
|
|
575
580
|
}),
|
|
576
581
|
emits: ["update:modelValue"],
|
|
577
582
|
setup(t) {
|
|
578
|
-
const e = t, n =
|
|
579
|
-
return (a, l) => (f(),
|
|
583
|
+
const e = t, n = N(t, "modelValue");
|
|
584
|
+
return (a, l) => (f(), b(p(ye), D(a.$attrs, {
|
|
580
585
|
modelValue: n.value,
|
|
581
|
-
"onUpdate:modelValue": l[0] || (l[0] = (
|
|
586
|
+
"onUpdate:modelValue": l[0] || (l[0] = (i) => n.value = i),
|
|
582
587
|
color: e.color,
|
|
583
588
|
"hide-details": e.hideDetails,
|
|
584
589
|
density: e.density
|
|
585
|
-
}),
|
|
590
|
+
}), X({ _: 2 }, [
|
|
586
591
|
e.labelTrue || e.labelFalse ? {
|
|
587
592
|
name: "label",
|
|
588
|
-
fn:
|
|
589
|
-
n.value ? (f(), P("span",
|
|
593
|
+
fn: m(() => [
|
|
594
|
+
n.value ? (f(), P("span", Ae, k(e.labelTrue), 1)) : (f(), P("span", Re, k(e.labelFalse), 1))
|
|
590
595
|
]),
|
|
591
596
|
key: "0"
|
|
592
597
|
} : void 0
|
|
593
598
|
]), 1040, ["modelValue", "color", "hide-details", "density"]));
|
|
594
599
|
}
|
|
595
|
-
}),
|
|
600
|
+
}), Pe = /* @__PURE__ */ _({
|
|
601
|
+
name: "FDialog",
|
|
602
|
+
inheritAttrs: !1,
|
|
603
|
+
__name: "FDialog",
|
|
604
|
+
props: /* @__PURE__ */ I({
|
|
605
|
+
width: { default: 750 },
|
|
606
|
+
persistent: { type: Boolean, default: !0 },
|
|
607
|
+
transition: { default: "slide-y-transition" }
|
|
608
|
+
}, {
|
|
609
|
+
modelValue: { type: Boolean },
|
|
610
|
+
modelModifiers: {}
|
|
611
|
+
}),
|
|
612
|
+
emits: /* @__PURE__ */ I(["closeDialog"], ["update:modelValue"]),
|
|
613
|
+
setup(t) {
|
|
614
|
+
const e = t, n = N(t, "modelValue");
|
|
615
|
+
return (a, l) => {
|
|
616
|
+
const i = y("v-btn"), o = y("v-card-title"), s = y("v-divider"), c = y("v-card-text"), u = y("v-card"), $ = y("v-dialog");
|
|
617
|
+
return f(), b($, D(a.$attrs, {
|
|
618
|
+
modelValue: n.value,
|
|
619
|
+
"onUpdate:modelValue": l[1] || (l[1] = (B) => n.value = B),
|
|
620
|
+
transition: e.transition,
|
|
621
|
+
class: "f-dialog",
|
|
622
|
+
width: e.width,
|
|
623
|
+
persistent: e.persistent
|
|
624
|
+
}), {
|
|
625
|
+
default: m(() => [
|
|
626
|
+
F(u, {
|
|
627
|
+
class: "f-dialog-card",
|
|
628
|
+
density: "default",
|
|
629
|
+
variant: "elevated",
|
|
630
|
+
rounded: "lg"
|
|
631
|
+
}, {
|
|
632
|
+
default: m(() => [
|
|
633
|
+
F(o, { class: "d-flex justify-space-between align-center" }, {
|
|
634
|
+
default: m(() => [
|
|
635
|
+
Y("header", null, [
|
|
636
|
+
S(a.$slots, "header", {}, void 0, !0)
|
|
637
|
+
]),
|
|
638
|
+
F(i, {
|
|
639
|
+
icon: "mdi-close",
|
|
640
|
+
variant: "text",
|
|
641
|
+
onClick: l[0] || (l[0] = (B) => a.$emit("closeDialog"))
|
|
642
|
+
})
|
|
643
|
+
]),
|
|
644
|
+
_: 3
|
|
645
|
+
}),
|
|
646
|
+
F(s),
|
|
647
|
+
F(c, { class: "py-4 px-1 overflow-auto overflow-x-hidden" }, {
|
|
648
|
+
default: m(() => [
|
|
649
|
+
S(a.$slots, "default", {}, void 0, !0)
|
|
650
|
+
]),
|
|
651
|
+
_: 3
|
|
652
|
+
})
|
|
653
|
+
]),
|
|
654
|
+
_: 3
|
|
655
|
+
})
|
|
656
|
+
]),
|
|
657
|
+
_: 3
|
|
658
|
+
}, 16, ["modelValue", "transition", "width", "persistent"]);
|
|
659
|
+
};
|
|
660
|
+
}
|
|
661
|
+
}), Te = /* @__PURE__ */ q(Pe, [["__scopeId", "data-v-5c571a9a"]]), Ee = {
|
|
596
662
|
install(t) {
|
|
597
|
-
t.component("FButton",
|
|
663
|
+
t.component("FButton", be), t.component("FTextField", he), t.component("FDataTable", De), t.component("FTextarea", Be), t.component("FAutocomplete", we), t.component("FCheckbox", Se), t.component("FCurrencyField", xe), t.component("FSelect", Ce), t.component("FNumberField", Me), t.component("FSwitch", Ne), t.component("FDialog", Te);
|
|
598
664
|
}
|
|
599
665
|
};
|
|
600
666
|
export {
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
667
|
+
we as FAutocomplete,
|
|
668
|
+
be as FButton,
|
|
669
|
+
Se as FCheckbox,
|
|
670
|
+
xe as FCurrencyField,
|
|
671
|
+
De as FDataTable,
|
|
672
|
+
$e as FDataTableHeaderType,
|
|
673
|
+
Te as FDialog,
|
|
674
|
+
Me as FNumberField,
|
|
675
|
+
Ce as FSelect,
|
|
676
|
+
Ne as FSwitch,
|
|
677
|
+
he as FTextField,
|
|
678
|
+
Be as FTextarea,
|
|
679
|
+
Ee as default
|
|
612
680
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(m,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):(m=typeof globalThis<"u"?globalThis:m||self,e(m.FinsoVueComponents={},m.Vue,m.VuetifyComponents,m.MaskaVue,m.VeeValidate))})(this,(function(m,e,k,z,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(a,l)=>{const n=e.resolveComponent("v-btn");return e.openBlock(),e.createBlock(n,{color:t.color,rounded:t.rounded},null,8,["color","rounded"])}}}),x=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:l,value:n}=B.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,d)=>e.withDirectives((e.openBlock(),e.createBlock(e.unref(k.VTextField),e.mergeProps(c.$attrs,{modelValue:e.unref(n),"onUpdate:modelValue":d[0]||(d[0]=i=>e.isRef(n)?n.value=i: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(l),"append-inner-icon":t.appendInnerIcon,"onClick:appendInner":d[1]||(d[1]=i=>c.$emit("clickAppendInner"))}),e.createSlots({_:2},[e.renderList(c.$slots,(i,p)=>({name:p,fn:e.withCtx(u=>[e.renderSlot(c.$slots,p,e.normalizeProps(e.guardReactiveProps(u??{})))])}))]),1040,["modelValue","name","color","density","rounded","variant","clearable","hide-details","error-messages","append-inner-icon"])),[[e.unref(z.vMaska),t.mask]])}}),U={key:1},j={key:4},E={class:"f-data-table__actions"},$=((o,t)=>{const a=o.__vccOpts||o;for(const[l,n]of t)a[l]=n;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:!1},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,l=t,n=e.useModel(o,"page"),c=e.useModel(o,"itemsPerPage"),d=e.useModel(o,"sortBy"),i=e.ref(!1),p=e.ref(null);function u(s,f){return f.split(".").reduce((F,w)=>F==null?void 0:F[w],s)}function b(s){return s==null?"":new Intl.NumberFormat(a.moneyLocale,{style:"currency",currency:a.moneyCurrency}).format(s)}function C(s){if(!s)return"";const f=s.replace(/\D/g,"");return f.length<10?s:`(${f.substring(0,3)}) ${f.substring(3,6)} ${f.substring(6,10)}`}const D=e.computed(()=>{const F=a.items.length*52+56;return Math.min(F,a.maxHeight)}),y=e.computed(()=>!a.canEditRecord&&!a.canReadRecord?{}:{"click:row":(s,{item:f})=>{l("show-record",f)}}),h=e.computed(()=>a.headers.filter(s=>s.type&&s.key!=="actions")),V=e.computed(()=>a.headers.some(s=>s.key==="actions"));function O(s){a.showDeleteConfirm?(p.value=s,i.value=!0):l("delete-record",s)}function q(){l("delete-record",p.value),i.value=!1,p.value=null}return(s,f)=>{const F=e.resolveComponent("v-img"),w=e.resolveComponent("v-avatar"),Y=e.resolveComponent("v-chip"),G=e.resolveComponent("v-icon"),S=e.resolveComponent("v-btn"),W=e.resolveComponent("v-card-title"),J=e.resolveComponent("v-card-text"),K=e.resolveComponent("v-spacer"),Q=e.resolveComponent("v-card-actions"),Z=e.resolveComponent("v-card"),v=e.resolveComponent("v-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(s.$attrs,{page:n.value,"onUpdate:page":f[0]||(f[0]=r=>n.value=r),"items-per-page":c.value,"onUpdate:itemsPerPage":f[1]||(f[1]=r=>c.value=r),"sort-by":d.value,"onUpdate:sortBy":f[2]||(f[2]=r=>d.value=r),headers:o.headers,items:o.items,"items-length":o.serverSide?o.totalCount:void 0,loading:o.loading,hover:o.hover,density:o.density,height:D.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(h.value,r=>({name:`item.${r.key}`,fn:e.withCtx(({item:g})=>[e.renderSlot(s.$slots,`item.${r.key}`,{item:g,value:u(g,r.key)},()=>[r.type==="image"?(e.openBlock(),e.createBlock(w,{key:0,rounded:"lg",variant:"elevated"},{default:e.withCtx(()=>[e.createVNode(F,{src:u(g,r.key),class:"f-data-table__logo"},null,8,["src"])]),_:2},1024)):r.type==="money"?(e.openBlock(),e.createElementBlock("span",U,e.toDisplayString(b(u(g,r.key))),1)):r.type==="status"?(e.openBlock(),e.createBlock(Y,{key:2,color:u(g,r.key)?"green-darken-1":"red-darken-2",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(g,r.key)?o.labelActive:o.labelPassive),1)]),_:2},1032,["color"])):r.type==="boolean"?(e.openBlock(),e.createBlock(G,{key:3,color:u(g,r.key)?"green-darken-1":"red-darken-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(u(g,r.key)?"mdi-check":"mdi-close"),1)]),_:2},1032,["color"])):r.type==="gsmNo"?(e.openBlock(),e.createElementBlock("span",j,e.toDisplayString(C(u(g,r.key))),1)):e.createCommentVNode("",!0)],!0)])})),V.value?{name:"item.actions",fn:e.withCtx(({item:r})=>[e.renderSlot(s.$slots,"item.actions",{item:r},()=>[e.createElementVNode("div",E,[o.canEditRecord||o.canReadRecord?(e.openBlock(),e.createBlock(S,{key:0,icon:"mdi-pencil",variant:"text",size:"small",onClick:e.withModifiers(g=>l("show-record",r),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0),o.canDeleteRecord?(e.openBlock(),e.createBlock(S,{key:1,icon:"mdi-delete",variant:"text",size:"small",color:"red-darken-2",onClick:e.withModifiers(g=>O(r),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0)])],!0)]),key:"0"}:void 0,e.renderList(s.$slots,(r,g)=>({name:g,fn:e.withCtx(ee=>[e.renderSlot(s.$slots,g,e.normalizeProps(e.guardReactiveProps(ee??{})),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(v,{modelValue:i.value,"onUpdate:modelValue":f[4]||(f[4]=r=>i.value=r),"max-width":"400"},{default:e.withCtx(()=>[e.createVNode(Z,null,{default:e.withCtx(()=>[e.createVNode(W,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.labelDeleteTitle),1)]),_:1}),e.createVNode(J,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.deleteMessageFormatter&&p.value?o.deleteMessageFormatter(p.value):o.labelDeleteMessage),1)]),_:1}),e.createVNode(Q,null,{default:e.withCtx(()=>[e.createVNode(K),e.createVNode(S,{variant:"text",onClick:f[3]||(f[3]=r=>i.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.labelDeleteCancel),1)]),_:1}),e.createVNode(S,{color:"red-darken-2",variant:"flat",onClick:q},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.labelDeleteConfirm),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}}),[["__scopeId","data-v-18a58608"]]),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:l,value:n}=B.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,d)=>(e.openBlock(),e.createBlock(e.unref(k.VTextarea),e.mergeProps(c.$attrs,{modelValue:e.unref(n),"onUpdate:modelValue":d[0]||(d[0]=i=>e.isRef(n)?n.value=i: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(l)}),null,16,["modelValue","name","rounded","variant","rows","density","color","label","hide-details","no-resize","error-messages"]))}}),P=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,l=o,n=e.computed(()=>l.rules),{errorMessage:c,value:d}=B.useField(()=>l.name,n,{initialValue:l.modelValue,syncVModel:!0});function i(p){a("change",p)}return(p,u)=>(e.openBlock(),e.createBlock(e.unref(k.VAutocomplete),e.mergeProps(p.$attrs,{modelValue:e.unref(d),"onUpdate:modelValue":[u[0]||(u[0]=b=>e.isRef(d)?d.value=b:null),u[1]||(u[1]=b=>i(e.unref(d)))],name:l.name,items:l.items,rounded:l.rounded,variant:l.variant,density:l.density,color:l.color,clearable:l.clearable,"hide-details":l.hideDetails,"return-object":l.returnObject,"no-data-text":l.noDataText,"error-messages":e.unref(c),"menu-props":{maxWidth:0}}),e.createSlots({_:2},[e.renderList(p.$slots,(b,C)=>({name:C,fn:e.withCtx(D=>[e.renderSlot(p.$slots,C,e.normalizeProps(e.guardReactiveProps(D??{})))])}))]),1040,["modelValue","name","items","rounded","variant","density","color","clearable","hide-details","return-object","no-data-text","error-messages"]))}}),T=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,l)=>(e.openBlock(),e.createBlock(e.unref(k.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"]))}}),N=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:l,value:n}=B.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})),d=e.ref(i(t.modelValue));function i(y){return y==null||isNaN(y)?"":c.value.format(y)}function p(y){const h=y.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 u=e.ref(!1);function b(y){const h=y.target;d.value=h.value,n.value=p(h.value)}function C(){u.value=!1,d.value=i(n.value)}function D(y){u.value=!0;const h=y.target,V=n.value;V!=null?d.value=V.toFixed(t.precision).replace(".",","):d.value="",setTimeout(()=>h.select(),0)}return e.watch(()=>t.modelValue,y=>{n.value=y,u.value||(d.value=i(y))}),(y,h)=>(e.openBlock(),e.createBlock(e.unref(k.VTextField),e.mergeProps(y.$attrs,{"model-value":d.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(l),inputmode:"decimal",onInput:b,onBlur:C,onFocus:D}),null,16,["model-value","name","label","readonly","hide-details","rounded","variant","density","color","error-messages"]))}}),R=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:l,value:n}=B.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,d)=>(e.openBlock(),e.createBlock(e.unref(k.VSelect),e.mergeProps(c.$attrs,{modelValue:e.unref(n),"onUpdate:modelValue":d[0]||(d[0]=i=>e.isRef(n)?n.value=i: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(l)}),e.createSlots({_:2},[e.renderList(c.$slots,(i,p)=>({name:p,fn:e.withCtx(u=>[e.renderSlot(c.$slots,p,e.normalizeProps(e.guardReactiveProps(u??{})))])}))]),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:l,value:n}=B.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,d)=>(e.openBlock(),e.createBlock(e.unref(k.VNumberInput),e.mergeProps(c.$attrs,{modelValue:e.unref(n),"onUpdate:modelValue":d[0]||(d[0]=i=>e.isRef(n)?n.value=i: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(l)}),null,16,["modelValue","name","color","density","rounded","variant","control-variant","hide-details","placeholder","label","prefix","disabled","readonly","min","precision","inset","error-messages"]))}}),X={key:0},H={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(l,n)=>(e.openBlock(),e.createBlock(e.unref(k.VSwitch),e.mergeProps(l.$attrs,{modelValue:a.value,"onUpdate:modelValue":n[0]||(n[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",X,e.toDisplayString(t.labelTrue),1)):(e.openBlock(),e.createElementBlock("span",H,e.toDisplayString(t.labelFalse),1))]),key:"0"}:void 0]),1040,["modelValue","color","hide-details","density"]))}}),L={install(o){o.component("FButton",_),o.component("FTextField",x),o.component("FDataTable",$),o.component("FTextarea",M),o.component("FAutocomplete",P),o.component("FCheckbox",T),o.component("FCurrencyField",N),o.component("FSelect",R),o.component("FNumberField",A),o.component("FSwitch",I)}};m.FAutocomplete=P,m.FButton=_,m.FCheckbox=T,m.FCurrencyField=N,m.FDataTable=$,m.FNumberField=A,m.FSelect=R,m.FSwitch=I,m.FTextField=x,m.FTextarea=M,m.default=L,Object.defineProperties(m,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
|
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,b,z,B){"use strict";const S=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"])}}}),x=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}=B.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,r)=>e.withDirectives((e.openBlock(),e.createBlock(e.unref(b.VTextField),e.mergeProps(c.$attrs,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=s=>e.isRef(l)?l.value=s: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]=s=>c.$emit("clickAppendInner"))}),e.createSlots({_:2},[e.renderList(c.$slots,(s,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=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:!1},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"),s=e.ref(!1),f=e.ref(null);function m(i,p){return p.split(".").reduce((F,w)=>F==null?void 0:F[w],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 F=a.items.length*52+56;return Math.min(F,a.maxHeight)}),y=e.computed(()=>!a.canEditRecord&&!a.canReadRecord?{}:{"click:row":(i,{item:p})=>{n("show-record",p)}}),V=e.computed(()=>a.headers.filter(i=>i.type&&i.key!=="actions")),C=e.computed(()=>a.headers.some(i=>i.key==="actions"));function W(i){a.showDeleteConfirm?(f.value=i,s.value=!0):n("delete-record",i)}function J(){n("delete-record",f.value),s.value=!1,f.value=null}return(i,p)=>{const F=e.resolveComponent("v-img"),w=e.resolveComponent("v-avatar"),K=e.resolveComponent("v-chip"),Q=e.resolveComponent("v-icon"),D=e.resolveComponent("v-btn"),Z=e.resolveComponent("v-card-title"),v=e.resolveComponent("v-card-text"),ee=e.resolveComponent("v-spacer"),te=e.resolveComponent("v-card-actions"),oe=e.resolveComponent("v-card"),ne=e.resolveComponent("v-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]=d=>l.value=d),"items-per-page":c.value,"onUpdate:itemsPerPage":p[1]||(p[1]=d=>c.value=d),"sort-by":r.value,"onUpdate:sortBy":p[2]||(p[2]=d=>r.value=d),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(V.value,d=>({name:`item.${d.key}`,fn:e.withCtx(({item:g})=>[e.renderSlot(i.$slots,`item.${d.key}`,{item:g,value:m(g,d.key)},()=>[d.type==="image"?(e.openBlock(),e.createBlock(w,{key:0,rounded:"lg",variant:"elevated",color:"white"},{default:e.withCtx(()=>[e.createVNode(F,{src:m(g,d.key),class:"f-data-table__logo"},null,8,["src"])]),_:2},1024)):d.type==="money"?(e.openBlock(),e.createElementBlock("span",O,e.toDisplayString(h(m(g,d.key))),1)):d.type==="status"?(e.openBlock(),e.createBlock(K,{key:2,color:m(g,d.key)?"green-darken-1":"red-darken-2",size:"small"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(g,d.key)?o.labelActive:o.labelPassive),1)]),_:2},1032,["color"])):d.type==="boolean"?(e.openBlock(),e.createBlock(Q,{key:3,color:m(g,d.key)?"green-darken-1":"red-darken-2"},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(m(g,d.key)?"mdi-check":"mdi-close"),1)]),_:2},1032,["color"])):d.type==="gsmNo"?(e.openBlock(),e.createElementBlock("span",X,e.toDisplayString(k(m(g,d.key))),1)):e.createCommentVNode("",!0)],!0)])})),C.value?{name:"item.actions",fn:e.withCtx(({item:d})=>[e.renderSlot(i.$slots,"item.actions",{item:d},()=>[e.createElementVNode("div",L,[o.canEditRecord||o.canReadRecord?(e.openBlock(),e.createBlock(D,{key:0,color:"primary",icon:"mdi-pencil-outline",variant:"text",size:"small",onClick:e.withModifiers(g=>n("show-record",d),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0),o.canDeleteRecord?(e.openBlock(),e.createBlock(D,{key:1,icon:"mdi-trash-can-outline",variant:"text",size:"small",color:"red-darken-2",onClick:e.withModifiers(g=>W(d),["stop"])},null,8,["onClick"])):e.createCommentVNode("",!0)])],!0)]),key:"0"}:void 0,e.renderList(i.$slots,(d,g)=>({name:g,fn:e.withCtx(le=>[e.renderSlot(i.$slots,g,e.normalizeProps(e.guardReactiveProps(le??{})),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(ne,{modelValue:s.value,"onUpdate:modelValue":p[4]||(p[4]=d=>s.value=d),"max-width":"400"},{default:e.withCtx(()=>[e.createVNode(oe,null,{default:e.withCtx(()=>[e.createVNode(Z,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.labelDeleteTitle),1)]),_:1}),e.createVNode(v,null,{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.deleteMessageFormatter&&f.value?o.deleteMessageFormatter(f.value):o.labelDeleteMessage),1)]),_:1}),e.createVNode(te,null,{default:e.withCtx(()=>[e.createVNode(ee),e.createVNode(D,{variant:"text",onClick:p[3]||(p[3]=d=>s.value=!1)},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.labelDeleteCancel),1)]),_:1}),e.createVNode(D,{color:"red-darken-2",variant:"flat",onClick:J},{default:e.withCtx(()=>[e.createTextVNode(e.toDisplayString(o.labelDeleteConfirm),1)]),_:1})]),_:1})]),_:1})]),_:1},8,["modelValue"])])}}}),$=(o,t)=>{const a=o.__vccOpts||o;for(const[n,l]of t)a[n]=l;return a},M=$(H,[["__scopeId","data-v-e4c3ed73"]]);var N=(o=>(o.IMAGE="image",o.MONEY="money",o.STATUS="status",o.BOOLEAN="boolean",o.GSM_NO="gsmNo",o))(N||{});const P=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}=B.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,r)=>(e.openBlock(),e.createBlock(e.unref(b.VTextarea),e.mergeProps(c.$attrs,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=s=>e.isRef(l)?l.value=s: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"]))}}),T=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}=B.useField(()=>n.name,l,{initialValue:n.modelValue,syncVModel:!0});function s(f){a("change",f)}return(f,m)=>(e.openBlock(),e.createBlock(e.unref(b.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=>s(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"]))}}),R=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(b.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"]))}}),A=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}=B.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(s(t.modelValue));function s(y){return y==null||isNaN(y)?"":c.value.format(y)}function f(y){const V=y.replace(/[^\d,.-]/g,"").replace(/\./g,"").replace(",","."),C=parseFloat(V);return isNaN(C)?null:Math.round(C*Math.pow(10,t.precision))/Math.pow(10,t.precision)}const m=e.ref(!1);function h(y){const V=y.target;r.value=V.value,l.value=f(V.value)}function k(){m.value=!1,r.value=s(l.value)}function _(y){m.value=!0;const V=y.target,C=l.value;C!=null?r.value=C.toFixed(t.precision).replace(".",","):r.value="",setTimeout(()=>V.select(),0)}return e.watch(()=>t.modelValue,y=>{l.value=y,m.value||(r.value=s(y))}),(y,V)=>(e.openBlock(),e.createBlock(e.unref(b.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"]))}}),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,a=e.computed(()=>t.rules),{errorMessage:n,value:l}=B.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,r)=>(e.openBlock(),e.createBlock(e.unref(b.VSelect),e.mergeProps(c.$attrs,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=s=>e.isRef(l)?l.value=s: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,(s,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"]))}}),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,a=e.computed(()=>t.rules),{errorMessage:n,value:l}=B.useField(()=>t.name,a,{initialValue:t.modelValue,syncVModel:!0});return(c,r)=>(e.openBlock(),e.createBlock(e.unref(b.VNumberInput),e.mergeProps(c.$attrs,{modelValue:e.unref(l),"onUpdate:modelValue":r[0]||(r[0]=s=>e.isRef(l)?l.value=s: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},U=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(b.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"]))}}),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"}},{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"),s=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",{},void 0,!0)]),e.createVNode(c,{icon:"mdi-close",variant:"text",onClick:l[0]||(l[0]=k=>n.$emit("closeDialog"))})]),_:3}),e.createVNode(s),e.createVNode(f,{class:"py-4 px-1 overflow-auto overflow-x-hidden"},{default:e.withCtx(()=>[e.renderSlot(n.$slots,"default",{},void 0,!0)]),_:3})]),_:3})]),_:3},16,["modelValue","transition","width","persistent"])}}}),[["__scopeId","data-v-5c571a9a"]]),Y={install(o){o.component("FButton",S),o.component("FTextField",x),o.component("FDataTable",M),o.component("FTextarea",P),o.component("FAutocomplete",T),o.component("FCheckbox",R),o.component("FCurrencyField",A),o.component("FSelect",I),o.component("FNumberField",E),o.component("FSwitch",U),o.component("FDialog",j)}};u.FAutocomplete=T,u.FButton=S,u.FCheckbox=R,u.FCurrencyField=A,u.FDataTable=M,u.FDataTableHeaderType=N,u.FDialog=j,u.FNumberField=E,u.FSelect=I,u.FSwitch=U,u.FTextField=x,u.FTextarea=P,u.default=Y,Object.defineProperties(u,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { Plugin } from 'vue';
|
|
2
2
|
export { FButton } from './components/FButton';
|
|
3
3
|
export { FTextField } from './components/FTextField';
|
|
4
|
-
export { FDataTable } from './components/FDataTable';
|
|
4
|
+
export { FDataTable, FDataTableHeaderType } from './components/FDataTable';
|
|
5
5
|
export { FTextarea } from './components/FTextarea';
|
|
6
6
|
export { FAutocomplete } from './components/FAutocomplete';
|
|
7
7
|
export { FCheckbox } from './components/FCheckbox';
|
|
@@ -9,9 +9,10 @@ export { FCurrencyField } from './components/FCurrencyField';
|
|
|
9
9
|
export { FSelect } from './components/FSelect';
|
|
10
10
|
export { FNumberField } from './components/FNumberField';
|
|
11
11
|
export { FSwitch } from './components/FSwitch';
|
|
12
|
+
export { FDialog } from './components/FDialog';
|
|
12
13
|
export type { FButtonProps } from './components/FButton';
|
|
13
14
|
export type { FTextFieldProps } from './components/FTextField';
|
|
14
|
-
export type { FDataTableProps, FDataTableHeader
|
|
15
|
+
export type { FDataTableProps, FDataTableHeader } from './components/FDataTable';
|
|
15
16
|
export type { FTextareaProps } from './components/FTextarea';
|
|
16
17
|
export type { FAutocompleteProps } from './components/FAutocomplete';
|
|
17
18
|
export type { FCheckboxProps } from './components/FCheckbox';
|
|
@@ -19,6 +20,7 @@ export type { FCurrencyFieldProps } from './components/FCurrencyField';
|
|
|
19
20
|
export type { FSelectProps } from './components/FSelect';
|
|
20
21
|
export type { FNumberFieldProps } from './components/FNumberField';
|
|
21
22
|
export type { FSwitchProps } from './components/FSwitch';
|
|
23
|
+
export type { FDialogProps } from './components/FDialog';
|
|
22
24
|
import { FButton } from './components/FButton';
|
|
23
25
|
import { FTextField } from './components/FTextField';
|
|
24
26
|
import { FDataTable } from './components/FDataTable';
|
|
@@ -29,6 +31,7 @@ import { FCurrencyField } from './components/FCurrencyField';
|
|
|
29
31
|
import { FSelect } from './components/FSelect';
|
|
30
32
|
import { FNumberField } from './components/FNumberField';
|
|
31
33
|
import { FSwitch } from './components/FSwitch';
|
|
34
|
+
import { FDialog } from './components/FDialog';
|
|
32
35
|
declare const FinsoComponents: Plugin;
|
|
33
36
|
export default FinsoComponents;
|
|
34
37
|
declare module 'vue' {
|
|
@@ -43,5 +46,6 @@ declare module 'vue' {
|
|
|
43
46
|
FSelect: typeof FSelect;
|
|
44
47
|
FNumberField: typeof FNumberField;
|
|
45
48
|
FSwitch: typeof FSwitch;
|
|
49
|
+
FDialog: typeof FDialog;
|
|
46
50
|
}
|
|
47
51
|
}
|