@iress-oss/ids-components 6.0.0-alpha.19 → 6.0.0-alpha.20
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/Input/Input.js +55 -55
- package/dist/components/Input/Input.styles.d.ts +7 -0
- package/dist/components/Input/Input.styles.js +8 -1
- package/dist/components/Popover/Popover.styles.js +1 -1
- package/dist/components/Slideout/Slideout.styles.js +1 -1
- package/dist/patterns/Shadow/Shadow.js +8 -0
- package/dist/style.css +1 -1
- package/package.json +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as U, useRef as
|
|
1
|
+
import { jsx as s, jsxs as b } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as U, useRef as M, useState as Y, useImperativeHandle as $, useEffect as z } from "react";
|
|
3
3
|
import { GlobalCSSClass as h } from "../../enums.js";
|
|
4
4
|
import { getFormControlValueAsString as J } from "../../helpers/form/getFormControlValueAsString.js";
|
|
5
5
|
import { InputBase as K } from "./InputBase/InputBase.js";
|
|
@@ -15,127 +15,127 @@ import { s as _ } from "../../is-valid-prop-DweT-eOL.js";
|
|
|
15
15
|
import { useNoDefaultValueInForms as ee } from "../../patterns/Form/hooks/useNoDefaultValueInForms.js";
|
|
16
16
|
import "../../Button-BTkololu.js";
|
|
17
17
|
import { IressCloseButton as te } from "../Button/CloseButton/CloseButton.js";
|
|
18
|
-
const
|
|
18
|
+
const re = ({ rows: t, ...c }, P) => {
|
|
19
19
|
const {
|
|
20
20
|
loading: d = !1,
|
|
21
|
-
clearable:
|
|
21
|
+
clearable: D = !1,
|
|
22
22
|
defaultValue: g,
|
|
23
|
-
onClear:
|
|
24
|
-
width:
|
|
23
|
+
onClear: E,
|
|
24
|
+
width: R,
|
|
25
25
|
prepend: v,
|
|
26
26
|
append: p,
|
|
27
|
-
onChange:
|
|
27
|
+
onChange: B,
|
|
28
28
|
className: I,
|
|
29
|
-
readOnly:
|
|
29
|
+
readOnly: G,
|
|
30
30
|
formatter: m,
|
|
31
|
-
type:
|
|
32
|
-
inline:
|
|
31
|
+
type: T,
|
|
32
|
+
inline: j,
|
|
33
33
|
alignRight: C,
|
|
34
|
-
...
|
|
34
|
+
...r
|
|
35
35
|
} = c;
|
|
36
|
-
let
|
|
37
|
-
|
|
36
|
+
let o = t !== void 0 ? c.autoGrow : void 0;
|
|
37
|
+
o === !0 && (o = 5), ee({
|
|
38
38
|
component: "IressInput",
|
|
39
39
|
defaultValue: g
|
|
40
40
|
});
|
|
41
|
-
const
|
|
41
|
+
const a = M(null), f = M(null), { value: i, setValue: y } = Q({
|
|
42
42
|
component: "IressInput",
|
|
43
43
|
defaultValue: g,
|
|
44
44
|
value: c.value
|
|
45
|
-
}), x = J(i), [w, F] = Y(!1), [
|
|
46
|
-
let
|
|
47
|
-
if (t !== void 0 && (
|
|
48
|
-
|
|
45
|
+
}), x = J(i), [w, F] = Y(!1), [H, O] = _(r), N = m && !w ? m(i) : x;
|
|
46
|
+
let S = m && !w ? { type: "text" } : { type: T };
|
|
47
|
+
if (t !== void 0 && (S = void 0), $(
|
|
48
|
+
P,
|
|
49
49
|
() => ({
|
|
50
|
-
...
|
|
50
|
+
...a.current,
|
|
51
51
|
extras: {
|
|
52
52
|
additionalOnChangeProps: ["onClear"]
|
|
53
53
|
}
|
|
54
54
|
})
|
|
55
55
|
), z(() => {
|
|
56
|
-
if (t &&
|
|
57
|
-
const e =
|
|
56
|
+
if (t && o && a.current) {
|
|
57
|
+
const e = a.current.input;
|
|
58
58
|
if (!e) return;
|
|
59
59
|
e.style.height = "auto";
|
|
60
|
-
const
|
|
61
|
-
e.style.height = `${A}px`, e.style.overflowY = e.scrollHeight >
|
|
60
|
+
const V = parseFloat(getComputedStyle(e).lineHeight) * 1.075 * o, A = Math.min(e.scrollHeight, V);
|
|
61
|
+
e.style.height = `${A}px`, e.style.overflowY = e.scrollHeight > V ? "auto" : "hidden";
|
|
62
62
|
}
|
|
63
|
-
}, [i, t,
|
|
64
|
-
return /* @__PURE__ */
|
|
63
|
+
}, [i, t, o]), G)
|
|
64
|
+
return /* @__PURE__ */ s(
|
|
65
65
|
W,
|
|
66
66
|
{
|
|
67
|
-
...
|
|
67
|
+
...r,
|
|
68
68
|
defaultValue: void 0,
|
|
69
69
|
value: i,
|
|
70
70
|
alignRight: C,
|
|
71
71
|
append: p,
|
|
72
72
|
className: I,
|
|
73
|
-
children:
|
|
73
|
+
children: N
|
|
74
74
|
}
|
|
75
75
|
);
|
|
76
76
|
const k = (e) => {
|
|
77
|
-
y(""),
|
|
78
|
-
const
|
|
77
|
+
y(""), a.current?.focus();
|
|
78
|
+
const n = new Event("change", {
|
|
79
79
|
bubbles: !0
|
|
80
80
|
});
|
|
81
|
-
Object.defineProperty(
|
|
81
|
+
Object.defineProperty(n, "target", {
|
|
82
82
|
writable: !1,
|
|
83
83
|
value: { value: "", ...e.target }
|
|
84
|
-
}),
|
|
84
|
+
}), E?.(n);
|
|
85
85
|
}, q = (e) => {
|
|
86
|
-
const
|
|
87
|
-
y(
|
|
86
|
+
const n = e.target.value;
|
|
87
|
+
y(n), B?.(e, n);
|
|
88
88
|
}, l = X({
|
|
89
89
|
alignRight: C,
|
|
90
|
-
autoGrow: !!
|
|
91
|
-
inline:
|
|
90
|
+
autoGrow: !!o,
|
|
91
|
+
inline: j,
|
|
92
92
|
isTextarea: t !== void 0,
|
|
93
|
-
|
|
93
|
+
stretched: !!H.stretch,
|
|
94
|
+
width: R
|
|
94
95
|
});
|
|
95
|
-
return /* @__PURE__ */
|
|
96
|
+
return /* @__PURE__ */ b(
|
|
96
97
|
Z.div,
|
|
97
98
|
{
|
|
98
99
|
className: u(
|
|
99
|
-
// classes.root,
|
|
100
100
|
h.FormElement,
|
|
101
101
|
h.Input,
|
|
102
102
|
I,
|
|
103
103
|
l.wrapper,
|
|
104
104
|
h.FormElementInner
|
|
105
105
|
),
|
|
106
|
-
"data-testid":
|
|
107
|
-
...
|
|
106
|
+
"data-testid": r["data-testid"],
|
|
107
|
+
...H,
|
|
108
108
|
children: [
|
|
109
|
-
v && /* @__PURE__ */
|
|
110
|
-
/* @__PURE__ */
|
|
109
|
+
v && /* @__PURE__ */ s("div", { className: u(l.addon), children: v }),
|
|
110
|
+
/* @__PURE__ */ s(
|
|
111
111
|
K,
|
|
112
112
|
{
|
|
113
113
|
...O,
|
|
114
|
-
...
|
|
114
|
+
...S,
|
|
115
115
|
className: l.formControl,
|
|
116
|
-
value:
|
|
116
|
+
value: N,
|
|
117
117
|
onChange: q,
|
|
118
118
|
onFocus: (e) => {
|
|
119
|
-
F(!0),
|
|
119
|
+
F(!0), r?.onFocus?.(e), f.current ? f.current = null : queueMicrotask(() => e.target.select());
|
|
120
120
|
},
|
|
121
121
|
onMouseDown: (e) => {
|
|
122
|
-
|
|
122
|
+
r?.onMouseDown?.(e), f.current = !0;
|
|
123
123
|
},
|
|
124
124
|
onBlur: (e) => {
|
|
125
|
-
F(!1),
|
|
125
|
+
F(!1), r?.onBlur?.(e);
|
|
126
126
|
},
|
|
127
127
|
rows: t,
|
|
128
|
-
ref:
|
|
128
|
+
ref: a
|
|
129
129
|
}
|
|
130
130
|
),
|
|
131
|
-
/* @__PURE__ */
|
|
132
|
-
d && /* @__PURE__ */
|
|
131
|
+
/* @__PURE__ */ b("div", { className: u(l.internal), children: [
|
|
132
|
+
d && /* @__PURE__ */ s(
|
|
133
133
|
L,
|
|
134
134
|
{
|
|
135
135
|
screenreaderText: d === !0 ? "loading" : d
|
|
136
136
|
}
|
|
137
137
|
),
|
|
138
|
-
x &&
|
|
138
|
+
x && D && /* @__PURE__ */ s(
|
|
139
139
|
te,
|
|
140
140
|
{
|
|
141
141
|
onClick: k,
|
|
@@ -144,12 +144,12 @@ const oe = ({ rows: t, ...c }, M) => {
|
|
|
144
144
|
}
|
|
145
145
|
)
|
|
146
146
|
] }),
|
|
147
|
-
p && /* @__PURE__ */
|
|
147
|
+
p && /* @__PURE__ */ s("div", { className: u(l.addon), children: p })
|
|
148
148
|
]
|
|
149
149
|
}
|
|
150
150
|
);
|
|
151
|
-
},
|
|
152
|
-
|
|
151
|
+
}, oe = U(re);
|
|
152
|
+
oe.displayName = "IressInput";
|
|
153
153
|
export {
|
|
154
|
-
|
|
154
|
+
oe as IressInput
|
|
155
155
|
};
|
|
@@ -4,7 +4,7 @@ const o = r({
|
|
|
4
4
|
base: {
|
|
5
5
|
wrapper: {
|
|
6
6
|
// Performance: CSS containment limits style recalculation scope
|
|
7
|
-
contain: "
|
|
7
|
+
contain: "style paint",
|
|
8
8
|
display: "flex",
|
|
9
9
|
alignItems: "stretch",
|
|
10
10
|
borderRadius: "radius.system.form",
|
|
@@ -212,6 +212,13 @@ const o = r({
|
|
|
212
212
|
width: "[100%]"
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
+
},
|
|
216
|
+
stretched: {
|
|
217
|
+
true: {
|
|
218
|
+
formControl: {
|
|
219
|
+
height: "[100%]"
|
|
220
|
+
}
|
|
221
|
+
}
|
|
215
222
|
}
|
|
216
223
|
},
|
|
217
224
|
defaultVariants: {}
|
|
@@ -4304,6 +4304,10 @@ const z = `@layer reset, base, tokens, recipes, utilities;
|
|
|
4304
4304
|
align-items: stretch;
|
|
4305
4305
|
}
|
|
4306
4306
|
|
|
4307
|
+
.contain_style_paint {
|
|
4308
|
+
contain: style paint;
|
|
4309
|
+
}
|
|
4310
|
+
|
|
4307
4311
|
.bg-c_colour\\.neutral\\.10 {
|
|
4308
4312
|
background-color: var(--colors-colour\\.neutral\\.10);
|
|
4309
4313
|
}
|
|
@@ -4451,6 +4455,10 @@ const z = `@layer reset, base, tokens, recipes, utilities;
|
|
|
4451
4455
|
stroke-opacity: 0.5;
|
|
4452
4456
|
}
|
|
4453
4457
|
|
|
4458
|
+
.contain_style {
|
|
4459
|
+
contain: style;
|
|
4460
|
+
}
|
|
4461
|
+
|
|
4454
4462
|
.ap_none {
|
|
4455
4463
|
appearance: none;
|
|
4456
4464
|
-webkit-appearance: none;
|