@universal-material/web 3.0.35 → 3.0.36

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.
@@ -2536,255 +2536,6 @@
2536
2536
  }
2537
2537
  ]
2538
2538
  },
2539
- {
2540
- "kind": "javascript-module",
2541
- "path": "src/card/card-content.styles.ts",
2542
- "declarations": [
2543
- {
2544
- "kind": "variable",
2545
- "name": "styles",
2546
- "default": "css `\n :host {\n display: block;\n }\n\n :host(:has(slot > *)) {\n display: none;\n }\n\n :host([has-content]) {\n padding: var(--u-card-padding, 16px);\n }\n\n slot {\n border-radius: inherit;\n }\n`"
2547
- }
2548
- ],
2549
- "exports": [
2550
- {
2551
- "kind": "js",
2552
- "name": "styles",
2553
- "declaration": {
2554
- "name": "styles",
2555
- "module": "src/card/card-content.styles.ts"
2556
- }
2557
- }
2558
- ]
2559
- },
2560
- {
2561
- "kind": "javascript-module",
2562
- "path": "src/card/card-content.ts",
2563
- "declarations": [
2564
- {
2565
- "kind": "class",
2566
- "description": "",
2567
- "name": "UmCardContent",
2568
- "members": [
2569
- {
2570
- "kind": "field",
2571
- "name": "hasContent",
2572
- "type": {
2573
- "text": "boolean"
2574
- },
2575
- "default": "false",
2576
- "attribute": "has-content",
2577
- "reflects": true
2578
- },
2579
- {
2580
- "kind": "method",
2581
- "name": "handleSlotChange",
2582
- "privacy": "private",
2583
- "parameters": [
2584
- {
2585
- "name": "e",
2586
- "type": {
2587
- "text": "Event"
2588
- }
2589
- }
2590
- ]
2591
- }
2592
- ],
2593
- "attributes": [
2594
- {
2595
- "name": "has-content",
2596
- "type": {
2597
- "text": "boolean"
2598
- },
2599
- "default": "false",
2600
- "fieldName": "hasContent"
2601
- }
2602
- ],
2603
- "superclass": {
2604
- "name": "LitElement",
2605
- "package": "lit"
2606
- },
2607
- "tagName": "u-card-content",
2608
- "customElement": true
2609
- }
2610
- ],
2611
- "exports": [
2612
- {
2613
- "kind": "js",
2614
- "name": "UmCardContent",
2615
- "declaration": {
2616
- "name": "UmCardContent",
2617
- "module": "src/card/card-content.ts"
2618
- }
2619
- },
2620
- {
2621
- "kind": "custom-element-definition",
2622
- "name": "u-card-content",
2623
- "declaration": {
2624
- "name": "UmCardContent",
2625
- "module": "src/card/card-content.ts"
2626
- }
2627
- }
2628
- ]
2629
- },
2630
- {
2631
- "kind": "javascript-module",
2632
- "path": "src/card/card-media.styles.ts",
2633
- "declarations": [
2634
- {
2635
- "kind": "variable",
2636
- "name": "styles",
2637
- "default": "css `\n :host {\n display: block;\n aspect-ratio: 1;\n border-radius: var(--u-card-shape-corner, var(--u-shape-corner-medium, 12px));\n }\n\n :host([wide]) {\n aspect-ratio: 16/9;\n }\n`"
2638
- }
2639
- ],
2640
- "exports": [
2641
- {
2642
- "kind": "js",
2643
- "name": "styles",
2644
- "declaration": {
2645
- "name": "styles",
2646
- "module": "src/card/card-media.styles.ts"
2647
- }
2648
- }
2649
- ]
2650
- },
2651
- {
2652
- "kind": "javascript-module",
2653
- "path": "src/card/card-media.ts",
2654
- "declarations": [
2655
- {
2656
- "kind": "class",
2657
- "description": "",
2658
- "name": "UmCardMedia",
2659
- "members": [
2660
- {
2661
- "kind": "field",
2662
- "name": "wide",
2663
- "type": {
2664
- "text": "boolean"
2665
- },
2666
- "default": "false",
2667
- "attribute": "wide",
2668
- "reflects": true
2669
- }
2670
- ],
2671
- "attributes": [
2672
- {
2673
- "name": "wide",
2674
- "type": {
2675
- "text": "boolean"
2676
- },
2677
- "default": "false",
2678
- "fieldName": "wide"
2679
- }
2680
- ],
2681
- "superclass": {
2682
- "name": "LitElement",
2683
- "package": "lit"
2684
- },
2685
- "tagName": "u-card-media",
2686
- "customElement": true
2687
- }
2688
- ],
2689
- "exports": [
2690
- {
2691
- "kind": "js",
2692
- "name": "UmCardMedia",
2693
- "declaration": {
2694
- "name": "UmCardMedia",
2695
- "module": "src/card/card-media.ts"
2696
- }
2697
- },
2698
- {
2699
- "kind": "custom-element-definition",
2700
- "name": "u-card-media",
2701
- "declaration": {
2702
- "name": "UmCardMedia",
2703
- "module": "src/card/card-media.ts"
2704
- }
2705
- }
2706
- ]
2707
- },
2708
- {
2709
- "kind": "javascript-module",
2710
- "path": "src/card/card.styles.ts",
2711
- "declarations": [
2712
- {
2713
- "kind": "variable",
2714
- "name": "styles",
2715
- "default": "css `\n :host {\n display: block;\n position: relative;\n border-radius: var(--u-card-shape-corner, var(--u-shape-corner-medium, 12px));\n }\n\n :host([variant=elevated]) {\n background-color: var(--u-color-surface-container-low, rgb(247, 242, 250));\n }\n :host([variant=elevated]) u-elevation {\n --u-elevation-level: var(--u-elevated-card-elevation-level, 1);\n }\n\n :host([variant=filled]) {\n background-color: var(--u-color-surface-container-highest, rgb(230, 224, 233));\n }\n\n :host([variant=outlined]) {\n border: var(--u-outlined-card-outline-width, 1px) solid var(--u-outlined-card-outline-color, var(--u-color-outline-variant, rgb(202, 196, 208)));\n }\n\n u-card-content,\n slot {\n border-radius: inherit;\n }\n`"
2716
- }
2717
- ],
2718
- "exports": [
2719
- {
2720
- "kind": "js",
2721
- "name": "styles",
2722
- "declaration": {
2723
- "name": "styles",
2724
- "module": "src/card/card.styles.ts"
2725
- }
2726
- }
2727
- ]
2728
- },
2729
- {
2730
- "kind": "javascript-module",
2731
- "path": "src/card/card.ts",
2732
- "declarations": [
2733
- {
2734
- "kind": "class",
2735
- "description": "",
2736
- "name": "UmCard",
2737
- "members": [
2738
- {
2739
- "kind": "field",
2740
- "name": "variant",
2741
- "type": {
2742
- "text": "UmCardVariant"
2743
- },
2744
- "default": "'filled'",
2745
- "description": "The Card variant to render.",
2746
- "attribute": "variant",
2747
- "reflects": true
2748
- }
2749
- ],
2750
- "attributes": [
2751
- {
2752
- "name": "variant",
2753
- "type": {
2754
- "text": "UmCardVariant"
2755
- },
2756
- "default": "'filled'",
2757
- "description": "The Card variant to render.",
2758
- "fieldName": "variant"
2759
- }
2760
- ],
2761
- "superclass": {
2762
- "name": "LitElement",
2763
- "package": "lit"
2764
- },
2765
- "tagName": "u-card",
2766
- "customElement": true
2767
- }
2768
- ],
2769
- "exports": [
2770
- {
2771
- "kind": "js",
2772
- "name": "UmCard",
2773
- "declaration": {
2774
- "name": "UmCard",
2775
- "module": "src/card/card.ts"
2776
- }
2777
- },
2778
- {
2779
- "kind": "custom-element-definition",
2780
- "name": "u-card",
2781
- "declaration": {
2782
- "name": "UmCard",
2783
- "module": "src/card/card.ts"
2784
- }
2785
- }
2786
- ]
2787
- },
2788
2539
  {
2789
2540
  "kind": "javascript-module",
2790
2541
  "path": "src/checkbox/checkbox-list-item.ts",
@@ -3027,6 +2778,14 @@
3027
2778
  {
3028
2779
  "kind": "method",
3029
2780
  "name": "#handleClick",
2781
+ "parameters": [
2782
+ {
2783
+ "name": "e",
2784
+ "type": {
2785
+ "text": "Event"
2786
+ }
2787
+ }
2788
+ ],
3030
2789
  "inheritedFrom": {
3031
2790
  "name": "UmSelectionControl",
3032
2791
  "module": "src/shared/selection-control/selection-control.ts"
@@ -3104,6 +2863,16 @@
3104
2863
  }
3105
2864
  ],
3106
2865
  "events": [
2866
+ {
2867
+ "name": "input",
2868
+ "type": {
2869
+ "text": "InputEvent"
2870
+ },
2871
+ "inheritedFrom": {
2872
+ "name": "UmSelectionControl",
2873
+ "module": "src/shared/selection-control/selection-control.ts"
2874
+ }
2875
+ },
3107
2876
  {
3108
2877
  "name": "change",
3109
2878
  "type": {
@@ -3349,6 +3118,14 @@
3349
3118
  {
3350
3119
  "kind": "method",
3351
3120
  "name": "#handleClick",
3121
+ "parameters": [
3122
+ {
3123
+ "name": "e",
3124
+ "type": {
3125
+ "text": "Event"
3126
+ }
3127
+ }
3128
+ ],
3352
3129
  "inheritedFrom": {
3353
3130
  "name": "UmSelectionControl",
3354
3131
  "module": "src/shared/selection-control/selection-control.ts"
@@ -3384,86 +3161,265 @@
3384
3161
  }
3385
3162
  },
3386
3163
  {
3387
- "name": "disabled",
3164
+ "name": "disabled",
3165
+ "type": {
3166
+ "text": "boolean"
3167
+ },
3168
+ "default": "false",
3169
+ "fieldName": "disabled",
3170
+ "inheritedFrom": {
3171
+ "name": "UmSelectionControl",
3172
+ "module": "src/shared/selection-control/selection-control.ts"
3173
+ }
3174
+ },
3175
+ {
3176
+ "name": "value",
3177
+ "type": {
3178
+ "text": "string"
3179
+ },
3180
+ "default": "'on'",
3181
+ "description": "The element value to use in form submission when checked.",
3182
+ "fieldName": "value",
3183
+ "inheritedFrom": {
3184
+ "name": "UmSelectionControl",
3185
+ "module": "src/shared/selection-control/selection-control.ts"
3186
+ }
3187
+ },
3188
+ {
3189
+ "name": "checked",
3190
+ "fieldName": "checked",
3191
+ "inheritedFrom": {
3192
+ "name": "UmSelectionControl",
3193
+ "module": "src/shared/selection-control/selection-control.ts"
3194
+ }
3195
+ }
3196
+ ],
3197
+ "superclass": {
3198
+ "name": "UmSelectionControl",
3199
+ "module": "/src/shared/selection-control/selection-control.js"
3200
+ },
3201
+ "tagName": "u-checkbox",
3202
+ "customElement": true,
3203
+ "events": [
3204
+ {
3205
+ "name": "input",
3206
+ "type": {
3207
+ "text": "InputEvent"
3208
+ },
3209
+ "inheritedFrom": {
3210
+ "name": "UmSelectionControl",
3211
+ "module": "src/shared/selection-control/selection-control.ts"
3212
+ }
3213
+ },
3214
+ {
3215
+ "name": "change",
3216
+ "type": {
3217
+ "text": "Event"
3218
+ },
3219
+ "inheritedFrom": {
3220
+ "name": "UmSelectionControl",
3221
+ "module": "src/shared/selection-control/selection-control.ts"
3222
+ }
3223
+ }
3224
+ ]
3225
+ }
3226
+ ],
3227
+ "exports": [
3228
+ {
3229
+ "kind": "js",
3230
+ "name": "UmCheckbox",
3231
+ "declaration": {
3232
+ "name": "UmCheckbox",
3233
+ "module": "src/checkbox/checkbox.ts"
3234
+ }
3235
+ },
3236
+ {
3237
+ "kind": "custom-element-definition",
3238
+ "name": "u-checkbox",
3239
+ "declaration": {
3240
+ "name": "UmCheckbox",
3241
+ "module": "src/checkbox/checkbox.ts"
3242
+ }
3243
+ }
3244
+ ]
3245
+ },
3246
+ {
3247
+ "kind": "javascript-module",
3248
+ "path": "src/card/card-content.styles.ts",
3249
+ "declarations": [
3250
+ {
3251
+ "kind": "variable",
3252
+ "name": "styles",
3253
+ "default": "css `\n :host {\n display: block;\n }\n\n :host(:has(slot > *)) {\n display: none;\n }\n\n :host([has-content]) {\n padding: var(--u-card-padding, 16px);\n }\n\n slot {\n border-radius: inherit;\n }\n`"
3254
+ }
3255
+ ],
3256
+ "exports": [
3257
+ {
3258
+ "kind": "js",
3259
+ "name": "styles",
3260
+ "declaration": {
3261
+ "name": "styles",
3262
+ "module": "src/card/card-content.styles.ts"
3263
+ }
3264
+ }
3265
+ ]
3266
+ },
3267
+ {
3268
+ "kind": "javascript-module",
3269
+ "path": "src/card/card-content.ts",
3270
+ "declarations": [
3271
+ {
3272
+ "kind": "class",
3273
+ "description": "",
3274
+ "name": "UmCardContent",
3275
+ "members": [
3276
+ {
3277
+ "kind": "field",
3278
+ "name": "hasContent",
3279
+ "type": {
3280
+ "text": "boolean"
3281
+ },
3282
+ "default": "false",
3283
+ "attribute": "has-content",
3284
+ "reflects": true
3285
+ },
3286
+ {
3287
+ "kind": "method",
3288
+ "name": "handleSlotChange",
3289
+ "privacy": "private",
3290
+ "parameters": [
3291
+ {
3292
+ "name": "e",
3293
+ "type": {
3294
+ "text": "Event"
3295
+ }
3296
+ }
3297
+ ]
3298
+ }
3299
+ ],
3300
+ "attributes": [
3301
+ {
3302
+ "name": "has-content",
3303
+ "type": {
3304
+ "text": "boolean"
3305
+ },
3306
+ "default": "false",
3307
+ "fieldName": "hasContent"
3308
+ }
3309
+ ],
3310
+ "superclass": {
3311
+ "name": "LitElement",
3312
+ "package": "lit"
3313
+ },
3314
+ "tagName": "u-card-content",
3315
+ "customElement": true
3316
+ }
3317
+ ],
3318
+ "exports": [
3319
+ {
3320
+ "kind": "js",
3321
+ "name": "UmCardContent",
3322
+ "declaration": {
3323
+ "name": "UmCardContent",
3324
+ "module": "src/card/card-content.ts"
3325
+ }
3326
+ },
3327
+ {
3328
+ "kind": "custom-element-definition",
3329
+ "name": "u-card-content",
3330
+ "declaration": {
3331
+ "name": "UmCardContent",
3332
+ "module": "src/card/card-content.ts"
3333
+ }
3334
+ }
3335
+ ]
3336
+ },
3337
+ {
3338
+ "kind": "javascript-module",
3339
+ "path": "src/card/card-media.styles.ts",
3340
+ "declarations": [
3341
+ {
3342
+ "kind": "variable",
3343
+ "name": "styles",
3344
+ "default": "css `\n :host {\n display: block;\n aspect-ratio: 1;\n border-radius: var(--u-card-shape-corner, var(--u-shape-corner-medium, 12px));\n }\n\n :host([wide]) {\n aspect-ratio: 16/9;\n }\n`"
3345
+ }
3346
+ ],
3347
+ "exports": [
3348
+ {
3349
+ "kind": "js",
3350
+ "name": "styles",
3351
+ "declaration": {
3352
+ "name": "styles",
3353
+ "module": "src/card/card-media.styles.ts"
3354
+ }
3355
+ }
3356
+ ]
3357
+ },
3358
+ {
3359
+ "kind": "javascript-module",
3360
+ "path": "src/card/card-media.ts",
3361
+ "declarations": [
3362
+ {
3363
+ "kind": "class",
3364
+ "description": "",
3365
+ "name": "UmCardMedia",
3366
+ "members": [
3367
+ {
3368
+ "kind": "field",
3369
+ "name": "wide",
3388
3370
  "type": {
3389
3371
  "text": "boolean"
3390
3372
  },
3391
3373
  "default": "false",
3392
- "fieldName": "disabled",
3393
- "inheritedFrom": {
3394
- "name": "UmSelectionControl",
3395
- "module": "src/shared/selection-control/selection-control.ts"
3396
- }
3397
- },
3374
+ "attribute": "wide",
3375
+ "reflects": true
3376
+ }
3377
+ ],
3378
+ "attributes": [
3398
3379
  {
3399
- "name": "value",
3380
+ "name": "wide",
3400
3381
  "type": {
3401
- "text": "string"
3382
+ "text": "boolean"
3402
3383
  },
3403
- "default": "'on'",
3404
- "description": "The element value to use in form submission when checked.",
3405
- "fieldName": "value",
3406
- "inheritedFrom": {
3407
- "name": "UmSelectionControl",
3408
- "module": "src/shared/selection-control/selection-control.ts"
3409
- }
3410
- },
3411
- {
3412
- "name": "checked",
3413
- "fieldName": "checked",
3414
- "inheritedFrom": {
3415
- "name": "UmSelectionControl",
3416
- "module": "src/shared/selection-control/selection-control.ts"
3417
- }
3384
+ "default": "false",
3385
+ "fieldName": "wide"
3418
3386
  }
3419
3387
  ],
3420
3388
  "superclass": {
3421
- "name": "UmSelectionControl",
3422
- "module": "/src/shared/selection-control/selection-control.js"
3389
+ "name": "LitElement",
3390
+ "package": "lit"
3423
3391
  },
3424
- "tagName": "u-checkbox",
3425
- "customElement": true,
3426
- "events": [
3427
- {
3428
- "name": "change",
3429
- "type": {
3430
- "text": "Event"
3431
- },
3432
- "inheritedFrom": {
3433
- "name": "UmSelectionControl",
3434
- "module": "src/shared/selection-control/selection-control.ts"
3435
- }
3436
- }
3437
- ]
3392
+ "tagName": "u-card-media",
3393
+ "customElement": true
3438
3394
  }
3439
3395
  ],
