@design.estate/dees-catalog 21.30.0 → 21.30.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 +57 -12
- package/dist_bundle/bundle.js.map +1 -1
- package/dist_ts_web/00_commitinfo_data.js +1 -1
- package/dist_ts_web/elements/00group-form/dees-form/dees-form.d.ts +8 -1
- package/dist_ts_web/elements/00group-form/dees-form/dees-form.js +10 -2
- package/dist_ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.d.ts +17 -0
- package/dist_ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.demo.js +8 -1
- package/dist_ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.js +36 -6
- package/dist_ts_web/elements/00group-layout/dees-stepper/dees-stepper.d.ts +4 -3
- package/dist_ts_web/elements/00group-layout/dees-stepper/dees-stepper.demo.js +8 -4
- package/dist_ts_web/elements/00group-layout/dees-stepper/dees-stepper.js +7 -6
- package/package.json +1 -1
- package/readme.md +17 -3
- package/scripts/reflect-allowlist.json +2 -1
- package/ts_web/00_commitinfo_data.ts +1 -1
- package/ts_web/elements/00group-form/dees-form/dees-form.ts +10 -2
- package/ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.demo.ts +10 -0
- package/ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.ts +31 -1
- package/ts_web/elements/00group-layout/dees-stepper/dees-stepper.demo.ts +7 -3
- package/ts_web/elements/00group-layout/dees-stepper/dees-stepper.ts +5 -4
package/dist_bundle/bundle.js
CHANGED
|
@@ -5710,20 +5710,37 @@ var sections = b`
|
|
|
5710
5710
|
${demoOutput("Chosen: manual")}
|
|
5711
5711
|
${demoCode("<dees-input-radiogroup .options=${[\n { key: 'manual', option: 'Enter the details yourself', description: 'Type the name and whatever else you know.' },\n ...\n]}></dees-input-radiogroup>")}
|
|
5712
5712
|
`
|
|
5713
|
+
)}
|
|
5714
|
+
${demoSection(
|
|
5715
|
+
"Named by the question above it",
|
|
5716
|
+
"Where a heading or a step title already asks the question, the group shows no label of its own. An aria-label names it instead, so assistive technology still announces the question when the focus enters the group.",
|
|
5717
|
+
b`
|
|
5718
|
+
<p class="dees-demo-label">How do you want to add the contact?</p>
|
|
5719
|
+
<dees-input-radiogroup key="source" aria-label="How do you want to add the contact?" .options=${imports} selectedOption="text"
|
|
5720
|
+
@change=${(event) => showDemoResult(
|
|
5721
|
+
event.currentTarget,
|
|
5722
|
+
`Chosen: ${event.currentTarget.selectedOption}`
|
|
5723
|
+
)}></dees-input-radiogroup>
|
|
5724
|
+
${demoOutput("Chosen: text")}
|
|
5725
|
+
${demoCode('<p>How do you want to add the contact?</p>\n<dees-input-radiogroup aria-label="How do you want to add the contact?" .options=${options}></dees-input-radiogroup>')}
|
|
5726
|
+
`
|
|
5713
5727
|
)}
|
|
5714
5728
|
`;
|
|
5715
5729
|
var demoFunc8 = /* @__PURE__ */ __name(() => focusedInputDemo("radiogroup", sections), "demoFunc");
|
|
5716
5730
|
|
|
5717
5731
|
// ts_web/elements/00group-input/dees-input-radiogroup/dees-input-radiogroup.ts
|
|
5718
|
-
var _validationState_dec, _direction_dec, _selectedOption_dec3, _options_dec4, _a14, _DeesInputRadiogroup_decorators, _init16, _options4, _selectedOption3, _direction, _validationState;
|
|
5732
|
+
var _ariaLabel_dec2, _validationState_dec, _direction_dec, _selectedOption_dec3, _options_dec4, _a14, _DeesInputRadiogroup_decorators, _init16, _options4, _selectedOption3, _direction, _validationState, _ariaLabel2;
|
|
5719
5733
|
_DeesInputRadiogroup_decorators = [customElement("dees-input-radiogroup")];
|
|
5720
|
-
var _DeesInputRadiogroup = class _DeesInputRadiogroup extends (_a14 = DeesInputBase, _options_dec4 = [n({ type: Array })], _selectedOption_dec3 = [n()], _direction_dec = [n({ type: String, reflect: true })], _validationState_dec = [n({ type: String, reflect: true })], _a14) {
|
|
5734
|
+
var _DeesInputRadiogroup = class _DeesInputRadiogroup extends (_a14 = DeesInputBase, _options_dec4 = [n({ type: Array })], _selectedOption_dec3 = [n()], _direction_dec = [n({ type: String, reflect: true })], _validationState_dec = [n({ type: String, reflect: true })], _ariaLabel_dec2 = [n({ type: String, attribute: "aria-label" })], _a14) {
|
|
5721
5735
|
constructor() {
|
|
5722
5736
|
super(...arguments);
|
|
5723
5737
|
__privateAdd(this, _options4, __runInitializers(_init16, 8, this, [])), __runInitializers(_init16, 11, this);
|
|
5724
5738
|
__privateAdd(this, _selectedOption3, __runInitializers(_init16, 12, this, "")), __runInitializers(_init16, 15, this);
|
|
5725
5739
|
__privateAdd(this, _direction, __runInitializers(_init16, 16, this, "vertical")), __runInitializers(_init16, 19, this);
|
|
5726
5740
|
__privateAdd(this, _validationState, __runInitializers(_init16, 20, this, null)), __runInitializers(_init16, 23, this);
|
|
5741
|
+
__privateAdd(this, _ariaLabel2, __runInitializers(_init16, 24, this, null)), __runInitializers(_init16, 27, this);
|
|
5742
|
+
/** Whether the host's `aria-label` was just removed by the group itself, after moving it. */
|
|
5743
|
+
__publicField(this, "movedAriaLabel", false);
|
|
5727
5744
|
}
|
|
5728
5745
|
// Form compatibility
|
|
5729
5746
|
get value() {
|
|
@@ -5760,7 +5777,7 @@ var _DeesInputRadiogroup = class _DeesInputRadiogroup extends (_a14 = DeesInputB
|
|
|
5760
5777
|
<div class="input-wrapper">
|
|
5761
5778
|
${this.label ? this.renderLabel() : ""}
|
|
5762
5779
|
<div class="maincontainer ${this.direction} ${described ? "described" : ""}" role="radiogroup"
|
|
5763
|
-
|
|
5780
|
+
.ariaLabel=${this.ariaLabel || this.label || null} aria-required=${this.required ? "true" : "false"}
|
|
5764
5781
|
aria-disabled=${this.disabled ? "true" : "false"}
|
|
5765
5782
|
aria-invalid=${this.validationState === "invalid" ? "true" : "false"}>
|
|
5766
5783
|
${this.options.map((option) => {
|
|
@@ -5794,6 +5811,22 @@ var _DeesInputRadiogroup = class _DeesInputRadiogroup extends (_a14 = DeesInputB
|
|
|
5794
5811
|
</div>
|
|
5795
5812
|
`;
|
|
5796
5813
|
}
|
|
5814
|
+
/**
|
|
5815
|
+
* An `aria-label` written on the host sets `ariaLabel`, which the group
|
|
5816
|
+
* carries, and leaves the host: kept there, Chromium would expose a generic
|
|
5817
|
+
* node with the name beside the group. The removal the group makes itself
|
|
5818
|
+
* changes nothing; to clear the name, set `ariaLabel` to `null`.
|
|
5819
|
+
*/
|
|
5820
|
+
attributeChangedCallback(name, oldValue, value) {
|
|
5821
|
+
if (name === "aria-label" && value === null && this.movedAriaLabel) {
|
|
5822
|
+
this.movedAriaLabel = false;
|
|
5823
|
+
return;
|
|
5824
|
+
}
|
|
5825
|
+
super.attributeChangedCallback(name, oldValue, value);
|
|
5826
|
+
if (name !== "aria-label" || value === null) return;
|
|
5827
|
+
this.movedAriaLabel = true;
|
|
5828
|
+
this.removeAttribute(name);
|
|
5829
|
+
}
|
|
5797
5830
|
getOptionKey(option) {
|
|
5798
5831
|
if (typeof option === "string") {
|
|
5799
5832
|
return option;
|
|
@@ -5872,10 +5905,12 @@ _options4 = new WeakMap();
|
|
|
5872
5905
|
_selectedOption3 = new WeakMap();
|
|
5873
5906
|
_direction = new WeakMap();
|
|
5874
5907
|
_validationState = new WeakMap();
|
|
5908
|
+
_ariaLabel2 = new WeakMap();
|
|
5875
5909
|
__decorateElement(_init16, 4, "options", _options_dec4, _DeesInputRadiogroup, _options4);
|
|
5876
5910
|
__decorateElement(_init16, 4, "selectedOption", _selectedOption_dec3, _DeesInputRadiogroup, _selectedOption3);
|
|
5877
5911
|
__decorateElement(_init16, 4, "direction", _direction_dec, _DeesInputRadiogroup, _direction);
|
|
5878
5912
|
__decorateElement(_init16, 4, "validationState", _validationState_dec, _DeesInputRadiogroup, _validationState);
|
|
5913
|
+
__decorateElement(_init16, 4, "ariaLabel", _ariaLabel_dec2, _DeesInputRadiogroup, _ariaLabel2);
|
|
5879
5914
|
_DeesInputRadiogroup = __decorateElement(_init16, 0, "DeesInputRadiogroup", _DeesInputRadiogroup_decorators, _DeesInputRadiogroup);
|
|
5880
5915
|
__name(_DeesInputRadiogroup, "DeesInputRadiogroup");
|
|
5881
5916
|
__publicField(_DeesInputRadiogroup, "inputLayout", "choice");
|
|
@@ -42551,6 +42586,13 @@ var _DeesForm = class _DeesForm extends (_a55 = DeesElement, _horizontalLayout_d
|
|
|
42551
42586
|
}
|
|
42552
42587
|
return valueObject;
|
|
42553
42588
|
}
|
|
42589
|
+
/**
|
|
42590
|
+
* Dispatches the collected data as `formData`, unless a field refuses: the
|
|
42591
|
+
* first enabled field whose `checkValidity()` fails reports its validity and
|
|
42592
|
+
* takes the focus, and nothing is dispatched. Resolves to `true` once
|
|
42593
|
+
* `formData` went out and to `false` after a refusal, so a host that submits
|
|
42594
|
+
* through the form (a stepper's primary) can stop where the field did.
|
|
42595
|
+
*/
|
|
42554
42596
|
async gatherAndDispatch() {
|
|
42555
42597
|
for (const child of this.getFormElements()) {
|
|
42556
42598
|
if (child.disabled) continue;
|
|
@@ -42558,7 +42600,7 @@ var _DeesForm = class _DeesForm extends (_a55 = DeesElement, _horizontalLayout_d
|
|
|
42558
42600
|
if (input.checkValidity?.() === false) {
|
|
42559
42601
|
input.reportValidity?.();
|
|
42560
42602
|
child.focus();
|
|
42561
|
-
return;
|
|
42603
|
+
return false;
|
|
42562
42604
|
}
|
|
42563
42605
|
}
|
|
42564
42606
|
const valueObject = await this.collectFormData();
|
|
@@ -42569,6 +42611,7 @@ var _DeesForm = class _DeesForm extends (_a55 = DeesElement, _horizontalLayout_d
|
|
|
42569
42611
|
bubbles: true
|
|
42570
42612
|
});
|
|
42571
42613
|
this.dispatchEvent(formDataEvent);
|
|
42614
|
+
return true;
|
|
42572
42615
|
}
|
|
42573
42616
|
/**
|
|
42574
42617
|
* Shows a status on the submit button and freezes or releases the fields with it:
|
|
@@ -83064,6 +83107,7 @@ var createChoiceSteps = /* @__PURE__ */ __name((finish) => {
|
|
|
83064
83107
|
review.content = reviewForm();
|
|
83065
83108
|
}, "validationFunc")
|
|
83066
83109
|
}), "reading");
|
|
83110
|
+
const reachable = /* @__PURE__ */ __name((value) => /\S+@\S+\.\S+|\+?\d[\d\s/-]{5,}/.test(value) ? { valid: true } : { valid: false, message: "Include an email address or a phone number, so the contact can be reached." }, "reachable");
|
|
83067
83111
|
const flows = {
|
|
83068
83112
|
manual: [{
|
|
83069
83113
|
title: "Enter the details.",
|
|
@@ -83078,7 +83122,7 @@ var createChoiceSteps = /* @__PURE__ */ __name((finish) => {
|
|
|
83078
83122
|
title: "Paste the text.",
|
|
83079
83123
|
description: "A signature, a letterhead or an email: whatever names the contact.",
|
|
83080
83124
|
content: b`<dees-form>
|
|
83081
|
-
<dees-input-textarea key="text" label="Text" .rows=${5} required
|
|
83125
|
+
<dees-input-textarea key="text" label="Text" .rows=${5} .validationFunction=${reachable} required
|
|
83082
83126
|
.value=${"Northwind Traders GmbH\nHafenstra\xDFe 12, 20457 Hamburg\nhello@northwind.example"}></dees-input-textarea>
|
|
83083
83127
|
</dees-form>`,
|
|
83084
83128
|
menuOptions: [{ name: "Read the details", action: /* @__PURE__ */ __name(async (stepper) => stepper?.goNext(), "action") }]
|
|
@@ -83098,7 +83142,7 @@ var createChoiceSteps = /* @__PURE__ */ __name((finish) => {
|
|
|
83098
83142
|
content: b`<dees-form @formData=${(event) => {
|
|
83099
83143
|
source = event.detail.data.source || source;
|
|
83100
83144
|
}}>
|
|
83101
|
-
<dees-input-radiogroup key="source" label="
|
|
83145
|
+
<dees-input-radiogroup key="source" aria-label="How do you want to bring in the details?" selectedOption="manual" .options=${[
|
|
83102
83146
|
{ key: "manual", option: "Enter the details yourself", description: "Type the name and whatever else you know." },
|
|
83103
83147
|
{ key: "text", option: "Read them from a text", description: "Paste a signature or a letterhead; a language model picks out the details." },
|
|
83104
83148
|
{ key: "website", option: "Read them from a website", description: "Give the address of an imprint page; a language model reads it." }
|
|
@@ -83195,7 +83239,7 @@ var _DeesDemoStepper = class _DeesDemoStepper extends (_a118 = DeesElement, _sce
|
|
|
83195
83239
|
</div>` : b`<dees-stepper .steps=${this.steps} .layout=${this.stepperLayout()} .cardAlign=${this.stepperAlign()} .stepCounter=${this.scenario === "Lookup" ? "position" : "total"} .beforeClose=${this.beforeClose} @stepper-close=${() => {
|
|
83196
83240
|
this.closed = true;
|
|
83197
83241
|
}}></dees-stepper>`}</div>
|
|
83198
|
-
<p class="caption">${this.scenario === "Retry example" ? "The first setup attempt pauses with an error. Try again to continue with your saved choices." : this.scenario === "Lookup" ? "The counter says only where you are and the ribbon fades out after it; the lookup is not a step of its own and can be stopped while it runs. Discard asks first, and only Discard waits for the answer." : this.scenario === "Choice first" ? "The first step asks how; the steps after it follow the answer. Entering the details takes one more step; reading them from a text or a website reads first and then shows what was read for checking. Cancelling closes at once until something was read, and asks first after that. Centred stands the card in the middle of the stage, as a flow with a tab of its own would." : this.scenario === "Long flow" ? "More steps than the ribbon has room for: it scrolls and keeps the current marker in view. Use a completed marker to go back." : "Move forward, go back with Back or a completed marker in the ribbon, and review your choices. Vertical, and Auto on a narrow surface, show the ribbon as a strip above the steps, and the steps slide sideways. Centred stands the card in the middle of the stage."}</p>
|
|
83242
|
+
<p class="caption">${this.scenario === "Retry example" ? "The first setup attempt pauses with an error. Try again to continue with your saved choices." : this.scenario === "Lookup" ? "The counter says only where you are and the ribbon fades out after it; the lookup is not a step of its own and can be stopped while it runs. Discard asks first, and only Discard waits for the answer." : this.scenario === "Choice first" ? "The first step asks how; the steps after it follow the answer. Entering the details takes one more step; reading them from a text or a website reads first and then shows what was read for checking. A text that names no email address or phone number stays on its step: the field says why and takes the focus. Cancelling closes at once until something was read, and asks first after that. Centred stands the card in the middle of the stage, as a flow with a tab of its own would." : this.scenario === "Long flow" ? "More steps than the ribbon has room for: it scrolls and keeps the current marker in view. Use a completed marker to go back." : "Move forward, go back with Back or a completed marker in the ribbon, and review your choices. Vertical, and Auto on a narrow surface, show the ribbon as a strip above the steps, and the steps slide sideways. Centred stands the card in the middle of the stage."}</p>
|
|
83199
83243
|
<details><summary class="caption">Completion required</summary>
|
|
83200
83244
|
<p class="caption">For a flow that must finish, such as a required update, cancellation can be disabled.</p>
|
|
83201
83245
|
<dees-button type="secondary" text="Open required setup" @clicked=${() => this.openOverlay(false)}></dees-button>
|
|
@@ -84210,9 +84254,10 @@ var _DeesStepper = class _DeesStepper extends (_a119 = DeesElement, _steps_dec =
|
|
|
84210
84254
|
/**
|
|
84211
84255
|
* Click handler for menuOption buttons in the footer. For the primary (last)
|
|
84212
84256
|
* button, if an active form is present, gates on required-field validity and
|
|
84213
|
-
* triggers the form's gatherAndDispatch() before running the action
|
|
84214
|
-
*
|
|
84215
|
-
*
|
|
84257
|
+
* triggers the form's gatherAndDispatch() before running the action; when a
|
|
84258
|
+
* field refuses there, the field reports why and takes the focus, and the
|
|
84259
|
+
* action does not run. The action is awaited so any async work it starts (a
|
|
84260
|
+
* save, a question) completes before the click handler returns.
|
|
84216
84261
|
*/
|
|
84217
84262
|
async handleMenuOptionClick(optionArg, isPrimary) {
|
|
84218
84263
|
if (this.actionPending || isPrimary && this.progressRunning) return;
|
|
@@ -84225,7 +84270,7 @@ var _DeesStepper = class _DeesStepper extends (_a119 = DeesElement, _steps_dec =
|
|
|
84225
84270
|
this.actionStep = step;
|
|
84226
84271
|
this.stepError = "";
|
|
84227
84272
|
try {
|
|
84228
|
-
if (isPrimary && form
|
|
84273
|
+
if (isPrimary && form && !await form.gatherAndDispatch()) return;
|
|
84229
84274
|
if (!this.isConnected || step !== this.selectedStep) return;
|
|
84230
84275
|
await optionArg.action(this);
|
|
84231
84276
|
} catch (error) {
|
|
@@ -120676,7 +120721,7 @@ var bright = {
|
|
|
120676
120721
|
// ts_web/00_commitinfo_data.ts
|
|
120677
120722
|
var commitinfo = {
|
|
120678
120723
|
name: "@design.estate/dees-catalog",
|
|
120679
|
-
version: "21.30.
|
|
120724
|
+
version: "21.30.1",
|
|
120680
120725
|
description: "A comprehensive library that provides dynamic web components for building sophisticated and modern web applications using JavaScript and TypeScript."
|
|
120681
120726
|
};
|
|
120682
120727
|
export {
|