UNPKG

@kelvininc/ui-components

Version:
46 lines (41 loc) 2.21 kB
'use strict'; var index = require('./index-DpuMIXDY.js'); var components = require('./components-D2lyDQ_a.js'); require('./lib-config-QLtHwxiM.js'); require('./action-button.types-BYOe6st0.js'); require('./absolute-time-picker-dropdown.types-mPwO9zQk.js'); require('./icon.types-B8lvUrX_.js'); require('./summary-card.types-W26sTdH1.js'); require('./toaster.types-DlSCye8T.js'); require('./tree-item.types-C2yRoORC.js'); require('./tag-alarm.types-BeZw-7PT.js'); require('./wizard.types-DTbE-B6d.js'); const toggleButtonGroupCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}:host{display:flex;gap:var(--kv-spacing, 4px);--toggle-group-width:unset}:host>kv-toggle-button{width:var(--toggle-group-width)}"; const KvToggleButtonGroup = class { constructor(hostRef) { index.registerInstance(this, hostRef); this.checkedChange = index.createEvent(this, "checkedChange", 7); /** @inheritdoc */ this.buttons = []; /** @inheritdoc */ this.withRadio = false; /** @inheritdoc */ this.disabled = false; /** @inheritdoc */ this.size = components.EComponentSize.Small; /** @inheritdoc */ this.selectedButtons = {}; /** @inheritdoc */ this.disabledButtons = {}; /** @inheritdoc */ this.radioButtons = {}; } render() { return (index.h(index.Host, { key: 'a61b9b7fe554e7337be7b82a0b315d5ef5187ea0' }, this.buttons.map(button => { var _a; return (index.h("kv-toggle-button", { part: "toggle-button-container", exportparts: "toggle-button", value: button.value, label: button.label, icon: button.icon, preventDefault: button.preventDefault, size: (_a = this.size) !== null && _a !== void 0 ? _a : button.size, disabled: this.disabled || this.disabledButtons[button.value] || button.disabled, checked: this.selectedButtons[button.value] || button.checked, withRadio: this.withRadio || this.radioButtons[button.value] || button.withRadio })); }))); } }; KvToggleButtonGroup.style = toggleButtonGroupCss; exports.kv_toggle_button_group = KvToggleButtonGroup;