@aurodesignsystem/auro-formkit 2.0.0-beta.2 → 2.0.0-beta.4
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/.turbo/cache/013a48308b893dac-meta.json +1 -1
- package/.turbo/cache/02244170c798a2bd-meta.json +1 -0
- package/.turbo/cache/02244170c798a2bd.tar.zst +0 -0
- package/.turbo/cache/051ff97a20add0e2-meta.json +1 -0
- package/.turbo/cache/051ff97a20add0e2.tar.zst +0 -0
- package/.turbo/cache/07ca42419b9f050c-meta.json +1 -1
- package/.turbo/cache/0cea4c1f34f3683b-meta.json +1 -1
- package/.turbo/cache/0ea853339c064fa1-meta.json +1 -0
- package/.turbo/cache/0ea853339c064fa1.tar.zst +0 -0
- package/.turbo/cache/16658beec9f4a809-meta.json +1 -0
- package/.turbo/cache/16658beec9f4a809.tar.zst +0 -0
- package/.turbo/cache/17259cf94d8f8925-meta.json +1 -1
- package/.turbo/cache/1b9818717e4bdf9f-meta.json +1 -0
- package/.turbo/cache/1b9818717e4bdf9f.tar.zst +0 -0
- package/.turbo/cache/1c0f580d37370ba2-meta.json +1 -0
- package/.turbo/cache/1c0f580d37370ba2.tar.zst +0 -0
- package/.turbo/cache/1c99a949ec63ab35-meta.json +1 -1
- package/.turbo/cache/1df4710eef8ed00d-meta.json +1 -0
- package/.turbo/cache/1df4710eef8ed00d.tar.zst +0 -0
- package/.turbo/cache/204b66d1b253e9cc-meta.json +1 -0
- package/.turbo/cache/204b66d1b253e9cc.tar.zst +0 -0
- package/.turbo/cache/257a7a26ea72dbc5-meta.json +1 -1
- package/.turbo/cache/2a5d0939d6fc1052-meta.json +1 -0
- package/.turbo/cache/2a5d0939d6fc1052.tar.zst +0 -0
- package/.turbo/cache/2e3b829fcf75c836-meta.json +1 -0
- package/.turbo/cache/2e3b829fcf75c836.tar.zst +0 -0
- package/.turbo/cache/3bf45120d0cc9bd8-meta.json +1 -1
- package/.turbo/cache/3d380d0d40404cac-meta.json +1 -0
- package/.turbo/cache/3d380d0d40404cac.tar.zst +0 -0
- package/.turbo/cache/3e12285c614db539-meta.json +1 -0
- package/.turbo/cache/3e12285c614db539.tar.zst +0 -0
- package/.turbo/cache/45035bf5c4147ccd-meta.json +1 -1
- package/.turbo/cache/5bf2d3f7ba5891e0-meta.json +1 -0
- package/.turbo/cache/5bf2d3f7ba5891e0.tar.zst +0 -0
- package/.turbo/cache/5f304c0f37ef25f3-meta.json +1 -1
- package/.turbo/cache/64de7a53e02db647-meta.json +1 -1
- package/.turbo/cache/691a74627ec57993-meta.json +1 -1
- package/.turbo/cache/69aae513b7ec6c7d-meta.json +1 -1
- package/.turbo/cache/6dd67d179191bda8-meta.json +1 -0
- package/.turbo/cache/6dd67d179191bda8.tar.zst +0 -0
- package/.turbo/cache/6dd7058e6703cb35-meta.json +1 -1
- package/.turbo/cache/73e9073a5274616d-meta.json +1 -1
- package/.turbo/cache/773edc0f83c8c5a5-meta.json +1 -1
- package/.turbo/cache/786a822763403879-meta.json +1 -1
- package/.turbo/cache/7e1043cffa69f327-meta.json +1 -0
- package/.turbo/cache/7e1043cffa69f327.tar.zst +0 -0
- package/.turbo/cache/7ffd501e81790676-meta.json +1 -0
- package/.turbo/cache/7ffd501e81790676.tar.zst +0 -0
- package/.turbo/cache/80a13352066a9801-meta.json +1 -0
- package/.turbo/cache/80a13352066a9801.tar.zst +0 -0
- package/.turbo/cache/80b5d974184a01df-meta.json +1 -1
- package/.turbo/cache/8954c6073396fadd-meta.json +1 -1
- package/.turbo/cache/8e79bd5c3a16a72e-meta.json +1 -0
- package/.turbo/cache/8e9ebc3df0e18de0-meta.json +1 -0
- package/.turbo/cache/8e9ebc3df0e18de0.tar.zst +0 -0
- package/.turbo/cache/92daa6d7c389d548-meta.json +1 -1
- package/.turbo/cache/973d0eea26083f4b-meta.json +1 -0
- package/.turbo/cache/973d0eea26083f4b.tar.zst +0 -0
- package/.turbo/cache/9c6ad42729c7b2d8-meta.json +1 -0
- package/.turbo/cache/9c6ad42729c7b2d8.tar.zst +0 -0
- package/.turbo/cache/a77bc920ea508bb8-meta.json +1 -1
- package/.turbo/cache/a77bc920ea508bb8.tar.zst +0 -0
- package/.turbo/cache/a9a9d012c83882d8-meta.json +1 -0
- package/.turbo/cache/a9a9d012c83882d8.tar.zst +0 -0
- package/.turbo/cache/b54fc4f664a7a5a0-meta.json +1 -1
- package/.turbo/cache/ba4418918621fbcd-meta.json +1 -1
- package/.turbo/cache/be7c23c37b8ec74b-meta.json +1 -1
- package/.turbo/cache/be7c23c37b8ec74b.tar.zst +0 -0
- package/.turbo/cache/bffc7582905c2a5e-meta.json +1 -0
- package/.turbo/cache/bffc7582905c2a5e.tar.zst +0 -0
- package/.turbo/cache/caa0b4ac8d2a04dd-meta.json +1 -1
- package/.turbo/cache/caa0b4ac8d2a04dd.tar.zst +0 -0
- package/.turbo/cache/cc81de9c0b452a7c-meta.json +1 -1
- package/.turbo/cache/d572ebb3c833e8f4-meta.json +1 -0
- package/.turbo/cache/d572ebb3c833e8f4.tar.zst +0 -0
- package/.turbo/cache/d61543843c932504-meta.json +1 -0
- package/.turbo/cache/d61543843c932504.tar.zst +0 -0
- package/.turbo/cache/dad1301ac69bcb85-meta.json +1 -1
- package/.turbo/cache/db361cb6578dca84-meta.json +1 -0
- package/.turbo/cache/db361cb6578dca84.tar.zst +0 -0
- package/.turbo/cache/dea5945f55c6aba5-meta.json +1 -0
- package/.turbo/cache/dea5945f55c6aba5.tar.zst +0 -0
- package/.turbo/cache/e992dab20aeefbaf-meta.json +1 -1
- package/.turbo/cache/e992dab20aeefbaf.tar.zst +0 -0
- package/.turbo/cache/f3ff9040a2196834-meta.json +1 -0
- package/.turbo/cache/f3ff9040a2196834.tar.zst +0 -0
- package/.turbo/cache/f817d89688cefca8-meta.json +1 -0
- package/.turbo/cache/f817d89688cefca8.tar.zst +0 -0
- package/.turbo/cache/fa132b5b5f0e75f8-meta.json +1 -1
- package/.turbo/cache/fc57c17867dcac3d-meta.json +1 -0
- package/.turbo/cache/fc57c17867dcac3d.tar.zst +0 -0
- package/CHANGELOG.md +44 -0
- package/components/checkbox/.turbo/turbo-build.log +3 -3
- package/components/checkbox/.turbo/turbo-bundler.log +3 -3
- package/components/checkbox/demo/api.md +4 -2
- package/components/checkbox/demo/api.min.js +31 -36
- package/components/checkbox/demo/index.min.js +31 -36
- package/components/checkbox/dist/auro-checkbox-group.d.ts +1 -1
- package/components/checkbox/dist/index.js +31 -36
- package/components/checkbox/src/auro-checkbox-group.js +2 -2
- package/components/combobox/.turbo/turbo-build.log +3 -3
- package/components/combobox/demo/api.md +17 -15
- package/components/combobox/demo/api.min.js +500 -218
- package/components/combobox/demo/index.min.js +500 -218
- package/components/combobox/dist/auro-combobox.d.ts +11 -4
- package/components/combobox/dist/auro-combobox.d.ts.map +1 -1
- package/components/combobox/dist/index.js +499 -217
- package/components/combobox/src/auro-combobox.js +22 -20
- package/components/counter/.turbo/turbo-build.log +3 -3
- package/components/counter/.turbo/turbo-bundler.log +3 -3
- package/components/datepicker/.turbo/turbo-build.log +9 -8
- package/components/datepicker/demo/api.md +107 -87
- package/components/datepicker/demo/api.min.js +492 -232
- package/components/datepicker/demo/index.min.js +492 -232
- package/components/datepicker/dist/auro-datepicker.d.ts +6 -13
- package/components/datepicker/dist/auro-datepicker.d.ts.map +1 -1
- package/components/datepicker/dist/index.js +492 -232
- package/components/datepicker/src/auro-datepicker.js +15 -35
- package/components/dropdown/.turbo/turbo-build.log +3 -3
- package/components/dropdown/.turbo/turbo-bundler.log +2 -2
- package/components/dropdown/demo/api.md +4 -4
- package/components/dropdown/demo/api.min.js +166 -42
- package/components/dropdown/demo/index.min.js +166 -42
- package/components/dropdown/dist/auro-dropdown.d.ts +93 -34
- package/components/dropdown/dist/auro-dropdown.d.ts.map +1 -1
- package/components/dropdown/dist/auro-dropdownBib.d.ts +9 -3
- package/components/dropdown/dist/auro-dropdownBib.d.ts.map +1 -1
- package/components/dropdown/dist/index.js +166 -42
- package/components/dropdown/src/auro-dropdown.js +154 -39
- package/components/dropdown/src/auro-dropdownBib.js +12 -3
- package/components/dropdown/src/styles/style-css.js +1 -1
- package/components/dropdown/src/styles/style.css +4 -0
- package/components/dropdown/src/styles/style.scss +5 -0
- package/components/form/.turbo/turbo-build.log +3 -3
- package/components/form/.turbo/turbo-bundler.log +3 -3
- package/components/input/.turbo/turbo-build$colon$sass.log +51 -1
- package/components/input/.turbo/turbo-build.log +56 -6
- package/components/input/.turbo/turbo-bundler.log +3 -3
- package/components/input/.turbo/turbo-sass$colon$render.log +6 -0
- package/components/input/demo/api.md +83 -81
- package/components/input/demo/api.min.js +282 -121
- package/components/input/demo/index.md +6 -6
- package/components/input/demo/index.min.js +282 -121
- package/components/input/dist/auro-input.d.ts.map +1 -1
- package/components/input/dist/base-input.d.ts +155 -84
- package/components/input/dist/base-input.d.ts.map +1 -1
- package/components/input/dist/index.js +282 -121
- package/components/input/dist/styles/mixins-css.d.ts +3 -0
- package/components/input/dist/styles/mixins-css.d.ts.map +1 -0
- package/components/input/src/auro-input.js +0 -1
- package/components/input/src/base-input.js +252 -85
- package/components/input/src/styles/borders.scss +3 -19
- package/components/input/src/styles/color.css +1 -2
- package/components/input/src/styles/color.scss +3 -10
- package/components/input/src/styles/input-css.js +1 -1
- package/components/input/src/styles/input.css +1 -1
- package/components/input/src/styles/input.scss +4 -1
- package/components/input/src/styles/label-css.js +1 -1
- package/components/input/src/styles/label.css +1 -1
- package/components/input/src/styles/label.scss +4 -7
- package/components/input/src/styles/mixins-css.js +2 -0
- package/components/input/src/styles/mixins.css +1 -0
- package/components/input/src/styles/mixins.scss +45 -0
- package/components/input/src/styles/notificationIcons-css.js +1 -1
- package/components/input/src/styles/notificationIcons.css +13 -12
- package/components/input/src/styles/notificationIcons.scss +17 -25
- package/components/input/src/styles/style-css.js +1 -1
- package/components/input/src/styles/style.css +15 -17
- package/components/input/src/styles/style.scss +0 -4
- package/components/menu/.turbo/turbo-build.log +3 -3
- package/components/menu/.turbo/turbo-bundler.log +3 -3
- package/components/menu/demo/api.min.js +1 -1
- package/components/menu/demo/index.min.js +1 -1
- package/components/menu/dist/auro-menu.d.ts +1 -1
- package/components/menu/dist/index.js +1 -1
- package/components/menu/src/auro-menu.js +1 -1
- package/components/radio/.turbo/turbo-build.log +3 -3
- package/components/radio/.turbo/turbo-bundler.log +3 -3
- package/components/radio/demo/api.md +3 -1
- package/components/radio/demo/api.min.js +30 -35
- package/components/radio/demo/index.min.js +30 -35
- package/components/radio/dist/index.js +30 -35
- package/components/radio/src/auro-radio-group.js +1 -1
- package/components/select/.turbo/turbo-build.log +7 -9
- package/components/select/demo/api.md +45 -110
- package/components/select/demo/api.min.js +320 -224
- package/components/select/demo/index.md +100 -43
- package/components/select/demo/index.min.js +320 -220
- package/components/select/dist/auro-select.d.ts +64 -51
- package/components/select/dist/auro-select.d.ts.map +1 -1
- package/components/select/dist/index.js +314 -201
- package/components/select/src/auro-select.js +100 -118
- package/components/select/src/styles/style-css.js +1 -1
- package/components/select/src/styles/style.css +7 -0
- package/components/select/src/styles/style.scss +11 -1
- package/package.json +1 -1
- package/packages/form-validation/src/validation.js +29 -34
- package/.turbo/cache/0663fcbb1d711029-meta.json +0 -1
- package/.turbo/cache/0663fcbb1d711029.tar.zst +0 -0
- package/.turbo/cache/0a2b0a4df8a0443f-meta.json +0 -1
- package/.turbo/cache/120c8e207aa1ba35-meta.json +0 -1
- package/.turbo/cache/120c8e207aa1ba35.tar.zst +0 -0
- package/.turbo/cache/17dd4bdef6550a07-meta.json +0 -1
- package/.turbo/cache/17dd4bdef6550a07.tar.zst +0 -0
- package/.turbo/cache/1de15d89eed2d760-meta.json +0 -1
- package/.turbo/cache/1de15d89eed2d760.tar.zst +0 -0
- package/.turbo/cache/2990aaa7ebc5b967-meta.json +0 -1
- package/.turbo/cache/2990aaa7ebc5b967.tar.zst +0 -0
- package/.turbo/cache/32c0b9995fb5f8dd-meta.json +0 -1
- package/.turbo/cache/32c0b9995fb5f8dd.tar.zst +0 -0
- package/.turbo/cache/47ba2b5ebdb579e9-meta.json +0 -1
- package/.turbo/cache/47ba2b5ebdb579e9.tar.zst +0 -0
- package/.turbo/cache/4f92cea2d8c63de2-meta.json +0 -1
- package/.turbo/cache/4f92cea2d8c63de2.tar.zst +0 -0
- package/.turbo/cache/56cb35d4c7473a23-meta.json +0 -1
- package/.turbo/cache/56cb35d4c7473a23.tar.zst +0 -0
- package/.turbo/cache/5c16ce3cff5c9dff-meta.json +0 -1
- package/.turbo/cache/5c16ce3cff5c9dff.tar.zst +0 -0
- package/.turbo/cache/626afdc67e0cb540-meta.json +0 -1
- package/.turbo/cache/626afdc67e0cb540.tar.zst +0 -0
- package/.turbo/cache/6ef81cf9a66f982a-meta.json +0 -1
- package/.turbo/cache/6ef81cf9a66f982a.tar.zst +0 -0
- package/.turbo/cache/784c03fe9fd5ac05-meta.json +0 -1
- package/.turbo/cache/784c03fe9fd5ac05.tar.zst +0 -0
- package/.turbo/cache/87219c41a4ace9cd-meta.json +0 -1
- package/.turbo/cache/87219c41a4ace9cd.tar.zst +0 -0
- package/.turbo/cache/8b735250fa5a62bf-meta.json +0 -1
- package/.turbo/cache/8b735250fa5a62bf.tar.zst +0 -0
- package/.turbo/cache/9154e8fe6ab767ea-meta.json +0 -1
- package/.turbo/cache/9154e8fe6ab767ea.tar.zst +0 -0
- package/.turbo/cache/993dff2edb7b6766-meta.json +0 -1
- package/.turbo/cache/993dff2edb7b6766.tar.zst +0 -0
- package/.turbo/cache/9a097d6576dadd64-meta.json +0 -1
- package/.turbo/cache/9a097d6576dadd64.tar.zst +0 -0
- package/.turbo/cache/a49cc58242467fdc-meta.json +0 -1
- package/.turbo/cache/a49cc58242467fdc.tar.zst +0 -0
- package/.turbo/cache/a6a56bb802e1c20f-meta.json +0 -1
- package/.turbo/cache/a6a56bb802e1c20f.tar.zst +0 -0
- package/.turbo/cache/af061e7a077a9ba5-meta.json +0 -1
- package/.turbo/cache/af061e7a077a9ba5.tar.zst +0 -0
- package/.turbo/cache/b50f1b283b4b81cd-meta.json +0 -1
- package/.turbo/cache/b50f1b283b4b81cd.tar.zst +0 -0
- package/.turbo/cache/bf85bc040b7e64db-meta.json +0 -1
- package/.turbo/cache/bf85bc040b7e64db.tar.zst +0 -0
- package/.turbo/cache/cd5f6987783fb56d-meta.json +0 -1
- package/.turbo/cache/cd5f6987783fb56d.tar.zst +0 -0
- package/.turbo/cache/ce67b6522dd09e64-meta.json +0 -1
- package/.turbo/cache/ce67b6522dd09e64.tar.zst +0 -0
- package/.turbo/cache/d716cb7a08152beb-meta.json +0 -1
- package/.turbo/cache/d716cb7a08152beb.tar.zst +0 -0
- package/.turbo/cache/d7a47b77deb3d9a4-meta.json +0 -1
- package/.turbo/cache/d7a47b77deb3d9a4.tar.zst +0 -0
- package/.turbo/cache/fbbe2704bf9cb90b-meta.json +0 -1
- package/.turbo/cache/fbbe2704bf9cb90b.tar.zst +0 -0
- package/.turbo/cache/ff58f630c9d69af4-meta.json +0 -1
- package/.turbo/cache/ff58f630c9d69af4.tar.zst +0 -0
- /package/.turbo/cache/{0a2b0a4df8a0443f.tar.zst → 8e79bd5c3a16a72e.tar.zst} +0 -0
|
@@ -32,10 +32,6 @@ function valueExample() {
|
|
|
32
32
|
document.querySelector('#invalidValueExampleBtn').addEventListener('click', () => {
|
|
33
33
|
valueExample.value = 'flight course';
|
|
34
34
|
});
|
|
35
|
-
|
|
36
|
-
document.querySelector('#undefinedValueExampleBtn').addEventListener('click', () => {
|
|
37
|
-
valueExample.value = undefined;
|
|
38
|
-
});
|
|
39
35
|
}
|
|
40
36
|
|
|
41
37
|
function valueExtractionExample() {
|
|
@@ -111,20 +107,20 @@ function auroMenuLoadingExample() {
|
|
|
111
107
|
* Copyright 2019 Google LLC
|
|
112
108
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
113
109
|
*/
|
|
114
|
-
const t$5=globalThis,e$
|
|
110
|
+
const t$5=globalThis,e$9=t$5.ShadowRoot&&(void 0===t$5.ShadyCSS||t$5.ShadyCSS.nativeShadow)&&"adoptedStyleSheets"in Document.prototype&&"replace"in CSSStyleSheet.prototype,s$5=Symbol(),o$9=new WeakMap;let n$7 = class n{constructor(t,e,o){if(this._$cssResult$=!0,o!==s$5)throw Error("CSSResult is not constructable. Use `unsafeCSS` or `css` instead.");this.cssText=t,this.t=e;}get styleSheet(){let t=this.o;const s=this.t;if(e$9&&void 0===t){const e=void 0!==s&&1===s.length;e&&(t=o$9.get(s)),void 0===t&&((this.o=t=new CSSStyleSheet).replaceSync(this.cssText),e&&o$9.set(s,t));}return t}toString(){return this.cssText}};const r$7=t=>new n$7("string"==typeof t?t:t+"",void 0,s$5),i$b=(t,...e)=>{const o=1===t.length?t[0]:e.reduce(((e,s,o)=>e+(t=>{if(!0===t._$cssResult$)return t.cssText;if("number"==typeof t)return t;throw Error("Value passed to 'css' function must be a 'css' function result: "+t+". Use 'unsafeCSS' to pass non-literal values, but take care to ensure page security.")})(s)+t[o+1]),t[0]);return new n$7(o,t,s$5)},S$3=(s,o)=>{if(e$9)s.adoptedStyleSheets=o.map((t=>t instanceof CSSStyleSheet?t:t.styleSheet));else for(const e of o){const o=document.createElement("style"),n=t$5.litNonce;void 0!==n&&o.setAttribute("nonce",n),o.textContent=e.cssText,s.appendChild(o);}},c$5=e$9?t=>t:t=>t instanceof CSSStyleSheet?(t=>{let e="";for(const s of t.cssRules)e+=s.cssText;return r$7(e)})(t):t;
|
|
115
111
|
|
|
116
112
|
/**
|
|
117
113
|
* @license
|
|
118
114
|
* Copyright 2017 Google LLC
|
|
119
115
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
120
|
-
*/const{is:i$a,defineProperty:e$
|
|
116
|
+
*/const{is:i$a,defineProperty:e$8,getOwnPropertyDescriptor:r$6,getOwnPropertyNames:h$3,getOwnPropertySymbols:o$8,getPrototypeOf:n$6}=Object,a$5=globalThis,c$4=a$5.trustedTypes,l$5=c$4?c$4.emptyScript:"",p$3=a$5.reactiveElementPolyfillSupport,d$3=(t,s)=>t,u$5={toAttribute(t,s){switch(s){case Boolean:t=t?l$5:null;break;case Object:case Array:t=null==t?t:JSON.stringify(t);}return t},fromAttribute(t,s){let i=t;switch(s){case Boolean:i=null!==t;break;case Number:i=null===t?null:Number(t);break;case Object:case Array:try{i=JSON.parse(t);}catch(t){i=null;}}return i}},f$3=(t,s)=>!i$a(t,s),y$3={attribute:!0,type:String,converter:u$5,reflect:!1,hasChanged:f$3};Symbol.metadata??=Symbol("metadata"),a$5.litPropertyMetadata??=new WeakMap;let b$1 = class b extends HTMLElement{static addInitializer(t){this._$Ei(),(this.l??=[]).push(t);}static get observedAttributes(){return this.finalize(),this._$Eh&&[...this._$Eh.keys()]}static createProperty(t,s=y$3){if(s.state&&(s.attribute=!1),this._$Ei(),this.elementProperties.set(t,s),!s.noAccessor){const i=Symbol(),r=this.getPropertyDescriptor(t,i,s);void 0!==r&&e$8(this.prototype,t,r);}}static getPropertyDescriptor(t,s,i){const{get:e,set:h}=r$6(this.prototype,t)??{get(){return this[s]},set(t){this[s]=t;}};return {get(){return e?.call(this)},set(s){const r=e?.call(this);h.call(this,s),this.requestUpdate(t,r,i);},configurable:!0,enumerable:!0}}static getPropertyOptions(t){return this.elementProperties.get(t)??y$3}static _$Ei(){if(this.hasOwnProperty(d$3("elementProperties")))return;const t=n$6(this);t.finalize(),void 0!==t.l&&(this.l=[...t.l]),this.elementProperties=new Map(t.elementProperties);}static finalize(){if(this.hasOwnProperty(d$3("finalized")))return;if(this.finalized=!0,this._$Ei(),this.hasOwnProperty(d$3("properties"))){const t=this.properties,s=[...h$3(t),...o$8(t)];for(const i of s)this.createProperty(i,t[i]);}const t=this[Symbol.metadata];if(null!==t){const s=litPropertyMetadata.get(t);if(void 0!==s)for(const[t,i]of s)this.elementProperties.set(t,i);}this._$Eh=new Map;for(const[t,s]of this.elementProperties){const i=this._$Eu(t,s);void 0!==i&&this._$Eh.set(i,t);}this.elementStyles=this.finalizeStyles(this.styles);}static finalizeStyles(s){const i=[];if(Array.isArray(s)){const e=new Set(s.flat(1/0).reverse());for(const s of e)i.unshift(c$5(s));}else void 0!==s&&i.push(c$5(s));return i}static _$Eu(t,s){const i=s.attribute;return !1===i?void 0:"string"==typeof i?i:"string"==typeof t?t.toLowerCase():void 0}constructor(){super(),this._$Ep=void 0,this.isUpdatePending=!1,this.hasUpdated=!1,this._$Em=null,this._$Ev();}_$Ev(){this._$ES=new Promise((t=>this.enableUpdating=t)),this._$AL=new Map,this._$E_(),this.requestUpdate(),this.constructor.l?.forEach((t=>t(this)));}addController(t){(this._$EO??=new Set).add(t),void 0!==this.renderRoot&&this.isConnected&&t.hostConnected?.();}removeController(t){this._$EO?.delete(t);}_$E_(){const t=new Map,s=this.constructor.elementProperties;for(const i of s.keys())this.hasOwnProperty(i)&&(t.set(i,this[i]),delete this[i]);t.size>0&&(this._$Ep=t);}createRenderRoot(){const t=this.shadowRoot??this.attachShadow(this.constructor.shadowRootOptions);return S$3(t,this.constructor.elementStyles),t}connectedCallback(){this.renderRoot??=this.createRenderRoot(),this.enableUpdating(!0),this._$EO?.forEach((t=>t.hostConnected?.()));}enableUpdating(t){}disconnectedCallback(){this._$EO?.forEach((t=>t.hostDisconnected?.()));}attributeChangedCallback(t,s,i){this._$AK(t,i);}_$EC(t,s){const i=this.constructor.elementProperties.get(t),e=this.constructor._$Eu(t,i);if(void 0!==e&&!0===i.reflect){const r=(void 0!==i.converter?.toAttribute?i.converter:u$5).toAttribute(s,i.type);this._$Em=t,null==r?this.removeAttribute(e):this.setAttribute(e,r),this._$Em=null;}}_$AK(t,s){const i=this.constructor,e=i._$Eh.get(t);if(void 0!==e&&this._$Em!==e){const t=i.getPropertyOptions(e),r="function"==typeof t.converter?{fromAttribute:t.converter}:void 0!==t.converter?.fromAttribute?t.converter:u$5;this._$Em=e,this[e]=r.fromAttribute(s,t.type),this._$Em=null;}}requestUpdate(t,s,i){if(void 0!==t){if(i??=this.constructor.getPropertyOptions(t),!(i.hasChanged??f$3)(this[t],s))return;this.P(t,s,i);}!1===this.isUpdatePending&&(this._$ES=this._$ET());}P(t,s,i){this._$AL.has(t)||this._$AL.set(t,s),!0===i.reflect&&this._$Em!==t&&(this._$Ej??=new Set).add(t);}async _$ET(){this.isUpdatePending=!0;try{await this._$ES;}catch(t){Promise.reject(t);}const t=this.scheduleUpdate();return null!=t&&await t,!this.isUpdatePending}scheduleUpdate(){return this.performUpdate()}performUpdate(){if(!this.isUpdatePending)return;if(!this.hasUpdated){if(this.renderRoot??=this.createRenderRoot(),this._$Ep){for(const[t,s]of this._$Ep)this[t]=s;this._$Ep=void 0;}const t=this.constructor.elementProperties;if(t.size>0)for(const[s,i]of t)!0!==i.wrapped||this._$AL.has(s)||void 0===this[s]||this.P(s,this[s],i);}let t=!1;const s=this._$AL;try{t=this.shouldUpdate(s),t?(this.willUpdate(s),this._$EO?.forEach((t=>t.hostUpdate?.())),this.update(s)):this._$EU();}catch(s){throw t=!1,this._$EU(),s}t&&this._$AE(s);}willUpdate(t){}_$AE(t){this._$EO?.forEach((t=>t.hostUpdated?.())),this.hasUpdated||(this.hasUpdated=!0,this.firstUpdated(t)),this.updated(t);}_$EU(){this._$AL=new Map,this.isUpdatePending=!1;}get updateComplete(){return this.getUpdateComplete()}getUpdateComplete(){return this._$ES}shouldUpdate(t){return !0}update(t){this._$Ej&&=this._$Ej.forEach((t=>this._$EC(t,this[t]))),this._$EU();}updated(t){}firstUpdated(t){}};b$1.elementStyles=[],b$1.shadowRootOptions={mode:"open"},b$1[d$3("elementProperties")]=new Map,b$1[d$3("finalized")]=new Map,p$3?.({ReactiveElement:b$1}),(a$5.reactiveElementVersions??=[]).push("2.0.4");
|
|
121
117
|
|
|
122
118
|
/**
|
|
123
119
|
* @license
|
|
124
120
|
* Copyright 2017 Google LLC
|
|
125
121
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
126
122
|
*/
|
|
127
|
-
const t$4=globalThis,i$9=t$4.trustedTypes,s$4=i$9?i$9.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$
|
|
123
|
+
const t$4=globalThis,i$9=t$4.trustedTypes,s$4=i$9?i$9.createPolicy("lit-html",{createHTML:t=>t}):void 0,e$7="$lit$",h$2=`lit$${Math.random().toFixed(9).slice(2)}$`,o$7="?"+h$2,n$5=`<${o$7}>`,r$5=document,l$4=()=>r$5.createComment(""),c$3=t=>null===t||"object"!=typeof t&&"function"!=typeof t,a$4=Array.isArray,u$4=t=>a$4(t)||"function"==typeof t?.[Symbol.iterator],d$2="[ \t\n\f\r]",f$2=/<(?:(!--|\/[^a-zA-Z])|(\/?[a-zA-Z][^>\s]*)|(\/?$))/g,v$1=/-->/g,_$1=/>/g,m$1=RegExp(`>|${d$2}(?:([^\\s"'>=/]+)(${d$2}*=${d$2}*(?:[^ \t\n\f\r"'\`<>=]|("|')|))|$)`,"g"),p$2=/'/g,g$1=/"/g,$$1=/^(?:script|style|textarea|title)$/i,y$2=t=>(i,...s)=>({_$litType$:t,strings:i,values:s}),x$1=y$2(1),T$1=Symbol.for("lit-noChange"),E$1=Symbol.for("lit-nothing"),A$1=new WeakMap,C$1=r$5.createTreeWalker(r$5,129);function P$1(t,i){if(!a$4(t)||!t.hasOwnProperty("raw"))throw Error("invalid template strings array");return void 0!==s$4?s$4.createHTML(i):i}const V$1=(t,i)=>{const s=t.length-1,o=[];let r,l=2===i?"<svg>":3===i?"<math>":"",c=f$2;for(let i=0;i<s;i++){const s=t[i];let a,u,d=-1,y=0;for(;y<s.length&&(c.lastIndex=y,u=c.exec(s),null!==u);)y=c.lastIndex,c===f$2?"!--"===u[1]?c=v$1:void 0!==u[1]?c=_$1:void 0!==u[2]?($$1.test(u[2])&&(r=RegExp("</"+u[2],"g")),c=m$1):void 0!==u[3]&&(c=m$1):c===m$1?">"===u[0]?(c=r??f$2,d=-1):void 0===u[1]?d=-2:(d=c.lastIndex-u[2].length,a=u[1],c=void 0===u[3]?m$1:'"'===u[3]?g$1:p$2):c===g$1||c===p$2?c=m$1:c===v$1||c===_$1?c=f$2:(c=m$1,r=void 0);const x=c===m$1&&t[i+1].startsWith("/>")?" ":"";l+=c===f$2?s+n$5:d>=0?(o.push(a),s.slice(0,d)+e$7+s.slice(d)+h$2+x):s+h$2+(-2===d?i:x);}return [P$1(t,l+(t[s]||"<?>")+(2===i?"</svg>":3===i?"</math>":"")),o]};let N$1 = class N{constructor({strings:t,_$litType$:s},n){let r;this.parts=[];let c=0,a=0;const u=t.length-1,d=this.parts,[f,v]=V$1(t,s);if(this.el=N.createElement(f,n),C$1.currentNode=this.el.content,2===s||3===s){const t=this.el.content.firstChild;t.replaceWith(...t.childNodes);}for(;null!==(r=C$1.nextNode())&&d.length<u;){if(1===r.nodeType){if(r.hasAttributes())for(const t of r.getAttributeNames())if(t.endsWith(e$7)){const i=v[a++],s=r.getAttribute(t).split(h$2),e=/([.?@])?(.*)/.exec(i);d.push({type:1,index:c,name:e[2],strings:s,ctor:"."===e[1]?H$1:"?"===e[1]?I$1:"@"===e[1]?L$1:k$1}),r.removeAttribute(t);}else t.startsWith(h$2)&&(d.push({type:6,index:c}),r.removeAttribute(t));if($$1.test(r.tagName)){const t=r.textContent.split(h$2),s=t.length-1;if(s>0){r.textContent=i$9?i$9.emptyScript:"";for(let i=0;i<s;i++)r.append(t[i],l$4()),C$1.nextNode(),d.push({type:2,index:++c});r.append(t[s],l$4());}}}else if(8===r.nodeType)if(r.data===o$7)d.push({type:2,index:c});else {let t=-1;for(;-1!==(t=r.data.indexOf(h$2,t+1));)d.push({type:7,index:c}),t+=h$2.length-1;}c++;}}static createElement(t,i){const s=r$5.createElement("template");return s.innerHTML=t,s}};function S$2(t,i,s=t,e){if(i===T$1)return i;let h=void 0!==e?s._$Co?.[e]:s._$Cl;const o=c$3(i)?void 0:i._$litDirective$;return h?.constructor!==o&&(h?._$AO?.(!1),void 0===o?h=void 0:(h=new o(t),h._$AT(t,s,e)),void 0!==e?(s._$Co??=[])[e]=h:s._$Cl=h),void 0!==h&&(i=S$2(t,h._$AS(t,i.values),h,e)),i}let M$1 = class M{constructor(t,i){this._$AV=[],this._$AN=void 0,this._$AD=t,this._$AM=i;}get parentNode(){return this._$AM.parentNode}get _$AU(){return this._$AM._$AU}u(t){const{el:{content:i},parts:s}=this._$AD,e=(t?.creationScope??r$5).importNode(i,!0);C$1.currentNode=e;let h=C$1.nextNode(),o=0,n=0,l=s[0];for(;void 0!==l;){if(o===l.index){let i;2===l.type?i=new R$1(h,h.nextSibling,this,t):1===l.type?i=new l.ctor(h,l.name,l.strings,this,t):6===l.type&&(i=new z$1(h,this,t)),this._$AV.push(i),l=s[++n];}o!==l?.index&&(h=C$1.nextNode(),o++);}return C$1.currentNode=r$5,e}p(t){let i=0;for(const s of this._$AV)void 0!==s&&(void 0!==s.strings?(s._$AI(t,s,i),i+=s.strings.length-2):s._$AI(t[i])),i++;}};let R$1 = class R{get _$AU(){return this._$AM?._$AU??this._$Cv}constructor(t,i,s,e){this.type=2,this._$AH=E$1,this._$AN=void 0,this._$AA=t,this._$AB=i,this._$AM=s,this.options=e,this._$Cv=e?.isConnected??!0;}get parentNode(){let t=this._$AA.parentNode;const i=this._$AM;return void 0!==i&&11===t?.nodeType&&(t=i.parentNode),t}get startNode(){return this._$AA}get endNode(){return this._$AB}_$AI(t,i=this){t=S$2(this,t,i),c$3(t)?t===E$1||null==t||""===t?(this._$AH!==E$1&&this._$AR(),this._$AH=E$1):t!==this._$AH&&t!==T$1&&this._(t):void 0!==t._$litType$?this.$(t):void 0!==t.nodeType?this.T(t):u$4(t)?this.k(t):this._(t);}O(t){return this._$AA.parentNode.insertBefore(t,this._$AB)}T(t){this._$AH!==t&&(this._$AR(),this._$AH=this.O(t));}_(t){this._$AH!==E$1&&c$3(this._$AH)?this._$AA.nextSibling.data=t:this.T(r$5.createTextNode(t)),this._$AH=t;}$(t){const{values:i,_$litType$:s}=t,e="number"==typeof s?this._$AC(t):(void 0===s.el&&(s.el=N$1.createElement(P$1(s.h,s.h[0]),this.options)),s);if(this._$AH?._$AD===e)this._$AH.p(i);else {const t=new M$1(e,this),s=t.u(this.options);t.p(i),this.T(s),this._$AH=t;}}_$AC(t){let i=A$1.get(t.strings);return void 0===i&&A$1.set(t.strings,i=new N$1(t)),i}k(t){a$4(this._$AH)||(this._$AH=[],this._$AR());const i=this._$AH;let s,e=0;for(const h of t)e===i.length?i.push(s=new R(this.O(l$4()),this.O(l$4()),this,this.options)):s=i[e],s._$AI(h),e++;e<i.length&&(this._$AR(s&&s._$AB.nextSibling,e),i.length=e);}_$AR(t=this._$AA.nextSibling,i){for(this._$AP?.(!1,!0,i);t&&t!==this._$AB;){const i=t.nextSibling;t.remove(),t=i;}}setConnected(t){void 0===this._$AM&&(this._$Cv=t,this._$AP?.(t));}};let k$1 = class k{get tagName(){return this.element.tagName}get _$AU(){return this._$AM._$AU}constructor(t,i,s,e,h){this.type=1,this._$AH=E$1,this._$AN=void 0,this.element=t,this.name=i,this._$AM=e,this.options=h,s.length>2||""!==s[0]||""!==s[1]?(this._$AH=Array(s.length-1).fill(new String),this.strings=s):this._$AH=E$1;}_$AI(t,i=this,s,e){const h=this.strings;let o=!1;if(void 0===h)t=S$2(this,t,i,0),o=!c$3(t)||t!==this._$AH&&t!==T$1,o&&(this._$AH=t);else {const e=t;let n,r;for(t=h[0],n=0;n<h.length-1;n++)r=S$2(this,e[s+n],i,n),r===T$1&&(r=this._$AH[n]),o||=!c$3(r)||r!==this._$AH[n],r===E$1?t=E$1:t!==E$1&&(t+=(r??"")+h[n+1]),this._$AH[n]=r;}o&&!e&&this.j(t);}j(t){t===E$1?this.element.removeAttribute(this.name):this.element.setAttribute(this.name,t??"");}};let H$1 = class H extends k$1{constructor(){super(...arguments),this.type=3;}j(t){this.element[this.name]=t===E$1?void 0:t;}};let I$1 = class I extends k$1{constructor(){super(...arguments),this.type=4;}j(t){this.element.toggleAttribute(this.name,!!t&&t!==E$1);}};let L$1 = class L extends k$1{constructor(t,i,s,e,h){super(t,i,s,e,h),this.type=5;}_$AI(t,i=this){if((t=S$2(this,t,i,0)??E$1)===T$1)return;const s=this._$AH,e=t===E$1&&s!==E$1||t.capture!==s.capture||t.once!==s.once||t.passive!==s.passive,h=t!==E$1&&(s===E$1||e);e&&this.element.removeEventListener(this.name,this,s),h&&this.element.addEventListener(this.name,this,t),this._$AH=t;}handleEvent(t){"function"==typeof this._$AH?this._$AH.call(this.options?.host??this.element,t):this._$AH.handleEvent(t);}};let z$1 = class z{constructor(t,i,s){this.element=t,this.type=6,this._$AN=void 0,this._$AM=i,this.options=s;}get _$AU(){return this._$AM._$AU}_$AI(t){S$2(this,t);}};const j$1=t$4.litHtmlPolyfillSupport;j$1?.(N$1,R$1),(t$4.litHtmlVersions??=[]).push("3.2.1");const B$1=(t,i,s)=>{const e=s?.renderBefore??i;let h=e._$litPart$;if(void 0===h){const t=s?.renderBefore??null;e._$litPart$=h=new R$1(i.insertBefore(l$4(),t),t,void 0,s??{});}return h._$AI(t),h};
|
|
128
124
|
|
|
129
125
|
/**
|
|
130
126
|
* @license
|
|
@@ -132,12 +128,25 @@ const t$4=globalThis,i$9=t$4.trustedTypes,s$4=i$9?i$9.createPolicy("lit-html",{c
|
|
|
132
128
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
133
129
|
*/let r$4 = class r extends b$1{constructor(){super(...arguments),this.renderOptions={host:this},this._$Do=void 0;}createRenderRoot(){const t=super.createRenderRoot();return this.renderOptions.renderBefore??=t.firstChild,t}update(t){const s=this.render();this.hasUpdated||(this.renderOptions.isConnected=this.isConnected),super.update(t),this._$Do=B$1(s,this.renderRoot,this.renderOptions);}connectedCallback(){super.connectedCallback(),this._$Do?.setConnected(!0);}disconnectedCallback(){super.disconnectedCallback(),this._$Do?.setConnected(!1);}render(){return T$1}};r$4._$litElement$=!0,r$4["finalized"]=!0,globalThis.litElementHydrateSupport?.({LitElement:r$4});const i$8=globalThis.litElementPolyfillSupport;i$8?.({LitElement:r$4});(globalThis.litElementVersions??=[]).push("4.1.1");
|
|
134
130
|
|
|
131
|
+
/**
|
|
132
|
+
* @license
|
|
133
|
+
* Copyright 2017 Google LLC
|
|
134
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
135
|
+
*/
|
|
136
|
+
const t$3={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$6=t=>(...e)=>({_$litDirective$:t,values:e});let i$7 = class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}};
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* @license
|
|
140
|
+
* Copyright 2018 Google LLC
|
|
141
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
142
|
+
*/const e$5=e$6(class extends i$7{constructor(t){if(super(t),t.type!==t$3.ATTRIBUTE||"class"!==t.name||t.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T$1}});
|
|
143
|
+
|
|
135
144
|
/**
|
|
136
145
|
* @license
|
|
137
146
|
* Copyright 2020 Google LLC
|
|
138
147
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
139
148
|
*/
|
|
140
|
-
const a$3=Symbol.for(""),o$6=t=>{if(t?.r===a$3)return t?._$litStatic$},s$3=t=>({_$litStatic$:t,r:a$3}),i$
|
|
149
|
+
const a$3=Symbol.for(""),o$6=t=>{if(t?.r===a$3)return t?._$litStatic$},s$3=t=>({_$litStatic$:t,r:a$3}),i$6=(t,...r)=>({_$litStatic$:r.reduce(((r,e,a)=>r+(t=>{if(void 0!==t._$litStatic$)return t._$litStatic$;throw Error(`Value passed to 'literal' function must be a 'literal' result: ${t}. Use 'unsafeStatic' to pass non-literal values, but\n take care to ensure page security.`)})(e)+t[a+1]),t[0]),r:a$3}),l$3=new Map,n$4=t=>(r,...e)=>{const a=e.length;let s,i;const n=[],u=[];let c,$=0,f=!1;for(;$<a;){for(c=r[$];$<a&&void 0!==(i=e[$],s=o$6(i));)c+=s+r[++$],f=!0;$!==a&&u.push(i),n.push(c),$++;}if($===a&&n.push(r[a]),f){const t=n.join("$$lit$$");void 0===(r=l$3.get(t))&&(n.raw=n,l$3.set(t,r=n)),e=u;}return t(r,...e)},u$3=n$4(x$1);
|
|
141
150
|
|
|
142
151
|
// Copyright (c) Alaska Air. All right reserved. Licensed under the Apache-2.0 license
|
|
143
152
|
// See LICENSE in the project root for license information.
|
|
@@ -253,20 +262,20 @@ class AuroFormValidation {
|
|
|
253
262
|
const pattern = new RegExp(`^${elem.pattern}$`, 'u');
|
|
254
263
|
|
|
255
264
|
if (!pattern.test(elem.value)) {
|
|
256
|
-
elem.validity = '
|
|
257
|
-
elem.
|
|
265
|
+
elem.validity = 'patternMismatch';
|
|
266
|
+
elem.errorMessage = elem.setCustomValidityPatternMismatch || elem.setCustomValidity || '';
|
|
258
267
|
}
|
|
259
268
|
}
|
|
260
269
|
|
|
261
270
|
// Length > 0 is required to prevent the error message from showing when the input is empty
|
|
262
271
|
if (elem.value?.length > 0 && elem.value?.length < elem.minLength) {
|
|
263
272
|
elem.validity = 'tooShort';
|
|
264
|
-
elem.
|
|
273
|
+
elem.errorMessage = elem.setCustomValidityTooShort || elem.setCustomValidity || '';
|
|
265
274
|
}
|
|
266
275
|
|
|
267
276
|
if (elem.value?.length > elem.maxLength) {
|
|
268
277
|
elem.validity = 'tooLong';
|
|
269
|
-
elem.
|
|
278
|
+
elem.errorMessage = elem.setCustomValidityTooLong || elem.setCustomValidity || '';
|
|
270
279
|
}
|
|
271
280
|
}
|
|
272
281
|
|
|
@@ -282,33 +291,32 @@ class AuroFormValidation {
|
|
|
282
291
|
const emailRegex = /^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/; // eslint-disable-line require-unicode-regexp
|
|
283
292
|
|
|
284
293
|
if (!elem.value.match(emailRegex)) {
|
|
285
|
-
elem.validity = '
|
|
286
|
-
elem.
|
|
294
|
+
elem.validity = 'patternMismatch';
|
|
295
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
287
296
|
}
|
|
288
297
|
} else if (elem.type === 'credit-card') {
|
|
289
298
|
if (elem.value.length > 0 && elem.value.length < elem.validationCCLength) {
|
|
290
299
|
elem.validity = 'tooShort';
|
|
291
|
-
elem.
|
|
300
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
292
301
|
}
|
|
293
302
|
} else if (elem.type === 'number') {
|
|
294
303
|
if (elem.max !== undefined && Number(elem.max) < Number(elem.value)) {
|
|
295
304
|
elem.validity = 'rangeOverflow';
|
|
296
|
-
elem.
|
|
305
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
297
306
|
}
|
|
298
307
|
|
|
299
|
-
if (elem.min !== undefined && Number(elem.min) > Number(elem.value)) {
|
|
308
|
+
if (elem.min !== undefined && elem.value?.length > 0 && Number(elem.min) > Number(elem.value)) {
|
|
300
309
|
elem.validity = 'rangeUnderflow';
|
|
301
|
-
elem.
|
|
310
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
302
311
|
}
|
|
303
|
-
|
|
304
312
|
} else if (elem.type === 'month-day-year' ||
|
|
305
313
|
elem.type === 'month-year' ||
|
|
306
314
|
elem.type === 'month-fullYear' ||
|
|
307
315
|
elem.type === 'year-month-day'
|
|
308
316
|
) {
|
|
309
|
-
if (elem.value
|
|
317
|
+
if (elem.value?.length > 0 && elem.value.length < elem.dateStrLength) {
|
|
310
318
|
elem.validity = 'tooShort';
|
|
311
|
-
elem.
|
|
319
|
+
elem.errorMessage = elem.setCustomValidityForType || elem.setCustomValidity || '';
|
|
312
320
|
} else {
|
|
313
321
|
const valueDate = new Date(elem.value);
|
|
314
322
|
|
|
@@ -318,7 +326,7 @@ class AuroFormValidation {
|
|
|
318
326
|
|
|
319
327
|
if (valueDate > maxDate) {
|
|
320
328
|
elem.validity = 'rangeOverflow';
|
|
321
|
-
elem.
|
|
329
|
+
elem.errorMessage = elem.setCustomValidityRangeOverflow || elem.setCustomValidity || '';
|
|
322
330
|
}
|
|
323
331
|
}
|
|
324
332
|
|
|
@@ -328,7 +336,7 @@ class AuroFormValidation {
|
|
|
328
336
|
|
|
329
337
|
if (valueDate < minDate) {
|
|
330
338
|
elem.validity = 'rangeUnderflow';
|
|
331
|
-
elem.
|
|
339
|
+
elem.errorMessage = elem.setCustomValidityRangeUnderflow || elem.setCustomValidity || '';
|
|
332
340
|
}
|
|
333
341
|
}
|
|
334
342
|
}
|
|
@@ -351,10 +359,10 @@ class AuroFormValidation {
|
|
|
351
359
|
|
|
352
360
|
if (elem.hasAttribute('error')) {
|
|
353
361
|
elem.validity = 'customError';
|
|
354
|
-
elem.
|
|
362
|
+
elem.errorMessage = elem.setCustomValidityCustomError || elem.error || elem.setCustomValidity || '';
|
|
355
363
|
} else if (validationShouldRun) {
|
|
356
364
|
elem.validity = 'valid';
|
|
357
|
-
elem.
|
|
365
|
+
elem.errorMessage = '';
|
|
358
366
|
|
|
359
367
|
/**
|
|
360
368
|
* Only validate once we interact with the datepicker
|
|
@@ -366,7 +374,7 @@ class AuroFormValidation {
|
|
|
366
374
|
let hasValue = elem.value && elem.value.length > 0;
|
|
367
375
|
|
|
368
376
|
// If there is a second input in the elem and that value is undefined or an empty string set hasValue to false;
|
|
369
|
-
if (this.auroInputElements
|
|
377
|
+
if (this.auroInputElements?.length === 2) {
|
|
370
378
|
if (!this.auroInputElements[1].value || this.auroInputElements[1].length === 0) {
|
|
371
379
|
hasValue = false;
|
|
372
380
|
}
|
|
@@ -374,31 +382,27 @@ class AuroFormValidation {
|
|
|
374
382
|
|
|
375
383
|
if (!hasValue && elem.required) {
|
|
376
384
|
elem.validity = 'valueMissing';
|
|
377
|
-
elem.
|
|
385
|
+
elem.errorMessage = elem.setCustomValidityValueMissing || elem.setCustomValidity || '';
|
|
378
386
|
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
379
387
|
this.validateType(elem);
|
|
380
388
|
this.validateAttributes(elem);
|
|
381
389
|
}
|
|
382
390
|
}
|
|
383
391
|
|
|
384
|
-
if (this.auroInputElements
|
|
392
|
+
if (this.auroInputElements?.length > 0) {
|
|
385
393
|
elem.validity = this.auroInputElements[0].validity;
|
|
386
|
-
elem.
|
|
394
|
+
elem.errorMessage = this.auroInputElements[0].errorMessage;
|
|
387
395
|
|
|
388
|
-
if (elem.validity === 'valid') {
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
elem.setCustomValidity = this.auroInputElements[1].setCustomValidity;
|
|
392
|
-
}
|
|
396
|
+
if (elem.validity === 'valid' && this.auroInputElements.length > 1) {
|
|
397
|
+
elem.validity = this.auroInputElements[1].validity;
|
|
398
|
+
elem.errorMessage = this.auroInputElements[1].errorMessage;
|
|
393
399
|
}
|
|
394
400
|
}
|
|
395
401
|
|
|
396
402
|
if (validationShouldRun || elem.hasAttribute('error')) {
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
elem.setCustomValidity = elem.ValidityMessageOverride;
|
|
401
|
-
}
|
|
403
|
+
// Use the validity message override if it is declared
|
|
404
|
+
if (elem.validity && elem.validity !== 'valid' && elem.ValidityMessageOverride) {
|
|
405
|
+
elem.errorMessage = elem.ValidityMessageOverride;
|
|
402
406
|
}
|
|
403
407
|
|
|
404
408
|
this.getErrorMessage(elem);
|
|
@@ -444,18 +448,18 @@ class AuroFormValidation {
|
|
|
444
448
|
if (elem.validity !== 'valid') {
|
|
445
449
|
if (elem.setCustomValidity) {
|
|
446
450
|
elem.errorMessage = elem.setCustomValidity;
|
|
447
|
-
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input')) {
|
|
451
|
+
} else if (this.runtimeUtils.elementMatch(elem, 'auro-input') && elem.errorMessage === '') {
|
|
448
452
|
const input = elem.renderRoot.querySelector('input');
|
|
449
453
|
|
|
450
454
|
if (input.validationMessage.length > 0) {
|
|
451
455
|
elem.errorMessage = input.validationMessage;
|
|
452
456
|
}
|
|
453
|
-
} else if (this.inputElements &&
|
|
457
|
+
} else if (this.inputElements?.length > 0 && elem.errorMessage === '') {
|
|
454
458
|
const firstInput = this.inputElements[0];
|
|
455
459
|
|
|
456
460
|
if (firstInput.validationMessage.length > 0) {
|
|
457
461
|
elem.errorMessage = firstInput.validationMessage;
|
|
458
|
-
} else if (this.inputElements
|
|
462
|
+
} else if (this.inputElements?.length === 2) {
|
|
459
463
|
const secondInput = this.inputElements[1];
|
|
460
464
|
|
|
461
465
|
if (secondInput.validationMessage.length > 0) {
|
|
@@ -499,7 +503,7 @@ let AuroDependencyVersioning$1 = class AuroDependencyVersioning {
|
|
|
499
503
|
*/
|
|
500
504
|
generateTag(baseName, version, tagClass) {
|
|
501
505
|
const elementName = this.generateElementName(baseName, version);
|
|
502
|
-
const tag = i$
|
|
506
|
+
const tag = i$6`${s$3(elementName)}`;
|
|
503
507
|
|
|
504
508
|
if (!customElements.get(elementName)) {
|
|
505
509
|
customElements.define(elementName, class extends tagClass {});
|
|
@@ -2539,13 +2543,13 @@ class AuroDependencyVersioning {
|
|
|
2539
2543
|
* Copyright 2017 Google LLC
|
|
2540
2544
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2541
2545
|
*/
|
|
2542
|
-
const t
|
|
2546
|
+
const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
2543
2547
|
|
|
2544
2548
|
/**
|
|
2545
2549
|
* @license
|
|
2546
2550
|
* Copyright 2018 Google LLC
|
|
2547
2551
|
* SPDX-License-Identifier: BSD-3-Clause
|
|
2548
|
-
*/const e
|
|
2552
|
+
*/const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T}});
|
|
2549
2553
|
|
|
2550
2554
|
/**
|
|
2551
2555
|
* @license
|
|
@@ -2892,7 +2896,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
2892
2896
|
|
|
2893
2897
|
return x`
|
|
2894
2898
|
<div
|
|
2895
|
-
class="${e
|
|
2899
|
+
class="${e(classes)}"
|
|
2896
2900
|
title="${o$5(this.title || undefined)}">
|
|
2897
2901
|
<span aria-hidden="${o$5(this.ariaHidden ? this.ariaHidden : true)}" part="svg">
|
|
2898
2902
|
${this.customSvg ? x`
|
|
@@ -2903,7 +2907,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
2903
2907
|
}
|
|
2904
2908
|
</span>
|
|
2905
2909
|
|
|
2906
|
-
<div class="${e
|
|
2910
|
+
<div class="${e(a11y)}">
|
|
2907
2911
|
<slot></slot>
|
|
2908
2912
|
</div>
|
|
2909
2913
|
</div>
|
|
@@ -2913,7 +2917,7 @@ let AuroIcon$1 = class AuroIcon extends BaseIcon$1 {
|
|
|
2913
2917
|
|
|
2914
2918
|
var iconVersion$1 = '6.1.2';
|
|
2915
2919
|
|
|
2916
|
-
var styleCss$1$1 = i$3`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);white-space:normal}.trigger{position:relative;display:flex;align-items:center;border-width:1px;border-style:solid}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}.helpText{margin-top:var(--ds-size-50, 0.25rem);font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
2920
|
+
var styleCss$1$1 = i$3`:host{position:relative;display:inline-block;max-width:100%}:host([fluid]){display:block}#bibSizer{position:absolute;z-index:-1;opacity:0;pointer-events:none}.label{font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem);transition:font-size .3s cubic-bezier(0.215, 0.61, 0.355, 1);white-space:normal}.label[hasTrigger=false]{font-size:var(--ds-text-body-size-default, 1rem)}.trigger{position:relative;display:flex;align-items:center;border-width:1px;border-style:solid}@media(hover: hover){.trigger:hover{cursor:pointer}}.triggerContentWrapper{overflow:hidden;flex:1;text-overflow:ellipsis;white-space:nowrap}#showStateIcon{display:flex;overflow:hidden;height:100%;align-items:center;margin-left:var(--ds-size-100, 0.5rem)}#showStateIcon [auro-icon]{height:var(--ds-size-300, 1.5rem);line-height:var(--ds-size-300, 1.5rem)}#showStateIcon[data-expanded=true] [auro-icon]{transform:rotate(-180deg)}.helpText{margin-top:var(--ds-size-50, 0.25rem);font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:var(--ds-text-body-size-default, 1rem)}:host([matchwidth]) #bibSizer{width:100%}:host([disabled]){pointer-events:none}:host([inset]) .trigger{padding:var(--ds-size-150, 0.75rem) var(--ds-size-200, 1rem)}:host([common]) .trigger,:host([inset][bordered]) .trigger{padding:var(--ds-size-200, 1rem) var(--ds-size-150, 0.75rem)}:host([common]) .trigger,:host([rounded]) .trigger{border-radius:var(--ds-border-radius, 0.375rem)}`;
|
|
2917
2921
|
|
|
2918
2922
|
var colorCss$1$1 = i$3`.label{color:var(--ds-auro-dropdown-label-text-color)}.trigger{border-color:var(--ds-auro-dropdown-trigger-border-color);background-color:var(--ds-auro-dropdown-trigger-container-color);color:var(--ds-auro-dropdown-trigger-text-color)}.trigger:focus-within,.trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8)}.trigger:focus-within:not(:active){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5);outline:1px solid var(--ds-color-border-ui-focus-default, #2c67b5)}.trigger:hover{--ds-auro-dropdown-trigger-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}.helpText{color:var(--ds-auro-dropdown-help-text-color)}:host([disabled]){--ds-auro-dropdown-trigger-text-color: var(--ds-color-text-ui-disabled-default, #adadad);--ds-auro-dropdown-label-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host([common]),:host([bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-primary-default, #585e67)}:host([common]) .trigger:active,:host([common]) .trigger:focus-within,:host([bordered]) .trigger:active,:host([bordered]) .trigger:focus-within{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-focus-default, #2c67b5)}:host([error]){--ds-auro-dropdown-help-text-color: var(--ds-color-text-error-default, #cc1816);--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-error-default, #cc1816)}:host([error]) .trigger{outline:solid 1px var(--ds-auro-dropdown-trigger-border-color)}:host([error]) .trigger:focus-within,:host([error]) .trigger:active{--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-active-default, #0074c8)}:host([error]) .trigger:active{box-shadow:none;outline:none}:host([disabled][common]),:host([disabled][bordered]){--ds-auro-dropdown-trigger-border-color: var(--ds-color-border-ui-disabled-default, #adadad)}`;
|
|
2919
2923
|
|
|
@@ -2937,9 +2941,6 @@ const DESIGN_TOKEN_BREAKPOINT_OPTIONS = [
|
|
|
2937
2941
|
];
|
|
2938
2942
|
|
|
2939
2943
|
/**
|
|
2940
|
-
* @attr { Boolean } common - If declared, will apply all styles for the common theme.
|
|
2941
|
-
* @attr { Boolean } rounded - If declared, will apply border-radius to the bib.
|
|
2942
|
-
* @attr { Boolean } inset - If declared, will apply extra padding to bib content.
|
|
2943
2944
|
* @prop { String } mobileFullscreenBreakpoint - Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
2944
2945
|
* @csspart bibContainer - Apply css to the bib container.
|
|
2945
2946
|
*/
|
|
@@ -2965,14 +2966,26 @@ class AuroDropdownBib extends r {
|
|
|
2965
2966
|
|
|
2966
2967
|
static get properties() {
|
|
2967
2968
|
return {
|
|
2969
|
+
|
|
2970
|
+
/**
|
|
2971
|
+
* If declared, will apply all styles for the common theme.
|
|
2972
|
+
*/
|
|
2968
2973
|
common: {
|
|
2969
2974
|
type: Boolean,
|
|
2970
2975
|
reflect: true
|
|
2971
2976
|
},
|
|
2977
|
+
|
|
2978
|
+
/**
|
|
2979
|
+
* If declared, will apply extra padding to bib content.
|
|
2980
|
+
*/
|
|
2972
2981
|
inset: {
|
|
2973
2982
|
type: Boolean,
|
|
2974
2983
|
reflect: true
|
|
2975
2984
|
},
|
|
2985
|
+
|
|
2986
|
+
/**
|
|
2987
|
+
* If declared, will apply border-radius to the bib.
|
|
2988
|
+
*/
|
|
2976
2989
|
rounded: {
|
|
2977
2990
|
type: Boolean,
|
|
2978
2991
|
reflect: true
|
|
@@ -3016,22 +3029,7 @@ if (!customElements.get("auro-dropdownbib")) {
|
|
|
3016
3029
|
|
|
3017
3030
|
|
|
3018
3031
|
/**
|
|
3019
|
-
* @attr { Boolean } bordered - If declared, applies a border around the trigger slot.
|
|
3020
|
-
* @attr { Boolean } common - If declared, the dropdown will be styled with the common theme.
|
|
3021
|
-
* @attr { Boolean } chevron - If declared, the dropdown displays an display state chevron on the right.
|
|
3022
|
-
* @attr { Boolean } disabled - If declared, the dropdown is not interactive.
|
|
3023
3032
|
* @attr { Boolean } disableEventShow - If declared, the dropdown will only show by calling the API .show() public method.
|
|
3024
|
-
* @attr { Boolean } error - If declared in combination with `bordered` property or `helpText` slot content, will apply red color to both.
|
|
3025
|
-
* @attr {Boolean} fluid - Makes the trigger to be full width of its parent container
|
|
3026
|
-
* @attr { Boolean } matchWidth - If declared, the popover and trigger will be set to the same width.
|
|
3027
|
-
* @attr { Boolean } inset - If declared, will apply padding around trigger slot content.
|
|
3028
|
-
* @attr { Boolean } rounded - If declared, will apply border-radius to trigger and default slots.
|
|
3029
|
-
* @attr { Boolean } hoverToggle - if declared, the trigger will toggle the big on mouseover/mouseout.
|
|
3030
|
-
* @attr { Boolean } noToggle - If declared, the trigger will only show the dropdown bib.
|
|
3031
|
-
* @attr { Boolean } focusShow - if declared, the bib will display when focus is applied to the trigger.
|
|
3032
|
-
* @attr { Boolean } noHideOnThisFocusLoss - If declared, the dropdown will not hide when moving focus outside the element.
|
|
3033
|
-
* @attr { String } mobileFullscreenBreakpoint - Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
3034
|
-
* @prop { Boolean } isPopoverVisible - If true, the dropdown bib is displayed.
|
|
3035
3033
|
* @slot - Default slot for the popover content.
|
|
3036
3034
|
* @slot label - Defines the content of the label.
|
|
3037
3035
|
* @slot helpText - Defines the content of the helpText.
|
|
@@ -3069,6 +3067,16 @@ class AuroDropdown extends r {
|
|
|
3069
3067
|
this.tabIndex = 0;
|
|
3070
3068
|
this.noToggle = false;
|
|
3071
3069
|
|
|
3070
|
+
/**
|
|
3071
|
+
* @private
|
|
3072
|
+
*/
|
|
3073
|
+
this.hasTriggerContent = false;
|
|
3074
|
+
|
|
3075
|
+
/**
|
|
3076
|
+
* @private
|
|
3077
|
+
*/
|
|
3078
|
+
this.triggerContentSlot = undefined;
|
|
3079
|
+
|
|
3072
3080
|
/**
|
|
3073
3081
|
* @private
|
|
3074
3082
|
*/
|
|
@@ -3115,89 +3123,166 @@ class AuroDropdown extends r {
|
|
|
3115
3123
|
// function to define props used within the scope of this component
|
|
3116
3124
|
static get properties() {
|
|
3117
3125
|
return {
|
|
3126
|
+
|
|
3127
|
+
/**
|
|
3128
|
+
* If declared, applies a border around the trigger slot.
|
|
3129
|
+
*/
|
|
3118
3130
|
bordered: {
|
|
3119
3131
|
type: Boolean,
|
|
3120
3132
|
reflect: true
|
|
3121
3133
|
},
|
|
3134
|
+
|
|
3135
|
+
/**
|
|
3136
|
+
* If declared, the dropdown displays a chevron on the right.
|
|
3137
|
+
* @attr {Boolean} chevron
|
|
3138
|
+
*/
|
|
3122
3139
|
chevron: {
|
|
3123
3140
|
type: Boolean,
|
|
3124
3141
|
reflect: true
|
|
3125
3142
|
},
|
|
3126
|
-
|
|
3143
|
+
|
|
3144
|
+
/**
|
|
3145
|
+
* If declared, the dropdown will be styled with the common theme.
|
|
3146
|
+
*/
|
|
3147
|
+
common: {
|
|
3127
3148
|
type: Boolean,
|
|
3128
3149
|
reflect: true
|
|
3129
3150
|
},
|
|
3130
|
-
|
|
3151
|
+
|
|
3152
|
+
/**
|
|
3153
|
+
* If declared, the dropdown is not interactive.
|
|
3154
|
+
*/
|
|
3155
|
+
disabled: {
|
|
3131
3156
|
type: Boolean,
|
|
3132
3157
|
reflect: true
|
|
3133
3158
|
},
|
|
3134
|
-
|
|
3159
|
+
|
|
3160
|
+
/**
|
|
3161
|
+
* @private
|
|
3162
|
+
*/
|
|
3163
|
+
dropdownWidth: {
|
|
3164
|
+
type: Number
|
|
3165
|
+
},
|
|
3166
|
+
|
|
3167
|
+
/**
|
|
3168
|
+
* If declared in combination with `bordered` property or `helpText` slot content, will apply red color to both.
|
|
3169
|
+
*/
|
|
3170
|
+
error: {
|
|
3135
3171
|
type: Boolean,
|
|
3136
|
-
reflect: true
|
|
3172
|
+
reflect: true
|
|
3137
3173
|
},
|
|
3174
|
+
|
|
3175
|
+
/**
|
|
3176
|
+
* If declared, the bib will display when focus is applied to the trigger.
|
|
3177
|
+
*/
|
|
3138
3178
|
focusShow: {
|
|
3139
3179
|
type: Boolean,
|
|
3140
3180
|
reflect: true
|
|
3141
3181
|
},
|
|
3142
|
-
|
|
3182
|
+
|
|
3183
|
+
/**
|
|
3184
|
+
* Makes the trigger to be full width of its parent container.
|
|
3185
|
+
*/
|
|
3186
|
+
fluid: {
|
|
3143
3187
|
type: Boolean,
|
|
3144
3188
|
reflect: true
|
|
3145
3189
|
},
|
|
3190
|
+
|
|
3191
|
+
/**
|
|
3192
|
+
* If declared, will apply padding around trigger slot content.
|
|
3193
|
+
*/
|
|
3146
3194
|
inset: {
|
|
3147
3195
|
type: Boolean,
|
|
3148
3196
|
reflect: true
|
|
3149
3197
|
},
|
|
3150
|
-
|
|
3198
|
+
|
|
3199
|
+
/**
|
|
3200
|
+
* If true, the dropdown bib is displayed.
|
|
3201
|
+
*/
|
|
3202
|
+
isPopoverVisible: {
|
|
3203
|
+
type: Boolean
|
|
3204
|
+
},
|
|
3205
|
+
|
|
3206
|
+
/**
|
|
3207
|
+
* If declared, the trigger will toggle the dropdown on mouseover/mouseout.
|
|
3208
|
+
*/
|
|
3209
|
+
hoverToggle: {
|
|
3151
3210
|
type: Boolean,
|
|
3152
3211
|
reflect: true
|
|
3153
3212
|
},
|
|
3154
|
-
|
|
3155
|
-
|
|
3213
|
+
|
|
3214
|
+
/**
|
|
3215
|
+
* @private
|
|
3216
|
+
*/
|
|
3217
|
+
hasTriggerContent: {
|
|
3218
|
+
type: Boolean
|
|
3219
|
+
},
|
|
3220
|
+
|
|
3221
|
+
/**
|
|
3222
|
+
* Defines the screen size breakpoint (`lg`, `md`, `sm`, or `xs`) at which the dropdown switches to fullscreen mode on mobile. When expanded, the dropdown will automatically display in fullscreen mode if the screen size is equal to or smaller than the selected breakpoint.
|
|
3223
|
+
*/
|
|
3224
|
+
mobileFullscreenBreakpoint: {
|
|
3225
|
+
type: String,
|
|
3156
3226
|
reflect: true
|
|
3157
3227
|
},
|
|
3158
|
-
|
|
3228
|
+
|
|
3229
|
+
/**
|
|
3230
|
+
* If declared, the popover and trigger will be set to the same width.
|
|
3231
|
+
*/
|
|
3232
|
+
matchWidth: {
|
|
3159
3233
|
type: Boolean,
|
|
3160
3234
|
reflect: true
|
|
3161
3235
|
},
|
|
3162
|
-
|
|
3236
|
+
|
|
3237
|
+
/**
|
|
3238
|
+
* If declared, the dropdown will not hide when moving focus outside the element.
|
|
3239
|
+
*/
|
|
3240
|
+
noHideOnThisFocusLoss: {
|
|
3163
3241
|
type: Boolean,
|
|
3164
3242
|
reflect: true
|
|
3165
3243
|
},
|
|
3166
|
-
|
|
3244
|
+
|
|
3245
|
+
/**
|
|
3246
|
+
* If declared, the trigger will only show the dropdown bib.
|
|
3247
|
+
*/
|
|
3248
|
+
noToggle: {
|
|
3167
3249
|
type: Boolean,
|
|
3168
3250
|
reflect: true
|
|
3169
3251
|
},
|
|
3170
|
-
|
|
3252
|
+
|
|
3171
3253
|
onSlotChange: {
|
|
3172
3254
|
type: Function,
|
|
3173
3255
|
reflect: false
|
|
3174
3256
|
},
|
|
3175
|
-
mobileFullscreenBreakpoint: {
|
|
3176
|
-
type: String,
|
|
3177
|
-
reflect: true,
|
|
3178
|
-
},
|
|
3179
3257
|
|
|
3180
3258
|
/**
|
|
3181
3259
|
* @private
|
|
3182
3260
|
*/
|
|
3183
|
-
|
|
3261
|
+
placement: {
|
|
3262
|
+
type: String
|
|
3263
|
+
},
|
|
3184
3264
|
|
|
3185
3265
|
/**
|
|
3186
|
-
*
|
|
3266
|
+
* If declared, will apply border-radius to trigger and default slots.
|
|
3187
3267
|
*/
|
|
3188
|
-
|
|
3268
|
+
rounded: {
|
|
3269
|
+
type: Boolean,
|
|
3270
|
+
reflect: true
|
|
3271
|
+
},
|
|
3189
3272
|
|
|
3190
3273
|
/**
|
|
3191
3274
|
* @private
|
|
3192
3275
|
*/
|
|
3193
|
-
tabIndex: {
|
|
3276
|
+
tabIndex: {
|
|
3277
|
+
type: Number
|
|
3278
|
+
}
|
|
3194
3279
|
};
|
|
3195
3280
|
}
|
|
3196
3281
|
|
|
3197
3282
|
static get styles() {
|
|
3198
3283
|
return [
|
|
3199
|
-
styleCss$1$1,
|
|
3200
3284
|
colorCss$1$1,
|
|
3285
|
+
styleCss$1$1,
|
|
3201
3286
|
tokensCss$3
|
|
3202
3287
|
];
|
|
3203
3288
|
}
|
|
@@ -3228,6 +3313,12 @@ class AuroDropdown extends r {
|
|
|
3228
3313
|
if (changedProperties.has('mobileFullscreenBreakpoint')) {
|
|
3229
3314
|
this.bibContent.mobileFullscreenBreakpoint = this.mobileFullscreenBreakpoint;
|
|
3230
3315
|
}
|
|
3316
|
+
|
|
3317
|
+
// when trigger's content is changed without any attribute or node change,
|
|
3318
|
+
// `requestUpdate` needs to be called to update hasTriggerContnet
|
|
3319
|
+
if (changedProperties.size === 0 || changedProperties.has('isPopoverVisible')) {
|
|
3320
|
+
this.handleTriggerContentSlotChange();
|
|
3321
|
+
}
|
|
3231
3322
|
}
|
|
3232
3323
|
|
|
3233
3324
|
firstUpdated() {
|
|
@@ -3270,6 +3361,43 @@ class AuroDropdown extends r {
|
|
|
3270
3361
|
return inCustomSlot;
|
|
3271
3362
|
}
|
|
3272
3363
|
|
|
3364
|
+
/**
|
|
3365
|
+
* Handles changes to the trigger content slot and updates related properties.
|
|
3366
|
+
*
|
|
3367
|
+
* It first updates the floater settings
|
|
3368
|
+
* Then, it retrieves the assigned nodes from the event target and checks if any of
|
|
3369
|
+
* the nodes contain non-empty text content, updating the `hasTriggerContent` property accordingly.
|
|
3370
|
+
*
|
|
3371
|
+
* @private
|
|
3372
|
+
* @method handleTriggerContentSlotChange
|
|
3373
|
+
* @param {Event} event - native slotchange event
|
|
3374
|
+
* @returns {void}
|
|
3375
|
+
*/
|
|
3376
|
+
handleTriggerContentSlotChange(event) {
|
|
3377
|
+
this.floater.handleTriggerTabIndex();
|
|
3378
|
+
|
|
3379
|
+
if (event) {
|
|
3380
|
+
this.triggerNode = event.target;
|
|
3381
|
+
this.triggerContentSlot = event.target.assignedNodes();
|
|
3382
|
+
}
|
|
3383
|
+
|
|
3384
|
+
if (this.triggerContentSlot) {
|
|
3385
|
+
this.hasTriggerContent = this.triggerContentSlot.some((slot) => {
|
|
3386
|
+
if (slot.textContent.trim()) {
|
|
3387
|
+
return true;
|
|
3388
|
+
}
|
|
3389
|
+
const slotInSlot = slot.querySelector('slot');
|
|
3390
|
+
if (!slotInSlot) {
|
|
3391
|
+
return false;
|
|
3392
|
+
}
|
|
3393
|
+
const slotsInSlotNodes = slotInSlot.assignedNodes();
|
|
3394
|
+
return slotsInSlotNodes.some((ss) => Boolean(ss.textContent.trim()));
|
|
3395
|
+
});
|
|
3396
|
+
} else {
|
|
3397
|
+
this.hasTriggerContent = false;
|
|
3398
|
+
}
|
|
3399
|
+
}
|
|
3400
|
+
|
|
3273
3401
|
/**
|
|
3274
3402
|
* Handles the default slot change event and updates the content.
|
|
3275
3403
|
*
|
|
@@ -3304,13 +3432,13 @@ class AuroDropdown extends r {
|
|
|
3304
3432
|
tabindex="${this.tabIndex}"
|
|
3305
3433
|
>
|
|
3306
3434
|
<div class="triggerContentWrapper">
|
|
3307
|
-
<label class="label" id="triggerLabel">
|
|
3435
|
+
<label class="label" id="triggerLabel" hasTrigger=${this.hasTriggerContent}>
|
|
3308
3436
|
<slot name="label"></slot>
|
|
3309
3437
|
</label>
|
|
3310
3438
|
<div class="triggerContent">
|
|
3311
3439
|
<slot
|
|
3312
3440
|
name="trigger"
|
|
3313
|
-
@slotchange="${() =>
|
|
3441
|
+
@slotchange="${(event) => this.handleTriggerContentSlotChange(event)}"></slot>
|
|
3314
3442
|
</div>
|
|
3315
3443
|
</div>
|
|
3316
3444
|
${this.chevron || this.common ? u$1`
|
|
@@ -3352,7 +3480,7 @@ AuroDropdown.register();
|
|
|
3352
3480
|
|
|
3353
3481
|
var dropdownVersion = '3.0.0';
|
|
3354
3482
|
|
|
3355
|
-
var styleCss$3 = i$b`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[slot=trigger]{width:100%;padding:0;border:0;cursor:pointer;font-family:inherit;font-size:inherit;text-align:left}[slot=trigger] .nestingSpacer{display:none}:host [auro-dropdown]{position:relative}:host [auro-dropdown]::part(trigger){max-height:var(--ds-size-300, 1.5rem)}:host [auro-dropdown]::part(popover){max-width:-webkit-fill-available;overflow-y:scroll}:host([disabled]) *{user-select:none}.outerWrapper{position:relative}auro-menuoption{pointer-events:none}.menuWrapper{padding:var(--ds-size-50, 0.25rem) 0}.selectElement-helpText{margin:var(--ds-size-50, 0.25rem) 0;font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:1rem}`;
|
|
3483
|
+
var styleCss$3 = i$b`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}[slot=trigger]{width:100%;padding:0;border:0;cursor:pointer;font-family:inherit;font-size:inherit;text-align:left}[slot=trigger] .nestingSpacer{display:none}[slot=trigger] #placeholder.hidden{position:absolute;z-index:-1;opacity:0;pointer-events:none}:host [auro-dropdown]{position:relative}:host [auro-dropdown]::part(trigger){max-height:var(--ds-size-300, 1.5rem)}:host [auro-dropdown]::part(popover){max-width:-webkit-fill-available;overflow-y:scroll}:host([disabled]) *{user-select:none}.outerWrapper{position:relative}auro-menuoption{padding:0;pointer-events:none}.menuWrapper{padding:var(--ds-size-50, 0.25rem) 0}.selectElement-helpText{margin:var(--ds-size-50, 0.25rem) 0;font-size:var(--ds-text-body-size-xs, 0.75rem);line-height:1rem}`;
|
|
3356
3484
|
|
|
3357
3485
|
var colorCss$3 = i$b`*,*:before,*:after{box-sizing:border-box}@media(prefers-reduced-motion: reduce){*,*:before,*:after{animation-duration:.01ms !important;animation-iteration-count:1 !important;transition-duration:.01ms !important}}*:focus-visible{outline:0}*:focus-visible{outline:0}:focus:not(:focus-visible){outline:3px solid transparent}.util_displayInline{display:inline}.util_displayInlineBlock{display:inline-block}.util_displayBlock{display:block}.util_displayFlex{display:flex}.util_displayHidden{display:none}.util_displayHiddenVisually{position:absolute;overflow:hidden;clip:rect(1px, 1px, 1px, 1px);width:1px;height:1px;padding:0;border:0}:host [auro-dropdown]::part(trigger):hover{--ds-auro-dropdown-trigger-container-color: rgba(0 0 0 / 0.06)}:host([disabled]) *{color:var(--ds-color-text-ui-disabled-default, #adadad)}.placeholder{color:var(--ds-auro-select-placeholder-text-color)}`;
|
|
3358
3486
|
|
|
@@ -3366,22 +3494,10 @@ var tokensCss$2 = i$b`:host{--ds-auro-select-placeholder-text-color: var(--ds-co
|
|
|
3366
3494
|
/**
|
|
3367
3495
|
* The auro-select element is a wrapper for auro-dropdown and auro-menu to create a dropdown menu control.
|
|
3368
3496
|
*
|
|
3369
|
-
* @attr {String} validity - Specifies the `validityState` this element is in.
|
|
3370
|
-
* @attr {String} setCustomValidity - Sets a custom help text message to display for all validityStates.
|
|
3371
|
-
* @attr {String} setCustomValidityCustomError - Custom help text message to display when validity = `customError`.
|
|
3372
|
-
* @attr {String} setCustomValidityValueMissing - Custom help text message to display when validity = `valueMissing`.
|
|
3373
|
-
* @attr {String} error - When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value.
|
|
3374
|
-
* @attr {Boolean} noValidate - If set, disables auto-validation on blur.
|
|
3375
|
-
* @attr {Boolean} required - Populates the `required` attribute on the element. Used for client-side validation.
|
|
3376
|
-
* @attr {Boolean} flexMenuWidth - If set, makes dropdown bib width match the size of the content, rather than the width of the trigger.
|
|
3377
|
-
* @prop {String} placeholder - Define placeholder text to display before a value is manually selected.
|
|
3378
|
-
* @prop {String} value - Value selected for the component.
|
|
3379
|
-
* @prop {Boolean} disabled - When attribute is present element shows disabled state.
|
|
3380
|
-
* @prop {Boolean} noCheckmark - When true, checkmark on selected option will no longer be present.
|
|
3381
|
-
* @attr {Object} optionSelected - Specifies the current selected menuOption.
|
|
3382
3497
|
* @slot - Default slot for the menu content.
|
|
3383
3498
|
* @slot label - Defines the content of the label.
|
|
3384
3499
|
* @slot helpText - Defines the content of the helpText.
|
|
3500
|
+
* @slot placeholder - Defines the content of the placeholder to be shown when there is no value
|
|
3385
3501
|
* @event auroSelect-valueSet - Notifies that the component has a new value set.
|
|
3386
3502
|
* @event auroFormElement-validated - Notifies that the `validity` and `errorMessage` values have changed.
|
|
3387
3503
|
* @csspart helpText - Apply CSS to the help text.
|
|
@@ -3392,7 +3508,6 @@ class AuroSelect extends r$4 {
|
|
|
3392
3508
|
constructor() {
|
|
3393
3509
|
super();
|
|
3394
3510
|
|
|
3395
|
-
this.placeholder = 'Please select option';
|
|
3396
3511
|
this.optionSelected = undefined;
|
|
3397
3512
|
this.validity = undefined;
|
|
3398
3513
|
|
|
@@ -3447,68 +3562,118 @@ class AuroSelect extends r$4 {
|
|
|
3447
3562
|
// to understand how to use reflected attributes with your property settings.
|
|
3448
3563
|
static get properties() {
|
|
3449
3564
|
return {
|
|
3450
|
-
|
|
3451
|
-
|
|
3452
|
-
|
|
3565
|
+
|
|
3566
|
+
/**
|
|
3567
|
+
* When attribute is present, element shows disabled state.
|
|
3568
|
+
*/
|
|
3569
|
+
disabled: {
|
|
3570
|
+
type: Boolean,
|
|
3571
|
+
reflect: true
|
|
3453
3572
|
},
|
|
3454
|
-
|
|
3455
|
-
|
|
3573
|
+
|
|
3574
|
+
/**
|
|
3575
|
+
* If set, makes dropdown width match the size of the content, rather than the width of the trigger.
|
|
3576
|
+
*/
|
|
3577
|
+
flexMenuWidth: {
|
|
3578
|
+
type: Boolean,
|
|
3579
|
+
reflect: true
|
|
3580
|
+
},
|
|
3581
|
+
|
|
3582
|
+
/**
|
|
3583
|
+
* When true, checkmark on selected option will no longer be present.
|
|
3584
|
+
*/
|
|
3585
|
+
noCheckmark: {
|
|
3586
|
+
type: Boolean,
|
|
3587
|
+
reflect: true
|
|
3456
3588
|
},
|
|
3589
|
+
|
|
3590
|
+
/**
|
|
3591
|
+
* If set, disables auto-validation on blur.
|
|
3592
|
+
*/
|
|
3457
3593
|
noValidate: {
|
|
3458
3594
|
type: Boolean,
|
|
3459
3595
|
reflect: true
|
|
3460
3596
|
},
|
|
3597
|
+
|
|
3598
|
+
/**
|
|
3599
|
+
* @private
|
|
3600
|
+
*/
|
|
3601
|
+
optionActive: {
|
|
3602
|
+
type: Object
|
|
3603
|
+
},
|
|
3604
|
+
|
|
3605
|
+
/**
|
|
3606
|
+
* Specifies the current selected menuOption.
|
|
3607
|
+
*/
|
|
3608
|
+
optionSelected: {
|
|
3609
|
+
type: Object
|
|
3610
|
+
},
|
|
3611
|
+
|
|
3612
|
+
/**
|
|
3613
|
+
* @private
|
|
3614
|
+
*/
|
|
3615
|
+
options: {
|
|
3616
|
+
type: Array
|
|
3617
|
+
},
|
|
3618
|
+
|
|
3619
|
+
/**
|
|
3620
|
+
* Populates the `required` attribute on the element. Used for client-side validation.
|
|
3621
|
+
*/
|
|
3461
3622
|
required: {
|
|
3462
3623
|
type: Boolean,
|
|
3463
3624
|
reflect: true
|
|
3464
3625
|
},
|
|
3626
|
+
|
|
3627
|
+
/**
|
|
3628
|
+
* When defined, sets persistent validity to `customError` and sets `setCustomValidity` = attribute value.
|
|
3629
|
+
*/
|
|
3465
3630
|
error: {
|
|
3466
3631
|
type: String,
|
|
3467
3632
|
reflect: true
|
|
3468
3633
|
},
|
|
3634
|
+
|
|
3635
|
+
/**
|
|
3636
|
+
* Sets a custom help text message to display for all validityStates.
|
|
3637
|
+
*/
|
|
3469
3638
|
setCustomValidity: {
|
|
3470
3639
|
type: String
|
|
3471
3640
|
},
|
|
3641
|
+
|
|
3642
|
+
/**
|
|
3643
|
+
* Custom help text message to display when validity = `customError`.
|
|
3644
|
+
*/
|
|
3472
3645
|
setCustomValidityCustomError: {
|
|
3473
3646
|
type: String
|
|
3474
3647
|
},
|
|
3648
|
+
|
|
3649
|
+
/**
|
|
3650
|
+
* Custom help text message to display when validity = `valueMissing`.
|
|
3651
|
+
*/
|
|
3475
3652
|
setCustomValidityValueMissing: {
|
|
3476
3653
|
type: String
|
|
3477
3654
|
},
|
|
3655
|
+
|
|
3656
|
+
/**
|
|
3657
|
+
* Specifies the `validityState` this element is in.
|
|
3658
|
+
*/
|
|
3478
3659
|
validity: {
|
|
3479
3660
|
type: String,
|
|
3480
3661
|
reflect: true
|
|
3481
3662
|
},
|
|
3482
|
-
disabled: {
|
|
3483
|
-
type: Boolean,
|
|
3484
|
-
reflect: true
|
|
3485
|
-
},
|
|
3486
|
-
noCheckmark: {
|
|
3487
|
-
type: Boolean,
|
|
3488
|
-
reflect: true
|
|
3489
|
-
},
|
|
3490
|
-
flexMenuWidth: {
|
|
3491
|
-
type: Boolean,
|
|
3492
|
-
reflect: true
|
|
3493
|
-
},
|
|
3494
|
-
placeholder: { type: String },
|
|
3495
|
-
|
|
3496
|
-
/**
|
|
3497
|
-
* @private
|
|
3498
|
-
*/
|
|
3499
|
-
options: { type: Array },
|
|
3500
3663
|
|
|
3501
3664
|
/**
|
|
3502
|
-
*
|
|
3665
|
+
* Value selected for the component.
|
|
3503
3666
|
*/
|
|
3504
|
-
|
|
3667
|
+
value: {
|
|
3668
|
+
type: String
|
|
3669
|
+
}
|
|
3505
3670
|
};
|
|
3506
3671
|
}
|
|
3507
3672
|
|
|
3508
3673
|
static get styles() {
|
|
3509
3674
|
return [
|
|
3510
|
-
styleCss$3,
|
|
3511
3675
|
colorCss$3,
|
|
3676
|
+
styleCss$3,
|
|
3512
3677
|
tokensCss$2
|
|
3513
3678
|
];
|
|
3514
3679
|
}
|
|
@@ -3543,36 +3708,30 @@ class AuroSelect extends r$4 {
|
|
|
3543
3708
|
}
|
|
3544
3709
|
|
|
3545
3710
|
/**
|
|
3546
|
-
* Updates the displayed value in an Auro dropdown component based on
|
|
3547
|
-
* @param {string|HTMLElement} option - The option to display. If a string, a new span element with the value string is created. If an HTMLElement, the selected option is cloned and non-styling attributes are removed.
|
|
3711
|
+
* Updates the displayed value in an Auro dropdown component based on optionSelected
|
|
3548
3712
|
* @private
|
|
3549
3713
|
* @returns {void}
|
|
3550
3714
|
*/
|
|
3551
|
-
updateDisplayedValue(
|
|
3715
|
+
updateDisplayedValue() {
|
|
3552
3716
|
const triggerContentEl = this.dropdown.querySelector('#triggerFocus');
|
|
3553
3717
|
|
|
3554
3718
|
// remove all existing rendered value(s)
|
|
3555
|
-
triggerContentEl.querySelectorAll('auro-menuoption, [
|
|
3719
|
+
triggerContentEl.querySelectorAll('auro-menuoption, [auro-menuoption]').forEach((elm) => {
|
|
3556
3720
|
elm.remove();
|
|
3557
3721
|
});
|
|
3558
3722
|
|
|
3559
|
-
if (
|
|
3560
|
-
// create a new span element with the value string
|
|
3561
|
-
const valueElem = document.createElement('span');
|
|
3562
|
-
valueElem.setAttribute('valuestr', true);
|
|
3563
|
-
valueElem.textContent = option;
|
|
3564
|
-
|
|
3565
|
-
// append the new element into the trigger content
|
|
3566
|
-
triggerContentEl.appendChild(valueElem);
|
|
3567
|
-
} else if (typeof option === 'object') {
|
|
3723
|
+
if (this.optionSelected) {
|
|
3568
3724
|
// clone the selected option and remove attributes that style it
|
|
3569
|
-
const clone =
|
|
3725
|
+
const clone = this.optionSelected.cloneNode(true);
|
|
3570
3726
|
clone.removeAttribute('selected');
|
|
3571
3727
|
clone.removeAttribute('class');
|
|
3572
3728
|
|
|
3573
3729
|
// insert the non-styled clone into the trigger
|
|
3574
3730
|
triggerContentEl.appendChild(clone);
|
|
3575
3731
|
}
|
|
3732
|
+
|
|
3733
|
+
// notify dropdown as trigger content is changed
|
|
3734
|
+
this.dropdown.requestUpdate();
|
|
3576
3735
|
}
|
|
3577
3736
|
|
|
3578
3737
|
/**
|
|
@@ -3582,7 +3741,7 @@ class AuroSelect extends r$4 {
|
|
|
3582
3741
|
*/
|
|
3583
3742
|
configureMenu() {
|
|
3584
3743
|
this.menu = this.querySelector('auro-menu, [auro-menu]');
|
|
3585
|
-
|
|
3744
|
+
|
|
3586
3745
|
// racing condition on custom-select with custom-menu
|
|
3587
3746
|
if (!this.menu) {
|
|
3588
3747
|
setTimeout(() => {
|
|
@@ -3591,6 +3750,7 @@ class AuroSelect extends r$4 {
|
|
|
3591
3750
|
return;
|
|
3592
3751
|
}
|
|
3593
3752
|
|
|
3753
|
+
this.menu.addEventListener("auroMenu-loadingChange", (event) => this.handleMenuLoadingChange(event));
|
|
3594
3754
|
this.menu.setAttribute('aria-hidden', 'true');
|
|
3595
3755
|
|
|
3596
3756
|
this.generateOptionsArray();
|
|
@@ -3603,8 +3763,6 @@ class AuroSelect extends r$4 {
|
|
|
3603
3763
|
this.optionSelected = this.menu.optionSelected;
|
|
3604
3764
|
this.value = this.optionSelected.value;
|
|
3605
3765
|
|
|
3606
|
-
this.updateDisplayedValue(this.optionSelected);
|
|
3607
|
-
|
|
3608
3766
|
if (this.dropdown.isPopoverVisible) {
|
|
3609
3767
|
this.dropdown.hide();
|
|
3610
3768
|
}
|
|
@@ -3618,25 +3776,11 @@ class AuroSelect extends r$4 {
|
|
|
3618
3776
|
* with `auro-select.value`.
|
|
3619
3777
|
*/
|
|
3620
3778
|
this.menu.addEventListener('auroMenu-selectValueFailure', () => {
|
|
3621
|
-
this.
|
|
3622
|
-
this.optionSelected = this.menu.optionSelected;
|
|
3623
|
-
|
|
3624
|
-
this.validity = 'badInput';
|
|
3625
|
-
|
|
3626
|
-
// Capitalizes the first letter of each word in this.value string
|
|
3627
|
-
const valueStr = this.value.replace(/(^\w{1})|(\s+\w{1})/gu, (letter) => letter.toUpperCase());
|
|
3628
|
-
|
|
3629
|
-
// Pass the new string to the trigger content
|
|
3630
|
-
this.updateDisplayedValue(valueStr);
|
|
3779
|
+
this.reset();
|
|
3631
3780
|
});
|
|
3632
3781
|
|
|
3633
3782
|
this.menu.addEventListener('auroMenu-selectValueReset', () => {
|
|
3634
|
-
|
|
3635
|
-
this.updateDisplayedValue(this.placeholder);
|
|
3636
|
-
|
|
3637
|
-
this.optionSelected = undefined;
|
|
3638
|
-
this.value = undefined;
|
|
3639
|
-
|
|
3783
|
+
this.optionSelected = this.menu.optionSelected;
|
|
3640
3784
|
this.validation.validate(this);
|
|
3641
3785
|
});
|
|
3642
3786
|
}
|
|
@@ -3688,8 +3832,6 @@ class AuroSelect extends r$4 {
|
|
|
3688
3832
|
this.addEventListener('blur', () => {
|
|
3689
3833
|
this.validation.validate(this);
|
|
3690
3834
|
});
|
|
3691
|
-
|
|
3692
|
-
this.labelForSr();
|
|
3693
3835
|
}
|
|
3694
3836
|
|
|
3695
3837
|
/**
|
|
@@ -3808,6 +3950,10 @@ class AuroSelect extends r$4 {
|
|
|
3808
3950
|
}));
|
|
3809
3951
|
}
|
|
3810
3952
|
|
|
3953
|
+
if (changedProperties.has('optionSelected')) {
|
|
3954
|
+
this.updateDisplayedValue();
|
|
3955
|
+
}
|
|
3956
|
+
|
|
3811
3957
|
if (changedProperties.has('error')) {
|
|
3812
3958
|
this.validation.validate(this, true);
|
|
3813
3959
|
}
|
|
@@ -3821,52 +3967,15 @@ class AuroSelect extends r$4 {
|
|
|
3821
3967
|
this.validation.reset(this);
|
|
3822
3968
|
}
|
|
3823
3969
|
|
|
3824
|
-
/**
|
|
3825
|
-
* Handles reading of auro-select by screen readers.
|
|
3826
|
-
* @private
|
|
3827
|
-
* @returns {void}
|
|
3828
|
-
*/
|
|
3829
|
-
labelForSr() {
|
|
3830
|
-
const placeholderLabel = document.createElement("div");
|
|
3831
|
-
const textId = "label";
|
|
3832
|
-
|
|
3833
|
-
placeholderLabel.setAttribute("id", textId);
|
|
3834
|
-
placeholderLabel.setAttribute("aria-live", "polite");
|
|
3835
|
-
|
|
3836
|
-
const styles = {
|
|
3837
|
-
position: 'absolute',
|
|
3838
|
-
overflow: 'hidden',
|
|
3839
|
-
clipPath: 'inset(1px, 1px, 1px, 1px)',
|
|
3840
|
-
width: '1px',
|
|
3841
|
-
height: '1px',
|
|
3842
|
-
padding: '0',
|
|
3843
|
-
border: '0'
|
|
3844
|
-
};
|
|
3845
|
-
|
|
3846
|
-
Object.assign(placeholderLabel.style, styles);
|
|
3847
|
-
|
|
3848
|
-
this.addEventListener('focus', () => {
|
|
3849
|
-
document.body.appendChild(placeholderLabel);
|
|
3850
|
-
|
|
3851
|
-
if (!this.optionSelected) {
|
|
3852
|
-
document.getElementById(textId).innerHTML = this.placeholder;
|
|
3853
|
-
} else {
|
|
3854
|
-
document.getElementById(textId).innerHTML = `${this.optionSelected.innerText}, ${this.placeholder}`;
|
|
3855
|
-
}
|
|
3856
|
-
});
|
|
3857
|
-
|
|
3858
|
-
this.addEventListener('blur', () => {
|
|
3859
|
-
if (document.contains(placeholderLabel)) {
|
|
3860
|
-
document.body.removeChild(placeholderLabel);
|
|
3861
|
-
}
|
|
3862
|
-
});
|
|
3863
|
-
}
|
|
3864
|
-
|
|
3865
3970
|
// When using auroElement, use the following attribute and function when hiding content from screen readers.
|
|
3866
3971
|
// aria-hidden="${this.hideAudible(this.hiddenAudible)}"
|
|
3867
3972
|
|
|
3868
3973
|
// function that renders the HTML and CSS into the scope of the component
|
|
3869
3974
|
render() {
|
|
3975
|
+
const placeholderClass = {
|
|
3976
|
+
hidden: this.value,
|
|
3977
|
+
};
|
|
3978
|
+
|
|
3870
3979
|
return u$3`
|
|
3871
3980
|
<div class="outerWrapper">
|
|
3872
3981
|
<div aria-live="polite" class="util_displayHiddenVisually">
|
|
@@ -3893,7 +4002,7 @@ class AuroSelect extends r$4 {
|
|
|
3893
4002
|
chevron
|
|
3894
4003
|
part="dropdown">
|
|
3895
4004
|
<span slot="trigger" aria-haspopup="true" id="triggerFocus">
|
|
3896
|
-
|
|
4005
|
+
<span id="placeholder" class="${e$5(placeholderClass)}"><slot name="placeholder"></slot></span>
|
|
3897
4006
|
</span>
|
|
3898
4007
|
<div class="menuWrapper">
|
|
3899
4008
|
</div>
|
|
@@ -3906,7 +4015,7 @@ class AuroSelect extends r$4 {
|
|
|
3906
4015
|
</p>`
|
|
3907
4016
|
: u$3`
|
|
3908
4017
|
<p class="selectElement-helpText" id="${this.uniqueId}" role="alert" aria-live="assertive" part="helpText">
|
|
3909
|
-
${this.
|
|
4018
|
+
${this.errorMessage}
|
|
3910
4019
|
</p>`
|
|
3911
4020
|
}
|
|
3912
4021
|
</span>
|
|
@@ -3940,8 +4049,8 @@ var tokensCss$1 = i$b`:host{--ds-auro-menu-divider-color: var(--ds-color-border-
|
|
|
3940
4049
|
* @event auroMenu-selectedOption - Notifies that a new menuoption selection has been made.
|
|
3941
4050
|
* @event auroMenu-activatedOption - Notifies that a menuoption has been made `active`.
|
|
3942
4051
|
* @event auroMenu-selectValueFailure - Notifies that a an attempt to select a menuoption by matching a value has failed.
|
|
3943
|
-
* @event auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
3944
4052
|
* @event auroMenu-selectValueReset - Notifies that the component value has been reset.
|
|
4053
|
+
* @event auroMenu-customEventFired - Notifies that a custom event has been fired.
|
|
3945
4054
|
* @event auroMenu-loadingChange - Notifies when the loading attribute is changed.
|
|
3946
4055
|
* @slot loadingText - Text to show while loading attribute is set
|
|
3947
4056
|
* @slot loadingIcon - Icon to show while loading attribute is set
|
|
@@ -4456,19 +4565,6 @@ var styleCss$1 = i$b`:host{display:flex;align-items:center;padding:var(--ds-size
|
|
|
4456
4565
|
|
|
4457
4566
|
var colorCss$1 = i$b`:host{background-color:var(--ds-auro-menuoption-container-color);color:var(--ds-auro-menuoption-text-color)}:host svg{fill:var(--ds-auro-menuoption-icon-color) !important}:host([disabled]){--ds-auro-menuoption-text-color: var(--ds-color-text-ui-disabled-default, #adadad)}:host(:hover),:host(.active){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-secondary-hover-default, rgba(0, 0, 0, 0.03))}:host([selected]){--ds-auro-menuoption-container-color: var(--ds-color-container-ui-primary-default-default, #2c67b5);--ds-auro-menuoption-text-color: var(--ds-color-text-primary-inverse, #ffffff);--ds-auro-menuoption-icon-color: var(--ds-color-icon-emphasis-inverse, #ffffff)}`;
|
|
4458
4567
|
|
|
4459
|
-
/**
|
|
4460
|
-
* @license
|
|
4461
|
-
* Copyright 2017 Google LLC
|
|
4462
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
4463
|
-
*/
|
|
4464
|
-
const t={ATTRIBUTE:1,CHILD:2,PROPERTY:3,BOOLEAN_ATTRIBUTE:4,EVENT:5,ELEMENT:6},e$1=t=>(...e)=>({_$litDirective$:t,values:e});class i{constructor(t){}get _$AU(){return this._$AM._$AU}_$AT(t,e,i){this._$Ct=t,this._$AM=e,this._$Ci=i;}_$AS(t,e){return this.update(t,e)}update(t,e){return this.render(...e)}}
|
|
4465
|
-
|
|
4466
|
-
/**
|
|
4467
|
-
* @license
|
|
4468
|
-
* Copyright 2018 Google LLC
|
|
4469
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
4470
|
-
*/const e=e$1(class extends i{constructor(t$1){if(super(t$1),t$1.type!==t.ATTRIBUTE||"class"!==t$1.name||t$1.strings?.length>2)throw Error("`classMap()` can only be used in the `class` attribute and must be the only part in the attribute.")}render(t){return " "+Object.keys(t).filter((s=>t[s])).join(" ")+" "}update(s,[i]){if(void 0===this.st){this.st=new Set,void 0!==s.strings&&(this.nt=new Set(s.strings.join(" ").split(/\s/).filter((t=>""!==t))));for(const t in i)i[t]&&!this.nt?.has(t)&&this.st.add(t);return this.render(i)}const r=s.element.classList;for(const t of this.st)t in i||(r.remove(t),this.st.delete(t));for(const t in i){const s=!!i[t];s===this.st.has(t)||this.nt?.has(t)||(s?(r.add(t),this.st.add(t)):(r.remove(t),this.st.delete(t)));}return T$1}});
|
|
4471
|
-
|
|
4472
4568
|
/**
|
|
4473
4569
|
* @license
|
|
4474
4570
|
* Copyright 2018 Google LLC
|
|
@@ -4814,7 +4910,7 @@ class AuroIcon extends BaseIcon {
|
|
|
4814
4910
|
|
|
4815
4911
|
return x$1`
|
|
4816
4912
|
<div
|
|
4817
|
-
class="${e(classes)}"
|
|
4913
|
+
class="${e$5(classes)}"
|
|
4818
4914
|
title="${o(this.title || undefined)}">
|
|
4819
4915
|
<span aria-hidden="${o(this.ariaHidden ? this.ariaHidden : true)}" part="svg">
|
|
4820
4916
|
${this.customSvg ? x$1`
|
|
@@ -4825,7 +4921,7 @@ class AuroIcon extends BaseIcon {
|
|
|
4825
4921
|
}
|
|
4826
4922
|
</span>
|
|
4827
4923
|
|
|
4828
|
-
<div class="${e(a11y)}">
|
|
4924
|
+
<div class="${e$5(a11y)}">
|
|
4829
4925
|
<slot></slot>
|
|
4830
4926
|
</div>
|
|
4831
4927
|
</div>
|