@genesislcap/design-system-configurator 14.192.0-accessibility.2 → 14.192.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1908,7 +1908,7 @@
1908
1908
  min-height: 40px;
1909
1909
  padding: 0 calc(var(--design-unit) * 2.25px);
1910
1910
  border-width: 0;
1911
- background-color: var(--neutral-fill-input-rest);
1911
+ background: var(--neutral-fill-input-rest);
1912
1912
  border-radius: calc(var(--control-corner-radius) * 1px);
1913
1913
  }
1914
1914
 
@@ -1984,7 +1984,6 @@
1984
1984
  overflow-y: scroll;
1985
1985
  scrollbar-width: thin;
1986
1986
  scrollbar-color: var(--neutral-layer-2) var(--neutral-layer-4);
1987
- list-style: none;
1988
1987
  }
1989
1988
 
1990
1989
  .checkbox-container zero-checkbox {
@@ -1996,6 +1995,10 @@
1996
1995
  cursor: not-allowed;
1997
1996
  }
1998
1997
 
1998
+ #filter-search {
1999
+ padding: 5px;
2000
+ }
2001
+
1999
2002
  ::-webkit-scrollbar {
2000
2003
  width: 12px;
2001
2004
  }
@@ -2049,34 +2052,10 @@
2049
2052
  .label-hidden {
2050
2053
  display: none;
2051
2054
  }
2052
-
2053
- ol,
2054
- li {
2055
- margin: 0;
2056
- padding: 0;
2057
- }
2058
-
2059
- .checkbox {
2060
- width: 100%;
2061
- }
2062
-
2063
- .select-all {
2064
- width: 100%;
2065
- }
2066
-
2067
- .display-value {
2068
- position: absolute;
2069
- right: 40px;
2070
- line-height: var(--type-ramp-base-line-height);
2071
- color: var(--neutral-foreground-rest);
2072
- font-size: var(--type-ramp-base-font-size);
2073
- line-height: var(--type-ramp-base-line-height);
2074
- font-family: var(--body-font);
2075
- }
2076
2055
  `;let Ps=class extends mt{constructor(){super(...arguments),this.isSnapshot=!0}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t;return(0,x.__awaiter)(this,void 0,void 0,(function*(){e.connectedCallback.call(this),this.fields=this.labelField?null===(t=this.valueField)||void 0===t?void 0:t.concat(" ",this.labelField):this.valueField,this.select=this.parentElement,this.select&&this.valueField&&(this.resourceName&&this.connect.isConnected||this.data)&&this.fetchGenesisData(),this.valueField||ae.warn('Specify field for values in options (e.g value-field="VALUE") and optionally field for label which is supported only in select and combobox (e.g label-field="NAME")')}))}clearData(){this.select.options=[]}syncComponentData(e){var t;const o=(null!=e?e:Array.from(this.rowsSyncedWithStream.values())).map((e=>({value:e[this.valueField],label:e[this.labelField]})));(null===(t=this.select)||void 0===t?void 0:t.async)&&(this.select.loading=!1),this.select.options=o}handleStreamInserts(e){ae.debug("handleStreamInserts - Method not implemented.")}handleStreamDeletes(e){ae.debug("handleStreamDeletes - Method not implemented.")}handleStreamUpdates(e){ae.debug("handleStreamUpdates - Method not implemented.")}};(0,x.__decorate)([(0,r.attr)({attribute:"value-field"})],Ps.prototype,"valueField",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"label-field"})],Ps.prototype,"labelField",void 0),Ps=(0,x.__decorate)([(0,r.customElement)({name:"multiselect-datasource"})],Ps);const Bs=(e="foundation")=>r.html`
2077
2056
  <label
2078
2057
  part="label"
2079
- for="display-field"
2058
+ for="control"
2080
2059
  class=${e=>{var t;return(0,w.x)("label",["label-hidden",!(null===(t=e.defaultSlottedNodes)||void 0===t?void 0:t.length)])}}
2081
2060
  >
2082
2061
  <slot
@@ -2084,23 +2063,8 @@
2084
2063
  ${(0,r.slotted)({property:"defaultSlottedNodes",filter:n.whitespaceFilter})}
2085
2064
  ></slot>
2086
2065
  </label>
