@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
|
@@ -1,82 +1,85 @@
|
|
|
1
|
+
import { Typography } from "../../../text/Typography/Typography.js";
|
|
1
2
|
import { DateSegmentItemView } from "./DateSegmentItem.js";
|
|
2
3
|
import { DateTimeUtils } from "../../../../utils/date-time.utils.js";
|
|
3
4
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/inputs/DateTime/shared/staticDateTimeSegments.tsx
|
|
5
|
-
var getStaticCalendarDateSegments = ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
|
|
6
|
-
|
|
7
|
-
return
|
|
8
|
-
isPlaceholder: !hasValue,
|
|
9
|
-
isInputEmpty: !hasValue,
|
|
6
|
+
var getStaticCalendarDateSegments = ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder, dateGranularity = "day" }) => {
|
|
7
|
+
if (disableManualEntry && placeholder && !value) return getStaticDateTimePlaceholder(placeholder);
|
|
8
|
+
return renderStaticDateTimeParts(DateTimeUtils.formatCalendarDatePartsLocalized(value, locale, { shouldForceLeadingZeros }), {
|
|
10
9
|
isDisabled,
|
|
11
|
-
hidePlaceholder
|
|
10
|
+
hidePlaceholder,
|
|
11
|
+
dateGranularity
|
|
12
12
|
});
|
|
13
13
|
};
|
|
14
|
-
var getStaticCalendarDateTimeSegments = ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
|
|
14
|
+
var getStaticCalendarDateTimeSegments = ({ value, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder }) => {
|
|
15
15
|
const hasValue = !!(value && "hour" in value);
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
isInputEmpty: !hasValue,
|
|
16
|
+
if (disableManualEntry && placeholder && !hasValue) return getStaticDateTimePlaceholder(placeholder);
|
|
17
|
+
return renderStaticDateTimeParts(DateTimeUtils.formatCalendarDateTimePartsLocalized(hasValue ? value : null, locale, { shouldForceLeadingZeros }), {
|
|
19
18
|
isDisabled,
|
|
20
19
|
hidePlaceholder,
|
|
21
20
|
segmentRole: "spinbutton"
|
|
22
21
|
});
|
|
23
22
|
};
|
|
24
|
-
var getStaticDateRangeSegments = ({ start, end, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder }) => {
|
|
25
|
-
|
|
23
|
+
var getStaticDateRangeSegments = ({ start, end, locale, shouldForceLeadingZeros, isDisabled, hidePlaceholder, disableManualEntry, placeholder }) => {
|
|
24
|
+
if (disableManualEntry && placeholder && !start && !end) return getStaticDateTimePlaceholder(placeholder);
|
|
25
|
+
const showSeparator = !hidePlaceholder;
|
|
26
26
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
27
|
-
|
|
28
|
-
isPlaceholder: !start,
|
|
29
|
-
isInputEmpty: !start,
|
|
27
|
+
renderStaticDateTimeParts(DateTimeUtils.formatCalendarDatePartsLocalized(start, locale, { shouldForceLeadingZeros }), {
|
|
30
28
|
isDisabled,
|
|
31
29
|
hidePlaceholder: hidePlaceholder && !start
|
|
32
30
|
}),
|
|
33
|
-
/* @__PURE__ */ jsx("span", {
|
|
31
|
+
showSeparator && /* @__PURE__ */ jsx("span", {
|
|
34
32
|
className: isDisabled ? "pointer-events-none select-none text-interactive-text-secondary-disabled" : "pointer-events-none select-none",
|
|
35
33
|
children: "–"
|
|
36
34
|
}),
|
|
37
|
-
|
|
38
|
-
isPlaceholder: !end,
|
|
39
|
-
isInputEmpty: !end,
|
|
35
|
+
renderStaticDateTimeParts(DateTimeUtils.formatCalendarDatePartsLocalized(end, locale, { shouldForceLeadingZeros }), {
|
|
40
36
|
isDisabled,
|
|
41
37
|
hidePlaceholder: hidePlaceholder && !end
|
|
42
38
|
})
|
|
43
39
|
] });
|
|
44
40
|
};
|
|
45
|
-
var getStaticTimeSegments = ({ value, locale, isDisabled, hidePlaceholder }) => {
|
|
46
|
-
|
|
47
|
-
return
|
|
48
|
-
isPlaceholder: !hasValue,
|
|
49
|
-
isInputEmpty: !hasValue,
|
|
41
|
+
var getStaticTimeSegments = ({ value, locale, isDisabled, hidePlaceholder, disableManualEntry, placeholder }) => {
|
|
42
|
+
if (disableManualEntry && placeholder && !value) return getStaticDateTimePlaceholder(placeholder);
|
|
43
|
+
return renderStaticDateTimeParts(DateTimeUtils.formatTimePartsLocalized(value, locale), {
|
|
50
44
|
isDisabled,
|
|
51
45
|
hidePlaceholder,
|
|
52
46
|
timePickerOnly: true
|
|
53
47
|
});
|
|
54
48
|
};
|
|
55
|
-
var
|
|
49
|
+
var getStaticDateTimePlaceholder = (placeholder) => /* @__PURE__ */ jsx(Typography, {
|
|
50
|
+
size: "label-1",
|
|
51
|
+
className: "text-text-default-3",
|
|
52
|
+
children: placeholder
|
|
53
|
+
});
|
|
54
|
+
var renderStaticDateTimeParts = (parts, options) => {
|
|
56
55
|
return /* @__PURE__ */ jsx("div", {
|
|
57
56
|
className: "flex",
|
|
58
|
-
children:
|
|
59
|
-
type:
|
|
60
|
-
text:
|
|
61
|
-
placeholder:
|
|
62
|
-
isPlaceholder:
|
|
63
|
-
isInputEmpty:
|
|
57
|
+
children: getStaticDateTimePartsToRender(parts, options.dateGranularity).map((part, index) => /* @__PURE__ */ jsx(DateSegmentItemView, {
|
|
58
|
+
type: part.type,
|
|
59
|
+
text: part.value,
|
|
60
|
+
placeholder: part.placeholder,
|
|
61
|
+
isPlaceholder: part.isPlaceholder && part.type !== "literal",
|
|
62
|
+
isInputEmpty: parts.some((item) => item.type !== "literal" && item.isPlaceholder),
|
|
64
63
|
isDisabled: options.isDisabled,
|
|
65
64
|
timePickerOnly: options.timePickerOnly,
|
|
66
65
|
hidePlaceholder: options.hidePlaceholder,
|
|
67
|
-
role:
|
|
66
|
+
role: part.type === "literal" ? void 0 : options.segmentRole
|
|
68
67
|
}, index))
|
|
69
68
|
});
|
|
70
69
|
};
|
|
71
|
-
var
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
type
|
|
75
|
-
}));
|
|
70
|
+
var getStaticDateTimePartsToRender = (parts, dateGranularity = "day") => {
|
|
71
|
+
const segments = [];
|
|
72
|
+
for (const part of parts) if (part.type !== "literal") {
|
|
73
|
+
if (isStaticDatePartVisible(part.type, dateGranularity)) segments.push(part);
|
|
74
|
+
} else if (segments.length > 0 && segments.at(-1)?.type !== "literal") segments.push(part);
|
|
75
|
+
if (segments.at(-1)?.type === "literal") segments.pop();
|
|
76
|
+
return segments;
|
|
76
77
|
};
|
|
77
|
-
var
|
|
78
|
-
if (
|
|
79
|
-
|
|
78
|
+
var isStaticDatePartVisible = (type, dateGranularity) => {
|
|
79
|
+
if (dateGranularity === "day") return true;
|
|
80
|
+
if (dateGranularity === "month") return type !== "day";
|
|
81
|
+
if (dateGranularity === "year") return type === "year";
|
|
82
|
+
return true;
|
|
80
83
|
};
|
|
81
84
|
//#endregion
|
|
82
85
|
export { getStaticCalendarDateSegments, getStaticCalendarDateTimeSegments, getStaticDateRangeSegments, getStaticTimeSegments };
|
|
@@ -30,7 +30,7 @@ var InputUploadFilled = (t0) => {
|
|
|
30
30
|
variant: "default",
|
|
31
31
|
size: "label-1",
|
|
32
32
|
as: "span",
|
|
33
|
-
className: "flex-fill select-none truncate text-ellipsis text-text-default-1",
|
|
33
|
+
className: "flex-fill select-none truncate text-ellipsis text-text-default-1 input-disabled:text-text-default-3",
|
|
34
34
|
children: t2
|
|
35
35
|
});
|
|
36
36
|
$[5] = t2;
|
|
@@ -18,7 +18,7 @@ import { Controller } from "react-hook-form";
|
|
|
18
18
|
import { useNumberFieldState } from "react-stately";
|
|
19
19
|
//#region src/components/inputs/Input/NumberInput/NumberInput.tsx
|
|
20
20
|
var NumberInputBase = (props) => {
|
|
21
|
-
const $ = c(
|
|
21
|
+
const $ = c(90);
|
|
22
22
|
const ui = UIConfig.useConfig();
|
|
23
23
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
24
24
|
const hasControlledValue = "value" in props;
|
|
@@ -57,7 +57,8 @@ var NumberInputBase = (props) => {
|
|
|
57
57
|
locale,
|
|
58
58
|
formatOptions
|
|
59
59
|
};
|
|
60
|
-
const
|
|
60
|
+
const state = useNumberFieldState(numberProps);
|
|
61
|
+
const { labelProps, inputProps } = useNumberField(numberProps, state, numberFieldRef);
|
|
61
62
|
let t2;
|
|
62
63
|
let t3;
|
|
63
64
|
if ($[4] !== autoFocusOnMount || $[5] !== isDisabled) {
|
|
@@ -116,13 +117,17 @@ var NumberInputBase = (props) => {
|
|
|
116
117
|
} else t6 = $[21];
|
|
117
118
|
const handleInputBlur = t6;
|
|
118
119
|
let t7;
|
|
119
|
-
if ($[22] !== onChange) {
|
|
120
|
-
t7 = (val) =>
|
|
120
|
+
if ($[22] !== onChange || $[23] !== state) {
|
|
121
|
+
t7 = (val) => {
|
|
122
|
+
if (val === "") state.setInputValue("");
|
|
123
|
+
onChange?.(val === "" ? null : Number(val));
|
|
124
|
+
};
|
|
121
125
|
$[22] = onChange;
|
|
122
|
-
$[23] =
|
|
123
|
-
|
|
126
|
+
$[23] = state;
|
|
127
|
+
$[24] = t7;
|
|
128
|
+
} else t7 = $[24];
|
|
124
129
|
let t8;
|
|
125
|
-
if ($[
|
|
130
|
+
if ($[25] !== action || $[26] !== handleInputBlur || $[27] !== isClearable || $[28] !== isDisabled || $[29] !== isLoading || $[30] !== leadingIcon || $[31] !== state.inputValue || $[32] !== t7 || $[33] !== trailingIcon || $[34] !== unit) {
|
|
126
131
|
t8 = {
|
|
127
132
|
unit,
|
|
128
133
|
isLoading,
|
|
@@ -131,26 +136,26 @@ var NumberInputBase = (props) => {
|
|
|
131
136
|
leadingIcon,
|
|
132
137
|
trailingIcon,
|
|
133
138
|
isClearable,
|
|
134
|
-
value,
|
|
135
139
|
onChange: t7,
|
|
140
|
+
value: state.inputValue,
|
|
136
141
|
onBlur: handleInputBlur
|
|
137
142
|
};
|
|
138
|
-
$[
|
|
139
|
-
$[
|
|
140
|
-
$[
|
|
141
|
-
$[
|
|
142
|
-
$[
|
|
143
|
-
$[
|
|
144
|
-
$[
|
|
145
|
-
$[
|
|
146
|
-
$[
|
|
147
|
-
$[
|
|
148
|
-
$[
|
|
149
|
-
} else t8 = $[
|
|
143
|
+
$[25] = action;
|
|
144
|
+
$[26] = handleInputBlur;
|
|
145
|
+
$[27] = isClearable;
|
|
146
|
+
$[28] = isDisabled;
|
|
147
|
+
$[29] = isLoading;
|
|
148
|
+
$[30] = leadingIcon;
|
|
149
|
+
$[31] = state.inputValue;
|
|
150
|
+
$[32] = t7;
|
|
151
|
+
$[33] = trailingIcon;
|
|
152
|
+
$[34] = unit;
|
|
153
|
+
$[35] = t8;
|
|
154
|
+
} else t8 = $[35];
|
|
150
155
|
const inputContentProps = t8;
|
|
151
156
|
const t9 = hideLabel || isHeaderHidden;
|
|
152
157
|
let t10;
|
|
153
|
-
if ($[
|
|
158
|
+
if ($[36] !== headerClassName || $[37] !== helperText || $[38] !== isDisabled || $[39] !== isRequired || $[40] !== label || $[41] !== labelProps || $[42] !== rightContent || $[43] !== t9 || $[44] !== tooltipText) {
|
|
154
159
|
t10 = {
|
|
155
160
|
label,
|
|
156
161
|
tooltipText,
|
|
@@ -162,28 +167,28 @@ var NumberInputBase = (props) => {
|
|
|
162
167
|
className: headerClassName,
|
|
163
168
|
labelProps
|
|
164
169
|
};
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
$[
|
|
171
|
-
$[
|
|
172
|
-
$[
|
|
173
|
-
$[
|
|
174
|
-
$[
|
|
175
|
-
} else t10 = $[
|
|
170
|
+
$[36] = headerClassName;
|
|
171
|
+
$[37] = helperText;
|
|
172
|
+
$[38] = isDisabled;
|
|
173
|
+
$[39] = isRequired;
|
|
174
|
+
$[40] = label;
|
|
175
|
+
$[41] = labelProps;
|
|
176
|
+
$[42] = rightContent;
|
|
177
|
+
$[43] = t9;
|
|
178
|
+
$[44] = tooltipText;
|
|
179
|
+
$[45] = t10;
|
|
180
|
+
} else t10 = $[45];
|
|
176
181
|
const headerProps = t10;
|
|
177
182
|
const dataIsDisabled = isDisabled || void 0;
|
|
178
183
|
const T0 = TooltipWrapper;
|
|
179
184
|
const t11 = as === "inline" ? -1 : void 0;
|
|
180
185
|
const T1 = FormField;
|
|
181
186
|
let t12;
|
|
182
|
-
if ($[
|
|
187
|
+
if ($[46] !== className) {
|
|
183
188
|
t12 = clsx("group w-full", className);
|
|
184
|
-
$[
|
|
185
|
-
$[
|
|
186
|
-
} else t12 = $[
|
|
189
|
+
$[46] = className;
|
|
190
|
+
$[47] = t12;
|
|
191
|
+
} else t12 = $[47];
|
|
187
192
|
const t13 = as === "inline" ? -1 : void 0;
|
|
188
193
|
const t14 = clsx("relative flex cursor-text has-disabled:cursor-default", inputBaseCva({
|
|
189
194
|
variant,
|
|
@@ -191,35 +196,35 @@ var NumberInputBase = (props) => {
|
|
|
191
196
|
...rest
|
|
192
197
|
}), inputClassName);
|
|
193
198
|
let t15;
|
|
194
|
-
if ($[
|
|
199
|
+
if ($[48] === Symbol.for("react.memo_cache_sentinel")) {
|
|
195
200
|
t15 = () => inputRef.current?.focus();
|
|
196
|
-
$[
|
|
197
|
-
} else t15 = $[
|
|
201
|
+
$[48] = t15;
|
|
202
|
+
} else t15 = $[48];
|
|
198
203
|
const t16 = value === null || value === void 0 || void 0;
|
|
199
204
|
const t17 = isRequired || void 0;
|
|
200
205
|
let t18;
|
|
201
|
-
if ($[
|
|
202
|
-
t18 = mergeRefs(ref, inputRef);
|
|
203
|
-
$[
|
|
204
|
-
$[
|
|
205
|
-
} else t18 = $[
|
|
206
|
+
if ($[49] !== ref) {
|
|
207
|
+
t18 = mergeRefs(ref, inputRef, numberFieldRef);
|
|
208
|
+
$[49] = ref;
|
|
209
|
+
$[50] = t18;
|
|
210
|
+
} else t18 = $[50];
|
|
206
211
|
const t19 = isDirty || void 0;
|
|
207
212
|
const t20 = isRequired || void 0;
|
|
208
|
-
const t21 =
|
|
213
|
+
const t21 = state.inputValue === "" || state.inputValue === void 0 || state.inputValue === null || void 0;
|
|
209
214
|
const t22 = !("" + value === "" || value === null || value === void 0) || void 0;
|
|
210
215
|
const t23 = as === "floating" ? "\xA0" : inputProps.placeholder;
|
|
211
216
|
let t24;
|
|
212
|
-
if ($[
|
|
217
|
+
if ($[51] !== inputProps || $[52] !== isFocusVisible) {
|
|
213
218
|
t24 = (e_1) => {
|
|
214
219
|
inputProps.onFocus?.(e_1);
|
|
215
220
|
if (isFocusVisible) e_1.target.select();
|
|
216
221
|
};
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
} else t24 = $[
|
|
222
|
+
$[51] = inputProps;
|
|
223
|
+
$[52] = isFocusVisible;
|
|
224
|
+
$[53] = t24;
|
|
225
|
+
} else t24 = $[53];
|
|
221
226
|
let t25;
|
|
222
|
-
if ($[
|
|
227
|
+
if ($[54] !== dataIsDisabled || $[55] !== inputProps || $[56] !== t18 || $[57] !== t19 || $[58] !== t20 || $[59] !== t21 || $[60] !== t22 || $[61] !== t23 || $[62] !== t24) {
|
|
223
228
|
t25 = /* @__PURE__ */ jsx(Input, {
|
|
224
229
|
...inputProps,
|
|
225
230
|
ref: t18,
|
|
@@ -232,19 +237,19 @@ var NumberInputBase = (props) => {
|
|
|
232
237
|
className: "w-full bg-transparent outline-none",
|
|
233
238
|
onFocus: t24
|
|
234
239
|
});
|
|
235
|
-
$[
|
|
236
|
-
$[
|
|
237
|
-
$[
|
|
238
|
-
$[
|
|
239
|
-
$[
|
|
240
|
-
$[
|
|
241
|
-
$[
|
|
242
|
-
$[
|
|
243
|
-
$[
|
|
244
|
-
$[
|
|
245
|
-
} else t25 = $[
|
|
240
|
+
$[54] = dataIsDisabled;
|
|
241
|
+
$[55] = inputProps;
|
|
242
|
+
$[56] = t18;
|
|
243
|
+
$[57] = t19;
|
|
244
|
+
$[58] = t20;
|
|
245
|
+
$[59] = t21;
|
|
246
|
+
$[60] = t22;
|
|
247
|
+
$[61] = t23;
|
|
248
|
+
$[62] = t24;
|
|
249
|
+
$[63] = t25;
|
|
250
|
+
} else t25 = $[63];
|
|
246
251
|
let t26;
|
|
247
|
-
if ($[
|
|
252
|
+
if ($[64] !== as || $[65] !== headerProps || $[66] !== inputContentProps || $[67] !== size || $[68] !== t25) {
|
|
248
253
|
t26 = /* @__PURE__ */ jsx(InputContent, {
|
|
249
254
|
...inputContentProps,
|
|
250
255
|
headerProps,
|
|
@@ -252,15 +257,15 @@ var NumberInputBase = (props) => {
|
|
|
252
257
|
size,
|
|
253
258
|
children: t25
|
|
254
259
|
});
|
|
255
|
-
$[
|
|
256
|
-
$[
|
|
257
|
-
$[
|
|
258
|
-
$[
|
|
259
|
-
$[
|
|
260
|
-
$[
|
|
261
|
-
} else t26 = $[
|
|
260
|
+
$[64] = as;
|
|
261
|
+
$[65] = headerProps;
|
|
262
|
+
$[66] = inputContentProps;
|
|
263
|
+
$[67] = size;
|
|
264
|
+
$[68] = t25;
|
|
265
|
+
$[69] = t26;
|
|
266
|
+
} else t26 = $[69];
|
|
262
267
|
let t27;
|
|
263
|
-
if ($[
|
|
268
|
+
if ($[70] !== dataIsDisabled || $[71] !== t14 || $[72] !== t16 || $[73] !== t17 || $[74] !== t26) {
|
|
264
269
|
t27 = /* @__PURE__ */ jsx("div", {
|
|
265
270
|
className: t14,
|
|
266
271
|
onClick: t15,
|
|
@@ -269,15 +274,15 @@ var NumberInputBase = (props) => {
|
|
|
269
274
|
"data-is-disabled": dataIsDisabled,
|
|
270
275
|
children: t26
|
|
271
276
|
});
|
|
272
|
-
$[
|
|
273
|
-
$[
|
|
274
|
-
$[
|
|
275
|
-
$[
|
|
276
|
-
$[
|
|
277
|
-
$[
|
|
278
|
-
} else t27 = $[
|
|
277
|
+
$[70] = dataIsDisabled;
|
|
278
|
+
$[71] = t14;
|
|
279
|
+
$[72] = t16;
|
|
280
|
+
$[73] = t17;
|
|
281
|
+
$[74] = t26;
|
|
282
|
+
$[75] = t27;
|
|
283
|
+
} else t27 = $[75];
|
|
279
284
|
let t28;
|
|
280
|
-
if ($[
|
|
285
|
+
if ($[76] !== T1 || $[77] !== as || $[78] !== formFieldProps || $[79] !== labelProps || $[80] !== t12 || $[81] !== t13 || $[82] !== t27) {
|
|
281
286
|
t28 = /* @__PURE__ */ jsx(T1, {
|
|
282
287
|
...formFieldProps,
|
|
283
288
|
as,
|
|
@@ -286,30 +291,30 @@ var NumberInputBase = (props) => {
|
|
|
286
291
|
tabIndex: t13,
|
|
287
292
|
children: t27
|
|
288
293
|
});
|
|
289
|
-
$[
|
|
290
|
-
$[
|
|
291
|
-
$[
|
|
292
|
-
$[
|
|
293
|
-
$[
|
|
294
|
-
$[
|
|
295
|
-
$[
|
|
296
|
-
$[
|
|
297
|
-
} else t28 = $[
|
|
294
|
+
$[76] = T1;
|
|
295
|
+
$[77] = as;
|
|
296
|
+
$[78] = formFieldProps;
|
|
297
|
+
$[79] = labelProps;
|
|
298
|
+
$[80] = t12;
|
|
299
|
+
$[81] = t13;
|
|
300
|
+
$[82] = t27;
|
|
301
|
+
$[83] = t28;
|
|
302
|
+
} else t28 = $[83];
|
|
298
303
|
let t29;
|
|
299
|
-
if ($[
|
|
304
|
+
if ($[84] !== T0 || $[85] !== as || $[86] !== error || $[87] !== t11 || $[88] !== t28) {
|
|
300
305
|
t29 = /* @__PURE__ */ jsx(T0, {
|
|
301
306
|
as,
|
|
302
307
|
error,
|
|
303
308
|
triggerTabIndex: t11,
|
|
304
309
|
children: t28
|
|
305
310
|
});
|
|
306
|
-
$[
|
|
307
|
-
$[
|
|
308
|
-
$[
|
|
309
|
-
$[
|
|
310
|
-
$[
|
|
311
|
-
$[
|
|
312
|
-
} else t29 = $[
|
|
311
|
+
$[84] = T0;
|
|
312
|
+
$[85] = as;
|
|
313
|
+
$[86] = error;
|
|
314
|
+
$[87] = t11;
|
|
315
|
+
$[88] = t28;
|
|
316
|
+
$[89] = t29;
|
|
317
|
+
} else t29 = $[89];
|
|
313
318
|
return t29;
|
|
314
319
|
};
|
|
315
320
|
var NumberInputInner = (t0) => {
|
|
@@ -369,6 +374,7 @@ var NumberInputInner = (t0) => {
|
|
|
369
374
|
contentClassName: t6,
|
|
370
375
|
trailingClassName: "py-0! pl-0!",
|
|
371
376
|
wrapContentAndTrailing: true,
|
|
377
|
+
reserveTrailingContent: true,
|
|
372
378
|
children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
|
|
373
379
|
type: "text",
|
|
374
380
|
ref: inputRef,
|
|
@@ -377,7 +383,7 @@ var NumberInputInner = (t0) => {
|
|
|
377
383
|
tabIndex: -1,
|
|
378
384
|
value: displayValue,
|
|
379
385
|
placeholder: as === "floating" ? "" : props.placeholder,
|
|
380
|
-
className: "w-full bg-transparent outline-none
|
|
386
|
+
className: "w-full bg-transparent outline-none",
|
|
381
387
|
onChange: (event) => replayStaticInputChange(event.target.value),
|
|
382
388
|
...dataAttributeProps,
|
|
383
389
|
"data-rac": true
|
|
@@ -185,9 +185,9 @@ var NumberRangeValueField = (t0) => {
|
|
|
185
185
|
} else t14 = $[51];
|
|
186
186
|
let t15;
|
|
187
187
|
if ($[52] !== isClearable || $[53] !== isDisabled || $[54] !== onClear || $[55] !== value) {
|
|
188
|
-
t15 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
188
|
+
t15 = isClearable && !isDisabled && /* @__PURE__ */ jsx(InputClear, {
|
|
189
189
|
onClear,
|
|
190
|
-
show: value !== null
|
|
190
|
+
show: value !== null
|
|
191
191
|
});
|
|
192
192
|
$[52] = isClearable;
|
|
193
193
|
$[53] = isDisabled;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
2
2
|
import { UIConfig } from "../../../../config/uiConfig.context.js";
|
|
3
|
+
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
3
4
|
import { InputClear } from "../../shared/InputClear.js";
|
|
4
5
|
import { inputBase, inputSize } from "../../shared/input.cva.js";
|
|
5
6
|
import { InputFrame } from "../../Skeleton/InputFrame.js";
|
|
@@ -421,39 +422,61 @@ var NumberRangeInputInner = (t0) => {
|
|
|
421
422
|
children: (t2) => {
|
|
422
423
|
const { id, ...dataAttributeProps } = t2;
|
|
423
424
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
424
|
-
/* @__PURE__ */
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
425
|
+
/* @__PURE__ */ jsxs("div", {
|
|
426
|
+
className: "min-w-0 flex-1",
|
|
427
|
+
children: [/* @__PURE__ */ jsx(FormFieldLabel, {
|
|
428
|
+
label: props.minLabel ?? "Minimum",
|
|
429
|
+
isRequired: props.isRequired,
|
|
430
|
+
isDisabled,
|
|
431
|
+
className: clsx((props.hideInnerLabels ?? true) && "sr-only")
|
|
432
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
433
|
+
className: "flex items-center gap-input-gap-trailing-elements",
|
|
434
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
435
|
+
id,
|
|
436
|
+
readOnly: true,
|
|
437
|
+
disabled: isDisabled,
|
|
438
|
+
tabIndex: -1,
|
|
439
|
+
value: minDisplay ?? "",
|
|
440
|
+
placeholder: props.minPlaceholder ?? "Min",
|
|
441
|
+
className: clsx("w-full min-w-0 bg-transparent outline-none", props.minInputClassName),
|
|
442
|
+
...dataAttributeProps,
|
|
443
|
+
"data-rac": true
|
|
444
|
+
}), isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
445
|
+
onClear: _temp,
|
|
446
|
+
show: staticValue.min !== null,
|
|
447
|
+
renderStatic: true
|
|
448
|
+
})]
|
|
449
|
+
})]
|
|
438
450
|
}),
|
|
439
451
|
/* @__PURE__ */ jsx("span", {
|
|
440
452
|
className: "pointer-events-none shrink-0 select-none text-label-2 text-text-default-3",
|
|
441
453
|
children: "-"
|
|
442
454
|
}),
|
|
443
|
-
/* @__PURE__ */
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
455
|
+
/* @__PURE__ */ jsxs("div", {
|
|
456
|
+
className: "min-w-0 flex-1",
|
|
457
|
+
children: [/* @__PURE__ */ jsx(FormFieldLabel, {
|
|
458
|
+
label: props.maxLabel ?? "Maximum",
|
|
459
|
+
isRequired: props.isRequired,
|
|
460
|
+
isDisabled,
|
|
461
|
+
className: clsx((props.hideInnerLabels ?? true) && "sr-only")
|
|
462
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
463
|
+
className: "flex items-center gap-input-gap-trailing-elements",
|
|
464
|
+
children: [/* @__PURE__ */ jsx("input", {
|
|
465
|
+
id: `${id}-max`,
|
|
466
|
+
readOnly: true,
|
|
467
|
+
disabled: isDisabled,
|
|
468
|
+
tabIndex: -1,
|
|
469
|
+
value: maxDisplay ?? "",
|
|
470
|
+
placeholder: props.maxPlaceholder ?? "Max",
|
|
471
|
+
className: clsx("w-full min-w-0 bg-transparent outline-none", props.maxInputClassName),
|
|
472
|
+
...dataAttributeProps,
|
|
473
|
+
"data-rac": true
|
|
474
|
+
}), isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
475
|
+
onClear: _temp2,
|
|
476
|
+
show: staticValue.max !== null,
|
|
477
|
+
renderStatic: true
|
|
478
|
+
})]
|
|
479
|
+
})]
|
|
457
480
|
})
|
|
458
481
|
] });
|
|
459
482
|
}
|
|
@@ -507,7 +530,7 @@ var NumberRangeInput = (t0) => {
|
|
|
507
530
|
value: field.value ?? EMPTY_RANGE,
|
|
508
531
|
onChange: field.onChange,
|
|
509
532
|
onBlur: field.onBlur,
|
|
510
|
-
isDisabled: field.disabled || props.isDisabled,
|
|
533
|
+
isDisabled: field.disabled || !!controlWithOptions._options?.disabled || props.isDisabled,
|
|
511
534
|
isFormControlDisabled: !!controlWithOptions._options?.disabled,
|
|
512
535
|
error: props.error ?? error?.message,
|
|
513
536
|
renderStaticInput
|
|
@@ -95,7 +95,7 @@ var TextAreaBase = (props) => {
|
|
|
95
95
|
className: headerClassName,
|
|
96
96
|
labelProps
|
|
97
97
|
};
|
|
98
|
-
showClear = isClearable && value != null && value !== "";
|
|
98
|
+
showClear = isClearable && value != null && value !== "" && !isDisabled;
|
|
99
99
|
T1 = TooltipWrapper;
|
|
100
100
|
t11 = as;
|
|
101
101
|
t12 = error;
|
|
@@ -105,7 +105,7 @@ var TextAreaBase = (props) => {
|
|
|
105
105
|
t7 = as;
|
|
106
106
|
t8 = labelProps;
|
|
107
107
|
if ($[43] !== className) {
|
|
108
|
-
t9 = clsx("w-full", className);
|
|
108
|
+
t9 = clsx("group w-full", className);
|
|
109
109
|
$[43] = className;
|
|
110
110
|
$[44] = t9;
|
|
111
111
|
} else t9 = $[44];
|
|
@@ -343,6 +343,7 @@ var TextInputInner = (t0) => {
|
|
|
343
343
|
contentClassName: t6,
|
|
344
344
|
trailingClassName: "py-0! pl-0!",
|
|
345
345
|
wrapContentAndTrailing: true,
|
|
346
|
+
reserveTrailingContent: true,
|
|
346
347
|
children: (dataAttributeProps) => /* @__PURE__ */ jsx("input", {
|
|
347
348
|
ref: inputRef,
|
|
348
349
|
type: inputType === "hidden" ? "password" : inputType,
|
|
@@ -350,7 +351,7 @@ var TextInputInner = (t0) => {
|
|
|
350
351
|
tabIndex: -1,
|
|
351
352
|
value: displayValue,
|
|
352
353
|
placeholder: as === "floating" ? "" : props.placeholder,
|
|
353
|
-
className: "w-full bg-transparent outline-none
|
|
354
|
+
className: "w-full bg-transparent outline-none",
|
|
354
355
|
onChange: (event) => replayStaticInputChange(event.target.value),
|
|
355
356
|
...dataAttributeProps,
|
|
356
357
|
"data-rac": true
|