@kelvininc/ui-components
Version:
Kelvin UI Components
50 lines (46 loc) • 3.73 kB
JavaScript
import { r as registerInstance, c as createEvent, h, H as Host } from './index-D-JVwta2.js';
import { a as EComponentSize } from './components-DzZLIMy0.js';
import './lib-config-DwRzddFC.js';
const actionButtonSplitCss = "@property --rotation{syntax:\"<angle>\";initial-value:0deg;inherits:false}@keyframes rotate-border{to{--rotation:360deg}}:host{--button-split-height-large:36px;--button-split-height-small:28px;--button-split-padding-x-large:var(--kv-spacing-2x, 8px);--button-split-padding-x-small:var(--kv-spacing, 4px);--button-split-icon-width:24px;--button-split-icon-height:24px}.action-button-split{display:flex;align-items:center}kv-action-button-text::part(button){border-top-right-radius:0;border-bottom-right-radius:0;border-right-width:0.5px}kv-action-button::part(button){--button-height-large:var(--button-split-height-large);--button-height-small:var(--button-split-height-small);--button-padding-x-large:var(--button-split-padding-x-large);--button-padding-x-small:var(--button-split-padding-x-small);display:flex;margin-left:-1px;border-left-width:0.5px;border-top-left-radius:0;border-bottom-left-radius:0}kv-icon{--icon-width:var(--button-split-icon-width);--icon-height:var(--button-split-icon-width)}";
const KvActionButtonSplit = class {
constructor(hostRef) {
registerInstance(this, hostRef);
this.clickLeftButton = createEvent(this, "clickLeftButton", 7);
this.clickRightButton = createEvent(this, "clickRightButton", 7);
this.focusLeftButton = createEvent(this, "focusLeftButton", 7);
this.focusRightButton = createEvent(this, "focusRightButton", 7);
this.blurLeftButton = createEvent(this, "blurLeftButton", 7);
this.blurRightButton = createEvent(this, "blurRightButton", 7);
/** @inheritdoc */
this.disabled = false;
/** @inheritdoc */
this.active = false;
/** @inheritdoc */
this.loading = false;
/** @inheritdoc */
this.size = EComponentSize.Large;
this.onClickLeftButton = (event) => {
this.clickLeftButton.emit(event.detail);
};
this.onClickRightButton = (event) => {
this.clickRightButton.emit(event.detail);
};
this.onFocusLeftButton = (event) => {
this.focusLeftButton.emit(event.detail);
};
this.onFocusRightButton = (event) => {
this.focusRightButton.emit(event.detail);
};
this.onBlurLeftButton = (event) => {
this.blurLeftButton.emit(event.detail);
};
this.onBlurRightButton = (event) => {
this.blurRightButton.emit(event.detail);
};
}
render() {
return (h(Host, { key: '6b76c82ff7fce00226146d654edb3825545b0b2c' }, h("div", { key: '83f19a6741d38f4b30bac48b94dd287ab4dbed63', class: "action-button-split" }, h("kv-action-button-text", { key: 'd83a2f2d3118467f5996ddab8bc68a53dcad04ba', type: this.type, text: this.text, icon: this.icon, disabled: this.disabled, size: this.size, loading: this.loading, onClickButton: this.onClickLeftButton, onFocusButton: this.onFocusLeftButton, onBlurButton: this.onBlurLeftButton, exportparts: "button" }), h("kv-action-button", { key: 'f30104f281919cfb44a8a4fac2eb490691adff7f', type: this.type, disabled: this.disabled, size: this.size, loading: this.loading, onClickButton: this.onClickRightButton, onFocusButton: this.onFocusRightButton, onBlurButton: this.onBlurRightButton, exportparts: "button" }, h("kv-icon", { key: 'e3909052a9d97c6c7f550ecd8d0d2ae954b9c11d', name: this.splitIcon, exportparts: "icon" })))));
}
};
KvActionButtonSplit.style = actionButtonSplitCss;
export { KvActionButtonSplit as kv_action_button_split };