@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.
- package/README.md +1 -0
- package/package.json +7 -2
- package/src/component-recipes.js +60 -60
- package/src/generated-manifest.json +11 -1
- package/src/index.d.ts +15 -42
- package/src/index.js +15 -46
- package/src/instance-state.d.ts +16 -0
- package/src/instance-state.js +30 -24
- package/src/manifest.d.ts +5 -9
- package/src/manifest.js +6 -11
- package/src/open-badge.d.ts +113 -159
- package/src/open-badge.js +200 -239
- package/src/open-button.d.ts +296 -898
- package/src/open-button.js +1150 -1322
- package/src/open-callout.d.ts +225 -366
- package/src/open-callout.js +488 -569
- package/src/open-card.d.ts +114 -144
- package/src/open-card.js +197 -251
- package/src/open-code-block.d.ts +165 -168
- package/src/open-code-block.js +315 -366
- package/src/open-dialog.d.ts +241 -424
- package/src/open-dialog.js +643 -823
- package/src/open-dropdown.d.ts +195 -252
- package/src/open-dropdown.js +368 -471
- package/src/open-input.d.ts +404 -1420
- package/src/open-input.js +1809 -2095
- package/src/open-props-tokens.d.ts +5 -5
- package/src/open-props-tokens.js +12 -7
- package/src/open-tabs.d.ts +163 -191
- package/src/open-tabs.js +306 -361
- package/src/open-theme-toggle.d.ts +171 -287
- package/src/open-theme-toggle.js +530 -754
- package/src/register.d.ts +4 -1
- package/src/register.js +27 -58
package/src/open-dialog.js
CHANGED
|
@@ -1,706 +1,557 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
|
|
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
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
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
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
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
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
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
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
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
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
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
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
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 };
|