@openelement/ui 1.0.0-alpha.5 → 1.0.0-alpha.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,706 +1,557 @@
1
- // <auto-generated by open:compiled-element; v0.44.0-alpha.1 - do not edit>
2
- import { effect, OpenElement } from '@openelement/element';
3
- import { overlayRecipe, recipe } from './component-recipes.js';
4
- import { readInstanceState, writeInstanceState } from './instance-state.js';
1
+ import { readInstanceState, writeInstanceState } from "./instance-state.js";
2
+ import { overlayRecipe, recipe } from "./component-recipes.js";
3
+ import { OpenElement, effect } from "@openelement/element";
4
+ //#region src/open-dialog.tsx
5
5
  const __partProgram = {
6
- "version": 1,
7
- "tag": "open-dialog",
8
- "root": {
9
- "id": "root",
10
- "kind": "shadow-open",
11
- "nodes": [
12
- "e0"
13
- ]
14
- },
15
- "template": [
16
- {
17
- "k": "el",
18
- "id": "e0",
19
- "tag": "div",
20
- "attrs": [
21
- [
22
- "style",
23
- "display:contents"
24
- ]
25
- ],
26
- "children": [
27
- {
28
- "k": "el",
29
- "id": "e1",
30
- "tag": "slot",
31
- "attrs": [
32
- [
33
- "name",
34
- "trigger"
35
- ]
36
- ],
37
- "children": []
38
- },
39
- {
40
- "k": "el",
41
- "id": "e2",
42
- "tag": "dialog",
43
- "attrs": [
44
- [
45
- "part",
46
- "overlay"
47
- ]
48
- ],
49
- "children": [
50
- {
51
- "k": "el",
52
- "id": "e3",
53
- "tag": "div",
54
- "attrs": [
55
- [
56
- "class",
57
- "dialog-header"
58
- ],
59
- [
60
- "part",
61
- "header"
62
- ]
63
- ],
64
- "children": [
65
- {
66
- "k": "el",
67
- "id": "e4",
68
- "tag": "h2",
69
- "attrs": [
70
- [
71
- "class",
72
- "dialog-title"
73
- ]
74
- ],
75
- "children": [
76
- {
77
- "k": "part",
78
- "id": "p5",
79
- "index": 5
80
- }
81
- ]
82
- },
83
- {
84
- "k": "el",
85
- "id": "e5",
86
- "tag": "button",
87
- "attrs": [
88
- [
89
- "type",
90
- "button"
91
- ],
92
- [
93
- "class",
94
- "dialog-close"
95
- ],
96
- [
97
- "part",
98
- "close"
99
- ],
100
- [
101
- "aria-label",
102
- "Close"
103
- ]
104
- ],
105
- "children": [
106
- {
107
- "k": "text",
108
- "value": "× "
109
- }
110
- ]
111
- }
112
- ]
113
- },
114
- {
115
- "k": "el",
116
- "id": "e6",
117
- "tag": "div",
118
- "attrs": [
119
- [
120
- "class",
121
- "dialog-body"
122
- ],
123
- [
124
- "part",
125
- "body"
126
- ]
127
- ],
128
- "children": [
129
- {
130
- "k": "el",
131
- "id": "e7",
132
- "tag": "slot",
133
- "attrs": [],
134
- "children": []
135
- }
136
- ]
137
- },
138
- {
139
- "k": "el",
140
- "id": "e8",
141
- "tag": "div",
142
- "attrs": [
143
- [
144
- "class",
145
- "dialog-footer"
146
- ],
147
- [
148
- "part",
149
- "footer"
150
- ]
151
- ],
152
- "children": [
153
- {
154
- "k": "el",
155
- "id": "e9",
156
- "tag": "slot",
157
- "attrs": [
158
- [
159
- "name",
160
- "footer"
161
- ]
162
- ],
163
- "children": []
164
- }
165
- ]
166
- }
167
- ]
168
- }
169
- ]
170
- }
171
- ],
172
- "parts": [
173
- {
174
- "k": "event",
175
- "event": "click",
176
- "handler": "handleTrigger",
177
- "action": {
178
- "kind": "method",
179
- "name": "handleTrigger"
180
- },
181
- "path": [
182
- 0,
183
- 0
184
- ],
185
- "index": 0,
186
- "location": {
187
- "id": "p0",
188
- "kind": "sink",
189
- "path": [
190
- 0,
191
- 0
192
- ],
193
- "node": "e1"
194
- }
195
- },
196
- {
197
- "k": "bool",
198
- "signal": "open",
199
- "name": "open",
200
- "path": [
201
- 0,
202
- 1
203
- ],
204
- "index": 1,
205
- "location": {
206
- "id": "p1",
207
- "kind": "sink",
208
- "path": [
209
- 0,
210
- 1
211
- ],
212
- "node": "e2"
213
- }
214
- },
215
- {
216
- "k": "attr",
217
- "signal": "label",
218
- "name": "aria-label",
219
- "path": [
220
- 0,
221
- 1
222
- ],
223
- "index": 2,
224
- "location": {
225
- "id": "p2",
226
- "kind": "sink",
227
- "path": [
228
- 0,
229
- 1
230
- ],
231
- "node": "e2"
232
- }
233
- },
234
- {
235
- "k": "event",
236
- "event": "cancel",
237
- "handler": "handleCancel",
238
- "action": {
239
- "kind": "method",
240
- "name": "handleCancel"
241
- },
242
- "path": [
243
- 0,
244
- 1
245
- ],
246
- "index": 3,
247
- "location": {
248
- "id": "p3",
249
- "kind": "sink",
250
- "path": [
251
- 0,
252
- 1
253
- ],
254
- "node": "e2"
255
- }
256
- },
257
- {
258
- "k": "event",
259
- "event": "close",
260
- "handler": "handleNativeClose",
261
- "action": {
262
- "kind": "method",
263
- "name": "handleNativeClose"
264
- },
265
- "path": [
266
- 0,
267
- 1
268
- ],
269
- "index": 4,
270
- "location": {
271
- "id": "p4",
272
- "kind": "sink",
273
- "path": [
274
- 0,
275
- 1
276
- ],
277
- "node": "e2"
278
- }
279
- },
280
- {
281
- "k": "text",
282
- "signal": "label",
283
- "index": 5,
284
- "location": {
285
- "id": "p5",
286
- "kind": "anchor",
287
- "path": [
288
- 0,
289
- 1,
290
- 0,
291
- 0,
292
- 0
293
- ]
294
- }
295
- },
296
- {
297
- "k": "event",
298
- "event": "click",
299
- "handler": "handleClose",
300
- "action": {
301
- "kind": "method",
302
- "name": "handleClose"
303
- },
304
- "path": [
305
- 0,
306
- 1,
307
- 0,
308
- 1
309
- ],
310
- "index": 6,
311
- "location": {
312
- "id": "p6",
313
- "kind": "sink",
314
- "path": [
315
- 0,
316
- 1,
317
- 0,
318
- 1
319
- ],
320
- "node": "e5"
321
- }
322
- }
323
- ],
324
- "regions": [],
325
- "dependencies": [
326
- {
327
- "signal": "open",
328
- "owner": {
329
- "kind": "part",
330
- "index": 1
331
- },
332
- "location": "p1"
333
- },
334
- {
335
- "signal": "label",
336
- "owner": {
337
- "kind": "part",
338
- "index": 2
339
- },
340
- "location": "p2"
341
- },
342
- {
343
- "signal": "label",
344
- "owner": {
345
- "kind": "part",
346
- "index": 5
347
- },
348
- "location": "p5"
349
- }
350
- ],
351
- "locations": [
352
- {
353
- "id": "e0",
354
- "kind": "element",
355
- "tag": "div",
356
- "path": [
357
- 0
358
- ]
359
- },
360
- {
361
- "id": "e1",
362
- "kind": "element",
363
- "tag": "slot",
364
- "path": [
365
- 0,
366
- 0
367
- ]
368
- },
369
- {
370
- "id": "p0",
371
- "kind": "sink",
372
- "part": 0,
373
- "node": "e1",
374
- "path": [
375
- 0,
376
- 0
377
- ]
378
- },
379
- {
380
- "id": "e2",
381
- "kind": "element",
382
- "tag": "dialog",
383
- "path": [
384
- 0,
385
- 1
386
- ]
387
- },
388
- {
389
- "id": "p1",
390
- "kind": "sink",
391
- "part": 1,
392
- "node": "e2",
393
- "path": [
394
- 0,
395
- 1
396
- ]
397
- },
398
- {
399
- "id": "p2",
400
- "kind": "sink",
401
- "part": 2,
402
- "node": "e2",
403
- "path": [
404
- 0,
405
- 1
406
- ]
407
- },
408
- {
409
- "id": "p3",
410
- "kind": "sink",
411
- "part": 3,
412
- "node": "e2",
413
- "path": [
414
- 0,
415
- 1
416
- ]
417
- },
418
- {
419
- "id": "p4",
420
- "kind": "sink",
421
- "part": 4,
422
- "node": "e2",
423
- "path": [
424
- 0,
425
- 1
426
- ]
427
- },
428
- {
429
- "id": "e3",
430
- "kind": "element",
431
- "tag": "div",
432
- "path": [
433
- 0,
434
- 1,
435
- 0
436
- ]
437
- },
438
- {
439
- "id": "e4",
440
- "kind": "element",
441
- "tag": "h2",
442
- "path": [
443
- 0,
444
- 1,
445
- 0,
446
- 0
447
- ]
448
- },
449
- {
450
- "id": "p5",
451
- "kind": "anchor",
452
- "part": 5,
453
- "path": [
454
- 0,
455
- 1,
456
- 0,
457
- 0,
458
- 0
459
- ]
460
- },
461
- {
462
- "id": "e5",
463
- "kind": "element",
464
- "tag": "button",
465
- "path": [
466
- 0,
467
- 1,
468
- 0,
469
- 1
470
- ]
471
- },
472
- {
473
- "id": "p6",
474
- "kind": "sink",
475
- "part": 6,
476
- "node": "e5",
477
- "path": [
478
- 0,
479
- 1,
480
- 0,
481
- 1
482
- ]
483
- },
484
- {
485
- "id": "e6",
486
- "kind": "element",
487
- "tag": "div",
488
- "path": [
489
- 0,
490
- 1,
491
- 1
492
- ]
493
- },
494
- {
495
- "id": "e7",
496
- "kind": "element",
497
- "tag": "slot",
498
- "path": [
499
- 0,
500
- 1,
501
- 1,
502
- 0
503
- ]
504
- },
505
- {
506
- "id": "e8",
507
- "kind": "element",
508
- "tag": "div",
509
- "path": [
510
- 0,
511
- 1,
512
- 2
513
- ]
514
- },
515
- {
516
- "id": "e9",
517
- "kind": "element",
518
- "tag": "slot",
519
- "path": [
520
- 0,
521
- 1,
522
- 2,
523
- 0
524
- ]
525
- }
526
- ],
527
- "metadata": {
528
- "tag": "open-dialog",
529
- "className": "OpenDialog",
530
- "sourceFile": "open-dialog.tsx",
531
- "properties": [
532
- {
533
- "name": "open",
534
- "attribute": "open",
535
- "type": "boolean",
536
- "converter": "boolean",
537
- "reflect": true,
538
- "default": false
539
- },
540
- {
541
- "name": "label",
542
- "attribute": "label",
543
- "type": "string",
544
- "converter": "string",
545
- "reflect": false,
546
- "default": ""
547
- }
548
- ],
549
- "observedAttributes": [
550
- "open",
551
- "label"
552
- ],
553
- "cem": {
554
- "tagName": "open-dialog",
555
- "className": "OpenDialog",
556
- "declaration": {
557
- "name": "OpenDialog",
558
- "module": "open-dialog.tsx"
559
- },
560
- "attributes": [
561
- {
562
- "name": "open",
563
- "fieldName": "open",
564
- "type": "boolean",
565
- "reflect": true
566
- },
567
- {
568
- "name": "label",
569
- "fieldName": "label",
570
- "type": "string",
571
- "reflect": false
572
- }
573
- ],
574
- "members": [
575
- {
576
- "name": "open",
577
- "fieldName": "open",
578
- "type": "boolean",
579
- "attribute": "open",
580
- "reflect": true
581
- },
582
- {
583
- "name": "label",
584
- "fieldName": "label",
585
- "type": "string",
586
- "attribute": "label",
587
- "reflect": false
588
- }
589
- ]
590
- }
591
- }
6
+ "version": 1,
7
+ "tag": "open-dialog",
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": [["style", "display:contents"]],
18
+ "children": [{
19
+ "k": "el",
20
+ "id": "e1",
21
+ "tag": "slot",
22
+ "attrs": [["name", "trigger"]],
23
+ "children": []
24
+ }, {
25
+ "k": "el",
26
+ "id": "e2",
27
+ "tag": "dialog",
28
+ "attrs": [["part", "overlay"]],
29
+ "children": [
30
+ {
31
+ "k": "el",
32
+ "id": "e3",
33
+ "tag": "div",
34
+ "attrs": [["class", "dialog-header"], ["part", "header"]],
35
+ "children": [{
36
+ "k": "el",
37
+ "id": "e4",
38
+ "tag": "h2",
39
+ "attrs": [["class", "dialog-title"]],
40
+ "children": [{
41
+ "k": "part",
42
+ "id": "p5",
43
+ "index": 5
44
+ }]
45
+ }, {
46
+ "k": "el",
47
+ "id": "e5",
48
+ "tag": "button",
49
+ "attrs": [
50
+ ["type", "button"],
51
+ ["class", "dialog-close"],
52
+ ["part", "close"],
53
+ ["aria-label", "Close"]
54
+ ],
55
+ "children": [{
56
+ "k": "text",
57
+ "value": "×"
58
+ }]
59
+ }]
60
+ },
61
+ {
62
+ "k": "el",
63
+ "id": "e6",
64
+ "tag": "div",
65
+ "attrs": [["class", "dialog-body"], ["part", "body"]],
66
+ "children": [{
67
+ "k": "el",
68
+ "id": "e7",
69
+ "tag": "slot",
70
+ "attrs": [],
71
+ "children": []
72
+ }]
73
+ },
74
+ {
75
+ "k": "el",
76
+ "id": "e8",
77
+ "tag": "div",
78
+ "attrs": [["class", "dialog-footer"], ["part", "footer"]],
79
+ "children": [{
80
+ "k": "el",
81
+ "id": "e9",
82
+ "tag": "slot",
83
+ "attrs": [["name", "footer"]],
84
+ "children": []
85
+ }]
86
+ }
87
+ ]
88
+ }]
89
+ }],
90
+ "parts": [
91
+ {
92
+ "k": "event",
93
+ "event": "click",
94
+ "handler": "handleTrigger",
95
+ "action": {
96
+ "kind": "method",
97
+ "name": "handleTrigger"
98
+ },
99
+ "path": [0, 0],
100
+ "index": 0,
101
+ "location": {
102
+ "id": "p0",
103
+ "kind": "sink",
104
+ "path": [0, 0],
105
+ "node": "e1"
106
+ }
107
+ },
108
+ {
109
+ "k": "bool",
110
+ "signal": "open",
111
+ "name": "open",
112
+ "path": [0, 1],
113
+ "index": 1,
114
+ "location": {
115
+ "id": "p1",
116
+ "kind": "sink",
117
+ "path": [0, 1],
118
+ "node": "e2"
119
+ }
120
+ },
121
+ {
122
+ "k": "attr",
123
+ "signal": "label",
124
+ "name": "aria-label",
125
+ "path": [0, 1],
126
+ "index": 2,
127
+ "location": {
128
+ "id": "p2",
129
+ "kind": "sink",
130
+ "path": [0, 1],
131
+ "node": "e2"
132
+ }
133
+ },
134
+ {
135
+ "k": "event",
136
+ "event": "cancel",
137
+ "handler": "handleCancel",
138
+ "action": {
139
+ "kind": "method",
140
+ "name": "handleCancel"
141
+ },
142
+ "path": [0, 1],
143
+ "index": 3,
144
+ "location": {
145
+ "id": "p3",
146
+ "kind": "sink",
147
+ "path": [0, 1],
148
+ "node": "e2"
149
+ }
150
+ },
151
+ {
152
+ "k": "event",
153
+ "event": "close",
154
+ "handler": "handleNativeClose",
155
+ "action": {
156
+ "kind": "method",
157
+ "name": "handleNativeClose"
158
+ },
159
+ "path": [0, 1],
160
+ "index": 4,
161
+ "location": {
162
+ "id": "p4",
163
+ "kind": "sink",
164
+ "path": [0, 1],
165
+ "node": "e2"
166
+ }
167
+ },
168
+ {
169
+ "k": "text",
170
+ "signal": "label",
171
+ "index": 5,
172
+ "location": {
173
+ "id": "p5",
174
+ "kind": "anchor",
175
+ "path": [
176
+ 0,
177
+ 1,
178
+ 0,
179
+ 0,
180
+ 0
181
+ ]
182
+ }
183
+ },
184
+ {
185
+ "k": "event",
186
+ "event": "click",
187
+ "handler": "handleClose",
188
+ "action": {
189
+ "kind": "method",
190
+ "name": "handleClose"
191
+ },
192
+ "path": [
193
+ 0,
194
+ 1,
195
+ 0,
196
+ 1
197
+ ],
198
+ "index": 6,
199
+ "location": {
200
+ "id": "p6",
201
+ "kind": "sink",
202
+ "path": [
203
+ 0,
204
+ 1,
205
+ 0,
206
+ 1
207
+ ],
208
+ "node": "e5"
209
+ }
210
+ }
211
+ ],
212
+ "regions": [],
213
+ "dependencies": [
214
+ {
215
+ "signal": "open",
216
+ "owner": {
217
+ "kind": "part",
218
+ "index": 1
219
+ },
220
+ "location": "p1"
221
+ },
222
+ {
223
+ "signal": "label",
224
+ "owner": {
225
+ "kind": "part",
226
+ "index": 2
227
+ },
228
+ "location": "p2"
229
+ },
230
+ {
231
+ "signal": "label",
232
+ "owner": {
233
+ "kind": "part",
234
+ "index": 5
235
+ },
236
+ "location": "p5"
237
+ }
238
+ ],
239
+ "locations": [
240
+ {
241
+ "id": "e0",
242
+ "kind": "element",
243
+ "tag": "div",
244
+ "path": [0]
245
+ },
246
+ {
247
+ "id": "e1",
248
+ "kind": "element",
249
+ "tag": "slot",
250
+ "path": [0, 0]
251
+ },
252
+ {
253
+ "id": "p0",
254
+ "kind": "sink",
255
+ "part": 0,
256
+ "node": "e1",
257
+ "path": [0, 0]
258
+ },
259
+ {
260
+ "id": "e2",
261
+ "kind": "element",
262
+ "tag": "dialog",
263
+ "path": [0, 1]
264
+ },
265
+ {
266
+ "id": "p1",
267
+ "kind": "sink",
268
+ "part": 1,
269
+ "node": "e2",
270
+ "path": [0, 1]
271
+ },
272
+ {
273
+ "id": "p2",
274
+ "kind": "sink",
275
+ "part": 2,
276
+ "node": "e2",
277
+ "path": [0, 1]
278
+ },
279
+ {
280
+ "id": "p3",
281
+ "kind": "sink",
282
+ "part": 3,
283
+ "node": "e2",
284
+ "path": [0, 1]
285
+ },
286
+ {
287
+ "id": "p4",
288
+ "kind": "sink",
289
+ "part": 4,
290
+ "node": "e2",
291
+ "path": [0, 1]
292
+ },
293
+ {
294
+ "id": "e3",
295
+ "kind": "element",
296
+ "tag": "div",
297
+ "path": [
298
+ 0,
299
+ 1,
300
+ 0
301
+ ]
302
+ },
303
+ {
304
+ "id": "e4",
305
+ "kind": "element",
306
+ "tag": "h2",
307
+ "path": [
308
+ 0,
309
+ 1,
310
+ 0,
311
+ 0
312
+ ]
313
+ },
314
+ {
315
+ "id": "p5",
316
+ "kind": "anchor",
317
+ "part": 5,
318
+ "path": [
319
+ 0,
320
+ 1,
321
+ 0,
322
+ 0,
323
+ 0
324
+ ]
325
+ },
326
+ {
327
+ "id": "e5",
328
+ "kind": "element",
329
+ "tag": "button",
330
+ "path": [
331
+ 0,
332
+ 1,
333
+ 0,
334
+ 1
335
+ ]
336
+ },
337
+ {
338
+ "id": "p6",
339
+ "kind": "sink",
340
+ "part": 6,
341
+ "node": "e5",
342
+ "path": [
343
+ 0,
344
+ 1,
345
+ 0,
346
+ 1
347
+ ]
348
+ },
349
+ {
350
+ "id": "e6",
351
+ "kind": "element",
352
+ "tag": "div",
353
+ "path": [
354
+ 0,
355
+ 1,
356
+ 1
357
+ ]
358
+ },
359
+ {
360
+ "id": "e7",
361
+ "kind": "element",
362
+ "tag": "slot",
363
+ "path": [
364
+ 0,
365
+ 1,
366
+ 1,
367
+ 0
368
+ ]
369
+ },
370
+ {
371
+ "id": "e8",
372
+ "kind": "element",
373
+ "tag": "div",
374
+ "path": [
375
+ 0,
376
+ 1,
377
+ 2
378
+ ]
379
+ },
380
+ {
381
+ "id": "e9",
382
+ "kind": "element",
383
+ "tag": "slot",
384
+ "path": [
385
+ 0,
386
+ 1,
387
+ 2,
388
+ 0
389
+ ]
390
+ }
391
+ ],
392
+ "metadata": {
393
+ "tag": "open-dialog",
394
+ "className": "OpenDialog",
395
+ "sourceFile": "open-dialog.tsx",
396
+ "properties": [{
397
+ "name": "open",
398
+ "attribute": "open",
399
+ "type": "boolean",
400
+ "converter": "boolean",
401
+ "reflect": true,
402
+ "default": false
403
+ }, {
404
+ "name": "label",
405
+ "attribute": "label",
406
+ "type": "string",
407
+ "converter": "string",
408
+ "reflect": false,
409
+ "default": ""
410
+ }],
411
+ "observedAttributes": ["open", "label"],
412
+ "cem": {
413
+ "tagName": "open-dialog",
414
+ "className": "OpenDialog",
415
+ "declaration": {
416
+ "name": "OpenDialog",
417
+ "module": "open-dialog.tsx"
418
+ },
419
+ "attributes": [{
420
+ "name": "open",
421
+ "fieldName": "open",
422
+ "type": "boolean",
423
+ "reflect": true
424
+ }, {
425
+ "name": "label",
426
+ "fieldName": "label",
427
+ "type": "string",
428
+ "reflect": false
429
+ }],
430
+ "members": [{
431
+ "name": "open",
432
+ "fieldName": "open",
433
+ "type": "boolean",
434
+ "attribute": "open",
435
+ "reflect": true
436
+ }, {
437
+ "name": "label",
438
+ "fieldName": "label",
439
+ "type": "string",
440
+ "attribute": "label",
441
+ "reflect": false
442
+ }]
443
+ }
444
+ }
592
445
  };
