@spectrum-web-components/tabs 0.35.1-rc.43 → 0.37.0

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.
@@ -0,0 +1,923 @@
1
+ {
2
+ "schemaVersion": "1.0.0",
3
+ "readme": "",
4
+ "modules": [
5
+ {
6
+ "kind": "javascript-module",
7
+ "path": "sp-tab-panel.js",
8
+ "declarations": [],
9
+ "exports": [
10
+ {
11
+ "kind": "custom-element-definition",
12
+ "name": "sp-tab-panel",
13
+ "declaration": {
14
+ "name": "TabPanel",
15
+ "module": "/src/TabPanel.js"
16
+ }
17
+ }
18
+ ]
19
+ },
20
+ {
21
+ "kind": "javascript-module",
22
+ "path": "sp-tab.js",
23
+ "declarations": [],
24
+ "exports": [
25
+ {
26
+ "kind": "custom-element-definition",
27
+ "name": "sp-tab",
28
+ "declaration": {
29
+ "name": "Tab",
30
+ "module": "/src/Tab.js"
31
+ }
32
+ }
33
+ ]
34
+ },
35
+ {
36
+ "kind": "javascript-module",
37
+ "path": "sp-tabs-overflow.js",
38
+ "declarations": [],
39
+ "exports": [
40
+ {
41
+ "kind": "custom-element-definition",
42
+ "name": "sp-tabs-overflow",
43
+ "declaration": {
44
+ "name": "TabsOverflow",
45
+ "module": "/src/TabsOverflow.js"
46
+ }
47
+ }
48
+ ]
49
+ },
50
+ {
51
+ "kind": "javascript-module",
52
+ "path": "sp-tabs.js",
53
+ "declarations": [],
54
+ "exports": [
55
+ {
56
+ "kind": "custom-element-definition",
57
+ "name": "sp-tabs",
58
+ "declaration": {
59
+ "name": "Tabs",
60
+ "module": "/src/Tabs.js"
61
+ }
62
+ }
63
+ ]
64
+ },
65
+ {
66
+ "kind": "javascript-module",
67
+ "path": "src/Tab.js",
68
+ "declarations": [
69
+ {
70
+ "kind": "class",
71
+ "description": "",
72
+ "name": "Tab",
73
+ "slots": [
74
+ {
75
+ "description": "text label of the Tab",
76
+ "name": ""
77
+ },
78
+ {
79
+ "description": "The icon that appears on the left of the label",
80
+ "name": "icon"
81
+ }
82
+ ],
83
+ "members": [
84
+ {
85
+ "kind": "field",
86
+ "name": "instanceCount",
87
+ "type": {
88
+ "text": "number"
89
+ },
90
+ "static": true,
91
+ "default": "0",
92
+ "privacy": "private"
93
+ },
94
+ {
95
+ "kind": "field",
96
+ "name": "hasIcon",
97
+ "type": {
98
+ "text": "boolean"
99
+ },
100
+ "privacy": "protected",
101
+ "readonly": true
102
+ },
103
+ {
104
+ "kind": "field",
105
+ "name": "hasLabel",
106
+ "type": {
107
+ "text": "boolean"
108
+ },
109
+ "privacy": "protected",
110
+ "readonly": true
111
+ },
112
+ {
113
+ "kind": "field",
114
+ "name": "disabled",
115
+ "type": {
116
+ "text": "boolean"
117
+ },
118
+ "privacy": "public",
119
+ "default": "false",
120
+ "attribute": "disabled",
121
+ "reflects": true
122
+ },
123
+ {
124
+ "kind": "field",
125
+ "name": "label",
126
+ "type": {
127
+ "text": "string"
128
+ },
129
+ "privacy": "public",
130
+ "default": "''",
131
+ "attribute": "label",
132
+ "reflects": true
133
+ },
134
+ {
135
+ "kind": "field",
136
+ "name": "selected",
137
+ "type": {
138
+ "text": "boolean"
139
+ },
140
+ "privacy": "public",
141
+ "default": "false",
142
+ "attribute": "selected",
143
+ "reflects": true
144
+ },
145
+ {
146
+ "kind": "field",
147
+ "name": "vertical",
148
+ "type": {
149
+ "text": "boolean"
150
+ },
151
+ "privacy": "public",
152
+ "default": "false",
153
+ "attribute": "vertical",
154
+ "reflects": true
155
+ },
156
+ {
157
+ "kind": "field",
158
+ "name": "value",
159
+ "type": {
160
+ "text": "string"
161
+ },
162
+ "privacy": "public",
163
+ "default": "''",
164
+ "attribute": "value",
165
+ "reflects": true
166
+ }
167
+ ],
168
+ "attributes": [
169
+ {
170
+ "name": "disabled",
171
+ "type": {
172
+ "text": "boolean"
173
+ },
174
+ "default": "false",
175
+ "fieldName": "disabled"
176
+ },
177
+ {
178
+ "name": "label",
179
+ "type": {
180
+ "text": "string"
181
+ },
182
+ "default": "''",
183
+ "fieldName": "label"
184
+ },
185
+ {
186
+ "name": "selected",
187
+ "type": {
188
+ "text": "boolean"
189
+ },
190
+ "default": "false",
191
+ "fieldName": "selected"
192
+ },
193
+ {
194
+ "name": "vertical",
195
+ "type": {
196
+ "text": "boolean"
197
+ },
198
+ "default": "false",
199
+ "fieldName": "vertical"
200
+ },
201
+ {
202
+ "name": "value",
203
+ "type": {
204
+ "text": "string"
205
+ },
206
+ "default": "''",
207
+ "fieldName": "value"
208
+ }
209
+ ],
210
+ "mixins": [
211
+ {
212
+ "name": "FocusVisiblePolyfillMixin",
213
+ "package": "@spectrum-web-components/shared"
214
+ },
215
+ {
216
+ "name": "ObserveSlotText",
217
+ "package": "@spectrum-web-components/shared"
218
+ },
219
+ {
220
+ "name": "ObserveSlotPresence",
221
+ "package": "@spectrum-web-components/shared"
222
+ }
223
+ ],
224
+ "superclass": {
225
+ "name": "SpectrumElement",
226
+ "package": "@spectrum-web-components/base"
227
+ },
228
+ "tagName": "sp-tab",
229
+ "customElement": true
230
+ }
231
+ ],
232
+ "exports": [
233
+ {
234
+ "kind": "js",
235
+ "name": "Tab",
236
+ "declaration": {
237
+ "name": "Tab",
238
+ "module": "src/Tab.js"
239
+ }
240
+ }
241
+ ]
242
+ },
243
+ {
244
+ "kind": "javascript-module",
245
+ "path": "src/TabPanel.js",
246
+ "declarations": [
247
+ {
248
+ "kind": "class",
249
+ "description": "",
250
+ "name": "TabPanel",
251
+ "slots": [
252
+ {
253
+ "description": "content of the Tab Panel",
254
+ "name": ""
255
+ }
256
+ ],
257
+ "members": [
258
+ {
259
+ "kind": "field",
260
+ "name": "instanceCount",
261
+ "type": {
262
+ "text": "number"
263
+ },
264
+ "static": true,
265
+ "default": "0",
266
+ "privacy": "private"
267
+ },
268
+ {
269
+ "kind": "field",
270
+ "name": "selected",
271
+ "type": {
272
+ "text": "boolean"
273
+ },
274
+ "privacy": "public",
275
+ "default": "false",
276
+ "attribute": "selected",
277
+ "reflects": true
278
+ },
279
+ {
280
+ "kind": "field",
281
+ "name": "value",
282
+ "type": {
283
+ "text": "string"
284
+ },
285
+ "privacy": "public",
286
+ "default": "''",
287
+ "attribute": "value",
288
+ "reflects": true
289
+ },
290
+ {
291
+ "kind": "method",
292
+ "name": "handleFocusin",
293
+ "privacy": "protected",
294
+ "return": {
295
+ "type": {
296
+ "text": "void"
297
+ }
298
+ }
299
+ },
300
+ {
301
+ "kind": "method",
302
+ "name": "handleFocusout",
303
+ "privacy": "protected",
304
+ "return": {
305
+ "type": {
306
+ "text": "void"
307
+ }
308
+ }
309
+ }
310
+ ],
311
+ "attributes": [
312
+ {
313
+ "name": "selected",
314
+ "type": {
315
+ "text": "boolean"
316
+ },
317
+ "default": "false",
318
+ "fieldName": "selected"
319
+ },
320
+ {
321
+ "name": "value",
322
+ "type": {
323
+ "text": "string"
324
+ },
325
+ "default": "''",
326
+ "fieldName": "value"
327
+ }
328
+ ],
329
+ "superclass": {
330
+ "name": "SpectrumElement",
331
+ "package": "@spectrum-web-components/base"
332
+ },
333
+ "tagName": "sp-tab-panel",
334
+ "customElement": true
335
+ }
336
+ ],
337
+ "exports": [
338
+ {
339
+ "kind": "js",
340
+ "name": "TabPanel",
341
+ "declaration": {
342
+ "name": "TabPanel",
343
+ "module": "src/TabPanel.js"
344
+ }
345
+ }
346
+ ]
347
+ },
348
+ {
349
+ "kind": "javascript-module",
350
+ "path": "src/Tabs.js",
351
+ "declarations": [
352
+ {
353
+ "kind": "variable",
354
+ "name": "ScaledIndicator",
355
+ "type": {
356
+ "text": "object"
357
+ },
358
+ "default": "{\n baseSize: 100 as const,\n noSelectionStyle: 'transform: translateX(0px) scaleX(0) scaleY(0)',\n\n transformX(left: number, width: number): string {\n const scale = width / this.baseSize;\n return `transform: translateX(${left}px) scaleX(${scale});`;\n },\n\n transformY(top: number, height: number): string {\n const scale = height / this.baseSize;\n return `transform: translateY(${top}px) scaleY(${scale});`;\n },\n\n baseStyles(): CSSResult {\n return css`\n :host([direction='vertical-right']) #selection-indicator,\n :host([direction='vertical']) #selection-indicator {\n height: ${this.baseSize}px;\n }\n :host([dir][direction='horizontal']) #selection-indicator {\n width: ${this.baseSize}px;\n }\n `;\n },\n}"
359
+ },
360
+ {
361
+ "kind": "class",
362
+ "description": "",
363
+ "name": "Tabs",
364
+ "cssParts": [
365
+ {
366
+ "description": "Container element for the slotted sp-tab elements",
367
+ "name": "tablist"
368
+ }
369
+ ],
370
+ "slots": [
371
+ {
372
+ "description": "Tab elements to manage as a group",
373
+ "name": ""
374
+ },
375
+ {
376
+ "description": "Tab Panel elements related to the listed Tab elements",
377
+ "name": "tab-panel"
378
+ }
379
+ ],
380
+ "members": [
381
+ {
382
+ "kind": "field",
383
+ "name": "auto",
384
+ "type": {
385
+ "text": "boolean"
386
+ },
387
+ "privacy": "public",
388
+ "default": "false",
389
+ "description": "Whether to activate a tab on keyboard focus or not.\n\nBy default a tab is activated via a \"click\" interaction. This is specifically intended for when\ntab content cannot be displayed instantly, e.g. not all of the DOM content is available, etc.\nTo learn more about \"Deciding When to Make Selection Automatically Follow Focus\", visit:\nhttps://w3c.github.io/aria-practices/#kbd_selection_follows_focus",
390
+ "attribute": "auto"
391
+ },
392
+ {
393
+ "kind": "field",
394
+ "name": "compact",
395
+ "type": {
396
+ "text": "boolean"
397
+ },
398
+ "privacy": "public",
399
+ "default": "false",
400
+ "description": "The tab items are displayed closer together.",
401
+ "attribute": "compact",
402
+ "reflects": true
403
+ },
404
+ {
405
+ "kind": "field",
406
+ "name": "dir",
407
+ "type": {
408
+ "text": "'ltr' | 'rtl'"
409
+ },
410
+ "privacy": "public",
411
+ "attribute": "dir",
412
+ "reflects": true
413
+ },
414
+ {
415
+ "kind": "field",
416
+ "name": "direction",
417
+ "type": {
418
+ "text": "'vertical' | 'vertical-right' | 'horizontal'"
419
+ },
420
+ "privacy": "public",
421
+ "default": "'horizontal'",
422
+ "attribute": "direction",
423
+ "reflects": true
424
+ },
425
+ {
426
+ "kind": "field",
427
+ "name": "emphasized",
428
+ "type": {
429
+ "text": "boolean"
430
+ },
431
+ "privacy": "public",
432
+ "default": "false",
433
+ "attribute": "emphasized",
434
+ "reflects": true
435
+ },
436
+ {
437
+ "kind": "field",
438
+ "name": "label",
439
+ "type": {
440
+ "text": "string"
441
+ },
442
+ "privacy": "public",
443
+ "default": "''",
444
+ "attribute": "label"
445
+ },
446
+ {
447
+ "kind": "field",
448
+ "name": "enableTabsScroll",
449
+ "type": {
450
+ "text": "boolean"
451
+ },
452
+ "privacy": "public",
453
+ "default": "false",
454
+ "attribute": "enableTabsScroll"
455
+ },
456
+ {
457
+ "kind": "field",
458
+ "name": "quiet",
459
+ "type": {
460
+ "text": "boolean"
461
+ },
462
+ "privacy": "public",
463
+ "default": "false",
464
+ "description": "The tab list is displayed without a border.",
465
+ "attribute": "quiet",
466
+ "reflects": true
467
+ },
468
+ {
469
+ "kind": "field",
470
+ "name": "selectionIndicatorStyle",
471
+ "privacy": "public"
472
+ },
473
+ {
474
+ "kind": "field",
475
+ "name": "shouldAnimate",
476
+ "type": {
477
+ "text": "boolean"
478
+ },
479
+ "privacy": "public",
480
+ "default": "false"
481
+ },
482
+ {
483
+ "kind": "field",
484
+ "name": "slotEl",
485
+ "type": {
486
+ "text": "HTMLSlotElement"
487
+ },
488
+ "privacy": "private"
489
+ },
490
+ {
491
+ "kind": "field",
492
+ "name": "tabList",
493
+ "type": {
494
+ "text": "HTMLDivElement"
495
+ },
496
+ "privacy": "private"
497
+ },
498
+ {
499
+ "kind": "field",
500
+ "name": "selected",
501
+ "type": {
502
+ "text": "string"
503
+ },
504
+ "default": "''",
505
+ "attribute": "selected",
506
+ "reflects": true
507
+ },
508
+ {
509
+ "kind": "field",
510
+ "name": "tabs",
511
+ "privacy": "private",
512
+ "type": {
513
+ "text": "Tab[]"
514
+ }
515
+ },
516
+ {
517
+ "kind": "field",
518
+ "name": "_tabs",
519
+ "type": {
520
+ "text": "Tab[]"
521
+ },
522
+ "privacy": "private",
523
+ "default": "[]"
524
+ },
525
+ {
526
+ "kind": "field",
527
+ "name": "resizeController",
528
+ "privacy": "protected",
529
+ "default": "new ResizeController(this, {\n callback: () => {\n this.updateSelectionIndicator();\n },\n })"
530
+ },
531
+ {
532
+ "kind": "field",
533
+ "name": "rovingTabindexController",
534
+ "default": "new RovingTabindexController<Tab>(this, {\n focusInIndex: (elements) => {\n let focusInIndex = 0;\n const firstFocusableElement = elements.find((el, index) => {\n const focusInElement = this.selected\n ? !el.disabled && el.value === this.selected\n : !el.disabled;\n focusInIndex = index;\n return focusInElement;\n });\n return firstFocusableElement ? focusInIndex : -1;\n },\n direction: () => 'both',\n elementEnterAction: (el) => {\n if (!this.auto) return;\n\n this.shouldAnimate = true;\n this.selectTarget(el);\n },\n elements: () => this.tabs,\n isFocusableElement: (el) => !el.disabled,\n listenerScope: () => this.tabList,\n })"
535
+ },
536
+ {
537
+ "kind": "field",
538
+ "name": "focusElement",
539
+ "type": {
540
+ "text": "Tab | this"
541
+ },
542
+ "privacy": "private",
543
+ "readonly": true
544
+ },
545
+ {
546
+ "kind": "method",
547
+ "name": "scrollTabs",
548
+ "privacy": "public",
549
+ "return": {
550
+ "type": {
551
+ "text": "void"
552
+ }
553
+ },
554
+ "parameters": [
555
+ {
556
+ "name": "delta",
557
+ "type": {
558
+ "text": "number"
559
+ }
560
+ },
561
+ {
562
+ "name": "behavior",
563
+ "default": "'smooth'",
564
+ "type": {
565
+ "text": "ScrollBehavior"
566
+ }
567
+ }
568
+ ]
569
+ },
570
+ {
571
+ "kind": "field",
572
+ "name": "scrollState",
573
+ "type": {
574
+ "text": "Record<string, boolean>"
575
+ },
576
+ "privacy": "public",
577
+ "readonly": true
578
+ },
579
+ {
580
+ "kind": "method",
581
+ "name": "manageAutoFocus",
582
+ "privacy": "protected",
583
+ "return": {
584
+ "type": {
585
+ "text": "void"
586
+ }
587
+ }
588
+ },
589
+ {
590
+ "kind": "method",
591
+ "name": "managePanels",
592
+ "privacy": "protected",
593
+ "return": {
594
+ "type": {
595
+ "text": "void"
596
+ }
597
+ },
598
+ "parameters": [
599
+ {
600
+ "name": "{\n target,\n }",
601
+ "type": {
602
+ "text": "Event & { target: HTMLSlotElement }"
603
+ }
604
+ }
605
+ ]
606
+ },
607
+ {
608
+ "kind": "field",
609
+ "name": "onTabsScroll",
610
+ "privacy": "private"
611
+ },
612
+ {
613
+ "kind": "field",
614
+ "name": "onClick",
615
+ "privacy": "private"
616
+ },
617
+ {
618
+ "kind": "field",
619
+ "name": "onKeyDown",
620
+ "privacy": "private"
621
+ },
622
+ {
623
+ "kind": "method",
624
+ "name": "selectTarget",
625
+ "privacy": "private",
626
+ "return": {
627
+ "type": {
628
+ "text": "void"
629
+ }
630
+ },
631
+ "parameters": [
632
+ {
633
+ "name": "target",
634
+ "type": {
635
+ "text": "HTMLElement"
636
+ }
637
+ }
638
+ ]
639
+ },
640
+ {
641
+ "kind": "method",
642
+ "name": "onSlotChange",
643
+ "privacy": "private",
644
+ "return": {
645
+ "type": {
646
+ "text": "void"
647
+ }
648
+ }
649
+ },
650
+ {
651
+ "kind": "field",
652
+ "name": "updateCheckedState",
653
+ "privacy": "private"
654
+ },
655
+ {
656
+ "kind": "field",
657
+ "name": "updateSelectionIndicator",
658
+ "privacy": "private"
659
+ }
660
+ ],
661
+ "events": [
662
+ {
663
+ "name": "change",
664
+ "type": {
665
+ "text": "Event"
666
+ },
667
+ "description": "The selected Tab child has changed."
668
+ }
669
+ ],
670
+ "attributes": [
671
+ {
672
+ "name": "auto",
673
+ "type": {
674
+ "text": "boolean"
675
+ },
676
+ "default": "false",
677
+ "description": "Whether to activate a tab on keyboard focus or not.\n\nBy default a tab is activated via a \"click\" interaction. This is specifically intended for when\ntab content cannot be displayed instantly, e.g. not all of the DOM content is available, etc.\nTo learn more about \"Deciding When to Make Selection Automatically Follow Focus\", visit:\nhttps://w3c.github.io/aria-practices/#kbd_selection_follows_focus",
678
+ "fieldName": "auto"
679
+ },
680
+ {
681
+ "name": "compact",
682
+ "type": {
683
+ "text": "boolean"
684
+ },
685
+ "default": "false",
686
+ "description": "The tab items are displayed closer together.",
687
+ "fieldName": "compact"
688
+ },
689
+ {
690
+ "name": "dir",
691
+ "type": {
692
+ "text": "'ltr' | 'rtl'"
693
+ },
694
+ "fieldName": "dir"
695
+ },
696
+ {
697
+ "name": "direction",
698
+ "type": {
699
+ "text": "'vertical' | 'vertical-right' | 'horizontal'"
700
+ },
701
+ "default": "'horizontal'",
702
+ "fieldName": "direction"
703
+ },
704
+ {
705
+ "name": "emphasized",
706
+ "type": {
707
+ "text": "boolean"
708
+ },
709
+ "default": "false",
710
+ "fieldName": "emphasized"
711
+ },
712
+ {
713
+ "name": "label",
714
+ "type": {
715
+ "text": "string"
716
+ },
717
+ "default": "''",
718
+ "fieldName": "label"
719
+ },
720
+ {
721
+ "name": "enableTabsScroll",
722
+ "type": {
723
+ "text": "boolean"
724
+ },
725
+ "default": "false",
726
+ "fieldName": "enableTabsScroll"
727
+ },
728
+ {
729
+ "name": "quiet",
730
+ "type": {
731
+ "text": "boolean"
732
+ },
733
+ "default": "false",
734
+ "description": "The tab list is displayed without a border.",
735
+ "fieldName": "quiet"
736
+ },
737
+ {
738
+ "name": "selected",
739
+ "type": {
740
+ "text": "string"
741
+ },
742
+ "default": "''",
743
+ "fieldName": "selected"
744
+ }
745
+ ],
746
+ "mixins": [
747
+ {
748
+ "name": "SizedMixin",
749
+ "package": "@spectrum-web-components/base"
750
+ }
751
+ ],
752
+ "superclass": {
753
+ "name": "Focusable",
754
+ "package": "@spectrum-web-components/shared"
755
+ },
756
+ "tagName": "sp-tabs",
757
+ "customElement": true
758
+ }
759
+ ],
760
+ "exports": [
761
+ {
762
+ "kind": "js",
763
+ "name": "ScaledIndicator",
764
+ "declaration": {
765
+ "name": "ScaledIndicator",
766
+ "module": "src/Tabs.js"
767
+ }
768
+ },
769
+ {
770
+ "kind": "js",
771
+ "name": "Tabs",
772
+ "declaration": {
773
+ "name": "Tabs",
774
+ "module": "src/Tabs.js"
775
+ }
776
+ }
777
+ ]
778
+ },
779
+ {
780
+ "kind": "javascript-module",
781
+ "path": "src/TabsOverflow.js",
782
+ "declarations": [
783
+ {
784
+ "kind": "class",
785
+ "description": "",
786
+ "name": "TabsOverflow",
787
+ "members": [
788
+ {
789
+ "kind": "field",
790
+ "name": "compact",
791
+ "type": {
792
+ "text": "boolean"
793
+ },
794
+ "default": "false",
795
+ "attribute": "compact",
796
+ "reflects": true
797
+ },
798
+ {
799
+ "kind": "field",
800
+ "name": "dir",
801
+ "type": {
802
+ "text": "'ltr' | 'rtl'"
803
+ },
804
+ "privacy": "public",
805
+ "attribute": "dir",
806
+ "reflects": true
807
+ },
808
+ {
809
+ "kind": "field",
810
+ "name": "overflowState",
811
+ "type": {
812
+ "text": "TabsOverflowState"
813
+ },
814
+ "privacy": "private",
815
+ "default": "{\n canScrollLeft: false,\n canScrollRight: false,\n }"
816
+ },
817
+ {
818
+ "kind": "field",
819
+ "name": "scrollContent",
820
+ "type": {
821
+ "text": "Tabs[]"
822
+ },
823
+ "privacy": "private"
824
+ },
825
+ {
826
+ "kind": "field",
827
+ "name": "overflowContainer",
828
+ "type": {
829
+ "text": "HTMLDivElement"
830
+ },
831
+ "privacy": "private"
832
+ },
833
+ {
834
+ "kind": "field",
835
+ "name": "resizeController",
836
+ "type": {
837
+ "text": "ResizeController"
838
+ },
839
+ "default": "new ResizeController(this, {\n target: this,\n callback: (): void => {\n this._updateScrollState();\n },\n })"
840
+ },
841
+ {
842
+ "kind": "method",
843
+ "name": "_handleSlotChange",
844
+ "privacy": "private",
845
+ "return": {
846
+ "type": {
847
+ "text": "Promise<void>"
848
+ }
849
+ }
850
+ },
851
+ {
852
+ "kind": "method",
853
+ "name": "_updateScrollState",
854
+ "privacy": "private",
855
+ "return": {
856
+ "type": {
857
+ "text": "void"
858
+ }
859
+ }
860
+ },
861
+ {
862
+ "kind": "method",
863
+ "name": "_handleScrollClick",
864
+ "privacy": "private",
865
+ "return": {
866
+ "type": {
867
+ "text": "void"
868
+ }
869
+ },
870
+ "parameters": [
871
+ {
872
+ "name": "event",
873
+ "type": {
874
+ "text": "MouseEvent"
875
+ }
876
+ }
877
+ ]
878
+ }
879
+ ],
880
+ "attributes": [
881
+ {
882
+ "name": "compact",
883
+ "type": {
884
+ "text": "boolean"
885
+ },
886
+ "default": "false",
887
+ "fieldName": "compact"
888
+ },
889
+ {
890
+ "name": "dir",
891
+ "type": {
892
+ "text": "'ltr' | 'rtl'"
893
+ },
894
+ "fieldName": "dir"
895
+ }
896
+ ],
897
+ "mixins": [
898
+ {
899
+ "name": "SizedMixin",
900
+ "package": "@spectrum-web-components/base"
901
+ }
902
+ ],
903
+ "superclass": {
904
+ "name": "SpectrumElement",
905
+ "package": "@spectrum-web-components/base"
906
+ },
907
+ "tagName": "sp-tabs-overflow",
908
+ "customElement": true
909
+ }
910
+ ],
911
+ "exports": [
912
+ {
913
+ "kind": "js",
914
+ "name": "TabsOverflow",
915
+ "declaration": {
916
+ "name": "TabsOverflow",
917
+ "module": "src/TabsOverflow.js"
918
+ }
919
+ }
920
+ ]
921
+ }
922
+ ]
923
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spectrum-web-components/tabs",
3
- "version": "0.35.1-rc.43+432051b80",
3
+ "version": "0.37.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -86,14 +86,14 @@
86
86
  ],
