use-wc 1.0.0-pre.63 → 1.0.0-pre.64

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.
@@ -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": [
@@ -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-grid` injects the leading
1443
- cell with `data-usewc-selection-cell` (a real select-all checkbox, or an inert hidden radio
1444
- spacer in single-select mode); a dev driving selection by hand uses a bare checkbox/radio. */
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 use-grid sets on every row it
1493
- injects a checkbox/radio cell into) keeps it blank when that control is the indicator —
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
@@ -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 |
@@ -8,3 +8,9 @@
8
8
  | disabled | `boolean` | `false` | - |
9
9
  | readonly | `boolean` | `false` | - |
10
10
  | value | `string` | `""` | - |
11
+
12
+ ## Methods
13
+
14
+ | Name | Signature | Description |
15
+ | --- | --- | --- |
16
+ | reconcileSelectorCell | `()` | - |
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "use-wc",
3
- "version": "1.0.0-pre.63",
3
+ "version": "1.0.0-pre.64",
4
4
  "private": false,
5
5
  "homepage": "https://usewc.com",
6
6
  "bugs": "https://github.com/dang-rabbits/use-wc/issues",
@@ -179,6 +179,7 @@
179
179
  { "name": "none" }
180
180
  ]
181
181
  },
182
+ { "name": "selectwith", "values": [{ "name": "SelectWith" }] },
182
183
  { "name": "name", "values": [] },
183
184
  { "name": "role", "values": [] },
184
185
  { "name": "disabled", "values": [] },