@design.estate/dees-catalog 21.45.0 → 21.46.1
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 +299 -84
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_bundle/bundle.js.third-party-notices.json +1 -1
- package/dist_bundle/bundle.js.third-party-notices.txt +1 -1
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-L4Z3DS4M.js → chunk-FCUX4QGD.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-Y2OCV2BV.js → chunk-LWT7IIPZ.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-L3H6FV4W.js → chunk-VJVZHESI.js} +37 -14
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-VJVZHESI.js.map +1 -0
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-SOLSWJ7V.js → de-7PGZC4IF.js} +2 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-VDA5LOS7.js → dees-modal-VOIWY235.js} +3 -3
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-SD4GXHX5.js → dees-workspace-terminal-EJRHSZ5F.js} +4 -4
- package/dist_bundle/third-party-notices.md +2 -2
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-appui/dees-appui/dees-appui.d.ts +37 -3
- package/dist_ts_web/elements/00group-appui/dees-appui/dees-appui.js +79 -19
- package/dist_ts_web/elements/00group-dataview/dees-table/dees-table.d.ts +24 -7
- package/dist_ts_web/elements/00group-dataview/dees-table/dees-table.js +53 -18
- package/dist_ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.d.ts +11 -1
- package/dist_ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.demo.js +17 -1
- package/dist_ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.js +19 -2
- package/dist_ts_web/elements/00group-layout/dees-stepper/dees-stepper.d.ts +33 -2
- package/dist_ts_web/elements/00group-layout/dees-stepper/dees-stepper.demo.js +92 -13
- package/dist_ts_web/elements/00group-layout/dees-stepper/dees-stepper.js +58 -15
- package/dist_ts_web/elements/00group-layout/dees-stepper/styles.js +31 -2
- package/dist_ts_web/elements/interfaces/appconfig.d.ts +9 -2
- package/package.json +2 -2
- package/readme.md +35 -6
- package/third-party-notices.md +2 -2
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-appui/dees-appui/dees-appui.ts +95 -21
- package/ts_web/elements/00group-appui/dees-appui/readme.md +16 -4
- package/ts_web/elements/00group-dataview/dees-table/dees-table.ts +54 -17
- package/ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.demo.ts +20 -0
- package/ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.ts +18 -1
- package/ts_web/elements/00group-layout/dees-stepper/dees-stepper.demo.ts +79 -4
- package/ts_web/elements/00group-layout/dees-stepper/dees-stepper.ts +69 -13
- package/ts_web/elements/00group-layout/dees-stepper/styles.ts +32 -1
- package/ts_web/elements/interfaces/appconfig.ts +9 -2
- package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/chunk-L3H6FV4W.js.map +0 -1
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-L4Z3DS4M.js.map → chunk-FCUX4QGD.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{chunk-Y2OCV2BV.js.map → chunk-LWT7IIPZ.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{de-SOLSWJ7V.js.map → de-7PGZC4IF.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-modal-VDA5LOS7.js.map → dees-modal-VOIWY235.js.map} +0 -0
- /package/dist_bundle/chunks/U6Ua8p1giFoD1s7vrUZUdpbg/{dees-workspace-terminal-SD4GXHX5.js.map → dees-workspace-terminal-EJRHSZ5F.js.map} +0 -0
|
@@ -77,6 +77,21 @@ export type TStepperLayout = 'auto' | 'horizontal' | 'vertical';
|
|
|
77
77
|
*/
|
|
78
78
|
export type TStepperCardAlign = 'start' | 'center';
|
|
79
79
|
|
|
80
|
+
/**
|
|
81
|
+
* When the ribbon and its counter show: `'always'` for any flow, "1 of 1" for
|
|
82
|
+
* a flow of one step; `'auto'` once the flow has two counted steps or more.
|
|
83
|
+
*/
|
|
84
|
+
export type TStepperRibbon = 'always' | 'auto';
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* What failed on the current step, kept as what it is rather than as its text:
|
|
88
|
+
* the error thrown, whose `message` is read each time the alert renders, or the
|
|
89
|
+
* key of the stepper's own words for a failure that is no `Error`.
|
|
90
|
+
*/
|
|
91
|
+
type TStepFailure =
|
|
92
|
+
| { error: Error }
|
|
93
|
+
| { key: 'stepper.actionFailed' | 'stepper.returnFailed' | 'stepper.stepFailed' };
|
|
94
|
+
|
|
80
95
|
export interface IStep {
|
|
81
96
|
title: string;
|
|
82
97
|
description?: string;
|
|
@@ -125,6 +140,8 @@ export class DeesStepper extends DeesElement {
|
|
|
125
140
|
layout?: TStepperLayout;
|
|
126
141
|
/** Where the card stands in the stepper's height; see `cardAlign`. */
|
|
127
142
|
cardAlign?: TStepperCardAlign;
|
|
143
|
+
/** When the ribbon and its counter show; see `ribbon`. */
|
|
144
|
+
ribbon?: TStepperRibbon;
|
|
128
145
|
/** Asked before a cancellation in place of the stepper's own confirmation; see `beforeClose`. */
|
|
129
146
|
beforeClose?: () => boolean | Promise<boolean>;
|
|
130
147
|
} & IOverlayI18nOptions): Promise<DeesStepper> {
|
|
@@ -139,6 +156,7 @@ export class DeesStepper extends DeesElement {
|
|
|
139
156
|
if (optionsArg.stepCounter !== undefined) stepper.stepCounter = optionsArg.stepCounter;
|
|
140
157
|
if (optionsArg.layout !== undefined) stepper.layout = optionsArg.layout;
|
|
141
158
|
if (optionsArg.cardAlign !== undefined) stepper.cardAlign = optionsArg.cardAlign;
|
|
159
|
+
if (optionsArg.ribbon !== undefined) stepper.ribbon = optionsArg.ribbon;
|
|
142
160
|
if (optionsArg.beforeClose) stepper.beforeClose = optionsArg.beforeClose;
|
|
143
161
|
body.append(stepper);
|
|
144
162
|
|
|
@@ -236,6 +254,17 @@ export class DeesStepper extends DeesElement {
|
|
|
236
254
|
@property({ type: String, reflect: true })
|
|
237
255
|
accessor cardAlign: TStepperCardAlign = 'start';
|
|
238
256
|
|
|
257
|
+
/**
|
|
258
|
+
* When the ribbon and its counter show. `'always'` (default) shows them for
|
|
259
|
+
* any flow, so a flow of one step reads "1 of 1". `'auto'` shows them once
|
|
260
|
+
* the flow has two counted steps or more: a flow of one step is its card
|
|
261
|
+
* alone, centred, with no room kept beside it (in the vertical layout, none
|
|
262
|
+
* above it), and the ribbon comes in when the flow gains a step, as a choice
|
|
263
|
+
* that adds its steps does.
|
|
264
|
+
*/
|
|
265
|
+
@property({ type: String, reflect: true })
|
|
266
|
+
accessor ribbon: TStepperRibbon = 'always';
|
|
267
|
+
|
|
239
268
|
@property({ type: Object, attribute: false })
|
|
240
269
|
accessor activeForm: DeesForm | null = null;
|
|
241
270
|
|
|
@@ -246,7 +275,15 @@ export class DeesStepper extends DeesElement {
|
|
|
246
275
|
|
|
247
276
|
private readonly t = dcLocalize(this);
|
|
248
277
|
|
|
249
|
-
|
|
278
|
+
/**
|
|
279
|
+
* The current step's failure, shown in its alert. A change of language
|
|
280
|
+
* renders the stepper again, so the alert follows it: the stepper's own words
|
|
281
|
+
* always, and a thrown error's when its `message` follows the language, as a
|
|
282
|
+
* `LocalizedError`'s (`@push.rocks/smarti18n`) does. A failed progress
|
|
283
|
+
* step's log line and status keep the text they had when the step failed:
|
|
284
|
+
* they are its record, and they are the strings of `IStepProgressState`.
|
|
285
|
+
*/
|
|
286
|
+
@state() private accessor stepError: TStepFailure | null = null;
|
|
250
287
|
@state() private accessor progressRunning = false;
|
|
251
288
|
@state() private accessor actionPending = false;
|
|
252
289
|
/** The action whose promise is still pending, if any: it alone shows the busy face. */
|
|
@@ -311,9 +348,10 @@ export class DeesStepper extends DeesElement {
|
|
|
311
348
|
const selectedIndex = this.getIndexOfStep(this.selectedStep);
|
|
312
349
|
// Back points the way the steps run back: to the inline start, which is the right in a right-to-left page.
|
|
313
350
|
const backIcon = this.matches(':dir(rtl)') ? 'lucide:ChevronRight' : 'lucide:ChevronLeft';
|
|
351
|
+
const ribbonShown = this.showsRibbon();
|
|
314
352
|
return html`<div class="stepperSurface" data-layout=${this.getLayout()} data-align=${this.cardAlign === 'center' ? 'center' : 'start'}
|
|
315
|
-
data-counter=${this.getCounterText()}>
|
|
316
|
-
${this.renderRibbon()}
|
|
353
|
+
data-ribbon=${ribbonShown ? 'shown' : 'hidden'} data-counter=${ribbonShown ? this.getCounterText() : ''}>
|
|
354
|
+
${ribbonShown ? this.renderRibbon() : ''}
|
|
317
355
|
<div class="stage">
|
|
318
356
|
${directives.repeat(this.steps.filter((step) => step === this.selectedStep || this.leavingSteps.has(step)), (step) => step, (stepArg) => {
|
|
319
357
|
const stepIndex = this.getIndexOfStep(stepArg);
|
|
@@ -348,7 +386,7 @@ export class DeesStepper extends DeesElement {
|
|
|
348
386
|
` : ''}
|
|
349
387
|
${this.stepContents.get(stepArg)?.host ?? ''}
|
|
350
388
|
${isSelected && this.stepError ? html`<div class="step-error" role="alert">
|
|
351
|
-
<dees-icon icon="lucide:CircleAlert" iconSize="16"></dees-icon><span>${this.
|
|
389
|
+
<dees-icon icon="lucide:CircleAlert" iconSize="16"></dees-icon><span>${this.getStepErrorText()}</span>
|
|
352
390
|
</div>` : ''}
|
|
353
391
|
</div>
|
|
354
392
|
<div slot="footer" class="step-footer">
|
|
@@ -416,8 +454,9 @@ export class DeesStepper extends DeesElement {
|
|
|
416
454
|
|
|
417
455
|
/**
|
|
418
456
|
* What the counter under the ribbon reads, empty without a counted step.
|
|
419
|
-
*
|
|
420
|
-
* takes beside the steps free on their other side
|
|
457
|
+
* While the ribbon shows, the surface holds it as `data-counter` too: the
|
|
458
|
+
* styles keep the room it takes beside the steps free on their other side
|
|
459
|
+
* as well.
|
|
421
460
|
*/
|
|
422
461
|
private getCounterText(): string {
|
|
423
462
|
const counted = this.steps.filter((step) => step.countsAsStep !== false);
|
|
@@ -429,6 +468,23 @@ export class DeesStepper extends DeesElement {
|
|
|
429
468
|
: this.t('stepper.counter', { current: current + 1, total: counted.length });
|
|
430
469
|
}
|
|
431
470
|
|
|
471
|
+
/** Whether the ribbon and its counter show: always, or under `ribbon: 'auto'` for two counted steps or more. */
|
|
472
|
+
private showsRibbon(): boolean {
|
|
473
|
+
return this.ribbon !== 'auto' || this.steps.filter((step) => step.countsAsStep !== false).length > 1;
|
|
474
|
+
}
|
|
475
|
+
|
|
476
|
+
/** The failure as it is kept: a thrown error, or the key of the stepper's own words for one that is no `Error`. */
|
|
477
|
+
private toStepFailure(error: unknown, key: 'stepper.actionFailed' | 'stepper.returnFailed' | 'stepper.stepFailed'): TStepFailure {
|
|
478
|
+
return error instanceof Error ? { error } : { key };
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
/** The current step's failure in words, read anew at every render: in the language the stepper speaks now. */
|
|
482
|
+
private getStepErrorText(): string {
|
|
483
|
+
const failure = this.stepError;
|
|
484
|
+
if (!failure) return '';
|
|
485
|
+
return 'error' in failure ? failure.error.message : this.t(failure.key);
|
|
486
|
+
}
|
|
487
|
+
|
|
432
488
|
/**
|
|
433
489
|
* Arrow keys, Home and End move the focus along the ribbon's markers.
|
|
434
490
|
* ArrowUp and ArrowDown go to the step before and after; ArrowLeft and
|
|
@@ -506,7 +562,7 @@ export class DeesStepper extends DeesElement {
|
|
|
506
562
|
this.activeValidationStep?.abortController?.abort();
|
|
507
563
|
if (this.activeValidationStep) this.activeValidationStep.validationFuncCalled = false;
|
|
508
564
|
this.activeValidationStep = this.selectedStep;
|
|
509
|
-
this.stepError =
|
|
565
|
+
this.stepError = null;
|
|
510
566
|
this.progressRunning = false;
|
|
511
567
|
this.actionPending = false;
|
|
512
568
|
this.pendingAction = null;
|
|
@@ -684,7 +740,7 @@ export class DeesStepper extends DeesElement {
|
|
|
684
740
|
await this.updateComplete;
|
|
685
741
|
if (this.isConnected && this.selectedStep === target) {
|
|
686
742
|
try { await target.onReturnToStepFunc?.(this, this.shadowRoot!.querySelector('.selected') as HTMLElement); }
|
|
687
|
-
catch (error) { if (this.selectedStep === target) this.stepError =
|
|
743
|
+
catch (error) { if (this.selectedStep === target) this.stepError = this.toStepFailure(error, 'stepper.returnFailed'); }
|
|
688
744
|
}
|
|
689
745
|
}
|
|
690
746
|
|
|
@@ -837,14 +893,14 @@ export class DeesStepper extends DeesElement {
|
|
|
837
893
|
this.actionPending = true;
|
|
838
894
|
this.pendingAction = optionArg;
|
|
839
895
|
this.actionStep = step;
|
|
840
|
-
this.stepError =
|
|
896
|
+
this.stepError = null;
|
|
841
897
|
try {
|
|
842
898
|
if (isPrimary && form && !await form.gatherAndDispatch()) return;
|
|
843
899
|
if (!this.isConnected || step !== this.selectedStep) return;
|
|
844
900
|
await optionArg.action(this);
|
|
845
901
|
} catch (error) {
|
|
846
902
|
// shown on the step, also when it is off the page meanwhile and comes back
|
|
847
|
-
if (step === this.selectedStep) this.stepError =
|
|
903
|
+
if (step === this.selectedStep) this.stepError = this.toStepFailure(error, 'stepper.actionFailed');
|
|
848
904
|
} finally {
|
|
849
905
|
if (this.actionStep === step) { this.actionPending = false; this.pendingAction = null; this.actionStep = undefined; }
|
|
850
906
|
}
|
|
@@ -917,8 +973,8 @@ export class DeesStepper extends DeesElement {
|
|
|
917
973
|
return;
|
|
918
974
|
}
|
|
919
975
|
|
|
920
|
-
|
|
921
|
-
|
|
976
|
+
this.stepError = this.toStepFailure(error, 'stepper.stepFailed');
|
|
977
|
+
const errorText = this.getStepErrorText();
|
|
922
978
|
if (stepArg.progressStep) {
|
|
923
979
|
// The line shows the failure alone: the alert below already says it is one.
|
|
924
980
|
this.appendProgressStepLine(errorText, stepArg);
|
|
@@ -942,7 +998,7 @@ export class DeesStepper extends DeesElement {
|
|
|
942
998
|
if (!step?.validationFunc || this.progressRunning || this.actionPending) return;
|
|
943
999
|
step.abortController?.abort();
|
|
944
1000
|
step.validationFuncCalled = false;
|
|
945
|
-
this.stepError =
|
|
1001
|
+
this.stepError = null;
|
|
946
1002
|
this.prepareStepForActivation(step);
|
|
947
1003
|
await this.activateSelectedStep();
|
|
948
1004
|
}
|
|
@@ -136,6 +136,32 @@ const centredStrip = css`
|
|
|
136
136
|
& dees-tile.step:not(.selected) { margin-block-start: calc(var(--stepper-rail) + var(--dees-spacing-md)); }
|
|
137
137
|
`;
|
|
138
138
|
|
|
139
|
+
/*
|
|
140
|
+
* A flow without its ribbon (`ribbon: 'auto'` and one counted step): the card
|
|
141
|
+
* alone. Beside the steps, the room kept free across from the ribbon
|
|
142
|
+
* (`::after`) goes with it, so both side columns are empty and the card stands
|
|
143
|
+
* in the middle; in the vertical layout, the card takes the strip's row and
|
|
144
|
+
* gap.
|
|
145
|
+
*/
|
|
146
|
+
const verticalAlone = css`
|
|
147
|
+
grid-template-rows: minmax(0, 1fr);
|
|
148
|
+
row-gap: 0;
|
|
149
|
+
& .stage { grid-row: 1; }
|
|
150
|
+
`;
|
|
151
|
+
|
|
152
|
+
/* The centred card alone in the vertical layout: centred in the stepper's height as beside the steps. */
|
|
153
|
+
const centredAlone = css`
|
|
154
|
+
--stepper-card-max: calc(100cqh - var(--dees-spacing-md) * 2);
|
|
155
|
+
grid-template-rows:
|
|
156
|
+
minmax(0, 1fr)
|
|
157
|
+
minmax(min(var(--stepper-step-min-height), var(--stepper-card-max)), auto)
|
|
158
|
+
minmax(0, 1fr);
|
|
159
|
+
row-gap: 0;
|
|
160
|
+
& .stage { grid-row: 1 / -1; }
|
|
161
|
+
& dees-tile.step.selected { grid-row: 2; }
|
|
162
|
+
& dees-tile.step:not(.selected) { margin-block-start: 0; }
|
|
163
|
+
`;
|
|
164
|
+
|
|
139
165
|
export const stepperStyles = css`
|
|
140
166
|
:host {
|
|
141
167
|
--stepper-motion-duration: var(--dees-transition-slow);
|
|
@@ -492,13 +518,18 @@ export const stepperStyles = css`
|
|
|
492
518
|
.predestroy .step.selected, .predestroy .progress { animation: none; }
|
|
493
519
|
}
|
|
494
520
|
|
|
495
|
-
/* --- The centred card; the vertical layout, chosen or on a narrow surface in the automatic one --- */
|
|
521
|
+
/* --- The centred card; the vertical layout, chosen or on a narrow surface in the automatic one; each without the ribbon --- */
|
|
496
522
|
.stepperSurface:where([data-align='center']) { ${centredCard} }
|
|
523
|
+
.stepperSurface:where([data-ribbon='hidden'])::after { content: none; }
|
|
497
524
|
.stepperSurface:where([data-layout='vertical']) { ${verticalLayout} }
|
|
525
|
+
.stepperSurface:where([data-layout='vertical'][data-ribbon='hidden']) { ${verticalAlone} }
|
|
498
526
|
.stepperSurface:where([data-layout='vertical'][data-align='center']) { ${centredStrip} }
|
|
527
|
+
.stepperSurface:where([data-layout='vertical'][data-align='center'][data-ribbon='hidden']) { ${centredAlone} }
|
|
499
528
|
@container stepper-surface (max-width: 640px) {
|
|
500
529
|
.stepperSurface:where([data-layout='auto']) { ${verticalLayout} }
|
|
530
|
+
.stepperSurface:where([data-layout='auto'][data-ribbon='hidden']) { ${verticalAlone} }
|
|
501
531
|
.stepperSurface:where([data-layout='auto'][data-align='center']) { ${centredStrip} }
|
|
532
|
+
.stepperSurface:where([data-layout='auto'][data-align='center'][data-ribbon='hidden']) { ${centredAlone} }
|
|
502
533
|
/* a narrow surface, in any layout: a closer card, the hint on a row of its own */
|
|
503
534
|
.step-header { padding: var(--dees-spacing-md) var(--dees-spacing-lg); }
|
|
504
535
|
.step-body { padding: var(--dees-spacing-lg); }
|
|
@@ -247,9 +247,16 @@ export interface IViewNavigationOptions {
|
|
|
247
247
|
* `push` (the default) adds a history entry, so Back returns to the screen
|
|
248
248
|
* left behind. `replace` rewrites the current entry instead — for a screen
|
|
249
249
|
* that corrects its own route, such as a redirect to a default section or a
|
|
250
|
-
* normalized identifier, which must not become a step of its own.
|
|
250
|
+
* normalized identifier, which must not become a step of its own. `return`
|
|
251
|
+
* ends a step the reader took from the screen asked for — a flow opened
|
|
252
|
+
* from a list that goes back to it once it is done or closed: when the
|
|
253
|
+
* entry before the current one shows that screen, the shell goes back to
|
|
254
|
+
* it, so the flow's entry stays only as Forward and Back leaves the screen
|
|
255
|
+
* the reader came from rather than showing it once more; otherwise, as
|
|
256
|
+
* after a reload or a deep link into the flow, it replaces the current
|
|
257
|
+
* entry.
|
|
251
258
|
*/
|
|
252
|
-
history?: 'push' | 'replace';
|
|
259
|
+
history?: 'push' | 'replace' | 'return';
|
|
253
260
|
}
|
|
254
261
|
|
|
255
262
|
/**
|