@kodaris/krubble-components 1.0.61 → 1.0.63
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/custom-elements.json +1271 -460
- package/dist/form/checkbox/checkbox.d.ts +71 -0
- package/dist/form/checkbox/checkbox.d.ts.map +1 -0
- package/dist/form/checkbox/checkbox.js +304 -0
- package/dist/form/checkbox/checkbox.js.map +1 -0
- package/dist/form/index.d.ts +2 -0
- package/dist/form/index.d.ts.map +1 -1
- package/dist/form/index.js +2 -0
- package/dist/form/index.js.map +1 -1
- package/dist/form/radio-cards/radio-cards.d.ts +81 -0
- package/dist/form/radio-cards/radio-cards.d.ts.map +1 -0
- package/dist/form/radio-cards/radio-cards.js +388 -0
- package/dist/form/radio-cards/radio-cards.js.map +1 -0
- package/dist/index.d.ts +2 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/krubble-components.bundled.js +892 -210
- package/dist/krubble-components.bundled.js.map +1 -1
- package/dist/krubble-components.bundled.min.js +384 -117
- package/dist/krubble-components.bundled.min.js.map +1 -1
- package/dist/krubble-components.umd.js +891 -209
- package/dist/krubble-components.umd.js.map +1 -1
- package/dist/krubble-components.umd.min.js +342 -75
- package/dist/krubble-components.umd.min.js.map +1 -1
- package/package.json +17 -1
package/custom-elements.json
CHANGED
|
@@ -214,6 +214,22 @@
|
|
|
214
214
|
"name": "KRComboBox",
|
|
215
215
|
"module": "./form/index.js"
|
|
216
216
|
}
|
|
217
|
+
},
|
|
218
|
+
{
|
|
219
|
+
"kind": "js",
|
|
220
|
+
"name": "KRRadioCards",
|
|
221
|
+
"declaration": {
|
|
222
|
+
"name": "KRRadioCards",
|
|
223
|
+
"module": "./form/index.js"
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
{
|
|
227
|
+
"kind": "js",
|
|
228
|
+
"name": "KRCheckbox",
|
|
229
|
+
"declaration": {
|
|
230
|
+
"name": "KRCheckbox",
|
|
231
|
+
"module": "./form/index.js"
|
|
232
|
+
}
|
|
217
233
|
}
|
|
218
234
|
]
|
|
219
235
|
},
|
|
@@ -633,6 +649,18 @@
|
|
|
633
649
|
"kind": "variable",
|
|
634
650
|
"name": "KRComboBox",
|
|
635
651
|
"default": "class KRComboBox extends i$2 { constructor() { super(); this._requestId = 0; this._selectedOption = null; this._handleDocumentClick = (e) => { if (!e.composedPath().includes(this)) { this._close(); } }; this.label = ''; this.name = ''; this.value = ''; this.placeholder = 'Select an option'; this.disabled = false; this.readonly = false; this.required = false; this.hint = ''; this.optionValue = 'value'; this.optionLabel = 'label'; this.options = []; this.fetch = null; this.fetchSelection = null; this._isOpen = false; this._highlightedIndex = -1; this._touched = false; this._searchQuery = ''; this._loading = false; this._handleInvalid = (e) => { e.preventDefault(); this._touched = true; }; this._internals = this.attachInternals(); } connectedCallback() { super.connectedCallback(); document.addEventListener('click', this._handleDocumentClick); this.addEventListener('invalid', this._handleInvalid); } disconnectedCallback() { super.disconnectedCallback(); document.removeEventListener('click', this._handleDocumentClick); this.removeEventListener('invalid', this._handleInvalid); } firstUpdated() { this._updateValidity(); if (this.value && this.fetchSelection) { this._resolveSelection(); } } updated(changedProperties) { if (changedProperties.has('required') || changedProperties.has('value')) { this._updateValidity(); } if (changedProperties.has('value')) { if (this.value) { // Only resolve if the selected option doesn't match the current value if (!this._selectedOption || this._getOptionValue(this._selectedOption) !== this.value) { this._resolveSelection(); } } else { this._selectedOption = null; } } if (changedProperties.has('options') && this._isOpen) { this._positionDropdown(); } } get form() { return this._internals.form; } get validity() { return this._internals.validity; } get validationMessage() { return this._internals.validationMessage; } checkValidity() { return this._internals.checkValidity(); } reportValidity() { return this._internals.reportValidity(); } formResetCallback() { this.value = ''; this._selectedOption = null; this._touched = false; this._isOpen = false; this._highlightedIndex = -1; this._searchQuery = ''; this._internals.setFormValue(''); this._internals.setValidity({}); } formStateRestoreCallback(state) { this.value = state; } focus() { if (!this._isOpen) { this._open(); } } blur() { this._triggerElement?.blur(); } _updateValidity() { if (this.required && !this.value) { this._internals.setValidity({ valueMissing: true }, 'Please select an option', this._triggerElement); } else { this._internals.setValidity({}); } } _handleTriggerClick() { if (this.disabled || this.readonly) { return; } if (this._isOpen) { this._close(); } else { this._open(); } } _open() { this._isOpen = true; this._searchQuery = ''; this._highlightedIndex = -1; this._fetch(); this.updateComplete.then(() => { this._positionDropdown(); if (this._searchInput) { this._searchInput.focus(); } }); } _close() { this._isOpen = false; this._highlightedIndex = -1; this._searchQuery = ''; } _positionDropdown() { requestAnimationFrame(() => { const dropdown = this.shadowRoot?.querySelector('.dropdown'); if (!dropdown) { return; } const triggerRect = this._triggerElement.getBoundingClientRect(); const spaceBelow = window.innerHeight - triggerRect.bottom - 4 - 8; const spaceAbove = triggerRect.top - 4 - 8; dropdown.style.left = triggerRect.left + 'px'; dropdown.style.width = triggerRect.width + 'px'; // Prefer opening below; only flip above when space below is tight if (spaceBelow < 200 && spaceAbove > spaceBelow) { dropdown.style.top = ''; dropdown.style.bottom = (window.innerHeight - triggerRect.top + 4) + 'px'; dropdown.style.maxHeight = spaceAbove + 'px'; } else { dropdown.style.bottom = ''; dropdown.style.top = triggerRect.bottom + 4 + 'px'; dropdown.style.maxHeight = spaceBelow + 'px'; } }); } _fetch() { if (!this.fetch) { return; } this._loading = true; this._requestId++; const requestId = this._requestId; this.fetch(this._searchQuery).then((options) => { if (requestId === this._requestId) { this.options = options; this._loading = false; } }).catch((error) => { console.error('kr-combo-box: fetch failed', error); this._loading = false; }); } _handleSearchInput(e) { this._searchQuery = e.target.value; this._highlightedIndex = -1; this._fetch(); } _handleSearchKeyDown(e) { switch (e.key) { case 'ArrowDown': e.preventDefault(); this._highlightedIndex = Math.min(this._highlightedIndex + 1, this.options.length - 1); this._scrollToHighlighted(); break; case 'ArrowUp': e.preventDefault(); if (this._highlightedIndex === -1) { this._highlightedIndex = this.options.length - 1; } else { this._highlightedIndex = Math.max(this._highlightedIndex - 1, 0); } this._scrollToHighlighted(); break; case 'Enter': e.preventDefault(); if (this._highlightedIndex >= 0 && this.options[this._highlightedIndex]) { this._selectOption(this.options[this._highlightedIndex]); } break; case 'Escape': e.preventDefault(); this._close(); this._triggerElement?.focus(); break; case 'Tab': this._close(); break; } } _handleTriggerKeyDown(e) { if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter' || e.key === ' ') { e.preventDefault(); if (!this._isOpen) { this._open(); } } } _handleTriggerBlur() { this._touched = true; this._updateValidity(); } _scrollToHighlighted() { this.updateComplete.then(() => { const container = this.shadowRoot?.querySelector('.options'); const highlighted = this.shadowRoot?.querySelector('.option--highlighted'); if (container && highlighted) { const containerRect = container.getBoundingClientRect(); const highlightedRect = highlighted.getBoundingClientRect(); if (highlightedRect.bottom > containerRect.bottom) { highlighted.scrollIntoView({ block: 'nearest' }); } else if (highlightedRect.top < containerRect.top) { highlighted.scrollIntoView({ block: 'nearest' }); } } }); } _getOptionValue(option) { if (typeof this.optionValue === 'function') { return this.optionValue(option); } return option[this.optionValue]; } _getOptionLabel(option) { let label; if (typeof this.optionLabel === 'function') { label = this.optionLabel(option); } else { label = option[this.optionLabel]; } if (!label) { return this._getOptionValue(option); } return label; } _resolveSelection() { if (!this.fetchSelection) { return; } const fetchedValue = this.value; this.fetchSelection(this.value).then((option) => { if (this.value !== fetchedValue) { return; } if (!option) { return; } this._selectedOption = option; this.requestUpdate(); }).catch((error) => { console.error('kr-combo-box: fetchSelection failed', error); }); } _selectOption(option) { if (option.disabled) { return; } this.value = this._getOptionValue(option); this._selectedOption = option; this._close(); this._internals.setFormValue(this.value); this._updateValidity(); this.dispatchEvent(new CustomEvent('select', { detail: { option: option }, bubbles: true, composed: true, })); this.dispatchEvent(new Event('change', { bubbles: true, composed: true })); this._triggerElement?.focus(); } _handleOptionMouseEnter(e, index) { this._highlightedIndex = index; } _renderOption(option, index) { const optionValue = this._getOptionValue(option); return b ` <button class=${e$1({ option: true, 'option--highlighted': index === this._highlightedIndex, 'option--selected': optionValue === this.value, })} type=\"button\" role=\"option\" aria-selected=${optionValue === this.value} ?disabled=${option.disabled} @click=${(e) => this._selectOption(option)} @mouseenter=${(e) => this._handleOptionMouseEnter(e, index)} > ${this._getOptionLabel(option)} </button> `; } render() { let footer = A; if (this._touched && this.required && !this.value) { footer = b `<div class=\"validation-message\">Please select an option</div>`; } else if (this.hint) { footer = b `<div class=\"hint\">${this.hint}</div>`; } return b ` <div class=\"wrapper\"> ${this.label ? b ` <label> ${this.label} ${this.required ? b `<span class=\"required\">*</span>` : A} </label> ` : A} <button class=${e$1({ trigger: true, 'trigger--open': this._isOpen, 'trigger--invalid': this._touched && this.required && !this.value, })} type=\"button\" ?disabled=${this.disabled} aria-haspopup=\"listbox\" aria-expanded=${this._isOpen} @click=${this._handleTriggerClick} @keydown=${this._handleTriggerKeyDown} @blur=${this._handleTriggerBlur} > <span class=${e$1({ trigger__value: true, trigger__placeholder: !this._selectedOption, })}> ${this._selectedOption ? this._getOptionLabel(this._selectedOption) : this.placeholder} </span> <svg class=${e$1({ trigger__icon: true, 'trigger__icon--open': this._isOpen, })} viewBox=\"0 0 24 24\" fill=\"currentColor\" > <path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z\"/> </svg> </button> <div role=\"listbox\" class=${e$1({ dropdown: true, 'dropdown--open': this._isOpen, })} > <div class=\"search\"> <div class=\"search__field\"> <input class=\"search__input\" type=\"text\" placeholder=\"Search...\" .value=${this._searchQuery} @input=${this._handleSearchInput} @keydown=${this._handleSearchKeyDown} /> <svg class=\"search__icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/> </svg> </div> </div> <div class=\"options\"> ${this._loading ? b `<div class=\"empty\">Loading...</div>` : this.options.length === 0 ? b `<div class=\"empty\">No options found</div>` : this.options.map((option, index) => this._renderOption(option, index))} </div> </div> ${footer} </div> `; } }"
|
|
652
|
+
},
|
|
653
|
+
{
|
|
654
|
+
"kind": "variable",
|
|
655
|
+
"name": "KRRadioCards",
|
|
656
|
+
"default": "class KRRadioCards extends i$2 { constructor() { super(); this._focusedIndex = -1; /** * The label text above the cards */ this.label = ''; /** * The input name for form submission */ this.name = ''; /** * The currently selected value */ this.value = ''; /** * The card options to display */ this.options = []; /** * Whether the field is disabled */ this.disabled = false; /** * Whether the field is required */ this.required = false; /** * Helper text shown below the cards */ this.hint = ''; /** * Layout direction: 'row' or 'column' */ this.direction = 'row'; this._touched = false; this._handleInvalid = (e) => { e.preventDefault(); this._touched = true; }; this._internals = this.attachInternals(); } // Form-associated custom element callbacks get form() { return this._internals.form; } get validity() { return this._internals.validity; } get validationMessage() { return this._internals.validationMessage; } get willValidate() { return this._internals.willValidate; } checkValidity() { return this._internals.checkValidity(); } reportValidity() { return this._internals.reportValidity(); } formResetCallback() { this.value = ''; this._touched = false; this._internals.setFormValue(''); this._internals.setValidity({}); } formStateRestoreCallback(state) { this.value = state; } connectedCallback() { super.connectedCallback(); this.addEventListener('invalid', this._handleInvalid); } disconnectedCallback() { super.disconnectedCallback(); this.removeEventListener('invalid', this._handleInvalid); } firstUpdated() { this._updateValidity(); } updated(changedProperties) { if (changedProperties.has('required') || changedProperties.has('value')) { this._updateValidity(); } } _updateValidity() { if (this.required && !this.value) { this._internals.setValidity({ valueMissing: true }, 'Please select an option'); } else { this._internals.setValidity({}); } } _handleCardClick(e, option) { if (this.disabled || option.disabled) { return; } this.value = option.value; this._touched = true; this._internals.setFormValue(this.value); this._updateValidity(); this.dispatchEvent(new Event('change', { bubbles: true, composed: true })); } _handleKeyDown(e, index) { if (this.disabled) { return; } if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); if (!this.options[index].disabled) { this._handleCardClick(e, this.options[index]); } return; } let nextIndex = -1; if (this.direction === 'row') { if (e.key === 'ArrowRight') { nextIndex = this._findNextEnabledIndex(index, 1); } else if (e.key === 'ArrowLeft') { nextIndex = this._findNextEnabledIndex(index, -1); } } else { if (e.key === 'ArrowDown') { nextIndex = this._findNextEnabledIndex(index, 1); } else if (e.key === 'ArrowUp') { nextIndex = this._findNextEnabledIndex(index, -1); } } if (nextIndex >= 0) { e.preventDefault(); this._focusedIndex = nextIndex; const cards = this.shadowRoot?.querySelectorAll('.card'); if (cards[nextIndex]) { cards[nextIndex].focus(); } } } _findNextEnabledIndex(current, step) { let next = current + step; while (next >= 0 && next < this.options.length) { if (!this.options[next].disabled) { return next; } next += step; } return -1; } render() { return b ` <div class=\"wrapper\"> ${this.label ? b ` <label> ${this.label} ${this.required ? b `<span class=\"required\" aria-hidden=\"true\">*</span>` : A} </label> ` : A} <div class=${e$1({ 'cards': true, 'cards--row': this.direction === 'row', 'cards--column': this.direction === 'column', })} role=\"radiogroup\" aria-label=${this.label} > ${this.options.map((option, index) => { const isSelected = option.value === this.value; const isDisabled = this.disabled || !!option.disabled; return b ` <div class=${e$1({ 'card': true, 'card--selected': isSelected, 'card--disabled': isDisabled, })} role=\"radio\" aria-checked=${isSelected} aria-disabled=${isDisabled} tabindex=${isDisabled ? -1 : 0} @click=${(e) => this._handleCardClick(e, option)} @keydown=${(e) => this._handleKeyDown(e, index)} > <div class=\"card__radio\"> ${isSelected ? b `<div class=\"card__radio-dot\"></div>` : A} </div> <div class=\"card__content\"> <div class=\"card__label\">${option.label}</div> ${option.description ? b `<div class=\"card__description\">${option.description}</div>` : A} </div> </div> `; })} </div> ${this._touched && this.required && !this.value ? b `<div class=\"validation-message\">Please select an option</div>` : this.hint ? b `<div class=\"hint\">${this.hint}</div>` : A} </div> `; } }",
|
|
657
|
+
"description": "A card-style radio group for selecting between a small number of options.\nEach option renders as a bordered card with a radio indicator, label, and optional description.\n\nUses ElementInternals for form association, allowing the component\nto participate in form submission, validation, and reset."
|
|
658
|
+
},
|
|
659
|
+
{
|
|
660
|
+
"kind": "variable",
|
|
661
|
+
"name": "KRCheckbox",
|
|
662
|
+
"default": "class KRCheckbox extends i$2 { constructor() { super(); /** * The checkbox label text */ this.label = ''; /** * The input name for form submission */ this.name = ''; /** * The value submitted when checked */ this.value = 'on'; /** * Whether the checkbox is checked */ this.checked = false; /** * Whether the checkbox is disabled */ this.disabled = false; /** * Whether the checkbox is required */ this.required = false; /** * Helper text shown below the checkbox */ this.hint = ''; this._touched = false; this._handleInvalid = (e) => { e.preventDefault(); this._touched = true; }; this._internals = this.attachInternals(); } // Form-associated custom element callbacks get form() { return this._internals.form; } get validity() { return this._internals.validity; } get validationMessage() { return this._internals.validationMessage; } get willValidate() { return this._internals.willValidate; } checkValidity() { return this._internals.checkValidity(); } reportValidity() { return this._internals.reportValidity(); } formResetCallback() { this.checked = false; this._touched = false; this._internals.setFormValue(''); this._internals.setValidity({}); } formStateRestoreCallback(state) { this.checked = state === this.value; } connectedCallback() { super.connectedCallback(); this.addEventListener('invalid', this._handleInvalid); } disconnectedCallback() { super.disconnectedCallback(); this.removeEventListener('invalid', this._handleInvalid); } firstUpdated() { this._syncFormValue(); this._updateValidity(); } updated(changedProperties) { if (changedProperties.has('checked') || changedProperties.has('value')) { this._syncFormValue(); } if (changedProperties.has('required') || changedProperties.has('checked')) { this._updateValidity(); } } _syncFormValue() { if (this.checked) { this._internals.setFormValue(this.value); } else { this._internals.setFormValue(''); } } _updateValidity() { if (this.required && !this.checked) { this._internals.setValidity({ valueMissing: true }, 'This field is required'); } else { this._internals.setValidity({}); } } _handleClick(e) { if (this.disabled) { return; } this.checked = !this.checked; this._touched = true; this.dispatchEvent(new Event('change', { bubbles: true, composed: true })); } _handleKeyDown(e) { if (this.disabled) { return; } if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); this._handleClick(e); } } render() { return b ` <div class=\"wrapper\"> <div class=${e$1({ 'checkbox': true, 'checkbox--disabled': this.disabled, })} role=\"checkbox\" aria-checked=${this.checked} aria-disabled=${this.disabled} aria-label=${this.label} tabindex=${this.disabled ? -1 : 0} @click=${this._handleClick} @keydown=${this._handleKeyDown} > <div class=${e$1({ 'checkbox__box': true, 'checkbox__box--checked': this.checked, 'checkbox__box--invalid': this._touched && this.required && !this.checked, })}> <svg class=${e$1({ 'checkbox__check': true, 'checkbox__check--hidden': !this.checked, })} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <polyline points=\"20 6 9 17 4 12\"></polyline> </svg> </div> ${this.label ? b ` <span class=\"checkbox__label\"> ${this.label} ${this.required ? b `<span class=\"required\" aria-hidden=\"true\">*</span>` : A} </span> ` : A} </div> ${this._touched && this.required && !this.checked ? b `<div class=\"validation-message\">This field is required</div>` : this.hint ? b `<div class=\"hint\">${this.hint}</div>` : A} </div> `; } focus() { this.shadowRoot?.querySelector('.checkbox')?.focus(); } blur() { this.shadowRoot?.querySelector('.checkbox')?.blur(); } }",
|
|
663
|
+
"description": "A checkbox component that works with native browser forms.\n\nUses ElementInternals for form association, allowing the component\nto participate in form submission, validation, and reset."
|
|
636
664
|
}
|
|
637
665
|
],
|
|
638
666
|
"exports": [
|
|
@@ -684,6 +712,14 @@
|
|
|
684
712
|
"module": "dist/krubble-components.bundled.js"
|
|
685
713
|
}
|
|
686
714
|
},
|
|
715
|
+
{
|
|
716
|
+
"kind": "js",
|
|
717
|
+
"name": "KRCheckbox",
|
|
718
|
+
"declaration": {
|
|
719
|
+
"name": "KRCheckbox",
|
|
720
|
+
"module": "dist/krubble-components.bundled.js"
|
|
721
|
+
}
|
|
722
|
+
},
|
|
687
723
|
{
|
|
688
724
|
"kind": "js",
|
|
689
725
|
"name": "KRCodeDemo",
|
|
@@ -764,6 +800,14 @@
|
|
|
764
800
|
"module": "dist/krubble-components.bundled.js"
|
|
765
801
|
}
|
|
766
802
|
},
|
|
803
|
+
{
|
|
804
|
+
"kind": "js",
|
|
805
|
+
"name": "KRRadioCards",
|
|
806
|
+
"declaration": {
|
|
807
|
+
"name": "KRRadioCards",
|
|
808
|
+
"module": "dist/krubble-components.bundled.js"
|
|
809
|
+
}
|
|
810
|
+
},
|
|
767
811
|
{
|
|
768
812
|
"kind": "js",
|
|
769
813
|
"name": "KRSelectField",
|
|
@@ -883,32 +927,32 @@
|
|
|
883
927
|
{
|
|
884
928
|
"kind": "variable",
|
|
885
929
|
"name": "ve",
|
|
886
|
-
"default": "class extends ae{constructor(){super(...arguments),this.header=\"\",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return
|
|
930
|
+
"default": "class extends ae{constructor(){super(...arguments),this.header=\"\",this.expanded=!1}toggle(){this.expanded=!this.expanded}render(){return j` <div class=\"header\" @click=${this.toggle}> <span class=\"header__title\">${this.header}</span> <svg class=\"header__icon\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <path d=\"M6 9l6 6 6-6\"/> </svg> </div> <div class=\"content\"> <div class=\"content__inner\"> <div class=\"content__body\"> <slot></slot> </div> </div> </div> `}}"
|
|
887
931
|
},
|
|
888
932
|
{
|
|
889
933
|
"kind": "variable",
|
|
890
934
|
"name": "Ce",
|
|
891
|
-
"default": "class extends ae{constructor(){super(...arguments),this.type=\"info\",this.title=\"\",this.dismissible=!1,this.visible=!0}_handleDismiss(){this.visible=!1,this.dispatchEvent(new CustomEvent(\"dismiss\",{bubbles:!0,composed:!0}))}render(){const e={info:
|
|
935
|
+
"default": "class extends ae{constructor(){super(...arguments),this.type=\"info\",this.title=\"\",this.dismissible=!1,this.visible=!0}_handleDismiss(){this.visible=!1,this.dispatchEvent(new CustomEvent(\"dismiss\",{bubbles:!0,composed:!0}))}render(){const e={info:j`<svg class=\"icon\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a1 1 0 000 2v3a1 1 0 001 1h1a1 1 0 100-2v-3a1 1 0 00-1-1H9z\" clip-rule=\"evenodd\"/></svg>`,success:j`<svg class=\"icon\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zm3.707-9.293a1 1 0 00-1.414-1.414L9 10.586 7.707 9.293a1 1 0 00-1.414 1.414l2 2a1 1 0 001.414 0l4-4z\" clip-rule=\"evenodd\"/></svg>`,warning:j`<svg class=\"icon\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M8.257 3.099c.765-1.36 2.722-1.36 3.486 0l5.58 9.92c.75 1.334-.213 2.98-1.742 2.98H4.42c-1.53 0-2.493-1.646-1.743-2.98l5.58-9.92zM11 13a1 1 0 11-2 0 1 1 0 012 0zm-1-8a1 1 0 00-1 1v3a1 1 0 002 0V6a1 1 0 00-1-1z\" clip-rule=\"evenodd\"/></svg>`,error:j`<svg class=\"icon\" viewBox=\"0 0 20 20\" fill=\"currentColor\"><path fill-rule=\"evenodd\" d=\"M10 18a8 8 0 100-16 8 8 0 000 16zM8.707 7.293a1 1 0 00-1.414 1.414L8.586 10l-1.293 1.293a1 1 0 101.414 1.414L10 11.414l1.293 1.293a1 1 0 001.414-1.414L11.414 10l1.293-1.293a1 1 0 00-1.414-1.414L10 8.586 8.707 7.293z\" clip-rule=\"evenodd\"/></svg>`};return j` <div class=${we({alert:!0,[\"alert--\"+this.type]:!0,\"alert--has-header\":!!this.title,\"alert--hidden\":!this.visible})} role=\"alert\" > ${e[this.type]} <div class=\"content\"> ${this.title?j`<h4 class=\"header\">${this.title}</h4>`:U} <div class=\"message\"> <slot></slot> </div> </div> ${this.dismissible?j` <button class=\"dismiss\" type=\"button\" aria-label=\"Dismiss alert\" @click=${this._handleDismiss} > <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" width=\"16\" height=\"16\"> <path fill-rule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clip-rule=\"evenodd\"/> </svg> </button> `:U} </div> `}}"
|
|
892
936
|
},
|
|
893
937
|
{
|
|
894
938
|
"kind": "variable",
|
|
895
939
|
"name": "Ee",
|
|
896
|
-
"default": "class extends ae{constructor(){super(...arguments),this.variant=\"flat\",this.color=\"primary\",this.size=\"medium\",this.disabled=!1,this.options=[],this.iconPosition=\"left\",this._state=\"idle\",this._stateText=\"\",this._dropdownOpened=!1,this._handleHostClick=e=>{this.options.length&&(e.stopPropagation(),this._toggleDropdown())},this._handleKeydown=e=>{\"Enter\"!==e.key&&\" \"!==e.key||(e.preventDefault(),this.options.length?this._toggleDropdown():this.click()),\"Escape\"===e.key&&this._dropdownOpened&&(this._dropdownOpened=!1)},this._handleClickOutside=e=>{this._dropdownOpened&&!this.contains(e.target)&&(this._dropdownOpened=!1)}}connectedCallback(){super.connectedCallback(),this.setAttribute(\"role\",this.href?\"link\":\"button\"),this.setAttribute(\"tabindex\",\"0\"),this.addEventListener(\"keydown\",this._handleKeydown),this.addEventListener(\"click\",this._handleHostClick),document.addEventListener(\"click\",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(\"keydown\",this._handleKeydown),this.removeEventListener(\"click\",this._handleHostClick),document.removeEventListener(\"click\",this._handleClickOutside)}_toggleDropdown(){this._dropdownOpened=!this._dropdownOpened,this._dropdownOpened&&requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(\".dropdown\");if(e){const t=this.getBoundingClientRect();e.style.top=t.bottom+4+\"px\",e.style.bottom=\"\",e.style.left=t.left+\"px\",e.style.right=\"\",e.style.minWidth=t.width+\"px\",e.style.transformOrigin=\"top left\";const i=e.getBoundingClientRect();i.bottom>window.innerHeight?(e.style.top=\"\",e.style.bottom=window.innerHeight-t.top+4+\"px\",e.style.transformOrigin=\"bottom left\",e.classList.add(\"dropdown--above\")):e.classList.remove(\"dropdown--above\"),i.right>window.innerWidth&&(e.style.left=\"\",e.style.right=window.innerWidth-t.right+\"px\",i.bottom>window.innerHeight?e.style.transformOrigin=\"bottom right\":e.style.transformOrigin=\"top right\")}}))}_handleOptionClick(e,t){t.stopPropagation(),this._dropdownOpened=!1,this.dispatchEvent(new CustomEvent(\"option-select\",{detail:{id:e.id,label:e.label},bubbles:!0,composed:!0}))}showLoading(){this._clearStateTimeout(),this._state=\"loading\",this._stateText=\"\"}showSuccess(e=\"Success\",t=2e3){this._clearStateTimeout(),this._state=\"success\",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}showError(e=\"Error\",t=2e3){this._clearStateTimeout(),this._state=\"error\",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}isLoading(){return\"loading\"===this._state}reset(){this._clearStateTimeout(),this._state=\"idle\",this._stateText=\"\"}_clearStateTimeout(){this._stateTimeout&&(clearTimeout(this._stateTimeout),this._stateTimeout=void 0)}updated(e){this.classList.toggle(\"kr-button--loading\",\"loading\"===this._state),this.classList.toggle(\"kr-button--success\",\"success\"===this._state),this.classList.toggle(\"kr-button--error\",\"error\"===this._state),this.classList.toggle(`kr-button--${this.variant}`,!0),this.classList.toggle(`kr-button--${this.color}`,!0),this.classList.toggle(\"kr-button--small\",\"small\"===this.size),this.classList.toggle(\"kr-button--large\",\"large\"===this.size)}render(){const e=
|
|
940
|
+
"default": "class extends ae{constructor(){super(...arguments),this.variant=\"flat\",this.color=\"primary\",this.size=\"medium\",this.disabled=!1,this.options=[],this.iconPosition=\"left\",this._state=\"idle\",this._stateText=\"\",this._dropdownOpened=!1,this._handleHostClick=e=>{this.options.length&&(e.stopPropagation(),this._toggleDropdown())},this._handleKeydown=e=>{\"Enter\"!==e.key&&\" \"!==e.key||(e.preventDefault(),this.options.length?this._toggleDropdown():this.click()),\"Escape\"===e.key&&this._dropdownOpened&&(this._dropdownOpened=!1)},this._handleClickOutside=e=>{this._dropdownOpened&&!this.contains(e.target)&&(this._dropdownOpened=!1)}}connectedCallback(){super.connectedCallback(),this.setAttribute(\"role\",this.href?\"link\":\"button\"),this.setAttribute(\"tabindex\",\"0\"),this.addEventListener(\"keydown\",this._handleKeydown),this.addEventListener(\"click\",this._handleHostClick),document.addEventListener(\"click\",this._handleClickOutside)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(\"keydown\",this._handleKeydown),this.removeEventListener(\"click\",this._handleHostClick),document.removeEventListener(\"click\",this._handleClickOutside)}_toggleDropdown(){this._dropdownOpened=!this._dropdownOpened,this._dropdownOpened&&requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(\".dropdown\");if(e){const t=this.getBoundingClientRect();e.style.top=t.bottom+4+\"px\",e.style.bottom=\"\",e.style.left=t.left+\"px\",e.style.right=\"\",e.style.minWidth=t.width+\"px\",e.style.transformOrigin=\"top left\";const i=e.getBoundingClientRect();i.bottom>window.innerHeight?(e.style.top=\"\",e.style.bottom=window.innerHeight-t.top+4+\"px\",e.style.transformOrigin=\"bottom left\",e.classList.add(\"dropdown--above\")):e.classList.remove(\"dropdown--above\"),i.right>window.innerWidth&&(e.style.left=\"\",e.style.right=window.innerWidth-t.right+\"px\",i.bottom>window.innerHeight?e.style.transformOrigin=\"bottom right\":e.style.transformOrigin=\"top right\")}}))}_handleOptionClick(e,t){t.stopPropagation(),this._dropdownOpened=!1,this.dispatchEvent(new CustomEvent(\"option-select\",{detail:{id:e.id,label:e.label},bubbles:!0,composed:!0}))}showLoading(){this._clearStateTimeout(),this._state=\"loading\",this._stateText=\"\"}showSuccess(e=\"Success\",t=2e3){this._clearStateTimeout(),this._state=\"success\",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}showError(e=\"Error\",t=2e3){this._clearStateTimeout(),this._state=\"error\",this._stateText=e,t>0&&(this._stateTimeout=window.setTimeout((()=>this.reset()),t))}isLoading(){return\"loading\"===this._state}reset(){this._clearStateTimeout(),this._state=\"idle\",this._stateText=\"\"}_clearStateTimeout(){this._stateTimeout&&(clearTimeout(this._stateTimeout),this._stateTimeout=void 0)}updated(e){this.classList.toggle(\"kr-button--loading\",\"loading\"===this._state),this.classList.toggle(\"kr-button--success\",\"success\"===this._state),this.classList.toggle(\"kr-button--error\",\"error\"===this._state),this.classList.toggle(`kr-button--${this.variant}`,!0),this.classList.toggle(`kr-button--${this.color}`,!0),this.classList.toggle(\"kr-button--small\",\"small\"===this.size),this.classList.toggle(\"kr-button--large\",\"large\"===this.size)}render(){const e=j` <span class=\"content\"> <slot name=\"icon\"></slot> <slot></slot> </span> ${this.options.length?j`<svg class=\"caret\" xmlns=\"http://www.w3.org/2000/svg\" height=\"20\" width=\"20\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z\"/></svg>`:U} ${\"idle\"!==this._state?j`<span class=\"state-overlay\"> ${\"loading\"===this._state?j`<span class=\"spinner\"></span>`:this._stateText} </span>`:U} ${this.options.length?j` <div class=\"dropdown ${this._dropdownOpened?\"dropdown--opened\":\"\"}\"> ${this.options.map((e=>j` <button class=\"dropdown-item\" @click=${t=>this._handleOptionClick(e,t)} >${e.label}</button> `))} </div> `:U} `;return this.href?j`<a class=\"link\" href=${this.href} target=${this.target||U}>${e}</a>`:e}}"
|
|
897
941
|
},
|
|
898
942
|
{
|
|
899
943
|
"kind": "variable",
|
|
900
944
|
"name": "De",
|
|
901
|
-
"default": "class extends ae{constructor(){super(...arguments),this.language=\"html\",this.code=\"\",this.activeTab=\"preview\",this.copied=!1,this.highlightedCode=\"\"}connectedCallback(){super.connectedCallback(),requestAnimationFrame((()=>{this.code||(this.code=this.innerHTML.trim().replace(/=\"\"(?=[\\s>])/g,\"\")),this.querySelectorAll(\"script\").forEach((e=>{const t=document.createElement(\"script\");t.textContent=e.textContent,e.replaceWith(t)})),this.code&&window.hljs&&window.hljs.getLanguage(this.language)?this.highlightedCode=window.hljs.highlight(this.code,{language:this.language}).value:this.highlightedCode=this.code.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\")}))}activateTab(e){this.activeTab=e}copyCode(){this.code&&navigator.clipboard.writeText(this.code).then((()=>{this.copied=!0,setTimeout((()=>{this.copied=!1}),2e3)}))}render(){return
|
|
945
|
+
"default": "class extends ae{constructor(){super(...arguments),this.language=\"html\",this.code=\"\",this.activeTab=\"preview\",this.copied=!1,this.highlightedCode=\"\"}connectedCallback(){super.connectedCallback(),requestAnimationFrame((()=>{this.code||(this.code=this.innerHTML.trim().replace(/=\"\"(?=[\\s>])/g,\"\")),this.querySelectorAll(\"script\").forEach((e=>{const t=document.createElement(\"script\");t.textContent=e.textContent,e.replaceWith(t)})),this.code&&window.hljs&&window.hljs.getLanguage(this.language)?this.highlightedCode=window.hljs.highlight(this.code,{language:this.language}).value:this.highlightedCode=this.code.replace(/&/g,\"&\").replace(/</g,\"<\").replace(/>/g,\">\")}))}activateTab(e){this.activeTab=e}copyCode(){this.code&&navigator.clipboard.writeText(this.code).then((()=>{this.copied=!0,setTimeout((()=>{this.copied=!1}),2e3)}))}render(){return j` <div class=\"tabs\"> <button class=${we({tab:!0,\"tab--active\":\"preview\"===this.activeTab})} @click=${()=>this.activateTab(\"preview\")} > Preview </button> <button class=${we({tab:!0,\"tab--active\":\"code\"===this.activeTab})} @click=${()=>this.activateTab(\"code\")} > Code </button> <button class=${we({copy:!0,\"copy--success\":this.copied})} @click=${this.copyCode} title=${this.copied?\"Copied!\":\"Copy code\"} > ${this.copied?j`<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><polyline points=\"20 6 9 17 4 12\"></polyline></svg>`:j`<svg width=\"18\" height=\"18\" viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\"><rect x=\"9\" y=\"9\" width=\"13\" height=\"13\" rx=\"2\" ry=\"2\"></rect><path d=\"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1\"></path></svg>`} </button> </div> <div class=${we({panel:!0,\"panel--active\":\"preview\"===this.activeTab,\"panel--preview\":!0})}> <slot></slot> </div> <div class=${we({panel:!0,\"panel--active\":\"code\"===this.activeTab,\"panel--code\":!0})}> <pre class=\"code\"><code>${Oe(this.highlightedCode)}</code></pre> </div> `}}"
|
|
902
946
|
},
|
|
903
947
|
{
|
|
904
948
|
"kind": "variable",
|
|
905
949
|
"name": "Pe",
|
|
906
|
-
"default": "class extends ae{constructor(){super(...arguments),this.items=[],this.resolvePromise=null,this.boundHandleOutsideClick=this.handleOutsideClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static async open(e){const t=document.querySelector(\"kr-context-menu\");t&&t.remove();const i=document.createElement(\"kr-context-menu\");return document.body.appendChild(i),i.show(e)}async show(e){this.items=e.items,this.style.left=`${e.x}px`,this.style.top=`${e.y}px`,await this.updateComplete;const t=this.getBoundingClientRect();return t.right>window.innerWidth&&(this.style.left=e.x-t.width+\"px\"),t.bottom>window.innerHeight&&(this.style.top=e.y-t.height+\"px\"),requestAnimationFrame((()=>{document.addEventListener(\"click\",this.boundHandleOutsideClick),document.addEventListener(\"contextmenu\",this.boundHandleOutsideClick),document.addEventListener(\"keydown\",this.boundHandleKeyDown)})),new Promise((e=>{this.resolvePromise=e}))}handleOutsideClick(e){this.contains(e.target)||this.close(null)}handleKeyDown(e){\"Escape\"===e.key&&this.close(null)}handleItemClick(e){e.disabled||e.divider||this.close(e)}close(e){document.removeEventListener(\"click\",this.boundHandleOutsideClick),document.removeEventListener(\"contextmenu\",this.boundHandleOutsideClick),document.removeEventListener(\"keydown\",this.boundHandleKeyDown),this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.remove()}render(){return
|
|
950
|
+
"default": "class extends ae{constructor(){super(...arguments),this.items=[],this.resolvePromise=null,this.boundHandleOutsideClick=this.handleOutsideClick.bind(this),this.boundHandleKeyDown=this.handleKeyDown.bind(this)}static async open(e){const t=document.querySelector(\"kr-context-menu\");t&&t.remove();const i=document.createElement(\"kr-context-menu\");return document.body.appendChild(i),i.show(e)}async show(e){this.items=e.items,this.style.left=`${e.x}px`,this.style.top=`${e.y}px`,await this.updateComplete;const t=this.getBoundingClientRect();return t.right>window.innerWidth&&(this.style.left=e.x-t.width+\"px\"),t.bottom>window.innerHeight&&(this.style.top=e.y-t.height+\"px\"),requestAnimationFrame((()=>{document.addEventListener(\"click\",this.boundHandleOutsideClick),document.addEventListener(\"contextmenu\",this.boundHandleOutsideClick),document.addEventListener(\"keydown\",this.boundHandleKeyDown)})),new Promise((e=>{this.resolvePromise=e}))}handleOutsideClick(e){this.contains(e.target)||this.close(null)}handleKeyDown(e){\"Escape\"===e.key&&this.close(null)}handleItemClick(e){e.disabled||e.divider||this.close(e)}close(e){document.removeEventListener(\"click\",this.boundHandleOutsideClick),document.removeEventListener(\"contextmenu\",this.boundHandleOutsideClick),document.removeEventListener(\"keydown\",this.boundHandleKeyDown),this.resolvePromise&&(this.resolvePromise(e),this.resolvePromise=null),this.remove()}render(){return j` <div class=\"menu\"> ${this.items.map((e=>e.divider?j`<div class=\"menu__divider\"></div>`:j` <button class=\"menu__item\" ?disabled=${e.disabled} @click=${()=>this.handleItemClick(e)} > ${e.icon?j`<span class=\"menu__item-icon\">${e.icon}</span>`:null} ${e.label} </button> `))} </div> `}}"
|
|
907
951
|
},
|
|
908
952
|
{
|
|
909
953
|
"kind": "class",
|
|
910
954
|
"description": "",
|
|
911
|
-
"name": "
|
|
955
|
+
"name": "je",
|
|
912
956
|
"members": [
|
|
913
957
|
{
|
|
914
958
|
"kind": "method",
|
|
@@ -958,36 +1002,36 @@
|
|
|
958
1002
|
{
|
|
959
1003
|
"kind": "variable",
|
|
960
1004
|
"name": "Be",
|
|
961
|
-
"default": "class extends ae{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.label=\"\",this.width=\"560px\",this._handleDocumentKeyDown=e=>{\"Escape\"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"keydown\",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has(\"opened\")&&(this.opened?document.addEventListener(\"keydown\",this._handleDocumentKeyDown):document.removeEventListener(\"keydown\",this._handleDocumentKeyDown))}open(){this.opened=!0}close(){this._dialogRef?this._dialogRef.close(void 0):(this.opened=!1,this.dispatchEvent(new CustomEvent(\"close\",{bubbles:!0,composed:!0})))}static open(e,t){document.querySelectorAll(\"kr-dialog\").forEach((e=>{e._dialogRef&&e.remove()}));const i=new
|
|
1005
|
+
"default": "class extends ae{constructor(){super(...arguments),this._dialogRef=null,this._contentElement=null,this.opened=!1,this.label=\"\",this.width=\"560px\",this._handleDocumentKeyDown=e=>{\"Escape\"===e.key&&this.close()}}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"keydown\",this._handleDocumentKeyDown)}updated(e){super.updated(e),e.has(\"opened\")&&(this.opened?document.addEventListener(\"keydown\",this._handleDocumentKeyDown):document.removeEventListener(\"keydown\",this._handleDocumentKeyDown))}open(){this.opened=!0}close(){this._dialogRef?this._dialogRef.close(void 0):(this.opened=!1,this.dispatchEvent(new CustomEvent(\"close\",{bubbles:!0,composed:!0})))}static open(e,t){document.querySelectorAll(\"kr-dialog\").forEach((e=>{e._dialogRef&&e.remove()}));const i=new je,s=document.createElement(\"kr-dialog\");i.setDialogElement(s),s._dialogRef=i;const o=new e;return o.dialogRef=i,t?.data&&(o.data=t.data),t?.label&&(s.label=t.label),t?.width&&(s.width=t.width),s._contentElement=o,s.opened=!0,document.body.appendChild(s),i}_handleBackdropClick(e){e.target.classList.contains(\"backdrop\")&&this.close()}render(){return j` <div class=\"backdrop\" @click=${this._handleBackdropClick}></div> <div class=\"dialog\" style=${Re({width:this.width})}> ${this.label?j`<div class=\"dialog__header\"><div class=\"dialog__header-label\">${this.label}</div></div>`:\"\"} ${this._contentElement?this._contentElement:j`<slot></slot>`} </div> `}}"
|
|
962
1006
|
},
|
|
963
1007
|
{
|
|
964
1008
|
"kind": "variable",
|
|
965
1009
|
"name": "Ne",
|
|
966
|
-
"default": "class extends ae{constructor(){super(...arguments),this.relativeOptions=[{key:\"last-5-minutes\",amount:5,unit:\"minute\",type:\"relative\"},{key:\"last-30-minutes\",amount:30,unit:\"minute\",type:\"relative\"},{key:\"last-1-hour\",amount:1,unit:\"hour\",type:\"relative\"},{key:\"last-6-hours\",amount:6,unit:\"hour\",type:\"relative\"},{key:\"last-1-day\",amount:1,unit:\"day\",type:\"relative\"},{key:\"last-7-days\",amount:7,unit:\"day\",type:\"relative\"},{key:\"last-30-days\",amount:30,unit:\"day\",type:\"relative\"}],this.disabled=!1,this.invalid=!1,this.placeholder=\"Select a date range\",this.startDate=\"\",this.endDate=\"\",this._isOpen=!1,this._activeTab=\"relative\",this._tempStartDate=\"\",this._tempEndDate=\"\",this._handleClickOutside=e=>{e.composedPath().includes(this)||(this._isOpen=!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleClickOutside),this.startDate&&(this._tempStartDate=this.startDate),this.endDate&&(this._tempEndDate=this.endDate),\"relative\"===this.mode?this._activeTab=\"relative\":\"absolute\"===this.mode&&(this._activeTab=\"absolute\")}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleClickOutside)}_handleTriggerClick(){this.disabled||(this._isOpen=!this._isOpen)}_handleTabClick(e){this._activeTab=e}_handleRelativeSelect(e){this.value={type:\"relative\",amount:e.amount,unit:e.unit},this._isOpen=!1,this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0}))}_handleApplyAbsolute(){this._tempStartDate&&this._tempEndDate&&(this._tempStartDate>=this._tempEndDate||(this.value={type:\"absolute\",startDate:this._tempStartDate,endDate:this._tempEndDate},this.startDate=this._tempStartDate,this.endDate=this._tempEndDate,this._isOpen=!1,this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0}))))}_handleCancel(){this._isOpen=!1,this._tempStartDate=this.startDate,this._tempEndDate=this.endDate}_formatRelativeOption(e){if(0===e.amount)return\"day\"===e.unit?\"Today\":`This ${e.unit}`;const t={second:1===e.amount?\"second\":\"seconds\",minute:1===e.amount?\"minute\":\"minutes\",hour:1===e.amount?\"hour\":\"hours\",day:1===e.amount?\"day\":\"days\",week:1===e.amount?\"week\":\"weeks\",month:1===e.amount?\"month\":\"months\",year:1===e.amount?\"year\":\"years\"};return`Last ${e.amount} ${t[e.unit]}`}_getDisplayValue(){return this.value?\"relative\"===this.value.type&&void 0!==this.value.amount&&this.value.unit?this._formatRelativeOption({key:\"\",amount:this.value.amount,unit:this.value.unit,type:\"relative\"}):\"absolute\"===this.value.type&&this.value.startDate&&this.value.endDate?`${this.value.startDate} - ${this.value.endDate}`:\"\":\"\"}_renderTriggerText(){const e=this._getDisplayValue();return e?
|
|
1010
|
+
"default": "class extends ae{constructor(){super(...arguments),this.relativeOptions=[{key:\"last-5-minutes\",amount:5,unit:\"minute\",type:\"relative\"},{key:\"last-30-minutes\",amount:30,unit:\"minute\",type:\"relative\"},{key:\"last-1-hour\",amount:1,unit:\"hour\",type:\"relative\"},{key:\"last-6-hours\",amount:6,unit:\"hour\",type:\"relative\"},{key:\"last-1-day\",amount:1,unit:\"day\",type:\"relative\"},{key:\"last-7-days\",amount:7,unit:\"day\",type:\"relative\"},{key:\"last-30-days\",amount:30,unit:\"day\",type:\"relative\"}],this.disabled=!1,this.invalid=!1,this.placeholder=\"Select a date range\",this.startDate=\"\",this.endDate=\"\",this._isOpen=!1,this._activeTab=\"relative\",this._tempStartDate=\"\",this._tempEndDate=\"\",this._handleClickOutside=e=>{e.composedPath().includes(this)||(this._isOpen=!1)}}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleClickOutside),this.startDate&&(this._tempStartDate=this.startDate),this.endDate&&(this._tempEndDate=this.endDate),\"relative\"===this.mode?this._activeTab=\"relative\":\"absolute\"===this.mode&&(this._activeTab=\"absolute\")}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleClickOutside)}_handleTriggerClick(){this.disabled||(this._isOpen=!this._isOpen)}_handleTabClick(e){this._activeTab=e}_handleRelativeSelect(e){this.value={type:\"relative\",amount:e.amount,unit:e.unit},this._isOpen=!1,this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0}))}_handleApplyAbsolute(){this._tempStartDate&&this._tempEndDate&&(this._tempStartDate>=this._tempEndDate||(this.value={type:\"absolute\",startDate:this._tempStartDate,endDate:this._tempEndDate},this.startDate=this._tempStartDate,this.endDate=this._tempEndDate,this._isOpen=!1,this.dispatchEvent(new CustomEvent(\"change\",{detail:{value:this.value},bubbles:!0,composed:!0}))))}_handleCancel(){this._isOpen=!1,this._tempStartDate=this.startDate,this._tempEndDate=this.endDate}_formatRelativeOption(e){if(0===e.amount)return\"day\"===e.unit?\"Today\":`This ${e.unit}`;const t={second:1===e.amount?\"second\":\"seconds\",minute:1===e.amount?\"minute\":\"minutes\",hour:1===e.amount?\"hour\":\"hours\",day:1===e.amount?\"day\":\"days\",week:1===e.amount?\"week\":\"weeks\",month:1===e.amount?\"month\":\"months\",year:1===e.amount?\"year\":\"years\"};return`Last ${e.amount} ${t[e.unit]}`}_getDisplayValue(){return this.value?\"relative\"===this.value.type&&void 0!==this.value.amount&&this.value.unit?this._formatRelativeOption({key:\"\",amount:this.value.amount,unit:this.value.unit,type:\"relative\"}):\"absolute\"===this.value.type&&this.value.startDate&&this.value.endDate?`${this.value.startDate} - ${this.value.endDate}`:\"\":\"\"}_renderTriggerText(){const e=this._getDisplayValue();return e?j`${e}`:j`<span class=\"trigger-placeholder\">${this.placeholder}</span>`}_renderContent(){return\"relative\"===this.mode?this._renderRelativeContent():\"absolute\"===this.mode?this._renderAbsoluteContent():\"relative\"===this._activeTab?this._renderRelativeContent():this._renderAbsoluteContent()}_renderRelativeContent(){return j` <div class=\"relative-options\"> ${this.relativeOptions.map((e=>j` <button class=${we({\"relative-option\":!0,\"relative-option--selected\":\"relative\"===this.value?.type&&this.value?.amount===e.amount&&this.value?.unit===e.unit})} type=\"button\" @click=${()=>this._handleRelativeSelect(e)} > ${this._formatRelativeOption(e)} </button> `))} </div> `}_renderAbsoluteContent(){return j` <div class=\"absolute\"> <div class=\"date-row\"> <span class=\"date-label\">Start</span> <input class=\"date-input\" type=\"date\" .value=${this._tempStartDate} @change=${this._handleStartDateChange} /> </div> <div class=\"date-row\"> <span class=\"date-label\">End</span> <input class=\"date-input\" type=\"date\" .value=${this._tempEndDate} @change=${this._handleEndDateChange} /> </div> </div> `}_renderFooter(){return\"absolute\"===this.mode?j` <div class=\"footer\"> <kr-button variant=\"outline\" size=\"small\" @click=${this._handleCancel}> Cancel </kr-button> <kr-button variant=\"primary\" size=\"small\" ?disabled=${!this._tempStartDate||!this._tempEndDate} @click=${this._handleApplyAbsolute} > Apply </kr-button> </div> `:\"relative\"===this.mode?U:\"absolute\"===this._activeTab?j` <div class=\"footer\"> <kr-button variant=\"outline\" size=\"small\" @click=${this._handleCancel}> Cancel </kr-button> <kr-button variant=\"primary\" size=\"small\" ?disabled=${!this._tempStartDate||!this._tempEndDate} @click=${this._handleApplyAbsolute} > Apply </kr-button> </div> `:U}_handleStartDateChange(e){this._tempStartDate=e.target.value}_handleEndDateChange(e){this._tempEndDate=e.target.value}render(){return j` <button part=\"trigger\" class=${we({trigger:!0,\"trigger--invalid\":this.invalid})} type=\"button\" ?disabled=${this.disabled} @click=${this._handleTriggerClick} > <svg class=\"icon\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\"> <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M8 7V3m8 4V3m-9 8h10M5 21h14a2 2 0 002-2V7a2 2 0 00-2-2H5a2 2 0 00-2 2v12a2 2 0 002 2z\" /> </svg> <span class=\"trigger-text\"> ${this._renderTriggerText()} </span> <svg class=\"icon\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\"> <path stroke-linecap=\"round\" stroke-linejoin=\"round\" stroke-width=\"2\" d=\"M19 9l-7 7-7-7\" /> </svg> </button> <div part=\"dropdown\" class=${we({dropdown:!0,\"dropdown--open\":this._isOpen})}> ${this.mode?U:j` <div class=\"tabs\"> <button class=${we({tab:!0,\"tab--active\":\"relative\"===this._activeTab})} type=\"button\" @click=${()=>this._handleTabClick(\"relative\")} > Relative </button> <button class=${we({tab:!0,\"tab--active\":\"absolute\"===this._activeTab})} type=\"button\" @click=${()=>this._handleTabClick(\"absolute\")} > Absolute </button> </div> `} <div class=\"content\"> ${this._renderContent()} </div> ${this._renderFooter()} </div> `}}"
|
|
967
1011
|
},
|
|
968
1012
|
{
|
|
969
1013
|
"kind": "variable",
|
|
970
|
-
"name": "
|
|
1014
|
+
"name": "We"
|
|
971
1015
|
},
|
|
972
1016
|
{
|
|
973
1017
|
"kind": "variable",
|
|
974
1018
|
"name": "Ye",
|
|
975
|
-
"default": "class extends ae{constructor(){super(...arguments),this.justified=!1,this.size=\"medium\"}updated(e){e.has(\"activeTabId\")&&this._updateActiveTab()}firstUpdated(){this._updateActiveTab()}_getTabs(){return Array.from(this.querySelectorAll(\"kr-tab\"))}_updateActiveTab(){const e=this._getTabs();0!==e.length&&(this.activeTabId||(this.activeTabId=e[0]?.id),e.forEach((e=>{e.active=e.id===this.activeTabId})),this.requestUpdate())}_handleTabClick(e){e.disabled||(this.activeTabId=e.id,this.dispatchEvent(new CustomEvent(\"tab-change\",{detail:{activeTabId:e.id},bubbles:!0,composed:!0})))}_handleTabDismiss(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(\"tab-dismiss\",{detail:{tabId:e.id},bubbles:!0,composed:!0}))}_handleKeyDown(e){const t=this._getTabs().filter((e=>!e.disabled)),i=t.findIndex((e=>e.id===this.activeTabId));let s=-1;switch(e.key){case\"ArrowLeft\":s=i>0?i-1:t.length-1;break;case\"ArrowRight\":s=i<t.length-1?i+1:0;break;case\"Home\":s=0;break;case\"End\":s=t.length-1}if(s>=0){e.preventDefault();const i=t[s];this.activeTabId=i.id,this.dispatchEvent(new CustomEvent(\"tab-change\",{detail:{activeTabId:i.id},bubbles:!0,composed:!0}));const o=this.shadowRoot?.querySelectorAll(\".label\"),r=Array.from(o||[]).find((e=>e.getAttribute(\"data-tab-id\")===i.id));r?.focus()}}_renderTabIcon(e){const t=e.getIconElement();if(!t)return U;const i=t.cloneNode(!0);return i.removeAttribute(\"slot\"),
|
|
1019
|
+
"default": "class extends ae{constructor(){super(...arguments),this.justified=!1,this.size=\"medium\"}updated(e){e.has(\"activeTabId\")&&this._updateActiveTab()}firstUpdated(){this._updateActiveTab()}_getTabs(){return Array.from(this.querySelectorAll(\"kr-tab\"))}_updateActiveTab(){const e=this._getTabs();0!==e.length&&(this.activeTabId||(this.activeTabId=e[0]?.id),e.forEach((e=>{e.active=e.id===this.activeTabId})),this.requestUpdate())}_handleTabClick(e){e.disabled||(this.activeTabId=e.id,this.dispatchEvent(new CustomEvent(\"tab-change\",{detail:{activeTabId:e.id},bubbles:!0,composed:!0})))}_handleTabDismiss(e,t){t.stopPropagation(),this.dispatchEvent(new CustomEvent(\"tab-dismiss\",{detail:{tabId:e.id},bubbles:!0,composed:!0}))}_handleKeyDown(e){const t=this._getTabs().filter((e=>!e.disabled)),i=t.findIndex((e=>e.id===this.activeTabId));let s=-1;switch(e.key){case\"ArrowLeft\":s=i>0?i-1:t.length-1;break;case\"ArrowRight\":s=i<t.length-1?i+1:0;break;case\"Home\":s=0;break;case\"End\":s=t.length-1}if(s>=0){e.preventDefault();const i=t[s];this.activeTabId=i.id,this.dispatchEvent(new CustomEvent(\"tab-change\",{detail:{activeTabId:i.id},bubbles:!0,composed:!0}));const o=this.shadowRoot?.querySelectorAll(\".label\"),r=Array.from(o||[]).find((e=>e.getAttribute(\"data-tab-id\")===i.id));r?.focus()}}_renderTabIcon(e){const t=e.getIconElement();if(!t)return U;const i=t.cloneNode(!0);return i.removeAttribute(\"slot\"),j`<span class=\"label-icon\">${i}</span>`}render(){return j` <div class=\"header\" role=\"tablist\" @keydown=${this._handleKeyDown}> ${this._getTabs().map((e=>j` <button class=${we({label:!0,\"label--active\":e.id===this.activeTabId,\"label--justified\":this.justified})} role=\"tab\" data-tab-id=${e.id} aria-selected=${e.id===this.activeTabId} aria-controls=${`panel-${e.id}`} tabindex=${e.id===this.activeTabId?0:-1} ?disabled=${e.disabled} @click=${()=>this._handleTabClick(e)} > ${this._renderTabIcon(e)} <span>${e.label}</span> ${e.badge?j`<span class=\"label-badge\" style=${Re({backgroundColor:e.badgeBackground,color:e.badgeColor})}>${e.badge}</span>`:U} ${e.dismissible?j` <button class=\"label-dismiss\" type=\"button\" aria-label=\"Close tab\" @click=${t=>this._handleTabDismiss(e,t)} > <svg viewBox=\"0 0 20 20\" fill=\"currentColor\" width=\"12\" height=\"12\"><path fill-rule=\"evenodd\" d=\"M4.293 4.293a1 1 0 011.414 0L10 8.586l4.293-4.293a1 1 0 111.414 1.414L11.414 10l4.293 4.293a1 1 0 01-1.414 1.414L10 11.414l-4.293 4.293a1 1 0 01-1.414-1.414L8.586 10 4.293 5.707a1 1 0 010-1.414z\" clip-rule=\"evenodd\"/></svg> </button> `:U} </button> `))} </div> <div class=\"content\" role=\"tabpanel\" aria-labelledby=${this.activeTabId||\"\"}> <slot @slotchange=${this._updateActiveTab}></slot> </div> `}}"
|
|
976
1020
|
},
|
|
977
1021
|
{
|
|
978
1022
|
"kind": "variable",
|
|
979
1023
|
"name": "Qe",
|
|
980
|
-
"default": "class extends ae{constructor(){super(...arguments),this.id=\"\",this.label=\"\",this.badge=\"\",this.badgeBackground=\"\",this.badgeColor=\"\",this.disabled=!1,this.dismissible=!1,this.active=!1}getIconElement(){return this.querySelector('[slot=\"icon\"]')}updated(){const e=this.closest(\"kr-tab-group\");e&&e.requestUpdate()}render(){return
|
|
1024
|
+
"default": "class extends ae{constructor(){super(...arguments),this.id=\"\",this.label=\"\",this.badge=\"\",this.badgeBackground=\"\",this.badgeColor=\"\",this.disabled=!1,this.dismissible=!1,this.active=!1}getIconElement(){return this.querySelector('[slot=\"icon\"]')}updated(){const e=this.closest(\"kr-tab-group\");e&&e.requestUpdate()}render(){return j`<slot></slot>`}}"
|
|
981
1025
|
},
|
|
982
1026
|
{
|
|
983
1027
|
"kind": "variable",
|
|
984
1028
|
"name": "Je",
|
|
985
|
-
"default": "class extends ae{constructor(){super(),this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"Select an option\",this.disabled=!1,this.required=!1,this.readonly=!1,this.hint=\"\",this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._handleOutsideClick=e=>{e.composedPath().includes(this)||this._close()},this._handleKeyDown=e=>{if(!this._isOpen)return;const t=Array.from(this.querySelectorAll(\"kr-select-option\"));switch(e.key){case\"Escape\":this._close(),this._triggerElement?.focus();break;case\"ArrowDown\":if(e.preventDefault(),t.some((e=>!e.disabled))){let e=this._highlightedIndex+1;for(;e<t.length&&t[e]?.disabled;)e++;e<t.length&&(this._highlightedIndex=e)}break;case\"ArrowUp\":e.preventDefault();{let e=this._highlightedIndex-1;for(;e>=0&&t[e]?.disabled;)e--;e>=0&&(this._highlightedIndex=e)}break;case\"Enter\":e.preventDefault(),this._highlightedIndex>=0&&this._highlightedIndex<t.length&&this._selectOption(t[this._highlightedIndex])}},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._touched=!1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleOutsideClick),document.addEventListener(\"keydown\",this._handleKeyDown),this.addEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleOutsideClick),document.removeEventListener(\"keydown\",this._handleKeyDown),this.removeEventListener(\"invalid\",this._handleInvalid)}_toggle(){if(!this.disabled&&!this.readonly)if(this._isOpen)this._close();else{this._isOpen=!0;const e=Array.from(this.querySelectorAll(\"kr-select-option\"));this._highlightedIndex=e.findIndex((e=>e.value===this.value)),requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(\".select-dropdown\");if(e){const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8;e.style.top=t.bottom+4+\"px\",e.style.left=t.left+\"px\",e.style.width=t.width+\"px\",e.style.maxHeight=i+\"px\"}}))}}_close(){this._isOpen=!1,this._highlightedIndex=-1}_selectOption(e){e.disabled||(this.value=e.value,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})),this._close(),this._triggerElement?.focus())}_handleBlur(){this._touched=!0,this._updateValidity()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},\"Please select an option\",this._triggerElement):this._internals.setValidity({})}render(){const e=Array.from(this.querySelectorAll(\"kr-select-option\")),t=e.find((e=>e.value===this.value))?.label;return
|
|
1029
|
+
"default": "class extends ae{constructor(){super(),this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"Select an option\",this.disabled=!1,this.required=!1,this.readonly=!1,this.hint=\"\",this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._handleOutsideClick=e=>{e.composedPath().includes(this)||this._close()},this._handleKeyDown=e=>{if(!this._isOpen)return;const t=Array.from(this.querySelectorAll(\"kr-select-option\"));switch(e.key){case\"Escape\":this._close(),this._triggerElement?.focus();break;case\"ArrowDown\":if(e.preventDefault(),t.some((e=>!e.disabled))){let e=this._highlightedIndex+1;for(;e<t.length&&t[e]?.disabled;)e++;e<t.length&&(this._highlightedIndex=e)}break;case\"ArrowUp\":e.preventDefault();{let e=this._highlightedIndex-1;for(;e>=0&&t[e]?.disabled;)e--;e>=0&&(this._highlightedIndex=e)}break;case\"Enter\":e.preventDefault(),this._highlightedIndex>=0&&this._highlightedIndex<t.length&&this._selectOption(t[this._highlightedIndex])}},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._touched=!1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleOutsideClick),document.addEventListener(\"keydown\",this._handleKeyDown),this.addEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity()}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleOutsideClick),document.removeEventListener(\"keydown\",this._handleKeyDown),this.removeEventListener(\"invalid\",this._handleInvalid)}_toggle(){if(!this.disabled&&!this.readonly)if(this._isOpen)this._close();else{this._isOpen=!0;const e=Array.from(this.querySelectorAll(\"kr-select-option\"));this._highlightedIndex=e.findIndex((e=>e.value===this.value)),requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(\".select-dropdown\");if(e){const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8;e.style.top=t.bottom+4+\"px\",e.style.left=t.left+\"px\",e.style.width=t.width+\"px\",e.style.maxHeight=i+\"px\"}}))}}_close(){this._isOpen=!1,this._highlightedIndex=-1}_selectOption(e){e.disabled||(this.value=e.value,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})),this._close(),this._triggerElement?.focus())}_handleBlur(){this._touched=!0,this._updateValidity()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},\"Please select an option\",this._triggerElement):this._internals.setValidity({})}render(){const e=Array.from(this.querySelectorAll(\"kr-select-option\")),t=e.find((e=>e.value===this.value))?.label;return j` <div class=\"wrapper\"> ${this.label?j` <label> ${this.label} ${this.required?j`<span class=\"required\" aria-hidden=\"true\">*</span>`:\"\"} </label> `:U} <div class=\"select-wrapper\"> <button class=${we({\"select-trigger\":!0,\"select-trigger--open\":this._isOpen,\"select-trigger--invalid\":this._touched&&this.required&&!this.value})} type=\"button\" ?disabled=${this.disabled} aria-haspopup=\"listbox\" aria-expanded=${this._isOpen} @click=${this._toggle} @blur=${this._handleBlur} > <span class=${we({\"select-value\":!0,\"select-placeholder\":!t})}> ${t||this.placeholder} </span> <svg class=${we({\"chevron-icon\":!0,\"select-icon\":!0,\"select-icon--open\":this._isOpen})} viewBox=\"0 0 24 24\" fill=\"currentColor\" > <path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z\"/> </svg> </button> <div class=${we({\"select-dropdown\":!0,hidden:!this._isOpen})} role=\"listbox\"> <div class=\"select-options\"> ${0===e.length?j`<div class=\"select-empty\">No options available</div>`:e.map(((e,t)=>{const i=e.value===this.value;return j` <div class=${we({\"select-option\":!0,\"select-option--selected\":i,\"select-option--disabled\":e.disabled,\"select-option--highlighted\":t===this._highlightedIndex})} role=\"option\" aria-selected=${i} @click=${()=>this._selectOption(e)} @mouseenter=${()=>this._highlightedIndex=t} > ${e.label} </div> `}))} </div> </div> </div> ${this._touched&&this.required&&!this.value?j`<div class=\"validation-message\">Please select an option</div>`:this.hint?j`<div class=\"hint\">${this.hint}</div>`:\"\"} </div> <div class=\"options-slot\"> <slot @slotchange=${()=>this.requestUpdate()}></slot> </div> `}focus(){this._triggerElement?.focus()}blur(){this._triggerElement?.blur()}}"
|
|
986
1030
|
},
|
|
987
1031
|
{
|
|
988
1032
|
"kind": "variable",
|
|
989
1033
|
"name": "tt",
|
|
990
|
-
"default": "class extends ae{constructor(){super(...arguments),this.value=\"\",this.disabled=!1}get label(){return this.textContent?.trim()||\"\"}render(){return
|
|
1034
|
+
"default": "class extends ae{constructor(){super(...arguments),this.value=\"\",this.disabled=!1}get label(){return this.textContent?.trim()||\"\"}render(){return j`<slot></slot>`}}"
|
|
991
1035
|
},
|
|
992
1036
|
{
|
|
993
1037
|
"kind": "variable",
|
|
@@ -1199,17 +1243,17 @@
|
|
|
1199
1243
|
{
|
|
1200
1244
|
"kind": "variable",
|
|
1201
1245
|
"name": "ft",
|
|
1202
|
-
"default": "class extends ae{constructor(){super(...arguments),this._scrollStyle=\"edge\",this._data=[],this._dataState=\"idle\",this._page=1,this._pageSize=50,this._totalItems=0,this._totalPages=0,this._searchQuery=\"\",this._canScrollLeft=!1,this._canScrollRight=!1,this._canScrollHorizontal=!1,this._columnPickerOpen=!1,this._filterPanelOpened=null,this._filterPanelTab=\"filter\",this._buckets=new Map,this._filterPanelPos={top:0,left:0},this._sorts=[],this._resizing=null,this._resizeObserver=null,this._searchPositionLocked=!1,this._columnWidthsLocked=!1,this._model=new ut,this.def={columns:[]},this._handleClickOutside=e=>{const t=e.composedPath();if(this._columnPickerOpen){const e=this.shadowRoot?.querySelector(\".column-picker-wrapper\");e&&!t.includes(e)&&(this._columnPickerOpen=!1)}this._filterPanelOpened&&(t.some((e=>e.classList?.contains(\"filter-panel\")))||this._handleFilterApply())},this._handleResizeMove=e=>{if(!this._resizing)return;const t=this._model.columns.find((e=>e.id===this._resizing.columnId));if(t){const i=this._resizing.startWidth+(e.clientX-this._resizing.startX);t.width=`${Math.min(900,Math.max(50,i))}px`,this.requestUpdate()}},this._handleResizeEnd=()=>{this._resizing=null,document.removeEventListener(\"mousemove\",this._handleResizeMove),document.removeEventListener(\"mouseup\",this._handleResizeEnd)}}connectedCallback(){super.connectedCallback(),this.classList.toggle(\"kr-table--scroll-overlay\",\"overlay\"===this._scrollStyle),this.classList.toggle(\"kr-table--scroll-edge\",\"edge\"===this._scrollStyle),this._fetch(),this._initRefresh(),document.addEventListener(\"click\",this._handleClickOutside),this._resizeObserver=new ResizeObserver((()=>{this._searchPositionLocked=!1,this._updateSearchPosition()})),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this._refreshTimer),document.removeEventListener(\"click\",this._handleClickOutside),this._resizeObserver?.disconnect()}willUpdate(e){e.has(\"def\")&&(this._columnWidthsLocked=!1,this._model=new ut,this.def.title&&(this._model.title=this.def.title),this.def.actions&&(this._model.actions=this.def.actions),this.def.data&&(this._model.data=this.def.data),this.def.dataSource&&(this._model.dataSource=this.def.dataSource),\"number\"==typeof this.def.refreshInterval&&(this._model.refreshInterval=this.def.refreshInterval),\"number\"==typeof this.def.pageSize&&(this._model.pageSize=this.def.pageSize),this.def.rowClickable&&(this._model.rowClickable=this.def.rowClickable),this.def.rowHref&&(this._model.rowHref=this.def.rowHref),this._sorts=[],this._model.columns=this.def.columns.map((e=>{const t={...e,filter:null};return t.type||(t.type=\"string\"),e.sort&&this._sorts.push({sortBy:e.id,sortDirection:e.sort}),\"actions\"===t.type?(t.label=e.label??\"\",t.sticky=\"right\",t.resizable=!1,t):((e.filterable||e.facetable)&&(t.filter=new ct,t.filter.field=e.id,t.filter.type=t.type,e.filter?(t.filter.setOperator(e.filter.operator),t.filter.setValue(e.filter.value)):e.facetable&&!e.filterable?(t.filter.operator=\"in\",t.filter.value=[]):\"string\"===t.filter.type&&(t.filter.operator=\"contains\")),t)})),this.def.displayedColumns?this._model.displayedColumns=this.def.displayedColumns:this._model.displayedColumns=this._model.columns.map((e=>e.id)),this._fetch(),this._initRefresh())}updated(e){this._updateScrollFlags(),this._syncSlottedContent()}_syncSlottedContent(){const e=this.getDisplayedColumns().filter((e=>e.render));e.length&&(this.querySelectorAll('[slot^=\"cell-\"]').forEach((e=>e.remove())),this._data.forEach(((t,i)=>{e.forEach((e=>{const s=e.render(t);if(!s)return;const o=document.createElement(\"span\");o.slot=`cell-${i}-${e.id}`,\"actions\"===e.type&&(o.style.display=\"flex\",o.style.gap=\"8px\"),\"string\"==typeof s?o.innerHTML=s:oe(s,o),this.appendChild(o)}))})))}refresh(){this._fetch()}goToPrevPage(){this._page>1&&(this._page--,this._fetch())}goToNextPage(){this._page<this._totalPages&&(this._page++,this._fetch())}goToPage(e){e>=1&&e<=this._totalPages&&(this._page=e,this._fetch())}_toSolrData(){const e={page:this._page-1,size:this._pageSize,sorts:this._sorts,filterFields:[],queryFields:[],facetFields:[]};for(const t of this._model.columns){if(!t.filter||t.filter.isEmpty()||!t.filter.isValid())continue;const i=t.filter.toSolrData();!t.facetable||\"in\"!==t.filter.operator&&\"n_in\"!==t.filter.operator||(i.tagged=!0),e.filterFields.push(i)}for(const t of this._model.columns)t.facetable&&e.facetFields.push({name:t.id,type:\"FIELD\",limit:100,sort:\"count\",minimumCount:1});return this._searchQuery?.trim().length&&e.queryFields.push({name:\"_text_\",operation:\"IS\",value:at(this._searchQuery,!1)}),e}_toDbParams(){const e={page:this._page-1,size:this._pageSize,sorts:this._sorts,filterFields:[],queryFields:[],facetFields:[]};for(const t of this._model.columns)t.filter&&!t.filter.isEmpty()&&t.filter.isValid()&&e.filterFields.push(t.filter.toDbParams());return this._searchQuery?.trim().length&&this._model.columns.filter((e=>e.searchable)).forEach((t=>{e.queryFields.push({name:t.id,operation:\"CONTAINS\",value:this._searchQuery,and:!1})})),e}_fetch(){if(this._model.data)return this._data=this._model.data,this._totalItems=this._model.data.length,this._totalPages=Math.ceil(this._model.data.length/this._pageSize),void(this._dataState=\"success\");if(!this._model.dataSource)return;let e;this._dataState=\"loading\",e=\"db\"===this._model.dataSource.mode?this._toDbParams():this._toSolrData(),this._model.dataSource.fetch(e).then((e=>{switch(this._model.dataSource?.mode){case\"opensearch\":throw Error(\"Opensearch not supported yet\");case\"db\":{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size;break}default:{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size,this._parseFacetResults(t)}}this._dataState=\"success\",this._columnWidthsLocked||requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelectorAll(\".header-row > .header-cell\");if(e){const t=this.getDisplayedColumns();e.forEach(((e,i)=>{i<t.length&&!t[i].width&&\"actions\"!==t[i].type&&(t[i].width=`${e.offsetWidth}px`)}))}this._columnWidthsLocked=!0})),this._updateSearchPosition()})).catch((e=>{this._dataState=\"error\",Ke.show({message:e instanceof Error?e.message:\"Failed to load data\",type:\"error\"})}))}_parseFacetResults(e){if(e.data.facetFields){for(const t of this._model.columns){if(!t.facetable)continue;const i=e.data.facetFields[t.id];if(!i){this._buckets.set(t.id,[]);continue}const s=[];for(const e of i){let i=e.name;\"boolean\"===t.type&&\"string\"==typeof e.name&&(\"true\"===e.name?i=!0:\"false\"===e.name&&(i=!1)),null===e.name&&e.count>0&&s.unshift({val:null,count:e.count}),null!==e.name&&s.push({val:i,count:e.count})}if(t.filter&&(\"in\"===t.filter.operator||\"n_in\"===t.filter.operator)&&Array.isArray(t.filter.value))for(const e of t.filter.value)s.some((t=>t.val===e))||s.push({val:e,count:0});this._buckets.set(t.id,s)}this._buckets=new Map(this._buckets)}}_initRefresh(){clearInterval(this._refreshTimer),this._model.refreshInterval&&this._model.refreshInterval>0&&(this._refreshTimer=window.setInterval((()=>{this._fetch()}),this._model.refreshInterval))}_handleSearch(e){const t=e.target;this._searchQuery=t.value,this._page=1,this._fetch()}_getGridTemplateColumns(){return this.getDisplayedColumns().map((e=>e.width?e.width:\"actions\"===e.type?\"max-content\":\"minmax(80px, auto)\")).join(\" \")}_updateSearchPosition(){if(this._searchPositionLocked)return;const e=this.shadowRoot?.querySelector(\".search\"),t=e?.querySelector(\".search-field\");e&&t&&(e.style.justifyContent=\"center\",t.style.marginLeft=\"\",requestAnimationFrame((()=>{const i=e.getBoundingClientRect(),s=t.getBoundingClientRect().left-i.left;e.style.justifyContent=\"flex-start\",t.style.marginLeft=`${s}px`,this._searchPositionLocked=!0})))}_toggleColumnPicker(){this._columnPickerOpen=!this._columnPickerOpen}_toggleColumn(e){this._model.displayedColumns.includes(e)?this._model.displayedColumns=this._model.displayedColumns.filter((t=>t!==e)):this._model.displayedColumns=[...this._model.displayedColumns,e],this.requestUpdate()}_handleRowMouseDown(){(this._model.rowClickable||this._model.rowHref)&&window.getSelection()?.removeAllRanges()}_handleRowClick(e,t,i){if(!this._model.rowClickable&&!this._model.rowHref)return;const s=window.getSelection();s&&s.toString().length>0?e.preventDefault():this.dispatchEvent(new CustomEvent(\"row-click\",{detail:{row:t,rowIndex:i},bubbles:!0,composed:!0}))}getDisplayedColumns(){return this._model.displayedColumns.map((e=>this._model.columns.find((t=>t.id===e)))).sort(((e,t)=>\"actions\"===e.type&&\"actions\"!==t.type?1:\"actions\"!==e.type&&\"actions\"===t.type?-1:0))}_handleScroll(e){const t=e.target;this._canScrollLeft=t.scrollLeft>0,this._canScrollRight=t.scrollLeft<t.scrollWidth-t.clientWidth-1}_updateScrollFlags(){const e=this.shadowRoot?.querySelector(\".content\");e&&(this._canScrollLeft=e.scrollLeft>0,this._canScrollRight=e.scrollWidth>e.clientWidth&&e.scrollLeft<e.scrollWidth-e.clientWidth-1,this._canScrollHorizontal=e.scrollWidth>e.clientWidth),this.classList.toggle(\"kr-table--scroll-left-available\",this._canScrollLeft),this.classList.toggle(\"kr-table--scroll-right-available\",this._canScrollRight),this.classList.toggle(\"kr-table--scroll-horizontal-available\",this._canScrollHorizontal),this.classList.toggle(\"kr-table--sticky-left\",this.getDisplayedColumns().some((e=>\"left\"===e.sticky))),this.classList.toggle(\"kr-table--sticky-right\",this.getDisplayedColumns().some((e=>\"right\"===e.sticky)))}_handleResizeStart(e,t){e.preventDefault();const i=this.shadowRoot?.querySelector(`.header-cell[data-column-id=\"${t}\"]`);this._resizing={columnId:t,startX:e.clientX,startWidth:i?.offsetWidth||200},document.addEventListener(\"mousemove\",this._handleResizeMove),document.addEventListener(\"mouseup\",this._handleResizeEnd)}_handleSortClick(e,t){if(e.shiftKey){const e=this._sorts.findIndex((e=>e.sortBy===t.id));if(-1===e)this._sorts.push({sortBy:t.id,sortDirection:\"asc\"});else{const t=this._sorts[e];\"asc\"===t.sortDirection?t.sortDirection=\"desc\":this._sorts.splice(e,1)}this.requestUpdate()}else{let e=null;1===this._sorts.length&&(e=this._sorts.find((e=>e.sortBy===t.id))),e?\"asc\"===e.sortDirection?this._sorts=[{sortBy:t.id,sortDirection:\"desc\"}]:this._sorts=[]:this._sorts=[{sortBy:t.id,sortDirection:\"asc\"}]}this._page=1,this._fetch()}_renderSortIndicator(e){if(!e.sortable)return U;const t=this._sorts.findIndex((t=>t.sortBy===e.id));if(-1===t)return V` <span class=\"header-cell__sort\" @click=${t=>this._handleSortClick(t,e)}> <svg class=\"header-cell__sort-arrow header-cell__sort-arrow--ghost\" viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\"/> </svg> </span> `;let i={};return\"desc\"===this._sorts[t].sortDirection&&(i={transform:\"rotate(180deg)\"}),V` <span class=\"header-cell__sort\" @click=${t=>this._handleSortClick(t,e)}> <svg class=\"header-cell__sort-arrow\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=${Re(i)}> <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\"/> </svg> ${this._sorts.length>1?V` <span class=\"header-cell__sort-priority\">${t+1}</span> `:U} </span> `}_handleAction(e){e.href||this.dispatchEvent(new CustomEvent(\"action\",{detail:{action:e.id},bubbles:!0,composed:!0}))}_handleKqlChange(e,t){const i=e.target.value.trim();if(i){if(t.filter.setKql(i),this.requestUpdate(),!t.filter.isValid())return}else t.filter.clear(),this.requestUpdate();this._page=1,this._fetch()}_handleFilterPanelToggle(e,t){if(e.stopPropagation(),this._filterPanelOpened===t.id)this._filterPanelOpened=null;else{const i=e.currentTarget.getBoundingClientRect();let s=i.left;s+328>window.innerWidth&&(s=window.innerWidth-328),this._filterPanelPos={top:i.bottom+4,left:s},this._filterPanelOpened=t.id,t.facetable?this._filterPanelTab=\"counts\":this._filterPanelTab=\"filter\"}}_handleKqlClear(e){e.filter.clear(),this._page=1,this._fetch()}_handleFilterClear(){const e=this._model.columns.find((e=>e.id===this._filterPanelOpened));e&&(e.filter.clear(),e.facetable&&!e.filterable&&(e.filter.operator=\"in\",e.filter.value=[])),this._filterPanelOpened=null,this._page=1,this._fetch()}_handleFilterTextKeydown(e,t){\"Enter\"===e.key&&(e.preventDefault(),this._handleFilterApply())}_handleOperatorChange(e,t){t.filter.setOperator(e.target.value),this.requestUpdate()}_handleFilterStringChange(e,t){t.filter.setValue(e.target.value),this.requestUpdate()}_handleFilterNumberChange(e,t){t.filter.setValue(Number(e.target.value)),this.requestUpdate()}_handleFilterDateChange(e,t){t.filter.setValue(new Date(e.target.value),\"day\"),this.requestUpdate()}_handleFilterBooleanChange(e,t){t.filter.setValue(\"true\"===e.target.value),this.requestUpdate()}_handleFilterDateStartChange(e,t){t.filter.setStart(new Date(e.target.value),\"day\"),this.requestUpdate()}_handleFilterDateEndChange(e,t){t.filter.setEnd(new Date(e.target.value),\"day\"),this.requestUpdate()}_handleFilterNumberStartChange(e,t){t.filter.setStart(Number(e.target.value)),this.requestUpdate()}_handleFilterNumberEndChange(e,t){t.filter.setEnd(Number(e.target.value)),this.requestUpdate()}_handleFilterListChange(e,t){const i=e.target.value.split(\",\").map((e=>e.trim())).filter((e=>\"\"!==e));\"number\"===t.type?t.filter.setValue(i.map((e=>Number(e)))):t.filter.setValue(i),this.requestUpdate()}_handleFilterApply(){this._filterPanelOpened=null,this._page=1,this._fetch()}_handleFilterPanelTabChange(e){this._filterPanelTab=e.detail.activeTabId}_handleBucketToggle(e,t,i){t.filter.toggle(i.val),this._page=1,this._fetch()}_renderCellContent(e,t,i){const s=t[e.id];if(e.render)return V`<slot name=\"cell-${i}-${e.id}\"></slot>`;if(null==s)return\"\";switch(e.type){case\"number\":return\"currency\"===e.format&&\"number\"==typeof s?s.toLocaleString(\"en-US\",{style:\"currency\",currency:\"USD\"}):String(s);case\"date\":{let e;if(s instanceof Date)e=s;else if(\"string\"==typeof s&&/^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}/.test(s)){const t=s.replace(/(\\d{2}:\\d{2}:\\d{2}):(\\d+)$/,\"$1.$2\").replace(\" \",\"T\")+\"Z\";e=new Date(t)}else e=new Date(s);return e.toLocaleString(void 0,{year:\"numeric\",month:\"short\",day:\"numeric\",hour:\"numeric\",minute:\"2-digit\",timeZone:\"UTC\"})}case\"boolean\":return!0===s?\"Yes\":!1===s?\"No\":\"\";default:return String(s)}}_getHeaderCellClasses(e,t){return{\"header-cell\":!0,\"header-cell--sortable\":!!e.sortable,\"header-cell--align-center\":\"center\"===e.align,\"header-cell--align-right\":\"right\"===e.align,\"header-cell--sticky-left\":\"left\"===e.sticky,\"header-cell--sticky-left-last\":\"left\"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>\"left\"===e.sticky)),\"header-cell--sticky-right\":\"right\"===e.sticky,\"header-cell--sticky-right-first\":\"right\"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>\"right\"===e.sticky))}}_getCellClasses(e,t){return{cell:!0,\"cell--actions\":\"actions\"===e.type,\"cell--align-center\":\"center\"===e.align,\"cell--align-right\":\"right\"===e.align,\"cell--sticky-left\":\"left\"===e.sticky,\"cell--sticky-left-last\":\"left\"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>\"left\"===e.sticky)),\"cell--sticky-right\":\"right\"===e.sticky,\"cell--sticky-right-first\":\"right\"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>\"right\"===e.sticky))}}_getCellStyle(e,t){const i={};if(\"left\"===e.sticky){let e=0;for(let i=0;i<t;i++){const t=this.getDisplayedColumns()[i];\"left\"===t.sticky&&(e+=parseInt(t.width||\"0\",10))}i.left=`${e}px`}if(\"right\"===e.sticky){let e=0;for(let i=t+1;i<this.getDisplayedColumns().length;i++){const t=this.getDisplayedColumns()[i];\"right\"===t.sticky&&(e+=parseInt(t.width||\"0\",10))}i.right=`${e}px`}return i}_renderPagination(){const e=(this._page-1)*this._pageSize+1,t=Math.min(this._page*this._pageSize,this._totalItems);return V` <div class=\"pagination\"> <span class=\"pagination-icon ${1===this._page?\"pagination-icon--disabled\":\"\"}\" @click=${this.goToPrevPage} > <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/></svg> </span> <span class=\"pagination-info\">${e}-${t} of ${this._totalItems}</span> <span class=\"pagination-icon ${this._page===this._totalPages?\"pagination-icon--disabled\":\"\"}\" @click=${this.goToNextPage} > <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/></svg> </span> </div> `}_renderHeader(){return!this._model.title&&!this._model.actions?.length&&this._totalPages<=1?U:V` <div class=\"header\"> <div class=\"title\">${this._model.title??\"\"}</div> ${\"db\"!==this._model.dataSource?.mode||this._model.columns.some((e=>e.searchable))?V` <div class=\"search\"> <!-- TODO: Saved views dropdown <div class=\"views\"> <span>Default View</span> <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z\"/></svg> </div> --> <div class=\"search-field\"> <svg class=\"search-icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\"><path d=\"M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z\"/></svg> <input type=\"text\" class=\"search-input\" placeholder=\"Search...\" .value=${this._searchQuery} @input=${this._handleSearch} /> </div> </div> `:V`<div class=\"search\"></div>`} <div class=\"tools\"> ${this._renderPagination()} <span class=\"refresh\" title=\"Refresh\" @click=${()=>this.refresh()}> <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\"><path d=\"M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z\"/></svg> </span> <div class=\"column-picker-wrapper\"> <span class=\"header-icon\" title=\"Columns\" @click=${this._toggleColumnPicker}> <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\"><path d=\"M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z\"/></svg> </span> <div class=\"column-picker ${this._columnPickerOpen?\"open\":\"\"}\"> ${[...this._model.columns].filter((e=>\"actions\"!==e.type)).sort(((e,t)=>(e.label??e.id).localeCompare(t.label??t.id))).map((e=>V` <div class=\"column-picker-item\" @click=${()=>this._toggleColumn(e.id)}> <div class=\"column-picker-checkbox ${this._model.displayedColumns.includes(e.id)?\"checked\":\"\"}\"> <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"/></svg> </div> <span class=\"column-picker-label\">${e.label??e.id}</span> </div> `))} </div> </div> ${1===this._model.actions?.length?V` <kr-button class=\"actions\" .href=${this._model.actions[0].href} .target=${this._model.actions[0].target} @click=${()=>this._handleAction(this._model.actions[0])} > ${this._model.actions[0].label} </kr-button> `:this._model.actions?.length?V` <kr-button class=\"actions\" .options=${this._model.actions.map((e=>({id:e.id,label:e.label})))} @option-select=${e=>this._handleAction({id:e.detail.id,label:e.detail.label})} > Actions </kr-button> `:U} </div> </div> `}_renderStatus(){return\"loading\"===this._dataState&&0===this._data.length?V`<div class=\"status\">Loading...</div>`:\"error\"===this._dataState&&0===this._data.length?V`<div class=\"status status--error\">Error loading data</div>`:0===this._data.length?V`<div class=\"status\">No data available</div>`:U}_renderFilterPanel(){if(!this._filterPanelOpened)return U;const e=this._model.columns.find((e=>e.id===this._filterPanelOpened));let t=V``;t=\"empty\"===e.filter.operator||\"n_empty\"===e.filter.operator?V` <input type=\"text\" class=\"filter-panel__input\" disabled .value=${e.filter.text} /> `:\"between\"===e.filter.operator&&\"date\"===e.type?V` <input type=\"date\" class=\"filter-panel__input\" .valueAsDate=${e.filter.value?.start??null} @change=${t=>this._handleFilterDateStartChange(t,e)} /> <input type=\"date\" class=\"filter-panel__input\" .valueAsDate=${e.filter.value?.end??null} @change=${t=>this._handleFilterDateEndChange(t,e)} /> `:\"between\"===e.filter.operator&&\"number\"===e.type?V` <input type=\"number\" class=\"filter-panel__input\" placeholder=\"Start\" .value=${e.filter.value?.start??\"\"} @input=${t=>this._handleFilterNumberStartChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} /> <input type=\"number\" class=\"filter-panel__input\" placeholder=\"End\" .value=${e.filter.value?.end??\"\"} @input=${t=>this._handleFilterNumberEndChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} /> `:\"in\"===e.filter.operator||\"n_in\"===e.filter.operator?V` <textarea class=\"filter-panel__textarea\" rows=\"3\" placeholder=\"Values (comma-separated)\" .value=${e.filter.text} @input=${t=>this._handleFilterListChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} ></textarea> `:\"boolean\"===e.type?V` <kr-select-field placeholder=\"Value\" .value=${String(e.filter.value??\"\")} @change=${t=>this._handleFilterBooleanChange(t,e)} > <kr-select-option value=\"true\">Yes</kr-select-option> <kr-select-option value=\"false\">No</kr-select-option> </kr-select-field> `:\"date\"===e.type?V` <input type=\"date\" class=\"filter-panel__input\" .valueAsDate=${e.filter.value} @change=${t=>this._handleFilterDateChange(t,e)} /> `:\"number\"===e.type?V` <input type=\"number\" class=\"filter-panel__input\" placeholder=\"Value\" min=\"0\" .value=${e.filter.text} @input=${t=>this._handleFilterNumberChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} /> `:V` <input type=\"text\" class=\"filter-panel__input\" placeholder=\"Value\" .value=${e.filter.text} @input=${t=>this._handleFilterStringChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} /> `;const i=V` <div class=\"filter-panel__content\"> <kr-select-field .value=${e.filter.operator} @change=${t=>this._handleOperatorChange(t,e)} > ${st(e.type).map((e=>V` <kr-select-option value=${e.key}>${e.label}</kr-select-option> `))} </kr-select-field> ${t} </div> `,s=this._buckets.get(e.id)||[];let o,r;return o=s.length?V` <div class=\"buckets\"> ${s.map((t=>{let i=\"(Empty)\";null!==t.val&&void 0!==t.val&&(i=\"boolean\"===e.type?!0===t.val||\"true\"===t.val?\"Yes\":\"No\":String(t.val));let s=e.filter.has(t.val);\"n_in\"===e.filter.operator&&(s=!s);let o=U;return s&&(o=V` <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"/> </svg> `),V` <div class=\"bucket\" @click=${i=>this._handleBucketToggle(i,e,t)} > <div class=${we({bucket__checkbox:!0,\"bucket__checkbox--checked\":s})}> ${o} </div> <span class=\"bucket__label\">${i}</span> <span class=\"bucket__count\">${t.count}</span> </div> `}))} </div> `:V`<div class=\"bucket-empty\">No data</div>`,r=e.facetable&&e.filterable?V` <kr-tab-group size=\"small\" active-tab-id=${this._filterPanelTab} @tab-change=${e=>this._handleFilterPanelTabChange(e)} > <kr-tab id=\"filter\" label=\"Filter\"> ${i} </kr-tab> <kr-tab id=\"counts\" label=\"Counts\"> ${o} </kr-tab> </kr-tab-group> `:e.facetable?o:i,V` <div class=\"filter-panel\" style=${Re({top:this._filterPanelPos.top+\"px\",left:this._filterPanelPos.left+\"px\"})} > ${r} <div class=\"filter-panel__actions\"> <kr-button variant=\"outline\" color=\"secondary\" size=\"small\" @click=${this._handleFilterClear}> Clear </kr-button> <kr-button size=\"small\" @click=${this._handleFilterApply}> Apply </kr-button> </div> </div> `}_renderFilterRow(){const e=this.getDisplayedColumns();return e.some((e=>e.filterable||e.facetable))?V` <div class=\"filter-row\"> ${e.map(((t,i)=>t.filterable||t.facetable?V` <div class=${we({\"filter-cell\":!0,\"filter-cell--sticky-left\":\"left\"===t.sticky,\"filter-cell--sticky-right\":\"right\"===t.sticky,\"filter-cell--sticky-right-first\":\"right\"===t.sticky&&!e.slice(0,i).some((e=>\"right\"===e.sticky))})} style=${Re(this._getCellStyle(t,i))} > <div class=\"filter-cell__wrapper\"> <input type=\"text\" class=${we({\"filter-cell__input\":!0,\"filter-cell__input--invalid\":!t.filter.isValid()})} .value=${t.filter.kql} @change=${e=>this._handleKqlChange(e,t)} /> ${t.filter?.kql?.length>0?V` <button class=\"filter-cell__clear\" @click=${()=>this._handleKqlClear(t)} > <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/> </svg> </button> `:U} <button class=${we({\"filter-cell__advanced\":!0,\"filter-cell__advanced--opened\":this._filterPanelOpened===t.id})} @click=${e=>this._handleFilterPanelToggle(e,t)} > <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z\"/> </svg> </button> </div> </div> `:V`<div class=${we({\"filter-cell\":!0,\"filter-cell--sticky-left\":\"left\"===t.sticky,\"filter-cell--sticky-right\":\"right\"===t.sticky,\"filter-cell--sticky-right-first\":\"right\"===t.sticky&&!e.slice(0,i).some((e=>\"right\"===e.sticky))})} style=${Re(this._getCellStyle(t,i))} ></div>`))} </div> `:U}_renderTable(){return V` <div class=\"wrapper\"> <div class=\"overlay-left\"></div> <div class=\"overlay-right\"></div> ${this._renderStatus()} <div class=\"content\" @scroll=${this._handleScroll}> <div class=\"table\" style=\"grid-template-columns: ${this._getGridTemplateColumns()}\"> <div class=\"header-row\"> ${this.getDisplayedColumns().map(((e,t)=>V` <div class=${we(this._getHeaderCellClasses(e,t))} style=${Re(this._getCellStyle(e,t))} data-column-id=${e.id} > <span class=\"header-cell__label\">${e.label??e.id}</span> ${this._renderSortIndicator(e)} ${!1!==e.resizable?V`<div class=\"header-cell__resize\" @mousedown=${t=>this._handleResizeStart(t,e.id)} ></div>`:U} </div> `))} </div> ${this._renderFilterRow()} ${this._data.map(((e,t)=>{const i=this.getDisplayedColumns().map(((i,s)=>V` <div class=${we(this._getCellClasses(i,s))} style=${Re(this._getCellStyle(i,s))} data-column-id=${i.id} > ${this._renderCellContent(i,e,t)} </div> `));return this._model.rowHref?V` <a href=${this._model.rowHref(e)} draggable=\"false\" class=${we({row:!0,\"row--clickable\":!0,\"row--link\":!0})} @mousedown=${()=>this._handleRowMouseDown()} @click=${i=>this._handleRowClick(i,e,t)} >${i}</a> `:V` <div class=${we({row:!0,\"row--clickable\":!!this._model.rowClickable})} @mousedown=${()=>this._handleRowMouseDown()} @click=${i=>this._handleRowClick(i,e,t)} >${i}</div> `}))} </div> </div> </div> `}render(){return this._model.columns.length?V` ${this._renderHeader()} ${this._renderTable()} ${this._renderFilterPanel()} `:V`<slot></slot>`}}"
|
|
1246
|
+
"default": "class extends ae{constructor(){super(...arguments),this._scrollStyle=\"edge\",this._data=[],this._dataState=\"idle\",this._page=1,this._pageSize=50,this._totalItems=0,this._totalPages=0,this._searchQuery=\"\",this._canScrollLeft=!1,this._canScrollRight=!1,this._canScrollHorizontal=!1,this._columnPickerOpen=!1,this._filterPanelOpened=null,this._filterPanelTab=\"filter\",this._buckets=new Map,this._filterPanelPos={top:0,left:0},this._sorts=[],this._resizing=null,this._resizeObserver=null,this._searchPositionLocked=!1,this._columnWidthsLocked=!1,this._model=new ut,this.def={columns:[]},this._handleClickOutside=e=>{const t=e.composedPath();if(this._columnPickerOpen){const e=this.shadowRoot?.querySelector(\".column-picker-wrapper\");e&&!t.includes(e)&&(this._columnPickerOpen=!1)}this._filterPanelOpened&&(t.some((e=>e.classList?.contains(\"filter-panel\")))||this._handleFilterApply())},this._handleResizeMove=e=>{if(!this._resizing)return;const t=this._model.columns.find((e=>e.id===this._resizing.columnId));if(t){const i=this._resizing.startWidth+(e.clientX-this._resizing.startX);t.width=`${Math.min(900,Math.max(50,i))}px`,this.requestUpdate()}},this._handleResizeEnd=()=>{this._resizing=null,document.removeEventListener(\"mousemove\",this._handleResizeMove),document.removeEventListener(\"mouseup\",this._handleResizeEnd)}}connectedCallback(){super.connectedCallback(),this.classList.toggle(\"kr-table--scroll-overlay\",\"overlay\"===this._scrollStyle),this.classList.toggle(\"kr-table--scroll-edge\",\"edge\"===this._scrollStyle),this._fetch(),this._initRefresh(),document.addEventListener(\"click\",this._handleClickOutside),this._resizeObserver=new ResizeObserver((()=>{this._searchPositionLocked=!1,this._updateSearchPosition()})),this._resizeObserver.observe(this)}disconnectedCallback(){super.disconnectedCallback(),clearInterval(this._refreshTimer),document.removeEventListener(\"click\",this._handleClickOutside),this._resizeObserver?.disconnect()}willUpdate(e){e.has(\"def\")&&(this._columnWidthsLocked=!1,this._model=new ut,this.def.title&&(this._model.title=this.def.title),this.def.actions&&(this._model.actions=this.def.actions),this.def.data&&(this._model.data=this.def.data),this.def.dataSource&&(this._model.dataSource=this.def.dataSource),\"number\"==typeof this.def.refreshInterval&&(this._model.refreshInterval=this.def.refreshInterval),\"number\"==typeof this.def.pageSize&&(this._model.pageSize=this.def.pageSize),this.def.rowClickable&&(this._model.rowClickable=this.def.rowClickable),this.def.rowHref&&(this._model.rowHref=this.def.rowHref),this._sorts=[],this._model.columns=this.def.columns.map((e=>{const t={...e,filter:null};return t.type||(t.type=\"string\"),e.sort&&this._sorts.push({sortBy:e.id,sortDirection:e.sort}),\"actions\"===t.type?(t.label=e.label??\"\",t.sticky=\"right\",t.resizable=!1,t):((e.filterable||e.facetable)&&(t.filter=new ct,t.filter.field=e.id,t.filter.type=t.type,e.filter?(t.filter.setOperator(e.filter.operator),t.filter.setValue(e.filter.value)):e.facetable&&!e.filterable?(t.filter.operator=\"in\",t.filter.value=[]):\"string\"===t.filter.type&&(t.filter.operator=\"contains\")),t)})),this.def.displayedColumns?this._model.displayedColumns=this.def.displayedColumns:this._model.displayedColumns=this._model.columns.map((e=>e.id)),this._fetch(),this._initRefresh())}updated(e){this._updateScrollFlags(),this._syncSlottedContent()}_syncSlottedContent(){const e=this.getDisplayedColumns().filter((e=>e.render));e.length&&(this.querySelectorAll('[slot^=\"cell-\"]').forEach((e=>e.remove())),this._data.forEach(((t,i)=>{e.forEach((e=>{const s=e.render(t);if(!s)return;const o=document.createElement(\"span\");o.slot=`cell-${i}-${e.id}`,\"actions\"===e.type&&(o.style.display=\"flex\",o.style.gap=\"8px\"),\"string\"==typeof s?o.innerHTML=s:oe(s,o),this.appendChild(o)}))})))}refresh(){this._fetch()}goToPrevPage(){this._page>1&&(this._page--,this._fetch())}goToNextPage(){this._page<this._totalPages&&(this._page++,this._fetch())}goToPage(e){e>=1&&e<=this._totalPages&&(this._page=e,this._fetch())}_toSolrData(){const e={page:this._page-1,size:this._pageSize,sorts:this._sorts,filterFields:[],queryFields:[],facetFields:[]};for(const t of this._model.columns){if(!t.filter||t.filter.isEmpty()||!t.filter.isValid())continue;const i=t.filter.toSolrData();!t.facetable||\"in\"!==t.filter.operator&&\"n_in\"!==t.filter.operator||(i.tagged=!0),e.filterFields.push(i)}for(const t of this._model.columns)t.facetable&&e.facetFields.push({name:t.id,type:\"FIELD\",limit:100,sort:\"count\",minimumCount:1});return this._searchQuery?.trim().length&&e.queryFields.push({name:\"_text_\",operation:\"IS\",value:at(this._searchQuery,!1)}),e}_toDbParams(){const e={page:this._page-1,size:this._pageSize,sorts:this._sorts,filterFields:[],queryFields:[],facetFields:[]};for(const t of this._model.columns)t.filter&&!t.filter.isEmpty()&&t.filter.isValid()&&e.filterFields.push(t.filter.toDbParams());return this._searchQuery?.trim().length&&this._model.columns.filter((e=>e.searchable)).forEach((t=>{e.queryFields.push({name:t.id,operation:\"CONTAINS\",value:this._searchQuery,and:!1})})),e}_fetch(){if(this._model.data)return this._data=this._model.data,this._totalItems=this._model.data.length,this._totalPages=Math.ceil(this._model.data.length/this._pageSize),void(this._dataState=\"success\");if(!this._model.dataSource)return;let e;this._dataState=\"loading\",e=\"db\"===this._model.dataSource.mode?this._toDbParams():this._toSolrData(),this._model.dataSource.fetch(e).then((e=>{switch(this._model.dataSource?.mode){case\"opensearch\":throw Error(\"Opensearch not supported yet\");case\"db\":{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size;break}default:{const t=e;this._data=t.data.content,this._totalItems=t.data.totalElements,this._totalPages=t.data.totalPages,this._pageSize=t.data.size,this._parseFacetResults(t)}}this._dataState=\"success\",this._columnWidthsLocked||requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelectorAll(\".header-row > .header-cell\");if(e){const t=this.getDisplayedColumns();e.forEach(((e,i)=>{i<t.length&&!t[i].width&&\"actions\"!==t[i].type&&(t[i].width=`${e.offsetWidth}px`)}))}this._columnWidthsLocked=!0})),this._updateSearchPosition()})).catch((e=>{this._dataState=\"error\",We.show({message:e instanceof Error?e.message:\"Failed to load data\",type:\"error\"})}))}_parseFacetResults(e){if(e.data.facetFields){for(const t of this._model.columns){if(!t.facetable)continue;const i=e.data.facetFields[t.id];if(!i){this._buckets.set(t.id,[]);continue}const s=[];for(const e of i){let i=e.name;\"boolean\"===t.type&&\"string\"==typeof e.name&&(\"true\"===e.name?i=!0:\"false\"===e.name&&(i=!1)),null===e.name&&e.count>0&&s.unshift({val:null,count:e.count}),null!==e.name&&s.push({val:i,count:e.count})}if(t.filter&&(\"in\"===t.filter.operator||\"n_in\"===t.filter.operator)&&Array.isArray(t.filter.value))for(const e of t.filter.value)s.some((t=>t.val===e))||s.push({val:e,count:0});this._buckets.set(t.id,s)}this._buckets=new Map(this._buckets)}}_initRefresh(){clearInterval(this._refreshTimer),this._model.refreshInterval&&this._model.refreshInterval>0&&(this._refreshTimer=window.setInterval((()=>{this._fetch()}),this._model.refreshInterval))}_handleSearch(e){const t=e.target;this._searchQuery=t.value,this._page=1,this._fetch()}_getGridTemplateColumns(){return this.getDisplayedColumns().map((e=>e.width?e.width:\"actions\"===e.type?\"max-content\":\"minmax(80px, auto)\")).join(\" \")}_updateSearchPosition(){if(this._searchPositionLocked)return;const e=this.shadowRoot?.querySelector(\".search\"),t=e?.querySelector(\".search-field\");e&&t&&(e.style.justifyContent=\"center\",t.style.marginLeft=\"\",requestAnimationFrame((()=>{const i=e.getBoundingClientRect(),s=t.getBoundingClientRect().left-i.left;e.style.justifyContent=\"flex-start\",t.style.marginLeft=`${s}px`,this._searchPositionLocked=!0})))}_toggleColumnPicker(){this._columnPickerOpen=!this._columnPickerOpen}_toggleColumn(e){this._model.displayedColumns.includes(e)?this._model.displayedColumns=this._model.displayedColumns.filter((t=>t!==e)):this._model.displayedColumns=[...this._model.displayedColumns,e],this.requestUpdate()}_handleRowMouseDown(){(this._model.rowClickable||this._model.rowHref)&&window.getSelection()?.removeAllRanges()}_handleRowClick(e,t,i){if(!this._model.rowClickable&&!this._model.rowHref)return;const s=window.getSelection();s&&s.toString().length>0?e.preventDefault():this.dispatchEvent(new CustomEvent(\"row-click\",{detail:{row:t,rowIndex:i},bubbles:!0,composed:!0}))}getDisplayedColumns(){return this._model.displayedColumns.map((e=>this._model.columns.find((t=>t.id===e)))).sort(((e,t)=>\"actions\"===e.type&&\"actions\"!==t.type?1:\"actions\"!==e.type&&\"actions\"===t.type?-1:0))}_handleScroll(e){const t=e.target;this._canScrollLeft=t.scrollLeft>0,this._canScrollRight=t.scrollLeft<t.scrollWidth-t.clientWidth-1}_updateScrollFlags(){const e=this.shadowRoot?.querySelector(\".content\");e&&(this._canScrollLeft=e.scrollLeft>0,this._canScrollRight=e.scrollWidth>e.clientWidth&&e.scrollLeft<e.scrollWidth-e.clientWidth-1,this._canScrollHorizontal=e.scrollWidth>e.clientWidth),this.classList.toggle(\"kr-table--scroll-left-available\",this._canScrollLeft),this.classList.toggle(\"kr-table--scroll-right-available\",this._canScrollRight),this.classList.toggle(\"kr-table--scroll-horizontal-available\",this._canScrollHorizontal),this.classList.toggle(\"kr-table--sticky-left\",this.getDisplayedColumns().some((e=>\"left\"===e.sticky))),this.classList.toggle(\"kr-table--sticky-right\",this.getDisplayedColumns().some((e=>\"right\"===e.sticky)))}_handleResizeStart(e,t){e.preventDefault();const i=this.shadowRoot?.querySelector(`.header-cell[data-column-id=\"${t}\"]`);this._resizing={columnId:t,startX:e.clientX,startWidth:i?.offsetWidth||200},document.addEventListener(\"mousemove\",this._handleResizeMove),document.addEventListener(\"mouseup\",this._handleResizeEnd)}_handleSortClick(e,t){if(e.shiftKey){const e=this._sorts.findIndex((e=>e.sortBy===t.id));if(-1===e)this._sorts.push({sortBy:t.id,sortDirection:\"asc\"});else{const t=this._sorts[e];\"asc\"===t.sortDirection?t.sortDirection=\"desc\":this._sorts.splice(e,1)}this.requestUpdate()}else{let e=null;1===this._sorts.length&&(e=this._sorts.find((e=>e.sortBy===t.id))),e?\"asc\"===e.sortDirection?this._sorts=[{sortBy:t.id,sortDirection:\"desc\"}]:this._sorts=[]:this._sorts=[{sortBy:t.id,sortDirection:\"asc\"}]}this._page=1,this._fetch()}_renderSortIndicator(e){if(!e.sortable)return U;const t=this._sorts.findIndex((t=>t.sortBy===e.id));if(-1===t)return j` <span class=\"header-cell__sort\" @click=${t=>this._handleSortClick(t,e)}> <svg class=\"header-cell__sort-arrow header-cell__sort-arrow--ghost\" viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\"/> </svg> </span> `;let i={};return\"desc\"===this._sorts[t].sortDirection&&(i={transform:\"rotate(180deg)\"}),j` <span class=\"header-cell__sort\" @click=${t=>this._handleSortClick(t,e)}> <svg class=\"header-cell__sort-arrow\" viewBox=\"0 0 24 24\" fill=\"currentColor\" style=${Re(i)}> <path d=\"M4 12l1.41 1.41L11 7.83V20h2V7.83l5.58 5.59L20 12l-8-8-8 8z\"/> </svg> ${this._sorts.length>1?j` <span class=\"header-cell__sort-priority\">${t+1}</span> `:U} </span> `}_handleAction(e){e.href||this.dispatchEvent(new CustomEvent(\"action\",{detail:{action:e.id},bubbles:!0,composed:!0}))}_handleKqlChange(e,t){const i=e.target.value.trim();if(i){if(t.filter.setKql(i),this.requestUpdate(),!t.filter.isValid())return}else t.filter.clear(),this.requestUpdate();this._page=1,this._fetch()}_handleFilterPanelToggle(e,t){if(e.stopPropagation(),this._filterPanelOpened===t.id)this._filterPanelOpened=null;else{const i=e.currentTarget.getBoundingClientRect();let s=i.left;s+328>window.innerWidth&&(s=window.innerWidth-328),this._filterPanelPos={top:i.bottom+4,left:s},this._filterPanelOpened=t.id,t.facetable?this._filterPanelTab=\"counts\":this._filterPanelTab=\"filter\"}}_handleKqlClear(e){e.filter.clear(),this._page=1,this._fetch()}_handleFilterClear(){const e=this._model.columns.find((e=>e.id===this._filterPanelOpened));e&&(e.filter.clear(),e.facetable&&!e.filterable&&(e.filter.operator=\"in\",e.filter.value=[])),this._filterPanelOpened=null,this._page=1,this._fetch()}_handleFilterTextKeydown(e,t){\"Enter\"===e.key&&(e.preventDefault(),this._handleFilterApply())}_handleOperatorChange(e,t){t.filter.setOperator(e.target.value),this.requestUpdate()}_handleFilterStringChange(e,t){t.filter.setValue(e.target.value),this.requestUpdate()}_handleFilterNumberChange(e,t){t.filter.setValue(Number(e.target.value)),this.requestUpdate()}_handleFilterDateChange(e,t){t.filter.setValue(new Date(e.target.value),\"day\"),this.requestUpdate()}_handleFilterBooleanChange(e,t){t.filter.setValue(\"true\"===e.target.value),this.requestUpdate()}_handleFilterDateStartChange(e,t){t.filter.setStart(new Date(e.target.value),\"day\"),this.requestUpdate()}_handleFilterDateEndChange(e,t){t.filter.setEnd(new Date(e.target.value),\"day\"),this.requestUpdate()}_handleFilterNumberStartChange(e,t){t.filter.setStart(Number(e.target.value)),this.requestUpdate()}_handleFilterNumberEndChange(e,t){t.filter.setEnd(Number(e.target.value)),this.requestUpdate()}_handleFilterListChange(e,t){const i=e.target.value.split(\",\").map((e=>e.trim())).filter((e=>\"\"!==e));\"number\"===t.type?t.filter.setValue(i.map((e=>Number(e)))):t.filter.setValue(i),this.requestUpdate()}_handleFilterApply(){this._filterPanelOpened=null,this._page=1,this._fetch()}_handleFilterPanelTabChange(e){this._filterPanelTab=e.detail.activeTabId}_handleBucketToggle(e,t,i){t.filter.toggle(i.val),this._page=1,this._fetch()}_renderCellContent(e,t,i){const s=t[e.id];if(e.render)return j`<slot name=\"cell-${i}-${e.id}\"></slot>`;if(null==s)return\"\";switch(e.type){case\"number\":return\"currency\"===e.format&&\"number\"==typeof s?s.toLocaleString(\"en-US\",{style:\"currency\",currency:\"USD\"}):String(s);case\"date\":{let e;if(s instanceof Date)e=s;else if(\"string\"==typeof s&&/^\\d{4}-\\d{2}-\\d{2} \\d{2}:\\d{2}:\\d{2}/.test(s)){const t=s.replace(/(\\d{2}:\\d{2}:\\d{2}):(\\d+)$/,\"$1.$2\").replace(\" \",\"T\")+\"Z\";e=new Date(t)}else e=new Date(s);return e.toLocaleString(void 0,{year:\"numeric\",month:\"short\",day:\"numeric\",hour:\"numeric\",minute:\"2-digit\",timeZone:\"UTC\"})}case\"boolean\":return!0===s?\"Yes\":!1===s?\"No\":\"\";default:return String(s)}}_getHeaderCellClasses(e,t){return{\"header-cell\":!0,\"header-cell--sortable\":!!e.sortable,\"header-cell--align-center\":\"center\"===e.align,\"header-cell--align-right\":\"right\"===e.align,\"header-cell--sticky-left\":\"left\"===e.sticky,\"header-cell--sticky-left-last\":\"left\"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>\"left\"===e.sticky)),\"header-cell--sticky-right\":\"right\"===e.sticky,\"header-cell--sticky-right-first\":\"right\"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>\"right\"===e.sticky))}}_getCellClasses(e,t){return{cell:!0,\"cell--actions\":\"actions\"===e.type,\"cell--align-center\":\"center\"===e.align,\"cell--align-right\":\"right\"===e.align,\"cell--sticky-left\":\"left\"===e.sticky,\"cell--sticky-left-last\":\"left\"===e.sticky&&!this.getDisplayedColumns().slice(t+1).some((e=>\"left\"===e.sticky)),\"cell--sticky-right\":\"right\"===e.sticky,\"cell--sticky-right-first\":\"right\"===e.sticky&&!this.getDisplayedColumns().slice(0,t).some((e=>\"right\"===e.sticky))}}_getCellStyle(e,t){const i={};if(\"left\"===e.sticky){let e=0;for(let i=0;i<t;i++){const t=this.getDisplayedColumns()[i];\"left\"===t.sticky&&(e+=parseInt(t.width||\"0\",10))}i.left=`${e}px`}if(\"right\"===e.sticky){let e=0;for(let i=t+1;i<this.getDisplayedColumns().length;i++){const t=this.getDisplayedColumns()[i];\"right\"===t.sticky&&(e+=parseInt(t.width||\"0\",10))}i.right=`${e}px`}return i}_renderPagination(){const e=(this._page-1)*this._pageSize+1,t=Math.min(this._page*this._pageSize,this._totalItems);return j` <div class=\"pagination\"> <span class=\"pagination-icon ${1===this._page?\"pagination-icon--disabled\":\"\"}\" @click=${this.goToPrevPage} > <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M15.41 7.41L14 6l-6 6 6 6 1.41-1.41L10.83 12z\"/></svg> </span> <span class=\"pagination-info\">${e}-${t} of ${this._totalItems}</span> <span class=\"pagination-icon ${this._page===this._totalPages?\"pagination-icon--disabled\":\"\"}\" @click=${this.goToNextPage} > <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M10 6L8.59 7.41 13.17 12l-4.58 4.59L10 18l6-6z\"/></svg> </span> </div> `}_renderHeader(){return!this._model.title&&!this._model.actions?.length&&this._totalPages<=1?U:j` <div class=\"header\"> <div class=\"title\">${this._model.title??\"\"}</div> ${\"db\"!==this._model.dataSource?.mode||this._model.columns.some((e=>e.searchable))?j` <div class=\"search\"> <!-- TODO: Saved views dropdown <div class=\"views\"> <span>Default View</span> <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6 1.41-1.41z\"/></svg> </div> --> <div class=\"search-field\"> <svg class=\"search-icon\" viewBox=\"0 -960 960 960\" fill=\"currentColor\"><path d=\"M784-120 532-372q-30 24-69 38t-83 14q-109 0-184.5-75.5T120-580q0-109 75.5-184.5T380-840q109 0 184.5 75.5T640-580q0 44-14 83t-38 69l252 252-56 56ZM380-400q75 0 127.5-52.5T560-580q0-75-52.5-127.5T380-760q-75 0-127.5 52.5T200-580q0 75 52.5 127.5T380-400Z\"/></svg> <input type=\"text\" class=\"search-input\" placeholder=\"Search...\" .value=${this._searchQuery} @input=${this._handleSearch} /> </div> </div> `:j`<div class=\"search\"></div>`} <div class=\"tools\"> ${this._renderPagination()} <span class=\"refresh\" title=\"Refresh\" @click=${()=>this.refresh()}> <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\"><path d=\"M480-160q-134 0-227-93t-93-227q0-134 93-227t227-93q69 0 132 28.5T720-690v-110h80v280H520v-80h168q-32-56-87.5-88T480-720q-100 0-170 70t-70 170q0 100 70 170t170 70q77 0 139-44t87-116h84q-28 106-114 173t-196 67Z\"/></svg> </span> <div class=\"column-picker-wrapper\"> <span class=\"header-icon\" title=\"Columns\" @click=${this._toggleColumnPicker}> <svg viewBox=\"0 -960 960 960\" fill=\"currentColor\"><path d=\"M121-280v-400q0-33 23.5-56.5T201-760h559q33 0 56.5 23.5T840-680v400q0 33-23.5 56.5T760-200H201q-33 0-56.5-23.5T121-280Zm79 0h133v-400H200v400Zm213 0h133v-400H413v400Zm213 0h133v-400H626v400Z\"/></svg> </span> <div class=\"column-picker ${this._columnPickerOpen?\"open\":\"\"}\"> ${[...this._model.columns].filter((e=>\"actions\"!==e.type)).sort(((e,t)=>(e.label??e.id).localeCompare(t.label??t.id))).map((e=>j` <div class=\"column-picker-item\" @click=${()=>this._toggleColumn(e.id)}> <div class=\"column-picker-checkbox ${this._model.displayedColumns.includes(e.id)?\"checked\":\"\"}\"> <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"/></svg> </div> <span class=\"column-picker-label\">${e.label??e.id}</span> </div> `))} </div> </div> ${1===this._model.actions?.length?j` <kr-button class=\"actions\" .href=${this._model.actions[0].href} .target=${this._model.actions[0].target} @click=${()=>this._handleAction(this._model.actions[0])} > ${this._model.actions[0].label} </kr-button> `:this._model.actions?.length?j` <kr-button class=\"actions\" .options=${this._model.actions.map((e=>({id:e.id,label:e.label})))} @option-select=${e=>this._handleAction({id:e.detail.id,label:e.detail.label})} > Actions </kr-button> `:U} </div> </div> `}_renderStatus(){return\"loading\"===this._dataState&&0===this._data.length?j`<div class=\"status\">Loading...</div>`:\"error\"===this._dataState&&0===this._data.length?j`<div class=\"status status--error\">Error loading data</div>`:0===this._data.length?j`<div class=\"status\">No data available</div>`:U}_renderFilterPanel(){if(!this._filterPanelOpened)return U;const e=this._model.columns.find((e=>e.id===this._filterPanelOpened));let t=j``;t=\"empty\"===e.filter.operator||\"n_empty\"===e.filter.operator?j` <input type=\"text\" class=\"filter-panel__input\" disabled .value=${e.filter.text} /> `:\"between\"===e.filter.operator&&\"date\"===e.type?j` <input type=\"date\" class=\"filter-panel__input\" .valueAsDate=${e.filter.value?.start??null} @change=${t=>this._handleFilterDateStartChange(t,e)} /> <input type=\"date\" class=\"filter-panel__input\" .valueAsDate=${e.filter.value?.end??null} @change=${t=>this._handleFilterDateEndChange(t,e)} /> `:\"between\"===e.filter.operator&&\"number\"===e.type?j` <input type=\"number\" class=\"filter-panel__input\" placeholder=\"Start\" .value=${e.filter.value?.start??\"\"} @input=${t=>this._handleFilterNumberStartChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} /> <input type=\"number\" class=\"filter-panel__input\" placeholder=\"End\" .value=${e.filter.value?.end??\"\"} @input=${t=>this._handleFilterNumberEndChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} /> `:\"in\"===e.filter.operator||\"n_in\"===e.filter.operator?j` <textarea class=\"filter-panel__textarea\" rows=\"3\" placeholder=\"Values (comma-separated)\" .value=${e.filter.text} @input=${t=>this._handleFilterListChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} ></textarea> `:\"boolean\"===e.type?j` <kr-select-field placeholder=\"Value\" .value=${String(e.filter.value??\"\")} @change=${t=>this._handleFilterBooleanChange(t,e)} > <kr-select-option value=\"true\">Yes</kr-select-option> <kr-select-option value=\"false\">No</kr-select-option> </kr-select-field> `:\"date\"===e.type?j` <input type=\"date\" class=\"filter-panel__input\" .valueAsDate=${e.filter.value} @change=${t=>this._handleFilterDateChange(t,e)} /> `:\"number\"===e.type?j` <input type=\"number\" class=\"filter-panel__input\" placeholder=\"Value\" min=\"0\" .value=${e.filter.text} @input=${t=>this._handleFilterNumberChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} /> `:j` <input type=\"text\" class=\"filter-panel__input\" placeholder=\"Value\" .value=${e.filter.text} @input=${t=>this._handleFilterStringChange(t,e)} @keydown=${t=>this._handleFilterTextKeydown(t,e)} /> `;const i=j` <div class=\"filter-panel__content\"> <kr-select-field .value=${e.filter.operator} @change=${t=>this._handleOperatorChange(t,e)} > ${st(e.type).map((e=>j` <kr-select-option value=${e.key}>${e.label}</kr-select-option> `))} </kr-select-field> ${t} </div> `,s=this._buckets.get(e.id)||[];let o,r;return o=s.length?j` <div class=\"buckets\"> ${s.map((t=>{let i=\"(Empty)\";null!==t.val&&void 0!==t.val&&(i=\"boolean\"===e.type?!0===t.val||\"true\"===t.val?\"Yes\":\"No\":String(t.val));let s=e.filter.has(t.val);\"n_in\"===e.filter.operator&&(s=!s);let o=U;return s&&(o=j` <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M9 16.17L4.83 12l-1.42 1.41L9 19 21 7l-1.41-1.41z\"/> </svg> `),j` <div class=\"bucket\" @click=${i=>this._handleBucketToggle(i,e,t)} > <div class=${we({bucket__checkbox:!0,\"bucket__checkbox--checked\":s})}> ${o} </div> <span class=\"bucket__label\">${i}</span> <span class=\"bucket__count\">${t.count}</span> </div> `}))} </div> `:j`<div class=\"bucket-empty\">No data</div>`,r=e.facetable&&e.filterable?j` <kr-tab-group size=\"small\" active-tab-id=${this._filterPanelTab} @tab-change=${e=>this._handleFilterPanelTabChange(e)} > <kr-tab id=\"filter\" label=\"Filter\"> ${i} </kr-tab> <kr-tab id=\"counts\" label=\"Counts\"> ${o} </kr-tab> </kr-tab-group> `:e.facetable?o:i,j` <div class=\"filter-panel\" style=${Re({top:this._filterPanelPos.top+\"px\",left:this._filterPanelPos.left+\"px\"})} > ${r} <div class=\"filter-panel__actions\"> <kr-button variant=\"outline\" color=\"secondary\" size=\"small\" @click=${this._handleFilterClear}> Clear </kr-button> <kr-button size=\"small\" @click=${this._handleFilterApply}> Apply </kr-button> </div> </div> `}_renderFilterRow(){const e=this.getDisplayedColumns();return e.some((e=>e.filterable||e.facetable))?j` <div class=\"filter-row\"> ${e.map(((t,i)=>t.filterable||t.facetable?j` <div class=${we({\"filter-cell\":!0,\"filter-cell--sticky-left\":\"left\"===t.sticky,\"filter-cell--sticky-right\":\"right\"===t.sticky,\"filter-cell--sticky-right-first\":\"right\"===t.sticky&&!e.slice(0,i).some((e=>\"right\"===e.sticky))})} style=${Re(this._getCellStyle(t,i))} > <div class=\"filter-cell__wrapper\"> <input type=\"text\" class=${we({\"filter-cell__input\":!0,\"filter-cell__input--invalid\":!t.filter.isValid()})} .value=${t.filter.kql} @change=${e=>this._handleKqlChange(e,t)} /> ${t.filter?.kql?.length>0?j` <button class=\"filter-cell__clear\" @click=${()=>this._handleKqlClear(t)} > <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/> </svg> </button> `:U} <button class=${we({\"filter-cell__advanced\":!0,\"filter-cell__advanced--opened\":this._filterPanelOpened===t.id})} @click=${e=>this._handleFilterPanelToggle(e,t)} > <svg viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M10 18h4v-2h-4v2zM3 6v2h18V6H3zm3 7h12v-2H6v2z\"/> </svg> </button> </div> </div> `:j`<div class=${we({\"filter-cell\":!0,\"filter-cell--sticky-left\":\"left\"===t.sticky,\"filter-cell--sticky-right\":\"right\"===t.sticky,\"filter-cell--sticky-right-first\":\"right\"===t.sticky&&!e.slice(0,i).some((e=>\"right\"===e.sticky))})} style=${Re(this._getCellStyle(t,i))} ></div>`))} </div> `:U}_renderTable(){return j` <div class=\"wrapper\"> <div class=\"overlay-left\"></div> <div class=\"overlay-right\"></div> ${this._renderStatus()} <div class=\"content\" @scroll=${this._handleScroll}> <div class=\"table\" style=\"grid-template-columns: ${this._getGridTemplateColumns()}\"> <div class=\"header-row\"> ${this.getDisplayedColumns().map(((e,t)=>j` <div class=${we(this._getHeaderCellClasses(e,t))} style=${Re(this._getCellStyle(e,t))} data-column-id=${e.id} > <span class=\"header-cell__label\">${e.label??e.id}</span> ${this._renderSortIndicator(e)} ${!1!==e.resizable?j`<div class=\"header-cell__resize\" @mousedown=${t=>this._handleResizeStart(t,e.id)} ></div>`:U} </div> `))} </div> ${this._renderFilterRow()} ${this._data.map(((e,t)=>{const i=this.getDisplayedColumns().map(((i,s)=>j` <div class=${we(this._getCellClasses(i,s))} style=${Re(this._getCellStyle(i,s))} data-column-id=${i.id} > ${this._renderCellContent(i,e,t)} </div> `));return this._model.rowHref?j` <a href=${this._model.rowHref(e)} draggable=\"false\" class=${we({row:!0,\"row--clickable\":!0,\"row--link\":!0})} @mousedown=${()=>this._handleRowMouseDown()} @click=${i=>this._handleRowClick(i,e,t)} >${i}</a> `:j` <div class=${we({row:!0,\"row--clickable\":!!this._model.rowClickable})} @mousedown=${()=>this._handleRowMouseDown()} @click=${i=>this._handleRowClick(i,e,t)} >${i}</div> `}))} </div> </div> </div> `}render(){return this._model.columns.length?j` ${this._renderHeader()} ${this._renderTable()} ${this._renderFilterPanel()} `:j`<slot></slot>`}}"
|
|
1203
1247
|
},
|
|
1204
1248
|
{
|
|
1205
1249
|
"kind": "variable",
|
|
1206
1250
|
"name": "vt",
|
|
1207
|
-
"default": "class extends ae{constructor(){super(...arguments),this.size=\"md\",this.color=\"dark\"}render(){var e=\"\",t=\"\";return e=\"sm\"==this.size?\"16px\":\"md\"==this.size?\"24px\":\"lg\"==this.size?\"32px\":\"xl\"==this.size?\"48px\":this.size,t=\"dark\"==this.color?\"#163052\":\"light\"==this.color?\"#ffffff\":this.color,
|
|
1251
|
+
"default": "class extends ae{constructor(){super(...arguments),this.size=\"md\",this.color=\"dark\"}render(){var e=\"\",t=\"\";return e=\"sm\"==this.size?\"16px\":\"md\"==this.size?\"24px\":\"lg\"==this.size?\"32px\":\"xl\"==this.size?\"48px\":this.size,t=\"dark\"==this.color?\"#163052\":\"light\"==this.color?\"#ffffff\":this.color,j` <svg class=\"spinner\" style=${`width: ${e}; height: ${e}; color: ${t}`} viewBox=\"0 0 44 44\" role=\"status\" aria-label=\"Loading\" > <circle class=\"circle\" cx=\"22\" cy=\"22\" r=\"20\" fill=\"none\" stroke-width=\"4\" /> </svg> `}}"
|
|
1208
1252
|
},
|
|
1209
1253
|
{
|
|
1210
1254
|
"kind": "variable",
|
|
1211
1255
|
"name": "_t",
|
|
1212
|
-
"default": "class extends ae{constructor(){super(...arguments),this.color=\"dark\"}render(){let e=\"\",t=\"\";return e=\"dark\"===this.color?\"#163052\":\"light\"===this.color?\"#ffffff\":this.color,t=this.trackColor?this.trackColor:\"light\"===this.color?\"#ffffff4d\":\"#0000001a\",
|
|
1256
|
+
"default": "class extends ae{constructor(){super(...arguments),this.color=\"dark\"}render(){let e=\"\",t=\"\";return e=\"dark\"===this.color?\"#163052\":\"light\"===this.color?\"#ffffff\":this.color,t=this.trackColor?this.trackColor:\"light\"===this.color?\"#ffffff4d\":\"#0000001a\",j` <div class=\"progress-bar\" style=${`background: ${t}`} role=\"status\" aria-label=\"Loading\" > <div class=\"fill\" style=${`background: ${e}`}></div> </div> `}}"
|
|
1213
1257
|
},
|
|
1214
1258
|
{
|
|
1215
1259
|
"kind": "variable",
|
|
@@ -1218,27 +1262,37 @@
|
|
|
1218
1262
|
{
|
|
1219
1263
|
"kind": "variable",
|
|
1220
1264
|
"name": "wt",
|
|
1221
|
-
"default": "class extends ae{constructor(){super(...arguments),this.files=[],this.emptyMessage=\"No files\"}_handleFileClick(e){if(this.dispatchEvent(new CustomEvent(\"file-click\",{bubbles:!0,composed:!0,detail:{file:e}})),e.url){xt.open({src:e.url,name:e.name}).addEventListener(\"download\",(()=>{this._handleDownload(e)}))}}_handleDownload(e){this.dispatchEvent(new CustomEvent(\"download\",{bubbles:!0,composed:!0,detail:{file:e}}))}_handleDelete(e){this.dispatchEvent(new CustomEvent(\"delete\",{bubbles:!0,composed:!0,detail:{file:e}}))}_getExtension(e){return e.split(\".\").pop()?.toLowerCase()||\"\"}_getExtClass(e){return[\"pdf\"].includes(e)?\"file-list__ext--pdf\":[\"doc\",\"docx\",\"rtf\",\"txt\"].includes(e)?\"file-list__ext--doc\":[\"xls\",\"xlsx\",\"csv\"].includes(e)?\"file-list__ext--xls\":[\"zip\",\"rar\",\"7z\",\"gz\",\"tar\"].includes(e)?\"file-list__ext--zip\":[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"bmp\"].includes(e)?\"file-list__ext--img\":\"file-list__ext--default\"}_getExtIcon(e){return[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"bmp\"].includes(e)?
|
|
1265
|
+
"default": "class extends ae{constructor(){super(...arguments),this.files=[],this.emptyMessage=\"No files\"}_handleFileClick(e){if(this.dispatchEvent(new CustomEvent(\"file-click\",{bubbles:!0,composed:!0,detail:{file:e}})),e.url){xt.open({src:e.url,name:e.name}).addEventListener(\"download\",(()=>{this._handleDownload(e)}))}}_handleDownload(e){this.dispatchEvent(new CustomEvent(\"download\",{bubbles:!0,composed:!0,detail:{file:e}}))}_handleDelete(e){this.dispatchEvent(new CustomEvent(\"delete\",{bubbles:!0,composed:!0,detail:{file:e}}))}_getExtension(e){return e.split(\".\").pop()?.toLowerCase()||\"\"}_getExtClass(e){return[\"pdf\"].includes(e)?\"file-list__ext--pdf\":[\"doc\",\"docx\",\"rtf\",\"txt\"].includes(e)?\"file-list__ext--doc\":[\"xls\",\"xlsx\",\"csv\"].includes(e)?\"file-list__ext--xls\":[\"zip\",\"rar\",\"7z\",\"gz\",\"tar\"].includes(e)?\"file-list__ext--zip\":[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"bmp\"].includes(e)?\"file-list__ext--img\":\"file-list__ext--default\"}_getExtIcon(e){return[\"jpg\",\"jpeg\",\"png\",\"gif\",\"webp\",\"svg\",\"bmp\"].includes(e)?j`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M19 5v14H5V5h14m0-2H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm-4.86 8.86-3 3.87L9 13.14 6 17h12l-3.86-5.14z\"/></svg>`:[\"pdf\"].includes(e)?j`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M20 2H8c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2zm-8.5 7.5c0 .83-.67 1.5-1.5 1.5H9v2H7.5V7H10c.83 0 1.5.67 1.5 1.5v1zm5 2c0 .83-.67 1.5-1.5 1.5h-2.5V7H15c.83 0 1.5.67 1.5 1.5v3zm4-3H19v1h1.5V11H19v2h-1.5V7h3v1.5zM9 9.5h1v-1H9v1zM4 6H2v14c0 1.1.9 2 2 2h14v-2H4V6zm10 5.5h1v-3h-1v3z\"/></svg>`:[\"doc\",\"docx\",\"rtf\",\"txt\"].includes(e)?j`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zM6 20V4h7v5h5v11H6zm2-6h8v2H8v-2zm0-4h8v2H8v-2zm0 8h5v2H8v-2z\"/></svg>`:[\"xls\",\"xlsx\",\"csv\"].includes(e)?j`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M19 3H5c-1.1 0-2 .9-2 2v14c0 1.1.9 2 2 2h14c1.1 0 2-.9 2-2V5c0-1.1-.9-2-2-2zm0 2v3H5V5h14zm0 5v4H5v-4h14zM5 19v-3h14v3H5zm2-8h4v2H7v-2zm0 5h4v2H7v-2z\"/></svg>`:[\"zip\",\"rar\",\"7z\",\"gz\",\"tar\"].includes(e)?j`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M20 6h-8l-2-2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V8c0-1.1-.9-2-2-2zm0 12H4V6h5.17l2 2H20v10zm-8-4h2v2h-2v-2zm0-4h2v2h-2v-2zm-2 2h2v2h-2v-2z\"/></svg>`:j`<svg xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" fill=\"currentColor\"><path d=\"M14 2H6c-1.1 0-2 .9-2 2v16c0 1.1.9 2 2 2h12c1.1 0 2-.9 2-2V8l-6-6zm4 18H6V4h7v5h5v11z\"/></svg>`}render(){return this.files.length?j` <div class=\"file-list\"> ${this.files.map((e=>{const t=this._getExtension(e.name),i=e.meta||e.date||\"\";return j` <div class=\"file-list__item\"> <div class=\"file-list__ext ${this._getExtClass(t)}\">${this._getExtIcon(t)}</div> <div class=\"file-list__info\"> <a class=\"file-list__name\" @click=${()=>this._handleFileClick(e)}>${e.name}</a> ${i?j`<div class=\"file-list__meta\">${i}</div>`:\"\"} </div> <div class=\"file-list__actions\"> <svg class=\"file-list__action\" @click=${()=>this._handleDownload(e)} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" title=\"Download\"><path d=\"M19 9h-4V3H9v6H5l7 7 7-7zm-8 2V5h2v6h1.17L12 13.17 9.83 11H11zm-6 7h14v2H5v-2z\"/></svg> <svg class=\"file-list__action file-list__action--delete\" @click=${()=>this._handleDelete(e)} xmlns=\"http://www.w3.org/2000/svg\" viewBox=\"0 0 24 24\" title=\"Delete\"><path d=\"M16 9v10H8V9h8m-1.5-6h-5l-1 1H5v2h14V4h-3.5l-1-1zM18 7H6v12c0 1.1.9 2 2 2h8c1.1 0 2-.9 2-2V7z\"/></svg> </div> </div> `}))} </div> `:j`<div class=\"file-list__empty\">${this.emptyMessage}</div>`}}"
|
|
1222
1266
|
},
|
|
1223
1267
|
{
|
|
1224
1268
|
"kind": "variable",
|
|
1225
1269
|
"name": "zt",
|
|
1226
|
-
"default": "class extends ae{constructor(){super(),this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"\",this.type=\"text\",this.required=!1,this.disabled=!1,this.readonly=!1,this.autocomplete=\"\",this.hint=\"\",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._touched=!1,this._dirty=!1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity()}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage)}render(){let e=\"\";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),
|
|
1270
|
+
"default": "class extends ae{constructor(){super(),this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"\",this.type=\"text\",this.required=!1,this.disabled=!1,this.readonly=!1,this.autocomplete=\"\",this.hint=\"\",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._touched=!1,this._dirty=!1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity()}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage)}render(){let e=\"\";return this._touched&&this._input&&!this._input.validity.valid&&(e=this._input.validationMessage),j` <div class=\"wrapper\"> ${this.label?j` <label for=\"input\"> ${this.label} ${this.required?j`<span class=\"required\" aria-hidden=\"true\">*</span>`:\"\"} </label> `:\"\"} <input id=\"input\" class=${we({\"input--invalid\":this._touched&&this._input&&!this._input.validity.valid})} type=${this.type} name=${this.name} .value=${St(this.value)} placeholder=${this.placeholder} ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly} minlength=${$t(this.minlength)} maxlength=${$t(this.maxlength)} pattern=${$t(this.pattern)} autocomplete=${$t(this.autocomplete||void 0)} @input=${this._handleInput} @change=${this._handleChange} @blur=${this._handleBlur} /> ${e?j`<div class=\"validation-message\">${e}</div>`:this.hint?j`<div class=\"hint\">${this.hint}</div>`:\"\"} </div> `}focus(){this._input?.focus()}blur(){this._input?.blur()}select(){this._input?.select()}}"
|
|
1227
1271
|
},
|
|
1228
1272
|
{
|
|
1229
1273
|
"kind": "variable",
|
|
1230
1274
|
"name": "Tt",
|
|
1231
|
-
"default": "class extends ae{constructor(){super(),this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"\",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=3,this.autocomplete=\"\",this.hint=\"\",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._touched=!1,this._dirty=!1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity()}_updateValidity(){this._textarea&&this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}render(){let e=\"\";return this._touched&&this._textarea&&!this._textarea.validity.valid&&(e=this._textarea.validationMessage),
|
|
1275
|
+
"default": "class extends ae{constructor(){super(),this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"\",this.required=!1,this.disabled=!1,this.readonly=!1,this.rows=3,this.autocomplete=\"\",this.hint=\"\",this._touched=!1,this._dirty=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._touched=!1,this._dirty=!1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity()}_updateValidity(){this._textarea&&this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleInput(e){this.value=e.target.value,this._dirty=!0,this._internals.setFormValue(this.value),this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}_handleChange(e){this.value=e.target.value,this._internals.setFormValue(this.value)}_handleBlur(){this._touched=!0,this._internals.setValidity(this._textarea.validity,this._textarea.validationMessage)}render(){let e=\"\";return this._touched&&this._textarea&&!this._textarea.validity.valid&&(e=this._textarea.validationMessage),j` <div class=\"wrapper\"> ${this.label?j` <label for=\"textarea\"> ${this.label} ${this.required?j`<span class=\"required\" aria-hidden=\"true\">*</span>`:U} </label> `:U} <textarea id=\"textarea\" class=${we({\"textarea--invalid\":this._touched&&this._textarea&&!this._textarea.validity.valid})} name=${this.name} .value=${St(this.value)} placeholder=${this.placeholder} ?required=${this.required} ?disabled=${this.disabled} ?readonly=${this.readonly} rows=${this.rows} cols=${$t(this.cols)} minlength=${$t(this.minlength)} maxlength=${$t(this.maxlength)} autocomplete=${$t(this.autocomplete||void 0)} @input=${this._handleInput} @change=${this._handleChange} @blur=${this._handleBlur} ></textarea> ${e?j`<div class=\"validation-message\">${e}</div>`:this.hint?j`<div class=\"hint\">${this.hint}</div>`:U} </div> `}focus(){this._textarea?.focus()}blur(){this._textarea?.blur()}select(){this._textarea?.select()}}"
|
|
1232
1276
|
},
|
|
1233
1277
|
{
|
|
1234
1278
|
"kind": "variable",
|
|
1235
1279
|
"name": "It",
|
|
1236
|
-
"default": "class extends ae{constructor(){super(),this._requestId=0,this._handleDocumentClick=e=>{e.composedPath().includes(this)||(this._isOpen=!1)},this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"\",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint=\"\",this.options=[],this.fetch=null,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleDocumentClick),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleDocumentClick),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity(),e.has(\"options\")&&this._isOpen&&this._positionDropdown()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._touched=!1,this._isOpen=!1,this._highlightedIndex=-1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_fetch(){if(!this.fetch)return;this._requestId++;const e=this._requestId;this.fetch(this.value).then((t=>{e===this._requestId&&(this.options=t)})).catch((e=>{console.error(\"kr-auto-suggest: fetch failed\",e)}))}_handleInput(e){this.value=e.target.value,this._isOpen=!0,this._highlightedIndex=-1,this._positionDropdown(),this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})),this._fetch()}_positionDropdown(){requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(\".dropdown\");if(!e)return;const t=this._input.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8,s=t.top-4-8;e.style.left=t.left+\"px\",e.style.width=t.width+\"px\",s>i?(e.style.top=\"\",e.style.bottom=window.innerHeight-t.top+4+\"px\",e.style.maxHeight=s+\"px\"):(e.style.bottom=\"\",e.style.top=t.bottom+4+\"px\",e.style.maxHeight=i+\"px\")}))}_handleFocus(){this._isOpen=!0,this._positionDropdown(),this._fetch()}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage),setTimeout((()=>{this._isOpen=!1,this._highlightedIndex=-1}),200)}_handleKeyDown(e){switch(e.key){case\"ArrowDown\":e.preventDefault(),this._isOpen=!0,this._highlightedIndex=Math.min(this._highlightedIndex+1,this.options.length-1),this._scrollToHighlighted();break;case\"ArrowUp\":e.preventDefault(),-1===this._highlightedIndex?(this._isOpen=!0,this._highlightedIndex=this.options.length-1):this._highlightedIndex=Math.max(this._highlightedIndex-1,0),this._scrollToHighlighted();break;case\"Enter\":this._highlightedIndex>=0&&this.options[this._highlightedIndex]&&(e.preventDefault(),this._selectOption(this.options[this._highlightedIndex]));break;case\"Escape\":e.preventDefault(),this._isOpen=!1,this._highlightedIndex=-1;break;case\"Tab\":this._isOpen=!1,this._highlightedIndex=-1}}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(\".dropdown\"),t=this.shadowRoot?.querySelector(\".option--highlighted\");if(e&&t){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect();(s.bottom>i.bottom||s.top<i.top)&&t.scrollIntoView({block:\"nearest\"})}}))}_selectOption(e){e.disabled||(this.value=e.value,this._isOpen=!1,this._highlightedIndex=-1,this._internals.setFormValue(this.value),this.dispatchEvent(new CustomEvent(\"select\",{detail:{value:e.value,option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})))}_handleClear(){this.value=\"\",this._internals.setFormValue(this.value),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})),this._input?.focus()}_handleOptionMouseEnter(e,t){this._highlightedIndex=t}_renderOption(e,t){return
|
|
1280
|
+
"default": "class extends ae{constructor(){super(),this._requestId=0,this._handleDocumentClick=e=>{e.composedPath().includes(this)||(this._isOpen=!1)},this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"\",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint=\"\",this.options=[],this.fetch=null,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleDocumentClick),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleDocumentClick),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity(),e.has(\"options\")&&this._isOpen&&this._positionDropdown()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._touched=!1,this._isOpen=!1,this._highlightedIndex=-1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}_updateValidity(){this._input&&this._internals.setValidity(this._input.validity,this._input.validationMessage)}_fetch(){if(!this.fetch)return;this._requestId++;const e=this._requestId;this.fetch(this.value).then((t=>{e===this._requestId&&(this.options=t)})).catch((e=>{console.error(\"kr-auto-suggest: fetch failed\",e)}))}_handleInput(e){this.value=e.target.value,this._isOpen=!0,this._highlightedIndex=-1,this._positionDropdown(),this._internals.setFormValue(this.value),this._internals.setValidity(this._input.validity,this._input.validationMessage),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})),this._fetch()}_positionDropdown(){requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(\".dropdown\");if(!e)return;const t=this._input.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8,s=t.top-4-8;e.style.left=t.left+\"px\",e.style.width=t.width+\"px\",s>i?(e.style.top=\"\",e.style.bottom=window.innerHeight-t.top+4+\"px\",e.style.maxHeight=s+\"px\"):(e.style.bottom=\"\",e.style.top=t.bottom+4+\"px\",e.style.maxHeight=i+\"px\")}))}_handleFocus(){this._isOpen=!0,this._positionDropdown(),this._fetch()}_handleBlur(){this._touched=!0,this._internals.setValidity(this._input.validity,this._input.validationMessage),setTimeout((()=>{this._isOpen=!1,this._highlightedIndex=-1}),200)}_handleKeyDown(e){switch(e.key){case\"ArrowDown\":e.preventDefault(),this._isOpen=!0,this._highlightedIndex=Math.min(this._highlightedIndex+1,this.options.length-1),this._scrollToHighlighted();break;case\"ArrowUp\":e.preventDefault(),-1===this._highlightedIndex?(this._isOpen=!0,this._highlightedIndex=this.options.length-1):this._highlightedIndex=Math.max(this._highlightedIndex-1,0),this._scrollToHighlighted();break;case\"Enter\":this._highlightedIndex>=0&&this.options[this._highlightedIndex]&&(e.preventDefault(),this._selectOption(this.options[this._highlightedIndex]));break;case\"Escape\":e.preventDefault(),this._isOpen=!1,this._highlightedIndex=-1;break;case\"Tab\":this._isOpen=!1,this._highlightedIndex=-1}}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(\".dropdown\"),t=this.shadowRoot?.querySelector(\".option--highlighted\");if(e&&t){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect();(s.bottom>i.bottom||s.top<i.top)&&t.scrollIntoView({block:\"nearest\"})}}))}_selectOption(e){e.disabled||(this.value=e.value,this._isOpen=!1,this._highlightedIndex=-1,this._internals.setFormValue(this.value),this.dispatchEvent(new CustomEvent(\"select\",{detail:{value:e.value,option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})))}_handleClear(){this.value=\"\",this._internals.setFormValue(this.value),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})),this._input?.focus()}_handleOptionMouseEnter(e,t){this._highlightedIndex=t}_renderOption(e,t){return j` <button class=${we({option:!0,\"option--highlighted\":t===this._highlightedIndex})} type=\"button\" role=\"option\" aria-selected=${t===this._highlightedIndex} ?disabled=${e.disabled} @click=${t=>this._selectOption(e)} @mouseenter=${e=>this._handleOptionMouseEnter(e,t)} > ${e.label||e.value} </button> `}render(){let e=U;return this._touched&&this._input&&!this._input.validity.valid?e=j`<div class=\"validation-message\">${this._input.validationMessage}</div>`:this.hint&&(e=j`<div class=\"hint\">${this.hint}</div>`),j` <div class=\"wrapper\"> ${this.label?j` <label> ${this.label} ${this.required?j`<span class=\"required\">*</span>`:U} </label> `:U} <div class=\"input-wrapper\"> <input type=\"text\" .value=${St(this.value)} placeholder=${this.placeholder} ?disabled=${this.disabled} ?readonly=${this.readonly} ?required=${this.required} name=${this.name} autocomplete=\"off\" role=\"combobox\" aria-autocomplete=\"list\" aria-expanded=${this._isOpen} aria-controls=\"dropdown\" class=${we({\"input--invalid\":this._touched&&this._input&&!this._input.validity.valid})} @input=${this._handleInput} @blur=${this._handleBlur} @focus=${this._handleFocus} @keydown=${this._handleKeyDown} /> <div class=\"icon-wrapper\"> ${!this.value||this.disabled||this.readonly?U:j` <svg class=\"clear\" viewBox=\"0 0 24 24\" fill=\"currentColor\" aria-label=\"Clear\" @click=${this._handleClear}> <path d=\"M19 6.41L17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z\"/> </svg> `} ${this.value||this.disabled||this.readonly?U:j` <svg class=\"search-icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/> </svg> `} </div> </div> <div id=\"dropdown\" role=\"listbox\" class=${we({dropdown:!0,\"dropdown--open\":this._isOpen&&this.options.length>0})} > ${this.options.map(((e,t)=>this._renderOption(e,t)))} </div> ${e} </div> `}}"
|
|
1237
1281
|
},
|
|
1238
1282
|
{
|
|
1239
1283
|
"kind": "variable",
|
|
1240
1284
|
"name": "Rt",
|
|
1241
|
-
"default": "class extends ae{constructor(){super(),this._requestId=0,this._selectedOption=null,this._handleDocumentClick=e=>{e.composedPath().includes(this)||this._close()},this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"Select an option\",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint=\"\",this.optionValue=\"value\",this.optionLabel=\"label\",this.options=[],this.fetch=null,this.fetchSelection=null,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._searchQuery=\"\",this._loading=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleDocumentClick),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleDocumentClick),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity(),this.value&&this.fetchSelection&&this._resolveSelection()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity(),e.has(\"value\")&&(this.value?this._selectedOption&&this._getOptionValue(this._selectedOption)===this.value||this._resolveSelection():this._selectedOption=null),e.has(\"options\")&&this._isOpen&&this._positionDropdown()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._selectedOption=null,this._touched=!1,this._isOpen=!1,this._highlightedIndex=-1,this._searchQuery=\"\",this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}focus(){this._isOpen||this._open()}blur(){this._triggerElement?.blur()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},\"Please select an option\",this._triggerElement):this._internals.setValidity({})}_handleTriggerClick(){this.disabled||this.readonly||(this._isOpen?this._close():this._open())}_open(){this._isOpen=!0,this._searchQuery=\"\",this._highlightedIndex=-1,this._fetch(),this.updateComplete.then((()=>{this._positionDropdown(),this._searchInput&&this._searchInput.focus()}))}_close(){this._isOpen=!1,this._highlightedIndex=-1,this._searchQuery=\"\"}_positionDropdown(){requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(\".dropdown\");if(!e)return;const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8,s=t.top-4-8;e.style.left=t.left+\"px\",e.style.width=t.width+\"px\",i<200&&s>i?(e.style.top=\"\",e.style.bottom=window.innerHeight-t.top+4+\"px\",e.style.maxHeight=s+\"px\"):(e.style.bottom=\"\",e.style.top=t.bottom+4+\"px\",e.style.maxHeight=i+\"px\")}))}_fetch(){if(!this.fetch)return;this._loading=!0,this._requestId++;const e=this._requestId;this.fetch(this._searchQuery).then((t=>{e===this._requestId&&(this.options=t,this._loading=!1)})).catch((e=>{console.error(\"kr-combo-box: fetch failed\",e),this._loading=!1}))}_handleSearchInput(e){this._searchQuery=e.target.value,this._highlightedIndex=-1,this._fetch()}_handleSearchKeyDown(e){switch(e.key){case\"ArrowDown\":e.preventDefault(),this._highlightedIndex=Math.min(this._highlightedIndex+1,this.options.length-1),this._scrollToHighlighted();break;case\"ArrowUp\":e.preventDefault(),-1===this._highlightedIndex?this._highlightedIndex=this.options.length-1:this._highlightedIndex=Math.max(this._highlightedIndex-1,0),this._scrollToHighlighted();break;case\"Enter\":e.preventDefault(),this._highlightedIndex>=0&&this.options[this._highlightedIndex]&&this._selectOption(this.options[this._highlightedIndex]);break;case\"Escape\":e.preventDefault(),this._close(),this._triggerElement?.focus();break;case\"Tab\":this._close()}}_handleTriggerKeyDown(e){\"ArrowDown\"!==e.key&&\"ArrowUp\"!==e.key&&\"Enter\"!==e.key&&\" \"!==e.key||(e.preventDefault(),this._isOpen||this._open())}_handleTriggerBlur(){this._touched=!0,this._updateValidity()}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(\".options\"),t=this.shadowRoot?.querySelector(\".option--highlighted\");if(e&&t){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect();(s.bottom>i.bottom||s.top<i.top)&&t.scrollIntoView({block:\"nearest\"})}}))}_getOptionValue(e){return\"function\"==typeof this.optionValue?this.optionValue(e):e[this.optionValue]}_getOptionLabel(e){let t;return t=\"function\"==typeof this.optionLabel?this.optionLabel(e):e[this.optionLabel],t||this._getOptionValue(e)}_resolveSelection(){if(!this.fetchSelection)return;const e=this.value;this.fetchSelection(this.value).then((t=>{this.value===e&&t&&(this._selectedOption=t,this.requestUpdate())})).catch((e=>{console.error(\"kr-combo-box: fetchSelection failed\",e)}))}_selectOption(e){e.disabled||(this.value=this._getOptionValue(e),this._selectedOption=e,this._close(),this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new CustomEvent(\"select\",{detail:{option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})),this._triggerElement?.focus())}_handleOptionMouseEnter(e,t){this._highlightedIndex=t}_renderOption(e,t){const i=this._getOptionValue(e);return
|
|
1285
|
+
"default": "class extends ae{constructor(){super(),this._requestId=0,this._selectedOption=null,this._handleDocumentClick=e=>{e.composedPath().includes(this)||this._close()},this.label=\"\",this.name=\"\",this.value=\"\",this.placeholder=\"Select an option\",this.disabled=!1,this.readonly=!1,this.required=!1,this.hint=\"\",this.optionValue=\"value\",this.optionLabel=\"label\",this.options=[],this.fetch=null,this.fetchSelection=null,this._isOpen=!1,this._highlightedIndex=-1,this._touched=!1,this._searchQuery=\"\",this._loading=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}connectedCallback(){super.connectedCallback(),document.addEventListener(\"click\",this._handleDocumentClick),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),document.removeEventListener(\"click\",this._handleDocumentClick),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity(),this.value&&this.fetchSelection&&this._resolveSelection()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity(),e.has(\"value\")&&(this.value?this._selectedOption&&this._getOptionValue(this._selectedOption)===this.value||this._resolveSelection():this._selectedOption=null),e.has(\"options\")&&this._isOpen&&this._positionDropdown()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._selectedOption=null,this._touched=!1,this._isOpen=!1,this._highlightedIndex=-1,this._searchQuery=\"\",this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}focus(){this._isOpen||this._open()}blur(){this._triggerElement?.blur()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},\"Please select an option\",this._triggerElement):this._internals.setValidity({})}_handleTriggerClick(){this.disabled||this.readonly||(this._isOpen?this._close():this._open())}_open(){this._isOpen=!0,this._searchQuery=\"\",this._highlightedIndex=-1,this._fetch(),this.updateComplete.then((()=>{this._positionDropdown(),this._searchInput&&this._searchInput.focus()}))}_close(){this._isOpen=!1,this._highlightedIndex=-1,this._searchQuery=\"\"}_positionDropdown(){requestAnimationFrame((()=>{const e=this.shadowRoot?.querySelector(\".dropdown\");if(!e)return;const t=this._triggerElement.getBoundingClientRect(),i=window.innerHeight-t.bottom-4-8,s=t.top-4-8;e.style.left=t.left+\"px\",e.style.width=t.width+\"px\",i<200&&s>i?(e.style.top=\"\",e.style.bottom=window.innerHeight-t.top+4+\"px\",e.style.maxHeight=s+\"px\"):(e.style.bottom=\"\",e.style.top=t.bottom+4+\"px\",e.style.maxHeight=i+\"px\")}))}_fetch(){if(!this.fetch)return;this._loading=!0,this._requestId++;const e=this._requestId;this.fetch(this._searchQuery).then((t=>{e===this._requestId&&(this.options=t,this._loading=!1)})).catch((e=>{console.error(\"kr-combo-box: fetch failed\",e),this._loading=!1}))}_handleSearchInput(e){this._searchQuery=e.target.value,this._highlightedIndex=-1,this._fetch()}_handleSearchKeyDown(e){switch(e.key){case\"ArrowDown\":e.preventDefault(),this._highlightedIndex=Math.min(this._highlightedIndex+1,this.options.length-1),this._scrollToHighlighted();break;case\"ArrowUp\":e.preventDefault(),-1===this._highlightedIndex?this._highlightedIndex=this.options.length-1:this._highlightedIndex=Math.max(this._highlightedIndex-1,0),this._scrollToHighlighted();break;case\"Enter\":e.preventDefault(),this._highlightedIndex>=0&&this.options[this._highlightedIndex]&&this._selectOption(this.options[this._highlightedIndex]);break;case\"Escape\":e.preventDefault(),this._close(),this._triggerElement?.focus();break;case\"Tab\":this._close()}}_handleTriggerKeyDown(e){\"ArrowDown\"!==e.key&&\"ArrowUp\"!==e.key&&\"Enter\"!==e.key&&\" \"!==e.key||(e.preventDefault(),this._isOpen||this._open())}_handleTriggerBlur(){this._touched=!0,this._updateValidity()}_scrollToHighlighted(){this.updateComplete.then((()=>{const e=this.shadowRoot?.querySelector(\".options\"),t=this.shadowRoot?.querySelector(\".option--highlighted\");if(e&&t){const i=e.getBoundingClientRect(),s=t.getBoundingClientRect();(s.bottom>i.bottom||s.top<i.top)&&t.scrollIntoView({block:\"nearest\"})}}))}_getOptionValue(e){return\"function\"==typeof this.optionValue?this.optionValue(e):e[this.optionValue]}_getOptionLabel(e){let t;return t=\"function\"==typeof this.optionLabel?this.optionLabel(e):e[this.optionLabel],t||this._getOptionValue(e)}_resolveSelection(){if(!this.fetchSelection)return;const e=this.value;this.fetchSelection(this.value).then((t=>{this.value===e&&t&&(this._selectedOption=t,this.requestUpdate())})).catch((e=>{console.error(\"kr-combo-box: fetchSelection failed\",e)}))}_selectOption(e){e.disabled||(this.value=this._getOptionValue(e),this._selectedOption=e,this._close(),this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new CustomEvent(\"select\",{detail:{option:e},bubbles:!0,composed:!0})),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})),this._triggerElement?.focus())}_handleOptionMouseEnter(e,t){this._highlightedIndex=t}_renderOption(e,t){const i=this._getOptionValue(e);return j` <button class=${we({option:!0,\"option--highlighted\":t===this._highlightedIndex,\"option--selected\":i===this.value})} type=\"button\" role=\"option\" aria-selected=${i===this.value} ?disabled=${e.disabled} @click=${t=>this._selectOption(e)} @mouseenter=${e=>this._handleOptionMouseEnter(e,t)} > ${this._getOptionLabel(e)} </button> `}render(){let e=U;return this._touched&&this.required&&!this.value?e=j`<div class=\"validation-message\">Please select an option</div>`:this.hint&&(e=j`<div class=\"hint\">${this.hint}</div>`),j` <div class=\"wrapper\"> ${this.label?j` <label> ${this.label} ${this.required?j`<span class=\"required\">*</span>`:U} </label> `:U} <button class=${we({trigger:!0,\"trigger--open\":this._isOpen,\"trigger--invalid\":this._touched&&this.required&&!this.value})} type=\"button\" ?disabled=${this.disabled} aria-haspopup=\"listbox\" aria-expanded=${this._isOpen} @click=${this._handleTriggerClick} @keydown=${this._handleTriggerKeyDown} @blur=${this._handleTriggerBlur} > <span class=${we({trigger__value:!0,trigger__placeholder:!this._selectedOption})}> ${this._selectedOption?this._getOptionLabel(this._selectedOption):this.placeholder} </span> <svg class=${we({trigger__icon:!0,\"trigger__icon--open\":this._isOpen})} viewBox=\"0 0 24 24\" fill=\"currentColor\" > <path d=\"M7.41 8.59L12 13.17l4.59-4.58L18 10l-6 6-6-6z\"/> </svg> </button> <div role=\"listbox\" class=${we({dropdown:!0,\"dropdown--open\":this._isOpen})} > <div class=\"search\"> <div class=\"search__field\"> <input class=\"search__input\" type=\"text\" placeholder=\"Search...\" .value=${this._searchQuery} @input=${this._handleSearchInput} @keydown=${this._handleSearchKeyDown} /> <svg class=\"search__icon\" viewBox=\"0 0 24 24\" fill=\"currentColor\"> <path d=\"M15.5 14h-.79l-.28-.27C15.41 12.59 16 11.11 16 9.5 16 5.91 13.09 3 9.5 3S3 5.91 3 9.5 5.91 16 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14z\"/> </svg> </div> </div> <div class=\"options\"> ${this._loading?j`<div class=\"empty\">Loading...</div>`:0===this.options.length?j`<div class=\"empty\">No options found</div>`:this.options.map(((e,t)=>this._renderOption(e,t)))} </div> </div> ${e} </div> `}}"
|
|
1286
|
+
},
|
|
1287
|
+
{
|
|
1288
|
+
"kind": "variable",
|
|
1289
|
+
"name": "Mt",
|
|
1290
|
+
"default": "class extends ae{constructor(){super(),this._focusedIndex=-1,this.label=\"\",this.name=\"\",this.value=\"\",this.options=[],this.disabled=!1,this.required=!1,this.hint=\"\",this.direction=\"row\",this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.value=\"\",this._touched=!1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.value=e}connectedCallback(){super.connectedCallback(),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._updateValidity()}updated(e){(e.has(\"required\")||e.has(\"value\"))&&this._updateValidity()}_updateValidity(){this.required&&!this.value?this._internals.setValidity({valueMissing:!0},\"Please select an option\"):this._internals.setValidity({})}_handleCardClick(e,t){this.disabled||t.disabled||(this.value=t.value,this._touched=!0,this._internals.setFormValue(this.value),this._updateValidity(),this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})))}_handleKeyDown(e,t){if(this.disabled)return;if(\" \"===e.key||\"Enter\"===e.key)return e.preventDefault(),void(this.options[t].disabled||this._handleCardClick(e,this.options[t]));let i=-1;if(\"row\"===this.direction?\"ArrowRight\"===e.key?i=this._findNextEnabledIndex(t,1):\"ArrowLeft\"===e.key&&(i=this._findNextEnabledIndex(t,-1)):\"ArrowDown\"===e.key?i=this._findNextEnabledIndex(t,1):\"ArrowUp\"===e.key&&(i=this._findNextEnabledIndex(t,-1)),i>=0){e.preventDefault(),this._focusedIndex=i;const t=this.shadowRoot?.querySelectorAll(\".card\");t[i]&&t[i].focus()}}_findNextEnabledIndex(e,t){let i=e+t;for(;i>=0&&i<this.options.length;){if(!this.options[i].disabled)return i;i+=t}return-1}render(){return j` <div class=\"wrapper\"> ${this.label?j` <label> ${this.label} ${this.required?j`<span class=\"required\" aria-hidden=\"true\">*</span>`:U} </label> `:U} <div class=${we({cards:!0,\"cards--row\":\"row\"===this.direction,\"cards--column\":\"column\"===this.direction})} role=\"radiogroup\" aria-label=${this.label} > ${this.options.map(((e,t)=>{const i=e.value===this.value,s=this.disabled||!!e.disabled;return j` <div class=${we({card:!0,\"card--selected\":i,\"card--disabled\":s})} role=\"radio\" aria-checked=${i} aria-disabled=${s} tabindex=${s?-1:0} @click=${t=>this._handleCardClick(t,e)} @keydown=${e=>this._handleKeyDown(e,t)} > <div class=\"card__radio\"> ${i?j`<div class=\"card__radio-dot\"></div>`:U} </div> <div class=\"card__content\"> <div class=\"card__label\">${e.label}</div> ${e.description?j`<div class=\"card__description\">${e.description}</div>`:U} </div> </div> `}))} </div> ${this._touched&&this.required&&!this.value?j`<div class=\"validation-message\">Please select an option</div>`:this.hint?j`<div class=\"hint\">${this.hint}</div>`:U} </div> `}}"
|
|
1291
|
+
},
|
|
1292
|
+
{
|
|
1293
|
+
"kind": "variable",
|
|
1294
|
+
"name": "Ht",
|
|
1295
|
+
"default": "class extends ae{constructor(){super(),this.label=\"\",this.name=\"\",this.value=\"on\",this.checked=!1,this.disabled=!1,this.required=!1,this.hint=\"\",this._touched=!1,this._handleInvalid=e=>{e.preventDefault(),this._touched=!0},this._internals=this.attachInternals()}get form(){return this._internals.form}get validity(){return this._internals.validity}get validationMessage(){return this._internals.validationMessage}get willValidate(){return this._internals.willValidate}checkValidity(){return this._internals.checkValidity()}reportValidity(){return this._internals.reportValidity()}formResetCallback(){this.checked=!1,this._touched=!1,this._internals.setFormValue(\"\"),this._internals.setValidity({})}formStateRestoreCallback(e){this.checked=e===this.value}connectedCallback(){super.connectedCallback(),this.addEventListener(\"invalid\",this._handleInvalid)}disconnectedCallback(){super.disconnectedCallback(),this.removeEventListener(\"invalid\",this._handleInvalid)}firstUpdated(){this._syncFormValue(),this._updateValidity()}updated(e){(e.has(\"checked\")||e.has(\"value\"))&&this._syncFormValue(),(e.has(\"required\")||e.has(\"checked\"))&&this._updateValidity()}_syncFormValue(){this.checked?this._internals.setFormValue(this.value):this._internals.setFormValue(\"\")}_updateValidity(){this.required&&!this.checked?this._internals.setValidity({valueMissing:!0},\"This field is required\"):this._internals.setValidity({})}_handleClick(e){this.disabled||(this.checked=!this.checked,this._touched=!0,this.dispatchEvent(new Event(\"change\",{bubbles:!0,composed:!0})))}_handleKeyDown(e){this.disabled||\" \"!==e.key&&\"Enter\"!==e.key||(e.preventDefault(),this._handleClick(e))}render(){return j` <div class=\"wrapper\"> <div class=${we({checkbox:!0,\"checkbox--disabled\":this.disabled})} role=\"checkbox\" aria-checked=${this.checked} aria-disabled=${this.disabled} aria-label=${this.label} tabindex=${this.disabled?-1:0} @click=${this._handleClick} @keydown=${this._handleKeyDown} > <div class=${we({checkbox__box:!0,\"checkbox__box--checked\":this.checked,\"checkbox__box--invalid\":this._touched&&this.required&&!this.checked})}> <svg class=${we({checkbox__check:!0,\"checkbox__check--hidden\":!this.checked})} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <polyline points=\"20 6 9 17 4 12\"></polyline> </svg> </div> ${this.label?j` <span class=\"checkbox__label\"> ${this.label} ${this.required?j`<span class=\"required\" aria-hidden=\"true\">*</span>`:U} </span> `:U} </div> ${this._touched&&this.required&&!this.checked?j`<div class=\"validation-message\">This field is required</div>`:this.hint?j`<div class=\"hint\">${this.hint}</div>`:U} </div> `}focus(){this.shadowRoot?.querySelector(\".checkbox\")?.focus()}blur(){this.shadowRoot?.querySelector(\".checkbox\")?.blur()}}"
|
|
1242
1296
|
}
|
|
1243
1297
|
],
|
|
1244
1298
|
"exports": [
|
|
@@ -1290,6 +1344,14 @@
|
|
|
1290
1344
|
"module": "dist/krubble-components.bundled.min.js"
|
|
1291
1345
|
}
|
|
1292
1346
|
},
|
|
1347
|
+
{
|
|
1348
|
+
"kind": "js",
|
|
1349
|
+
"name": "KRCheckbox",
|
|
1350
|
+
"declaration": {
|
|
1351
|
+
"name": "Ht",
|
|
1352
|
+
"module": "dist/krubble-components.bundled.min.js"
|
|
1353
|
+
}
|
|
1354
|
+
},
|
|
1293
1355
|
{
|
|
1294
1356
|
"kind": "js",
|
|
1295
1357
|
"name": "KRCodeDemo",
|
|
@@ -1334,7 +1396,7 @@
|
|
|
1334
1396
|
"kind": "js",
|
|
1335
1397
|
"name": "KRDialogRef",
|
|
1336
1398
|
"declaration": {
|
|
1337
|
-
"name": "
|
|
1399
|
+
"name": "je",
|
|
1338
1400
|
"module": "dist/krubble-components.bundled.min.js"
|
|
1339
1401
|
}
|
|
1340
1402
|
},
|
|
@@ -1370,6 +1432,14 @@
|
|
|
1370
1432
|
"module": "dist/krubble-components.bundled.min.js"
|
|
1371
1433
|
}
|
|
1372
1434
|
},
|
|
1435
|
+
{
|
|
1436
|
+
"kind": "js",
|
|
1437
|
+
"name": "KRRadioCards",
|
|
1438
|
+
"declaration": {
|
|
1439
|
+
"name": "Mt",
|
|
1440
|
+
"module": "dist/krubble-components.bundled.min.js"
|
|
1441
|
+
}
|
|
1442
|
+
},
|
|
1373
1443
|
{
|
|
1374
1444
|
"kind": "js",
|
|
1375
1445
|
"name": "KRSelectField",
|
|
@@ -1390,7 +1460,7 @@
|
|
|
1390
1460
|
"kind": "js",
|
|
1391
1461
|
"name": "KRSnackbar",
|
|
1392
1462
|
"declaration": {
|
|
1393
|
-
"name": "
|
|
1463
|
+
"name": "We",
|
|
1394
1464
|
"module": "dist/krubble-components.bundled.min.js"
|
|
1395
1465
|
}
|
|
1396
1466
|
},
|
|
@@ -1854,6 +1924,22 @@
|
|
|
1854
1924
|
"module": "./form/index.js"
|
|
1855
1925
|
}
|
|
1856
1926
|
},
|
|
1927
|
+
{
|
|
1928
|
+
"kind": "js",
|
|
1929
|
+
"name": "KRRadioCards",
|
|
1930
|
+
"declaration": {
|
|
1931
|
+
"name": "KRRadioCards",
|
|
1932
|
+
"module": "./form/index.js"
|
|
1933
|
+
}
|
|
1934
|
+
},
|
|
1935
|
+
{
|
|
1936
|
+
"kind": "js",
|
|
1937
|
+
"name": "KRCheckbox",
|
|
1938
|
+
"declaration": {
|
|
1939
|
+
"name": "KRCheckbox",
|
|
1940
|
+
"module": "./form/index.js"
|
|
1941
|
+
}
|
|
1942
|
+
},
|
|
1857
1943
|
{
|
|
1858
1944
|
"kind": "js",
|
|
1859
1945
|
"name": "ContextMenuItem",
|
|
@@ -1917,6 +2003,14 @@
|
|
|
1917
2003
|
"name": "KRDateRangePickerMode",
|
|
1918
2004
|
"module": "./date-range-picker/date-range-picker.js"
|
|
1919
2005
|
}
|
|
2006
|
+
},
|
|
2007
|
+
{
|
|
2008
|
+
"kind": "js",
|
|
2009
|
+
"name": "KRRadioCardsOption",
|
|
2010
|
+
"declaration": {
|
|
2011
|
+
"name": "KRRadioCardsOption",
|
|
2012
|
+
"module": "./form/radio-cards/radio-cards.js"
|
|
2013
|
+
}
|
|
1920
2014
|
}
|
|
1921
2015
|
]
|
|
1922
2016
|
},
|
|
@@ -2273,6 +2367,22 @@
|
|
|
2273
2367
|
"name": "KRComboBox",
|
|
2274
2368
|
"module": "./combo-box/combo-box.js"
|
|
2275
2369
|
}
|
|
2370
|
+
},
|
|
2371
|
+
{
|
|
2372
|
+
"kind": "js",
|
|
2373
|
+
"name": "KRRadioCards",
|
|
2374
|
+
"declaration": {
|
|
2375
|
+
"name": "KRRadioCards",
|
|
2376
|
+
"module": "./radio-cards/radio-cards.js"
|
|
2377
|
+
}
|
|
2378
|
+
},
|
|
2379
|
+
{
|
|
2380
|
+
"kind": "js",
|
|
2381
|
+
"name": "KRCheckbox",
|
|
2382
|
+
"declaration": {
|
|
2383
|
+
"name": "KRCheckbox",
|
|
2384
|
+
"module": "./checkbox/checkbox.js"
|
|
2385
|
+
}
|
|
2276
2386
|
}
|
|
2277
2387
|
]
|
|
2278
2388
|
},
|
|
@@ -4892,6 +5002,22 @@
|
|
|
4892
5002
|
"name": "KRComboBox",
|
|
4893
5003
|
"module": "./combo-box/combo-box.js"
|
|
4894
5004
|
}
|
|
5005
|
+
},
|
|
5006
|
+
{
|
|
5007
|
+
"kind": "js",
|
|
5008
|
+
"name": "KRRadioCards",
|
|
5009
|
+
"declaration": {
|
|
5010
|
+
"name": "KRRadioCards",
|
|
5011
|
+
"module": "./radio-cards/radio-cards.js"
|
|
5012
|
+
}
|
|
5013
|
+
},
|
|
5014
|
+
{
|
|
5015
|
+
"kind": "js",
|
|
5016
|
+
"name": "KRCheckbox",
|
|
5017
|
+
"declaration": {
|
|
5018
|
+
"name": "KRCheckbox",
|
|
5019
|
+
"module": "./checkbox/checkbox.js"
|
|
5020
|
+
}
|
|
4895
5021
|
}
|
|
4896
5022
|
]
|
|
4897
5023
|
},
|
|
@@ -7173,6 +7299,28 @@
|
|
|
7173
7299
|
}
|
|
7174
7300
|
]
|
|
7175
7301
|
},
|
|
7302
|
+
{
|
|
7303
|
+
"kind": "javascript-module",
|
|
7304
|
+
"path": "dist/form/checkbox/checkbox.js",
|
|
7305
|
+
"declarations": [
|
|
7306
|
+
{
|
|
7307
|
+
"kind": "variable",
|
|
7308
|
+
"name": "KRCheckbox",
|
|
7309
|
+
"default": "class KRCheckbox extends LitElement { constructor() { super(); /** * The checkbox label text */ this.label = ''; /** * The input name for form submission */ this.name = ''; /** * The value submitted when checked */ this.value = 'on'; /** * Whether the checkbox is checked */ this.checked = false; /** * Whether the checkbox is disabled */ this.disabled = false; /** * Whether the checkbox is required */ this.required = false; /** * Helper text shown below the checkbox */ this.hint = ''; this._touched = false; this._handleInvalid = (e) => { e.preventDefault(); this._touched = true; }; this._internals = this.attachInternals(); } // Form-associated custom element callbacks get form() { return this._internals.form; } get validity() { return this._internals.validity; } get validationMessage() { return this._internals.validationMessage; } get willValidate() { return this._internals.willValidate; } checkValidity() { return this._internals.checkValidity(); } reportValidity() { return this._internals.reportValidity(); } formResetCallback() { this.checked = false; this._touched = false; this._internals.setFormValue(''); this._internals.setValidity({}); } formStateRestoreCallback(state) { this.checked = state === this.value; } connectedCallback() { super.connectedCallback(); this.addEventListener('invalid', this._handleInvalid); } disconnectedCallback() { super.disconnectedCallback(); this.removeEventListener('invalid', this._handleInvalid); } firstUpdated() { this._syncFormValue(); this._updateValidity(); } updated(changedProperties) { if (changedProperties.has('checked') || changedProperties.has('value')) { this._syncFormValue(); } if (changedProperties.has('required') || changedProperties.has('checked')) { this._updateValidity(); } } _syncFormValue() { if (this.checked) { this._internals.setFormValue(this.value); } else { this._internals.setFormValue(''); } } _updateValidity() { if (this.required && !this.checked) { this._internals.setValidity({ valueMissing: true }, 'This field is required'); } else { this._internals.setValidity({}); } } _handleClick(e) { if (this.disabled) { return; } this.checked = !this.checked; this._touched = true; this.dispatchEvent(new Event('change', { bubbles: true, composed: true })); } _handleKeyDown(e) { if (this.disabled) { return; } if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); this._handleClick(e); } } render() { return html ` <div class=\"wrapper\"> <div class=${classMap({ 'checkbox': true, 'checkbox--disabled': this.disabled, })} role=\"checkbox\" aria-checked=${this.checked} aria-disabled=${this.disabled} aria-label=${this.label} tabindex=${this.disabled ? -1 : 0} @click=${this._handleClick} @keydown=${this._handleKeyDown} > <div class=${classMap({ 'checkbox__box': true, 'checkbox__box--checked': this.checked, 'checkbox__box--invalid': this._touched && this.required && !this.checked, })}> <svg class=${classMap({ 'checkbox__check': true, 'checkbox__check--hidden': !this.checked, })} viewBox=\"0 0 24 24\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"3\" stroke-linecap=\"round\" stroke-linejoin=\"round\"> <polyline points=\"20 6 9 17 4 12\"></polyline> </svg> </div> ${this.label ? html ` <span class=\"checkbox__label\"> ${this.label} ${this.required ? html `<span class=\"required\" aria-hidden=\"true\">*</span>` : nothing} </span> ` : nothing} </div> ${this._touched && this.required && !this.checked ? html `<div class=\"validation-message\">This field is required</div>` : this.hint ? html `<div class=\"hint\">${this.hint}</div>` : nothing} </div> `; } focus() { this.shadowRoot?.querySelector('.checkbox')?.focus(); } blur() { this.shadowRoot?.querySelector('.checkbox')?.blur(); } }",
|
|
7310
|
+
"description": "A checkbox component that works with native browser forms.\n\nUses ElementInternals for form association, allowing the component\nto participate in form submission, validation, and reset."
|
|
7311
|
+
}
|
|
7312
|
+
],
|
|
7313
|
+
"exports": [
|
|
7314
|
+
{
|
|
7315
|
+
"kind": "js",
|
|
7316
|
+
"name": "KRCheckbox",
|
|
7317
|
+
"declaration": {
|
|
7318
|
+
"name": "KRCheckbox",
|
|
7319
|
+
"module": "dist/form/checkbox/checkbox.js"
|
|
7320
|
+
}
|
|
7321
|
+
}
|
|
7322
|
+
]
|
|
7323
|
+
},
|
|
7176
7324
|
{
|
|
7177
7325
|
"kind": "javascript-module",
|
|
7178
7326
|
"path": "dist/form/combo-box/combo-box.js",
|
|
@@ -7216,6 +7364,28 @@
|
|
|
7216
7364
|
}
|
|
7217
7365
|
]
|
|
7218
7366
|
},
|
|
7367
|
+
{
|
|
7368
|
+
"kind": "javascript-module",
|
|
7369
|
+
"path": "dist/form/radio-cards/radio-cards.js",
|
|
7370
|
+
"declarations": [
|
|
7371
|
+
{
|
|
7372
|
+
"kind": "variable",
|
|
7373
|
+
"name": "KRRadioCards",
|
|
7374
|
+
"default": "class KRRadioCards extends LitElement { constructor() { super(); this._focusedIndex = -1; /** * The label text above the cards */ this.label = ''; /** * The input name for form submission */ this.name = ''; /** * The currently selected value */ this.value = ''; /** * The card options to display */ this.options = []; /** * Whether the field is disabled */ this.disabled = false; /** * Whether the field is required */ this.required = false; /** * Helper text shown below the cards */ this.hint = ''; /** * Layout direction: 'row' or 'column' */ this.direction = 'row'; this._touched = false; this._handleInvalid = (e) => { e.preventDefault(); this._touched = true; }; this._internals = this.attachInternals(); } // Form-associated custom element callbacks get form() { return this._internals.form; } get validity() { return this._internals.validity; } get validationMessage() { return this._internals.validationMessage; } get willValidate() { return this._internals.willValidate; } checkValidity() { return this._internals.checkValidity(); } reportValidity() { return this._internals.reportValidity(); } formResetCallback() { this.value = ''; this._touched = false; this._internals.setFormValue(''); this._internals.setValidity({}); } formStateRestoreCallback(state) { this.value = state; } connectedCallback() { super.connectedCallback(); this.addEventListener('invalid', this._handleInvalid); } disconnectedCallback() { super.disconnectedCallback(); this.removeEventListener('invalid', this._handleInvalid); } firstUpdated() { this._updateValidity(); } updated(changedProperties) { if (changedProperties.has('required') || changedProperties.has('value')) { this._updateValidity(); } } _updateValidity() { if (this.required && !this.value) { this._internals.setValidity({ valueMissing: true }, 'Please select an option'); } else { this._internals.setValidity({}); } } _handleCardClick(e, option) { if (this.disabled || option.disabled) { return; } this.value = option.value; this._touched = true; this._internals.setFormValue(this.value); this._updateValidity(); this.dispatchEvent(new Event('change', { bubbles: true, composed: true })); } _handleKeyDown(e, index) { if (this.disabled) { return; } if (e.key === ' ' || e.key === 'Enter') { e.preventDefault(); if (!this.options[index].disabled) { this._handleCardClick(e, this.options[index]); } return; } let nextIndex = -1; if (this.direction === 'row') { if (e.key === 'ArrowRight') { nextIndex = this._findNextEnabledIndex(index, 1); } else if (e.key === 'ArrowLeft') { nextIndex = this._findNextEnabledIndex(index, -1); } } else { if (e.key === 'ArrowDown') { nextIndex = this._findNextEnabledIndex(index, 1); } else if (e.key === 'ArrowUp') { nextIndex = this._findNextEnabledIndex(index, -1); } } if (nextIndex >= 0) { e.preventDefault(); this._focusedIndex = nextIndex; const cards = this.shadowRoot?.querySelectorAll('.card'); if (cards[nextIndex]) { cards[nextIndex].focus(); } } } _findNextEnabledIndex(current, step) { let next = current + step; while (next >= 0 && next < this.options.length) { if (!this.options[next].disabled) { return next; } next += step; } return -1; } render() { return html ` <div class=\"wrapper\"> ${this.label ? html ` <label> ${this.label} ${this.required ? html `<span class=\"required\" aria-hidden=\"true\">*</span>` : nothing} </label> ` : nothing} <div class=${classMap({ 'cards': true, 'cards--row': this.direction === 'row', 'cards--column': this.direction === 'column', })} role=\"radiogroup\" aria-label=${this.label} > ${this.options.map((option, index) => { const isSelected = option.value === this.value; const isDisabled = this.disabled || !!option.disabled; return html ` <div class=${classMap({ 'card': true, 'card--selected': isSelected, 'card--disabled': isDisabled, })} role=\"radio\" aria-checked=${isSelected} aria-disabled=${isDisabled} tabindex=${isDisabled ? -1 : 0} @click=${(e) => this._handleCardClick(e, option)} @keydown=${(e) => this._handleKeyDown(e, index)} > <div class=\"card__radio\"> ${isSelected ? html `<div class=\"card__radio-dot\"></div>` : nothing} </div> <div class=\"card__content\"> <div class=\"card__label\">${option.label}</div> ${option.description ? html `<div class=\"card__description\">${option.description}</div>` : nothing} </div> </div> `; })} </div> ${this._touched && this.required && !this.value ? html `<div class=\"validation-message\">Please select an option</div>` : this.hint ? html `<div class=\"hint\">${this.hint}</div>` : nothing} </div> `; } }",
|
|
7375
|
+
"description": "A card-style radio group for selecting between a small number of options.\nEach option renders as a bordered card with a radio indicator, label, and optional description.\n\nUses ElementInternals for form association, allowing the component\nto participate in form submission, validation, and reset."
|
|
7376
|
+
}
|
|
7377
|
+
],
|
|
7378
|
+
"exports": [
|
|
7379
|
+
{
|
|
7380
|
+
"kind": "js",
|
|
7381
|
+
"name": "KRRadioCards",
|
|
7382
|
+
"declaration": {
|
|
7383
|
+
"name": "KRRadioCards",
|
|
7384
|
+
"module": "dist/form/radio-cards/radio-cards.js"
|
|
7385
|
+
}
|
|
7386
|
+
}
|
|
7387
|
+
]
|
|
7388
|
+
},
|
|
7219
7389
|
{
|
|
7220
7390
|
"kind": "javascript-module",
|
|
7221
7391
|
"path": "dist/form/select-field/select-field.js",
|
|
@@ -7824,12 +7994,12 @@
|
|
|
7824
7994
|
},
|
|
7825
7995
|
{
|
|
7826
7996
|
"kind": "javascript-module",
|
|
7827
|
-
"path": "src/form/
|
|
7997
|
+
"path": "src/form/checkbox/checkbox.ts",
|
|
7828
7998
|
"declarations": [
|
|
7829
7999
|
{
|
|
7830
8000
|
"kind": "class",
|
|
7831
|
-
"description": "",
|
|
7832
|
-
"name": "
|
|
8001
|
+
"description": "A checkbox component that works with native browser forms.\n\nUses ElementInternals for form association, allowing the component\nto participate in form submission, validation, and reset.",
|
|
8002
|
+
"name": "KRCheckbox",
|
|
7833
8003
|
"members": [
|
|
7834
8004
|
{
|
|
7835
8005
|
"kind": "field",
|
|
@@ -7848,29 +8018,6 @@
|
|
|
7848
8018
|
},
|
|
7849
8019
|
"privacy": "private"
|
|
7850
8020
|
},
|
|
7851
|
-
{
|
|
7852
|
-
"kind": "field",
|
|
7853
|
-
"name": "_requestId",
|
|
7854
|
-
"type": {
|
|
7855
|
-
"text": "number"
|
|
7856
|
-
},
|
|
7857
|
-
"privacy": "private",
|
|
7858
|
-
"default": "0"
|
|
7859
|
-
},
|
|
7860
|
-
{
|
|
7861
|
-
"kind": "field",
|
|
7862
|
-
"name": "_selectedOption",
|
|
7863
|
-
"type": {
|
|
7864
|
-
"text": "any"
|
|
7865
|
-
},
|
|
7866
|
-
"privacy": "private",
|
|
7867
|
-
"default": "null"
|
|
7868
|
-
},
|
|
7869
|
-
{
|
|
7870
|
-
"kind": "field",
|
|
7871
|
-
"name": "_handleDocumentClick",
|
|
7872
|
-
"privacy": "private"
|
|
7873
|
-
},
|
|
7874
8021
|
{
|
|
7875
8022
|
"kind": "field",
|
|
7876
8023
|
"name": "label",
|
|
@@ -7878,7 +8025,7 @@
|
|
|
7878
8025
|
"text": "string"
|
|
7879
8026
|
},
|
|
7880
8027
|
"default": "''",
|
|
7881
|
-
"description": "
|
|
8028
|
+
"description": "The checkbox label text",
|
|
7882
8029
|
"attribute": "label"
|
|
7883
8030
|
},
|
|
7884
8031
|
{
|
|
@@ -7888,7 +8035,7 @@
|
|
|
7888
8035
|
"text": "string"
|
|
7889
8036
|
},
|
|
7890
8037
|
"default": "''",
|
|
7891
|
-
"description": "
|
|
8038
|
+
"description": "The input name for form submission",
|
|
7892
8039
|
"attribute": "name"
|
|
7893
8040
|
},
|
|
7894
8041
|
{
|
|
@@ -7897,39 +8044,29 @@
|
|
|
7897
8044
|
"type": {
|
|
7898
8045
|
"text": "string"
|
|
7899
8046
|
},
|
|
7900
|
-
"default": "''",
|
|
7901
|
-
"description": "
|
|
8047
|
+
"default": "'on'",
|
|
8048
|
+
"description": "The value submitted when checked",
|
|
7902
8049
|
"attribute": "value"
|
|
7903
8050
|
},
|
|
7904
8051
|
{
|
|
7905
8052
|
"kind": "field",
|
|
7906
|
-
"name": "
|
|
7907
|
-
"type": {
|
|
7908
|
-
"text": "string"
|
|
7909
|
-
},
|
|
7910
|
-
"default": "'Select an option'",
|
|
7911
|
-
"description": "Placeholder text when nothing is selected",
|
|
7912
|
-
"attribute": "placeholder"
|
|
7913
|
-
},
|
|
7914
|
-
{
|
|
7915
|
-
"kind": "field",
|
|
7916
|
-
"name": "disabled",
|
|
8053
|
+
"name": "checked",
|
|
7917
8054
|
"type": {
|
|
7918
8055
|
"text": "boolean"
|
|
7919
8056
|
},
|
|
7920
8057
|
"default": "false",
|
|
7921
|
-
"description": "Whether the
|
|
7922
|
-
"attribute": "
|
|
8058
|
+
"description": "Whether the checkbox is checked",
|
|
8059
|
+
"attribute": "checked"
|
|
7923
8060
|
},
|
|
7924
8061
|
{
|
|
7925
8062
|
"kind": "field",
|
|
7926
|
-
"name": "
|
|
8063
|
+
"name": "disabled",
|
|
7927
8064
|
"type": {
|
|
7928
8065
|
"text": "boolean"
|
|
7929
8066
|
},
|
|
7930
8067
|
"default": "false",
|
|
7931
|
-
"description": "Whether the
|
|
7932
|
-
"attribute": "
|
|
8068
|
+
"description": "Whether the checkbox is disabled",
|
|
8069
|
+
"attribute": "disabled"
|
|
7933
8070
|
},
|
|
7934
8071
|
{
|
|
7935
8072
|
"kind": "field",
|
|
@@ -7938,7 +8075,7 @@
|
|
|
7938
8075
|
"text": "boolean"
|
|
7939
8076
|
},
|
|
7940
8077
|
"default": "false",
|
|
7941
|
-
"description": "Whether the
|
|
8078
|
+
"description": "Whether the checkbox is required",
|
|
7942
8079
|
"attribute": "required"
|
|
7943
8080
|
},
|
|
7944
8081
|
{
|
|
@@ -7948,153 +8085,99 @@
|
|
|
7948
8085
|
"text": "string"
|
|
7949
8086
|
},
|
|
7950
8087
|
"default": "''",
|
|
7951
|
-
"description": "Helper text
|
|
8088
|
+
"description": "Helper text shown below the checkbox",
|
|
7952
8089
|
"attribute": "hint"
|
|
7953
8090
|
},
|
|
7954
8091
|
{
|
|
7955
8092
|
"kind": "field",
|
|
7956
|
-
"name": "
|
|
8093
|
+
"name": "_touched",
|
|
7957
8094
|
"type": {
|
|
7958
|
-
"text": "
|
|
8095
|
+
"text": "boolean"
|
|
7959
8096
|
},
|
|
7960
|
-
"
|
|
7961
|
-
"
|
|
7962
|
-
"attribute": "option-value"
|
|
8097
|
+
"privacy": "private",
|
|
8098
|
+
"default": "false"
|
|
7963
8099
|
},
|
|
7964
8100
|
{
|
|
7965
8101
|
"kind": "field",
|
|
7966
|
-
"name": "
|
|
7967
|
-
"
|
|
7968
|
-
"text": "string|Function"
|
|
7969
|
-
},
|
|
7970
|
-
"default": "'label'",
|
|
7971
|
-
"description": "Field name or function to extract the label from an option",
|
|
7972
|
-
"attribute": "option-label"
|
|
8102
|
+
"name": "form",
|
|
8103
|
+
"readonly": true
|
|
7973
8104
|
},
|
|
7974
8105
|
{
|
|
7975
8106
|
"kind": "field",
|
|
7976
|
-
"name": "
|
|
7977
|
-
"
|
|
7978
|
-
"text": "any[]"
|
|
7979
|
-
},
|
|
7980
|
-
"default": "[]",
|
|
7981
|
-
"description": "Array of options",
|
|
7982
|
-
"attribute": "options"
|
|
8107
|
+
"name": "validity",
|
|
8108
|
+
"readonly": true
|
|
7983
8109
|
},
|
|
7984
8110
|
{
|
|
7985
8111
|
"kind": "field",
|
|
7986
|
-
"name": "
|
|
7987
|
-
"
|
|
7988
|
-
"text": "Function"
|
|
7989
|
-
},
|
|
7990
|
-
"default": "null",
|
|
7991
|
-
"description": "Function that returns a promise of options"
|
|
8112
|
+
"name": "validationMessage",
|
|
8113
|
+
"readonly": true
|
|
7992
8114
|
},
|
|
7993
8115
|
{
|
|
7994
8116
|
"kind": "field",
|
|
7995
|
-
"name": "
|
|
7996
|
-
"
|
|
7997
|
-
"text": "Function"
|
|
7998
|
-
},
|
|
7999
|
-
"default": "null",
|
|
8000
|
-
"description": "Function that resolves a single option by its value"
|
|
8117
|
+
"name": "willValidate",
|
|
8118
|
+
"readonly": true
|
|
8001
8119
|
},
|
|
8002
8120
|
{
|
|
8003
|
-
"kind": "
|
|
8004
|
-
"name": "
|
|
8005
|
-
"type": {
|
|
8006
|
-
"text": "boolean"
|
|
8007
|
-
},
|
|
8008
|
-
"privacy": "private",
|
|
8009
|
-
"default": "false"
|
|
8121
|
+
"kind": "method",
|
|
8122
|
+
"name": "checkValidity"
|
|
8010
8123
|
},
|
|
8011
8124
|
{
|
|
8012
|
-
"kind": "
|
|
8013
|
-
"name": "
|
|
8014
|
-
"type": {
|
|
8015
|
-
"text": "number"
|
|
8016
|
-
},
|
|
8017
|
-
"privacy": "private",
|
|
8018
|
-
"default": "-1"
|
|
8125
|
+
"kind": "method",
|
|
8126
|
+
"name": "reportValidity"
|
|
8019
8127
|
},
|
|
8020
8128
|
{
|
|
8021
|
-
"kind": "
|
|
8022
|
-
"name": "
|
|
8023
|
-
"type": {
|
|
8024
|
-
"text": "boolean"
|
|
8025
|
-
},
|
|
8026
|
-
"privacy": "private",
|
|
8027
|
-
"default": "false"
|
|
8129
|
+
"kind": "method",
|
|
8130
|
+
"name": "formResetCallback"
|
|
8028
8131
|
},
|
|
8029
8132
|
{
|
|
8030
|
-
"kind": "
|
|
8031
|
-
"name": "
|
|
8032
|
-
"
|
|
8033
|
-
|
|
8034
|
-
|
|
8035
|
-
|
|
8036
|
-
|
|
8133
|
+
"kind": "method",
|
|
8134
|
+
"name": "formStateRestoreCallback",
|
|
8135
|
+
"parameters": [
|
|
8136
|
+
{
|
|
8137
|
+
"name": "state",
|
|
8138
|
+
"type": {
|
|
8139
|
+
"text": "string"
|
|
8140
|
+
}
|
|
8141
|
+
}
|
|
8142
|
+
]
|
|
8037
8143
|
},
|
|
8038
8144
|
{
|
|
8039
8145
|
"kind": "field",
|
|
8040
|
-
"name": "
|
|
8041
|
-
"type": {
|
|
8042
|
-
"text": "boolean"
|
|
8043
|
-
},
|
|
8044
|
-
"privacy": "private",
|
|
8045
|
-
"default": "false"
|
|
8046
|
-
},
|
|
8047
|
-
{
|
|
8048
|
-
"kind": "field",
|
|
8049
|
-
"name": "_triggerElement",
|
|
8050
|
-
"type": {
|
|
8051
|
-
"text": "HTMLButtonElement"
|
|
8052
|
-
},
|
|
8053
|
-
"privacy": "private"
|
|
8054
|
-
},
|
|
8055
|
-
{
|
|
8056
|
-
"kind": "field",
|
|
8057
|
-
"name": "_searchInput",
|
|
8058
|
-
"type": {
|
|
8059
|
-
"text": "HTMLInputElement"
|
|
8060
|
-
},
|
|
8146
|
+
"name": "_handleInvalid",
|
|
8061
8147
|
"privacy": "private"
|
|
8062
8148
|
},
|
|
8063
|
-
{
|
|
8064
|
-
"kind": "field",
|
|
8065
|
-
"name": "form",
|
|
8066
|
-
"readonly": true
|
|
8067
|
-
},
|
|
8068
|
-
{
|
|
8069
|
-
"kind": "field",
|
|
8070
|
-
"name": "validity",
|
|
8071
|
-
"readonly": true
|
|
8072
|
-
},
|
|
8073
|
-
{
|
|
8074
|
-
"kind": "field",
|
|
8075
|
-
"name": "validationMessage",
|
|
8076
|
-
"readonly": true
|
|
8077
|
-
},
|
|
8078
8149
|
{
|
|
8079
8150
|
"kind": "method",
|
|
8080
|
-
"name": "
|
|
8151
|
+
"name": "_syncFormValue",
|
|
8152
|
+
"privacy": "private"
|
|
8081
8153
|
},
|
|
8082
8154
|
{
|
|
8083
8155
|
"kind": "method",
|
|
8084
|
-
"name": "
|
|
8156
|
+
"name": "_updateValidity",
|
|
8157
|
+
"privacy": "private"
|
|
8085
8158
|
},
|
|
8086
8159
|
{
|
|
8087
8160
|
"kind": "method",
|
|
8088
|
-
"name": "
|
|
8161
|
+
"name": "_handleClick",
|
|
8162
|
+
"privacy": "private",
|
|
8163
|
+
"parameters": [
|
|
8164
|
+
{
|
|
8165
|
+
"name": "e",
|
|
8166
|
+
"type": {
|
|
8167
|
+
"text": "Event"
|
|
8168
|
+
}
|
|
8169
|
+
}
|
|
8170
|
+
]
|
|
8089
8171
|
},
|
|
8090
8172
|
{
|
|
8091
8173
|
"kind": "method",
|
|
8092
|
-
"name": "
|
|
8174
|
+
"name": "_handleKeyDown",
|
|
8175
|
+
"privacy": "private",
|
|
8093
8176
|
"parameters": [
|
|
8094
8177
|
{
|
|
8095
|
-
"name": "
|
|
8178
|
+
"name": "e",
|
|
8096
8179
|
"type": {
|
|
8097
|
-
"text": "
|
|
8180
|
+
"text": "KeyboardEvent"
|
|
8098
8181
|
}
|
|
8099
8182
|
}
|
|
8100
8183
|
]
|
|
@@ -8106,224 +8189,1067 @@
|
|
|
8106
8189
|
{
|
|
8107
8190
|
"kind": "method",
|
|
8108
8191
|
"name": "blur"
|
|
8192
|
+
}
|
|
8193
|
+
],
|
|
8194
|
+
"events": [
|
|
8195
|
+
{
|
|
8196
|
+
"name": "change",
|
|
8197
|
+
"type": {
|
|
8198
|
+
"text": "Event"
|
|
8199
|
+
},
|
|
8200
|
+
"description": "Fired when the checked state changes"
|
|
8201
|
+
}
|
|
8202
|
+
],
|
|
8203
|
+
"attributes": [
|
|
8204
|
+
{
|
|
8205
|
+
"name": "label",
|
|
8206
|
+
"type": {
|
|
8207
|
+
"text": "string"
|
|
8208
|
+
},
|
|
8209
|
+
"default": "''",
|
|
8210
|
+
"description": "The checkbox label text",
|
|
8211
|
+
"fieldName": "label"
|
|
8109
8212
|
},
|
|
8110
8213
|
{
|
|
8111
|
-
"
|
|
8112
|
-
"
|
|
8113
|
-
|
|
8214
|
+
"name": "name",
|
|
8215
|
+
"type": {
|
|
8216
|
+
"text": "string"
|
|
8217
|
+
},
|
|
8218
|
+
"default": "''",
|
|
8219
|
+
"description": "The input name for form submission",
|
|
8220
|
+
"fieldName": "name"
|
|
8114
8221
|
},
|
|
8115
8222
|
{
|
|
8116
|
-
"
|
|
8117
|
-
"
|
|
8118
|
-
|
|
8119
|
-
|
|
8120
|
-
|
|
8121
|
-
|
|
8122
|
-
|
|
8123
|
-
}
|
|
8223
|
+
"name": "value",
|
|
8224
|
+
"type": {
|
|
8225
|
+
"text": "string"
|
|
8226
|
+
},
|
|
8227
|
+
"default": "'on'",
|
|
8228
|
+
"description": "The value submitted when checked",
|
|
8229
|
+
"fieldName": "value"
|
|
8124
8230
|
},
|
|
8125
8231
|
{
|
|
8126
|
-
"
|
|
8127
|
-
"
|
|
8128
|
-
|
|
8129
|
-
|
|
8130
|
-
|
|
8131
|
-
|
|
8132
|
-
|
|
8133
|
-
}
|
|
8232
|
+
"name": "checked",
|
|
8233
|
+
"type": {
|
|
8234
|
+
"text": "boolean"
|
|
8235
|
+
},
|
|
8236
|
+
"default": "false",
|
|
8237
|
+
"description": "Whether the checkbox is checked",
|
|
8238
|
+
"fieldName": "checked"
|
|
8134
8239
|
},
|
|
8135
8240
|
{
|
|
8136
|
-
"
|
|
8137
|
-
"
|
|
8138
|
-
|
|
8139
|
-
|
|
8140
|
-
|
|
8141
|
-
|
|
8142
|
-
|
|
8143
|
-
}
|
|
8241
|
+
"name": "disabled",
|
|
8242
|
+
"type": {
|
|
8243
|
+
"text": "boolean"
|
|
8244
|
+
},
|
|
8245
|
+
"default": "false",
|
|
8246
|
+
"description": "Whether the checkbox is disabled",
|
|
8247
|
+
"fieldName": "disabled"
|
|
8144
8248
|
},
|
|
8145
8249
|
{
|
|
8146
|
-
"
|
|
8147
|
-
"
|
|
8148
|
-
|
|
8149
|
-
|
|
8150
|
-
|
|
8151
|
-
|
|
8152
|
-
|
|
8153
|
-
}
|
|
8250
|
+
"name": "required",
|
|
8251
|
+
"type": {
|
|
8252
|
+
"text": "boolean"
|
|
8253
|
+
},
|
|
8254
|
+
"default": "false",
|
|
8255
|
+
"description": "Whether the checkbox is required",
|
|
8256
|
+
"fieldName": "required"
|
|
8154
8257
|
},
|
|
8155
8258
|
{
|
|
8156
|
-
"
|
|
8157
|
-
"
|
|
8158
|
-
|
|
8159
|
-
|
|
8160
|
-
|
|
8161
|
-
|
|
8162
|
-
|
|
8163
|
-
|
|
8259
|
+
"name": "hint",
|
|
8260
|
+
"type": {
|
|
8261
|
+
"text": "string"
|
|
8262
|
+
},
|
|
8263
|
+
"default": "''",
|
|
8264
|
+
"description": "Helper text shown below the checkbox",
|
|
8265
|
+
"fieldName": "hint"
|
|
8266
|
+
}
|
|
8267
|
+
],
|
|
8268
|
+
"superclass": {
|
|
8269
|
+
"name": "LitElement",
|
|
8270
|
+
"package": "lit"
|
|
8271
|
+
},
|
|
8272
|
+
"tagName": "kr-checkbox",
|
|
8273
|
+
"customElement": true
|
|
8274
|
+
}
|
|
8275
|
+
],
|
|
8276
|
+
"exports": [
|
|
8277
|
+
{
|
|
8278
|
+
"kind": "js",
|
|
8279
|
+
"name": "KRCheckbox",
|
|
8280
|
+
"declaration": {
|
|
8281
|
+
"name": "KRCheckbox",
|
|
8282
|
+
"module": "src/form/checkbox/checkbox.ts"
|
|
8283
|
+
}
|
|
8284
|
+
},
|
|
8285
|
+
{
|
|
8286
|
+
"kind": "custom-element-definition",
|
|
8287
|
+
"name": "kr-checkbox",
|
|
8288
|
+
"declaration": {
|
|
8289
|
+
"name": "KRCheckbox",
|
|
8290
|
+
"module": "src/form/checkbox/checkbox.ts"
|
|
8291
|
+
}
|
|
8292
|
+
}
|
|
8293
|
+
]
|
|
8294
|
+
},
|
|
8295
|
+
{
|
|
8296
|
+
"kind": "javascript-module",
|
|
8297
|
+
"path": "src/form/combo-box/combo-box.ts",
|
|
8298
|
+
"declarations": [
|
|
8299
|
+
{
|
|
8300
|
+
"kind": "class",
|
|
8301
|
+
"description": "",
|
|
8302
|
+
"name": "KRComboBox",
|
|
8303
|
+
"members": [
|
|
8304
|
+
{
|
|
8305
|
+
"kind": "field",
|
|
8306
|
+
"name": "formAssociated",
|
|
8307
|
+
"type": {
|
|
8308
|
+
"text": "boolean"
|
|
8309
|
+
},
|
|
8310
|
+
"static": true,
|
|
8311
|
+
"default": "true"
|
|
8164
8312
|
},
|
|
8165
8313
|
{
|
|
8166
|
-
"kind": "
|
|
8167
|
-
"name": "
|
|
8314
|
+
"kind": "field",
|
|
8315
|
+
"name": "_internals",
|
|
8316
|
+
"type": {
|
|
8317
|
+
"text": "ElementInternals"
|
|
8318
|
+
},
|
|
8319
|
+
"privacy": "private"
|
|
8320
|
+
},
|
|
8321
|
+
{
|
|
8322
|
+
"kind": "field",
|
|
8323
|
+
"name": "_requestId",
|
|
8324
|
+
"type": {
|
|
8325
|
+
"text": "number"
|
|
8326
|
+
},
|
|
8168
8327
|
"privacy": "private",
|
|
8169
|
-
"
|
|
8170
|
-
"type": {
|
|
8171
|
-
"text": "void"
|
|
8172
|
-
}
|
|
8173
|
-
}
|
|
8328
|
+
"default": "0"
|
|
8174
8329
|
},
|
|
8175
8330
|
{
|
|
8176
|
-
"kind": "
|
|
8177
|
-
"name": "
|
|
8331
|
+
"kind": "field",
|
|
8332
|
+
"name": "_selectedOption",
|
|
8333
|
+
"type": {
|
|
8334
|
+
"text": "any"
|
|
8335
|
+
},
|
|
8178
8336
|
"privacy": "private",
|
|
8179
|
-
"
|
|
8180
|
-
|
|
8181
|
-
|
|
8182
|
-
|
|
8337
|
+
"default": "null"
|
|
8338
|
+
},
|
|
8339
|
+
{
|
|
8340
|
+
"kind": "field",
|
|
8341
|
+
"name": "_handleDocumentClick",
|
|
8342
|
+
"privacy": "private"
|
|
8343
|
+
},
|
|
8344
|
+
{
|
|
8345
|
+
"kind": "field",
|
|
8346
|
+
"name": "label",
|
|
8347
|
+
"type": {
|
|
8348
|
+
"text": "string"
|
|
8183
8349
|
},
|
|
8184
|
-
"
|
|
8185
|
-
|
|
8186
|
-
|
|
8187
|
-
"type": {
|
|
8188
|
-
"text": "Event"
|
|
8189
|
-
}
|
|
8190
|
-
}
|
|
8191
|
-
]
|
|
8350
|
+
"default": "''",
|
|
8351
|
+
"description": "Label text",
|
|
8352
|
+
"attribute": "label"
|
|
8192
8353
|
},
|
|
8193
8354
|
{
|
|
8194
|
-
"kind": "
|
|
8195
|
-
"name": "
|
|
8196
|
-
"
|
|
8197
|
-
|
|
8198
|
-
"type": {
|
|
8199
|
-
"text": "void"
|
|
8200
|
-
}
|
|
8355
|
+
"kind": "field",
|
|
8356
|
+
"name": "name",
|
|
8357
|
+
"type": {
|
|
8358
|
+
"text": "string"
|
|
8201
8359
|
},
|
|
8360
|
+
"default": "''",
|
|
8361
|
+
"description": "Name for form submission",
|
|
8362
|
+
"attribute": "name"
|
|
8363
|
+
},
|
|
8364
|
+
{
|
|
8365
|
+
"kind": "field",
|
|
8366
|
+
"name": "value",
|
|
8367
|
+
"type": {
|
|
8368
|
+
"text": "string"
|
|
8369
|
+
},
|
|
8370
|
+
"default": "''",
|
|
8371
|
+
"description": "Currently selected value",
|
|
8372
|
+
"attribute": "value"
|
|
8373
|
+
},
|
|
8374
|
+
{
|
|
8375
|
+
"kind": "field",
|
|
8376
|
+
"name": "placeholder",
|
|
8377
|
+
"type": {
|
|
8378
|
+
"text": "string"
|
|
8379
|
+
},
|
|
8380
|
+
"default": "'Select an option'",
|
|
8381
|
+
"description": "Placeholder text when nothing is selected",
|
|
8382
|
+
"attribute": "placeholder"
|
|
8383
|
+
},
|
|
8384
|
+
{
|
|
8385
|
+
"kind": "field",
|
|
8386
|
+
"name": "disabled",
|
|
8387
|
+
"type": {
|
|
8388
|
+
"text": "boolean"
|
|
8389
|
+
},
|
|
8390
|
+
"default": "false",
|
|
8391
|
+
"description": "Whether the field is disabled",
|
|
8392
|
+
"attribute": "disabled"
|
|
8393
|
+
},
|
|
8394
|
+
{
|
|
8395
|
+
"kind": "field",
|
|
8396
|
+
"name": "readonly",
|
|
8397
|
+
"type": {
|
|
8398
|
+
"text": "boolean"
|
|
8399
|
+
},
|
|
8400
|
+
"default": "false",
|
|
8401
|
+
"description": "Whether the field is readonly",
|
|
8402
|
+
"attribute": "readonly"
|
|
8403
|
+
},
|
|
8404
|
+
{
|
|
8405
|
+
"kind": "field",
|
|
8406
|
+
"name": "required",
|
|
8407
|
+
"type": {
|
|
8408
|
+
"text": "boolean"
|
|
8409
|
+
},
|
|
8410
|
+
"default": "false",
|
|
8411
|
+
"description": "Whether the field is required",
|
|
8412
|
+
"attribute": "required"
|
|
8413
|
+
},
|
|
8414
|
+
{
|
|
8415
|
+
"kind": "field",
|
|
8416
|
+
"name": "hint",
|
|
8417
|
+
"type": {
|
|
8418
|
+
"text": "string"
|
|
8419
|
+
},
|
|
8420
|
+
"default": "''",
|
|
8421
|
+
"description": "Helper text displayed below the field",
|
|
8422
|
+
"attribute": "hint"
|
|
8423
|
+
},
|
|
8424
|
+
{
|
|
8425
|
+
"kind": "field",
|
|
8426
|
+
"name": "optionValue",
|
|
8427
|
+
"type": {
|
|
8428
|
+
"text": "string|Function"
|
|
8429
|
+
},
|
|
8430
|
+
"default": "'value'",
|
|
8431
|
+
"description": "Field name or function to extract the value from an option",
|
|
8432
|
+
"attribute": "option-value"
|
|
8433
|
+
},
|
|
8434
|
+
{
|
|
8435
|
+
"kind": "field",
|
|
8436
|
+
"name": "optionLabel",
|
|
8437
|
+
"type": {
|
|
8438
|
+
"text": "string|Function"
|
|
8439
|
+
},
|
|
8440
|
+
"default": "'label'",
|
|
8441
|
+
"description": "Field name or function to extract the label from an option",
|
|
8442
|
+
"attribute": "option-label"
|
|
8443
|
+
},
|
|
8444
|
+
{
|
|
8445
|
+
"kind": "field",
|
|
8446
|
+
"name": "options",
|
|
8447
|
+
"type": {
|
|
8448
|
+
"text": "any[]"
|
|
8449
|
+
},
|
|
8450
|
+
"default": "[]",
|
|
8451
|
+
"description": "Array of options",
|
|
8452
|
+
"attribute": "options"
|
|
8453
|
+
},
|
|
8454
|
+
{
|
|
8455
|
+
"kind": "field",
|
|
8456
|
+
"name": "fetch",
|
|
8457
|
+
"type": {
|
|
8458
|
+
"text": "Function"
|
|
8459
|
+
},
|
|
8460
|
+
"default": "null",
|
|
8461
|
+
"description": "Function that returns a promise of options"
|
|
8462
|
+
},
|
|
8463
|
+
{
|
|
8464
|
+
"kind": "field",
|
|
8465
|
+
"name": "fetchSelection",
|
|
8466
|
+
"type": {
|
|
8467
|
+
"text": "Function"
|
|
8468
|
+
},
|
|
8469
|
+
"default": "null",
|
|
8470
|
+
"description": "Function that resolves a single option by its value"
|
|
8471
|
+
},
|
|
8472
|
+
{
|
|
8473
|
+
"kind": "field",
|
|
8474
|
+
"name": "_isOpen",
|
|
8475
|
+
"type": {
|
|
8476
|
+
"text": "boolean"
|
|
8477
|
+
},
|
|
8478
|
+
"privacy": "private",
|
|
8479
|
+
"default": "false"
|
|
8480
|
+
},
|
|
8481
|
+
{
|
|
8482
|
+
"kind": "field",
|
|
8483
|
+
"name": "_highlightedIndex",
|
|
8484
|
+
"type": {
|
|
8485
|
+
"text": "number"
|
|
8486
|
+
},
|
|
8487
|
+
"privacy": "private",
|
|
8488
|
+
"default": "-1"
|
|
8489
|
+
},
|
|
8490
|
+
{
|
|
8491
|
+
"kind": "field",
|
|
8492
|
+
"name": "_touched",
|
|
8493
|
+
"type": {
|
|
8494
|
+
"text": "boolean"
|
|
8495
|
+
},
|
|
8496
|
+
"privacy": "private",
|
|
8497
|
+
"default": "false"
|
|
8498
|
+
},
|
|
8499
|
+
{
|
|
8500
|
+
"kind": "field",
|
|
8501
|
+
"name": "_searchQuery",
|
|
8502
|
+
"type": {
|
|
8503
|
+
"text": "string"
|
|
8504
|
+
},
|
|
8505
|
+
"privacy": "private",
|
|
8506
|
+
"default": "''"
|
|
8507
|
+
},
|
|
8508
|
+
{
|
|
8509
|
+
"kind": "field",
|
|
8510
|
+
"name": "_loading",
|
|
8511
|
+
"type": {
|
|
8512
|
+
"text": "boolean"
|
|
8513
|
+
},
|
|
8514
|
+
"privacy": "private",
|
|
8515
|
+
"default": "false"
|
|
8516
|
+
},
|
|
8517
|
+
{
|
|
8518
|
+
"kind": "field",
|
|
8519
|
+
"name": "_triggerElement",
|
|
8520
|
+
"type": {
|
|
8521
|
+
"text": "HTMLButtonElement"
|
|
8522
|
+
},
|
|
8523
|
+
"privacy": "private"
|
|
8524
|
+
},
|
|
8525
|
+
{
|
|
8526
|
+
"kind": "field",
|
|
8527
|
+
"name": "_searchInput",
|
|
8528
|
+
"type": {
|
|
8529
|
+
"text": "HTMLInputElement"
|
|
8530
|
+
},
|
|
8531
|
+
"privacy": "private"
|
|
8532
|
+
},
|
|
8533
|
+
{
|
|
8534
|
+
"kind": "field",
|
|
8535
|
+
"name": "form",
|
|
8536
|
+
"readonly": true
|
|
8537
|
+
},
|
|
8538
|
+
{
|
|
8539
|
+
"kind": "field",
|
|
8540
|
+
"name": "validity",
|
|
8541
|
+
"readonly": true
|
|
8542
|
+
},
|
|
8543
|
+
{
|
|
8544
|
+
"kind": "field",
|
|
8545
|
+
"name": "validationMessage",
|
|
8546
|
+
"readonly": true
|
|
8547
|
+
},
|
|
8548
|
+
{
|
|
8549
|
+
"kind": "method",
|
|
8550
|
+
"name": "checkValidity"
|
|
8551
|
+
},
|
|
8552
|
+
{
|
|
8553
|
+
"kind": "method",
|
|
8554
|
+
"name": "reportValidity"
|
|
8555
|
+
},
|
|
8556
|
+
{
|
|
8557
|
+
"kind": "method",
|
|
8558
|
+
"name": "formResetCallback"
|
|
8559
|
+
},
|
|
8560
|
+
{
|
|
8561
|
+
"kind": "method",
|
|
8562
|
+
"name": "formStateRestoreCallback",
|
|
8202
8563
|
"parameters": [
|
|
8203
8564
|
{
|
|
8204
|
-
"name": "
|
|
8565
|
+
"name": "state",
|
|
8205
8566
|
"type": {
|
|
8206
|
-
"text": "
|
|
8567
|
+
"text": "string"
|
|
8207
8568
|
}
|
|
8208
8569
|
}
|
|
8209
8570
|
]
|
|
8210
8571
|
},
|
|
8211
8572
|
{
|
|
8212
|
-
"kind": "method",
|
|
8213
|
-
"name": "
|
|
8214
|
-
|
|
8215
|
-
|
|
8216
|
-
|
|
8217
|
-
|
|
8218
|
-
|
|
8219
|
-
|
|
8220
|
-
"
|
|
8221
|
-
|
|
8222
|
-
|
|
8223
|
-
|
|
8224
|
-
|
|
8225
|
-
|
|
8226
|
-
|
|
8227
|
-
|
|
8573
|
+
"kind": "method",
|
|
8574
|
+
"name": "focus"
|
|
8575
|
+
},
|
|
8576
|
+
{
|
|
8577
|
+
"kind": "method",
|
|
8578
|
+
"name": "blur"
|
|
8579
|
+
},
|
|
8580
|
+
{
|
|
8581
|
+
"kind": "field",
|
|
8582
|
+
"name": "_handleInvalid",
|
|
8583
|
+
"privacy": "private"
|
|
8584
|
+
},
|
|
8585
|
+
{
|
|
8586
|
+
"kind": "method",
|
|
8587
|
+
"name": "_updateValidity",
|
|
8588
|
+
"privacy": "private",
|
|
8589
|
+
"return": {
|
|
8590
|
+
"type": {
|
|
8591
|
+
"text": "void"
|
|
8592
|
+
}
|
|
8593
|
+
}
|
|
8594
|
+
},
|
|
8595
|
+
{
|
|
8596
|
+
"kind": "method",
|
|
8597
|
+
"name": "_handleTriggerClick",
|
|
8598
|
+
"privacy": "private",
|
|
8599
|
+
"return": {
|
|
8600
|
+
"type": {
|
|
8601
|
+
"text": "void"
|
|
8602
|
+
}
|
|
8603
|
+
}
|
|
8604
|
+
},
|
|
8605
|
+
{
|
|
8606
|
+
"kind": "method",
|
|
8607
|
+
"name": "_open",
|
|
8608
|
+
"privacy": "private",
|
|
8609
|
+
"return": {
|
|
8610
|
+
"type": {
|
|
8611
|
+
"text": "void"
|
|
8612
|
+
}
|
|
8613
|
+
}
|
|
8614
|
+
},
|
|
8615
|
+
{
|
|
8616
|
+
"kind": "method",
|
|
8617
|
+
"name": "_close",
|
|
8618
|
+
"privacy": "private",
|
|
8619
|
+
"return": {
|
|
8620
|
+
"type": {
|
|
8621
|
+
"text": "void"
|
|
8622
|
+
}
|
|
8623
|
+
}
|
|
8624
|
+
},
|
|
8625
|
+
{
|
|
8626
|
+
"kind": "method",
|
|
8627
|
+
"name": "_positionDropdown",
|
|
8628
|
+
"privacy": "private",
|
|
8629
|
+
"return": {
|
|
8630
|
+
"type": {
|
|
8631
|
+
"text": "void"
|
|
8632
|
+
}
|
|
8633
|
+
}
|
|
8634
|
+
},
|
|
8635
|
+
{
|
|
8636
|
+
"kind": "method",
|
|
8637
|
+
"name": "_fetch",
|
|
8638
|
+
"privacy": "private",
|
|
8639
|
+
"return": {
|
|
8640
|
+
"type": {
|
|
8641
|
+
"text": "void"
|
|
8642
|
+
}
|
|
8643
|
+
}
|
|
8644
|
+
},
|
|
8645
|
+
{
|
|
8646
|
+
"kind": "method",
|
|
8647
|
+
"name": "_handleSearchInput",
|
|
8648
|
+
"privacy": "private",
|
|
8649
|
+
"return": {
|
|
8650
|
+
"type": {
|
|
8651
|
+
"text": "void"
|
|
8652
|
+
}
|
|
8653
|
+
},
|
|
8654
|
+
"parameters": [
|
|
8655
|
+
{
|
|
8656
|
+
"name": "e",
|
|
8657
|
+
"type": {
|
|
8658
|
+
"text": "Event"
|
|
8659
|
+
}
|
|
8660
|
+
}
|
|
8661
|
+
]
|
|
8662
|
+
},
|
|
8663
|
+
{
|
|
8664
|
+
"kind": "method",
|
|
8665
|
+
"name": "_handleSearchKeyDown",
|
|
8666
|
+
"privacy": "private",
|
|
8667
|
+
"return": {
|
|
8668
|
+
"type": {
|
|
8669
|
+
"text": "void"
|
|
8670
|
+
}
|
|
8671
|
+
},
|
|
8672
|
+
"parameters": [
|
|
8673
|
+
{
|
|
8674
|
+
"name": "e",
|
|
8675
|
+
"type": {
|
|
8676
|
+
"text": "KeyboardEvent"
|
|
8677
|
+
}
|
|
8678
|
+
}
|
|
8679
|
+
]
|
|
8680
|
+
},
|
|
8681
|
+
{
|
|
8682
|
+
"kind": "method",
|
|
8683
|
+
"name": "_handleTriggerKeyDown",
|
|
8684
|
+
"privacy": "private",
|
|
8685
|
+
"return": {
|
|
8686
|
+
"type": {
|
|
8687
|
+
"text": "void"
|
|
8688
|
+
}
|
|
8689
|
+
},
|
|
8690
|
+
"parameters": [
|
|
8691
|
+
{
|
|
8692
|
+
"name": "e",
|
|
8693
|
+
"type": {
|
|
8694
|
+
"text": "KeyboardEvent"
|
|
8695
|
+
}
|
|
8696
|
+
}
|
|
8697
|
+
]
|
|
8698
|
+
},
|
|
8699
|
+
{
|
|
8700
|
+
"kind": "method",
|
|
8701
|
+
"name": "_handleTriggerBlur",
|
|
8702
|
+
"privacy": "private",
|
|
8703
|
+
"return": {
|
|
8704
|
+
"type": {
|
|
8705
|
+
"text": "void"
|
|
8706
|
+
}
|
|
8707
|
+
}
|
|
8708
|
+
},
|
|
8709
|
+
{
|
|
8710
|
+
"kind": "method",
|
|
8711
|
+
"name": "_scrollToHighlighted",
|
|
8712
|
+
"privacy": "private",
|
|
8713
|
+
"return": {
|
|
8714
|
+
"type": {
|
|
8715
|
+
"text": "void"
|
|
8716
|
+
}
|
|
8717
|
+
}
|
|
8718
|
+
},
|
|
8719
|
+
{
|
|
8720
|
+
"kind": "method",
|
|
8721
|
+
"name": "_getOptionValue",
|
|
8722
|
+
"privacy": "private",
|
|
8723
|
+
"return": {
|
|
8724
|
+
"type": {
|
|
8725
|
+
"text": "string"
|
|
8726
|
+
}
|
|
8727
|
+
},
|
|
8728
|
+
"parameters": [
|
|
8729
|
+
{
|
|
8730
|
+
"name": "option",
|
|
8731
|
+
"type": {
|
|
8732
|
+
"text": "any"
|
|
8733
|
+
}
|
|
8734
|
+
}
|
|
8735
|
+
]
|
|
8736
|
+
},
|
|
8737
|
+
{
|
|
8738
|
+
"kind": "method",
|
|
8739
|
+
"name": "_getOptionLabel",
|
|
8740
|
+
"privacy": "private",
|
|
8741
|
+
"return": {
|
|
8742
|
+
"type": {
|
|
8743
|
+
"text": "string"
|
|
8744
|
+
}
|
|
8745
|
+
},
|
|
8746
|
+
"parameters": [
|
|
8747
|
+
{
|
|
8748
|
+
"name": "option",
|
|
8749
|
+
"type": {
|
|
8750
|
+
"text": "any"
|
|
8751
|
+
}
|
|
8752
|
+
}
|
|
8753
|
+
]
|
|
8754
|
+
},
|
|
8755
|
+
{
|
|
8756
|
+
"kind": "method",
|
|
8757
|
+
"name": "_resolveSelection",
|
|
8758
|
+
"privacy": "private",
|
|
8759
|
+
"return": {
|
|
8760
|
+
"type": {
|
|
8761
|
+
"text": "void"
|
|
8762
|
+
}
|
|
8763
|
+
}
|
|
8764
|
+
},
|
|
8765
|
+
{
|
|
8766
|
+
"kind": "method",
|
|
8767
|
+
"name": "_selectOption",
|
|
8768
|
+
"privacy": "private",
|
|
8769
|
+
"return": {
|
|
8770
|
+
"type": {
|
|
8771
|
+
"text": "void"
|
|
8772
|
+
}
|
|
8773
|
+
},
|
|
8774
|
+
"parameters": [
|
|
8775
|
+
{
|
|
8776
|
+
"name": "option",
|
|
8777
|
+
"type": {
|
|
8778
|
+
"text": "any"
|
|
8779
|
+
}
|
|
8780
|
+
}
|
|
8781
|
+
]
|
|
8782
|
+
},
|
|
8783
|
+
{
|
|
8784
|
+
"kind": "method",
|
|
8785
|
+
"name": "_handleOptionMouseEnter",
|
|
8786
|
+
"privacy": "private",
|
|
8787
|
+
"return": {
|
|
8788
|
+
"type": {
|
|
8789
|
+
"text": "void"
|
|
8790
|
+
}
|
|
8791
|
+
},
|
|
8792
|
+
"parameters": [
|
|
8793
|
+
{
|
|
8794
|
+
"name": "e",
|
|
8795
|
+
"type": {
|
|
8796
|
+
"text": "Event"
|
|
8797
|
+
}
|
|
8798
|
+
},
|
|
8799
|
+
{
|
|
8800
|
+
"name": "index",
|
|
8801
|
+
"type": {
|
|
8802
|
+
"text": "number"
|
|
8803
|
+
}
|
|
8804
|
+
}
|
|
8805
|
+
]
|
|
8806
|
+
},
|
|
8807
|
+
{
|
|
8808
|
+
"kind": "method",
|
|
8809
|
+
"name": "_renderOption",
|
|
8810
|
+
"privacy": "private",
|
|
8811
|
+
"parameters": [
|
|
8812
|
+
{
|
|
8813
|
+
"name": "option",
|
|
8814
|
+
"type": {
|
|
8815
|
+
"text": "any"
|
|
8816
|
+
}
|
|
8817
|
+
},
|
|
8818
|
+
{
|
|
8819
|
+
"name": "index",
|
|
8820
|
+
"type": {
|
|
8821
|
+
"text": "number"
|
|
8822
|
+
}
|
|
8823
|
+
}
|
|
8824
|
+
]
|
|
8825
|
+
}
|
|
8826
|
+
],
|
|
8827
|
+
"events": [
|
|
8828
|
+
{
|
|
8829
|
+
"name": "select",
|
|
8830
|
+
"type": {
|
|
8831
|
+
"text": "CustomEvent"
|
|
8832
|
+
},
|
|
8833
|
+
"description": "Fired when an option is selected"
|
|
8834
|
+
},
|
|
8835
|
+
{
|
|
8836
|
+
"name": "change",
|
|
8837
|
+
"type": {
|
|
8838
|
+
"text": "Event"
|
|
8839
|
+
},
|
|
8840
|
+
"description": "Fired when the selected value changes"
|
|
8841
|
+
}
|
|
8842
|
+
],
|
|
8843
|
+
"attributes": [
|
|
8844
|
+
{
|
|
8845
|
+
"name": "label",
|
|
8846
|
+
"type": {
|
|
8847
|
+
"text": "string"
|
|
8848
|
+
},
|
|
8849
|
+
"default": "''",
|
|
8850
|
+
"description": "Label text",
|
|
8851
|
+
"fieldName": "label"
|
|
8852
|
+
},
|
|
8853
|
+
{
|
|
8854
|
+
"name": "name",
|
|
8855
|
+
"type": {
|
|
8856
|
+
"text": "string"
|
|
8857
|
+
},
|
|
8858
|
+
"default": "''",
|
|
8859
|
+
"description": "Name for form submission",
|
|
8860
|
+
"fieldName": "name"
|
|
8861
|
+
},
|
|
8862
|
+
{
|
|
8863
|
+
"name": "value",
|
|
8864
|
+
"type": {
|
|
8865
|
+
"text": "string"
|
|
8866
|
+
},
|
|
8867
|
+
"default": "''",
|
|
8868
|
+
"description": "Currently selected value",
|
|
8869
|
+
"fieldName": "value"
|
|
8870
|
+
},
|
|
8871
|
+
{
|
|
8872
|
+
"name": "placeholder",
|
|
8873
|
+
"type": {
|
|
8874
|
+
"text": "string"
|
|
8875
|
+
},
|
|
8876
|
+
"default": "'Select an option'",
|
|
8877
|
+
"description": "Placeholder text when nothing is selected",
|
|
8878
|
+
"fieldName": "placeholder"
|
|
8879
|
+
},
|
|
8880
|
+
{
|
|
8881
|
+
"name": "disabled",
|
|
8882
|
+
"type": {
|
|
8883
|
+
"text": "boolean"
|
|
8884
|
+
},
|
|
8885
|
+
"default": "false",
|
|
8886
|
+
"description": "Whether the field is disabled",
|
|
8887
|
+
"fieldName": "disabled"
|
|
8888
|
+
},
|
|
8889
|
+
{
|
|
8890
|
+
"name": "readonly",
|
|
8891
|
+
"type": {
|
|
8892
|
+
"text": "boolean"
|
|
8893
|
+
},
|
|
8894
|
+
"default": "false",
|
|
8895
|
+
"description": "Whether the field is readonly",
|
|
8896
|
+
"fieldName": "readonly"
|
|
8897
|
+
},
|
|
8898
|
+
{
|
|
8899
|
+
"name": "required",
|
|
8900
|
+
"type": {
|
|
8901
|
+
"text": "boolean"
|
|
8902
|
+
},
|
|
8903
|
+
"default": "false",
|
|
8904
|
+
"description": "Whether the field is required",
|
|
8905
|
+
"fieldName": "required"
|
|
8906
|
+
},
|
|
8907
|
+
{
|
|
8908
|
+
"name": "hint",
|
|
8909
|
+
"type": {
|
|
8910
|
+
"text": "string"
|
|
8911
|
+
},
|
|
8912
|
+
"default": "''",
|
|
8913
|
+
"description": "Helper text displayed below the field",
|
|
8914
|
+
"fieldName": "hint"
|
|
8915
|
+
},
|
|
8916
|
+
{
|
|
8917
|
+
"name": "option-value",
|
|
8918
|
+
"type": {
|
|
8919
|
+
"text": "string|Function"
|
|
8920
|
+
},
|
|
8921
|
+
"default": "'value'",
|
|
8922
|
+
"description": "Field name or function to extract the value from an option",
|
|
8923
|
+
"fieldName": "optionValue"
|
|
8924
|
+
},
|
|
8925
|
+
{
|
|
8926
|
+
"name": "option-label",
|
|
8927
|
+
"type": {
|
|
8928
|
+
"text": "string|Function"
|
|
8929
|
+
},
|
|
8930
|
+
"default": "'label'",
|
|
8931
|
+
"description": "Field name or function to extract the label from an option",
|
|
8932
|
+
"fieldName": "optionLabel"
|
|
8933
|
+
},
|
|
8934
|
+
{
|
|
8935
|
+
"name": "options",
|
|
8936
|
+
"type": {
|
|
8937
|
+
"text": "any[]"
|
|
8938
|
+
},
|
|
8939
|
+
"default": "[]",
|
|
8940
|
+
"description": "Array of options",
|
|
8941
|
+
"fieldName": "options"
|
|
8942
|
+
}
|
|
8943
|
+
],
|
|
8944
|
+
"superclass": {
|
|
8945
|
+
"name": "LitElement",
|
|
8946
|
+
"package": "lit"
|
|
8947
|
+
},
|
|
8948
|
+
"tagName": "kr-combo-box",
|
|
8949
|
+
"customElement": true
|
|
8950
|
+
}
|
|
8951
|
+
],
|
|
8952
|
+
"exports": [
|
|
8953
|
+
{
|
|
8954
|
+
"kind": "js",
|
|
8955
|
+
"name": "KRComboBox",
|
|
8956
|
+
"declaration": {
|
|
8957
|
+
"name": "KRComboBox",
|
|
8958
|
+
"module": "src/form/combo-box/combo-box.ts"
|
|
8959
|
+
}
|
|
8960
|
+
},
|
|
8961
|
+
{
|
|
8962
|
+
"kind": "custom-element-definition",
|
|
8963
|
+
"name": "kr-combo-box",
|
|
8964
|
+
"declaration": {
|
|
8965
|
+
"name": "KRComboBox",
|
|
8966
|
+
"module": "src/form/combo-box/combo-box.ts"
|
|
8967
|
+
}
|
|
8968
|
+
}
|
|
8969
|
+
]
|
|
8970
|
+
},
|
|
8971
|
+
{
|
|
8972
|
+
"kind": "javascript-module",
|
|
8973
|
+
"path": "src/form/detail-field/detail-field.ts",
|
|
8974
|
+
"declarations": [
|
|
8975
|
+
{
|
|
8976
|
+
"kind": "class",
|
|
8977
|
+
"description": "A read-only field component that displays a label and value.",
|
|
8978
|
+
"name": "KRDetailField",
|
|
8979
|
+
"members": [
|
|
8980
|
+
{
|
|
8981
|
+
"kind": "field",
|
|
8982
|
+
"name": "label",
|
|
8983
|
+
"type": {
|
|
8984
|
+
"text": "string"
|
|
8985
|
+
},
|
|
8986
|
+
"default": "''",
|
|
8987
|
+
"description": "The field label text",
|
|
8988
|
+
"attribute": "label"
|
|
8989
|
+
},
|
|
8990
|
+
{
|
|
8991
|
+
"kind": "field",
|
|
8992
|
+
"name": "value",
|
|
8993
|
+
"type": {
|
|
8994
|
+
"text": "string"
|
|
8995
|
+
},
|
|
8996
|
+
"default": "''",
|
|
8997
|
+
"description": "The value to display",
|
|
8998
|
+
"attribute": "value"
|
|
8999
|
+
}
|
|
9000
|
+
],
|
|
9001
|
+
"attributes": [
|
|
9002
|
+
{
|
|
9003
|
+
"name": "label",
|
|
9004
|
+
"type": {
|
|
9005
|
+
"text": "string"
|
|
9006
|
+
},
|
|
9007
|
+
"default": "''",
|
|
9008
|
+
"description": "The field label text",
|
|
9009
|
+
"fieldName": "label"
|
|
9010
|
+
},
|
|
9011
|
+
{
|
|
9012
|
+
"name": "value",
|
|
9013
|
+
"type": {
|
|
9014
|
+
"text": "string"
|
|
9015
|
+
},
|
|
9016
|
+
"default": "''",
|
|
9017
|
+
"description": "The value to display",
|
|
9018
|
+
"fieldName": "value"
|
|
9019
|
+
}
|
|
9020
|
+
],
|
|
9021
|
+
"superclass": {
|
|
9022
|
+
"name": "LitElement",
|
|
9023
|
+
"package": "lit"
|
|
9024
|
+
},
|
|
9025
|
+
"tagName": "kr-detail-field",
|
|
9026
|
+
"customElement": true
|
|
9027
|
+
}
|
|
9028
|
+
],
|
|
9029
|
+
"exports": [
|
|
9030
|
+
{
|
|
9031
|
+
"kind": "js",
|
|
9032
|
+
"name": "KRDetailField",
|
|
9033
|
+
"declaration": {
|
|
9034
|
+
"name": "KRDetailField",
|
|
9035
|
+
"module": "src/form/detail-field/detail-field.ts"
|
|
9036
|
+
}
|
|
9037
|
+
},
|
|
9038
|
+
{
|
|
9039
|
+
"kind": "custom-element-definition",
|
|
9040
|
+
"name": "kr-detail-field",
|
|
9041
|
+
"declaration": {
|
|
9042
|
+
"name": "KRDetailField",
|
|
9043
|
+
"module": "src/form/detail-field/detail-field.ts"
|
|
9044
|
+
}
|
|
9045
|
+
}
|
|
9046
|
+
]
|
|
9047
|
+
},
|
|
9048
|
+
{
|
|
9049
|
+
"kind": "javascript-module",
|
|
9050
|
+
"path": "src/form/radio-cards/radio-cards.ts",
|
|
9051
|
+
"declarations": [
|
|
9052
|
+
{
|
|
9053
|
+
"kind": "class",
|
|
9054
|
+
"description": "A card-style radio group for selecting between a small number of options.\nEach option renders as a bordered card with a radio indicator, label, and optional description.\n\nUses ElementInternals for form association, allowing the component\nto participate in form submission, validation, and reset.",
|
|
9055
|
+
"name": "KRRadioCards",
|
|
9056
|
+
"members": [
|
|
9057
|
+
{
|
|
9058
|
+
"kind": "field",
|
|
9059
|
+
"name": "formAssociated",
|
|
9060
|
+
"type": {
|
|
9061
|
+
"text": "boolean"
|
|
9062
|
+
},
|
|
9063
|
+
"static": true,
|
|
9064
|
+
"default": "true"
|
|
9065
|
+
},
|
|
9066
|
+
{
|
|
9067
|
+
"kind": "field",
|
|
9068
|
+
"name": "_internals",
|
|
9069
|
+
"type": {
|
|
9070
|
+
"text": "ElementInternals"
|
|
9071
|
+
},
|
|
9072
|
+
"privacy": "private"
|
|
9073
|
+
},
|
|
9074
|
+
{
|
|
9075
|
+
"kind": "field",
|
|
9076
|
+
"name": "_focusedIndex",
|
|
9077
|
+
"type": {
|
|
9078
|
+
"text": "number"
|
|
9079
|
+
},
|
|
9080
|
+
"privacy": "private",
|
|
9081
|
+
"default": "-1"
|
|
9082
|
+
},
|
|
9083
|
+
{
|
|
9084
|
+
"kind": "field",
|
|
9085
|
+
"name": "label",
|
|
9086
|
+
"type": {
|
|
9087
|
+
"text": "string"
|
|
9088
|
+
},
|
|
9089
|
+
"default": "''",
|
|
9090
|
+
"description": "The label text above the cards",
|
|
9091
|
+
"attribute": "label"
|
|
9092
|
+
},
|
|
9093
|
+
{
|
|
9094
|
+
"kind": "field",
|
|
9095
|
+
"name": "name",
|
|
9096
|
+
"type": {
|
|
9097
|
+
"text": "string"
|
|
9098
|
+
},
|
|
9099
|
+
"default": "''",
|
|
9100
|
+
"description": "The input name for form submission",
|
|
9101
|
+
"attribute": "name"
|
|
9102
|
+
},
|
|
9103
|
+
{
|
|
9104
|
+
"kind": "field",
|
|
9105
|
+
"name": "value",
|
|
9106
|
+
"type": {
|
|
9107
|
+
"text": "string"
|
|
9108
|
+
},
|
|
9109
|
+
"default": "''",
|
|
9110
|
+
"description": "The currently selected value",
|
|
9111
|
+
"attribute": "value"
|
|
9112
|
+
},
|
|
9113
|
+
{
|
|
9114
|
+
"kind": "field",
|
|
9115
|
+
"name": "options",
|
|
9116
|
+
"type": {
|
|
9117
|
+
"text": "KRRadioCardsOption[]"
|
|
9118
|
+
},
|
|
9119
|
+
"default": "[]",
|
|
9120
|
+
"description": "The card options to display"
|
|
9121
|
+
},
|
|
9122
|
+
{
|
|
9123
|
+
"kind": "field",
|
|
9124
|
+
"name": "disabled",
|
|
9125
|
+
"type": {
|
|
9126
|
+
"text": "boolean"
|
|
9127
|
+
},
|
|
9128
|
+
"default": "false",
|
|
9129
|
+
"description": "Whether the field is disabled",
|
|
9130
|
+
"attribute": "disabled"
|
|
9131
|
+
},
|
|
9132
|
+
{
|
|
9133
|
+
"kind": "field",
|
|
9134
|
+
"name": "required",
|
|
9135
|
+
"type": {
|
|
9136
|
+
"text": "boolean"
|
|
9137
|
+
},
|
|
9138
|
+
"default": "false",
|
|
9139
|
+
"description": "Whether the field is required",
|
|
9140
|
+
"attribute": "required"
|
|
9141
|
+
},
|
|
9142
|
+
{
|
|
9143
|
+
"kind": "field",
|
|
9144
|
+
"name": "hint",
|
|
9145
|
+
"type": {
|
|
9146
|
+
"text": "string"
|
|
9147
|
+
},
|
|
9148
|
+
"default": "''",
|
|
9149
|
+
"description": "Helper text shown below the cards",
|
|
9150
|
+
"attribute": "hint"
|
|
9151
|
+
},
|
|
9152
|
+
{
|
|
9153
|
+
"kind": "field",
|
|
9154
|
+
"name": "direction",
|
|
9155
|
+
"type": {
|
|
9156
|
+
"text": "'row' | 'column'"
|
|
9157
|
+
},
|
|
9158
|
+
"default": "'row'",
|
|
9159
|
+
"description": "Layout direction: 'row' or 'column'",
|
|
9160
|
+
"attribute": "direction"
|
|
9161
|
+
},
|
|
9162
|
+
{
|
|
9163
|
+
"kind": "field",
|
|
9164
|
+
"name": "_touched",
|
|
9165
|
+
"type": {
|
|
9166
|
+
"text": "boolean"
|
|
9167
|
+
},
|
|
9168
|
+
"privacy": "private",
|
|
9169
|
+
"default": "false"
|
|
9170
|
+
},
|
|
9171
|
+
{
|
|
9172
|
+
"kind": "field",
|
|
9173
|
+
"name": "form",
|
|
9174
|
+
"readonly": true
|
|
9175
|
+
},
|
|
9176
|
+
{
|
|
9177
|
+
"kind": "field",
|
|
9178
|
+
"name": "validity",
|
|
9179
|
+
"readonly": true
|
|
9180
|
+
},
|
|
9181
|
+
{
|
|
9182
|
+
"kind": "field",
|
|
9183
|
+
"name": "validationMessage",
|
|
9184
|
+
"readonly": true
|
|
9185
|
+
},
|
|
9186
|
+
{
|
|
9187
|
+
"kind": "field",
|
|
9188
|
+
"name": "willValidate",
|
|
9189
|
+
"readonly": true
|
|
8228
9190
|
},
|
|
8229
9191
|
{
|
|
8230
9192
|
"kind": "method",
|
|
8231
|
-
"name": "
|
|
8232
|
-
"privacy": "private",
|
|
8233
|
-
"return": {
|
|
8234
|
-
"type": {
|
|
8235
|
-
"text": "void"
|
|
8236
|
-
}
|
|
8237
|
-
}
|
|
9193
|
+
"name": "checkValidity"
|
|
8238
9194
|
},
|
|
8239
9195
|
{
|
|
8240
9196
|
"kind": "method",
|
|
8241
|
-
"name": "
|
|
8242
|
-
"privacy": "private",
|
|
8243
|
-
"return": {
|
|
8244
|
-
"type": {
|
|
8245
|
-
"text": "void"
|
|
8246
|
-
}
|
|
8247
|
-
}
|
|
9197
|
+
"name": "reportValidity"
|
|
8248
9198
|
},
|
|
8249
9199
|
{
|
|
8250
9200
|
"kind": "method",
|
|
8251
|
-
"name": "
|
|
8252
|
-
"privacy": "private",
|
|
8253
|
-
"return": {
|
|
8254
|
-
"type": {
|
|
8255
|
-
"text": "string"
|
|
8256
|
-
}
|
|
8257
|
-
},
|
|
8258
|
-
"parameters": [
|
|
8259
|
-
{
|
|
8260
|
-
"name": "option",
|
|
8261
|
-
"type": {
|
|
8262
|
-
"text": "any"
|
|
8263
|
-
}
|
|
8264
|
-
}
|
|
8265
|
-
]
|
|
9201
|
+
"name": "formResetCallback"
|
|
8266
9202
|
},
|
|
8267
9203
|
{
|
|
8268
9204
|
"kind": "method",
|
|
8269
|
-
"name": "
|
|
8270
|
-
"privacy": "private",
|
|
8271
|
-
"return": {
|
|
8272
|
-
"type": {
|
|
8273
|
-
"text": "string"
|
|
8274
|
-
}
|
|
8275
|
-
},
|
|
9205
|
+
"name": "formStateRestoreCallback",
|
|
8276
9206
|
"parameters": [
|
|
8277
9207
|
{
|
|
8278
|
-
"name": "
|
|
9208
|
+
"name": "state",
|
|
8279
9209
|
"type": {
|
|
8280
|
-
"text": "
|
|
9210
|
+
"text": "string"
|
|
8281
9211
|
}
|
|
8282
9212
|
}
|
|
8283
9213
|
]
|
|
8284
9214
|
},
|
|
9215
|
+
{
|
|
9216
|
+
"kind": "field",
|
|
9217
|
+
"name": "_handleInvalid",
|
|
9218
|
+
"privacy": "private"
|
|
9219
|
+
},
|
|
8285
9220
|
{
|
|
8286
9221
|
"kind": "method",
|
|
8287
|
-
"name": "
|
|
8288
|
-
"privacy": "private"
|
|
8289
|
-
"return": {
|
|
8290
|
-
"type": {
|
|
8291
|
-
"text": "void"
|
|
8292
|
-
}
|
|
8293
|
-
}
|
|
9222
|
+
"name": "_updateValidity",
|
|
9223
|
+
"privacy": "private"
|
|
8294
9224
|
},
|
|
8295
9225
|
{
|
|
8296
9226
|
"kind": "method",
|
|
8297
|
-
"name": "
|
|
9227
|
+
"name": "_handleCardClick",
|
|
8298
9228
|
"privacy": "private",
|
|
8299
|
-
"return": {
|
|
8300
|
-
"type": {
|
|
8301
|
-
"text": "void"
|
|
8302
|
-
}
|
|
8303
|
-
},
|
|
8304
9229
|
"parameters": [
|
|
9230
|
+
{
|
|
9231
|
+
"name": "e",
|
|
9232
|
+
"type": {
|
|
9233
|
+
"text": "Event"
|
|
9234
|
+
}
|
|
9235
|
+
},
|
|
8305
9236
|
{
|
|
8306
9237
|
"name": "option",
|
|
8307
9238
|
"type": {
|
|
8308
|
-
"text": "
|
|
9239
|
+
"text": "KRRadioCardsOption"
|
|
8309
9240
|
}
|
|
8310
9241
|
}
|
|
8311
9242
|
]
|
|
8312
9243
|
},
|
|
8313
9244
|
{
|
|
8314
9245
|
"kind": "method",
|
|
8315
|
-
"name": "
|
|
9246
|
+
"name": "_handleKeyDown",
|
|
8316
9247
|
"privacy": "private",
|
|
8317
|
-
"return": {
|
|
8318
|
-
"type": {
|
|
8319
|
-
"text": "void"
|
|
8320
|
-
}
|
|
8321
|
-
},
|
|
8322
9248
|
"parameters": [
|
|
8323
9249
|
{
|
|
8324
9250
|
"name": "e",
|
|
8325
9251
|
"type": {
|
|
8326
|
-
"text": "
|
|
9252
|
+
"text": "KeyboardEvent"
|
|
8327
9253
|
}
|
|
8328
9254
|
},
|
|
8329
9255
|
{
|
|
@@ -8336,17 +9262,22 @@
|
|
|
8336
9262
|
},
|
|
8337
9263
|
{
|
|
8338
9264
|
"kind": "method",
|
|
8339
|
-
"name": "
|
|
9265
|
+
"name": "_findNextEnabledIndex",
|
|
8340
9266
|
"privacy": "private",
|
|
9267
|
+
"return": {
|
|
9268
|
+
"type": {
|
|
9269
|
+
"text": "number"
|
|
9270
|
+
}
|
|
9271
|
+
},
|
|
8341
9272
|
"parameters": [
|
|
8342
9273
|
{
|
|
8343
|
-
"name": "
|
|
9274
|
+
"name": "current",
|
|
8344
9275
|
"type": {
|
|
8345
|
-
"text": "
|
|
9276
|
+
"text": "number"
|
|
8346
9277
|
}
|
|
8347
9278
|
},
|
|
8348
9279
|
{
|
|
8349
|
-
"name": "
|
|
9280
|
+
"name": "step",
|
|
8350
9281
|
"type": {
|
|
8351
9282
|
"text": "number"
|
|
8352
9283
|
}
|
|
@@ -8355,13 +9286,6 @@
|
|
|
8355
9286
|
}
|
|
8356
9287
|
],
|
|
8357
9288
|
"events": [
|
|
8358
|
-
{
|
|
8359
|
-
"name": "select",
|
|
8360
|
-
"type": {
|
|
8361
|
-
"text": "CustomEvent"
|
|
8362
|
-
},
|
|
8363
|
-
"description": "Fired when an option is selected"
|
|
8364
|
-
},
|
|
8365
9289
|
{
|
|
8366
9290
|
"name": "change",
|
|
8367
9291
|
"type": {
|
|
@@ -8377,7 +9301,7 @@
|
|
|
8377
9301
|
"text": "string"
|
|
8378
9302
|
},
|
|
8379
9303
|
"default": "''",
|
|
8380
|
-
"description": "
|
|
9304
|
+
"description": "The label text above the cards",
|
|
8381
9305
|
"fieldName": "label"
|
|
8382
9306
|
},
|
|
8383
9307
|
{
|
|
@@ -8386,7 +9310,7 @@
|
|
|
8386
9310
|
"text": "string"
|
|
8387
9311
|
},
|
|
8388
9312
|
"default": "''",
|
|
8389
|
-
"description": "
|
|
9313
|
+
"description": "The input name for form submission",
|
|
8390
9314
|
"fieldName": "name"
|
|
8391
9315
|
},
|
|
8392
9316
|
{
|
|
@@ -8395,18 +9319,9 @@
|
|
|
8395
9319
|
"text": "string"
|
|
8396
9320
|
},
|
|
8397
9321
|
"default": "''",
|
|
8398
|
-
"description": "
|
|
9322
|
+
"description": "The currently selected value",
|
|
8399
9323
|
"fieldName": "value"
|
|
8400
9324
|
},
|
|
8401
|
-
{
|
|
8402
|
-
"name": "placeholder",
|
|
8403
|
-
"type": {
|
|
8404
|
-
"text": "string"
|
|
8405
|
-
},
|
|
8406
|
-
"default": "'Select an option'",
|
|
8407
|
-
"description": "Placeholder text when nothing is selected",
|
|
8408
|
-
"fieldName": "placeholder"
|
|
8409
|
-
},
|
|
8410
9325
|
{
|
|
8411
9326
|
"name": "disabled",
|
|
8412
9327
|
"type": {
|
|
@@ -8416,15 +9331,6 @@
|
|
|
8416
9331
|
"description": "Whether the field is disabled",
|
|
8417
9332
|
"fieldName": "disabled"
|
|
8418
9333
|
},
|
|
8419
|
-
{
|
|
8420
|
-
"name": "readonly",
|
|
8421
|
-
"type": {
|
|
8422
|
-
"text": "boolean"
|
|
8423
|
-
},
|
|
8424
|
-
"default": "false",
|
|
8425
|
-
"description": "Whether the field is readonly",
|
|
8426
|
-
"fieldName": "readonly"
|
|
8427
|
-
},
|
|
8428
9334
|
{
|
|
8429
9335
|
"name": "required",
|
|
8430
9336
|
"type": {
|
|
@@ -8440,137 +9346,42 @@
|
|
|
8440
9346
|
"text": "string"
|
|
8441
9347
|
},
|
|
8442
9348
|
"default": "''",
|
|
8443
|
-
"description": "Helper text
|
|
9349
|
+
"description": "Helper text shown below the cards",
|
|
8444
9350
|
"fieldName": "hint"
|
|
8445
9351
|
},
|
|
8446
9352
|
{
|
|
8447
|
-
"name": "
|
|
8448
|
-
"type": {
|
|
8449
|
-
"text": "string|Function"
|
|
8450
|
-
},
|
|
8451
|
-
"default": "'value'",
|
|
8452
|
-
"description": "Field name or function to extract the value from an option",
|
|
8453
|
-
"fieldName": "optionValue"
|
|
8454
|
-
},
|
|
8455
|
-
{
|
|
8456
|
-
"name": "option-label",
|
|
8457
|
-
"type": {
|
|
8458
|
-
"text": "string|Function"
|
|
8459
|
-
},
|
|
8460
|
-
"default": "'label'",
|
|
8461
|
-
"description": "Field name or function to extract the label from an option",
|
|
8462
|
-
"fieldName": "optionLabel"
|
|
8463
|
-
},
|
|
8464
|
-
{
|
|
8465
|
-
"name": "options",
|
|
8466
|
-
"type": {
|
|
8467
|
-
"text": "any[]"
|
|
8468
|
-
},
|
|
8469
|
-
"default": "[]",
|
|
8470
|
-
"description": "Array of options",
|
|
8471
|
-
"fieldName": "options"
|
|
8472
|
-
}
|
|
8473
|
-
],
|
|
8474
|
-
"superclass": {
|
|
8475
|
-
"name": "LitElement",
|
|
8476
|
-
"package": "lit"
|
|
8477
|
-
},
|
|
8478
|
-
"tagName": "kr-combo-box",
|
|
8479
|
-
"customElement": true
|
|
8480
|
-
}
|
|
8481
|
-
],
|
|
8482
|
-
"exports": [
|
|
8483
|
-
{
|
|
8484
|
-
"kind": "js",
|
|
8485
|
-
"name": "KRComboBox",
|
|
8486
|
-
"declaration": {
|
|
8487
|
-
"name": "KRComboBox",
|
|
8488
|
-
"module": "src/form/combo-box/combo-box.ts"
|
|
8489
|
-
}
|
|
8490
|
-
},
|
|
8491
|
-
{
|
|
8492
|
-
"kind": "custom-element-definition",
|
|
8493
|
-
"name": "kr-combo-box",
|
|
8494
|
-
"declaration": {
|
|
8495
|
-
"name": "KRComboBox",
|
|
8496
|
-
"module": "src/form/combo-box/combo-box.ts"
|
|
8497
|
-
}
|
|
8498
|
-
}
|
|
8499
|
-
]
|
|
8500
|
-
},
|
|
8501
|
-
{
|
|
8502
|
-
"kind": "javascript-module",
|
|
8503
|
-
"path": "src/form/detail-field/detail-field.ts",
|
|
8504
|
-
"declarations": [
|
|
8505
|
-
{
|
|
8506
|
-
"kind": "class",
|
|
8507
|
-
"description": "A read-only field component that displays a label and value.",
|
|
8508
|
-
"name": "KRDetailField",
|
|
8509
|
-
"members": [
|
|
8510
|
-
{
|
|
8511
|
-
"kind": "field",
|
|
8512
|
-
"name": "label",
|
|
8513
|
-
"type": {
|
|
8514
|
-
"text": "string"
|
|
8515
|
-
},
|
|
8516
|
-
"default": "''",
|
|
8517
|
-
"description": "The field label text",
|
|
8518
|
-
"attribute": "label"
|
|
8519
|
-
},
|
|
8520
|
-
{
|
|
8521
|
-
"kind": "field",
|
|
8522
|
-
"name": "value",
|
|
8523
|
-
"type": {
|
|
8524
|
-
"text": "string"
|
|
8525
|
-
},
|
|
8526
|
-
"default": "''",
|
|
8527
|
-
"description": "The value to display",
|
|
8528
|
-
"attribute": "value"
|
|
8529
|
-
}
|
|
8530
|
-
],
|
|
8531
|
-
"attributes": [
|
|
8532
|
-
{
|
|
8533
|
-
"name": "label",
|
|
8534
|
-
"type": {
|
|
8535
|
-
"text": "string"
|
|
8536
|
-
},
|
|
8537
|
-
"default": "''",
|
|
8538
|
-
"description": "The field label text",
|
|
8539
|
-
"fieldName": "label"
|
|
8540
|
-
},
|
|
8541
|
-
{
|
|
8542
|
-
"name": "value",
|
|
9353
|
+
"name": "direction",
|
|
8543
9354
|
"type": {
|
|
8544
|
-
"text": "
|
|
9355
|
+
"text": "'row' | 'column'"
|
|
8545
9356
|
},
|
|
8546
|
-
"default": "''",
|
|
8547
|
-
"description": "
|
|
8548
|
-
"fieldName": "
|
|
9357
|
+
"default": "'row'",
|
|
9358
|
+
"description": "Layout direction: 'row' or 'column'",
|
|
9359
|
+
"fieldName": "direction"
|
|
8549
9360
|
}
|
|
8550
9361
|
],
|
|
8551
9362
|
"superclass": {
|
|
8552
9363
|
"name": "LitElement",
|
|
8553
9364
|
"package": "lit"
|
|
8554
9365
|
},
|
|
8555
|
-
"tagName": "kr-
|
|
9366
|
+
"tagName": "kr-radio-cards",
|
|
8556
9367
|
"customElement": true
|
|
8557
9368
|
}
|
|
8558
9369
|
],
|
|
8559
9370
|
"exports": [
|
|
8560
9371
|
{
|
|
8561
9372
|
"kind": "js",
|
|
8562
|
-
"name": "
|
|
9373
|
+
"name": "KRRadioCards",
|
|
8563
9374
|
"declaration": {
|
|
8564
|
-
"name": "
|
|
8565
|
-
"module": "src/form/
|
|
9375
|
+
"name": "KRRadioCards",
|
|
9376
|
+
"module": "src/form/radio-cards/radio-cards.ts"
|
|
8566
9377
|
}
|
|
8567
9378
|
},
|
|
8568
9379
|
{
|
|
8569
9380
|
"kind": "custom-element-definition",
|
|
8570
|
-
"name": "kr-
|
|
9381
|
+
"name": "kr-radio-cards",
|
|
8571
9382
|
"declaration": {
|
|
8572
|
-
"name": "
|
|
8573
|
-
"module": "src/form/
|
|
9383
|
+
"name": "KRRadioCards",
|
|
9384
|
+
"module": "src/form/radio-cards/radio-cards.ts"
|
|
8574
9385
|
}
|
|
8575
9386
|
}
|
|
8576
9387
|
]
|