@huntflow/ui 0.0.26 → 0.0.27
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/components/button/button.vue.d.ts +4 -128
- package/dist/components/button/types.d.ts +1 -55
- package/dist/ui.es.js +113 -155
- package/dist/ui.umd.js +2 -2
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { BaseButtonProps } from './types';
|
|
2
2
|
declare function __VLS_template(): {
|
|
3
3
|
slots: {
|
|
4
4
|
leftIcon?(_: {
|
|
@@ -17,135 +17,11 @@ declare function __VLS_template(): {
|
|
|
17
17
|
attrs: Partial<{}>;
|
|
18
18
|
};
|
|
19
19
|
type __VLS_TemplateResult = ReturnType<typeof __VLS_template>;
|
|
20
|
-
declare const __VLS_component: import('vue').DefineComponent<import('vue').
|
|
21
|
-
name: {
|
|
22
|
-
type: import('vue').PropType<string>;
|
|
23
|
-
default: undefined;
|
|
24
|
-
};
|
|
25
|
-
htmlType: {
|
|
26
|
-
type: import('vue').PropType<import('./types').BaseButtonHTMLType>;
|
|
27
|
-
default: import('./types').BaseButtonHTMLType;
|
|
28
|
-
};
|
|
29
|
-
size: {
|
|
30
|
-
type: import('vue').PropType<BaseButtonSize>;
|
|
31
|
-
default: BaseButtonSize;
|
|
32
|
-
};
|
|
33
|
-
className: {
|
|
34
|
-
type: import('vue').PropType<string | undefined>;
|
|
35
|
-
default: undefined;
|
|
36
|
-
};
|
|
37
|
-
type: {
|
|
38
|
-
type: import('vue').PropType<BaseButtonType>;
|
|
39
|
-
default: BaseButtonType;
|
|
40
|
-
};
|
|
41
|
-
bordered: {
|
|
42
|
-
type: import('vue').PropType<boolean>;
|
|
43
|
-
default: undefined;
|
|
44
|
-
};
|
|
45
|
-
loading: {
|
|
46
|
-
type: import('vue').PropType<boolean>;
|
|
47
|
-
default: undefined;
|
|
48
|
-
};
|
|
49
|
-
disabled: {
|
|
50
|
-
type: import('vue').PropType<boolean>;
|
|
51
|
-
default: undefined;
|
|
52
|
-
};
|
|
53
|
-
circle: {
|
|
54
|
-
type: import('vue').PropType<boolean>;
|
|
55
|
-
default: undefined;
|
|
56
|
-
};
|
|
57
|
-
active: {
|
|
58
|
-
type: import('vue').PropType<boolean>;
|
|
59
|
-
default: undefined;
|
|
60
|
-
};
|
|
61
|
-
block: {
|
|
62
|
-
type: import('vue').PropType<boolean>;
|
|
63
|
-
default: undefined;
|
|
64
|
-
};
|
|
65
|
-
rightIcon: {
|
|
66
|
-
type: import('vue').PropType<import('vue').VNode>;
|
|
67
|
-
default: undefined;
|
|
68
|
-
};
|
|
69
|
-
leftIcon: {
|
|
70
|
-
type: import('vue').PropType<import('vue').VNode>;
|
|
71
|
-
default: undefined;
|
|
72
|
-
};
|
|
73
|
-
}>, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
20
|
+
declare const __VLS_component: import('vue').DefineComponent<BaseButtonProps, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {} & {
|
|
74
21
|
click: () => any;
|
|
75
|
-
}, string, import('vue').PublicProps, Readonly<
|
|
76
|
-
name: {
|
|
77
|
-
type: import('vue').PropType<string>;
|
|
78
|
-
default: undefined;
|
|
79
|
-
};
|
|
80
|
-
htmlType: {
|
|
81
|
-
type: import('vue').PropType<import('./types').BaseButtonHTMLType>;
|
|
82
|
-
default: import('./types').BaseButtonHTMLType;
|
|
83
|
-
};
|
|
84
|
-
size: {
|
|
85
|
-
type: import('vue').PropType<BaseButtonSize>;
|
|
86
|
-
default: BaseButtonSize;
|
|
87
|
-
};
|
|
88
|
-
className: {
|
|
89
|
-
type: import('vue').PropType<string | undefined>;
|
|
90
|
-
default: undefined;
|
|
91
|
-
};
|
|
92
|
-
type: {
|
|
93
|
-
type: import('vue').PropType<BaseButtonType>;
|
|
94
|
-
default: BaseButtonType;
|
|
95
|
-
};
|
|
96
|
-
bordered: {
|
|
97
|
-
type: import('vue').PropType<boolean>;
|
|
98
|
-
default: undefined;
|
|
99
|
-
};
|
|
100
|
-
loading: {
|
|
101
|
-
type: import('vue').PropType<boolean>;
|
|
102
|
-
default: undefined;
|
|
103
|
-
};
|
|
104
|
-
disabled: {
|
|
105
|
-
type: import('vue').PropType<boolean>;
|
|
106
|
-
default: undefined;
|
|
107
|
-
};
|
|
108
|
-
circle: {
|
|
109
|
-
type: import('vue').PropType<boolean>;
|
|
110
|
-
default: undefined;
|
|
111
|
-
};
|
|
112
|
-
active: {
|
|
113
|
-
type: import('vue').PropType<boolean>;
|
|
114
|
-
default: undefined;
|
|
115
|
-
};
|
|
116
|
-
block: {
|
|
117
|
-
type: import('vue').PropType<boolean>;
|
|
118
|
-
default: undefined;
|
|
119
|
-
};
|
|
120
|
-
rightIcon: {
|
|
121
|
-
type: import('vue').PropType<import('vue').VNode>;
|
|
122
|
-
default: undefined;
|
|
123
|
-
};
|
|
124
|
-
leftIcon: {
|
|
125
|
-
type: import('vue').PropType<import('vue').VNode>;
|
|
126
|
-
default: undefined;
|
|
127
|
-
};
|
|
128
|
-
}>> & Readonly<{
|
|
22
|
+
}, string, import('vue').PublicProps, Readonly<BaseButtonProps> & Readonly<{
|
|
129
23
|
onClick?: (() => any) | undefined;
|
|
130
|
-
}>, {
|
|
131
|
-
name: string;
|
|
132
|
-
htmlType: import('./types').BaseButtonHTMLType;
|
|
133
|
-
size: BaseButtonSize;
|
|
134
|
-
className: string | undefined;
|
|
135
|
-
type: BaseButtonType;
|
|
136
|
-
bordered: boolean;
|
|
137
|
-
loading: boolean;
|
|
138
|
-
disabled: boolean;
|
|
139
|
-
circle: boolean;
|
|
140
|
-
active: boolean;
|
|
141
|
-
block: boolean;
|
|
142
|
-
rightIcon: import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
143
|
-
[key: string]: any;
|
|
144
|
-
}>;
|
|
145
|
-
leftIcon: import('vue').VNode<import('vue').RendererNode, import('vue').RendererElement, {
|
|
146
|
-
[key: string]: any;
|
|
147
|
-
}>;
|
|
148
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
24
|
+
}>, {}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {}, any>;
|
|
149
25
|
declare const _default: __VLS_WithTemplateSlots<typeof __VLS_component, __VLS_TemplateResult["slots"]>;
|
|
150
26
|
export default _default;
|
|
151
27
|
type __VLS_WithTemplateSlots<T, S> = T & {
|
|
@@ -1,58 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const buttonProps: () => {
|
|
3
|
-
name: {
|
|
4
|
-
type: PropType<string>;
|
|
5
|
-
default: undefined;
|
|
6
|
-
};
|
|
7
|
-
htmlType: {
|
|
8
|
-
type: PropType<BaseButtonHTMLType>;
|
|
9
|
-
default: BaseButtonHTMLType;
|
|
10
|
-
};
|
|
11
|
-
size: {
|
|
12
|
-
type: PropType<BaseButtonSize>;
|
|
13
|
-
default: BaseButtonSize;
|
|
14
|
-
};
|
|
15
|
-
className: {
|
|
16
|
-
type: PropType<string | undefined>;
|
|
17
|
-
default: undefined;
|
|
18
|
-
};
|
|
19
|
-
type: {
|
|
20
|
-
type: PropType<BaseButtonType>;
|
|
21
|
-
default: BaseButtonType;
|
|
22
|
-
};
|
|
23
|
-
bordered: {
|
|
24
|
-
type: PropType<boolean>;
|
|
25
|
-
default: undefined;
|
|
26
|
-
};
|
|
27
|
-
loading: {
|
|
28
|
-
type: PropType<boolean>;
|
|
29
|
-
default: undefined;
|
|
30
|
-
};
|
|
31
|
-
disabled: {
|
|
32
|
-
type: PropType<boolean>;
|
|
33
|
-
default: undefined;
|
|
34
|
-
};
|
|
35
|
-
circle: {
|
|
36
|
-
type: PropType<boolean>;
|
|
37
|
-
default: undefined;
|
|
38
|
-
};
|
|
39
|
-
active: {
|
|
40
|
-
type: PropType<boolean>;
|
|
41
|
-
default: undefined;
|
|
42
|
-
};
|
|
43
|
-
block: {
|
|
44
|
-
type: PropType<boolean>;
|
|
45
|
-
default: undefined;
|
|
46
|
-
};
|
|
47
|
-
rightIcon: {
|
|
48
|
-
type: PropType<VNode>;
|
|
49
|
-
default: undefined;
|
|
50
|
-
};
|
|
51
|
-
leftIcon: {
|
|
52
|
-
type: PropType<VNode>;
|
|
53
|
-
default: undefined;
|
|
54
|
-
};
|
|
55
|
-
};
|
|
1
|
+
import { VNode } from 'vue';
|
|
56
2
|
export type BaseButtonProps = {
|
|
57
3
|
size?: BaseButtonSize;
|
|
58
4
|
className?: string;
|
package/dist/ui.es.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(){"use strict";var r;try{if(typeof document<"u"){var o=document.createElement("style");o.nonce=(r=document.head.querySelector("meta[property=csp-nonce]"))==null?void 0:r.content,o.appendChild(document.createTextNode("._button_den84_1{position:relative;display:inline-flex;align-items:center;font-weight:500;justify-content:center;border:none;border-radius:var(--hf-button-border-radius);cursor:pointer;transition:background-color .3s,box-shadow .3s}._button_den84_1:focus{outline:none}._primary_den84_19{color:var(--hf-button-primary-text-color);border:1px solid var(--hf-button-primary-background-color);background-color:var(--hf-button-primary-background-color)}._primary_den84_19:hover{background-color:var(--hf-button-primary-hover-background-color)}._primary_den84_19:focus{box-shadow:0 0 0 3px var(--hf-button-primary-focus-color)}._primary_den84_19._bordered_den84_34{background-color:#fff;color:var(--hf-button-primary-background-color);border:1px solid var(--hf-button-primary-background-color)}._danger_den84_40{color:var(--hf-button-danger-text-color);background-color:var(--hf-button-danger-background-color)}._danger_den84_40:hover{background-color:var(--hf-button-danger-hover-background-color)}._danger_den84_40:focus{box-shadow:0 0 0 3px var(--hf-button-danger-focus-color)}._danger_den84_40._bordered_den84_34{background-color:#fff;color:var(--hf-button-danger-background-color);border:1px solid var(--hf-button-danger-background-color)}._default_den84_59{background-color:#fff;color:var(--hf-button-default-text-color);border:1px solid var(--hf-button-default-border-color)}._default_den84_59:hover{background-color:var(--hf-button-default-hover-background-color)}._default_den84_59:focus{box-shadow:0 0 0 3px var(--hf-button-default-focus-color)}._text_den84_73{background-color:#fff;color:#000}._link_den84_78{background-color:#fff;color:#007bff;text-decoration:underline}._block_den84_84{width:100%}._disabled_den84_88{background-color:#e9ecef;color:#6c757d;cursor:not-allowed}._loading_den84_94{cursor:wait}._circle_den84_98{border-radius:100%;padding:0!important}._bordered_den84_34{border:1px solid currentColor}._icon_den84_107{display:flex;align-items:center}._iconLeft_den84_112{margin-right:8px}._iconRight_den84_116{margin-left:8px}._xs_den84_120{padding:4px 8px;font-size:12px}._s_den84_125{padding:6px 12px;font-size:14px;line-height:20px}._m_den84_131{padding:6px 12px;font-size:15px;line-height:24px}._l_den84_78{padding:16px 32px;font-size:18px}._xl_den84_142{padding:20px 40px;font-size:20px}._spinner_den84_147{display:inline-block;position:absolute;right:0;left:0;margin:0 auto;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_den84_147 .6s linear infinite}@keyframes _spin_den84_147{to{transform:rotate(360deg)}}._wrapper_hww12_1{display:flex;flex-direction:column}._label_hww12_6{margin-bottom:4px;font-size:14px;color:#333}._container_hww12_12{position:relative;display:flex;align-items:center}._input_hww12_18{flex:1;padding:8px 12px;font-size:14px;border:1px solid #ced4da;border-radius:12px;outline:none;transition:border-color .3s}._xs_hww12_28{padding:4px 8px;font-size:12px}._s_hww12_33{padding:6px 10px;font-size:13px}._m_hww12_38{padding:8px 12px;font-size:14px}._l_hww12_6{padding:10px 14px;font-size:16px}._xl_hww12_48{padding:12px 16px;font-size:18px}input:focus{border-color:#007bff}._disabled_hww12_57{background-color:#e9ecef;cursor:not-allowed}._error_hww12_62{border-color:#dc3545}._error_hww12_62{margin-top:4px;font-size:12px;color:#dc3545}._prefix_hww12_72,._suffix_hww12_73{position:absolute;display:flex;align-items:center;color:#6c757d}._prefix_hww12_72{left:8px}._suffix_hww12_73{right:8px}._loading_hww12_88{cursor:wait}._spinner_hww12_92{position:absolute;right:8px;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_hww12_92 .6s linear infinite}@keyframes _spin_hww12_92{to{transform:rotate(360deg)}}")),document.head.appendChild(o)}}catch(e){console.error("vite-plugin-css-injected-by-js",e)}})();
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const N = "_button_den84_1", E = "_primary_den84_19", R = "_bordered_den84_34", V = "_danger_den84_40", C = "_text_den84_73", X = "_link_den84_78", A = "_block_den84_84", D = "_disabled_den84_88", F = "_loading_den84_94",
|
|
2
|
+
import { defineComponent as y, computed as k, openBlock as r, createElementBlock as i, normalizeClass as l, unref as t, Fragment as I, renderSlot as _, createCommentVNode as d, mergeModels as w, useModel as M, toDisplayString as g, createElementVNode as h } from "vue";
|
|
3
|
+
const N = "_button_den84_1", E = "_primary_den84_19", R = "_bordered_den84_34", V = "_danger_den84_40", C = "_text_den84_73", X = "_link_den84_78", A = "_block_den84_84", D = "_disabled_den84_88", F = "_loading_den84_94", K = "_circle_den84_98", T = "_icon_den84_107", U = "_iconLeft_den84_112", G = "_iconRight_den84_116", P = "_xs_den84_120", Y = "_s_den84_125", j = "_m_den84_131", q = "_l_den84_78", B = "_xl_den84_142", H = "_spinner_den84_147", J = "_spin_den84_147", o = {
|
|
4
4
|
button: N,
|
|
5
5
|
primary: E,
|
|
6
6
|
bordered: R,
|
|
@@ -11,154 +11,112 @@ const N = "_button_den84_1", E = "_primary_den84_19", R = "_bordered_den84_34",
|
|
|
11
11
|
block: A,
|
|
12
12
|
disabled: D,
|
|
13
13
|
loading: F,
|
|
14
|
-
circle:
|
|
15
|
-
icon:
|
|
16
|
-
iconLeft:
|
|
17
|
-
iconRight:
|
|
14
|
+
circle: K,
|
|
15
|
+
icon: T,
|
|
16
|
+
iconLeft: U,
|
|
17
|
+
iconRight: G,
|
|
18
18
|
xs: P,
|
|
19
|
-
s:
|
|
20
|
-
m:
|
|
21
|
-
l:
|
|
22
|
-
xl:
|
|
23
|
-
spinner:
|
|
24
|
-
spin:
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
default: void 0
|
|
29
|
-
},
|
|
30
|
-
htmlType: {
|
|
31
|
-
type: String,
|
|
32
|
-
default: "button"
|
|
33
|
-
/* BUTTON */
|
|
34
|
-
},
|
|
35
|
-
size: {
|
|
36
|
-
type: String,
|
|
37
|
-
default: "m"
|
|
38
|
-
/* M */
|
|
39
|
-
},
|
|
40
|
-
className: {
|
|
41
|
-
type: String,
|
|
42
|
-
default: void 0
|
|
43
|
-
},
|
|
44
|
-
type: {
|
|
45
|
-
type: String,
|
|
46
|
-
default: "default"
|
|
47
|
-
/* DEFAULT */
|
|
48
|
-
},
|
|
49
|
-
bordered: {
|
|
50
|
-
type: Boolean,
|
|
51
|
-
default: void 0
|
|
52
|
-
},
|
|
53
|
-
loading: {
|
|
54
|
-
type: Boolean,
|
|
55
|
-
default: void 0
|
|
56
|
-
},
|
|
57
|
-
disabled: {
|
|
58
|
-
type: Boolean,
|
|
59
|
-
default: void 0
|
|
60
|
-
},
|
|
61
|
-
circle: {
|
|
62
|
-
type: Boolean,
|
|
63
|
-
default: void 0
|
|
64
|
-
},
|
|
65
|
-
active: {
|
|
66
|
-
type: Boolean,
|
|
67
|
-
default: void 0
|
|
68
|
-
},
|
|
69
|
-
block: {
|
|
70
|
-
type: Boolean,
|
|
71
|
-
default: void 0
|
|
72
|
-
},
|
|
73
|
-
rightIcon: {
|
|
74
|
-
type: Object,
|
|
75
|
-
default: void 0
|
|
76
|
-
},
|
|
77
|
-
leftIcon: {
|
|
78
|
-
type: Object,
|
|
79
|
-
default: void 0
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
var v = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))(v || {}), $ = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.DANGER = "danger", e.DEFAULT = "default", e.TEXT = "text", e.LINK = "link", e))($ || {});
|
|
83
|
-
const J = ["name", "type", "disabled"], fe = /* @__PURE__ */ h({
|
|
19
|
+
s: Y,
|
|
20
|
+
m: j,
|
|
21
|
+
l: q,
|
|
22
|
+
xl: B,
|
|
23
|
+
spinner: H,
|
|
24
|
+
spin: J
|
|
25
|
+
};
|
|
26
|
+
var $ = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))($ || {}), x = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.DANGER = "danger", e.DEFAULT = "default", e.TEXT = "text", e.LINK = "link", e))(x || {});
|
|
27
|
+
const O = ["name", "type", "disabled"], ue = /* @__PURE__ */ y({
|
|
84
28
|
name: "BaseButton",
|
|
85
29
|
__name: "button",
|
|
86
|
-
props:
|
|
30
|
+
props: {
|
|
31
|
+
size: {},
|
|
32
|
+
className: {},
|
|
33
|
+
type: {},
|
|
34
|
+
leftIcon: {},
|
|
35
|
+
rightIcon: {},
|
|
36
|
+
block: { type: Boolean },
|
|
37
|
+
disabled: { type: Boolean },
|
|
38
|
+
loading: { type: Boolean },
|
|
39
|
+
active: { type: Boolean },
|
|
40
|
+
name: {},
|
|
41
|
+
circle: { type: Boolean },
|
|
42
|
+
bordered: { type: Boolean },
|
|
43
|
+
htmlType: {}
|
|
44
|
+
},
|
|
87
45
|
emits: ["click"],
|
|
88
|
-
setup(e, { emit:
|
|
89
|
-
const n = e,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
46
|
+
setup(e, { emit: u }) {
|
|
47
|
+
const n = e, b = u, p = k(() => [
|
|
48
|
+
o.button,
|
|
49
|
+
o[n.size || $.M],
|
|
50
|
+
o[n.type || x.DEFAULT],
|
|
93
51
|
{
|
|
94
|
-
[
|
|
95
|
-
[
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
52
|
+
[o.block]: n.block,
|
|
53
|
+
[o.disabled]: n.disabled || n.loading,
|
|
54
|
+
[o.loading]: n.loading,
|
|
55
|
+
[o.active]: n.active,
|
|
56
|
+
[o.circle]: n.circle,
|
|
57
|
+
[o.bordered]: n.bordered
|
|
100
58
|
},
|
|
101
59
|
n.className
|
|
102
60
|
]);
|
|
103
|
-
return (c,
|
|
61
|
+
return (c, m) => (r(), i("button", {
|
|
104
62
|
name: n.name,
|
|
105
|
-
class:
|
|
63
|
+
class: l(p.value),
|
|
106
64
|
type: n.htmlType,
|
|
107
65
|
disabled: n.disabled || n.loading,
|
|
108
|
-
onClick:
|
|
66
|
+
onClick: m[0] || (m[0] = () => b("click"))
|
|
109
67
|
}, [
|
|
110
|
-
n.loading ? (
|
|
68
|
+
n.loading ? (r(), i("span", {
|
|
111
69
|
key: 0,
|
|
112
|
-
class: t(
|
|
113
|
-
}, null, 2)) : (
|
|
114
|
-
n.leftIcon ? (
|
|
70
|
+
class: l(t(o).spinner)
|
|
71
|
+
}, null, 2)) : (r(), i(I, { key: 1 }, [
|
|
72
|
+
n.leftIcon ? (r(), i("span", {
|
|
115
73
|
key: 0,
|
|
116
|
-
class:
|
|
74
|
+
class: l([t(o).icon, t(o).iconLeft])
|
|
117
75
|
}, [
|
|
118
76
|
_(c.$slots, "leftIcon", {
|
|
119
77
|
icon: n.leftIcon
|
|
120
78
|
})
|
|
121
|
-
], 2)) :
|
|
122
|
-
c.$slots.default ? (
|
|
79
|
+
], 2)) : d("", !0),
|
|
80
|
+
c.$slots.default ? (r(), i("span", {
|
|
123
81
|
key: 1,
|
|
124
|
-
class: t(
|
|
82
|
+
class: l(t(o).content)
|
|
125
83
|
}, [
|
|
126
84
|
_(c.$slots, "default")
|
|
127
|
-
], 2)) :
|
|
128
|
-
n.rightIcon ? (
|
|
85
|
+
], 2)) : d("", !0),
|
|
86
|
+
n.rightIcon ? (r(), i("span", {
|
|
129
87
|
key: 2,
|
|
130
|
-
class:
|
|
88
|
+
class: l([t(o).icon, t(o).iconRight])
|
|
131
89
|
}, [
|
|
132
90
|
_(c.$slots, "rightIcon", {
|
|
133
91
|
icon: n.rightIcon
|
|
134
92
|
})
|
|
135
|
-
], 2)) :
|
|
93
|
+
], 2)) : d("", !0)
|
|
136
94
|
], 64))
|
|
137
|
-
], 10,
|
|
95
|
+
], 10, O));
|
|
138
96
|
}
|
|
139
|
-
}), Q = "_wrapper_hww12_1", W = "_label_hww12_6", Z = "_container_hww12_12",
|
|
97
|
+
}), Q = "_wrapper_hww12_1", W = "_label_hww12_6", Z = "_container_hww12_12", S = "_input_hww12_18", z = "_xs_hww12_28", ee = "_s_hww12_33", ne = "_m_hww12_38", se = "_l_hww12_6", oe = "_xl_hww12_48", le = "_disabled_hww12_57", te = "_error_hww12_62", ae = "_prefix_hww12_72", re = "_suffix_hww12_73", ie = "_loading_hww12_88", de = "_spinner_hww12_92", ce = "_spin_hww12_92", a = {
|
|
140
98
|
wrapper: Q,
|
|
141
99
|
label: W,
|
|
142
100
|
container: Z,
|
|
143
|
-
input:
|
|
144
|
-
xs:
|
|
145
|
-
s:
|
|
146
|
-
m:
|
|
101
|
+
input: S,
|
|
102
|
+
xs: z,
|
|
103
|
+
s: ee,
|
|
104
|
+
m: ne,
|
|
147
105
|
l: se,
|
|
148
|
-
xl:
|
|
106
|
+
xl: oe,
|
|
149
107
|
disabled: le,
|
|
150
|
-
error:
|
|
151
|
-
prefix:
|
|
152
|
-
suffix:
|
|
153
|
-
loading:
|
|
154
|
-
spinner:
|
|
155
|
-
spin:
|
|
108
|
+
error: te,
|
|
109
|
+
prefix: ae,
|
|
110
|
+
suffix: re,
|
|
111
|
+
loading: ie,
|
|
112
|
+
spinner: de,
|
|
113
|
+
spin: ce
|
|
156
114
|
};
|
|
157
|
-
var
|
|
158
|
-
const
|
|
115
|
+
var v = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))(v || {});
|
|
116
|
+
const _e = ["for"], pe = ["id", "value", "name", "type", "disabled", "placeholder"], be = /* @__PURE__ */ y({
|
|
159
117
|
name: "BaseInput",
|
|
160
118
|
__name: "input",
|
|
161
|
-
props: /* @__PURE__ */
|
|
119
|
+
props: /* @__PURE__ */ w({
|
|
162
120
|
value: {},
|
|
163
121
|
type: {},
|
|
164
122
|
id: {},
|
|
@@ -174,16 +132,16 @@ const pe = ["for"], ue = ["id", "value", "name", "type", "disabled", "placeholde
|
|
|
174
132
|
modelValue: {},
|
|
175
133
|
modelModifiers: {}
|
|
176
134
|
}),
|
|
177
|
-
emits: /* @__PURE__ */
|
|
178
|
-
setup(e, { emit:
|
|
179
|
-
const n = e,
|
|
180
|
-
const
|
|
181
|
-
p("update:modelValue",
|
|
182
|
-
},
|
|
183
|
-
|
|
135
|
+
emits: /* @__PURE__ */ w(["update:modelValue", "enter"], ["update:modelValue"]),
|
|
136
|
+
setup(e, { emit: u }) {
|
|
137
|
+
const n = e, b = M(e, "modelValue"), p = u, c = (s) => {
|
|
138
|
+
const f = s.target;
|
|
139
|
+
p("update:modelValue", f.value);
|
|
140
|
+
}, m = (s) => {
|
|
141
|
+
s.key === "Enter" && p("enter");
|
|
184
142
|
}, L = k(() => [
|
|
185
143
|
a.input,
|
|
186
|
-
a[n.size ||
|
|
144
|
+
a[n.size || v.M],
|
|
187
145
|
{
|
|
188
146
|
[a.disabled]: n.disabled,
|
|
189
147
|
[a.error]: n.error,
|
|
@@ -191,53 +149,53 @@ const pe = ["for"], ue = ["id", "value", "name", "type", "disabled", "placeholde
|
|
|
191
149
|
},
|
|
192
150
|
n.className
|
|
193
151
|
]);
|
|
194
|
-
return (
|
|
195
|
-
class: t(
|
|
152
|
+
return (s, f) => (r(), i("div", {
|
|
153
|
+
class: l(t(a).wrapper)
|
|
196
154
|
}, [
|
|
197
|
-
|
|
155
|
+
s.label ? (r(), i("label", {
|
|
198
156
|
key: 0,
|
|
199
|
-
for:
|
|
200
|
-
class: t(
|
|
201
|
-
}, g(
|
|
202
|
-
|
|
203
|
-
class: t(
|
|
157
|
+
for: s.id,
|
|
158
|
+
class: l(t(a).label)
|
|
159
|
+
}, g(s.label), 11, _e)) : d("", !0),
|
|
160
|
+
h("div", {
|
|
161
|
+
class: l(t(a).container)
|
|
204
162
|
}, [
|
|
205
|
-
|
|
163
|
+
s.$slots.prefix ? (r(), i("span", {
|
|
206
164
|
key: 0,
|
|
207
|
-
class: t(
|
|
165
|
+
class: l(t(a).prefix)
|
|
208
166
|
}, [
|
|
209
|
-
_(
|
|
210
|
-
], 2)) :
|
|
211
|
-
|
|
212
|
-
id:
|
|
213
|
-
value:
|
|
214
|
-
name:
|
|
215
|
-
type:
|
|
216
|
-
disabled:
|
|
217
|
-
placeholder:
|
|
218
|
-
class:
|
|
167
|
+
_(s.$slots, "prefix")
|
|
168
|
+
], 2)) : d("", !0),
|
|
169
|
+
h("input", {
|
|
170
|
+
id: s.id,
|
|
171
|
+
value: b.value,
|
|
172
|
+
name: s.name,
|
|
173
|
+
type: s.type || "text",
|
|
174
|
+
disabled: s.disabled || s.loading,
|
|
175
|
+
placeholder: s.placeholder,
|
|
176
|
+
class: l(L.value),
|
|
219
177
|
onInput: c,
|
|
220
|
-
onKeydown:
|
|
221
|
-
}, null, 42,
|
|
222
|
-
|
|
178
|
+
onKeydown: m
|
|
179
|
+
}, null, 42, pe),
|
|
180
|
+
s.$slots.suffix ? (r(), i("span", {
|
|
223
181
|
key: 1,
|
|
224
|
-
class: t(
|
|
182
|
+
class: l(t(a).suffix)
|
|
225
183
|
}, [
|
|
226
|
-
_(
|
|
227
|
-
], 2)) :
|
|
228
|
-
|
|
184
|
+
_(s.$slots, "suffix")
|
|
185
|
+
], 2)) : d("", !0),
|
|
186
|
+
s.loading ? (r(), i("span", {
|
|
229
187
|
key: 2,
|
|
230
|
-
class: t(
|
|
231
|
-
}, null, 2)) :
|
|
188
|
+
class: l(t(a).spinner)
|
|
189
|
+
}, null, 2)) : d("", !0)
|
|
232
190
|
], 2),
|
|
233
|
-
|
|
191
|
+
s.error ? (r(), i("p", {
|
|
234
192
|
key: 1,
|
|
235
|
-
class: t(
|
|
236
|
-
}, g(
|
|
193
|
+
class: l(t(a).error)
|
|
194
|
+
}, g(s.error), 3)) : d("", !0)
|
|
237
195
|
], 2));
|
|
238
196
|
}
|
|
239
197
|
});
|
|
240
198
|
export {
|
|
241
|
-
|
|
199
|
+
ue as BaseButton,
|
|
242
200
|
be as BaseInput
|
|
243
201
|
};
|
package/dist/ui.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(p);const t={button:"_button_den84_1",primary:"_primary_den84_19",bordered:"_bordered_den84_34",danger:"_danger_den84_40",default:"_default_den84_59",text:"_text_den84_73",link:"_link_den84_78",block:"_block_den84_84",disabled:"_disabled_den84_88",loading:"_loading_den84_94",circle:"_circle_den84_98",icon:"_icon_den84_107",iconLeft:"_iconLeft_den84_112",iconRight:"_iconRight_den84_116",xs:"_xs_den84_120",s:"_s_den84_125",m:"_m_den84_131",l:"_l_den84_78",xl:"_xl_den84_142",spinner:"_spinner_den84_147",spin:"_spin_den84_147"}
|
|
1
|
+
(function(a,e){typeof exports=="object"&&typeof module<"u"?e(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],e):(a=typeof globalThis<"u"?globalThis:a||self,e(a.ui={},a.Vue))})(this,function(a,e){"use strict";var p=document.createElement("style");p.textContent=`._button_den84_1{position:relative;display:inline-flex;align-items:center;font-weight:500;justify-content:center;border:none;border-radius:var(--hf-button-border-radius);cursor:pointer;transition:background-color .3s,box-shadow .3s}._button_den84_1:focus{outline:none}._primary_den84_19{color:var(--hf-button-primary-text-color);border:1px solid var(--hf-button-primary-background-color);background-color:var(--hf-button-primary-background-color)}._primary_den84_19:hover{background-color:var(--hf-button-primary-hover-background-color)}._primary_den84_19:focus{box-shadow:0 0 0 3px var(--hf-button-primary-focus-color)}._primary_den84_19._bordered_den84_34{background-color:#fff;color:var(--hf-button-primary-background-color);border:1px solid var(--hf-button-primary-background-color)}._danger_den84_40{color:var(--hf-button-danger-text-color);background-color:var(--hf-button-danger-background-color)}._danger_den84_40:hover{background-color:var(--hf-button-danger-hover-background-color)}._danger_den84_40:focus{box-shadow:0 0 0 3px var(--hf-button-danger-focus-color)}._danger_den84_40._bordered_den84_34{background-color:#fff;color:var(--hf-button-danger-background-color);border:1px solid var(--hf-button-danger-background-color)}._default_den84_59{background-color:#fff;color:var(--hf-button-default-text-color);border:1px solid var(--hf-button-default-border-color)}._default_den84_59:hover{background-color:var(--hf-button-default-hover-background-color)}._default_den84_59:focus{box-shadow:0 0 0 3px var(--hf-button-default-focus-color)}._text_den84_73{background-color:#fff;color:#000}._link_den84_78{background-color:#fff;color:#007bff;text-decoration:underline}._block_den84_84{width:100%}._disabled_den84_88{background-color:#e9ecef;color:#6c757d;cursor:not-allowed}._loading_den84_94{cursor:wait}._circle_den84_98{border-radius:100%;padding:0!important}._bordered_den84_34{border:1px solid currentColor}._icon_den84_107{display:flex;align-items:center}._iconLeft_den84_112{margin-right:8px}._iconRight_den84_116{margin-left:8px}._xs_den84_120{padding:4px 8px;font-size:12px}._s_den84_125{padding:6px 12px;font-size:14px;line-height:20px}._m_den84_131{padding:6px 12px;font-size:15px;line-height:24px}._l_den84_78{padding:16px 32px;font-size:18px}._xl_den84_142{padding:20px 40px;font-size:20px}._spinner_den84_147{display:inline-block;position:absolute;right:0;left:0;margin:0 auto;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_den84_147 .6s linear infinite}@keyframes _spin_den84_147{to{transform:rotate(360deg)}}._wrapper_hww12_1{display:flex;flex-direction:column}._label_hww12_6{margin-bottom:4px;font-size:14px;color:#333}._container_hww12_12{position:relative;display:flex;align-items:center}._input_hww12_18{flex:1;padding:8px 12px;font-size:14px;border:1px solid #ced4da;border-radius:12px;outline:none;transition:border-color .3s}._xs_hww12_28{padding:4px 8px;font-size:12px}._s_hww12_33{padding:6px 10px;font-size:13px}._m_hww12_38{padding:8px 12px;font-size:14px}._l_hww12_6{padding:10px 14px;font-size:16px}._xl_hww12_48{padding:12px 16px;font-size:18px}input:focus{border-color:#007bff}._disabled_hww12_57{background-color:#e9ecef;cursor:not-allowed}._error_hww12_62{border-color:#dc3545}._error_hww12_62{margin-top:4px;font-size:12px;color:#dc3545}._prefix_hww12_72,._suffix_hww12_73{position:absolute;display:flex;align-items:center;color:#6c757d}._prefix_hww12_72{left:8px}._suffix_hww12_73{right:8px}._loading_hww12_88{cursor:wait}._spinner_hww12_92{position:absolute;right:8px;width:16px;height:16px;border:2px solid rgba(0,0,0,.2);border-top-color:#007bff;border-radius:50%;animation:_spin_hww12_92 .6s linear infinite}@keyframes _spin_hww12_92{to{transform:rotate(360deg)}}
|
|
2
|
+
/*$vite$:1*/`,document.head.appendChild(p);const t={button:"_button_den84_1",primary:"_primary_den84_19",bordered:"_bordered_den84_34",danger:"_danger_den84_40",default:"_default_den84_59",text:"_text_den84_73",link:"_link_den84_78",block:"_block_den84_84",disabled:"_disabled_den84_88",loading:"_loading_den84_94",circle:"_circle_den84_98",icon:"_icon_den84_107",iconLeft:"_iconLeft_den84_112",iconRight:"_iconRight_den84_116",xs:"_xs_den84_120",s:"_s_den84_125",m:"_m_den84_131",l:"_l_den84_78",xl:"_xl_den84_142",spinner:"_spinner_den84_147",spin:"_spin_den84_147"};var f=(o=>(o.XS="xs",o.S="s",o.M="m",o.L="l",o.XL="xl",o))(f||{}),b=(o=>(o.PRIMARY="primary",o.DANGER="danger",o.DEFAULT="default",o.TEXT="text",o.LINK="link",o))(b||{});const x=["name","type","disabled"],h=e.defineComponent({name:"BaseButton",__name:"button",props:{size:{},className:{},type:{},leftIcon:{},rightIcon:{},block:{type:Boolean},disabled:{type:Boolean},loading:{type:Boolean},active:{type:Boolean},name:{},circle:{type:Boolean},bordered:{type:Boolean},htmlType:{}},emits:["click"],setup(o,{emit:c}){const n=o,_=c,d=e.computed(()=>[t.button,t[n.size||f.M],t[n.type||b.DEFAULT],{[t.block]:n.block,[t.disabled]:n.disabled||n.loading,[t.loading]:n.loading,[t.active]:n.active,[t.circle]:n.circle,[t.bordered]:n.bordered},n.className]);return(i,s)=>(e.openBlock(),e.createElementBlock("button",{name:n.name,class:e.normalizeClass(d.value),type:n.htmlType,disabled:n.disabled||n.loading,onClick:s[0]||(s[0]=()=>_("click"))},[n.loading?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(t).spinner)},null,2)):(e.openBlock(),e.createElementBlock(e.Fragment,{key:1},[n.leftIcon?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass([e.unref(t).icon,e.unref(t).iconLeft])},[e.renderSlot(i.$slots,"leftIcon",{icon:n.leftIcon})],2)):e.createCommentVNode("",!0),i.$slots.default?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(t).content)},[e.renderSlot(i.$slots,"default")],2)):e.createCommentVNode("",!0),n.rightIcon?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass([e.unref(t).icon,e.unref(t).iconRight])},[e.renderSlot(i.$slots,"rightIcon",{icon:n.rightIcon})],2)):e.createCommentVNode("",!0)],64))],10,x))}}),l={wrapper:"_wrapper_hww12_1",label:"_label_hww12_6",container:"_container_hww12_12",input:"_input_hww12_18",xs:"_xs_hww12_28",s:"_s_hww12_33",m:"_m_hww12_38",l:"_l_hww12_6",xl:"_xl_hww12_48",disabled:"_disabled_hww12_57",error:"_error_hww12_62",prefix:"_prefix_hww12_72",suffix:"_suffix_hww12_73",loading:"_loading_hww12_88",spinner:"_spinner_hww12_92",spin:"_spin_hww12_92"};var m=(o=>(o.XS="xs",o.S="s",o.M="m",o.L="l",o.XL="xl",o))(m||{});const u=["for"],w=["id","value","name","type","disabled","placeholder"],k=e.defineComponent({name:"BaseInput",__name:"input",props:e.mergeModels({value:{},type:{},id:{},name:{},disabled:{type:Boolean},label:{},placeholder:{},loading:{type:Boolean},error:{},size:{},className:{}},{modelValue:{},modelModifiers:{}}),emits:e.mergeModels(["update:modelValue","enter"],["update:modelValue"]),setup(o,{emit:c}){const n=o,_=e.useModel(o,"modelValue"),d=c,i=r=>{const g=r.target;d("update:modelValue",g.value)},s=r=>{r.key==="Enter"&&d("enter")},y=e.computed(()=>[l.input,l[n.size||m.M],{[l.disabled]:n.disabled,[l.error]:n.error,[l.loading]:n.loading},n.className]);return(r,g)=>(e.openBlock(),e.createElementBlock("div",{class:e.normalizeClass(e.unref(l).wrapper)},[r.label?(e.openBlock(),e.createElementBlock("label",{key:0,for:r.id,class:e.normalizeClass(e.unref(l).label)},e.toDisplayString(r.label),11,u)):e.createCommentVNode("",!0),e.createElementVNode("div",{class:e.normalizeClass(e.unref(l).container)},[r.$slots.prefix?(e.openBlock(),e.createElementBlock("span",{key:0,class:e.normalizeClass(e.unref(l).prefix)},[e.renderSlot(r.$slots,"prefix")],2)):e.createCommentVNode("",!0),e.createElementVNode("input",{id:r.id,value:_.value,name:r.name,type:r.type||"text",disabled:r.disabled||r.loading,placeholder:r.placeholder,class:e.normalizeClass(y.value),onInput:i,onKeydown:s},null,42,w),r.$slots.suffix?(e.openBlock(),e.createElementBlock("span",{key:1,class:e.normalizeClass(e.unref(l).suffix)},[e.renderSlot(r.$slots,"suffix")],2)):e.createCommentVNode("",!0),r.loading?(e.openBlock(),e.createElementBlock("span",{key:2,class:e.normalizeClass(e.unref(l).spinner)},null,2)):e.createCommentVNode("",!0)],2),r.error?(e.openBlock(),e.createElementBlock("p",{key:1,class:e.normalizeClass(e.unref(l).error)},e.toDisplayString(r.error),3)):e.createCommentVNode("",!0)],2))}});a.BaseButton=h,a.BaseInput=k,Object.defineProperty(a,Symbol.toStringTag,{value:"Module"})});
|