bani-ui 1.0.2-alpha.10 → 1.0.2-alpha.12
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/dist/es/Button-CXgL_cy-.js +105 -0
- package/dist/es/ButtonGroup-CaS3gDGZ.js +37 -0
- package/dist/es/ConfigProvider-CncTDeC_.js +74 -0
- package/dist/es/Dropdown-nLRWWor5.js +175 -0
- package/dist/es/Icon-iDz_Qer5.js +57 -0
- package/dist/es/Loading-ZYFHvHMx.js +269 -0
- package/dist/es/Message-BwW1uKch.js +203 -0
- package/dist/es/Popconfirm-BuixWawX.js +116 -0
- package/dist/es/Tooltip-DSiZCd9r.js +263 -0
- package/dist/es/hooks-DRNrztJ_.js +79 -0
- package/dist/es/index.js +40 -31
- package/dist/es/locale/lang/af.js +2 -2
- package/dist/es/locale/lang/ar-eg.js +2 -2
- package/dist/es/locale/lang/ar.js +2 -2
- package/dist/es/locale/lang/az.js +2 -2
- package/dist/es/locale/lang/bg.js +2 -2
- package/dist/es/locale/lang/bn.js +2 -2
- package/dist/es/locale/lang/ca.js +2 -2
- package/dist/es/locale/lang/ckb.js +2 -2
- package/dist/es/locale/lang/cs.js +2 -2
- package/dist/es/locale/lang/da.js +2 -2
- package/dist/es/locale/lang/de.js +2 -2
- package/dist/es/locale/lang/el.js +2 -2
- package/dist/es/locale/lang/en.js +2 -2
- package/dist/es/locale/lang/eo.js +2 -2
- package/dist/es/locale/lang/es.js +2 -2
- package/dist/es/locale/lang/et.js +2 -2
- package/dist/es/locale/lang/eu.js +2 -2
- package/dist/es/locale/lang/fa.js +2 -2
- package/dist/es/locale/lang/fi.js +2 -2
- package/dist/es/locale/lang/fr.js +2 -2
- package/dist/es/locale/lang/he.js +2 -2
- package/dist/es/locale/lang/hi.js +2 -2
- package/dist/es/locale/lang/hr.js +2 -2
- package/dist/es/locale/lang/hu.js +2 -2
- package/dist/es/locale/lang/hy-am.js +2 -2
- package/dist/es/locale/lang/id.js +2 -2
- package/dist/es/locale/lang/index.js +132 -132
- package/dist/es/locale/lang/it.js +2 -2
- package/dist/es/locale/lang/ja.js +2 -2
- package/dist/es/locale/lang/kk.js +2 -2
- package/dist/es/locale/lang/km.js +2 -2
- package/dist/es/locale/lang/ko.js +2 -2
- package/dist/es/locale/lang/ku.js +2 -2
- package/dist/es/locale/lang/ky.js +2 -2
- package/dist/es/locale/lang/lo.js +2 -2
- package/dist/es/locale/lang/lt.js +2 -2
- package/dist/es/locale/lang/lv.js +2 -2
- package/dist/es/locale/lang/mg.js +2 -2
- package/dist/es/locale/lang/mn.js +2 -2
- package/dist/es/locale/lang/ms.js +2 -2
- package/dist/es/locale/lang/my.js +2 -2
- package/dist/es/locale/lang/nb-no.js +2 -2
- package/dist/es/locale/lang/nl.js +2 -2
- package/dist/es/locale/lang/no.js +2 -2
- package/dist/es/locale/lang/pa.js +2 -2
- package/dist/es/locale/lang/pl.js +2 -2
- package/dist/es/locale/lang/pt-br.js +2 -2
- package/dist/es/locale/lang/pt.js +2 -2
- package/dist/es/locale/lang/ro.js +2 -2
- package/dist/es/locale/lang/ru.js +2 -2
- package/dist/es/locale/lang/sk.js +2 -2
- package/dist/es/locale/lang/sl.js +2 -2
- package/dist/es/locale/lang/sr.js +2 -2
- package/dist/es/locale/lang/sv.js +2 -2
- package/dist/es/locale/lang/sw.js +2 -2
- package/dist/es/locale/lang/ta.js +2 -2
- package/dist/es/locale/lang/te.js +2 -2
- package/dist/es/locale/lang/th.js +2 -2
- package/dist/es/locale/lang/tk.js +2 -2
- package/dist/es/locale/lang/tr.js +2 -2
- package/dist/es/locale/lang/ug-cn.js +2 -2
- package/dist/es/locale/lang/uk.js +2 -2
- package/dist/es/locale/lang/uz-uz.js +2 -2
- package/dist/es/locale/lang/vi.js +2 -2
- package/dist/es/locale/lang/zh-cn.js +2 -2
- package/dist/es/locale/lang/zh-hk.js +2 -2
- package/dist/es/locale/lang/zh-mo.js +2 -2
- package/dist/es/locale/lang/zh-tw.js +2 -2
- package/dist/es/utils-mFOE2DND.js +69 -0
- package/dist/es/vendor-mcUuP0dl.js +3633 -0
- package/dist/index.css +1 -1
- package/dist/theme/Button.css +259 -1
- package/dist/theme/ButtonGroup.css +48 -1
- package/dist/theme/Dropdown.css +117 -0
- package/dist/theme/Icon.css +25 -1
- package/dist/theme/Loading.css +55 -1
- package/dist/theme/Message.css +97 -1
- package/dist/theme/Popconfirm.css +11 -1
- package/dist/theme/Tooltip.css +74 -1
- package/dist/theme/index.css +197 -1
- package/dist/types/components/Button/index.d.ts +3 -3
- package/dist/types/components/Button/types.d.ts +2 -2
- package/dist/types/components/ConfigProvider/constants.d.ts +5 -0
- package/dist/types/components/ConfigProvider/hooks.d.ts +6 -0
- package/dist/types/components/ConfigProvider/index.d.ts +41 -0
- package/dist/types/components/ConfigProvider/types.d.ts +6 -0
- package/dist/types/components/Dropdown/constants.d.ts +4 -0
- package/dist/types/components/Dropdown/index.d.ts +266 -0
- package/dist/types/components/Dropdown/types.d.ts +31 -0
- package/dist/types/components/index.d.ts +2 -0
- package/dist/umd/index.css +1 -1
- package/dist/umd/index.css.br +0 -0
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +12 -12
- package/dist/umd/index.umd.cjs.br +0 -0
- package/dist/umd/index.umd.cjs.gz +0 -0
- package/dist/umd/locale/lang.umd.cjs +1 -0
- package/package.json +11 -5
- package/dist/es/Button-DE5lOjx4.js +0 -86
- package/dist/es/ButtonGroup-CgAr7Q6O.js +0 -29
- package/dist/es/Icon-B1pHSRJ9.js +0 -50
- package/dist/es/Loading-BJXm3yVc.js +0 -196
- package/dist/es/Message-CLTFWHIN.js +0 -167
- package/dist/es/Popconfirm-DA_hHUdg.js +0 -99
- package/dist/es/Tooltip-040OoVcb.js +0 -193
- package/dist/es/hooks-Mfyp42JB.js +0 -58
- package/dist/es/utils-CnOVokX1.js +0 -51
- package/dist/es/vendor-CyogNz9a.js +0 -2465
- package/dist/theme/theme/Button.css +0 -1
- package/dist/theme/theme/ButtonGroup.css +0 -1
- package/dist/theme/theme/Icon.css +0 -1
- package/dist/theme/theme/Loading.css +0 -1
- package/dist/theme/theme/Message.css +0 -1
- package/dist/theme/theme/Popconfirm.css +0 -1
- package/dist/theme/theme/Tooltip.css +0 -1
- package/dist/theme/theme/index.css +0 -1
|
@@ -0,0 +1,105 @@
|
|
|
1
|
+
import { defineComponent, inject, computed, useSlots, ref, openBlock, createBlock, resolveDynamicComponent, unref, normalizeClass, withCtx, renderSlot, createVNode, normalizeStyle, createCommentVNode } from "vue";
|
|
2
|
+
import { _ as _sfc_main$1 } from "./Icon-iDz_Qer5.js";
|
|
3
|
+
import { faSpinner } from "@fortawesome/free-solid-svg-icons";
|
|
4
|
+
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
5
|
+
import { t as throttle } from "./vendor-mcUuP0dl.js";
|
|
6
|
+
import { w as withInstall } from "./utils-mFOE2DND.js";
|
|
7
|
+
const BUTTON_GROUP_CTX_KEY = Symbol(
|
|
8
|
+
"BUTTON_GROUP_CTX_KEY"
|
|
9
|
+
);
|
|
10
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
11
|
+
...{
|
|
12
|
+
name: "BnButton"
|
|
13
|
+
},
|
|
14
|
+
__name: "Button",
|
|
15
|
+
props: {
|
|
16
|
+
tag: { default: "button" },
|
|
17
|
+
type: {},
|
|
18
|
+
size: {},
|
|
19
|
+
plain: { type: Boolean },
|
|
20
|
+
round: { type: Boolean },
|
|
21
|
+
circle: { type: Boolean },
|
|
22
|
+
disabled: { type: Boolean },
|
|
23
|
+
autofocus: { type: Boolean },
|
|
24
|
+
nativeType: { default: "button" },
|
|
25
|
+
icon: {},
|
|
26
|
+
loading: { type: Boolean },
|
|
27
|
+
loadingIcon: {},
|
|
28
|
+
useThrottle: { type: Boolean, default: true },
|
|
29
|
+
throttleDuration: { default: 500 }
|
|
30
|
+
},
|
|
31
|
+
emits: ["click"],
|
|
32
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
33
|
+
library.add(faSpinner);
|
|
34
|
+
const props = __props;
|
|
35
|
+
const ctx = inject(BUTTON_GROUP_CTX_KEY, void 0);
|
|
36
|
+
const size = computed(() => (ctx == null ? void 0 : ctx.size) ?? props.size ?? "");
|
|
37
|
+
const type = computed(() => (ctx == null ? void 0 : ctx.type) ?? props.type ?? "");
|
|
38
|
+
const disabled = computed(() => (ctx == null ? void 0 : ctx.disabled) || props.disabled || false);
|
|
39
|
+
const emits = __emit;
|
|
40
|
+
const slots = useSlots();
|
|
41
|
+
const _ref = ref();
|
|
42
|
+
const iconStyle = computed(() => ({
|
|
43
|
+
marginRight: slots.default ? "6px" : "0px"
|
|
44
|
+
}));
|
|
45
|
+
const handleBthClick = (e) => emits("click", e);
|
|
46
|
+
const handleBthClickThrottle = throttle(
|
|
47
|
+
handleBthClick,
|
|
48
|
+
props.throttleDuration,
|
|
49
|
+
{ trailing: false }
|
|
50
|
+
);
|
|
51
|
+
__expose({
|
|
52
|
+
get ref() {
|
|
53
|
+
return _ref.value ?? void 0;
|
|
54
|
+
},
|
|
55
|
+
disabled,
|
|
56
|
+
size,
|
|
57
|
+
type
|
|
58
|
+
});
|
|
59
|
+
return (_ctx, _cache) => {
|
|
60
|
+
return openBlock(), createBlock(resolveDynamicComponent(props.tag), {
|
|
61
|
+
ref_key: "_ref",
|
|
62
|
+
ref: _ref,
|
|
63
|
+
class: normalizeClass(["er-button", {
|
|
64
|
+
[`er-button--${type.value}`]: type.value,
|
|
65
|
+
[`er-button--${size.value}`]: size.value,
|
|
66
|
+
"is-plain": __props.plain,
|
|
67
|
+
"is-round": __props.round,
|
|
68
|
+
"is-circle": __props.circle,
|
|
69
|
+
"is-disabled": disabled.value,
|
|
70
|
+
"is-loading": __props.loading
|
|
71
|
+
}]),
|
|
72
|
+
autofocus: __props.autofocus,
|
|
73
|
+
type: __props.tag === "button" ? __props.nativeType : void 0,
|
|
74
|
+
disabled: disabled.value || __props.loading,
|
|
75
|
+
onClick: _cache[0] || (_cache[0] = (e) => __props.useThrottle ? unref(handleBthClickThrottle)(e) : handleBthClick(e))
|
|
76
|
+
}, {
|
|
77
|
+
default: withCtx(() => [
|
|
78
|
+
__props.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
|
|
79
|
+
createVNode(_sfc_main$1, {
|
|
80
|
+
class: "loading-icon",
|
|
81
|
+
icon: __props.loadingIcon ?? unref(faSpinner),
|
|
82
|
+
style: normalizeStyle(iconStyle.value),
|
|
83
|
+
size: "1x",
|
|
84
|
+
spin: ""
|
|
85
|
+
}, null, 8, ["icon", "style"])
|
|
86
|
+
]) : createCommentVNode("", true),
|
|
87
|
+
__props.icon && !__props.loading ? (openBlock(), createBlock(_sfc_main$1, {
|
|
88
|
+
key: 1,
|
|
89
|
+
icon: __props.icon,
|
|
90
|
+
size: "1x",
|
|
91
|
+
style: normalizeStyle(iconStyle.value)
|
|
92
|
+
}, null, 8, ["icon", "style"])) : createCommentVNode("", true),
|
|
93
|
+
renderSlot(_ctx.$slots, "default")
|
|
94
|
+
]),
|
|
95
|
+
_: 3
|
|
96
|
+
}, 8, ["autofocus", "type", "disabled", "class"]);
|
|
97
|
+
};
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
|
+
const BnButton = withInstall(_sfc_main);
|
|
101
|
+
export {
|
|
102
|
+
BUTTON_GROUP_CTX_KEY as B,
|
|
103
|
+
_sfc_main as _,
|
|
104
|
+
BnButton as a
|
|
105
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { defineComponent, provide, reactive, toRef, openBlock, createElementBlock, renderSlot } from "vue";
|
|
2
|
+
import { B as BUTTON_GROUP_CTX_KEY } from "./Button-CXgL_cy-.js";
|
|
3
|
+
import { w as withInstall } from "./utils-mFOE2DND.js";
|
|
4
|
+
import "@fortawesome/free-solid-svg-icons";
|
|
5
|
+
const _hoisted_1 = { class: "er-button-group" };
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...{
|
|
8
|
+
name: "BnButtonGroup"
|
|
9
|
+
},
|
|
10
|
+
__name: "ButtonGroup",
|
|
11
|
+
props: {
|
|
12
|
+
size: {},
|
|
13
|
+
type: {},
|
|
14
|
+
disabled: { type: Boolean }
|
|
15
|
+
},
|
|
16
|
+
setup(__props) {
|
|
17
|
+
const props = __props;
|
|
18
|
+
provide(
|
|
19
|
+
BUTTON_GROUP_CTX_KEY,
|
|
20
|
+
reactive({
|
|
21
|
+
size: toRef(props, "size"),
|
|
22
|
+
type: toRef(props, "type"),
|
|
23
|
+
disabled: toRef(props, "disabled")
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
return (_ctx, _cache) => {
|
|
27
|
+
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
28
|
+
renderSlot(_ctx.$slots, "default")
|
|
29
|
+
]);
|
|
30
|
+
};
|
|
31
|
+
}
|
|
32
|
+
});
|
|
33
|
+
const BnButtonGroup = withInstall(_sfc_main);
|
|
34
|
+
export {
|
|
35
|
+
BnButtonGroup as B,
|
|
36
|
+
_sfc_main as _
|
|
37
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { ref, getCurrentInstance, computed, unref, inject, provide, defineComponent, renderSlot } from "vue";
|
|
2
|
+
import { n as merge, o as n, p as o } from "./vendor-mcUuP0dl.js";
|
|
3
|
+
import { E as English } from "./locale/lang/en.js";
|
|
4
|
+
import { w as withInstall } from "./utils-mFOE2DND.js";
|
|
5
|
+
import "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
const configProviderContextKey = Symbol();
|
|
7
|
+
const globalConfig = ref();
|
|
8
|
+
function useGlobalConfig(key, defaultVal = void 0) {
|
|
9
|
+
const config = getCurrentInstance() ? inject(configProviderContextKey, globalConfig) : globalConfig;
|
|
10
|
+
return config;
|
|
11
|
+
}
|
|
12
|
+
const _createI18n = (opts) => {
|
|
13
|
+
var _a, _b, _c;
|
|
14
|
+
const mergeMsg = (msg) => merge(msg, (opts == null ? void 0 : opts.extendsI18nMsg) ?? {});
|
|
15
|
+
if (!(opts == null ? void 0 : opts.locale))
|
|
16
|
+
return o({
|
|
17
|
+
locale: "en",
|
|
18
|
+
messages: mergeMsg({
|
|
19
|
+
en: English.el
|
|
20
|
+
})
|
|
21
|
+
});
|
|
22
|
+
return o({
|
|
23
|
+
locale: ((_a = opts.locale) == null ? void 0 : _a.name) || "en",
|
|
24
|
+
messages: mergeMsg({
|
|
25
|
+
[((_b = opts.locale) == null ? void 0 : _b.name) || "en"]: ((_c = opts.locale) == null ? void 0 : _c.el) || {}
|
|
26
|
+
})
|
|
27
|
+
});
|
|
28
|
+
};
|
|
29
|
+
function provideGlobalConfig(config = { locale: English }, app, global = false) {
|
|
30
|
+
const instance = getCurrentInstance();
|
|
31
|
+
const oldConfig = instance ? useGlobalConfig() : void 0;
|
|
32
|
+
const provideFn = instance ? provide : void 0;
|
|
33
|
+
if (!provideFn) {
|
|
34
|
+
console.warn(
|
|
35
|
+
"provideGlobalConfig",
|
|
36
|
+
"provideGlobalConfig() can only be used inside setup()"
|
|
37
|
+
);
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
const context = computed(() => {
|
|
41
|
+
const cfg = unref(config);
|
|
42
|
+
if (!(oldConfig == null ? void 0 : oldConfig.value)) return cfg;
|
|
43
|
+
return merge(oldConfig.value, cfg);
|
|
44
|
+
});
|
|
45
|
+
const i18n = computed(() => {
|
|
46
|
+
return _createI18n(context.value);
|
|
47
|
+
});
|
|
48
|
+
provideFn(configProviderContextKey, context);
|
|
49
|
+
provideFn(n, { i18n: i18n.value, s: 2222 });
|
|
50
|
+
if (global || !globalConfig.value) globalConfig.value = context.value;
|
|
51
|
+
return context;
|
|
52
|
+
}
|
|
53
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
54
|
+
...{
|
|
55
|
+
name: "BnConfigProvider",
|
|
56
|
+
inheritAttrs: false
|
|
57
|
+
},
|
|
58
|
+
__name: "ConfigProvider",
|
|
59
|
+
props: {
|
|
60
|
+
locale: {},
|
|
61
|
+
extendsI18nMsg: {}
|
|
62
|
+
},
|
|
63
|
+
setup(__props) {
|
|
64
|
+
const props = __props;
|
|
65
|
+
const config = provideGlobalConfig(props);
|
|
66
|
+
return (_ctx, _cache) => {
|
|
67
|
+
return renderSlot(_ctx.$slots, "default", { config: unref(config) });
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const BnConfigProvider = withInstall(_sfc_main);
|
|
72
|
+
export {
|
|
73
|
+
BnConfigProvider as B
|
|
74
|
+
};
|
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
import { defineComponent, inject, computed, openBlock, createElementBlock, Fragment, createCommentVNode, createElementVNode, normalizeClass, unref, renderSlot, createTextVNode, toDisplayString, useSlots, ref, provide, createVNode, mergeProps, withCtx, createBlock, renderList } from "vue";
|
|
2
|
+
import { b as useId } from "./hooks-DRNrztJ_.js";
|
|
3
|
+
import { _ as _sfc_main$2 } from "./ButtonGroup-CaS3gDGZ.js";
|
|
4
|
+
import { _ as _sfc_main$3 } from "./Button-CXgL_cy-.js";
|
|
5
|
+
import { B as BnTooltip } from "./Tooltip-DSiZCd9r.js";
|
|
6
|
+
import { faAngleDown } from "@fortawesome/free-solid-svg-icons";
|
|
7
|
+
import { library } from "@fortawesome/fontawesome-svg-core";
|
|
8
|
+
import { q as omit, k as isNil } from "./vendor-mcUuP0dl.js";
|
|
9
|
+
import { w as withInstall } from "./utils-mFOE2DND.js";
|
|
10
|
+
const DROPDOWN_CTX_KEY = Symbol("dropdownContext");
|
|
11
|
+
const _hoisted_1$1 = {
|
|
12
|
+
key: 0,
|
|
13
|
+
role: "separator",
|
|
14
|
+
class: "divided-placeholder"
|
|
15
|
+
};
|
|
16
|
+
const _hoisted_2 = ["id"];
|
|
17
|
+
const _sfc_main$1 = /* @__PURE__ */ defineComponent({
|
|
18
|
+
...{
|
|
19
|
+
name: "BnDropdownItem",
|
|
20
|
+
inheritAttrs: false
|
|
21
|
+
},
|
|
22
|
+
__name: "DropdownItem",
|
|
23
|
+
props: {
|
|
24
|
+
command: { default: useId().value },
|
|
25
|
+
label: {},
|
|
26
|
+
disabled: { type: Boolean, default: false },
|
|
27
|
+
divided: { type: Boolean }
|
|
28
|
+
},
|
|
29
|
+
setup(__props) {
|
|
30
|
+
const props = __props;
|
|
31
|
+
const ctx = inject(DROPDOWN_CTX_KEY);
|
|
32
|
+
const size = computed(() => ctx == null ? void 0 : ctx.size.value);
|
|
33
|
+
function handleClick() {
|
|
34
|
+
if (props.disabled) return;
|
|
35
|
+
ctx == null ? void 0 : ctx.handleItemClick(props);
|
|
36
|
+
}
|
|
37
|
+
return (_ctx, _cache) => {
|
|
38
|
+
return openBlock(), createElementBlock(Fragment, null, [
|
|
39
|
+
__props.divided ? (openBlock(), createElementBlock("li", _hoisted_1$1)) : createCommentVNode("", true),
|
|
40
|
+
createElementVNode("li", {
|
|
41
|
+
id: `dropdown-item-${__props.command ?? unref(useId)().value}`,
|
|
42
|
+
class: normalizeClass({
|
|
43
|
+
"er-dropdown__item": true,
|
|
44
|
+
["er-dropdown__item--" + size.value]: size.value,
|
|
45
|
+
"is-disabled": __props.disabled,
|
|
46
|
+
"is-divided": __props.divided
|
|
47
|
+
}),
|
|
48
|
+
onClick: handleClick
|
|
49
|
+
}, [
|
|
50
|
+
renderSlot(_ctx.$slots, "default", {}, () => [
|
|
51
|
+
createTextVNode(toDisplayString(__props.label), 1)
|
|
52
|
+
])
|
|
53
|
+
], 10, _hoisted_2)
|
|
54
|
+
], 64);
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
const _hoisted_1 = { class: "er-dropdown__menu" };
|
|
59
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
60
|
+
...{
|
|
61
|
+
name: "BnDropdown",
|
|
62
|
+
inheritAttrs: false
|
|
63
|
+
},
|
|
64
|
+
__name: "Dropdown",
|
|
65
|
+
props: {
|
|
66
|
+
type: {},
|
|
67
|
+
size: {},
|
|
68
|
+
items: { default: () => [] },
|
|
69
|
+
hideOnClick: { type: Boolean, default: true },
|
|
70
|
+
splitButton: { type: Boolean },
|
|
71
|
+
content: {},
|
|
72
|
+
trigger: {},
|
|
73
|
+
placement: {},
|
|
74
|
+
manual: { type: Boolean },
|
|
75
|
+
disabled: { type: Boolean },
|
|
76
|
+
popperOptions: {},
|
|
77
|
+
transition: {},
|
|
78
|
+
showTimeout: {},
|
|
79
|
+
hideTimeout: {}
|
|
80
|
+
},
|
|
81
|
+
emits: ["visible-change", "command", "click"],
|
|
82
|
+
setup(__props, { expose: __expose, emit: __emit }) {
|
|
83
|
+
library.add(faAngleDown);
|
|
84
|
+
const props = __props;
|
|
85
|
+
const emits = __emit;
|
|
86
|
+
useSlots();
|
|
87
|
+
const tooltipRef = ref();
|
|
88
|
+
const triggerRef = ref();
|
|
89
|
+
const virtualRef = computed(() => {
|
|
90
|
+
var _a;
|
|
91
|
+
return ((_a = triggerRef.value) == null ? void 0 : _a.ref) ?? void 0;
|
|
92
|
+
});
|
|
93
|
+
const tooltipProps = computed(
|
|
94
|
+
() => omit(props, ["items", "hideAfterClick", "size", "type", "splitButton"])
|
|
95
|
+
);
|
|
96
|
+
function handleItemClick(e) {
|
|
97
|
+
var _a;
|
|
98
|
+
props.hideOnClick && ((_a = tooltipRef.value) == null ? void 0 : _a.hide());
|
|
99
|
+
!isNil(e.command) && emits("command", e.command);
|
|
100
|
+
}
|
|
101
|
+
provide(DROPDOWN_CTX_KEY, {
|
|
102
|
+
handleItemClick,
|
|
103
|
+
size: computed(() => props.size)
|
|
104
|
+
});
|
|
105
|
+
__expose({
|
|
106
|
+
open: () => {
|
|
107
|
+
var _a;
|
|
108
|
+
return (_a = tooltipRef.value) == null ? void 0 : _a.show();
|
|
109
|
+
},
|
|
110
|
+
close: () => {
|
|
111
|
+
var _a;
|
|
112
|
+
return (_a = tooltipRef.value) == null ? void 0 : _a.hide();
|
|
113
|
+
}
|
|
114
|
+
});
|
|
115
|
+
return (_ctx, _cache) => {
|
|
116
|
+
return openBlock(), createElementBlock("div", {
|
|
117
|
+
class: normalizeClass(["er-dropdown", { "is-disabled": props.disabled }])
|
|
118
|
+
}, [
|
|
119
|
+
createVNode(BnTooltip, mergeProps({
|
|
120
|
+
ref_key: "tooltipRef",
|
|
121
|
+
ref: tooltipRef
|
|
122
|
+
}, tooltipProps.value, {
|
|
123
|
+
"virtual-triggering": __props.splitButton,
|
|
124
|
+
"virtual-ref": virtualRef.value,
|
|
125
|
+
onVisibleChange: _cache[1] || (_cache[1] = ($event) => _ctx.$emit("visible-change", $event))
|
|
126
|
+
}), {
|
|
127
|
+
content: withCtx(() => [
|
|
128
|
+
createElementVNode("div", _hoisted_1, [
|
|
129
|
+
renderSlot(_ctx.$slots, "dropdown", {}, () => [
|
|
130
|
+
(openBlock(true), createElementBlock(Fragment, null, renderList(__props.items, (item) => {
|
|
131
|
+
return openBlock(), createBlock(_sfc_main$1, mergeProps({
|
|
132
|
+
key: item.command,
|
|
133
|
+
ref_for: true
|
|
134
|
+
}, item), null, 16);
|
|
135
|
+
}), 128))
|
|
136
|
+
])
|
|
137
|
+
])
|
|
138
|
+
]),
|
|
139
|
+
default: withCtx(() => [
|
|
140
|
+
__props.splitButton ? (openBlock(), createBlock(_sfc_main$2, {
|
|
141
|
+
key: 0,
|
|
142
|
+
type: __props.type,
|
|
143
|
+
size: __props.size,
|
|
144
|
+
disabled: __props.disabled
|
|
145
|
+
}, {
|
|
146
|
+
default: withCtx(() => [
|
|
147
|
+
createVNode(_sfc_main$3, {
|
|
148
|
+
onClick: _cache[0] || (_cache[0] = ($event) => _ctx.$emit("click", $event))
|
|
149
|
+
}, {
|
|
150
|
+
default: withCtx(() => [
|
|
151
|
+
renderSlot(_ctx.$slots, "default")
|
|
152
|
+
]),
|
|
153
|
+
_: 3
|
|
154
|
+
}),
|
|
155
|
+
createVNode(_sfc_main$3, {
|
|
156
|
+
ref_key: "triggerRef",
|
|
157
|
+
ref: triggerRef,
|
|
158
|
+
icon: "angle-down"
|
|
159
|
+
}, null, 512)
|
|
160
|
+
]),
|
|
161
|
+
_: 3
|
|
162
|
+
}, 8, ["type", "size", "disabled"])) : renderSlot(_ctx.$slots, "default", { key: 1 })
|
|
163
|
+
]),
|
|
164
|
+
_: 3
|
|
165
|
+
}, 16, ["virtual-triggering", "virtual-ref"])
|
|
166
|
+
], 2);
|
|
167
|
+
};
|
|
168
|
+
}
|
|
169
|
+
});
|
|
170
|
+
const BnDropdown = withInstall(_sfc_main);
|
|
171
|
+
const BnDropdownItem = withInstall(_sfc_main$1);
|
|
172
|
+
export {
|
|
173
|
+
BnDropdown as B,
|
|
174
|
+
BnDropdownItem as a
|
|
175
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { defineComponent, computed, openBlock, createElementBlock, mergeProps, createVNode, unref, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
+
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
|
3
|
+
import { q as omit } from "./vendor-mcUuP0dl.js";
|
|
4
|
+
import { w as withInstall } from "./utils-mFOE2DND.js";
|
|
5
|
+
import "@fortawesome/free-solid-svg-icons";
|
|
6
|
+
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
7
|
+
...{
|
|
8
|
+
name: "BnIcon",
|
|
9
|
+
inheritAttrs: false
|
|
10
|
+
},
|
|
11
|
+
__name: "Icon",
|
|
12
|
+
props: {
|
|
13
|
+
border: { type: Boolean },
|
|
14
|
+
fixedWidth: { type: Boolean },
|
|
15
|
+
flip: {},
|
|
16
|
+
icon: {},
|
|
17
|
+
mask: {},
|
|
18
|
+
listItem: { type: Boolean },
|
|
19
|
+
pull: {},
|
|
20
|
+
pulse: { type: Boolean },
|
|
21
|
+
rotation: {},
|
|
22
|
+
swapOpacity: { type: Boolean },
|
|
23
|
+
size: {},
|
|
24
|
+
spin: { type: Boolean },
|
|
25
|
+
transform: {},
|
|
26
|
+
symbol: { type: [Boolean, String] },
|
|
27
|
+
title: {},
|
|
28
|
+
inverse: { type: Boolean },
|
|
29
|
+
bounce: { type: Boolean },
|
|
30
|
+
shake: { type: Boolean },
|
|
31
|
+
beat: { type: Boolean },
|
|
32
|
+
fade: { type: Boolean },
|
|
33
|
+
beatFade: { type: Boolean },
|
|
34
|
+
spinPulse: { type: Boolean },
|
|
35
|
+
spinReverse: { type: Boolean },
|
|
36
|
+
type: {},
|
|
37
|
+
color: {}
|
|
38
|
+
},
|
|
39
|
+
setup(__props) {
|
|
40
|
+
const props = __props;
|
|
41
|
+
const filterProps = computed(() => omit(props, ["type", "color"]));
|
|
42
|
+
const customStyles = computed(() => ({ color: props.color ?? void 0 }));
|
|
43
|
+
return (_ctx, _cache) => {
|
|
44
|
+
return openBlock(), createElementBlock("i", mergeProps({
|
|
45
|
+
class: ["er-icon", [`er-icon--${__props.type}`]],
|
|
46
|
+
style: customStyles.value
|
|
47
|
+
}, _ctx.$attrs), [
|
|
48
|
+
createVNode(unref(FontAwesomeIcon), normalizeProps(guardReactiveProps(filterProps.value)), null, 16)
|
|
49
|
+
], 16);
|
|
50
|
+
};
|
|
51
|
+
}
|
|
52
|
+
});
|
|
53
|
+
const BnIcon = withInstall(_sfc_main);
|
|
54
|
+
export {
|
|
55
|
+
BnIcon as B,
|
|
56
|
+
_sfc_main as _
|
|
57
|
+
};
|