@tachui/forms 0.8.15 → 0.8.17
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{Select-yZyKooXk.js → Select-C2CbXEop.js} +247 -242
- package/dist/{Slider-0-oal5YR.js → Slider-6ybJi_Iw.js} +2 -2
- package/dist/{TextField-hX15dY3U.js → TextField-qobWm59g.js} +166 -159
- package/dist/components/advanced/index.js +1 -1
- package/dist/components/selection/Checkbox.d.ts.map +1 -1
- package/dist/components/selection/Select.d.ts.map +1 -1
- package/dist/components/selection/index.js +1 -1
- package/dist/components/text-input/TextField.d.ts.map +1 -1
- package/dist/components/text-input/index.js +1 -1
- package/dist/index.js +3 -3
- package/dist/modifiers/index.js +157 -110
- package/dist/modifiers/placeholder.d.ts.map +1 -1
- package/dist/modifiers/required.d.ts +5 -3
- package/dist/modifiers/required.d.ts.map +1 -1
- package/dist/modifiers/validation.d.ts +2 -1
- package/dist/modifiers/validation.d.ts.map +1 -1
- package/dist/types/index.d.ts +4 -2
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/components/advanced/Slider.ts +2 -2
- package/src/components/selection/Checkbox.ts +14 -5
- package/src/components/selection/Select.ts +14 -4
- package/src/components/text-input/TextField.ts +31 -2
- package/src/modifiers/placeholder.ts +13 -1
- package/src/modifiers/required.ts +62 -8
- package/src/modifiers/validation.ts +48 -13
- package/src/types/index.ts +4 -1
|
@@ -299,7 +299,7 @@ class V {
|
|
|
299
299
|
*/
|
|
300
300
|
isDisabled() {
|
|
301
301
|
const { disabled: t } = this.props;
|
|
302
|
-
return typeof t == "boolean" ? t :
|
|
302
|
+
return typeof t == "boolean" ? t : typeof t == "function" ? t() : !1;
|
|
303
303
|
}
|
|
304
304
|
/**
|
|
305
305
|
* Format value for display
|
|
@@ -604,7 +604,7 @@ class V {
|
|
|
604
604
|
max: String(e),
|
|
605
605
|
step: String(i),
|
|
606
606
|
value: String(a),
|
|
607
|
-
disabled:
|
|
607
|
+
disabled: this.props.disabled ?? !1,
|
|
608
608
|
orient: s ? "vertical" : void 0,
|
|
609
609
|
style: f,
|
|
610
610
|
"aria-label": n,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { createSignal as
|
|
2
|
-
import { a as
|
|
3
|
-
const
|
|
1
|
+
import { createSignal as h, createEffect as p, h as u, isSignal as De, text as m } from "@tachui/core";
|
|
2
|
+
import { a as Pe } from "./index-D3WfkqVv.js";
|
|
3
|
+
const g = {
|
|
4
4
|
/**
|
|
5
5
|
* Phone number formatter (US format)
|
|
6
6
|
*/
|
|
@@ -69,7 +69,7 @@ const h = {
|
|
|
69
69
|
* Custom formatter factory
|
|
70
70
|
*/
|
|
71
71
|
custom: (e) => e
|
|
72
|
-
},
|
|
72
|
+
}, v = {
|
|
73
73
|
/**
|
|
74
74
|
* Phone number parser - extracts digits only
|
|
75
75
|
*/
|
|
@@ -100,136 +100,143 @@ const h = {
|
|
|
100
100
|
const t = e.match(/^-?\d*\.?\d*/);
|
|
101
101
|
return t ? t[0] : "";
|
|
102
102
|
}
|
|
103
|
-
},
|
|
103
|
+
}, S = (e, t) => e === void 0 ? t : typeof e == "function" || De(e) ? e() : e, l = (e) => {
|
|
104
104
|
const {
|
|
105
105
|
name: t,
|
|
106
106
|
label: r,
|
|
107
107
|
placeholder: b,
|
|
108
108
|
type: n = "text",
|
|
109
109
|
multiline: s = !1,
|
|
110
|
-
rows:
|
|
111
|
-
minLength:
|
|
112
|
-
maxLength:
|
|
113
|
-
pattern:
|
|
114
|
-
autocomplete:
|
|
115
|
-
spellcheck:
|
|
116
|
-
disabled:
|
|
117
|
-
|
|
118
|
-
|
|
110
|
+
rows: f = 3,
|
|
111
|
+
minLength: J,
|
|
112
|
+
maxLength: x,
|
|
113
|
+
pattern: Q,
|
|
114
|
+
autocomplete: X,
|
|
115
|
+
spellcheck: Y = !0,
|
|
116
|
+
disabled: T = !1,
|
|
117
|
+
readOnly: w = !1,
|
|
118
|
+
required: D = !1,
|
|
119
|
+
validation: B,
|
|
119
120
|
value: L,
|
|
120
|
-
defaultValue:
|
|
121
|
-
onChange:
|
|
122
|
-
onBlur:
|
|
123
|
-
onFocus:
|
|
124
|
-
error:
|
|
125
|
-
helperText:
|
|
121
|
+
defaultValue: Z = "",
|
|
122
|
+
onChange: U,
|
|
123
|
+
onBlur: q,
|
|
124
|
+
onFocus: _,
|
|
125
|
+
error: ee,
|
|
126
|
+
helperText: P,
|
|
126
127
|
// New enhanced features
|
|
127
|
-
keyboardType:
|
|
128
|
-
returnKeyType:
|
|
129
|
-
autoCapitalize:
|
|
130
|
-
autoFocus:
|
|
131
|
-
accessibilityLabel:
|
|
132
|
-
accessibilityHint:
|
|
133
|
-
accessibilityRole:
|
|
134
|
-
formatter:
|
|
135
|
-
parser:
|
|
136
|
-
validateOnChange:
|
|
137
|
-
validateOnBlur:
|
|
128
|
+
keyboardType: I = "default",
|
|
129
|
+
returnKeyType: te,
|
|
130
|
+
autoCapitalize: ae,
|
|
131
|
+
autoFocus: ie = !1,
|
|
132
|
+
accessibilityLabel: re,
|
|
133
|
+
accessibilityHint: O,
|
|
134
|
+
accessibilityRole: le = "textbox",
|
|
135
|
+
formatter: V,
|
|
136
|
+
parser: N,
|
|
137
|
+
validateOnChange: ne = !1,
|
|
138
|
+
validateOnBlur: se = !0,
|
|
138
139
|
font: c,
|
|
139
|
-
textAlign:
|
|
140
|
-
text:
|
|
141
|
-
placeholderSignal:
|
|
142
|
-
disabledSignal:
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
o
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
140
|
+
textAlign: A,
|
|
141
|
+
text: k,
|
|
142
|
+
placeholderSignal: E,
|
|
143
|
+
disabledSignal: F,
|
|
144
|
+
readOnlySignal: R,
|
|
145
|
+
...C
|
|
146
|
+
} = e, o = e._formContext, a = Pe(t, L ?? Z, B);
|
|
147
|
+
o && o.register(t, B);
|
|
148
|
+
const [ce, K] = h(!1), [H, oe] = h(0), [de, ue] = h(""), [be, fe] = h(""), [ye, me] = h(!1), [he, pe] = h(!1);
|
|
149
|
+
F !== void 0 && typeof process < "u" && process.env.NODE_ENV === "development" && console.warn(
|
|
150
|
+
"TextField: `disabledSignal` is deprecated. Prefer `disabled` with a Signal<boolean>."
|
|
151
|
+
), p(() => {
|
|
152
|
+
if (k) {
|
|
153
|
+
const i = S(k, "");
|
|
154
|
+
ue(i), i !== a.value() && a.setValue(i);
|
|
151
155
|
}
|
|
152
|
-
}),
|
|
153
|
-
|
|
154
|
-
}),
|
|
155
|
-
|
|
156
|
-
}),
|
|
156
|
+
}), p(() => {
|
|
157
|
+
E && fe(S(E, ""));
|
|
158
|
+
}), p(() => {
|
|
159
|
+
F && me(S(F, !1));
|
|
160
|
+
}), p(() => {
|
|
161
|
+
R && pe(S(R, !1));
|
|
162
|
+
}), L !== void 0 && p(() => {
|
|
157
163
|
a.value() !== L && a.setValue(L);
|
|
158
|
-
}),
|
|
164
|
+
}), p(() => {
|
|
159
165
|
const i = a.value() || "";
|
|
160
|
-
|
|
166
|
+
oe(String(i).length);
|
|
161
167
|
});
|
|
162
|
-
const
|
|
163
|
-
if (
|
|
168
|
+
const M = (i) => {
|
|
169
|
+
if (V)
|
|
164
170
|
try {
|
|
165
|
-
return
|
|
171
|
+
return V(i);
|
|
166
172
|
} catch (d) {
|
|
167
173
|
return console.warn("TextField formatter error:", d), i;
|
|
168
174
|
}
|
|
169
175
|
return i;
|
|
170
|
-
},
|
|
171
|
-
if (
|
|
176
|
+
}, ge = (i) => {
|
|
177
|
+
if (N)
|
|
172
178
|
try {
|
|
173
|
-
return
|
|
179
|
+
return N(i);
|
|
174
180
|
} catch (d) {
|
|
175
181
|
return console.warn("TextField parser error:", d), i;
|
|
176
182
|
}
|
|
177
183
|
return i;
|
|
178
|
-
},
|
|
179
|
-
const d = i.target,
|
|
180
|
-
if (a.setValue(
|
|
181
|
-
const
|
|
182
|
-
d.value =
|
|
184
|
+
}, ve = (i) => {
|
|
185
|
+
const d = i.target, W = d.value, $ = ge(W), j = M($);
|
|
186
|
+
if (a.setValue($), j !== W && d) {
|
|
187
|
+
const G = d.selectionStart || 0;
|
|
188
|
+
d.value = j, d.setSelectionRange(G, G);
|
|
183
189
|
}
|
|
184
|
-
o && o.setValue(t,
|
|
185
|
-
},
|
|
186
|
-
|
|
187
|
-
},
|
|
188
|
-
|
|
189
|
-
},
|
|
190
|
+
o && o.setValue(t, $), ne && a.validate(), U && U(t, $, a);
|
|
191
|
+
}, xe = (i) => {
|
|
192
|
+
K(!0), a.onFocus(), _ && _(t, a.value());
|
|
193
|
+
}, Le = (i) => {
|
|
194
|
+
K(!1), a.onBlur(), se && a.validate(), q && q(t, a.value());
|
|
195
|
+
}, Fe = (i) => {
|
|
190
196
|
i.key === "Enter" && !s && (i.preventDefault(), o?.submitForm && o.submitForm());
|
|
191
|
-
},
|
|
192
|
-
id:
|
|
197
|
+
}, y = ee || a.error() || o?.getError(t), Ce = E ? be() : b, $e = F ? ye : typeof T == "function" ? T : () => T, Se = R ? he : typeof w == "function" ? w : () => w, Te = k ? de() : a.value() || "", we = M(Te), z = {
|
|
198
|
+
id: C.id || t,
|
|
193
199
|
name: t,
|
|
194
|
-
value:
|
|
195
|
-
placeholder:
|
|
196
|
-
disabled:
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
200
|
+
value: we,
|
|
201
|
+
placeholder: Ce,
|
|
202
|
+
disabled: $e,
|
|
203
|
+
readOnly: Se,
|
|
204
|
+
required: D,
|
|
205
|
+
minlength: J,
|
|
206
|
+
maxlength: x,
|
|
207
|
+
pattern: Q,
|
|
208
|
+
autocomplete: X,
|
|
209
|
+
spellcheck: Y,
|
|
210
|
+
oninput: ve,
|
|
211
|
+
onfocus: xe,
|
|
212
|
+
onblur: Le,
|
|
213
|
+
onkeydown: Fe,
|
|
207
214
|
// Enhanced accessibility
|
|
208
|
-
"aria-invalid": !!
|
|
215
|
+
"aria-invalid": !!y,
|
|
209
216
|
"aria-describedby": [
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
217
|
+
y ? `${t}-error` : null,
|
|
218
|
+
P ? `${t}-helper` : null,
|
|
219
|
+
x ? `${t}-counter` : null,
|
|
220
|
+
O ? `${t}-hint` : null
|
|
214
221
|
].filter(Boolean).join(" ") || void 0,
|
|
215
|
-
"aria-label":
|
|
216
|
-
role:
|
|
222
|
+
"aria-label": re,
|
|
223
|
+
role: le,
|
|
217
224
|
// Mobile features
|
|
218
|
-
inputMode:
|
|
219
|
-
enterKeyHint:
|
|
220
|
-
autoCapitalize:
|
|
221
|
-
autoFocus:
|
|
225
|
+
inputMode: I !== "default" ? I : void 0,
|
|
226
|
+
enterKeyHint: te,
|
|
227
|
+
autoCapitalize: ae,
|
|
228
|
+
autoFocus: ie,
|
|
222
229
|
// Data attributes for styling and debugging
|
|
223
230
|
"data-tachui-textfield": !0,
|
|
224
231
|
"data-field-name": t,
|
|
225
232
|
"data-field-type": n,
|
|
226
|
-
"data-field-valid": !
|
|
233
|
+
"data-field-valid": !y,
|
|
227
234
|
"data-field-touched": a.touched(),
|
|
228
235
|
"data-field-dirty": a.dirty(),
|
|
229
|
-
"data-field-focused":
|
|
236
|
+
"data-field-focused": ce(),
|
|
230
237
|
"data-field-validating": a.validating(),
|
|
231
|
-
"data-field-has-formatter": !!
|
|
232
|
-
"data-field-has-parser": !!
|
|
238
|
+
"data-field-has-formatter": !!V,
|
|
239
|
+
"data-field-has-parser": !!N,
|
|
233
240
|
// Typography styling
|
|
234
241
|
style: {
|
|
235
242
|
...c?.family && { fontFamily: c.family },
|
|
@@ -238,59 +245,59 @@ const h = {
|
|
|
238
245
|
},
|
|
239
246
|
...c?.weight && { fontWeight: c.weight },
|
|
240
247
|
...c?.style && { fontStyle: c.style },
|
|
241
|
-
...
|
|
248
|
+
...A && { textAlign: A }
|
|
242
249
|
// Additional styling can be applied via modifiers
|
|
243
250
|
}
|
|
244
251
|
};
|
|
245
|
-
return n && !s && (
|
|
252
|
+
return n && !s && (z.type = n), {
|
|
246
253
|
type: "component",
|
|
247
|
-
id:
|
|
254
|
+
id: C.id || `textfield-${t}`,
|
|
248
255
|
render: () => u(
|
|
249
256
|
"div",
|
|
250
257
|
{
|
|
251
|
-
...
|
|
252
|
-
class: `tachui-textfield ${
|
|
258
|
+
...C,
|
|
259
|
+
class: `tachui-textfield ${C.class || ""}`.trim(),
|
|
253
260
|
"data-tachui-textfield-container": !0,
|
|
254
|
-
"data-field-state":
|
|
261
|
+
"data-field-state": y ? "error" : a.validating() ? "validating" : "valid"
|
|
255
262
|
},
|
|
256
263
|
...r ? [
|
|
257
264
|
u(
|
|
258
265
|
"label",
|
|
259
266
|
{
|
|
260
|
-
for:
|
|
267
|
+
for: z.id,
|
|
261
268
|
"data-tachui-label": !0,
|
|
262
|
-
"data-required":
|
|
269
|
+
"data-required": D
|
|
263
270
|
},
|
|
264
|
-
|
|
265
|
-
|
|
271
|
+
m(r),
|
|
272
|
+
...D ? [
|
|
266
273
|
u(
|
|
267
274
|
"span",
|
|
268
275
|
{
|
|
269
276
|
"aria-label": "required",
|
|
270
277
|
"data-required-indicator": !0
|
|
271
278
|
},
|
|
272
|
-
|
|
279
|
+
m(" *")
|
|
273
280
|
)
|
|
274
281
|
] : []
|
|
275
282
|
)
|
|
276
283
|
] : [],
|
|
277
284
|
// Input field
|
|
278
285
|
u(s ? "textarea" : "input", {
|
|
279
|
-
...
|
|
280
|
-
...s ? { rows:
|
|
286
|
+
...z,
|
|
287
|
+
...s ? { rows: f } : {}
|
|
281
288
|
}),
|
|
282
|
-
...
|
|
289
|
+
...x ? [
|
|
283
290
|
u(
|
|
284
291
|
"div",
|
|
285
292
|
{
|
|
286
293
|
id: `${t}-counter`,
|
|
287
294
|
"data-tachui-character-counter": !0,
|
|
288
|
-
"data-over-limit":
|
|
295
|
+
"data-over-limit": H() > x
|
|
289
296
|
},
|
|
290
|
-
|
|
297
|
+
m(`${H()}/${x}`)
|
|
291
298
|
)
|
|
292
299
|
] : [],
|
|
293
|
-
...
|
|
300
|
+
...y ? [
|
|
294
301
|
u(
|
|
295
302
|
"div",
|
|
296
303
|
{
|
|
@@ -299,20 +306,20 @@ const h = {
|
|
|
299
306
|
"aria-live": "polite",
|
|
300
307
|
"data-tachui-error": !0
|
|
301
308
|
},
|
|
302
|
-
y
|
|
309
|
+
m(y)
|
|
303
310
|
)
|
|
304
311
|
] : [],
|
|
305
|
-
...
|
|
312
|
+
...P && !y ? [
|
|
306
313
|
u(
|
|
307
314
|
"div",
|
|
308
315
|
{
|
|
309
316
|
id: `${t}-helper`,
|
|
310
317
|
"data-tachui-helper": !0
|
|
311
318
|
},
|
|
312
|
-
|
|
319
|
+
m(P)
|
|
313
320
|
)
|
|
314
321
|
] : [],
|
|
315
|
-
...
|
|
322
|
+
...O ? [
|
|
316
323
|
u(
|
|
317
324
|
"div",
|
|
318
325
|
{
|
|
@@ -320,7 +327,7 @@ const h = {
|
|
|
320
327
|
"data-tachui-accessibility-hint": !0,
|
|
321
328
|
"aria-hidden": "true"
|
|
322
329
|
},
|
|
323
|
-
|
|
330
|
+
m(O)
|
|
324
331
|
)
|
|
325
332
|
] : [],
|
|
326
333
|
...a.validating() ? [
|
|
@@ -331,7 +338,7 @@ const h = {
|
|
|
331
338
|
"aria-label": "Validating...",
|
|
332
339
|
"aria-live": "polite"
|
|
333
340
|
},
|
|
334
|
-
|
|
341
|
+
m("⏳")
|
|
335
342
|
)
|
|
336
343
|
] : []
|
|
337
344
|
),
|
|
@@ -342,7 +349,7 @@ const h = {
|
|
|
342
349
|
}
|
|
343
350
|
]
|
|
344
351
|
};
|
|
345
|
-
},
|
|
352
|
+
}, ke = (e) => l({
|
|
346
353
|
...e,
|
|
347
354
|
type: "email",
|
|
348
355
|
keyboardType: "email",
|
|
@@ -353,7 +360,7 @@ const h = {
|
|
|
353
360
|
},
|
|
354
361
|
accessibilityRole: "textbox",
|
|
355
362
|
accessibilityLabel: e.accessibilityLabel || "Email address"
|
|
356
|
-
}),
|
|
363
|
+
}), Ee = (e) => {
|
|
357
364
|
const {
|
|
358
365
|
showStrengthIndicator: t = !1,
|
|
359
366
|
strongValidation: r = !1,
|
|
@@ -370,14 +377,14 @@ const h = {
|
|
|
370
377
|
},
|
|
371
378
|
accessibilityLabel: e.accessibilityLabel || "Password"
|
|
372
379
|
});
|
|
373
|
-
},
|
|
380
|
+
}, Re = (e) => l({
|
|
374
381
|
...e,
|
|
375
382
|
type: "search",
|
|
376
383
|
keyboardType: "search",
|
|
377
384
|
placeholder: e.placeholder || "Search...",
|
|
378
385
|
accessibilityRole: "searchbox",
|
|
379
386
|
accessibilityLabel: e.accessibilityLabel || "Search"
|
|
380
|
-
}),
|
|
387
|
+
}), ze = (e) => l({
|
|
381
388
|
...e,
|
|
382
389
|
type: "url",
|
|
383
390
|
keyboardType: "url",
|
|
@@ -387,14 +394,14 @@ const h = {
|
|
|
387
394
|
...e.validation
|
|
388
395
|
},
|
|
389
396
|
accessibilityLabel: e.accessibilityLabel || "Website URL"
|
|
390
|
-
}),
|
|
397
|
+
}), Be = (e) => {
|
|
391
398
|
const { format: t = "us", ...r } = e;
|
|
392
399
|
return l({
|
|
393
400
|
...r,
|
|
394
401
|
type: "tel",
|
|
395
402
|
keyboardType: "phone",
|
|
396
|
-
formatter:
|
|
397
|
-
parser:
|
|
403
|
+
formatter: g.phone,
|
|
404
|
+
parser: v.phone,
|
|
398
405
|
validation: {
|
|
399
406
|
rules: ["phone"],
|
|
400
407
|
validateOn: "blur",
|
|
@@ -402,27 +409,27 @@ const h = {
|
|
|
402
409
|
},
|
|
403
410
|
accessibilityLabel: e.accessibilityLabel || "Phone number"
|
|
404
411
|
});
|
|
405
|
-
},
|
|
406
|
-
const { min: t, max: r, precision: b = 0, currency: n = !1, ...s } = e,
|
|
407
|
-
return t !== void 0 && (
|
|
412
|
+
}, Ue = (e) => {
|
|
413
|
+
const { min: t, max: r, precision: b = 0, currency: n = !1, ...s } = e, f = ["numeric"];
|
|
414
|
+
return t !== void 0 && (f.push("min"), f.push({ name: "min", options: { min: t } })), r !== void 0 && (f.push("max"), f.push({ name: "max", options: { max: r } })), l({
|
|
408
415
|
...s,
|
|
409
416
|
type: "number",
|
|
410
417
|
keyboardType: "numeric",
|
|
411
|
-
formatter: n ?
|
|
412
|
-
parser: n ?
|
|
418
|
+
formatter: n ? g.currency : b > 0 ? g.decimal(b) : void 0,
|
|
419
|
+
parser: n ? v.currency : v.decimal,
|
|
413
420
|
validation: {
|
|
414
|
-
rules:
|
|
421
|
+
rules: f,
|
|
415
422
|
validateOn: "blur",
|
|
416
423
|
...e.validation
|
|
417
424
|
},
|
|
418
425
|
accessibilityLabel: e.accessibilityLabel || "Number"
|
|
419
426
|
});
|
|
420
|
-
},
|
|
427
|
+
}, qe = (e) => l({
|
|
421
428
|
...e,
|
|
422
429
|
type: "text",
|
|
423
430
|
keyboardType: "numeric",
|
|
424
|
-
formatter:
|
|
425
|
-
parser:
|
|
431
|
+
formatter: g.creditCard,
|
|
432
|
+
parser: v.creditCard,
|
|
426
433
|
maxLength: 19,
|
|
427
434
|
// 16 digits + 3 spaces
|
|
428
435
|
validation: {
|
|
@@ -431,12 +438,12 @@ const h = {
|
|
|
431
438
|
...e.validation
|
|
432
439
|
},
|
|
433
440
|
accessibilityLabel: e.accessibilityLabel || "Credit card number"
|
|
434
|
-
}),
|
|
441
|
+
}), _e = (e) => l({
|
|
435
442
|
...e,
|
|
436
443
|
type: "text",
|
|
437
444
|
keyboardType: "numeric",
|
|
438
|
-
formatter:
|
|
439
|
-
parser:
|
|
445
|
+
formatter: g.ssn,
|
|
446
|
+
parser: v.ssn,
|
|
440
447
|
maxLength: 11,
|
|
441
448
|
// 9 digits + 2 hyphens
|
|
442
449
|
validation: {
|
|
@@ -445,12 +452,12 @@ const h = {
|
|
|
445
452
|
...e.validation
|
|
446
453
|
},
|
|
447
454
|
accessibilityLabel: e.accessibilityLabel || "Social Security Number"
|
|
448
|
-
}),
|
|
455
|
+
}), Ie = (e) => l({
|
|
449
456
|
...e,
|
|
450
457
|
type: "text",
|
|
451
458
|
keyboardType: "numeric",
|
|
452
|
-
formatter:
|
|
453
|
-
parser:
|
|
459
|
+
formatter: g.postalCode,
|
|
460
|
+
parser: v.postalCode,
|
|
454
461
|
maxLength: 10,
|
|
455
462
|
// 5 or 9 digits + hyphen
|
|
456
463
|
validation: {
|
|
@@ -460,11 +467,11 @@ const h = {
|
|
|
460
467
|
...e.validation
|
|
461
468
|
},
|
|
462
469
|
accessibilityLabel: e.accessibilityLabel || "Postal code"
|
|
463
|
-
}),
|
|
470
|
+
}), Ae = (e) => l({
|
|
464
471
|
...e,
|
|
465
472
|
multiline: !0,
|
|
466
473
|
accessibilityLabel: e.accessibilityLabel || "Text area"
|
|
467
|
-
}),
|
|
474
|
+
}), Ke = (e) => {
|
|
468
475
|
const { min: t, max: r, ...b } = e, n = ["date"];
|
|
469
476
|
return t && n.push({ name: "min", options: { min: new Date(t) } }), r && n.push({ name: "max", options: { max: new Date(r) } }), l({
|
|
470
477
|
...b,
|
|
@@ -476,7 +483,7 @@ const h = {
|
|
|
476
483
|
},
|
|
477
484
|
accessibilityLabel: e.accessibilityLabel || "Date"
|
|
478
485
|
});
|
|
479
|
-
},
|
|
486
|
+
}, He = (e) => l({
|
|
480
487
|
...e,
|
|
481
488
|
type: "time",
|
|
482
489
|
validation: {
|
|
@@ -485,24 +492,24 @@ const h = {
|
|
|
485
492
|
...e.validation
|
|
486
493
|
},
|
|
487
494
|
accessibilityLabel: e.accessibilityLabel || "Time"
|
|
488
|
-
}),
|
|
495
|
+
}), Me = (e) => l({
|
|
489
496
|
...e,
|
|
490
497
|
type: "color",
|
|
491
498
|
accessibilityLabel: e.accessibilityLabel || "Color picker"
|
|
492
499
|
});
|
|
493
500
|
export {
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
501
|
+
qe as C,
|
|
502
|
+
Ke as D,
|
|
503
|
+
ke as E,
|
|
504
|
+
Ue as N,
|
|
505
|
+
Ee as P,
|
|
506
|
+
Re as S,
|
|
500
507
|
l as T,
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
+
ze as U,
|
|
509
|
+
Be as a,
|
|
510
|
+
_e as b,
|
|
511
|
+
Ie as c,
|
|
512
|
+
Ae as d,
|
|
513
|
+
He as e,
|
|
514
|
+
Me as f
|
|
508
515
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/selection/Checkbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAqB,MAAM,cAAc,CAAA;AAGhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,aAAa,
|
|
1
|
+
{"version":3,"file":"Checkbox.d.ts","sourceRoot":"","sources":["../../../src/components/selection/Checkbox.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAqB,MAAM,cAAc,CAAA;AAGhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,aAAa,CAAA;AAEhD;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,aAAa,CAiR7C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,CAC5B,aAAa,GAAG;IACd,IAAI,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,OAAO,CAAA;CACpC,CAoCF,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,SAAS,CAAC;IACpC,IAAI,EAAE,MAAM,CAAA;IACZ,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,OAAO,EAAE,KAAK,CAAC;QACb,KAAK,EAAE,GAAG,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,CAAC,EAAE,OAAO,CAAA;KACnB,CAAC,CAAA;IACF,KAAK,CAAC,EAAE,GAAG,EAAE,CAAA;IACb,YAAY,CAAC,EAAE,GAAG,EAAE,CAAA;IACpB,QAAQ,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,QAAQ,EAAE,GAAG,KAAK,IAAI,CAAA;IAC9D,UAAU,CAAC,EAAE,GAAG,CAAA;IAChB,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,SAAS,CAAC,EAAE,YAAY,GAAG,UAAU,CAAA;IACrC,EAAE,CAAC,EAAE,MAAM,CAAA;IACX,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAA;CACnB,CAkIA,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/selection/Select.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAqB,MAAM,cAAc,CAAA;AAUhE,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,aAAa,CAAA;AAE5D;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,WAAW,
|
|
1
|
+
{"version":3,"file":"Select.d.ts","sourceRoot":"","sources":["../../../src/components/selection/Select.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAqB,MAAM,cAAc,CAAA;AAUhE,OAAO,KAAK,EAAgB,WAAW,EAAE,MAAM,aAAa,CAAA;AAE5D;;GAEG;AACH,eAAO,MAAM,MAAM,EAAE,SAAS,CAAC,WAAW,CAilBzC,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,WAAW,CAE9C,CAAA;AAED;;GAEG;AACH,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,WAAW,CAE3C,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/text-input/TextField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAA6B,MAAM,cAAc,CAAA;AAGxE,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAA;AAejE;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,cAAc,
|
|
1
|
+
{"version":3,"file":"TextField.d.ts","sourceRoot":"","sources":["../../../src/components/text-input/TextField.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EAAE,SAAS,EAA6B,MAAM,cAAc,CAAA;AAGxE,OAAO,KAAK,EAAE,cAAc,EAAkB,MAAM,aAAa,CAAA;AAejE;;GAEG;AACH,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,cAAc,CA2b/C,CAAA;AASD,eAAO,MAAM,UAAU,EAAE,SAAS,CAChC,cAAc,GAAG;IACf,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;CAC1C,CAcF,CAAA;AAED,eAAO,MAAM,aAAa,EAAE,SAAS,CACnC,cAAc,GAAG;IACf,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;IACzC,qBAAqB,CAAC,EAAE,OAAO,CAAA;IAC/B,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAC3B,CA6BF,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,SAAS,CAAC,cAAc,CASjD,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,cAAc,GAAG;IACf,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;CAC1C,CAaF,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,CAChC,cAAc,GAAG;IACf,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,IAAI,GAAG,eAAe,CAAA;CAChC,CAiBF,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,SAAS,CACjC,cAAc,GAAG;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,QAAQ,CAAC,EAAE,OAAO,CAAA;CACnB,CAiCF,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,CACrC,cAAc,GAAG;IACf,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;CAC1C,CAgBF,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,SAAS,CAC9B,cAAc,GAAG;IACf,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;CAC1C,CAgBF,CAAA;AAED,eAAO,MAAM,eAAe,EAAE,SAAS,CACrC,cAAc,GAAG;IACf,UAAU,CAAC,EAAE,cAAc,CAAC,YAAY,CAAC,CAAA;CAC1C,CAgBF,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,SAAS,CAAC,cAAc,CAM9C,CAAA;AAGD,eAAO,MAAM,SAAS,EAAE,SAAS,CAC/B,cAAc,GAAG;IACf,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,GAAG,CAAC,EAAE,MAAM,CAAA;CACb,CAwBF,CAAA;AAED,eAAO,MAAM,SAAS,EAAE,SAAS,CAAC,cAAc,CAW/C,CAAA;AAED,eAAO,MAAM,UAAU,EAAE,SAAS,CAAC,cAAc,CAMhD,CAAA"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { f as d, C as s, D as i, E as l, N as F, P as r, a as o, c as t, b as C, S as m, d as P, T as S, e as T, U as x } from "../../TextField-
|
|
1
|
+
import { f as d, C as s, D as i, E as l, N as F, P as r, a as o, c as t, b as C, S as m, d as P, T as S, e as T, U as x } from "../../TextField-qobWm59g.js";
|
|
2
2
|
export {
|
|
3
3
|
d as ColorField,
|
|
4
4
|
s as CreditCardField,
|
package/dist/index.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { createSignal as o, createComputed as a } from "@tachui/core";
|
|
2
2
|
import { c as n } from "./index-D3WfkqVv.js";
|
|
3
3
|
import { a as N, b as T } from "./index-D3WfkqVv.js";
|
|
4
|
-
import { f as D, C as M, D as w, E as A, N as L, P, a as R, c as $, b as k, S as O, d as U, T as H, e as I, U as z } from "./TextField-
|
|
5
|
-
import { C as _, a as j, c as q, M as Z, R as B, b as J, d as K, S as Q } from "./Select-
|
|
6
|
-
import { a as X, S as Y } from "./Slider-
|
|
4
|
+
import { f as D, C as M, D as w, E as A, N as L, P, a as R, c as $, b as k, S as O, d as U, T as H, e as I, U as z } from "./TextField-qobWm59g.js";
|
|
5
|
+
import { C as _, a as j, c as q, M as Z, R as B, b as J, d as K, S as Q } from "./Select-C2CbXEop.js";
|
|
6
|
+
import { a as X, S as Y } from "./Slider-6ybJi_Iw.js";
|
|
7
7
|
import { D as te } from "./DatePicker-D5nRFTUm.js";
|
|
8
8
|
import { CrossFieldValidators as ie, FormsComponentValidation as se, FormsValidationError as ae, VALIDATION_RULES as oe, ValidationMessageFormatter as ne, ValidationPresets as de, ValidationUtils as pe, createDebouncedValidator as le, createFormsValidators as ce, defaultMessageFormatter as fe, getValidationRules as me, registerFormsValidators as he, registerValidationRule as ue, unregisterValidationRule as Se, validateField as xe, validateValue as ge, validateValueAsync as Fe } from "./validation/index.js";
|
|
9
9
|
import { placeholder as Ee, registerFormsModifiers as ye, required as Ve, validation as be } from "./modifiers/index.js";
|