87
87
  "dependencies": {
88
88
  "@lit-labs/observers": "^2.0.0",
89
- "@spectrum-web-components/base": "^0.35.1-rc.43+432051b80",
90
- "@spectrum-web-components/icon": "^0.35.1-rc.43+432051b80",
91
- "@spectrum-web-components/icons-ui": "^0.35.1-rc.43+432051b80",
92
- "@spectrum-web-components/reactive-controllers": "^0.35.1-rc.43+432051b80",
93
- "@spectrum-web-components/shared": "^0.35.1-rc.43+432051b80"
89
+ "@spectrum-web-components/base": "^0.37.0",
90
+ "@spectrum-web-components/icon": "^0.37.0",
91
+ "@spectrum-web-components/icons-ui": "^0.37.0",
92
+ "@spectrum-web-components/reactive-controllers": "^0.37.0",
93
+ "@spectrum-web-components/shared": "^0.37.0"
94
94
  },
95
95
  "devDependencies": {
96
- "@spectrum-css/tabs": "^4.0.2"
96
+ "@spectrum-css/tabs": "^4.0.8"
97
97
  },
98
98
  "types": "./src/index.d.ts",
99
99
  "customElements": "custom-elements.json",
@@ -101,5 +101,5 @@
101
101
  "./sp-*.js",
