@design.estate/dees-catalog 24.2.0 → 24.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist_bundle/bundle.js +6164 -5263
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-SSD44HAU.js → chunk-4UZGSPGV.js} +8 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-SSD44HAU.js.map → chunk-4UZGSPGV.js.map} +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-YUJKYSDX.js → chunk-7CM7S6EQ.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-347GWLFZ.js → chunk-R6EBIDCM.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-5P7JLMRS.js → de-LD3JG4AD.js} +5 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-LD3JG4AD.js.map +1 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-PC4PYTOT.js → dees-modal-Z3DSEMNI.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-GFHNW2QR.js → dees-workspace-terminal-KPB3RVGL.js} +4 -4
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/es-J75P6Y7U.js +1461 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/es-J75P6Y7U.js.map +1 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/fr-FXZISX5I.js +1461 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/fr-FXZISX5I.js.map +1 -0
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-appui/appui.helpers.d.ts +6 -0
- package/dist_ts_web/elements/00group-appui/appui.helpers.js +7 -1
- package/dist_ts_web/elements/00group-appui/dees-appui/dees-appui.js +7 -10
- package/dist_ts_web/elements/00group-appui/dees-appui-detailpane/dees-appui-detailpane.d.ts +88 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-detailpane/dees-appui-detailpane.demo.d.ts +34 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-detailpane/dees-appui-detailpane.demo.js +317 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-detailpane/dees-appui-detailpane.js +510 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-detailpane/index.d.ts +1 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-detailpane/index.js +2 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-page/dees-appui-page.d.ts +43 -17
- package/dist_ts_web/elements/00group-appui/dees-appui-page/dees-appui-page.demo.d.ts +2 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-page/dees-appui-page.demo.js +28 -3
- package/dist_ts_web/elements/00group-appui/dees-appui-page/dees-appui-page.js +113 -152
- package/dist_ts_web/elements/00group-appui/dees-appui-secondarytabs/dees-appui-secondarytabs.d.ts +68 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-secondarytabs/dees-appui-secondarytabs.demo.d.ts +4 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-secondarytabs/dees-appui-secondarytabs.demo.js +57 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-secondarytabs/dees-appui-secondarytabs.js +357 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-secondarytabs/index.d.ts +1 -0
- package/dist_ts_web/elements/00group-appui/dees-appui-secondarytabs/index.js +2 -0
- package/dist_ts_web/elements/00group-appui/index.d.ts +2 -0
- package/dist_ts_web/elements/00group-appui/index.js +3 -1
- package/dist_ts_web/elements/00group-feedback/dees-statusbutton/dees-statusbutton.demo.js +6 -6
- package/dist_ts_web/elements/00group-media/dees-pdf-viewer/component.d.ts +10 -0
- package/dist_ts_web/elements/00group-media/dees-pdf-viewer/component.js +38 -6
- package/dist_ts_web/elements/00group-media/dees-pdf-viewer/styles.js +4 -1
- package/dist_ts_web/i18n/de.d.ts +12 -0
- package/dist_ts_web/i18n/de.js +4 -1
- package/dist_ts_web/i18n/es.d.ts +5780 -0
- package/dist_ts_web/i18n/es.js +1452 -0
- package/dist_ts_web/i18n/fr.d.ts +5780 -0
- package/dist_ts_web/i18n/fr.js +1452 -0
- package/dist_ts_web/i18n/messages.d.ts +13 -1
- package/dist_ts_web/i18n/messages.js +8 -2
- package/package.json +2 -2
- package/readme.md +133 -16
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-appui/appui.helpers.ts +7 -0
- package/ts_web/elements/00group-appui/dees-appui/dees-appui.ts +6 -10
- package/ts_web/elements/00group-appui/dees-appui-detailpane/dees-appui-detailpane.demo.ts +267 -0
- package/ts_web/elements/00group-appui/dees-appui-detailpane/dees-appui-detailpane.ts +451 -0
- package/ts_web/elements/00group-appui/dees-appui-detailpane/index.ts +1 -0
- package/ts_web/elements/00group-appui/dees-appui-page/dees-appui-page.demo.ts +30 -2
- package/ts_web/elements/00group-appui/dees-appui-page/dees-appui-page.ts +113 -148
- package/ts_web/elements/00group-appui/dees-appui-secondarytabs/dees-appui-secondarytabs.demo.ts +62 -0
- package/ts_web/elements/00group-appui/dees-appui-secondarytabs/dees-appui-secondarytabs.ts +299 -0
- package/ts_web/elements/00group-appui/dees-appui-secondarytabs/index.ts +1 -0
- package/ts_web/elements/00group-appui/index.ts +2 -0
- package/ts_web/elements/00group-feedback/dees-statusbutton/dees-statusbutton.demo.ts +5 -5
- package/ts_web/elements/00group-media/dees-pdf-viewer/component.ts +37 -5
- package/ts_web/elements/00group-media/dees-pdf-viewer/styles.ts +3 -0
- package/ts_web/i18n/de.ts +3 -0
- package/ts_web/i18n/es.ts +1452 -0
- package/ts_web/i18n/fr.ts +1452 -0
- package/ts_web/i18n/messages.ts +8 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/de-5P7JLMRS.js.map +0 -1
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-YUJKYSDX.js.map → chunk-7CM7S6EQ.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-347GWLFZ.js.map → chunk-R6EBIDCM.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-PC4PYTOT.js.map → dees-modal-Z3DSEMNI.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-GFHNW2QR.js.map → dees-workspace-terminal-KPB3RVGL.js.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@design.estate/dees-catalog",
|
|
3
|
-
"version": "24.
|
|
3
|
+
"version": "24.3.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.",
|
|
6
6
|
"main": "dist_ts_web/index.js",
|
|
@@ -63,7 +63,7 @@
|
|
|
63
63
|
},
|
|
64
64
|
"devDependencies": {
|
|
65
65
|
"@design.estate/wcctools": "^7.1.4",
|
|
66
|
-
"@git.zone/tsrepo": "^
|
|
66
|
+
"@git.zone/tsrepo": "^2.0.0",
|
|
67
67
|
"@push.rocks/projectinfo": "^5.1.0",
|
|
68
68
|
"@types/node": "26.6.6",
|
|
69
69
|
"@types/qrcode": "^1.5.6"
|
package/readme.md
CHANGED
|
@@ -27,6 +27,8 @@ switcher**, **view-toggle**, and **single-selection toggle** all lead to
|
|
|
27
27
|
| Navigate open content panels, with optional close controls | [`dees-appui-tabs`](#deesappuitabs) | Tab selection, close actions and keyboard focus. Use multitoggle for changing a display mode within a panel. |
|
|
28
28
|
| Build an application shell with views and menus | [`dees-appui`](#deesappui) | Main/secondary navigation, content tabs, bars and view lifecycle. Routes by hash, or by path beside the host's server routes. |
|
|
29
29
|
| Give a view its page header: title, summary, actions, tabs | [`dees-appui-page`](#deesappuipage) | One max-width and padding for every view; the primary action at the end of the title row. Do not hand-code headers. |
|
|
30
|
+
| Open a list's record beside the list, each scrolling on its own; a list with a sidebar | [`dees-appui-detailpane`](#deesappuidetailpane) in a `dees-appui-page` with `layout="fill"` | The host opens it from a row and closes it on `close-request`; the reader resizes it, and `width-change` reports the width to keep. At 700px or less it covers the list. |
|
|
31
|
+
| Switch a page's sub-views or a record's parts with tabs under its heading | [`dees-appui-secondarytabs`](#deesappuisecondarytabs), or `tabs` on [`dees-appui-page`](#deesappuipage) | A stripe of its own under the heading, the selected tab's line on its hairline; one Tab stop, badges, the first label under the title. Open records a reader closes again are content tabs ([`dees-appui-tabs`](#deesappuitabs)). |
|
|
30
32
|
| Head a view with its title, summary and actions above content that scrolls on its own | [`dees-appui-contentheading`](#deesappuicontentheading), or `contentHeading` in the view definition | A title with its badges, a line of facts joined with " · ", the view's tools and actions at the end of the row and a hairline across the content area; it stays while the view scrolls. `dees-appui-page` draws its header with it. |
|
|
31
33
|
| Report a page's warnings and errors from its header instead of stacking hints above its content | [`dees-statusbutton`](#deesstatusbutton) | One button beside the page's actions shows the worst status and a count; its speech-bubble panel lists the statuses, and an error or a severe warning opens it by itself. Keep [`dees-hint`](#deeshint) for a note next to the thing it explains. |
|
|
32
34
|
| Say that a tile, panel or list is loading, empty or failed | [`dees-state`](#deesstate) | One pattern for all three: icon or spinner, sentence, the way on, Retry and folded technical detail. A `dees-table` says the same through `loading`, `error` and `'empty'` actions. |
|
|
@@ -372,12 +374,14 @@ task guide and examples deliberately; the generated table does not replace them.
|
|
|
372
374
|
| `dees-appui-bottombar` | appui | [DeesAppuiBottombar](#deesappuibottombar) | [Source](ts_web/elements/00group-appui/dees-appui-bottombar/dees-appui-bottombar.ts) |
|
|
373
375
|
| `dees-appui-commandpalette` | appui | [DeesAppuiCommandpalette](#deesappuicommandpalette) | [Source](ts_web/elements/00group-appui/dees-appui-commandpalette/dees-appui-commandpalette.ts) |
|
|
374
376
|
| `dees-appui-contentheading` | appui | [DeesAppuiContentheading](#deesappuicontentheading) | [Source](ts_web/elements/00group-appui/dees-appui-contentheading/dees-appui-contentheading.ts) |
|
|
377
|
+
| `dees-appui-detailpane` | appui | [DeesAppuiDetailpane](#deesappuidetailpane) | [Source](ts_web/elements/00group-appui/dees-appui-detailpane/dees-appui-detailpane.ts) |
|
|
375
378
|
| `dees-appui-location` | appui | [DeesAppuiLocation](#deesappuilocation) | [Source](ts_web/elements/00group-appui/dees-appui-location/dees-appui-location.ts) |
|
|
376
379
|
| `dees-appui-maincontent` | appui | [DeesAppuiMaincontent](#deesappuimaincontent) | [Source](ts_web/elements/00group-appui/dees-appui-maincontent/dees-appui-maincontent.ts) |
|
|
377
380
|
| `dees-appui-mainmenu` | appui | [DeesAppuiMainmenu](#deesappuimainmenu) | [Source](ts_web/elements/00group-appui/dees-appui-mainmenu/dees-appui-mainmenu.ts) |
|
|
378
381
|
| `dees-appui-page` | appui | [DeesAppuiPage](#deesappuipage) | [Source](ts_web/elements/00group-appui/dees-appui-page/dees-appui-page.ts) |
|
|
379
382
|
| `dees-appui-profiledropdown` | appui | — | [Source](ts_web/elements/00group-appui/dees-appui-profiledropdown/dees-appui-profiledropdown.ts) |
|
|
380
383
|
| `dees-appui-secondarymenu` | appui | [DeesAppuiSecondarymenu](#deesappuisecondarymenu) | [Source](ts_web/elements/00group-appui/dees-appui-secondarymenu/dees-appui-secondarymenu.ts) |
|
|
384
|
+
| `dees-appui-secondarytabs` | appui | [DeesAppuiSecondarytabs](#deesappuisecondarytabs) | [Source](ts_web/elements/00group-appui/dees-appui-secondarytabs/dees-appui-secondarytabs.ts) |
|
|
381
385
|
| `dees-appui-signin` | appui | [DeesAppuiSignin](#deesappuisignin) | [Source](ts_web/elements/00group-appui/dees-appui-signin/dees-appui-signin.ts) |
|
|
382
386
|
| `dees-appui-tabs` | appui | [DeesAppuiTabs](#deesappuitabs) | [Source](ts_web/elements/00group-appui/dees-appui-tabs/dees-appui-tabs.ts) |
|
|
383
387
|
| `dees-appui-tray` | appui | [DeesAppuiTray](#deesappuitray) | [Source](ts_web/elements/00group-appui/dees-appui-tray/dees-appui-tray.ts) |
|
|
@@ -1337,13 +1341,14 @@ button**, **page status**, **warnings**, **errors**, **issues panel**, **health
|
|
|
1337
1341
|
indicator**.
|
|
1338
1342
|
|
|
1339
1343
|
The pattern, the design.estate standard for a view whose statuses would otherwise sit
|
|
1340
|
-
above its table: the page header holds the status button
|
|
1341
|
-
|
|
1344
|
+
above its table: the page header holds the status button and the table's search field
|
|
1345
|
+
in its tools, before its actions, and the page body is the table alone, `frameless` and
|
|
1346
|
+
`fill` (with the page's `layout="fill"`, the integrated list).
|
|
1342
1347
|
|
|
1343
1348
|
```typescript
|
|
1344
|
-
html`<dees-appui-page heading="Bank statements" description="4 statements · 2 accounts" .actions=${actions}>
|
|
1345
|
-
<dees-table-search slot="
|
|
1346
|
-
<dees-statusbutton slot="
|
|
1349
|
+
html`<dees-appui-page heading="Bank statements" description="4 statements · 2 accounts" layout="fill" .actions=${actions}>
|
|
1350
|
+
<dees-table-search slot="tools" for="statements" dataName="statements"></dees-table-search>
|
|
1351
|
+
<dees-statusbutton slot="tools" .items=${statuses}></dees-statusbutton>
|
|
1347
1352
|
${loading
|
|
1348
1353
|
? html`<dees-state variant="loading"></dees-state>`
|
|
1349
1354
|
: html`<dees-table id="statements" frameless fill .searchable=${false} dataName="statements"
|
|
@@ -3619,8 +3624,9 @@ with the focus in it. See
|
|
|
3619
3624
|
|
|
3620
3625
|
The page of a view inside `dees-appui`: its header and its content within one
|
|
3621
3626
|
max-width and one padding, so every view of an app lines up and none hand-codes a
|
|
3622
|
-
header
|
|
3623
|
-
|
|
3627
|
+
header — or, with `layout="fill"`, an integrated list that fills the view. The header
|
|
3628
|
+
is a [`dees-appui-contentheading`](#deesappuicontentheading). Search terms: **page
|
|
3629
|
+
header**, **page title**, **header actions**, **page tabs**, **integrated list**.
|
|
3624
3630
|
|
|
3625
3631
|
```typescript
|
|
3626
3632
|
html`<dees-appui-page
|
|
@@ -3651,14 +3657,17 @@ html`<dees-appui-page
|
|
|
3651
3657
|
the title row, the primary one last and in the accent colour, secondary ones as
|
|
3652
3658
|
outlines. Each `action` is awaited with its button pending meanwhile, and a
|
|
3653
3659
|
rejection is reported as `dees-action-error` (`source: 'page-action'`). The
|
|
3654
|
-
`
|
|
3655
|
-
[`dees-table-search`](#deestablesearch) and the page's
|
|
3656
|
-
[`dees-statusbutton`](#deesstatusbutton)
|
|
3657
|
-
fit in one row, and always below 700px of
|
|
3658
|
-
title
|
|
3660
|
+
`tools` slot takes controls of the host's own before them — the list's
|
|
3661
|
+
[`dees-table-search`](#deestablesearch), filters and the page's
|
|
3662
|
+
[`dees-statusbutton`](#deesstatusbutton) — and the `actions` slot after them. Where
|
|
3663
|
+
the title and the tools and actions do not fit in one row, and always below 700px of
|
|
3664
|
+
page width, the tools and actions stand under the title together; the title keeps
|
|
3665
|
+
its width.
|
|
3659
3666
|
- `tabs` (`IAppuiPageTab[]`: `key`, `label`, `iconName?`, `badge?`) are sections of
|
|
3660
|
-
the page,
|
|
3661
|
-
|
|
3667
|
+
the page — its sub-views, or the parts of a record — in a stripe of their own under
|
|
3668
|
+
the header: a [`dees-appui-secondarytabs`](#deesappuisecondarytabs) named by the
|
|
3669
|
+
title, with its own hairline and the selected tab's line on it. The content is their
|
|
3670
|
+
`tabpanel`, named by the selected tab. `selectedTab` (reflected) is the selected key, the first tab while
|
|
3662
3671
|
it names none. A click, or Enter or Space after moving with the arrow keys (in the
|
|
3663
3672
|
writing direction), Home and End, selects a tab, sets `selectedTab` and emits the
|
|
3664
3673
|
bubbling, composed `tab-select` (`{ key, tab }`); the tabs are one Tab stop. A host
|
|
@@ -3666,8 +3675,116 @@ html`<dees-appui-page
|
|
|
3666
3675
|
- The page owns its inset (32px, 16px below 700px of page width) and its
|
|
3667
3676
|
max-width: `contentWidth` `'default'` (`--dees-content-width-xl`, 1200px), `'wide'`
|
|
3668
3677
|
(`--dees-content-width-2xl`, 1600px) or `'full'`, or `--dees-appui-page-max-width` for
|
|
3669
|
-
another. The header's content
|
|
3670
|
-
width. The content is a grid with a 16px gap.
|
|
3678
|
+
another. The header's content and the tabs keep both; their hairlines span the
|
|
3679
|
+
page's full width. The content is a grid with a 16px gap.
|
|
3680
|
+
- `layout` (reflected) is `'scroll'`, the default, or `'fill'`: the integrated list.
|
|
3681
|
+
The page takes its container's height (`height: 100%`); the heading and the tabs keep
|
|
3682
|
+
theirs, and the content fills the rest edge to edge — no max-width, no side inset, no
|
|
3683
|
+
bottom padding — without the page scrolling. A frameless, `fill` table or a
|
|
3684
|
+
[`dees-appui-detailpane`](#deesappuidetailpane) fills it and scrolls inside itself;
|
|
3685
|
+
the content area scrolls only what does not. The heading and the tabs drop the
|
|
3686
|
+
max-width as well, and the content declares the page's inset as the region inset
|
|
3687
|
+
(`--dees-inset-inline`), so the list's first column stands under the title.
|
|
3688
|
+
|
|
3689
|
+
```typescript
|
|
3690
|
+
html`<dees-appui-page heading="Routes" description="Network · 9 routes" layout="fill"
|
|
3691
|
+
.actions=${[{ label: 'Add route', iconName: 'lucide:Plus', type: 'primary', action: () => this.add() }]}
|
|
3692
|
+
.tabs=${[{ key: 'routes', label: 'Routes', badge: 9 }, { key: 'redirects', label: 'Derived redirects', badge: 5 }]}
|
|
3693
|
+
>
|
|
3694
|
+
<dees-table-search slot="tools" for="routes" dataName="routes"></dees-table-search>
|
|
3695
|
+
<dees-statusbutton slot="tools" .items=${statuses}></dees-statusbutton>
|
|
3696
|
+
<dees-table id="routes" frameless fill .searchable=${false} .columns=${columns} .data=${routes}></dees-table>
|
|
3697
|
+
</dees-appui-page>`
|
|
3698
|
+
```
|
|
3699
|
+
|
|
3700
|
+
#### `DeesAppuiSecondarytabs`
|
|
3701
|
+
|
|
3702
|
+
A view's second level of tabs — the sub-views of a page, or the parts of a record —
|
|
3703
|
+
as a stripe across the content's width under the page heading, with a hairline of its
|
|
3704
|
+
own below it on which the selected tab's line lies. `dees-appui-page` draws its `tabs`
|
|
3705
|
+
with one; a view that heads itself with a
|
|
3706
|
+
[`dees-appui-contentheading`](#deesappuicontentheading) puts one under it. Search
|
|
3707
|
+
terms: **sub-views**, **sub tabs**, **record tabs**, **tab stripe**, **secondary
|
|
3708
|
+
navigation**.
|
|
3709
|
+
|
|
3710
|
+
```typescript
|
|
3711
|
+
html`<dees-appui-contentheading heading="Routes" description="Network · 9 routes"></dees-appui-contentheading>
|
|
3712
|
+
<dees-appui-secondarytabs
|
|
3713
|
+
label="Routes"
|
|
3714
|
+
.tabs=${[{ key: 'routes', label: 'Routes', badge: 9 }, { key: 'redirects', label: 'Derived redirects', badge: 5 }]}
|
|
3715
|
+
.selectedTab=${this.subView}
|
|
3716
|
+
.controlsElement=${this.panel}
|
|
3717
|
+
@tab-select=${(event: CustomEvent<IAppuiPageTabSelectEvent>) => this.show(event.detail.key)}
|
|
3718
|
+
></dees-appui-secondarytabs>`
|
|
3719
|
+
```
|
|
3720
|
+
|
|
3721
|
+
- `tabs` (`IAppuiPageTab[]`: `key`, `label`, `iconName?`, `badge?`), a badge a count or
|
|
3722
|
+
a short mark after the label. `selectedTab` (reflected) is the selected key, the
|
|
3723
|
+
first tab while it names none; `label` (reflected) names the `tablist`, such as the
|
|
3724
|
+
page's title. `controlsElement` is the element that shows the selected tab, which
|
|
3725
|
+
every tab names as the panel it controls (an element reference: an IDREF does not
|
|
3726
|
+
cross the tabs' shadow root); name that panel after the selected tab.
|
|
3727
|
+
- A click, or Enter or Space after moving with the arrow keys (in the writing
|
|
3728
|
+
direction), Home and End, selects a tab, reflects `selectedTab` and emits the
|
|
3729
|
+
bubbling, composed `tab-select` (`{ key, tab }`); the tabs are one Tab stop. A tab
|
|
3730
|
+
the host selects through `selectedTab` emits nothing.
|
|
3731
|
+
- The first tab's label stands at the region inset, `--dees-inset-inline`, where a
|
|
3732
|
+
container declares one, else at 32px (16px below 700px of width), so it lines up with
|
|
3733
|
+
the title above; its hover face reaches into the inset.
|
|
3734
|
+
`--dees-appui-secondarytabs-max-width` caps the row, centred, while the hairline keeps
|
|
3735
|
+
the full width. A row wider than the stripe scrolls sideways under an overlay
|
|
3736
|
+
scrollbar, and the selected tab scrolls into view.
|
|
3737
|
+
|
|
3738
|
+
#### `DeesAppuiDetailpane`
|
|
3739
|
+
|
|
3740
|
+
A list and the record it opens, side by side inside a view's content — the integrated
|
|
3741
|
+
list's sidebar: the list takes the room left and scrolls on its own, the record scrolls
|
|
3742
|
+
on its own in a pane at the end, with the side panel's surface and hairline. Put it in
|
|
3743
|
+
a [`dees-appui-page`](#deesappuipage) with `layout="fill"`. Search terms: **detail
|
|
3744
|
+
pane**, **sidebar**, **master detail**, **record panel**, **split view**, **inspector**.
|
|
3745
|
+
|
|
3746
|
+
```typescript
|
|
3747
|
+
html`<dees-appui-page layout="fill" heading="Routes" .actions=${actions}>
|
|
3748
|
+
<dees-table-search slot="tools" for="routes"></dees-table-search>
|
|
3749
|
+
<dees-appui-detailpane
|
|
3750
|
+
.open=${!!this.route}
|
|
3751
|
+
.heading=${this.route?.name ?? ''}
|
|
3752
|
+
.description=${this.route ? `${this.route.target} · ${this.route.cluster}` : ''}
|
|
3753
|
+
.width=${this.paneWidth}
|
|
3754
|
+
@close-request=${() => this.closeRoute()}
|
|
3755
|
+
@width-change=${(event: CustomEvent<IAppuiDetailpaneWidthChangeEvent>) => this.keepWidth(event.detail.width)}
|
|
3756
|
+
>
|
|
3757
|
+
<dees-table id="routes" frameless fill .searchable=${false} .selectionMode=${'single'} .rowKey=${'id'}
|
|
3758
|
+
.columns=${columns} .data=${routes}
|
|
3759
|
+
@selectionChange=${(event: CustomEvent) => this.openRoute(event.detail.selectedIds[0])}></dees-table>
|
|
3760
|
+
<dees-badge slot="status" tone="warning" text="Applying" rounded></dees-badge>
|
|
3761
|
+
<dees-button slot="actions" size="sm" type="outline" text="Edit"></dees-button>
|
|
3762
|
+
<div slot="detail">${this.renderRoute()}</div>
|
|
3763
|
+
</dees-appui-detailpane>
|
|
3764
|
+
</dees-appui-page>`
|
|
3765
|
+
```
|
|
3766
|
+
|
|
3767
|
+
- Slots: the default slot is the list; `detail` is the record, with the pane's padding;
|
|
3768
|
+
`status` stands beside the heading (a `dees-badge`); `actions` before the close
|
|
3769
|
+
button. A frameless list in the default slot takes the region inset of the page
|
|
3770
|
+
around it, so its first column stands under the page's title; the record does not.
|
|
3771
|
+
- `heading` and `description` (reflected) are the record's name and one line about it.
|
|
3772
|
+
`open` (reflected) shows the pane; the host sets it, and the record, from a row it
|
|
3773
|
+
opens, and clears them on the bubbling, composed `close-request` that the close
|
|
3774
|
+
button sends — the pane never closes itself.
|
|
3775
|
+
- `width` (reflected, 400) is drawn between `minWidth` (320) and `maxWidth` (640). The
|
|
3776
|
+
handle on the pane's inner edge (a `dees-resize-handle`, a focusable separator
|
|
3777
|
+
with `aria-valuenow`, `-min` and `-max`) resizes it by pointer drag or by the arrow
|
|
3778
|
+
keys (Shift for 64px, Home and End to the bounds, Enter and a double-click back to
|
|
3779
|
+
400); the width lands at once, and `width-change` (`{ width }`, bubbling, composed)
|
|
3780
|
+
reports it once settled, for the host to keep and give back as `width`.
|
|
3781
|
+
- At 700px of its own width or less (the app UI's compact width) the open pane covers
|
|
3782
|
+
the list, which is inert meanwhile, and Escape asks to close it unless something
|
|
3783
|
+
inside took the press; the host attribute `narrow` and the `narrow` getter say so.
|
|
3784
|
+
- `focus()` takes the reader into the pane — call it when opening covers the list, or
|
|
3785
|
+
whenever the reader should land in the record; it waits for the render that shows
|
|
3786
|
+
the pane. When the pane closes, the focus goes where the host puts it: the row the
|
|
3787
|
+
record came from.
|
|
3671
3788
|
|
|
3672
3789
|
#### `DeesAppuiSignin`
|
|
3673
3790
|
|
|
@@ -3,6 +3,6 @@
|
|
|
3
3
|
*/
|
|
4
4
|
export const commitinfo = {
|
|
5
5
|
name: '@design.estate/dees-catalog',
|
|
6
|
-
version: '24.
|
|
6
|
+
version: '24.3.0',
|
|
7
7
|
description: 'A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript.'
|
|
8
8
|
}
|
|
@@ -18,6 +18,13 @@ import type {
|
|
|
18
18
|
export const normalizeIconName = (iconName: string): string =>
|
|
19
19
|
iconName.includes(':') ? iconName : `lucide:${iconName}`;
|
|
20
20
|
|
|
21
|
+
/**
|
|
22
|
+
* At or below this width an app UI layout is compact: the shell opens its
|
|
23
|
+
* navigation on demand and its side panel covers the content, and a detail
|
|
24
|
+
* pane covers its list. Each measures its own width against it.
|
|
25
|
+
*/
|
|
26
|
+
export const appuiCompactMaxWidth = 700;
|
|
27
|
+
|
|
21
28
|
/** The activity log's icon, on its app bar button and its palette command. */
|
|
22
29
|
export const activityLogIconName = 'lucide:activity';
|
|
23
30
|
|
|
@@ -37,7 +37,7 @@ import {
|
|
|
37
37
|
type IShortcutChord,
|
|
38
38
|
type TShortcutSource,
|
|
39
39
|
} from '../appui.shortcuts.js';
|
|
40
|
-
import { activityLogIconName, defaultAssistantIconName, secondaryMenuTabRows } from '../appui.helpers.js';
|
|
40
|
+
import { activityLogIconName, appuiCompactMaxWidth, defaultAssistantIconName, secondaryMenuTabRows } from '../appui.helpers.js';
|
|
41
41
|
import { appuiWords, formatAppuiLabel, ownAppuiLabels } from '../appui.labels.js';
|
|
42
42
|
import { dcLocalize } from '../../../i18n/localize.js';
|
|
43
43
|
|
|
@@ -173,14 +173,6 @@ interface IShellShortcut {
|
|
|
173
173
|
run: () => void;
|
|
174
174
|
}
|
|
175
175
|
|
|
176
|
-
/**
|
|
177
|
-
* At or below this width the shell is compact: navigation opens on demand as a
|
|
178
|
-
* drawer and the side panel covers the content. It is decided here and
|
|
179
|
-
* nowhere else; the styles read the `compact` attribute and the app bar its
|
|
180
|
-
* `compact` property.
|
|
181
|
-
*/
|
|
182
|
-
const compactMaxWidth = 700;
|
|
183
|
-
|
|
184
176
|
/** A tray tab of its own, so neither the caller nor the tray changes the other's. */
|
|
185
177
|
const copyTrayTab = (tab: interfaces.IAppTrayTab): interfaces.IAppTrayTab => ({
|
|
186
178
|
key: tab.key,
|
|
@@ -606,8 +598,12 @@ export class DeesAppui extends DeesElement {
|
|
|
606
598
|
this.registerStartupFunction(async (signal) => {
|
|
607
599
|
await this.updateComplete;
|
|
608
600
|
if (signal.aborted) return;
|
|
601
|
+
// At or below the app UI's compact width the shell is compact: navigation
|
|
602
|
+
// opens on demand as a drawer and the side panel covers the content. It is
|
|
603
|
+
// decided here and nowhere else; the styles read the `compact` attribute and
|
|
604
|
+
// the app bar its `compact` property.
|
|
609
605
|
const update = () => {
|
|
610
|
-
this.compact = this.clientWidth <=
|
|
606
|
+
this.compact = this.clientWidth <= appuiCompactMaxWidth;
|
|
611
607
|
this.toggleAttribute('compact', this.compact);
|
|
612
608
|
};
|
|
613
609
|
update();
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
import { DeesElement, css, customElement, html, property, state, type TemplateResult } from '@design.estate/dees-element';
|
|
2
|
+
import { demoCode, demoPage, demoSection, demoStyles } from '../../../demos/templates.js';
|
|
3
|
+
import { themeDefaultStyles } from '../../00theme.js';
|
|
4
|
+
import type { Column, ITableAction } from '../../00group-dataview/dees-table/types.js';
|
|
5
|
+
import type { DeesTable } from '../../00group-dataview/dees-table/dees-table.js';
|
|
6
|
+
import type { IStatusbuttonItem } from '../../00group-feedback/dees-statusbutton/dees-statusbutton.js';
|
|
7
|
+
import type { IAppuiPageAction, IAppuiPageTab, IAppuiPageTabSelectEvent } from '../dees-appui-page/dees-appui-page.js';
|
|
8
|
+
import type { DeesAppuiDetailpane, IAppuiDetailpaneWidthChangeEvent } from './dees-appui-detailpane.js';
|
|
9
|
+
import { deepActiveElement } from '../../00overlay.js';
|
|
10
|
+
import '../dees-appui-page/dees-appui-page.js';
|
|
11
|
+
import '../../00group-dataview/dees-table/dees-table.js';
|
|
12
|
+
import '../../00group-dataview/dees-table-search/dees-table-search.js';
|
|
13
|
+
import '../../00group-feedback/dees-statusbutton/dees-statusbutton.js';
|
|
14
|
+
import '../../00group-feedback/dees-badge/dees-badge.js';
|
|
15
|
+
import '../../00group-button/dees-button/dees-button.js';
|
|
16
|
+
|
|
17
|
+
interface IDemoRoute {
|
|
18
|
+
id: string;
|
|
19
|
+
hosts: string;
|
|
20
|
+
target: string;
|
|
21
|
+
owner: string;
|
|
22
|
+
cluster: string;
|
|
23
|
+
ports: string;
|
|
24
|
+
source: string;
|
|
25
|
+
/** Whether every gateway applied the route's last revision. */
|
|
26
|
+
applying: boolean;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface IDemoRedirect {
|
|
30
|
+
id: string;
|
|
31
|
+
from: string;
|
|
32
|
+
to: string;
|
|
33
|
+
route: string;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const routes: IDemoRoute[] = [
|
|
37
|
+
{ id: 'docs', hosts: 'docs.example.com', target: 'docs-site', owner: 'Service', cluster: 'production', ports: '443', source: 'Public', applying: true },
|
|
38
|
+
{ id: 'uploads', hosts: 'uploads.example.com', target: 'uploads', owner: 'Service', cluster: 'production', ports: '443', source: 'Public', applying: false },
|
|
39
|
+
{ id: 'media', hosts: 'media.example.com', target: 'media-render', owner: 'Service', cluster: 'production', ports: '443', source: 'Public', applying: false },
|
|
40
|
+
{ id: 'www', hosts: 'www.example.com +3', target: 'docs-site', owner: 'Service', cluster: 'production', ports: '443', source: 'Public', applying: false },
|
|
41
|
+
{ id: 'smtp-submission', hosts: 'Port 587', target: 'Mail', owner: 'System', cluster: 'edge', ports: '587', source: 'Public', applying: false },
|
|
42
|
+
{ id: 'agl', hosts: 'agl.example.com', target: '10.0.4.20:3000', owner: 'Gateway client', cluster: 'office', ports: '443', source: 'Office network', applying: false },
|
|
43
|
+
{ id: 'status', hosts: 'status.example.com', target: 'status-page', owner: 'Service', cluster: 'production', ports: '443', source: 'Public', applying: false },
|
|
44
|
+
{ id: 'grafana', hosts: 'grafana.example.com', target: 'grafana', owner: 'Service', cluster: 'monitoring', ports: '443', source: 'Office network', applying: false },
|
|
45
|
+
{ id: 'registry', hosts: 'registry.example.com', target: 'registry', owner: 'Service', cluster: 'production', ports: '443', source: 'Public', applying: false },
|
|
46
|
+
{ id: 'api', hosts: 'api.example.com', target: 'api-gateway', owner: 'Service', cluster: 'production', ports: '443', source: 'Public', applying: false },
|
|
47
|
+
{ id: 'auth', hosts: 'auth.example.com', target: 'idp', owner: 'Service', cluster: 'production', ports: '443', source: 'Public', applying: false },
|
|
48
|
+
{ id: 'imap', hosts: 'Port 993', target: 'Mail', owner: 'System', cluster: 'edge', ports: '993', source: 'Public', applying: false },
|
|
49
|
+
{ id: 'git', hosts: 'git.example.com', target: 'gitea', owner: 'Service', cluster: 'tools', ports: '443, 22', source: 'Public', applying: false },
|
|
50
|
+
{ id: 'chat', hosts: 'chat.example.com', target: 'matrix', owner: 'Service', cluster: 'tools', ports: '443', source: 'Public', applying: false },
|
|
51
|
+
{ id: 'vpn', hosts: 'Port 51820', target: 'wireguard', owner: 'System', cluster: 'edge', ports: '51820', source: 'Public', applying: false },
|
|
52
|
+
{ id: 'billing', hosts: 'billing.example.com', target: 'billing-api', owner: 'Service', cluster: 'production', ports: '443', source: 'Public', applying: false },
|
|
53
|
+
{ id: 'backup', hosts: 'backup.example.com', target: '10.0.4.31:8200', owner: 'Gateway client', cluster: 'office', ports: '443', source: 'Office network', applying: false },
|
|
54
|
+
{ id: 'preview', hosts: '*.preview.example.com', target: 'preview-renderer', owner: 'Service', cluster: 'staging', ports: '443', source: 'Public', applying: false },
|
|
55
|
+
];
|
|
56
|
+
|
|
57
|
+
const redirects: IDemoRedirect[] = ['docs', 'uploads', 'media', 'www', 'status'].map((route) => ({
|
|
58
|
+
id: `${route}-http`,
|
|
59
|
+
from: `http://${routes.find((entry) => entry.id === route)!.hosts.split(' ')[0]}/*`,
|
|
60
|
+
to: 'https, 308',
|
|
61
|
+
route,
|
|
62
|
+
}));
|
|
63
|
+
|
|
64
|
+
const appliedBadge = (applying: boolean) => html`<dees-badge .tone=${applying ? 'warning' : 'success'} .text=${applying ? 'Applying' : 'Applied'} .rounded=${true}></dees-badge>`;
|
|
65
|
+
|
|
66
|
+
const routeColumns: Column<IDemoRoute>[] = [
|
|
67
|
+
{ key: 'id', header: 'Route' },
|
|
68
|
+
{ key: 'hosts', header: 'Hosts' },
|
|
69
|
+
{ key: 'target', header: 'Target' },
|
|
70
|
+
{ key: 'owner', header: 'Owner' },
|
|
71
|
+
{ key: 'applying', header: 'Applied', renderer: (value) => appliedBadge(!!value) },
|
|
72
|
+
];
|
|
73
|
+
|
|
74
|
+
const redirectColumns: Column<IDemoRedirect>[] = [
|
|
75
|
+
{ key: 'from', header: 'From' },
|
|
76
|
+
{ key: 'to', header: 'To' },
|
|
77
|
+
{ key: 'route', header: 'Route' },
|
|
78
|
+
];
|
|
79
|
+
|
|
80
|
+
const subViews: IAppuiPageTab[] = [
|
|
81
|
+
{ key: 'routes', label: 'Routes', badge: routes.length },
|
|
82
|
+
{ key: 'redirects', label: 'Derived redirects', badge: redirects.length },
|
|
83
|
+
];
|
|
84
|
+
|
|
85
|
+
const statuses: IStatusbuttonItem[] = [
|
|
86
|
+
{ key: 'rollout', severity: 'warning', text: 'Applying r418: 1 of 2 gateways.', detail: 'gw-nbg-1 still runs r417.' },
|
|
87
|
+
{ key: 'certificates', severity: 'success', text: 'Every route is covered by a valid certificate.' },
|
|
88
|
+
];
|
|
89
|
+
|
|
90
|
+
/**
|
|
91
|
+
* A list page as the integrated view standard has it: the search, the status button and the
|
|
92
|
+
* primary action in the header, two sub-views in a stripe of tabs, and a frameless list whose
|
|
93
|
+
* rows open their record in a detail pane beside it. The host drives the pane: a row it opens
|
|
94
|
+
* sets `open` and the record, `close-request` clears them, and `width-change` is kept.
|
|
95
|
+
*/
|
|
96
|
+
@customElement('dees-demo-appui-detailpane')
|
|
97
|
+
export class DeesDemoAppuiDetailpane extends DeesElement {
|
|
98
|
+
/** The frame's width in CSS pixels; 0 takes the panel's. */
|
|
99
|
+
@property({ type: Number }) accessor frameWidth = 0;
|
|
100
|
+
@state() accessor subView = 'routes';
|
|
101
|
+
@state() accessor openId: string | null = null;
|
|
102
|
+
@state() accessor paneWidth = 400;
|
|
103
|
+
@state() accessor message = 'Click a row, or focus one and press Enter, to open its record.';
|
|
104
|
+
|
|
105
|
+
public static styles = [themeDefaultStyles, demoStyles, css`
|
|
106
|
+
:host { display: block; min-width: 0; }
|
|
107
|
+
.frame {
|
|
108
|
+
height: 560px; min-width: 0; overflow: hidden;
|
|
109
|
+
border: 1px solid var(--dees-color-border-subtle); border-radius: var(--dees-radius-xl); background: var(--dees-color-bg-canvas);
|
|
110
|
+
}
|
|
111
|
+
.record { display: grid; gap: 18px; font-size: 13px; line-height: 20px; }
|
|
112
|
+
.record h3 { margin: 0 0 8px; font-size: 11px; font-weight: 600; letter-spacing: .05em; text-transform: uppercase; color: var(--dees-color-text-muted); }
|
|
113
|
+
.record dl { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 6px 12px; margin: 0; }
|
|
114
|
+
.record dt { color: var(--dees-color-text-secondary); }
|
|
115
|
+
.record dd { margin: 0; min-width: 0; overflow-wrap: anywhere; }
|
|
116
|
+
.checks { border: 1px solid var(--dees-color-border-subtle); border-radius: var(--dees-radius-lg); }
|
|
117
|
+
.check { display: flex; align-items: center; gap: 8px; min-height: 40px; padding: 0 12px; }
|
|
118
|
+
.check + .check { border-top: 1px solid var(--dees-color-border-subtle); }
|
|
119
|
+
.check small { margin-left: auto; color: var(--dees-color-text-muted); }
|
|
120
|
+
`];
|
|
121
|
+
|
|
122
|
+
private get pane(): DeesAppuiDetailpane | null {
|
|
123
|
+
return this.shadowRoot?.querySelector('dees-appui-detailpane') ?? null;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
private get table(): DeesTable<IDemoRoute | IDemoRedirect> | null {
|
|
127
|
+
return this.shadowRoot?.querySelector('dees-table') ?? null;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
/** Opens a record; where the pane covers the list, the reader is taken into it. */
|
|
131
|
+
private async openRecord(id: string, takeFocus: boolean): Promise<void> {
|
|
132
|
+
if (this.openId !== id) this.message = `Opened ${id}.`;
|
|
133
|
+
this.openId = id;
|
|
134
|
+
await this.updateComplete;
|
|
135
|
+
if (takeFocus && this.pane?.narrow) await this.pane.focus();
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
/** Closes the record; a reader who was in it goes back to the row the record was opened from. */
|
|
139
|
+
private readonly closeRecord = async () => {
|
|
140
|
+
const active = deepActiveElement();
|
|
141
|
+
const pane = this.pane;
|
|
142
|
+
const wasInPane = !!pane && !!active && (pane.contains(active) || !!pane.shadowRoot?.contains(active));
|
|
143
|
+
this.message = `close-request: closed ${this.openId}.`;
|
|
144
|
+
this.openId = null;
|
|
145
|
+
await this.updateComplete;
|
|
146
|
+
// The rows' tab stop is the row the reader last focused or clicked: the one the record came from.
|
|
147
|
+
if (wasInPane) this.table?.shadowRoot?.querySelector<HTMLElement>('tbody tr[tabindex="0"]')?.focus();
|
|
148
|
+
};
|
|
149
|
+
|
|
150
|
+
private readonly openAction: ITableAction<IDemoRoute | IDemoRedirect> = {
|
|
151
|
+
name: 'Open',
|
|
152
|
+
type: ['rowClick'],
|
|
153
|
+
actionFunc: async ({ item }) => this.openRecord(item.id, true),
|
|
154
|
+
};
|
|
155
|
+
|
|
156
|
+
public render(): TemplateResult {
|
|
157
|
+
const onRoutes = this.subView === 'routes';
|
|
158
|
+
const route = onRoutes ? routes.find((entry) => entry.id === this.openId) : undefined;
|
|
159
|
+
const redirect = onRoutes ? undefined : redirects.find((entry) => entry.id === this.openId);
|
|
160
|
+
const actions: IAppuiPageAction[] = [
|
|
161
|
+
{ label: 'Add route', iconName: 'lucide:Plus', type: 'primary', action: () => { this.message = 'Add route.'; } },
|
|
162
|
+
];
|
|
163
|
+
return html`
|
|
164
|
+
<div class="frame" style=${this.frameWidth ? `max-width: ${this.frameWidth}px` : ''}>
|
|
165
|
+
<dees-appui-page
|
|
166
|
+
layout="fill"
|
|
167
|
+
heading="Routes"
|
|
168
|
+
description="Network · 18 routes, whoever created them. Special forwards are a route type."
|
|
169
|
+
.actions=${actions}
|
|
170
|
+
.tabs=${subViews}
|
|
171
|
+
.selectedTab=${this.subView}
|
|
172
|
+
@tab-select=${(event: CustomEvent<IAppuiPageTabSelectEvent>) => {
|
|
173
|
+
this.subView = event.detail.key;
|
|
174
|
+
this.openId = null;
|
|
175
|
+
this.message = `tab-select: ${event.detail.key}`;
|
|
176
|
+
}}
|
|
177
|
+
>
|
|
178
|
+
<dees-table-search slot="tools" for="detailpaneDemoList"></dees-table-search>
|
|
179
|
+
<dees-statusbutton slot="tools" heading="Rollout" .progress=${'r418'} .items=${statuses}></dees-statusbutton>
|
|
180
|
+
<dees-appui-detailpane
|
|
181
|
+
.open=${!!(route || redirect)}
|
|
182
|
+
.heading=${route?.id ?? redirect?.from ?? ''}
|
|
183
|
+
.description=${route ? `${route.owner} ${route.target} · ${route.cluster} · r418` : redirect ? `Derived from the route ${redirect.route}` : ''}
|
|
184
|
+
.width=${this.paneWidth}
|
|
185
|
+
@close-request=${this.closeRecord}
|
|
186
|
+
@width-change=${(event: CustomEvent<IAppuiDetailpaneWidthChangeEvent>) => {
|
|
187
|
+
this.paneWidth = event.detail.width;
|
|
188
|
+
this.message = `width-change: ${event.detail.width}px, kept by the host.`;
|
|
189
|
+
}}
|
|
190
|
+
>
|
|
191
|
+
<dees-table
|
|
192
|
+
id="detailpaneDemoList"
|
|
193
|
+
frameless
|
|
194
|
+
fill
|
|
195
|
+
.searchable=${false}
|
|
196
|
+
.selectionMode=${'single'}
|
|
197
|
+
.rowKey=${'id'}
|
|
198
|
+
.dataName=${onRoutes ? 'routes' : 'redirects'}
|
|
199
|
+
.columns=${onRoutes ? routeColumns : redirectColumns}
|
|
200
|
+
.data=${onRoutes ? routes : redirects}
|
|
201
|
+
.dataActions=${[this.openAction]}
|
|
202
|
+
.selectedIds=${new Set(this.openId ? [this.openId] : [])}
|
|
203
|
+
@selectionChange=${(event: CustomEvent<{ selectedIds: string[] }>) => {
|
|
204
|
+
const [id] = event.detail.selectedIds;
|
|
205
|
+
if (id) void this.openRecord(id, false);
|
|
206
|
+
}}
|
|
207
|
+
></dees-table>
|
|
208
|
+
${route ? html`<dees-badge slot="status" .tone=${route.applying ? 'warning' : 'success'} .text=${route.applying ? 'Applying' : 'Applied'} .rounded=${true}></dees-badge>` : ''}
|
|
209
|
+
${route ? html`<dees-button slot="actions" size="sm" type="outline" text="Edit" icon="lucide:SquarePen" @clicked=${() => { this.message = `Edit ${route.id}.`; }}></dees-button>` : ''}
|
|
210
|
+
${route ? this.renderRoute(route) : redirect ? this.renderRedirect(redirect) : ''}
|
|
211
|
+
</dees-appui-detailpane>
|
|
212
|
+
</dees-appui-page>
|
|
213
|
+
</div>
|
|
214
|
+
<output class="dees-demo-output" role="status">${this.message}</output>
|
|
215
|
+
`;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
private renderRoute(route: IDemoRoute): TemplateResult {
|
|
219
|
+
return html`<div slot="detail" class="record">
|
|
220
|
+
<section><h3>Match</h3><dl><dt>Hosts</dt><dd>${route.hosts}</dd><dt>Ports</dt><dd>${route.ports}</dd></dl></section>
|
|
221
|
+
<section><h3>Target</h3><dl><dt>${route.owner}</dt><dd>${route.target}</dd><dt>Cluster</dt><dd>${route.cluster}</dd></dl></section>
|
|
222
|
+
<section><h3>Policy</h3><dl><dt>Source</dt><dd>${route.source}</dd></dl></section>
|
|
223
|
+
<section><h3>Applied</h3><div class="checks">
|
|
224
|
+
<div class="check">gw-fra-1 <small>r418, 12 s ago</small></div>
|
|
225
|
+
<div class="check">gw-nbg-1 <small>${route.applying ? 'r417, applying' : 'r418, 14 s ago'}</small></div>
|
|
226
|
+
</div></section>
|
|
227
|
+
<section><h3>Certificate</h3><dl><dt>Covered by</dt><dd>*.example.com, ACME, valid until 2027-01-08</dd></dl></section>
|
|
228
|
+
<section><h3>Derived redirect</h3><dl><dt>From</dt><dd>http :80, /*</dd><dt>To</dt><dd>https :443, 308</dd><dt>Status</dt><dd>Active</dd></dl></section>
|
|
229
|
+
<section><h3>Last change</h3><div class="checks">
|
|
230
|
+
<div class="check">r418 Changed target <small>maria.keller, 12 min. ago</small></div>
|
|
231
|
+
<div class="check">r402 Added host <small>jonas.weber, 3 days ago</small></div>
|
|
232
|
+
<div class="check">r377 Created <small>maria.keller, 2 weeks ago</small></div>
|
|
233
|
+
</div></section>
|
|
234
|
+
</div>`;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
private renderRedirect(redirect: IDemoRedirect): TemplateResult {
|
|
238
|
+
return html`<div slot="detail" class="record">
|
|
239
|
+
<section><h3>Redirect</h3><dl><dt>From</dt><dd>${redirect.from}</dd><dt>To</dt><dd>${redirect.to}</dd></dl></section>
|
|
240
|
+
<section><h3>Derived from</h3><dl><dt>Route</dt><dd>${redirect.route}</dd><dt>Status</dt><dd>Active</dd></dl></section>
|
|
241
|
+
</div>`;
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
/** The integrated list at the panel's width and at 600px, where the open record covers the list. */
|
|
246
|
+
export const demoFunc = () => demoPage('Detail pane', 'A list and the record it opens, side by side inside a view\'s content: the list fills the room left and scrolls on its own, the record scrolls on its own in the pane, which a reader resizes at its inner edge. At 700px or less the open pane covers the list.', html`
|
|
247
|
+
${demoSection('Integrated list', 'A page with layout="fill": the search and the status button in its tools, the primary action last, two sub-views as tabs in a stripe, and a frameless list whose rows open their record. Drag the pane\'s inner edge, or focus it and press the arrow keys; the host keeps the width from width-change.', html`
|
|
248
|
+
<dees-demo-appui-detailpane></dees-demo-appui-detailpane>
|
|
249
|
+
${demoCode(`<dees-appui-page layout="fill" heading="Routes" .tabs=\${subViews} .actions=\${[addRoute]}>
|
|
250
|
+
<dees-table-search slot="tools" for="routes"></dees-table-search>
|
|
251
|
+
<dees-statusbutton slot="tools" .items=\${statuses}></dees-statusbutton>
|
|
252
|
+
<dees-appui-detailpane .open=\${!!route} .heading=\${route?.id ?? ''} .description=\${summary}
|
|
253
|
+
.width=\${this.paneWidth} @close-request=\${() => this.close()}
|
|
254
|
+
@width-change=\${(event) => this.keepWidth(event.detail.width)}>
|
|
255
|
+
<dees-table id="routes" frameless fill .searchable=\${false} .selectionMode=\${'single'}
|
|
256
|
+
.rowKey=\${'id'} .columns=\${columns} .data=\${routes}
|
|
257
|
+
@selectionChange=\${(event) => this.open(event.detail.selectedIds[0])}></dees-table>
|
|
258
|
+
<dees-badge slot="status" tone="warning" text="Applying" rounded></dees-badge>
|
|
259
|
+
<dees-button slot="actions" size="sm" type="outline" text="Edit"></dees-button>
|
|
260
|
+
<div slot="detail">…the record…</div>
|
|
261
|
+
</dees-appui-detailpane>
|
|
262
|
+
</dees-appui-page>`)}
|
|
263
|
+
`)}
|
|
264
|
+
${demoSection('Narrow', 'At 600px the open record covers the list, which is inert meanwhile. The host takes the reader into the pane with focus(); Escape or the close button ask to close it, and the host puts the focus back on the row.', html`
|
|
265
|
+
<dees-demo-appui-detailpane .frameWidth=${600}></dees-demo-appui-detailpane>
|
|
266
|
+
`)}
|
|
267
|
+
`);
|