2087
- <div class="root" part="root" @keydown="${(e,t)=>e.keydownHandler(t.event)}">
2066
+ <div class="root" part="root">
2088
2067
  <div class="control" part="control">
2089
- <input
2090
- id="display-field"
2091
- part="filter-search"
2092
- role="combobox"
2093
- aria-haspopup="listbox"
2094
- aria-controls="checkbox-container"
2095
- aria-expanded=${e=>e.open?"true":"false"}
2096
- ?readonly=${e=>!e.search}
2097
- @click=${e=>e.toggle()}
2098
- ?disabled="${e=>e.disabled}"
2099
- value=${(0,Ge.O)((e=>e.filterSearchValue),"string","input")}
2100
- placeholder="${e=>e.getDisplayValue}"
2101
- @input=${(e,t)=>e.inputHandler()}
2102
- @change=${(e,t)=>e.changeHandler(t.event)}
2103
- />
2104
2068
  <div part="indicator" class="indicator" @click=${e=>!e.disabled&&e.toggle()}>
2105
2069
  <svg
2106
2070
  viewBox="0 0 12 7"
@@ -2112,34 +2076,47 @@
2112
2076
  <path d="${"M11.85.65c.2.2.2.5 0 .7L6.4 6.84a.55.55 0 01-.78 0L.14 1.35a.5.5 0 11.71-.7L6 5.8 11.15.65c.2-.2.5-.2.7 0z"}" />
2113
2077
  </svg>
2114
2078
  </div>
2115
- ${(0,r.when)((e=>e.filterSearchValue&&e.selectedOptions.length),r.html`
2116
- <div class="display-value">${e=>e.getDisplayValue}</div>
2117
- `)}
2079
+
2080
+ <input
2081
+ part="input"
2082
+ readonly
2083
+ type="text"
2084
+ id="display-field"
2085
+ part="display-field"
2086
+ :value="${e=>e.getDisplayValue}"
2087
+ :disabled="${e=>e.disabled}"
2088
+ @click=${e=>e.toggle()}
2089
+ />
2118
2090
  </div>