3440
3396
  "exports": [
3441
3397
  {
3442
3398
  "kind": "js",
3443
- "name": "UmCheckbox",
3399
+ "name": "UmCardMedia",
3444
3400
  "declaration": {
3445
- "name": "UmCheckbox",
3446
- "module": "src/checkbox/checkbox.ts"
3401
+ "name": "UmCardMedia",
3402
+ "module": "src/card/card-media.ts"
3447
3403
  }
3448
3404
  },
3449
3405
  {
3450
3406
  "kind": "custom-element-definition",
3451
- "name": "u-checkbox",
3407
+ "name": "u-card-media",
3452
3408
  "declaration": {
3453
- "name": "UmCheckbox",
3454
- "module": "src/checkbox/checkbox.ts"
3409
+ "name": "UmCardMedia",
3410
+ "module": "src/card/card-media.ts"
3455
3411
  }
3456
3412
  }
3457
3413
  ]
3458
3414
  },
3459
3415
  {
3460
3416
  "kind": "javascript-module",
3461
- "path": "src/elevation/elevation.styles.ts",
3417
+ "path": "src/card/card.styles.ts",
3462
3418
  "declarations": [
3463
3419
  {
3464
3420
  "kind": "variable",
3465
3421
  "name": "styles",
3466
- "default": "css `\n :host {\n --_level: var(--u-elevation-level, 0);\n --_shadow-color: var(--u-color-shadow, rgb(0, 0, 0));\n -webkit-tap-highlight-color: transparent;\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n }\n :host::before, :host::after {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n transition: box-shadow 150ms ease-in-out;\n }\n :host::before {\n box-shadow: 0 calc(1px * (clamp(0, var(--_level), 1) + clamp(0, var(--_level) - 3, 1) + 2 * clamp(0, var(--_level) - 4, 1))) calc(1px * (2 * clamp(0, var(--_level), 1) + clamp(0, var(--_level) - 2, 1) + clamp(0, var(--_level) - 4, 1))) 0 var(--_shadow-color);\n opacity: 0.3;\n }\n :host::after {\n box-shadow: 0 calc(1px * (clamp(0, var(--_level), 1) + clamp(0, var(--_level) - 1, 1) + 2 * clamp(0, var(--_level) - 2, 3))) calc(1px * (3 * clamp(0, var(--_level), 2) + 2 * clamp(0, var(--_level) - 2, 3))) calc(1px * (clamp(0, var(--_level), 4) + 2 * clamp(0, var(--_level) - 4, 1))) var(--_shadow-color);\n opacity: 0.15;\n }\n`"
3422
+ "default": "css `\n :host {\n display: block;\n position: relative;\n border-radius: var(--u-card-shape-corner, var(--u-shape-corner-medium, 12px));\n }\n\n :host([variant=elevated]) {\n background-color: var(--u-color-surface-container-low, rgb(247, 242, 250));\n }\n :host([variant=elevated]) u-elevation {\n --u-elevation-level: var(--u-elevated-card-elevation-level, 1);\n }\n\n :host([variant=filled]) {\n background-color: var(--u-color-surface-container-highest, rgb(230, 224, 233));\n }\n\n :host([variant=outlined]) {\n border: var(--u-outlined-card-outline-width, 1px) solid var(--u-outlined-card-outline-color, var(--u-color-outline-variant, rgb(202, 196, 208)));\n }\n\n u-card-content,\n slot {\n border-radius: inherit;\n }\n`"
3467
3423
  }
3468
3424
  ],
3469
3425
  "exports": [
@@ -3472,43 +3428,66 @@
3472
3428
  "name": "styles",
3473
3429
  "declaration": {
3474
3430
  "name": "styles",
3475
- "module": "src/elevation/elevation.styles.ts"
3431
+ "module": "src/card/card.styles.ts"
3476
3432
  }
3477
3433
  }
3478
3434
  ]
