@iress-oss/ids-components 6.0.0-alpha.16 → 6.0.0-alpha.18
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/Autocomplete/Autocomplete.styles.js +5 -1
- package/dist/components/Autocomplete/hooks/useAutocompleteSearch.js +53 -51
- package/dist/components/Badge/Badge.styles.js +2 -0
- package/dist/components/Card/Card.styles.d.ts +1 -1
- package/dist/components/Card/Card.styles.js +3 -1
- package/dist/components/Checkbox/Checkbox.styles.js +2 -0
- package/dist/components/Expander/Expander.styles.js +2 -0
- package/dist/components/Filter/Filter.styles.d.ts +1 -1
- package/dist/components/Filter/components/FilterSearch.d.ts +2 -1
- package/dist/components/Input/Input.d.ts +15 -6
- package/dist/components/Input/Input.js +92 -82
- package/dist/components/Input/Input.styles.d.ts +8 -0
- package/dist/components/Input/Input.styles.js +11 -1
- package/dist/components/Modal/Modal.styles.d.ts +0 -1
- package/dist/components/Modal/Modal.styles.js +7 -3
- package/dist/components/Panel/Panel.styles.js +2 -0
- package/dist/components/Popover/Popover.styles.js +2 -0
- package/dist/components/Progress/Progress.d.ts +6 -1
- package/dist/components/Progress/Progress.js +38 -36
- package/dist/components/Progress/Progress.styles.js +8 -0
- package/dist/components/Radio/Radio.styles.js +2 -0
- package/dist/components/RichSelect/RichSelect.styles.js +2 -0
- package/dist/components/RichSelect/SelectBody/SelectBody.styles.js +2 -0
- package/dist/components/RichSelect/SelectMenu/SelectMenu.styles.js +2 -0
- package/dist/components/RichSelect/SelectSearchInput/SelectSearchInput.styles.js +2 -0
- package/dist/components/RichSelect/SelectTags/SelectTags.styles.js +2 -0
- package/dist/components/Select/Select.styles.js +4 -2
- package/dist/components/Slideout/Slideout.js +1 -1
- package/dist/components/Slideout/Slideout.styles.js +4 -1
- package/dist/components/Slider/Slider.styles.js +2 -0
- package/dist/components/Spinner/Spinner.d.ts +22 -3
- package/dist/components/Spinner/Spinner.js +35 -19
- package/dist/components/Spinner/Spinner.styles.d.ts +1 -0
- package/dist/components/Spinner/Spinner.styles.js +32 -4
- package/dist/components/Spinner/index.js +3 -2
- package/dist/components/TabSet/TabSet.styles.js +2 -0
- package/dist/components/Tag/Tag.styles.d.ts +6 -0
- package/dist/components/Tag/Tag.styles.js +10 -2
- package/dist/components/Toggle/Toggle.styles.js +2 -0
- package/dist/components/Tooltip/Tooltip.styles.js +4 -2
- package/dist/main.js +108 -107
- package/dist/patterns/Loading/Loading.styles.d.ts +1 -1
- package/dist/patterns/Shadow/Shadow.js +110 -38
- package/dist/style.css +1 -1
- package/dist/styled-system/types/prop-type.d.ts +1 -1
- package/package.json +3 -2
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { useRef as
|
|
1
|
+
import { useRef as g, useState as T, useCallback as p, useEffect as _, useMemo as L } from "react";
|
|
2
2
|
import { searchLabelValues as U } from "../../../helpers/label-value/searchLabelValues.js";
|
|
3
3
|
import { highlightQueryInLabelValue as I } from "../../../helpers/label-value/highlightQueryInLabelValue.js";
|
|
4
4
|
function V(r, n, u, c) {
|
|
5
|
-
var a = this, t =
|
|
5
|
+
var a = this, t = g(null), f = g(0), s = g(0), e = g(null), i = g([]), l = g(), d = g(), E = g(r), v = g(!0);
|
|
6
6
|
E.current = r;
|
|
7
7
|
var S = typeof window < "u", m = !n && n !== 0 && S;
|
|
8
8
|
if (typeof r != "function") throw new TypeError("Expected a function");
|
|
@@ -15,42 +15,42 @@ function V(r, n, u, c) {
|
|
|
15
15
|
}, []);
|
|
16
16
|
var M = L(function() {
|
|
17
17
|
var x = function(o) {
|
|
18
|
-
var
|
|
19
|
-
return
|
|
20
|
-
}, D = function(o,
|
|
21
|
-
m && cancelAnimationFrame(e.current), e.current = m ? requestAnimationFrame(o) : setTimeout(o,
|
|
18
|
+
var h = i.current, b = l.current;
|
|
19
|
+
return i.current = l.current = null, f.current = o, s.current = s.current || o, d.current = E.current.apply(b, h);
|
|
20
|
+
}, D = function(o, h) {
|
|
21
|
+
m && cancelAnimationFrame(e.current), e.current = m ? requestAnimationFrame(o) : setTimeout(o, h);
|
|
22
22
|
}, O = function(o) {
|
|
23
23
|
if (!v.current) return !1;
|
|
24
|
-
var
|
|
25
|
-
return !t.current ||
|
|
24
|
+
var h = o - t.current;
|
|
25
|
+
return !t.current || h >= n || h < 0 || R && o - f.current >= y;
|
|
26
26
|
}, Q = function(o) {
|
|
27
|
-
return e.current = null, A &&
|
|
27
|
+
return e.current = null, A && i.current ? x(o) : (i.current = l.current = null, d.current);
|
|
28
28
|
}, F = function o() {
|
|
29
|
-
var
|
|
30
|
-
if (w && s.current === f.current && N(), O(
|
|
29
|
+
var h = Date.now();
|
|
30
|
+
if (w && s.current === f.current && N(), O(h)) return Q(h);
|
|
31
31
|
if (v.current) {
|
|
32
|
-
var b = n - (
|
|
32
|
+
var b = n - (h - t.current), k = R ? Math.min(b, y - (h - f.current)) : b;
|
|
33
33
|
D(o, k);
|
|
34
34
|
}
|
|
35
35
|
}, N = function() {
|
|
36
36
|
c && c({});
|
|
37
37
|
}, W = function() {
|
|
38
38
|
if (S || H) {
|
|
39
|
-
var o = Date.now(),
|
|
40
|
-
if (
|
|
41
|
-
if (!e.current && v.current) return f.current = t.current, D(F, n), w ? x(t.current) :
|
|
39
|
+
var o = Date.now(), h = O(o);
|
|
40
|
+
if (i.current = [].slice.call(arguments), l.current = a, t.current = o, h) {
|
|
41
|
+
if (!e.current && v.current) return f.current = t.current, D(F, n), w ? x(t.current) : d.current;
|
|
42
42
|
if (R) return D(F, n), x(t.current);
|
|
43
43
|
}
|
|
44
|
-
return e.current || D(F, n),
|
|
44
|
+
return e.current || D(F, n), d.current;
|
|
45
45
|
}
|
|
46
46
|
};
|
|
47
47
|
return W.cancel = function() {
|
|
48
48
|
var o = e.current;
|
|
49
|
-
o && (m ? cancelAnimationFrame(e.current) : clearTimeout(e.current)), f.current = 0,
|
|
49
|
+
o && (m ? cancelAnimationFrame(e.current) : clearTimeout(e.current)), f.current = 0, i.current = t.current = l.current = e.current = null, o && c && c({});
|
|
50
50
|
}, W.isPending = function() {
|
|
51
51
|
return !!e.current;
|
|
52
52
|
}, W.flush = function() {
|
|
53
|
-
return e.current ? Q(Date.now()) :
|
|
53
|
+
return e.current ? Q(Date.now()) : d.current;
|
|
54
54
|
}, W;
|
|
55
55
|
}, [w, R, n, y, A, m, S, H, c]);
|
|
56
56
|
return M;
|
|
@@ -59,15 +59,15 @@ function B(r, n) {
|
|
|
59
59
|
return r === n;
|
|
60
60
|
}
|
|
61
61
|
function C(r, n, u) {
|
|
62
|
-
var c = B, a =
|
|
62
|
+
var c = B, a = g(r), t = T({})[1], f = V(p(function(e) {
|
|
63
63
|
a.current = e, t({});
|
|
64
|
-
}, [t]), n, u, t), s =
|
|
64
|
+
}, [t]), n, u, t), s = g(r);
|
|
65
65
|
return c(s.current, r) || (f(r), s.current = r), [a.current, f];
|
|
66
66
|
}
|
|
67
67
|
const G = 500, P = 1, j = (r) => r instanceof Error && r.message ? r.message : typeof r == "string" ? r : !0, z = () => {
|
|
68
|
-
const [r, n] = T(!1), [u, c] = T(!1), [a, t] = T([]), [f, s] = T(!1), e =
|
|
68
|
+
const [r, n] = T(!1), [u, c] = T(!1), [a, t] = T([]), [f, s] = T(!1), e = p(() => {
|
|
69
69
|
t([]), n(!1), c(!1), s(!1);
|
|
70
|
-
}, []),
|
|
70
|
+
}, []), i = p(
|
|
71
71
|
(m, w) => {
|
|
72
72
|
t(
|
|
73
73
|
m.map(
|
|
@@ -76,15 +76,15 @@ const G = 500, P = 1, j = (r) => r instanceof Error && r.message ? r.message : t
|
|
|
76
76
|
), c(!1), n(!1);
|
|
77
77
|
},
|
|
78
78
|
[]
|
|
79
|
-
),
|
|
79
|
+
), l = p((m) => {
|
|
80
80
|
t([]), c(m), n(!1);
|
|
81
|
-
}, []),
|
|
81
|
+
}, []), d = p(() => {
|
|
82
82
|
c(!1);
|
|
83
|
-
}, []), E =
|
|
83
|
+
}, []), E = p((m) => {
|
|
84
84
|
n(m);
|
|
85
|
-
}, []), v =
|
|
85
|
+
}, []), v = p((m) => {
|
|
86
86
|
s(m);
|
|
87
|
-
}, []), S =
|
|
87
|
+
}, []), S = p(() => {
|
|
88
88
|
c(!1);
|
|
89
89
|
}, []);
|
|
90
90
|
return {
|
|
@@ -93,28 +93,28 @@ const G = 500, P = 1, j = (r) => r instanceof Error && r.message ? r.message : t
|
|
|
93
93
|
results: a,
|
|
94
94
|
hasSearched: f,
|
|
95
95
|
reset: e,
|
|
96
|
-
updateWithResults:
|
|
97
|
-
updateWithError:
|
|
98
|
-
clearError:
|
|
96
|
+
updateWithResults: i,
|
|
97
|
+
updateWithError: l,
|
|
98
|
+
clearError: d,
|
|
99
99
|
setLoadingState: E,
|
|
100
100
|
setSearched: v,
|
|
101
101
|
clearErrorState: S
|
|
102
102
|
};
|
|
103
103
|
}, J = (r, n) => {
|
|
104
|
-
const u =
|
|
104
|
+
const u = g(""), c = p((s) => u.current === s, []), a = p((s) => {
|
|
105
105
|
u.current = s;
|
|
106
|
-
}, []), t =
|
|
107
|
-
async (s, e,
|
|
108
|
-
if (c(e) && !
|
|
109
|
-
const
|
|
110
|
-
if (a(e), e.length >=
|
|
106
|
+
}, []), t = p(
|
|
107
|
+
async (s, e, i, l = !1) => {
|
|
108
|
+
if (c(e) && !l) return;
|
|
109
|
+
const d = ++n.current;
|
|
110
|
+
if (a(e), e.length >= i || l) {
|
|
111
111
|
r.setLoadingState(!0), r.clearErrorState();
|
|
112
112
|
try {
|
|
113
113
|
const E = await s(e);
|
|
114
|
-
if (
|
|
114
|
+
if (d !== n.current) return;
|
|
115
115
|
r.setSearched(!0), r.updateWithResults(E, e);
|
|
116
116
|
} catch (E) {
|
|
117
|
-
if (
|
|
117
|
+
if (d !== n.current) return;
|
|
118
118
|
r.setSearched(!0), r.updateWithError(
|
|
119
119
|
j(E)
|
|
120
120
|
);
|
|
@@ -123,13 +123,13 @@ const G = 500, P = 1, j = (r) => r instanceof Error && r.message ? r.message : t
|
|
|
123
123
|
r.reset();
|
|
124
124
|
},
|
|
125
125
|
[r, c, a, n]
|
|
126
|
-
), f =
|
|
127
|
-
(s, e,
|
|
128
|
-
if (!(c(e) && !
|
|
129
|
-
if (a(e), e.length >=
|
|
126
|
+
), f = p(
|
|
127
|
+
(s, e, i, l = !1) => {
|
|
128
|
+
if (!(c(e) && !l))
|
|
129
|
+
if (a(e), e.length >= i || l) {
|
|
130
130
|
r.setSearched(!0);
|
|
131
|
-
const
|
|
132
|
-
r.updateWithResults(
|
|
131
|
+
const d = U(e, s);
|
|
132
|
+
r.updateWithResults(d, e);
|
|
133
133
|
} else
|
|
134
134
|
r.reset();
|
|
135
135
|
},
|
|
@@ -146,14 +146,14 @@ const G = 500, P = 1, j = (r) => r instanceof Error && r.message ? r.message : t
|
|
|
146
146
|
options: c = [],
|
|
147
147
|
query: a = ""
|
|
148
148
|
}) => {
|
|
149
|
-
const t = z(), f =
|
|
150
|
-
(
|
|
149
|
+
const t = z(), f = g(0), s = J(t, f), [e] = C(a, r), i = p(
|
|
150
|
+
(d = !1) => {
|
|
151
151
|
if (typeof c == "function") {
|
|
152
152
|
s.handleAsync(
|
|
153
153
|
c,
|
|
154
154
|
e,
|
|
155
155
|
u,
|
|
156
|
-
|
|
156
|
+
d
|
|
157
157
|
);
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
@@ -161,12 +161,14 @@ const G = 500, P = 1, j = (r) => r instanceof Error && r.message ? r.message : t
|
|
|
161
161
|
c,
|
|
162
162
|
e,
|
|
163
163
|
u,
|
|
164
|
-
|
|
164
|
+
d
|
|
165
165
|
);
|
|
166
166
|
},
|
|
167
167
|
[e, u, c, s]
|
|
168
168
|
);
|
|
169
|
-
|
|
169
|
+
_(i, [i]);
|
|
170
|
+
let l;
|
|
171
|
+
return t.results.length ? l = t.results : e.length ? l = [] : l = n ?? [], {
|
|
170
172
|
clearError: t.clearError,
|
|
171
173
|
debouncedQuery: e,
|
|
172
174
|
error: t.error,
|
|
@@ -174,8 +176,8 @@ const G = 500, P = 1, j = (r) => r instanceof Error && r.message ? r.message : t
|
|
|
174
176
|
shouldShowInstructions: a.length < u && !t.results.length && !n?.length,
|
|
175
177
|
shouldShowDebounceWaiting: a.length >= u && e.length < u && !t.loading && !t.hasSearched,
|
|
176
178
|
shouldShowNoResults: t.hasSearched && !t.loading && t.results.length === 0 && a.length >= u,
|
|
177
|
-
results:
|
|
178
|
-
startSearch:
|
|
179
|
+
results: l,
|
|
180
|
+
startSearch: i,
|
|
179
181
|
stopSearch: t.reset
|
|
180
182
|
};
|
|
181
183
|
};
|
|
@@ -34,7 +34,7 @@ export declare const card: import('../../styled-system/types').SlotRecipeRuntime
|
|
|
34
34
|
borderColor: "colour.primary.fill";
|
|
35
35
|
borderStyle: "solid";
|
|
36
36
|
borderWidth: "[2px]";
|
|
37
|
-
borderRadius: "radius.system.
|
|
37
|
+
borderRadius: "radius.system.layout";
|
|
38
38
|
pointerEvents: "[none]";
|
|
39
39
|
};
|
|
40
40
|
};
|
|
@@ -3,6 +3,8 @@ const e = t({
|
|
|
3
3
|
slots: ["root", "prepend", "heading", "topRight", "media", "body", "footer"],
|
|
4
4
|
base: {
|
|
5
5
|
root: {
|
|
6
|
+
// Performance: CSS containment (no paint to allow overflow)
|
|
7
|
+
contain: "layout style",
|
|
6
8
|
position: "relative",
|
|
7
9
|
borderRadius: "radius.system.layout",
|
|
8
10
|
bg: "colour.neutral.10",
|
|
@@ -101,7 +103,7 @@ const e = t({
|
|
|
101
103
|
borderColor: "colour.primary.fill",
|
|
102
104
|
borderStyle: "solid",
|
|
103
105
|
borderWidth: "[2px]",
|
|
104
|
-
borderRadius: "radius.system.
|
|
106
|
+
borderRadius: "radius.system.layout",
|
|
105
107
|
pointerEvents: "[none]"
|
|
106
108
|
}
|
|
107
109
|
}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const filter: import('../../styled-system/types').SlotRecipeRuntimeFn<"
|
|
1
|
+
export declare const filter: import('../../styled-system/types').SlotRecipeRuntimeFn<"root" | "reset" | "popoverContent" | "optionList" | "noResults" | "chevron" | "searchInput" | "optionContent" | "optionMeta" | "optionMetaText", {}>;
|
|
2
2
|
export type FilterVariants = Parameters<typeof filter>[0];
|
|
@@ -2,7 +2,6 @@ import { InputRef } from '../../Input/InputBase/InputBase';
|
|
|
2
2
|
export declare const FilterSearch: import('react').ForwardRefExoticComponent<Omit<import('../../Input').InputBaseProps<undefined>, "defaultValue" | "onChange" | "value"> & {
|
|
3
3
|
alignRight?: boolean;
|
|
4
4
|
append?: import('react').ReactNode;
|
|
5
|
-
clearable?: boolean;
|
|
6
5
|
defaultValue?: string | number | undefined;
|
|
7
6
|
formatter?: ((value?: string | number | undefined) => string | number) | undefined;
|
|
8
7
|
inline?: boolean;
|
|
@@ -12,4 +11,6 @@ export declare const FilterSearch: import('react').ForwardRefExoticComponent<Omi
|
|
|
12
11
|
prepend?: import('react').ReactNode;
|
|
13
12
|
value?: string | number | undefined;
|
|
14
13
|
width?: import('../../../types').FormElementWidths;
|
|
14
|
+
} & {
|
|
15
|
+
clearable?: boolean;
|
|
15
16
|
} & import('react').RefAttributes<InputRef>>;
|
|
@@ -11,11 +11,6 @@ export type IressInputProps<T extends FormControlValue = string | number, TRows
|
|
|
11
11
|
* Content to append to the input field, usually a button or icon.
|
|
12
12
|
**/
|
|
13
13
|
append?: ReactNode;
|
|
14
|
-
/**
|
|
15
|
-
* If `true`, then user can clear the value of the input. Will be ignored if `rows` prop is in use.
|
|
16
|
-
* @default false
|
|
17
|
-
*/
|
|
18
|
-
clearable?: boolean;
|
|
19
14
|
/**
|
|
20
15
|
* The value of the input. Can be a string or a number. Use for uncontrolled inputs.
|
|
21
16
|
*/
|
|
@@ -53,7 +48,21 @@ export type IressInputProps<T extends FormControlValue = string | number, TRows
|
|
|
53
48
|
* The width of the input.
|
|
54
49
|
*/
|
|
55
50
|
width?: FormElementWidths;
|
|
56
|
-
}
|
|
51
|
+
} & (TRows extends number ? {
|
|
52
|
+
/**
|
|
53
|
+
* Controls the auto-grow behaviour of the textarea when `rows` is set.
|
|
54
|
+
* - Set to a number (e.g. `autoGrow={10}`) to define the maximum number of visible rows before the textarea starts scrolling.
|
|
55
|
+
* - Set to `true` to enable auto-grow with a default maximum of 5 visible rows.
|
|
56
|
+
* @default false (no auto-grow) or 5 rows when `autoGrow` is `true`
|
|
57
|
+
*/
|
|
58
|
+
autoGrow?: number | boolean;
|
|
59
|
+
} : {
|
|
60
|
+
/**
|
|
61
|
+
* If `true`, then user can clear the value of the input.
|
|
62
|
+
* @default false
|
|
63
|
+
*/
|
|
64
|
+
clearable?: boolean;
|
|
65
|
+
});
|
|
57
66
|
export declare const IressInput: (<T extends FormControlValue = string | number, TRows extends number | undefined = undefined>(props: IressInputProps<T, TRows> & RefAttributes<InputRef<TRows> | null>) => ReactElement) & {
|
|
58
67
|
displayName: "IressInput";
|
|
59
68
|
};
|
|
@@ -1,132 +1,142 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { GlobalCSSClass as
|
|
4
|
-
import { getFormControlValueAsString as
|
|
5
|
-
import { InputBase as
|
|
6
|
-
import { IressSpinner as
|
|
1
|
+
import { jsx as a, jsxs as V } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as U, useRef as b, useState as Y, useImperativeHandle as $, useEffect as z } from "react";
|
|
3
|
+
import { GlobalCSSClass as h } from "../../enums.js";
|
|
4
|
+
import { getFormControlValueAsString as J } from "../../helpers/form/getFormControlValueAsString.js";
|
|
5
|
+
import { InputBase as K } from "./InputBase/InputBase.js";
|
|
6
|
+
import { IressSpinner as L } from "../Spinner/Spinner.js";
|
|
7
7
|
import "../Spinner/Spinner.styles.js";
|
|
8
|
-
import { useControlledState as
|
|
9
|
-
import { IressReadonly as
|
|
8
|
+
import { useControlledState as Q } from "../../hooks/useControlledState.js";
|
|
9
|
+
import { IressReadonly as W } from "../Readonly/Readonly.js";
|
|
10
10
|
import "../Readonly/Readonly.styles.js";
|
|
11
|
-
import { c as
|
|
12
|
-
import { input as
|
|
13
|
-
import { s as
|
|
14
|
-
import { s as
|
|
15
|
-
import { useNoDefaultValueInForms as
|
|
11
|
+
import { c as u } from "../../cx-DN21T1EH.js";
|
|
12
|
+
import { input as X } from "./Input.styles.js";
|
|
13
|
+
import { s as Z } from "../../factory-CsinCTPr.js";
|
|
14
|
+
import { s as _ } from "../../is-valid-prop-DweT-eOL.js";
|
|
15
|
+
import { useNoDefaultValueInForms as ee } from "../../patterns/Form/hooks/useNoDefaultValueInForms.js";
|
|
16
16
|
import "../../Button-BTkololu.js";
|
|
17
|
-
import { IressCloseButton as
|
|
18
|
-
const
|
|
17
|
+
import { IressCloseButton as te } from "../Button/CloseButton/CloseButton.js";
|
|
18
|
+
const oe = ({ rows: t, ...c }, M) => {
|
|
19
19
|
const {
|
|
20
|
-
loading:
|
|
20
|
+
loading: d = !1,
|
|
21
21
|
clearable: P = !1,
|
|
22
|
-
defaultValue:
|
|
22
|
+
defaultValue: g,
|
|
23
23
|
onClear: D,
|
|
24
|
-
width:
|
|
25
|
-
prepend:
|
|
26
|
-
append:
|
|
24
|
+
width: E,
|
|
25
|
+
prepend: v,
|
|
26
|
+
append: p,
|
|
27
27
|
onChange: R,
|
|
28
|
-
className:
|
|
28
|
+
className: I,
|
|
29
29
|
readOnly: B,
|
|
30
|
-
formatter:
|
|
31
|
-
type:
|
|
30
|
+
formatter: m,
|
|
31
|
+
type: G,
|
|
32
32
|
inline: T,
|
|
33
33
|
alignRight: C,
|
|
34
|
-
...
|
|
35
|
-
} =
|
|
36
|
-
|
|
34
|
+
...o
|
|
35
|
+
} = c;
|
|
36
|
+
let n = t !== void 0 ? c.autoGrow : void 0;
|
|
37
|
+
n === !0 && (n = 5), ee({
|
|
37
38
|
component: "IressInput",
|
|
38
|
-
defaultValue:
|
|
39
|
+
defaultValue: g
|
|
39
40
|
});
|
|
40
|
-
const
|
|
41
|
+
const s = b(null), f = b(null), { value: i, setValue: y } = Q({
|
|
41
42
|
component: "IressInput",
|
|
42
|
-
defaultValue:
|
|
43
|
-
value:
|
|
44
|
-
}),
|
|
45
|
-
let
|
|
46
|
-
if (
|
|
47
|
-
|
|
43
|
+
defaultValue: g,
|
|
44
|
+
value: c.value
|
|
45
|
+
}), x = J(i), [w, F] = Y(!1), [j, O] = _(o), H = m && !w ? m(i) : x;
|
|
46
|
+
let N = m && !w ? { type: "text" } : { type: G };
|
|
47
|
+
if (t !== void 0 && (N = void 0), $(
|
|
48
|
+
M,
|
|
48
49
|
() => ({
|
|
49
|
-
...
|
|
50
|
+
...s.current,
|
|
50
51
|
extras: {
|
|
51
52
|
additionalOnChangeProps: ["onClear"]
|
|
52
53
|
}
|
|
53
54
|
})
|
|
54
|
-
),
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
), z(() => {
|
|
56
|
+
if (t && n && s.current) {
|
|
57
|
+
const e = s.current.input;
|
|
58
|
+
if (!e) return;
|
|
59
|
+
e.style.height = "auto";
|
|
60
|
+
const S = parseFloat(getComputedStyle(e).lineHeight) * 1.075 * n, A = Math.min(e.scrollHeight, S);
|
|
61
|
+
e.style.height = `${A}px`, e.style.overflowY = e.scrollHeight > S ? "auto" : "hidden";
|
|
62
|
+
}
|
|
63
|
+
}, [i, t, n]), B)
|
|
64
|
+
return /* @__PURE__ */ a(
|
|
65
|
+
W,
|
|
57
66
|
{
|
|
58
|
-
...
|
|
67
|
+
...o,
|
|
59
68
|
defaultValue: void 0,
|
|
60
|
-
value:
|
|
69
|
+
value: i,
|
|
61
70
|
alignRight: C,
|
|
62
|
-
append:
|
|
63
|
-
className:
|
|
64
|
-
children:
|
|
71
|
+
append: p,
|
|
72
|
+
className: I,
|
|
73
|
+
children: H
|
|
65
74
|
}
|
|
66
75
|
);
|
|
67
76
|
const k = (e) => {
|
|
68
|
-
|
|
69
|
-
const
|
|
77
|
+
y(""), s.current?.focus();
|
|
78
|
+
const r = new Event("change", {
|
|
70
79
|
bubbles: !0
|
|
71
80
|
});
|
|
72
|
-
Object.defineProperty(
|
|
81
|
+
Object.defineProperty(r, "target", {
|
|
73
82
|
writable: !1,
|
|
74
83
|
value: { value: "", ...e.target }
|
|
75
|
-
}), D?.(
|
|
84
|
+
}), D?.(r);
|
|
76
85
|
}, q = (e) => {
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
},
|
|
86
|
+
const r = e.target.value;
|
|
87
|
+
y(r), R?.(e, r);
|
|
88
|
+
}, l = X({
|
|
80
89
|
alignRight: C,
|
|
90
|
+
autoGrow: !!n,
|
|
81
91
|
inline: T,
|
|
82
|
-
isTextarea:
|
|
83
|
-
width:
|
|
92
|
+
isTextarea: t !== void 0,
|
|
93
|
+
width: E
|
|
84
94
|
});
|
|
85
|
-
return /* @__PURE__ */
|
|
86
|
-
|
|
95
|
+
return /* @__PURE__ */ V(
|
|
96
|
+
Z.div,
|
|
87
97
|
{
|
|
88
|
-
className:
|
|
98
|
+
className: u(
|
|
89
99
|
// classes.root,
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
100
|
+
h.FormElement,
|
|
101
|
+
h.Input,
|
|
102
|
+
I,
|
|
103
|
+
l.wrapper,
|
|
104
|
+
h.FormElementInner
|
|
95
105
|
),
|
|
96
|
-
"data-testid":
|
|
106
|
+
"data-testid": o["data-testid"],
|
|
97
107
|
...j,
|
|
98
108
|
children: [
|
|
99
|
-
|
|
100
|
-
/* @__PURE__ */
|
|
101
|
-
|
|
109
|
+
v && /* @__PURE__ */ a("div", { className: u(l.addon), children: v }),
|
|
110
|
+
/* @__PURE__ */ a(
|
|
111
|
+
K,
|
|
102
112
|
{
|
|
103
113
|
...O,
|
|
104
|
-
...
|
|
105
|
-
className:
|
|
106
|
-
value:
|
|
114
|
+
...N,
|
|
115
|
+
className: l.formControl,
|
|
116
|
+
value: H,
|
|
107
117
|
onChange: q,
|
|
108
118
|
onFocus: (e) => {
|
|
109
|
-
|
|
119
|
+
F(!0), o?.onFocus?.(e), f.current ? f.current = null : queueMicrotask(() => e.target.select());
|
|
110
120
|
},
|
|
111
121
|
onMouseDown: (e) => {
|
|
112
|
-
|
|
122
|
+
o?.onMouseDown?.(e), f.current = !0;
|
|
113
123
|
},
|
|
114
124
|
onBlur: (e) => {
|
|
115
|
-
|
|
125
|
+
F(!1), o?.onBlur?.(e);
|
|
116
126
|
},
|
|
117
|
-
rows:
|
|
118
|
-
ref:
|
|
127
|
+
rows: t,
|
|
128
|
+
ref: s
|
|
119
129
|
}
|
|
120
130
|
),
|
|
121
|
-
/* @__PURE__ */
|
|
122
|
-
|
|
123
|
-
|
|
131
|
+
/* @__PURE__ */ V("div", { className: u(l.internal), children: [
|
|
132
|
+
d && /* @__PURE__ */ a(
|
|
133
|
+
L,
|
|
124
134
|
{
|
|
125
|
-
screenreaderText:
|
|
135
|
+
screenreaderText: d === !0 ? "loading" : d
|
|
126
136
|
}
|
|
127
137
|
),
|
|
128
|
-
|
|
129
|
-
|
|
138
|
+
x && P && /* @__PURE__ */ a(
|
|
139
|
+
te,
|
|
130
140
|
{
|
|
131
141
|
onClick: k,
|
|
132
142
|
onMouseDown: (e) => e.preventDefault(),
|
|
@@ -134,12 +144,12 @@ const _ = ({ rows: a, ...f }, S) => {
|
|
|
134
144
|
}
|
|
135
145
|
)
|
|
136
146
|
] }),
|
|
137
|
-
|
|
147
|
+
p && /* @__PURE__ */ a("div", { className: u(l.addon), children: p })
|
|
138
148
|
]
|
|
139
149
|
}
|
|
140
150
|
);
|
|
141
|
-
},
|
|
142
|
-
|
|
151
|
+
}, ne = U(oe);
|
|
152
|
+
ne.displayName = "IressInput";
|
|
143
153
|
export {
|
|
144
|
-
|
|
154
|
+
ne as IressInput
|
|
145
155
|
};
|
|
@@ -6,6 +6,13 @@ export declare const input: import('../../styled-system/types').SlotRecipeRuntim
|
|
|
6
6
|
};
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
+
autoGrow: {
|
|
10
|
+
true: {
|
|
11
|
+
formControl: {
|
|
12
|
+
resize: "none";
|
|
13
|
+
};
|
|
14
|
+
};
|
|
15
|
+
};
|
|
9
16
|
inline: {
|
|
10
17
|
true: {
|
|
11
18
|
wrapper: {
|
|
@@ -18,6 +25,7 @@ export declare const input: import('../../styled-system/types').SlotRecipeRuntim
|
|
|
18
25
|
formControl: {
|
|
19
26
|
lineHeight: number;
|
|
20
27
|
height: "auto";
|
|
28
|
+
scrollable: "y";
|
|
21
29
|
};
|
|
22
30
|
};
|
|
23
31
|
};
|
|
@@ -3,6 +3,8 @@ const o = r({
|
|
|
3
3
|
slots: ["root", "wrapper", "inline", "addon", "internal", "formControl"],
|
|
4
4
|
base: {
|
|
5
5
|
wrapper: {
|
|
6
|
+
// Performance: CSS containment limits style recalculation scope
|
|
7
|
+
contain: "layout style paint",
|
|
6
8
|
display: "flex",
|
|
7
9
|
alignItems: "stretch",
|
|
8
10
|
borderRadius: "radius.system.form",
|
|
@@ -88,6 +90,13 @@ const o = r({
|
|
|
88
90
|
}
|
|
89
91
|
}
|
|
90
92
|
},
|
|
93
|
+
autoGrow: {
|
|
94
|
+
true: {
|
|
95
|
+
formControl: {
|
|
96
|
+
resize: "none"
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
},
|
|
91
100
|
inline: {
|
|
92
101
|
true: {
|
|
93
102
|
wrapper: {
|
|
@@ -99,7 +108,8 @@ const o = r({
|
|
|
99
108
|
true: {
|
|
100
109
|
formControl: {
|
|
101
110
|
lineHeight: 1.5,
|
|
102
|
-
height: "auto"
|
|
111
|
+
height: "auto",
|
|
112
|
+
scrollable: "y"
|
|
103
113
|
}
|
|
104
114
|
}
|
|
105
115
|
},
|
|
@@ -21,7 +21,6 @@ export declare const modal: import('../../styled-system/types').SlotRecipeRuntim
|
|
|
21
21
|
content: {
|
|
22
22
|
flex: "[1]";
|
|
23
23
|
overflowX: "hidden";
|
|
24
|
-
scrollable: "y";
|
|
25
24
|
maxHeight: "[calc(100vh - ({spacing.spacing.7} * 2))]";
|
|
26
25
|
'@media (min-height: 600px)': {
|
|
27
26
|
maxHeight: "[calc(100vh - (100px * 2))]";
|