@huntflow/ui 0.0.36 → 0.0.38
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/base-button/button.vue.d.ts +1 -1
- package/dist/components/base-button/index.d.ts +1 -0
- package/dist/components/base-input/index.d.ts +3 -0
- package/dist/components/base-input/input.vue.d.ts +48 -0
- package/dist/components/{input → base-input}/types.d.ts +4 -4
- package/dist/components/index.d.ts +3 -1
- package/dist/ui.es.js +212 -68
- package/dist/ui.umd.js +2 -2
- package/package.json +1 -1
|
@@ -37,9 +37,9 @@ declare const _default: import('vue').DefineComponent<{
|
|
|
37
37
|
onClick?: ((...args: any[]) => any) | undefined;
|
|
38
38
|
}>, {
|
|
39
39
|
name: string;
|
|
40
|
-
type: BaseButtonType;
|
|
41
40
|
size: BaseButtonSize;
|
|
42
41
|
className: string;
|
|
42
|
+
type: BaseButtonType;
|
|
43
43
|
leftIcon: Record<string, any>;
|
|
44
44
|
rightIcon: Record<string, any>;
|
|
45
45
|
block: boolean;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { BaseInputSize, BaseInputType } from './types.ts';
|
|
2
|
+
declare const _default: import('vue').DefineComponent<{
|
|
3
|
+
value: string;
|
|
4
|
+
type?: BaseInputType | undefined;
|
|
5
|
+
id?: string | undefined;
|
|
6
|
+
name?: string | undefined;
|
|
7
|
+
disabled?: boolean | undefined;
|
|
8
|
+
label?: string | undefined;
|
|
9
|
+
placeholder?: string | undefined;
|
|
10
|
+
loading?: boolean | undefined;
|
|
11
|
+
error?: string | null | void;
|
|
12
|
+
size?: BaseInputSize | undefined;
|
|
13
|
+
className?: string | undefined;
|
|
14
|
+
}, {
|
|
15
|
+
styles: CSSModuleClasses;
|
|
16
|
+
onInput: () => void;
|
|
17
|
+
onKeydown: (event: KeyboardEvent) => void;
|
|
18
|
+
inputClass: import('vue').ComputedRef<(string | {
|
|
19
|
+
[x: string]: string | boolean | void | null;
|
|
20
|
+
} | undefined)[]>;
|
|
21
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, ("update:value" | "enter")[], "update:value" | "enter", import('vue').PublicProps, Readonly<{
|
|
22
|
+
value: string;
|
|
23
|
+
type?: BaseInputType | undefined;
|
|
24
|
+
id?: string | undefined;
|
|
25
|
+
name?: string | undefined;
|
|
26
|
+
disabled?: boolean | undefined;
|
|
27
|
+
label?: string | undefined;
|
|
28
|
+
placeholder?: string | undefined;
|
|
29
|
+
loading?: boolean | undefined;
|
|
30
|
+
error?: string | null | void;
|
|
31
|
+
size?: BaseInputSize | undefined;
|
|
32
|
+
className?: string | undefined;
|
|
33
|
+
}> & Readonly<{
|
|
34
|
+
"onUpdate:value"?: ((...args: any[]) => any) | undefined;
|
|
35
|
+
onEnter?: ((...args: any[]) => any) | undefined;
|
|
36
|
+
}>, {
|
|
37
|
+
name: string;
|
|
38
|
+
size: BaseInputSize;
|
|
39
|
+
className: string;
|
|
40
|
+
type: BaseInputType;
|
|
41
|
+
disabled: boolean;
|
|
42
|
+
loading: boolean;
|
|
43
|
+
label: string;
|
|
44
|
+
id: string;
|
|
45
|
+
placeholder: string;
|
|
46
|
+
error: string;
|
|
47
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {}, any>;
|
|
48
|
+
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export type BaseInputProps = {
|
|
2
2
|
value: string;
|
|
3
|
-
type?:
|
|
3
|
+
type?: BaseInputType;
|
|
4
4
|
id?: string;
|
|
5
5
|
name?: string;
|
|
6
6
|
disabled?: boolean;
|
|
@@ -8,17 +8,17 @@ export type BaseInputProps = {
|
|
|
8
8
|
placeholder?: string;
|
|
9
9
|
loading?: boolean;
|
|
10
10
|
error?: string | null | void;
|
|
11
|
-
size?:
|
|
11
|
+
size?: BaseInputSize;
|
|
12
12
|
className?: string;
|
|
13
13
|
};
|
|
14
|
-
export declare enum
|
|
14
|
+
export declare enum BaseInputSize {
|
|
15
15
|
XS = "xs",
|
|
16
16
|
S = "s",
|
|
17
17
|
M = "m",
|
|
18
18
|
L = "l",
|
|
19
19
|
XL = "xl"
|
|
20
20
|
}
|
|
21
|
-
export declare enum
|
|
21
|
+
export declare enum BaseInputType {
|
|
22
22
|
TEXT = "text",
|
|
23
23
|
PASSWORD = "password",
|
|
24
24
|
EMAIL = "email",
|
package/dist/ui.es.js
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
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)}}")),document.head.appendChild(o)}}catch(
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const
|
|
4
|
-
button:
|
|
5
|
-
primary:
|
|
6
|
-
bordered:
|
|
7
|
-
danger:
|
|
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 w, computed as h, openBlock as l, createElementBlock as t, normalizeClass as s, Fragment as S, renderSlot as f, createCommentVNode as r, toDisplayString as g, createElementVNode as m } from "vue";
|
|
3
|
+
const E = "_button_den84_1", L = "_primary_den84_19", q = "_bordered_den84_34", C = "_danger_den84_40", I = "_text_den84_73", N = "_link_den84_78", R = "_block_den84_84", A = "_disabled_den84_88", M = "_loading_den84_94", X = "_circle_den84_98", D = "_icon_den84_107", O = "_iconLeft_den84_112", T = "_iconRight_den84_116", U = "_xs_den84_120", K = "_s_den84_125", F = "_m_den84_131", j = "_l_den84_78", P = "_xl_den84_142", V = "_spinner_den84_147", G = "_spin_den84_147", o = {
|
|
4
|
+
button: E,
|
|
5
|
+
primary: L,
|
|
6
|
+
bordered: q,
|
|
7
|
+
danger: C,
|
|
8
8
|
default: "_default_den84_59",
|
|
9
9
|
text: I,
|
|
10
|
-
link:
|
|
11
|
-
block:
|
|
12
|
-
disabled:
|
|
13
|
-
loading:
|
|
14
|
-
circle:
|
|
15
|
-
icon:
|
|
16
|
-
iconLeft:
|
|
17
|
-
iconRight:
|
|
18
|
-
xs:
|
|
19
|
-
s:
|
|
20
|
-
m:
|
|
21
|
-
l:
|
|
22
|
-
xl:
|
|
23
|
-
spinner:
|
|
24
|
-
spin:
|
|
10
|
+
link: N,
|
|
11
|
+
block: R,
|
|
12
|
+
disabled: A,
|
|
13
|
+
loading: M,
|
|
14
|
+
circle: X,
|
|
15
|
+
icon: D,
|
|
16
|
+
iconLeft: O,
|
|
17
|
+
iconRight: T,
|
|
18
|
+
xs: U,
|
|
19
|
+
s: K,
|
|
20
|
+
m: F,
|
|
21
|
+
l: j,
|
|
22
|
+
xl: P,
|
|
23
|
+
spinner: V,
|
|
24
|
+
spin: G
|
|
25
25
|
};
|
|
26
|
-
var
|
|
27
|
-
const
|
|
26
|
+
var p = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))(p || {}), y = /* @__PURE__ */ ((e) => (e.PRIMARY = "primary", e.DANGER = "danger", e.DEFAULT = "default", e.TEXT = "text", e.LINK = "link", e))(y || {}), k = /* @__PURE__ */ ((e) => (e.SUBMIT = "submit", e.BUTTON = "button", e.RESET = "reset", e))(k || {});
|
|
27
|
+
const W = w({
|
|
28
28
|
name: "BaseButton",
|
|
29
29
|
props: {
|
|
30
30
|
name: {
|
|
@@ -34,7 +34,7 @@ const X = y({
|
|
|
34
34
|
},
|
|
35
35
|
size: {
|
|
36
36
|
type: String,
|
|
37
|
-
default:
|
|
37
|
+
default: p.M
|
|
38
38
|
},
|
|
39
39
|
className: {
|
|
40
40
|
type: String,
|
|
@@ -43,7 +43,7 @@ const X = y({
|
|
|
43
43
|
},
|
|
44
44
|
type: {
|
|
45
45
|
type: String,
|
|
46
|
-
default:
|
|
46
|
+
default: y.DEFAULT
|
|
47
47
|
},
|
|
48
48
|
leftIcon: {
|
|
49
49
|
type: Object,
|
|
@@ -81,72 +81,216 @@ const X = y({
|
|
|
81
81
|
},
|
|
82
82
|
htmlType: {
|
|
83
83
|
type: String,
|
|
84
|
-
default:
|
|
84
|
+
default: k.BUTTON
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
87
|
emits: ["click"],
|
|
88
|
-
setup(e, { emit:
|
|
88
|
+
setup(e, { emit: n }) {
|
|
89
89
|
return {
|
|
90
|
-
classList:
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
90
|
+
classList: h(() => [
|
|
91
|
+
o.button,
|
|
92
|
+
o[e.size || p.M],
|
|
93
|
+
o[e.type || y.DEFAULT],
|
|
94
94
|
{
|
|
95
|
-
[
|
|
96
|
-
[
|
|
97
|
-
[
|
|
98
|
-
[
|
|
99
|
-
[
|
|
100
|
-
[
|
|
95
|
+
[o.block]: e.block,
|
|
96
|
+
[o.disabled]: e.disabled || e.loading,
|
|
97
|
+
[o.loading]: e.loading,
|
|
98
|
+
[o.active]: e.active,
|
|
99
|
+
[o.circle]: e.circle,
|
|
100
|
+
[o.bordered]: e.bordered
|
|
101
101
|
},
|
|
102
102
|
e.className
|
|
103
103
|
]),
|
|
104
104
|
handleClick: () => {
|
|
105
|
-
|
|
105
|
+
n("click");
|
|
106
106
|
},
|
|
107
|
-
styles:
|
|
107
|
+
styles: o
|
|
108
108
|
};
|
|
109
109
|
}
|
|
110
|
-
}),
|
|
111
|
-
const
|
|
112
|
-
for (const [i,
|
|
113
|
-
|
|
114
|
-
return
|
|
115
|
-
},
|
|
116
|
-
function
|
|
117
|
-
return l(),
|
|
110
|
+
}), $ = (e, n) => {
|
|
111
|
+
const a = e.__vccOpts || e;
|
|
112
|
+
for (const [i, c] of n)
|
|
113
|
+
a[i] = c;
|
|
114
|
+
return a;
|
|
115
|
+
}, Y = ["name", "type", "disabled"];
|
|
116
|
+
function J(e, n, a, i, c, _) {
|
|
117
|
+
return l(), t("button", {
|
|
118
118
|
name: e.name,
|
|
119
|
-
class:
|
|
119
|
+
class: s(e.classList),
|
|
120
120
|
type: e.htmlType,
|
|
121
121
|
disabled: e.disabled || e.loading,
|
|
122
|
-
onClick:
|
|
122
|
+
onClick: n[0] || (n[0] = (...u) => e.handleClick && e.handleClick(...u))
|
|
123
123
|
}, [
|
|
124
|
-
e.loading ? (l(),
|
|
124
|
+
e.loading ? (l(), t("span", {
|
|
125
125
|
key: 0,
|
|
126
|
-
class:
|
|
127
|
-
}, null, 2)) : (l(),
|
|
128
|
-
e.leftIcon ? (l(),
|
|
126
|
+
class: s(e.styles.spinner)
|
|
127
|
+
}, null, 2)) : (l(), t(S, { key: 1 }, [
|
|
128
|
+
e.leftIcon ? (l(), t("span", {
|
|
129
129
|
key: 0,
|
|
130
|
-
class:
|
|
130
|
+
class: s([e.styles.icon, e.styles.iconLeft])
|
|
131
131
|
}, [
|
|
132
|
-
|
|
133
|
-
], 2)) :
|
|
134
|
-
e.$slots.default ? (l(),
|
|
132
|
+
f(e.$slots, "leftIcon", { icon: e.leftIcon })
|
|
133
|
+
], 2)) : r("", !0),
|
|
134
|
+
e.$slots.default ? (l(), t("span", {
|
|
135
135
|
key: 1,
|
|
136
|
-
class:
|
|
136
|
+
class: s(e.styles.content)
|
|
137
137
|
}, [
|
|
138
|
-
|
|
139
|
-
], 2)) :
|
|
140
|
-
e.rightIcon ? (l(),
|
|
138
|
+
f(e.$slots, "default")
|
|
139
|
+
], 2)) : r("", !0),
|
|
140
|
+
e.rightIcon ? (l(), t("span", {
|
|
141
141
|
key: 2,
|
|
142
|
-
class:
|
|
142
|
+
class: s([e.styles.icon, e.styles.iconRight])
|
|
143
143
|
}, [
|
|
144
|
-
|
|
145
|
-
], 2)) :
|
|
144
|
+
f(e.$slots, "rightIcon", { icon: e.rightIcon })
|
|
145
|
+
], 2)) : r("", !0)
|
|
146
146
|
], 64))
|
|
147
|
-
], 10,
|
|
147
|
+
], 10, Y);
|
|
148
148
|
}
|
|
149
|
-
const
|
|
149
|
+
const ye = /* @__PURE__ */ $(W, [["render", J]]), Q = "_wrapper_hww12_1", Z = "_label_hww12_6", H = "_container_hww12_12", z = "_input_hww12_18", B = "_xs_hww12_28", x = "_s_hww12_33", ee = "_m_hww12_38", ne = "_l_hww12_6", se = "_xl_hww12_48", le = "_disabled_hww12_57", te = "_error_hww12_62", oe = "_prefix_hww12_72", re = "_suffix_hww12_73", ae = "_loading_hww12_88", ie = "_spinner_hww12_92", de = "_spin_hww12_92", d = {
|
|
150
|
+
wrapper: Q,
|
|
151
|
+
label: Z,
|
|
152
|
+
container: H,
|
|
153
|
+
input: z,
|
|
154
|
+
xs: B,
|
|
155
|
+
s: x,
|
|
156
|
+
m: ee,
|
|
157
|
+
l: ne,
|
|
158
|
+
xl: se,
|
|
159
|
+
disabled: le,
|
|
160
|
+
error: te,
|
|
161
|
+
prefix: oe,
|
|
162
|
+
suffix: re,
|
|
163
|
+
loading: ae,
|
|
164
|
+
spinner: ie,
|
|
165
|
+
spin: de
|
|
166
|
+
};
|
|
167
|
+
var b = /* @__PURE__ */ ((e) => (e.XS = "xs", e.S = "s", e.M = "m", e.L = "l", e.XL = "xl", e))(b || {}), v = /* @__PURE__ */ ((e) => (e.TEXT = "text", e.PASSWORD = "password", e.EMAIL = "email", e.TEL = "tel", e.SEARCH = "search", e))(v || {});
|
|
168
|
+
const ce = w({
|
|
169
|
+
name: "BaseInput",
|
|
170
|
+
props: {
|
|
171
|
+
value: {
|
|
172
|
+
type: String,
|
|
173
|
+
required: !0
|
|
174
|
+
},
|
|
175
|
+
type: {
|
|
176
|
+
type: String,
|
|
177
|
+
default: v.TEXT
|
|
178
|
+
},
|
|
179
|
+
id: {
|
|
180
|
+
type: String,
|
|
181
|
+
required: !1,
|
|
182
|
+
default: void 0
|
|
183
|
+
},
|
|
184
|
+
name: {
|
|
185
|
+
type: String,
|
|
186
|
+
required: !1,
|
|
187
|
+
default: void 0
|
|
188
|
+
},
|
|
189
|
+
disabled: {
|
|
190
|
+
type: Boolean,
|
|
191
|
+
default: !1
|
|
192
|
+
},
|
|
193
|
+
label: {
|
|
194
|
+
type: String,
|
|
195
|
+
required: !1,
|
|
196
|
+
default: void 0
|
|
197
|
+
},
|
|
198
|
+
placeholder: {
|
|
199
|
+
type: String,
|
|
200
|
+
required: !1,
|
|
201
|
+
default: void 0
|
|
202
|
+
},
|
|
203
|
+
loading: {
|
|
204
|
+
type: Boolean,
|
|
205
|
+
default: !1
|
|
206
|
+
},
|
|
207
|
+
error: {
|
|
208
|
+
type: String,
|
|
209
|
+
required: !1,
|
|
210
|
+
default: void 0
|
|
211
|
+
},
|
|
212
|
+
size: {
|
|
213
|
+
type: String,
|
|
214
|
+
default: b.M
|
|
215
|
+
},
|
|
216
|
+
className: {
|
|
217
|
+
type: String,
|
|
218
|
+
required: !1,
|
|
219
|
+
default: void 0
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
emits: ["update:value", "enter"],
|
|
223
|
+
setup(e, { emit: n }) {
|
|
224
|
+
const a = () => {
|
|
225
|
+
n("update:value");
|
|
226
|
+
}, i = (_) => {
|
|
227
|
+
_.key === "Enter" && n("enter");
|
|
228
|
+
}, c = h(() => [
|
|
229
|
+
d.input,
|
|
230
|
+
d[e.size || b.M],
|
|
231
|
+
{
|
|
232
|
+
[d.disabled]: e.disabled,
|
|
233
|
+
[d.error]: e.error,
|
|
234
|
+
[d.loading]: e.loading
|
|
235
|
+
},
|
|
236
|
+
e.className
|
|
237
|
+
]);
|
|
238
|
+
return {
|
|
239
|
+
styles: d,
|
|
240
|
+
onInput: a,
|
|
241
|
+
onKeydown: i,
|
|
242
|
+
inputClass: c
|
|
243
|
+
};
|
|
244
|
+
}
|
|
245
|
+
}), ue = ["for"], fe = ["id", "value", "name", "type", "disabled", "placeholder"];
|
|
246
|
+
function _e(e, n, a, i, c, _) {
|
|
247
|
+
return l(), t("div", {
|
|
248
|
+
class: s(e.styles.wrapper)
|
|
249
|
+
}, [
|
|
250
|
+
e.label ? (l(), t("label", {
|
|
251
|
+
key: 0,
|
|
252
|
+
for: e.id,
|
|
253
|
+
class: s(e.styles.label)
|
|
254
|
+
}, g(e.label), 11, ue)) : r("", !0),
|
|
255
|
+
m("div", {
|
|
256
|
+
class: s(e.styles.container)
|
|
257
|
+
}, [
|
|
258
|
+
e.$slots.prefix ? (l(), t("span", {
|
|
259
|
+
key: 0,
|
|
260
|
+
class: s(e.styles.prefix)
|
|
261
|
+
}, [
|
|
262
|
+
f(e.$slots, "prefix")
|
|
263
|
+
], 2)) : r("", !0),
|
|
264
|
+
m("input", {
|
|
265
|
+
id: e.id,
|
|
266
|
+
value: e.value,
|
|
267
|
+
name: e.name,
|
|
268
|
+
type: e.type || "text",
|
|
269
|
+
disabled: e.disabled || e.loading,
|
|
270
|
+
placeholder: e.placeholder,
|
|
271
|
+
class: s(e.inputClass),
|
|
272
|
+
onInput: n[0] || (n[0] = (...u) => e.onInput && e.onInput(...u)),
|
|
273
|
+
onKeydown: n[1] || (n[1] = (...u) => e.onKeydown && e.onKeydown(...u))
|
|
274
|
+
}, null, 42, fe),
|
|
275
|
+
e.$slots.suffix ? (l(), t("span", {
|
|
276
|
+
key: 1,
|
|
277
|
+
class: s(e.styles.suffix)
|
|
278
|
+
}, [
|
|
279
|
+
f(e.$slots, "suffix")
|
|
280
|
+
], 2)) : r("", !0),
|
|
281
|
+
e.loading ? (l(), t("span", {
|
|
282
|
+
key: 2,
|
|
283
|
+
class: s(e.styles.spinner)
|
|
284
|
+
}, null, 2)) : r("", !0)
|
|
285
|
+
], 2),
|
|
286
|
+
e.error ? (l(), t("p", {
|
|
287
|
+
key: 1,
|
|
288
|
+
class: s(e.styles.error)
|
|
289
|
+
}, g(e.error), 3)) : r("", !0)
|
|
290
|
+
], 2);
|
|
291
|
+
}
|
|
292
|
+
const be = /* @__PURE__ */ $(ce, [["render", _e]]);
|
|
150
293
|
export {
|
|
151
|
-
|
|
294
|
+
ye as BaseButton,
|
|
295
|
+
be as BaseInput
|
|
152
296
|
};
|
package/dist/ui.umd.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
(function(
|
|
2
|
-
/*$vite$:1*/`,document.head.appendChild(
|
|
1
|
+
(function(t,o){typeof exports=="object"&&typeof module<"u"?o(exports,require("vue")):typeof define=="function"&&define.amd?define(["exports","vue"],o):(t=typeof globalThis<"u"?globalThis:t||self,o(t.ui={},t.Vue))})(this,function(t,o){"use strict";var b=document.createElement("style");b.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(b);const r={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 c=(e=>(e.XS="xs",e.S="s",e.M="m",e.L="l",e.XL="xl",e))(c||{}),_=(e=>(e.PRIMARY="primary",e.DANGER="danger",e.DEFAULT="default",e.TEXT="text",e.LINK="link",e))(_||{}),u=(e=>(e.SUBMIT="submit",e.BUTTON="button",e.RESET="reset",e))(u||{});const h=o.defineComponent({name:"BaseButton",props:{name:{type:String,required:!1,default:void 0},size:{type:String,default:c.M},className:{type:String,required:!1,default:void 0},type:{type:String,default:_.DEFAULT},leftIcon:{type:Object,required:!1,default:void 0},rightIcon:{type:Object,required:!1,default:void 0},block:{type:Boolean,default:!1},disabled:{type:Boolean,default:!1},loading:{type:Boolean,default:!1},active:{type:Boolean,default:!1},circle:{type:Boolean,default:!1},bordered:{type:Boolean,default:!1},htmlType:{type:String,default:u.BUTTON}},emits:["click"],setup(e,{emit:n}){return{classList:o.computed(()=>[r.button,r[e.size||c.M],r[e.type||_.DEFAULT],{[r.block]:e.block,[r.disabled]:e.disabled||e.loading,[r.loading]:e.loading,[r.active]:e.active,[r.circle]:e.circle,[r.bordered]:e.bordered},e.className]),handleClick:()=>{n("click")},styles:r}}}),g=(e,n)=>{const l=e.__vccOpts||e;for(const[i,a]of n)l[i]=a;return l},w=["name","type","disabled"];function y(e,n,l,i,a,f){return o.openBlock(),o.createElementBlock("button",{name:e.name,class:o.normalizeClass(e.classList),type:e.htmlType,disabled:e.disabled||e.loading,onClick:n[0]||(n[0]=(...s)=>e.handleClick&&e.handleClick(...s))},[e.loading?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(e.styles.spinner)},null,2)):(o.openBlock(),o.createElementBlock(o.Fragment,{key:1},[e.leftIcon?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass([e.styles.icon,e.styles.iconLeft])},[o.renderSlot(e.$slots,"leftIcon",{icon:e.leftIcon})],2)):o.createCommentVNode("",!0),e.$slots.default?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(e.styles.content)},[o.renderSlot(e.$slots,"default")],2)):o.createCommentVNode("",!0),e.rightIcon?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass([e.styles.icon,e.styles.iconRight])},[o.renderSlot(e.$slots,"rightIcon",{icon:e.rightIcon})],2)):o.createCommentVNode("",!0)],64))],10,w)}const k=g(h,[["render",y]]),d={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 p=(e=>(e.XS="xs",e.S="s",e.M="m",e.L="l",e.XL="xl",e))(p||{}),m=(e=>(e.TEXT="text",e.PASSWORD="password",e.EMAIL="email",e.TEL="tel",e.SEARCH="search",e))(m||{});const x=o.defineComponent({name:"BaseInput",props:{value:{type:String,required:!0},type:{type:String,default:m.TEXT},id:{type:String,required:!1,default:void 0},name:{type:String,required:!1,default:void 0},disabled:{type:Boolean,default:!1},label:{type:String,required:!1,default:void 0},placeholder:{type:String,required:!1,default:void 0},loading:{type:Boolean,default:!1},error:{type:String,required:!1,default:void 0},size:{type:String,default:p.M},className:{type:String,required:!1,default:void 0}},emits:["update:value","enter"],setup(e,{emit:n}){const l=()=>{n("update:value")},i=f=>{f.key==="Enter"&&n("enter")},a=o.computed(()=>[d.input,d[e.size||p.M],{[d.disabled]:e.disabled,[d.error]:e.error,[d.loading]:e.loading},e.className]);return{styles:d,onInput:l,onKeydown:i,inputClass:a}}}),$=["for"],C=["id","value","name","type","disabled","placeholder"];function E(e,n,l,i,a,f){return o.openBlock(),o.createElementBlock("div",{class:o.normalizeClass(e.styles.wrapper)},[e.label?(o.openBlock(),o.createElementBlock("label",{key:0,for:e.id,class:o.normalizeClass(e.styles.label)},o.toDisplayString(e.label),11,$)):o.createCommentVNode("",!0),o.createElementVNode("div",{class:o.normalizeClass(e.styles.container)},[e.$slots.prefix?(o.openBlock(),o.createElementBlock("span",{key:0,class:o.normalizeClass(e.styles.prefix)},[o.renderSlot(e.$slots,"prefix")],2)):o.createCommentVNode("",!0),o.createElementVNode("input",{id:e.id,value:e.value,name:e.name,type:e.type||"text",disabled:e.disabled||e.loading,placeholder:e.placeholder,class:o.normalizeClass(e.inputClass),onInput:n[0]||(n[0]=(...s)=>e.onInput&&e.onInput(...s)),onKeydown:n[1]||(n[1]=(...s)=>e.onKeydown&&e.onKeydown(...s))},null,42,C),e.$slots.suffix?(o.openBlock(),o.createElementBlock("span",{key:1,class:o.normalizeClass(e.styles.suffix)},[o.renderSlot(e.$slots,"suffix")],2)):o.createCommentVNode("",!0),e.loading?(o.openBlock(),o.createElementBlock("span",{key:2,class:o.normalizeClass(e.styles.spinner)},null,2)):o.createCommentVNode("",!0)],2),e.error?(o.openBlock(),o.createElementBlock("p",{key:1,class:o.normalizeClass(e.styles.error)},o.toDisplayString(e.error),3)):o.createCommentVNode("",!0)],2)}const S=g(x,[["render",E]]);t.BaseButton=k,t.BaseInput=S,Object.defineProperty(t,Symbol.toStringTag,{value:"Module"})});
|