bani-ui 1.0.2-alpha.0 → 1.0.2-alpha.2
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/package.json +8 -3
- package/dist/es/Button-Bwc0dTzv.js +0 -102
- package/dist/es/ButtonGroup-C4UHHgrM.js +0 -35
- package/dist/es/Icon-CseJvWyQ.js +0 -56
- package/dist/es/index.js +0 -12
- package/dist/es/utils-B5aZ4w8w.js +0 -16
- package/dist/es/vendor-BkjRo-uZ.js +0 -1176
- package/dist/index.css +0 -1
- package/dist/theme/Button.css +0 -304
- package/dist/theme/ButtonGroup.css +0 -46
- package/dist/theme/Icon.css +0 -25
- package/dist/theme/index.css +0 -197
- package/dist/types/components/Button/constants.d.ts +0 -3
- package/dist/types/components/Button/index.d.ts +0 -57
- package/dist/types/components/Button/types.d.ts +0 -34
- package/dist/types/components/ButtonGroup/index.d.ts +0 -17
- package/dist/types/components/ButtonGroup/types.d.ts +0 -6
- package/dist/types/components/Icon/index.d.ts +0 -13
- package/dist/types/components/Icon/types.d.ts +0 -28
- package/dist/types/components/index.d.ts +0 -3
- package/dist/types/core/index.d.ts +0 -3
- package/dist/types/utils/index.d.ts +0 -1
- package/dist/types/utils/install.d.ts +0 -5
- package/dist/umd/index.css +0 -1
- package/dist/umd/index.css.br +0 -0
- package/dist/umd/index.css.gz +0 -0
- package/dist/umd/index.umd.cjs +0 -567
- package/dist/umd/index.umd.cjs.br +0 -0
- package/dist/umd/index.umd.cjs.gz +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bani-ui",
|
|
3
|
-
"version": "1.0.2-alpha.
|
|
3
|
+
"version": "1.0.2-alpha.2",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Components library by Vue3 + TS",
|
|
6
6
|
"main": "./dist/umd/index.umd.cjs",
|
|
@@ -11,9 +11,9 @@
|
|
|
11
11
|
],
|
|
12
12
|
"exports": {
|
|
13
13
|
".": {
|
|
14
|
+
"types": "./dist/types/core/index.d.ts",
|
|
14
15
|
"import": "./dist/es/index.js",
|
|
15
|
-
"require": "./dist/umd/index.umd.cjs"
|
|
16
|
-
"types": "./dist/types/core/index.d.ts"
|
|
16
|
+
"require": "./dist/umd/index.umd.cjs"
|
|
17
17
|
},
|
|
18
18
|
"./dist/": {
|
|
19
19
|
"import": "./dist/",
|
|
@@ -36,6 +36,11 @@
|
|
|
36
36
|
"@bani/theme": "1.0.0",
|
|
37
37
|
"@bani/utils": "1.0.0"
|
|
38
38
|
},
|
|
39
|
+
"dependencies": {
|
|
40
|
+
"@fortawesome/fontawesome-svg-core": "^7.2.0",
|
|
41
|
+
"@fortawesome/free-solid-svg-icons": "^7.2.0",
|
|
42
|
+
"@fortawesome/vue-fontawesome": "^3.2.0"
|
|
43
|
+
},
|
|
39
44
|
"peerDependencies": {
|
|
40
45
|
"vue": "^3.4.19"
|
|
41
46
|
},
|
|
@@ -1,102 +0,0 @@
|
|
|
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-CseJvWyQ.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-BkjRo-uZ.js";
|
|
6
|
-
import { w as withInstall } from "./utils-B5aZ4w8w.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
|
-
ref: _ref,
|
|
53
|
-
disabled,
|
|
54
|
-
size,
|
|
55
|
-
type
|
|
56
|
-
});
|
|
57
|
-
return (_ctx, _cache) => {
|
|
58
|
-
return openBlock(), createBlock(resolveDynamicComponent(props.tag), {
|
|
59
|
-
ref_key: "_ref",
|
|
60
|
-
ref: _ref,
|
|
61
|
-
class: normalizeClass(["er-button", {
|
|
62
|
-
[`er-button--${type.value}`]: type.value,
|
|
63
|
-
[`er-button--${size.value}`]: size.value,
|
|
64
|
-
"is-plain": __props.plain,
|
|
65
|
-
"is-round": __props.round,
|
|
66
|
-
"is-circle": __props.circle,
|
|
67
|
-
"is-disabled": disabled.value,
|
|
68
|
-
"is-loading": __props.loading
|
|
69
|
-
}]),
|
|
70
|
-
autofocus: __props.autofocus,
|
|
71
|
-
type: __props.tag === "button" ? __props.nativeType : void 0,
|
|
72
|
-
disabled: disabled.value || __props.loading,
|
|
73
|
-
onClick: _cache[0] || (_cache[0] = (e) => __props.useThrottle ? unref(handleBthClickThrottle)(e) : handleBthClick(e))
|
|
74
|
-
}, {
|
|
75
|
-
default: withCtx(() => [
|
|
76
|
-
__props.loading ? renderSlot(_ctx.$slots, "loading", { key: 0 }, () => [
|
|
77
|
-
createVNode(_sfc_main$1, {
|
|
78
|
-
class: "loading-icon",
|
|
79
|
-
icon: __props.loadingIcon ?? unref(faSpinner),
|
|
80
|
-
style: normalizeStyle(iconStyle.value),
|
|
81
|
-
size: "1x",
|
|
82
|
-
spin: ""
|
|
83
|
-
}, null, 8, ["icon", "style"])
|
|
84
|
-
]) : createCommentVNode("", true),
|
|
85
|
-
__props.icon && !__props.loading ? (openBlock(), createBlock(_sfc_main$1, {
|
|
86
|
-
key: 1,
|
|
87
|
-
icon: __props.icon,
|
|
88
|
-
size: "1x",
|
|
89
|
-
style: normalizeStyle(iconStyle.value)
|
|
90
|
-
}, null, 8, ["icon", "style"])) : createCommentVNode("", true),
|
|
91
|
-
renderSlot(_ctx.$slots, "default")
|
|
92
|
-
]),
|
|
93
|
-
_: 3
|
|
94
|
-
}, 8, ["autofocus", "type", "disabled", "class"]);
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
});
|
|
98
|
-
const BnButton = withInstall(_sfc_main);
|
|
99
|
-
export {
|
|
100
|
-
BUTTON_GROUP_CTX_KEY as B,
|
|
101
|
-
BnButton as a
|
|
102
|
-
};
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import { defineComponent, provide, reactive, toRef, openBlock, createElementBlock, renderSlot } from "vue";
|
|
2
|
-
import { B as BUTTON_GROUP_CTX_KEY } from "./Button-Bwc0dTzv.js";
|
|
3
|
-
import { w as withInstall } from "./utils-B5aZ4w8w.js";
|
|
4
|
-
const _hoisted_1 = { class: "er-button-group" };
|
|
5
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
-
...{
|
|
7
|
-
name: "BnButtonGroup"
|
|
8
|
-
},
|
|
9
|
-
__name: "ButtonGroup",
|
|
10
|
-
props: {
|
|
11
|
-
size: {},
|
|
12
|
-
type: {},
|
|
13
|
-
disabled: { type: Boolean }
|
|
14
|
-
},
|
|
15
|
-
setup(__props) {
|
|
16
|
-
const props = __props;
|
|
17
|
-
provide(
|
|
18
|
-
BUTTON_GROUP_CTX_KEY,
|
|
19
|
-
reactive({
|
|
20
|
-
size: toRef(props, "size"),
|
|
21
|
-
type: toRef(props, "type"),
|
|
22
|
-
disabled: toRef(props, "disabled")
|
|
23
|
-
})
|
|
24
|
-
);
|
|
25
|
-
return (_ctx, _cache) => {
|
|
26
|
-
return openBlock(), createElementBlock("div", _hoisted_1, [
|
|
27
|
-
renderSlot(_ctx.$slots, "default")
|
|
28
|
-
]);
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
});
|
|
32
|
-
const BnButtonGroup = withInstall(_sfc_main);
|
|
33
|
-
export {
|
|
34
|
-
BnButtonGroup as B
|
|
35
|
-
};
|
package/dist/es/Icon-CseJvWyQ.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import { defineComponent, computed, openBlock, createElementBlock, mergeProps, createVNode, unref, normalizeProps, guardReactiveProps } from "vue";
|
|
2
|
-
import { FontAwesomeIcon } from "@fortawesome/vue-fontawesome";
|
|
3
|
-
import { o as omit } from "./vendor-BkjRo-uZ.js";
|
|
4
|
-
import { w as withInstall } from "./utils-B5aZ4w8w.js";
|
|
5
|
-
const _sfc_main = /* @__PURE__ */ defineComponent({
|
|
6
|
-
...{
|
|
7
|
-
name: "BnIcon",
|
|
8
|
-
inheritAttrs: false
|
|
9
|
-
},
|
|
10
|
-
__name: "Icon",
|
|
11
|
-
props: {
|
|
12
|
-
border: { type: Boolean },
|
|
13
|
-
fixedWidth: { type: Boolean },
|
|
14
|
-
flip: {},
|
|
15
|
-
icon: {},
|
|
16
|
-
mask: {},
|
|
17
|
-
listItem: { type: Boolean },
|
|
18
|
-
pull: {},
|
|
19
|
-
pulse: { type: Boolean },
|
|
20
|
-
rotation: {},
|
|
21
|
-
swapOpacity: { type: Boolean },
|
|
22
|
-
size: {},
|
|
23
|
-
spin: { type: Boolean },
|
|
24
|
-
transform: {},
|
|
25
|
-
symbol: { type: [Boolean, String] },
|
|
26
|
-
title: {},
|
|
27
|
-
inverse: { type: Boolean },
|
|
28
|
-
bounce: { type: Boolean },
|
|
29
|
-
shake: { type: Boolean },
|
|
30
|
-
beat: { type: Boolean },
|
|
31
|
-
fade: { type: Boolean },
|
|
32
|
-
beatFade: { type: Boolean },
|
|
33
|
-
spinPulse: { type: Boolean },
|
|
34
|
-
spinReverse: { type: Boolean },
|
|
35
|
-
type: {},
|
|
36
|
-
color: {}
|
|
37
|
-
},
|
|
38
|
-
setup(__props) {
|
|
39
|
-
const props = __props;
|
|
40
|
-
const filterProps = computed(() => omit(props, ["type", "color"]));
|
|
41
|
-
const customStyles = computed(() => ({ color: props.color ?? void 0 }));
|
|
42
|
-
return (_ctx, _cache) => {
|
|
43
|
-
return openBlock(), createElementBlock("i", mergeProps({
|
|
44
|
-
class: ["er-icon", [`er-icon--${__props.type}`]],
|
|
45
|
-
style: customStyles.value
|
|
46
|
-
}, _ctx.$attrs), [
|
|
47
|
-
createVNode(unref(FontAwesomeIcon), normalizeProps(guardReactiveProps(filterProps.value)), null, 16)
|
|
48
|
-
], 16);
|
|
49
|
-
};
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
const BnIcon = withInstall(_sfc_main);
|
|
53
|
-
export {
|
|
54
|
-
BnIcon as B,
|
|
55
|
-
_sfc_main as _
|
|
56
|
-
};
|
package/dist/es/index.js
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { m as makeInstaller } from "./utils-B5aZ4w8w.js";
|
|
2
|
-
import { a as BnButton } from "./Button-Bwc0dTzv.js";
|
|
3
|
-
import { B as BnButtonGroup } from "./ButtonGroup-C4UHHgrM.js";
|
|
4
|
-
import { B as BnIcon } from "./Icon-CseJvWyQ.js";
|
|
5
|
-
const components = [BnButton, BnButtonGroup, BnIcon];
|
|
6
|
-
const installer = makeInstaller(components);
|
|
7
|
-
export {
|
|
8
|
-
BnButton,
|
|
9
|
-
BnButtonGroup,
|
|
10
|
-
BnIcon,
|
|
11
|
-
installer as default
|
|
12
|
-
};
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import { f as forEach } from "./vendor-BkjRo-uZ.js";
|
|
2
|
-
function makeInstaller(components) {
|
|
3
|
-
const install = (app) => forEach(components, (c) => app.use(c));
|
|
4
|
-
return install;
|
|
5
|
-
}
|
|
6
|
-
const withInstall = (component) => {
|
|
7
|
-
component.install = (app) => {
|
|
8
|
-
const name = component.name;
|
|
9
|
-
app.component(name, component);
|
|
10
|
-
};
|
|
11
|
-
return component;
|
|
12
|
-
};
|
|
13
|
-
export {
|
|
14
|
-
makeInstaller as m,
|
|
15
|
-
withInstall as w
|
|
16
|
-
};
|