@povio/ui 2.3.0-rc.16 → 2.3.0-rc.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.
@@ -18,7 +18,7 @@ import { Controller, useWatch } 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(85);
21
+ const $ = c(87);
22
22
  const ui = UIConfig.useConfig();
23
23
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
24
24
  const inputRef = useRef(null);
@@ -167,6 +167,7 @@ var NumberInputBase = (props) => {
167
167
  $[42] = t9;
168
168
  } else t9 = $[42];
169
169
  const headerProps = t9;
170
+ const dataIsDisabled = isDisabled || void 0;
170
171
  const T0 = TooltipWrapper;
171
172
  const t10 = as === "inline" ? -1 : void 0;
172
173
  const T1 = FormField;
@@ -211,7 +212,7 @@ var NumberInputBase = (props) => {
211
212
  $[50] = t23;
212
213
  } else t23 = $[50];
213
214
  let t24;
214
- if ($[51] !== inputProps || $[52] !== t17 || $[53] !== t18 || $[54] !== t19 || $[55] !== t20 || $[56] !== t21 || $[57] !== t22 || $[58] !== t23) {
215
+ if ($[51] !== dataIsDisabled || $[52] !== inputProps || $[53] !== t17 || $[54] !== t18 || $[55] !== t19 || $[56] !== t20 || $[57] !== t21 || $[58] !== t22 || $[59] !== t23) {
215
216
  t24 = /* @__PURE__ */ jsx(Input, {
216
217
  ...inputProps,
217
218
  ref: t17,
@@ -219,22 +220,24 @@ var NumberInputBase = (props) => {
219
220
  "data-is-required": t19,
220
221
  "data-is-empty": t20,
221
222
  "data-is-filled": t21,
223
+ "data-is-disabled": dataIsDisabled,
222
224
  placeholder: t22,
223
225
  className: "w-full bg-transparent outline-none",
224
226
  onFocus: t23
225
227
  });
226
- $[51] = inputProps;
227
- $[52] = t17;
228
- $[53] = t18;
229
- $[54] = t19;
230
- $[55] = t20;
231
- $[56] = t21;
232
- $[57] = t22;
233
- $[58] = t23;
234
- $[59] = t24;
235
- } else t24 = $[59];
228
+ $[51] = dataIsDisabled;
229
+ $[52] = inputProps;
230
+ $[53] = t17;
231
+ $[54] = t18;
232
+ $[55] = t19;
233
+ $[56] = t20;
234
+ $[57] = t21;
235
+ $[58] = t22;
236
+ $[59] = t23;
237
+ $[60] = t24;
238
+ } else t24 = $[60];
236
239
  let t25;
237
- if ($[60] !== as || $[61] !== headerProps || $[62] !== inputContentProps || $[63] !== size || $[64] !== t24) {
240
+ if ($[61] !== as || $[62] !== headerProps || $[63] !== inputContentProps || $[64] !== size || $[65] !== t24) {
238
241
  t25 = /* @__PURE__ */ jsx(InputContent, {
239
242
  ...inputContentProps,
240
243
  headerProps,
@@ -242,30 +245,32 @@ var NumberInputBase = (props) => {
242
245
  size,
243
246
  children: t24
244
247
  });
245
- $[60] = as;
246
- $[61] = headerProps;
247
- $[62] = inputContentProps;
248
- $[63] = size;
249
- $[64] = t24;
250
- $[65] = t25;
251
- } else t25 = $[65];
248
+ $[61] = as;
249
+ $[62] = headerProps;
250
+ $[63] = inputContentProps;
251
+ $[64] = size;
252
+ $[65] = t24;
253
+ $[66] = t25;
254
+ } else t25 = $[66];
252
255
  let t26;
253
- if ($[66] !== t13 || $[67] !== t15 || $[68] !== t16 || $[69] !== t25) {
256
+ if ($[67] !== dataIsDisabled || $[68] !== t13 || $[69] !== t15 || $[70] !== t16 || $[71] !== t25) {
254
257
  t26 = /* @__PURE__ */ jsx("div", {
255
258
  className: t13,
256
259
  onClick: t14,
257
260
  "data-is-empty": t15,
258
261
  "data-is-required": t16,
262
+ "data-is-disabled": dataIsDisabled,
259
263
  children: t25
260
264
  });
261
- $[66] = t13;
262
- $[67] = t15;
263
- $[68] = t16;
264
- $[69] = t25;
265
- $[70] = t26;
266
- } else t26 = $[70];
265
+ $[67] = dataIsDisabled;
266
+ $[68] = t13;
267
+ $[69] = t15;
268
+ $[70] = t16;
269
+ $[71] = t25;
270
+ $[72] = t26;
271
+ } else t26 = $[72];
267
272
  let t27;
268
- if ($[71] !== T1 || $[72] !== as || $[73] !== formFieldProps || $[74] !== labelProps || $[75] !== t11 || $[76] !== t12 || $[77] !== t26) {
273
+ if ($[73] !== T1 || $[74] !== as || $[75] !== formFieldProps || $[76] !== labelProps || $[77] !== t11 || $[78] !== t12 || $[79] !== t26) {
269
274
  t27 = /* @__PURE__ */ jsx(T1, {
270
275
  ...formFieldProps,
271
276
  as,
@@ -274,30 +279,30 @@ var NumberInputBase = (props) => {
274
279
  tabIndex: t12,
275
280
  children: t26
276
281
  });
277
- $[71] = T1;
278
- $[72] = as;
279
- $[73] = formFieldProps;
280
- $[74] = labelProps;
281
- $[75] = t11;
282
- $[76] = t12;
283
- $[77] = t26;
284
- $[78] = t27;
285
- } else t27 = $[78];
282
+ $[73] = T1;
283
+ $[74] = as;
284
+ $[75] = formFieldProps;
285
+ $[76] = labelProps;
286
+ $[77] = t11;
287
+ $[78] = t12;
288
+ $[79] = t26;
289
+ $[80] = t27;
290
+ } else t27 = $[80];
286
291
  let t28;
287
- if ($[79] !== T0 || $[80] !== as || $[81] !== error || $[82] !== t10 || $[83] !== t27) {
292
+ if ($[81] !== T0 || $[82] !== as || $[83] !== error || $[84] !== t10 || $[85] !== t27) {
288
293
  t28 = /* @__PURE__ */ jsx(T0, {
289
294
  as,
290
295
  error,
291
296
  triggerTabIndex: t10,
292
297
  children: t27
293
298
  });
294
- $[79] = T0;
295
- $[80] = as;
296
- $[81] = error;
297
- $[82] = t10;
298
- $[83] = t27;
299
- $[84] = t28;
300
- } else t28 = $[84];
299
+ $[81] = T0;
300
+ $[82] = as;
301
+ $[83] = error;
302
+ $[84] = t10;
303
+ $[85] = t27;
304
+ $[86] = t28;
305
+ } else t28 = $[86];
301
306
  return t28;
302
307
  };
303
308
  var NumberInput = ({ renderStaticInput, ...props }) => {
@@ -16,7 +16,7 @@ import { mergeRefs } from "@react-aria/utils";
16
16
  import { Controller, useWatch } from "react-hook-form";
17
17
  //#region src/components/inputs/Input/TextInput/TextInput.tsx
18
18
  var TextInputBase = (props) => {
19
- const $ = c(83);
19
+ const $ = c(84);
20
20
  const ui = UIConfig.useConfig();
21
21
  const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
22
22
  const inputRef = useRef(null);
@@ -139,6 +139,7 @@ var TextInputBase = (props) => {
139
139
  $[36] = t6;
140
140
  } else t6 = $[36];
141
141
  const headerProps = t6;
142
+ const dataIsDisabled = isDisabled || void 0;
142
143
  const T0 = TooltipWrapper;
143
144
  const t7 = as === "inline" ? -1 : void 0;
144
145
  const T1 = FormField;
@@ -175,77 +176,78 @@ var TextInputBase = (props) => {
175
176
  const t19 = !(value === "" || value === null || value === void 0) || void 0;
176
177
  const t20 = isDirty || void 0;
177
178
  const t21 = isRequired || void 0;
178
- const t22 = isDisabled || void 0;
179
- const t23 = as === "floating" ? "\xA0" : inputProps.placeholder;
180
- let t24;
179
+ const t22 = as === "floating" ? "\xA0" : inputProps.placeholder;
180
+ let t23;
181
181
  if ($[43] !== inputProps || $[44] !== isFocusVisible) {
182
- t24 = (e) => {
182
+ t23 = (e) => {
183
183
  inputProps.onFocus?.(e);
184
184
  if (isFocusVisible) e.target.select();
185
185
  };
186
186
  $[43] = inputProps;
187
187
  $[44] = isFocusVisible;
188
- $[45] = t24;
189
- } else t24 = $[45];
190
- let t25;
191
- if ($[46] !== inputProps || $[47] !== t17 || $[48] !== t18 || $[49] !== t19 || $[50] !== t20 || $[51] !== t21 || $[52] !== t22 || $[53] !== t23 || $[54] !== t24) {
192
- t25 = /* @__PURE__ */ jsx(Input, {
188
+ $[45] = t23;
189
+ } else t23 = $[45];
190
+ let t24;
191
+ if ($[46] !== dataIsDisabled || $[47] !== inputProps || $[48] !== t17 || $[49] !== t18 || $[50] !== t19 || $[51] !== t20 || $[52] !== t21 || $[53] !== t22 || $[54] !== t23) {
192
+ t24 = /* @__PURE__ */ jsx(Input, {
193
193
  ...inputProps,
194
194
  ref: t17,
195
195
  "data-is-empty": t18,
196
196
  "data-is-filled": t19,
197
197
  "data-is-dirty": t20,
198
198
  "data-is-required": t21,
199
- "data-is-disabled": t22,
200
- placeholder: t23,
199
+ "data-is-disabled": dataIsDisabled,
200
+ placeholder: t22,
201
201
  className: "w-full bg-transparent outline-none",
202
- onFocus: t24
202
+ onFocus: t23
203
203
  });
204
- $[46] = inputProps;
205
- $[47] = t17;
206
- $[48] = t18;
207
- $[49] = t19;
208
- $[50] = t20;
209
- $[51] = t21;
210
- $[52] = t22;
211
- $[53] = t23;
212
- $[54] = t24;
213
- $[55] = t25;
214
- } else t25 = $[55];
215
- let t26;
216
- if ($[56] !== as || $[57] !== headerProps || $[58] !== inputContentProps || $[59] !== size || $[60] !== t25) {
217
- t26 = /* @__PURE__ */ jsx(InputContent, {
204
+ $[46] = dataIsDisabled;
205
+ $[47] = inputProps;
206
+ $[48] = t17;
207
+ $[49] = t18;
208
+ $[50] = t19;
209
+ $[51] = t20;
210
+ $[52] = t21;
211
+ $[53] = t22;
212
+ $[54] = t23;
213
+ $[55] = t24;
214
+ } else t24 = $[55];
215
+ let t25;
216
+ if ($[56] !== as || $[57] !== headerProps || $[58] !== inputContentProps || $[59] !== size || $[60] !== t24) {
217
+ t25 = /* @__PURE__ */ jsx(InputContent, {
218
218
  ...inputContentProps,
219
219
  headerProps,
220
220
  as,
221
221
  size,
222
- children: t25
222
+ children: t24
223
223
  });
224
224
  $[56] = as;
225
225
  $[57] = headerProps;
226
226
  $[58] = inputContentProps;
227
227
  $[59] = size;
228
- $[60] = t25;
229
- $[61] = t26;
230
- } else t26 = $[61];
231
- let t27;
232
- if ($[62] !== t13 || $[63] !== t15 || $[64] !== t16 || $[65] !== t26) {
233
- t27 = /* @__PURE__ */ jsx("div", {
228
+ $[60] = t24;
229
+ $[61] = t25;
230
+ } else t25 = $[61];
231
+ let t26;
232
+ if ($[62] !== dataIsDisabled || $[63] !== t13 || $[64] !== t15 || $[65] !== t16 || $[66] !== t25) {
233
+ t26 = /* @__PURE__ */ jsx("div", {
234
234
  className: t13,
235
235
  onClick: t14,
236
236
  "data-is-empty": t15,
237
237
  "data-is-required": t16,
238
- children: t26
238
+ "data-is-disabled": dataIsDisabled,
239
+ children: t25
239
240
  });
240
- $[62] = t13;
241
- $[63] = t15;
242
- $[64] = t16;
243
- $[65] = t26;
244
- $[66] = t27;
245
- } else t27 = $[66];
246
- let t28;
247
- if ($[67] !== T1 || $[68] !== as || $[69] !== formFieldProps || $[70] !== labelProps || $[71] !== t10 || $[72] !== t11 || $[73] !== t12 || $[74] !== t27 || $[75] !== t9) {
248
- t28 = /* @__PURE__ */ jsx(T1, {
241
+ $[62] = dataIsDisabled;
242
+ $[63] = t13;
243
+ $[64] = t15;
244
+ $[65] = t16;
245
+ $[66] = t25;
246
+ $[67] = t26;
247
+ } else t26 = $[67];
248
+ let t27;
249
+ if ($[68] !== T1 || $[69] !== as || $[70] !== formFieldProps || $[71] !== labelProps || $[72] !== t10 || $[73] !== t11 || $[74] !== t12 || $[75] !== t26 || $[76] !== t9) {
250
+ t27 = /* @__PURE__ */ jsx(T1, {
249
251
  ...formFieldProps,
250
252
  as,
251
253
  labelProps,
@@ -253,35 +255,35 @@ var TextInputBase = (props) => {
253
255
  tabIndex: t10,
254
256
  "data-is-empty": t11,
255
257
  "data-is-required": t12,
256
- children: t27
258
+ children: t26
257
259
  });
258
- $[67] = T1;
259
- $[68] = as;
260
- $[69] = formFieldProps;
261
- $[70] = labelProps;
262
- $[71] = t10;
263
- $[72] = t11;
264
- $[73] = t12;
265
- $[74] = t27;
266
- $[75] = t9;
267
- $[76] = t28;
268
- } else t28 = $[76];
269
- let t29;
270
- if ($[77] !== T0 || $[78] !== as || $[79] !== error || $[80] !== t28 || $[81] !== t7) {
271
- t29 = /* @__PURE__ */ jsx(T0, {
260
+ $[68] = T1;
261
+ $[69] = as;
262
+ $[70] = formFieldProps;
263
+ $[71] = labelProps;
264
+ $[72] = t10;
265
+ $[73] = t11;
266
+ $[74] = t12;
267
+ $[75] = t26;
268
+ $[76] = t9;
269
+ $[77] = t27;
270
+ } else t27 = $[77];
271
+ let t28;
272
+ if ($[78] !== T0 || $[79] !== as || $[80] !== error || $[81] !== t27 || $[82] !== t7) {
273
+ t28 = /* @__PURE__ */ jsx(T0, {
272
274
  as,
273
275
  error,
274
276
  triggerTabIndex: t7,
275
- children: t28
277
+ children: t27
276
278
  });
277
- $[77] = T0;
278
- $[78] = as;
279
- $[79] = error;
280
- $[80] = t28;
281
- $[81] = t7;
282
- $[82] = t29;
283
- } else t29 = $[82];
284
- return t29;
279
+ $[78] = T0;
280
+ $[79] = as;
281
+ $[80] = error;
282
+ $[81] = t27;
283
+ $[82] = t7;
284
+ $[83] = t28;
285
+ } else t28 = $[83];
286
+ return t28;
285
287
  };
286
288
  var TextInput = ({ renderStaticInput, ...props }) => {
287
289
  const ui = UIConfig.useConfig();
@@ -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" | "fireBlurOnChange" | "leadingContent" | "trailingContent" | "onMouseEnter" | "onFocusCapture"> {
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, fireBlurOnChange, leadingContent, trailingContent, onMouseEnter, onFocusCapture, ...props }: SelectInputProps) => import("react/jsx-runtime").JSX.Element;
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(111);
21
- const { ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, isRequired, isDirty, onCloseComboBox, onBlur, fireBlurOnChange, leadingContent, trailingContent, onMouseEnter, onFocusCapture, ...props } = t0;
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] !== fireBlurOnChange || $0[13] !== isLoading || $0[14] !== isMultiple || $0[15] !== listItems || $0[16] !== onBlur || $0[17] !== onChange || $0[18] !== onCloseComboBox || $0[19] !== state) {
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] = fireBlurOnChange;
97
- $0[13] = isLoading;
98
- $0[14] = isMultiple;
99
- $0[15] = listItems;
100
- $0[16] = onBlur;
101
- $0[17] = onChange;
102
- $0[18] = onCloseComboBox;
103
- $0[19] = state;
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[21] !== isDisabled || $0[22] !== isOpen || $0[23] !== isSearchable || $0[24] !== setIsOpen) {
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[21] = isDisabled;
118
- $0[22] = isOpen;
119
- $0[23] = isSearchable;
120
- $0[24] = setIsOpen;
121
- $0[25] = t5;
122
- } else t5 = $0[25];
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[26] !== as || $0[27] !== headerProps || $0[28] !== labelProps) {
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[26] = as;
159
- $0[27] = headerProps;
160
- $0[28] = labelProps;
161
- $0[29] = t24;
162
- } else t24 = $0[29];
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[30] !== leadingContent) {
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[30] = leadingContent;
170
- $0[31] = t25;
171
- } else t25 = $0[31];
163
+ $0[28] = leadingContent;
164
+ $0[29] = t25;
165
+ } else t25 = $0[29];
172
166
  let t26;
173
- if ($0[32] !== as || $0[33] !== collapseAfter || $0[34] !== fieldProps || $0[35] !== inputClassName || $0[36] !== isDisabled || $0[37] !== isSearchable || $0[38] !== onBlur || $0[39] !== onKeyDown || $0[40] !== onRemove || $0[41] !== placeholder || $0[42] !== selectedItems || $0[43] !== selectedTagsType || $0[44] !== showTags) {
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[32] = as;
192
- $0[33] = collapseAfter;
193
- $0[34] = fieldProps;
194
- $0[35] = inputClassName;
195
- $0[36] = isDisabled;
196
- $0[37] = isSearchable;
197
- $0[38] = onBlur;
198
- $0[39] = onKeyDown;
199
- $0[40] = onRemove;
200
- $0[41] = placeholder;
201
- $0[42] = selectedItems;
202
- $0[43] = selectedTagsType;
203
- $0[44] = showTags;
204
- $0[45] = t26;
205
- } else t26 = $0[45];
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[46] !== as || $0[47] !== fieldProps || $0[48] !== isDisabled || $0[49] !== isEmpty || $0[50] !== isMultiple || $0[51] !== isOpen || $0[52] !== isSearchable || $0[53] !== onBlur || $0[54] !== placeholder || $0[55] !== selectedItems[0] || $0[56] !== setIsOpen || $0[57] !== showSelectionContent || $0[58] !== showTags) {
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[46] = as;
222
- $0[47] = fieldProps;
223
- $0[48] = isDisabled;
224
- $0[49] = isEmpty;
225
- $0[50] = isMultiple;
226
- $0[51] = isOpen;
227
- $0[52] = isSearchable;
228
- $0[53] = onBlur;
229
- $0[54] = placeholder;
230
- $0[55] = selectedItems[0];
231
- $0[56] = setIsOpen;
232
- $0[57] = showSelectionContent;
233
- $0[58] = showTags;
234
- $0[59] = t27;
235
- } else t27 = $0[59];
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[60] !== onClick || $0[61] !== t23 || $0[62] !== t24 || $0[63] !== t25 || $0[64] !== t26 || $0[65] !== t27) {
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[60] = onClick;
249
- $0[61] = t23;
250
- $0[62] = t24;
251
- $0[63] = t25;
252
- $0[64] = t26;
253
- $0[65] = t27;
254
- $0[66] = t28;
255
- } else t28 = $0[66];
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[67] !== as || $0[68] !== fireBlurOnChange || $0[69] !== inputClearClassCva || $0[70] !== isClearable || $0[71] !== onBlur || $0[72] !== onClear || $0[73] !== showClearButton) {
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[67] = as;
267
- $0[68] = fireBlurOnChange;
268
- $0[69] = inputClearClassCva;
269
- $0[70] = isClearable;
270
- $0[71] = onBlur;
271
- $0[72] = onClear;
272
- $0[73] = showClearButton;
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[75] !== trailingContent) {
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[75] = trailingContent;
282
- $0[76] = t30;
283
- } else t30 = $0[76];
272
+ $0[71] = trailingContent;
273
+ $0[72] = t30;
274
+ } else t30 = $0[72];
284
275
  let t31;
285
- if ($0[77] !== hideDropdownIcon || $0[78] !== inputSizeCva || $0[79] !== isDisabled || $0[80] !== isOpen || $0[81] !== isSearchable || $0[82] !== setIsOpen || $0[83] !== size || $0[84] !== t) {
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[77] = hideDropdownIcon;
300
- $0[78] = inputSizeCva;
301
- $0[79] = isDisabled;
302
- $0[80] = isOpen;
303
- $0[81] = isSearchable;
304
- $0[82] = setIsOpen;
305
- $0[83] = size;
306
- $0[84] = t;
307
- $0[85] = t31;
308
- } else t31 = $0[85];
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[86] !== focusWithinProps || $0[87] !== hoverProps || $0[88] !== onFocusCapture || $0[89] !== onMouseEnter || $0[90] !== ref || $0[91] !== t10 || $0[92] !== t11 || $0[93] !== t12 || $0[94] !== t13 || $0[95] !== t14 || $0[96] !== t15 || $0[97] !== t16 || $0[98] !== t17 || $0[99] !== t18 || $0[100] !== t19 || $0[101] !== t20 || $0[102] !== t21 || $0[103] !== t28 || $0[104] !== t29 || $0[105] !== t30 || $0[106] !== t31 || $0[107] !== t6 || $0[108] !== t8 || $0[109] !== t9) {
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[86] = focusWithinProps;
342
- $0[87] = hoverProps;
343
- $0[88] = onFocusCapture;
344
- $0[89] = onMouseEnter;
345
- $0[90] = ref;
346
- $0[91] = t10;
347
- $0[92] = t11;
348
- $0[93] = t12;
349
- $0[94] = t13;
350
- $0[95] = t14;
351
- $0[96] = t15;
352
- $0[97] = t16;
353
- $0[98] = t17;
354
- $0[99] = t18;
355
- $0[100] = t19;
356
- $0[101] = t20;
357
- $0[102] = t21;
358
- $0[103] = t28;
359
- $0[104] = t29;
360
- $0[105] = t30;
361
- $0[106] = t31;
362
- $0[107] = t6;
363
- $0[108] = t8;
364
- $0[109] = t9;
365
- $0[110] = t32;
366
- } else t32 = $0[110];
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
- if (JSON.stringify(changes.value) !== JSON.stringify(getValueIds())) {
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) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@povio/ui",
3
- "version": "2.3.0-rc.16",
3
+ "version": "2.3.0-rc.18",
4
4
  "type": "module",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",