@aurodesignsystem-dev/auro-formkit 0.0.0-pr1474.3 → 0.0.0-pr1475.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/components/bibtemplate/dist/auro-bibtemplate.d.ts +7 -0
- package/components/bibtemplate/dist/index.js +9 -1
- package/components/bibtemplate/dist/registered.js +9 -1
- package/components/checkbox/demo/customize.html +2 -1
- package/components/checkbox/demo/customize.min.js +1 -1
- package/components/checkbox/demo/getting-started.min.js +1 -1
- package/components/checkbox/demo/index.min.js +1 -1
- package/components/checkbox/dist/index.js +1 -1
- package/components/checkbox/dist/registered.js +1 -1
- package/components/combobox/demo/customize.html +2 -1
- package/components/combobox/demo/customize.md +130 -106
- package/components/combobox/demo/customize.min.js +209 -16
- package/components/combobox/demo/getting-started.min.js +209 -16
- package/components/combobox/demo/index.min.js +209 -16
- package/components/combobox/dist/index.js +209 -16
- package/components/combobox/dist/registered.js +209 -16
- package/components/counter/demo/customize.min.js +208 -15
- package/components/counter/demo/index.min.js +208 -15
- package/components/counter/demo/keyboard-behavior.md +1 -0
- package/components/counter/dist/index.js +10 -2
- package/components/counter/dist/registered.js +10 -2
- package/components/datepicker/demo/accessibility.md +51 -3
- package/components/datepicker/demo/api.md +9 -0
- package/components/datepicker/demo/customize.html +2 -0
- package/components/datepicker/demo/customize.js +19 -0
- package/components/datepicker/demo/customize.md +72 -8
- package/components/datepicker/demo/customize.min.js +25690 -0
- package/components/datepicker/demo/design.md +3 -1
- package/components/datepicker/demo/index.js +2 -1
- package/components/datepicker/demo/index.md +81 -1
- package/components/datepicker/demo/index.min.js +1223 -101
- package/components/datepicker/demo/keyboard-behavior.md +201 -2
- package/components/datepicker/demo/voiceover.md +19 -12
- package/components/datepicker/dist/index.js +1155 -104
- package/components/datepicker/dist/registered.js +1155 -104
- package/components/datepicker/dist/src/auro-calendar-cell.d.ts +59 -0
- package/components/datepicker/dist/src/auro-calendar-month.d.ts +28 -0
- package/components/datepicker/dist/src/auro-calendar.d.ts +84 -0
- package/components/datepicker/dist/src/auro-datepicker.d.ts +80 -0
- package/components/datepicker/dist/src/datepickerKeyboardStrategy.d.ts +5 -3
- package/components/dropdown/demo/accessibility.md +11 -0
- package/components/dropdown/demo/api.md +1 -0
- package/components/dropdown/demo/customize.md +3 -0
- package/components/dropdown/demo/customize.min.js +198 -13
- package/components/dropdown/demo/getting-started.min.js +198 -13
- package/components/dropdown/demo/index.min.js +198 -13
- package/components/dropdown/demo/keyboard-behavior.md +1 -0
- package/components/dropdown/dist/auro-dropdown.d.ts +30 -1
- package/components/dropdown/dist/index.js +198 -13
- package/components/dropdown/dist/registered.js +198 -13
- package/components/form/demo/customize.html +6 -6
- package/components/form/demo/customize.js +0 -17
- package/components/form/demo/customize.md +51 -125
- package/components/form/demo/customize.min.js +1776 -327
- package/components/form/demo/getting-started.min.js +1776 -291
- package/components/form/demo/index.min.js +1776 -291
- package/components/form/demo/registerDemoDeps.min.js +1769 -139
- package/components/form/dist/auro-form.d.ts +5 -45
- package/components/form/dist/index.js +7 -152
- package/components/form/dist/registered.js +7 -152
- package/components/input/demo/customize.html +2 -1
- package/components/input/demo/customize.min.js +1 -1
- package/components/input/demo/getting-started.min.js +1 -1
- package/components/input/demo/index.min.js +1 -1
- package/components/input/dist/index.js +1 -1
- package/components/input/dist/registered.js +1 -1
- package/components/radio/demo/customize.min.js +2186 -0
- package/components/radio/demo/demo-support.min.js +55807 -0
- package/components/radio/demo/getting-started.js +1 -1
- package/components/radio/demo/getting-started.md +1 -1
- package/components/radio/demo/getting-started.min.js +2205 -0
- package/components/radio/demo/index.min.js +1 -1
- package/components/radio/dist/index.js +1 -1
- package/components/radio/dist/registered.js +1 -1
- package/components/select/demo/customize.html +2 -2
- package/components/select/demo/customize.min.js +208 -15
- package/components/select/demo/getting-started.min.js +208 -15
- package/components/select/demo/index.min.js +208 -15
- package/components/select/demo/keyboard-behavior.md +1 -0
- package/components/select/dist/index.js +208 -15
- package/components/select/dist/registered.js +208 -15
- package/custom-elements.json +2130 -1518
- package/package.json +2 -2
|
@@ -3243,7 +3243,7 @@ function applyKeyboardStrategy(component, strategy, options = {}) {
|
|
|
3243
3243
|
});
|
|
3244
3244
|
}
|
|
3245
3245
|
|
|
3246
|
-
var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
|
|
3246
|
+
var styleCss$2 = css`:host{position:fixed;z-index:var(--depth-tooltip, 400);display:none;isolation:isolate}:host dialog{width:auto;max-width:none;height:auto;max-height:none;padding:0;border:none;margin:0;outline:none;transform:translateZ(0)}:host dialog::backdrop{background:transparent}:host(:not([isfullscreen])) dialog{position:relative;inset:unset}:host(:not([isfullscreen])) .container.shape-box{border-radius:unset}:host(:not([isfullscreen])) .container[class*=shape-pill],:host(:not([isfullscreen])) .container[class*=shape-snowflake]{border-radius:30px}:host(:not([isfullscreen])) .container[class*=shape-rounded]{border-radius:16px}:host([desktopmodal]:popover-open)::backdrop{background:transparent}:host(:not([matchWidth])) .container{min-width:fit-content}:host([isfullscreen]){position:fixed;top:0;left:0}:host([isfullscreen]) .container{width:100dvw;max-width:none;height:100dvh;max-height:none;border-radius:unset;margin-top:0;box-shadow:unset;overscroll-behavior:contain}:host([isfullscreen]) .container::backdrop{background:var(--ds-color-background-primary, #fff)}:host(:popover-open){position:fixed;overflow:visible;padding:0;border:none;margin:0;background:transparent;inset:unset;outline:none}:host([data-show]){display:flex}:host([common]:not([isfullscreen])) .container,:host([rounded]:not([isfullscreen])) .container{border-radius:var(--ds-border-radius, 0.375rem)}:host([common][isfullscreen]) .container,:host([rounded][isfullscreen]) .container{border-radius:unset;box-shadow:unset}.container{display:inline-block;overflow:auto;box-sizing:border-box;border-radius:var(--ds-border-radius, 0.375rem);margin:var(--ds-size-50, 0.25rem) 0}.util_displayHiddenVisually{position:absolute;overflow:hidden;width:1px;height:1px;padding:0;border:0;margin:-1px;clip-path:inset(50%);white-space:nowrap}`;
|
|
3247
3247
|
|
|
3248
3248
|
var colorCss$2 = css`.container{background-color:var(--ds-auro-dropdownbib-container-color);box-shadow:var(--ds-auro-dropdownbib-boxshadow-color);color:var(--ds-auro-dropdownbib-text-color)}`;
|
|
3249
3249
|
|
|
@@ -3874,7 +3874,7 @@ class AuroHelpText extends LitElement {
|
|
|
3874
3874
|
}
|
|
3875
3875
|
}
|
|
3876
3876
|
|
|
3877
|
-
var formkitVersion = '
|
|
3877
|
+
var formkitVersion = '202605182147';
|
|
3878
3878
|
|
|
3879
3879
|
class AuroElement extends LitElement {
|
|
3880
3880
|
static get properties() {
|
|
@@ -4054,6 +4054,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4054
4054
|
_intializeDefaults() {
|
|
4055
4055
|
this.appearance = 'default';
|
|
4056
4056
|
this.chevron = false;
|
|
4057
|
+
this.desktopModal = false;
|
|
4057
4058
|
this.disabled = false;
|
|
4058
4059
|
this.disableKeyboardHandling = false;
|
|
4059
4060
|
this.error = false;
|
|
@@ -4234,6 +4235,14 @@ class AuroDropdown extends AuroElement {
|
|
|
4234
4235
|
reflect: true
|
|
4235
4236
|
},
|
|
4236
4237
|
|
|
4238
|
+
/**
|
|
4239
|
+
* If declared, the dropdown will behave as a modal dialog when in a desktop viewport size.
|
|
4240
|
+
*/
|
|
4241
|
+
desktopModal: {
|
|
4242
|
+
type: Boolean,
|
|
4243
|
+
reflect: true
|
|
4244
|
+
},
|
|
4245
|
+
|
|
4237
4246
|
/**
|
|
4238
4247
|
* If declared, the dropdown will only show by calling the API .show() public method.
|
|
4239
4248
|
*/
|
|
@@ -4521,6 +4530,15 @@ class AuroDropdown extends AuroElement {
|
|
|
4521
4530
|
|
|
4522
4531
|
disconnectedCallback() {
|
|
4523
4532
|
super.disconnectedCallback();
|
|
4533
|
+
this._clearPageInert();
|
|
4534
|
+
if (this._bibTabHandler) {
|
|
4535
|
+
this.removeEventListener('keydown', this._bibTabHandler);
|
|
4536
|
+
this._bibTabHandler = undefined;
|
|
4537
|
+
}
|
|
4538
|
+
if (this.focusTrap) {
|
|
4539
|
+
this.focusTrap.disconnect();
|
|
4540
|
+
this.focusTrap = undefined;
|
|
4541
|
+
}
|
|
4524
4542
|
if (this.floater) {
|
|
4525
4543
|
this.floater.hideBib('disconnect');
|
|
4526
4544
|
this.floater.disconnect();
|
|
@@ -4548,19 +4566,34 @@ class AuroDropdown extends AuroElement {
|
|
|
4548
4566
|
if (this.isPopoverVisible) {
|
|
4549
4567
|
// Fullscreen: use showModal() for native accessibility (inert outside, focus trap)
|
|
4550
4568
|
// Desktop: use show() for Floating UI positioning + FocusTrap for focus management
|
|
4551
|
-
|
|
4552
|
-
this.
|
|
4569
|
+
this.bibElement.value.open(this.isBibFullscreen);
|
|
4570
|
+
this.updateFocusTrap();
|
|
4571
|
+
|
|
4572
|
+
// Desktop modal: make siblings inert so content outside is not interactive
|
|
4573
|
+
if (this.desktopModal && !this.isBibFullscreen) {
|
|
4574
|
+
this._setPageInert();
|
|
4575
|
+
}
|
|
4553
4576
|
} else {
|
|
4554
4577
|
this.bibElement.value.close();
|
|
4578
|
+
this._clearPageInert();
|
|
4555
4579
|
}
|
|
4556
4580
|
}
|
|
4557
4581
|
|
|
4558
4582
|
// When fullscreen strategy changes while open, re-open dialog with correct mode
|
|
4559
4583
|
// (e.g. resizing from desktop → mobile while dropdown is open)
|
|
4560
4584
|
if (changedProperties.has('isBibFullscreen') && this.isPopoverVisible && this.bibElement.value) {
|
|
4561
|
-
const useModal = this.isBibFullscreen;
|
|
4562
4585
|
this.bibElement.value.close();
|
|
4563
|
-
this.bibElement.value.open(
|
|
4586
|
+
this.bibElement.value.open(this.isBibFullscreen);
|
|
4587
|
+
|
|
4588
|
+
// Re-initialize focus management for the new strategy
|
|
4589
|
+
this.updateFocusTrap();
|
|
4590
|
+
|
|
4591
|
+
// Toggle inert: desktop modal needs it, fullscreen showModal() handles it natively
|
|
4592
|
+
if (this.desktopModal && !this.isBibFullscreen) {
|
|
4593
|
+
this._setPageInert();
|
|
4594
|
+
} else {
|
|
4595
|
+
this._clearPageInert();
|
|
4596
|
+
}
|
|
4564
4597
|
}
|
|
4565
4598
|
}
|
|
4566
4599
|
|
|
@@ -4570,8 +4603,14 @@ class AuroDropdown extends AuroElement {
|
|
|
4570
4603
|
* @param {CustomEvent} event - The custom event that contains the dropdown toggle information.
|
|
4571
4604
|
*/
|
|
4572
4605
|
handleDropdownToggle(event) {
|
|
4573
|
-
this.updateFocusTrap();
|
|
4574
4606
|
this.isPopoverVisible = event.detail.expanded;
|
|
4607
|
+
|
|
4608
|
+
// Tear down FocusTrap when closing. Creation happens in updated()
|
|
4609
|
+
// after the dialog is open so getFocusableElements can find content.
|
|
4610
|
+
if (!this.isPopoverVisible) {
|
|
4611
|
+
this.updateFocusTrap();
|
|
4612
|
+
}
|
|
4613
|
+
|
|
4575
4614
|
const eventType = event.detail.eventType || "unknown";
|
|
4576
4615
|
if (!this.isPopoverVisible && this.hasFocus && eventType === "keydown") {
|
|
4577
4616
|
this.trigger.focus();
|
|
@@ -4670,19 +4709,164 @@ class AuroDropdown extends AuroElement {
|
|
|
4670
4709
|
* @private
|
|
4671
4710
|
*/
|
|
4672
4711
|
updateFocusTrap() {
|
|
4712
|
+
// Always clean up existing handlers/traps before setting up new ones
|
|
4713
|
+
// to prevent duplicate listeners on repeated calls.
|
|
4714
|
+
if (this._bibTabHandler) {
|
|
4715
|
+
this.removeEventListener('keydown', this._bibTabHandler);
|
|
4716
|
+
this._bibTabHandler = undefined;
|
|
4717
|
+
}
|
|
4718
|
+
|
|
4719
|
+
if (this.focusTrap) {
|
|
4720
|
+
this.focusTrap.disconnect();
|
|
4721
|
+
this.focusTrap = undefined;
|
|
4722
|
+
}
|
|
4723
|
+
|
|
4673
4724
|
if (this.isPopoverVisible) {
|
|
4674
4725
|
if (!this.isBibFullscreen) {
|
|
4675
|
-
|
|
4676
|
-
|
|
4677
|
-
|
|
4726
|
+
if (this.desktopModal) {
|
|
4727
|
+
// Desktop modal: trap focus only within the bib content.
|
|
4728
|
+
// Can't use FocusTrap on the bib element because keydown events
|
|
4729
|
+
// from slotted content bubble through the dropdown host (light DOM),
|
|
4730
|
+
// not through the bib (shadow projection target). Using FocusTrap
|
|
4731
|
+
// on the dropdown would include the trigger in the tab cycle.
|
|
4732
|
+
// Instead, listen for Tab on the dropdown and manually wrap focus
|
|
4733
|
+
// within the bib's focusable elements.
|
|
4734
|
+
this._bibTabHandler = (event) => {
|
|
4735
|
+
if (event.key !== 'Tab') {
|
|
4736
|
+
return;
|
|
4737
|
+
}
|
|
4738
|
+
|
|
4739
|
+
// Collect focusable elements from the bib content.
|
|
4740
|
+
const focusables = getFocusableElements(this.bibContent);
|
|
4741
|
+
|
|
4742
|
+
// Fallback: try from slotted content directly
|
|
4743
|
+
if (!focusables.length) {
|
|
4744
|
+
const slot = this.shadowRoot.querySelector('.slotContent slot');
|
|
4745
|
+
const assignedNodes = slot ? slot.assignedNodes({ flatten: true }) : [];
|
|
4746
|
+
|
|
4747
|
+
for (const node of assignedNodes) {
|
|
4748
|
+
if (node.nodeType === Node.ELEMENT_NODE) {
|
|
4749
|
+
focusables.push(...getFocusableElements(node));
|
|
4750
|
+
}
|
|
4751
|
+
}
|
|
4752
|
+
}
|
|
4753
|
+
|
|
4754
|
+
if (!focusables.length) {
|
|
4755
|
+
return;
|
|
4756
|
+
}
|
|
4757
|
+
|
|
4758
|
+
event.preventDefault();
|
|
4759
|
+
|
|
4760
|
+
const direction = event.shiftKey ? -1 : 1; // eslint-disable-line no-magic-numbers
|
|
4761
|
+
|
|
4762
|
+
// Walk the active element chain through shadow roots
|
|
4763
|
+
const actives = this._getActiveElements();
|
|
4764
|
+
|
|
4765
|
+
let idx = focusables.findIndex((el) => actives.includes(el));
|
|
4766
|
+
|
|
4767
|
+
if (idx === -1) { // eslint-disable-line no-magic-numbers
|
|
4768
|
+
// Focus is not on a known element — move to first/last
|
|
4769
|
+
idx = direction === 1 ? -1 : focusables.length; // eslint-disable-line no-magic-numbers
|
|
4770
|
+
}
|
|
4771
|
+
|
|
4772
|
+
// Try each element in order, skipping any that can't receive focus
|
|
4773
|
+
// (e.g. hidden elements, elements in collapsed sections)
|
|
4774
|
+
for (let index = 0; index < focusables.length; index++) { // eslint-disable-line no-plusplus
|
|
4775
|
+
let nextIdx = idx + direction;
|
|
4776
|
+
|
|
4777
|
+
// Wrap around
|
|
4778
|
+
if (nextIdx < 0) {
|
|
4779
|
+
nextIdx = focusables.length - 1;
|
|
4780
|
+
} else if (nextIdx >= focusables.length) {
|
|
4781
|
+
nextIdx = 0;
|
|
4782
|
+
}
|
|
4783
|
+
|
|
4784
|
+
focusables[nextIdx].focus();
|
|
4785
|
+
|
|
4786
|
+
// Verify focus actually moved to the target
|
|
4787
|
+
const newActives = this._getActiveElements();
|
|
4788
|
+
|
|
4789
|
+
if (newActives.includes(focusables[nextIdx])) {
|
|
4790
|
+
return;
|
|
4791
|
+
}
|
|
4792
|
+
|
|
4793
|
+
// Focus didn't stick — skip this element and try the next
|
|
4794
|
+
idx = nextIdx;
|
|
4795
|
+
}
|
|
4796
|
+
};
|
|
4797
|
+
this.addEventListener('keydown', this._bibTabHandler);
|
|
4798
|
+
} else {
|
|
4799
|
+
// Normal desktop: use FocusTrap on the bib element
|
|
4800
|
+
this.focusTrap = new FocusTrap(this.bibContent);
|
|
4801
|
+
this.focusTrap.focusFirstElement();
|
|
4802
|
+
}
|
|
4678
4803
|
}
|
|
4679
4804
|
// Fullscreen: showModal() provides native focus trapping
|
|
4805
|
+
}
|
|
4806
|
+
}
|
|
4807
|
+
|
|
4808
|
+
/**
|
|
4809
|
+
* Returns the chain of active (focused) elements through shadow roots.
|
|
4810
|
+
* @private
|
|
4811
|
+
* @returns {Array<HTMLElement>}
|
|
4812
|
+
*/
|
|
4813
|
+
_getActiveElements() {
|
|
4814
|
+
let { activeElement } = document;
|
|
4815
|
+
const actives = [activeElement];
|
|
4816
|
+
|
|
4817
|
+
while (activeElement?.shadowRoot?.activeElement) {
|
|
4818
|
+
activeElement = activeElement.shadowRoot.activeElement;
|
|
4819
|
+
actives.push(activeElement);
|
|
4820
|
+
}
|
|
4821
|
+
|
|
4822
|
+
return actives;
|
|
4823
|
+
}
|
|
4824
|
+
|
|
4825
|
+
/**
|
|
4826
|
+
* Sets `inert` on sibling elements of the dropdown's top-level host
|
|
4827
|
+
* so that content outside the dropdown is not interactive while the modal is open.
|
|
4828
|
+
* Walks up through shadow DOM boundaries to find the outermost host element
|
|
4829
|
+
* in the light DOM, then sets `inert` on that element's siblings.
|
|
4830
|
+
* @private
|
|
4831
|
+
*/
|
|
4832
|
+
_setPageInert() {
|
|
4833
|
+
if (this._inertSiblings) {
|
|
4680
4834
|
return;
|
|
4681
4835
|
}
|
|
4682
4836
|
|
|
4683
|
-
|
|
4684
|
-
|
|
4685
|
-
|
|
4837
|
+
this._inertSiblings = [];
|
|
4838
|
+
|
|
4839
|
+
// Walk up through shadow DOM boundaries to find the topmost host
|
|
4840
|
+
// element in the light DOM. For example, if this dropdown is inside
|
|
4841
|
+
// auro-datepicker's shadow DOM, we walk up to the datepicker element
|
|
4842
|
+
// so we set inert on its siblings — not on the datepicker itself.
|
|
4843
|
+
let host = this;
|
|
4844
|
+
while (host.getRootNode() instanceof ShadowRoot) {
|
|
4845
|
+
host = host.getRootNode().host;
|
|
4846
|
+
}
|
|
4847
|
+
|
|
4848
|
+
const parent = host.parentElement;
|
|
4849
|
+
|
|
4850
|
+
if (parent) {
|
|
4851
|
+
for (const sibling of parent.children) {
|
|
4852
|
+
if (sibling !== host && !sibling.inert) {
|
|
4853
|
+
sibling.inert = true;
|
|
4854
|
+
this._inertSiblings.push(sibling);
|
|
4855
|
+
}
|
|
4856
|
+
}
|
|
4857
|
+
}
|
|
4858
|
+
}
|
|
4859
|
+
|
|
4860
|
+
/**
|
|
4861
|
+
* Restores `inert` state on siblings that were made inert by `_setPageInert`.
|
|
4862
|
+
* @private
|
|
4863
|
+
*/
|
|
4864
|
+
_clearPageInert() {
|
|
4865
|
+
if (this._inertSiblings) {
|
|
4866
|
+
for (const sibling of this._inertSiblings) {
|
|
4867
|
+
sibling.inert = false;
|
|
4868
|
+
}
|
|
4869
|
+
this._inertSiblings = undefined;
|
|
4686
4870
|
}
|
|
4687
4871
|
}
|
|
4688
4872
|
|
|
@@ -4921,6 +5105,7 @@ class AuroDropdown extends AuroElement {
|
|
|
4921
5105
|
shape="${this.shape}"
|
|
4922
5106
|
?data-show="${this.isPopoverVisible}"
|
|
4923
5107
|
?isfullscreen="${this.isBibFullscreen}"
|
|
5108
|
+
?desktopmodal="${this.desktopModal}"
|
|
4924
5109
|
.dialogLabel="${this.bibDialogLabel}"
|
|
4925
5110
|
${ref(this.bibElement)}
|
|
4926
5111
|
>
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
<body class="auro-markdown">
|
|
37
37
|
<main></main>
|
|
38
38
|
|
|
39
|
+
<script type="module">
|
|
40
|
+
import { renderPage } from './demo-support.min.js';
|
|
41
|
+
await renderPage('./customize.md');
|
|
42
|
+
</script>
|
|
43
|
+
|
|
39
44
|
<!-- If additional elements are needed for the demo, add them here. -->
|
|
40
45
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-accordion@latest/+esm" type="module"></script>
|
|
41
46
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-nav@latest/+esm" type="module"></script>
|
|
@@ -44,11 +49,6 @@
|
|
|
44
49
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-button@latest/+esm" type="module"></script>
|
|
45
50
|
<script src="https://cdn.jsdelivr.net/npm/@aurodesignsystem/auro-icon@latest/+esm" type="module"></script>
|
|
46
51
|
|
|
47
|
-
<script
|
|
48
|
-
import { renderPage } from './demo-support.min.js';
|
|
49
|
-
await renderPage('./customize.md');
|
|
50
|
-
import { initExamples } from "./customize.min.js";
|
|
51
|
-
initExamples();
|
|
52
|
-
</script>
|
|
52
|
+
<script src="./customize.min.js" data-demo-script="true" type="module"></script>
|
|
53
53
|
</body>
|
|
54
54
|
</html>
|
|
@@ -1,26 +1,9 @@
|
|
|
1
|
-
/* eslint-disable jsdoc/require-jsdoc */
|
|
2
|
-
|
|
3
1
|
import { AuroForm } from '../src/auro-form.js';
|
|
4
2
|
import './registerDemoDeps.js';
|
|
5
3
|
import { AuroInput } from '@aurodesignsystem/auro-input';
|
|
6
4
|
import { AuroDatePicker } from '@aurodesignsystem/auro-datepicker';
|
|
7
|
-
import { disabledExample } from '../apiExamples/disabled.js';
|
|
8
5
|
|
|
9
6
|
AuroInput.register('input-two');
|
|
10
7
|
AuroDatePicker.register();
|
|
11
8
|
AuroForm.register();
|
|
12
9
|
AuroForm.register('custom-form');
|
|
13
|
-
|
|
14
|
-
export async function initExamples(initCount) {
|
|
15
|
-
initCount = initCount || 0;
|
|
16
|
-
|
|
17
|
-
try {
|
|
18
|
-
await disabledExample();
|
|
19
|
-
} catch (err) {
|
|
20
|
-
if (initCount <= 20) {
|
|
21
|
-
setTimeout(() => {
|
|
22
|
-
initExamples(initCount + 1);
|
|
23
|
-
}, 100);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
@@ -7,8 +7,6 @@
|
|
|
7
7
|
<auro-anchorlink fluid href="#layout">Layout</auro-anchorlink>
|
|
8
8
|
<auro-anchorlink fluid href="#columnLayout" class="level2 body-xs">Column Layout</auro-anchorlink>
|
|
9
9
|
<auro-anchorlink fluid href="#complexForm" class="level2 body-xs">Complex Form</auro-anchorlink>
|
|
10
|
-
<auro-anchorlink fluid href="#fieldState">Field State</auro-anchorlink>
|
|
11
|
-
<auro-anchorlink fluid href="#disabledFields" class="level2 body-xs">Disabled Fields</auro-anchorlink>
|
|
12
10
|
</auro-nav>
|
|
13
11
|
</nav>
|
|
14
12
|
<div class="mainContent">
|
|
@@ -26,14 +24,16 @@
|
|
|
26
24
|
display: grid;
|
|
27
25
|
grid-template-columns: 1fr 1fr;
|
|
28
26
|
gap: 1rem;
|
|
29
|
-
align-items: start;
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
.columned-form
|
|
33
|
-
|
|
29
|
+
.columned-form div {
|
|
30
|
+
display: flex;
|
|
31
|
+
flex-direction: column;
|
|
32
|
+
padding: 1rem;
|
|
33
|
+
gap: 1rem;
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
.
|
|
36
|
+
.controls {
|
|
37
37
|
display: flex;
|
|
38
38
|
justify-content: flex-end;
|
|
39
39
|
margin-top: 1rem;
|
|
@@ -41,25 +41,29 @@
|
|
|
41
41
|
</style>
|
|
42
42
|
<auro-form>
|
|
43
43
|
<div class="columned-form">
|
|
44
|
-
<
|
|
45
|
-
<
|
|
44
|
+
<div>
|
|
45
|
+
<auro-input id="search-box" name="searchBox" required>
|
|
46
|
+
<span slot="label">Search flights</span>
|
|
46
47
|
</auro-input>
|
|
47
|
-
<auro-input id="
|
|
48
|
+
<auro-input id="last-name" name="lastName" required>
|
|
48
49
|
<span slot="label">Last Name</span>
|
|
49
|
-
</auro-input>
|
|
50
|
-
|
|
51
|
-
<
|
|
52
|
-
|
|
53
|
-
<
|
|
54
|
-
<
|
|
55
|
-
<span slot="
|
|
56
|
-
<span slot="
|
|
57
|
-
<span slot="bib.fullscreen.
|
|
50
|
+
</auro-input>
|
|
51
|
+
</div>
|
|
52
|
+
<div>
|
|
53
|
+
<div class="datepickerBlock">
|
|
54
|
+
<h4>Pick a date range</h4>
|
|
55
|
+
<auro-datepicker id="date-range" name="dateRange" required range>
|
|
56
|
+
<span slot="fromLabel">Start</span>
|
|
57
|
+
<span slot="toLabel">End</span>
|
|
58
|
+
<span slot="bib.fullscreen.fromLabel">Start</span>
|
|
59
|
+
<span slot="bib.fullscreen.toLabel">End</span>
|
|
58
60
|
</auro-datepicker>
|
|
59
61
|
</div>
|
|
60
|
-
<div class="
|
|
62
|
+
<div class="controls">
|
|
61
63
|
<auro-button type="submit">Submit</auro-button>
|
|
62
64
|
</div>
|
|
65
|
+
</div>
|
|
66
|
+
</div>
|
|
63
67
|
</auro-form>
|
|
64
68
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
65
69
|
</div>
|
|
@@ -72,14 +76,16 @@
|
|
|
72
76
|
display: grid;
|
|
73
77
|
grid-template-columns: 1fr 1fr;
|
|
74
78
|
gap: 1rem;
|
|
75
|
-
align-items: start;
|
|
76
79
|
}
|
|
77
80
|
|
|
78
|
-
.columned-form
|
|
79
|
-
|
|
81
|
+
.columned-form div {
|
|
82
|
+
display: flex;
|
|
83
|
+
flex-direction: column;
|
|
84
|
+
padding: 1rem;
|
|
85
|
+
gap: 1rem;
|
|
80
86
|
}
|
|
81
87
|
|
|
82
|
-
.
|
|
88
|
+
.controls {
|
|
83
89
|
display: flex;
|
|
84
90
|
justify-content: flex-end;
|
|
85
91
|
margin-top: 1rem;
|
|
@@ -87,24 +93,28 @@
|
|
|
87
93
|
</style>
|
|
88
94
|
<auro-form>
|
|
89
95
|
<div class="columned-form">
|
|
90
|
-
<
|
|
91
|
-
<
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
<
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
<
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
96
|
+
<div>
|
|
97
|
+
<auro-input id="search-box" name="searchBox" required>
|
|
98
|
+
<span slot="label">Search flights</span>
|
|
99
|
+
</auro-input>
|
|
100
|
+
<auro-input id="last-name" name="lastName" required>
|
|
101
|
+
<span slot="label">Last Name</span>
|
|
102
|
+
</auro-input>
|
|
103
|
+
</div>
|
|
104
|
+
<div>
|
|
105
|
+
<div class="datepickerBlock">
|
|
106
|
+
<h4>Pick a date range</h4>
|
|
107
|
+
<auro-datepicker id="date-range" name="dateRange" required range>
|
|
108
|
+
<span slot="fromLabel">Start</span>
|
|
109
|
+
<span slot="toLabel">End</span>
|
|
110
|
+
<span slot="bib.fullscreen.fromLabel">Start</span>
|
|
111
|
+
<span slot="bib.fullscreen.toLabel">End</span>
|
|
112
|
+
</auro-datepicker>
|
|
113
|
+
</div>
|
|
114
|
+
<div class="controls">
|
|
115
|
+
<auro-button type="submit">Submit</auro-button>
|
|
116
|
+
</div>
|
|
117
|
+
</div>
|
|
108
118
|
</div>
|
|
109
119
|
</auro-form></code></pre>
|
|
110
120
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
@@ -231,90 +241,6 @@
|
|
|
231
241
|
<!-- AURO-GENERATED-CONTENT:END -->
|
|
232
242
|
</auro-accordion>
|
|
233
243
|
</section>
|
|
234
|
-
<section>
|
|
235
|
-
<auro-header level="2" id="fieldState">Field State</auro-header>
|
|
236
|
-
<p>Per the <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Attributes/disabled">HTML spec</a>, form controls with the <code>disabled</code> attribute are excluded from form submission and are not validated. <code>auro-form</code> mirrors that behavior.</p>
|
|
237
|
-
<auro-header level="3" id="disabledFields">Disabled Fields</auro-header>
|
|
238
|
-
<p>When a child form element has the <code>disabled</code> attribute:</p>
|
|
239
|
-
<ul>
|
|
240
|
-
<li>Its <code>name</code> is omitted from <code>form.value</code> and from the <code>submit</code> event's <code>detail.value</code>, even if the element carries a value.</li>
|
|
241
|
-
<li>It does not contribute to <code>validity</code> — a disabled <code>required</code> field will not block submission.</li>
|
|
242
|
-
<li>It does not taint <code>isInitialState</code> — a disabled field carrying a preset value still leaves the form in its initial state.</li>
|
|
243
|
-
</ul>
|
|
244
|
-
<p><strong>Behavior change:</strong> a form whose only invalid field was a <code>disabled</code> AND <code>required</code> field is now submittable, where previously it would have been blocked. If you were using <code>disabled</code> on a populated field to carry a value through to submission (for example, a read-only account number or a preset reference id), switch that field to <a href="https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input/hidden"><code><input type="hidden"></code></a> — hidden inputs are submitted with the form even though they are not interactive, which is the native pattern for "include this value, but don't show or validate it."</p>
|
|
245
|
-
<p>In the example below the Mileage Plan number is preset and disabled. Fill in the remaining required fields and submit the form — the output region below the form will show the contents of the <code>submit</code> event's <code>detail.value</code>. Notice that only <code>firstName</code> and <code>lastName</code> appear; <code>loyaltyNumber</code> is omitted even though the field has a value.</p>
|
|
246
|
-
<div class="exampleWrapper">
|
|
247
|
-
<!-- AURO-GENERATED-CONTENT:START (FILE:src=./../apiExamples/disabled.html) -->
|
|
248
|
-
<!-- The below content is automatically added from ./../apiExamples/disabled.html -->
|
|
249
|
-
<auro-form id="disabledExampleForm">
|
|
250
|
-
<auro-input id="first-name" name="firstName" required>
|
|
251
|
-
<span slot="label">First Name</span>
|
|
252
|
-
</auro-input>
|
|
253
|
-
<br />
|
|
254
|
-
<auro-input id="last-name" name="lastName" required>
|
|
255
|
-
<span slot="label">Last Name</span>
|
|
256
|
-
</auro-input>
|
|
257
|
-
<br />
|
|
258
|
-
<auro-input id="loyalty-number" name="loyaltyNumber" value="AS-123456" disabled>
|
|
259
|
-
<span slot="label">Mileage Plan number</span>
|
|
260
|
-
<span slot="helpText">Account number is read-only and is not submitted with the form.</span>
|
|
261
|
-
</auro-input>
|
|
262
|
-
<br />
|
|
263
|
-
<auro-button type="submit">Submit</auro-button>
|
|
264
|
-
</auro-form>
|
|
265
|
-
<output id="disabledExampleOutput" form="disabledExampleForm" aria-live="polite">Submit the form to see what data gets stored.</output>
|
|
266
|
-
<style>
|
|
267
|
-
#disabledExampleOutput {
|
|
268
|
-
display: block;
|
|
269
|
-
margin-top: 2rem;
|
|
270
|
-
padding: 1rem 1.25rem;
|
|
271
|
-
border-left: 4px solid #2a2a2a;
|
|
272
|
-
border-radius: 0.25rem;
|
|
273
|
-
background: #f5f5f5;
|
|
274
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
275
|
-
font-size: 0.875rem;
|
|
276
|
-
white-space: pre-wrap;
|
|
277
|
-
}
|
|
278
|
-
</style>
|
|
279
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
280
|
-
</div>
|
|
281
|
-
<auro-accordion alignRight>
|
|
282
|
-
<span slot="trigger">See code</span>
|
|
283
|
-
<!-- AURO-GENERATED-CONTENT:START (CODE:src=./../apiExamples/disabled.html) -->
|
|
284
|
-
<!-- The below code snippet is automatically added from ./../apiExamples/disabled.html -->
|
|
285
|
-
<pre class="language-html"><code class="language-html"><auro-form id="disabledExampleForm">
|
|
286
|
-
<auro-input id="first-name" name="firstName" required>
|
|
287
|
-
<span slot="label">First Name</span>
|
|
288
|
-
</auro-input>
|
|
289
|
-
<br />
|
|
290
|
-
<auro-input id="last-name" name="lastName" required>
|
|
291
|
-
<span slot="label">Last Name</span>
|
|
292
|
-
</auro-input>
|
|
293
|
-
<br />
|
|
294
|
-
<auro-input id="loyalty-number" name="loyaltyNumber" value="AS-123456" disabled>
|
|
295
|
-
<span slot="label">Mileage Plan number</span>
|
|
296
|
-
<span slot="helpText">Account number is read-only and is not submitted with the form.</span>
|
|
297
|
-
</auro-input>
|
|
298
|
-
<br />
|
|
299
|
-
<auro-button type="submit">Submit</auro-button>
|
|
300
|
-
</auro-form>
|
|
301
|
-
<output id="disabledExampleOutput" form="disabledExampleForm" aria-live="polite">Submit the form to see what data gets stored.</output>
|
|
302
|
-
<style>
|
|
303
|
-
#disabledExampleOutput {
|
|
304
|
-
display: block;
|
|
305
|
-
margin-top: 2rem;
|
|
306
|
-
padding: 1rem 1.25rem;
|
|
307
|
-
border-left: 4px solid #2a2a2a;
|
|
308
|
-
border-radius: 0.25rem;
|
|
309
|
-
background: #f5f5f5;
|
|
310
|
-
font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
|
|
311
|
-
font-size: 0.875rem;
|
|
312
|
-
white-space: pre-wrap;
|
|
313
|
-
}
|
|
314
|
-
</style></code></pre>
|
|
315
|
-
<!-- AURO-GENERATED-CONTENT:END -->
|
|
316
|
-
</auro-accordion>
|
|
317
|
-
</section>
|
|
318
244
|
</div>
|
|
319
245
|
</div>
|
|
320
246
|
</div>
|