@povio/ui 2.3.0-rc.17 → 2.3.0-rc.19
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/DateTime/DatePicker/DatePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +6 -4
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +6 -4
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +6 -4
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +193 -185
- package/dist/components/inputs/DateTime/shared/Calendar.js +49 -47
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +199 -181
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +59 -55
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +143 -134
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +44 -43
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +120 -129
- package/dist/components/inputs/Selection/shared/select.context.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/select.context.js +10 -4
- package/dist/config/uiConfig.context.d.ts +1 -1
- package/dist/config/uiConfig.context.js +1 -0
- package/package.json +1 -1
|
@@ -14,8 +14,8 @@ import { Button } from "react-aria-components";
|
|
|
14
14
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
15
15
|
//#region src/components/inputs/DateTime/shared/TimePickerInput.tsx
|
|
16
16
|
var TimePickerInput = (t0) => {
|
|
17
|
-
const $ = c(
|
|
18
|
-
const { ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, ...props } = t0;
|
|
17
|
+
const $ = c(66);
|
|
18
|
+
const { ref, as, fieldProps, state, isDisabled, isDirty, isRequired, isInvalid, disableDropdown, variant, size, isClearable, headerProps, disableManualEntry, placeholder, className, onPress, fireBlurOnChange, ...props } = t0;
|
|
19
19
|
const uiConfig = UIConfig.useConfig();
|
|
20
20
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
21
21
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
@@ -137,22 +137,23 @@ var TimePickerInput = (t0) => {
|
|
|
137
137
|
$[30] = t21;
|
|
138
138
|
} else t21 = $[30];
|
|
139
139
|
let t22;
|
|
140
|
-
if ($[31] !== canClear || $[32] !== fieldProps || $[33] !==
|
|
140
|
+
if ($[31] !== canClear || $[32] !== fieldProps || $[33] !== fireBlurOnChange || $[34] !== isClearable || $[35] !== state) {
|
|
141
141
|
t22 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
142
142
|
onClear: () => {
|
|
143
143
|
state.setValue(null);
|
|
144
|
-
fieldProps.onBlur?.(null);
|
|
144
|
+
if (fireBlurOnChange) fieldProps.onBlur?.(null);
|
|
145
145
|
},
|
|
146
146
|
show: canClear
|
|
147
147
|
});
|
|
148
148
|
$[31] = canClear;
|
|
149
149
|
$[32] = fieldProps;
|
|
150
|
-
$[33] =
|
|
151
|
-
$[34] =
|
|
152
|
-
$[35] =
|
|
153
|
-
|
|
150
|
+
$[33] = fireBlurOnChange;
|
|
151
|
+
$[34] = isClearable;
|
|
152
|
+
$[35] = state;
|
|
153
|
+
$[36] = t22;
|
|
154
|
+
} else t22 = $[36];
|
|
154
155
|
let t23;
|
|
155
|
-
if ($[
|
|
156
|
+
if ($[37] !== disableDropdown || $[38] !== disableManualEntry || $[39] !== isDisabled || $[40] !== onPress || $[41] !== uiConfig) {
|
|
156
157
|
t23 = (!disableDropdown || disableManualEntry) && /* @__PURE__ */ jsx(InlineIconButton, {
|
|
157
158
|
label: "",
|
|
158
159
|
color: "secondary",
|
|
@@ -161,26 +162,26 @@ var TimePickerInput = (t0) => {
|
|
|
161
162
|
isDisabled,
|
|
162
163
|
className: "border-0!"
|
|
163
164
|
});
|
|
164
|
-
$[
|
|
165
|
-
$[
|
|
166
|
-
$[
|
|
167
|
-
$[
|
|
168
|
-
$[
|
|
169
|
-
$[
|
|
170
|
-
} else t23 = $[
|
|
165
|
+
$[37] = disableDropdown;
|
|
166
|
+
$[38] = disableManualEntry;
|
|
167
|
+
$[39] = isDisabled;
|
|
168
|
+
$[40] = onPress;
|
|
169
|
+
$[41] = uiConfig;
|
|
170
|
+
$[42] = t23;
|
|
171
|
+
} else t23 = $[42];
|
|
171
172
|
let t24;
|
|
172
|
-
if ($[
|
|
173
|
+
if ($[43] !== t21 || $[44] !== t22 || $[45] !== t23) {
|
|
173
174
|
t24 = /* @__PURE__ */ jsxs("div", {
|
|
174
175
|
className: t21,
|
|
175
176
|
children: [t22, t23]
|
|
176
177
|
});
|
|
177
|
-
$[
|
|
178
|
-
$[
|
|
179
|
-
$[
|
|
180
|
-
$[
|
|
181
|
-
} else t24 = $[
|
|
178
|
+
$[43] = t21;
|
|
179
|
+
$[44] = t22;
|
|
180
|
+
$[45] = t23;
|
|
181
|
+
$[46] = t24;
|
|
182
|
+
} else t24 = $[46];
|
|
182
183
|
let t25;
|
|
183
|
-
if ($[
|
|
184
|
+
if ($[47] !== fieldProps || $[48] !== focusWithinProps || $[49] !== hoverProps || $[50] !== ref || $[51] !== t10 || $[52] !== t11 || $[53] !== t12 || $[54] !== t13 || $[55] !== t14 || $[56] !== t15 || $[57] !== t20 || $[58] !== t24 || $[59] !== t4 || $[60] !== t5 || $[61] !== t6 || $[62] !== t7 || $[63] !== t8 || $[64] !== t9) {
|
|
184
185
|
t25 = /* @__PURE__ */ jsxs("div", {
|
|
185
186
|
ref,
|
|
186
187
|
className: t4,
|
|
@@ -202,26 +203,26 @@ var TimePickerInput = (t0) => {
|
|
|
202
203
|
...hoverProps,
|
|
203
204
|
children: [t20, t24]
|
|
204
205
|
});
|
|
205
|
-
$[
|
|
206
|
-
$[
|
|
207
|
-
$[
|
|
208
|
-
$[
|
|
209
|
-
$[
|
|
210
|
-
$[
|
|
211
|
-
$[
|
|
212
|
-
$[
|
|
213
|
-
$[
|
|
214
|
-
$[
|
|
215
|
-
$[
|
|
216
|
-
$[
|
|
217
|
-
$[
|
|
218
|
-
$[
|
|
219
|
-
$[
|
|
220
|
-
$[
|
|
221
|
-
$[
|
|
222
|
-
$[
|
|
223
|
-
$[
|
|
224
|
-
} else t25 = $[
|
|
206
|
+
$[47] = fieldProps;
|
|
207
|
+
$[48] = focusWithinProps;
|
|
208
|
+
$[49] = hoverProps;
|
|
209
|
+
$[50] = ref;
|
|
210
|
+
$[51] = t10;
|
|
211
|
+
$[52] = t11;
|
|
212
|
+
$[53] = t12;
|
|
213
|
+
$[54] = t13;
|
|
214
|
+
$[55] = t14;
|
|
215
|
+
$[56] = t15;
|
|
216
|
+
$[57] = t20;
|
|
217
|
+
$[58] = t24;
|
|
218
|
+
$[59] = t4;
|
|
219
|
+
$[60] = t5;
|
|
220
|
+
$[61] = t6;
|
|
221
|
+
$[62] = t7;
|
|
222
|
+
$[63] = t8;
|
|
223
|
+
$[64] = t9;
|
|
224
|
+
$[65] = t25;
|
|
225
|
+
} else t25 = $[65];
|
|
225
226
|
return t25;
|
|
226
227
|
};
|
|
227
228
|
function _temp(segment) {
|
|
@@ -4,12 +4,12 @@ import { FormFieldHeaderProps } from '../../FormField/FormFieldHeader';
|
|
|
4
4
|
import { SelectBaseProps } from './SelectBase';
|
|
5
5
|
import { SelectItem } from './select.types';
|
|
6
6
|
import { InputVariantProps } from '../../shared/input.cva';
|
|
7
|
-
interface SelectInputProps extends InputVariantProps, Pick<SelectBaseProps, "ref" | "placeholder" | "isDisabled" | "hideDropdownIcon" | "isSearchable" | "isClearable" | "onBlur" | "showSelectionContent" | "inputClassName" | "selectedTagsType" | "collapseAfter" | "isRequired" | "isDirty" | "
|
|
7
|
+
interface SelectInputProps extends InputVariantProps, Pick<SelectBaseProps, "ref" | "placeholder" | "isDisabled" | "hideDropdownIcon" | "isSearchable" | "isClearable" | "onBlur" | "showSelectionContent" | "inputClassName" | "selectedTagsType" | "collapseAfter" | "isRequired" | "isDirty" | "leadingContent" | "trailingContent" | "onMouseEnter" | "onFocusCapture"> {
|
|
8
8
|
isInvalid?: boolean;
|
|
9
9
|
className?: string;
|
|
10
10
|
fieldProps?: AriaFieldProps;
|
|
11
11
|
headerProps?: FormFieldHeaderProps;
|
|
12
12
|
onCloseComboBox?: (state: ComboBoxState<SelectItem> | null) => void;
|
|
13
13
|
}
|
|
14
|
-
export declare const SelectInput: ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur,
|
|
14
|
+
export declare const SelectInput: ({ 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 }: SelectInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
export {};
|
|
@@ -17,8 +17,8 @@ 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(
|
|
21
|
-
const { ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur,
|
|
20
|
+
const $0 = c(107);
|
|
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);
|
|
24
24
|
const inputClearClassCva = UIStyle.useCva("input.clearClassCva", inputClearClass);
|
|
@@ -78,34 +78,28 @@ var SelectInput = (t0) => {
|
|
|
78
78
|
}
|
|
79
79
|
const labelProps = t3;
|
|
80
80
|
let t4;
|
|
81
|
-
if ($0[10] !== fieldState.inputValue || $0[11] !== fieldState.value || $0[12] !==
|
|
81
|
+
if ($0[10] !== fieldState.inputValue || $0[11] !== fieldState.value || $0[12] !== isLoading || $0[13] !== isMultiple || $0[14] !== listItems || $0[15] !== onChange || $0[16] !== onCloseComboBox || $0[17] !== state) {
|
|
82
82
|
t4 = (e) => {
|
|
83
83
|
if (e.key === "Enter" && !isMultiple && !isLoading && listItems.length === 1 && !listItems[0].isDisabled) {
|
|
84
84
|
e.preventDefault();
|
|
85
85
|
onChange(listItems[0].id);
|
|
86
|
-
if (fireBlurOnChange) onBlur?.({});
|
|
87
86
|
onCloseComboBox?.(state);
|
|
88
87
|
}
|
|
89
|
-
if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0)
|
|
90
|
-
onChange(fieldState.value.slice(0, -1));
|
|
91
|
-
if (fireBlurOnChange) onBlur?.({});
|
|
92
|
-
}
|
|
88
|
+
if (e.key === "Backspace" && isMultiple && fieldState.inputValue === "" && Array.isArray(fieldState.value) && fieldState.value.length > 0) onChange(fieldState.value.slice(0, -1));
|
|
93
89
|
};
|
|
94
90
|
$0[10] = fieldState.inputValue;
|
|
95
91
|
$0[11] = fieldState.value;
|
|
96
|
-
$0[12] =
|
|
97
|
-
$0[13] =
|
|
98
|
-
$0[14] =
|
|
99
|
-
$0[15] =
|
|
100
|
-
$0[16] =
|
|
101
|
-
$0[17] =
|
|
102
|
-
$0[18] =
|
|
103
|
-
|
|
104
|
-
$0[20] = t4;
|
|
105
|
-
} else t4 = $0[20];
|
|
92
|
+
$0[12] = isLoading;
|
|
93
|
+
$0[13] = isMultiple;
|
|
94
|
+
$0[14] = listItems;
|
|
95
|
+
$0[15] = onChange;
|
|
96
|
+
$0[16] = onCloseComboBox;
|
|
97
|
+
$0[17] = state;
|
|
98
|
+
$0[18] = t4;
|
|
99
|
+
} else t4 = $0[18];
|
|
106
100
|
const onKeyDown = t4;
|
|
107
101
|
let t5;
|
|
108
|
-
if ($0[
|
|
102
|
+
if ($0[19] !== isDisabled || $0[20] !== isOpen || $0[21] !== isSearchable || $0[22] !== setIsOpen) {
|
|
109
103
|
t5 = () => {
|
|
110
104
|
if (isDisabled) return;
|
|
111
105
|
if (!isSearchable) {
|
|
@@ -114,12 +108,12 @@ var SelectInput = (t0) => {
|
|
|
114
108
|
}
|
|
115
109
|
inputRef.current?.focus();
|
|
116
110
|
};
|
|
117
|
-
$0[
|
|
118
|
-
$0[
|
|
119
|
-
$0[
|
|
120
|
-
$0[
|
|
121
|
-
$0[
|
|
122
|
-
} else t5 = $0[
|
|
111
|
+
$0[19] = isDisabled;
|
|
112
|
+
$0[20] = isOpen;
|
|
113
|
+
$0[21] = isSearchable;
|
|
114
|
+
$0[22] = setIsOpen;
|
|
115
|
+
$0[23] = t5;
|
|
116
|
+
} else t5 = $0[23];
|
|
123
117
|
const onClick = t5;
|
|
124
118
|
const t6 = inputBaseCva({
|
|
125
119
|
variant,
|
|
@@ -149,28 +143,28 @@ var SelectInput = (t0) => {
|
|
|
149
143
|
...props
|
|
150
144
|
}));
|
|
151
145
|
let t24;
|
|
152
|
-
if ($0[
|
|
146
|
+
if ($0[24] !== as || $0[25] !== headerProps || $0[26] !== labelProps) {
|
|
153
147
|
t24 = as && ["filter", "floating"].includes(as) && headerProps && /* @__PURE__ */ jsx(FormFieldLabel, {
|
|
154
148
|
as,
|
|
155
149
|
...headerProps,
|
|
156
150
|
labelProps
|
|
157
151
|
});
|
|
158
|
-
$0[
|
|
159
|
-
$0[
|
|
160
|
-
$0[
|
|
161
|
-
$0[
|
|
162
|
-
} else t24 = $0[
|
|
152
|
+
$0[24] = as;
|
|
153
|
+
$0[25] = headerProps;
|
|
154
|
+
$0[26] = labelProps;
|
|
155
|
+
$0[27] = t24;
|
|
156
|
+
} else t24 = $0[27];
|
|
163
157
|
let t25;
|
|
164
|
-
if ($0[
|
|
158
|
+
if ($0[28] !== leadingContent) {
|
|
165
159
|
t25 = leadingContent && /* @__PURE__ */ jsx("div", {
|
|
166
160
|
className: "ml-input-side-default flex shrink-0 items-center",
|
|
167
161
|
children: leadingContent
|
|
168
162
|
});
|
|
169
|
-
$0[
|
|
170
|
-
$0[
|
|
171
|
-
} else t25 = $0[
|
|
163
|
+
$0[28] = leadingContent;
|
|
164
|
+
$0[29] = t25;
|
|
165
|
+
} else t25 = $0[29];
|
|
172
166
|
let t26;
|
|
173
|
-
if ($0[
|
|
167
|
+
if ($0[30] !== as || $0[31] !== collapseAfter || $0[32] !== fieldProps || $0[33] !== inputClassName || $0[34] !== isDisabled || $0[35] !== isSearchable || $0[36] !== onBlur || $0[37] !== onKeyDown || $0[38] !== onRemove || $0[39] !== placeholder || $0[40] !== selectedItems || $0[41] !== selectedTagsType || $0[42] !== showTags) {
|
|
174
168
|
t26 = (showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
|
|
175
169
|
className: selectInputTagsContentWrapperCva({ isSearchable }),
|
|
176
170
|
children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
|
|
@@ -188,23 +182,23 @@ var SelectInput = (t0) => {
|
|
|
188
182
|
...fieldProps
|
|
189
183
|
})]
|
|
190
184
|
});
|
|
191
|
-
$0[
|
|
192
|
-
$0[
|
|
193
|
-
$0[
|
|
194
|
-
$0[
|
|
195
|
-
$0[
|
|
196
|
-
$0[
|
|
197
|
-
$0[
|
|
198
|
-
$0[
|
|
199
|
-
$0[
|
|
200
|
-
$0[
|
|
201
|
-
$0[
|
|
202
|
-
$0[
|
|
203
|
-
$0[
|
|
204
|
-
$0[
|
|
205
|
-
} else t26 = $0[
|
|
185
|
+
$0[30] = as;
|
|
186
|
+
$0[31] = collapseAfter;
|
|
187
|
+
$0[32] = fieldProps;
|
|
188
|
+
$0[33] = inputClassName;
|
|
189
|
+
$0[34] = isDisabled;
|
|
190
|
+
$0[35] = isSearchable;
|
|
191
|
+
$0[36] = onBlur;
|
|
192
|
+
$0[37] = onKeyDown;
|
|
193
|
+
$0[38] = onRemove;
|
|
194
|
+
$0[39] = placeholder;
|
|
195
|
+
$0[40] = selectedItems;
|
|
196
|
+
$0[41] = selectedTagsType;
|
|
197
|
+
$0[42] = showTags;
|
|
198
|
+
$0[43] = t26;
|
|
199
|
+
} else t26 = $0[43];
|
|
206
200
|
let t27;
|
|
207
|
-
if ($0[
|
|
201
|
+
if ($0[44] !== as || $0[45] !== fieldProps || $0[46] !== isDisabled || $0[47] !== isEmpty || $0[48] !== isMultiple || $0[49] !== isOpen || $0[50] !== isSearchable || $0[51] !== onBlur || $0[52] !== placeholder || $0[53] !== selectedItems[0] || $0[54] !== setIsOpen || $0[55] !== showSelectionContent || $0[56] !== showTags) {
|
|
208
202
|
t27 = !isSearchable && /* @__PURE__ */ jsxs(Button, {
|
|
209
203
|
isDisabled,
|
|
210
204
|
onPress: () => setIsOpen(!isOpen),
|
|
@@ -218,23 +212,23 @@ var SelectInput = (t0) => {
|
|
|
218
212
|
children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
|
|
219
213
|
})]
|
|
220
214
|
});
|
|
221
|
-
$0[
|
|
222
|
-
$0[
|
|
223
|
-
$0[
|
|
224
|
-
$0[
|
|
225
|
-
$0[
|
|
226
|
-
$0[
|
|
227
|
-
$0[
|
|
228
|
-
$0[
|
|
229
|
-
$0[
|
|
230
|
-
$0[
|
|
231
|
-
$0[
|
|
232
|
-
$0[
|
|
233
|
-
$0[
|
|
234
|
-
$0[
|
|
235
|
-
} else t27 = $0[
|
|
215
|
+
$0[44] = as;
|
|
216
|
+
$0[45] = fieldProps;
|
|
217
|
+
$0[46] = isDisabled;
|
|
218
|
+
$0[47] = isEmpty;
|
|
219
|
+
$0[48] = isMultiple;
|
|
220
|
+
$0[49] = isOpen;
|
|
221
|
+
$0[50] = isSearchable;
|
|
222
|
+
$0[51] = onBlur;
|
|
223
|
+
$0[52] = placeholder;
|
|
224
|
+
$0[53] = selectedItems[0];
|
|
225
|
+
$0[54] = setIsOpen;
|
|
226
|
+
$0[55] = showSelectionContent;
|
|
227
|
+
$0[56] = showTags;
|
|
228
|
+
$0[57] = t27;
|
|
229
|
+
} else t27 = $0[57];
|
|
236
230
|
let t28;
|
|
237
|
-
if ($0[
|
|
231
|
+
if ($0[58] !== onClick || $0[59] !== t23 || $0[60] !== t24 || $0[61] !== t25 || $0[62] !== t26 || $0[63] !== t27) {
|
|
238
232
|
t28 = /* @__PURE__ */ jsxs("div", {
|
|
239
233
|
className: t23,
|
|
240
234
|
onClick,
|
|
@@ -245,44 +239,41 @@ var SelectInput = (t0) => {
|
|
|
245
239
|
t27
|
|
246
240
|
]
|
|
247
241
|
});
|
|
248
|
-
$0[
|
|
249
|
-
$0[
|
|
250
|
-
$0[
|
|
251
|
-
$0[
|
|
252
|
-
$0[
|
|
253
|
-
$0[
|
|
254
|
-
$0[
|
|
255
|
-
} else t28 = $0[
|
|
242
|
+
$0[58] = onClick;
|
|
243
|
+
$0[59] = t23;
|
|
244
|
+
$0[60] = t24;
|
|
245
|
+
$0[61] = t25;
|
|
246
|
+
$0[62] = t26;
|
|
247
|
+
$0[63] = t27;
|
|
248
|
+
$0[64] = t28;
|
|
249
|
+
} else t28 = $0[64];
|
|
256
250
|
let t29;
|
|
257
|
-
if ($0[
|
|
251
|
+
if ($0[65] !== as || $0[66] !== inputClearClassCva || $0[67] !== isClearable || $0[68] !== onClear || $0[69] !== showClearButton) {
|
|
258
252
|
t29 = isClearable && /* @__PURE__ */ jsx(InputClear, {
|
|
259
253
|
onClear: () => {
|
|
260
254
|
onClear();
|
|
261
|
-
if (fireBlurOnChange) onBlur?.({});
|
|
262
255
|
},
|
|
263
256
|
className: inputClearClassCva({ as }),
|
|
264
257
|
show: showClearButton
|
|
265
258
|
});
|
|
266
|
-
$0[
|
|
267
|
-
$0[
|
|
268
|
-
$0[
|
|
269
|
-
$0[
|
|
270
|
-
$0[
|
|
271
|
-
$0[
|
|
272
|
-
|
|
273
|
-
$0[74] = t29;
|
|
274
|
-
} else t29 = $0[74];
|
|
259
|
+
$0[65] = as;
|
|
260
|
+
$0[66] = inputClearClassCva;
|
|
261
|
+
$0[67] = isClearable;
|
|
262
|
+
$0[68] = onClear;
|
|
263
|
+
$0[69] = showClearButton;
|
|
264
|
+
$0[70] = t29;
|
|
265
|
+
} else t29 = $0[70];
|
|
275
266
|
let t30;
|
|
276
|
-
if ($0[
|
|
267
|
+
if ($0[71] !== trailingContent) {
|
|
277
268
|
t30 = trailingContent && /* @__PURE__ */ jsx("div", {
|
|
278
269
|
className: "flex shrink-0 items-center",
|
|
279
270
|
children: trailingContent
|
|
280
271
|
});
|
|
281
|
-
$0[
|
|
282
|
-
$0[
|
|
283
|
-
} else t30 = $0[
|
|
272
|
+
$0[71] = trailingContent;
|
|
273
|
+
$0[72] = t30;
|
|
274
|
+
} else t30 = $0[72];
|
|
284
275
|
let t31;
|
|
285
|
-
if ($0[
|
|
276
|
+
if ($0[73] !== hideDropdownIcon || $0[74] !== inputSizeCva || $0[75] !== isDisabled || $0[76] !== isOpen || $0[77] !== isSearchable || $0[78] !== setIsOpen || $0[79] !== size || $0[80] !== t) {
|
|
286
277
|
t31 = !hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
|
|
287
278
|
excludeFromTabOrder: true,
|
|
288
279
|
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
@@ -296,18 +287,18 @@ var SelectInput = (t0) => {
|
|
|
296
287
|
"aria-hidden": "true"
|
|
297
288
|
})
|
|
298
289
|
});
|
|
299
|
-
$0[
|
|
300
|
-
$0[
|
|
301
|
-
$0[
|
|
302
|
-
$0[
|
|
303
|
-
$0[
|
|
304
|
-
$0[
|
|
305
|
-
$0[
|
|
306
|
-
$0[
|
|
307
|
-
$0[
|
|
308
|
-
} else t31 = $0[
|
|
290
|
+
$0[73] = hideDropdownIcon;
|
|
291
|
+
$0[74] = inputSizeCva;
|
|
292
|
+
$0[75] = isDisabled;
|
|
293
|
+
$0[76] = isOpen;
|
|
294
|
+
$0[77] = isSearchable;
|
|
295
|
+
$0[78] = setIsOpen;
|
|
296
|
+
$0[79] = size;
|
|
297
|
+
$0[80] = t;
|
|
298
|
+
$0[81] = t31;
|
|
299
|
+
} else t31 = $0[81];
|
|
309
300
|
let t32;
|
|
310
|
-
if ($0[
|
|
301
|
+
if ($0[82] !== focusWithinProps || $0[83] !== hoverProps || $0[84] !== onFocusCapture || $0[85] !== onMouseEnter || $0[86] !== ref || $0[87] !== t10 || $0[88] !== t11 || $0[89] !== t12 || $0[90] !== t13 || $0[91] !== t14 || $0[92] !== t15 || $0[93] !== t16 || $0[94] !== t17 || $0[95] !== t18 || $0[96] !== t19 || $0[97] !== t20 || $0[98] !== t21 || $0[99] !== t28 || $0[100] !== t29 || $0[101] !== t30 || $0[102] !== t31 || $0[103] !== t6 || $0[104] !== t8 || $0[105] !== t9) {
|
|
311
302
|
t32 = /* @__PURE__ */ jsxs("div", {
|
|
312
303
|
ref,
|
|
313
304
|
className: t6,
|
|
@@ -338,32 +329,32 @@ var SelectInput = (t0) => {
|
|
|
338
329
|
t31
|
|
339
330
|
]
|
|
340
331
|
});
|
|
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
|
-
$0[
|
|
358
|
-
$0[
|
|
359
|
-
$0[
|
|
360
|
-
$0[
|
|
361
|
-
$0[
|
|
362
|
-
$0[
|
|
363
|
-
$0[
|
|
364
|
-
$0[
|
|
365
|
-
$0[
|
|
366
|
-
} else t32 = $0[
|
|
332
|
+
$0[82] = focusWithinProps;
|
|
333
|
+
$0[83] = hoverProps;
|
|
334
|
+
$0[84] = onFocusCapture;
|
|
335
|
+
$0[85] = onMouseEnter;
|
|
336
|
+
$0[86] = ref;
|
|
337
|
+
$0[87] = t10;
|
|
338
|
+
$0[88] = t11;
|
|
339
|
+
$0[89] = t12;
|
|
340
|
+
$0[90] = t13;
|
|
341
|
+
$0[91] = t14;
|
|
342
|
+
$0[92] = t15;
|
|
343
|
+
$0[93] = t16;
|
|
344
|
+
$0[94] = t17;
|
|
345
|
+
$0[95] = t18;
|
|
346
|
+
$0[96] = t19;
|
|
347
|
+
$0[97] = t20;
|
|
348
|
+
$0[98] = t21;
|
|
349
|
+
$0[99] = t28;
|
|
350
|
+
$0[100] = t29;
|
|
351
|
+
$0[101] = t30;
|
|
352
|
+
$0[102] = t31;
|
|
353
|
+
$0[103] = t6;
|
|
354
|
+
$0[104] = t8;
|
|
355
|
+
$0[105] = t9;
|
|
356
|
+
$0[106] = t32;
|
|
357
|
+
} else t32 = $0[106];
|
|
367
358
|
return t32;
|
|
368
359
|
};
|
|
369
360
|
//#endregion
|
|
@@ -24,8 +24,8 @@ export declare namespace SelectContext {
|
|
|
24
24
|
selectedIds: Key[];
|
|
25
25
|
isMultiple: boolean;
|
|
26
26
|
} & Pick<SelectBaseProps, "onInputChange" | "isLoading" | "hasLoadMore">;
|
|
27
|
-
export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled" | "ignoreInputValueFiltering">;
|
|
28
|
-
export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
27
|
+
export type ProviderProps = GroupedSelectProps & Pick<SelectBaseProps, "items" | "onInputChange" | "onSearchChange" | "showSelectAllOption" | "showNewItemOption" | "newItemMinLength" | "onNewItemOption" | "isLoading" | "hasLoadMore" | "mapInitialToSelectItem" | "isSearchable" | "isClientSearchDisabled" | "ignoreInputValueFiltering" | "fireBlurOnChange" | "onBlur">;
|
|
28
|
+
export const Provider: ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, onBlur: fieldOnBlur, children, mapInitialToSelectItem, ...props }: PropsWithChildren<ProviderProps>) => import("react/jsx-runtime").JSX.Element;
|
|
29
29
|
export const useSelect: () => Type;
|
|
30
30
|
export {};
|
|
31
31
|
}
|
|
@@ -10,7 +10,7 @@ var SelectContext;
|
|
|
10
10
|
id: item.id,
|
|
11
11
|
label: item.label ?? item.name ?? ""
|
|
12
12
|
});
|
|
13
|
-
_SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
|
|
13
|
+
_SelectContext.Provider = ({ items, onInputChange, onSearchChange, showSelectAllOption, showNewItemOption, newItemMinLength, onNewItemOption, isLoading, hasLoadMore, isClientSearchDisabled, ignoreInputValueFiltering, fireBlurOnChange, onBlur: fieldOnBlur, children, mapInitialToSelectItem = defaultMapInitialToSelectItem, ...props }) => {
|
|
14
14
|
const isMultiple = props.selectionMode === "multiple";
|
|
15
15
|
const initialSelectedItems = useMemo(() => {
|
|
16
16
|
if (!props.initialSelection) return null;
|
|
@@ -58,13 +58,15 @@ var SelectContext;
|
|
|
58
58
|
}, [getItem_0]);
|
|
59
59
|
const getValueIds = () => Array.isArray(valueRef.current) ? valueRef.current.map(({ id: id_3 }) => id_3) : valueRef.current?.id ?? null;
|
|
60
60
|
const emitStateChanges = useCallback((changes, skipSelectionChange) => {
|
|
61
|
-
|
|
61
|
+
const valueChanged = JSON.stringify(changes.value) !== JSON.stringify(getValueIds());
|
|
62
|
+
if (valueChanged) {
|
|
62
63
|
updateValue(changes.value);
|
|
63
64
|
if (!skipSelectionChange) if (isMultiple) props.onChange?.(changes.value);
|
|
64
65
|
else props.onChange?.(changes.value);
|
|
65
66
|
}
|
|
66
67
|
if (changes.inputValue !== fieldState.inputValue) onInputChange?.(changes.inputValue);
|
|
67
68
|
if (changes.searchValue !== fieldState.searchValue) onSearchChangeDebounced?.(changes.searchValue);
|
|
69
|
+
return valueChanged;
|
|
68
70
|
}, [
|
|
69
71
|
fieldState,
|
|
70
72
|
isMultiple,
|
|
@@ -73,6 +75,9 @@ var SelectContext;
|
|
|
73
75
|
onSearchChangeDebounced,
|
|
74
76
|
updateValue
|
|
75
77
|
]);
|
|
78
|
+
const triggerBlurOnChange = useCallback(() => {
|
|
79
|
+
if (fireBlurOnChange) fieldOnBlur?.({});
|
|
80
|
+
}, [fireBlurOnChange, fieldOnBlur]);
|
|
76
81
|
const syncFieldState = (value_1) => {
|
|
77
82
|
const newFieldState = {
|
|
78
83
|
value: value_1,
|
|
@@ -115,7 +120,7 @@ var SelectContext;
|
|
|
115
120
|
searchValue: ""
|
|
116
121
|
};
|
|
117
122
|
setFieldState(newFieldState_1);
|
|
118
|
-
emitStateChanges(newFieldState_1);
|
|
123
|
+
if (emitStateChanges(newFieldState_1)) triggerBlurOnChange();
|
|
119
124
|
}
|
|
120
125
|
if (!isMultiple) {
|
|
121
126
|
setIsOpen(false);
|
|
@@ -126,7 +131,8 @@ var SelectContext;
|
|
|
126
131
|
onNewItemOption,
|
|
127
132
|
fieldState.inputValue,
|
|
128
133
|
getItem_0,
|
|
129
|
-
isMultiple
|
|
134
|
+
isMultiple,
|
|
135
|
+
triggerBlurOnChange
|
|
130
136
|
]);
|
|
131
137
|
const onClear = useCallback(() => {
|
|
132
138
|
if (!valueRef.current || Array.isArray(valueRef.current) && valueRef.current.length === 0) {
|
|
@@ -34,7 +34,7 @@ export declare namespace UIConfig {
|
|
|
34
34
|
};
|
|
35
35
|
toggle: Pick<ToggleProps, "variant">;
|
|
36
36
|
slider: Pick<SliderProps, "minValue" | "maxValue">;
|
|
37
|
-
dateInput: Pick<DatePickerProps, "todayIcon" | "todayIconButtonSize" | "todayIconPlacement" | "shouldForceLeadingZeros" | "disableManualEntry" | "shouldUpdateDateOnMonthYearChange" | "granularity" | "autoFixYear"> & {
|
|
37
|
+
dateInput: Pick<DatePickerProps, "todayIcon" | "todayIconButtonSize" | "todayIconPlacement" | "shouldForceLeadingZeros" | "disableManualEntry" | "shouldUpdateDateOnMonthYearChange" | "granularity" | "autoFixYear" | "fireBlurOnChange"> & {
|
|
38
38
|
calendarIcon?: ReactElement;
|
|
39
39
|
dateTimeIcon?: ReactElement;
|
|
40
40
|
timeIcon?: ReactElement;
|
|
@@ -57,6 +57,7 @@ var UIConfig;
|
|
|
57
57
|
shouldForceLeadingZeros: false,
|
|
58
58
|
disableManualEntry: false,
|
|
59
59
|
autoFixYear: false,
|
|
60
|
+
fireBlurOnChange: false,
|
|
60
61
|
calendarIcon: /* @__PURE__ */ jsx(CalendarIcon, { className: "size-5" }),
|
|
61
62
|
dateTimeIcon: /* @__PURE__ */ jsx(DateTimeIcon, { className: "size-5" }),
|
|
62
63
|
timeIcon: /* @__PURE__ */ jsx(ClockIcon, { className: "size-6 text-interactive-text-secondary-idle" }),
|