finso-vue-components 0.4.0 → 0.4.1

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.
@@ -1,8 +1,8 @@
1
- import { defineComponent as c, resolveComponent as M, openBlock as i, createBlock as m, computed as y, withDirectives as k, unref as o, mergeProps as p, isRef as g, createSlots as D, renderList as A, withCtx as x, renderSlot as w, normalizeProps as C, guardReactiveProps as N, ref as R, watch as B, useModel as I, createElementBlock as S, toDisplayString as _, mergeModels as j } from "vue";
2
- import { VTextField as T, VDataTable as P, VTextarea as U, VAutocomplete as z, VCheckbox as O, VSelect as E, VNumberInput as L, VSwitch as Y } from "vuetify/components";
3
- import { vMaska as q } from "maska/vue";
4
- import { useField as v } from "vee-validate";
5
- const G = /* @__PURE__ */ c({
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";
3
+ import { vMaska as G } from "maska/vue";
4
+ import { useField as F } from "vee-validate";
5
+ const H = /* @__PURE__ */ c({
6
6
  __name: "FButton",
7
7
  props: {
8
8
  color: { default: "primary" },
@@ -11,14 +11,14 @@ const G = /* @__PURE__ */ c({
11
11
  setup(t) {
12
12
  const e = t;
13
13
  return (r, l) => {
14
- const a = M("v-btn");
14
+ const a = k("v-btn");
15
15
  return i(), m(a, {
16
16
  color: e.color,
17
17
  rounded: e.rounded
18
18
  }, null, 8, ["color", "rounded"]);
19
19
  };
20
20
  }
21
- }), H = /* @__PURE__ */ c({
21
+ }), J = /* @__PURE__ */ c({
22
22
  name: "FTextField",
23
23
  inheritAttrs: !1,
24
24
  __name: "FTextField",
@@ -37,13 +37,13 @@ const G = /* @__PURE__ */ c({
37
37
  },
38
38
  emits: ["clickAppendInner"],
39
39
  setup(t) {
40
- const e = t, r = y(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
40
+ const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
41
41
  initialValue: e.modelValue,
42
42
  syncVModel: !0
43
43
  });
44
- return (d, n) => k((i(), m(o(T), p(d.$attrs, {
44
+ return (d, n) => A((i(), m(o(T), p(d.$attrs, {
45
45
  modelValue: o(a),
46
- "onUpdate:modelValue": n[0] || (n[0] = (u) => g(a) ? a.value = u : null),
46
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => g(a) ? a.value = s : null),
47
47
  name: e.name,
48
48
  color: e.color,
49
49
  density: e.density,
@@ -53,12 +53,12 @@ const G = /* @__PURE__ */ c({
53
53
  "hide-details": e.hideDetails,
54
54
  "error-messages": o(l),
55
55
  "append-inner-icon": e.appendInnerIcon,
56
- "onClick:appendInner": n[1] || (n[1] = (u) => d.$emit("clickAppendInner"))
56
+ "onClick:appendInner": n[1] || (n[1] = (s) => d.$emit("clickAppendInner"))
57
57
  }), null, 16, ["modelValue", "name", "color", "density", "rounded", "variant", "clearable", "hide-details", "error-messages", "append-inner-icon"])), [
58
- [o(q), e.mask]
58
+ [o(G), e.mask]
59
59
  ]);
60
60
  }
61
- }), J = /* @__PURE__ */ c({
61
+ }), K = /* @__PURE__ */ c({
62
62
  name: "FDataTable",
63
63
  inheritAttrs: !1,
64
64
  __name: "FDataTable",
@@ -72,7 +72,7 @@ const G = /* @__PURE__ */ c({
72
72
  density: { default: "default" }
73
73
  },
74
74
  setup(t) {
75
- return (e, r) => (i(), m(o(P), p(e.$attrs, {
75
+ return (e, r) => (i(), m(o(U), p(e.$attrs, {
76
76
  headers: t.headers,
77
77
  items: t.items,
78
78
  loading: t.loading,
@@ -81,15 +81,15 @@ const G = /* @__PURE__ */ c({
81
81
  hover: t.hover,
82
82
  density: t.density
83
83
  }), D({ _: 2 }, [
84
- A(e.$slots, (l, a) => ({
84
+ w(e.$slots, (l, a) => ({
85
85
  name: a,
86
86
  fn: x((d) => [
87
- w(e.$slots, a, C(N(d ?? {})))
87
+ C(e.$slots, a, N(R(d ?? {})))
88
88
  ])
89
89
  }))
90
90
  ]), 1040, ["headers", "items", "loading", "search", "items-per-page", "hover", "density"]));
91
91
  }
92
- }), K = /* @__PURE__ */ c({
92
+ }), Q = /* @__PURE__ */ c({
93
93
  name: "FTextarea",
94
94
  inheritAttrs: !1,
95
95
  __name: "FTextarea",
@@ -107,13 +107,13 @@ const G = /* @__PURE__ */ c({
107
107
  rules: { type: [String, Function], default: "" }
108
108
  },
109
109
  setup(t) {
110
- const e = t, r = y(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
110
+ const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
111
111
  initialValue: e.modelValue,
112
112
  syncVModel: !0
113
113
  });
114
- return (d, n) => (i(), m(o(U), p(d.$attrs, {
114
+ return (d, n) => (i(), m(o(z), p(d.$attrs, {
115
115
  modelValue: o(a),
116
- "onUpdate:modelValue": n[0] || (n[0] = (u) => g(a) ? a.value = u : null),
116
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => g(a) ? a.value = s : null),
117
117
  name: e.name,
118
118
  rounded: e.rounded,
119
119
  variant: e.variant,
@@ -126,7 +126,7 @@ const G = /* @__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
- }), Q = /* @__PURE__ */ c({
129
+ }), W = /* @__PURE__ */ c({
130
130
  name: "FAutocomplete",
131
131
  inheritAttrs: !1,
132
132
  __name: "FAutocomplete",
@@ -146,18 +146,18 @@ const G = /* @__PURE__ */ c({
146
146
  },
147
147
  emits: ["change"],
148
148
  setup(t, { emit: e }) {
149
- const r = e, l = t, a = y(() => l.rules), { errorMessage: d, value: n } = v(() => l.name, a, {
149
+ const r = e, l = t, a = h(() => l.rules), { errorMessage: d, value: n } = F(() => l.name, a, {
150
150
  initialValue: l.modelValue,
151
151
  syncVModel: !0
152
152
  });
153
- function u(b) {
154
- r("change", b);
153
+ function s(v) {
154
+ r("change", v);
155
155
  }
156
- return (b, h) => (i(), m(o(z), p(b.$attrs, {
156
+ return (v, f) => (i(), m(o(O), p(v.$attrs, {
157
157
  modelValue: o(n),
158
158
  "onUpdate:modelValue": [
159
- h[0] || (h[0] = (V) => g(n) ? n.value = V : null),
160
- h[1] || (h[1] = (V) => u(o(n)))
159
+ f[0] || (f[0] = (V) => g(n) ? n.value = V : null),
160
+ f[1] || (f[1] = (V) => s(o(n)))
161
161
  ],
162
162
  name: l.name,
163
163
  items: l.items,
@@ -172,7 +172,7 @@ const G = /* @__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
- }), W = /* @__PURE__ */ c({
175
+ }), X = /* @__PURE__ */ c({
176
176
  name: "FCheckbox",
177
177
  inheritAttrs: !1,
178
178
  __name: "FCheckbox",
@@ -184,14 +184,14 @@ const G = /* @__PURE__ */ c({
184
184
  },
185
185
  setup(t) {
186
186
  const e = t;
187
- return (r, l) => (i(), m(o(O), p(r.$attrs, {
187
+ return (r, l) => (i(), m(o(E), p(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
- }), X = /* @__PURE__ */ c({
194
+ }), Z = /* @__PURE__ */ c({
195
195
  name: "FCurrencyField",
196
196
  inheritAttrs: !1,
197
197
  __name: "FCurrencyField",
@@ -211,40 +211,40 @@ const G = /* @__PURE__ */ c({
211
211
  rules: { type: [String, Function], default: "" }
212
212
  },
213
213
  setup(t) {
214
- const e = t, r = y(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
214
+ const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
215
215
  initialValue: e.modelValue,
216
216
  syncVModel: !0
217
- }), d = y(
217
+ }), d = h(
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 = R(u(e.modelValue));
225
- function u(s) {
226
- return s == null || isNaN(s) ? "" : d.value.format(s);
224
+ ), n = B(s(e.modelValue));
225
+ function s(u) {
226
+ return u == null || isNaN(u) ? "" : d.value.format(u);
227
227
  }
228
- function b(s) {
229
- const F = s.replace(/[^\d,.-]/g, "").replace(/\./g, "").replace(",", "."), f = parseFloat(F);
230
- return isNaN(f) ? null : Math.round(f * Math.pow(10, e.precision)) / Math.pow(10, e.precision);
228
+ function v(u) {
229
+ const y = u.replace(/[^\d,.-]/g, "").replace(/\./g, "").replace(",", "."), b = parseFloat(y);
230
+ return isNaN(b) ? null : Math.round(b * Math.pow(10, e.precision)) / Math.pow(10, e.precision);
231
231
  }
232
- function h(s) {
233
- const F = s.target, f = b(F.value);
234
- a.value = f;
232
+ const f = B(!1);
233
+ function V(u) {
234
+ const y = u.target;
235
+ n.value = y.value, a.value = v(y.value);
235
236
  }
236
- function V() {
237
- n.value = u(a.value);
237
+ function $() {
238
+ f.value = !1, n.value = s(a.value);
238
239
  }
239
- function $(s) {
240
- const F = s.target, f = a.value;
241
- f != null && (n.value = f.toFixed(e.precision).replace(".", ",")), setTimeout(() => F.select(), 0);
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);
242
244
  }
243
- return B(() => e.modelValue, (s) => {
244
- a.value = s, n.value = u(s);
245
- }), B(a, (s) => {
246
- n.value = u(s);
247
- }), (s, F) => (i(), m(o(T), p(s.$attrs, {
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, {
248
248
  "model-value": n.value,
249
249
  name: e.name,
250
250
  label: e.label,
@@ -256,12 +256,12 @@ const G = /* @__PURE__ */ c({
256
256
  color: e.color,
257
257
  "error-messages": o(l),
258
258
  inputmode: "decimal",
259
- onInput: h,
260
- onBlur: V,
261
- onFocus: $
259
+ onInput: V,
260
+ onBlur: $,
261
+ onFocus: M
262
262
  }), null, 16, ["model-value", "name", "label", "readonly", "hide-details", "rounded", "variant", "density", "color", "error-messages"]));
263
263
  }
264
- }), Z = /* @__PURE__ */ c({
264
+ }), ee = /* @__PURE__ */ c({
265
265
  name: "FSelect",
266
266
  inheritAttrs: !1,
267
267
  __name: "FSelect",
@@ -278,13 +278,13 @@ const G = /* @__PURE__ */ c({
278
278
  rules: { type: [String, Function], default: "" }
279
279
  },
280
280
  setup(t) {
281
- const e = t, r = y(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
281
+ const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
282
282
  initialValue: e.modelValue,
283
283
  syncVModel: !0
284
284
  });
285
- return (d, n) => (i(), m(o(E), p(d.$attrs, {
285
+ return (d, n) => (i(), m(o(L), p(d.$attrs, {
286
286
  modelValue: o(a),
287
- "onUpdate:modelValue": n[0] || (n[0] = (u) => g(a) ? a.value = u : null),
287
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => g(a) ? a.value = s : null),
288
288
  name: e.name,
289
289
  items: e.items,
290
290
  rounded: e.rounded,
@@ -296,7 +296,7 @@ const G = /* @__PURE__ */ c({
296
296
  "error-messages": o(l)
297
297
  }), null, 16, ["modelValue", "name", "items", "rounded", "variant", "density", "color", "hide-details", "return-object", "error-messages"]));
298
298
  }
299
- }), ee = /* @__PURE__ */ c({
299
+ }), te = /* @__PURE__ */ c({
300
300
  name: "FNumberField",
301
301
  inheritAttrs: !1,
302
302
  __name: "FNumberField",
@@ -320,13 +320,13 @@ const G = /* @__PURE__ */ c({
320
320
  rules: { type: [String, Function], default: "" }
321
321
  },
322
322
  setup(t) {
323
- const e = t, r = y(() => e.rules), { errorMessage: l, value: a } = v(() => e.name, r, {
323
+ const e = t, r = h(() => e.rules), { errorMessage: l, value: a } = F(() => e.name, r, {
324
324
  initialValue: e.modelValue,
325
325
  syncVModel: !0
326
326
  });
327
- return (d, n) => (i(), m(o(L), p(d.$attrs, {
327
+ return (d, n) => (i(), m(o(Y), p(d.$attrs, {
328
328
  modelValue: o(a),
329
- "onUpdate:modelValue": n[0] || (n[0] = (u) => g(a) ? a.value = u : null),
329
+ "onUpdate:modelValue": n[0] || (n[0] = (s) => g(a) ? a.value = s : null),
330
330
  name: e.name,
331
331
  color: e.color,
332
332
  density: e.density,
@@ -345,11 +345,11 @@ const G = /* @__PURE__ */ c({
345
345
  "error-messages": o(l)
346
346
  }), null, 16, ["modelValue", "name", "color", "density", "rounded", "variant", "control-variant", "hide-details", "placeholder", "label", "prefix", "disabled", "readonly", "min", "precision", "inset", "error-messages"]));
347
347
  }
348
- }), te = { key: 0 }, ae = { key: 1 }, le = /* @__PURE__ */ c({
348
+ }), ae = { key: 0 }, le = { key: 1 }, ne = /* @__PURE__ */ c({
349
349
  name: "FSwitch",
350
350
  inheritAttrs: !1,
351
351
  __name: "FSwitch",
352
- props: /* @__PURE__ */ j({
352
+ props: /* @__PURE__ */ P({
353
353
  color: { default: "secondary" },
354
354
  density: { default: "comfortable" },
355
355
  hideDetails: { type: [Boolean, String], default: "auto" },
@@ -361,8 +361,8 @@ const G = /* @__PURE__ */ c({
361
361
  }),
362
362
  emits: ["update:modelValue"],
363
363
  setup(t) {
364
- const e = t, r = I(t, "modelValue");
365
- return (l, a) => (i(), m(o(Y), p(l.$attrs, {
364
+ const e = t, r = j(t, "modelValue");
365
+ return (l, a) => (i(), m(o(q), p(l.$attrs, {
366
366
  modelValue: r.value,
367
367
  "onUpdate:modelValue": a[0] || (a[0] = (d) => r.value = d),
368
368
  color: e.color,
@@ -372,27 +372,27 @@ const G = /* @__PURE__ */ c({
372
372
  e.labelTrue || e.labelFalse ? {
373
373
  name: "label",
374
374
  fn: x(() => [
375
- r.value ? (i(), S("span", te, _(e.labelTrue), 1)) : (i(), S("span", ae, _(e.labelFalse), 1))
375
+ r.value ? (i(), S("span", ae, _(e.labelTrue), 1)) : (i(), S("span", le, _(e.labelFalse), 1))
376
376
  ]),
377
377
  key: "0"
378
378
  } : void 0
379
379
  ]), 1040, ["modelValue", "color", "hide-details", "density"]));
380
380
  }
381
- }), se = {
381
+ }), ue = {
382
382
  install(t) {
383
- t.component("FButton", G), t.component("FTextField", H), t.component("FDataTable", J), t.component("FTextarea", K), t.component("FAutocomplete", Q), t.component("FCheckbox", W), t.component("FCurrencyField", X), t.component("FSelect", Z), t.component("FNumberField", ee), t.component("FSwitch", le);
383
+ t.component("FButton", H), t.component("FTextField", J), t.component("FDataTable", K), t.component("FTextarea", Q), t.component("FAutocomplete", W), t.component("FCheckbox", X), t.component("FCurrencyField", Z), t.component("FSelect", ee), t.component("FNumberField", te), t.component("FSwitch", ne);
384
384
  }
385
385
  };
386
386
  export {
387
- Q as FAutocomplete,
388
- G as FButton,
389
- W as FCheckbox,
390
- X as FCurrencyField,
391
- J as FDataTable,
392
- ee as FNumberField,
393
- Z as FSelect,
394
- le as FSwitch,
395
- H as FTextField,
396
- K as FTextarea,
397
- se as default
387
+ W as FAutocomplete,
388
+ H as FButton,
389
+ X as FCheckbox,
390
+ Z as FCurrencyField,
391
+ K as FDataTable,
392
+ te as FNumberField,
393
+ ee as FSelect,
394
+ ne as FSwitch,
395
+ J as FTextField,
396
+ Q as FTextarea,
397
+ ue as default
398
398
  };
@@ -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,$,f){"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}=f.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]=u=>t.isRef(a)?a.value=u: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]=u=>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}=f.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]=u=>t.isRef(a)?a.value=u: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}=f.useField(()=>l.name,a,{initialValue:l.modelValue,syncVModel:!0});function u(h){d("change",h)}return(h,p)=>(t.openBlock(),t.createBlock(t.unref(c.VAutocomplete),t.mergeProps(h.$attrs,{modelValue:t.unref(o),"onUpdate:modelValue":[p[0]||(p[0]=F=>t.isRef(o)?o.value=F:null),p[1]||(p[1]=F=>u(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}=f.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(u(e.modelValue));function u(s){return s==null||isNaN(s)?"":i.value.format(s)}function h(s){const y=s.replace(/[^\d,.-]/g,"").replace(/\./g,"").replace(",","."),m=parseFloat(y);return isNaN(m)?null:Math.round(m*Math.pow(10,e.precision))/Math.pow(10,e.precision)}function p(s){const y=s.target,m=h(y.value);a.value=m}function F(){o.value=u(a.value)}function A(s){const y=s.target,m=a.value;m!=null&&(o.value=m.toFixed(e.precision).replace(".",",")),setTimeout(()=>y.select(),0)}return t.watch(()=>e.modelValue,s=>{a.value=s,o.value=u(s)}),t.watch(a,s=>{o.value=u(s)}),(s,y)=>(t.openBlock(),t.createBlock(t.unref(c.VTextField),t.mergeProps(s.$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:p,onBlur:F,onFocus:A}),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}=f.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]=u=>t.isRef(a)?a.value=u: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}=f.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]=u=>t.isRef(a)?a.value=u: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,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"}})}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "finso-vue-components",
3
- "version": "0.4.0",
3
+ "version": "0.4.1",
4
4
  "description": "Finso Vue 3 + Vuetify UI Component Library",
5
5
  "type": "module",
6
6
  "main": "./dist/finso-vue-components.umd.cjs",