2119
- ${(0,r.when)((e=>e.loading),r.html`
2120
- <${e}-progress slot="indicator"></${e}-progress>
2121
- `)}
2122
- <ol
2123
- ${(0,r.ref)("optionsElement")}
2124
- id="checkbox-container"
2125
- class="checkbox-container options"
2126
- aria-multiselectable="true"
2127
- >
2128
- ${(0,r.when)((e=>e.all),r.html`
2129
- <${e}-button
2130
- class="select-all"
2131
- @click=${e=>e.selectCheckboxAll()}
2132
- ?disabled="${(e,t)=>e.isAllOptionsDisabled}"
2133
- >
2134
- Select All ${e=>e.name}
2135
- </${e}-button>
2091
+ <div ${(0,r.ref)("optionsElement")} class="options">
2092
+ ${(0,r.when)((e=>e.search),r.html`
2093
+ <${e}-text-field
2094
+ id="filter-search"
2095
+ part="filter-search"
2096
+ value=${(0,Ge.O)((e=>e.filterSearchValue),"string","input")}
2097
+ placeholder="${e=>e.getPlaceholder}"
2098
+ @input=${(e,t)=>e.inputHandler()}
2099
+ @change=${(e,t)=>e.changeHandler(t.event)}
2100
+ ></${e}-text-field>
2136
2101
  `)}
2137
- ${(0,r.repeat)((e=>e.filteredAvailableOptions),r.html`
2138
- <li role="option" value=${(e,t)=>t.parent.getItemLabel(e)}>
2102
+ <div class="checkbox-container">
2103
+ ${(0,r.when)((e=>e.loading),r.html`
2104
+ <${e}-progress slot="indicator"></${e}-progress>
2105
+ `)}
2106
+ ${(0,r.when)((e=>e.all),r.html`
2107
+ <${e}-checkbox
2108
+ part="checkbox"
2109
+ @click=${e=>e.selectCheckboxAll()}
2110
+ @change=${(e,t)=>e.changeHandler(t.event)}
2111
+ ?current-checked="${e=>e.isAllSelected}"
2112
+ ?disabled="${(e,t)=>e.isAllOptionsDisabled}"
2113
+ >
2114
+ All ${e=>e.name}
2115
+ </${e}-checkbox>
2116
+ `)}
2117
+ ${(0,r.repeat)((e=>e.filteredAvailableOptions),r.html`
2139
2118
  <${e}-checkbox
2140
2119
  part="checkbox"
2141
- class="checkbox"
2142
- @keydown=${(e,t)=>t.parent.checkboxKeyDown(e,t.event)}
2143
2120
  @click=${(e,t)=>t.parent.selectCheckboxOne(e)}
2144
2121
  @change=${(e,t)=>t.parent.changeHandler(t.event)}
2145
2122
  ?current-checked="${(e,t)=>t.parent.isOptionSelected(e)}"
@@ -2147,19 +2124,19 @@
2147
2124
  >
2148
2125
  ${(e,t)=>t.parent.getItemLabel(e)}
2149
2126
  </${e}-checkbox>
2150
- </li>
2151
- `)}
2152
- ${(0,r.when)((e=>e.showCreatable),r.html`
2153
- <${e}-button @click=${e=>e.addOption()}>Create&nbsp;"${e=>e.filterSearchValue}"</${e}-button>
2154
- `)}
2155
- </ol>
2127
+ `)}
2128
+ ${(0,r.when)((e=>e.showCreatable),r.html`
2129
+ <${e}-button @click=${e=>e.addOption()}>Create&nbsp;"${e=>e.filterSearchValue}"</${e}-button>
2130
+ `)}
2131
+ </div>
2132
+ </div>
2156
2133
  </div>
2157
2134
  <slot
2158
2135
  ${(0,r.slotted)({property:"slottedDatasource",filter:e=>e instanceof Ps})}
2159
2136
  ></slot>
2160
2137
  `,zs=r.html`
2161
2138
  ${Bs()}
2162
- `,js=void 0,Vs={};class Gs extends n.FoundationElement{constructor(){super(...arguments),this.name="",this.autoPosition=!0,this.all=!0,this.allSelected=!1,this.search=!0,this.disabled=!1,this.creatable=!1,this.async=!1,this.debounce=500,this.filterByContains=!1,this.filterSearchValue="",this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.filteredAvailableOptions=[...this.options],this.position=ze.BELOW,this.initialisedOptions=!1}debounceChanged(e,t){this.debouncedInputHandler=nt()(this.asyncSetFilter,t)}openChanged(e,t){var o,i,a,n;t?(document.addEventListener("mousedown",this.clickOutside),null===(o=this.arrowIcon)||void 0===o||o.classList.add("flipped"),null===(i=this.optionsElement)||void 0===i||i.classList.add("visible")):(document.removeEventListener("mousedown",this.clickOutside),null===(a=this.arrowIcon)||void 0===a||a.classList.remove("flipped"),null===(n=this.optionsElement)||void 0===n||n.classList.remove("visible"))}connectedCallback(){var e;super.connectedCallback(),this.position===ze.ABOVE&&(null===(e=this.optionsElement)||void 0===e||e.classList.add("position-above"))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this.clickOutside)}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}optionsChanged(){this.allSelected&&!this.initialisedOptions&&(this.selectedOptions=this.options.map((e=>this.optionGetter(e)))),this.filteredAvailableOptions=[...this.options]}selectedOptionsChanged(){this.$fastController.isConnected&&(this.initialisedOptions=!0)}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.assignedSlot?this.assignedSlot.parentElement:this.parentElement;for(;t&&!t.classList.contains("content-wrapper");)t=t.parentElement;if(t){const o=t.getBoundingClientRect(),i=this.getBoundingClientRect(),a=o.top+o.height/2;e=i.top<a?ze.BELOW:ze.ABOVE}else{const t=this.getBoundingClientRect(),o=window.innerHeight,i=t.top,a=o-t.bottom;e=a<t.height&&i>a?ze.ABOVE:ze.BELOW}}e===ze.ABOVE?(this.optionsElement.classList.add("position-above"),this.optionsElement.classList.remove("position-below")):e===ze.BELOW&&(this.optionsElement.classList.add("position-below"),this.optionsElement.classList.remove("position-above"))}optionGetter(e){return"string"!=typeof e?e.value:e}getItemLabel(e){let t;return e?(t="string"==typeof e?e:e.label||e.value||"",this.valueFormatter?this.valueFormatter(t):t):""}isOptionDisabled(e){return e&&"string"!=typeof e&&e.disabled||!1}get getDisplayValue(){let e="";switch(this.selectedOptions.length){case 0:e=this.getPlaceholder;break;case 1:{const t=this.options.find((e=>this.optionGetter(e)===this.selectedOptions[0]));e=this.getItemLabel(t);break}case this.options.length:e=`All ${this.name}`.trim();break;default:e=`${this.selectedOptions.length} Selected`}return e}get getPlaceholder(){return`Search ${this.name}`.trim().concat("...")}get isAllOptionsDisabled(){return this.options.length===this.options.filter(this.isOptionDisabled).length}get showCreatable(){return this.creatable&&this.filterSearchValue.length>0&&0===this.findExactMatchOptions().length}isOptionSelected(e){return this.selectedOptions.includes(this.optionGetter(e))}selectCheckboxOne(e){const t=this.optionGetter(e);this.selectedOptions.includes(t)?(this.selectedOptions=[...this.selectedOptions],this.selectedOptions.splice(this.selectedOptions.indexOf(t),1)):this.selectedOptions=[...this.selectedOptions,t],this.$emit("selectionChange",this.selectedOptions)}checkboxKeyDown(e,t){return" "===t.key&&(t.preventDefault(),this.selectCheckboxOne(e)),!0}getEnabledOptionsCount(){return this.options.length-this.options.filter(this.isOptionDisabled).length}selectCheckboxAll(){const e=this.selectedOptions.length===this.getEnabledOptionsCount();this.selectedOptions=e?[]:this.options.filter((e=>!this.isOptionDisabled(e))).map((e=>this.optionGetter(e))),this.onAllSelectedCallback&&this.onAllSelectedCallback(!e),this.$emit("selectionChange",this.selectedOptions)}inputHandler(){this.open||(this.open=!0),this.async?(this.loading=!0,this.filteredAvailableOptions=[],this.debouncedInputHandler()):this.setFilter()}findExactMatchOptions(){const e=this.filterSearchValue.toLowerCase();return this.filteredAvailableOptions.filter((t=>{var o,i;const a="string"==typeof t?t:null!==(o=t.label)&&void 0!==o?o:t.value;return(null!==(i=null==a?void 0:a.toLowerCase())&&void 0!==i?i:"")===e}))}setFilter(){this.filteredAvailableOptions=[...this.options.filter((e=>{var t;const o=("string"==typeof e?e:null!==(t=e.label)&&void 0!==t?t:e.value).toLowerCase(),i=this.filterSearchValue.toLowerCase();return this.filterByContains?o.indexOf(i)>=0:o.startsWith(i)}))]}addOption(){this.options=[{value:this.filterSearchValue,label:this.filterSearchValue},...this.options],this.setFilter(),this.selectedOptions=[...this.selectedOptions,this.filterSearchValue]}asyncSetFilter(){if(this.slottedDatasource.length>0){const e=this.slottedDatasource[0].datasource.resourceType;e===it.v.DATASERVER&&kt(this.slottedDatasource[0],this.filterSearchValue),e===it.v.REQUEST_SERVER&&Ft(this.slottedDatasource[0],this.filterSearchValue)}else this.loading=!1,ae.warn("Multiselect-datasource is not connected. Please add a datasource to use this functionality.")}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){C(e,this)&&(this.open=!1)}keydownHandler(e){const t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case"Escape":if(this.open){this.open=!1;break}break;case"ArrowUp":case"ArrowDown":if(!this.open){this.open=!0;break}break;default:return!0}}}(0,x.__decorate)([r.attr],Gs.prototype,"name",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean",attribute:"auto-position"})],Gs.prototype,"autoPosition",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"all",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"allSelected",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"search",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"disabled",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"creatable",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"async",void 0),(0,x.__decorate)([r.attr],Gs.prototype,"debounce",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean",attribute:"filter-by-contains"})],Gs.prototype,"filterByContains",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"defaultSlottedNodes",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"slottedDatasource",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"valueFormatter",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"loading",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"filterSearchValue",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"open",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"options",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"selectedOptions",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"filteredAvailableOptions",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"scrollContainer",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"position",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"onAllSelectedCallback",void 0),(0,x.__decorate)([r.volatile],Gs.prototype,"getDisplayValue",null),(0,x.__decorate)([r.volatile],Gs.prototype,"getPlaceholder",null),(0,x.__decorate)([r.volatile],Gs.prototype,"isAllOptionsDisabled",null),(0,x.__decorate)([r.volatile],Gs.prototype,"showCreatable",null);const Us=Gs.compose(Object.assign({baseName:"multiselect",template:zs,styles:Hs,shadowOptions:js},Vs));class Ys{constructor(e){const t=new Intl.NumberFormat(e).formatToParts(12345.6),o=[...new Intl.NumberFormat(e,{useGrouping:!1}).format(9876543210)].reverse(),i=new Map(o.map(((e,t)=>[e,t])));this._group=new RegExp(`[${t.find((e=>"group"===e.type)).value}]`,"g"),this._decimal=new RegExp(`[${t.find((e=>"decimal"===e.type)).value}]`),this._separator=new RegExp(`[$${t.find((e=>"decimal"===e.type)).value}](?:0*$|[^0]0+$)`),this._numeral=new RegExp(`[${o.join("")}]`,"g"),this._index=e=>i.get(e)}parse(e){return(e=e.trim().replace(this._group,"").replace(this._decimal,".").replace(this._numeral,this._index))?+e:NaN}hasSeparator(e){return this._separator.test(e)}}const Ws=(e,t)=>r.css`
2139
+ `,js=void 0,Vs={};class Gs extends n.FoundationElement{constructor(){super(...arguments),this.name="",this.autoPosition=!0,this.all=!0,this.allSelected=!1,this.search=!0,this.disabled=!1,this.creatable=!1,this.async=!1,this.debounce=500,this.filterByContains=!1,this.filterSearchValue="",this.clickOutside=e=>this.handleClickOutside(e),this.open=!1,this.options=[],this.selectedOptions=[],this.filteredAvailableOptions=[...this.options],this.position=ze.BELOW,this.initialisedOptions=!1}debounceChanged(e,t){this.debouncedInputHandler=nt()(this.asyncSetFilter,t)}openChanged(e,t){var o,i,a,n;t?(document.addEventListener("mousedown",this.clickOutside),null===(o=this.arrowIcon)||void 0===o||o.classList.add("flipped"),null===(i=this.optionsElement)||void 0===i||i.classList.add("visible")):(document.removeEventListener("mousedown",this.clickOutside),null===(a=this.arrowIcon)||void 0===a||a.classList.remove("flipped"),null===(n=this.optionsElement)||void 0===n||n.classList.remove("visible"))}connectedCallback(){var e;super.connectedCallback(),this.position===ze.ABOVE&&(null===(e=this.optionsElement)||void 0===e||e.classList.add("position-above"))}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener("mousedown",this.clickOutside)}toggle(){this.open||this.setDropdownPosition(),this.open=!this.open}optionsChanged(){this.allSelected&&!this.initialisedOptions&&(this.selectedOptions=this.options.map((e=>this.optionGetter(e)))),this.filteredAvailableOptions=[...this.options]}selectedOptionsChanged(){this.$fastController.isConnected&&(this.initialisedOptions=!0)}setDropdownPosition(){let e=this.position;if(this.autoPosition){let t=this.assignedSlot?this.assignedSlot.parentElement:this.parentElement;for(;t&&!t.classList.contains("content-wrapper");)t=t.parentElement;if(t){const o=t.getBoundingClientRect(),i=this.getBoundingClientRect(),a=o.top+o.height/2;e=i.top<a?ze.BELOW:ze.ABOVE}else{const t=this.getBoundingClientRect(),o=window.innerHeight,i=t.top,a=o-t.bottom;e=a<t.height&&i>a?ze.ABOVE:ze.BELOW}}e===ze.ABOVE?(this.optionsElement.classList.add("position-above"),this.optionsElement.classList.remove("position-below")):e===ze.BELOW&&(this.optionsElement.classList.add("position-below"),this.optionsElement.classList.remove("position-above"))}optionGetter(e){return"string"!=typeof e?e.value:e}getItemLabel(e){let t;return e?(t="string"==typeof e?e:e.label||e.value||"",this.valueFormatter?this.valueFormatter(t):t):""}isOptionDisabled(e){return e&&"string"!=typeof e&&e.disabled||!1}get getDisplayValue(){let e="";switch(this.selectedOptions.length){case 0:e=this.getPlaceholder;break;case 1:{const t=this.options.find((e=>this.optionGetter(e)===this.selectedOptions[0]));e=this.getItemLabel(t);break}case this.options.length:e=`All ${this.name}`.trim();break;default:e=`${this.selectedOptions.length} Selected`}return e}get getPlaceholder(){return`Search ${this.name}`.trim().concat("...")}get isAllSelected(){return!this.isAllOptionsDisabled&&this.selectedOptions.length===this.getEnabledOptionsCount()}get isAllOptionsDisabled(){return this.options.length===this.options.filter(this.isOptionDisabled).length}get showCreatable(){return this.creatable&&this.filterSearchValue.length>0&&0===this.findExactMatchOptions().length}isOptionSelected(e){return this.selectedOptions.includes(this.optionGetter(e))}selectCheckboxOne(e){const t=this.optionGetter(e);this.selectedOptions.includes(t)?(this.selectedOptions=[...this.selectedOptions],this.selectedOptions.splice(this.selectedOptions.indexOf(t),1)):this.selectedOptions=[...this.selectedOptions,t],this.$emit("selectionChange",this.selectedOptions)}getEnabledOptionsCount(){return this.options.length-this.options.filter(this.isOptionDisabled).length}selectCheckboxAll(){const e=this.selectedOptions.length===this.getEnabledOptionsCount();this.selectedOptions=e?[]:this.options.filter((e=>!this.isOptionDisabled(e))).map((e=>this.optionGetter(e))),this.onAllSelectedCallback&&this.onAllSelectedCallback(!e),this.$emit("selectionChange",this.selectedOptions)}inputHandler(){this.async?(this.loading=!0,this.filteredAvailableOptions=[],this.debouncedInputHandler()):this.setFilter()}findExactMatchOptions(){const e=this.filterSearchValue.toLowerCase();return this.filteredAvailableOptions.filter((t=>{var o,i;const a="string"==typeof t?t:null!==(o=t.label)&&void 0!==o?o:t.value;return(null!==(i=null==a?void 0:a.toLowerCase())&&void 0!==i?i:"")===e}))}setFilter(){this.filteredAvailableOptions=[...this.options.filter((e=>{var t;const o=("string"==typeof e?e:null!==(t=e.label)&&void 0!==t?t:e.value).toLowerCase(),i=this.filterSearchValue.toLowerCase();return this.filterByContains?o.indexOf(i)>=0:o.startsWith(i)}))]}addOption(){this.options=[{value:this.filterSearchValue,label:this.filterSearchValue},...this.options],this.setFilter(),this.selectedOptions=[...this.selectedOptions,this.filterSearchValue]}asyncSetFilter(){if(this.slottedDatasource.length>0){const e=this.slottedDatasource[0].datasource.resourceType;e===it.v.DATASERVER&&kt(this.slottedDatasource[0],this.filterSearchValue),e===it.v.REQUEST_SERVER&&Ft(this.slottedDatasource[0],this.filterSearchValue)}else this.loading=!1,ae.warn("Multiselect-datasource is not connected. Please add a datasource to use this functionality.")}changeHandler(e){e.preventDefault(),e.stopImmediatePropagation()}handleClickOutside(e){C(e,this)&&(this.open=!1)}}(0,x.__decorate)([r.attr],Gs.prototype,"name",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean",attribute:"auto-position"})],Gs.prototype,"autoPosition",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"all",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"allSelected",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"search",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"disabled",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"creatable",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean"})],Gs.prototype,"async",void 0),(0,x.__decorate)([r.attr],Gs.prototype,"debounce",void 0),(0,x.__decorate)([(0,r.attr)({mode:"boolean",attribute:"filter-by-contains"})],Gs.prototype,"filterByContains",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"defaultSlottedNodes",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"slottedDatasource",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"valueFormatter",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"loading",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"filterSearchValue",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"open",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"options",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"selectedOptions",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"filteredAvailableOptions",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"scrollContainer",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"position",void 0),(0,x.__decorate)([r.observable],Gs.prototype,"onAllSelectedCallback",void 0),(0,x.__decorate)([r.volatile],Gs.prototype,"getDisplayValue",null),(0,x.__decorate)([r.volatile],Gs.prototype,"getPlaceholder",null),(0,x.__decorate)([r.volatile],Gs.prototype,"isAllSelected",null),(0,x.__decorate)([r.volatile],Gs.prototype,"isAllOptionsDisabled",null),(0,x.__decorate)([r.volatile],Gs.prototype,"showCreatable",null);const Us=Gs.compose(Object.assign({baseName:"multiselect",template:zs,styles:Hs,shadowOptions:js},Vs));class Ys{constructor(e){const t=new Intl.NumberFormat(e).formatToParts(12345.6),o=[...new Intl.NumberFormat(e,{useGrouping:!1}).format(9876543210)].reverse(),i=new Map(o.map(((e,t)=>[e,t])));this._group=new RegExp(`[${t.find((e=>"group"===e.type)).value}]`,"g"),this._decimal=new RegExp(`[${t.find((e=>"decimal"===e.type)).value}]`),this._separator=new RegExp(`[$${t.find((e=>"decimal"===e.type)).value}](?:0*$|[^0]0+$)`),this._numeral=new RegExp(`[${o.join("")}]`,"g"),this._index=e=>i.get(e)}parse(e){return(e=e.trim().replace(this._group,"").replace(this._decimal,".").replace(this._numeral,this._index))?+e:NaN}hasSeparator(e){return this._separator.test(e)}}const Ws=(e,t)=>r.css`
2163
2140
  ${(0,s.numberFieldStyles)(e,t)}
2164
2141
  ::part(label) {
2165
2142
  color: var(--neutral-foreground-rest);
@@ -3777,4 +3754,4 @@
3777
3754
  <slot></slot>
3778
3755
  </template>
3779
3756
  `;var mu;!function(e){e.NOTIFICATION_EVENT="notification-event"}(mu||(mu={}));const vu={mode:"open",delegatesFocus:!0};class gu extends n.FoundationElement{constructor(){super(...arguments),this.closeTimeout=0,this.toastButtons=[]}connectedCallback(){const e=Object.create(null,{connectedCallback:{get:()=>super.connectedCallback}});var t;return(0,x.__awaiter)(this,void 0,void 0,(function*(){if(e.connectedCallback.call(this),this.addEventListener(mu.NOTIFICATION_EVENT,(e=>{e.stopImmediatePropagation(),_a(e.detail,this.tagName,this.notificationListener)})),this.resourceName){if(!(yield this.datasource.init({resourceName:this.resourceName},!0)))return void ae.debug(`Genesis Datasource init failed for ${this.resourceName}`);this.dataSub=null===(t=this.datasource.stream)||void 0===t?void 0:t.subscribe((e=>{e.ROW&&e.SEQUENCE_ID>1&&this.handleStreamUpdate((0,ct.d)(e))}))}}))}disconnectedCallback(){var e,t;super.disconnectedCallback(),null===(e=this.dataSub)||void 0===e||e.unsubscribe(),delete this.dataSub,null===(t=this.datasource)||void 0===t||t.destroy(),delete this.datasource}handleStreamUpdate(e){const t=e.inserts;t.length>0&&t.forEach((e=>{this.showNotificationToast(e)}))}showNotificationToast(e){const{HEADER:t,MESSAGE:o,NOTIFY_SEVERITY:i}=e,a=e.CREATED_AT?new Date(e.CREATED_AT):void 0,n=e.EXPIRY?e.EXPIRY-e.CREATED_AT:void 0;let s=[];this.toastButtons&&this.toastButtons.length>0&&(s=this.toastButtons.filter((({condition:t})=>!t||t({details:e}))));((e,t,o)=>{if(!e.title)throw new Error("Title is required");if(!e.body)throw new Error("Missing required param 'body'");let i={title:e.title,body:e.body},a={};e.createdAt&&(i=Object.assign({createdAt:e.createdAt},i)),e.logLevel in ie.LogLevel&&(i=Object.assign({logLevel:e.logLevel},i)),e.toast&&(a=Object.assign({toast:e.toast},a),i=Object.assign({config:a},i)),ka(i,t,o)})({title:t,body:o,createdAt:a,toast:{details:e,type:null==i?void 0:i.toLowerCase(),buttons:s,autoClose:void 0!==n?!!n:!!this.closeTimeout,closeTimeout:null!=n?n:this.closeTimeout}},this.tagName)}}(0,x.__decorate)([r.observable],gu.prototype,"notificationListener",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"resource-name"})],gu.prototype,"resourceName",void 0),(0,x.__decorate)([(0,r.attr)({attribute:"close-timeout",converter:r.nullableNumberConverter})],gu.prototype,"closeTimeout",void 0),(0,x.__decorate)([r.observable],gu.prototype,"toastButtons",void 0),(0,x.__decorate)([pt.yW],gu.prototype,"datasource",void 0);const fu=gu.compose({baseName:"notification-listener",template:hu,shadowOptions:vu}),bu=(e,t)=>o=>{const i="function"==typeof t?t:(a=t,e=>Object.assign(Object.assign({},a),e));var a;return r.FASTElement.define(class extends e{},i(o))};function yu(e){if("string"==typeof e)return e;if("function"==typeof e&&!(e=r.FASTElementDefinition.forType(e)))throw new Error("Missing FASTElement definition.");return e.name}const xu=e=>!e.navId||"header"===e.navId,wu=10;function $u(e,t=xu,o=wu){const i=[];return e.filter((e=>e.navItems&&e.navItems.some(t))).forEach(((e,a)=>{e.navItems.filter(t).map(((t,i)=>{var n,s,r,l;const d=null!==(n=t.placementIndex)&&void 0!==n?n:a*o+i;return Object.assign(Object.assign({},t),{navId:null!==(s=t.navId)&&void 0!==s?s:"header",placementIndex:d,routePath:null!==(r=t.routePath)&&void 0!==r?r:e.path,routeName:null!==(l=t.routeName)&&void 0!==l?l:e.name})})).forEach((e=>i.push(e)))})),i.sort(((e,t)=>e.placementIndex-t.placementIndex))}var Su,Cu=o(63734);!function(e){e.controlClicked="controlClicked",e.routeChanged="routeChanged"}(Su||(Su={}));class ku{constructor(e){this.analytics=(0,Cu.Ay)(e)}trackEvent(e,t){ma.v.debug(`FoundationAnalytics.trackEvent ${e} : ${JSON.stringify(t)}`),this.analytics.track(e,t)}}const Fu=n.DI.createInterface((e=>e.singleton(ku)));var _u=o(3479),Ou=o(80751),Du=o(98647);let Tu=class extends(_u.Ix.from(r.FASTElement)){connectedCallback(){super.connectedCallback(),r.DOM.queueUpdate((()=>(0,x.__awaiter)(this,void 0,void 0,(function*(){this.$router.config=this.config}))))}};Tu=(0,x.__decorate)([(0,r.customElement)({name:"foundation-router"})],Tu);class Lu extends Ou.s{constructor(){super(...arguments),this.definitions=[]}map(...e){this.definitions=[...e,...this.definitions],super.map(...e)}}(0,x.__decorate)([r.observable],Lu.prototype,"definitions",void 0);class Eu extends Du.Y{constructor(){super(...arguments),this.routes=new Lu(this)}getNavItems(e=xu){return $u(this.routes.definitions,e)}configureAnalytics(){this.contributors.push({navigate:e=>(0,x.__awaiter)(this,void 0,void 0,(function*(){this.analytics.trackEvent(Su.routeChanged,{path:e.route.endpoint.path})}))})}construct(e){return this.container.get(e)}}(0,x.__decorate)([n.Container],Eu.prototype,"container",void 0),(0,x.__decorate)([Fu],Eu.prototype,"analytics",void 0),(0,x.__decorate)([er.KJ],Eu.prototype,"user",void 0);const Au=()=>_r().register(cu)}}]);
3780
- //# sourceMappingURL=531.8c2a7185df33f37aba0be4b35f036229.js.map
3757
+ //# sourceMappingURL=531.e7d837b3dc03a9828045d28ab13761e4.js.map