@huntflow/ui 0.0.48 → 0.0.49
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/README.md +6 -0
- package/dist/assets/sprite.svg +1 -1
- package/dist/components/base-button/button.vue.d.ts +3 -3
- package/dist/components/base-button/types.d.ts +2 -3
- package/dist/components/base-loader/index.d.ts +3 -0
- package/dist/components/base-loader/loader.vue.d.ts +6 -0
- package/dist/components/base-loader/types.d.ts +6 -0
- package/dist/components/index.d.ts +2 -0
- package/dist/global.css +1 -1
- package/dist/sprite.svg +1 -1
- package/dist/ui.cjs.js +2 -2
- package/dist/ui.es.js +220 -207
- package/package.json +4 -2
package/dist/ui.es.js
CHANGED
|
@@ -1,36 +1,54 @@
|
|
|
1
|
-
(function(){"use strict";var
|
|
2
|
-
import { defineComponent as
|
|
3
|
-
const
|
|
4
|
-
button:
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
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_1syl2_1{position:relative;display:inline-flex;align-items:center;justify-content:center;border:solid 1px;cursor:pointer;font-family:var(--hf-font-family-body);font-style:normal;min-width:-moz-max-content;min-width:max-content;text-decoration:none;color:inherit;gap:4px}._button_1syl2_1:active{background-color:#999}._button_1syl2_1:focus{outline:none}._button_1syl2_1:focus-visible{outline:solid 3px var(--hf-color-button-disable-default)}._button_1syl2_1:is(._disabled_1syl2_1),._button_1syl2_1:is(._disabled_1syl2_1):hover{background:var(--hf-color-button-disable-default);border-color:transparent;color:var(--hf-color-text-light);box-shadow:none;transform:none;cursor:default}._button_1syl2_1._loading_1syl2_1>*:not(._loader_1syl2_1){visibility:hidden}._content_1syl2_1{display:flex;line-height:inherit}._content_1syl2_1:first-child:last-child{width:100%;text-align:center}._loader_1syl2_1{position:absolute;top:0;right:0;bottom:0;left:0;display:flex;align-items:center;justify-content:center}._s_1syl2_2{border-radius:var(--hf-radius-button-s);font-size:var(--hf-font-size-button-s);font-weight:var(--hf-font-weight-button-s);line-height:var(--hf-font-line-height-button-s);padding:var(--hf-padding-button-top-bottom-s) var(--hf-padding-button-left-right-s)}._xs_1syl2_1{font-size:var(--hf-font-size-button-xs);font-weight:var(--hf-font-weight-button-xs);line-height:var(--hf-font-line-height-button-xs);padding:var(--hf-padding-button-top-bottom-xs) var(--hf-padding-button-left-right-xs)}._xs_1syl2_1._square_1syl2_1{border-radius:var(--hf-radius-button-xs)}._xs_1syl2_1._circle_1syl2_1{border-radius:var(--hf-radius-button-circle)}._m_1syl2_1{border-radius:var(--hf-radius-button-m);font-size:var(--hf-font-size-button-m);font-weight:var(--hf-font-weight-button-m);line-height:var(--hf-font-line-height-button-m);padding:var(--hf-padding-button-top-bottom-m) var(--hf-padding-button-left-right-m)}._l_1syl2_1{border-radius:var(--hf-radius-button-l);font-size:var(--hf-font-size-button-l);font-weight:var(--hf-font-weight-button-l);line-height:var(--hf-font-line-height-button-l);padding:var(--hf-padding-button-top-bottom-l) var(--hf-padding-button-left-right-l)}._primary_1syl2_1{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-primary-default);border-color:var(--hf-color-button-primary-default)}._primary_1syl2_1:hover{background-color:var(--hf-color-button-primary-hover);border-color:var(--hf-color-button-primary-hover)}._primary_1syl2_1:active{background-color:var(--hf-color-button-primary-active);border-color:var(--hf-color-button-primary-active)}._secondary_1syl2_1{color:var(--hf-color-text-main);background-color:var(--hf-color-button-secondary-fill-default);border-color:var(--hf-color-button-secondary-border-default);box-shadow:0 1px 4px #0505050a}._secondary_1syl2_1:hover{background-color:var(--hf-color-button-secondary-fill-hover);border-color:var(--hf-color-button-secondary-fill-hover)}._secondary_1syl2_1:active{background-color:var(--hf-color-button-secondary-fill-active);border-color:var(--hf-color-button-secondary-fill-active)}._accent_1syl2_1{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-accent-default);border-color:var(--hf-color-button-accent-default)}._accent_1syl2_1:hover{background-color:var(--hf-color-button-accent-hover);border-color:var(--hf-color-button-accent-hover)}._accent_1syl2_1:active{background-color:var(--hf-color-button-accent-active);border-color:var(--hf-color-button-accent-active)}._danger_1syl2_1{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-danger-default);border-color:var(--hf-color-button-danger-default)}._danger_1syl2_1:hover{background-color:var(--hf-color-button-danger-hover);border-color:var(--hf-color-button-danger-hover)}._danger_1syl2_1:active{background-color:var(--hf-color-button-danger-active);border-color:var(--hf-color-button-danger-active)}._jobsites_1syl2_1{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-jobsite-default);border-color:var(--hf-color-button-jobsite-default)}._jobsites_1syl2_1:hover{background-color:var(--hf-color-button-jobsite-hover);border-color:var(--hf-color-button-jobsite-hover)}._jobsites_1syl2_1:active{background-color:var(--hf-color-button-jobsite-active);border-color:var(--hf-color-button-jobsite-active)}._ghost_1syl2_1{color:var(--hf-color-text-main);background-color:transparent;border-color:transparent}._ghost_1syl2_1:hover{background-color:var(--hf-color-button-secondary-fill-hover)}._ghost_1syl2_1:active{background-color:var(--hf-color-button-secondary-fill-active)}._ghost-danger_1syl2_1{color:var(--hf-color-text-main);background-color:transparent;border-color:transparent}._ghost-danger_1syl2_1:hover{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-danger-hover)}._ghost-danger_1syl2_1:active{color:var(--hf-color-text-invert);background-color:var(--hf-color-button-danger-active)}@keyframes _loader-animation_t6bg6_1{0%{transform:rotate(0)}to{transform:rotate(360deg)}}._loader_t6bg6_10{display:block;color:var(--hf-loader-color);flex:0 0 auto}._circle_t6bg6_15{animation-name:_loader-animation_t6bg6_1;animation-iteration-count:infinite;animation-duration:1s;animation-timing-function:linear}._white_t6bg6_22{--hf-loader-color: var(--hf-color-text-invert)}._black_t6bg6_26{--hf-loader-color: var(--hf-color-text-main)}._s_t6bg6_30{width:18px;height:18px}._m_t6bg6_35{width:28px;height:28px}._l_t6bg6_10{width:56px;height:56px}._spinner_t6bg6_45{display:inline-block;border:1px solid var(--hf-loader-color);border-top-color:transparent;border-left-color:transparent;border-radius:50%}._wrapper_f5n0f_1{display:flex;flex-direction:column}._label_f5n0f_6{margin-bottom:4px;font-size:15px;font-weight:500;line-height:20px}._container_f5n0f_13{position:relative;display:flex;align-items:center}._input_f5n0f_19{flex:1;padding:8px 12px;font-size:15px;line-height:24px;border:1px solid #00000029;border-radius:12px;outline:none;transition:border-color .3s}._input_f5n0f_19._error_f5n0f_29{border:1px solid #FF0000}._input_f5n0f_19._error_f5n0f_29:focus{outline:3px solid #FFD6D6}._input_f5n0f_19:focus{outline:3px solid #C4EDFA}._xs_f5n0f_41{padding:4px 8px;font-size:12px}._s_f5n0f_46{padding:6px 10px;font-size:13px}._m_f5n0f_51{padding:8px 12px;font-size:14px}._l_f5n0f_6{padding:10px 14px;font-size:16px}._xl_f5n0f_61{padding:12px 16px;font-size:18px}._disabled_f5n0f_66{background-color:#e9ecef;cursor:not-allowed}._errorText_f5n0f_71{margin-top:4px;font-size:14px;line-height:20px;color:red}._prefix_f5n0f_78,._suffix_f5n0f_79{position:absolute;display:flex;align-items:center;color:#6c757d}._prefix_f5n0f_78{left:8px}._suffix_f5n0f_79{right:8px}._loading_f5n0f_94{cursor:wait}._spinner_f5n0f_98{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_f5n0f_98 .6s linear infinite}@keyframes _spin_f5n0f_98{to{transform:rotate(360deg)}}._label_jcdiv_1{display:flex;align-items:center;gap:8px;height:20px}._label_jcdiv_1._disabled_jcdiv_7{color:gray;cursor:not-allowed}._label_jcdiv_1 span{margin-top:-5px}._input_jcdiv_17[type=checkbox]{vertical-align:-2px;margin:0;border-radius:4px;-webkit-appearance:none;-moz-appearance:none;appearance:none;background-color:#fff;width:16px;height:16px;border:1px solid #25CFE8;transform:translateY(-.075em);display:grid;place-content:center}._input_jcdiv_17._error_jcdiv_30[type=checkbox]{border:1px solid #FF0000}._input_jcdiv_17[type=checkbox]:before{content:"";width:16px;height:16px;clip-path:polygon(0 0,50% 0,100% 0,100% 100%,50% 100%,0 100%);transform:scale(0);transform-origin:bottom left;transition:.12s transform ease-in-out;background-color:#25cfe8;border-radius:4px}._input_jcdiv_17[type=checkbox]:checked:before{transform:scale(1)}._input_jcdiv_17[type=checkbox]:focus{outline:2px solid #C4EDFA}._input_jcdiv_17._error_jcdiv_30[type=checkbox]:focus{outline:2px solid #FFD6D6}._input_jcdiv_17[type=checkbox]:disabled{border-color:#00000029;opacity:30%;color:#000;cursor:not-allowed}._text_jcdiv_70{-webkit-user-select:none;-moz-user-select:none;user-select:none;font-size:15px;line-height:20px}._errorText_jcdiv_76{color:red;font-size:12px}._icon_1p8iz_2{font-style:normal;display:inline-block;vertical-align:middle}')),document.head.appendChild(o)}}catch(t){console.error("vite-plugin-css-injected-by-js",t)}})();
|
|
2
|
+
import { defineComponent as $, computed as f, openBlock as i, createElementBlock as d, normalizeClass as r, unref as c, createVNode as j, createCommentVNode as u, renderSlot as y, createElementVNode as h, mergeModels as v, useModel as C, toDisplayString as k, withDirectives as z, vModelDynamic as N, vModelCheckbox as T, normalizeStyle as x } from "vue";
|
|
3
|
+
const M = "_button_1syl2_1", I = "_disabled_1syl2_1", L = "_loading_1syl2_1", V = "_loader_1syl2_1", q = "_content_1syl2_1", D = "_s_1syl2_2", O = "_xs_1syl2_1", S = "_square_1syl2_1", A = "_circle_1syl2_1", R = "_m_1syl2_1", U = "_l_1syl2_1", K = "_primary_1syl2_1", P = "_secondary_1syl2_1", F = "_accent_1syl2_1", G = "_danger_1syl2_1", H = "_jobsites_1syl2_1", J = "_ghost_1syl2_1", p = {
|
|
4
|
+
button: M,
|
|
5
|
+
disabled: I,
|
|
6
|
+
loading: L,
|
|
7
|
+
loader: V,
|
|
8
|
+
content: q,
|
|
9
|
+
s: D,
|
|
10
|
+
xs: O,
|
|
11
|
+
square: S,
|
|
12
|
+
circle: A,
|
|
13
|
+
m: R,
|
|
14
|
+
l: U,
|
|
15
|
+
primary: K,
|
|
16
|
+
secondary: P,
|
|
17
|
+
accent: F,
|
|
18
|
+
danger: G,
|
|
19
|
+
jobsites: H,
|
|
20
|
+
ghost: J,
|
|
21
|
+
"ghost-danger": "_ghost-danger_1syl2_1"
|
|
22
|
+
}, Q = "_loader_t6bg6_10", W = "_circle_t6bg6_15", X = "_white_t6bg6_22", Y = "_black_t6bg6_26", Z = "_s_t6bg6_30", ee = "_m_t6bg6_35", se = "_l_t6bg6_10", te = "_spinner_t6bg6_45", g = {
|
|
23
|
+
loader: Q,
|
|
24
|
+
circle: W,
|
|
25
|
+
"loader-animation": "_loader-animation_t6bg6_1",
|
|
26
|
+
white: X,
|
|
27
|
+
black: Y,
|
|
28
|
+
s: Z,
|
|
29
|
+
m: ee,
|
|
30
|
+
l: se,
|
|
31
|
+
spinner: te
|
|
32
|
+
}, oe = /* @__PURE__ */ $({
|
|
33
|
+
__name: "loader",
|
|
34
|
+
props: {
|
|
35
|
+
className: {},
|
|
36
|
+
size: { default: "l" },
|
|
37
|
+
color: { default: "black" }
|
|
38
|
+
},
|
|
39
|
+
setup(n) {
|
|
40
|
+
const s = n, t = f(() => [g.loader, g[s.size], g[s.color], g.circle]);
|
|
41
|
+
return (l, e) => (i(), d("span", {
|
|
42
|
+
class: r([c(g).spinner, t.value])
|
|
43
|
+
}, null, 2));
|
|
44
|
+
}
|
|
45
|
+
}), ne = ["name", "type", "disabled"], Ae = /* @__PURE__ */ $({
|
|
46
|
+
name: "BaseButton",
|
|
28
47
|
__name: "button",
|
|
29
48
|
props: {
|
|
30
49
|
size: { default: "m" },
|
|
31
50
|
className: {},
|
|
32
|
-
type: { default: "
|
|
33
|
-
block: { type: Boolean },
|
|
51
|
+
type: { default: "primary" },
|
|
34
52
|
disabled: { type: Boolean, default: !1 },
|
|
35
53
|
loading: { type: Boolean, default: !1 },
|
|
36
54
|
active: { type: Boolean, default: !1 },
|
|
@@ -40,80 +58,74 @@ const z = "_button_1ey6t_1", M = "_contentWrapper_1ey6t_13", N = "_primary_1ey6t
|
|
|
40
58
|
htmlType: {}
|
|
41
59
|
},
|
|
42
60
|
emits: ["click"],
|
|
43
|
-
setup(
|
|
44
|
-
const
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
61
|
+
setup(n) {
|
|
62
|
+
const s = n, t = {
|
|
63
|
+
primary: "white",
|
|
64
|
+
secondary: "black",
|
|
65
|
+
accent: "white",
|
|
66
|
+
danger: "white",
|
|
67
|
+
jobsites: "white",
|
|
68
|
+
ghost: "black",
|
|
69
|
+
"ghost-danger": "black"
|
|
70
|
+
}, l = f(() => [
|
|
71
|
+
p.button,
|
|
72
|
+
p[s.size],
|
|
73
|
+
p[s.type],
|
|
74
|
+
s.circle ? [p.circle] : [p.square],
|
|
48
75
|
{
|
|
49
|
-
[
|
|
50
|
-
[
|
|
51
|
-
[
|
|
52
|
-
[
|
|
53
|
-
[r.circle]: t.circle,
|
|
54
|
-
[r.bordered]: t.bordered
|
|
76
|
+
[p.disabled]: s.disabled,
|
|
77
|
+
[p.loading]: s.loading,
|
|
78
|
+
[p.active]: s.active,
|
|
79
|
+
[p.bordered]: s.bordered
|
|
55
80
|
},
|
|
56
|
-
|
|
57
|
-
]);
|
|
58
|
-
return (
|
|
59
|
-
name:
|
|
60
|
-
class:
|
|
61
|
-
type:
|
|
62
|
-
disabled:
|
|
63
|
-
onClick:
|
|
81
|
+
s.className
|
|
82
|
+
]), e = f(() => t[s.type] || "white");
|
|
83
|
+
return (a, m) => (i(), d("button", {
|
|
84
|
+
name: a.name,
|
|
85
|
+
class: r(l.value),
|
|
86
|
+
type: a.htmlType,
|
|
87
|
+
disabled: a.disabled || a.loading,
|
|
88
|
+
onClick: m[0] || (m[0] = (B) => a.$emit("click"))
|
|
64
89
|
}, [
|
|
65
|
-
|
|
90
|
+
a.loading ? (i(), d("div", {
|
|
66
91
|
key: 0,
|
|
67
|
-
class:
|
|
92
|
+
class: r(c(p).loader)
|
|
68
93
|
}, [
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
u("
|
|
74
|
-
|
|
94
|
+
j(c(oe), {
|
|
95
|
+
size: "s",
|
|
96
|
+
color: e.value
|
|
97
|
+
}, null, 8, ["color"])
|
|
98
|
+
], 2)) : u("", !0),
|
|
99
|
+
a.$slots.before ? y(a.$slots, "before", { key: 1 }) : u("", !0),
|
|
100
|
+
h("span", {
|
|
101
|
+
class: r(c(p).content)
|
|
75
102
|
}, [
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
m(s.$slots, "leftIcon")
|
|
81
|
-
], 2)) : _("", !0),
|
|
82
|
-
u("span", {
|
|
83
|
-
class: o(a(r).content)
|
|
84
|
-
}, [
|
|
85
|
-
m(s.$slots, "default")
|
|
86
|
-
], 2),
|
|
87
|
-
s.$slots.rightIcon ? (c(), d("span", {
|
|
88
|
-
key: 1,
|
|
89
|
-
class: o([a(r).icon, a(r).iconRight])
|
|
90
|
-
}, [
|
|
91
|
-
m(s.$slots, "rightIcon")
|
|
92
|
-
], 2)) : _("", !0)
|
|
93
|
-
], 2)
|
|
94
|
-
], 10, Y));
|
|
103
|
+
y(a.$slots, "default")
|
|
104
|
+
], 2),
|
|
105
|
+
a.$slots.after ? y(a.$slots, "after", { key: 2 }) : u("", !0)
|
|
106
|
+
], 10, ne));
|
|
95
107
|
}
|
|
96
|
-
}),
|
|
97
|
-
wrapper:
|
|
98
|
-
label:
|
|
99
|
-
container:
|
|
100
|
-
input:
|
|
101
|
-
error:
|
|
102
|
-
xs:
|
|
103
|
-
s:
|
|
104
|
-
m:
|
|
105
|
-
l:
|
|
106
|
-
xl:
|
|
107
|
-
disabled:
|
|
108
|
-
errorText:
|
|
109
|
-
prefix:
|
|
110
|
-
suffix:
|
|
111
|
-
loading:
|
|
112
|
-
spinner:
|
|
113
|
-
spin:
|
|
114
|
-
},
|
|
108
|
+
}), le = "_wrapper_f5n0f_1", ae = "_label_f5n0f_6", re = "_container_f5n0f_13", ce = "_input_f5n0f_19", ie = "_error_f5n0f_29", de = "_xs_f5n0f_41", _e = "_s_f5n0f_46", pe = "_m_f5n0f_51", ue = "_l_f5n0f_6", fe = "_xl_f5n0f_61", me = "_disabled_f5n0f_66", be = "_errorText_f5n0f_71", ye = "_prefix_f5n0f_78", he = "_suffix_f5n0f_79", ge = "_loading_f5n0f_94", $e = "_spinner_f5n0f_98", ve = "_spin_f5n0f_98", _ = {
|
|
109
|
+
wrapper: le,
|
|
110
|
+
label: ae,
|
|
111
|
+
container: re,
|
|
112
|
+
input: ce,
|
|
113
|
+
error: ie,
|
|
114
|
+
xs: de,
|
|
115
|
+
s: _e,
|
|
116
|
+
m: pe,
|
|
117
|
+
l: ue,
|
|
118
|
+
xl: fe,
|
|
119
|
+
disabled: me,
|
|
120
|
+
errorText: be,
|
|
121
|
+
prefix: ye,
|
|
122
|
+
suffix: he,
|
|
123
|
+
loading: ge,
|
|
124
|
+
spinner: $e,
|
|
125
|
+
spin: ve
|
|
126
|
+
}, ke = ["for"], Be = ["id", "name", "type", "disabled", "placeholder"], Re = /* @__PURE__ */ $({
|
|
115
127
|
__name: "input",
|
|
116
|
-
props: /* @__PURE__ */
|
|
128
|
+
props: /* @__PURE__ */ v({
|
|
117
129
|
value: {},
|
|
118
130
|
type: { default: "text" },
|
|
119
131
|
id: {},
|
|
@@ -129,79 +141,79 @@ const z = "_button_1ey6t_1", M = "_contentWrapper_1ey6t_13", N = "_primary_1ey6t
|
|
|
129
141
|
value: {},
|
|
130
142
|
valueModifiers: {}
|
|
131
143
|
}),
|
|
132
|
-
emits: /* @__PURE__ */
|
|
133
|
-
setup(
|
|
134
|
-
const
|
|
135
|
-
|
|
136
|
-
|
|
144
|
+
emits: /* @__PURE__ */ v(["update:value", "enter"], ["update:value"]),
|
|
145
|
+
setup(n, { emit: s }) {
|
|
146
|
+
const t = C(n, "value"), l = n, e = s, a = f(() => [
|
|
147
|
+
_.input,
|
|
148
|
+
_[l.size],
|
|
137
149
|
{
|
|
138
|
-
[
|
|
139
|
-
[
|
|
140
|
-
[
|
|
150
|
+
[_.disabled]: l.disabled,
|
|
151
|
+
[_.error]: l.error,
|
|
152
|
+
[_.loading]: l.loading
|
|
141
153
|
},
|
|
142
|
-
|
|
143
|
-
]),
|
|
144
|
-
e("update:value",
|
|
145
|
-
},
|
|
146
|
-
|
|
154
|
+
l.className
|
|
155
|
+
]), m = (o) => {
|
|
156
|
+
e("update:value", o.target.value);
|
|
157
|
+
}, B = (o) => {
|
|
158
|
+
o.key === "Enter" && e("enter");
|
|
147
159
|
};
|
|
148
|
-
return (
|
|
149
|
-
class:
|
|
160
|
+
return (o, w) => (i(), d("div", {
|
|
161
|
+
class: r(c(_).wrapper)
|
|
150
162
|
}, [
|
|
151
|
-
|
|
163
|
+
o.label ? (i(), d("label", {
|
|
152
164
|
key: 0,
|
|
153
|
-
for:
|
|
154
|
-
class:
|
|
155
|
-
},
|
|
156
|
-
|
|
157
|
-
class:
|
|
165
|
+
for: o.id,
|
|
166
|
+
class: r(c(_).label)
|
|
167
|
+
}, k(o.label), 11, ke)) : u("", !0),
|
|
168
|
+
h("div", {
|
|
169
|
+
class: r(c(_).container)
|
|
158
170
|
}, [
|
|
159
|
-
|
|
171
|
+
o.$slots.prefix ? (i(), d("span", {
|
|
160
172
|
key: 0,
|
|
161
|
-
class:
|
|
173
|
+
class: r(c(_).prefix)
|
|
162
174
|
}, [
|
|
163
|
-
|
|
164
|
-
], 2)) :
|
|
165
|
-
|
|
166
|
-
id:
|
|
167
|
-
"onUpdate:modelValue":
|
|
168
|
-
name:
|
|
169
|
-
type:
|
|
170
|
-
disabled:
|
|
171
|
-
placeholder:
|
|
172
|
-
class:
|
|
173
|
-
onInput:
|
|
174
|
-
onKeydown:
|
|
175
|
-
}, null, 42,
|
|
176
|
-
[
|
|
175
|
+
y(o.$slots, "prefix")
|
|
176
|
+
], 2)) : u("", !0),
|
|
177
|
+
z(h("input", {
|
|
178
|
+
id: o.id,
|
|
179
|
+
"onUpdate:modelValue": w[0] || (w[0] = (E) => t.value = E),
|
|
180
|
+
name: o.name,
|
|
181
|
+
type: o.type,
|
|
182
|
+
disabled: o.disabled || o.loading,
|
|
183
|
+
placeholder: o.placeholder,
|
|
184
|
+
class: r(a.value),
|
|
185
|
+
onInput: m,
|
|
186
|
+
onKeydown: B
|
|
187
|
+
}, null, 42, Be), [
|
|
188
|
+
[N, t.value]
|
|
177
189
|
]),
|
|
178
|
-
|
|
190
|
+
o.$slots.suffix ? (i(), d("span", {
|
|
179
191
|
key: 1,
|
|
180
|
-
class:
|
|
192
|
+
class: r(c(_).suffix)
|
|
181
193
|
}, [
|
|
182
|
-
|
|
183
|
-
], 2)) :
|
|
184
|
-
|
|
194
|
+
y(o.$slots, "suffix")
|
|
195
|
+
], 2)) : u("", !0),
|
|
196
|
+
o.loading ? (i(), d("span", {
|
|
185
197
|
key: 2,
|
|
186
|
-
class:
|
|
187
|
-
}, null, 2)) :
|
|
198
|
+
class: r(c(_).spinner)
|
|
199
|
+
}, null, 2)) : u("", !0)
|
|
188
200
|
], 2),
|
|
189
|
-
|
|
201
|
+
o.error ? (i(), d("p", {
|
|
190
202
|
key: 1,
|
|
191
|
-
class:
|
|
192
|
-
},
|
|
203
|
+
class: r(c(_).errorText)
|
|
204
|
+
}, k(o.error), 3)) : u("", !0)
|
|
193
205
|
], 2));
|
|
194
206
|
}
|
|
195
|
-
}),
|
|
196
|
-
label:
|
|
197
|
-
disabled:
|
|
198
|
-
input:
|
|
199
|
-
error:
|
|
200
|
-
text:
|
|
201
|
-
errorText:
|
|
202
|
-
},
|
|
207
|
+
}), we = "_label_jcdiv_1", Ce = "_disabled_jcdiv_7", ze = "_input_jcdiv_17", Ee = "_error_jcdiv_30", je = "_text_jcdiv_70", Ne = "_errorText_jcdiv_76", b = {
|
|
208
|
+
label: we,
|
|
209
|
+
disabled: Ce,
|
|
210
|
+
input: ze,
|
|
211
|
+
error: Ee,
|
|
212
|
+
text: je,
|
|
213
|
+
errorText: Ne
|
|
214
|
+
}, Te = ["for"], xe = ["id", "name", "disabled"], Ue = /* @__PURE__ */ $({
|
|
203
215
|
__name: "checkbox",
|
|
204
|
-
props: /* @__PURE__ */
|
|
216
|
+
props: /* @__PURE__ */ v({
|
|
205
217
|
id: {},
|
|
206
218
|
name: {},
|
|
207
219
|
disabled: { type: Boolean },
|
|
@@ -213,92 +225,93 @@ const z = "_button_1ey6t_1", M = "_contentWrapper_1ey6t_13", N = "_primary_1ey6t
|
|
|
213
225
|
checkedModifiers: {}
|
|
214
226
|
}),
|
|
215
227
|
emits: ["update:checked"],
|
|
216
|
-
setup(
|
|
217
|
-
const
|
|
218
|
-
|
|
228
|
+
setup(n) {
|
|
229
|
+
const s = C(n, "checked"), t = n, l = f(() => [
|
|
230
|
+
b.label,
|
|
219
231
|
{
|
|
220
|
-
[
|
|
232
|
+
[b.disabled]: t.disabled
|
|
221
233
|
},
|
|
222
|
-
|
|
234
|
+
t.className
|
|
223
235
|
]);
|
|
224
|
-
return (e,
|
|
225
|
-
|
|
236
|
+
return (e, a) => (i(), d("div", null, [
|
|
237
|
+
h("label", {
|
|
226
238
|
for: e.id,
|
|
227
|
-
class:
|
|
239
|
+
class: r(l.value)
|
|
228
240
|
}, [
|
|
229
|
-
|
|
241
|
+
z(h("input", {
|
|
230
242
|
id: e.id,
|
|
231
|
-
"onUpdate:modelValue":
|
|
243
|
+
"onUpdate:modelValue": a[0] || (a[0] = (m) => s.value = m),
|
|
232
244
|
name: e.name,
|
|
233
245
|
type: "checkbox",
|
|
234
246
|
disabled: e.disabled,
|
|
235
|
-
class:
|
|
236
|
-
}, null, 10,
|
|
237
|
-
[T,
|
|
247
|
+
class: r([c(b).input, { [c(b).error]: !!t.error }])
|
|
248
|
+
}, null, 10, xe), [
|
|
249
|
+
[T, s.value]
|
|
238
250
|
]),
|
|
239
|
-
e.$slots.default ? (
|
|
251
|
+
e.$slots.default ? (i(), d("span", {
|
|
240
252
|
key: 0,
|
|
241
|
-
class:
|
|
253
|
+
class: r(c(b).text)
|
|
242
254
|
}, [
|
|
243
|
-
|
|
244
|
-
], 2)) :
|
|
245
|
-
], 10,
|
|
246
|
-
e.error ? (
|
|
255
|
+
y(e.$slots, "default")
|
|
256
|
+
], 2)) : u("", !0)
|
|
257
|
+
], 10, Te),
|
|
258
|
+
e.error ? (i(), d("div", {
|
|
247
259
|
key: 0,
|
|
248
|
-
class:
|
|
249
|
-
},
|
|
260
|
+
class: r(c(b).errorText)
|
|
261
|
+
}, k(e.error), 3)) : u("", !0)
|
|
250
262
|
]));
|
|
251
263
|
}
|
|
252
|
-
}),
|
|
264
|
+
}), Me = ["aria-label", "width", "height"], Ie = ["xlink:href"], Le = /* @__PURE__ */ $({
|
|
253
265
|
__name: "icon",
|
|
254
266
|
props: {
|
|
255
267
|
type: {},
|
|
256
268
|
color: {},
|
|
257
269
|
block: { type: Boolean }
|
|
258
270
|
},
|
|
259
|
-
setup(
|
|
260
|
-
const
|
|
261
|
-
const e =
|
|
271
|
+
setup(n) {
|
|
272
|
+
const s = n, t = f(() => {
|
|
273
|
+
const e = s.type.match(/(\d+)$/);
|
|
262
274
|
return e ? parseInt(e[1], 10) : 16;
|
|
263
|
-
}),
|
|
275
|
+
}), l = f(() => {
|
|
264
276
|
const e = {};
|
|
265
|
-
return
|
|
277
|
+
return s.color && (e.color = s.color), s.block && (e.display = "block"), e;
|
|
266
278
|
});
|
|
267
|
-
return (e,
|
|
268
|
-
class:
|
|
279
|
+
return (e, a) => (i(), d("svg", {
|
|
280
|
+
class: r(e.$style.icon),
|
|
269
281
|
"aria-label": e.type,
|
|
270
|
-
style:
|
|
282
|
+
style: x(l.value),
|
|
271
283
|
role: "img",
|
|
272
|
-
width:
|
|
273
|
-
height:
|
|
284
|
+
width: t.value,
|
|
285
|
+
height: t.value
|
|
274
286
|
}, [
|
|
275
|
-
|
|
287
|
+
h("use", {
|
|
276
288
|
"xlink:href": `../assets/sprite.svg#${e.type}`
|
|
277
|
-
}, null, 8,
|
|
278
|
-
], 14,
|
|
289
|
+
}, null, 8, Ie)
|
|
290
|
+
], 14, Me));
|
|
279
291
|
}
|
|
280
|
-
}),
|
|
281
|
-
icon:
|
|
282
|
-
},
|
|
283
|
-
const
|
|
284
|
-
for (const [
|
|
285
|
-
l
|
|
286
|
-
return
|
|
287
|
-
},
|
|
288
|
-
$style:
|
|
289
|
-
},
|
|
290
|
-
const
|
|
291
|
-
if (!document.getElementById(
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
const
|
|
295
|
-
e.setAttribute("href", `${
|
|
292
|
+
}), Ve = "_icon_1p8iz_2", qe = {
|
|
293
|
+
icon: Ve
|
|
294
|
+
}, De = (n, s) => {
|
|
295
|
+
const t = n.__vccOpts || n;
|
|
296
|
+
for (const [l, e] of s)
|
|
297
|
+
t[l] = e;
|
|
298
|
+
return t;
|
|
299
|
+
}, Oe = {
|
|
300
|
+
$style: qe
|
|
301
|
+
}, Ke = /* @__PURE__ */ De(Le, [["__cssModules", Oe]]), Pe = () => {
|
|
302
|
+
const n = "huntflow-uikit-icons-sprite", s = "/src/assets/sprite.svg";
|
|
303
|
+
if (!document.getElementById(n)) {
|
|
304
|
+
const t = document.createElement("svg");
|
|
305
|
+
t.style.display = "none", t.id = n;
|
|
306
|
+
const l = document.createElement("defs"), e = document.createElement("use");
|
|
307
|
+
e.setAttribute("href", `${s}`), l.appendChild(e), t.appendChild(l), document.body.appendChild(t);
|
|
296
308
|
}
|
|
297
309
|
};
|
|
298
310
|
export {
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
311
|
+
Ae as BaseButton,
|
|
312
|
+
Ue as BaseCheckbox,
|
|
313
|
+
Ke as BaseIcon,
|
|
314
|
+
Re as BaseInput,
|
|
315
|
+
oe as BaseLoader,
|
|
316
|
+
Pe as useIcons
|
|
304
317
|
};
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@huntflow/ui",
|
|
3
3
|
"description": "HuntFlow UiKit, icons, utils library",
|
|
4
4
|
"private": false,
|
|
5
|
-
"version": "0.0.
|
|
5
|
+
"version": "0.0.49",
|
|
6
6
|
"author": {
|
|
7
7
|
"name": "HuntFlow Developer",
|
|
8
8
|
"nickname": "developer",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"storybook": "storybook dev -p 6006",
|
|
24
24
|
"build-storybook": "storybook build",
|
|
25
25
|
"lint": "eslint './src/**/*.{js,vue,ts}' --quiet",
|
|
26
|
-
"icons": "npx tsx utils/figma-icons.ts"
|
|
26
|
+
"icons": "npx tsx utils/figma-icons.ts",
|
|
27
|
+
"variables": "npx tsx utils/figma-variables.ts"
|
|
27
28
|
},
|
|
28
29
|
"publishConfig": {
|
|
29
30
|
"access": "public"
|
|
@@ -75,6 +76,7 @@
|
|
|
75
76
|
"postcss-nesting": "^13.0.1",
|
|
76
77
|
"prettier": "^3.4.2",
|
|
77
78
|
"storybook": "^8.4.7",
|
|
79
|
+
"storybook-addon-pseudo-states": "^4.0.2",
|
|
78
80
|
"stylelint": "^16.12.0",
|
|
79
81
|
"stylelint-config-recommended": "^14.0.1",
|
|
80
82
|
"tsx": "^4.19.2",
|