102
102
  "./**/*.dev.js"
103
103
  ],
104
- "gitHead": "432051b8085e7c86032333fa296bfa5334d47d84"
104
+ "gitHead": "d771f62f0d8063070af43283bb0fd5e3400bad06"
105
105
  }
package/src/TabPanel.d.ts CHANGED
@@ -12,6 +12,8 @@ export declare class TabPanel extends SpectrumElement {
12
12
  static instanceCount: number;
13
13
  selected: boolean;
14
14
  value: string;
15
+ protected handleFocusin(): void;
16
+ protected handleFocusout(): void;
15
17
  protected render(): TemplateResult;
16
18
  protected firstUpdated(): void;
17
19
  protected updated(changes: PropertyValues<this>): void;
@@ -22,9 +22,18 @@ const _TabPanel = class _TabPanel extends SpectrumElement {
22
22
  this.selected = false;
23
23
  this.value = "";
24
24
  }
25
+ handleFocusin() {
26
+ this.removeAttribute("tabindex");
27
+ }
28
+ handleFocusout() {
29
+ this.tabIndex = this.selected ? 0 : -1;
30
+ }
25
31
  render() {
26
32
  return html`
27
- <slot></slot>
33
+ <slot
34
+ @focusin=${this.handleFocusin}
35
+ @focusout=${this.handleFocusout}
36
+ ></slot>
28
37
  `;
29
38
  }
30
39
  firstUpdated() {
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["TabPanel.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport panelStyles from './tab-panel.css.js';\n\n/**\n * @element sp-tab-panel\n *\n * @slot - content of the Tab Panel\n */\nexport class TabPanel extends SpectrumElement {\n static override styles = [panelStyles];\n\n /**\n * @private\n */\n static instanceCount = 0;\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: String, reflect: true })\n public value = '';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected override firstUpdated(): void {\n this.slot = 'tab-panel';\n this.setAttribute('role', 'tabpanel');\n this.tabIndex = 0;\n if (!this.hasAttribute('id')) {\n this.id = `sp-tab-panel-${TabPanel.instanceCount++}`;\n }\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n if (changes.has('selected')) {\n if (this.selected) {\n this.removeAttribute('aria-hidden');\n this.tabIndex = 0;\n } else {\n this.setAttribute('aria-hidden', 'true');\n this.tabIndex = -1;\n }\n }\n }\n}\n"],
5
- "mappings": ";;;;;;;;;;;;AAYA;AAAA,EACI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AAEzB,OAAO,iBAAiB;AAOjB,MAAM,YAAN,MAAM,kBAAiB,gBAAgB;AAAA,EAAvC;AAAA;AASH,SAAO,WAAW;AAGlB,SAAO,QAAQ;AAAA;AAAA,EAEI,SAAyB;AACxC,WAAO;AAAA;AAAA;AAAA,EAGX;AAAA,EAEmB,eAAqB;AACpC,SAAK,OAAO;AACZ,SAAK,aAAa,QAAQ,UAAU;AACpC,SAAK,WAAW;AAChB,QAAI,CAAC,KAAK,aAAa,IAAI,GAAG;AAC1B,WAAK,KAAK,gBAAgB,UAAS,eAAe;AAAA,IACtD;AAAA,EACJ;AAAA,EAEmB,QAAQ,SAAqC;AAC5D,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,UAAI,KAAK,UAAU;AACf,aAAK,gBAAgB,aAAa;AAClC,aAAK,WAAW;AAAA,MACpB,OAAO;AACH,aAAK,aAAa,eAAe,MAAM;AACvC,aAAK,WAAW;AAAA,MACpB;AAAA,IACJ;AAAA,EACJ;AACJ;AAxCa,UACO,SAAS,CAAC,WAAW;AAAA;AAAA;AAAA;AAD5B,UAMF,gBAAgB;AAGhB;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GARjC,UASF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAXhC,UAYF;AAZJ,WAAM,WAAN;",
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport panelStyles from './tab-panel.css.js';\n\n/**\n * @element sp-tab-panel\n *\n * @slot - content of the Tab Panel\n */\nexport class TabPanel extends SpectrumElement {\n static override styles = [panelStyles];\n\n /**\n * @private\n */\n static instanceCount = 0;\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: String, reflect: true })\n public value = '';\n\n protected handleFocusin(): void {\n this.removeAttribute('tabindex');\n }\n\n protected handleFocusout(): void {\n this.tabIndex = this.selected ? 0 : -1;\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n ></slot>\n `;\n }\n\n protected override firstUpdated(): void {\n this.slot = 'tab-panel';\n this.setAttribute('role', 'tabpanel');\n this.tabIndex = 0;\n if (!this.hasAttribute('id')) {\n this.id = `sp-tab-panel-${TabPanel.instanceCount++}`;\n }\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n if (changes.has('selected')) {\n if (this.selected) {\n this.removeAttribute('aria-hidden');\n this.tabIndex = 0;\n } else {\n this.setAttribute('aria-hidden', 'true');\n this.tabIndex = -1;\n }\n }\n }\n}\n"],
5
+ "mappings": ";;;;;;;;;;;;AAYA;AAAA,EACI;AAAA,EAEA;AAAA,OAEG;AACP,SAAS,gBAAgB;AAEzB,OAAO,iBAAiB;AAOjB,MAAM,YAAN,MAAM,kBAAiB,gBAAgB;AAAA,EAAvC;AAAA;AASH,SAAO,WAAW;AAGlB,SAAO,QAAQ;AAAA;AAAA,EAEL,gBAAsB;AAC5B,SAAK,gBAAgB,UAAU;AAAA,EACnC;AAAA,EAEU,iBAAuB;AAC7B,SAAK,WAAW,KAAK,WAAW,IAAI;AAAA,EACxC;AAAA,EAEmB,SAAyB;AACxC,WAAO;AAAA;AAAA,2BAEY,KAAK,aAAa;AAAA,4BACjB,KAAK,cAAc;AAAA;AAAA;AAAA,EAG3C;AAAA,EAEmB,eAAqB;AACpC,SAAK,OAAO;AACZ,SAAK,aAAa,QAAQ,UAAU;AACpC,SAAK,WAAW;AAChB,QAAI,CAAC,KAAK,aAAa,IAAI,GAAG;AAC1B,WAAK,KAAK,gBAAgB,UAAS,eAAe;AAAA,IACtD;AAAA,EACJ;AAAA,EAEmB,QAAQ,SAAqC;AAC5D,QAAI,QAAQ,IAAI,UAAU,GAAG;AACzB,UAAI,KAAK,UAAU;AACf,aAAK,gBAAgB,aAAa;AAClC,aAAK,WAAW;AAAA,MACpB,OAAO;AACH,aAAK,aAAa,eAAe,MAAM;AACvC,aAAK,WAAW;AAAA,MACpB;AAAA,IACJ;AAAA,EACJ;AACJ;AAnDa,UACO,SAAS,CAAC,WAAW;AAAA;AAAA;AAAA;AAD5B,UAMF,gBAAgB;AAGhB;AAAA,EADN,SAAS,EAAE,MAAM,SAAS,SAAS,KAAK,CAAC;AAAA,GARjC,UASF;AAGA;AAAA,EADN,SAAS,EAAE,MAAM,QAAQ,SAAS,KAAK,CAAC;AAAA,GAXhC,UAYF;AAZJ,WAAM,WAAN;",
6
6
  "names": []
7
7
  }
package/src/TabPanel.js CHANGED
@@ -1,4 +1,7 @@
1
- "use strict";var u=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=(p,r,i,s)=>{for(var t=s>1?void 0:s?c(r,i):r,o=p.length-1,d;o>=0;o--)(d=p[o])&&(t=(s?d(r,i,t):d(t))||t);return s&&t&&u(r,i,t),t};import{html as h,SpectrumElement as n}from"@spectrum-web-components/base";import{property as a}from"@spectrum-web-components/base/src/decorators.js";import m from"./tab-panel.css.js";const e=class e extends n{constructor(){super(...arguments);this.selected=!1;this.value=""}render(){return h`
2
- <slot></slot>
3
- `}firstUpdated(){this.slot="tab-panel",this.setAttribute("role","tabpanel"),this.tabIndex=0,this.hasAttribute("id")||(this.id=`sp-tab-panel-${e.instanceCount++}`)}updated(i){i.has("selected")&&(this.selected?(this.removeAttribute("aria-hidden"),this.tabIndex=0):(this.setAttribute("aria-hidden","true"),this.tabIndex=-1))}};e.styles=[m],e.instanceCount=0,l([a({type:Boolean,reflect:!0})],e.prototype,"selected",2),l([a({type:String,reflect:!0})],e.prototype,"value",2);export let TabPanel=e;
1
+ "use strict";var a=Object.defineProperty;var c=Object.getOwnPropertyDescriptor;var l=(u,i,s,r)=>{for(var t=r>1?void 0:r?c(i,s):i,o=u.length-1,d;o>=0;o--)(d=u[o])&&(t=(r?d(i,s,t):d(t))||t);return r&&t&&a(i,s,t),t};import{html as h,SpectrumElement as n}from"@spectrum-web-components/base";import{property as p}from"@spectrum-web-components/base/src/decorators.js";import m from"./tab-panel.css.js";const e=class e extends n{constructor(){super(...arguments);this.selected=!1;this.value=""}handleFocusin(){this.removeAttribute("tabindex")}handleFocusout(){this.tabIndex=this.selected?0:-1}render(){return h`
2
+ <slot
3
+ @focusin=${this.handleFocusin}
4
+ @focusout=${this.handleFocusout}
5
+ ></slot>
6
+ `}firstUpdated(){this.slot="tab-panel",this.setAttribute("role","tabpanel"),this.tabIndex=0,this.hasAttribute("id")||(this.id=`sp-tab-panel-${e.instanceCount++}`)}updated(s){s.has("selected")&&(this.selected?(this.removeAttribute("aria-hidden"),this.tabIndex=0):(this.setAttribute("aria-hidden","true"),this.tabIndex=-1))}};e.styles=[m],e.instanceCount=0,l([p({type:Boolean,reflect:!0})],e.prototype,"selected",2),l([p({type:String,reflect:!0})],e.prototype,"value",2);export let TabPanel=e;
4
7
  //# sourceMappingURL=TabPanel.js.map
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["TabPanel.ts"],
4
- "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport panelStyles from './tab-panel.css.js';\n\n/**\n * @element sp-tab-panel\n *\n * @slot - content of the Tab Panel\n */\nexport class TabPanel extends SpectrumElement {\n static override styles = [panelStyles];\n\n /**\n * @private\n */\n static instanceCount = 0;\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: String, reflect: true })\n public value = '';\n\n protected override render(): TemplateResult {\n return html`\n <slot></slot>\n `;\n }\n\n protected override firstUpdated(): void {\n this.slot = 'tab-panel';\n this.setAttribute('role', 'tabpanel');\n this.tabIndex = 0;\n if (!this.hasAttribute('id')) {\n this.id = `sp-tab-panel-${TabPanel.instanceCount++}`;\n }\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n if (changes.has('selected')) {\n if (this.selected) {\n this.removeAttribute('aria-hidden');\n this.tabIndex = 0;\n } else {\n this.setAttribute('aria-hidden', 'true');\n this.tabIndex = -1;\n }\n }\n }\n}\n"],
5
- "mappings": "qNAYA,OACI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDAEzB,OAAOC,MAAiB,qBAOjB,MAAMC,EAAN,MAAMA,UAAiBH,CAAgB,CAAvC,kCASH,KAAO,SAAW,GAGlB,KAAO,MAAQ,GAEI,QAAyB,CACxC,OAAOD;AAAA;AAAA,SAGX,CAEmB,cAAqB,CACpC,KAAK,KAAO,YACZ,KAAK,aAAa,OAAQ,UAAU,EACpC,KAAK,SAAW,EACX,KAAK,aAAa,IAAI,IACvB,KAAK,GAAK,gBAAgBI,EAAS,eAAe,GAE1D,CAEmB,QAAQC,EAAqC,CACxDA,EAAQ,IAAI,UAAU,IAClB,KAAK,UACL,KAAK,gBAAgB,aAAa,EAClC,KAAK,SAAW,IAEhB,KAAK,aAAa,cAAe,MAAM,EACvC,KAAK,SAAW,IAG5B,CACJ,EAxCaD,EACO,OAAS,CAACD,CAAW,EAD5BC,EAMF,cAAgB,EAGhBE,EAAA,CADNJ,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GARjCE,EASF,wBAGAE,EAAA,CADNJ,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAXhCE,EAYF,qBAZJ,WAAM,SAANA",
4
+ "sourcesContent": ["/*\nCopyright 2020 Adobe. All rights reserved.\nThis file is licensed to you under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License. You may obtain a copy\nof the License at http://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software distributed under\nthe License is distributed on an \"AS IS\" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS\nOF ANY KIND, either express or implied. See the License for the specific language\ngoverning permissions and limitations under the License.\n*/\n\nimport {\n html,\n PropertyValues,\n SpectrumElement,\n TemplateResult,\n} from '@spectrum-web-components/base';\nimport { property } from '@spectrum-web-components/base/src/decorators.js';\n\nimport panelStyles from './tab-panel.css.js';\n\n/**\n * @element sp-tab-panel\n *\n * @slot - content of the Tab Panel\n */\nexport class TabPanel extends SpectrumElement {\n static override styles = [panelStyles];\n\n /**\n * @private\n */\n static instanceCount = 0;\n\n @property({ type: Boolean, reflect: true })\n public selected = false;\n\n @property({ type: String, reflect: true })\n public value = '';\n\n protected handleFocusin(): void {\n this.removeAttribute('tabindex');\n }\n\n protected handleFocusout(): void {\n this.tabIndex = this.selected ? 0 : -1;\n }\n\n protected override render(): TemplateResult {\n return html`\n <slot\n @focusin=${this.handleFocusin}\n @focusout=${this.handleFocusout}\n ></slot>\n `;\n }\n\n protected override firstUpdated(): void {\n this.slot = 'tab-panel';\n this.setAttribute('role', 'tabpanel');\n this.tabIndex = 0;\n if (!this.hasAttribute('id')) {\n this.id = `sp-tab-panel-${TabPanel.instanceCount++}`;\n }\n }\n\n protected override updated(changes: PropertyValues<this>): void {\n if (changes.has('selected')) {\n if (this.selected) {\n this.removeAttribute('aria-hidden');\n this.tabIndex = 0;\n } else {\n this.setAttribute('aria-hidden', 'true');\n this.tabIndex = -1;\n }\n }\n }\n}\n"],
5
+ "mappings": "qNAYA,OACI,QAAAA,EAEA,mBAAAC,MAEG,gCACP,OAAS,YAAAC,MAAgB,kDAEzB,OAAOC,MAAiB,qBAOjB,MAAMC,EAAN,MAAMA,UAAiBH,CAAgB,CAAvC,kCASH,KAAO,SAAW,GAGlB,KAAO,MAAQ,GAEL,eAAsB,CAC5B,KAAK,gBAAgB,UAAU,CACnC,CAEU,gBAAuB,CAC7B,KAAK,SAAW,KAAK,SAAW,EAAI,EACxC,CAEmB,QAAyB,CACxC,OAAOD;AAAA;AAAA,2BAEY,KAAK,aAAa;AAAA,4BACjB,KAAK,cAAc;AAAA;AAAA,SAG3C,CAEmB,cAAqB,CACpC,KAAK,KAAO,YACZ,KAAK,aAAa,OAAQ,UAAU,EACpC,KAAK,SAAW,EACX,KAAK,aAAa,IAAI,IACvB,KAAK,GAAK,gBAAgBI,EAAS,eAAe,GAE1D,CAEmB,QAAQC,EAAqC,CACxDA,EAAQ,IAAI,UAAU,IAClB,KAAK,UACL,KAAK,gBAAgB,aAAa,EAClC,KAAK,SAAW,IAEhB,KAAK,aAAa,cAAe,MAAM,EACvC,KAAK,SAAW,IAG5B,CACJ,EAnDaD,EACO,OAAS,CAACD,CAAW,EAD5BC,EAMF,cAAgB,EAGhBE,EAAA,CADNJ,EAAS,CAAE,KAAM,QAAS,QAAS,EAAK,CAAC,GARjCE,EASF,wBAGAE,EAAA,CADNJ,EAAS,CAAE,KAAM,OAAQ,QAAS,EAAK,CAAC,GAXhCE,EAYF,qBAZJ,WAAM,SAANA",
6
6
  "names": ["html", "SpectrumElement", "property", "panelStyles", "_TabPanel", "changes", "__decorateClass"]
7
7
  }