593
- const __compiledProperties = [
594
- {
595
- "name": "open",
596
- "attribute": "open",
597
- "type": "boolean",
598
- "converter": "boolean",
599
- "reflect": true,
600
- "default": false
601
- },
602
- {
603
- "name": "label",
604
- "attribute": "label",
605
- "type": "string",
606
- "converter": "string",
607
- "reflect": false,
608
- "default": ""
609
- }
610
- ];
446
+ const __compiledProperties = [{
447
+ "name": "open",
448
+ "attribute": "open",
449
+ "type": "boolean",
450
+ "converter": "boolean",
451
+ "reflect": true,
452
+ "default": false
453
+ }, {
454
+ "name": "label",
455
+ "attribute": "label",
456
+ "type": "string",
457
+ "converter": "string",
458
+ "reflect": false,
459
+ "default": ""
460
+ }];
611
461
  const __elementMetadata = {
612
- "tag": "open-dialog",
613
- "className": "OpenDialog",
614
- "sourceFile": "open-dialog.tsx",
615
- "properties": [
616
- {
617
- "name": "open",
618
- "attribute": "open",
619
- "type": "boolean",
620
- "converter": "boolean",
621
- "reflect": true,
622
- "default": false
623
- },
624
- {
625
- "name": "label",
626
- "attribute": "label",
627
- "type": "string",
628
- "converter": "string",
629
- "reflect": false,
630
- "default": ""
631
- }
632
- ],
633
- "observedAttributes": [
634
- "open",
635
- "label"
636
- ],
637
- "cem": {
638
- "tagName": "open-dialog",
639
- "className": "OpenDialog",
640
- "declaration": {
641
- "name": "OpenDialog",
642
- "module": "open-dialog.tsx"
643
- },
644
- "attributes": [
645
- {
646
- "name": "open",
647
- "fieldName": "open",
648
- "type": "boolean",
649
- "reflect": true
650
- },
651
- {
652
- "name": "label",
653
- "fieldName": "label",
654
- "type": "string",
655
- "reflect": false
656
- }
657
- ],
658
- "members": [
659
- {
660
- "name": "open",
661
- "fieldName": "open",
662
- "type": "boolean",
663
- "attribute": "open",
664
- "reflect": true
665
- },
666
- {
667
- "name": "label",
668
- "fieldName": "label",
669
- "type": "string",
670
- "attribute": "label",
671
- "reflect": false
672
- }
673
- ]
674
- }
462
+ "tag": "open-dialog",
463
+ "className": "OpenDialog",
464
+ "sourceFile": "open-dialog.tsx",
465
+ "properties": [{
466
+ "name": "open",
467
+ "attribute": "open",
468
+ "type": "boolean",
469
+ "converter": "boolean",
470
+ "reflect": true,
471
+ "default": false
472
+ }, {
473
+ "name": "label",
474
+ "attribute": "label",
475
+ "type": "string",
476
+ "converter": "string",
477
+ "reflect": false,
478
+ "default": ""
479
+ }],
480
+ "observedAttributes": ["open", "label"],
481
+ "cem": {
482
+ "tagName": "open-dialog",
483
+ "className": "OpenDialog",
484
+ "declaration": {
485
+ "name": "OpenDialog",
486
+ "module": "open-dialog.tsx"
487
+ },
488
+ "attributes": [{
489
+ "name": "open",
490
+ "fieldName": "open",
491
+ "type": "boolean",
492
+ "reflect": true
493
+ }, {
494
+ "name": "label",
495
+ "fieldName": "label",
496
+ "type": "string",
497
+ "reflect": false
498
+ }],
499
+ "members": [{
500
+ "name": "open",
501
+ "fieldName": "open",
502
+ "type": "boolean",
503
+ "attribute": "open",
504
+ "reflect": true
505
+ }, {
506
+ "name": "label",
507
+ "fieldName": "label",
508
+ "type": "string",
509
+ "attribute": "label",
510
+ "reflect": false
511
+ }]
512
+ }
675
513
  };
