@blueprintui/grid 0.0.0 → 0.0.2
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/cell/element.css.js +1 -1
- package/column/element.d.ts +3 -0
- package/custom-elements.json +46 -291
- package/grid/element.d.ts +13 -7
- package/grid/element.js +1 -1
- package/include/keynav.js +1 -1
- package/internals/index.d.ts +0 -2
- package/internals/index.js +1 -1
- package/internals/utils/events.d.ts +0 -1
- package/internals/utils/events.js +1 -1
- package/package.json +7 -3
- package/row/element.d.ts +2 -0
- package/internals/controllers/key-grid.controller.d.ts +0 -19
- package/internals/controllers/key-grid.controller.js +0 -1
- package/internals/controllers/key.utils.d.ts +0 -9
- package/internals/controllers/key.utils.js +0 -1
- package/internals/utils/dom.d.ts +0 -2
- package/internals/utils/dom.js +0 -1
- package/internals/utils/focus.js +0 -1
- package/internals/utils/keynav.d.ts +0 -11
- package/internals/utils/keynav.js +0 -1
- package/internals/utils/traversal.js +0 -1
package/cell/element.css.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const t=new CSSStyleSheet;t.replaceSync(":host{--border-right:var(--cell-border-width) solid var(--bp-object-border-color-100);--border-left:0;--min-width:var(--bp-size-9);--min-height:var(--bp-size-9);--font-size:var(--bp-text-size-200);--justify-content:var(--cell-justify-content, start);--padding-block:var(--bp-size-4);--padding-inline:var(--bp-size-6);--color:var(--bp-text-color-500);display:block;height:100%;outline:0!important;position:sticky}slot{justify-content:var(--justify-content);border-left:var(--border-left);background:var(--background);background-image:linear-gradient(hsla(0deg,0%,0%,var(--bp-interaction-offset))0 0)!important;box-shadow:var(--box-shadow);border-right:var(--border-right);min-width:var(--min-width);min-height:var(--min-height);font-size:var(--font-size);padding-inline:var(--padding-inline);padding-block:var(--padding-block);color:var(--color);text-align:left;display:flex;gap:var(--bp-space-sm);line-height:1em;align-items:center;width:100%;height:100%;position:relative}:host([type='action']){--padding-block:0;--padding-inline-start:0;--padding-inline-end:0}:host([type='action']) slot{justify-content:center;min-width:var(--bp-size-8)}:host([highlight]) slot::after{display:block;position:absolute;inset:0;background:var(--bp-interaction-highlight-background);content:\"\";pointer-events:none}[focusable]{outline-offset:calc(var(--bp-size-2)*-1)!important}@media not all and (min-resolution:.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){[focusable]{outline-offset:calc(var(--bp-size-3)*-1)!important}}}:host([type='action']:focus-within) [focusable]{outline:var(--bp-interaction-outline-webkit)!important;outline-offset:calc(var(--bp-size-2)*-1)!important}:host([type='action']:focus-within) ::slotted(*){outline:0!important;--bp-interaction-outline-webkit:none!important;--bp-interaction-outline-offset:none!important}:host(:focus) [focusable]{outline:var(--bp-interaction-outline-webkit);outline-offset:calc(var(--bp-size-2)*-1)!important}:host([role='rowheader']){--bp-interaction-offset:
|
|
1
|
+
const t=new CSSStyleSheet;t.replaceSync(":host{--border-right:var(--cell-border-width) solid var(--bp-object-border-color-100);--border-left:0;--min-width:var(--bp-size-9);--min-height:var(--bp-size-9);--font-size:var(--bp-text-size-200);--justify-content:var(--cell-justify-content, start);--padding-block:var(--bp-size-4);--padding-inline:var(--bp-size-6);--color:var(--bp-text-color-500);display:block;height:100%;outline:0!important;position:sticky}slot{justify-content:var(--justify-content);border-left:var(--border-left);background:var(--background);background-image:linear-gradient(hsla(0deg,0%,0%,var(--bp-interaction-offset))0 0)!important;box-shadow:var(--box-shadow);border-right:var(--border-right);min-width:var(--min-width);min-height:var(--min-height);font-size:var(--font-size);padding-inline:var(--padding-inline);padding-block:var(--padding-block);color:var(--color);text-align:left;display:flex;gap:var(--bp-space-sm);line-height:1em;align-items:center;width:100%;height:100%;position:relative}:host([type='action']){--padding-block:0;--padding-inline-start:0;--padding-inline-end:0}:host([type='action']) slot{justify-content:center;min-width:var(--bp-size-8)}:host([highlight]) slot::after{display:block;position:absolute;inset:0;background:var(--bp-interaction-highlight-background);content:\"\";pointer-events:none}[focusable]{outline-offset:calc(var(--bp-size-2)*-1)!important}@media not all and (min-resolution:.001dpcm){@supports (-webkit-appearance:none) and (stroke-color:transparent){[focusable]{outline-offset:calc(var(--bp-size-3)*-1)!important}}}:host([type='action']:focus-within) [focusable]{outline:var(--bp-interaction-outline-webkit)!important;outline-offset:calc(var(--bp-size-2)*-1)!important}:host([type='action']:focus-within) ::slotted(*){outline:0!important;--bp-interaction-outline-webkit:none!important;--bp-interaction-outline-offset:none!important}:host(:focus) [focusable]{outline:var(--bp-interaction-outline-webkit);outline-offset:calc(var(--bp-size-2)*-1)!important}:host([role='rowheader']){--bp-interaction-offset:var(--bp-interaction-selected-offset);--cell-border-width:var(--bp-size-1)}");export{t as default};
|
package/column/element.d.ts
CHANGED
|
@@ -19,8 +19,11 @@ import { LitElement } from 'lit';
|
|
|
19
19
|
*/
|
|
20
20
|
export declare class BpGridColumn extends LitElement {
|
|
21
21
|
#private;
|
|
22
|
+
/** control width of grid column via numeric or CSS value types */
|
|
22
23
|
width: string;
|
|
24
|
+
/** determine if given column type for various action features */
|
|
23
25
|
type: '' | 'action';
|
|
26
|
+
/** position individual column relative to the grid scroll container */
|
|
24
27
|
position: '' | 'sticky' | 'fixed';
|
|
25
28
|
static styles: CSSStyleSheet[];
|
|
26
29
|
render(): import("lit-html").TemplateResult<1>;
|
package/custom-elements.json
CHANGED
|
@@ -141,6 +141,7 @@
|
|
|
141
141
|
"type": {
|
|
142
142
|
"text": "string"
|
|
143
143
|
},
|
|
144
|
+
"description": "control width of grid column via numeric or CSS value types",
|
|
144
145
|
"attribute": "width"
|
|
145
146
|
},
|
|
146
147
|
{
|
|
@@ -149,6 +150,7 @@
|
|
|
149
150
|
"type": {
|
|
150
151
|
"text": "'' | 'action'"
|
|
151
152
|
},
|
|
153
|
+
"description": "determine if given column type for various action features",
|
|
152
154
|
"attribute": "type",
|
|
153
155
|
"reflects": true
|
|
154
156
|
},
|
|
@@ -159,6 +161,7 @@
|
|
|
159
161
|
"text": "'' | 'sticky' | 'fixed'"
|
|
160
162
|
},
|
|
161
163
|
"default": "''",
|
|
164
|
+
"description": "position individual column relative to the grid scroll container",
|
|
162
165
|
"attribute": "position",
|
|
163
166
|
"reflects": true
|
|
164
167
|
},
|
|
@@ -190,6 +193,7 @@
|
|
|
190
193
|
"type": {
|
|
191
194
|
"text": "string"
|
|
192
195
|
},
|
|
196
|
+
"description": "control width of grid column via numeric or CSS value types",
|
|
193
197
|
"fieldName": "width"
|
|
194
198
|
},
|
|
195
199
|
{
|
|
@@ -197,6 +201,7 @@
|
|
|
197
201
|
"type": {
|
|
198
202
|
"text": "'' | 'action'"
|
|
199
203
|
},
|
|
204
|
+
"description": "determine if given column type for various action features",
|
|
200
205
|
"fieldName": "type"
|
|
201
206
|
},
|
|
202
207
|
{
|
|
@@ -205,6 +210,7 @@
|
|
|
205
210
|
"text": "'' | 'sticky' | 'fixed'"
|
|
206
211
|
},
|
|
207
212
|
"default": "''",
|
|
213
|
+
"description": "position individual column relative to the grid scroll container",
|
|
208
214
|
"fieldName": "position"
|
|
209
215
|
}
|
|
210
216
|
],
|
|
@@ -556,6 +562,7 @@
|
|
|
556
562
|
{
|
|
557
563
|
"kind": "field",
|
|
558
564
|
"name": "i18n",
|
|
565
|
+
"description": "i18n string options",
|
|
559
566
|
"attribute": "i18n"
|
|
560
567
|
},
|
|
561
568
|
{
|
|
@@ -564,6 +571,7 @@
|
|
|
564
571
|
"type": {
|
|
565
572
|
"text": "string"
|
|
566
573
|
},
|
|
574
|
+
"description": "max height for grid container",
|
|
567
575
|
"attribute": "height",
|
|
568
576
|
"reflects": true
|
|
569
577
|
},
|
|
@@ -574,6 +582,7 @@
|
|
|
574
582
|
"text": "'fixed' | 'flex'"
|
|
575
583
|
},
|
|
576
584
|
"default": "'fixed'",
|
|
585
|
+
"description": "column layout determines initial column width calculation",
|
|
577
586
|
"attribute": "column-layout",
|
|
578
587
|
"reflects": true
|
|
579
588
|
},
|
|
@@ -584,6 +593,7 @@
|
|
|
584
593
|
"text": "'row' | 'cell' | 'column' | 'none' | 'stripe'"
|
|
585
594
|
},
|
|
586
595
|
"default": "'row'",
|
|
596
|
+
"description": "determines the visual style of grid cells and rows",
|
|
587
597
|
"attribute": "borders",
|
|
588
598
|
"reflects": true
|
|
589
599
|
},
|
|
@@ -593,27 +603,29 @@
|
|
|
593
603
|
"type": {
|
|
594
604
|
"text": "'multi' | 'single' | null"
|
|
595
605
|
},
|
|
606
|
+
"description": "initializes grid to appropriate aria/a11y settings for selections",
|
|
596
607
|
"attribute": "selectable",
|
|
597
608
|
"reflects": true
|
|
598
609
|
},
|
|
599
610
|
{
|
|
600
611
|
"kind": "field",
|
|
601
|
-
"name": "
|
|
612
|
+
"name": "scrollLock",
|
|
602
613
|
"type": {
|
|
603
614
|
"text": "boolean"
|
|
604
615
|
},
|
|
605
616
|
"default": "false",
|
|
606
|
-
"
|
|
617
|
+
"description": "disables scroll container",
|
|
618
|
+
"attribute": "scroll-lock",
|
|
607
619
|
"reflects": true
|
|
608
620
|
},
|
|
609
621
|
{
|
|
610
622
|
"kind": "field",
|
|
611
|
-
"name": "
|
|
623
|
+
"name": "rangeSelection",
|
|
612
624
|
"type": {
|
|
613
625
|
"text": "boolean"
|
|
614
626
|
},
|
|
615
627
|
"default": "false",
|
|
616
|
-
"attribute": "
|
|
628
|
+
"attribute": "range-selection",
|
|
617
629
|
"reflects": true
|
|
618
630
|
},
|
|
619
631
|
{
|
|
@@ -645,28 +657,22 @@
|
|
|
645
657
|
"text": "Set<any>"
|
|
646
658
|
},
|
|
647
659
|
"static": true,
|
|
648
|
-
"default": "new Set()"
|
|
649
|
-
|
|
650
|
-
{
|
|
651
|
-
"kind": "field",
|
|
652
|
-
"name": "keyGridControllerConfig"
|
|
653
|
-
},
|
|
654
|
-
{
|
|
655
|
-
"kind": "field",
|
|
656
|
-
"name": "gridLayoutControllerConfig"
|
|
660
|
+
"default": "new Set()",
|
|
661
|
+
"privacy": "private"
|
|
657
662
|
},
|
|
658
663
|
{
|
|
659
664
|
"kind": "field",
|
|
660
|
-
"name": "
|
|
665
|
+
"name": "gridLayoutControllerConfig",
|
|
666
|
+
"privacy": "private"
|
|
661
667
|
},
|
|
662
668
|
{
|
|
663
669
|
"kind": "field",
|
|
664
|
-
"name": "
|
|
670
|
+
"name": "gridColumnSizeControllerConfig",
|
|
665
671
|
"privacy": "private"
|
|
666
672
|
},
|
|
667
673
|
{
|
|
668
674
|
"kind": "field",
|
|
669
|
-
"name": "#
|
|
675
|
+
"name": "#columns",
|
|
670
676
|
"privacy": "private"
|
|
671
677
|
},
|
|
672
678
|
{
|
|
@@ -691,7 +697,16 @@
|
|
|
691
697
|
},
|
|
692
698
|
{
|
|
693
699
|
"kind": "field",
|
|
694
|
-
"name": "keyNavGrid"
|
|
700
|
+
"name": "keyNavGrid",
|
|
701
|
+
"privacy": "private"
|
|
702
|
+
},
|
|
703
|
+
{
|
|
704
|
+
"kind": "field",
|
|
705
|
+
"name": "grid",
|
|
706
|
+
"type": {
|
|
707
|
+
"text": "HTMLElement[][]"
|
|
708
|
+
},
|
|
709
|
+
"privacy": "private"
|
|
695
710
|
},
|
|
696
711
|
{
|
|
697
712
|
"kind": "field",
|
|
@@ -756,6 +771,7 @@
|
|
|
756
771
|
"attributes": [
|
|
757
772
|
{
|
|
758
773
|
"name": "i18n",
|
|
774
|
+
"description": "i18n string options",
|
|
759
775
|
"fieldName": "i18n"
|
|
760
776
|
},
|
|
761
777
|
{
|
|
@@ -763,6 +779,7 @@
|
|
|
763
779
|
"type": {
|
|
764
780
|
"text": "string"
|
|
765
781
|
},
|
|
782
|
+
"description": "max height for grid container",
|
|
766
783
|
"fieldName": "height"
|
|
767
784
|
},
|
|
768
785
|
{
|
|
@@ -771,6 +788,7 @@
|
|
|
771
788
|
"text": "'fixed' | 'flex'"
|
|
772
789
|
},
|
|
773
790
|
"default": "'fixed'",
|
|
791
|
+
"description": "column layout determines initial column width calculation",
|
|
774
792
|
"fieldName": "columnLayout"
|
|
775
793
|
},
|
|
776
794
|
{
|
|
@@ -779,6 +797,7 @@
|
|
|
779
797
|
"text": "'row' | 'cell' | 'column' | 'none' | 'stripe'"
|
|
780
798
|
},
|
|
781
799
|
"default": "'row'",
|
|
800
|
+
"description": "determines the visual style of grid cells and rows",
|
|
782
801
|
"fieldName": "borders"
|
|
783
802
|
},
|
|
784
803
|
{
|
|
@@ -786,23 +805,25 @@
|
|
|
786
805
|
"type": {
|
|
787
806
|
"text": "'multi' | 'single' | null"
|
|
788
807
|
},
|
|
808
|
+
"description": "initializes grid to appropriate aria/a11y settings for selections",
|
|
789
809
|
"fieldName": "selectable"
|
|
790
810
|
},
|
|
791
811
|
{
|
|
792
|
-
"name": "
|
|
812
|
+
"name": "scroll-lock",
|
|
793
813
|
"type": {
|
|
794
814
|
"text": "boolean"
|
|
795
815
|
},
|
|
796
816
|
"default": "false",
|
|
797
|
-
"
|
|
817
|
+
"description": "disables scroll container",
|
|
818
|
+
"fieldName": "scrollLock"
|
|
798
819
|
},
|
|
799
820
|
{
|
|
800
|
-
"name": "
|
|
821
|
+
"name": "range-selection",
|
|
801
822
|
"type": {
|
|
802
823
|
"text": "boolean"
|
|
803
824
|
},
|
|
804
825
|
"default": "false",
|
|
805
|
-
"fieldName": "
|
|
826
|
+
"fieldName": "rangeSelection"
|
|
806
827
|
},
|
|
807
828
|
{
|
|
808
829
|
"name": "elevation",
|
|
@@ -1147,178 +1168,6 @@
|
|
|
1147
1168
|
}
|
|
1148
1169
|
]
|
|
1149
1170
|
},
|
|
1150
|
-
{
|
|
1151
|
-
"kind": "javascript-module",
|
|
1152
|
-
"path": "/internals/controllers/key-grid.controller.js",
|
|
1153
|
-
"declarations": [
|
|
1154
|
-
{
|
|
1155
|
-
"kind": "function",
|
|
1156
|
-
"name": "keyGrid",
|
|
1157
|
-
"return": {
|
|
1158
|
-
"type": {
|
|
1159
|
-
"text": "ClassDecorator"
|
|
1160
|
-
}
|
|
1161
|
-
},
|
|
1162
|
-
"description": "https://w3c.github.io/aria-practices/#gridNav_focus"
|
|
1163
|
-
},
|
|
1164
|
-
{
|
|
1165
|
-
"kind": "class",
|
|
1166
|
-
"description": "",
|
|
1167
|
-
"name": "KeyGridController",
|
|
1168
|
-
"members": [
|
|
1169
|
-
{
|
|
1170
|
-
"kind": "field",
|
|
1171
|
-
"name": "#observers",
|
|
1172
|
-
"privacy": "private",
|
|
1173
|
-
"type": {
|
|
1174
|
-
"text": "MutationObserver[]"
|
|
1175
|
-
},
|
|
1176
|
-
"default": "[]"
|
|
1177
|
-
},
|
|
1178
|
-
{
|
|
1179
|
-
"kind": "field",
|
|
1180
|
-
"name": "#grid",
|
|
1181
|
-
"privacy": "private"
|
|
1182
|
-
},
|
|
1183
|
-
{
|
|
1184
|
-
"kind": "field",
|
|
1185
|
-
"name": "#rows",
|
|
1186
|
-
"privacy": "private"
|
|
1187
|
-
},
|
|
1188
|
-
{
|
|
1189
|
-
"kind": "field",
|
|
1190
|
-
"name": "#cells",
|
|
1191
|
-
"privacy": "private"
|
|
1192
|
-
},
|
|
1193
|
-
{
|
|
1194
|
-
"kind": "field",
|
|
1195
|
-
"name": "#activeCell",
|
|
1196
|
-
"privacy": "private"
|
|
1197
|
-
},
|
|
1198
|
-
{
|
|
1199
|
-
"kind": "method",
|
|
1200
|
-
"name": "hostConnected"
|
|
1201
|
-
},
|
|
1202
|
-
{
|
|
1203
|
-
"kind": "method",
|
|
1204
|
-
"name": "hostDisconnected"
|
|
1205
|
-
},
|
|
1206
|
-
{
|
|
1207
|
-
"kind": "method",
|
|
1208
|
-
"name": "#clickCell",
|
|
1209
|
-
"parameters": [
|
|
1210
|
-
{
|
|
1211
|
-
"name": "e",
|
|
1212
|
-
"type": {
|
|
1213
|
-
"text": "MouseEvent"
|
|
1214
|
-
}
|
|
1215
|
-
}
|
|
1216
|
-
]
|
|
1217
|
-
},
|
|
1218
|
-
{
|
|
1219
|
-
"kind": "method",
|
|
1220
|
-
"name": "#keynavCell",
|
|
1221
|
-
"parameters": [
|
|
1222
|
-
{
|
|
1223
|
-
"name": "e",
|
|
1224
|
-
"type": {
|
|
1225
|
-
"text": "KeyboardEvent"
|
|
1226
|
-
}
|
|
1227
|
-
}
|
|
1228
|
-
]
|
|
1229
|
-
},
|
|
1230
|
-
{
|
|
1231
|
-
"kind": "method",
|
|
1232
|
-
"name": "#setActiveCell",
|
|
1233
|
-
"parameters": [
|
|
1234
|
-
{
|
|
1235
|
-
"name": "e",
|
|
1236
|
-
"type": {
|
|
1237
|
-
"text": "any"
|
|
1238
|
-
}
|
|
1239
|
-
},
|
|
1240
|
-
{
|
|
1241
|
-
"name": "activeCell",
|
|
1242
|
-
"type": {
|
|
1243
|
-
"text": "HTMLElement"
|
|
1244
|
-
}
|
|
1245
|
-
}
|
|
1246
|
-
]
|
|
1247
|
-
},
|
|
1248
|
-
{
|
|
1249
|
-
"kind": "method",
|
|
1250
|
-
"name": "#updateCellActivation",
|
|
1251
|
-
"parameters": [
|
|
1252
|
-
{
|
|
1253
|
-
"name": "e",
|
|
1254
|
-
"type": {
|
|
1255
|
-
"text": "KeyboardEvent"
|
|
1256
|
-
}
|
|
1257
|
-
}
|
|
1258
|
-
]
|
|
1259
|
-
}
|
|
1260
|
-
]
|
|
1261
|
-
}
|
|
1262
|
-
],
|
|
1263
|
-
"exports": [
|
|
1264
|
-
{
|
|
1265
|
-
"kind": "js",
|
|
1266
|
-
"name": "keyGrid",
|
|
1267
|
-
"declaration": {
|
|
1268
|
-
"name": "keyGrid",
|
|
1269
|
-
"module": "/internals/controllers/key-grid.controller.js"
|
|
1270
|
-
}
|
|
1271
|
-
},
|
|
1272
|
-
{
|
|
1273
|
-
"kind": "js",
|
|
1274
|
-
"name": "KeyGridController",
|
|
1275
|
-
"declaration": {
|
|
1276
|
-
"name": "KeyGridController",
|
|
1277
|
-
"module": "/internals/controllers/key-grid.controller.js"
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
]
|
|
1281
|
-
},
|
|
1282
|
-
{
|
|
1283
|
-
"kind": "javascript-module",
|
|
1284
|
-
"path": "/internals/controllers/key.utils.js",
|
|
1285
|
-
"declarations": [
|
|
1286
|
-
{
|
|
1287
|
-
"kind": "function",
|
|
1288
|
-
"name": "getNextKeyGridItem",
|
|
1289
|
-
"parameters": [
|
|
1290
|
-
{
|
|
1291
|
-
"name": "cells",
|
|
1292
|
-
"type": {
|
|
1293
|
-
"text": "HTMLElement[]"
|
|
1294
|
-
}
|
|
1295
|
-
},
|
|
1296
|
-
{
|
|
1297
|
-
"name": "rows",
|
|
1298
|
-
"type": {
|
|
1299
|
-
"text": "HTMLElement[]"
|
|
1300
|
-
}
|
|
1301
|
-
},
|
|
1302
|
-
{
|
|
1303
|
-
"name": "config",
|
|
1304
|
-
"type": {
|
|
1305
|
-
"text": "{ code: KeyNavigationCode | string; ctrlKey: boolean; dir: string }"
|
|
1306
|
-
}
|
|
1307
|
-
}
|
|
1308
|
-
]
|
|
1309
|
-
}
|
|
1310
|
-
],
|
|
1311
|
-
"exports": [
|
|
1312
|
-
{
|
|
1313
|
-
"kind": "js",
|
|
1314
|
-
"name": "getNextKeyGridItem",
|
|
1315
|
-
"declaration": {
|
|
1316
|
-
"name": "getNextKeyGridItem",
|
|
1317
|
-
"module": "/internals/controllers/key.utils.js"
|
|
1318
|
-
}
|
|
1319
|
-
}
|
|
1320
|
-
]
|
|
1321
|
-
},
|
|
1322
1171
|
{
|
|
1323
1172
|
"kind": "javascript-module",
|
|
1324
1173
|
"path": "/internals/index.js",
|
|
@@ -1332,22 +1181,6 @@
|
|
|
1332
1181
|
"package": "./controllers/interaction-scroll-visibility.controller.js"
|
|
1333
1182
|
}
|
|
1334
1183
|
},
|
|
1335
|
-
{
|
|
1336
|
-
"kind": "js",
|
|
1337
|
-
"name": "*",
|
|
1338
|
-
"declaration": {
|
|
1339
|
-
"name": "*",
|
|
1340
|
-
"package": "./controllers/key-grid.controller.js"
|
|
1341
|
-
}
|
|
1342
|
-
},
|
|
1343
|
-
{
|
|
1344
|
-
"kind": "js",
|
|
1345
|
-
"name": "*",
|
|
1346
|
-
"declaration": {
|
|
1347
|
-
"name": "*",
|
|
1348
|
-
"package": "./utils/dom.js"
|
|
1349
|
-
}
|
|
1350
|
-
},
|
|
1351
1184
|
{
|
|
1352
1185
|
"kind": "js",
|
|
1353
1186
|
"name": "*",
|
|
@@ -1358,35 +1191,6 @@
|
|
|
1358
1191
|
}
|
|
1359
1192
|
]
|
|
1360
1193
|
},
|
|
1361
|
-
{
|
|
1362
|
-
"kind": "javascript-module",
|
|
1363
|
-
"path": "/internals/utils/dom.js",
|
|
1364
|
-
"declarations": [
|
|
1365
|
-
{
|
|
1366
|
-
"kind": "function",
|
|
1367
|
-
"name": "contextMenuClick",
|
|
1368
|
-
"parameters": [
|
|
1369
|
-
{
|
|
1370
|
-
"name": "event",
|
|
1371
|
-
"type": {
|
|
1372
|
-
"text": "MouseEvent"
|
|
1373
|
-
}
|
|
1374
|
-
}
|
|
1375
|
-
],
|
|
1376
|
-
"description": "right click with context menus & keyboard mouse control https://apple.stackexchange.com/questions/32715/how-do-i-open-the-context-menu-from-a-mac-keyboard"
|
|
1377
|
-
}
|
|
1378
|
-
],
|
|
1379
|
-
"exports": [
|
|
1380
|
-
{
|
|
1381
|
-
"kind": "js",
|
|
1382
|
-
"name": "contextMenuClick",
|
|
1383
|
-
"declaration": {
|
|
1384
|
-
"name": "contextMenuClick",
|
|
1385
|
-
"module": "/internals/utils/dom.js"
|
|
1386
|
-
}
|
|
1387
|
-
}
|
|
1388
|
-
]
|
|
1389
|
-
},
|
|
1390
1194
|
{
|
|
1391
1195
|
"kind": "javascript-module",
|
|
1392
1196
|
"path": "/internals/utils/events.js",
|
|
@@ -1408,23 +1212,6 @@
|
|
|
1408
1212
|
}
|
|
1409
1213
|
}
|
|
1410
1214
|
]
|
|
1411
|
-
},
|
|
1412
|
-
{
|
|
1413
|
-
"kind": "function",
|
|
1414
|
-
"name": "onFirstInteraction",
|
|
1415
|
-
"return": {
|
|
1416
|
-
"type": {
|
|
1417
|
-
"text": "Promise<null>"
|
|
1418
|
-
}
|
|
1419
|
-
},
|
|
1420
|
-
"parameters": [
|
|
1421
|
-
{
|
|
1422
|
-
"name": "element",
|
|
1423
|
-
"type": {
|
|
1424
|
-
"text": "HTMLElement"
|
|
1425
|
-
}
|
|
1426
|
-
}
|
|
1427
|
-
]
|
|
1428
1215
|
}
|
|
1429
1216
|
],
|
|
1430
1217
|
"exports": [
|
|
@@ -1435,14 +1222,6 @@
|
|
|
1435
1222
|
"name": "onChildListMutation",
|
|
1436
1223
|
"module": "/internals/utils/events.js"
|
|
1437
1224
|
}
|
|
1438
|
-
},
|
|
1439
|
-
{
|
|
1440
|
-
"kind": "js",
|
|
1441
|
-
"name": "onFirstInteraction",
|
|
1442
|
-
"declaration": {
|
|
1443
|
-
"name": "onFirstInteraction",
|
|
1444
|
-
"module": "/internals/utils/events.js"
|
|
1445
|
-
}
|
|
1446
1225
|
}
|
|
1447
1226
|
]
|
|
1448
1227
|
},
|
|
@@ -1587,34 +1366,6 @@
|
|
|
1587
1366
|
}
|
|
1588
1367
|
]
|
|
1589
1368
|
},
|
|
1590
|
-
{
|
|
1591
|
-
"kind": "javascript-module",
|
|
1592
|
-
"path": "/internals/utils/keynav.js",
|
|
1593
|
-
"declarations": [
|
|
1594
|
-
{
|
|
1595
|
-
"kind": "function",
|
|
1596
|
-
"name": "validKeyNavigationCode",
|
|
1597
|
-
"parameters": [
|
|
1598
|
-
{
|
|
1599
|
-
"name": "e",
|
|
1600
|
-
"type": {
|
|
1601
|
-
"text": "KeyboardEvent"
|
|
1602
|
-
}
|
|
1603
|
-
}
|
|
1604
|
-
]
|
|
1605
|
-
}
|
|
1606
|
-
],
|
|
1607
|
-
"exports": [
|
|
1608
|
-
{
|
|
1609
|
-
"kind": "js",
|
|
1610
|
-
"name": "validKeyNavigationCode",
|
|
1611
|
-
"declaration": {
|
|
1612
|
-
"name": "validKeyNavigationCode",
|
|
1613
|
-
"module": "/internals/utils/keynav.js"
|
|
1614
|
-
}
|
|
1615
|
-
}
|
|
1616
|
-
]
|
|
1617
|
-
},
|
|
1618
1369
|
{
|
|
1619
1370
|
"kind": "javascript-module",
|
|
1620
1371
|
"path": "/internals/utils/traversal.js",
|
|
@@ -2015,6 +1766,7 @@
|
|
|
2015
1766
|
"type": {
|
|
2016
1767
|
"text": "boolean"
|
|
2017
1768
|
},
|
|
1769
|
+
"description": "selected visual state",
|
|
2018
1770
|
"attribute": "selected",
|
|
2019
1771
|
"reflects": true
|
|
2020
1772
|
},
|
|
@@ -2024,6 +1776,7 @@
|
|
|
2024
1776
|
"type": {
|
|
2025
1777
|
"text": "'fixed' | 'sticky' | ''"
|
|
2026
1778
|
},
|
|
1779
|
+
"description": "position individual row relative to the grid scroll container",
|
|
2027
1780
|
"attribute": "position",
|
|
2028
1781
|
"reflects": true
|
|
2029
1782
|
},
|
|
@@ -2047,6 +1800,7 @@
|
|
|
2047
1800
|
"type": {
|
|
2048
1801
|
"text": "boolean"
|
|
2049
1802
|
},
|
|
1803
|
+
"description": "selected visual state",
|
|
2050
1804
|
"fieldName": "selected"
|
|
2051
1805
|
},
|
|
2052
1806
|
{
|
|
@@ -2054,6 +1808,7 @@
|
|
|
2054
1808
|
"type": {
|
|
2055
1809
|
"text": "'fixed' | 'sticky' | ''"
|
|
2056
1810
|
},
|
|
1811
|
+
"description": "position individual row relative to the grid scroll container",
|
|
2057
1812
|
"fieldName": "position"
|
|
2058
1813
|
}
|
|
2059
1814
|
],
|
package/grid/element.d.ts
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { LitElement } from 'lit';
|
|
2
2
|
import { BpGridRow } from '../row/element.js';
|
|
3
|
-
import { BpGridCell } from '../cell/element.js';
|
|
4
3
|
import { BpGridColumn } from '../column/element.js';
|
|
5
4
|
import { GridLayoutController } from './layout.controller.js';
|
|
6
5
|
/**
|
|
@@ -24,6 +23,7 @@ import { GridLayoutController } from './layout.controller.js';
|
|
|
24
23
|
*/
|
|
25
24
|
export declare class BpGrid extends LitElement {
|
|
26
25
|
#private;
|
|
26
|
+
/** i18n string options */
|
|
27
27
|
i18n: {
|
|
28
28
|
sort: string;
|
|
29
29
|
expand: string;
|
|
@@ -52,32 +52,38 @@ export declare class BpGrid extends LitElement {
|
|
|
52
52
|
lastPage: string;
|
|
53
53
|
pageSize: string;
|
|
54
54
|
};
|
|
55
|
+
/** max height for grid container */
|
|
55
56
|
height: string;
|
|
57
|
+
/** column layout determines initial column width calculation */
|
|
56
58
|
columnLayout: 'fixed' | 'flex';
|
|
59
|
+
/** determines the visual style of grid cells and rows */
|
|
57
60
|
borders: 'row' | 'cell' | 'column' | 'none' | 'stripe';
|
|
61
|
+
/** initializes grid to appropriate aria/a11y settings for selections */
|
|
58
62
|
selectable: 'multi' | 'single' | null;
|
|
59
|
-
|
|
63
|
+
/** disables scroll container */
|
|
60
64
|
scrollLock: boolean;
|
|
65
|
+
rangeSelection: boolean;
|
|
61
66
|
elevation: 'raised' | 'flat';
|
|
62
67
|
protected _id: string;
|
|
63
68
|
protected gridLayoutController: GridLayoutController;
|
|
64
69
|
static styles: CSSStyleSheet[];
|
|
70
|
+
/** @private */
|
|
65
71
|
static controllers: Set<any>;
|
|
66
|
-
|
|
67
|
-
grid: HTMLElement;
|
|
68
|
-
rows: HTMLElement[];
|
|
69
|
-
cells: (BpGridCell | BpGridColumn)[];
|
|
70
|
-
};
|
|
72
|
+
/** @private */
|
|
71
73
|
get gridLayoutControllerConfig(): {
|
|
72
74
|
columns: BpGridColumn[];
|
|
73
75
|
columnLayout: "fixed" | "flex";
|
|
74
76
|
height: string;
|
|
75
77
|
};
|
|
78
|
+
/** @private */
|
|
76
79
|
get gridColumnSizeControllerConfig(): {
|
|
77
80
|
columns: BpGridColumn[];
|
|
78
81
|
rows: BpGridRow[];
|
|
79
82
|
};
|
|
83
|
+
/** @private */
|
|
80
84
|
get keyNavGrid(): HTMLElement;
|
|
85
|
+
/** @private */
|
|
86
|
+
get grid(): HTMLElement[][];
|
|
81
87
|
_internals: ElementInternals;
|
|
82
88
|
render(): import("lit-html").TemplateResult<1>;
|
|
83
89
|
constructor();
|
package/grid/element.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{__decorate as t}from"tslib";import{LitElement as e,html as
|
|
1
|
+
import{__decorate as t}from"tslib";import{LitElement as e,html as i}from"lit";import{baseStyles as o,elevationStyles as r,I18nService as l,createId as s,attachRootNodeStyles as n,i18n as a,ariaMultiSelectable as c}from"@blueprintui/components/internals";import{interactionScrollVisibility as h}from"../internals/controllers/interaction-scroll-visibility.controller.js";import{GridLayoutController as u}from"./layout.controller.js";import d from"./element.css.js";import p from"./global.css.js";var m;let g=m=class extends e{static properties={i18n:{type:Object},height:{type:String,reflect:!0},columnLayout:{type:String,reflect:!0,attribute:"column-layout"},borders:{type:String,reflect:!0},selectable:{type:String,reflect:!0},scrollLock:{type:Boolean,reflect:!0,attribute:"scroll-lock"},rangeSelection:{type:Boolean,reflect:!0,attribute:"range-selection"},elevation:{type:String,reflect:!0},_id:{type:String,reflect:!0}};gridLayoutController=new u(this);static styles=[o,r,d];static controllers=new Set;get gridLayoutControllerConfig(){return{columns:Array.from(this.#t),columnLayout:this.columnLayout,height:this.height}}get gridColumnSizeControllerConfig(){return{columns:Array.from(this.#t),rows:Array.from(this.#e)}}get#t(){return this.querySelectorAll("bp-grid-column")}get#e(){return this.querySelectorAll("bp-grid-row")}get#i(){return this.querySelectorAll("bp-grid-cell")}get#o(){return this.querySelector("bp-grid-placeholder")}get#r(){return this.querySelector("bp-grid-footer")}get keyNavGrid(){return this.shadowRoot.querySelector(".scroll-container")}get grid(){const t=[...Array.from(this.#t),...Array.from(this.#i)],e=this.#t.length,i=[];for(;t.length;)i.push(t.splice(0,e));return i}_internals=this.attachInternals();render(){return i`<div role="presentation" elevation part="internal"><div role="presentation" class="scroll-container"><div role="presentation" class="column-row-group"><div role="row" aria-rowindex="1" class="column-row"><slot name="columns"><bp-grid-column draggable-hidden><span sr-only>${this.i18n.noData}</span></bp-grid-column></slot></div></div><slot role="presentation" class="body-row-group"></slot></div><slot name="footer"></slot><slot name="detail"></slot></div>`}constructor(){super();this._internals.role="grid",this.#l(),this.i18n=l.keys.actions,this.columnLayout="fixed",this.borders="row",this.scrollLock=!1,this.rangeSelection=!1,this._id=s()}async connectedCallback(){super.connectedCallback(),n(this.parentNode,[p]),await this.updateComplete,m.controllers.forEach((t=>new t(this))),this.#s(),this.shadowRoot.addEventListener("slotchange",(()=>this.updateComplete.then((()=>this.#s()))))}#l(){this.addEventListener("sort",(t=>{const e=t.composedPath().find((t=>"BP-GRID-COLUMN"===t.tagName));e&&(e.ariaSort=t.detail)}))}#n=0;get#a(){return this.#n++,1===this.#n&&!this.rangeSelection&&!Array.from(this.#t).find((t=>""!==t.position||void 0!==t.type))}async#s(){this.#a||(this.#c(),this.#h(),this.#u(),this.#d(),this.#p(),this.#m())}#c(){const t=Math.max(this.#e?.length,1),e=this.#r?1:0;this._internals.ariaRowCount=""+(1+t+e),this._internals.ariaColCount=""+this.#t.length}#h(){this.#t.forEach(((t,e)=>t.ariaColIndex=""+(e+1)))}#u(){this.#e?.forEach(((t,e)=>t.ariaRowIndex=""+(e+2)))}#d(){this.#i?.forEach(((t,e)=>t.ariaColIndex=""+(e%this.#t.length+1)))}#p(){this.#o&&(this.#o.ariaRowCount=""+(this.#e.length+1),this.#o._colSpan=this._internals.ariaColCount)}#m(){this.#r&&(this.#r.ariaRowCount=""+(this.#e.length+2),this.#r._colSpan=this._internals.ariaColCount)}};g=m=t([a({key:"actions"}),c(),h()],g);export{g as BpGrid};
|
package/include/keynav.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{KeynavController as e}from"@blueprintui/typewriter";await customElements.whenDefined("bp-grid"),customElements.get("bp-grid").controllers.add(class extends e{constructor(e){super(e,(()=>({host:e.keyNavGrid,grid:e.grid})))}});
|
package/internals/index.d.ts
CHANGED
package/internals/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export{InteractionScrollVisibilityController,interactionScrollVisibility}from"./controllers/interaction-scroll-visibility.controller.js";export{
|
|
1
|
+
export{InteractionScrollVisibilityController,interactionScrollVisibility}from"./controllers/interaction-scroll-visibility.controller.js";export{onChildListMutation}from"./utils/events.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function t(t,e){const o=new MutationObserver((t=>{for(const o of t)"childList"===o.type&&e(o)}));return o.observe(t,{childList:!0}),o}export{t as onChildListMutation};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blueprintui/grid",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.2",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"module": "./index.js",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
@@ -38,7 +38,11 @@
|
|
|
38
38
|
"./*": "./*/index.js"
|
|
39
39
|
},
|
|
40
40
|
"dependencies": {
|
|
41
|
-
"@blueprintui/components": "^0.0.
|
|
42
|
-
"
|
|
41
|
+
"@blueprintui/components": "^0.0.34",
|
|
42
|
+
"@blueprintui/icons": "^0.0.23",
|
|
43
|
+
"@blueprintui/themes": "^0.0.14",
|
|
44
|
+
"@blueprintui/typwriter": "^0.0.1",
|
|
45
|
+
"lit": "^2.5.0",
|
|
46
|
+
"tslib": "^2.4.1"
|
|
43
47
|
}
|
|
44
48
|
}
|
package/row/element.d.ts
CHANGED
|
@@ -14,7 +14,9 @@ import { LitElement } from 'lit';
|
|
|
14
14
|
*/
|
|
15
15
|
export declare class BpGridRow extends LitElement {
|
|
16
16
|
#private;
|
|
17
|
+
/** selected visual state */
|
|
17
18
|
selected: boolean;
|
|
19
|
+
/** position individual row relative to the grid scroll container */
|
|
18
20
|
position: 'fixed' | 'sticky' | '';
|
|
19
21
|
static styles: CSSStyleSheet[];
|
|
20
22
|
render(): import("lit-html").TemplateResult<1>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ReactiveController, ReactiveElement } from 'lit';
|
|
2
|
-
export interface KeyGridConfig {
|
|
3
|
-
keyGridControllerConfig: {
|
|
4
|
-
grid?: HTMLElement;
|
|
5
|
-
rows: NodeListOf<HTMLElement> | HTMLElement[];
|
|
6
|
-
cells: NodeListOf<HTMLElement> | HTMLElement[];
|
|
7
|
-
};
|
|
8
|
-
}
|
|
9
|
-
/**
|
|
10
|
-
* https://w3c.github.io/aria-practices/#gridNav_focus
|
|
11
|
-
*/
|
|
12
|
-
export declare function keyGrid<T extends ReactiveElement & KeyGridConfig>(): ClassDecorator;
|
|
13
|
-
export declare class KeyGridController<T extends ReactiveElement & KeyGridConfig> implements ReactiveController {
|
|
14
|
-
#private;
|
|
15
|
-
private host;
|
|
16
|
-
constructor(host: T);
|
|
17
|
-
hostConnected(): Promise<void>;
|
|
18
|
-
hostDisconnected(): void;
|
|
19
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{onFirstInteraction as t,onChildListMutation as e}from"../utils/events.js";import{getFlattenedDOMTree as s,getFlattenedFocusableItems as i}from"../utils/traversal.js";import{contextMenuClick as r}from"../utils/dom.js";import{validKeyNavigationCode as o}from"../utils/keynav.js";import{initializeKeyListItems as l,simpleFocusable as n,getActiveElement as h,setActiveKeyListItem as c,focusElement as d}from"../utils/focus.js";import{getNextKeyGridItem as a}from"./key.utils.js";function f(){return t=>t.addInitializer((t=>new u(t)))}class u{host;#t=[];get#e(){return this.host.keyGridControllerConfig.grid}get#s(){return Array.from(this.host.keyGridControllerConfig.rows)}get#i(){return Array.from(this.host.keyGridControllerConfig.cells)}get#r(){return Array.from(this.#i).find((t=>0===t.tabIndex))}constructor(t){this.host=t,this.host.addController(this)}async hostConnected(){await this.host.updateComplete,await t(this.host),l(this.#i),this.#e.addEventListener("mouseup",(t=>this.#o(t))),this.#e.addEventListener("keydown",(t=>this.#l(t))),this.#e.addEventListener("keyup",(t=>this.#n(t))),this.#t.push(e(this.#e,(()=>l(this.#i))))}hostDisconnected(){this.#t.forEach((t=>t.disconnect()))}#o(t){if(!r(t)){const e=t.composedPath().find((t=>this.#i.find((e=>e===t))));e&&this.#h(t,e)}}#l(t){if(o(t)&&n(h())){const{x:e,y:i}=a(this.#i,this.#s,{code:t.code,ctrlKey:t.ctrlKey,dir:this.host.dir}),r=Array.from(s(this.#s[i])).filter((t=>!!this.#i.find((e=>e===t))))[e];this.#h(t,r),t.preventDefault()}}#h(t,e){c(this.#i,e);const s=i(e).filter((t=>!t.hidden&&!t.ariaHidden)),r=s.filter((t=>n(t)));1===r.length&&1===s.length?d(r[0]):d(e),e.dispatchEvent(new CustomEvent("bpKeyChange",{bubbles:!0,detail:{code:t.code,shiftKey:t.shiftKey,activeItem:e}}))}#n(t){"Escape"===t.code&&this.#r?.focus(),"Enter"===t.code&&this.#r===t.composedPath()[0]&&i(this.#r)[0]?.focus()}}export{u as KeyGridController,f as keyGrid};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{KeyNavigationCode as r}from"../utils/keynav.js";import{getFlattenedDOMTree as t}from"../utils/traversal.js";function o(o,e,n){const i=o.find((r=>0===r.tabIndex)),f=e.find((r=>t(r).find((r=>r===i)))),d=Array.from(t(f)).filter((r=>!!o.find((t=>t===r)))),l=e.length-1,w=d.length-1,{code:a,ctrlKey:s,dir:A}=n;let g=d.indexOf(i),m=e.indexOf(f);const c="rtl"===A?r.ArrowRight:r.ArrowLeft,p="rtl"===A?r.ArrowLeft:r.ArrowRight;return a===r.ArrowUp&&0!==m?m-=1:a===r.ArrowDown&&m<l?m+=1:a===c&&0!==g?g-=1:a===p&&g<w?g+=1:a===r.End?(g=w,s&&(m=l)):a===r.Home?(g=0,s&&(m=0)):a===r.PageUp?m=m-4>0?m-4:0:a===r.PageDown&&(m=m+4<l?m+4:l),{x:g,y:m}}export{o as getNextKeyGridItem};
|
package/internals/utils/dom.d.ts
DELETED
package/internals/utils/dom.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t){return 2===t.buttons&&!t.ctrlKey||1===t.buttons&&t.ctrlKey}export{t as contextMenuClick};
|
package/internals/utils/focus.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function t(t){return t.matches("a[href],area[href],input:not([disabled]),button:not([disabled]),select:not([disabled]),textarea:not([disabled]),iframe,object,embed,*[tabindex],*[contenteditable=true],[role=button]:not([disabled])")}function e(t){return t.matches("a[href],button:not([disabled]),input[type=checkbox],input[type=radio],object,embed,*[tabindex],[role=button]:not([disabled])")}function n(t=document){return t.activeElement&&t.activeElement.shadowRoot?n(t.activeElement.shadowRoot)??t.activeElement:t.activeElement}function o(e){e&&!t(e)?(e.setAttribute("tabindex","-1"),e.focus(),e.addEventListener("blur",(()=>e.removeAttribute("tabindex")),{once:!0})):e?.focus()}function a(t,e){t.forEach((t=>t.tabIndex=-1)),e.tabIndex=0}function d(t){t.forEach((t=>t.tabIndex=-1)),t[0].tabIndex=0}export{o as focusElement,t as focusable,n as getActiveElement,d as initializeKeyListItems,a as setActiveKeyListItem,e as simpleFocusable};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export declare function validKeyNavigationCode(e: KeyboardEvent): boolean;
|
|
2
|
-
export declare enum KeyNavigationCode {
|
|
3
|
-
ArrowUp = "ArrowUp",
|
|
4
|
-
ArrowDown = "ArrowDown",
|
|
5
|
-
ArrowLeft = "ArrowLeft",
|
|
6
|
-
ArrowRight = "ArrowRight",
|
|
7
|
-
End = "End",
|
|
8
|
-
Home = "Home",
|
|
9
|
-
PageUp = "PageUp",
|
|
10
|
-
PageDown = "PageDown"
|
|
11
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function o(o){return o.code===r.ArrowUp||o.code===r.ArrowDown||o.code===r.ArrowLeft||o.code===r.ArrowRight||o.code===r.End||o.code===r.Home||o.code===r.PageUp||o.code===r.PageDown}var r;!function(o){o.ArrowUp="ArrowUp",o.ArrowDown="ArrowDown",o.ArrowLeft="ArrowLeft",o.ArrowRight="ArrowRight",o.End="End",o.Home="Home",o.PageUp="PageUp",o.PageDown="PageDown"}(r||(r={}));export{r as KeyNavigationCode,o as validKeyNavigationCode};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{focusable as r}from"./focus.js";function n(n,e=10){return t(n,e).filter((n=>r(n)))}function t(r,n=10){return Array.from(e(r)).reduce(((r,o)=>[...r,[o,[...Array.from(e(o)).map((r=>[r,t(r,n)]))]]]),[]).flat(n)}function e(r){if(r.documentElement)return r.documentElement.children;if(r.shadowRoot)return r.shadowRoot.children;if(r.assignedElements){const n=r.assignedElements();return n.length?n:r.children}return r.children}function o(r){return r?.constructor===Object}function c(...r){const n={};return r.map((r=>o(r)?{...r}:{})).forEach((r=>{Object.keys(r).forEach((t=>{const e=r[t];Array.isArray(e)?n[t]=Array.from(e):o(e)?n[t]=c(n[t]||{},e):n[t]=e}))})),n}export{e as getChildren,t as getFlattenedDOMTree,n as getFlattenedFocusableItems,o as isObject,c as mergeObjects};
|