@genesislcap/foundation-workspace 15.90.1-GENC-1829.2 → 15.90.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/dist/custom-elements.json +162 -124
- package/dist/dts/react.d.ts +8 -8
- package/dist/dts/workspace/grid-register/grid-register.d.ts +13 -3
- package/dist/dts/workspace/grid-register/grid-register.d.ts.map +1 -1
- package/dist/esm/workspace/grid-register/grid-register.js +107 -45
- package/dist/foundation-workspace.api.json +1 -1
- package/dist/foundation-workspace.d.ts +13 -3
- package/dist/react.cjs +5 -5
- package/dist/react.mjs +4 -4
- package/package.json +14 -14
|
@@ -2099,13 +2099,28 @@
|
|
|
2099
2099
|
},
|
|
2100
2100
|
{
|
|
2101
2101
|
"kind": "javascript-module",
|
|
2102
|
-
"path": "src/workspace/
|
|
2102
|
+
"path": "src/workspace/layout-wrapper/index.ts",
|
|
2103
|
+
"declarations": [],
|
|
2104
|
+
"exports": [
|
|
2105
|
+
{
|
|
2106
|
+
"kind": "js",
|
|
2107
|
+
"name": "*",
|
|
2108
|
+
"declaration": {
|
|
2109
|
+
"name": "*",
|
|
2110
|
+
"package": "./layout-wrapper"
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
]
|
|
2114
|
+
},
|
|
2115
|
+
{
|
|
2116
|
+
"kind": "javascript-module",
|
|
2117
|
+
"path": "src/workspace/layout-wrapper/layout-wrapper.template.ts",
|
|
2103
2118
|
"declarations": [
|
|
2104
2119
|
{
|
|
2105
2120
|
"kind": "variable",
|
|
2106
|
-
"name": "
|
|
2121
|
+
"name": "LayoutWrapperTemplate",
|
|
2107
2122
|
"type": {
|
|
2108
|
-
"text": "ViewTemplate<
|
|
2123
|
+
"text": "ViewTemplate<LayoutWrapper>"
|
|
2109
2124
|
},
|
|
2110
2125
|
"default": "html`\n <slot></slot>\n`"
|
|
2111
2126
|
}
|
|
@@ -2113,26 +2128,26 @@
|
|
|
2113
2128
|
"exports": [
|
|
2114
2129
|
{
|
|
2115
2130
|
"kind": "js",
|
|
2116
|
-
"name": "
|
|
2131
|
+
"name": "LayoutWrapperTemplate",
|
|
2117
2132
|
"declaration": {
|
|
2118
|
-
"name": "
|
|
2119
|
-
"module": "src/workspace/
|
|
2133
|
+
"name": "LayoutWrapperTemplate",
|
|
2134
|
+
"module": "src/workspace/layout-wrapper/layout-wrapper.template.ts"
|
|
2120
2135
|
}
|
|
2121
2136
|
}
|
|
2122
2137
|
]
|
|
2123
2138
|
},
|
|
2124
2139
|
{
|
|
2125
2140
|
"kind": "javascript-module",
|
|
2126
|
-
"path": "src/workspace/
|
|
2141
|
+
"path": "src/workspace/layout-wrapper/layout-wrapper.ts",
|
|
2127
2142
|
"declarations": [
|
|
2128
2143
|
{
|
|
2129
2144
|
"kind": "class",
|
|
2130
|
-
"description": "Registers
|
|
2131
|
-
"name": "
|
|
2145
|
+
"description": "Registers a layout instance so workspace state can apply/load it.",
|
|
2146
|
+
"name": "LayoutWrapper",
|
|
2132
2147
|
"members": [
|
|
2133
2148
|
{
|
|
2134
2149
|
"kind": "field",
|
|
2135
|
-
"name": "
|
|
2150
|
+
"name": "layoutKey",
|
|
2136
2151
|
"type": {
|
|
2137
2152
|
"text": "string"
|
|
2138
2153
|
}
|
|
@@ -2147,69 +2162,23 @@
|
|
|
2147
2162
|
},
|
|
2148
2163
|
{
|
|
2149
2164
|
"kind": "field",
|
|
2150
|
-
"name": "
|
|
2165
|
+
"name": "layoutRegistry",
|
|
2151
2166
|
"type": {
|
|
2152
|
-
"text": "
|
|
2167
|
+
"text": "LayoutRegistry"
|
|
2153
2168
|
}
|
|
2154
2169
|
},
|
|
2155
2170
|
{
|
|
2156
2171
|
"kind": "field",
|
|
2157
|
-
"name": "
|
|
2158
|
-
"type": {
|
|
2159
|
-
"text": "GridPro | GridProLegacy | null"
|
|
2160
|
-
},
|
|
2161
|
-
"privacy": "private",
|
|
2162
|
-
"default": "null",
|
|
2163
|
-
"description": "`<prefix>-grid-pro` is the AG Grid v36 `GridPro` by default; `GridProLegacy` is the v29 grid."
|
|
2164
|
-
},
|
|
2165
|
-
{
|
|
2166
|
-
"kind": "field",
|
|
2167
|
-
"name": "gridApi",
|
|
2172
|
+
"name": "layoutElement",
|
|
2168
2173
|
"type": {
|
|
2169
|
-
"text": "
|
|
2174
|
+
"text": "FoundationLayout | null"
|
|
2170
2175
|
},
|
|
2171
2176
|
"privacy": "private",
|
|
2172
2177
|
"default": "null"
|
|
2173
2178
|
},
|
|
2174
|
-
{
|
|
2175
|
-
"kind": "field",
|
|
2176
|
-
"name": "columnApi",
|
|
2177
|
-
"type": {
|
|
2178
|
-
"text": "ColumnApi | null"
|
|
2179
|
-
},
|
|
2180
|
-
"privacy": "private",
|
|
2181
|
-
"default": "null",
|
|
2182
|
-
"description": "Only the v29 grid has a column API; on v36 the column state lives on `gridApi`."
|
|
2183
|
-
},
|
|
2184
|
-
{
|
|
2185
|
-
"kind": "method",
|
|
2186
|
-
"name": "findAndRegisterGrid",
|
|
2187
|
-
"privacy": "private",
|
|
2188
|
-
"return": {
|
|
2189
|
-
"type": {
|
|
2190
|
-
"text": "void"
|
|
2191
|
-
}
|
|
2192
|
-
}
|
|
2193
|
-
},
|
|
2194
|
-
{
|
|
2195
|
-
"kind": "field",
|
|
2196
|
-
"name": "handleGridReady",
|
|
2197
|
-
"privacy": "private",
|
|
2198
|
-
"readonly": true
|
|
2199
|
-
},
|
|
2200
|
-
{
|
|
2201
|
-
"kind": "method",
|
|
2202
|
-
"name": "attachToGridApis",
|
|
2203
|
-
"privacy": "private",
|
|
2204
|
-
"return": {
|
|
2205
|
-
"type": {
|
|
2206
|
-
"text": "void"
|
|
2207
|
-
}
|
|
2208
|
-
}
|
|
2209
|
-
},
|
|
2210
2179
|
{
|
|
2211
2180
|
"kind": "method",
|
|
2212
|
-
"name": "
|
|
2181
|
+
"name": "findAndRegisterLayout",
|
|
2213
2182
|
"privacy": "private",
|
|
2214
2183
|
"return": {
|
|
2215
2184
|
"type": {
|
|
@@ -2331,11 +2300,11 @@
|
|
|
2331
2300
|
],
|
|
2332
2301
|
"attributes": [
|
|
2333
2302
|
{
|
|
2334
|
-
"name": "
|
|
2303
|
+
"name": "layout-key",
|
|
2335
2304
|
"type": {
|
|
2336
2305
|
"text": "string"
|
|
2337
2306
|
},
|
|
2338
|
-
"fieldName": "
|
|
2307
|
+
"fieldName": "layoutKey"
|
|
2339
2308
|
},
|
|
2340
2309
|
{
|
|
2341
2310
|
"name": "design-system-prefix",
|
|
@@ -2350,68 +2319,38 @@
|
|
|
2350
2319
|
"name": "FoundationElement",
|
|
2351
2320
|
"package": "@genesislcap/web-core"
|
|
2352
2321
|
},
|
|
2353
|
-
"tagName": "
|
|
2322
|
+
"tagName": "layout-register",
|
|
2354
2323
|
"customElement": true
|
|
2355
2324
|
}
|
|
2356
2325
|
],
|
|
2357
2326
|
"exports": [
|
|
2358
2327
|
{
|
|
2359
2328
|
"kind": "js",
|
|
2360
|
-
"name": "
|
|
2329
|
+
"name": "LayoutWrapper",
|
|
2361
2330
|
"declaration": {
|
|
2362
|
-
"name": "
|
|
2363
|
-
"module": "src/workspace/
|
|
2331
|
+
"name": "LayoutWrapper",
|
|
2332
|
+
"module": "src/workspace/layout-wrapper/layout-wrapper.ts"
|
|
2364
2333
|
}
|
|
2365
2334
|
},
|
|
2366
2335
|
{
|
|
2367
2336
|
"kind": "custom-element-definition",
|
|
2368
|
-
"name": "
|
|
2369
|
-
"declaration": {
|
|
2370
|
-
"name": "GridRegister",
|
|
2371
|
-
"module": "src/workspace/grid-register/grid-register.ts"
|
|
2372
|
-
}
|
|
2373
|
-
}
|
|
2374
|
-
]
|
|
2375
|
-
},
|
|
2376
|
-
{
|
|
2377
|
-
"kind": "javascript-module",
|
|
2378
|
-
"path": "src/workspace/grid-register/index.ts",
|
|
2379
|
-
"declarations": [],
|
|
2380
|
-
"exports": [
|
|
2381
|
-
{
|
|
2382
|
-
"kind": "js",
|
|
2383
|
-
"name": "*",
|
|
2384
|
-
"declaration": {
|
|
2385
|
-
"name": "*",
|
|
2386
|
-
"package": "./grid-register"
|
|
2387
|
-
}
|
|
2388
|
-
}
|
|
2389
|
-
]
|
|
2390
|
-
},
|
|
2391
|
-
{
|
|
2392
|
-
"kind": "javascript-module",
|
|
2393
|
-
"path": "src/workspace/layout-wrapper/index.ts",
|
|
2394
|
-
"declarations": [],
|
|
2395
|
-
"exports": [
|
|
2396
|
-
{
|
|
2397
|
-
"kind": "js",
|
|
2398
|
-
"name": "*",
|
|
2337
|
+
"name": "layout-register",
|
|
2399
2338
|
"declaration": {
|
|
2400
|
-
"name": "
|
|
2401
|
-
"
|
|
2339
|
+
"name": "LayoutWrapper",
|
|
2340
|
+
"module": "src/workspace/layout-wrapper/layout-wrapper.ts"
|
|
2402
2341
|
}
|
|
2403
2342
|
}
|
|
2404
2343
|
]
|
|
2405
2344
|
},
|
|
2406
2345
|
{
|
|
2407
2346
|
"kind": "javascript-module",
|
|
2408
|
-
"path": "src/workspace/
|
|
2347
|
+
"path": "src/workspace/grid-register/grid-register.template.ts",
|
|
2409
2348
|
"declarations": [
|
|
2410
2349
|
{
|
|
2411
2350
|
"kind": "variable",
|
|
2412
|
-
"name": "
|
|
2351
|
+
"name": "GridRegisterTemplate",
|
|
2413
2352
|
"type": {
|
|
2414
|
-
"text": "ViewTemplate<
|
|
2353
|
+
"text": "ViewTemplate<GridRegister>"
|
|
2415
2354
|
},
|
|
2416
2355
|
"default": "html`\n <slot></slot>\n`"
|
|
2417
2356
|
}
|
|
@@ -2419,26 +2358,26 @@
|
|
|
2419
2358
|
"exports": [
|
|
2420
2359
|
{
|
|
2421
2360
|
"kind": "js",
|
|
2422
|
-
"name": "
|
|
2361
|
+
"name": "GridRegisterTemplate",
|
|
2423
2362
|
"declaration": {
|
|
2424
|
-
"name": "
|
|
2425
|
-
"module": "src/workspace/
|
|
2363
|
+
"name": "GridRegisterTemplate",
|
|
2364
|
+
"module": "src/workspace/grid-register/grid-register.template.ts"
|
|
2426
2365
|
}
|
|
2427
2366
|
}
|
|
2428
2367
|
]
|
|
2429
2368
|
},
|
|
2430
2369
|
{
|
|
2431
2370
|
"kind": "javascript-module",
|
|
2432
|
-
"path": "src/workspace/
|
|
2371
|
+
"path": "src/workspace/grid-register/grid-register.ts",
|
|
2433
2372
|
"declarations": [
|
|
2434
2373
|
{
|
|
2435
2374
|
"kind": "class",
|
|
2436
|
-
"description": "Registers
|
|
2437
|
-
"name": "
|
|
2375
|
+
"description": "Registers an AG Grid instance so workspace state can apply/load it. Registering applies the\ngrid's stored column state (from the loaded workspace, or its last state this session) — see\n`DefaultGridRegistry`.",
|
|
2376
|
+
"name": "GridRegister",
|
|
2438
2377
|
"members": [
|
|
2439
2378
|
{
|
|
2440
2379
|
"kind": "field",
|
|
2441
|
-
"name": "
|
|
2380
|
+
"name": "gridKey",
|
|
2442
2381
|
"type": {
|
|
2443
2382
|
"text": "string"
|
|
2444
2383
|
}
|
|
@@ -2453,23 +2392,107 @@
|
|
|
2453
2392
|
},
|
|
2454
2393
|
{
|
|
2455
2394
|
"kind": "field",
|
|
2456
|
-
"name": "
|
|
2395
|
+
"name": "gridRegistry",
|
|
2457
2396
|
"type": {
|
|
2458
|
-
"text": "
|
|
2397
|
+
"text": "GridRegistry"
|
|
2459
2398
|
}
|
|
2460
2399
|
},
|
|
2461
2400
|
{
|
|
2462
2401
|
"kind": "field",
|
|
2463
|
-
"name": "
|
|
2402
|
+
"name": "gridElement",
|
|
2464
2403
|
"type": {
|
|
2465
|
-
"text": "
|
|
2404
|
+
"text": "Grid | null"
|
|
2405
|
+
},
|
|
2406
|
+
"privacy": "private",
|
|
2407
|
+
"default": "null",
|
|
2408
|
+
"description": "`<prefix>-grid-pro` is the AG Grid v36 `GridPro` by default; `GridProLegacy` is the v29 grid."
|
|
2409
|
+
},
|
|
2410
|
+
{
|
|
2411
|
+
"kind": "field",
|
|
2412
|
+
"name": "gridApi",
|
|
2413
|
+
"type": {
|
|
2414
|
+
"text": "Grid['gridApi'] | null"
|
|
2466
2415
|
},
|
|
2467
2416
|
"privacy": "private",
|
|
2468
2417
|
"default": "null"
|
|
2469
2418
|
},
|
|
2419
|
+
{
|
|
2420
|
+
"kind": "field",
|
|
2421
|
+
"name": "columnApi",
|
|
2422
|
+
"type": {
|
|
2423
|
+
"text": "ColumnApi | null"
|
|
2424
|
+
},
|
|
2425
|
+
"privacy": "private",
|
|
2426
|
+
"default": "null",
|
|
2427
|
+
"description": "Only the v29 grid has a column API; on v36 the column state lives on `gridApi`."
|
|
2428
|
+
},
|
|
2429
|
+
{
|
|
2430
|
+
"kind": "field",
|
|
2431
|
+
"name": "registeredKey",
|
|
2432
|
+
"type": {
|
|
2433
|
+
"text": "string | null"
|
|
2434
|
+
},
|
|
2435
|
+
"privacy": "private",
|
|
2436
|
+
"default": "null",
|
|
2437
|
+
"description": "The key the current grid is registered under, so a replaced or removed grid is unregistered."
|
|
2438
|
+
},
|
|
2439
|
+
{
|
|
2440
|
+
"kind": "field",
|
|
2441
|
+
"name": "connectedAt",
|
|
2442
|
+
"type": {
|
|
2443
|
+
"text": "number"
|
|
2444
|
+
},
|
|
2445
|
+
"privacy": "private",
|
|
2446
|
+
"default": "0"
|
|
2447
|
+
},
|
|
2448
|
+
{
|
|
2449
|
+
"kind": "field",
|
|
2450
|
+
"name": "gridTag",
|
|
2451
|
+
"type": {
|
|
2452
|
+
"text": "string"
|
|
2453
|
+
},
|
|
2454
|
+
"privacy": "private",
|
|
2455
|
+
"description": "Custom element names are lowercase, so a prefix like `Rapid` still matches `rapid-grid-pro`.",
|
|
2456
|
+
"readonly": true
|
|
2457
|
+
},
|
|
2458
|
+
{
|
|
2459
|
+
"kind": "field",
|
|
2460
|
+
"name": "handleGridReady",
|
|
2461
|
+
"privacy": "private",
|
|
2462
|
+
"readonly": true,
|
|
2463
|
+
"description": "`gridReady` bubbles and is composed, so it reaches this host from a grid in any shadow root."
|
|
2464
|
+
},
|
|
2470
2465
|
{
|
|
2471
2466
|
"kind": "method",
|
|
2472
|
-
"name": "
|
|
2467
|
+
"name": "useGrid",
|
|
2468
|
+
"privacy": "private",
|
|
2469
|
+
"return": {
|
|
2470
|
+
"type": {
|
|
2471
|
+
"text": "void"
|
|
2472
|
+
}
|
|
2473
|
+
},
|
|
2474
|
+
"parameters": [
|
|
2475
|
+
{
|
|
2476
|
+
"name": "grid",
|
|
2477
|
+
"type": {
|
|
2478
|
+
"text": "Grid"
|
|
2479
|
+
}
|
|
2480
|
+
}
|
|
2481
|
+
]
|
|
2482
|
+
},
|
|
2483
|
+
{
|
|
2484
|
+
"kind": "method",
|
|
2485
|
+
"name": "attachToGridApi",
|
|
2486
|
+
"privacy": "private",
|
|
2487
|
+
"return": {
|
|
2488
|
+
"type": {
|
|
2489
|
+
"text": "void"
|
|
2490
|
+
}
|
|
2491
|
+
}
|
|
2492
|
+
},
|
|
2493
|
+
{
|
|
2494
|
+
"kind": "method",
|
|
2495
|
+
"name": "unregister",
|
|
2473
2496
|
"privacy": "private",
|
|
2474
2497
|
"return": {
|
|
2475
2498
|
"type": {
|
|
@@ -2591,11 +2614,11 @@
|
|
|
2591
2614
|
],
|
|
2592
2615
|
"attributes": [
|
|
2593
2616
|
{
|
|
2594
|
-
"name": "
|
|
2617
|
+
"name": "grid-key",
|
|
2595
2618
|
"type": {
|
|
2596
2619
|
"text": "string"
|
|
2597
2620
|
},
|
|
2598
|
-
"fieldName": "
|
|
2621
|
+
"fieldName": "gridKey"
|
|
2599
2622
|
},
|
|
2600
2623
|
{
|
|
2601
2624
|
"name": "design-system-prefix",
|
|
@@ -2610,25 +2633,40 @@
|
|
|
2610
2633
|
"name": "FoundationElement",
|
|
2611
2634
|
"package": "@genesislcap/web-core"
|
|
2612
2635
|
},
|
|
2613
|
-
"tagName": "
|
|
2636
|
+
"tagName": "grid-register",
|
|
2614
2637
|
"customElement": true
|
|
2615
2638
|
}
|
|
2616
2639
|
],
|
|
2617
2640
|
"exports": [
|
|
2618
2641
|
{
|
|
2619
2642
|
"kind": "js",
|
|
2620
|
-
"name": "
|
|
2643
|
+
"name": "GridRegister",
|
|
2621
2644
|
"declaration": {
|
|
2622
|
-
"name": "
|
|
2623
|
-
"module": "src/workspace/
|
|
2645
|
+
"name": "GridRegister",
|
|
2646
|
+
"module": "src/workspace/grid-register/grid-register.ts"
|
|
2624
2647
|
}
|
|
2625
2648
|
},
|
|
2626
2649
|
{
|
|
2627
2650
|
"kind": "custom-element-definition",
|
|
2628
|
-
"name": "
|
|
2651
|
+
"name": "grid-register",
|
|
2629
2652
|
"declaration": {
|
|
2630
|
-
"name": "
|
|
2631
|
-
"module": "src/workspace/
|
|
2653
|
+
"name": "GridRegister",
|
|
2654
|
+
"module": "src/workspace/grid-register/grid-register.ts"
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
]
|
|
2658
|
+
},
|
|
2659
|
+
{
|
|
2660
|
+
"kind": "javascript-module",
|
|
2661
|
+
"path": "src/workspace/grid-register/index.ts",
|
|
2662
|
+
"declarations": [],
|
|
2663
|
+
"exports": [
|
|
2664
|
+
{
|
|
2665
|
+
"kind": "js",
|
|
2666
|
+
"name": "*",
|
|
2667
|
+
"declaration": {
|
|
2668
|
+
"name": "*",
|
|
2669
|
+
"package": "./grid-register"
|
|
2632
2670
|
}
|
|
2633
2671
|
}
|
|
2634
2672
|
]
|
package/dist/dts/react.d.ts
CHANGED
|
@@ -46,22 +46,22 @@ export declare const WorkspaceManager: React.ForwardRefExoticComponent<
|
|
|
46
46
|
>;
|
|
47
47
|
export type WorkspaceManagerRef = WorkspaceManagerWC;
|
|
48
48
|
|
|
49
|
-
export declare const
|
|
49
|
+
export declare const LayoutWrapper: React.ForwardRefExoticComponent<
|
|
50
50
|
React.PropsWithChildren<
|
|
51
|
-
Omit<PublicOf<
|
|
51
|
+
Omit<PublicOf<LayoutWrapperWC>, 'children' | 'style'> &
|
|
52
52
|
HTMLWCProps & {
|
|
53
53
|
}
|
|
54
|
-
> & React.RefAttributes<
|
|
54
|
+
> & React.RefAttributes<LayoutWrapperWC>
|
|
55
55
|
>;
|
|
56
|
-
export type
|
|
56
|
+
export type LayoutWrapperRef = LayoutWrapperWC;
|
|
57
57
|
|
|
58
|
-
export declare const
|
|
58
|
+
export declare const GridRegister: React.ForwardRefExoticComponent<
|
|
59
59
|
React.PropsWithChildren<
|
|
60
|
-
Omit<PublicOf<
|
|
60
|
+
Omit<PublicOf<GridRegisterWC>, 'children' | 'style'> &
|
|
61
61
|
HTMLWCProps & {
|
|
62
62
|
}
|
|
63
|
-
> & React.RefAttributes<
|
|
63
|
+
> & React.RefAttributes<GridRegisterWC>
|
|
64
64
|
>;
|
|
65
|
-
export type
|
|
65
|
+
export type GridRegisterRef = GridRegisterWC;
|
|
66
66
|
|
|
67
67
|
export {};
|
|
@@ -4,6 +4,10 @@ import { GridRegistry } from '../grid-registry';
|
|
|
4
4
|
* Registers an AG Grid instance so workspace state can apply/load it. Registering applies the
|
|
5
5
|
* grid's stored column state (from the loaded workspace, or its last state this session) — see
|
|
6
6
|
* `DefaultGridRegistry`.
|
|
7
|
+
* @remarks
|
|
8
|
+
* The grid may be a light-DOM child or rendered inside a descendant's open shadow root (e.g.
|
|
9
|
+
* `<entity-management>`). A grid that becomes ready later, or replaces a removed one, is picked up
|
|
10
|
+
* from its composed `gridReady` event. A grid inside a nested `grid-register` belongs to that one.
|
|
7
11
|
* @alpha
|
|
8
12
|
*/
|
|
9
13
|
export declare class GridRegister extends FoundationElement {
|
|
@@ -15,11 +19,17 @@ export declare class GridRegister extends FoundationElement {
|
|
|
15
19
|
private gridApi;
|
|
16
20
|
/** Only the v29 grid has a column API; on v36 the column state lives on `gridApi`. */
|
|
17
21
|
private columnApi;
|
|
22
|
+
/** The key the current grid is registered under, so a replaced or removed grid is unregistered. */
|
|
23
|
+
private registeredKey;
|
|
24
|
+
private connectedAt;
|
|
25
|
+
/** Custom element names are lowercase, so a prefix like `Rapid` still matches `rapid-grid-pro`. */
|
|
26
|
+
private get gridTag();
|
|
18
27
|
connectedCallback(): void;
|
|
19
28
|
disconnectedCallback(): void;
|
|
20
|
-
|
|
29
|
+
/** `gridReady` bubbles and is composed, so it reaches this host from a grid in any shadow root. */
|
|
21
30
|
private readonly handleGridReady;
|
|
22
|
-
private
|
|
23
|
-
private
|
|
31
|
+
private useGrid;
|
|
32
|
+
private attachToGridApi;
|
|
33
|
+
private unregister;
|
|
24
34
|
}
|
|
25
35
|
//# sourceMappingURL=grid-register.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grid-register.d.ts","sourceRoot":"","sources":["../../../../src/workspace/grid-register/grid-register.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;
|
|
1
|
+
{"version":3,"file":"grid-register.d.ts","sourceRoot":"","sources":["../../../../src/workspace/grid-register/grid-register.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAuB,MAAM,uBAAuB,CAAC;AAC/E,OAAO,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAiEhD;;;;;;;;;GASG;AACH,qBAIa,YAAa,SAAQ,iBAAiB;IAChB,OAAO,EAAE,MAAM,CAAC;IACJ,kBAAkB,EAAE,MAAM,CAAW;IAEpE,YAAY,EAAE,YAAY,CAAC;IAEzC,oGAAoG;IACpG,OAAO,CAAC,WAAW,CAAqB;IACxC,OAAO,CAAC,OAAO,CAAgC;IAC/C,sFAAsF;IACtF,OAAO,CAAC,SAAS,CAA0B;IAC3C,mGAAmG;IACnG,OAAO,CAAC,aAAa,CAAuB;IAC5C,OAAO,CAAC,WAAW,CAAK;IAExB,mGAAmG;IACnG,OAAO,KAAK,OAAO,GAElB;IAED,iBAAiB,IAAI,IAAI;IAYzB,oBAAoB,IAAI,IAAI;IAc5B,mGAAmG;IACnG,OAAO,CAAC,QAAQ,CAAC,eAAe,CAY9B;IAEF,OAAO,CAAC,OAAO;IAKf,OAAO,CAAC,eAAe;IA0BvB,OAAO,CAAC,UAAU;CASnB"}
|
|
@@ -2,10 +2,62 @@ import { __decorate } from "tslib";
|
|
|
2
2
|
import { FoundationElement, attr, customElement } from '@genesislcap/web-core';
|
|
3
3
|
import { GridRegistry } from '../grid-registry';
|
|
4
4
|
import { GridRegisterTemplate as template } from './grid-register.template';
|
|
5
|
+
/**
|
|
6
|
+
* How long a register must stay connected without finding a grid before disconnecting warns.
|
|
7
|
+
* Layouts create throwaway copies of their panes (rapid-layout does), which disconnect before a
|
|
8
|
+
* late grid such as entity-management's has rendered; a misconfigured register stays mounted.
|
|
9
|
+
*/
|
|
10
|
+
const MISSING_GRID_WARNING_GRACE_MS = 2000;
|
|
11
|
+
/** Up one step in the flat tree: to the assigned slot, else the parent, else a shadow root's host. */
|
|
12
|
+
const flatParent = (node) => {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
return (_c = (_b = (_a = node.assignedSlot) !== null && _a !== void 0 ? _a : node.parentNode) !== null && _b !== void 0 ? _b : (node.nodeType === Node.DOCUMENT_FRAGMENT_NODE ? node.host : null)) !== null && _c !== void 0 ? _c : null;
|
|
15
|
+
};
|
|
16
|
+
/**
|
|
17
|
+
* The `grid-register` that owns `node`: the nearest one above it in the flat tree, the same order
|
|
18
|
+
* as a composed event's path. A grid slotted into a nested register belongs to that register, so
|
|
19
|
+
* nested registers never share a grid.
|
|
20
|
+
*/
|
|
21
|
+
const owningRegister = (node) => {
|
|
22
|
+
for (let current = flatParent(node); current; current = flatParent(current)) {
|
|
23
|
+
if (current.localName === 'grid-register') {
|
|
24
|
+
return current;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
return null;
|
|
28
|
+
};
|
|
29
|
+
/**
|
|
30
|
+
* Finds the first grid `owner` owns, a tree scope at a time: the light DOM first, natively, then
|
|
31
|
+
* the open shadow roots beneath it. So a light-DOM grid wins over one in a descendant's shadow root.
|
|
32
|
+
*/
|
|
33
|
+
const findOwnedGrid = (root, gridTag, owner) => {
|
|
34
|
+
const isOwned = (element) => owningRegister(element) === owner;
|
|
35
|
+
// `getElementsByTagName` matches the tag exactly, without parsing the prefix as a selector.
|
|
36
|
+
const candidates = root === owner ? root.getElementsByTagName(gridTag) : root.querySelectorAll('*');
|
|
37
|
+
for (const element of candidates) {
|
|
38
|
+
if (element.localName === gridTag && isOwned(element)) {
|
|
39
|
+
return element;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
for (const element of root.querySelectorAll('*')) {
|
|
43
|
+
// A host another register owns can only hold grids that register (or a deeper one) owns.
|
|
44
|
+
if (element.shadowRoot && isOwned(element)) {
|
|
45
|
+
const found = findOwnedGrid(element.shadowRoot, gridTag, owner);
|
|
46
|
+
if (found) {
|
|
47
|
+
return found;
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
return null;
|
|
52
|
+
};
|
|
5
53
|
/**
|
|
6
54
|
* Registers an AG Grid instance so workspace state can apply/load it. Registering applies the
|
|
7
55
|
* grid's stored column state (from the loaded workspace, or its last state this session) — see
|
|
8
56
|
* `DefaultGridRegistry`.
|
|
57
|
+
* @remarks
|
|
58
|
+
* The grid may be a light-DOM child or rendered inside a descendant's open shadow root (e.g.
|
|
59
|
+
* `<entity-management>`). A grid that becomes ready later, or replaces a removed one, is picked up
|
|
60
|
+
* from its composed `gridReady` event. A grid inside a nested `grid-register` belongs to that one.
|
|
9
61
|
* @alpha
|
|
10
62
|
*/
|
|
11
63
|
let GridRegister = class GridRegister extends FoundationElement {
|
|
@@ -17,70 +69,80 @@ let GridRegister = class GridRegister extends FoundationElement {
|
|
|
17
69
|
this.gridApi = null;
|
|
18
70
|
/** Only the v29 grid has a column API; on v36 the column state lives on `gridApi`. */
|
|
19
71
|
this.columnApi = null;
|
|
20
|
-
|
|
21
|
-
|
|
72
|
+
/** The key the current grid is registered under, so a replaced or removed grid is unregistered. */
|
|
73
|
+
this.registeredKey = null;
|
|
74
|
+
this.connectedAt = 0;
|
|
75
|
+
/** `gridReady` bubbles and is composed, so it reaches this host from a grid in any shadow root. */
|
|
76
|
+
this.handleGridReady = (event) => {
|
|
77
|
+
var _a;
|
|
78
|
+
const path = event.composedPath();
|
|
79
|
+
const grid = path.find((target) => target.localName === this.gridTag);
|
|
80
|
+
if (!grid || owningRegister(grid) !== this) {
|
|
81
|
+
return;
|
|
82
|
+
}
|
|
83
|
+
// Stay with the first grid while it is mounted, but take over from one that was removed
|
|
84
|
+
// (e.g. a grid re-rendered by `when(...)`), whose API grid-pro has destroyed.
|
|
85
|
+
if (grid === this.gridElement || !((_a = this.gridElement) === null || _a === void 0 ? void 0 : _a.isConnected)) {
|
|
86
|
+
this.useGrid(grid);
|
|
87
|
+
}
|
|
22
88
|
};
|
|
23
89
|
}
|
|
90
|
+
/** Custom element names are lowercase, so a prefix like `Rapid` still matches `rapid-grid-pro`. */
|
|
91
|
+
get gridTag() {
|
|
92
|
+
return `${this.designSystemPrefix}-grid-pro`.toLowerCase();
|
|
93
|
+
}
|
|
24
94
|
connectedCallback() {
|
|
25
95
|
super.connectedCallback();
|
|
26
|
-
this.
|
|
96
|
+
this.connectedAt = Date.now();
|
|
97
|
+
this.addEventListener('gridReady', this.handleGridReady);
|
|
98
|
+
// A grid that is already ready (e.g. a layout move reconnecting this register) fires no
|
|
99
|
+
// `gridReady`; any grid that becomes ready later does, and is registered from it.
|
|
100
|
+
const found = findOwnedGrid(this, this.gridTag, this);
|
|
101
|
+
if (found) {
|
|
102
|
+
this.useGrid(found);
|
|
103
|
+
}
|
|
27
104
|
}
|
|
28
105
|
disconnectedCallback() {
|
|
29
106
|
super.disconnectedCallback();
|
|
30
|
-
|
|
31
|
-
|
|
107
|
+
this.removeEventListener('gridReady', this.handleGridReady);
|
|
108
|
+
this.unregister();
|
|
109
|
+
// Nothing else reports a prefix mismatch, a closed shadow root or a tag typo.
|
|
110
|
+
if (!this.gridElement && Date.now() - this.connectedAt >= MISSING_GRID_WARNING_GRACE_MS) {
|
|
111
|
+
console.warn(`grid-register: no ${this.gridTag} element found for grid-key "${this.gridKey}"`);
|
|
32
112
|
}
|
|
33
|
-
this.
|
|
113
|
+
this.gridElement = null;
|
|
34
114
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
this.
|
|
38
|
-
if (this.gridElement) {
|
|
39
|
-
this.gridElement.addEventListener('gridReady', this.handleGridReady);
|
|
40
|
-
this.attachToGridApis();
|
|
41
|
-
}
|
|
42
|
-
else {
|
|
43
|
-
setTimeout(() => {
|
|
44
|
-
this.gridElement = this.querySelector(gridTag);
|
|
45
|
-
if (this.gridElement) {
|
|
46
|
-
this.gridElement.addEventListener('gridReady', this.handleGridReady);
|
|
47
|
-
this.attachToGridApis();
|
|
48
|
-
}
|
|
49
|
-
else {
|
|
50
|
-
console.warn(`grid-register: ${gridTag} element not found`);
|
|
51
|
-
}
|
|
52
|
-
}, 100);
|
|
53
|
-
}
|
|
115
|
+
useGrid(grid) {
|
|
116
|
+
this.gridElement = grid;
|
|
117
|
+
this.attachToGridApi();
|
|
54
118
|
}
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
return;
|
|
59
|
-
}
|
|
60
|
-
const anyGrid = this.gridElement;
|
|
61
|
-
const gridApi = anyGrid.gridApi || null;
|
|
62
|
-
const columnApi = ('columnApi' in anyGrid && anyGrid.columnApi) || null;
|
|
63
|
-
const persistKey = ((_a = anyGrid === null || anyGrid === void 0 ? void 0 : anyGrid.getAttribute) === null || _a === void 0 ? void 0 : _a.call(anyGrid, 'persist-column-state-key')) || this.gridKey;
|
|
119
|
+
attachToGridApi() {
|
|
120
|
+
const grid = this.gridElement;
|
|
121
|
+
const gridApi = grid.gridApi || null;
|
|
64
122
|
if (!gridApi || this.gridApi === gridApi) {
|
|
65
123
|
return;
|
|
66
124
|
}
|
|
67
125
|
this.gridApi = gridApi;
|
|
68
|
-
this.columnApi = columnApi;
|
|
126
|
+
this.columnApi = ('columnApi' in grid && grid.columnApi) || null;
|
|
127
|
+
const persistKey = grid.getAttribute('persist-column-state-key') || this.gridKey;
|
|
128
|
+
// Re-registering the same key keeps the outgoing grid's state; a different key must let go of it.
|
|
129
|
+
if (this.registeredKey && this.registeredKey !== persistKey) {
|
|
130
|
+
this.unregister();
|
|
131
|
+
}
|
|
69
132
|
if (!persistKey) {
|
|
70
133
|
console.warn('grid-register: missing persist-column-state-key; grid state will not be saved');
|
|
134
|
+
return;
|
|
71
135
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
this.gridRegistry.registerGrid(persistKey, gridApi, columnApi, anyGrid);
|
|
77
|
-
}
|
|
136
|
+
// The element is grid-pro's own filter persistence (`setFilterModel`), so a workspace's
|
|
137
|
+
// filters survive grid-pro restoring its persisted filter model after registration.
|
|
138
|
+
this.gridRegistry.registerGrid(persistKey, gridApi, this.columnApi, grid);
|
|
139
|
+
this.registeredKey = persistKey;
|
|
78
140
|
}
|
|
79
|
-
|
|
80
|
-
if (this.
|
|
81
|
-
this.
|
|
141
|
+
unregister() {
|
|
142
|
+
if (this.registeredKey) {
|
|
143
|
+
this.gridRegistry.unregisterGrid(this.registeredKey);
|
|
82
144
|
}
|
|
83
|
-
this.
|
|
145
|
+
this.registeredKey = null;
|
|
84
146
|
this.gridApi = null;
|
|
85
147
|
this.columnApi = null;
|
|
86
148
|
}
|
|
@@ -956,7 +956,7 @@
|
|
|
956
956
|
{
|
|
957
957
|
"kind": "Class",
|
|
958
958
|
"canonicalReference": "@genesislcap/foundation-workspace!GridRegister:class",
|
|
959
|
-
"docComment": "/**\n * Registers an AG Grid instance so workspace state can apply/load it. Registering applies the grid's stored column state (from the loaded workspace, or its last state this session) — see `DefaultGridRegistry`.\n *\n * @alpha\n */\n",
|
|
959
|
+
"docComment": "/**\n * Registers an AG Grid instance so workspace state can apply/load it. Registering applies the grid's stored column state (from the loaded workspace, or its last state this session) — see `DefaultGridRegistry`.\n *\n * @remarks\n *\n * The grid may be a light-DOM child or rendered inside a descendant's open shadow root (e.g. `<entity-management>`). A grid that becomes ready later, or replaces a removed one, is picked up from its composed `gridReady` event. A grid inside a nested `grid-register` belongs to that one.\n *\n * @alpha\n */\n",
|
|
960
960
|
"excerptTokens": [
|
|
961
961
|
{
|
|
962
962
|
"kind": "Content",
|
|
@@ -232,6 +232,10 @@ export declare interface GridFilterPersistence {
|
|
|
232
232
|
* Registers an AG Grid instance so workspace state can apply/load it. Registering applies the
|
|
233
233
|
* grid's stored column state (from the loaded workspace, or its last state this session) — see
|
|
234
234
|
* `DefaultGridRegistry`.
|
|
235
|
+
* @remarks
|
|
236
|
+
* The grid may be a light-DOM child or rendered inside a descendant's open shadow root (e.g.
|
|
237
|
+
* `<entity-management>`). A grid that becomes ready later, or replaces a removed one, is picked up
|
|
238
|
+
* from its composed `gridReady` event. A grid inside a nested `grid-register` belongs to that one.
|
|
235
239
|
* @alpha
|
|
236
240
|
*/
|
|
237
241
|
export declare class GridRegister extends FoundationElement {
|
|
@@ -243,12 +247,18 @@ export declare class GridRegister extends FoundationElement {
|
|
|
243
247
|
private gridApi;
|
|
244
248
|
/** Only the v29 grid has a column API; on v36 the column state lives on `gridApi`. */
|
|
245
249
|
private columnApi;
|
|
250
|
+
/** The key the current grid is registered under, so a replaced or removed grid is unregistered. */
|
|
251
|
+
private registeredKey;
|
|
252
|
+
private connectedAt;
|
|
253
|
+
/** Custom element names are lowercase, so a prefix like `Rapid` still matches `rapid-grid-pro`. */
|
|
254
|
+
private get gridTag();
|
|
246
255
|
connectedCallback(): void;
|
|
247
256
|
disconnectedCallback(): void;
|
|
248
|
-
|
|
257
|
+
/** `gridReady` bubbles and is composed, so it reaches this host from a grid in any shadow root. */
|
|
249
258
|
private readonly handleGridReady;
|
|
250
|
-
private
|
|
251
|
-
private
|
|
259
|
+
private useGrid;
|
|
260
|
+
private attachToGridApi;
|
|
261
|
+
private unregister;
|
|
252
262
|
}
|
|
253
263
|
|
|
254
264
|
/**
|
package/dist/react.cjs
CHANGED
|
@@ -15,18 +15,18 @@ const WorkspaceManager = React.forwardRef(function WorkspaceManager(props, ref)
|
|
|
15
15
|
return React.createElement(customElements.getName(WorkspaceManagerWC) ?? 'workspace-manager', { ...rest, ref }, children);
|
|
16
16
|
});
|
|
17
17
|
|
|
18
|
-
const
|
|
18
|
+
const LayoutWrapper = React.forwardRef(function LayoutWrapper(props, ref) {
|
|
19
19
|
const { children, ...rest } = props;
|
|
20
|
-
return React.createElement(customElements.getName(
|
|
20
|
+
return React.createElement(customElements.getName(LayoutWrapperWC) ?? 'layout-register', { ...rest, ref }, children);
|
|
21
21
|
});
|
|
22
22
|
|
|
23
|
-
const
|
|
23
|
+
const GridRegister = React.forwardRef(function GridRegister(props, ref) {
|
|
24
24
|
const { children, ...rest } = props;
|
|
25
|
-
return React.createElement(customElements.getName(
|
|
25
|
+
return React.createElement(customElements.getName(GridRegisterWC) ?? 'grid-register', { ...rest, ref }, children);
|
|
26
26
|
});
|
|
27
27
|
|
|
28
28
|
module.exports = {
|
|
29
29
|
WorkspaceManager,
|
|
30
|
-
GridRegister,
|
|
31
30
|
LayoutWrapper,
|
|
31
|
+
GridRegister,
|
|
32
32
|
};
|
package/dist/react.mjs
CHANGED
|
@@ -13,12 +13,12 @@ export const WorkspaceManager = React.forwardRef(function WorkspaceManager(props
|
|
|
13
13
|
return React.createElement(customElements.getName(WorkspaceManagerWC) ?? 'workspace-manager', { ...rest, ref }, children);
|
|
14
14
|
});
|
|
15
15
|
|
|
16
|
-
export const
|
|
16
|
+
export const LayoutWrapper = React.forwardRef(function LayoutWrapper(props, ref) {
|
|
17
17
|
const { children, ...rest } = props;
|
|
18
|
-
return React.createElement(customElements.getName(
|
|
18
|
+
return React.createElement(customElements.getName(LayoutWrapperWC) ?? 'layout-register', { ...rest, ref }, children);
|
|
19
19
|
});
|
|
20
20
|
|
|
21
|
-
export const
|
|
21
|
+
export const GridRegister = React.forwardRef(function GridRegister(props, ref) {
|
|
22
22
|
const { children, ...rest } = props;
|
|
23
|
-
return React.createElement(customElements.getName(
|
|
23
|
+
return React.createElement(customElements.getName(GridRegisterWC) ?? 'grid-register', { ...rest, ref }, children);
|
|
24
24
|
});
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-workspace",
|
|
3
3
|
"description": "Genesis Foundation Workspace Components and State",
|
|
4
|
-
"version": "15.90.
|
|
4
|
+
"version": "15.90.2",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"main": "dist/esm/index.js",
|
|
@@ -48,22 +48,22 @@
|
|
|
48
48
|
}
|
|
49
49
|
},
|
|
50
50
|
"devDependencies": {
|
|
51
|
-
"@genesislcap/foundation-testing": "15.90.
|
|
52
|
-
"@genesislcap/genx": "15.90.
|
|
53
|
-
"@genesislcap/ts-builder": "15.90.
|
|
54
|
-
"@genesislcap/uvu-playwright-builder": "15.90.
|
|
55
|
-
"@genesislcap/vite-builder": "15.90.
|
|
56
|
-
"@genesislcap/webpack-builder": "15.90.
|
|
51
|
+
"@genesislcap/foundation-testing": "15.90.2",
|
|
52
|
+
"@genesislcap/genx": "15.90.2",
|
|
53
|
+
"@genesislcap/ts-builder": "15.90.2",
|
|
54
|
+
"@genesislcap/uvu-playwright-builder": "15.90.2",
|
|
55
|
+
"@genesislcap/vite-builder": "15.90.2",
|
|
56
|
+
"@genesislcap/webpack-builder": "15.90.2"
|
|
57
57
|
},
|
|
58
58
|
"dependencies": {
|
|
59
59
|
"@ag-grid-community/core": "29.2.0",
|
|
60
|
-
"@genesislcap/foundation-comms": "15.90.
|
|
61
|
-
"@genesislcap/foundation-layout": "15.90.
|
|
62
|
-
"@genesislcap/foundation-notifications": "15.90.
|
|
63
|
-
"@genesislcap/foundation-ui": "15.90.
|
|
64
|
-
"@genesislcap/foundation-utils": "15.90.
|
|
65
|
-
"@genesislcap/grid-pro": "15.90.
|
|
66
|
-
"@genesislcap/web-core": "15.90.
|
|
60
|
+
"@genesislcap/foundation-comms": "15.90.2",
|
|
61
|
+
"@genesislcap/foundation-layout": "15.90.2",
|
|
62
|
+
"@genesislcap/foundation-notifications": "15.90.2",
|
|
63
|
+
"@genesislcap/foundation-ui": "15.90.2",
|
|
64
|
+
"@genesislcap/foundation-utils": "15.90.2",
|
|
65
|
+
"@genesislcap/grid-pro": "15.90.2",
|
|
66
|
+
"@genesislcap/web-core": "15.90.2"
|
|
67
67
|
},
|
|
68
68
|
"repository": {
|
|
69
69
|
"type": "git",
|