@openelement/ui 1.0.0-alpha.15 → 1.0.0-alpha.16

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/src/open-input.js CHANGED
@@ -1,1753 +1,166 @@
1
- import { nextInstanceId, syncDisabledState } from "./component-recipes.js";
2
- import { OpenElement, computed } from "@openelement/element";
3
- import openInputStyles from "./open-input.css";
1
+ import { defineComponentConfig } from "./component-config.js";
2
+ import { syncInputDisabled, syncInputValue } from "./input-machine.js";
3
+ import { jsx, jsxs } from "@openelement/element/jsx-runtime";
4
+ import { onConnect, onPropertyChange } from "@openelement/element/lifecycle";
4
5
  //#region src/open-input.tsx
5
- const __partProgram = {
6
- "version": 2,
7
- "tag": "open-input",
8
- "root": {
9
- "id": "root",
10
- "kind": "shadow-open",
11
- "nodes": ["e0"]
12
- },
13
- "template": [{
14
- "k": "el",
15
- "id": "e0",
16
- "tag": "div",
17
- "attrs": [["class", "flex flex-col gap-2"], ["part", "wrapper"]],
18
- "children": [
19
- {
20
- "k": "el",
21
- "id": "e1",
22
- "tag": "label",
23
- "attrs": [["class", "text-sm font-medium text-muted-foreground tracking-normal"], ["part", "label"]],
24
- "children": [{
25
- "k": "part",
26
- "id": "p2",
27
- "index": 2
28
- }, {
29
- "k": "el",
30
- "id": "e2",
31
- "tag": "span",
32
- "attrs": [],
33
- "children": [{
34
- "k": "part",
35
- "id": "p3",
36
- "index": 3
37
- }]
38
- }]
39
- },
40
- {
41
- "k": "el",
42
- "id": "e3",
43
- "tag": "input",
44
- "attrs": [["class", "control w-full px-3 py-2 font-sans text-base text-foreground rounded-md outline-none transition-[border-color,box-shadow] duration-200 ease-out placeholder:text-muted-foreground"], ["part", "control"]],
45
- "children": []
46
- },
47
- {
48
- "k": "el",
49
- "id": "e4",
50
- "tag": "small",
51
- "attrs": [
52
- ["role", "alert"],
53
- ["class", "text-xs text-destructive"],
54
- ["part", "error"]
55
- ],
56
- "children": [{
57
- "k": "part",
58
- "id": "p20",
59
- "index": 20
60
- }]
61
- }
62
- ]
63
- }],
64
- "parts": [
65
- {
66
- "k": "attr",
67
- "signal": "idAttr",
68
- "name": "for",
69
- "path": [0, 0],
70
- "index": 0,
71
- "location": {
72
- "id": "p0",
73
- "kind": "sink",
74
- "path": [0, 0],
75
- "node": "e1"
76
- }
77
- },
78
- {
79
- "k": "bool",
80
- "signal": "noLabel",
81
- "name": "hidden",
82
- "path": [0, 0],
83
- "index": 1,
84
- "location": {
85
- "id": "p1",
86
- "kind": "sink",
87
- "path": [0, 0],
88
- "node": "e1"
89
- }
90
- },
91
- {
92
- "k": "text",
93
- "signal": "label",
94
- "index": 2,
95
- "location": {
96
- "id": "p2",
97
- "kind": "anchor",
98
- "path": [
99
- 0,
100
- 0,
101
- 0
102
- ]
103
- }
104
- },
105
- {
106
- "k": "text",
107
- "signal": "requiredMark",
108
- "index": 3,
109
- "location": {
110
- "id": "p3",
111
- "kind": "anchor",
112
- "path": [
113
- 0,
114
- 0,
115
- 1,
116
- 0
117
- ]
118
- }
119
- },
120
- {
121
- "k": "attr",
122
- "signal": "idAttr",
123
- "name": "id",
124
- "path": [0, 1],
125
- "index": 4,
126
- "location": {
127
- "id": "p4",
128
- "kind": "sink",
129
- "path": [0, 1],
130
- "node": "e3"
131
- }
132
- },
133
- {
134
- "k": "attr",
135
- "signal": "type",
136
- "name": "type",
137
- "path": [0, 1],
138
- "index": 5,
139
- "location": {
140
- "id": "p5",
141
- "kind": "sink",
142
- "path": [0, 1],
143
- "node": "e3"
144
- }
145
- },
146
- {
147
- "k": "attr",
148
- "signal": "placeholder",
149
- "name": "placeholder",
150
- "path": [0, 1],
151
- "index": 6,
152
- "location": {
153
- "id": "p6",
154
- "kind": "sink",
155
- "path": [0, 1],
156
- "node": "e3"
157
- }
158
- },
159
- {
160
- "k": "prop",
161
- "signal": "value",
162
- "name": "value",
163
- "path": [0, 1],
164
- "index": 7,
165
- "location": {
166
- "id": "p7",
167
- "kind": "sink",
168
- "path": [0, 1],
169
- "node": "e3"
170
- }
171
- },
172
- {
173
- "k": "attr",
174
- "signal": "name",
175
- "name": "name",
176
- "path": [0, 1],
177
- "index": 8,
178
- "location": {
179
- "id": "p8",
180
- "kind": "sink",
181
- "path": [0, 1],
182
- "node": "e3"
183
- }
184
- },
185
- {
186
- "k": "bool",
187
- "signal": "disabled",
188
- "name": "disabled",
189
- "path": [0, 1],
190
- "index": 9,
191
- "location": {
192
- "id": "p9",
193
- "kind": "sink",
194
- "path": [0, 1],
195
- "node": "e3"
196
- }
197
- },
198
- {
199
- "k": "bool",
200
- "signal": "required",
201
- "name": "required",
202
- "path": [0, 1],
203
- "index": 10,
204
- "location": {
205
- "id": "p10",
206
- "kind": "sink",
207
- "path": [0, 1],
208
- "node": "e3"
209
- }
210
- },
211
- {
212
- "k": "attr",
213
- "signal": "ariaInvalidAttr",
214
- "name": "aria-invalid",
215
- "path": [0, 1],
216
- "index": 11,
217
- "location": {
218
- "id": "p11",
219
- "kind": "sink",
220
- "path": [0, 1],
221
- "node": "e3"
222
- }
223
- },
224
- {
225
- "k": "attr",
226
- "signal": "describedByAttr",
227
- "name": "aria-describedby",
228
- "path": [0, 1],
229
- "index": 12,
230
- "location": {
231
- "id": "p12",
232
- "kind": "sink",
233
- "path": [0, 1],
234
- "node": "e3"
235
- }
236
- },
237
- {
238
- "k": "attr",
239
- "signal": "describedByAttr",
240
- "name": "aria-errormessage",
241
- "path": [0, 1],
242
- "index": 13,
243
- "location": {
244
- "id": "p13",
245
- "kind": "sink",
246
- "path": [0, 1],
247
- "node": "e3"
248
- }
249
- },
250
- {
251
- "k": "event",
252
- "event": "input",
253
- "handler": "handleInput",
254
- "action": {
255
- "kind": "method",
256
- "name": "handleInput"
257
- },
258
- "path": [0, 1],
259
- "index": 14,
260
- "location": {
261
- "id": "p14",
262
- "kind": "sink",
263
- "path": [0, 1],
264
- "node": "e3"
265
- }
266
- },
267
- {
268
- "k": "event",
269
- "event": "change",
270
- "handler": "handleChange",
271
- "action": {
272
- "kind": "method",
273
- "name": "handleChange"
274
- },
275
- "path": [0, 1],
276
- "index": 15,
277
- "location": {
278
- "id": "p15",
279
- "kind": "sink",
280
- "path": [0, 1],
281
- "node": "e3"
282
- }
283
- },
284
- {
285
- "k": "event",
286
- "event": "focus",
287
- "handler": "handleFocus",
288
- "action": {
289
- "kind": "method",
290
- "name": "handleFocus"
291
- },
292
- "path": [0, 1],
293
- "index": 16,
294
- "location": {
295
- "id": "p16",
296
- "kind": "sink",
297
- "path": [0, 1],
298
- "node": "e3"
299
- }
300
- },
301
- {
302
- "k": "event",
303
- "event": "blur",
304
- "handler": "handleBlur",
305
- "action": {
306
- "kind": "method",
307
- "name": "handleBlur"
308
- },
309
- "path": [0, 1],
310
- "index": 17,
311
- "location": {
312
- "id": "p17",
313
- "kind": "sink",
314
- "path": [0, 1],
315
- "node": "e3"
316
- }
317
- },
318
- {
319
- "k": "attr",
320
- "signal": "errorIdAttr",
321
- "name": "id",
322
- "path": [0, 2],
323
- "index": 18,
324
- "location": {
325
- "id": "p18",
326
- "kind": "sink",
327
- "path": [0, 2],
328
- "node": "e4"
329
- }
330
- },
331
- {
332
- "k": "bool",
333
- "signal": "noError",
334
- "name": "hidden",
335
- "path": [0, 2],
336
- "index": 19,
337
- "location": {
338
- "id": "p19",
339
- "kind": "sink",
340
- "path": [0, 2],
341
- "node": "e4"
342
- }
343
- },
344
- {
345
- "k": "text",
346
- "signal": "error",
347
- "index": 20,
348
- "location": {
349
- "id": "p20",
350
- "kind": "anchor",
351
- "path": [
352
- 0,
353
- 2,
354
- 0
355
- ]
356
- }
357
- }
358
- ],
359
- "blocks": [],
360
- "dependencies": [
361
- {
362
- "signal": "idAttr",
363
- "owner": {
364
- "kind": "part",
365
- "index": 0
366
- },
367
- "location": "p0"
368
- },
369
- {
370
- "signal": "noLabel",
371
- "owner": {
372
- "kind": "part",
373
- "index": 1
374
- },
375
- "location": "p1"
376
- },
377
- {
378
- "signal": "label",
379
- "owner": {
380
- "kind": "part",
381
- "index": 2
382
- },
383
- "location": "p2"
384
- },
385
- {
386
- "signal": "requiredMark",
387
- "owner": {
388
- "kind": "part",
389
- "index": 3
390
- },
391
- "location": "p3"
392
- },
393
- {
394
- "signal": "idAttr",
395
- "owner": {
396
- "kind": "part",
397
- "index": 4
398
- },
399
- "location": "p4"
400
- },
401
- {
402
- "signal": "type",
403
- "owner": {
404
- "kind": "part",
405
- "index": 5
406
- },
407
- "location": "p5"
408
- },
409
- {
410
- "signal": "placeholder",
411
- "owner": {
412
- "kind": "part",
413
- "index": 6
414
- },
415
- "location": "p6"
416
- },
417
- {
418
- "signal": "value",
419
- "owner": {
420
- "kind": "part",
421
- "index": 7
422
- },
423
- "location": "p7"
424
- },
425
- {
426
- "signal": "name",
427
- "owner": {
428
- "kind": "part",
429
- "index": 8
430
- },
431
- "location": "p8"
432
- },
433
- {
434
- "signal": "disabled",
435
- "owner": {
436
- "kind": "part",
437
- "index": 9
438
- },
439
- "location": "p9"
440
- },
441
- {
442
- "signal": "required",
443
- "owner": {
444
- "kind": "part",
445
- "index": 10
446
- },
447
- "location": "p10"
448
- },
449
- {
450
- "signal": "ariaInvalidAttr",
451
- "owner": {
452
- "kind": "part",
453
- "index": 11
454
- },
455
- "location": "p11"
456
- },
457
- {
458
- "signal": "describedByAttr",
459
- "owner": {
460
- "kind": "part",
461
- "index": 12
462
- },
463
- "location": "p12"
464
- },
465
- {
466
- "signal": "describedByAttr",
467
- "owner": {
468
- "kind": "part",
469
- "index": 13
470
- },
471
- "location": "p13"
472
- },
473
- {
474
- "signal": "errorIdAttr",
475
- "owner": {
476
- "kind": "part",
477
- "index": 18
478
- },
479
- "location": "p18"
480
- },
481
- {
482
- "signal": "noError",
483
- "owner": {
484
- "kind": "part",
485
- "index": 19
486
- },
487
- "location": "p19"
488
- },
489
- {
490
- "signal": "error",
491
- "owner": {
492
- "kind": "part",
493
- "index": 20
494
- },
495
- "location": "p20"
496
- }
497
- ],
498
- "locations": [
499
- {
500
- "id": "e0",
501
- "kind": "element",
502
- "tag": "div",
503
- "path": [0]
504
- },
505
- {
506
- "id": "e1",
507
- "kind": "element",
508
- "tag": "label",
509
- "path": [0, 0]
510
- },
511
- {
512
- "id": "p0",
513
- "kind": "sink",
514
- "part": 0,
515
- "node": "e1",
516
- "path": [0, 0]
517
- },
518
- {
519
- "id": "p1",
520
- "kind": "sink",
521
- "part": 1,
522
- "node": "e1",
523
- "path": [0, 0]
524
- },
525
- {
526
- "id": "p2",
527
- "kind": "anchor",
528
- "part": 2,
529
- "path": [
530
- 0,
531
- 0,
532
- 0
533
- ]
534
- },
535
- {
536
- "id": "e2",
537
- "kind": "element",
538
- "tag": "span",
539
- "path": [
540
- 0,
541
- 0,
542
- 1
543
- ]
544
- },
545
- {
546
- "id": "p3",
547
- "kind": "anchor",
548
- "part": 3,
549
- "path": [
550
- 0,
551
- 0,
552
- 1,
553
- 0
554
- ]
555
- },
556
- {
557
- "id": "e3",
558
- "kind": "element",
559
- "tag": "input",
560
- "path": [0, 1]
561
- },
562
- {
563
- "id": "p4",
564
- "kind": "sink",
565
- "part": 4,
566
- "node": "e3",
567
- "path": [0, 1]
568
- },
569
- {
570
- "id": "p5",
571
- "kind": "sink",
572
- "part": 5,
573
- "node": "e3",
574
- "path": [0, 1]
575
- },
576
- {
577
- "id": "p6",
578
- "kind": "sink",
579
- "part": 6,
580
- "node": "e3",
581
- "path": [0, 1]
582
- },
583
- {
584
- "id": "p7",
585
- "kind": "sink",
586
- "part": 7,
587
- "node": "e3",
588
- "path": [0, 1]
589
- },
590
- {
591
- "id": "p8",
592
- "kind": "sink",
593
- "part": 8,
594
- "node": "e3",
595
- "path": [0, 1]
596
- },
597
- {
598
- "id": "p9",
599
- "kind": "sink",
600
- "part": 9,
601
- "node": "e3",
602
- "path": [0, 1]
603
- },
604
- {
605
- "id": "p10",
606
- "kind": "sink",
607
- "part": 10,
608
- "node": "e3",
609
- "path": [0, 1]
610
- },
611
- {
612
- "id": "p11",
613
- "kind": "sink",
614
- "part": 11,
615
- "node": "e3",
616
- "path": [0, 1]
617
- },
618
- {
619
- "id": "p12",
620
- "kind": "sink",
621
- "part": 12,
622
- "node": "e3",
623
- "path": [0, 1]
624
- },
625
- {
626
- "id": "p13",
627
- "kind": "sink",
628
- "part": 13,
629
- "node": "e3",
630
- "path": [0, 1]
631
- },
632
- {
633
- "id": "p14",
634
- "kind": "sink",
635
- "part": 14,
636
- "node": "e3",
637
- "path": [0, 1]
638
- },
639
- {
640
- "id": "p15",
641
- "kind": "sink",
642
- "part": 15,
643
- "node": "e3",
644
- "path": [0, 1]
645
- },
646
- {
647
- "id": "p16",
648
- "kind": "sink",
649
- "part": 16,
650
- "node": "e3",
651
- "path": [0, 1]
652
- },
653
- {
654
- "id": "p17",
655
- "kind": "sink",
656
- "part": 17,
657
- "node": "e3",
658
- "path": [0, 1]
659
- },
660
- {
661
- "id": "e4",
662
- "kind": "element",
663
- "tag": "small",
664
- "path": [0, 2]
665
- },
666
- {
667
- "id": "p18",
668
- "kind": "sink",
669
- "part": 18,
670
- "node": "e4",
671
- "path": [0, 2]
672
- },
673
- {
674
- "id": "p19",
675
- "kind": "sink",
676
- "part": 19,
677
- "node": "e4",
678
- "path": [0, 2]
679
- },
680
- {
681
- "id": "p20",
682
- "kind": "anchor",
683
- "part": 20,
684
- "path": [
685
- 0,
686
- 2,
687
- 0
688
- ]
6
+ /**
7
+ * @openelement/ui - open-input
8
+ *
9
+ * Form-associated text input with a label, an inline error slot, and native
10
+ * constraint validation (required and email constraints through the shell's
11
+ * M09-2d form mapping).
12
+ *
13
+ * Experimental (owner ruling C1, #1468): internal implementation may change or
14
+ * be removed before 1.0; the declared `::part` names follow the
15
+ * CUSTOMIZATION.md contract (`::part` names never shrink).
16
+ *
17
+ * Generated authoring. The declared rows drive the compiled sinks; the derived
18
+ * visibility/ARIA surface is authored as inline JSX expressions (the generated
19
+ * lane has no authoring `computed`), and the FORM CONTRACT (setFormValue,
20
+ * validity, reset/restore, fieldset states) is the SHELL's mapping.
21
+ * `input-machine.ts` only projects the live value and the disabled surface.
22
+ *
23
+ * TWO CONSTRAINTS SHAPE THIS TEMPLATE, and both come from the generated lane:
24
+ *
25
+ * 1. No `value={…}` binding. That name classifies as a DOM-IDL `property`
26
+ * channel, and a property slot makes the whole component mount-only — losing
27
+ * the SSR producer and the claim path.
28
+ * 2. Every id is STATIC and therefore part of the compiled attribute seed. A
29
+ * claim verifies each node's static attributes, so an id written at connect
30
+ * time would fail it with OEIR_LEAF_CLAIM_MISMATCH. A shadow root is its own
31
+ * id scope, so the same spelling in every instance is correct — the class
32
+ * lane's realm-unique counter existed only to keep SSR and CSR agreeing on a
33
+ * document-wide identity, which the shadow boundary makes unnecessary.
34
+ *
35
+ * @csspart wrapper -The outer input-wrapper div
36
+ * @csspart label -The label element
37
+ * @csspart control -The input element
38
+ * @csspart error -The error message small element
39
+ *
40
+ * Usage:
41
+ * ```html
42
+ * <open-input placeholder="Enter text"></open-input>
43
+ * <open-input type="email" label="Email"></open-input>
44
+ * <form>
45
+ * <open-input name="username" label="Username"></open-input>
46
+ * <button type="submit">Submit</button>
47
+ * </form>
48
+ * ```
49
+ */
50
+ /**
51
+ * Platform facts for the generated element: shadow root with delegated focus,
52
+ * form association (value publication, required and email validity, reset/restore and
53
+ * the fieldset-effective disabled state are the SHELL's mapping), the authored
54
+ * stylesheet, and the eight declared property rows. Only `value` has no
55
+ * attribute wire — it is the live property the form contract and the compiled
56
+ * sinks read.
57
+ */
58
+ const openElement = /* @__PURE__ */ defineComponentConfig({
59
+ root: "shadow",
60
+ delegatesFocus: true,
61
+ formAssociated: true,
62
+ styles: ["./open-input.css"],
63
+ properties: {
64
+ type: { default: "text" },
65
+ placeholder: { default: "" },
66
+ label: { default: "" },
67
+ name: { default: "" },
68
+ value: { default: "" },
69
+ disabled: { default: false },
70
+ required: { default: false },
71
+ error: { default: "" }
72
+ }
73
+ });
74
+ /** Form-associated text input with a label, an error slot and native validity. */
75
+ function OpenInput(props) {
76
+ const hostOf = (event) => event.currentTarget.getRootNode().host;
77
+ const lockedByFieldset = (event) => hostOf(event).matches(":state(disabled)");
78
+ onConnect((env) => {
79
+ syncInputValue(env.host);
80
+ });
81
+ onPropertyChange((event) => {
82
+ const host = event.host;
83
+ if (event.name === "value") {
84
+ syncInputValue(host);
85
+ return;
689
86
  }
690
- ],
691
- "metadata": {
692
- "tag": "open-input",
693
- "className": "OpenInput",
694
- "sourceFile": "open-input.tsx",
695
- "properties": [
696
- {
697
- "name": "type",
698
- "attribute": "type",
699
- "type": "string",
700
- "converter": "string",
701
- "reflect": false,
702
- "default": "text"
703
- },
704
- {
705
- "name": "placeholder",
706
- "attribute": "placeholder",
707
- "type": "string",
708
- "converter": "string",
709
- "reflect": false,
710
- "default": ""
711
- },
712
- {
713
- "name": "label",
714
- "attribute": "label",
715
- "type": "string",
716
- "converter": "string",
717
- "reflect": false,
718
- "default": ""
719
- },
720
- {
721
- "name": "name",
722
- "attribute": "name",
723
- "type": "string",
724
- "converter": "string",
725
- "reflect": false,
726
- "default": ""
727
- },
728
- {
729
- "name": "value",
730
- "attribute": "value",
731
- "type": "string",
732
- "converter": "string",
733
- "reflect": false,
734
- "default": ""
735
- },
736
- {
737
- "name": "disabled",
738
- "attribute": "disabled",
739
- "type": "boolean",
740
- "converter": "boolean",
741
- "reflect": false,
742
- "default": false
743
- },
744
- {
745
- "name": "required",
746
- "attribute": "required",
747
- "type": "boolean",
748
- "converter": "boolean",
749
- "reflect": false,
750
- "default": false
751
- },
752
- {
753
- "name": "error",
754
- "attribute": "error",
755
- "type": "string",
756
- "converter": "string",
757
- "reflect": false,
758
- "default": ""
759
- },
760
- {
761
- "name": "inputId",
762
- "attribute": null,
763
- "type": "string",
764
- "converter": "string",
765
- "reflect": false,
766
- "default": ""
767
- },
768
- {
769
- "name": "noLabel",
770
- "attribute": null,
771
- "type": "boolean",
772
- "converter": "boolean",
773
- "reflect": false,
774
- "default": null,
775
- "computed": true,
776
- "deps": ["label"]
777
- },
778
- {
779
- "name": "noError",
780
- "attribute": null,
781
- "type": "boolean",
782
- "converter": "boolean",
783
- "reflect": false,
784
- "default": null,
785
- "computed": true,
786
- "deps": ["error"]
787
- },
788
- {
789
- "name": "idAttr",
790
- "attribute": null,
791
- "type": "string",
792
- "converter": "string",
793
- "reflect": false,
794
- "default": null,
795
- "computed": true,
796
- "deps": ["inputId"]
797
- },
798
- {
799
- "name": "errorIdAttr",
800
- "attribute": null,
801
- "type": "string",
802
- "converter": "string",
803
- "reflect": false,
804
- "default": null,
805
- "computed": true,
806
- "deps": ["inputId"]
807
- },
808
- {
809
- "name": "ariaInvalidAttr",
810
- "attribute": null,
811
- "type": "string",
812
- "converter": "string",
813
- "reflect": false,
814
- "default": null,
815
- "computed": true,
816
- "deps": ["error"]
817
- },
818
- {
819
- "name": "requiredMark",
820
- "attribute": null,
821
- "type": "string",
822
- "converter": "string",
823
- "reflect": false,
824
- "default": null,
825
- "computed": true,
826
- "deps": ["required"]
827
- },
828
- {
829
- "name": "describedByAttr",
830
- "attribute": null,
831
- "type": "string",
832
- "converter": "string",
833
- "reflect": false,
834
- "default": null,
835
- "computed": true,
836
- "deps": ["error", "inputId"]
837
- }
838
- ],
839
- "observedAttributes": [
840
- "type",
841
- "placeholder",
842
- "label",
843
- "name",
844
- "value",
845
- "disabled",
846
- "required",
847
- "error"
848
- ],
849
- "cem": {
850
- "tagName": "open-input",
851
- "className": "OpenInput",
852
- "declaration": {
853
- "name": "OpenInput",
854
- "module": "open-input.tsx"
855
- },
856
- "attributes": [
857
- {
858
- "name": "type",
859
- "fieldName": "type",
860
- "type": "string",
861
- "reflect": false
862
- },
863
- {
864
- "name": "placeholder",
865
- "fieldName": "placeholder",
866
- "type": "string",
867
- "reflect": false
868
- },
869
- {
870
- "name": "label",
871
- "fieldName": "label",
872
- "type": "string",
873
- "reflect": false
874
- },
875
- {
876
- "name": "name",
877
- "fieldName": "name",
878
- "type": "string",
879
- "reflect": false
880
- },
881
- {
882
- "name": "value",
883
- "fieldName": "value",
884
- "type": "string",
885
- "reflect": false
886
- },
887
- {
888
- "name": "disabled",
889
- "fieldName": "disabled",
890
- "type": "boolean",
891
- "reflect": false
892
- },
893
- {
894
- "name": "required",
895
- "fieldName": "required",
896
- "type": "boolean",
897
- "reflect": false
898
- },
899
- {
900
- "name": "error",
901
- "fieldName": "error",
902
- "type": "string",
903
- "reflect": false
904
- }
905
- ],
906
- "members": [
907
- {
908
- "name": "type",
909
- "fieldName": "type",
910
- "type": "string",
911
- "attribute": "type",
912
- "reflect": false
913
- },
914
- {
915
- "name": "placeholder",
916
- "fieldName": "placeholder",
917
- "type": "string",
918
- "attribute": "placeholder",
919
- "reflect": false
920
- },
921
- {
922
- "name": "label",
923
- "fieldName": "label",
924
- "type": "string",
925
- "attribute": "label",
926
- "reflect": false
927
- },
928
- {
929
- "name": "name",
930
- "fieldName": "name",
931
- "type": "string",
932
- "attribute": "name",
933
- "reflect": false
934
- },
935
- {
936
- "name": "value",
937
- "fieldName": "value",
938
- "type": "string",
939
- "attribute": "value",
940
- "reflect": false
941
- },
942
- {
943
- "name": "disabled",
944
- "fieldName": "disabled",
945
- "type": "boolean",
946
- "attribute": "disabled",
947
- "reflect": false
948
- },
949
- {
950
- "name": "required",
951
- "fieldName": "required",
952
- "type": "boolean",
953
- "attribute": "required",
954
- "reflect": false
955
- },
956
- {
957
- "name": "error",
958
- "fieldName": "error",
959
- "type": "string",
960
- "attribute": "error",
961
- "reflect": false
962
- },
963
- {
964
- "name": "inputId",
965
- "fieldName": "inputId",
966
- "type": "string",
967
- "attribute": null,
968
- "reflect": false
969
- },
970
- {
971
- "name": "noLabel",
972
- "fieldName": "noLabel",
973
- "type": "boolean",
974
- "attribute": null,
975
- "reflect": false
976
- },
977
- {
978
- "name": "noError",
979
- "fieldName": "noError",
980
- "type": "boolean",
981
- "attribute": null,
982
- "reflect": false
983
- },
984
- {
985
- "name": "idAttr",
986
- "fieldName": "idAttr",
987
- "type": "string",
988
- "attribute": null,
989
- "reflect": false
990
- },
991
- {
992
- "name": "errorIdAttr",
993
- "fieldName": "errorIdAttr",
994
- "type": "string",
995
- "attribute": null,
996
- "reflect": false
997
- },
998
- {
999
- "name": "ariaInvalidAttr",
1000
- "fieldName": "ariaInvalidAttr",
1001
- "type": "string",
1002
- "attribute": null,
1003
- "reflect": false
1004
- },
1005
- {
1006
- "name": "requiredMark",
1007
- "fieldName": "requiredMark",
1008
- "type": "string",
1009
- "attribute": null,
1010
- "reflect": false
1011
- },
1012
- {
1013
- "name": "describedByAttr",
1014
- "fieldName": "describedByAttr",
1015
- "type": "string",
1016
- "attribute": null,
1017
- "reflect": false
87
+ if (event.name === "disabled") syncInputDisabled(host);
88
+ });
89
+ return /* @__PURE__ */ jsxs("div", {
90
+ class: "flex flex-col gap-2",
91
+ part: "wrapper",
92
+ children: [
93
+ /* @__PURE__ */ jsxs("label", {
94
+ class: "text-sm font-medium text-muted-foreground tracking-normal",
95
+ part: "label",
96
+ for: "open-input-control",
97
+ hidden: props.label === "",
98
+ children: [props.label, /* @__PURE__ */ jsx("span", { class: "required-mark" })]
99
+ }),
100
+ /* @__PURE__ */ jsx("input", {
101
+ class: "control w-full px-3 py-2 font-sans text-base text-foreground rounded-md outline-none transition-[border-color,box-shadow] duration-200 ease-out placeholder:text-muted-foreground",
102
+ part: "control",
103
+ id: "open-input-control",
104
+ "data-form-validation": "email",
105
+ type: props.type,
106
+ placeholder: props.placeholder,
107
+ name: props.name,
108
+ disabled: props.disabled,
109
+ required: props.required,
110
+ "aria-invalid": props.error === "" ? null : "true",
111
+ "aria-describedby": props.error === "" ? null : "open-input-error",
112
+ "aria-errormessage": props.error === "" ? null : "open-input-error",
113
+ onInput: (event) => {
114
+ const host = hostOf(event);
115
+ const control = event.target;
116
+ if (lockedByFieldset(event)) {
117
+ syncInputValue(host);
118
+ return;
119
+ }
120
+ host.value = control.value;
121
+ if (host.getAttribute("value") !== control.value) host.setAttribute("value", control.value);
122
+ host.dispatchEvent(new globalThis.CustomEvent("open-input", {
123
+ detail: { value: control.value },
124
+ bubbles: true,
125
+ composed: true
126
+ }));
127
+ },
128
+ onChange: (event) => {
129
+ if (lockedByFieldset(event)) return;
130
+ const control = event.target;
131
+ hostOf(event).dispatchEvent(new globalThis.CustomEvent("open-change", {
132
+ detail: { value: control.value },
133
+ bubbles: true,
134
+ composed: true
135
+ }));
136
+ },
137
+ onFocus: (event) => {
138
+ hostOf(event).dispatchEvent(new globalThis.CustomEvent("open-focus", {
139
+ bubbles: true,
140
+ composed: true
141
+ }));
142
+ },
143
+ onBlur: (event) => {
144
+ hostOf(event).dispatchEvent(new globalThis.CustomEvent("open-blur", {
145
+ bubbles: true,
146
+ composed: true
147
+ }));
1018
148
  }
1019
- ]
1020
- }
1021
- }
1022
- };
1023
- const __compiledProperties = [
1024
- {
1025
- "name": "type",
1026
- "attribute": "type",
1027
- "type": "string",
1028
- "converter": "string",
1029
- "reflect": false,
1030
- "default": "text"
1031
- },
1032
- {
1033
- "name": "placeholder",
1034
- "attribute": "placeholder",
1035
- "type": "string",
1036
- "converter": "string",
1037
- "reflect": false,
1038
- "default": ""
1039
- },
1040
- {
1041
- "name": "label",
1042
- "attribute": "label",
1043
- "type": "string",
1044
- "converter": "string",
1045
- "reflect": false,
1046
- "default": ""
1047
- },
1048
- {
1049
- "name": "name",
1050
- "attribute": "name",
1051
- "type": "string",
1052
- "converter": "string",
1053
- "reflect": false,
1054
- "default": ""
1055
- },
1056
- {
1057
- "name": "value",
1058
- "attribute": "value",
1059
- "type": "string",
1060
- "converter": "string",
1061
- "reflect": false,
1062
- "default": ""
1063
- },
1064
- {
1065
- "name": "disabled",
1066
- "attribute": "disabled",
1067
- "type": "boolean",
1068
- "converter": "boolean",
1069
- "reflect": false,
1070
- "default": false
1071
- },
1072
- {
1073
- "name": "required",
1074
- "attribute": "required",
1075
- "type": "boolean",
1076
- "converter": "boolean",
1077
- "reflect": false,
1078
- "default": false
1079
- },
1080
- {
1081
- "name": "error",
1082
- "attribute": "error",
1083
- "type": "string",
1084
- "converter": "string",
1085
- "reflect": false,
1086
- "default": ""
1087
- },
1088
- {
1089
- "name": "inputId",
1090
- "attribute": null,
1091
- "type": "string",
1092
- "converter": "string",
1093
- "reflect": false,
1094
- "default": ""
1095
- },
1096
- {
1097
- "name": "noLabel",
1098
- "attribute": null,
1099
- "type": "boolean",
1100
- "converter": "boolean",
1101
- "reflect": false,
1102
- "default": null,
1103
- "computed": true,
1104
- "deps": ["label"]
1105
- },
1106
- {
1107
- "name": "noError",
1108
- "attribute": null,
1109
- "type": "boolean",
1110
- "converter": "boolean",
1111
- "reflect": false,
1112
- "default": null,
1113
- "computed": true,
1114
- "deps": ["error"]
1115
- },
1116
- {
1117
- "name": "idAttr",
1118
- "attribute": null,
1119
- "type": "string",
1120
- "converter": "string",
1121
- "reflect": false,
1122
- "default": null,
1123
- "computed": true,
1124
- "deps": ["inputId"]
1125
- },
1126
- {
1127
- "name": "errorIdAttr",
1128
- "attribute": null,
1129
- "type": "string",
1130
- "converter": "string",
1131
- "reflect": false,
1132
- "default": null,
1133
- "computed": true,
1134
- "deps": ["inputId"]
1135
- },
1136
- {
1137
- "name": "ariaInvalidAttr",
1138
- "attribute": null,
1139
- "type": "string",
1140
- "converter": "string",
1141
- "reflect": false,
1142
- "default": null,
1143
- "computed": true,
1144
- "deps": ["error"]
1145
- },
1146
- {
1147
- "name": "requiredMark",
1148
- "attribute": null,
1149
- "type": "string",
1150
- "converter": "string",
1151
- "reflect": false,
1152
- "default": null,
1153
- "computed": true,
1154
- "deps": ["required"]
1155
- },
1156
- {
1157
- "name": "describedByAttr",
1158
- "attribute": null,
1159
- "type": "string",
1160
- "converter": "string",
1161
- "reflect": false,
1162
- "default": null,
1163
- "computed": true,
1164
- "deps": ["error", "inputId"]
1165
- }
1166
- ];
1167
- const __elementMetadata = {
1168
- "tag": "open-input",
1169
- "className": "OpenInput",
1170
- "sourceFile": "open-input.tsx",
1171
- "properties": [
1172
- {
1173
- "name": "type",
1174
- "attribute": "type",
1175
- "type": "string",
1176
- "converter": "string",
1177
- "reflect": false,
1178
- "default": "text"
1179
- },
1180
- {
1181
- "name": "placeholder",
1182
- "attribute": "placeholder",
1183
- "type": "string",
1184
- "converter": "string",
1185
- "reflect": false,
1186
- "default": ""
1187
- },
1188
- {
1189
- "name": "label",
1190
- "attribute": "label",
1191
- "type": "string",
1192
- "converter": "string",
1193
- "reflect": false,
1194
- "default": ""
1195
- },
1196
- {
1197
- "name": "name",
1198
- "attribute": "name",
1199
- "type": "string",
1200
- "converter": "string",
1201
- "reflect": false,
1202
- "default": ""
1203
- },
1204
- {
1205
- "name": "value",
1206
- "attribute": "value",
1207
- "type": "string",
1208
- "converter": "string",
1209
- "reflect": false,
1210
- "default": ""
1211
- },
1212
- {
1213
- "name": "disabled",
1214
- "attribute": "disabled",
1215
- "type": "boolean",
1216
- "converter": "boolean",
1217
- "reflect": false,
1218
- "default": false
1219
- },
1220
- {
1221
- "name": "required",
1222
- "attribute": "required",
1223
- "type": "boolean",
1224
- "converter": "boolean",
1225
- "reflect": false,
1226
- "default": false
1227
- },
1228
- {
1229
- "name": "error",
1230
- "attribute": "error",
1231
- "type": "string",
1232
- "converter": "string",
1233
- "reflect": false,
1234
- "default": ""
1235
- },
1236
- {
1237
- "name": "inputId",
1238
- "attribute": null,
1239
- "type": "string",
1240
- "converter": "string",
1241
- "reflect": false,
1242
- "default": ""
1243
- },
1244
- {
1245
- "name": "noLabel",
1246
- "attribute": null,
1247
- "type": "boolean",
1248
- "converter": "boolean",
1249
- "reflect": false,
1250
- "default": null,
1251
- "computed": true,
1252
- "deps": ["label"]
1253
- },
1254
- {
1255
- "name": "noError",
1256
- "attribute": null,
1257
- "type": "boolean",
1258
- "converter": "boolean",
1259
- "reflect": false,
1260
- "default": null,
1261
- "computed": true,
1262
- "deps": ["error"]
1263
- },
1264
- {
1265
- "name": "idAttr",
1266
- "attribute": null,
1267
- "type": "string",
1268
- "converter": "string",
1269
- "reflect": false,
1270
- "default": null,
1271
- "computed": true,
1272
- "deps": ["inputId"]
1273
- },
1274
- {
1275
- "name": "errorIdAttr",
1276
- "attribute": null,
1277
- "type": "string",
1278
- "converter": "string",
1279
- "reflect": false,
1280
- "default": null,
1281
- "computed": true,
1282
- "deps": ["inputId"]
1283
- },
1284
- {
1285
- "name": "ariaInvalidAttr",
1286
- "attribute": null,
1287
- "type": "string",
1288
- "converter": "string",
1289
- "reflect": false,
1290
- "default": null,
1291
- "computed": true,
1292
- "deps": ["error"]
1293
- },
1294
- {
1295
- "name": "requiredMark",
1296
- "attribute": null,
1297
- "type": "string",
1298
- "converter": "string",
1299
- "reflect": false,
1300
- "default": null,
1301
- "computed": true,
1302
- "deps": ["required"]
1303
- },
1304
- {
1305
- "name": "describedByAttr",
1306
- "attribute": null,
1307
- "type": "string",
1308
- "converter": "string",
1309
- "reflect": false,
1310
- "default": null,
1311
- "computed": true,
1312
- "deps": ["error", "inputId"]
1313
- }
1314
- ],
1315
- "observedAttributes": [
1316
- "type",
1317
- "placeholder",
1318
- "label",
1319
- "name",
1320
- "value",
1321
- "disabled",
1322
- "required",
1323
- "error"
1324
- ],
1325
- "cem": {
1326
- "tagName": "open-input",
1327
- "className": "OpenInput",
1328
- "declaration": {
1329
- "name": "OpenInput",
1330
- "module": "open-input.tsx"
1331
- },
1332
- "attributes": [
1333
- {
1334
- "name": "type",
1335
- "fieldName": "type",
1336
- "type": "string",
1337
- "reflect": false
1338
- },
1339
- {
1340
- "name": "placeholder",
1341
- "fieldName": "placeholder",
1342
- "type": "string",
1343
- "reflect": false
1344
- },
1345
- {
1346
- "name": "label",
1347
- "fieldName": "label",
1348
- "type": "string",
1349
- "reflect": false
1350
- },
1351
- {
1352
- "name": "name",
1353
- "fieldName": "name",
1354
- "type": "string",
1355
- "reflect": false
1356
- },
1357
- {
1358
- "name": "value",
1359
- "fieldName": "value",
1360
- "type": "string",
1361
- "reflect": false
1362
- },
1363
- {
1364
- "name": "disabled",
1365
- "fieldName": "disabled",
1366
- "type": "boolean",
1367
- "reflect": false
1368
- },
1369
- {
1370
- "name": "required",
1371
- "fieldName": "required",
1372
- "type": "boolean",
1373
- "reflect": false
1374
- },
1375
- {
1376
- "name": "error",
1377
- "fieldName": "error",
1378
- "type": "string",
1379
- "reflect": false
1380
- }
1381
- ],
1382
- "members": [
1383
- {
1384
- "name": "type",
1385
- "fieldName": "type",
1386
- "type": "string",
1387
- "attribute": "type",
1388
- "reflect": false
1389
- },
1390
- {
1391
- "name": "placeholder",
1392
- "fieldName": "placeholder",
1393
- "type": "string",
1394
- "attribute": "placeholder",
1395
- "reflect": false
1396
- },
1397
- {
1398
- "name": "label",
1399
- "fieldName": "label",
1400
- "type": "string",
1401
- "attribute": "label",
1402
- "reflect": false
1403
- },
1404
- {
1405
- "name": "name",
1406
- "fieldName": "name",
1407
- "type": "string",
1408
- "attribute": "name",
1409
- "reflect": false
1410
- },
1411
- {
1412
- "name": "value",
1413
- "fieldName": "value",
1414
- "type": "string",
1415
- "attribute": "value",
1416
- "reflect": false
1417
- },
1418
- {
1419
- "name": "disabled",
1420
- "fieldName": "disabled",
1421
- "type": "boolean",
1422
- "attribute": "disabled",
1423
- "reflect": false
1424
- },
1425
- {
1426
- "name": "required",
1427
- "fieldName": "required",
1428
- "type": "boolean",
1429
- "attribute": "required",
1430
- "reflect": false
1431
- },
1432
- {
1433
- "name": "error",
1434
- "fieldName": "error",
1435
- "type": "string",
1436
- "attribute": "error",
1437
- "reflect": false
1438
- },
1439
- {
1440
- "name": "inputId",
1441
- "fieldName": "inputId",
1442
- "type": "string",
1443
- "attribute": null,
1444
- "reflect": false
1445
- },
1446
- {
1447
- "name": "noLabel",
1448
- "fieldName": "noLabel",
1449
- "type": "boolean",
1450
- "attribute": null,
1451
- "reflect": false
1452
- },
1453
- {
1454
- "name": "noError",
1455
- "fieldName": "noError",
1456
- "type": "boolean",
1457
- "attribute": null,
1458
- "reflect": false
1459
- },
1460
- {
1461
- "name": "idAttr",
1462
- "fieldName": "idAttr",
1463
- "type": "string",
1464
- "attribute": null,
1465
- "reflect": false
1466
- },
1467
- {
1468
- "name": "errorIdAttr",
1469
- "fieldName": "errorIdAttr",
1470
- "type": "string",
1471
- "attribute": null,
1472
- "reflect": false
1473
- },
1474
- {
1475
- "name": "ariaInvalidAttr",
1476
- "fieldName": "ariaInvalidAttr",
1477
- "type": "string",
1478
- "attribute": null,
1479
- "reflect": false
1480
- },
1481
- {
1482
- "name": "requiredMark",
1483
- "fieldName": "requiredMark",
1484
- "type": "string",
1485
- "attribute": null,
1486
- "reflect": false
1487
- },
1488
- {
1489
- "name": "describedByAttr",
1490
- "fieldName": "describedByAttr",
1491
- "type": "string",
1492
- "attribute": null,
1493
- "reflect": false
1494
- }
149
+ }),
150
+ /* @__PURE__ */ jsx("small", {
151
+ id: "open-input-error",
152
+ role: "alert",
153
+ class: "text-xs text-destructive",
154
+ part: "error",
155
+ hidden: props.error === "",
156
+ children: props.error
157
+ })
1495
158
  ]
1496
- }
1497
- };
1498
- const __observedAttributes = [
1499
- "type",
1500
- "placeholder",
1501
- "label",
1502
- "name",
1503
- "value",
1504
- "disabled",
1505
- "required",
1506
- "error"
1507
- ];
1508
- const __compiledProps = {
1509
- type: {
1510
- type: String,
1511
- default: "text",
1512
- reflect: false,
1513
- attribute: "type"
1514
- },
1515
- placeholder: {
1516
- type: String,
1517
- default: "",
1518
- reflect: false,
1519
- attribute: "placeholder"
1520
- },
1521
- label: {
1522
- type: String,
1523
- default: "",
1524
- reflect: false,
1525
- attribute: "label"
1526
- },
1527
- name: {
1528
- type: String,
1529
- default: "",
1530
- reflect: false,
1531
- attribute: "name"
1532
- },
1533
- value: {
1534
- type: String,
1535
- default: "",
1536
- reflect: false,
1537
- attribute: "value"
1538
- },
1539
- disabled: {
1540
- type: Boolean,
1541
- default: false,
1542
- reflect: false,
1543
- attribute: "disabled"
1544
- },
1545
- required: {
1546
- type: Boolean,
1547
- default: false,
1548
- reflect: false,
1549
- attribute: "required"
1550
- },
1551
- error: {
1552
- type: String,
1553
- default: "",
1554
- reflect: false,
1555
- attribute: "error"
1556
- },
1557
- inputId: {
1558
- type: String,
1559
- default: "",
1560
- reflect: false,
1561
- attribute: false
1562
- },
1563
- noLabel: {
1564
- type: Object,
1565
- default: void 0,
1566
- reflect: false,
1567
- attribute: false
1568
- },
1569
- noError: {
1570
- type: Object,
1571
- default: void 0,
1572
- reflect: false,
1573
- attribute: false
1574
- },
1575
- idAttr: {
1576
- type: Object,
1577
- default: void 0,
1578
- reflect: false,
1579
- attribute: false
1580
- },
1581
- errorIdAttr: {
1582
- type: Object,
1583
- default: void 0,
1584
- reflect: false,
1585
- attribute: false
1586
- },
1587
- ariaInvalidAttr: {
1588
- type: Object,
1589
- default: void 0,
1590
- reflect: false,
1591
- attribute: false
1592
- },
1593
- requiredMark: {
1594
- type: Object,
1595
- default: void 0,
1596
- reflect: false,
1597
- attribute: false
1598
- },
1599
- describedByAttr: {
1600
- type: Object,
1601
- default: void 0,
1602
- reflect: false,
1603
- attribute: false
1604
- }
1605
- };
1606
- var OpenInput = class extends OpenElement {
1607
- static __partProgram = __partProgram;
1608
- static __compiledProperties = __compiledProperties;
1609
- static __elementMetadata = __elementMetadata;
1610
- static props = __compiledProps;
1611
- static observedAttributes = __observedAttributes;
1612
- static delegatesFocus = true;
1613
- static formAssociated = true;
1614
- static __oeUtilityClasses = true;
1615
- static __oeClassCandidates = [
1616
- "flex",
1617
- "flex-col",
1618
- "gap-2",
1619
- "text-sm",
1620
- "font-medium",
1621
- "text-muted-foreground",
1622
- "tracking-normal",
1623
- "control",
1624
- "w-full",
1625
- "px-3",
1626
- "py-2",
1627
- "font-sans",
1628
- "text-base",
1629
- "text-foreground",
1630
- "rounded-md",
1631
- "outline-none",
1632
- "transition-[border-color,box-shadow]",
1633
- "duration-200",
1634
- "ease-out",
1635
- "placeholder:text-muted-foreground",
1636
- "text-xs",
1637
- "text-destructive"
1638
- ];
1639
- static __computedFields = {
1640
- noLabel: (__s) => computed(() => __s.label.value === ""),
1641
- noError: (__s) => computed(() => __s.error.value === ""),
1642
- idAttr: (__s) => computed(() => __s.inputId.value === "" ? null : __s.inputId.value),
1643
- errorIdAttr: (__s) => computed(() => __s.inputId.value === "" ? null : `${__s.inputId.value}-error`),
1644
- ariaInvalidAttr: (__s) => computed(() => __s.error.value === "" ? null : "true"),
1645
- requiredMark: (__s) => computed(() => __s.required.value ? " *" : ""),
1646
- describedByAttr: (__s) => computed(() => __s.error.value === "" || __s.inputId.value === "" ? null : `${__s.inputId.value}-error`)
1647
- };
1648
- static styles = [openInputStyles];
1649
- type = "text";
1650
- placeholder = "";
1651
- label = "";
1652
- name = "";
1653
- value = "";
1654
- disabled = false;
1655
- required = false;
1656
- error = "";
1657
- inputId = "";
1658
- onDsdHydrated() {
1659
- this.activate();
1660
- }
1661
- onCsrRendered() {
1662
- this.activate();
1663
- }
1664
- activate() {
1665
- if (this.inputId === "") this.inputId = `input-${nextInstanceId()}`;
1666
- this.syncFormValue();
1667
- this.syncValidity();
1668
- this.updateStates();
1669
- }
1670
- attributeChangedCallback(name, old, val) {
1671
- try {
1672
- super.attributeChangedCallback(name, old, val);
1673
- if (old === val) return;
1674
- if (name === "value") {
1675
- this.syncFormValue();
1676
- this.syncValidity();
1677
- return;
1678
- }
1679
- if (name === "disabled" || name === "error") this.updateStates();
1680
- if (name === "required") this.syncValidity();
1681
- } catch (error) {
1682
- if (!this._captureError(error)) throw error;
1683
- }
1684
- }
1685
- updateStates() {
1686
- if (!this._internals?.states) return;
1687
- syncDisabledState(this._internals, this.disabled);
1688
- if (this.error !== "") this._internals.states.add("invalid");
1689
- else this._internals.states.delete("invalid");
1690
- }
1691
- syncFormValue() {
1692
- this._internals?.setFormValue(this.value);
1693
- }
1694
- syncValidity() {
1695
- const internals = this._internals;
1696
- if (!internals || typeof internals.setValidity !== "function") return;
1697
- if (this.required && this.value === "") {
1698
- const inner = this.shadowRoot?.querySelector("input");
1699
- internals.setValidity({ valueMissing: true }, inner?.validationMessage || "Please fill out this field.");
1700
- } else internals.setValidity({});
1701
- }
1702
- handleInput(e) {
1703
- const input = e.target;
1704
- this.setAttribute("value", input.value);
1705
- this.syncFormValue();
1706
- this.syncValidity();
1707
- this.dispatchEvent(new CustomEvent("open-input", {
1708
- detail: { value: input.value },
1709
- bubbles: true,
1710
- composed: true
1711
- }));
1712
- }
1713
- handleChange(e) {
1714
- const input = e.target;
1715
- this.dispatchEvent(new CustomEvent("open-change", {
1716
- detail: { value: input.value },
1717
- bubbles: true,
1718
- composed: true
1719
- }));
1720
- }
1721
- handleFocus() {
1722
- this.dispatchEvent(new CustomEvent("open-focus", {
1723
- bubbles: true,
1724
- composed: true
1725
- }));
1726
- }
1727
- handleBlur() {
1728
- this.dispatchEvent(new CustomEvent("open-blur", {
1729
- bubbles: true,
1730
- composed: true
1731
- }));
1732
- }
1733
- formResetCallback() {
1734
- try {
1735
- super.formResetCallback();
1736
- this.setAttribute("value", "");
1737
- this.removeAttribute("error");
1738
- this.syncFormValue();
1739
- this.syncValidity();
1740
- } catch (error) {
1741
- if (!this._captureError(error)) throw error;
1742
- }
1743
- }
1744
- formDisabledCallback(disabled) {
1745
- this.disabled = disabled;
1746
- this.updateStates();
1747
- }
1748
- render() {
1749
- throw new Error("[open:compiled-element] open-input is compiled to a Part Program; the runtime JSX render path is not available.");
1750
- }
1751
- };
159
+ });
160
+ }
1752
161
  //#endregion
1753
- export { OpenInput, __elementMetadata, __partProgram };
162
+ export { OpenInput as default, openElement };
163
+
164
+ export { OpenInputElement, OpenInput__ssrHost } from './open-input.generated.js';
165
+
166
+ // openElement:class-candidates ["control","duration-200","ease-out","flex","flex-col","font-medium","font-sans","gap-2","outline-none","placeholder:text-muted-foreground","px-3","py-2","required-mark","rounded-md","text-base","text-destructive","text-foreground","text-muted-foreground","text-sm","text-xs","tracking-normal","transition-[border-color,box-shadow]","w-full"]