@tachui/forms 0.7.0-alpha1 → 0.8.0-alpha

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.
Files changed (114) hide show
  1. package/README.md +136 -0
  2. package/dist/DatePicker-D5nRFTUm.js +475 -0
  3. package/dist/DatePicker-D5nRFTUm.js.map +1 -0
  4. package/dist/Select-yZyKooXk.js +945 -0
  5. package/dist/Select-yZyKooXk.js.map +1 -0
  6. package/dist/Slider-0-oal5YR.js +644 -0
  7. package/dist/Slider-0-oal5YR.js.map +1 -0
  8. package/dist/TextField-hX15dY3U.js +509 -0
  9. package/dist/TextField-hX15dY3U.js.map +1 -0
  10. package/dist/components/advanced/Slider.d.ts +190 -0
  11. package/dist/components/advanced/Slider.d.ts.map +1 -0
  12. package/dist/components/advanced/Stepper.d.ts +161 -0
  13. package/dist/components/advanced/Stepper.d.ts.map +1 -0
  14. package/dist/components/advanced/index.d.ts +15 -0
  15. package/dist/components/advanced/index.d.ts.map +1 -0
  16. package/dist/components/advanced/index.js +6 -0
  17. package/dist/{state → components/advanced}/index.js.map +1 -1
  18. package/dist/components/date-picker/DatePicker.d.ts +126 -0
  19. package/dist/components/date-picker/DatePicker.d.ts.map +1 -0
  20. package/dist/components/date-picker/index.d.ts +14 -0
  21. package/dist/components/date-picker/index.d.ts.map +1 -0
  22. package/dist/components/date-picker/index.js +5 -0
  23. package/dist/components/{index.js.map → date-picker/index.js.map} +1 -1
  24. package/dist/components/form-container/index.d.ts +58 -0
  25. package/dist/components/form-container/index.d.ts.map +1 -0
  26. package/dist/components/selection/Checkbox.d.ts.map +1 -0
  27. package/dist/components/selection/Radio.d.ts.map +1 -0
  28. package/dist/components/selection/Select.d.ts.map +1 -0
  29. package/dist/components/selection/index.d.ts +68 -0
  30. package/dist/components/selection/index.d.ts.map +1 -0
  31. package/dist/components/selection/index.js +12 -0
  32. package/dist/components/selection/index.js.map +1 -0
  33. package/dist/components/text-input/TextField.d.ts.map +1 -0
  34. package/dist/components/text-input/index.d.ts +8 -0
  35. package/dist/components/text-input/index.d.ts.map +1 -0
  36. package/dist/components/text-input/index.js +18 -0
  37. package/dist/components/text-input/index.js.map +1 -0
  38. package/dist/index-D3WfkqVv.js +249 -0
  39. package/dist/index-D3WfkqVv.js.map +1 -0
  40. package/dist/index.d.ts +10 -15
  41. package/dist/index.d.ts.map +1 -1
  42. package/dist/index.js +196 -376
  43. package/dist/index.js.map +1 -1
  44. package/dist/state/index.d.ts.map +1 -1
  45. package/dist/types/index.d.ts.map +1 -1
  46. package/dist/utils/index.d.ts +19 -0
  47. package/dist/utils/index.d.ts.map +1 -0
  48. package/dist/validation/component-validation.d.ts +11 -2
  49. package/dist/validation/component-validation.d.ts.map +1 -1
  50. package/dist/validation/index.d.ts.map +1 -1
  51. package/dist/validation/index.js +687 -17
  52. package/dist/validation/index.js.map +1 -1
  53. package/package.json +54 -41
  54. package/src/components/advanced/Slider.ts +722 -0
  55. package/src/components/advanced/Stepper.ts +715 -0
  56. package/src/components/advanced/index.ts +20 -0
  57. package/src/components/date-picker/DatePicker.ts +925 -0
  58. package/src/components/date-picker/index.ts +20 -0
  59. package/src/components/form-container/index.ts +266 -0
  60. package/src/components/selection/Checkbox.ts +478 -0
  61. package/src/components/selection/Radio.ts +470 -0
  62. package/src/components/selection/Select.ts +620 -0
  63. package/src/components/selection/index.ts +81 -0
  64. package/src/components/text-input/TextField.ts +728 -0
  65. package/src/components/text-input/index.ts +35 -0
  66. package/src/index.ts +48 -0
  67. package/src/state/index.ts +544 -0
  68. package/src/types/index.ts +579 -0
  69. package/src/utils/formatters.ts +184 -0
  70. package/src/utils/index.ts +57 -0
  71. package/src/validation/component-validation.ts +429 -0
  72. package/src/validation/index.ts +641 -0
  73. package/dist/Form-ueYEcSg1.cjs +0 -2
  74. package/dist/Form-ueYEcSg1.cjs.map +0 -1
  75. package/dist/Form-ylAr3o_e.js +0 -376
  76. package/dist/Form-ylAr3o_e.js.map +0 -1
  77. package/dist/components/Form.d.ts +0 -76
  78. package/dist/components/Form.d.ts.map +0 -1
  79. package/dist/components/index.cjs +0 -2
  80. package/dist/components/index.cjs.map +0 -1
  81. package/dist/components/index.d.ts +0 -9
  82. package/dist/components/index.d.ts.map +0 -1
  83. package/dist/components/index.js +0 -31
  84. package/dist/components/input/Checkbox.d.ts.map +0 -1
  85. package/dist/components/input/Radio.d.ts.map +0 -1
  86. package/dist/components/input/Select.d.ts.map +0 -1
  87. package/dist/components/input/TextField.d.ts.map +0 -1
  88. package/dist/components/input/index.d.ts +0 -11
  89. package/dist/components/input/index.d.ts.map +0 -1
  90. package/dist/forms-complex-BiQsZZlT.js +0 -361
  91. package/dist/forms-complex-BiQsZZlT.js.map +0 -1
  92. package/dist/forms-complex-DLEnXXJ5.cjs +0 -2
  93. package/dist/forms-complex-DLEnXXJ5.cjs.map +0 -1
  94. package/dist/forms-core-B1bx1drO.js +0 -839
  95. package/dist/forms-core-B1bx1drO.js.map +0 -1
  96. package/dist/forms-core-W_JGVLAI.cjs +0 -9
  97. package/dist/forms-core-W_JGVLAI.cjs.map +0 -1
  98. package/dist/forms-inputs-6QdeMWFk.js +0 -1075
  99. package/dist/forms-inputs-6QdeMWFk.js.map +0 -1
  100. package/dist/forms-inputs-DQ5QI_SU.cjs +0 -2
  101. package/dist/forms-inputs-DQ5QI_SU.cjs.map +0 -1
  102. package/dist/index.cjs +0 -2
  103. package/dist/index.cjs.map +0 -1
  104. package/dist/state/index.cjs +0 -2
  105. package/dist/state/index.cjs.map +0 -1
  106. package/dist/state/index.js +0 -9
  107. package/dist/utils/validators.d.ts +0 -101
  108. package/dist/utils/validators.d.ts.map +0 -1
  109. package/dist/validation/index.cjs +0 -2
  110. package/dist/validation/index.cjs.map +0 -1
  111. /package/dist/components/{input → selection}/Checkbox.d.ts +0 -0
  112. /package/dist/components/{input → selection}/Radio.d.ts +0 -0
  113. /package/dist/components/{input → selection}/Select.d.ts +0 -0
  114. /package/dist/components/{input → text-input}/TextField.d.ts +0 -0