3479
3435
  },
3480
3436
  {
3481
3437
  "kind": "javascript-module",
3482
- "path": "src/elevation/elevation.ts",
3438
+ "path": "src/card/card.ts",
3483
3439
  "declarations": [
3484
3440
  {
3485
3441
  "kind": "class",
3486
3442
  "description": "",
3487
- "name": "UmElevation",
3488
- "members": [],
3443
+ "name": "UmCard",
3444
+ "members": [
3445
+ {
3446
+ "kind": "field",
3447
+ "name": "variant",
3448
+ "type": {
3449
+ "text": "UmCardVariant"
3450
+ },
3451
+ "default": "'filled'",
3452
+ "description": "The Card variant to render.",
3453
+ "attribute": "variant",
3454
+ "reflects": true
3455
+ }
3456
+ ],
3457
+ "attributes": [
3458
+ {
3459
+ "name": "variant",
3460
+ "type": {
3461
+ "text": "UmCardVariant"
3462
+ },
3463
+ "default": "'filled'",
3464
+ "description": "The Card variant to render.",
3465
+ "fieldName": "variant"
3466
+ }
3467
+ ],
3489
3468
  "superclass": {
3490
3469
  "name": "LitElement",
3491
3470
  "package": "lit"
3492
3471
  },
3493
- "tagName": "u-elevation",
3472
+ "tagName": "u-card",
3494
3473
  "customElement": true
3495
3474
  }
3496
3475
  ],
3497
3476
  "exports": [
3498
3477
  {
3499
3478
  "kind": "js",
3500
- "name": "UmElevation",
3479
+ "name": "UmCard",
3501
3480
  "declaration": {
3502
- "name": "UmElevation",
3503
- "module": "src/elevation/elevation.ts"
3481
+ "name": "UmCard",
3482
+ "module": "src/card/card.ts"
3504
3483
  }
3505
3484
  },
3506
3485
  {
3507
3486
  "kind": "custom-element-definition",
3508
- "name": "u-elevation",
3487
+ "name": "u-card",
3509
3488
  "declaration": {
3510
- "name": "UmElevation",
3511
- "module": "src/elevation/elevation.ts"
3489
+ "name": "UmCard",
3490
+ "module": "src/card/card.ts"
3512
3491
  }
3513
3492
  }
3514
3493
  ]
@@ -3817,6 +3796,63 @@
3817
3796
  }
