@craterapp/vue-sdk 0.0.2-alpha.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.
- package/README.md +34 -0
- package/dist/AddressType-m1hqKeYp.js +227 -0
- package/dist/CheckboxType-i0NN31IO.js +72 -0
- package/dist/DOBType-7LLta_0g.js +129 -0
- package/dist/DocumentType-brMr3YMK.js +412 -0
- package/dist/DropdownType-jG2Uw1cX.js +54 -0
- package/dist/EmailType-fxRHt19f.js +67 -0
- package/dist/ExternalAccountType-JpeVUGZe.js +208 -0
- package/dist/IdentityNumberType-_qb4HC7c.js +68 -0
- package/dist/InputType-SM3zO2qx.js +71 -0
- package/dist/MCCType-jJ2nRm9j.js +1488 -0
- package/dist/PhoneType-7z0wZZBx.js +69 -0
- package/dist/SSNType-FNEpe3un.js +70 -0
- package/dist/TaxType-B9-nJm8c.js +68 -0
- package/dist/TextAreaType-KPDy81ZR.js +71 -0
- package/dist/UrlType-Kfiv3mDk.js +114 -0
- package/dist/crater-vue-sdk.es.js +22 -0
- package/dist/crater-vue-sdk.umd.js +239 -0
- package/dist/fonts/Inter/Inter-Black.otf +0 -0
- package/dist/fonts/Inter/Inter-BlackItalic.otf +0 -0
- package/dist/fonts/Inter/Inter-Bold.otf +0 -0
- package/dist/fonts/Inter/Inter-BoldItalic.otf +0 -0
- package/dist/fonts/Inter/Inter-ExtraBold.otf +0 -0
- package/dist/fonts/Inter/Inter-ExtraBoldItalic.otf +0 -0
- package/dist/fonts/Inter/Inter-ExtraLight.otf +0 -0
- package/dist/fonts/Inter/Inter-ExtraLightItalic.otf +0 -0
- package/dist/fonts/Inter/Inter-Italic.otf +0 -0
- package/dist/fonts/Inter/Inter-Light.otf +0 -0
- package/dist/fonts/Inter/Inter-LightItalic.otf +0 -0
- package/dist/fonts/Inter/Inter-Medium.otf +0 -0
- package/dist/fonts/Inter/Inter-MediumItalic.otf +0 -0
- package/dist/fonts/Inter/Inter-Regular.otf +0 -0
- package/dist/fonts/Inter/Inter-SemiBold.otf +0 -0
- package/dist/fonts/Inter/Inter-SemiBoldItalic.otf +0 -0
- package/dist/fonts/Inter/Inter-Thin.otf +0 -0
- package/dist/fonts/Inter/Inter-ThinItalic.otf +0 -0
- package/dist/fonts/Inter/Inter-V.ttf +0 -0
- package/dist/index-IlzZ4Xqv.js +80938 -0
- package/dist/index.d.ts +8 -0
- package/dist/style.css +9 -0
- package/dist/templates/estimate1.png +0 -0
- package/dist/templates/estimate2.png +0 -0
- package/dist/templates/estimate3.png +0 -0
- package/dist/templates/invoice1.png +0 -0
- package/dist/templates/invoice2.png +0 -0
- package/dist/templates/invoice3.png +0 -0
- package/dist/types/interfaces.d.ts +11 -0
- package/dist/types/locale.d.ts +4 -0
- package/dist/views/BusinessPaymentStatus.vue.d.ts +2 -0
- package/dist/views/CustomerCreate.vue.d.ts +2 -0
- package/dist/views/CustomerDetails.vue.d.ts +14 -0
- package/dist/views/CustomerEdit.vue.d.ts +14 -0
- package/dist/views/CustomerTable.vue.d.ts +2 -0
- package/dist/views/EstimateCreate.vue.d.ts +2 -0
- package/dist/views/EstimateDetails.vue.d.ts +14 -0
- package/dist/views/EstimateEdit.vue.d.ts +14 -0
- package/dist/views/EstimateTable.vue.d.ts +16 -0
- package/dist/views/HelloWorld.vue.d.ts +6 -0
- package/dist/views/InvoiceCreate.vue.d.ts +2 -0
- package/dist/views/InvoiceDetails.vue.d.ts +14 -0
- package/dist/views/InvoiceEdit.vue.d.ts +14 -0
- package/dist/views/InvoiceTable.vue.d.ts +16 -0
- package/dist/views/Payment.vue.d.ts +74 -0
- package/dist/views/index.d.ts +15 -0
- package/package.json +97 -0
package/README.md
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
## Crater Vue SDK
|
|
2
|
+
|
|
3
|
+
### 1. Install
|
|
4
|
+
|
|
5
|
+
Run the following command to Install Crater Vue SDK
|
|
6
|
+
|
|
7
|
+
### NPM
|
|
8
|
+
```bash
|
|
9
|
+
npm install @craterapp/vue-sdk
|
|
10
|
+
```
|
|
11
|
+
### Yarn
|
|
12
|
+
```bash
|
|
13
|
+
yarn add @craterapp/vue-sdk
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
### 2. Configuration
|
|
17
|
+
|
|
18
|
+
Add Crater SDK to the main application.
|
|
19
|
+
|
|
20
|
+
```js
|
|
21
|
+
import { createApp } from 'vue'
|
|
22
|
+
import '@craterapp/vue-sdk/dist/style.css'
|
|
23
|
+
import { craterPlugin } from '@craterapp/vue-sdk'
|
|
24
|
+
import App from './App.vue'
|
|
25
|
+
|
|
26
|
+
const app = createApp(App)
|
|
27
|
+
|
|
28
|
+
app.use(craterPlugin, {
|
|
29
|
+
apiBaseUrl: '<API_BASE_URL>',
|
|
30
|
+
})
|
|
31
|
+
|
|
32
|
+
app.mount('#app')
|
|
33
|
+
|
|
34
|
+
```
|
|
@@ -0,0 +1,227 @@
|
|
|
1
|
+
import { u as q, c as n, t as r, r as c, a as v, _ as N, b as h, d as A, e as k } from "./index-IlzZ4Xqv.js";
|
|
2
|
+
import { defineComponent as C, computed as I, openBlock as t, createElementBlock as w, Fragment as _, createBlock as u, unref as a, withCtx as b, createVNode as f, createCommentVNode as m } from "vue";
|
|
3
|
+
const S = [
|
|
4
|
+
{ name: "Alabama", code: "AL" },
|
|
5
|
+
{ name: "Alaska", code: "AK" },
|
|
6
|
+
{ name: "Arizona", code: "AZ" },
|
|
7
|
+
{ name: "Arkansas", code: "AR" },
|
|
8
|
+
{ name: "California", code: "CA" },
|
|
9
|
+
{ name: "Colorado", code: "CO" },
|
|
10
|
+
{ name: "Connecticut", code: "CT" },
|
|
11
|
+
{ name: "Delaware", code: "DE" },
|
|
12
|
+
{ name: "District of Columbia", code: "DC" },
|
|
13
|
+
{ name: "Florida", code: "FL" },
|
|
14
|
+
{ name: "Georgia", code: "GA" },
|
|
15
|
+
{ name: "Hawaii", code: "HI" },
|
|
16
|
+
{ name: "Idaho", code: "ID" },
|
|
17
|
+
{ name: "Illinois", code: "IL" },
|
|
18
|
+
{ name: "Indiana", code: "IN" },
|
|
19
|
+
{ name: "Iowa", code: "IA" },
|
|
20
|
+
{ name: "Kansas", code: "KS" },
|
|
21
|
+
{ name: "Kentucky", code: "KY" },
|
|
22
|
+
{ name: "Louisiana", code: "LA" },
|
|
23
|
+
{ name: "Maine", code: "ME" },
|
|
24
|
+
{ name: "Maryland", code: "MD" },
|
|
25
|
+
{ name: "Massachusetts", code: "MA" },
|
|
26
|
+
{ name: "Michigan", code: "MI" },
|
|
27
|
+
{ name: "Minnesota", code: "MN" },
|
|
28
|
+
{ name: "Mississippi", code: "MS" },
|
|
29
|
+
{ name: "Missouri", code: "MO" },
|
|
30
|
+
{ name: "Montana", code: "MT" },
|
|
31
|
+
{ name: "Nebraska", code: "NE" },
|
|
32
|
+
{ name: "Nevada", code: "NV" },
|
|
33
|
+
{ name: "New Hampshire", code: "NH" },
|
|
34
|
+
{ name: "New Jersey", code: "NJ" },
|
|
35
|
+
{ name: "New Mexico", code: "NM" },
|
|
36
|
+
{ name: "New York", code: "NY" },
|
|
37
|
+
{ name: "North Carolina", code: "NC" },
|
|
38
|
+
{ name: "North Dakota", code: "ND" },
|
|
39
|
+
{ name: "Ohio", code: "OH" },
|
|
40
|
+
{ name: "Oklahoma", code: "OK" },
|
|
41
|
+
{ name: "Oregon", code: "OR" },
|
|
42
|
+
{ name: "Pennsylvania", code: "PA" },
|
|
43
|
+
{ name: "Rhode Island", code: "RI" },
|
|
44
|
+
{ name: "South Carolina", code: "SC" },
|
|
45
|
+
{ name: "South Dakota", code: "SD" },
|
|
46
|
+
{ name: "Tennessee", code: "TN" },
|
|
47
|
+
{ name: "Texas", code: "TX" },
|
|
48
|
+
{ name: "Utah", code: "UT" },
|
|
49
|
+
{ name: "Vermont", code: "VT" },
|
|
50
|
+
{ name: "Virginia", code: "VA" },
|
|
51
|
+
{ name: "Washington", code: "WA" },
|
|
52
|
+
{ name: "West Virginia", code: "WV" },
|
|
53
|
+
{ name: "Wisconsin", code: "WI" },
|
|
54
|
+
{ name: "Wyoming", code: "WY" }
|
|
55
|
+
], O = /* @__PURE__ */ C({
|
|
56
|
+
inheritAttrs: !1,
|
|
57
|
+
__name: "AddressType",
|
|
58
|
+
props: {
|
|
59
|
+
modelValue: {
|
|
60
|
+
type: String,
|
|
61
|
+
default: null
|
|
62
|
+
},
|
|
63
|
+
requirements: {
|
|
64
|
+
type: Array,
|
|
65
|
+
default: () => []
|
|
66
|
+
},
|
|
67
|
+
field: {
|
|
68
|
+
type: Object,
|
|
69
|
+
required: !0
|
|
70
|
+
},
|
|
71
|
+
placeholder: {
|
|
72
|
+
type: String,
|
|
73
|
+
default: ""
|
|
74
|
+
},
|
|
75
|
+
validationScope: {
|
|
76
|
+
type: String,
|
|
77
|
+
required: !0
|
|
78
|
+
},
|
|
79
|
+
step: {
|
|
80
|
+
type: Object,
|
|
81
|
+
required: !0
|
|
82
|
+
}
|
|
83
|
+
},
|
|
84
|
+
setup(o) {
|
|
85
|
+
const y = o;
|
|
86
|
+
q();
|
|
87
|
+
function e(i) {
|
|
88
|
+
return y.requirements.find((s) => s.includes(i));
|
|
89
|
+
}
|
|
90
|
+
const V = function(i) {
|
|
91
|
+
return i ? /^\d{5}(-\d{4})?$/.test(i) : !0;
|
|
92
|
+
}, $ = {
|
|
93
|
+
subFields: {
|
|
94
|
+
[e("address.line1")]: {
|
|
95
|
+
required: n.withMessage(
|
|
96
|
+
r("validation.required"),
|
|
97
|
+
c(e("address.line1"))
|
|
98
|
+
)
|
|
99
|
+
},
|
|
100
|
+
[e("address.line2")]: {
|
|
101
|
+
required: n.withMessage(
|
|
102
|
+
r("validation.required"),
|
|
103
|
+
c(e("address.line2"))
|
|
104
|
+
)
|
|
105
|
+
},
|
|
106
|
+
[e("address.state")]: {
|
|
107
|
+
required: n.withMessage(
|
|
108
|
+
r("validation.required"),
|
|
109
|
+
c(e("address.state"))
|
|
110
|
+
)
|
|
111
|
+
},
|
|
112
|
+
[e("address.city")]: {
|
|
113
|
+
required: n.withMessage(
|
|
114
|
+
r("validation.required"),
|
|
115
|
+
c(e("address.city"))
|
|
116
|
+
)
|
|
117
|
+
},
|
|
118
|
+
[e("address.postal_code")]: {
|
|
119
|
+
required: n.withMessage(
|
|
120
|
+
r("validation.required"),
|
|
121
|
+
c(e("address.postal_code"))
|
|
122
|
+
),
|
|
123
|
+
postalCode: n.withMessage("Enter a valid postal code", V)
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
}, d = v(
|
|
127
|
+
$,
|
|
128
|
+
I(() => y.field),
|
|
129
|
+
{ $scope: y.validationScope }
|
|
130
|
+
);
|
|
131
|
+
return (i, s) => {
|
|
132
|
+
const F = N, p = h, g = A, M = k;
|
|
133
|
+
return t(), w(_, null, [
|
|
134
|
+
e("address.line1") || e("address.line2") ? (t(), u(p, {
|
|
135
|
+
key: 0,
|
|
136
|
+
label: r("customers.address"),
|
|
137
|
+
error: a(d).subFields[e("address.line1")].$error && a(d).subFields[e("address.line1")].$errors[0].$message || a(d).subFields[e("address.line2")].$error && a(d).subFields[e("address.line2")].$errors[0].$message,
|
|
138
|
+
required: ""
|
|
139
|
+
}, {
|
|
140
|
+
default: b(() => [
|
|
141
|
+
f(F, {
|
|
142
|
+
modelValue: o.field.subFields[e("address.line1")],
|
|
143
|
+
"onUpdate:modelValue": s[0] || (s[0] = (l) => o.field.subFields[e("address.line1")] = l),
|
|
144
|
+
placeholder: r("general.street_1"),
|
|
145
|
+
type: "text",
|
|
146
|
+
name: "address_street1",
|
|
147
|
+
"container-class": "mt-3",
|
|
148
|
+
invalid: a(d).subFields[e("address.line1")].$error
|
|
149
|
+
}, null, 8, ["modelValue", "placeholder", "invalid"]),
|
|
150
|
+
e("address.line2") ? (t(), u(F, {
|
|
151
|
+
key: 0,
|
|
152
|
+
modelValue: o.field.subFields[e("address.line2")],
|
|
153
|
+
"onUpdate:modelValue": s[1] || (s[1] = (l) => o.field.subFields[e("address.line2")] = l),
|
|
154
|
+
placeholder: r("general.street_2"),
|
|
155
|
+
type: "text",
|
|
156
|
+
class: "mt-3",
|
|
157
|
+
name: "address_street2",
|
|
158
|
+
"container-class": "mt-3",
|
|
159
|
+
invalid: a(d).subFields[e("address.line2")].$error
|
|
160
|
+
}, null, 8, ["modelValue", "placeholder", "invalid"])) : m("", !0)
|
|
161
|
+
]),
|
|
162
|
+
_: 1
|
|
163
|
+
}, 8, ["label", "error"])) : m("", !0),
|
|
164
|
+
e("address.city") ? (t(), u(p, {
|
|
165
|
+
key: 1,
|
|
166
|
+
label: r("customers.city"),
|
|
167
|
+
error: a(d).subFields[e("address.city")].$error && a(d).subFields[e("address.city")].$errors[0].$message,
|
|
168
|
+
required: ""
|
|
169
|
+
}, {
|
|
170
|
+
default: b(() => [
|
|
171
|
+
f(g, {
|
|
172
|
+
modelValue: o.field.subFields[e("address.city")],
|
|
173
|
+
"onUpdate:modelValue": s[2] || (s[2] = (l) => o.field.subFields[e("address.city")] = l),
|
|
174
|
+
name: "address.city",
|
|
175
|
+
type: "text",
|
|
176
|
+
invalid: a(d).subFields[e("address.city")].$error
|
|
177
|
+
}, null, 8, ["modelValue", "invalid"])
|
|
178
|
+
]),
|
|
179
|
+
_: 1
|
|
180
|
+
}, 8, ["label", "error"])) : m("", !0),
|
|
181
|
+
e("address.state") ? (t(), u(p, {
|
|
182
|
+
key: 2,
|
|
183
|
+
label: r("customers.state"),
|
|
184
|
+
error: a(d).subFields[e("address.state")].$error && a(d).subFields[e("address.state")].$errors[0].$message,
|
|
185
|
+
required: ""
|
|
186
|
+
}, {
|
|
187
|
+
default: b(() => [
|
|
188
|
+
f(M, {
|
|
189
|
+
modelValue: o.field.subFields[e("address.state")],
|
|
190
|
+
"onUpdate:modelValue": s[3] || (s[3] = (l) => o.field.subFields[e("address.state")] = l),
|
|
191
|
+
"value-prop": "code",
|
|
192
|
+
label: "name",
|
|
193
|
+
"track-by": "name",
|
|
194
|
+
searchable: "",
|
|
195
|
+
options: a(S),
|
|
196
|
+
placeholder: r("general.select_state"),
|
|
197
|
+
class: "w-full",
|
|
198
|
+
invalid: a(d).subFields[e("address.state")].$error
|
|
199
|
+
}, null, 8, ["modelValue", "options", "placeholder", "invalid"])
|
|
200
|
+
]),
|
|
201
|
+
_: 1
|
|
202
|
+
}, 8, ["label", "error"])) : m("", !0),
|
|
203
|
+
e("address.postal_code") ? (t(), u(p, {
|
|
204
|
+
key: 3,
|
|
205
|
+
label: r("general.zip_code"),
|
|
206
|
+
class: "mt-2 text-left",
|
|
207
|
+
error: a(d).subFields[e("address.postal_code")].$error && a(d).subFields[e("address.postal_code")].$errors[0].$message,
|
|
208
|
+
required: ""
|
|
209
|
+
}, {
|
|
210
|
+
default: b(() => [
|
|
211
|
+
f(g, {
|
|
212
|
+
modelValue: o.field.subFields[e("address.postal_code")],
|
|
213
|
+
"onUpdate:modelValue": s[4] || (s[4] = (l) => o.field.subFields[e("address.postal_code")] = l),
|
|
214
|
+
type: "text",
|
|
215
|
+
name: "postal_code",
|
|
216
|
+
invalid: a(d).subFields[e("address.postal_code")].$error
|
|
217
|
+
}, null, 8, ["modelValue", "invalid"])
|
|
218
|
+
]),
|
|
219
|
+
_: 1
|
|
220
|
+
}, 8, ["label", "error"])) : m("", !0)
|
|
221
|
+
], 64);
|
|
222
|
+
};
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
export {
|
|
226
|
+
O as default
|
|
227
|
+
};
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { c as m, t as p, s as f, a as y, u as _, f as v, b } from "./index-IlzZ4Xqv.js";
|
|
2
|
+
import { defineComponent as x, computed as n, openBlock as V, createBlock as g, unref as t, withCtx as s, createVNode as k, createTextVNode as S, toDisplayString as $, createElementVNode as h } from "vue";
|
|
3
|
+
const q = ["href"], A = /* @__PURE__ */ x({
|
|
4
|
+
__name: "CheckboxType",
|
|
5
|
+
props: {
|
|
6
|
+
modelValue: {
|
|
7
|
+
type: String,
|
|
8
|
+
default: null
|
|
9
|
+
},
|
|
10
|
+
requirements: {
|
|
11
|
+
type: Array,
|
|
12
|
+
default: () => []
|
|
13
|
+
},
|
|
14
|
+
field: {
|
|
15
|
+
type: Object,
|
|
16
|
+
required: !0
|
|
17
|
+
},
|
|
18
|
+
validationScope: {
|
|
19
|
+
type: String,
|
|
20
|
+
required: !0
|
|
21
|
+
},
|
|
22
|
+
label: {
|
|
23
|
+
type: String,
|
|
24
|
+
required: !0
|
|
25
|
+
},
|
|
26
|
+
step: {
|
|
27
|
+
type: Object
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
setup(e) {
|
|
31
|
+
const r = e, l = {
|
|
32
|
+
value: {
|
|
33
|
+
sameAs: m.withMessage(
|
|
34
|
+
p("validation.required"),
|
|
35
|
+
f(!0)
|
|
36
|
+
)
|
|
37
|
+
}
|
|
38
|
+
}, i = n(() => window.tenant), a = y(
|
|
39
|
+
l,
|
|
40
|
+
n(() => r.field),
|
|
41
|
+
{ $scope: r.validationScope }
|
|
42
|
+
);
|
|
43
|
+
return _(), (w, o) => {
|
|
44
|
+
const u = v, c = b;
|
|
45
|
+
return V(), g(c, {
|
|
46
|
+
error: t(a).value.$error && t(a).value.$errors[0].$message
|
|
47
|
+
}, {
|
|
48
|
+
default: s(() => [
|
|
49
|
+
k(u, {
|
|
50
|
+
modelValue: e.field.value,
|
|
51
|
+
"onUpdate:modelValue": o[0] || (o[0] = (d) => e.field.value = d),
|
|
52
|
+
variant: "primary"
|
|
53
|
+
}, {
|
|
54
|
+
default: s(() => [
|
|
55
|
+
S($(e.label) + " ", 1),
|
|
56
|
+
h("a", {
|
|
57
|
+
class: "text-primary-500 dark:text-primary-400",
|
|
58
|
+
href: t(i).terms_link,
|
|
59
|
+
target: "_blank"
|
|
60
|
+
}, " terms of service", 8, q)
|
|
61
|
+
]),
|
|
62
|
+
_: 1
|
|
63
|
+
}, 8, ["modelValue"])
|
|
64
|
+
]),
|
|
65
|
+
_: 1
|
|
66
|
+
}, 8, ["error"]);
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
export {
|
|
71
|
+
A as default
|
|
72
|
+
};
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import { u as F, c as b, t as m, r as f, a as $, d as V, b as x } from "./index-IlzZ4Xqv.js";
|
|
2
|
+
import { defineComponent as w, computed as g, resolveDirective as _, openBlock as i, createBlock as a, unref as o, withCtx as k, createElementVNode as l, withDirectives as y, createCommentVNode as p } from "vue";
|
|
3
|
+
const D = { class: "flex -space-x-px" }, M = { class: "min-w-0" }, S = /* @__PURE__ */ l("label", {
|
|
4
|
+
for: "card-expiration-date",
|
|
5
|
+
class: "sr-only"
|
|
6
|
+
}, " Month ", -1), B = { class: "min-w-0" }, Y = /* @__PURE__ */ l("label", {
|
|
7
|
+
for: "card-expiration-date",
|
|
8
|
+
class: "sr-only"
|
|
9
|
+
}, " Day ", -1), z = { class: "min-w-0" }, C = /* @__PURE__ */ l("label", {
|
|
10
|
+
for: "card-expiration-date",
|
|
11
|
+
class: "sr-only"
|
|
12
|
+
}, " Year ", -1), U = /* @__PURE__ */ w({
|
|
13
|
+
__name: "DOBType",
|
|
14
|
+
props: {
|
|
15
|
+
modelValue: {
|
|
16
|
+
type: String,
|
|
17
|
+
default: null
|
|
18
|
+
},
|
|
19
|
+
requirements: {
|
|
20
|
+
type: Array,
|
|
21
|
+
default: () => []
|
|
22
|
+
},
|
|
23
|
+
field: {
|
|
24
|
+
type: Object,
|
|
25
|
+
required: !0
|
|
26
|
+
},
|
|
27
|
+
placeholder: {
|
|
28
|
+
type: String,
|
|
29
|
+
default: ""
|
|
30
|
+
},
|
|
31
|
+
validationScope: {
|
|
32
|
+
type: String,
|
|
33
|
+
required: !0
|
|
34
|
+
},
|
|
35
|
+
step: {
|
|
36
|
+
type: Object,
|
|
37
|
+
required: !0
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
setup(d) {
|
|
41
|
+
const n = d;
|
|
42
|
+
F();
|
|
43
|
+
const h = {
|
|
44
|
+
subFields: {
|
|
45
|
+
[e("dob.day")]: {
|
|
46
|
+
required: b.withMessage(
|
|
47
|
+
m("validation.required"),
|
|
48
|
+
f(e("dob.day"))
|
|
49
|
+
)
|
|
50
|
+
},
|
|
51
|
+
[e("dob.month")]: {
|
|
52
|
+
required: b.withMessage(
|
|
53
|
+
m("validation.required"),
|
|
54
|
+
f(e("dob.month"))
|
|
55
|
+
)
|
|
56
|
+
},
|
|
57
|
+
[e("dob.year")]: {
|
|
58
|
+
required: b.withMessage(
|
|
59
|
+
m("validation.required"),
|
|
60
|
+
f(e("dob.year"))
|
|
61
|
+
)
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}, r = $(
|
|
65
|
+
h,
|
|
66
|
+
g(() => n.field),
|
|
67
|
+
{ $scope: n.validationScope }
|
|
68
|
+
);
|
|
69
|
+
function e(v) {
|
|
70
|
+
return n.requirements.find((t) => t.includes(v));
|
|
71
|
+
}
|
|
72
|
+
return (v, t) => {
|
|
73
|
+
const u = V, q = x, c = _("maska");
|
|
74
|
+
return i(), a(q, {
|
|
75
|
+
label: d.field.label,
|
|
76
|
+
required: !!d.field.is_required,
|
|
77
|
+
error: o(r).subFields[e("dob.day")].$error && o(r).subFields[e("dob.day")].$errors[0].$message || o(r).subFields[e("dob.month")].$error && o(r).subFields[e("dob.month")].$errors[0].$message || o(r).subFields[e("dob.year")].$error && o(r).subFields[e("dob.year")].$errors[0].$message
|
|
78
|
+
}, {
|
|
79
|
+
default: k(() => [
|
|
80
|
+
l("div", D, [
|
|
81
|
+
l("div", M, [
|
|
82
|
+
S,
|
|
83
|
+
e("dob.month") ? y((i(), a(u, {
|
|
84
|
+
key: 0,
|
|
85
|
+
modelValue: d.field.subFields[e("dob.month")],
|
|
86
|
+
"onUpdate:modelValue": t[0] || (t[0] = (s) => d.field.subFields[e("dob.month")] = s),
|
|
87
|
+
placeholder: "MM",
|
|
88
|
+
class: "w-14 text-center rounded-r-none relative focus:z-10",
|
|
89
|
+
invalid: o(r).subFields[e("dob.month")].$error
|
|
90
|
+
}, null, 8, ["modelValue", "invalid"])), [
|
|
91
|
+
[c, "##"]
|
|
92
|
+
]) : p("", !0)
|
|
93
|
+
]),
|
|
94
|
+
l("div", B, [
|
|
95
|
+
Y,
|
|
96
|
+
e("dob.day") ? y((i(), a(u, {
|
|
97
|
+
key: 0,
|
|
98
|
+
modelValue: d.field.subFields[e("dob.day")],
|
|
99
|
+
"onUpdate:modelValue": t[1] || (t[1] = (s) => d.field.subFields[e("dob.day")] = s),
|
|
100
|
+
placeholder: "DD",
|
|
101
|
+
class: "w-14 text-center rounded-none relative focus:z-10",
|
|
102
|
+
invalid: o(r).subFields[e("dob.day")].$error
|
|
103
|
+
}, null, 8, ["modelValue", "invalid"])), [
|
|
104
|
+
[c, "##"]
|
|
105
|
+
]) : p("", !0)
|
|
106
|
+
]),
|
|
107
|
+
l("div", z, [
|
|
108
|
+
C,
|
|
109
|
+
e("dob.year") ? y((i(), a(u, {
|
|
110
|
+
key: 0,
|
|
111
|
+
modelValue: d.field.subFields[e("dob.year")],
|
|
112
|
+
"onUpdate:modelValue": t[2] || (t[2] = (s) => d.field.subFields[e("dob.year")] = s),
|
|
113
|
+
placeholder: "YYYY",
|
|
114
|
+
class: "w-16 text-center rounded-l-none relative focus:z-10",
|
|
115
|
+
invalid: o(r).subFields[e("dob.year")].$error
|
|
116
|
+
}, null, 8, ["modelValue", "invalid"])), [
|
|
117
|
+
[c, "####"]
|
|
118
|
+
]) : p("", !0)
|
|
119
|
+
])
|
|
120
|
+
])
|
|
121
|
+
]),
|
|
122
|
+
_: 1
|
|
123
|
+
}, 8, ["label", "required", "error"]);
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
export {
|
|
128
|
+
U as default
|
|
129
|
+
};
|