package/dist/index.js CHANGED
@@ -1,383 +1,203 @@
1
- import { F as n, a as d } from "./Form-ylAr3o_e.js";
2
- import { b as Q } from "./Form-ylAr3o_e.js";
3
- import { d as c, a as m, c as u, b as g, V as f, C as p, r as F, g as h } from "./forms-core-B1bx1drO.js";
4
- import { m as Y, F as ee, l as te, j as re, k as ae, i as se, n as ie, e as oe, u as le, h as ne, f as de, v as ce } from "./forms-core-B1bx1drO.js";
5
- import { k as v, l as N, i as b, E as I, P as S, g as V, U as x, e as y, N as C, d as R, h as A, f as T, T as P, D as L, j as D, c as E, C as _, S as M, a as U, R as w, b as $ } from "./forms-inputs-6QdeMWFk.js";
6
- import { S as k, M as G, C as H } from "./forms-complex-BiQsZZlT.js";
7
- const O = {
8
- /**
9
- * Email validation
10
- */
11
- email: (e) => {
12
- if (!e) return { valid: !0 };
13
- const r = /^[^\s@]+@[^\s@]+\.[^\s@]+$/.test(e);
14
- return {
15
- valid: r,
16
- ...r ? {} : { message: "Please enter a valid email address", code: "INVALID_EMAIL" }
17
- };
18
- },
19
- /**
20
- * Phone number validation
21
- */
22
- phone: (e) => {
23
- if (!e) return { valid: !0 };
24
- const t = /^[+]?[1-9][\d]{0,15}$/, r = e.replace(/\s/g, ""), a = t.test(r);
25
- return {
26
- valid: a,
27
- ...a ? {} : { message: "Please enter a valid phone number", code: "INVALID_PHONE" }
28
- };
29
- },
30
- /**
31
- * URL validation
32
- */
33
- url: (e) => {
34
- if (!e) return { valid: !0 };
35
- try {
36
- return new URL(e), { valid: !0 };
37
- } catch {
38
- return { valid: !1, message: "Please enter a valid URL", code: "INVALID_URL" };
39
- }
40
- },
41
- /**
42
- * Minimum length validation
43
- */
44
- minLength: (e) => (t) => {
45
- const r = !t || t.length >= e;
46
- return {
47
- valid: r,
48
- ...r ? {} : { message: `Minimum length is ${e} characters`, code: "MIN_LENGTH" }
49
- };
50
- },
51
- /**
52
- * Maximum length validation
53
- */
54
- maxLength: (e) => (t) => {
55
- const r = !t || t.length <= e;
56
- return {
57
- valid: r,
58
- ...r ? {} : { message: `Maximum length is ${e} characters`, code: "MAX_LENGTH" }
59
- };
60
- },
61
- /**
62
- * Required field validation
63
- */
64
- required: (e) => {
65
- const t = !!(e && e.trim().length > 0);
66
- return {
67
- valid: t,
68
- ...t ? {} : { message: "This field is required", code: "REQUIRED" }
69
- };
70
- },
71
- /**
72
- * Pattern validation
73
- */
74
- pattern: (e, t = "Invalid format") => (r) => {
75
- if (!r) return { valid: !0 };
76
- const a = e.test(r);
77
- return {
78
- valid: a,
79
- ...a ? {} : { message: t, code: "PATTERN_MISMATCH" }
80
- };
81
- },
82
- /**
83
- * Numeric validation
84
- */
85
- numeric: (e) => {
86
- if (!e) return { valid: !0 };
87
- const t = !Number.isNaN(Number(e)) && Number.isFinite(Number(e));
88
- return {
89
- valid: t,
90
- ...t ? {} : { message: "Please enter a valid number", code: "INVALID_NUMBER" }
91
- };
92
- },
93
- /**
94
- * Integer validation
95
- */
96
- integer: (e) => {
97
- if (!e) return { valid: !0 };
98
- const t = Number(e), r = Number.isInteger(t);
99
- return {
100
- valid: r,
101
- ...r ? {} : { message: "Please enter a whole number", code: "INVALID_INTEGER" }
102
- };
103
- },
104
- /**
105
- * Minimum value validation
106
- */
107
- min: (e) => (t) => {
108
- if (!t) return { valid: !0 };
109
- const r = Number(t), a = !Number.isNaN(r) && r >= e;
110
- return {
111
- valid: a,
112
- ...a ? {} : { message: `Value must be at least ${e}`, code: "MIN_VALUE" }
113
- };
114
- },
115
- /**
116
- * Maximum value validation
117
- */
118
- max: (e) => (t) => {
119
- if (!t) return { valid: !0 };
120
- const r = Number(t), a = !Number.isNaN(r) && r <= e;
121
- return {
122
- valid: a,
123
- ...a ? {} : { message: `Value must be at most ${e}`, code: "MAX_VALUE" }
124
- };
125
- },
126
- /**
127
- * Range validation
128
- */
129
- range: (e, t) => (r) => {
130
- if (!r) return { valid: !0 };
131
- const a = Number(r), o = !Number.isNaN(a) && a >= e && a <= t;
132
- return {
133
- valid: o,
134
- ...o ? {} : { message: `Value must be between ${e} and ${t}`, code: "OUT_OF_RANGE" }
135
- };
136
- },
137
- /**
138
- * Credit card validation (Luhn algorithm)
139
- */
140
- creditCard: (e) => {
141
- if (!e) return { valid: !0 };
142
- const t = e.replace(/\D/g, "");
143
- if (t.length < 13 || t.length > 19)
144
- return {
145
- valid: !1,
146
- message: "Credit card number must be 13-19 digits",
147
- code: "INVALID_CREDIT_CARD"
148
- };
149
- let r = 0, a = !1;
150
- for (let i = t.length - 1; i >= 0; i--) {
151
- let s = parseInt(t[i]);
152
- a && (s *= 2, s > 9 && (s -= 9)), r += s, a = !a;
153
- }
154
- const o = r % 10 === 0;
155
- return {
156
- valid: o,
157
- ...o ? {} : { message: "Please enter a valid credit card number", code: "INVALID_CREDIT_CARD" }
158
- };
159
- },
160
- /**
161
- * Social Security Number validation
162
- */
163
- ssn: (e) => {
164
- if (!e) return { valid: !0 };
165
- const t = e.replace(/\D/g, ""), a = /^(?!666|000|9\d{2})\d{3}(?!00)\d{2}(?!0{4})\d{4}$/.test(t);
166
- return {
167
- valid: a,
168
- ...a ? {} : { message: "Please enter a valid Social Security Number", code: "INVALID_SSN" }
169
- };
170
- },
171
- /**
172
- * US ZIP code validation
173
- */
174
- zipCode: (e) => {
175
- if (!e) return { valid: !0 };
176
- const r = /^\d{5}(-\d{4})?$/.test(e);
177
- return {
178
- valid: r,
179
- ...r ? {} : { message: "Please enter a valid ZIP code", code: "INVALID_ZIP" }
180
- };
181
- },
182
- /**
183
- * Strong password validation
184
- */
185
- strongPassword: (e) => {
186
- if (!e) return { valid: !0 };
187
- const t = /[a-z]/.test(e), r = /[A-Z]/.test(e), a = /\d/.test(e), o = /[!@#$%^&*(),.?":{}|<>]/.test(e), i = e.length >= 8, s = [];
188
- i || s.push("at least 8 characters"), t || s.push("lowercase letter"), r || s.push("uppercase letter"), a || s.push("number"), o || s.push("special character");
189
- const l = s.length === 0;
190
- return {
191
- valid: l,
192
- ...l ? {} : {
193
- message: `Password must contain ${s.join(", ")}`,
194
- code: "WEAK_PASSWORD"
1
+ import { createSignal as n, createComputed as a } from "@tachui/core";
2
+ import { c as o } from "./index-D3WfkqVv.js";
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-hX15dY3U.js";
5
+ import { C as _, a as j, c as Z, M as q, R as B, b as J, d as K, S as Q } from "./Select-yZyKooXk.js";
6
+ import { a as X, S as Y } from "./Slider-0-oal5YR.js";
7
+ import { D as te } from "./DatePicker-D5nRFTUm.js";
8
+ import { CrossFieldValidators as ie, FormsComponentValidation as se, FormsValidationError as ae, VALIDATION_RULES as ne, ValidationMessageFormatter as oe, 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 Ce } from "./validation/index.js";
9
+ class d {
10
+ constructor(e) {
11
+ this.properties = e, this.formState = o(e.initialValues || {}), e.validation && Object.entries(e.validation).forEach(
12
+ ([t, r]) => {
13
+ this.formState.register(t, r);
14
+ }
15
+ );
16
+ }
17
+ type = "form-container";
18
+ formState;
19
+ get state() {
20
+ return this.formState.state;
21
+ }
22
+ async handleSubmit() {
23
+ this.properties.validateOnSubmit !== !1 && !await this.formState.validateForm() || (this.properties.onSubmit && await this.properties.onSubmit(
24
+ this.formState.watch(),
25
+ this.formState.state
26
+ ), this.properties.resetOnSubmit && this.formState.resetForm());
27
+ }
28
+ register(e, t) {
29
+ this.formState.register(e, t);
30
+ }
31
+ setValue(e, t) {
32
+ this.formState.setValue(e, t);
33
+ }
34
+ getValue(e) {
35
+ return this.formState.getValue(e);
36
+ }
37
+ getError(e) {
38
+ return this.formState.getError(e);
39
+ }
40
+ async validateField(e) {
41
+ return this.formState.validateField(e);
42
+ }
43
+ async validateForm() {
44
+ return this.formState.validateForm();
45
+ }
46
+ resetForm() {
47
+ this.formState.resetForm();
48
+ }
49
+ render() {
50
+ const e = document.createElement("form");
51
+ return this.properties.className && (e.className = this.properties.className), this.properties.id && (e.id = this.properties.id), e.addEventListener("submit", (t) => {
52
+ t.preventDefault(), this.handleSubmit();
53
+ }), this.properties.children && (Array.isArray(this.properties.children) ? this.properties.children.forEach((t) => {
54
+ typeof t == "string" ? e.appendChild(document.createTextNode(t)) : t && typeof t.render == "function" ? e.appendChild(t.render()) : t instanceof HTMLElement && e.appendChild(t);
55
+ }) : typeof this.properties.children == "string" ? e.appendChild(document.createTextNode(this.properties.children)) : this.properties.children && typeof this.properties.children.render == "function" ? e.appendChild(this.properties.children.render()) : this.properties.children instanceof HTMLElement && e.appendChild(this.properties.children)), e;
56
+ }
57
+ }
58
+ class p {
59
+ constructor(e) {
60
+ this.properties = e;
61
+ const [t, r] = n(
62
+ e.defaultExpanded ?? !0
63
+ );
64
+ this.expanded = t, this.setExpanded = r;
65
+ }
66
+ type = "form-section";
67
+ expanded;
68
+ setExpanded;
69
+ get isExpanded() {
70
+ return this.expanded();
71
+ }
72
+ toggle() {
73
+ this.properties.collapsible && this.setExpanded(!this.expanded());
74
+ }
75
+ expand() {
76
+ this.setExpanded(!0);
77
+ }
78
+ collapse() {
79
+ this.properties.collapsible && this.setExpanded(!1);
80
+ }
81
+ render() {
82
+ const e = document.createElement("section");
83
+ if (this.properties.className && (e.className = this.properties.className), this.properties.title) {
84
+ const r = document.createElement("h3");
85
+ if (r.textContent = this.properties.title, r.style.cssText = "margin: 0 0 1rem 0; font-weight: 600;", this.properties.collapsible) {
86
+ r.style.cursor = "pointer", r.addEventListener("click", () => this.toggle());
87
+ const s = document.createElement("span");
88
+ s.textContent = this.expanded() ? " ▼" : " ▶", s.style.cssText = "font-size: 0.8em; margin-left: 0.5rem;", r.appendChild(s), a(() => {
89
+ s.textContent = this.expanded() ? " ▼" : " ▶";
90
+ });
195
91
  }
196
- };
197
- },
198
- /**
199
- * Date validation (YYYY-MM-DD format)
200
- */
201
- date: (e) => {
202
- if (!e) return { valid: !0 };
203
- const t = new Date(e), r = !Number.isNaN(t.getTime());
204
- return {
205
- valid: r,
206
- ...r ? {} : { message: "Please enter a valid date", code: "INVALID_DATE" }
207
- };
208
- },
209
- /**
210
- * Time validation (HH:MM format)
211
- */
212
- time: (e) => {
213
- if (!e) return { valid: !0 };
214
- const r = /^([0-1]?[0-9]|2[0-3]):[0-5][0-9]$/.test(e);
215
- return {
216
- valid: r,
217
- ...r ? {} : { message: "Please enter a valid time (HH:MM)", code: "INVALID_TIME" }
218
- };
219
- },
220
- /**
221
- * Composite validator - combines multiple validators with AND logic
222
- */
223
- and: (...e) => (t) => {
224
- for (const r of e) {
225
- const a = r(t);
226
- if (!a.valid)
227
- return a;
92
+ e.appendChild(r);
93
+ }
94
+ if (this.properties.description) {
95
+ const r = document.createElement("p");
96
+ r.textContent = this.properties.description, r.style.cssText = "margin: 0 0 1rem 0; color: #666; font-size: 0.9em;", e.appendChild(r);
228
97
  }
229
- return { valid: !0 };
230
- },
231
- /**
232
- * Composite validator - combines multiple validators with OR logic
233
- */
234
- or: (...e) => (t) => {
235
- const r = e.map((i) => i(t));
236
- return r.some((i) => i.valid) ? { valid: !0 } : r.find((i) => !i.valid) || { valid: !1, message: "Validation failed", code: "VALIDATION_FAILED" };
237
- },
238
- /**
239
- * Custom validator factory
240
- */
241
- custom: (e) => e
242
- }, z = {
243
- name: "@tachui/forms",
244
- version: "0.1.0",
245
- async install(e) {
246
- const t = (r, a, o) => {
247
- e.registerComponent(r, a, o);
248
- };
249
- t("Form", n, {
250
- category: "forms",
251
- tags: ["form", "container", "validation"]
252
- }), t("FormSection", d, {
253
- category: "forms",
254
- tags: ["form", "section", "fieldset"]
255
- }), t("TextField", b, {
256
- category: "forms",
257
- tags: ["input", "text", "validation"]
258
- }), t("EmailField", I, {
259
- category: "forms",
260
- tags: ["input", "email", "validation"]
261
- }), t("PasswordField", S, {
262
- category: "forms",
263
- tags: ["input", "password", "validation"]
264
- }), t("SearchField", V, {
265
- category: "forms",
266
- tags: ["input", "search"]
267
- }), t("URLField", x, {
268
- category: "forms",
269
- tags: ["input", "url", "validation"]
270
- }), t("PhoneField", y, {
271
- category: "forms",
272
- tags: ["input", "phone", "validation"]
273
- }), t("NumberField", C, {
274
- category: "forms",
275
- tags: ["input", "number", "numeric", "validation"]
276
- }), t("CreditCardField", R, {
277
- category: "forms",
278
- tags: ["input", "credit-card", "payment", "validation"]
279
- }), t("SSNField", A, {
280
- category: "forms",
281
- tags: ["input", "ssn", "social-security", "validation"]
282
- }), t("PostalCodeField", T, {
283
- category: "forms",
284
- tags: ["input", "postal-code", "zip", "validation"]
285
- }), t("TextArea", P, {
286
- category: "forms",
287
- tags: ["input", "textarea", "multiline"]
288
- }), t("DateField", L, {
289
- category: "forms",
290
- tags: ["input", "date", "calendar", "validation"]
291
- }), t("TimeField", D, {
292
- category: "forms",
293
- tags: ["input", "time", "clock", "validation"]
294
- }), t("ColorField", E, {
295
- category: "forms",
296
- tags: ["input", "color", "picker"]
297
- }), t("Checkbox", _, {
298
- category: "forms",
299
- tags: ["input", "checkbox", "boolean"]
300
- }), t("Switch", M, {
301
- category: "forms",
302
- tags: ["input", "switch", "toggle", "boolean"]
303
- }), t("CheckboxGroup", U, {
304
- category: "forms",
305
- tags: ["input", "checkbox", "group", "multiple"]
306
- }), t("Radio", w, {
307
- category: "forms",
308
- tags: ["input", "radio", "choice"]
309
- }), t("RadioGroup", $, {
310
- category: "forms",
311
- tags: ["input", "radio", "group", "choice"]
312
- }), t("Select", k, {
313
- category: "forms",
314
- tags: ["input", "select", "dropdown", "choice"]
315
- }), t("MultiSelect", G, {
316
- category: "forms",
317
- tags: ["input", "select", "multiple", "choice"]
318
- }), t("Combobox", H, {
319
- category: "forms",
320
- tags: ["input", "combobox", "search", "choice"]
321
- }), e.registerService("formsConfig", {
322
- theme: "default",
323
- validation: {},
324
- accessibility: {}
325
- }), e.registerService("validationMessageFormatter", c), e.registerService("createFormState", m), e.registerService("createField", u), e.registerService("createMultiStepFormState", g), e.registerService("ValidationPresets", f), e.registerService("CrossFieldValidators", p), e.registerService("TextFieldFormatters", v), e.registerService("TextFieldParsers", N), e.registerService("TextFieldValidators", O), await F(), console.log("📝 TachUI Forms plugin installed successfully"), console.log(" • 24 form components (including enhanced TextField variants)"), console.log(` • ${h().length} validation rules`), console.log(" • TextField formatters and validators included");
326
- },
327
- async uninstall() {
328
- console.log("📝 TachUI Forms plugin uninstalled");
98
+ const t = document.createElement("div");
99
+ return a(() => {
100
+ t.style.display = this.expanded() ? "block" : "none";
101
+ }), this.properties.children && (Array.isArray(this.properties.children) ? this.properties.children.forEach((r) => {
102
+ typeof r == "string" ? t.appendChild(document.createTextNode(r)) : r && typeof r.render == "function" ? t.appendChild(r.render()) : r instanceof HTMLElement && t.appendChild(r);
103
+ }) : typeof this.properties.children == "string" ? t.appendChild(document.createTextNode(this.properties.children)) : this.properties.children && typeof this.properties.children.render == "function" ? t.appendChild(this.properties.children.render()) : this.properties.children instanceof HTMLElement && t.appendChild(this.properties.children)), e.appendChild(t), e;
329
104
  }
330
- }, W = async (e) => z.install(e);
105
+ }
106
+ function f(i) {
107
+ return new d(i);
108
+ }
109
+ function m(i) {
110
+ return new p(i);
111
+ }
112
+ function h() {
113
+ return {
114
+ /* TODO: Implement form state hook */
115
+ };
116
+ }
117
+ function u() {
118
+ return {
119
+ /* TODO: Implement form validation hook */
120
+ };
121
+ }
122
+ function S(i) {
123
+ return i.replace(/\D/g, "").replace(/(\d{4})(?=\d)/g, "$1 ");
124
+ }
125
+ function x(i) {
126
+ return i.replace(/\D/g, "").replace(/(\d{3})(\d{3})(\d{4})/, "($1) $2-$3");
127
+ }
128
+ function g(i) {
129
+ return i.replace(/\D/g, "").replace(/(\d{3})(\d{2})(\d{4})/, "$1-$2-$3");
130
+ }
131
+ function C(i) {
132
+ return i.toUpperCase().replace(/[^A-Z0-9]/g, "");
133
+ }
134
+ function F(i, e = "yyyy-MM-dd") {
135
+ return i.toISOString().split("T")[0];
136
+ }
137
+ function E(i) {
138
+ return new Date(i);
139
+ }
140
+ function y(i) {
141
+ return i instanceof Date && !isNaN(i.getTime());
142
+ }
331
143
  export {
332
144
  _ as Checkbox,
333
- U as CheckboxGroup,
334
- E as ColorField,
335
- H as Combobox,
336
- R as CreditCardField,
337
- p as CrossFieldValidators,
338
- L as DateField,
339
- I as EmailField,
340
- n as Form,
341
- d as FormSection,
342
- Q as FormUtils,
343
- Y as FormsComponentValidation,
344
- ee as FormsValidationError,
345
- G as MultiSelect,
346
- C as NumberField,
347
- S as PasswordField,
348
- y as PhoneField,
349
- T as PostalCodeField,
350
- w as Radio,
351
- $ as RadioGroup,
352
- A as SSNField,
353
- V as SearchField,
354
- k as Select,
355
- M as Switch,
356
- P as TextArea,
357
- b as TextField,
358
- v as TextFieldFormatters,
359
- N as TextFieldParsers,
360
- O as TextFieldValidators,
361
- D as TimeField,
362
- x as URLField,
363
- te as VALIDATION_RULES,
364
- re as ValidationMessageFormatter,
365
- f as ValidationPresets,
366
- ae as ValidationUtils,
367
- se as createDebouncedValidator,
368
- u as createField,
369
- m as createFormState,
370
- ie as createFormsValidators,
371
- g as createMultiStepFormState,
372
- z as default,
373
- c as defaultMessageFormatter,
374
- h as getValidationRules,
375
- W as installFormsPlugin,
376
- F as registerFormsValidators,
377
- oe as registerValidationRule,
378
- le as unregisterValidationRule,
379
- ne as validateField,
380
- de as validateValue,
381
- ce as validateValueAsync
145
+ j as CheckboxGroup,
146
+ D as ColorField,
147
+ Z as Combobox,
148
+ M as CreditCardField,
149
+ ie as CrossFieldValidators,
150
+ w as DateField,
151
+ te as DatePicker,
152
+ A as EmailField,
153
+ d as Form,
154
+ p as FormSection,
155
+ se as FormsComponentValidation,
156
+ ae as FormsValidationError,
157
+ q as MultiSelect,
158
+ L as NumberField,
159
+ P as PasswordField,
160
+ R as PhoneField,
161
+ $ as PostalCodeField,
162
+ B as Radio,
163
+ J as RadioGroup,
164
+ k as SSNField,
165
+ O as SearchField,
166
+ K as Select,
167
+ X as Slider,
168
+ Y as Stepper,
169
+ Q as Switch,
170
+ U as TextArea,
171
+ H as TextField,
172
+ I as TimeField,
173
+ z as URLField,
174
+ ne as VALIDATION_RULES,
175
+ oe as ValidationMessageFormatter,
176
+ de as ValidationPresets,
177
+ pe as ValidationUtils,
178
+ le as createDebouncedValidator,
179
+ N as createField,
180
+ o as createFormState,
181
+ ce as createFormsValidators,
182
+ T as createMultiStepFormState,
183
+ fe as defaultMessageFormatter,
184
+ f as form,
185
+ m as formSection,
186
+ S as formatCreditCard,
187
+ F as formatDate,
188
+ x as formatPhoneNumber,
189
+ C as formatPostalCode,
190
+ g as formatSSN,
191
+ me as getValidationRules,
192
+ y as isValidDate,
193
+ E as parseDate,
194
+ he as registerFormsValidators,
195
+ ue as registerValidationRule,
196
+ Se as unregisterValidationRule,
197
+ h as useFormState,
198
+ u as useFormValidation,
199
+ xe as validateField,
200
+ ge as validateValue,
201
+ Ce as validateValueAsync
382
202
  };
383
203
  //# sourceMappingURL=index.js.map