@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
|
@@ -0,0 +1,451 @@
|
|
|
1
|
+
import {
|
|
2
|
+
DeesElement,
|
|
3
|
+
type TemplateResult,
|
|
4
|
+
property,
|
|
5
|
+
state,
|
|
6
|
+
customElement,
|
|
7
|
+
html,
|
|
8
|
+
css,
|
|
9
|
+
cssManager,
|
|
10
|
+
} from '@design.estate/dees-element';
|
|
11
|
+
import { themeDefaultStyles } from '../../00theme.js';
|
|
12
|
+
import { OverlayScrollbarController, overlayScrollbarStyles } from '../../00scrollbars.js';
|
|
13
|
+
import type { IResizeHandleEventDetail } from '../../00group-layout/dees-resize-handle/dees-resize-handle.js';
|
|
14
|
+
import '../../00group-layout/dees-resize-handle/dees-resize-handle.js';
|
|
15
|
+
import '../../00group-utility/dees-icon/dees-icon.js';
|
|
16
|
+
import { appuiCompactMaxWidth } from '../appui.helpers.js';
|
|
17
|
+
import { dcLocalize } from '../../../i18n/localize.js';
|
|
18
|
+
import { demoFunc } from './dees-appui-detailpane.demo.js';
|
|
19
|
+
|
|
20
|
+
declare global {
|
|
21
|
+
interface HTMLElementTagNameMap {
|
|
22
|
+
'dees-appui-detailpane': DeesAppuiDetailpane;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** The detail of the pane's `width-change` event: the width a reader settled on, in CSS pixels. */
|
|
27
|
+
export interface IAppuiDetailpaneWidthChangeEvent {
|
|
28
|
+
width: number;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** The pane's width while nobody chose another, and the width a reset of its handle gives back. */
|
|
32
|
+
const defaultPaneWidth = 400;
|
|
33
|
+
|
|
34
|
+
/** How far Shift and an Arrow key move the pane's edge; a plain Arrow key moves it the handle's 16px. */
|
|
35
|
+
const paneLargeStep = 64;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* A list and the record it opens, side by side inside a view's content: the
|
|
39
|
+
* integrated list's sidebar. The default slot is the list, which takes the
|
|
40
|
+
* room the pane leaves and scrolls on its own; the `detail` slot is the
|
|
41
|
+
* record, which scrolls on its own in the pane at the end. The pane's header
|
|
42
|
+
* shows `heading`, the `status` slot beside it (a `dees-badge`), one line of
|
|
43
|
+
* `description`, the `actions` slot and a close button, which asks the host to
|
|
44
|
+
* close the pane with a bubbling, composed `close-request`.
|
|
45
|
+
*
|
|
46
|
+
* The host drives it: `open` (reflected) shows the pane, and the host sets the
|
|
47
|
+
* record's content and heading, from a row selection say. The pane's width is
|
|
48
|
+
* `width` (400px), between `minWidth` (320px) and `maxWidth` (640px). A reader
|
|
49
|
+
* changes it with the resize handle on the pane's inner edge, a separator
|
|
50
|
+
* dragged with the pointer or stepped with the arrow keys (Shift for larger
|
|
51
|
+
* steps, Home and End to the bounds, Enter and a double-click back to 400px);
|
|
52
|
+
* the width lands at once, reflects, and is reported once settled as
|
|
53
|
+
* `width-change` (`{ width }`) for the host to keep.
|
|
54
|
+
*
|
|
55
|
+
* At 700px of its own width or less (the app UI's compact width) the open
|
|
56
|
+
* pane covers the list, which is inert meanwhile, and Escape asks to close it
|
|
57
|
+
* unless something inside took the press; the host attribute `narrow` says
|
|
58
|
+
* so. The focus moves into the pane when the host calls `focus()`, and goes
|
|
59
|
+
* where the host puts it when the pane closes.
|
|
60
|
+
*
|
|
61
|
+
* The pane draws the surface, hairline and header height of the shell's side
|
|
62
|
+
* panel. The list stays in the region the pane stands in, so a frameless table
|
|
63
|
+
* there takes that region's inset (`--dees-inset-inline`); the record has the
|
|
64
|
+
* pane's own padding.
|
|
65
|
+
*/
|
|
66
|
+
@customElement('dees-appui-detailpane')
|
|
67
|
+
export class DeesAppuiDetailpane extends DeesElement {
|
|
68
|
+
public static demo = demoFunc;
|
|
69
|
+
public static demoGroups = ['App UI'];
|
|
70
|
+
|
|
71
|
+
/** The record's name, at the top of the pane. */
|
|
72
|
+
@property({ type: String, reflect: true })
|
|
73
|
+
accessor heading: string = '';
|
|
74
|
+
|
|
75
|
+
/** One line under the record's name: what it is, where it stands. */
|
|
76
|
+
@property({ type: String, reflect: true })
|
|
77
|
+
accessor description: string = '';
|
|
78
|
+
|
|
79
|
+
/** Whether the pane shows. The host opens it for a record and closes it on `close-request`. */
|
|
80
|
+
@property({ type: Boolean, reflect: true })
|
|
81
|
+
accessor open: boolean = false;
|
|
82
|
+
|
|
83
|
+
/** The pane's width in CSS pixels, drawn within `minWidth` and `maxWidth`. */
|
|
84
|
+
@property({ type: Number, reflect: true })
|
|
85
|
+
accessor width: number = defaultPaneWidth;
|
|
86
|
+
|
|
87
|
+
/** The narrowest a reader can make the pane. */
|
|
88
|
+
@property({ type: Number, reflect: true })
|
|
89
|
+
accessor minWidth: number = 320;
|
|
90
|
+
|
|
91
|
+
/** The widest a reader can make the pane. */
|
|
92
|
+
@property({ type: Number, reflect: true })
|
|
93
|
+
accessor maxWidth: number = 640;
|
|
94
|
+
|
|
95
|
+
/** At the app UI's compact width or less, where the open pane covers the list. */
|
|
96
|
+
@state()
|
|
97
|
+
private accessor narrowLayout = false;
|
|
98
|
+
|
|
99
|
+
private readonly t = dcLocalize(this);
|
|
100
|
+
|
|
101
|
+
/** The list's and the record's scrollbars, each shown while its side scrolls. */
|
|
102
|
+
private readonly scrollbars = new OverlayScrollbarController(this, () => {
|
|
103
|
+
const root = this.shadowRoot;
|
|
104
|
+
return root ? [...root.querySelectorAll<HTMLElement>('.list, .body')] : [];
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
constructor() {
|
|
108
|
+
super();
|
|
109
|
+
this.registerStartupFunction(async (signal) => {
|
|
110
|
+
await this.updateComplete;
|
|
111
|
+
if (signal.aborted) return;
|
|
112
|
+
const measure = () => {
|
|
113
|
+
const narrow = this.clientWidth <= appuiCompactMaxWidth;
|
|
114
|
+
if (narrow === this.narrowLayout) return;
|
|
115
|
+
this.narrowLayout = narrow;
|
|
116
|
+
this.toggleAttribute('narrow', narrow);
|
|
117
|
+
};
|
|
118
|
+
measure();
|
|
119
|
+
const observer = new ResizeObserver(measure);
|
|
120
|
+
observer.observe(this);
|
|
121
|
+
signal.addEventListener('abort', () => observer.disconnect(), { once: true });
|
|
122
|
+
});
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** Whether the pane is in its narrow layout, where it covers the list while open. */
|
|
126
|
+
public get narrow(): boolean {
|
|
127
|
+
return this.narrowLayout;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
public static styles = [
|
|
131
|
+
themeDefaultStyles,
|
|
132
|
+
cssManager.defaultStyles,
|
|
133
|
+
overlayScrollbarStyles,
|
|
134
|
+
css`
|
|
135
|
+
:host {
|
|
136
|
+
display: block;
|
|
137
|
+
height: 100%;
|
|
138
|
+
min-width: 0;
|
|
139
|
+
min-height: 0;
|
|
140
|
+
color: var(--dees-color-text-primary);
|
|
141
|
+
font-family: var(--dees-font-family);
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
.split {
|
|
145
|
+
position: relative;
|
|
146
|
+
display: flex;
|
|
147
|
+
height: 100%;
|
|
148
|
+
min-height: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
/* The box the list's scrollbars are placed in. It is a stacking context of
|
|
152
|
+
its own, so the list's sticky parts (a table's column header and footer)
|
|
153
|
+
stay under the pane that covers it. */
|
|
154
|
+
.listFrame {
|
|
155
|
+
position: relative;
|
|
156
|
+
isolation: isolate;
|
|
157
|
+
flex: 1 1 0;
|
|
158
|
+
display: flex;
|
|
159
|
+
min-width: 0;
|
|
160
|
+
min-height: 0;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
.list {
|
|
164
|
+
flex: 1 1 auto;
|
|
165
|
+
display: flex;
|
|
166
|
+
flex-direction: column;
|
|
167
|
+
min-width: 0;
|
|
168
|
+
min-height: 0;
|
|
169
|
+
overflow: auto;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
/* A list that fills its host fills the room; any other scrolls in it. */
|
|
173
|
+
.list > slot::slotted(*) {
|
|
174
|
+
flex: 1 0 auto;
|
|
175
|
+
min-width: 0;
|
|
176
|
+
}
|
|
177
|
+
|
|
178
|
+
.pane {
|
|
179
|
+
--dees-region-surface: var(--dees-appui-chrome-bg);
|
|
180
|
+
position: relative;
|
|
181
|
+
flex: none;
|
|
182
|
+
display: flex;
|
|
183
|
+
flex-direction: column;
|
|
184
|
+
width: var(--detailpane-width);
|
|
185
|
+
min-width: 0;
|
|
186
|
+
min-height: 0;
|
|
187
|
+
background: var(--dees-appui-chrome-bg);
|
|
188
|
+
border-inline-start: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
.pane[hidden] {
|
|
192
|
+
display: none;
|
|
193
|
+
}
|
|
194
|
+
|
|
195
|
+
/* The pane takes the focus as a region, for its name; it is no control. */
|
|
196
|
+
.pane:focus-visible {
|
|
197
|
+
outline: none;
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
/* On the pane's inner edge, where its hairline is, which the handle's line
|
|
201
|
+
stands in for while a reader handles it. */
|
|
202
|
+
.handle {
|
|
203
|
+
--dees-resize-handle-color: transparent;
|
|
204
|
+
position: absolute;
|
|
205
|
+
inset-block: 0;
|
|
206
|
+
inset-inline-end: calc(var(--detailpane-width) - var(--dees-line-width-hairline));
|
|
207
|
+
z-index: 2;
|
|
208
|
+
width: var(--dees-line-width-hairline);
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
/* At least as tall as the side panel's header. */
|
|
212
|
+
.header {
|
|
213
|
+
flex: none;
|
|
214
|
+
display: flex;
|
|
215
|
+
align-items: center;
|
|
216
|
+
gap: var(--dees-spacing-sm);
|
|
217
|
+
min-height: var(--dees-appui-row-height);
|
|
218
|
+
padding-block: var(--dees-spacing-sm);
|
|
219
|
+
padding-inline: var(--dees-spacing-lg) var(--dees-spacing-sm);
|
|
220
|
+
border-bottom: var(--dees-line-width-hairline) solid var(--dees-color-border-subtle);
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
.titles {
|
|
224
|
+
flex: 1 1 auto;
|
|
225
|
+
min-width: 0;
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
.titleLine {
|
|
229
|
+
display: flex;
|
|
230
|
+
align-items: center;
|
|
231
|
+
gap: var(--dees-spacing-sm);
|
|
232
|
+
min-width: 0;
|
|
233
|
+
}
|
|
234
|
+
|
|
235
|
+
h2 {
|
|
236
|
+
margin: 0;
|
|
237
|
+
min-width: 0;
|
|
238
|
+
font-size: var(--dees-font-headline-size);
|
|
239
|
+
font-weight: var(--dees-font-headline-weight);
|
|
240
|
+
line-height: var(--dees-font-headline-line);
|
|
241
|
+
letter-spacing: var(--dees-font-headline-tracking);
|
|
242
|
+
white-space: nowrap;
|
|
243
|
+
overflow: hidden;
|
|
244
|
+
text-overflow: ellipsis;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
::slotted([slot='status']) {
|
|
248
|
+
flex: none;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
.description {
|
|
252
|
+
margin: var(--dees-spacing-2xs) 0 0;
|
|
253
|
+
font-size: var(--dees-font-caption1-size);
|
|
254
|
+
line-height: var(--dees-font-caption1-line);
|
|
255
|
+
color: var(--dees-color-text-secondary);
|
|
256
|
+
white-space: nowrap;
|
|
257
|
+
overflow: hidden;
|
|
258
|
+
text-overflow: ellipsis;
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
.actions {
|
|
262
|
+
flex: none;
|
|
263
|
+
display: flex;
|
|
264
|
+
align-items: center;
|
|
265
|
+
gap: var(--dees-spacing-xs);
|
|
266
|
+
}
|
|
267
|
+
|
|
268
|
+
.close {
|
|
269
|
+
flex: none;
|
|
270
|
+
display: inline-flex;
|
|
271
|
+
align-items: center;
|
|
272
|
+
justify-content: center;
|
|
273
|
+
width: var(--dees-control-height-md);
|
|
274
|
+
height: var(--dees-control-height-md);
|
|
275
|
+
padding: 0;
|
|
276
|
+
border: 0;
|
|
277
|
+
border-radius: var(--dees-radius-md);
|
|
278
|
+
background: transparent;
|
|
279
|
+
color: var(--dees-color-text-secondary);
|
|
280
|
+
cursor: pointer;
|
|
281
|
+
transition: background var(--dees-transition-fast) var(--dees-ease-standard),
|
|
282
|
+
color var(--dees-transition-fast) var(--dees-ease-standard);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
.close:hover {
|
|
286
|
+
background: var(--dees-color-hover);
|
|
287
|
+
color: var(--dees-color-text-primary);
|
|
288
|
+
}
|
|
289
|
+
|
|
290
|
+
.close:focus-visible {
|
|
291
|
+
outline: var(--dees-line-width-focus-ring) solid var(--dees-color-focus-ring);
|
|
292
|
+
outline-offset: -2px;
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/* The box the record's scrollbars are placed in. */
|
|
296
|
+
.bodyFrame {
|
|
297
|
+
position: relative;
|
|
298
|
+
flex: 1 1 0;
|
|
299
|
+
display: flex;
|
|
300
|
+
min-height: 0;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
/* The record has the pane's padding, so nothing in it takes the list's region inset. */
|
|
304
|
+
.body {
|
|
305
|
+
--dees-inset-inline: initial;
|
|
306
|
+
flex: 1 1 auto;
|
|
307
|
+
min-width: 0;
|
|
308
|
+
min-height: 0;
|
|
309
|
+
overflow: auto;
|
|
310
|
+
padding-block: var(--dees-spacing-lg) var(--dees-spacing-xl);
|
|
311
|
+
padding-inline: var(--dees-spacing-lg);
|
|
312
|
+
}
|
|
313
|
+
|
|
314
|
+
/* Narrow, the open pane covers the list. */
|
|
315
|
+
.split.narrow .pane {
|
|
316
|
+
position: absolute;
|
|
317
|
+
inset: 0;
|
|
318
|
+
z-index: 1;
|
|
319
|
+
width: auto;
|
|
320
|
+
border-inline-start: 0;
|
|
321
|
+
}
|
|
322
|
+
|
|
323
|
+
@media (pointer: coarse) {
|
|
324
|
+
.close {
|
|
325
|
+
width: var(--dees-control-height-touch);
|
|
326
|
+
height: var(--dees-control-height-touch);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
@media (prefers-reduced-motion: reduce) {
|
|
331
|
+
.close {
|
|
332
|
+
transition: none;
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
`,
|
|
336
|
+
];
|
|
337
|
+
|
|
338
|
+
public render(): TemplateResult {
|
|
339
|
+
const open = this.open;
|
|
340
|
+
const narrow = this.narrowLayout;
|
|
341
|
+
const width = this.drawnWidth();
|
|
342
|
+
return html`
|
|
343
|
+
<div class="split ${narrow ? 'narrow' : ''}" style=${`--detailpane-width: ${width}px`}>
|
|
344
|
+
<div class="listFrame">
|
|
345
|
+
<div class="list" ?inert=${narrow && open}><slot></slot></div>
|
|
346
|
+
</div>
|
|
347
|
+
${open && !narrow ? this.renderHandle(width) : ''}
|
|
348
|
+
<aside
|
|
349
|
+
id="pane"
|
|
350
|
+
class="pane"
|
|
351
|
+
tabindex="-1"
|
|
352
|
+
aria-label=${this.heading || this.t('detailpane.label')}
|
|
353
|
+
?hidden=${!open}
|
|
354
|
+
@keydown=${this.handleKeydown}
|
|
355
|
+
>
|
|
356
|
+
<div class="header">
|
|
357
|
+
<div class="titles">
|
|
358
|
+
<div class="titleLine">
|
|
359
|
+
<h2 title=${this.heading}>${this.heading}</h2>
|
|
360
|
+
<slot name="status"></slot>
|
|
361
|
+
</div>
|
|
362
|
+
${this.description ? html`<p class="description" title=${this.description}>${this.description}</p>` : ''}
|
|
363
|
+
</div>
|
|
364
|
+
<div class="actions">
|
|
365
|
+
<slot name="actions"></slot>
|
|
366
|
+
<button type="button" class="close" aria-label=${this.t('detailpane.close')} @click=${this.requestClose}>
|
|
367
|
+
<dees-icon aria-hidden="true" icon="lucide:X" iconSize="16"></dees-icon>
|
|
368
|
+
</button>
|
|
369
|
+
</div>
|
|
370
|
+
</div>
|
|
371
|
+
<div class="bodyFrame">
|
|
372
|
+
<div class="body"><slot name="detail"></slot></div>
|
|
373
|
+
</div>
|
|
374
|
+
</aside>
|
|
375
|
+
</div>
|
|
376
|
+
`;
|
|
377
|
+
}
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* The separator on the pane's inner edge. It sizes the pane after it, which
|
|
381
|
+
* lies on its right while the writing runs left to right and on its left
|
|
382
|
+
* otherwise; the handle reads the pointer in screen coordinates.
|
|
383
|
+
*/
|
|
384
|
+
private renderHandle(width: number): TemplateResult {
|
|
385
|
+
const rtl = getComputedStyle(this).direction === 'rtl';
|
|
386
|
+
return html`<dees-resize-handle
|
|
387
|
+
class="handle"
|
|
388
|
+
aria-controls="pane"
|
|
389
|
+
.primary=${rtl ? 'start' : 'end'}
|
|
390
|
+
.label=${this.t('detailpane.resize')}
|
|
391
|
+
.value=${width}
|
|
392
|
+
.min=${this.minWidth}
|
|
393
|
+
.max=${this.maxWidth}
|
|
394
|
+
.defaultValue=${this.clamp(defaultPaneWidth)}
|
|
395
|
+
.largeStep=${paneLargeStep}
|
|
396
|
+
@resize-input=${(event: CustomEvent<IResizeHandleEventDetail>) => this.applyWidth(event.detail.value)}
|
|
397
|
+
@resize-change=${() => this.reportWidth()}
|
|
398
|
+
></dees-resize-handle>`;
|
|
399
|
+
}
|
|
400
|
+
|
|
401
|
+
/** Focuses the pane, for its name and its record; a call before the render that shows it waits for it. */
|
|
402
|
+
public async focus(optionsArg?: FocusOptions): Promise<void> {
|
|
403
|
+
if (!this.hasUpdated || this.isUpdatePending) await this.updateComplete;
|
|
404
|
+
const pane = this.shadowRoot?.querySelector<HTMLElement>('.pane');
|
|
405
|
+
if (pane && this.open) pane.focus(optionsArg);
|
|
406
|
+
else super.focus(optionsArg);
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
/** Takes the focus `focus()` gave the pane away again, waiting as `focus()` does. */
|
|
410
|
+
public async blur(): Promise<void> {
|
|
411
|
+
if (!this.hasUpdated || this.isUpdatePending) await this.updateComplete;
|
|
412
|
+
const pane = this.shadowRoot?.querySelector<HTMLElement>('.pane');
|
|
413
|
+
if (pane && this.shadowRoot!.activeElement === pane) pane.blur();
|
|
414
|
+
else super.blur();
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/** The width the pane is drawn at: `width` within its bounds, in whole pixels. */
|
|
418
|
+
private drawnWidth(): number {
|
|
419
|
+
return this.clamp(this.width);
|
|
420
|
+
}
|
|
421
|
+
|
|
422
|
+
private clamp(width: number): number {
|
|
423
|
+
return Math.min(this.maxWidth, Math.max(this.minWidth, Math.round(width)));
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/** What a reader asks for lands at once. */
|
|
427
|
+
private applyWidth(width: number): void {
|
|
428
|
+
const clamped = this.clamp(width);
|
|
429
|
+
if (clamped !== this.width) this.width = clamped;
|
|
430
|
+
}
|
|
431
|
+
|
|
432
|
+
/** A width a reader settled on is reported once, for the host to keep. */
|
|
433
|
+
private reportWidth(): void {
|
|
434
|
+
this.dispatchEvent(new CustomEvent<IAppuiDetailpaneWidthChangeEvent>('width-change', {
|
|
435
|
+
detail: { width: this.drawnWidth() },
|
|
436
|
+
bubbles: true,
|
|
437
|
+
composed: true,
|
|
438
|
+
}));
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
private readonly requestClose = () => {
|
|
442
|
+
this.dispatchEvent(new CustomEvent('close-request', { bubbles: true, composed: true }));
|
|
443
|
+
};
|
|
444
|
+
|
|
445
|
+
/** Narrow, Escape asks to close the pane that covers the list, unless something inside took the press. */
|
|
446
|
+
private readonly handleKeydown = (event: KeyboardEvent) => {
|
|
447
|
+
if (event.key !== 'Escape' || event.defaultPrevented || !this.narrowLayout || !this.open) return;
|
|
448
|
+
event.preventDefault();
|
|
449
|
+
this.requestClose();
|
|
450
|
+
};
|
|
451
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './dees-appui-detailpane.js';
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import { html } from '@design.estate/dees-element';
|
|
2
2
|
import { demoPage, demoSection, demoOutput, showDemoResult } from '../../../demos/templates.js';
|
|
3
3
|
import type { Column } from '../../00group-dataview/dees-table/types.js';
|
|
4
|
+
import type { IStatusbuttonItem } from '../../00group-feedback/dees-statusbutton/dees-statusbutton.js';
|
|
4
5
|
import type { DeesAppuiPage, IAppuiPageAction, IAppuiPageTab, IAppuiPageTabSelectEvent } from './dees-appui-page.js';
|
|
5
6
|
import '../../00group-dataview/dees-table/dees-table.js';
|
|
7
|
+
import '../../00group-dataview/dees-table-search/dees-table-search.js';
|
|
6
8
|
import '../../00group-feedback/dees-badge/dees-badge.js';
|
|
9
|
+
import '../../00group-feedback/dees-statusbutton/dees-statusbutton.js';
|
|
7
10
|
|
|
8
11
|
interface IDemoService {
|
|
9
12
|
name: string;
|
|
@@ -30,6 +33,17 @@ const columns: Column<IDemoService>[] = [
|
|
|
30
33
|
|
|
31
34
|
const delay = (ms: number) => new Promise<void>((resolve) => setTimeout(resolve, ms));
|
|
32
35
|
|
|
36
|
+
/** Enough services for the integrated list to scroll inside itself. */
|
|
37
|
+
const manyServices: IDemoService[] = Array.from({ length: 40 }, (_, index) => {
|
|
38
|
+
const service = services[index % services.length];
|
|
39
|
+
return { ...service, name: `${service.name}-${String(index + 1).padStart(2, '0')}` };
|
|
40
|
+
});
|
|
41
|
+
|
|
42
|
+
const listStatuses: IStatusbuttonItem[] = [
|
|
43
|
+
{ key: 'rollout', severity: 'info', text: 'Rolling out acme/worker:1.8.0 to 2 of 3 nodes.' },
|
|
44
|
+
{ key: 'failed', severity: 'warning', text: '1 service failed its last health check.', detail: 'api has answered no request for 4 minutes.' },
|
|
45
|
+
];
|
|
46
|
+
|
|
33
47
|
const listActions = (report: (text: string) => void): IAppuiPageAction[] => [
|
|
34
48
|
{ label: 'Refresh', iconName: 'lucide:RefreshCw', action: async () => { await delay(600); report('Refreshed'); } },
|
|
35
49
|
{ label: 'New service', iconName: 'lucide:Plus', type: 'primary', action: () => report('New service') },
|
|
@@ -55,7 +69,7 @@ const resultLine = (text: string): HTMLOutputElement => {
|
|
|
55
69
|
/** A list page and a detail page, as a view inside `dees-appui` renders them. */
|
|
56
70
|
export const demoFunc = () => {
|
|
57
71
|
const listResult = resultLine('Press Refresh or New service.');
|
|
58
|
-
return demoPage('Page', 'The header and container of a view: breadcrumbs, title, status, a one-line summary, actions at the end of the title row and optional tabs, within one max-width and padding.', html`
|
|
72
|
+
return demoPage('Page', 'The header and container of a view: breadcrumbs, title, status, a one-line summary, tools and actions at the end of the title row and optional tabs in a stripe under it, within one max-width and padding, or filling the view as an integrated list.', html`
|
|
59
73
|
${demoSection('List page', 'A title that equals the navigation label, a summary line, a secondary and a primary action. Refresh runs for a moment: its button shows the pending state.', html`
|
|
60
74
|
<div style="background: var(--dees-color-bg-canvas); border: 1px solid var(--dees-color-border-subtle); border-radius: var(--dees-radius-xl); overflow: hidden;">
|
|
61
75
|
<dees-appui-page
|
|
@@ -68,7 +82,21 @@ export const demoFunc = () => {
|
|
|
68
82
|
</div>
|
|
69
83
|
${listResult}
|
|
70
84
|
`)}
|
|
71
|
-
${demoSection('
|
|
85
|
+
${demoSection('Integrated list', 'layout="fill": the page takes the height of its container and the frameless list fills the rest, edge to edge, scrolling inside itself under the heading; its first column stands under the title. The search and the status button stand in the tools slot, before the actions, the primary one last. Narrow the window: the tools and actions move under the title together.', html`
|
|
86
|
+
<div style="height: 420px; background: var(--dees-color-bg-canvas); border: 1px solid var(--dees-color-border-subtle); border-radius: var(--dees-radius-xl); overflow: hidden;">
|
|
87
|
+
<dees-appui-page
|
|
88
|
+
layout="fill"
|
|
89
|
+
heading="Services"
|
|
90
|
+
description="40 services · 14 failed · 13 deploying"
|
|
91
|
+
.actions=${[{ label: 'New service', iconName: 'lucide:Plus', type: 'primary', action: () => undefined }] satisfies IAppuiPageAction[]}
|
|
92
|
+
>
|
|
93
|
+
<dees-table-search slot="tools" for="pageDemoServices" dataName="services"></dees-table-search>
|
|
94
|
+
<dees-statusbutton slot="tools" .items=${listStatuses}></dees-statusbutton>
|
|
95
|
+
<dees-table id="pageDemoServices" frameless fill .searchable=${false} .columns=${columns} .data=${manyServices} dataName="services" .selectionMode=${'none'}></dees-table>
|
|
96
|
+
</dees-appui-page>
|
|
97
|
+
</div>
|
|
98
|
+
`)}
|
|
99
|
+
${demoSection('Detail page', 'Breadcrumbs to the list, a status badge beside the title, two actions and tabs in a stripe under the heading. Select a tab with a click, or move with the arrow keys and press Enter.', html`
|
|
72
100
|
<div style="background: var(--dees-color-bg-canvas); border: 1px solid var(--dees-color-border-subtle); border-radius: var(--dees-radius-xl); overflow: hidden;">
|
|
73
101
|
<dees-appui-page
|
|
74
102
|
heading="api"
|