@lanaco/lnc-react-ui 4.0.3 → 4.0.6
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/Avatar.cjs +1 -1
- package/dist/Avatar.js +5 -6
- package/dist/Button.cjs +2 -2
- package/dist/Button.js +0 -1
- package/dist/CheckBoxInput.js +2 -2
- package/dist/Chip.cjs +1 -1
- package/dist/Chip.js +10 -9
- package/dist/ColorInput.js +18 -18
- package/dist/ConfirmationForm.cjs +5 -5
- package/dist/ConfirmationForm.js +16 -16
- package/dist/DataView.cjs +1 -1
- package/dist/DataView.js +35 -35
- package/dist/DecimalInput.js +41 -41
- package/dist/DoubleRangeSlider.js +30 -30
- package/dist/DragAndDropFile.js +162 -162
- package/dist/DragDropFiles.js +29 -29
- package/dist/Drawer.js +46 -46
- package/dist/Dropdown.js +36 -36
- package/dist/DropdownItem.js +19 -19
- package/dist/DropdownLookup.js +34 -34
- package/dist/DropdownMenu.js +43 -43
- package/dist/FileInput.js +21 -21
- package/dist/FlexGridItem.js +13 -13
- package/dist/Grid.cjs +1 -2
- package/dist/Grid.js +36 -8
- package/dist/GridItem.cjs +1 -1
- package/dist/GridItem.js +27 -7
- package/dist/Icon.cjs +2 -2
- package/dist/Icon.js +5 -6
- package/dist/IconButton.cjs +5 -5
- package/dist/IconButton.js +24 -25
- package/dist/Kanban.js +446 -446
- package/dist/MenuItem.cjs +2 -2
- package/dist/MenuItem.js +59 -58
- package/dist/Modal.js +38 -38
- package/dist/MultiSelectDropdown.js +2 -2
- package/dist/MultiSelectDropdownLookup.js +2 -2
- package/dist/NestedDropdownItem.js +43 -43
- package/dist/NestedMenuItem.js +44 -44
- package/dist/NotificationContainer.cjs +2 -2
- package/dist/NotificationContainer.js +24 -23
- package/dist/NumberInput.js +12 -12
- package/dist/PageLayout.cjs +2 -2
- package/dist/PageLayout.js +18 -18
- package/dist/PasswordInput.js +40 -40
- package/dist/RadioGroup.js +11 -11
- package/dist/RadioInput.js +6 -6
- package/dist/RangeSlider.js +25 -25
- package/dist/SearchBar.js +73 -73
- package/dist/Sidebar.js +11 -11
- package/dist/SwipeableDrawer.js +16 -16
- package/dist/TabItem.js +25 -25
- package/dist/Tabs.js +32 -26
- package/dist/TextAreaInput.js +30 -30
- package/dist/TextInput.js +22 -22
- package/dist/ThemeProvider.js +83 -83
- package/dist/TimeInput.js +4 -4
- package/dist/Toggle.cjs +1 -1
- package/dist/Toggle.js +0 -1
- package/dist/TreeMenu.js +56 -56
- package/dist/style.css +1 -5
- package/package.json +1 -1
- package/bundle-visualization.html +0 -4842
- package/custom-addons/ThemeSelector.js +0 -111
- package/custom-addons/register.js +0 -16
- package/custom-addons/theme-selector.css +0 -17
package/dist/SwipeableDrawer.js
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
1
|
import { jsx as g, Fragment as Y } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { forwardRef as V, useRef as q, useState as A, useImperativeHandle as B, useEffect as G } from "react";
|
|
3
3
|
import { P as t } from "./index-BYnWp42a.js";
|
|
4
4
|
import { n as y } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
5
|
-
import { a as $, g as
|
|
6
|
-
import { u as
|
|
7
|
-
const
|
|
5
|
+
import { a as $, g as J } from "./utils-C52T57HO.js";
|
|
6
|
+
import { u as K } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
|
|
7
|
+
const Q = (e, r, o, u, s) => {
|
|
8
8
|
if (e === "right" || e === "left" || r && o) return "height: 100%;";
|
|
9
9
|
if (!(r && s === !0))
|
|
10
10
|
return r ? "height: " + u + ";" : "height: 0;";
|
|
11
|
-
},
|
|
11
|
+
}, R = (e, r, o, u, s) => {
|
|
12
12
|
if (e === "top" || e === "bottom" || r && o) return "width: 100%;";
|
|
13
13
|
if (!(r && s === !0))
|
|
14
14
|
return r ? "width: " + u + ";" : "width: 0;";
|
|
15
|
-
},
|
|
15
|
+
}, Z = y.div`
|
|
16
16
|
touch-action: none;
|
|
17
17
|
overflow: auto;
|
|
18
18
|
max-height: ${(e) => e.isOpen || e.unsetHeight === !1 ? "100dvh" : 0};
|
|
19
|
-
${(e) =>
|
|
19
|
+
${(e) => Q(
|
|
20
20
|
e.direction,
|
|
21
21
|
e.isOpen,
|
|
22
22
|
e.isFullPage,
|
|
@@ -24,7 +24,7 @@ const J = (e, r, o, u, s) => {
|
|
|
24
24
|
e.unsetHeight
|
|
25
25
|
)}
|
|
26
26
|
max-width: ${(e) => e.isOpen || e.unsetWidth === !1 ? "100vw" : 0};
|
|
27
|
-
${(e) =>
|
|
27
|
+
${(e) => R(
|
|
28
28
|
e.direction,
|
|
29
29
|
e.isOpen,
|
|
30
30
|
e.isFullPage,
|
|
@@ -52,8 +52,8 @@ const J = (e, r, o, u, s) => {
|
|
|
52
52
|
"background"
|
|
53
53
|
)};
|
|
54
54
|
color: ${(e) => $(e.theme, "Drawer", e.color, "enabled", "text")};
|
|
55
|
-
${(e) =>
|
|
56
|
-
`,
|
|
55
|
+
${(e) => J(e.theme, "Drawer", e.size, "enabled")};
|
|
56
|
+
`, _ = y.div`
|
|
57
57
|
z-index: ${(e) => e.zIndex};
|
|
58
58
|
position: fixed;
|
|
59
59
|
top: 0;
|
|
@@ -62,7 +62,7 @@ const J = (e, r, o, u, s) => {
|
|
|
62
62
|
height: ${(e) => e.isOpen === !0 && e.enableOverlay === !0 ? "100dvh" : 0};
|
|
63
63
|
width: ${(e) => e.isOpen === !0 && e.enableOverlay === !0 ? "100vw" : 0};
|
|
64
64
|
background-color: ${(e) => e.overlayColor};
|
|
65
|
-
`, ee =
|
|
65
|
+
`, ee = V((e, r) => {
|
|
66
66
|
const {
|
|
67
67
|
direction: o = "right",
|
|
68
68
|
open: u = !1,
|
|
@@ -88,7 +88,7 @@ const J = (e, r, o, u, s) => {
|
|
|
88
88
|
drawerSize: F = "12.5rem",
|
|
89
89
|
children: W,
|
|
90
90
|
...E
|
|
91
|
-
} = e, M =
|
|
91
|
+
} = e, M = K(), i = q(), [f, b] = A(!1);
|
|
92
92
|
var d = null, h = null;
|
|
93
93
|
function j(n) {
|
|
94
94
|
return n.touches || n.originalEvent.touches;
|
|
@@ -103,7 +103,7 @@ const J = (e, r, o, u, s) => {
|
|
|
103
103
|
Math.abs(w) > Math.abs(v) ? w > 0 ? c == !0 && o == "left" && l() : c == !0 && o == "right" && l() : v > 0 ? c == !0 && o == "top" && l() : c == !0 && o == "bottom" && l(), d = null, h = null;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
-
|
|
106
|
+
B(r, () => ({
|
|
107
107
|
open() {
|
|
108
108
|
U();
|
|
109
109
|
},
|
|
@@ -119,7 +119,7 @@ const J = (e, r, o, u, s) => {
|
|
|
119
119
|
}, l = (n) => {
|
|
120
120
|
b(!1), C(n);
|
|
121
121
|
};
|
|
122
|
-
return
|
|
122
|
+
return G(() => {
|
|
123
123
|
const n = (a) => {
|
|
124
124
|
i != null && i.current && !(i != null && i.current.contains(a.target)) && x == !0 && l();
|
|
125
125
|
};
|
|
@@ -127,14 +127,14 @@ const J = (e, r, o, u, s) => {
|
|
|
127
127
|
document.removeEventListener("click", n, !0);
|
|
128
128
|
};
|
|
129
129
|
}, []), /* @__PURE__ */ g(Y, { children: /* @__PURE__ */ g(
|
|
130
|
-
|
|
130
|
+
_,
|
|
131
131
|
{
|
|
132
132
|
enableOverlay: O,
|
|
133
133
|
overlayColor: I,
|
|
134
134
|
isOpen: f,
|
|
135
135
|
zIndex: m,
|
|
136
136
|
children: /* @__PURE__ */ g(
|
|
137
|
-
|
|
137
|
+
Z,
|
|
138
138
|
{
|
|
139
139
|
ref: i,
|
|
140
140
|
zIndex: m,
|
package/dist/TabItem.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as j } from "react/jsx-runtime";
|
|
2
|
-
import D,
|
|
2
|
+
import { forwardRef as D, useState as H } from "react";
|
|
3
3
|
import { P as t } from "./index-BYnWp42a.js";
|
|
4
4
|
import { n as I } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
5
5
|
import { h as S, g as A, a as i, b as o } from "./utils-C52T57HO.js";
|
|
@@ -17,21 +17,21 @@ const K = (e) => e == "small" ? "3.125rem" : e == "medium" ? "3.375rem" : "3.625
|
|
|
17
17
|
height: ${(e) => K(e.size)};
|
|
18
18
|
${(e) => A(
|
|
19
19
|
e.theme,
|
|
20
|
-
|
|
20
|
+
a(e.type),
|
|
21
21
|
e.size,
|
|
22
22
|
"enabled"
|
|
23
23
|
)};
|
|
24
24
|
${(e) => !e.disabled && "cursor: pointer"};
|
|
25
25
|
color: ${(e) => !e.disabled && i(
|
|
26
26
|
e.theme,
|
|
27
|
-
|
|
27
|
+
a(e.type),
|
|
28
28
|
e.color,
|
|
29
29
|
e.active ? "active" : "enabled",
|
|
30
30
|
"text"
|
|
31
31
|
)};
|
|
32
32
|
background-color: ${(e) => e.type == "regular" || e.type == "pill" && (e.disabled == !0 || e.active == !1) ? "transparent" : !e.disabled && i(
|
|
33
33
|
e.theme,
|
|
34
|
-
|
|
34
|
+
a(e.type),
|
|
35
35
|
e.color,
|
|
36
36
|
e.active ? "active" : "enabled",
|
|
37
37
|
"background",
|
|
@@ -39,7 +39,7 @@ const K = (e) => e == "small" ? "3.125rem" : e == "medium" ? "3.375rem" : "3.625
|
|
|
39
39
|
)};
|
|
40
40
|
${(e) => e.type == "underline" && e.last == !1 && "border-right: 1px solid " + i(
|
|
41
41
|
e.theme,
|
|
42
|
-
|
|
42
|
+
a(e.type),
|
|
43
43
|
e.color,
|
|
44
44
|
"enabled",
|
|
45
45
|
"line"
|
|
@@ -52,18 +52,18 @@ const K = (e) => e == "small" ? "3.125rem" : e == "medium" ? "3.375rem" : "3.625
|
|
|
52
52
|
e.color,
|
|
53
53
|
"enabled"
|
|
54
54
|
)};
|
|
55
|
-
${(e) =>
|
|
55
|
+
${(e) => E(e.theme, e.type, e.first, e.last)};
|
|
56
56
|
&:hover {
|
|
57
57
|
color: ${(e) => !e.disabled && i(
|
|
58
58
|
e.theme,
|
|
59
|
-
|
|
59
|
+
a(e.type),
|
|
60
60
|
e.color,
|
|
61
61
|
"hover",
|
|
62
62
|
"text"
|
|
63
63
|
)};
|
|
64
64
|
background-color: ${(e) => e.type == "regular" ? "transparent" : !e.disabled && i(
|
|
65
65
|
e.theme,
|
|
66
|
-
|
|
66
|
+
a(e.type),
|
|
67
67
|
e.color,
|
|
68
68
|
"hover",
|
|
69
69
|
"background",
|
|
@@ -81,36 +81,36 @@ const K = (e) => e == "small" ? "3.125rem" : e == "medium" ? "3.375rem" : "3.625
|
|
|
81
81
|
&:active {
|
|
82
82
|
background: ${(e) => i(
|
|
83
83
|
e.theme,
|
|
84
|
-
|
|
84
|
+
a(e.type),
|
|
85
85
|
e.color,
|
|
86
86
|
"active",
|
|
87
87
|
"background",
|
|
88
88
|
"backgroundOpacity"
|
|
89
89
|
)};
|
|
90
90
|
}
|
|
91
|
-
`,
|
|
92
|
-
if (
|
|
91
|
+
`, a = (e) => e == "underline" ? "TabUnderline" : e == "pill" ? "TabPill" : "TabRegular", E = (e, r, n, l) => {
|
|
92
|
+
if (r == "pill")
|
|
93
93
|
return `border-radius: ${o(e, "regular")}`;
|
|
94
|
-
if (
|
|
94
|
+
if (r == "underline" && n)
|
|
95
95
|
return `border-radius: ${o(
|
|
96
96
|
e,
|
|
97
97
|
"regular"
|
|
98
98
|
)} 0 0 ${o(e, "regular")}`;
|
|
99
|
-
if (
|
|
99
|
+
if (r == "underline" && l)
|
|
100
100
|
return `border-radius: 0 ${o(
|
|
101
101
|
e,
|
|
102
102
|
"regular"
|
|
103
103
|
)} ${o(e, "regular")} 0`;
|
|
104
|
-
}, y = (e,
|
|
105
|
-
if (
|
|
106
|
-
return `border-bottom: ${!l && (n || u == "hover") ? e.components[
|
|
104
|
+
}, y = (e, r, n, l, c, u) => {
|
|
105
|
+
if (r != "pill")
|
|
106
|
+
return `border-bottom: ${!l && (n || u == "hover") ? e.components[r === "regular" ? "TabRegular" : "TabUnderline"].default.enabled.lineHeight + "" : e.components[r === "regular" ? "TabRegular" : "TabUnderline"].default.hover.lineHeight + ""} solid ${i(
|
|
107
107
|
e,
|
|
108
|
-
r
|
|
108
|
+
a(r),
|
|
109
109
|
c,
|
|
110
110
|
n && !l ? "active" : l ? "enabled" : u,
|
|
111
111
|
"line"
|
|
112
112
|
)}`;
|
|
113
|
-
},
|
|
113
|
+
}, L = D((e, r) => {
|
|
114
114
|
const {
|
|
115
115
|
type: n = "underline",
|
|
116
116
|
disabled: l,
|
|
@@ -134,16 +134,16 @@ const K = (e) => e == "small" ? "3.125rem" : e == "medium" ? "3.375rem" : "3.625
|
|
|
134
134
|
//----------------
|
|
135
135
|
size: x = "small",
|
|
136
136
|
color: C = "primary",
|
|
137
|
-
className:
|
|
138
|
-
style:
|
|
137
|
+
className: w = "",
|
|
138
|
+
style: R = {},
|
|
139
139
|
children: O,
|
|
140
140
|
...B
|
|
141
141
|
} = e, U = F(), [z, g] = H(d), N = {
|
|
142
142
|
theme: U,
|
|
143
143
|
color: C,
|
|
144
144
|
size: x,
|
|
145
|
-
style:
|
|
146
|
-
className: "lnc-ui-tabitem " +
|
|
145
|
+
style: R,
|
|
146
|
+
className: "lnc-ui-tabitem " + w
|
|
147
147
|
}, P = (W) => {
|
|
148
148
|
f && !l && f(b), m && !l && m(W);
|
|
149
149
|
};
|
|
@@ -154,7 +154,7 @@ const K = (e) => e == "small" ? "3.125rem" : e == "medium" ? "3.375rem" : "3.625
|
|
|
154
154
|
}, [s]), /* @__PURE__ */ j(
|
|
155
155
|
V,
|
|
156
156
|
{
|
|
157
|
-
ref:
|
|
157
|
+
ref: r,
|
|
158
158
|
onFocus: $,
|
|
159
159
|
onBlur: k,
|
|
160
160
|
onClick: P,
|
|
@@ -171,7 +171,7 @@ const K = (e) => e == "small" ? "3.125rem" : e == "medium" ? "3.375rem" : "3.625
|
|
|
171
171
|
}
|
|
172
172
|
);
|
|
173
173
|
});
|
|
174
|
-
|
|
174
|
+
L.propTypes = {
|
|
175
175
|
type: t.oneOf(["regular", "pill", "underline"]),
|
|
176
176
|
/**
|
|
177
177
|
* Is it first Tab Item in Tab Wrapper
|
|
@@ -206,5 +206,5 @@ E.propTypes = {
|
|
|
206
206
|
size: t.oneOf(["small", "medium", "large"])
|
|
207
207
|
};
|
|
208
208
|
export {
|
|
209
|
-
|
|
209
|
+
L as default
|
|
210
210
|
};
|
package/dist/Tabs.js
CHANGED
|
@@ -1,55 +1,61 @@
|
|
|
1
1
|
import { jsx as T } from "react/jsx-runtime";
|
|
2
|
-
import
|
|
2
|
+
import { forwardRef as j, useState as v, Children as c, cloneElement as P } from "react";
|
|
3
3
|
import { P as e } from "./index-BYnWp42a.js";
|
|
4
|
-
import { n as
|
|
5
|
-
import { u as
|
|
6
|
-
const
|
|
4
|
+
import { n as W } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
5
|
+
import { u as k } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
|
|
6
|
+
const w = W.div`
|
|
7
7
|
background: transparent;
|
|
8
8
|
display: flex;
|
|
9
9
|
justify-content: ${(t) => t.fullWidth ? "space-evenly" : "none"};
|
|
10
10
|
gap: ${(t) => t.type == "pill" ? "10px" : "0"};
|
|
11
11
|
box-sizing: border-box;
|
|
12
|
-
`,
|
|
12
|
+
`, z = j((t, m) => {
|
|
13
13
|
const {
|
|
14
|
-
type:
|
|
15
|
-
fullWidth:
|
|
14
|
+
type: o = "regular",
|
|
15
|
+
fullWidth: r = !1,
|
|
16
16
|
//----------------
|
|
17
17
|
className: p = "",
|
|
18
18
|
style: d = {},
|
|
19
19
|
color: n = "primary",
|
|
20
|
-
size:
|
|
21
|
-
children:
|
|
20
|
+
size: a = "small",
|
|
21
|
+
children: i,
|
|
22
22
|
...f
|
|
23
|
-
} = t, u =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
23
|
+
} = t, u = k(), [y, h] = v(), g = {
|
|
24
|
+
theme: u,
|
|
25
|
+
color: n,
|
|
26
|
+
size: a,
|
|
27
|
+
style: d,
|
|
28
|
+
className: "lnc-ui-tabs " + p
|
|
29
|
+
}, b = (s) => {
|
|
30
|
+
h(s);
|
|
31
|
+
}, x = c.map(
|
|
32
|
+
i,
|
|
33
|
+
(s, l) => P(s, {
|
|
34
|
+
type: o,
|
|
35
|
+
first: l == 0,
|
|
36
|
+
last: l == c.toArray(i).length - 1,
|
|
37
|
+
fullWidth: r,
|
|
38
|
+
index: l,
|
|
33
39
|
itemClick: b,
|
|
34
40
|
activeIndex: y,
|
|
35
41
|
color: n,
|
|
36
|
-
size:
|
|
37
|
-
fullWidth:
|
|
42
|
+
size: a,
|
|
43
|
+
fullWidth: r
|
|
38
44
|
})
|
|
39
45
|
);
|
|
40
46
|
return /* @__PURE__ */ T(
|
|
41
|
-
|
|
47
|
+
w,
|
|
42
48
|
{
|
|
43
49
|
ref: m,
|
|
44
|
-
type:
|
|
45
|
-
fullWidth:
|
|
50
|
+
type: o,
|
|
51
|
+
fullWidth: r,
|
|
46
52
|
...g,
|
|
47
53
|
...f,
|
|
48
54
|
children: x
|
|
49
55
|
}
|
|
50
56
|
);
|
|
51
57
|
});
|
|
52
|
-
|
|
58
|
+
z.propTypes = {
|
|
53
59
|
type: e.oneOf(["regular", "pill", "underline"]),
|
|
54
60
|
fullWidth: e.bool,
|
|
55
61
|
//---------------------------------------------------------------
|
|
@@ -68,5 +74,5 @@ W.propTypes = {
|
|
|
68
74
|
size: e.oneOf(["small", "medium", "large"])
|
|
69
75
|
};
|
|
70
76
|
export {
|
|
71
|
-
|
|
77
|
+
z as default
|
|
72
78
|
};
|
package/dist/TextAreaInput.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as W } from "react/jsx-runtime";
|
|
2
2
|
import { P as o } from "./index-BYnWp42a.js";
|
|
3
3
|
import * as v from "react";
|
|
4
|
-
import
|
|
4
|
+
import { useRef as Y, useCallback as A, forwardRef as D, useState as H, useEffect as $ } from "react";
|
|
5
5
|
import { d as X } from "./index-CNBqQrtK.js";
|
|
6
6
|
import { n as Z } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
7
7
|
import { g as q, d as J, a as z, b as K, e as Q, h as ee } from "./utils-C52T57HO.js";
|
|
@@ -77,8 +77,8 @@ var ie = function(t) {
|
|
|
77
77
|
}
|
|
78
78
|
t.current = r;
|
|
79
79
|
}, de = function(t, r) {
|
|
80
|
-
var n =
|
|
81
|
-
return
|
|
80
|
+
var n = Y();
|
|
81
|
+
return A(function(a) {
|
|
82
82
|
t.current = a, n.current && B(n.current, null), n.current = r, r && B(r, a);
|
|
83
83
|
}, [r]);
|
|
84
84
|
}, O = {
|
|
@@ -102,7 +102,7 @@ var ie = function(t) {
|
|
|
102
102
|
};
|
|
103
103
|
function se(e, t, r, n) {
|
|
104
104
|
r === void 0 && (r = 1), n === void 0 && (n = 1 / 0), d || (d = document.createElement("textarea"), d.setAttribute("tabindex", "-1"), d.setAttribute("aria-hidden", "true"), k(d)), d.parentNode === null && document.body.appendChild(d);
|
|
105
|
-
var a = e.paddingSize,
|
|
105
|
+
var a = e.paddingSize, f = e.borderSize, s = e.sizingStyle, S = s.boxSizing;
|
|
106
106
|
Object.keys(s).forEach(function(g) {
|
|
107
107
|
var m = g;
|
|
108
108
|
d.style[m] = s[m];
|
|
@@ -110,9 +110,9 @@ function se(e, t, r, n) {
|
|
|
110
110
|
var i = M(d, e);
|
|
111
111
|
d.value = t, i = M(d, e), d.value = "x";
|
|
112
112
|
var u = d.scrollHeight - a, l = u * r;
|
|
113
|
-
S === "border-box" && (l = l + a +
|
|
113
|
+
S === "border-box" && (l = l + a + f), i = Math.max(l, i);
|
|
114
114
|
var c = u * n;
|
|
115
|
-
return S === "border-box" && (c = c + a +
|
|
115
|
+
return S === "border-box" && (c = c + a + f), i = Math.min(c, i), [i, u];
|
|
116
116
|
}
|
|
117
117
|
var V = function() {
|
|
118
118
|
}, le = function(t, r) {
|
|
@@ -145,22 +145,22 @@ var V = function() {
|
|
|
145
145
|
"wordBreak",
|
|
146
146
|
"wordSpacing",
|
|
147
147
|
"scrollbarGutter"
|
|
148
|
-
],
|
|
148
|
+
], he = !!document.documentElement.currentStyle, fe = function(t) {
|
|
149
149
|
var r = window.getComputedStyle(t);
|
|
150
150
|
if (r === null)
|
|
151
151
|
return null;
|
|
152
152
|
var n = le(ce, r), a = n.boxSizing;
|
|
153
153
|
if (a === "")
|
|
154
154
|
return null;
|
|
155
|
-
|
|
156
|
-
var
|
|
155
|
+
he && a === "border-box" && (n.width = parseFloat(n.width) + parseFloat(n.borderRightWidth) + parseFloat(n.borderLeftWidth) + parseFloat(n.paddingRight) + parseFloat(n.paddingLeft) + "px");
|
|
156
|
+
var f = parseFloat(n.paddingBottom) + parseFloat(n.paddingTop), s = parseFloat(n.borderBottomWidth) + parseFloat(n.borderTopWidth);
|
|
157
157
|
return {
|
|
158
158
|
sizingStyle: n,
|
|
159
|
-
paddingSize:
|
|
159
|
+
paddingSize: f,
|
|
160
160
|
borderSize: s
|
|
161
161
|
};
|
|
162
|
-
}, ge =
|
|
163
|
-
function
|
|
162
|
+
}, ge = fe;
|
|
163
|
+
function N(e, t, r) {
|
|
164
164
|
var n = ie(r);
|
|
165
165
|
v.useLayoutEffect(function() {
|
|
166
166
|
var a = function(s) {
|
|
@@ -173,15 +173,15 @@ function A(e, t, r) {
|
|
|
173
173
|
}, []);
|
|
174
174
|
}
|
|
175
175
|
var me = function(t) {
|
|
176
|
-
|
|
176
|
+
N(window, "resize", t);
|
|
177
177
|
}, be = function(t) {
|
|
178
|
-
|
|
178
|
+
N(document.fonts, "loadingdone", t);
|
|
179
179
|
}, pe = ["cacheMeasurements", "maxRows", "minRows", "onChange", "onHeightChange"], ve = function(t, r) {
|
|
180
|
-
var n = t.cacheMeasurements, a = t.maxRows,
|
|
180
|
+
var n = t.cacheMeasurements, a = t.maxRows, f = t.minRows, s = t.onChange, S = s === void 0 ? V : s, i = t.onHeightChange, u = i === void 0 ? V : i, l = ne(t, pe), c = l.value !== void 0, g = v.useRef(null), m = de(g, r), C = v.useRef(0), R = v.useRef(), x = function() {
|
|
181
181
|
var b = g.current, y = n && R.current ? R.current : ge(b);
|
|
182
182
|
if (y) {
|
|
183
183
|
R.current = y;
|
|
184
|
-
var T = se(y, b.value || b.placeholder || "x",
|
|
184
|
+
var T = se(y, b.value || b.placeholder || "x", f, a), p = T[0], L = T[1];
|
|
185
185
|
C.current !== p && (C.current = p, b.style.setProperty("height", p + "px", "important"), u(p, {
|
|
186
186
|
rowHeight: L
|
|
187
187
|
}));
|
|
@@ -194,12 +194,12 @@ var me = function(t) {
|
|
|
194
194
|
ref: m
|
|
195
195
|
}));
|
|
196
196
|
}, xe = /* @__PURE__ */ v.forwardRef(ve);
|
|
197
|
-
const ye =
|
|
197
|
+
const ye = D((e, t) => {
|
|
198
198
|
const {
|
|
199
199
|
disabled: r,
|
|
200
200
|
readOnly: n,
|
|
201
201
|
value: a,
|
|
202
|
-
defaultValue:
|
|
202
|
+
defaultValue: f,
|
|
203
203
|
debounceTime: s = 180,
|
|
204
204
|
type: S = "textarea",
|
|
205
205
|
collapseOnBlur: i = !1,
|
|
@@ -215,7 +215,7 @@ const ye = Y.forwardRef((e, t) => {
|
|
|
215
215
|
size: x = "small",
|
|
216
216
|
color: I = "primary",
|
|
217
217
|
...E
|
|
218
|
-
} = e, [b, y] = H(a ||
|
|
218
|
+
} = e, [b, y] = H(a || f || ""), T = re(), [p, L] = H(!1), [_, j] = H(u), [P, w] = H(
|
|
219
219
|
i ? u : l
|
|
220
220
|
);
|
|
221
221
|
$(() => {
|
|
@@ -225,11 +225,11 @@ const ye = Y.forwardRef((e, t) => {
|
|
|
225
225
|
}, [u, l]), $(() => {
|
|
226
226
|
w(i ? p === !0 ? l : u : l);
|
|
227
227
|
}, [i]);
|
|
228
|
-
const U =
|
|
229
|
-
X((
|
|
228
|
+
const U = A(
|
|
229
|
+
X((h, F) => G(h, F), s),
|
|
230
230
|
[c]
|
|
231
|
-
), G = (
|
|
232
|
-
c && (c == null || c(
|
|
231
|
+
), G = (h, F) => {
|
|
232
|
+
c && (c == null || c(h, F));
|
|
233
233
|
};
|
|
234
234
|
return /* @__PURE__ */ W(
|
|
235
235
|
oe,
|
|
@@ -250,16 +250,16 @@ const ye = Y.forwardRef((e, t) => {
|
|
|
250
250
|
disabled: r,
|
|
251
251
|
value: b,
|
|
252
252
|
readOnly: n,
|
|
253
|
-
minRows:
|
|
253
|
+
minRows: _,
|
|
254
254
|
maxRows: P,
|
|
255
|
-
onChange: (
|
|
256
|
-
y(
|
|
255
|
+
onChange: (h) => {
|
|
256
|
+
y(h.target.value), U(h, h.target.value);
|
|
257
257
|
},
|
|
258
|
-
onFocus: (
|
|
259
|
-
L(!0), i && w(l), m == null || m(
|
|
258
|
+
onFocus: (h) => {
|
|
259
|
+
L(!0), i && w(l), m == null || m(h);
|
|
260
260
|
},
|
|
261
|
-
onBlur: (
|
|
262
|
-
L(!1), i && w(u), g == null || g(
|
|
261
|
+
onBlur: (h) => {
|
|
262
|
+
L(!1), i && w(u), g == null || g(h);
|
|
263
263
|
},
|
|
264
264
|
...E
|
|
265
265
|
}
|
package/dist/TextInput.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { jsxs as W, jsx as b } from "react/jsx-runtime";
|
|
2
2
|
import { P as t } from "./index-BYnWp42a.js";
|
|
3
|
-
import U,
|
|
4
|
-
import { d as
|
|
3
|
+
import { forwardRef as U, useState as C, useEffect as D, useCallback as E } from "react";
|
|
4
|
+
import { d as q } from "./index-CNBqQrtK.js";
|
|
5
5
|
import { n as u } from "./emotion-styled.browser.esm-BiK8DcgW.js";
|
|
6
|
-
import { d as s, a, b as
|
|
7
|
-
import { u as
|
|
8
|
-
const
|
|
6
|
+
import { d as s, a, b as A, e as G, h as O, g as H } from "./utils-C52T57HO.js";
|
|
7
|
+
import { u as J } from "./emotion-element-5486c51c.browser.esm-Bb4VkP8U.js";
|
|
8
|
+
const K = u.div`
|
|
9
9
|
display: flex;
|
|
10
10
|
align-items: center;
|
|
11
11
|
|
|
@@ -26,9 +26,9 @@ const J = u.div`
|
|
|
26
26
|
e.disabled === !0 ? "disabled" : "enabled",
|
|
27
27
|
"border"
|
|
28
28
|
)};
|
|
29
|
-
border-radius: ${(e) =>
|
|
29
|
+
border-radius: ${(e) => A(e.theme, "regular")};
|
|
30
30
|
|
|
31
|
-
${(e) => e.focused && e.readOnly !== !0 ?
|
|
31
|
+
${(e) => e.focused && e.readOnly !== !0 ? G(e.theme) : ""}
|
|
32
32
|
${(e) => e.disabled === !0 ? O(e.theme) : ""}
|
|
33
33
|
`, S = u.span`
|
|
34
34
|
padding: 0 12px;
|
|
@@ -39,7 +39,7 @@ const J = u.div`
|
|
|
39
39
|
"enabled",
|
|
40
40
|
"prefix"
|
|
41
41
|
)};
|
|
42
|
-
`,
|
|
42
|
+
`, L = u(S)``, M = u.input`
|
|
43
43
|
background: none;
|
|
44
44
|
border: none;
|
|
45
45
|
outline: none;
|
|
@@ -47,7 +47,7 @@ const J = u.div`
|
|
|
47
47
|
padding-bottom: 0.625rem;
|
|
48
48
|
width: 100%;
|
|
49
49
|
|
|
50
|
-
${(e) =>
|
|
50
|
+
${(e) => H(e.theme, "Input", e.size, "enabled")}
|
|
51
51
|
min-height: ${(e) => s(e.theme, e.size)};
|
|
52
52
|
max-height: ${(e) => s(e.theme, e.size)};
|
|
53
53
|
color: ${(e) => a(
|
|
@@ -79,7 +79,7 @@ const J = u.div`
|
|
|
79
79
|
${(e) => O(e.theme)}
|
|
80
80
|
background: none;
|
|
81
81
|
}
|
|
82
|
-
`,
|
|
82
|
+
`, Q = U((e, T) => {
|
|
83
83
|
const {
|
|
84
84
|
disabled: y,
|
|
85
85
|
readOnly: x,
|
|
@@ -101,18 +101,18 @@ const J = u.div`
|
|
|
101
101
|
size: p = "small",
|
|
102
102
|
color: o = "primary",
|
|
103
103
|
...N
|
|
104
|
-
} = e, d =
|
|
105
|
-
|
|
104
|
+
} = e, d = J(), [j, $] = C(l || V || ""), [i, I] = C(!1);
|
|
105
|
+
D(() => {
|
|
106
106
|
l != null && $(l);
|
|
107
107
|
}, [l]);
|
|
108
|
-
const
|
|
109
|
-
|
|
108
|
+
const P = E(
|
|
109
|
+
q((n, g) => R(n, g), z),
|
|
110
110
|
[r]
|
|
111
|
-
),
|
|
111
|
+
), R = (n, g) => {
|
|
112
112
|
r && (r == null || r(n, g));
|
|
113
113
|
};
|
|
114
114
|
return /* @__PURE__ */ W(
|
|
115
|
-
|
|
115
|
+
K,
|
|
116
116
|
{
|
|
117
117
|
style: F,
|
|
118
118
|
className: B,
|
|
@@ -134,7 +134,7 @@ const J = u.div`
|
|
|
134
134
|
}
|
|
135
135
|
),
|
|
136
136
|
/* @__PURE__ */ b(
|
|
137
|
-
|
|
137
|
+
M,
|
|
138
138
|
{
|
|
139
139
|
ref: T,
|
|
140
140
|
type: v,
|
|
@@ -154,15 +154,15 @@ const J = u.div`
|
|
|
154
154
|
I(!1), f == null || f(n);
|
|
155
155
|
},
|
|
156
156
|
onChange: (n) => {
|
|
157
|
-
$(n.target.value),
|
|
157
|
+
$(n.target.value), P(n, n.target.value);
|
|
158
158
|
},
|
|
159
159
|
tabIndex: w,
|
|
160
|
-
value:
|
|
160
|
+
value: j,
|
|
161
161
|
...N
|
|
162
162
|
}
|
|
163
163
|
),
|
|
164
164
|
m && /* @__PURE__ */ b(
|
|
165
|
-
|
|
165
|
+
L,
|
|
166
166
|
{
|
|
167
167
|
theme: d,
|
|
168
168
|
color: o,
|
|
@@ -175,7 +175,7 @@ const J = u.div`
|
|
|
175
175
|
}
|
|
176
176
|
);
|
|
177
177
|
});
|
|
178
|
-
|
|
178
|
+
Q.propTypes = {
|
|
179
179
|
id: t.string,
|
|
180
180
|
defaultValue: t.string,
|
|
181
181
|
value: t.string,
|
|
@@ -223,5 +223,5 @@ M.propTypes = {
|
|
|
223
223
|
])
|
|
224
224
|
};
|
|
225
225
|
export {
|
|
226
|
-
|
|
226
|
+
Q as default
|
|
227
227
|
};
|