3818
3797
  ]
3819
3798
  },
3799
+ {
3800
+ "kind": "javascript-module",
3801
+ "path": "src/elevation/elevation.styles.ts",
3802
+ "declarations": [
3803
+ {
3804
+ "kind": "variable",
3805
+ "name": "styles",
3806
+ "default": "css `\n :host {\n --_level: var(--u-elevation-level, 0);\n --_shadow-color: var(--u-color-shadow, rgb(0, 0, 0));\n -webkit-tap-highlight-color: transparent;\n position: absolute;\n inset: 0;\n border-radius: inherit;\n pointer-events: none;\n }\n :host::before, :host::after {\n content: \"\";\n position: absolute;\n inset: 0;\n border-radius: inherit;\n transition: box-shadow 150ms ease-in-out;\n }\n :host::before {\n box-shadow: 0 calc(1px * (clamp(0, var(--_level), 1) + clamp(0, var(--_level) - 3, 1) + 2 * clamp(0, var(--_level) - 4, 1))) calc(1px * (2 * clamp(0, var(--_level), 1) + clamp(0, var(--_level) - 2, 1) + clamp(0, var(--_level) - 4, 1))) 0 var(--_shadow-color);\n opacity: 0.3;\n }\n :host::after {\n box-shadow: 0 calc(1px * (clamp(0, var(--_level), 1) + clamp(0, var(--_level) - 1, 1) + 2 * clamp(0, var(--_level) - 2, 3))) calc(1px * (3 * clamp(0, var(--_level), 2) + 2 * clamp(0, var(--_level) - 2, 3))) calc(1px * (clamp(0, var(--_level), 4) + 2 * clamp(0, var(--_level) - 4, 1))) var(--_shadow-color);\n opacity: 0.15;\n }\n`"
3807
+ }
3808
+ ],
3809
+ "exports": [
3810
+ {
3811
+ "kind": "js",
3812
+ "name": "styles",
3813
+ "declaration": {
3814
+ "name": "styles",
3815
+ "module": "src/elevation/elevation.styles.ts"
3816
+ }
3817
+ }
3818
+ ]
3819
+ },
3820
+ {
3821
+ "kind": "javascript-module",
3822
+ "path": "src/elevation/elevation.ts",
3823
+ "declarations": [
3824
+ {
3825
+ "kind": "class",
3826
+ "description": "",
3827
+ "name": "UmElevation",
3828
+ "members": [],
3829
+ "superclass": {
3830
+ "name": "LitElement",
3831
+ "package": "lit"
3832
+ },
3833
+ "tagName": "u-elevation",
3834
+ "customElement": true
3835
+ }
3836
+ ],
3837
+ "exports": [
3838
+ {
3839
+ "kind": "js",
3840
+ "name": "UmElevation",
3841
+ "declaration": {
3842
+ "name": "UmElevation",
3843
+ "module": "src/elevation/elevation.ts"
3844
+ }
3845
+ },
3846
+ {
3847
+ "kind": "custom-element-definition",
3848
+ "name": "u-elevation",
3849
+ "declaration": {
3850
+ "name": "UmElevation",
3851
+ "module": "src/elevation/elevation.ts"
3852
+ }
3853
+ }
3854
+ ]
3855
+ },
3820
3856
  {
3821
3857
  "kind": "javascript-module",
3822
3858
  "path": "src/list/list-item.styles.ts",
@@ -5605,6 +5641,14 @@
5605
5641
  {
5606
5642
  "kind": "method",
5607
5643
  "name": "#handleClick",
5644
+ "parameters": [
5645
+ {
5646
+ "name": "e",
5647
+ "type": {
5648
+ "text": "Event"
5649
+ }
5650
+ }
5651
+ ],
5608
5652
  "inheritedFrom": {
5609
5653
  "name": "UmSelectionControl",
5610
5654
  "module": "src/shared/selection-control/selection-control.ts"
@@ -5671,6 +5715,16 @@
5671
5715
  }
5672
5716
  ],
5673
5717
  "events": [
5718
+ {
5719
+ "name": "input",
5720
+ "type": {
5721
+ "text": "InputEvent"
5722
+ },
5723
+ "inheritedFrom": {
5724
+ "name": "UmSelectionControl",
5725
+ "module": "src/shared/selection-control/selection-control.ts"
5726
+ }
5727
+ },
5674
5728
  {
5675
5729
  "name": "change",
5676
5730
  "type": {
@@ -5926,6 +5980,14 @@
5926
5980
  {
5927
5981
  "kind": "method",
5928
5982
  "name": "#handleClick",
5983
+ "parameters": [
5984
+ {
5985
+ "name": "e",
5986
+ "type": {
5987
+ "text": "Event"
5988
+ }
5989
+ }
5990
+ ],
5929
5991
  "inheritedFrom": {
5930
5992
  "name": "UmSelectionControl",
5931
5993
  "module": "src/shared/selection-control/selection-control.ts"
@@ -5994,6 +6056,16 @@
5994
6056
  "tagName": "u-radio",
5995
6057
  "customElement": true,
5996
6058
  "events": [
6059
+ {
6060
+ "name": "input",
6061
+ "type": {
6062
+ "text": "InputEvent"
6063
+ },
6064
+ "inheritedFrom": {
6065
+ "name": "UmSelectionControl",
6066
+ "module": "src/shared/selection-control/selection-control.ts"
6067
+ }
6068
+ },
5997
6069
  {
5998
6070
  "name": "change",
5999
6071
  "type": {
@@ -6993,6 +7065,14 @@
6993
7065
  {
6994
7066
  "kind": "method",
6995
7067
  "name": "#handleClick",
7068
+ "parameters": [
7069
+ {
7070
+ "name": "e",
7071
+ "type": {
7072
+ "text": "Event"
7073
+ }
7074
+ }
7075
+ ],
6996
7076
  "inheritedFrom": {
6997
7077
  "name": "UmSelectionControl",
6998
7078
  "module": "src/shared/selection-control/selection-control.ts"
@@ -7047,6 +7127,16 @@
7047
7127
  }
7048
7128
  ],
7049
7129
  "events": [
7130
+ {
7131
+ "name": "input",
7132
+ "type": {
7133
+ "text": "InputEvent"
7134
+ },
7135
+ "inheritedFrom": {
7136
+ "name": "UmSelectionControl",
7137
+ "module": "src/shared/selection-control/selection-control.ts"
7138
+ }
7139
+ },
7050
7140
  {
7051
7141
  "name": "change",
7052
7142
  "type": {
@@ -7262,6 +7352,14 @@
7262
7352
  {
7263
7353
  "kind": "method",
7264
7354
  "name": "#handleClick",
7355
+ "parameters": [
7356
+ {
7357
+ "name": "e",
7358
+ "type": {
7359
+ "text": "Event"
7360
+ }
7361
+ }
7362
+ ],
7265
7363
  "inheritedFrom": {
7266
7364
  "name": "UmSelectionControl",
7267
7365
  "module": "src/shared/selection-control/selection-control.ts"
@@ -7322,6 +7420,16 @@
7322
7420
  }
7323
7421
  ],
7324
7422
  "events": [
7423
+ {
7424
+ "name": "input",
7425
+ "type": {
7426
+ "text": "InputEvent"
7427
+ },
7428
+ "inheritedFrom": {
7429
+ "name": "UmSelectionControl",
7430
+ "module": "src/shared/selection-control/selection-control.ts"
7431
+ }
7432
+ },
7325
7433
  {
7326
7434
  "name": "change",
7327
7435
  "type": {
@@ -8297,10 +8405,24 @@
8297
8405
  },
8298
8406
  {
8299
8407
  "kind": "method",
8300
- "name": "#handleClick"
8408
+ "name": "#handleClick",
8409
+ "parameters": [
8410
+ {
8411
+ "name": "e",
8412
+ "type": {
8413
+ "text": "Event"
8414
+ }
8415
+ }
8416
+ ]
8301
8417
  }
8302
8418
  ],
8303
8419
  "events": [
8420
+ {
8421
+ "name": "input",
8422
+ "type": {
8423
+ "text": "InputEvent"
8424
+ }
8425
+ },
8304
8426
  {
8305
8427
  "name": "change",
8306
8428
  "type": {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@universal-material/web",
3
- "version": "3.0.35",
3
+ "version": "3.0.36",
4
4
  "description": "Material web components",
5
5
  "type": "module",
6
6
  "keywords": [
@@ -5,12 +5,12 @@ export const mixinSelectionControlListItem = (base) => {
5
5
  class SelectionControlListItem extends base {
6
6
  render() {
7
7
  return html `
8
- <u-list-item ?selectable=${!this.disabled}>
9
- <slot></slot>
10
- <div slot="trailing">
11
- ${super.render()}
12
- </div>
13
- </u-list-item>`;
8
+ <u-list-item ?selectable=${!this.disabled}>
9
+ <label for="input"><slot></slot></label>
10
+ <div slot="trailing">
11
+ ${super.render()}
12
+ </div>
13
+ </u-list-item>`;
14
14
  }
15
15
  }
16
16
  SelectionControlListItem.styles = [
@@ -1 +1 @@
1
- {"version":3,"file":"selection-control-list-item.js","sourceRoot":"","sources":["../../../src/shared/selection-control/selection-control-list-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAehE,aAAa;AACb,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAA0C,IAAO,EAAkB,EAAE;IAChH,aAAa;IACb,MAAe,wBAAyB,SAAQ,IAAI;QASzC,MAAM;YACb,OAAO,IAAI,CAAA;mCACkB,CAAC,IAAI,CAAC,QAAQ;;;cAGnC,KAAK,CAAC,MAAM,EAAE;;uBAEL,CAAC;QACpB,CAAC;;IAhBM,+BAAM,GAAG;QACb,IAAqC,CAAC,MAAM,IAAI,EAAE;QACnD,GAAG,CAAA;;;QAGD;KACH,CAAC;IAaJ,OAAO,wBAAwB,CAAC;AAClC,CAAC,CAAA","sourcesContent":["import { css, html, HTMLTemplateResult, LitElement } from 'lit';\n\nimport { UmSelectionControl } from './selection-control.js';\n\nexport type MixinBase<ExpectedBase = object> = abstract new (\n // Mixins must have a constructor with `...args: any[]`\n // @ts-ignore\n ...args: any[]\n) => ExpectedBase;\n\nexport type MixinReturn<MixinBase, MixinClass = object> =\n// Mixins must have a constructor with `...args: any[]`\n// tslint:disable-next-line:no-any\n (abstract new (...args: any[]) => MixinClass) & MixinBase;\n\n// @ts-ignore\nexport const mixinSelectionControlListItem = <T extends MixinBase<UmSelectionControl>>(base: T): MixinReturn<T> => {\n // @ts-ignore\n abstract class SelectionControlListItem extends base {\n static styles = [\n (base as unknown as typeof LitElement).styles ?? [],\n css`:host {\n --u-list-item-block-padding: 0;\n display: block;\n }`\n ];\n\n override render(): HTMLTemplateResult {\n return html`\n <u-list-item ?selectable=${!this.disabled}>\n <slot></slot>\n <div slot=\"trailing\">\n ${super.render()}\n </div>\n </u-list-item>`;\n }\n }\n\n return SelectionControlListItem;\n}\n"]}
1
+ {"version":3,"file":"selection-control-list-item.js","sourceRoot":"","sources":["../../../src/shared/selection-control/selection-control-list-item.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,GAAG,EAAE,IAAI,EAAkC,MAAM,KAAK,CAAC;AAehE,aAAa;AACb,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAA0C,IAAO,EAAkB,EAAE;IAChH,aAAa;IACb,MAAe,wBAAyB,SAAQ,IAAI;QASzC,MAAM;YACb,OAAO,IAAI,CAAA;qCACoB,CAAC,IAAI,CAAC,QAAQ;;;gBAGnC,KAAK,CAAC,MAAM,EAAE;;yBAEL,CAAC;QACtB,CAAC;;IAhBM,+BAAM,GAAG;QACb,IAAqC,CAAC,MAAM,IAAI,EAAE;QACnD,GAAG,CAAA;;;QAGD;KACH,CAAC;IAaJ,OAAO,wBAAwB,CAAC;AAClC,CAAC,CAAA","sourcesContent":["import { css, html, HTMLTemplateResult, LitElement } from 'lit';\n\nimport { UmSelectionControl } from './selection-control.js';\n\nexport type MixinBase<ExpectedBase = object> = abstract new (\n // Mixins must have a constructor with `...args: any[]`\n // @ts-ignore\n ...args: any[]\n) => ExpectedBase;\n\nexport type MixinReturn<MixinBase, MixinClass = object> =\n// Mixins must have a constructor with `...args: any[]`\n// tslint:disable-next-line:no-any\n (abstract new (...args: any[]) => MixinClass) & MixinBase;\n\n// @ts-ignore\nexport const mixinSelectionControlListItem = <T extends MixinBase<UmSelectionControl>>(base: T): MixinReturn<T> => {\n // @ts-ignore\n abstract class SelectionControlListItem extends base {\n static styles = [\n (base as unknown as typeof LitElement).styles ?? [],\n css`:host {\n --u-list-item-block-padding: 0;\n display: block;\n }`\n ];\n\n override render(): HTMLTemplateResult {\n return html`\n <u-list-item ?selectable=${!this.disabled}>\n <label for=\"input\"><slot></slot></label>\n <div slot=\"trailing\">\n ${super.render()}\n </div>\n </u-list-item>`;\n }\n }\n\n return SelectionControlListItem;\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"selection-control.d.ts","sourceRoot":"","sources":["../../../src/shared/selection-control/selection-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAW,MAAM,KAAK,CAAC;AAGpE,OAAO,wBAAwB,CAAC;AAEhC,8BAAsB,kBAAmB,SAAQ,UAAU;;IACzD,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAEtC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE1C,IAAI,EAAE,MAAM,GAAG,SAAS,CAAM;IACA,QAAQ,UAAS;IAC3C,KAAK,EAAG,gBAAgB,CAAC;IAKzC,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;IAGD,SAAS,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAc;IACvD,SAAS,CAAC,YAAY,UAAQ;IAE9B,SAAS,CAAC,QAAQ,CAAC,eAAe,IAAI,kBAAkB;IAExD;;OAEG;IACS,KAAK,SAAQ;IAEzB,IACI,OAAO,IAGQ,OAAO,CADzB;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;IAED,SAAS;IAKA,iBAAiB;IAKjB,oBAAoB;cAKV,MAAM,IAAI,kBAAkB;CAoBhD"}
1
+ {"version":3,"file":"selection-control.d.ts","sourceRoot":"","sources":["../../../src/shared/selection-control/selection-control.ts"],"names":[],"mappings":"AAAA,OAAO,EAAQ,kBAAkB,EAAE,UAAU,EAAW,MAAM,KAAK,CAAC;AAGpE,OAAO,wBAAwB,CAAC;AAEhC,8BAAsB,kBAAmB,SAAQ,UAAU;;IACzD,MAAM,CAAC,QAAQ,CAAC,cAAc,QAAQ;IAEtC,SAAS,CAAC,QAAQ,CAAC,gBAAgB,EAAE,gBAAgB,CAAC;IAE1C,IAAI,EAAE,MAAM,GAAG,SAAS,CAAM;IACA,QAAQ,UAAS;IAC3C,KAAK,EAAG,gBAAgB,CAAC;IAKzC,IAAI,IAAI,IAAI,eAAe,GAAG,IAAI,CAEjC;IAGD,SAAS,CAAC,SAAS,EAAE,UAAU,GAAG,OAAO,CAAc;IACvD,SAAS,CAAC,YAAY,UAAQ;IAE9B,SAAS,CAAC,QAAQ,CAAC,eAAe,IAAI,kBAAkB;IAExD;;OAEG;IACS,KAAK,SAAQ;IAEzB,IACI,OAAO,IAGQ,OAAO,CADzB;IACD,IAAI,OAAO,CAAC,KAAK,EAAE,OAAO,EAGzB;IAED,SAAS;IAKA,iBAAiB;IAKjB,oBAAoB;cAKV,MAAM,IAAI,kBAAkB;CA0BhD"}
@@ -60,17 +60,22 @@ export class UmSelectionControl extends LitElement {
60
60
  <div class="container">
61
61
  ${this.renderRipple ? ripple : nothing}
62
62
  <input
63
+ id="input"
63
64
  type=${this.inputType}
64
65
  class="focus-ring"
65
- ?name=${this.name}
66
+ .name=${this.name}
66
67
  .checked=${__classPrivateFieldGet(this, _UmSelectionControl_checked, "f")}
67
68
  .disabled=${this.disabled} />
68
69
  <div class="indicator-container">${this.renderIndicator()}</div>
69
70
  </div>`;
70
71
  }
71
72
  }
72
- _UmSelectionControl_checked = new WeakMap(), _UmSelectionControl_instances = new WeakSet(), _UmSelectionControl_handleClick = function _UmSelectionControl_handleClick() {
73
+ _UmSelectionControl_checked = new WeakMap(), _UmSelectionControl_instances = new WeakSet(), _UmSelectionControl_handleClick = function _UmSelectionControl_handleClick(e) {
74
+ if (e.defaultPrevented) {
75
+ return;
76
+ }
73
77
  this.checked = this.inputType === 'radio' || !this.checked;
78
+ this.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
74
79
  this.dispatchEvent(new Event('change', { bubbles: true }));
75
80
  };
76
81
  UmSelectionControl.formAssociated = true;
@@ -1 +1 @@
1
- {"version":3,"file":"selection-control.js","sourceRoot":"","sources":["../../../src/shared/selection-control/selection-control.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,wBAAwB,CAAC;AAEhC,MAAM,OAAgB,kBAAmB,SAAQ,UAAU;IASzD,2BAA2B;IAC3B,oBAAoB;IAEpB,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;IACpC,CAAC;IAcD,IAAI,OAAO;QACT,OAAO,uBAAA,IAAI,mCAAS,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,KAAc;QACxB,uBAAA,IAAI,+BAAY,KAAK,MAAA,CAAC;QACtB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC;IAED;QACE,KAAK,EAAE,CAAC;;QAhCE,SAAI,GAAuB,EAAE,CAAC;QACA,aAAQ,GAAG,KAAK,CAAC;QAU3D,sCAAW,KAAK,EAAC;QACP,cAAS,GAAyB,UAAU,CAAC;QAC7C,iBAAY,GAAG,IAAI,CAAC;QAI9B;;WAEG;QACS,UAAK,GAAG,IAAI,CAAC;QAavB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IACjD,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,uBAAA,IAAI,sEAAa,CAAC,CAAC;IACpD,CAAC;IAEQ,oBAAoB;QAC3B,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,uBAAA,IAAI,sEAAa,CAAC,CAAA;IACtD,CAAC;IAEkB,MAAM;QACvB,MAAM,MAAM,GAAG,IAAI,CAAA,uBAAuB,IAAI,CAAC,QAAQ,cAAc,CAAC;QAEtE,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;;iBAE7B,IAAI,CAAC,SAAS;;kBAEb,IAAI,CAAC,IAAI;qBACN,uBAAA,IAAI,mCAAS;sBACZ,IAAI,CAAC,QAAQ;2CACQ,IAAI,CAAC,eAAe,EAAE;aACpD,CAAC;IACZ,CAAC;;;IAGC,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3D,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AArEe,iCAAc,GAAG,IAAI,AAAP,CAAQ;AAI1B;IAAX,QAAQ,EAAE;gDAA+B;AACA;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;oDAAkB;AAC3C;IAAf,KAAK,CAAC,OAAO,CAAC;iDAA0B;AAkB7B;IAAX,QAAQ,EAAE;iDAAc;AAGzB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;iDAGzB","sourcesContent":["import { html, HTMLTemplateResult, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\n\nimport '../../ripple/ripple.js';\n\nexport abstract class UmSelectionControl extends LitElement {\n static readonly formAssociated = true;\n\n protected readonly elementInternals: ElementInternals;\n\n @property() name: string | undefined = '';\n @property({type: Boolean, reflect: true}) disabled = false;\n @query('input') input!: HTMLInputElement;\n\n // eslint-disable-next-line\n // #value: any = '';\n\n get form(): HTMLFormElement | null {\n return this.elementInternals.form;\n }\n\n #checked = false;\n protected inputType: 'checkbox' | 'radio' = 'checkbox';\n protected renderRipple = true;\n\n protected abstract renderIndicator(): HTMLTemplateResult;\n\n /**\n * The element value to use in form submission when checked.\n */\n @property() value = 'on';\n\n @property({type: Boolean})\n get checked() {\n return this.#checked;\n }\n set checked(value: boolean) {\n this.#checked = value;\n this.elementInternals.setFormValue(value ? this.value : null);\n }\n\n protected constructor() {\n super();\n this.elementInternals = this.attachInternals();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.#handleClick);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#handleClick)\n }\n\n protected override render(): HTMLTemplateResult {\n const ripple = html`<u-ripple ?disabled=${this.disabled}></u-ripple>`;\n\n return html`\n <div class=\"container\">\n ${this.renderRipple ? ripple : nothing}\n <input\n type=${this.inputType}\n class=\"focus-ring\"\n ?name=${this.name}\n .checked=${this.#checked}\n .disabled=${this.disabled} />\n <div class=\"indicator-container\">${this.renderIndicator()}</div>\n </div>`;\n }\n\n #handleClick() {\n this.checked = this.inputType === 'radio' || !this.checked;\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n}\n"]}
1
+ {"version":3,"file":"selection-control.js","sourceRoot":"","sources":["../../../src/shared/selection-control/selection-control.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,OAAO,EAAE,IAAI,EAAsB,UAAU,EAAE,OAAO,EAAE,MAAM,KAAK,CAAC;AACpE,OAAO,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEpD,OAAO,wBAAwB,CAAC;AAEhC,MAAM,OAAgB,kBAAmB,SAAQ,UAAU;IASzD,2BAA2B;IAC3B,oBAAoB;IAEpB,IAAI,IAAI;QACN,OAAO,IAAI,CAAC,gBAAgB,CAAC,IAAI,CAAC;IACpC,CAAC;IAcD,IAAI,OAAO;QACT,OAAO,uBAAA,IAAI,mCAAS,CAAC;IACvB,CAAC;IACD,IAAI,OAAO,CAAC,KAAc;QACxB,uBAAA,IAAI,+BAAY,KAAK,MAAA,CAAC;QACtB,IAAI,CAAC,gBAAgB,CAAC,YAAY,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC;IAChE,CAAC;IAED;QACE,KAAK,EAAE,CAAC;;QAhCE,SAAI,GAAuB,EAAE,CAAC;QACA,aAAQ,GAAG,KAAK,CAAC;QAU3D,sCAAW,KAAK,EAAC;QACP,cAAS,GAAyB,UAAU,CAAC;QAC7C,iBAAY,GAAG,IAAI,CAAC;QAI9B;;WAEG;QACS,UAAK,GAAG,IAAI,CAAC;QAavB,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,eAAe,EAAE,CAAC;IACjD,CAAC;IAEQ,iBAAiB;QACxB,KAAK,CAAC,iBAAiB,EAAE,CAAC;QAC1B,IAAI,CAAC,gBAAgB,CAAC,OAAO,EAAE,uBAAA,IAAI,sEAAa,CAAC,CAAC;IACpD,CAAC;IAEQ,oBAAoB;QAC3B,KAAK,CAAC,oBAAoB,EAAE,CAAC;QAC7B,IAAI,CAAC,mBAAmB,CAAC,OAAO,EAAE,uBAAA,IAAI,sEAAa,CAAC,CAAA;IACtD,CAAC;IAEkB,MAAM;QACvB,MAAM,MAAM,GAAG,IAAI,CAAA,uBAAuB,IAAI,CAAC,QAAQ,cAAc,CAAC;QAEtE,OAAO,IAAI,CAAA;;UAEL,IAAI,CAAC,YAAY,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO;;;iBAG7B,IAAI,CAAC,SAAS;;kBAEb,IAAI,CAAC,IAAI;qBACN,uBAAA,IAAI,mCAAS;sBACZ,IAAI,CAAC,QAAQ;2CACQ,IAAI,CAAC,eAAe,EAAE;aACpD,CAAC;IACZ,CAAC;;uKAEY,CAAQ;IACnB,IAAI,CAAC,CAAC,gBAAgB,EAAE,CAAC;QACvB,OAAO;IACT,CAAC;IAED,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,SAAS,KAAK,OAAO,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC;IAC3D,IAAI,CAAC,aAAa,CAAC,IAAI,UAAU,CAAC,OAAO,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;IAC7E,IAAI,CAAC,aAAa,CAAC,IAAI,KAAK,CAAC,QAAQ,EAAE,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC;AAC3D,CAAC;AA3Ee,iCAAc,GAAG,IAAI,AAAP,CAAQ;AAI1B;IAAX,QAAQ,EAAE;gDAA+B;AACA;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;oDAAkB;AAC3C;IAAf,KAAK,CAAC,OAAO,CAAC;iDAA0B;AAkB7B;IAAX,QAAQ,EAAE;iDAAc;AAGzB;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;iDAGzB","sourcesContent":["import { html, HTMLTemplateResult, LitElement, nothing } from 'lit';\nimport { property, query } from 'lit/decorators.js';\n\nimport '../../ripple/ripple.js';\n\nexport abstract class UmSelectionControl extends LitElement {\n static readonly formAssociated = true;\n\n protected readonly elementInternals: ElementInternals;\n\n @property() name: string | undefined = '';\n @property({type: Boolean, reflect: true}) disabled = false;\n @query('input') input!: HTMLInputElement;\n\n // eslint-disable-next-line\n // #value: any = '';\n\n get form(): HTMLFormElement | null {\n return this.elementInternals.form;\n }\n\n #checked = false;\n protected inputType: 'checkbox' | 'radio' = 'checkbox';\n protected renderRipple = true;\n\n protected abstract renderIndicator(): HTMLTemplateResult;\n\n /**\n * The element value to use in form submission when checked.\n */\n @property() value = 'on';\n\n @property({type: Boolean})\n get checked() {\n return this.#checked;\n }\n set checked(value: boolean) {\n this.#checked = value;\n this.elementInternals.setFormValue(value ? this.value : null);\n }\n\n protected constructor() {\n super();\n this.elementInternals = this.attachInternals();\n }\n\n override connectedCallback() {\n super.connectedCallback();\n this.addEventListener('click', this.#handleClick);\n }\n\n override disconnectedCallback() {\n super.disconnectedCallback();\n this.removeEventListener('click', this.#handleClick)\n }\n\n protected override render(): HTMLTemplateResult {\n const ripple = html`<u-ripple ?disabled=${this.disabled}></u-ripple>`;\n\n return html`\n <div class=\"container\">\n ${this.renderRipple ? ripple : nothing}\n <input\n id=\"input\"\n type=${this.inputType}\n class=\"focus-ring\"\n .name=${this.name}\n .checked=${this.#checked}\n .disabled=${this.disabled} />\n <div class=\"indicator-container\">${this.renderIndicator()}</div>\n </div>`;\n }\n\n #handleClick(e: Event) {\n if (e.defaultPrevented) {\n return;\n }\n\n this.checked = this.inputType === 'radio' || !this.checked;\n this.dispatchEvent(new InputEvent('input', {bubbles: true, composed: true}));\n this.dispatchEvent(new Event('change', {bubbles: true}));\n }\n}\n"]}