use-wc 1.0.0-pre.63 → 1.0.0-pre.65
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/custom-elements.json +100 -0
- package/dist/design-system.css +44 -6
- package/dist/docs/use-grid.md +12 -0
- package/dist/docs/use-gridrow.md +6 -0
- package/package.json +1 -1
- package/vscode.html-custom-data.json +1 -0
package/custom-elements.json
CHANGED
|
@@ -2167,6 +2167,46 @@
|
|
|
2167
2167
|
}
|
|
2168
2168
|
]
|
|
2169
2169
|
},
|
|
2170
|
+
{
|
|
2171
|
+
"kind": "javascript-module",
|
|
2172
|
+
"path": "src/elements/use-grid/constants.ts",
|
|
2173
|
+
"declarations": [
|
|
2174
|
+
{
|
|
2175
|
+
"kind": "variable",
|
|
2176
|
+
"name": "SELECTION_CELL_ATTRIBUTE",
|
|
2177
|
+
"type": {
|
|
2178
|
+
"text": "string"
|
|
2179
|
+
},
|
|
2180
|
+
"default": "\"data-usewc-selection-cell\""
|
|
2181
|
+
},
|
|
2182
|
+
{
|
|
2183
|
+
"kind": "variable",
|
|
2184
|
+
"name": "SELECTION_COLUMN_ATTRIBUTE",
|
|
2185
|
+
"type": {
|
|
2186
|
+
"text": "string"
|
|
2187
|
+
},
|
|
2188
|
+
"default": "\"data-usewc-selection-column\""
|
|
2189
|
+
}
|
|
2190
|
+
],
|
|
2191
|
+
"exports": [
|
|
2192
|
+
{
|
|
2193
|
+
"kind": "js",
|
|
2194
|
+
"name": "SELECTION_CELL_ATTRIBUTE",
|
|
2195
|
+
"declaration": {
|
|
2196
|
+
"name": "SELECTION_CELL_ATTRIBUTE",
|
|
2197
|
+
"module": "src/elements/use-grid/constants.ts"
|
|
2198
|
+
}
|
|
2199
|
+
},
|
|
2200
|
+
{
|
|
2201
|
+
"kind": "js",
|
|
2202
|
+
"name": "SELECTION_COLUMN_ATTRIBUTE",
|
|
2203
|
+
"declaration": {
|
|
2204
|
+
"name": "SELECTION_COLUMN_ATTRIBUTE",
|
|
2205
|
+
"module": "src/elements/use-grid/constants.ts"
|
|
2206
|
+
}
|
|
2207
|
+
}
|
|
2208
|
+
]
|
|
2209
|
+
},
|
|
2170
2210
|
{
|
|
2171
2211
|
"kind": "javascript-module",
|
|
2172
2212
|
"path": "src/elements/use-grid/index.ts",
|
|
@@ -2244,6 +2284,16 @@
|
|
|
2244
2284
|
"attribute": "selectmode",
|
|
2245
2285
|
"reflects": true
|
|
2246
2286
|
},
|
|
2287
|
+
{
|
|
2288
|
+
"kind": "field",
|
|
2289
|
+
"name": "selectwith",
|
|
2290
|
+
"type": {
|
|
2291
|
+
"text": "SelectWith"
|
|
2292
|
+
},
|
|
2293
|
+
"default": "\"row\"",
|
|
2294
|
+
"attribute": "selectwith",
|
|
2295
|
+
"reflects": true
|
|
2296
|
+
},
|
|
2247
2297
|
{
|
|
2248
2298
|
"kind": "field",
|
|
2249
2299
|
"name": "name",
|
|
@@ -2284,6 +2334,36 @@
|
|
|
2284
2334
|
"attribute": "readonly",
|
|
2285
2335
|
"reflects": true
|
|
2286
2336
|
},
|
|
2337
|
+
{
|
|
2338
|
+
"kind": "field",
|
|
2339
|
+
"name": "isMultiSelect",
|
|
2340
|
+
"description": "`true` when `selectmode=\"multiple\"`. Read by `use-gridcell` selection cells.",
|
|
2341
|
+
"readonly": true
|
|
2342
|
+
},
|
|
2343
|
+
{
|
|
2344
|
+
"kind": "field",
|
|
2345
|
+
"name": "injectsSelectionColumn",
|
|
2346
|
+
"description": "`true` when a checkbox/radio selection column should exist (`selectmode` on and `selectwith`\nincludes `control`). Read by `use-gridrow.reconcileSelectorCell`.",
|
|
2347
|
+
"readonly": true
|
|
2348
|
+
},
|
|
2349
|
+
{
|
|
2350
|
+
"kind": "field",
|
|
2351
|
+
"name": "selectionGroupName",
|
|
2352
|
+
"description": "The shared `name` for injected radio controls — the grid's `name` when set, otherwise a stable\ngenerated id. Lazily created so single-select grids without a `name` still group correctly.",
|
|
2353
|
+
"readonly": true
|
|
2354
|
+
},
|
|
2355
|
+
{
|
|
2356
|
+
"kind": "method",
|
|
2357
|
+
"name": "isRowDisabled",
|
|
2358
|
+
"parameters": [
|
|
2359
|
+
{
|
|
2360
|
+
"name": "row",
|
|
2361
|
+
"type": {
|
|
2362
|
+
"text": "Element | null | undefined"
|
|
2363
|
+
}
|
|
2364
|
+
}
|
|
2365
|
+
]
|
|
2366
|
+
},
|
|
2287
2367
|
{
|
|
2288
2368
|
"kind": "field",
|
|
2289
2369
|
"name": "value",
|
|
@@ -2301,6 +2381,14 @@
|
|
|
2301
2381
|
"default": "\"none\"",
|
|
2302
2382
|
"fieldName": "selectmode"
|
|
2303
2383
|
},
|
|
2384
|
+
{
|
|
2385
|
+
"name": "selectwith",
|
|
2386
|
+
"type": {
|
|
2387
|
+
"text": "SelectWith"
|
|
2388
|
+
},
|
|
2389
|
+
"default": "\"row\"",
|
|
2390
|
+
"fieldName": "selectwith"
|
|
2391
|
+
},
|
|
2304
2392
|
{
|
|
2305
2393
|
"name": "name",
|
|
2306
2394
|
"type": {
|
|
@@ -2343,6 +2431,14 @@
|
|
|
2343
2431
|
}
|
|
2344
2432
|
],
|
|
2345
2433
|
"exports": [
|
|
2434
|
+
{
|
|
2435
|
+
"kind": "js",
|
|
2436
|
+
"name": "SELECTION_CELL_ATTRIBUTE",
|
|
2437
|
+
"declaration": {
|
|
2438
|
+
"name": "SELECTION_CELL_ATTRIBUTE",
|
|
2439
|
+
"module": "src/elements/use-grid/use-grid.ts"
|
|
2440
|
+
}
|
|
2441
|
+
},
|
|
2346
2442
|
{
|
|
2347
2443
|
"kind": "js",
|
|
2348
2444
|
"name": "UseGrid",
|
|
@@ -2586,6 +2682,10 @@
|
|
|
2586
2682
|
"default": "\"\"",
|
|
2587
2683
|
"attribute": "value",
|
|
2588
2684
|
"reflects": true
|
|
2685
|
+
},
|
|
2686
|
+
{
|
|
2687
|
+
"kind": "method",
|
|
2688
|
+
"name": "reconcileSelectorCell"
|
|
2589
2689
|
}
|
|
2590
2690
|
],
|
|
2591
2691
|
"attributes": [
|
package/dist/design-system.css
CHANGED
|
@@ -1439,9 +1439,10 @@
|
|
|
1439
1439
|
}
|
|
1440
1440
|
|
|
1441
1441
|
/* ...but not right after a selection header cell — a select column reads as separate from the
|
|
1442
|
-
data columns without a rule between it and the first one. `use-
|
|
1443
|
-
cell with `data-usewc-selection-cell` (a real select-all checkbox, or an inert hidden
|
|
1444
|
-
spacer in single-select mode); a dev driving selection by hand uses a bare
|
|
1442
|
+
data columns without a rule between it and the first one. `use-gridrow` provisions the
|
|
1443
|
+
leading cell with `data-usewc-selection-cell` (a real select-all checkbox, or an inert hidden
|
|
1444
|
+
radio spacer in single-select mode); a dev driving selection by hand uses a bare
|
|
1445
|
+
checkbox/radio. */
|
|
1445
1446
|
use-gridhead
|
|
1446
1447
|
use-gridcell:is([data-usewc-selection-cell], :has(> input:is([type="checkbox"], [type="radio"])))
|
|
1447
1448
|
+ use-gridcell[role="columnheader"]::before {
|
|
@@ -1489,8 +1490,8 @@
|
|
|
1489
1490
|
showing centres the masked glyph inside it (no inline-block `vertical-align` guesswork).
|
|
1490
1491
|
The `[selected]` / `:not([selected])` split keeps the hidden slot on the shadow's
|
|
1491
1492
|
`display: none`; the `:not([selectmode="none"])` guard keeps a selection-less grid blank, and
|
|
1492
|
-
`use-gridrow:not([data-usewc-selection-column])` (an attribute
|
|
1493
|
-
|
|
1493
|
+
`use-gridrow:not([data-usewc-selection-column])` (an attribute the row sets on itself while
|
|
1494
|
+
it holds a checkbox/radio cell) keeps it blank when that control is the indicator —
|
|
1494
1495
|
otherwise the empty 1lh slot renders as a ghost column left of the control.
|
|
1495
1496
|
|
|
1496
1497
|
The leading gutter matches the injected checkbox/radio cell's inline padding, so the ✔ glyph
|
|
@@ -1595,6 +1596,25 @@
|
|
|
1595
1596
|
--usewc-color-grid-row-background: var(--usewc-color-grid-row-background-selected-hover);
|
|
1596
1597
|
}
|
|
1597
1598
|
|
|
1599
|
+
/* In the `row control` combo mode a whole-row hover both lights the row band (above) and
|
|
1600
|
+
previews the selection control, so the injected checkbox/radio picks up its own hover
|
|
1601
|
+
treatment even though the pointer is over the row rather than the control itself. Mirrors the
|
|
1602
|
+
`:not(...)` guards in selector.css — a disabled/readonly/checked control keeps its resting
|
|
1603
|
+
state — and wins over that rule because `use-theme.grid` imports after `use-theme.selector`. */
|
|
1604
|
+
use-grid:not(.chips, .list)[selectwith~="row"][selectwith~="control"]
|
|
1605
|
+
use-gridbody
|
|
1606
|
+
use-gridrow:not([disabled], [aria-disabled="true"]):hover
|
|
1607
|
+
use-gridcell[data-usewc-selection-cell]
|
|
1608
|
+
input:is([type="checkbox"], [type="radio"]):not(
|
|
1609
|
+
:disabled,
|
|
1610
|
+
[aria-disabled="true"],
|
|
1611
|
+
[aria-readonly="true"],
|
|
1612
|
+
:checked
|
|
1613
|
+
) {
|
|
1614
|
+
--usewc-color-selector-border: var(--usewc-color-selector-border-hover);
|
|
1615
|
+
--usewc-color-selector-background: var(--usewc-color-selector-background-hover);
|
|
1616
|
+
}
|
|
1617
|
+
|
|
1598
1618
|
/* Cursor for a selectable, non-disabled row body. */
|
|
1599
1619
|
use-grid:not(.chips, .list):not([selectmode="none"]):is(:not([selectwith]), [selectwith~="row"])
|
|
1600
1620
|
use-gridbody
|
|
@@ -1966,9 +1986,27 @@
|
|
|
1966
1986
|
anchored" signal — so a standalone `[popover]` or modal `<dialog>` elsewhere keeps its UA
|
|
1967
1987
|
centering. `margin-block` (both edges) so the gap survives a `position-try` flip to the
|
|
1968
1988
|
other side. The open-state check mirrors the positioning util: `:popover-open` for a
|
|
1969
|
-
popover, `[open]` for a `<dialog>`.
|
|
1989
|
+
popover, `[open]` for a `<dialog>`.
|
|
1990
|
+
|
|
1991
|
+
The `max-block-size` override is what lets it flip on scroll instead of shrinking.
|
|
1992
|
+
`popover.css` / `dialog.css` cap the surface at `min(80dvh, 100% - <pad>)`, where `100%`
|
|
1993
|
+
is the free space on the anchor's *current* side — so as the anchor nears a viewport edge
|
|
1994
|
+
that cap shrinks with it, the surface never overflows, and `position-try` never sees the
|
|
1995
|
+
overflow it needs to flip (or to flip back). Reworking the cap to
|
|
1996
|
+
`min(80dvh, max(45dvh, 100% - <pad>))` keeps the surface willing to be at least 45dvh: a
|
|
1997
|
+
side smaller than that overflows and triggers a flip, and since sibling sides sum to nearly
|
|
1998
|
+
the full viewport a 45dvh surface always fits the other one, so the flip lands on-screen.
|
|
1999
|
+
Where a side has more than 45dvh the `100%` term still tracks it, up to 80dvh. Left at the
|
|
2000
|
+
default `position-try-order` (not `most-block-size`) so the surface stays on the block-end
|
|
2001
|
+
(below) side whenever the content fits there, only flipping above when it doesn't — rather
|
|
2002
|
+
than jumping to whichever side merely has more room. `overflow` (otherwise `hidden`)
|
|
2003
|
+
scrolls the content once the cap bites; a `use-shell-fill` layout already scrolls its own
|
|
2004
|
+
fill region (`shell.css`), so the surface itself never overflows there and this `overflow`
|
|
2005
|
+
is inert. */
|
|
1970
2006
|
use-anchored > :is(dialog, [popover]):not(use-menu, .appearance-native):is([open], :popover-open) {
|
|
1971
2007
|
margin-block: var(--usewc-layout-surface-anchor-offset);
|
|
2008
|
+
max-block-size: min(80dvh, max(45dvh, 100% - var(--usewc-space-surface-padding) * 2));
|
|
2009
|
+
overflow: auto;
|
|
1972
2010
|
|
|
1973
2011
|
use-theme-escape & {
|
|
1974
2012
|
all: revert-layer;
|
package/dist/docs/use-grid.md
CHANGED
|
@@ -17,6 +17,7 @@ Provide `aria-label` or `aria-labelledby` on the `use-grid` element so screen re
|
|
|
17
17
|
| Name | Type | Default | Description |
|
|
18
18
|
| --- | --- | --- | --- |
|
|
19
19
|
| selectmode | `"multiple" \| "single" \| "none"` | `"none"` | - |
|
|
20
|
+
| selectwith | `SelectWith` | `"row"` | - |
|
|
20
21
|
| name | `string` | `""` | - |
|
|
21
22
|
| role | `string` | `"grid"` | - |
|
|
22
23
|
| disabled | `boolean` | `false` | - |
|
|
@@ -27,8 +28,19 @@ Provide `aria-label` or `aria-labelledby` on the `use-grid` element so screen re
|
|
|
27
28
|
| Name | Type | Default | Description |
|
|
28
29
|
| --- | --- | --- | --- |
|
|
29
30
|
| internals | - | - | - |
|
|
31
|
+
| isMultiSelect | - | - | `true` when `selectmode="multiple"`. Read by `use-gridcell` selection cells. |
|
|
32
|
+
| injectsSelectionColumn | - | - | `true` when a checkbox/radio selection column should exist (`selectmode` on and `selectwith`
|
|
33
|
+
includes `control`). Read by `use-gridrow.reconcileSelectorCell`. |
|
|
34
|
+
| selectionGroupName | - | - | The shared `name` for injected radio controls — the grid's `name` when set, otherwise a stable
|
|
35
|
+
generated id. Lazily created so single-select grids without a `name` still group correctly. |
|
|
30
36
|
| value | `string[] \| string \| null` | - | - |
|
|
31
37
|
|
|
38
|
+
## Methods
|
|
39
|
+
|
|
40
|
+
| Name | Signature | Description |
|
|
41
|
+
| --- | --- | --- |
|
|
42
|
+
| isRowDisabled | `(row: Element \| null \| undefined)` | - |
|
|
43
|
+
|
|
32
44
|
## Slots
|
|
33
45
|
|
|
34
46
|
| Name | Description |
|
package/dist/docs/use-gridrow.md
CHANGED
package/package.json
CHANGED