676
- const __observedAttributes = [
677
- "open",
678
- "label"
679
- ];
514
+ const __observedAttributes = ["open", "label"];
680
515
  const __compiledProps = {
681
- open: {
682
- type: Boolean,
683
- default: false,
684
- reflect: true,
685
- attribute: "open"
686
- },
687
- label: {
688
- type: String,
689
- default: '',
690
- reflect: false,
691
- attribute: "label"
692
- }
516
+ open: {
517
+ type: Boolean,
518
+ default: false,
519
+ reflect: true,
520
+ attribute: "open"
521
+ },
522
+ label: {
523
+ type: String,
524
+ default: "",
525
+ reflect: false,
526
+ attribute: "label"
527
+ }
693
528
  };
694
- export class OpenDialog extends OpenElement {
695
- static __partProgram = __partProgram;
696
- static __compiledProperties = __compiledProperties;
697
- static __elementMetadata = __elementMetadata;
698
- static props = __compiledProps;
699
- static observedAttributes = __observedAttributes;
700
- static delegatesFocus = true;
701
- static styles = [
702
- overlayRecipe,
703
- recipe(`
529
+ var OpenDialog = class extends OpenElement {
530
+ constructor(..._args) {
531
+ super(..._args);
532
+ this.open = false;
533
+ this.label = "";
534
+ }
535
+ static {
536
+ this.__partProgram = __partProgram;
537
+ }
538
+ static {
539
+ this.__compiledProperties = __compiledProperties;
540
+ }
541
+ static {
542
+ this.__elementMetadata = __elementMetadata;
543
+ }
544
+ static {
545
+ this.props = __compiledProps;
546
+ }
547
+ static {
548
+ this.observedAttributes = __observedAttributes;
549
+ }
550
+ static {
551
+ this.delegatesFocus = true;
552
+ }
553
+ static {
554
+ this.styles = [overlayRecipe, recipe(`
704
555
  :host {
705
556
  display: inline-block;
706
557
  }
@@ -781,129 +632,98 @@ export class OpenDialog extends OpenElement {
781
632
  :host(:state(open)) dialog {
782
633
  display: block;
783
634
  }
784
- `)
785
- ];
786
- open = false;
787
- label = '';
788
- onCsrRendered() {
789
- this.syncOpenState();
790
- }
791
- onDsdHydrated() {
792
- this.syncOpenState();
793
- }
794
- disconnectedCallback() {
795
- readInstanceState(this, 'openEffect', ()=>undefined)?.();
796
- writeInstanceState(this, 'openEffect', undefined);
797
- super.disconnectedCallback();
798
- }
799
- syncOpenState() {
800
- this.updateStates();
801
- this.syncDialogElement();
802
- const off = effect(()=>{
803
- // Reading the property tracks the signal; the bodies stay idempotent.
804
- void this.open;
805
- this.updateStates();
806
- this.syncDialogElement();
807
- });
808
- writeInstanceState(this, 'openEffect', off);
809
- }
810
- updateStates() {
811
- const states = this.stateSet();
812
- if (!states) return;
813
- if (this.open) {
814
- states.add('open');
815
- states.delete('closed');
816
- } else {
817
- states.delete('open');
818
- states.add('closed');
819
- }
820
- }
821
- stateSet() {
822
- if (this._internals?.states) return this._internals.states;
823
- let internals = readInstanceState(this, 'internals', ()=>undefined);
824
- if (!internals) {
825
- if (typeof this.attachInternals !== 'function') return undefined;
826
- internals = this.attachInternals();
827
- writeInstanceState(this, 'internals', internals);
828
- }
829
- return internals.states;
830
- }
831
- show() {
832
- this.open = true;
833
- }
834
- close() {
835
- this.open = false;
836
- }
837
- toggle() {
838
- this.open = !this.open;
839
- }
840
- syncDialogElement() {
841
- const dialog = this.shadowRoot?.querySelector('dialog');
842
- if (!dialog) return;
843
- // True once showModal() has run for the current open session (#1030).
844
- const modalActive = readInstanceState(this, 'modalActive', ()=>false);
845
- if (this.open) {
846
- if ((this.getAttribute('mode') || 'modal') === 'modal') {
847
- // Modal: showModal() puts the rest of the page on the inert top layer
848
- // natively — focus, hit-testing, and the accessibility tree are all
849
- // covered by the platform, so no hand-rolled sibling inert is needed.
850
- if (modalActive) return;
851
- // #1030: the compiled bool sink writes `open` onto the inner <dialog>
852
- // (SSR DSD / CSR first render), so dialog.open may already be true
853
- // without showModal() having run — that state presents as NON-modal
854
- // (no top layer, no ::backdrop, no focus containment). Close the
855
- // attribute-driven open first, then enter the top layer; showModal()
856
- // on an already-open dialog throws InvalidStateError.
857
- if (dialog.open) dialog.close();
858
- dialog.showModal();
859
- writeInstanceState(this, 'modalActive', true);
860
- } else if (!dialog.open) {
861
- // Non-modal: show() leaves the page interactive by design.
862
- dialog.show();
863
- }
864
- } else {
865
- // A modal session only exits the top layer while the inner `open`
866
- // attribute is still present. The compiled bool sink subscribes to the
867
- // same signal and may have already removed it — removing the attribute
868
- // leaves the dialog :modal and close() is then a spec no-op, so the
869
- // attribute must be restored before close() (#1226).
870
- if (modalActive && !dialog.open) dialog.setAttribute('open', '');
871
- if (dialog.open) dialog.close();
872
- writeInstanceState(this, 'modalActive', false);
873
- }
874
- }
875
- handleNativeClose() {
876
- // The attribute→modal transition above close()es the attribute-opened
877
- // dialog and immediately re-opens it via showModal(); if the resulting
878
- // close event is dispatched asynchronously it arrives after the re-open
879
- // (dialog.open true, host attribute still present) and must be ignored.
880
- const dialog = this.shadowRoot?.querySelector('dialog');
881
- if (dialog?.open && this.open) return;
882
- // A close() driven by handleClose (property already cleared) is the same
883
- // closing session — its open-dialog-close event already fired (#1226).
884
- if (!this.open) return;
885
- // A genuine native close (e.g. form method="dialog") finds the platform
886
- // has already cleared dialog.open.
887
- this.handleClose();
888
- }
889
- handleClose() {
890
- // Clearing the property updates the compiled signal; the open effect runs
891
- // updateStates() + syncDialogElement() — no duplicate sync here.
892
- this.open = false;
893
- this.dispatchEvent(new CustomEvent('open-dialog-close', {
894
- bubbles: true,
895
- composed: true
896
- }));
897
- }
898
- handleCancel(e) {
899
- e.preventDefault();
900
- this.handleClose();
901
- }
902
- handleTrigger() {
903
- this.toggle();
904
- }
905
- render() {
906
- throw new Error('[open:compiled-element] open-dialog is compiled to a Part Program; the runtime JSX render path is not available in 0.44.');
907
- }
908
- }
909
- export { __partProgram, __elementMetadata };
635
+ `)];
636
+ }
637
+ onCsrRendered() {
638
+ this.syncOpenState();
639
+ }
640
+ onDsdHydrated() {
641
+ this.syncOpenState();
642
+ }
643
+ disconnectedCallback() {
644
+ readInstanceState(this, "openEffect", () => void 0)?.();
645
+ writeInstanceState(this, "openEffect", void 0);
646
+ super.disconnectedCallback();
647
+ }
648
+ syncOpenState() {
649
+ this.updateStates();
650
+ this.syncDialogElement();
651
+ const off = effect(() => {
652
+ this.open;
653
+ this.updateStates();
654
+ this.syncDialogElement();
655
+ });
656
+ writeInstanceState(this, "openEffect", off);
657
+ }
658
+ updateStates() {
659
+ const states = this.stateSet();
660
+ if (!states) return;
661
+ if (this.open) {
662
+ states.add("open");
663
+ states.delete("closed");
664
+ } else {
665
+ states.delete("open");
666
+ states.add("closed");
667
+ }
668
+ }
669
+ stateSet() {
670
+ if (this._internals?.states) return this._internals.states;
671
+ let internals = readInstanceState(this, "internals", () => void 0);
672
+ if (!internals) {
673
+ if (typeof this.attachInternals !== "function") return void 0;
674
+ internals = this.attachInternals();
675
+ writeInstanceState(this, "internals", internals);
676
+ }
677
+ return internals.states;
678
+ }
679
+ show() {
680
+ this.open = true;
681
+ }
682
+ close() {
683
+ this.open = false;
684
+ }
685
+ toggle() {
686
+ this.open = !this.open;
687
+ }
688
+ syncDialogElement() {
689
+ const dialog = this.shadowRoot?.querySelector("dialog");
690
+ if (!dialog) return;
691
+ const modalActive = readInstanceState(this, "modalActive", () => false);
692
+ if (this.open) {
693
+ if ((this.getAttribute("mode") || "modal") === "modal") {
694
+ if (modalActive) return;
695
+ if (dialog.open) dialog.close();
696
+ dialog.showModal();
697
+ writeInstanceState(this, "modalActive", true);
698
+ } else if (!dialog.open) dialog.show();
699
+ } else {
700
+ if (modalActive && !dialog.open) dialog.setAttribute("open", "");
701
+ if (dialog.open) dialog.close();
702
+ writeInstanceState(this, "modalActive", false);
703
+ }
704
+ }
705
+ handleNativeClose() {
706
+ if ((this.shadowRoot?.querySelector("dialog"))?.open && this.open) return;
707
+ if (!this.open) return;
708
+ this.handleClose();
709
+ }
710
+ handleClose() {
711
+ this.open = false;
712
+ this.dispatchEvent(new CustomEvent("open-dialog-close", {
713
+ bubbles: true,
714
+ composed: true
715
+ }));
716
+ }
717
+ handleCancel(e) {
718
+ e.preventDefault();
719
+ this.handleClose();
720
+ }
721
+ handleTrigger() {
722
+ this.toggle();
723
+ }
724
+ render() {
725
+ throw new Error("[open:compiled-element] open-dialog is compiled to a Part Program; the runtime JSX render path is not available.");
726
+ }
727
+ };
728
+ //#endregion
729
+ export { OpenDialog, __elementMetadata, __partProgram };