finso-vue-components 0.4.1 → 0.4.2

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.
@@ -11,7 +11,11 @@ export interface FSelectProps {
11
11
  modelValue?: any;
12
12
  rules?: string | GenericValidateFunction<any>;
13
13
  }
14
- declare const _default: import("vue").DefineComponent<FSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FSelectProps> & Readonly<{}>, {
14
+ declare var __VLS_7: string | number, __VLS_8: any;
15
+ type __VLS_Slots = {} & {
16
+ [K in NonNullable<typeof __VLS_7>]?: (props: typeof __VLS_8) => any;
17
+ };
18
+ declare const __VLS_component: import("vue").DefineComponent<FSelectProps, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {}, string, import("vue").PublicProps, Readonly<FSelectProps> & Readonly<{}>, {
15
19
  color: string;
16
20
  rounded: string;
17
21
  density: "default" | "comfortable" | "compact";
@@ -22,4 +26,10 @@ declare const _default: import("vue").DefineComponent<FSelectProps, {}, {}, {},
22
26
  items: any[];
23
27
  returnObject: boolean;
24
28
  }, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
29
+ declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
25
30
  export default _default;
31
+ type __VLS_WithSlots<T, S> = T & {
32
+ new (): {
33
+ $slots: S;
34
+ };
35
+ };
@@ -1,8 +1,8 @@
1
- import { defineComponent as c, resolveComponent as k, openBlock as i, createBlock as m, computed as h, withDirectives as A, unref as o, mergeProps as p, isRef as g, createSlots as D, renderList as w, withCtx as x, renderSlot as C, normalizeProps as N, guardReactiveProps as R, ref as B, watch as I, useModel as j, createElementBlock as S, toDisplayString as _, mergeModels as P } from "vue";
2
- import { VTextField as T, VDataTable as U, VTextarea as z, VAutocomplete as O, VCheckbox as E, VSelect as L, VNumberInput as Y, VSwitch as q } from "vuetify/components";
1
+ import { defineComponent as m, resolveComponent as N, openBlock as i, createBlock as p, computed as F, withDirectives as R, unref as o, mergeProps as f, isRef as g, createSlots as B, renderList as x, withCtx as S, renderSlot as T, normalizeProps as M, guardReactiveProps as k, ref as _, watch as I, useModel as j, createElementBlock as D, toDisplayString as $, mergeModels as P } from "vue";
2
+ import { VTextField as A, VDataTable as U, VTextarea as z, VAutocomplete as O, VCheckbox as E, VSelect as L, VNumberInput as Y, VSwitch as q } from "vuetify/components";
3
3
  import { vMaska as G } from "maska/vue";
4
- import { useField as F } from "vee-validate";
5
- const H = /* @__PURE__ */ c({
4
+ import { useField as v } from "vee-validate";
5
+ const H = /* @__PURE__ */ m({
6
6
  __name: "FButton",
7
7
  props: {
8
8
  color: { default: "primary" },
@@ -11,14 +11,14 @@ const H = /* @__PURE__ */ c({
11
11
  setup(t) {
12
12
  const e = t;
13
13
  return (r, l) => {
14
- const a = k("v-btn");
15
- return i(), m(a, {
14
+ const a = N("v-btn");
15
+ return i(), p(a, {
16
16
  color: e.color,
17
17
  rounded: e.rounded
18
18
  }, null, 8, ["color", "rounded"]);
19
19
  };
20
20
  }
21
- }), J = /* @__PURE__ */ c({
21
+ }), J = /* @__PURE__ */ m({
22
22
  name: "FTextField",
23
23
  inheritAttrs: !1,
24
24
  __name: "FTextField",
@@ -37,11 +37,11 @@ const H = /* @__PURE__ */ c({
37
37
  },
38
38
  emits: ["clickAppendInner"],
39
39
  setup(t) {
40
- const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
40
+ const e = t, r = F(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
41
41
  initialValue: e.modelValue,
42
42
  syncVModel: !0
43
43
  });
44
- return (d, n) => A((i(), m(o(T), p(d.$attrs, {
44
+ return (d, n) => R((i(), p(o(A), f(d.$attrs, {
45
45
  modelValue: o(a),
46
46
  "onUpdate:modelValue": n[0] || (n[0] = (s) => g(a) ? a.value = s : null),
47
47
  name: e.name,
@@ -58,7 +58,7 @@ const H = /* @__PURE__ */ c({
58
58
  [o(G), e.mask]
59
59
  ]);
60
60
  }
61
- }), K = /* @__PURE__ */ c({
61
+ }), K = /* @__PURE__ */ m({
62
62
  name: "FDataTable",
63
63
  inheritAttrs: !1,
64
64
  __name: "FDataTable",
@@ -72,7 +72,7 @@ const H = /* @__PURE__ */ c({
72
72
  density: { default: "default" }
73
73
  },
74
74
  setup(t) {
75
- return (e, r) => (i(), m(o(U), p(e.$attrs, {
75
+ return (e, r) => (i(), p(o(U), f(e.$attrs, {
76
76
  headers: t.headers,
77
77
  items: t.items,
78
78
  loading: t.loading,
@@ -80,16 +80,16 @@ const H = /* @__PURE__ */ c({
80
80
  "items-per-page": t.itemsPerPage,
81
81
  hover: t.hover,
82
82
  density: t.density
83
- }), D({ _: 2 }, [
84
- w(e.$slots, (l, a) => ({
83
+ }), B({ _: 2 }, [
84
+ x(e.$slots, (l, a) => ({
85
85
  name: a,
86
- fn: x((d) => [
87
- C(e.$slots, a, N(R(d ?? {})))
86
+ fn: S((d) => [
87
+ T(e.$slots, a, M(k(d ?? {})))
88
88
  ])
89
89
  }))
90
90
  ]), 1040, ["headers", "items", "loading", "search", "items-per-page", "hover", "density"]));
91
91
  }
92
- }), Q = /* @__PURE__ */ c({
92
+ }), Q = /* @__PURE__ */ m({
93
93
  name: "FTextarea",
94
94
  inheritAttrs: !1,
95
95
  __name: "FTextarea",
@@ -107,11 +107,11 @@ const H = /* @__PURE__ */ c({
107
107
  rules: { type: [String, Function], default: "" }
108
108
  },
109
109
  setup(t) {
110
- const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
110
+ const e = t, r = F(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
111
111
  initialValue: e.modelValue,
112
112
  syncVModel: !0
113
113
  });
114
- return (d, n) => (i(), m(o(z), p(d.$attrs, {
114
+ return (d, n) => (i(), p(o(z), f(d.$attrs, {
115
115
  modelValue: o(a),
116
116
  "onUpdate:modelValue": n[0] || (n[0] = (s) => g(a) ? a.value = s : null),
117
117
  name: e.name,
@@ -126,7 +126,7 @@ const H = /* @__PURE__ */ c({
126
126
  "error-messages": o(l)
127
127
  }), null, 16, ["modelValue", "name", "rounded", "variant", "rows", "density", "color", "label", "hide-details", "no-resize", "error-messages"]));
128
128
  }
129
- }), W = /* @__PURE__ */ c({
129
+ }), W = /* @__PURE__ */ m({
130
130
  name: "FAutocomplete",
131
131
  inheritAttrs: !1,
132
132
  __name: "FAutocomplete",
@@ -146,18 +146,18 @@ const H = /* @__PURE__ */ c({
146
146
  },
147
147
  emits: ["change"],
148
148
  setup(t, { emit: e }) {
149
- const r = e, l = t, a = h(() => l.rules), { errorMessage: d, value: n } = F(() => l.name, a, {
149
+ const r = e, l = t, a = F(() => l.rules), { errorMessage: d, value: n } = v(() => l.name, a, {
150
150
  initialValue: l.modelValue,
151
151
  syncVModel: !0
152
152
  });
153
- function s(v) {
154
- r("change", v);
153
+ function s(y) {
154
+ r("change", y);
155
155
  }
156
- return (v, f) => (i(), m(o(O), p(v.$attrs, {
156
+ return (y, c) => (i(), p(o(O), f(y.$attrs, {
157
157
  modelValue: o(n),
158
158
  "onUpdate:modelValue": [
159
- f[0] || (f[0] = (V) => g(n) ? n.value = V : null),
160
- f[1] || (f[1] = (V) => s(o(n)))
159
+ c[0] || (c[0] = (V) => g(n) ? n.value = V : null),
160
+ c[1] || (c[1] = (V) => s(o(n)))
161
161
  ],
162
162
  name: l.name,
163
163
  items: l.items,
@@ -172,7 +172,7 @@ const H = /* @__PURE__ */ c({
172
172
  "error-messages": o(d)
173
173
  }), null, 16, ["modelValue", "name", "items", "rounded", "variant", "density", "color", "clearable", "hide-details", "return-object", "no-data-text", "error-messages"]));
174
174
  }
175
- }), X = /* @__PURE__ */ c({
175
+ }), X = /* @__PURE__ */ m({
176
176
  name: "FCheckbox",
177
177
  inheritAttrs: !1,
178
178
  __name: "FCheckbox",
@@ -184,14 +184,14 @@ const H = /* @__PURE__ */ c({
184
184
  },
185
185
  setup(t) {
186
186
  const e = t;
187
- return (r, l) => (i(), m(o(E), p(r.$attrs, {
187
+ return (r, l) => (i(), p(o(E), f(r.$attrs, {
188
188
  color: e.color,
189
189
  "hide-details": e.hideDetails,
190
190
  indeterminate: e.indeterminate,
191
191
  density: e.density
192
192
  }), null, 16, ["color", "hide-details", "indeterminate", "density"]));
193
193
  }
194
- }), Z = /* @__PURE__ */ c({
194
+ }), Z = /* @__PURE__ */ m({
195
195
  name: "FCurrencyField",
196
196
  inheritAttrs: !1,
197
197
  __name: "FCurrencyField",
@@ -211,40 +211,40 @@ const H = /* @__PURE__ */ c({
211
211
  rules: { type: [String, Function], default: "" }
212
212
  },
213
213
  setup(t) {
214
- const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
214
+ const e = t, r = F(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
215
215
  initialValue: e.modelValue,
216
216
  syncVModel: !0
217
- }), d = h(
217
+ }), d = F(
218
218
  () => new Intl.NumberFormat(e.locale, {
219
219
  style: "currency",
220
220
  currency: e.currency,
221
221
  minimumFractionDigits: e.precision,
222
222
  maximumFractionDigits: e.precision
223
223
  })
224
- ), n = B(s(e.modelValue));
224
+ ), n = _(s(e.modelValue));
225
225
  function s(u) {
226
226
  return u == null || isNaN(u) ? "" : d.value.format(u);
227
227
  }
228
- function v(u) {
229
- const y = u.replace(/[^\d,.-]/g, "").replace(/\./g, "").replace(",", "."), b = parseFloat(y);
228
+ function y(u) {
229
+ const h = u.replace(/[^\d,.-]/g, "").replace(/\./g, "").replace(",", "."), b = parseFloat(h);
230
230
  return isNaN(b) ? null : Math.round(b * Math.pow(10, e.precision)) / Math.pow(10, e.precision);
231
231
  }
232
- const f = B(!1);
232
+ const c = _(!1);
233
233
  function V(u) {
234
- const y = u.target;
235
- n.value = y.value, a.value = v(y.value);
234
+ const h = u.target;
235
+ n.value = h.value, a.value = y(h.value);
236
236
  }
237
- function $() {
238
- f.value = !1, n.value = s(a.value);
237
+ function w() {
238
+ c.value = !1, n.value = s(a.value);
239
239
  }
240
- function M(u) {
241
- f.value = !0;
242
- const y = u.target, b = a.value;
243
- b != null ? n.value = b.toFixed(e.precision).replace(".", ",") : n.value = "", setTimeout(() => y.select(), 0);
240
+ function C(u) {
241
+ c.value = !0;
242
+ const h = u.target, b = a.value;
243
+ b != null ? n.value = b.toFixed(e.precision).replace(".", ",") : n.value = "", setTimeout(() => h.select(), 0);
244
244
  }
245
245
  return I(() => e.modelValue, (u) => {
246
- a.value = u, f.value || (n.value = s(u));
247
- }), (u, y) => (i(), m(o(T), p(u.$attrs, {
246
+ a.value = u, c.value || (n.value = s(u));
247
+ }), (u, h) => (i(), p(o(A), f(u.$attrs, {
248
248
  "model-value": n.value,
249
249
  name: e.name,
250
250
  label: e.label,
@@ -257,11 +257,11 @@ const H = /* @__PURE__ */ c({
257
257
  "error-messages": o(l),
258
258
  inputmode: "decimal",
259
259
  onInput: V,
260
- onBlur: $,
261
- onFocus: M
260
+ onBlur: w,
261
+ onFocus: C
262
262
  }), null, 16, ["model-value", "name", "label", "readonly", "hide-details", "rounded", "variant", "density", "color", "error-messages"]));
263
263
  }
264
- }), ee = /* @__PURE__ */ c({
264
+ }), ee = /* @__PURE__ */ m({
265
265
  name: "FSelect",
266
266
  inheritAttrs: !1,
267
267
  __name: "FSelect",
@@ -278,11 +278,11 @@ const H = /* @__PURE__ */ c({
278
278
  rules: { type: [String, Function], default: "" }
279
279
  },
280
280
  setup(t) {
281
- const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
281
+ const e = t, r = F(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
282
282
  initialValue: e.modelValue,
283
283
  syncVModel: !0
284
284
  });
285
- return (d, n) => (i(), m(o(L), p(d.$attrs, {
285
+ return (d, n) => (i(), p(o(L), f(d.$attrs, {
286
286
  modelValue: o(a),
287
287
  "onUpdate:modelValue": n[0] || (n[0] = (s) => g(a) ? a.value = s : null),
288
288
  name: e.name,
@@ -294,9 +294,16 @@ const H = /* @__PURE__ */ c({
294
294
  "hide-details": e.hideDetails,
295
295
  "return-object": e.returnObject,
296
296
  "error-messages": o(l)
297
- }), null, 16, ["modelValue", "name", "items", "rounded", "variant", "density", "color", "hide-details", "return-object", "error-messages"]));
297
+ }), B({ _: 2 }, [
298
+ x(d.$slots, (s, y) => ({
299
+ name: y,
300
+ fn: S((c) => [
301
+ T(d.$slots, y, M(k(c ?? {})))
302
+ ])
303
+ }))
304
+ ]), 1040, ["modelValue", "name", "items", "rounded", "variant", "density", "color", "hide-details", "return-object", "error-messages"]));
298
305
  }
299
- }), te = /* @__PURE__ */ c({
306
+ }), te = /* @__PURE__ */ m({
300
307
  name: "FNumberField",
301
308
  inheritAttrs: !1,
302
309
  __name: "FNumberField",
@@ -320,11 +327,11 @@ const H = /* @__PURE__ */ c({
320
327
  rules: { type: [String, Function], default: "" }
321
328
  },
322
329
  setup(t) {
323
- const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
330
+ const e = t, r = F(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
324
331
  initialValue: e.modelValue,
325
332
  syncVModel: !0
326
333
  });
327
- return (d, n) => (i(), m(o(Y), p(d.$attrs, {
334
+ return (d, n) => (i(), p(o(Y), f(d.$attrs, {
328
335
  modelValue: o(a),
329
336
  "onUpdate:modelValue": n[0] || (n[0] = (s) => g(a) ? a.value = s : null),
330
337
  name: e.name,
@@ -345,7 +352,7 @@ const H = /* @__PURE__ */ c({
345
352
  "error-messages": o(l)
346
353
  }), null, 16, ["modelValue", "name", "color", "density", "rounded", "variant", "control-variant", "hide-details", "placeholder", "label", "prefix", "disabled", "readonly", "min", "precision", "inset", "error-messages"]));
347
354
  }
348
- }), ae = { key: 0 }, le = { key: 1 }, ne = /* @__PURE__ */ c({
355
+ }), ae = { key: 0 }, le = { key: 1 }, ne = /* @__PURE__ */ m({
349
356
  name: "FSwitch",
350
357
  inheritAttrs: !1,
351
358
  __name: "FSwitch",
@@ -362,17 +369,17 @@ const H = /* @__PURE__ */ c({
362
369
  emits: ["update:modelValue"],
363
370
  setup(t) {
364
371
  const e = t, r = j(t, "modelValue");
365
- return (l, a) => (i(), m(o(q), p(l.$attrs, {
372
+ return (l, a) => (i(), p(o(q), f(l.$attrs, {
366
373
  modelValue: r.value,
367
374
  "onUpdate:modelValue": a[0] || (a[0] = (d) => r.value = d),
368
375
  color: e.color,
369
376
  "hide-details": e.hideDetails,
370
377
  density: e.density
371
- }), D({ _: 2 }, [
378
+ }), B({ _: 2 }, [
372
379
  e.labelTrue || e.labelFalse ? {
373
380
  name: "label",
374
- fn: x(() => [
375
- r.value ? (i(), S("span", ae, _(e.labelTrue), 1)) : (i(), S("span", le, _(e.labelFalse), 1))
381
+ fn: S(() => [
382
+ r.value ? (i(), D("span", ae, $(e.labelTrue), 1)) : (i(), D("span", le, $(e.labelFalse), 1))
376
383
  ]),
377
384
  key: "0"
378
385
  } : void 0
@@ -1 +1 @@
1
- (function(r,t){typeof exports=="object"&&typeof module<"u"?t(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"],t):(r=typeof globalThis<"u"?globalThis:r||self,t(r.FinsoVueComponents={},r.Vue,r.VuetifyComponents,r.MaskaVue,r.VeeValidate))})(this,(function(r,t,c,$,p){"use strict";const g=t.defineComponent({__name:"FButton",props:{color:{default:"primary"},rounded:{type:[String,Number,Boolean],default:"lg"}},setup(n){const e=n;return(d,l)=>{const a=t.resolveComponent("v-btn");return t.openBlock(),t.createBlock(a,{color:e.color,rounded:e.rounded},null,8,["color","rounded"])}}}),V=t.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(n){const e=n,d=t.computed(()=>e.rules),{errorMessage:l,value:a}=p.useField(()=>e.name,d,{initialValue:e.modelValue,syncVModel:!0});return(i,o)=>t.withDirectives((t.openBlock(),t.createBlock(t.unref(c.VTextField),t.mergeProps(i.$attrs,{modelValue:t.unref(a),"onUpdate:modelValue":o[0]||(o[0]=s=>t.isRef(a)?a.value=s:null),name:e.name,color:e.color,density:e.density,rounded:e.rounded,variant:e.variant,clearable:e.clearable,"hide-details":e.hideDetails,"error-messages":t.unref(l),"append-inner-icon":e.appendInnerIcon,"onClick:appendInner":o[1]||(o[1]=s=>i.$emit("clickAppendInner"))}),null,16,["modelValue","name","color","density","rounded","variant","clearable","hide-details","error-messages","append-inner-icon"])),[[t.unref($.vMaska),e.mask]])}}),b=t.defineComponent({name:"FDataTable",inheritAttrs:!1,__name:"FDataTable",props:{headers:{},items:{},loading:{type:Boolean,default:!1},search:{default:""},itemsPerPage:{default:10},hover:{type:Boolean,default:!0},density:{default:"default"}},setup(n){return(e,d)=>(t.openBlock(),t.createBlock(t.unref(c.VDataTable),t.mergeProps(e.$attrs,{headers:n.headers,items:n.items,loading:n.loading,search:n.search,"items-per-page":n.itemsPerPage,hover:n.hover,density:n.density}),t.createSlots({_:2},[t.renderList(e.$slots,(l,a)=>({name:a,fn:t.withCtx(i=>[t.renderSlot(e.$slots,a,t.normalizeProps(t.guardReactiveProps(i??{})))])}))]),1040,["headers","items","loading","search","items-per-page","hover","density"]))}}),B=t.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(n){const e=n,d=t.computed(()=>e.rules),{errorMessage:l,value:a}=p.useField(()=>e.name,d,{initialValue:e.modelValue,syncVModel:!0});return(i,o)=>(t.openBlock(),t.createBlock(t.unref(c.VTextarea),t.mergeProps(i.$attrs,{modelValue:t.unref(a),"onUpdate:modelValue":o[0]||(o[0]=s=>t.isRef(a)?a.value=s:null),name:e.name,rounded:e.rounded,variant:e.variant,rows:e.rows,density:e.density,color:e.color,label:e.label,"hide-details":e.hideDetails,"no-resize":e.noResize,"error-messages":t.unref(l)}),null,16,["modelValue","name","rounded","variant","rows","density","color","label","hide-details","no-resize","error-messages"]))}}),k=t.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(n,{emit:e}){const d=e,l=n,a=t.computed(()=>l.rules),{errorMessage:i,value:o}=p.useField(()=>l.name,a,{initialValue:l.modelValue,syncVModel:!0});function s(y){d("change",y)}return(y,m)=>(t.openBlock(),t.createBlock(t.unref(c.VAutocomplete),t.mergeProps(y.$attrs,{modelValue:t.unref(o),"onUpdate:modelValue":[m[0]||(m[0]=h=>t.isRef(o)?o.value=h:null),m[1]||(m[1]=h=>s(t.unref(o)))],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":t.unref(i)}),null,16,["modelValue","name","items","rounded","variant","density","color","clearable","hide-details","return-object","no-data-text","error-messages"]))}}),S=t.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(n){const e=n;return(d,l)=>(t.openBlock(),t.createBlock(t.unref(c.VCheckbox),t.mergeProps(d.$attrs,{color:e.color,"hide-details":e.hideDetails,indeterminate:e.indeterminate,density:e.density}),null,16,["color","hide-details","indeterminate","density"]))}}),_=t.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(n){const e=n,d=t.computed(()=>e.rules),{errorMessage:l,value:a}=p.useField(()=>e.name,d,{initialValue:e.modelValue,syncVModel:!0}),i=t.computed(()=>new Intl.NumberFormat(e.locale,{style:"currency",currency:e.currency,minimumFractionDigits:e.precision,maximumFractionDigits:e.precision})),o=t.ref(s(e.modelValue));function s(u){return u==null||isNaN(u)?"":i.value.format(u)}function y(u){const f=u.replace(/[^\d,.-]/g,"").replace(/\./g,"").replace(",","."),F=parseFloat(f);return isNaN(F)?null:Math.round(F*Math.pow(10,e.precision))/Math.pow(10,e.precision)}const m=t.ref(!1);function h(u){const f=u.target;o.value=f.value,a.value=y(f.value)}function A(){m.value=!1,o.value=s(a.value)}function P(u){m.value=!0;const f=u.target,F=a.value;F!=null?o.value=F.toFixed(e.precision).replace(".",","):o.value="",setTimeout(()=>f.select(),0)}return t.watch(()=>e.modelValue,u=>{a.value=u,m.value||(o.value=s(u))}),(u,f)=>(t.openBlock(),t.createBlock(t.unref(c.VTextField),t.mergeProps(u.$attrs,{"model-value":o.value,name:e.name,label:e.label,readonly:e.readonly,"hide-details":e.hideDetails,rounded:e.rounded,variant:e.variant,density:e.density,color:e.color,"error-messages":t.unref(l),inputmode:"decimal",onInput:h,onBlur:A,onFocus:P}),null,16,["model-value","name","label","readonly","hide-details","rounded","variant","density","color","error-messages"]))}}),D=t.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(n){const e=n,d=t.computed(()=>e.rules),{errorMessage:l,value:a}=p.useField(()=>e.name,d,{initialValue:e.modelValue,syncVModel:!0});return(i,o)=>(t.openBlock(),t.createBlock(t.unref(c.VSelect),t.mergeProps(i.$attrs,{modelValue:t.unref(a),"onUpdate:modelValue":o[0]||(o[0]=s=>t.isRef(a)?a.value=s:null),name:e.name,items:e.items,rounded:e.rounded,variant:e.variant,density:e.density,color:e.color,"hide-details":e.hideDetails,"return-object":e.returnObject,"error-messages":t.unref(l)}),null,16,["modelValue","name","items","rounded","variant","density","color","hide-details","return-object","error-messages"]))}}),T=t.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(n){const e=n,d=t.computed(()=>e.rules),{errorMessage:l,value:a}=p.useField(()=>e.name,d,{initialValue:e.modelValue,syncVModel:!0});return(i,o)=>(t.openBlock(),t.createBlock(t.unref(c.VNumberInput),t.mergeProps(i.$attrs,{modelValue:t.unref(a),"onUpdate:modelValue":o[0]||(o[0]=s=>t.isRef(a)?a.value=s:null),name:e.name,color:e.color,density:e.density,rounded:e.rounded,variant:e.variant,"control-variant":e.controlVariant,"hide-details":e.hideDetails,placeholder:e.placeholder,label:e.label,prefix:e.prefix,disabled:e.disabled,readonly:e.readonly,min:e.min,precision:e.precision,inset:e.inset,"error-messages":t.unref(l)}),null,16,["modelValue","name","color","density","rounded","variant","control-variant","hide-details","placeholder","label","prefix","disabled","readonly","min","precision","inset","error-messages"]))}}),M={key:0},x={key:1},C=t.defineComponent({name:"FSwitch",inheritAttrs:!1,__name:"FSwitch",props:t.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(n){const e=n,d=t.useModel(n,"modelValue");return(l,a)=>(t.openBlock(),t.createBlock(t.unref(c.VSwitch),t.mergeProps(l.$attrs,{modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=i=>d.value=i),color:e.color,"hide-details":e.hideDetails,density:e.density}),t.createSlots({_:2},[e.labelTrue||e.labelFalse?{name:"label",fn:t.withCtx(()=>[d.value?(t.openBlock(),t.createElementBlock("span",M,t.toDisplayString(e.labelTrue),1)):(t.openBlock(),t.createElementBlock("span",x,t.toDisplayString(e.labelFalse),1))]),key:"0"}:void 0]),1040,["modelValue","color","hide-details","density"]))}}),w={install(n){n.component("FButton",g),n.component("FTextField",V),n.component("FDataTable",b),n.component("FTextarea",B),n.component("FAutocomplete",k),n.component("FCheckbox",S),n.component("FCurrencyField",_),n.component("FSelect",D),n.component("FNumberField",T),n.component("FSwitch",C)}};r.FAutocomplete=k,r.FButton=g,r.FCheckbox=S,r.FCurrencyField=_,r.FDataTable=b,r.FNumberField=T,r.FSelect=D,r.FSwitch=C,r.FTextField=V,r.FTextarea=B,r.default=w,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
1
+ (function(r,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):(r=typeof globalThis<"u"?globalThis:r||self,e(r.FinsoVueComponents={},r.Vue,r.VuetifyComponents,r.MaskaVue,r.VeeValidate))})(this,(function(r,e,m,$,y){"use strict";const g=e.defineComponent({__name:"FButton",props:{color:{default:"primary"},rounded:{type:[String,Number,Boolean],default:"lg"}},setup(n){const t=n;return(d,l)=>{const a=e.resolveComponent("v-btn");return e.openBlock(),e.createBlock(a,{color:t.color,rounded:t.rounded},null,8,["color","rounded"])}}}),V=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(n){const t=n,d=e.computed(()=>t.rules),{errorMessage:l,value:a}=y.useField(()=>t.name,d,{initialValue:t.modelValue,syncVModel:!0});return(i,o)=>e.withDirectives((e.openBlock(),e.createBlock(e.unref(m.VTextField),e.mergeProps(i.$attrs,{modelValue:e.unref(a),"onUpdate:modelValue":o[0]||(o[0]=s=>e.isRef(a)?a.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(l),"append-inner-icon":t.appendInnerIcon,"onClick:appendInner":o[1]||(o[1]=s=>i.$emit("clickAppendInner"))}),null,16,["modelValue","name","color","density","rounded","variant","clearable","hide-details","error-messages","append-inner-icon"])),[[e.unref($.vMaska),t.mask]])}}),b=e.defineComponent({name:"FDataTable",inheritAttrs:!1,__name:"FDataTable",props:{headers:{},items:{},loading:{type:Boolean,default:!1},search:{default:""},itemsPerPage:{default:10},hover:{type:Boolean,default:!0},density:{default:"default"}},setup(n){return(t,d)=>(e.openBlock(),e.createBlock(e.unref(m.VDataTable),e.mergeProps(t.$attrs,{headers:n.headers,items:n.items,loading:n.loading,search:n.search,"items-per-page":n.itemsPerPage,hover:n.hover,density:n.density}),e.createSlots({_:2},[e.renderList(t.$slots,(l,a)=>({name:a,fn:e.withCtx(i=>[e.renderSlot(t.$slots,a,e.normalizeProps(e.guardReactiveProps(i??{})))])}))]),1040,["headers","items","loading","search","items-per-page","hover","density"]))}}),B=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(n){const t=n,d=e.computed(()=>t.rules),{errorMessage:l,value:a}=y.useField(()=>t.name,d,{initialValue:t.modelValue,syncVModel:!0});return(i,o)=>(e.openBlock(),e.createBlock(e.unref(m.VTextarea),e.mergeProps(i.$attrs,{modelValue:e.unref(a),"onUpdate:modelValue":o[0]||(o[0]=s=>e.isRef(a)?a.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(l)}),null,16,["modelValue","name","rounded","variant","rows","density","color","label","hide-details","no-resize","error-messages"]))}}),k=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(n,{emit:t}){const d=t,l=n,a=e.computed(()=>l.rules),{errorMessage:i,value:o}=y.useField(()=>l.name,a,{initialValue:l.modelValue,syncVModel:!0});function s(f){d("change",f)}return(f,c)=>(e.openBlock(),e.createBlock(e.unref(m.VAutocomplete),e.mergeProps(f.$attrs,{modelValue:e.unref(o),"onUpdate:modelValue":[c[0]||(c[0]=h=>e.isRef(o)?o.value=h:null),c[1]||(c[1]=h=>s(e.unref(o)))],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(i)}),null,16,["modelValue","name","items","rounded","variant","density","color","clearable","hide-details","return-object","no-data-text","error-messages"]))}}),S=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(n){const t=n;return(d,l)=>(e.openBlock(),e.createBlock(e.unref(m.VCheckbox),e.mergeProps(d.$attrs,{color:t.color,"hide-details":t.hideDetails,indeterminate:t.indeterminate,density:t.density}),null,16,["color","hide-details","indeterminate","density"]))}}),_=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(n){const t=n,d=e.computed(()=>t.rules),{errorMessage:l,value:a}=y.useField(()=>t.name,d,{initialValue:t.modelValue,syncVModel:!0}),i=e.computed(()=>new Intl.NumberFormat(t.locale,{style:"currency",currency:t.currency,minimumFractionDigits:t.precision,maximumFractionDigits:t.precision})),o=e.ref(s(t.modelValue));function s(u){return u==null||isNaN(u)?"":i.value.format(u)}function f(u){const p=u.replace(/[^\d,.-]/g,"").replace(/\./g,"").replace(",","."),F=parseFloat(p);return isNaN(F)?null:Math.round(F*Math.pow(10,t.precision))/Math.pow(10,t.precision)}const c=e.ref(!1);function h(u){const p=u.target;o.value=p.value,a.value=f(p.value)}function x(){c.value=!1,o.value=s(a.value)}function R(u){c.value=!0;const p=u.target,F=a.value;F!=null?o.value=F.toFixed(t.precision).replace(".",","):o.value="",setTimeout(()=>p.select(),0)}return e.watch(()=>t.modelValue,u=>{a.value=u,c.value||(o.value=s(u))}),(u,p)=>(e.openBlock(),e.createBlock(e.unref(m.VTextField),e.mergeProps(u.$attrs,{"model-value":o.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:h,onBlur:x,onFocus:R}),null,16,["model-value","name","label","readonly","hide-details","rounded","variant","density","color","error-messages"]))}}),D=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(n){const t=n,d=e.computed(()=>t.rules),{errorMessage:l,value:a}=y.useField(()=>t.name,d,{initialValue:t.modelValue,syncVModel:!0});return(i,o)=>(e.openBlock(),e.createBlock(e.unref(m.VSelect),e.mergeProps(i.$attrs,{modelValue:e.unref(a),"onUpdate:modelValue":o[0]||(o[0]=s=>e.isRef(a)?a.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(l)}),e.createSlots({_:2},[e.renderList(i.$slots,(s,f)=>({name:f,fn:e.withCtx(c=>[e.renderSlot(i.$slots,f,e.normalizeProps(e.guardReactiveProps(c??{})))])}))]),1040,["modelValue","name","items","rounded","variant","density","color","hide-details","return-object","error-messages"]))}}),C=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(n){const t=n,d=e.computed(()=>t.rules),{errorMessage:l,value:a}=y.useField(()=>t.name,d,{initialValue:t.modelValue,syncVModel:!0});return(i,o)=>(e.openBlock(),e.createBlock(e.unref(m.VNumberInput),e.mergeProps(i.$attrs,{modelValue:e.unref(a),"onUpdate:modelValue":o[0]||(o[0]=s=>e.isRef(a)?a.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(l)}),null,16,["modelValue","name","color","density","rounded","variant","control-variant","hide-details","placeholder","label","prefix","disabled","readonly","min","precision","inset","error-messages"]))}}),M={key:0},P={key:1},T=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(n){const t=n,d=e.useModel(n,"modelValue");return(l,a)=>(e.openBlock(),e.createBlock(e.unref(m.VSwitch),e.mergeProps(l.$attrs,{modelValue:d.value,"onUpdate:modelValue":a[0]||(a[0]=i=>d.value=i),color:t.color,"hide-details":t.hideDetails,density:t.density}),e.createSlots({_:2},[t.labelTrue||t.labelFalse?{name:"label",fn:e.withCtx(()=>[d.value?(e.openBlock(),e.createElementBlock("span",M,e.toDisplayString(t.labelTrue),1)):(e.openBlock(),e.createElementBlock("span",P,e.toDisplayString(t.labelFalse),1))]),key:"0"}:void 0]),1040,["modelValue","color","hide-details","density"]))}}),w={install(n){n.component("FButton",g),n.component("FTextField",V),n.component("FDataTable",b),n.component("FTextarea",B),n.component("FAutocomplete",k),n.component("FCheckbox",S),n.component("FCurrencyField",_),n.component("FSelect",D),n.component("FNumberField",C),n.component("FSwitch",T)}};r.FAutocomplete=k,r.FButton=g,r.FCheckbox=S,r.FCurrencyField=_,r.FDataTable=b,r.FNumberField=C,r.FSelect=D,r.FSwitch=T,r.FTextField=V,r.FTextarea=B,r.default=w,Object.defineProperties(r,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "finso-vue-components",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "description": "Finso Vue 3 + Vuetify UI Component Library",
5
5
  "type": "module",
6
6
  "main": "./dist/finso-vue-components.umd.cjs",