@dialpad/dialtone
Version:
Dialpad's Dialtone design system monorepo
96 lines (95 loc) • 2.66 kB
JavaScript
import { SPLIT_BUTTON_ICON_SIZES } from "./split_button_constants.js";
import { DtIconChevronDown } from "@dialpad/dialtone-icons/vue2";
import { getUniqueString } from "../../common/utils.js";
import normalizeComponent from "../../_virtual/_plugin-vue2_normalizer.js";
import DtButton from "../button/button.vue.js";
const _sfc_main = {
name: "SplitButtonOmega",
components: {
DtButton,
DtIconChevronDown
},
props: {
/**
* Determines whether the button should have active styling
*/
active: {
type: Boolean,
default: false
},
/**
* Descriptive label for the button
*/
ariaLabel: {
type: String,
default: null
},
/**
* HTML button disabled attribute
*/
disabled: {
type: Boolean,
default: false
},
/**
* Element ID, useful in case you need to reference the button
* as an external anchor for popover
*/
id: {
type: String,
default: getUniqueString()
},
/**
* The fill and outline of the button associated with its visual importance.
*/
importance: {
type: String,
default: "primary"
},
/**
* The color of the button.
*/
kind: {
type: String,
default: "default"
},
/**
* The size of the button.
*/
size: {
type: String,
default: "md"
},
/**
* Text shown in tooltip when you hover the button
*/
tooltipText: {
type: String,
default: ""
}
},
data() {
return {
SPLIT_BUTTON_ICON_SIZES
};
}
};
var _sfc_render = function render() {
var _vm = this, _c = _vm._self._c;
return _c("dt-button", { directives: [{ name: "dt-tooltip", rawName: "v-dt-tooltip", value: _vm.tooltipText, expression: "tooltipText" }], class: `d-split-btn__omega d-split-btn__omega--${_vm.size}`, attrs: { "id": _vm.id, "data-qa": "dt-split-button-omega", "active": _vm.active, "aria-label": _vm.ariaLabel, "disabled": _vm.disabled, "importance": _vm.importance, "kind": _vm.kind, "size": _vm.size }, scopedSlots: _vm._u([{ key: "icon", fn: function() {
return [_vm._t("icon", function() {
return [_c("dt-icon-chevron-down", { attrs: { "size": _vm.SPLIT_BUTTON_ICON_SIZES[_vm.size] } })];
}, { "size": _vm.SPLIT_BUTTON_ICON_SIZES[_vm.size] })];
}, proxy: true }], null, true) });
};
var _sfc_staticRenderFns = [];
var __component__ = /* @__PURE__ */ normalizeComponent(
_sfc_main,
_sfc_render,
_sfc_staticRenderFns
);
const SplitButtonOmega = __component__.exports;
export {
SplitButtonOmega as default
};
//# sourceMappingURL=split_button-omega.vue.js.map