@povio/ui 2.3.0-rc.39 → 2.3.0-rc.40
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/inputs/Checkbox/Checkbox.js +50 -45
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +25 -6
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +31 -7
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +18 -5
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +97 -68
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +131 -136
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +1 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +39 -37
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +9 -1
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +43 -7
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +16 -8
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +43 -40
- package/dist/components/inputs/File/InputUpload.js +1 -1
- package/dist/components/inputs/File/shared/InputUploadFilled.js +1 -1
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +103 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +2 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +52 -29
- package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
- package/dist/components/inputs/Input/TextInput/TextInput.js +2 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +29 -43
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +1 -0
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +2 -2
- package/dist/components/inputs/Selection/Select/QuerySelect.js +45 -63
- package/dist/components/inputs/Selection/Select/Select.js +1 -0
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +54 -53
- package/dist/components/inputs/Selection/shared/SelectMobile.js +3 -2
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +12 -1
- package/dist/components/inputs/Selection/shared/select.context.js +3 -1
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +1 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +100 -92
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +170 -156
- package/dist/components/inputs/TextEditor/TextEditor.js +1 -1
- package/dist/components/inputs/Toggle/Toggle.js +70 -64
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/InputClear.js +71 -61
- package/dist/components/inputs/shared/input.cva.js +22 -10
- package/dist/components/inputs/shared/label.cva.js +2 -2
- package/dist/components/overlays/BottomSheet/BottomSheet.js +26 -2
- package/dist/config/uiConfig.context.d.ts +3 -1
- package/dist/config/uiConfig.context.js +2 -1
- package/dist/tw-ui-plugin.js +6 -1
- package/dist/utils/date-time.utils.d.ts +5 -0
- package/dist/utils/date-time.utils.js +10 -0
- package/dist/utils/dom.utils.js +1 -1
- package/package.json +1 -1
|
@@ -4,7 +4,6 @@ import { CheckContent } from "../shared/CheckContent.js";
|
|
|
4
4
|
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
5
5
|
import { inputBase, inputSize } from "../shared/input.cva.js";
|
|
6
6
|
import { FormField } from "../FormField/FormField.js";
|
|
7
|
-
import { TooltipWrapper } from "../shared/TooltipWrapper.js";
|
|
8
7
|
import { radio, radioContentClassName, radioContentRow, radioContentWrapper, radioIndicatorClass, radioTypography } from "./radio.cva.js";
|
|
9
8
|
import { c } from "react/compiler-runtime";
|
|
10
9
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -15,7 +14,7 @@ import { mergeRefs } from "@react-aria/utils";
|
|
|
15
14
|
import { Controller } from "react-hook-form";
|
|
16
15
|
//#region src/components/inputs/RadioGroup/RadioGroup.tsx
|
|
17
16
|
var RadioGroupBase = (props) => {
|
|
18
|
-
const $ = c(
|
|
17
|
+
const $ = c(91);
|
|
19
18
|
const ui = UIConfig.useConfig();
|
|
20
19
|
const radioCva = UIStyle.useCva("radio.cva", radio);
|
|
21
20
|
const radioContentWrapperCva = UIStyle.useCva("radio.contentWrapperCva", radioContentWrapper);
|
|
@@ -121,13 +120,12 @@ var RadioGroupBase = (props) => {
|
|
|
121
120
|
$[28] = t5;
|
|
122
121
|
} else t5 = $[28];
|
|
123
122
|
const handleChange = t5;
|
|
124
|
-
const T0 =
|
|
125
|
-
const t6 =
|
|
126
|
-
const
|
|
127
|
-
const
|
|
128
|
-
const
|
|
129
|
-
const
|
|
130
|
-
const T2 = FormField;
|
|
123
|
+
const T0 = RadioGroup;
|
|
124
|
+
const t6 = !!error;
|
|
125
|
+
const t7 = isDirty || void 0;
|
|
126
|
+
const t8 = isRequired || void 0;
|
|
127
|
+
const t9 = "group";
|
|
128
|
+
const T1 = FormField;
|
|
131
129
|
const t10 = as === "inline" && "h-full";
|
|
132
130
|
let t11;
|
|
133
131
|
if ($[29] !== className || $[30] !== t10) {
|
|
@@ -259,8 +257,8 @@ var RadioGroupBase = (props) => {
|
|
|
259
257
|
$[68] = t28;
|
|
260
258
|
} else t28 = $[68];
|
|
261
259
|
let t29;
|
|
262
|
-
if ($[69] !==
|
|
263
|
-
t29 = /* @__PURE__ */ jsx(
|
|
260
|
+
if ($[69] !== T1 || $[70] !== as || $[71] !== formFieldProps || $[72] !== labelProps || $[73] !== t11 || $[74] !== t12 || $[75] !== t28) {
|
|
261
|
+
t29 = /* @__PURE__ */ jsx(T1, {
|
|
264
262
|
...formFieldProps,
|
|
265
263
|
as,
|
|
266
264
|
labelProps,
|
|
@@ -268,7 +266,7 @@ var RadioGroupBase = (props) => {
|
|
|
268
266
|
tabIndex: t12,
|
|
269
267
|
children: t28
|
|
270
268
|
});
|
|
271
|
-
$[69] =
|
|
269
|
+
$[69] = T1;
|
|
272
270
|
$[70] = as;
|
|
273
271
|
$[71] = formFieldProps;
|
|
274
272
|
$[72] = labelProps;
|
|
@@ -278,50 +276,38 @@ var RadioGroupBase = (props) => {
|
|
|
278
276
|
$[76] = t29;
|
|
279
277
|
} else t29 = $[76];
|
|
280
278
|
let t30;
|
|
281
|
-
if ($[77] !==
|
|
282
|
-
t30 = /* @__PURE__ */ jsx(
|
|
279
|
+
if ($[77] !== T0 || $[78] !== defaultValue || $[79] !== fieldProps || $[80] !== handleChange || $[81] !== isDisabled || $[82] !== onBlur || $[83] !== ref || $[84] !== rest || $[85] !== t29 || $[86] !== t6 || $[87] !== t7 || $[88] !== t8 || $[89] !== value) {
|
|
280
|
+
t30 = /* @__PURE__ */ jsx(T0, {
|
|
283
281
|
...rest,
|
|
284
282
|
...fieldProps,
|
|
285
283
|
ref,
|
|
286
284
|
value,
|
|
287
285
|
defaultValue,
|
|
288
286
|
onChange: handleChange,
|
|
287
|
+
onBlur,
|
|
289
288
|
isDisabled,
|
|
290
|
-
isInvalid:
|
|
291
|
-
"data-is-dirty":
|
|
292
|
-
"data-is-required":
|
|
289
|
+
isInvalid: t6,
|
|
290
|
+
"data-is-dirty": t7,
|
|
291
|
+
"data-is-required": t8,
|
|
292
|
+
className: t9,
|
|
293
293
|
children: t29
|
|
294
294
|
});
|
|
295
|
-
$[77] =
|
|
295
|
+
$[77] = T0;
|
|
296
296
|
$[78] = defaultValue;
|
|
297
297
|
$[79] = fieldProps;
|
|
298
298
|
$[80] = handleChange;
|
|
299
299
|
$[81] = isDisabled;
|
|
300
|
-
$[82] =
|
|
301
|
-
$[83] =
|
|
302
|
-
$[84] =
|
|
303
|
-
$[85] =
|
|
304
|
-
$[86] =
|
|
305
|
-
$[87] =
|
|
306
|
-
$[88] =
|
|
307
|
-
$[89] =
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
t31 = /* @__PURE__ */ jsx(T0, {
|
|
312
|
-
as,
|
|
313
|
-
error,
|
|
314
|
-
triggerTabIndex: t6,
|
|
315
|
-
children: t30
|
|
316
|
-
});
|
|
317
|
-
$[90] = T0;
|
|
318
|
-
$[91] = as;
|
|
319
|
-
$[92] = error;
|
|
320
|
-
$[93] = t30;
|
|
321
|
-
$[94] = t6;
|
|
322
|
-
$[95] = t31;
|
|
323
|
-
} else t31 = $[95];
|
|
324
|
-
return t31;
|
|
300
|
+
$[82] = onBlur;
|
|
301
|
+
$[83] = ref;
|
|
302
|
+
$[84] = rest;
|
|
303
|
+
$[85] = t29;
|
|
304
|
+
$[86] = t6;
|
|
305
|
+
$[87] = t7;
|
|
306
|
+
$[88] = t8;
|
|
307
|
+
$[89] = value;
|
|
308
|
+
$[90] = t30;
|
|
309
|
+
} else t30 = $[90];
|
|
310
|
+
return t30;
|
|
325
311
|
};
|
|
326
312
|
var RadioGroup$1 = (props) => {
|
|
327
313
|
const $ = c(15);
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
2
|
import { Autocomplete } from "./Autocomplete.js";
|
|
3
|
-
import { getQueryItems } from "../shared/querySelect.utils.js";
|
|
3
|
+
import { getQueryItems, isInitialSelectionLabelMissing } from "../shared/querySelect.utils.js";
|
|
4
4
|
import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
import { useState } from "react";
|
|
@@ -16,7 +16,7 @@ var QueryAutocomplete = ({ query, queryParams, queryOptions, queryMap, leadingCo
|
|
|
16
16
|
queryOptions,
|
|
17
17
|
mapItems: (data) => getQueryItems(data, queryMap),
|
|
18
18
|
search,
|
|
19
|
-
initialQueryState: props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled
|
|
19
|
+
initialQueryState: isInitialSelectionLabelMissing(props.initialSelection, props.mapInitialToSelectItem) ? false : props.isInitialQueryDisabled ?? ui.queryAutocomplete?.isInitialQueryDisabled
|
|
20
20
|
});
|
|
21
21
|
const handleChange = (value) => {
|
|
22
22
|
onChange?.(value);
|
|
@@ -1,46 +1,27 @@
|
|
|
1
1
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
2
2
|
import { Select } from "./Select.js";
|
|
3
|
-
import { getQueryItems } from "../shared/querySelect.utils.js";
|
|
3
|
+
import { getQueryItems, isInitialSelectionLabelMissing } from "../shared/querySelect.utils.js";
|
|
4
4
|
import { useQueryAutocomplete } from "../../../../hooks/useQueryAutocomplete.js";
|
|
5
5
|
import { c } from "react/compiler-runtime";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { useState } from "react";
|
|
8
8
|
//#region src/components/inputs/Selection/Select/QuerySelect.tsx
|
|
9
9
|
var QuerySelect = (t0) => {
|
|
10
|
-
const $ = c(
|
|
11
|
-
|
|
12
|
-
let query;
|
|
13
|
-
let queryMap;
|
|
14
|
-
let queryOptions;
|
|
15
|
-
let queryParams;
|
|
16
|
-
if ($[0] !== t0) {
|
|
17
|
-
({query, queryParams, queryOptions, queryMap, ...props} = t0);
|
|
18
|
-
$[0] = t0;
|
|
19
|
-
$[1] = props;
|
|
20
|
-
$[2] = query;
|
|
21
|
-
$[3] = queryMap;
|
|
22
|
-
$[4] = queryOptions;
|
|
23
|
-
$[5] = queryParams;
|
|
24
|
-
} else {
|
|
25
|
-
props = $[1];
|
|
26
|
-
query = $[2];
|
|
27
|
-
queryMap = $[3];
|
|
28
|
-
queryOptions = $[4];
|
|
29
|
-
queryParams = $[5];
|
|
30
|
-
}
|
|
10
|
+
const $ = c(28);
|
|
11
|
+
const { query, queryParams, queryOptions, queryMap, ...props } = t0;
|
|
31
12
|
const ui = UIConfig.useConfig();
|
|
32
13
|
const [search, setSearch] = useState("");
|
|
33
14
|
const isSearchable = props.isSearchable ?? ui.select.isSearchable;
|
|
34
15
|
let t1;
|
|
35
|
-
if ($[
|
|
16
|
+
if ($[0] !== queryMap) {
|
|
36
17
|
t1 = (data) => getQueryItems(data, queryMap);
|
|
37
|
-
$[
|
|
38
|
-
$[
|
|
39
|
-
} else t1 = $[
|
|
18
|
+
$[0] = queryMap;
|
|
19
|
+
$[1] = t1;
|
|
20
|
+
} else t1 = $[1];
|
|
40
21
|
const t2 = isSearchable ? search : void 0;
|
|
41
|
-
const t3 = props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
|
|
22
|
+
const t3 = isInitialSelectionLabelMissing(props.initialSelection, props.mapInitialToSelectItem) ? false : props.isInitialQueryDisabled ?? ui.querySelect?.isInitialQueryDisabled;
|
|
42
23
|
let t4;
|
|
43
|
-
if ($[
|
|
24
|
+
if ($[2] !== query || $[3] !== queryOptions || $[4] !== queryParams || $[5] !== t1 || $[6] !== t2 || $[7] !== t3) {
|
|
44
25
|
t4 = {
|
|
45
26
|
query,
|
|
46
27
|
queryParams,
|
|
@@ -49,52 +30,53 @@ var QuerySelect = (t0) => {
|
|
|
49
30
|
search: t2,
|
|
50
31
|
initialQueryState: t3
|
|
51
32
|
};
|
|
52
|
-
$[
|
|
53
|
-
$[
|
|
54
|
-
$[
|
|
55
|
-
$[
|
|
56
|
-
$[
|
|
57
|
-
$[
|
|
58
|
-
$[
|
|
59
|
-
} else t4 = $[
|
|
33
|
+
$[2] = query;
|
|
34
|
+
$[3] = queryOptions;
|
|
35
|
+
$[4] = queryParams;
|
|
36
|
+
$[5] = t1;
|
|
37
|
+
$[6] = t2;
|
|
38
|
+
$[7] = t3;
|
|
39
|
+
$[8] = t4;
|
|
40
|
+
} else t4 = $[8];
|
|
60
41
|
const { items, totalItems, isLoading, handleEnableQuery, hasNextPage, fetchNextPage } = useQueryAutocomplete(t4);
|
|
61
42
|
let onSearchChange;
|
|
62
43
|
let selectProps;
|
|
63
|
-
if ($[
|
|
44
|
+
if ($[9] !== props) {
|
|
64
45
|
const { isInitialQueryDisabled: _, onSearchChange: t5, ...t6 } = props;
|
|
65
46
|
onSearchChange = t5;
|
|
66
47
|
selectProps = t6;
|
|
67
|
-
$[
|
|
68
|
-
$[
|
|
69
|
-
$[
|
|
48
|
+
$[9] = props;
|
|
49
|
+
$[10] = onSearchChange;
|
|
50
|
+
$[11] = selectProps;
|
|
70
51
|
} else {
|
|
71
|
-
onSearchChange = $[
|
|
72
|
-
selectProps = $[
|
|
52
|
+
onSearchChange = $[10];
|
|
53
|
+
selectProps = $[11];
|
|
73
54
|
}
|
|
74
55
|
let t5;
|
|
75
|
-
if ($[
|
|
56
|
+
if ($[12] !== handleEnableQuery || $[13] !== onSearchChange || $[14] !== setSearch) {
|
|
76
57
|
t5 = (value) => {
|
|
77
58
|
setSearch(value);
|
|
78
59
|
handleEnableQuery();
|
|
79
60
|
onSearchChange?.(value);
|
|
80
61
|
};
|
|
81
|
-
$[
|
|
82
|
-
$[
|
|
83
|
-
$[
|
|
84
|
-
|
|
62
|
+
$[12] = handleEnableQuery;
|
|
63
|
+
$[13] = onSearchChange;
|
|
64
|
+
$[14] = setSearch;
|
|
65
|
+
$[15] = t5;
|
|
66
|
+
} else t5 = $[15];
|
|
85
67
|
const handleSearchChange = t5;
|
|
86
68
|
let t6;
|
|
87
|
-
if ($[
|
|
69
|
+
if ($[16] !== handleSearchChange || $[17] !== isSearchable) {
|
|
88
70
|
t6 = isSearchable && {
|
|
89
71
|
isClientSearchDisabled: true,
|
|
90
72
|
onSearchChange: handleSearchChange
|
|
91
73
|
};
|
|
92
|
-
$[
|
|
93
|
-
$[
|
|
94
|
-
$[
|
|
95
|
-
} else t6 = $[
|
|
74
|
+
$[16] = handleSearchChange;
|
|
75
|
+
$[17] = isSearchable;
|
|
76
|
+
$[18] = t6;
|
|
77
|
+
} else t6 = $[18];
|
|
96
78
|
let t7;
|
|
97
|
-
if ($[
|
|
79
|
+
if ($[19] !== fetchNextPage || $[20] !== handleEnableQuery || $[21] !== hasNextPage || $[22] !== isLoading || $[23] !== items || $[24] !== selectProps || $[25] !== t6 || $[26] !== totalItems) {
|
|
98
80
|
t7 = /* @__PURE__ */ jsx(Select, {
|
|
99
81
|
...selectProps,
|
|
100
82
|
items,
|
|
@@ -106,16 +88,16 @@ var QuerySelect = (t0) => {
|
|
|
106
88
|
onFocusCapture: handleEnableQuery,
|
|
107
89
|
...t6
|
|
108
90
|
});
|
|
109
|
-
$[
|
|
110
|
-
$[
|
|
111
|
-
$[
|
|
112
|
-
$[
|
|
113
|
-
$[
|
|
114
|
-
$[
|
|
115
|
-
$[
|
|
116
|
-
$[
|
|
117
|
-
$[
|
|
118
|
-
} else t7 = $[
|
|
91
|
+
$[19] = fetchNextPage;
|
|
92
|
+
$[20] = handleEnableQuery;
|
|
93
|
+
$[21] = hasNextPage;
|
|
94
|
+
$[22] = isLoading;
|
|
95
|
+
$[23] = items;
|
|
96
|
+
$[24] = selectProps;
|
|
97
|
+
$[25] = t6;
|
|
98
|
+
$[26] = totalItems;
|
|
99
|
+
$[27] = t7;
|
|
100
|
+
} else t7 = $[27];
|
|
119
101
|
return t7;
|
|
120
102
|
};
|
|
121
103
|
//#endregion
|
|
@@ -87,6 +87,7 @@ function SelectInner(t0) {
|
|
|
87
87
|
return /* @__PURE__ */ jsx(InputFrame, {
|
|
88
88
|
...props,
|
|
89
89
|
isDisabled,
|
|
90
|
+
isLoading: false,
|
|
90
91
|
className: clsx("w-full", props.containerClassName),
|
|
91
92
|
inputClassName: clsx(props.className, props.inputClassName),
|
|
92
93
|
contentWrapperClassName: selectInputTagsContentWrapperCva({ isSearchable }),
|
|
@@ -185,7 +185,7 @@ var SelectDesktop = (t0) => {
|
|
|
185
185
|
const t12 = !!error;
|
|
186
186
|
let t13;
|
|
187
187
|
if ($[43] !== containerClassName) {
|
|
188
|
-
t13 = clsx("w-full", containerClassName);
|
|
188
|
+
t13 = clsx("group w-full", containerClassName);
|
|
189
189
|
$[43] = containerClassName;
|
|
190
190
|
$[44] = t13;
|
|
191
191
|
} else t13 = $[44];
|
|
@@ -272,7 +272,7 @@ var SelectDesktop = (t0) => {
|
|
|
272
272
|
if ($[74] !== containerClassName || $[75] !== isSearchable || $[76] !== labelProps) {
|
|
273
273
|
t20 = !isSearchable && {
|
|
274
274
|
labelProps,
|
|
275
|
-
className: clsx("w-full", containerClassName)
|
|
275
|
+
className: clsx("group w-full", containerClassName)
|
|
276
276
|
};
|
|
277
277
|
$[74] = containerClassName;
|
|
278
278
|
$[75] = isSearchable;
|
|
@@ -17,7 +17,7 @@ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
|
17
17
|
import { useTranslation } from "react-i18next";
|
|
18
18
|
//#region src/components/inputs/Selection/shared/SelectInput.tsx
|
|
19
19
|
var SelectInput = (t0) => {
|
|
20
|
-
const $0 = c(
|
|
20
|
+
const $0 = c(108);
|
|
21
21
|
const { ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur, leadingContent, trailingContent, onMouseEnter, onFocusCapture, ...props } = t0;
|
|
22
22
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
23
23
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
@@ -43,7 +43,7 @@ var SelectInput = (t0) => {
|
|
|
43
43
|
const { fieldState, isOpen, setIsOpen, listItems, selectedItems, onChange, onClear, onRemove, isMultiple, isLoading } = SelectContext.useSelect();
|
|
44
44
|
const isEmpty = selectedItems.length === 0;
|
|
45
45
|
const showTags = isMultiple && !isEmpty;
|
|
46
|
-
const showClearButton =
|
|
46
|
+
const showClearButton = !isDisabled && isClearable && (selectedItems.length > 0 || isSearchable && fieldState.inputValue !== "");
|
|
47
47
|
let t3;
|
|
48
48
|
bb0: {
|
|
49
49
|
let t4;
|
|
@@ -177,7 +177,7 @@ var SelectInput = (t0) => {
|
|
|
177
177
|
ref: inputRef,
|
|
178
178
|
placeholder: as === "floating" ? void 0 : placeholder,
|
|
179
179
|
onBlur,
|
|
180
|
-
className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3 disabled:text-interactive-text-secondary-disabled", inputClassName),
|
|
180
|
+
className: clsx("w-full flex-1 bg-transparent outline-none placeholder:text-text-default-3", "disabled:text-text-default-3 disabled:placeholder:text-interactive-text-secondary-disabled", inputClassName),
|
|
181
181
|
onKeyDown,
|
|
182
182
|
...fieldProps
|
|
183
183
|
})]
|
|
@@ -204,11 +204,11 @@ var SelectInput = (t0) => {
|
|
|
204
204
|
onPress: () => setIsOpen(!isOpen),
|
|
205
205
|
onBlur,
|
|
206
206
|
"data-type": "select-trigger",
|
|
207
|
-
className: clsx("w-full truncate text-start outline-none disabled:text-
|
|
207
|
+
className: clsx("group/select-trigger w-full truncate text-start outline-none disabled:text-text-default-3", showTags && "absolute inset-0 z-0"),
|
|
208
208
|
...fieldProps,
|
|
209
209
|
children: [(as === "floating" && isEmpty || isMultiple && !isEmpty) && /* @__PURE__ */ jsx(Fragment, { children: "\xA0" }), (isEmpty || !isMultiple) && (as !== "floating" || !isEmpty) && /* @__PURE__ */ jsxs(Typography, {
|
|
210
210
|
size: "label-1",
|
|
211
|
-
className: clsx("truncate empty:before:inline-block empty:before:content-['']", isEmpty && "text-text-default-3"),
|
|
211
|
+
className: clsx("truncate empty:before:inline-block empty:before:content-['']", isEmpty && "text-text-default-3 group-disabled/select-trigger:text-interactive-text-secondary-disabled"),
|
|
212
212
|
children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
|
|
213
213
|
})]
|
|
214
214
|
});
|
|
@@ -248,8 +248,8 @@ var SelectInput = (t0) => {
|
|
|
248
248
|
$0[64] = t28;
|
|
249
249
|
} else t28 = $0[64];
|
|
250
250
|
let t29;
|
|
251
|
-
if ($0[65] !== as || $0[66] !== inputClearClassCva || $0[67] !== isClearable || $0[68] !==
|
|
252
|
-
t29 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
251
|
+
if ($0[65] !== as || $0[66] !== inputClearClassCva || $0[67] !== isClearable || $0[68] !== isDisabled || $0[69] !== onClear || $0[70] !== showClearButton) {
|
|
252
|
+
t29 = isClearable && !isDisabled && /* @__PURE__ */ jsx(InputClear, {
|
|
253
253
|
onClear: () => {
|
|
254
254
|
onClear();
|
|
255
255
|
},
|
|
@@ -259,21 +259,22 @@ var SelectInput = (t0) => {
|
|
|
259
259
|
$0[65] = as;
|
|
260
260
|
$0[66] = inputClearClassCva;
|
|
261
261
|
$0[67] = isClearable;
|
|
262
|
-
$0[68] =
|
|
263
|
-
$0[69] =
|
|
264
|
-
$0[70] =
|
|
265
|
-
|
|
262
|
+
$0[68] = isDisabled;
|
|
263
|
+
$0[69] = onClear;
|
|
264
|
+
$0[70] = showClearButton;
|
|
265
|
+
$0[71] = t29;
|
|
266
|
+
} else t29 = $0[71];
|
|
266
267
|
let t30;
|
|
267
|
-
if ($0[
|
|
268
|
+
if ($0[72] !== trailingContent) {
|
|
268
269
|
t30 = trailingContent && /* @__PURE__ */ jsx("div", {
|
|
269
270
|
className: "flex shrink-0 items-center",
|
|
270
271
|
children: trailingContent
|
|
271
272
|
});
|
|
272
|
-
$0[
|
|
273
|
-
$0[
|
|
274
|
-
} else t30 = $0[
|
|
273
|
+
$0[72] = trailingContent;
|
|
274
|
+
$0[73] = t30;
|
|
275
|
+
} else t30 = $0[73];
|
|
275
276
|
let t31;
|
|
276
|
-
if ($0[
|
|
277
|
+
if ($0[74] !== hideDropdownIcon || $0[75] !== inputSizeCva || $0[76] !== isDisabled || $0[77] !== isOpen || $0[78] !== isSearchable || $0[79] !== setIsOpen || $0[80] !== size || $0[81] !== t) {
|
|
277
278
|
t31 = !hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
|
|
278
279
|
excludeFromTabOrder: true,
|
|
279
280
|
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
@@ -287,18 +288,18 @@ var SelectInput = (t0) => {
|
|
|
287
288
|
"aria-hidden": "true"
|
|
288
289
|
})
|
|
289
290
|
});
|
|
290
|
-
$0[
|
|
291
|
-
$0[
|
|
292
|
-
$0[
|
|
293
|
-
$0[
|
|
294
|
-
$0[
|
|
295
|
-
$0[
|
|
296
|
-
$0[
|
|
297
|
-
$0[
|
|
298
|
-
$0[
|
|
299
|
-
} else t31 = $0[
|
|
291
|
+
$0[74] = hideDropdownIcon;
|
|
292
|
+
$0[75] = inputSizeCva;
|
|
293
|
+
$0[76] = isDisabled;
|
|
294
|
+
$0[77] = isOpen;
|
|
295
|
+
$0[78] = isSearchable;
|
|
296
|
+
$0[79] = setIsOpen;
|
|
297
|
+
$0[80] = size;
|
|
298
|
+
$0[81] = t;
|
|
299
|
+
$0[82] = t31;
|
|
300
|
+
} else t31 = $0[82];
|
|
300
301
|
let t32;
|
|
301
|
-
if ($0[
|
|
302
|
+
if ($0[83] !== focusWithinProps || $0[84] !== hoverProps || $0[85] !== onFocusCapture || $0[86] !== onMouseEnter || $0[87] !== ref || $0[88] !== t10 || $0[89] !== t11 || $0[90] !== t12 || $0[91] !== t13 || $0[92] !== t14 || $0[93] !== t15 || $0[94] !== t16 || $0[95] !== t17 || $0[96] !== t18 || $0[97] !== t19 || $0[98] !== t20 || $0[99] !== t21 || $0[100] !== t28 || $0[101] !== t29 || $0[102] !== t30 || $0[103] !== t31 || $0[104] !== t6 || $0[105] !== t8 || $0[106] !== t9) {
|
|
302
303
|
t32 = /* @__PURE__ */ jsxs("div", {
|
|
303
304
|
ref,
|
|
304
305
|
className: t6,
|
|
@@ -329,32 +330,32 @@ var SelectInput = (t0) => {
|
|
|
329
330
|
t31
|
|
330
331
|
]
|
|
331
332
|
});
|
|
332
|
-
$0[
|
|
333
|
-
$0[
|
|
334
|
-
$0[
|
|
335
|
-
$0[
|
|
336
|
-
$0[
|
|
337
|
-
$0[
|
|
338
|
-
$0[
|
|
339
|
-
$0[
|
|
340
|
-
$0[
|
|
341
|
-
$0[
|
|
342
|
-
$0[
|
|
343
|
-
$0[
|
|
344
|
-
$0[
|
|
345
|
-
$0[
|
|
346
|
-
$0[
|
|
347
|
-
$0[
|
|
348
|
-
$0[
|
|
349
|
-
$0[
|
|
350
|
-
$0[
|
|
351
|
-
$0[
|
|
352
|
-
$0[
|
|
353
|
-
$0[
|
|
354
|
-
$0[
|
|
355
|
-
$0[
|
|
356
|
-
$0[
|
|
357
|
-
} else t32 = $0[
|
|
333
|
+
$0[83] = focusWithinProps;
|
|
334
|
+
$0[84] = hoverProps;
|
|
335
|
+
$0[85] = onFocusCapture;
|
|
336
|
+
$0[86] = onMouseEnter;
|
|
337
|
+
$0[87] = ref;
|
|
338
|
+
$0[88] = t10;
|
|
339
|
+
$0[89] = t11;
|
|
340
|
+
$0[90] = t12;
|
|
341
|
+
$0[91] = t13;
|
|
342
|
+
$0[92] = t14;
|
|
343
|
+
$0[93] = t15;
|
|
344
|
+
$0[94] = t16;
|
|
345
|
+
$0[95] = t17;
|
|
346
|
+
$0[96] = t18;
|
|
347
|
+
$0[97] = t19;
|
|
348
|
+
$0[98] = t20;
|
|
349
|
+
$0[99] = t21;
|
|
350
|
+
$0[100] = t28;
|
|
351
|
+
$0[101] = t29;
|
|
352
|
+
$0[102] = t30;
|
|
353
|
+
$0[103] = t31;
|
|
354
|
+
$0[104] = t6;
|
|
355
|
+
$0[105] = t8;
|
|
356
|
+
$0[106] = t9;
|
|
357
|
+
$0[107] = t32;
|
|
358
|
+
} else t32 = $0[107];
|
|
358
359
|
return t32;
|
|
359
360
|
};
|
|
360
361
|
//#endregion
|
|
@@ -56,7 +56,7 @@ var SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containe
|
|
|
56
56
|
...formFieldProps,
|
|
57
57
|
as,
|
|
58
58
|
labelProps,
|
|
59
|
-
className: clsx("w-full", containerClassName),
|
|
59
|
+
className: clsx("group w-full", containerClassName),
|
|
60
60
|
onMouseEnter,
|
|
61
61
|
onFocusCapture,
|
|
62
62
|
children: /* @__PURE__ */ jsxs(DialogTrigger, {
|
|
@@ -109,7 +109,8 @@ var SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containe
|
|
|
109
109
|
inputClassName,
|
|
110
110
|
className: "mb-list-height-title-bottom px-list-side-title",
|
|
111
111
|
leadingIcon: !hideSearchIcon ? /* @__PURE__ */ jsx(SearchIcon, { className: "size-6" }) : void 0,
|
|
112
|
-
size: "default"
|
|
112
|
+
size: "default",
|
|
113
|
+
isClearable
|
|
113
114
|
}), /* @__PURE__ */ jsx(SelectListBox, {
|
|
114
115
|
...props,
|
|
115
116
|
autoFocus: !isSearchable,
|
|
@@ -3,4 +3,5 @@ import { Key } from 'react-aria-components';
|
|
|
3
3
|
import { SelectItem } from './select.types';
|
|
4
4
|
export type QueryFn<TData = any> = (...args: any[]) => UseQueryResult<TData> | UseInfiniteQueryResult<TData>;
|
|
5
5
|
export type QueryDataType<TQueryFn extends QueryFn> = Exclude<ReturnType<TQueryFn>["data"], undefined>;
|
|
6
|
+
export declare const isInitialSelectionLabelMissing: <TInitialSelectItem>(initialSelection: TInitialSelectItem | TInitialSelectItem[] | null | undefined, mapInitialToSelectItem?: (item: TInitialSelectItem) => SelectItem) => boolean;
|
|
6
7
|
export declare const getQueryItems: <TQueryFn extends QueryFn, TKey extends Key = Key>(data: QueryDataType<TQueryFn> | undefined, queryMap?: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[]) => SelectItem<TKey>[];
|
|
@@ -1,4 +1,15 @@
|
|
|
1
1
|
//#region src/components/inputs/Selection/shared/querySelect.utils.ts
|
|
2
|
+
var getDefaultInitialSelectionLabel = (initialSelection) => {
|
|
3
|
+
if (typeof initialSelection !== "object" || initialSelection === null) return "";
|
|
4
|
+
if ("label" in initialSelection && typeof initialSelection.label === "string") return initialSelection.label;
|
|
5
|
+
if ("name" in initialSelection && typeof initialSelection.name === "string") return initialSelection.name;
|
|
6
|
+
return "";
|
|
7
|
+
};
|
|
8
|
+
var isInitialSelectionLabelMissing = (initialSelection, mapInitialToSelectItem) => {
|
|
9
|
+
return (Array.isArray(initialSelection) ? initialSelection : initialSelection != null ? [initialSelection] : []).some((item) => {
|
|
10
|
+
return (mapInitialToSelectItem?.(item).label ?? getDefaultInitialSelectionLabel(item)) === "";
|
|
11
|
+
});
|
|
12
|
+
};
|
|
2
13
|
var getQueryItems = (data, queryMap) => {
|
|
3
14
|
if (!data) return [];
|
|
4
15
|
if (queryMap) return queryMap(data);
|
|
@@ -10,4 +21,4 @@ var getQueryItems = (data, queryMap) => {
|
|
|
10
21
|
return [];
|
|
11
22
|
};
|
|
12
23
|
//#endregion
|
|
13
|
-
export { getQueryItems };
|
|
24
|
+
export { getQueryItems, isInitialSelectionLabelMissing };
|
|
@@ -166,10 +166,12 @@ var SelectContext;
|
|
|
166
166
|
emitStateChanges(newFieldState_2);
|
|
167
167
|
setShowAll(true);
|
|
168
168
|
}
|
|
169
|
+
fieldOnBlur?.({});
|
|
169
170
|
}, [
|
|
170
171
|
props.isSearchable,
|
|
171
172
|
isMultiple,
|
|
172
|
-
fieldState
|
|
173
|
+
fieldState,
|
|
174
|
+
fieldOnBlur
|
|
173
175
|
]);
|
|
174
176
|
const value_5 = useMemo(() => ({
|
|
175
177
|
fieldState,
|
|
@@ -72,6 +72,7 @@ export interface InputFrameProps extends InputVariantProps, Partial<FormFieldPro
|
|
|
72
72
|
contentAndTrailingClassName?: string;
|
|
73
73
|
wrapContentAndTrailing?: boolean;
|
|
74
74
|
wrapTrailingContent?: boolean;
|
|
75
|
+
reserveTrailingContent?: boolean;
|
|
75
76
|
labelPlacement?: InputFrameLabelPlacement;
|
|
76
77
|
trailingClassName?: string;
|
|
77
78
|
}
|