@genesislcap/foundation-rapid-cdn 15.99.2 → 15.99.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.
|
@@ -270,7 +270,7 @@ function ty(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r
|
|
|
270
270
|
</svg>
|
|
271
271
|
`,indeterminateIndicator:`
|
|
272
272
|
<div part="indeterminate-indicator" class="indeterminate-indicator"></div>
|
|
273
|
-
`};zw.compose(Object.assign({baseName:`checkbox`,template:Lw,styles:Rw,shadowOptions:void 0},Bw));let Vw=(e,t)=>O` .combo-box-indicator{transition-property: transform;transition-duration: 0.2s;transition-timing-function: ease-out}:host([open]) .combo-box-indicator{transform: rotate(180deg)}${Ql(e,t)}`,Hw=(e,t)=>T`<template aria-activedescendant="${e=>e.activeDescendant}" class="${e=>e.open?`open`:``} ${e=>e.disabled?`disabled`:``} ${e=>e.position}" ?open="${e=>e.open}" @click="${(e,t)=>e.clickHandler(t.event)}" @focusout="${(e,t)=>e.focusoutHandler(t.event)}" @keydown="${(e,t)=>e.keydownHandler(t.event)}"><div class="control" part="control">${Tt(e,t)}<slot name="control"><input aria-activedescendant="${e=>e.activeDescendant}" aria-autocomplete="${e=>e.ariaAutoComplete||e.autocomplete}" aria-controls="${e=>e.ariaControls||e.listboxId}" aria-disabled="${e=>e.disabled?`true`:`false`}" aria-expanded="${e=>e.open?`true`:`false`}" aria-haspopup="listbox" aria-labelledby="${e=>e.ariaLabelledby}" aria-label="${e=>e.ariaLabel}" autocomplete="${e=>e.autocomplete}" class="selected-value" part="selected-value" placeholder="${e=>e.placeholder}" role="combobox" type="text" ?disabled="${e=>e.disabled}" :value="${e=>e.value}" @input="${(e,t)=>e.inputHandler(t.event)}" @keyup="${(e,t)=>e.keyupHandler(t.event)}" ${k(`control`)}/><div class="indicator" part="indicator" aria-hidden="true"><slot name="indicator">${t.indicator||``}</slot></div></slot>${wt(e,t)}</div><div class="listbox" id="${e=>e.listboxId}" part="listbox" role="listbox" ?disabled="${e=>e.disabled}" ?hidden="${e=>!e.open}" ${k(`listbox`)}><slot ${k(`slottedDatasource`)} ${xt({filter:zr.slottedOptionFilter,flatten:!0,property:`slottedOptions`})}></slot></div></template>`;var Uw,Ww,Gw=class extends $l{constructor(){super(...arguments),Uw.set(this,void 0),Ww.set(this,!1),this.needManualChangeEventDispatch=!1,this.async=!1,this.debounce=500,this.caseSensitive=!1,this.ignoreInputClick=!1,this.filterMode=`startsWith`,this.scrollToSelectedWhenOpening=!1,this.scrollToSelectedWhenOpeningOptions={behavior:`auto`,block:`nearest`},this.scrollWhenSelectionChanges=!1,this.scrollWhenSelectionChangesOptions={behavior:`auto`,block:`center`},this.resetCombobox=()=>{this.selectedOptions=[],this.selectedIndex=-1,this.value=``,this.control.value=``,this.filter=``,this.filterOptions()}}get activeDescendant(){if(this.selectedOptions&&this.selectedOptions.length!==0)return this.ariaActiveDescendant=this.selectedOptions[0]?.id,this.selectedOptions[0]?.id}debounceChanged(e,t){this.debouncedInputHandler=(0,Tw.default)(this.asyncSetFilter,t)}get scrollableListbox(){return this.listbox??this.shadowRoot?.querySelector(`.listbox`)}openChanged(){super.openChanged(),this.$emit(`open-change`,{open:this.open}),this.open?this.scrollToSelectedWhenOpening&&setTimeout(()=>{this.options[this.selectedIndex]?.scrollIntoView(this.scrollToSelectedWhenOpeningOptions)},500):(this.manuallyDispatchChangeEvent(),this.filter=``,this.filterOptions())}get value(){return S.track(this,`value`),this._ourValue}set value(e){if(e===void 0)return;let t=`${this._ourValue}`;if(this.$fastController.isConnected&&this.options){let t=this.caseSensitive?t=>t.text===e:t=>t.text.toLowerCase()===String(e).toLowerCase(),n=this.options?this.options.findIndex(t):-1,r=this.options[this.selectedIndex]?.text,i=this.options[n]?.text;this.selectedIndex=i&&i!==r?n:this.selectedIndex,e&&e.trim()!==``&&n===-1&&(e=this.firstSelectedOption?.text||e)}t!==e&&(this._ourValue=e,super.valueChanged(t,e),S.notify(this,`value`))}slottedOptionsChanged(e,t){this.enableAsyncForInfiniteScrollDatasource(),super.slottedOptionsChanged(e,t),this.updateValue(!1)}enableAsyncForInfiniteScrollDatasource(){this.async||this.slottedDatasource?.assignedNodes().find(e=>e instanceof Ow)?.infiniteScroll&&(this.async=!0)}get options(){return this.async?(S.track(this,`options`),this._options):super.options}set options(e){super.options=e}filterOptions(){if(this.async){this.filteredOptions=[...this._options],this._options.forEach(e=>e.hidden=!1);return}(!this.autocomplete||this.autocomplete===Hr.none)&&(this.filter=``);let e=this.filter,t=this.caseSensitive?e:e.toLowerCase(),n=e=>{let n=this.caseSensitive?e.text:e.text.toLowerCase();return this.filterMode===`contains`?n.includes(t):n.startsWith(t)};this.filteredOptions=this._options.filter(n),this.isAutocompleteList&&(!this.filteredOptions.length&&!t&&(this.filteredOptions=this._options),this._options.forEach(e=>e.hidden=!this.filteredOptions.includes(e)))}clickHandler(e){if(!this.disabled){if(gb(e,this)){this.open=!1;return}if(_b(e,this.indicator)){this.open=!this.open,this.open&&this.control.focus();return}if(!(this.ignoreInputClick&&_b(e,this.control)))return super.clickHandler(e)}}keydownHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Enter`:if(dd(this,Ww,this.open,`f`),!this.open)return this.open=!0,!0;break;case`ArrowDown`:case`ArrowUp`:if(!this.open)return this.open=!0,!0;this.scrollWhenSelectionChanges&&this.options[this.selectedIndex]?.scrollIntoView(this.scrollWhenSelectionChangesOptions);break;case`Escape`:if(this.control.value!==this.currentValue){this.filter=``,this.filterOptions(),this.control.value=this.currentValue,this.selectItemByValue(this.currentValue),this.open=!1;return}if(!this.open)return!0}let n=super.keydownHandler(e);if(t!==`Enter`)return n}keyupHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Enter`:return!ud(this,Ww,`f`);case`ArrowDown`:case`ArrowUp`:this.open&&this.firstSelectedOption&&this.autocomplete===Hr.both&&(this.needManualChangeEventDispatch=!0,this.currentValue=this.firstSelectedOption?.value);break;case`Home`:case`End`:return;case`Backspace`:case`Delete`:let t=super.keyupHandler(e);return this.selectItemByValue(this.control.value),t}return super.keyupHandler(e)}get indicator(){return ud(this,Uw,`f`)||dd(this,Uw,this.shadowRoot.querySelector(`[part="indicator"]`),`f`),ud(this,Uw,`f`)}selectItemByValue(e){var t;this.selectedIndex=this.options?.findIndex(t=>t.text===e)??-1,(t=this.options)==null||t.forEach((e,t)=>e.selected=t===this.selectedIndex)}inputHandler(e){this.async?(this.selectedIndex=this.options.map(e=>e.text).indexOf(this.control.value),this.debouncedInputHandler()):super.inputHandler(e)}asyncSetFilter(){let e=this.control.value,t=this.slottedDatasource.assignedNodes().filter(e=>e instanceof Ow);if(t.length>0){let n=t[0];e==null||e===``?n.criteria=n.baseCriteria||``:Lb(n,e),x.queueUpdate(()=>{this.control.value=e})}else mb.warn(`Options-datasource is not connected. Please add a datasource to use this functionality.`)}manuallyDispatchChangeEvent(){this.needManualChangeEventDispatch&&this.firstSelectedOption&&this.autocomplete===Hr.both&&(this.dispatchEvent(new Event(`change`,{bubbles:!0})),this.needManualChangeEventDispatch=!1)}};Uw=/* @__PURE__ */ new WeakMap,Ww=/* @__PURE__ */ new WeakMap,q([C],Gw.prototype,`activeDescendant`,null),q([C],Gw.prototype,`slottedDatasource`,void 0),q([D({mode:`boolean`})],Gw.prototype,`async`,void 0),q([D],Gw.prototype,`debounce`,void 0),q([D({mode:`boolean`,attribute:`case-sensitive`})],Gw.prototype,`caseSensitive`,void 0),q([D({mode:`boolean`,attribute:`ignore-input-click`})],Gw.prototype,`ignoreInputClick`,void 0),q([D({attribute:`filter-mode`})],Gw.prototype,`filterMode`,void 0),q([D({mode:`boolean`,attribute:`scroll-to-selected-when-opening`})],Gw.prototype,`scrollToSelectedWhenOpening`,void 0),q([C],Gw.prototype,`scrollToSelectedWhenOpeningOptions`,void 0),q([D({mode:`boolean`,attribute:`scroll-when-selection-changes`})],Gw.prototype,`scrollWhenSelectionChanges`,void 0),q([C],Gw.prototype,`scrollWhenSelectionChangesOptions`,void 0);let Kw={delegatesFocus:!0,mode:`open`},qw={indicator:`
|
|
273
|
+
`};zw.compose(Object.assign({baseName:`checkbox`,template:Lw,styles:Rw,shadowOptions:void 0},Bw));let Vw=(e,t)=>O` .combo-box-indicator{transition-property: transform;transition-duration: 0.2s;transition-timing-function: ease-out}:host([open]) .combo-box-indicator{transform: rotate(180deg)}${Ql(e,t)}`,Hw=(e,t)=>T`<template aria-activedescendant="${e=>e.activeDescendant}" class="${e=>e.open?`open`:``} ${e=>e.disabled?`disabled`:``} ${e=>e.position}" ?open="${e=>e.open}" @click="${(e,t)=>e.clickHandler(t.event)}" @focusout="${(e,t)=>e.focusoutHandler(t.event)}" @keydown="${(e,t)=>e.keydownHandler(t.event)}"><div class="control" part="control">${Tt(e,t)}<slot name="control"><input aria-activedescendant="${e=>e.activeDescendant}" aria-autocomplete="${e=>e.ariaAutoComplete||e.autocomplete}" aria-controls="${e=>e.ariaControls||e.listboxId}" aria-disabled="${e=>e.disabled?`true`:`false`}" aria-expanded="${e=>e.open?`true`:`false`}" aria-haspopup="listbox" aria-labelledby="${e=>e.ariaLabelledby}" aria-label="${e=>e.ariaLabel}" autocomplete="${e=>e.autocomplete}" class="selected-value" part="selected-value" placeholder="${e=>e.placeholder}" role="combobox" type="text" ?disabled="${e=>e.disabled}" :value="${e=>e.value}" @input="${(e,t)=>e.inputHandler(t.event)}" @keyup="${(e,t)=>e.keyupHandler(t.event)}" ${k(`control`)}/><div class="indicator" part="indicator" aria-hidden="true"><slot name="indicator">${t.indicator||``}</slot></div></slot>${wt(e,t)}</div><div class="listbox" id="${e=>e.listboxId}" part="listbox" role="listbox" ?disabled="${e=>e.disabled}" ?hidden="${e=>!e.open}" ${k(`listbox`)}><slot ${k(`slottedDatasource`)} ${xt({filter:zr.slottedOptionFilter,flatten:!0,property:`slottedOptions`})}></slot></div></template>`;var Uw,Ww,Gw=class extends $l{constructor(){super(...arguments),Uw.set(this,void 0),Ww.set(this,!1),this.needManualChangeEventDispatch=!1,this.async=!1,this.debounce=500,this.caseSensitive=!1,this.ignoreInputClick=!1,this.filterMode=`startsWith`,this.scrollToSelectedWhenOpening=!1,this.scrollToSelectedWhenOpeningOptions={behavior:`auto`,block:`nearest`},this.scrollWhenSelectionChanges=!1,this.scrollWhenSelectionChangesOptions={behavior:`auto`,block:`center`},this.resetCombobox=()=>{this.selectedOptions=[],this.selectedIndex=-1,this.value=``,this.control.value=``,this.filter=``,this.filterOptions()}}get activeDescendant(){if(this.selectedOptions&&this.selectedOptions.length!==0)return this.ariaActiveDescendant=this.selectedOptions[0]?.id,this.selectedOptions[0]?.id}debounceChanged(e,t){this.debouncedInputHandler=(0,Tw.default)(this.asyncSetFilter,t)}get scrollableListbox(){return this.listbox??this.shadowRoot?.querySelector(`.listbox`)}openChanged(){super.openChanged(),this.$emit(`open-change`,{open:this.open}),this.open?this.scrollToSelectedWhenOpening&&setTimeout(()=>{this.options[this.selectedIndex]?.scrollIntoView(this.scrollToSelectedWhenOpeningOptions)},500):(this.manuallyDispatchChangeEvent(),this.filter=``,this.filterOptions())}get value(){return S.track(this,`value`),this._ourValue}set value(e){if(e===void 0)return;let t=`${this._ourValue}`;if(this.$fastController.isConnected&&this.options){let t=this.caseSensitive?t=>t.text===e:t=>t.text.toLowerCase()===String(e).toLowerCase(),n=this.options?this.options.findIndex(t):-1,r=this.options[this.selectedIndex]?.text,i=this.options[n]?.text;this.selectedIndex=i&&i!==r?n:this.selectedIndex,e&&e.trim()!==``&&n===-1&&(e=this.firstSelectedOption?.text||e)}t!==e&&(this._ourValue=e,super.valueChanged(t,e),S.notify(this,`value`))}slottedOptionsChanged(e,t){this.enableAsyncForInfiniteScrollDatasource(),super.slottedOptionsChanged(e,t),this.updateValue(!1)}enableAsyncForInfiniteScrollDatasource(){this.async||this.slottedDatasource?.assignedNodes().find(e=>e instanceof Ow)?.infiniteScroll&&(this.async=!0)}get options(){return this.async?(S.track(this,`options`),this._options):super.options}set options(e){super.options=e}filterOptions(){if(this.async){this.filteredOptions=[...this._options],this._options.forEach(e=>e.hidden=!1);return}(!this.autocomplete||this.autocomplete===Hr.none)&&(this.filter=``);let e=this.filter,t=this.caseSensitive?e:e.toLowerCase(),n=e=>{let n=this.caseSensitive?e.text:e.text.toLowerCase();return this.filterMode===`contains`?n.includes(t):n.startsWith(t)};this.filteredOptions=this._options.filter(n),this.isAutocompleteList&&(!this.filteredOptions.length&&!t&&(this.filteredOptions=this._options),this._options.forEach(e=>e.hidden=!this.filteredOptions.includes(e)))}clickHandler(e){if(!this.disabled){if(gb(e,this)){this.open=!1;return}if(_b(e,this.indicator)){this.open=!this.open,this.open&&this.control.focus();return}if(!(this.ignoreInputClick&&_b(e,this.control)))return super.clickHandler(e)}}keydownHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Enter`:if(dd(this,Ww,this.open,`f`),!this.open)return this.open=!0,!0;break;case`ArrowDown`:case`ArrowUp`:if(!this.open)return this.open=!0,!0;this.scrollWhenSelectionChanges&&this.options[this.selectedIndex]?.scrollIntoView(this.scrollWhenSelectionChangesOptions);break;case`Escape`:if(this.control.value!==this.currentValue){this.filter=``,this.filterOptions(),this.control.value=this.currentValue,this.selectItemByValue(this.currentValue),this.open=!1;return}if(!this.open)return!0}let n=super.keydownHandler(e);if(t!==`Enter`)return n}keyupHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Enter`:return!ud(this,Ww,`f`);case`ArrowDown`:case`ArrowUp`:this.open&&this.firstSelectedOption&&this.autocomplete===Hr.both&&(this.needManualChangeEventDispatch=!0,this.currentValue=this.firstSelectedOption?.value);break;case`Home`:case`End`:return;case`Backspace`:case`Delete`:let t=super.keyupHandler(e);return this.selectItemByValue(this.control.value),t}return super.keyupHandler(e)}get indicator(){return ud(this,Uw,`f`)||dd(this,Uw,this.shadowRoot.querySelector(`[part="indicator"]`),`f`),ud(this,Uw,`f`)}selectItemByValue(e){var t;this.selectedIndex=this.options?.findIndex(t=>t.text===e)??-1,(t=this.options)==null||t.forEach((e,t)=>e.selected=t===this.selectedIndex)}inputHandler(e){this.async?(this.selectedIndex=this.options.map(e=>e.text).indexOf(this.control.value),this.debouncedInputHandler()):super.inputHandler(typeof e.inputType==`string`?e:{inputType:``})}asyncSetFilter(){let e=this.control.value,t=this.slottedDatasource.assignedNodes().filter(e=>e instanceof Ow);if(t.length>0){let n=t[0];e==null||e===``?n.criteria=n.baseCriteria||``:Lb(n,e),x.queueUpdate(()=>{this.control.value=e})}else mb.warn(`Options-datasource is not connected. Please add a datasource to use this functionality.`)}manuallyDispatchChangeEvent(){this.needManualChangeEventDispatch&&this.firstSelectedOption&&this.autocomplete===Hr.both&&(this.dispatchEvent(new Event(`change`,{bubbles:!0})),this.needManualChangeEventDispatch=!1)}};Uw=/* @__PURE__ */ new WeakMap,Ww=/* @__PURE__ */ new WeakMap,q([C],Gw.prototype,`activeDescendant`,null),q([C],Gw.prototype,`slottedDatasource`,void 0),q([D({mode:`boolean`})],Gw.prototype,`async`,void 0),q([D],Gw.prototype,`debounce`,void 0),q([D({mode:`boolean`,attribute:`case-sensitive`})],Gw.prototype,`caseSensitive`,void 0),q([D({mode:`boolean`,attribute:`ignore-input-click`})],Gw.prototype,`ignoreInputClick`,void 0),q([D({attribute:`filter-mode`})],Gw.prototype,`filterMode`,void 0),q([D({mode:`boolean`,attribute:`scroll-to-selected-when-opening`})],Gw.prototype,`scrollToSelectedWhenOpening`,void 0),q([C],Gw.prototype,`scrollToSelectedWhenOpeningOptions`,void 0),q([D({mode:`boolean`,attribute:`scroll-when-selection-changes`})],Gw.prototype,`scrollWhenSelectionChanges`,void 0),q([C],Gw.prototype,`scrollWhenSelectionChangesOptions`,void 0);let Kw={delegatesFocus:!0,mode:`open`},qw={indicator:`
|
|
274
274
|
<svg
|
|
275
275
|
class="combo-box-indicator"
|
|
276
276
|
part="combo-box-indicator"
|
|
@@ -270,7 +270,7 @@ function ay(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r
|
|
|
270
270
|
</svg>
|
|
271
271
|
`,indeterminateIndicator:`
|
|
272
272
|
<div part="indeterminate-indicator" class="indeterminate-indicator"></div>
|
|
273
|
-
`};Vw.compose(Object.assign({baseName:`checkbox`,template:zw,styles:Bw,shadowOptions:void 0},Hw));let Uw=(e,t)=>O` .combo-box-indicator{transition-property: transform;transition-duration: 0.2s;transition-timing-function: ease-out}:host([open]) .combo-box-indicator{transform: rotate(180deg)}${Ql(e,t)}`,Ww=(e,t)=>T`<template aria-activedescendant="${e=>e.activeDescendant}" class="${e=>e.open?`open`:``} ${e=>e.disabled?`disabled`:``} ${e=>e.position}" ?open="${e=>e.open}" @click="${(e,t)=>e.clickHandler(t.event)}" @focusout="${(e,t)=>e.focusoutHandler(t.event)}" @keydown="${(e,t)=>e.keydownHandler(t.event)}"><div class="control" part="control">${Tt(e,t)}<slot name="control"><input aria-activedescendant="${e=>e.activeDescendant}" aria-autocomplete="${e=>e.ariaAutoComplete||e.autocomplete}" aria-controls="${e=>e.ariaControls||e.listboxId}" aria-disabled="${e=>e.disabled?`true`:`false`}" aria-expanded="${e=>e.open?`true`:`false`}" aria-haspopup="listbox" aria-labelledby="${e=>e.ariaLabelledby}" aria-label="${e=>e.ariaLabel}" autocomplete="${e=>e.autocomplete}" class="selected-value" part="selected-value" placeholder="${e=>e.placeholder}" role="combobox" type="text" ?disabled="${e=>e.disabled}" :value="${e=>e.value}" @input="${(e,t)=>e.inputHandler(t.event)}" @keyup="${(e,t)=>e.keyupHandler(t.event)}" ${k(`control`)}/><div class="indicator" part="indicator" aria-hidden="true"><slot name="indicator">${t.indicator||``}</slot></div></slot>${wt(e,t)}</div><div class="listbox" id="${e=>e.listboxId}" part="listbox" role="listbox" ?disabled="${e=>e.disabled}" ?hidden="${e=>!e.open}" ${k(`listbox`)}><slot ${k(`slottedDatasource`)} ${xt({filter:zr.slottedOptionFilter,flatten:!0,property:`slottedOptions`})}></slot></div></template>`;var Gw,Kw,qw=class extends $l{constructor(){super(...arguments),Gw.set(this,void 0),Kw.set(this,!1),this.needManualChangeEventDispatch=!1,this.async=!1,this.debounce=500,this.caseSensitive=!1,this.ignoreInputClick=!1,this.filterMode=`startsWith`,this.scrollToSelectedWhenOpening=!1,this.scrollToSelectedWhenOpeningOptions={behavior:`auto`,block:`nearest`},this.scrollWhenSelectionChanges=!1,this.scrollWhenSelectionChangesOptions={behavior:`auto`,block:`center`},this.resetCombobox=()=>{this.selectedOptions=[],this.selectedIndex=-1,this.value=``,this.control.value=``,this.filter=``,this.filterOptions()}}get activeDescendant(){if(this.selectedOptions&&this.selectedOptions.length!==0)return this.ariaActiveDescendant=this.selectedOptions[0]?.id,this.selectedOptions[0]?.id}debounceChanged(e,t){this.debouncedInputHandler=(0,Dw.default)(this.asyncSetFilter,t)}get scrollableListbox(){return this.listbox??this.shadowRoot?.querySelector(`.listbox`)}openChanged(){super.openChanged(),this.$emit(`open-change`,{open:this.open}),this.open?this.scrollToSelectedWhenOpening&&setTimeout(()=>{this.options[this.selectedIndex]?.scrollIntoView(this.scrollToSelectedWhenOpeningOptions)},500):(this.manuallyDispatchChangeEvent(),this.filter=``,this.filterOptions())}get value(){return S.track(this,`value`),this._ourValue}set value(e){if(e===void 0)return;let t=`${this._ourValue}`;if(this.$fastController.isConnected&&this.options){let t=this.caseSensitive?t=>t.text===e:t=>t.text.toLowerCase()===String(e).toLowerCase(),n=this.options?this.options.findIndex(t):-1,r=this.options[this.selectedIndex]?.text,i=this.options[n]?.text;this.selectedIndex=i&&i!==r?n:this.selectedIndex,e&&e.trim()!==``&&n===-1&&(e=this.firstSelectedOption?.text||e)}t!==e&&(this._ourValue=e,super.valueChanged(t,e),S.notify(this,`value`))}slottedOptionsChanged(e,t){this.enableAsyncForInfiniteScrollDatasource(),super.slottedOptionsChanged(e,t),this.updateValue(!1)}enableAsyncForInfiniteScrollDatasource(){this.async||this.slottedDatasource?.assignedNodes().find(e=>e instanceof Aw)?.infiniteScroll&&(this.async=!0)}get options(){return this.async?(S.track(this,`options`),this._options):super.options}set options(e){super.options=e}filterOptions(){if(this.async){this.filteredOptions=[...this._options],this._options.forEach(e=>e.hidden=!1);return}(!this.autocomplete||this.autocomplete===Hr.none)&&(this.filter=``);let e=this.filter,t=this.caseSensitive?e:e.toLowerCase(),n=e=>{let n=this.caseSensitive?e.text:e.text.toLowerCase();return this.filterMode===`contains`?n.includes(t):n.startsWith(t)};this.filteredOptions=this._options.filter(n),this.isAutocompleteList&&(!this.filteredOptions.length&&!t&&(this.filteredOptions=this._options),this._options.forEach(e=>e.hidden=!this.filteredOptions.includes(e)))}clickHandler(e){if(!this.disabled){if(bb(e,this)){this.open=!1;return}if(xb(e,this.indicator)){this.open=!this.open,this.open&&this.control.focus();return}if(!(this.ignoreInputClick&&xb(e,this.control)))return super.clickHandler(e)}}keydownHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Enter`:if(dd(this,Kw,this.open,`f`),!this.open)return this.open=!0,!0;break;case`ArrowDown`:case`ArrowUp`:if(!this.open)return this.open=!0,!0;this.scrollWhenSelectionChanges&&this.options[this.selectedIndex]?.scrollIntoView(this.scrollWhenSelectionChangesOptions);break;case`Escape`:if(this.control.value!==this.currentValue){this.filter=``,this.filterOptions(),this.control.value=this.currentValue,this.selectItemByValue(this.currentValue),this.open=!1;return}if(!this.open)return!0}let n=super.keydownHandler(e);if(t!==`Enter`)return n}keyupHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Enter`:return!ud(this,Kw,`f`);case`ArrowDown`:case`ArrowUp`:this.open&&this.firstSelectedOption&&this.autocomplete===Hr.both&&(this.needManualChangeEventDispatch=!0,this.currentValue=this.firstSelectedOption?.value);break;case`Home`:case`End`:return;case`Backspace`:case`Delete`:let t=super.keyupHandler(e);return this.selectItemByValue(this.control.value),t}return super.keyupHandler(e)}get indicator(){return ud(this,Gw,`f`)||dd(this,Gw,this.shadowRoot.querySelector(`[part="indicator"]`),`f`),ud(this,Gw,`f`)}selectItemByValue(e){var t;this.selectedIndex=this.options?.findIndex(t=>t.text===e)??-1,(t=this.options)==null||t.forEach((e,t)=>e.selected=t===this.selectedIndex)}inputHandler(e){this.async?(this.selectedIndex=this.options.map(e=>e.text).indexOf(this.control.value),this.debouncedInputHandler()):super.inputHandler(e)}asyncSetFilter(){let e=this.control.value,t=this.slottedDatasource.assignedNodes().filter(e=>e instanceof Aw);if(t.length>0){let n=t[0];e==null||e===``?n.criteria=n.baseCriteria||``:Vb(n,e),x.queueUpdate(()=>{this.control.value=e})}else vb.warn(`Options-datasource is not connected. Please add a datasource to use this functionality.`)}manuallyDispatchChangeEvent(){this.needManualChangeEventDispatch&&this.firstSelectedOption&&this.autocomplete===Hr.both&&(this.dispatchEvent(new Event(`change`,{bubbles:!0})),this.needManualChangeEventDispatch=!1)}};Gw=/* @__PURE__ */ new WeakMap,Kw=/* @__PURE__ */ new WeakMap,q([C],qw.prototype,`activeDescendant`,null),q([C],qw.prototype,`slottedDatasource`,void 0),q([D({mode:`boolean`})],qw.prototype,`async`,void 0),q([D],qw.prototype,`debounce`,void 0),q([D({mode:`boolean`,attribute:`case-sensitive`})],qw.prototype,`caseSensitive`,void 0),q([D({mode:`boolean`,attribute:`ignore-input-click`})],qw.prototype,`ignoreInputClick`,void 0),q([D({attribute:`filter-mode`})],qw.prototype,`filterMode`,void 0),q([D({mode:`boolean`,attribute:`scroll-to-selected-when-opening`})],qw.prototype,`scrollToSelectedWhenOpening`,void 0),q([C],qw.prototype,`scrollToSelectedWhenOpeningOptions`,void 0),q([D({mode:`boolean`,attribute:`scroll-when-selection-changes`})],qw.prototype,`scrollWhenSelectionChanges`,void 0),q([C],qw.prototype,`scrollWhenSelectionChangesOptions`,void 0);let Jw={delegatesFocus:!0,mode:`open`},Yw={indicator:`
|
|
273
|
+
`};Vw.compose(Object.assign({baseName:`checkbox`,template:zw,styles:Bw,shadowOptions:void 0},Hw));let Uw=(e,t)=>O` .combo-box-indicator{transition-property: transform;transition-duration: 0.2s;transition-timing-function: ease-out}:host([open]) .combo-box-indicator{transform: rotate(180deg)}${Ql(e,t)}`,Ww=(e,t)=>T`<template aria-activedescendant="${e=>e.activeDescendant}" class="${e=>e.open?`open`:``} ${e=>e.disabled?`disabled`:``} ${e=>e.position}" ?open="${e=>e.open}" @click="${(e,t)=>e.clickHandler(t.event)}" @focusout="${(e,t)=>e.focusoutHandler(t.event)}" @keydown="${(e,t)=>e.keydownHandler(t.event)}"><div class="control" part="control">${Tt(e,t)}<slot name="control"><input aria-activedescendant="${e=>e.activeDescendant}" aria-autocomplete="${e=>e.ariaAutoComplete||e.autocomplete}" aria-controls="${e=>e.ariaControls||e.listboxId}" aria-disabled="${e=>e.disabled?`true`:`false`}" aria-expanded="${e=>e.open?`true`:`false`}" aria-haspopup="listbox" aria-labelledby="${e=>e.ariaLabelledby}" aria-label="${e=>e.ariaLabel}" autocomplete="${e=>e.autocomplete}" class="selected-value" part="selected-value" placeholder="${e=>e.placeholder}" role="combobox" type="text" ?disabled="${e=>e.disabled}" :value="${e=>e.value}" @input="${(e,t)=>e.inputHandler(t.event)}" @keyup="${(e,t)=>e.keyupHandler(t.event)}" ${k(`control`)}/><div class="indicator" part="indicator" aria-hidden="true"><slot name="indicator">${t.indicator||``}</slot></div></slot>${wt(e,t)}</div><div class="listbox" id="${e=>e.listboxId}" part="listbox" role="listbox" ?disabled="${e=>e.disabled}" ?hidden="${e=>!e.open}" ${k(`listbox`)}><slot ${k(`slottedDatasource`)} ${xt({filter:zr.slottedOptionFilter,flatten:!0,property:`slottedOptions`})}></slot></div></template>`;var Gw,Kw,qw=class extends $l{constructor(){super(...arguments),Gw.set(this,void 0),Kw.set(this,!1),this.needManualChangeEventDispatch=!1,this.async=!1,this.debounce=500,this.caseSensitive=!1,this.ignoreInputClick=!1,this.filterMode=`startsWith`,this.scrollToSelectedWhenOpening=!1,this.scrollToSelectedWhenOpeningOptions={behavior:`auto`,block:`nearest`},this.scrollWhenSelectionChanges=!1,this.scrollWhenSelectionChangesOptions={behavior:`auto`,block:`center`},this.resetCombobox=()=>{this.selectedOptions=[],this.selectedIndex=-1,this.value=``,this.control.value=``,this.filter=``,this.filterOptions()}}get activeDescendant(){if(this.selectedOptions&&this.selectedOptions.length!==0)return this.ariaActiveDescendant=this.selectedOptions[0]?.id,this.selectedOptions[0]?.id}debounceChanged(e,t){this.debouncedInputHandler=(0,Dw.default)(this.asyncSetFilter,t)}get scrollableListbox(){return this.listbox??this.shadowRoot?.querySelector(`.listbox`)}openChanged(){super.openChanged(),this.$emit(`open-change`,{open:this.open}),this.open?this.scrollToSelectedWhenOpening&&setTimeout(()=>{this.options[this.selectedIndex]?.scrollIntoView(this.scrollToSelectedWhenOpeningOptions)},500):(this.manuallyDispatchChangeEvent(),this.filter=``,this.filterOptions())}get value(){return S.track(this,`value`),this._ourValue}set value(e){if(e===void 0)return;let t=`${this._ourValue}`;if(this.$fastController.isConnected&&this.options){let t=this.caseSensitive?t=>t.text===e:t=>t.text.toLowerCase()===String(e).toLowerCase(),n=this.options?this.options.findIndex(t):-1,r=this.options[this.selectedIndex]?.text,i=this.options[n]?.text;this.selectedIndex=i&&i!==r?n:this.selectedIndex,e&&e.trim()!==``&&n===-1&&(e=this.firstSelectedOption?.text||e)}t!==e&&(this._ourValue=e,super.valueChanged(t,e),S.notify(this,`value`))}slottedOptionsChanged(e,t){this.enableAsyncForInfiniteScrollDatasource(),super.slottedOptionsChanged(e,t),this.updateValue(!1)}enableAsyncForInfiniteScrollDatasource(){this.async||this.slottedDatasource?.assignedNodes().find(e=>e instanceof Aw)?.infiniteScroll&&(this.async=!0)}get options(){return this.async?(S.track(this,`options`),this._options):super.options}set options(e){super.options=e}filterOptions(){if(this.async){this.filteredOptions=[...this._options],this._options.forEach(e=>e.hidden=!1);return}(!this.autocomplete||this.autocomplete===Hr.none)&&(this.filter=``);let e=this.filter,t=this.caseSensitive?e:e.toLowerCase(),n=e=>{let n=this.caseSensitive?e.text:e.text.toLowerCase();return this.filterMode===`contains`?n.includes(t):n.startsWith(t)};this.filteredOptions=this._options.filter(n),this.isAutocompleteList&&(!this.filteredOptions.length&&!t&&(this.filteredOptions=this._options),this._options.forEach(e=>e.hidden=!this.filteredOptions.includes(e)))}clickHandler(e){if(!this.disabled){if(bb(e,this)){this.open=!1;return}if(xb(e,this.indicator)){this.open=!this.open,this.open&&this.control.focus();return}if(!(this.ignoreInputClick&&xb(e,this.control)))return super.clickHandler(e)}}keydownHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Enter`:if(dd(this,Kw,this.open,`f`),!this.open)return this.open=!0,!0;break;case`ArrowDown`:case`ArrowUp`:if(!this.open)return this.open=!0,!0;this.scrollWhenSelectionChanges&&this.options[this.selectedIndex]?.scrollIntoView(this.scrollWhenSelectionChangesOptions);break;case`Escape`:if(this.control.value!==this.currentValue){this.filter=``,this.filterOptions(),this.control.value=this.currentValue,this.selectItemByValue(this.currentValue),this.open=!1;return}if(!this.open)return!0}let n=super.keydownHandler(e);if(t!==`Enter`)return n}keyupHandler(e){let t=e.key;if(e.ctrlKey||e.shiftKey)return!0;switch(t){case`Enter`:return!ud(this,Kw,`f`);case`ArrowDown`:case`ArrowUp`:this.open&&this.firstSelectedOption&&this.autocomplete===Hr.both&&(this.needManualChangeEventDispatch=!0,this.currentValue=this.firstSelectedOption?.value);break;case`Home`:case`End`:return;case`Backspace`:case`Delete`:let t=super.keyupHandler(e);return this.selectItemByValue(this.control.value),t}return super.keyupHandler(e)}get indicator(){return ud(this,Gw,`f`)||dd(this,Gw,this.shadowRoot.querySelector(`[part="indicator"]`),`f`),ud(this,Gw,`f`)}selectItemByValue(e){var t;this.selectedIndex=this.options?.findIndex(t=>t.text===e)??-1,(t=this.options)==null||t.forEach((e,t)=>e.selected=t===this.selectedIndex)}inputHandler(e){this.async?(this.selectedIndex=this.options.map(e=>e.text).indexOf(this.control.value),this.debouncedInputHandler()):super.inputHandler(typeof e.inputType==`string`?e:{inputType:``})}asyncSetFilter(){let e=this.control.value,t=this.slottedDatasource.assignedNodes().filter(e=>e instanceof Aw);if(t.length>0){let n=t[0];e==null||e===``?n.criteria=n.baseCriteria||``:Vb(n,e),x.queueUpdate(()=>{this.control.value=e})}else vb.warn(`Options-datasource is not connected. Please add a datasource to use this functionality.`)}manuallyDispatchChangeEvent(){this.needManualChangeEventDispatch&&this.firstSelectedOption&&this.autocomplete===Hr.both&&(this.dispatchEvent(new Event(`change`,{bubbles:!0})),this.needManualChangeEventDispatch=!1)}};Gw=/* @__PURE__ */ new WeakMap,Kw=/* @__PURE__ */ new WeakMap,q([C],qw.prototype,`activeDescendant`,null),q([C],qw.prototype,`slottedDatasource`,void 0),q([D({mode:`boolean`})],qw.prototype,`async`,void 0),q([D],qw.prototype,`debounce`,void 0),q([D({mode:`boolean`,attribute:`case-sensitive`})],qw.prototype,`caseSensitive`,void 0),q([D({mode:`boolean`,attribute:`ignore-input-click`})],qw.prototype,`ignoreInputClick`,void 0),q([D({attribute:`filter-mode`})],qw.prototype,`filterMode`,void 0),q([D({mode:`boolean`,attribute:`scroll-to-selected-when-opening`})],qw.prototype,`scrollToSelectedWhenOpening`,void 0),q([C],qw.prototype,`scrollToSelectedWhenOpeningOptions`,void 0),q([D({mode:`boolean`,attribute:`scroll-when-selection-changes`})],qw.prototype,`scrollWhenSelectionChanges`,void 0),q([C],qw.prototype,`scrollWhenSelectionChangesOptions`,void 0);let Jw={delegatesFocus:!0,mode:`open`},Yw={indicator:`
|
|
274
274
|
<svg
|
|
275
275
|
class="combo-box-indicator"
|
|
276
276
|
part="combo-box-indicator"
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@genesislcap/foundation-rapid-cdn",
|
|
3
3
|
"description": "Side-effecting CDN bundle that auto-registers the Rapid Design System. Intended for AI/prototyping tools (e.g. Claude Artifacts), not for production apps.",
|
|
4
|
-
"version": "15.99.
|
|
4
|
+
"version": "15.99.4",
|
|
5
5
|
"sideEffects": true,
|
|
6
6
|
"license": "SEE LICENSE IN license.txt",
|
|
7
7
|
"unpkg": "dist/foundation-rapid-cdn.iife.min.js",
|
|
@@ -24,11 +24,11 @@
|
|
|
24
24
|
"@babel/generator": "^7.29.0",
|
|
25
25
|
"@babel/parser": "^7.29.0",
|
|
26
26
|
"@babel/traverse": "^7.29.0",
|
|
27
|
-
"@genesislcap/genx": "15.99.
|
|
27
|
+
"@genesislcap/genx": "15.99.4",
|
|
28
28
|
"rolldown": "~1.2.9"
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@genesislcap/rapid-design-system": "15.99.
|
|
31
|
+
"@genesislcap/rapid-design-system": "15.99.4"
|
|
32
32
|
},
|
|
33
33
|
"repository": {
|
|
34
34
|
"type": "git",
|