@povio/ui 3.0.0-rc.1 → 3.0.0-rc.3
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.js +4 -2
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +12 -2
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +1 -0
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +12 -5
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +188 -205
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +0 -11
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +3 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +2 -2
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +0 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +3 -2
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +4 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +0 -4
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +3 -2
- package/dist/components/inputs/Input/TextArea/TextArea.js +2 -2
- package/dist/components/inputs/Input/shared/InputContent.js +2 -2
- package/dist/components/inputs/Inputs/InputItem.d.ts +1 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +6 -6
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +0 -44
- package/dist/components/inputs/RadioGroup/radio.cva.js +3 -3
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +14 -11
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +13 -10
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +1 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +50 -45
- package/dist/components/inputs/Selection/Select/Select.js +3 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +5 -5
- package/dist/components/inputs/Selection/shared/SelectInput.js +89 -87
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +2 -2
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +5 -3
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +18 -11
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +0 -4
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +3 -2
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -5
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +6 -3
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +25 -8
- package/dist/components/inputs/Skeleton/InputFrame.js +6 -6
- package/dist/components/inputs/shared/TooltipWrapper.js +2 -2
- package/dist/components/inputs/shared/input.cva.d.ts +0 -54
- package/dist/components/inputs/shared/input.cva.js +3 -5
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +0 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +3 -2
- package/dist/components/text/Typography/typography.cva.d.ts +0 -45
- package/dist/components/text/Typography/typography.cva.js +1 -2
- package/dist/config/uiConfig.context.d.ts +1 -1
- package/dist/config/uiOverrides.context.d.ts +1 -0
- package/dist/hooks/useQueryAutocomplete.d.ts +1 -1
- package/dist/hooks/useQueryAutocomplete.js +17 -2
- package/dist/index.d.ts +8 -2
- package/dist/index.js +9 -3
- package/package.json +1 -1
|
@@ -4,10 +4,10 @@ import { Typography } from "../../../text/Typography/Typography.js";
|
|
|
4
4
|
import "../../../../config/i18n.js";
|
|
5
5
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
6
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
7
|
-
import { inputBaseDefinition,
|
|
7
|
+
import { inputBaseDefinition, inputClearClassDefinition, inputSizeDefinition } from "../../shared/input.cva.js";
|
|
8
8
|
import { SelectInputTags } from "./SelectInputTags.js";
|
|
9
9
|
import { SelectContext } from "./select.context.js";
|
|
10
|
-
import {
|
|
10
|
+
import { selectInputTagsContentWrapperDefinition } from "./selectInput.cva.js";
|
|
11
11
|
import { useKeyInteractions } from "../../../../hooks/useKeyInteractions.js";
|
|
12
12
|
import { c } from "react/compiler-runtime";
|
|
13
13
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -18,11 +18,12 @@ import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
|
18
18
|
import { useTranslation } from "react-i18next";
|
|
19
19
|
//#region src/components/inputs/Selection/shared/SelectInput.tsx
|
|
20
20
|
var SelectInput = (t0) => {
|
|
21
|
-
const $0 = c(
|
|
21
|
+
const $0 = c(124);
|
|
22
22
|
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;
|
|
23
23
|
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
24
24
|
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
25
|
-
const inputClearClassCva = UIOverrides.useCva("input.clearClassCva",
|
|
25
|
+
const inputClearClassCva = UIOverrides.useCva("input.clearClassCva", inputClearClassDefinition);
|
|
26
|
+
const selectInputTagsContentWrapperCva = UIOverrides.useCva("select.tagsContentWrapperCva", selectInputTagsContentWrapperDefinition);
|
|
26
27
|
const { t } = useTranslation("ui");
|
|
27
28
|
const state = use(ComboBoxStateContext);
|
|
28
29
|
let t1;
|
|
@@ -227,7 +228,7 @@ var SelectInput = (t0) => {
|
|
|
227
228
|
$0[43] = t35;
|
|
228
229
|
} else t35 = $0[43];
|
|
229
230
|
let t36;
|
|
230
|
-
if ($0[44] !== as || $0[45] !== collapseAfter || $0[46] !== fieldProps || $0[47] !== inputClassName || $0[48] !== isDisabled || $0[49] !== isSearchable || $0[50] !== onBlur || $0[51] !== onKeyDown || $0[52] !== onRemove || $0[53] !== placeholder || $0[54] !==
|
|
231
|
+
if ($0[44] !== as || $0[45] !== collapseAfter || $0[46] !== fieldProps || $0[47] !== inputClassName || $0[48] !== isDisabled || $0[49] !== isSearchable || $0[50] !== onBlur || $0[51] !== onKeyDown || $0[52] !== onRemove || $0[53] !== placeholder || $0[54] !== selectInputTagsContentWrapperCva || $0[55] !== selectedItems || $0[56] !== selectedTagsType || $0[57] !== showTags) {
|
|
231
232
|
t36 = (showTags || isSearchable) && /* @__PURE__ */ jsxs("div", {
|
|
232
233
|
className: selectInputTagsContentWrapperCva({ isSearchable }),
|
|
233
234
|
children: [showTags && /* @__PURE__ */ jsx(SelectInputTags, {
|
|
@@ -255,13 +256,14 @@ var SelectInput = (t0) => {
|
|
|
255
256
|
$0[51] = onKeyDown;
|
|
256
257
|
$0[52] = onRemove;
|
|
257
258
|
$0[53] = placeholder;
|
|
258
|
-
$0[54] =
|
|
259
|
-
$0[55] =
|
|
260
|
-
$0[56] =
|
|
261
|
-
$0[57] =
|
|
262
|
-
|
|
259
|
+
$0[54] = selectInputTagsContentWrapperCva;
|
|
260
|
+
$0[55] = selectedItems;
|
|
261
|
+
$0[56] = selectedTagsType;
|
|
262
|
+
$0[57] = showTags;
|
|
263
|
+
$0[58] = t36;
|
|
264
|
+
} else t36 = $0[58];
|
|
263
265
|
let t37;
|
|
264
|
-
if ($0[
|
|
266
|
+
if ($0[59] !== as || $0[60] !== fieldProps || $0[61] !== isDisabled || $0[62] !== isEmpty || $0[63] !== isMultiple || $0[64] !== isOpen || $0[65] !== isSearchable || $0[66] !== onBlur || $0[67] !== onTriggerKeyDown || $0[68] !== placeholder || $0[69] !== selectedItems[0] || $0[70] !== setIsOpen || $0[71] !== showSelectionContent || $0[72] !== showTags) {
|
|
265
267
|
t37 = !isSearchable && /* @__PURE__ */ jsxs(Button, {
|
|
266
268
|
isDisabled,
|
|
267
269
|
onPress: () => setIsOpen(!isOpen),
|
|
@@ -276,24 +278,24 @@ var SelectInput = (t0) => {
|
|
|
276
278
|
children: [isEmpty && placeholder, !isEmpty && (showSelectionContent ? selectedItems[0].content : selectedItems[0].label)]
|
|
277
279
|
})]
|
|
278
280
|
});
|
|
279
|
-
$0[
|
|
280
|
-
$0[
|
|
281
|
-
$0[
|
|
282
|
-
$0[
|
|
283
|
-
$0[
|
|
284
|
-
$0[
|
|
285
|
-
$0[
|
|
286
|
-
$0[
|
|
287
|
-
$0[
|
|
288
|
-
$0[
|
|
289
|
-
$0[
|
|
290
|
-
$0[
|
|
291
|
-
$0[
|
|
292
|
-
$0[
|
|
293
|
-
$0[
|
|
294
|
-
} else t37 = $0[
|
|
281
|
+
$0[59] = as;
|
|
282
|
+
$0[60] = fieldProps;
|
|
283
|
+
$0[61] = isDisabled;
|
|
284
|
+
$0[62] = isEmpty;
|
|
285
|
+
$0[63] = isMultiple;
|
|
286
|
+
$0[64] = isOpen;
|
|
287
|
+
$0[65] = isSearchable;
|
|
288
|
+
$0[66] = onBlur;
|
|
289
|
+
$0[67] = onTriggerKeyDown;
|
|
290
|
+
$0[68] = placeholder;
|
|
291
|
+
$0[69] = selectedItems[0];
|
|
292
|
+
$0[70] = setIsOpen;
|
|
293
|
+
$0[71] = showSelectionContent;
|
|
294
|
+
$0[72] = showTags;
|
|
295
|
+
$0[73] = t37;
|
|
296
|
+
} else t37 = $0[73];
|
|
295
297
|
let t38;
|
|
296
|
-
if ($0[
|
|
298
|
+
if ($0[74] !== onClick || $0[75] !== t33 || $0[76] !== t34 || $0[77] !== t35 || $0[78] !== t36 || $0[79] !== t37) {
|
|
297
299
|
t38 = /* @__PURE__ */ jsxs("div", {
|
|
298
300
|
className: t33,
|
|
299
301
|
onClick,
|
|
@@ -304,16 +306,16 @@ var SelectInput = (t0) => {
|
|
|
304
306
|
t37
|
|
305
307
|
]
|
|
306
308
|
});
|
|
307
|
-
$0[
|
|
308
|
-
$0[
|
|
309
|
-
$0[
|
|
310
|
-
$0[
|
|
311
|
-
$0[
|
|
312
|
-
$0[
|
|
313
|
-
$0[
|
|
314
|
-
} else t38 = $0[
|
|
309
|
+
$0[74] = onClick;
|
|
310
|
+
$0[75] = t33;
|
|
311
|
+
$0[76] = t34;
|
|
312
|
+
$0[77] = t35;
|
|
313
|
+
$0[78] = t36;
|
|
314
|
+
$0[79] = t37;
|
|
315
|
+
$0[80] = t38;
|
|
316
|
+
} else t38 = $0[80];
|
|
315
317
|
let t39;
|
|
316
|
-
if ($0[
|
|
318
|
+
if ($0[81] !== as || $0[82] !== inputClearClassCva || $0[83] !== isClearable || $0[84] !== isDisabled || $0[85] !== onClear || $0[86] !== showClearButton) {
|
|
317
319
|
t39 = isClearable && !isDisabled && /* @__PURE__ */ jsx(InputClear, {
|
|
318
320
|
onClear: () => {
|
|
319
321
|
onClear();
|
|
@@ -321,25 +323,25 @@ var SelectInput = (t0) => {
|
|
|
321
323
|
className: inputClearClassCva({ as }),
|
|
322
324
|
show: showClearButton
|
|
323
325
|
});
|
|
324
|
-
$0[
|
|
325
|
-
$0[
|
|
326
|
-
$0[
|
|
327
|
-
$0[
|
|
328
|
-
$0[
|
|
329
|
-
$0[
|
|
330
|
-
$0[
|
|
331
|
-
} else t39 = $0[
|
|
326
|
+
$0[81] = as;
|
|
327
|
+
$0[82] = inputClearClassCva;
|
|
328
|
+
$0[83] = isClearable;
|
|
329
|
+
$0[84] = isDisabled;
|
|
330
|
+
$0[85] = onClear;
|
|
331
|
+
$0[86] = showClearButton;
|
|
332
|
+
$0[87] = t39;
|
|
333
|
+
} else t39 = $0[87];
|
|
332
334
|
let t40;
|
|
333
|
-
if ($0[
|
|
335
|
+
if ($0[88] !== trailingContent) {
|
|
334
336
|
t40 = trailingContent && /* @__PURE__ */ jsx("div", {
|
|
335
337
|
className: "flex shrink-0 items-center",
|
|
336
338
|
children: trailingContent
|
|
337
339
|
});
|
|
338
|
-
$0[
|
|
339
|
-
$0[
|
|
340
|
-
} else t40 = $0[
|
|
340
|
+
$0[88] = trailingContent;
|
|
341
|
+
$0[89] = t40;
|
|
342
|
+
} else t40 = $0[89];
|
|
341
343
|
let t41;
|
|
342
|
-
if ($0[
|
|
344
|
+
if ($0[90] !== hideDropdownIcon || $0[91] !== inputSizeCva || $0[92] !== isDisabled || $0[93] !== isOpen || $0[94] !== isSearchable || $0[95] !== setIsOpen || $0[96] !== size || $0[97] !== t) {
|
|
343
345
|
t41 = !hideDropdownIcon && /* @__PURE__ */ jsx(Button, {
|
|
344
346
|
excludeFromTabOrder: true,
|
|
345
347
|
"aria-label": t(($) => isOpen ? $.ui.closeAlt : $.ui.openAlt),
|
|
@@ -353,18 +355,18 @@ var SelectInput = (t0) => {
|
|
|
353
355
|
"aria-hidden": "true"
|
|
354
356
|
})
|
|
355
357
|
});
|
|
356
|
-
$0[
|
|
357
|
-
$0[
|
|
358
|
-
$0[
|
|
359
|
-
$0[
|
|
360
|
-
$0[
|
|
361
|
-
$0[
|
|
362
|
-
$0[
|
|
363
|
-
$0[
|
|
364
|
-
$0[
|
|
365
|
-
} else t41 = $0[
|
|
358
|
+
$0[90] = hideDropdownIcon;
|
|
359
|
+
$0[91] = inputSizeCva;
|
|
360
|
+
$0[92] = isDisabled;
|
|
361
|
+
$0[93] = isOpen;
|
|
362
|
+
$0[94] = isSearchable;
|
|
363
|
+
$0[95] = setIsOpen;
|
|
364
|
+
$0[96] = size;
|
|
365
|
+
$0[97] = t;
|
|
366
|
+
$0[98] = t41;
|
|
367
|
+
} else t41 = $0[98];
|
|
366
368
|
let t42;
|
|
367
|
-
if ($0[
|
|
369
|
+
if ($0[99] !== focusWithinProps || $0[100] !== hoverProps || $0[101] !== onFocusCapture || $0[102] !== onMouseEnter || $0[103] !== ref || $0[104] !== t16 || $0[105] !== t18 || $0[106] !== t19 || $0[107] !== t20 || $0[108] !== t21 || $0[109] !== t22 || $0[110] !== t23 || $0[111] !== t24 || $0[112] !== t25 || $0[113] !== t26 || $0[114] !== t27 || $0[115] !== t28 || $0[116] !== t29 || $0[117] !== t30 || $0[118] !== t31 || $0[119] !== t38 || $0[120] !== t39 || $0[121] !== t40 || $0[122] !== t41) {
|
|
368
370
|
t42 = /* @__PURE__ */ jsxs("div", {
|
|
369
371
|
ref,
|
|
370
372
|
className: t16,
|
|
@@ -395,32 +397,32 @@ var SelectInput = (t0) => {
|
|
|
395
397
|
t41
|
|
396
398
|
]
|
|
397
399
|
});
|
|
398
|
-
$0[
|
|
399
|
-
$0[
|
|
400
|
-
$0[
|
|
401
|
-
$0[
|
|
402
|
-
$0[
|
|
403
|
-
$0[
|
|
404
|
-
$0[
|
|
405
|
-
$0[
|
|
406
|
-
$0[
|
|
407
|
-
$0[
|
|
408
|
-
$0[
|
|
409
|
-
$0[
|
|
410
|
-
$0[
|
|
411
|
-
$0[
|
|
412
|
-
$0[
|
|
413
|
-
$0[
|
|
414
|
-
$0[
|
|
415
|
-
$0[
|
|
416
|
-
$0[
|
|
417
|
-
$0[
|
|
418
|
-
$0[
|
|
419
|
-
$0[
|
|
420
|
-
$0[
|
|
421
|
-
$0[
|
|
422
|
-
$0[
|
|
423
|
-
} else t42 = $0[
|
|
400
|
+
$0[99] = focusWithinProps;
|
|
401
|
+
$0[100] = hoverProps;
|
|
402
|
+
$0[101] = onFocusCapture;
|
|
403
|
+
$0[102] = onMouseEnter;
|
|
404
|
+
$0[103] = ref;
|
|
405
|
+
$0[104] = t16;
|
|
406
|
+
$0[105] = t18;
|
|
407
|
+
$0[106] = t19;
|
|
408
|
+
$0[107] = t20;
|
|
409
|
+
$0[108] = t21;
|
|
410
|
+
$0[109] = t22;
|
|
411
|
+
$0[110] = t23;
|
|
412
|
+
$0[111] = t24;
|
|
413
|
+
$0[112] = t25;
|
|
414
|
+
$0[113] = t26;
|
|
415
|
+
$0[114] = t27;
|
|
416
|
+
$0[115] = t28;
|
|
417
|
+
$0[116] = t29;
|
|
418
|
+
$0[117] = t30;
|
|
419
|
+
$0[118] = t31;
|
|
420
|
+
$0[119] = t38;
|
|
421
|
+
$0[120] = t39;
|
|
422
|
+
$0[121] = t40;
|
|
423
|
+
$0[122] = t41;
|
|
424
|
+
$0[123] = t42;
|
|
425
|
+
} else t42 = $0[123];
|
|
424
426
|
return t42;
|
|
425
427
|
};
|
|
426
428
|
//#endregion
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
2
2
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
3
|
-
import {
|
|
3
|
+
import { inputSizeDefinition } from "../../shared/input.cva.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { clsx } from "clsx";
|
|
@@ -8,7 +8,7 @@ import { clsx } from "clsx";
|
|
|
8
8
|
var StaticSelectTrailingContent = (t0) => {
|
|
9
9
|
const $ = c(10);
|
|
10
10
|
const { trailingContent, hideDropdownIcon, isDisabled, size } = t0;
|
|
11
|
-
const inputSizeCva = UIOverrides.useCva("input.sizeCva",
|
|
11
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
12
12
|
if (!trailingContent && hideDropdownIcon) return null;
|
|
13
13
|
let t1;
|
|
14
14
|
if ($[0] !== trailingContent) {
|
|
@@ -3,10 +3,12 @@ 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
|
|
7
|
-
export declare const shouldEnableQueryForSelection: <TInitialSelectItem, TKey extends Key = Key>({ initialSelection, value, mapInitialToSelectItem, }: {
|
|
6
|
+
export declare const getSelectionIdsToResolve: <TInitialSelectItem, TKey extends Key = Key>({ initialSelection, value, mapInitialToSelectItem, }: {
|
|
8
7
|
initialSelection: TInitialSelectItem | TInitialSelectItem[] | null | undefined;
|
|
9
8
|
value: TKey | TKey[] | null | undefined;
|
|
10
9
|
mapInitialToSelectItem?: (item: TInitialSelectItem) => SelectItem<TKey>;
|
|
11
|
-
}) =>
|
|
10
|
+
}) => {
|
|
11
|
+
count: number;
|
|
12
|
+
items: TKey[];
|
|
13
|
+
};
|
|
12
14
|
export declare const getQueryItems: <TQueryFn extends QueryFn, TKey extends Key = Key>(data: QueryDataType<TQueryFn> | undefined, queryMap?: (data: QueryDataType<TQueryFn>) => SelectItem<TKey>[]) => SelectItem<TKey>[];
|
|
@@ -9,18 +9,25 @@ var getInitialSelectionItems = (initialSelection) => {
|
|
|
9
9
|
return Array.isArray(initialSelection) ? initialSelection : initialSelection != null ? [initialSelection] : [];
|
|
10
10
|
};
|
|
11
11
|
var getInitialSelectionLabel = (initialSelection, mapInitialToSelectItem) => mapInitialToSelectItem?.(initialSelection).label ?? getDefaultInitialSelectionLabel(initialSelection);
|
|
12
|
-
var
|
|
13
|
-
return getInitialSelectionItems(initialSelection).some((item) => {
|
|
14
|
-
return getInitialSelectionLabel(item, mapInitialToSelectItem) === "";
|
|
15
|
-
});
|
|
16
|
-
};
|
|
17
|
-
var shouldEnableQueryForSelection = ({ initialSelection, value, mapInitialToSelectItem }) => {
|
|
18
|
-
if (isInitialSelectionLabelMissing(initialSelection, mapInitialToSelectItem)) return true;
|
|
12
|
+
var getSelectionIdsToResolve = ({ initialSelection, value, mapInitialToSelectItem }) => {
|
|
19
13
|
const values = Array.isArray(value) ? value : value != null ? [value] : [];
|
|
20
|
-
if (values.length === 0) return false;
|
|
21
14
|
const initialSelections = getInitialSelectionItems(initialSelection);
|
|
22
|
-
const labeledInitialSelectionIds =
|
|
23
|
-
|
|
15
|
+
const labeledInitialSelectionIds = /* @__PURE__ */ new Set();
|
|
16
|
+
const missingLabelInitialSelectionIds = [];
|
|
17
|
+
initialSelections.forEach((item) => {
|
|
18
|
+
const id = (mapInitialToSelectItem?.(item))?.id ?? item.id;
|
|
19
|
+
if (id == null) return;
|
|
20
|
+
if (getInitialSelectionLabel(item, mapInitialToSelectItem) === "") {
|
|
21
|
+
missingLabelInitialSelectionIds.push(id);
|
|
22
|
+
return;
|
|
23
|
+
}
|
|
24
|
+
labeledInitialSelectionIds.add(id);
|
|
25
|
+
});
|
|
26
|
+
const items = Array.from(new Set([...missingLabelInitialSelectionIds, ...values.filter((id) => !labeledInitialSelectionIds.has(id))]));
|
|
27
|
+
return {
|
|
28
|
+
count: items.length,
|
|
29
|
+
items
|
|
30
|
+
};
|
|
24
31
|
};
|
|
25
32
|
var getQueryItems = (data, queryMap) => {
|
|
26
33
|
if (!data) return [];
|
|
@@ -33,4 +40,4 @@ var getQueryItems = (data, queryMap) => {
|
|
|
33
40
|
return [];
|
|
34
41
|
};
|
|
35
42
|
//#endregion
|
|
36
|
-
export { getQueryItems,
|
|
43
|
+
export { getQueryItems, getSelectionIdsToResolve };
|
|
@@ -3,8 +3,4 @@ export declare const selectPopoverDefinition: {
|
|
|
3
3
|
base: string[];
|
|
4
4
|
config?: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
5
5
|
};
|
|
6
|
-
export declare const selectPopoverCva: {
|
|
7
|
-
base: string[];
|
|
8
|
-
config?: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
9
|
-
};
|
|
10
6
|
export type SelectPopoverCva = UIOverrides.VariantProps<NonNullable<typeof selectPopoverDefinition.config>>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
|
-
|
|
2
|
+
//#region src/components/inputs/Selection/shared/selectDesktop.cva.ts
|
|
3
|
+
var selectPopoverDefinition = UIOverrides.defineConfig({ base: ["my-4 outline-none"] });
|
|
3
4
|
//#endregion
|
|
4
|
-
export {
|
|
5
|
+
export { selectPopoverDefinition };
|
|
@@ -1,5 +1,12 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
import { UIOverrides } from '../../../../config/uiOverrides.context';
|
|
2
|
+
export declare const selectInputTagsContentWrapperDefinition: {
|
|
3
|
+
base: string[];
|
|
4
|
+
config: import("../../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
5
|
+
readonly isSearchable: {
|
|
6
|
+
readonly false: "pointer-events-none z-1";
|
|
7
|
+
};
|
|
8
|
+
}>;
|
|
9
|
+
};
|
|
10
|
+
export type SelectInputTagsContentWrapperConfig = NonNullable<typeof selectInputTagsContentWrapperDefinition.config>;
|
|
11
|
+
export interface SelectInputTagsContentWrapperVariantProps extends UIOverrides.VariantProps<SelectInputTagsContentWrapperConfig> {
|
|
12
|
+
}
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { UIOverrides } from "../../../../config/uiOverrides.context.js";
|
|
2
2
|
//#region src/components/inputs/Selection/shared/selectInput.cva.ts
|
|
3
|
-
var
|
|
3
|
+
var selectInputTagsContentWrapperDefinition = UIOverrides.defineConfig({
|
|
4
|
+
base: ["flex flex-1 flex-wrap gap-input-gap-input-text-to-elements truncate"],
|
|
5
|
+
config: { variants: { isSearchable: { false: "pointer-events-none z-1" } } }
|
|
6
|
+
});
|
|
4
7
|
//#endregion
|
|
5
|
-
export {
|
|
8
|
+
export { selectInputTagsContentWrapperDefinition };
|
|
@@ -1,6 +1,24 @@
|
|
|
1
1
|
import { SelectInputTags } from "./SelectInputTags.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
//#region src/components/inputs/Selection/shared/staticSelect.utils.tsx
|
|
4
|
+
var getStaticMultipleDisplayValue = ({ selectedItems, isDisabled, collapseAfter, selectedTagsType }) => {
|
|
5
|
+
if (selectedItems.length === 0) return "";
|
|
6
|
+
return /* @__PURE__ */ jsx(SelectInputTags, {
|
|
7
|
+
selectedItems,
|
|
8
|
+
isDisabled,
|
|
9
|
+
collapseAfter,
|
|
10
|
+
selectedTagsType,
|
|
11
|
+
onRemove: () => void 0
|
|
12
|
+
});
|
|
13
|
+
};
|
|
14
|
+
var getStaticSingleDisplayValue = ({ selectedItem, showSelectionContent }) => {
|
|
15
|
+
if (!selectedItem) return "";
|
|
16
|
+
if (showSelectionContent && selectedItem.content) return selectedItem.content;
|
|
17
|
+
return /* @__PURE__ */ jsx("div", {
|
|
18
|
+
className: "min-w-0 flex-1 truncate",
|
|
19
|
+
children: selectedItem.label
|
|
20
|
+
});
|
|
21
|
+
};
|
|
4
22
|
var getStaticSelectValue = ({ items, value, selectionMode, initialSelection, mapInitialToSelectItem = ((item) => ({
|
|
5
23
|
id: item.id,
|
|
6
24
|
label: item.label ?? item.name ?? ""
|
|
@@ -14,22 +32,21 @@ var getStaticSelectValue = ({ items, value, selectionMode, initialSelection, map
|
|
|
14
32
|
if (selectionMode === "multiple") return {
|
|
15
33
|
selectedItem,
|
|
16
34
|
selectedItems,
|
|
17
|
-
displayValue:
|
|
35
|
+
displayValue: getStaticMultipleDisplayValue({
|
|
18
36
|
selectedItems,
|
|
19
37
|
isDisabled,
|
|
20
38
|
collapseAfter,
|
|
21
|
-
selectedTagsType
|
|
22
|
-
|
|
23
|
-
}) : "",
|
|
39
|
+
selectedTagsType
|
|
40
|
+
}),
|
|
24
41
|
isEmpty: selectedItems.length === 0
|
|
25
42
|
};
|
|
26
43
|
return {
|
|
27
44
|
selectedItem,
|
|
28
45
|
selectedItems,
|
|
29
|
-
displayValue:
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
})
|
|
46
|
+
displayValue: getStaticSingleDisplayValue({
|
|
47
|
+
selectedItem,
|
|
48
|
+
showSelectionContent
|
|
49
|
+
}),
|
|
33
50
|
isEmpty: selectedItem == null
|
|
34
51
|
};
|
|
35
52
|
};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
|
-
import {
|
|
2
|
+
import { typographyDefinition } from "../../text/Typography/typography.cva.js";
|
|
3
3
|
import { Loader } from "../../status/Loader/Loader.js";
|
|
4
4
|
import { UIConfig } from "../../../config/uiConfig.context.js";
|
|
5
5
|
import { InlineIconButton } from "../../buttons/InlineIconButton/InlineIconButton.js";
|
|
6
6
|
import { FormFieldLabel } from "../FormField/FormFieldLabel.js";
|
|
7
7
|
import { InputClear } from "../shared/InputClear.js";
|
|
8
|
-
import {
|
|
8
|
+
import { inputBaseDefinition, inputContentWrapperDefinition, inputSizeDefinition } from "../shared/input.cva.js";
|
|
9
9
|
import { FormField } from "../FormField/FormField.js";
|
|
10
10
|
import { TooltipWrapper } from "../shared/TooltipWrapper.js";
|
|
11
11
|
import { c } from "react/compiler-runtime";
|
|
@@ -16,10 +16,10 @@ import { isValidElement, useId } from "react";
|
|
|
16
16
|
var InputFrame = (props) => {
|
|
17
17
|
const $ = c(189);
|
|
18
18
|
const ui = UIConfig.useConfig();
|
|
19
|
-
const inputBaseCva = UIOverrides.useCva("input.baseCva",
|
|
20
|
-
const inputSizeCva = UIOverrides.useCva("input.sizeCva",
|
|
21
|
-
const inputContentWrapperCva = UIOverrides.useCva("input.contentWrapperCva",
|
|
22
|
-
const typographyCva = UIOverrides.useCva("typography.cva",
|
|
19
|
+
const inputBaseCva = UIOverrides.useCva("input.baseCva", inputBaseDefinition);
|
|
20
|
+
const inputSizeCva = UIOverrides.useCva("input.sizeCva", inputSizeDefinition);
|
|
21
|
+
const inputContentWrapperCva = UIOverrides.useCva("input.contentWrapperCva", inputContentWrapperDefinition);
|
|
22
|
+
const typographyCva = UIOverrides.useCva("typography.cva", typographyDefinition);
|
|
23
23
|
const generatedInputId = useId();
|
|
24
24
|
const { ref, children, formFieldRef, labelProps: labelPropsProp, headerProps, error, label, tooltipText, helperText, isRequired, rightContent, isDisabled, isHeaderHidden, hideLabel: hideLabelProp, headerClassName, errorClassName, className, leadingContent, leadingIcon, actionContent, actionContentPlacement: t0, trailingContent, trailingIcon, trailingAction, unit, isLoading, action, isClearable: isClearableProp, showClear, renderStatic, onStaticInteract, clearClassName, onClear, dataAttributes, typographySize, id: idProp, inputClassName, contentClassName, contentWrapperClassName, contentGroup: t1, contentAndTrailingClassName, wrapContentAndTrailing, wrapTrailingContent: t2, reserveTrailingContent, labelPlacement: t3, trailingClassName, onMouseEnter, onFocusCapture, variant: variantProp, as: asProp, size: sizeProp } = props;
|
|
25
25
|
const actionContentPlacement = t0 === void 0 ? "content-wrapper" : t0;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { Tooltip } from "../../overlays/Tooltip/Tooltip.js";
|
|
3
|
-
import {
|
|
3
|
+
import { tooltipWrapperTriggerDefinition } from "./tooltipWrapper.cva.js";
|
|
4
4
|
import { c } from "react/compiler-runtime";
|
|
5
5
|
import { jsx } from "react/jsx-runtime";
|
|
6
6
|
//#region src/components/inputs/shared/TooltipWrapper.tsx
|
|
7
7
|
var TooltipWrapper = (props) => {
|
|
8
8
|
const $ = c(14);
|
|
9
|
-
const tooltipWrapperTriggerCva = UIOverrides.useCva("tooltipWrapper.triggerCva",
|
|
9
|
+
const tooltipWrapperTriggerCva = UIOverrides.useCva("tooltipWrapper.triggerCva", tooltipWrapperTriggerDefinition);
|
|
10
10
|
if (props.as !== "inline") return props.children;
|
|
11
11
|
const t0 = props.error || void 0;
|
|
12
12
|
const t1 = !props.error;
|
|
@@ -38,38 +38,6 @@ export declare const inputSizeDefinition: {
|
|
|
38
38
|
export type InputSizeConfig = NonNullable<typeof inputSizeDefinition.config>;
|
|
39
39
|
export interface InputSizeProps extends UIOverrides.VariantProps<InputSizeConfig> {
|
|
40
40
|
}
|
|
41
|
-
export declare const inputBase: {
|
|
42
|
-
base: string[];
|
|
43
|
-
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
44
|
-
readonly variant: {
|
|
45
|
-
readonly outlined: "";
|
|
46
|
-
readonly filled: "";
|
|
47
|
-
};
|
|
48
|
-
readonly as: {
|
|
49
|
-
readonly default: "rounded-input-rounding-default";
|
|
50
|
-
readonly floating: "rounded-input-rounding-default";
|
|
51
|
-
readonly filter: "rounded-input-rounding-default";
|
|
52
|
-
readonly inline: ["h-full", "border-transparent border-b-0 bg-transparent text-text-default-1", "hover:border-input-outlined-outline-hover", "focus-within:border-input-outlined-outline-active", "invalid:border-input-outlined-outline-error", "has-invalid:border-input-outlined-outline-error", "disabled:hover:border-transparent", "has-disabled:hover:border-transparent"];
|
|
53
|
-
};
|
|
54
|
-
}>;
|
|
55
|
-
};
|
|
56
|
-
export declare const inputSize: {
|
|
57
|
-
base: string[];
|
|
58
|
-
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
59
|
-
readonly size: {
|
|
60
|
-
readonly "extra-small": "text-label-1";
|
|
61
|
-
readonly small: "text-label-1";
|
|
62
|
-
readonly default: "text-label-1";
|
|
63
|
-
readonly large: "text-label-1";
|
|
64
|
-
};
|
|
65
|
-
readonly as: {
|
|
66
|
-
readonly default: "";
|
|
67
|
-
readonly floating: ["px-input-side-m", "py-floating-label-input-height-empty", "input-filled:pb-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-bottom))]", "input-filled:pt-[calc(var(--spacing-floating-label-input-height-filled)+var(--spacing-floating-label-input-offset-top)+var(--text-label-3--line-height)*var(--text-label-3))]"];
|
|
68
|
-
readonly filter: "";
|
|
69
|
-
readonly inline: "";
|
|
70
|
-
};
|
|
71
|
-
}>;
|
|
72
|
-
};
|
|
73
41
|
export declare const inputContentWrapperDefinition: {
|
|
74
42
|
base: string[];
|
|
75
43
|
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
@@ -81,17 +49,6 @@ export declare const inputContentWrapperDefinition: {
|
|
|
81
49
|
};
|
|
82
50
|
}>;
|
|
83
51
|
};
|
|
84
|
-
export declare const inputContentWrapper: {
|
|
85
|
-
base: string[];
|
|
86
|
-
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
87
|
-
readonly as: {
|
|
88
|
-
readonly default: "";
|
|
89
|
-
readonly floating: "flex-col";
|
|
90
|
-
readonly filter: "gap-input-gap-input-text-to-elements";
|
|
91
|
-
readonly inline: "";
|
|
92
|
-
};
|
|
93
|
-
}>;
|
|
94
|
-
};
|
|
95
52
|
export type InputContentWrapperConfig = NonNullable<typeof inputContentWrapperDefinition.config>;
|
|
96
53
|
export interface InputContentWrapperProps extends UIOverrides.VariantProps<InputContentWrapperConfig> {
|
|
97
54
|
}
|
|
@@ -106,17 +63,6 @@ export declare const inputClearClassDefinition: {
|
|
|
106
63
|
};
|
|
107
64
|
}>;
|
|
108
65
|
};
|
|
109
|
-
export declare const inputClearClass: {
|
|
110
|
-
base: string[];
|
|
111
|
-
config: import("../../../utils/style-merge.util").StyleMergeUtils.Config<{
|
|
112
|
-
readonly as: {
|
|
113
|
-
readonly default: "";
|
|
114
|
-
readonly floating: "";
|
|
115
|
-
readonly filter: "";
|
|
116
|
-
readonly inline: "";
|
|
117
|
-
};
|
|
118
|
-
}>;
|
|
119
|
-
};
|
|
120
66
|
export type InputClearClassConfig = NonNullable<typeof inputClearClassDefinition.config>;
|
|
121
67
|
export interface InputClearClassProps extends UIOverrides.VariantProps<InputClearClassConfig> {
|
|
122
68
|
}
|
|
@@ -209,9 +209,7 @@ var inputSizeDefinition = UIOverrides.defineConfig({
|
|
|
209
209
|
}
|
|
210
210
|
}
|
|
211
211
|
});
|
|
212
|
-
var
|
|
213
|
-
var inputSize = inputSizeDefinition;
|
|
214
|
-
var inputContentWrapper = UIOverrides.defineConfig({
|
|
212
|
+
var inputContentWrapperDefinition = UIOverrides.defineConfig({
|
|
215
213
|
base: ["flex w-full"],
|
|
216
214
|
config: {
|
|
217
215
|
variants: { as: {
|
|
@@ -223,7 +221,7 @@ var inputContentWrapper = UIOverrides.defineConfig({
|
|
|
223
221
|
defaultVariants: { as: "default" }
|
|
224
222
|
}
|
|
225
223
|
});
|
|
226
|
-
var
|
|
224
|
+
var inputClearClassDefinition = UIOverrides.defineConfig({
|
|
227
225
|
base: [""],
|
|
228
226
|
config: {
|
|
229
227
|
variants: { as: {
|
|
@@ -333,4 +331,4 @@ var useInputCva = () => {
|
|
|
333
331
|
return t0;
|
|
334
332
|
};
|
|
335
333
|
//#endregion
|
|
336
|
-
export {
|
|
334
|
+
export { inputBaseDefinition, inputClearClassDefinition, inputContentWrapperDefinition, inputSideDefinition, inputSizeDefinition, useInputCva };
|
|
@@ -3,10 +3,6 @@ export declare const tooltipWrapperTriggerDefinition: {
|
|
|
3
3
|
base: string[];
|
|
4
4
|
config?: import("../../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
5
5
|
};
|
|
6
|
-
export declare const tooltipWrapperTrigger: {
|
|
7
|
-
base: string[];
|
|
8
|
-
config?: import("../../../utils/style-merge.util").StyleMergeUtils.Config<Record<never, never>>;
|
|
9
|
-
};
|
|
10
6
|
export type TooltipWrapperTriggerConfig = NonNullable<typeof tooltipWrapperTriggerDefinition.config>;
|
|
11
7
|
export interface TooltipWrapperTriggerVariantProps extends UIOverrides.VariantProps<TooltipWrapperTriggerConfig> {
|
|
12
8
|
}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
|
-
|
|
2
|
+
//#region src/components/inputs/shared/tooltipWrapper.cva.ts
|
|
3
|
+
var tooltipWrapperTriggerDefinition = UIOverrides.defineConfig({ base: ["inline-flex"] });
|
|
3
4
|
//#endregion
|
|
4
|
-
export {
|
|
5
|
+
export { tooltipWrapperTriggerDefinition };
|