UNPKG

@kelvininc/ui-components

Version:
35 lines (31 loc) 1.94 kB
import { r as registerInstance, c as createEvent, h, H as Host } from './index-BOTigrTZ.js'; import { c as EComponentSize } from './wizard.types-COrzvkrr.js'; const toggleButtonGroupCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}kv-dropdown-base:not(.hydrated)>[slot=list]{display:none}:host{display:flex;gap:var(--spacing-xs);--toggle-group-width:unset}:host>kv-toggle-button{width:var(--toggle-group-width)}"; const KvToggleButtonGroup = class { constructor(hostRef) { registerInstance(this, hostRef); this.checkedChange = createEvent(this, "checkedChange", 7); /** @inheritdoc */ this.buttons = []; /** @inheritdoc */ this.withRadio = false; /** @inheritdoc */ this.disabled = false; /** @inheritdoc */ this.size = EComponentSize.Small; /** @inheritdoc */ this.selectedButtons = {}; /** @inheritdoc */ this.disabledButtons = {}; /** @inheritdoc */ this.radioButtons = {}; } render() { return (h(Host, { key: 'b6340ed668eb3bfa6b7774e2ea7655a551cbd1b3' }, this.buttons.map(button => { var _a; return (h("kv-toggle-button", { part: "toggle-button-container", exportparts: "toggle-button", icon: button.icon, value: button.value, label: button.label, tooltip: button.tooltip, size: (_a = this.size) !== null && _a !== void 0 ? _a : button.size, preventDefault: button.preventDefault, checked: this.selectedButtons[button.value] || button.checked, disabled: this.disabled || this.disabledButtons[button.value] || button.disabled, withRadio: this.withRadio || this.radioButtons[button.value] || button.withRadio, customAttributes: button.customAttributes })); }))); } }; KvToggleButtonGroup.style = toggleButtonGroupCss; export { KvToggleButtonGroup as kv_toggle_button_group };