@povio/ui 2.2.5 → 2.2.7
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/assets/icons/AlignCenter.js +3 -1
- package/dist/assets/icons/AlignLeft.js +3 -1
- package/dist/assets/icons/AlignLeftRight.js +3 -1
- package/dist/assets/icons/AlignRight.js +3 -1
- package/dist/assets/icons/ArrowDropDown.js +3 -1
- package/dist/assets/icons/ArrowDropUp.js +3 -1
- package/dist/assets/icons/ArrowLeft.js +3 -1
- package/dist/assets/icons/ArrowRight.js +3 -1
- package/dist/assets/icons/Bold.js +3 -1
- package/dist/assets/icons/BulletedList.js +3 -1
- package/dist/assets/icons/Calendar.js +3 -1
- package/dist/assets/icons/Check.js +3 -1
- package/dist/assets/icons/CheckCircle.js +3 -1
- package/dist/assets/icons/CheckboxCheckmark.js +3 -1
- package/dist/assets/icons/CheckboxIndeterminate.js +3 -1
- package/dist/assets/icons/ChevronDown.js +3 -1
- package/dist/assets/icons/ChevronLeft.js +3 -1
- package/dist/assets/icons/ChevronRight.js +3 -1
- package/dist/assets/icons/ChevronUp.js +3 -1
- package/dist/assets/icons/ChevronsLeft.js +3 -1
- package/dist/assets/icons/ChevronsRight.js +3 -1
- package/dist/assets/icons/Clock.js +3 -1
- package/dist/assets/icons/Close.js +3 -1
- package/dist/assets/icons/DateTime.js +3 -1
- package/dist/assets/icons/DragIndicator.js +3 -1
- package/dist/assets/icons/File.js +3 -1
- package/dist/assets/icons/Highlight.js +3 -1
- package/dist/assets/icons/HighlightOn.js +3 -1
- package/dist/assets/icons/Home.js +3 -1
- package/dist/assets/icons/Info.js +3 -1
- package/dist/assets/icons/Italic.js +3 -1
- package/dist/assets/icons/Link.js +3 -1
- package/dist/assets/icons/Menu.js +3 -1
- package/dist/assets/icons/NumberedList.js +3 -1
- package/dist/assets/icons/PointerHorizontal.js +3 -1
- package/dist/assets/icons/PointerVertical.js +3 -1
- package/dist/assets/icons/Search.js +15 -0
- package/dist/assets/icons/Send.js +3 -1
- package/dist/assets/icons/Strikethrough.js +3 -1
- package/dist/assets/icons/TextColor.js +3 -1
- package/dist/assets/icons/Today.js +3 -1
- package/dist/assets/icons/Underlined.js +3 -1
- package/dist/assets/icons/Upload.js +3 -1
- package/dist/assets/icons/Visibility.js +3 -1
- package/dist/assets/icons/VisibilityOff.js +3 -1
- package/dist/assets/icons/WarningFilled.js +3 -1
- package/dist/assets/locales/en/translation.json.js +1 -0
- package/dist/assets/locales/sl/translation.json.js +1 -0
- package/dist/components/Breadcrumbs/Breadcrumbs.js +5 -3
- package/dist/components/Breadcrumbs/breadcrumbs.cva.js +7 -5
- package/dist/components/Menu/Menu.js +3 -1
- package/dist/components/Menu/MenuDesktop.js +3 -1
- package/dist/components/Menu/MenuItem.js +3 -1
- package/dist/components/Menu/MenuMobile.js +4 -1
- package/dist/components/Menu/MenuPopover.js +3 -1
- package/dist/components/Menu/menu.cva.js +6 -4
- package/dist/components/buttons/Button/Button.js +3 -1
- package/dist/components/buttons/Button/button.cva.js +7 -5
- package/dist/components/buttons/IconButton/IconButton.js +3 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +3 -1
- package/dist/components/buttons/PillButton/PillButton.js +3 -1
- package/dist/components/buttons/PillButton/pillButton.cva.js +6 -4
- package/dist/components/buttons/SplitButton/SplitButton.js +3 -1
- package/dist/components/buttons/TextButton/TextButton.js +3 -1
- package/dist/components/buttons/ToggleButton/ToggleButton.js +3 -1
- package/dist/components/buttons/shared/ButtonContent.js +3 -1
- package/dist/components/buttons/shared/buttonContent.cva.js +2 -1
- package/dist/components/inputs/Checkbox/Checkbox.js +4 -2
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +3 -1
- package/dist/components/inputs/Checkbox/checkbox.cva.js +7 -4
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +3 -1
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +10 -8
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +3 -1
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +3 -1
- package/dist/components/inputs/DateTime/shared/Calendar.js +3 -1
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +3 -1
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +3 -1
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +3 -1
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +5 -3
- package/dist/components/inputs/DateTime/shared/DateField.js +3 -1
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +3 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +4 -2
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +6 -14
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +4 -2
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +3 -1
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +3 -1
- package/dist/components/inputs/DateTime/shared/TimeField.js +3 -1
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +3 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +3 -1
- package/dist/components/inputs/DateTime/shared/YearPicker.js +3 -1
- package/dist/components/inputs/File/FileUpload.d.ts +1 -1
- package/dist/components/inputs/File/FileUpload.js +21 -7
- package/dist/components/inputs/File/FileUploadContainer.js +3 -1
- package/dist/components/inputs/File/InputUpload.js +3 -1
- package/dist/components/inputs/File/fileUpload.types.d.ts +11 -1
- package/dist/components/inputs/File/shared/FileCard.js +3 -1
- package/dist/components/inputs/File/shared/FileCardList.js +4 -2
- package/dist/components/inputs/File/shared/FileUploadContent.js +3 -1
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +3 -1
- package/dist/components/inputs/File/shared/FileUploadContentError.js +5 -3
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +6 -4
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +6 -4
- package/dist/components/inputs/File/shared/InputUploadContent.js +4 -2
- package/dist/components/inputs/File/shared/InputUploadFilled.js +3 -1
- package/dist/components/inputs/File/shared/ProgressBar.js +3 -1
- package/dist/components/inputs/File/shared/fileUpload.cva.js +4 -2
- package/dist/components/inputs/File/shared/inputUploadButton.cva.js +6 -3
- package/dist/components/inputs/FormField/FormField.js +11 -1
- package/dist/components/inputs/FormField/FormFieldError.js +5 -3
- package/dist/components/inputs/FormField/FormFieldHeader.js +3 -1
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +4 -2
- package/dist/components/inputs/FormField/FormFieldHelper.d.ts +8 -0
- package/dist/components/inputs/FormField/FormFieldHelper.js +14 -0
- package/dist/components/inputs/FormField/FormFieldLabel.js +4 -1
- package/dist/components/inputs/FormField/formFieldError.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldError.cva.js +11 -0
- package/dist/components/inputs/FormField/formFieldHelper.cva.d.ts +6 -0
- package/dist/components/inputs/FormField/formFieldHelper.cva.js +11 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +3 -1
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +4 -2
- package/dist/components/inputs/Input/TextArea/TextArea.js +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +3 -1
- package/dist/components/inputs/Input/shared/InputContent.js +4 -1
- package/dist/components/inputs/Inputs/Form.js +2 -0
- package/dist/components/inputs/Inputs/InputItem.js +2 -0
- package/dist/components/inputs/Inputs/Inputs.js +2 -0
- package/dist/components/inputs/RadioGroup/RadioGroup.js +6 -4
- package/dist/components/inputs/RadioGroup/radio.cva.js +6 -3
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +3 -1
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +3 -1
- package/dist/components/inputs/Selection/Select/Select.js +3 -1
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/SelectBase.js +5 -2
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +3 -1
- package/dist/components/inputs/Selection/shared/SelectListBox.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +5 -3
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +4 -2
- package/dist/components/inputs/Selection/shared/SelectMobile.js +19 -13
- package/dist/components/inputs/Selection/shared/select.context.js +20 -18
- package/dist/components/inputs/Selection/shared/useSelectItems.js +6 -4
- package/dist/components/inputs/Slider/Slider.js +3 -1
- package/dist/components/inputs/TextEditor/TextEditor.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +4 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +4 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +3 -1
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +4 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +4 -2
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +4 -2
- package/dist/components/inputs/TextEditor/textEditor.types.js +3 -1
- package/dist/components/inputs/Toggle/Toggle.js +3 -1
- package/dist/components/inputs/Toggle/toggle.cva.js +5 -2
- package/dist/components/inputs/shared/CheckContent.js +4 -1
- package/dist/components/inputs/shared/InputClear.js +5 -3
- package/dist/components/inputs/shared/TooltipWrapper.js +3 -1
- package/dist/components/inputs/shared/input.cva.js +6 -4
- package/dist/components/inputs/shared/label.cva.js +9 -2
- package/dist/components/navigation/Accordion/Accordion.js +3 -1
- package/dist/components/navigation/Accordion/AccordionItem.js +3 -1
- package/dist/components/navigation/Accordion/accordion.cva.js +12 -10
- package/dist/components/navigation/Stepper/Stepper.js +3 -1
- package/dist/components/navigation/Stepper/StepperItem.js +3 -1
- package/dist/components/navigation/Stepper/StepperSeparator.js +3 -1
- package/dist/components/navigation/Stepper/stepper.cva.js +9 -7
- package/dist/components/outline.clsx.js +4 -2
- package/dist/components/overlays/ActionModal/ActionModal.js +3 -1
- package/dist/components/overlays/BottomSheet/BottomSheet.d.ts +5 -0
- package/dist/components/overlays/BottomSheet/BottomSheet.js +23 -7
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.d.ts +13 -0
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +38 -0
- package/dist/components/overlays/Drawer/Drawer.js +3 -1
- package/dist/components/overlays/Modal/Modal.js +4 -2
- package/dist/components/overlays/Modal/modal.cva.js +5 -3
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +7 -10
- package/dist/components/overlays/Tooltip/Tooltip.js +7 -2
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +3 -1
- package/dist/components/overlays/Tooltip/tooltip.cva.js +6 -4
- package/dist/components/segment/Segment.js +3 -1
- package/dist/components/segment/SegmentItem.js +3 -1
- package/dist/components/segment/segment.cva.js +4 -2
- package/dist/components/shared/pagination/Pagination.js +4 -2
- package/dist/components/shared/pagination/PaginationList.js +4 -2
- package/dist/components/shared/pagination/minWidth.cva.js +3 -1
- package/dist/components/shared/popover.cva.js +3 -1
- package/dist/components/status/Alert/Alert.js +3 -1
- package/dist/components/status/Alert/alert.cva.js +3 -1
- package/dist/components/status/Loader/Loader.js +3 -1
- package/dist/components/status/Loader/loader.cva.js +4 -2
- package/dist/components/status/Toast/Toast.js +15 -6
- package/dist/components/status/Toast/toast.cva.js +6 -20
- package/dist/components/status/Toast/useToast.js +3 -1
- package/dist/components/status/shared/status.cva.js +4 -2
- package/dist/components/table/CellText.d.ts +2 -1
- package/dist/components/table/CellText.js +18 -10
- package/dist/components/table/ColumnConfig.js +3 -1
- package/dist/components/table/HeaderText.d.ts +5 -2
- package/dist/components/table/HeaderText.js +17 -7
- package/dist/components/table/InfiniteTable.js +3 -1
- package/dist/components/table/PaginatedTable.js +3 -1
- package/dist/components/table/Table.js +5 -3
- package/dist/components/table/table.cva.d.ts +6 -0
- package/dist/components/table/table.cva.js +9 -5
- package/dist/components/text/Link/Link.js +3 -1
- package/dist/components/text/Link/link.cva.js +3 -1
- package/dist/components/text/Tag/Tag.d.ts +3 -0
- package/dist/components/text/Tag/Tag.js +9 -4
- package/dist/components/text/Tag/tag.cva.js +3 -1
- package/dist/components/text/Typography/Typography.js +3 -1
- package/dist/components/text/Typography/typography.cva.js +3 -1
- package/dist/config/confirmation.context.js +4 -2
- package/dist/config/i18n.js +4 -2
- package/dist/config/link.context.js +3 -1
- package/dist/config/router.context.js +3 -1
- package/dist/config/theme.context.js +8 -6
- package/dist/config/uiConfig.context.d.ts +10 -2
- package/dist/config/uiConfig.context.js +25 -4
- package/dist/config/uiStyle.context.d.ts +9 -1
- package/dist/config/uiStyle.context.js +3 -1
- package/dist/helpers/dynamicColumns.js +4 -2
- package/dist/helpers/dynamicInputs.js +5 -3
- package/dist/hooks/useAutosave.js +2 -0
- package/dist/hooks/useBreakpoint.js +5 -3
- package/dist/hooks/useDebounceCallback.js +2 -0
- package/dist/hooks/useDeepCompare.js +5 -3
- package/dist/hooks/useFilters.js +3 -1
- package/dist/hooks/useForm.js +2 -0
- package/dist/hooks/useFormAutosave.js +2 -0
- package/dist/hooks/useIntersectionObserver.js +3 -1
- package/dist/hooks/useLocalStorage.js +3 -1
- package/dist/hooks/useLongPressRepeat.js +3 -1
- package/dist/hooks/usePagination.js +2 -0
- package/dist/hooks/useScrollableListBox.js +2 -0
- package/dist/hooks/useSorting.js +2 -0
- package/dist/hooks/useStateAndRef.js +3 -1
- package/dist/hooks/useTableColumnConfig.js +2 -0
- package/dist/hooks/useTableNav.js +124 -20
- package/dist/hooks/useTranslationMemo.js +2 -0
- package/dist/index.js +1 -1
- package/dist/tw-ui-plugin.js +4 -2
- package/dist/utils/array.utils.js +3 -1
- package/dist/utils/compoundMapper.js +3 -1
- package/dist/utils/date-time.utils.js +3 -1
- package/dist/utils/date.utils.js +3 -1
- package/dist/utils/dom.utils.js +3 -1
- package/dist/utils/file.utils.d.ts +4 -0
- package/dist/utils/file.utils.js +10 -3
- package/dist/utils/isEqual.js +3 -1
- package/dist/utils/logger.js +3 -1
- package/dist/utils/object.utils.js +3 -1
- package/dist/utils/queries.utils.js +3 -1
- package/dist/utils/rest.utils.js +3 -1
- package/dist/utils/routing.utils.js +3 -1
- package/dist/utils/string.utils.js +3 -1
- package/dist/utils/zod.utils.js +3 -1
- package/package.json +2 -2
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { uiGroupOutlineClass } from "../../outline.clsx.js";
|
|
2
2
|
import { compoundMapper } from "../../../utils/compoundMapper.js";
|
|
3
3
|
import { cva } from "class-variance-authority";
|
|
4
|
-
|
|
4
|
+
//#region src/components/inputs/RadioGroup/radio.cva.ts
|
|
5
|
+
var radio = cva([
|
|
5
6
|
"flex items-center justify-center border-2",
|
|
6
7
|
"relative size-3-5 rounded-full p-1-5",
|
|
7
8
|
"before:absolute before:hidden before:size-1 before:rounded-full",
|
|
@@ -24,9 +25,11 @@ const radio = cva([
|
|
|
24
25
|
] } },
|
|
25
26
|
defaultVariants: { variant: "default" }
|
|
26
27
|
});
|
|
27
|
-
|
|
28
|
-
|
|
28
|
+
var radioIndicatorClass = "group flex items-center gap-2";
|
|
29
|
+
var radioTypography = compoundMapper({ default: {
|
|
29
30
|
size: "label-1",
|
|
31
|
+
sizeMobile: "label-1",
|
|
30
32
|
variant: "default"
|
|
31
33
|
} });
|
|
34
|
+
//#endregion
|
|
32
35
|
export { radio, radioIndicatorClass, radioTypography };
|
|
@@ -2,7 +2,8 @@ import { SelectBase } from "../shared/SelectBase.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { mergeRefs } from "@react-aria/utils";
|
|
4
4
|
import { Controller } from "react-hook-form";
|
|
5
|
-
|
|
5
|
+
//#region src/components/inputs/Selection/Autocomplete/Autocomplete.tsx
|
|
6
|
+
var Autocomplete = (props) => {
|
|
6
7
|
if ("formControl" in props && props.formControl) {
|
|
7
8
|
const { formControl, ref, ...innerProps } = props;
|
|
8
9
|
return /* @__PURE__ */ jsx(Controller, {
|
|
@@ -25,4 +26,5 @@ const Autocomplete = (props) => {
|
|
|
25
26
|
isSearchable: true
|
|
26
27
|
});
|
|
27
28
|
};
|
|
29
|
+
//#endregion
|
|
28
30
|
export { Autocomplete };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Autocomplete } from "./Autocomplete.js";
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
-
|
|
4
|
+
//#region src/components/inputs/Selection/Autocomplete/QueryAutocomplete.tsx
|
|
5
|
+
var QueryAutocomplete = ({ query, queryParams, queryOptions, ...props }) => {
|
|
5
6
|
const [search, setSearch] = useState("");
|
|
6
7
|
const { data: items, isLoading } = query({
|
|
7
8
|
search,
|
|
@@ -15,4 +16,5 @@ const QueryAutocomplete = ({ query, queryParams, queryOptions, ...props }) => {
|
|
|
15
16
|
isLoading
|
|
16
17
|
});
|
|
17
18
|
};
|
|
19
|
+
//#endregion
|
|
18
20
|
export { QueryAutocomplete };
|
|
@@ -2,7 +2,8 @@ import { SelectBase } from "../shared/SelectBase.js";
|
|
|
2
2
|
import { jsx } from "react/jsx-runtime";
|
|
3
3
|
import { mergeRefs } from "@react-aria/utils";
|
|
4
4
|
import { Controller } from "react-hook-form";
|
|
5
|
-
|
|
5
|
+
//#region src/components/inputs/Selection/Select/Select.tsx
|
|
6
|
+
var Select = (props) => {
|
|
6
7
|
if ("formControl" in props && props.formControl) {
|
|
7
8
|
const { formControl, ref, ...innerProps } = props;
|
|
8
9
|
return /* @__PURE__ */ jsx(Controller, {
|
|
@@ -21,4 +22,5 @@ const Select = (props) => {
|
|
|
21
22
|
}
|
|
22
23
|
return /* @__PURE__ */ jsx(SelectBase, { ...props });
|
|
23
24
|
};
|
|
25
|
+
//#endregion
|
|
24
26
|
export { Select };
|
|
@@ -9,6 +9,7 @@ export type SelectBaseProps<TKey extends Key = Key, TInitialSelectItem = Default
|
|
|
9
9
|
className?: string;
|
|
10
10
|
placeholder?: string;
|
|
11
11
|
hideDropdownIcon?: boolean;
|
|
12
|
+
hideSearchIcon?: boolean;
|
|
12
13
|
isSearchable?: boolean;
|
|
13
14
|
isClearable?: boolean;
|
|
14
15
|
isClientSearchDisabled?: boolean;
|
|
@@ -4,7 +4,8 @@ import { SelectContext } from "./select.context.js";
|
|
|
4
4
|
import { SelectDesktop } from "./SelectDesktop.js";
|
|
5
5
|
import { SelectMobile } from "./SelectMobile.js";
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
|
-
|
|
7
|
+
//#region src/components/inputs/Selection/shared/SelectBase.tsx
|
|
8
|
+
var SelectBase = (dProps) => {
|
|
8
9
|
const ui = UIConfig.useConfig();
|
|
9
10
|
const props = {
|
|
10
11
|
...dProps,
|
|
@@ -17,7 +18,8 @@ const SelectBase = (dProps) => {
|
|
|
17
18
|
isSearchable: dProps.isSearchable ?? ui.select.isSearchable,
|
|
18
19
|
selectedTagsType: dProps.selectedTagsType ?? ui.select.selectedTagsType,
|
|
19
20
|
ignoreTriggerWidth: dProps.virtualizerOptions || dProps.items.length > 100 ? false : dProps.ignoreTriggerWidth ?? false,
|
|
20
|
-
collapseAfter: dProps.collapseAfter ?? ui.select.collapseAfter
|
|
21
|
+
collapseAfter: dProps.collapseAfter ?? ui.select.collapseAfter,
|
|
22
|
+
hideSearchIcon: dProps.hideSearchIcon ?? ui.select.hideSearchIcon
|
|
21
23
|
};
|
|
22
24
|
const isDesktop = useBreakpoint("md");
|
|
23
25
|
return /* @__PURE__ */ jsx(SelectContext.Provider, {
|
|
@@ -25,4 +27,5 @@ const SelectBase = (dProps) => {
|
|
|
25
27
|
children: isDesktop ? /* @__PURE__ */ jsx(SelectDesktop, { ...props }) : /* @__PURE__ */ jsx(SelectMobile, { ...props })
|
|
26
28
|
});
|
|
27
29
|
};
|
|
30
|
+
//#endregion
|
|
28
31
|
export { SelectBase };
|
|
@@ -2,7 +2,7 @@ import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
|
2
2
|
import { popover } from "../../../shared/popover.cva.js";
|
|
3
3
|
import { FormField } from "../../FormField/FormField.js";
|
|
4
4
|
import { TooltipWrapper } from "../../shared/TooltipWrapper.js";
|
|
5
|
-
import
|
|
5
|
+
import "./useSelectItems.js";
|
|
6
6
|
import { SelectContext } from "./select.context.js";
|
|
7
7
|
import { SelectInput } from "./SelectInput.js";
|
|
8
8
|
import { SelectListBox } from "./SelectListBox.js";
|
|
@@ -12,7 +12,8 @@ import { Fragment as Fragment$1, useLayoutEffect, useMemo, useRef, useState } fr
|
|
|
12
12
|
import { ComboBox, DialogTrigger, Popover } from "react-aria-components";
|
|
13
13
|
import { useLabel, usePreventScroll } from "react-aria";
|
|
14
14
|
import { mergeRefs } from "@react-aria/utils";
|
|
15
|
-
|
|
15
|
+
//#region src/components/inputs/Selection/shared/SelectDesktop.tsx
|
|
16
|
+
var SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur, ...props }) => {
|
|
16
17
|
const { label, tooltipText, helperText, isRequired, rightContent, isHeaderHidden, headerClassName, errorClassName, placeholder, variant, isDisabled, className, hideLabel, hideDropdownIcon, isSearchable, isClearable, isLoading, as, size, collapseAfter, selectedTagsType } = props;
|
|
17
18
|
const popoverCva = UIStyle.useCva("popover.cva", popover);
|
|
18
19
|
const formFieldProps = {
|
|
@@ -159,4 +160,5 @@ const SelectDesktop = ({ ref, error, ignoreTriggerWidth, showSelectionContent, i
|
|
|
159
160
|
})
|
|
160
161
|
});
|
|
161
162
|
};
|
|
163
|
+
//#endregion
|
|
162
164
|
export { SelectDesktop };
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { ArrowDropDownIcon } from "../../../../assets/icons/ArrowDropDown.js";
|
|
2
2
|
import { UIStyle } from "../../../../config/uiStyle.context.js";
|
|
3
3
|
import { Typography } from "../../../text/Typography/Typography.js";
|
|
4
|
+
import "../../../../config/i18n.js";
|
|
4
5
|
import { FormFieldLabel } from "../../FormField/FormFieldLabel.js";
|
|
5
|
-
import { ns } from "../../../../config/i18n.js";
|
|
6
6
|
import { InputClear } from "../../shared/InputClear.js";
|
|
7
7
|
import { inputBase, inputSize } from "../../shared/input.cva.js";
|
|
8
8
|
import { SelectInputTags } from "./SelectInputTags.js";
|
|
@@ -13,7 +13,8 @@ import { use, useMemo, useRef, useState } from "react";
|
|
|
13
13
|
import { Button, ComboBoxStateContext, Input } from "react-aria-components";
|
|
14
14
|
import { useFocusVisible, useFocusWithin, useHover } from "react-aria";
|
|
15
15
|
import { useTranslation } from "react-i18next";
|
|
16
|
-
|
|
16
|
+
//#region src/components/inputs/Selection/shared/SelectInput.tsx
|
|
17
|
+
var SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvalid, className, hideDropdownIcon, isSearchable, isClearable, showSelectionContent, inputClassName, fieldProps, headerProps, selectedTagsType, collapseAfter, onCloseComboBox, onBlur, ...props }) => {
|
|
17
18
|
const inputSizeCva = UIStyle.useCva("input.sizeCva", inputSize);
|
|
18
19
|
const inputBaseCva = UIStyle.useCva("input.baseCva", inputBase);
|
|
19
20
|
const { t } = useTranslation("ui");
|
|
@@ -143,4 +144,5 @@ const SelectInput = ({ ref, placeholder, variant, as, size, isDisabled, isInvali
|
|
|
143
144
|
]
|
|
144
145
|
});
|
|
145
146
|
};
|
|
147
|
+
//#endregion
|
|
146
148
|
export { SelectInput };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Tag } from "../../../text/Tag/Tag.js";
|
|
2
2
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
3
3
|
import { useMemo } from "react";
|
|
4
|
-
|
|
4
|
+
//#region src/components/inputs/Selection/shared/SelectInputTags.tsx
|
|
5
|
+
var SelectInputTags = ({ selectedItems, isDisabled, selectedTagsType, collapseAfter, onRemove }) => {
|
|
5
6
|
const { displayedItems, remainingCount } = useMemo(() => {
|
|
6
7
|
if (!collapseAfter || selectedItems.length <= collapseAfter) return {
|
|
7
8
|
displayedItems: selectedItems,
|
|
@@ -26,4 +27,5 @@ const SelectInputTags = ({ selectedItems, isDisabled, selectedTagsType, collapse
|
|
|
26
27
|
}, "remaining-count")] });
|
|
27
28
|
return /* @__PURE__ */ jsx("p", { children: selectedItems.map((item) => item.label).join(", ") });
|
|
28
29
|
};
|
|
30
|
+
//#endregion
|
|
29
31
|
export { SelectInputTags };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import "./useSelectItems.js";
|
|
2
2
|
import { SelectContext } from "./select.context.js";
|
|
3
3
|
import { SelectListBoxItem } from "./SelectListBoxItem.js";
|
|
4
4
|
import { SelectListBoxItemSelectAll } from "./SelectListBoxItemSelectAll.js";
|
|
@@ -6,7 +6,8 @@ import { SelectListBoxLoadingItem } from "./SelectListBoxLoadingItem.js";
|
|
|
6
6
|
import { jsx } from "react/jsx-runtime";
|
|
7
7
|
import { clsx } from "clsx";
|
|
8
8
|
import { ListBox, ListLayout, Virtualizer } from "react-aria-components";
|
|
9
|
-
|
|
9
|
+
//#region src/components/inputs/Selection/shared/SelectListBox.tsx
|
|
10
|
+
var SelectListBox = ({ label, selectionMode, isSearchable, isScrollable = true, virtualizerOptions, newItemRender, onLoadMore, className, onClose, ...props }) => {
|
|
10
11
|
const { fieldState, onChange, listItems, selectableListItems, selectedIds, isMultiple, onClear, onSelectAll } = SelectContext.useSelect();
|
|
11
12
|
const onSelectionChange = (value) => {
|
|
12
13
|
const ids = Array.from(value);
|
|
@@ -70,4 +71,5 @@ const SelectListBox = ({ label, selectionMode, isSearchable, isScrollable = true
|
|
|
70
71
|
children: renderItem
|
|
71
72
|
});
|
|
72
73
|
};
|
|
74
|
+
//#endregion
|
|
73
75
|
export { SelectListBox };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import "../../../../config/i18n.js";
|
|
1
2
|
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
2
|
-
import { ns } from "../../../../config/i18n.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import { useMemo, useRef } from "react";
|
|
7
7
|
import { ListBoxItem } from "react-aria-components";
|
|
8
8
|
import { useTranslation } from "react-i18next";
|
|
9
|
-
|
|
9
|
+
//#region src/components/inputs/Selection/shared/SelectListBoxItem.tsx
|
|
10
|
+
var SelectListBoxItem = ({ isSearchable, isNewItem, newItemRender, id, label, content, isDisabled }) => {
|
|
10
11
|
const ref = useRef(null);
|
|
11
12
|
const { t } = useTranslation("ui");
|
|
12
13
|
const { selectedIds, isMultiple } = SelectContext.useSelect();
|
|
@@ -44,5 +45,6 @@ const SelectListBoxItem = ({ isSearchable, isNewItem, newItemRender, id, label,
|
|
|
44
45
|
]
|
|
45
46
|
});
|
|
46
47
|
};
|
|
47
|
-
|
|
48
|
+
var selectListBoxItemClass = clsx("group flex cursor-pointer items-center gap-2 px-list-side-item-left py-list-height-item", "border-b border-b-elevation-outline-default-1 outline-none", "font-labels-default text-interactive-text-secondary-idle text-label-2", "hover:text-interactive-text-secondary-hover", "focus-visible:bg-interactive-contained-primary-focus focus-visible:text-interactive-text-secondary-idle-inverted", "disabled:cursor-default disabled:text-interactive-text-secondary-disabled");
|
|
49
|
+
//#endregion
|
|
48
50
|
export { SelectListBoxItem, selectListBoxItemClass };
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
+
import "../../../../config/i18n.js";
|
|
1
2
|
import { CheckboxCheckmark } from "../../Checkbox/CheckboxCheckmark.js";
|
|
2
|
-
import { ns } from "../../../../config/i18n.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { selectListBoxItemClass } from "./SelectListBoxItem.js";
|
|
5
5
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
6
6
|
import { useRef } from "react";
|
|
7
7
|
import { ListBoxItem } from "react-aria-components";
|
|
8
8
|
import { useTranslation } from "react-i18next";
|
|
9
|
-
|
|
9
|
+
//#region src/components/inputs/Selection/shared/SelectListBoxItemSelectAll.tsx
|
|
10
|
+
var SelectListBoxItemSelectAll = ({ id, label, isDisabled }) => {
|
|
10
11
|
const ref = useRef(null);
|
|
11
12
|
const { t } = useTranslation("ui");
|
|
12
13
|
const { selectableListItems, selectedIds } = SelectContext.useSelect();
|
|
@@ -28,4 +29,5 @@ const SelectListBoxItemSelectAll = ({ id, label, isDisabled }) => {
|
|
|
28
29
|
}), t(($) => $.ui.select.allOption)]
|
|
29
30
|
});
|
|
30
31
|
};
|
|
32
|
+
//#endregion
|
|
31
33
|
export { SelectListBoxItemSelectAll };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Loader } from "../../../status/Loader/Loader.js";
|
|
2
|
-
import
|
|
2
|
+
import "../../../../config/i18n.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { selectListBoxItemClass } from "./SelectListBoxItem.js";
|
|
5
5
|
import { useIntersectionObserver } from "../../../../hooks/useIntersectionObserver.js";
|
|
@@ -7,7 +7,8 @@ import { jsx } from "react/jsx-runtime";
|
|
|
7
7
|
import { useCallback } from "react";
|
|
8
8
|
import { ListBoxItem } from "react-aria-components";
|
|
9
9
|
import { useTranslation } from "react-i18next";
|
|
10
|
-
|
|
10
|
+
//#region src/components/inputs/Selection/shared/SelectListBoxLoadingItem.tsx
|
|
11
|
+
var SelectListBoxLoadingItem = ({ id, label, onLoadMore }) => {
|
|
11
12
|
const { t } = useTranslation("ui");
|
|
12
13
|
const { isDebouncing, isLoading, hasLoadMore } = SelectContext.useSelect();
|
|
13
14
|
const { ref } = useIntersectionObserver({
|
|
@@ -33,4 +34,5 @@ const SelectListBoxLoadingItem = ({ id, label, onLoadMore }) => {
|
|
|
33
34
|
})
|
|
34
35
|
});
|
|
35
36
|
};
|
|
37
|
+
//#endregion
|
|
36
38
|
export { SelectListBoxLoadingItem };
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
+
import "../../../../config/i18n.js";
|
|
1
2
|
import { TextButton } from "../../../buttons/TextButton/TextButton.js";
|
|
2
|
-
import { ns } from "../../../../config/i18n.js";
|
|
3
3
|
import { SelectContext } from "./select.context.js";
|
|
4
4
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
5
5
|
import { clsx } from "clsx";
|
|
6
6
|
import { useTranslation } from "react-i18next";
|
|
7
|
-
|
|
7
|
+
//#region src/components/inputs/Selection/shared/SelectListBoxSelectionBar.tsx
|
|
8
|
+
var SelectListBoxSelectionBar = ({ className }) => {
|
|
8
9
|
const { t } = useTranslation("ui");
|
|
9
10
|
const { onClear, onSelectAll } = SelectContext.useSelect();
|
|
10
11
|
return /* @__PURE__ */ jsxs("div", {
|
|
@@ -22,4 +23,5 @@ const SelectListBoxSelectionBar = ({ className }) => {
|
|
|
22
23
|
})]
|
|
23
24
|
});
|
|
24
25
|
};
|
|
26
|
+
//#endregion
|
|
25
27
|
export { SelectListBoxSelectionBar };
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { BottomSheet } from "../../../overlays/BottomSheet/BottomSheet.js";
|
|
2
|
-
import { FormFieldHeader } from "../../FormField/FormFieldHeader.js";
|
|
3
|
-
import { FormFieldHeaderClose } from "../../FormField/FormFieldHeaderClose.js";
|
|
4
2
|
import { FormField } from "../../FormField/FormField.js";
|
|
5
3
|
import { SelectContext } from "./select.context.js";
|
|
6
4
|
import { SelectInput } from "./SelectInput.js";
|
|
7
5
|
import { SelectListBox } from "./SelectListBox.js";
|
|
6
|
+
import { SearchIcon } from "../../../../assets/icons/Search.js";
|
|
7
|
+
import { FormFieldHeaderClose } from "../../FormField/FormFieldHeaderClose.js";
|
|
8
8
|
import { TextInput } from "../../Input/TextInput/TextInput.js";
|
|
9
9
|
import { SelectListBoxSelectionBar } from "./SelectListBoxSelectionBar.js";
|
|
10
10
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -12,8 +12,9 @@ import { clsx } from "clsx";
|
|
|
12
12
|
import { useRef } from "react";
|
|
13
13
|
import { DialogTrigger } from "react-aria-components";
|
|
14
14
|
import { useLabel } from "react-aria";
|
|
15
|
-
|
|
16
|
-
|
|
15
|
+
//#region src/components/inputs/Selection/shared/SelectMobile.tsx
|
|
16
|
+
var SelectMobile = ({ ref, error, showSelectionContent, inputClassName, containerClassName, customTrigger, onBlur, ...props }) => {
|
|
17
|
+
const { label, tooltipText, helperText, isRequired, rightContent, isHeaderHidden, headerClassName, errorClassName, placeholder, variant, isDisabled, className, hideLabel, hideDropdownIcon, hideSearchIcon, isSearchable, isClearable, as, collapseAfter, selectedTagsType } = props;
|
|
17
18
|
const formFieldProps = {
|
|
18
19
|
error,
|
|
19
20
|
label,
|
|
@@ -41,9 +42,15 @@ const SelectMobile = ({ ref, error, showSelectionContent, inputClassName, contai
|
|
|
41
42
|
};
|
|
42
43
|
const { fieldState, isOpen, setIsOpen, onInputChange, isMultiple } = SelectContext.useSelect();
|
|
43
44
|
const searchInputRef = useRef(null);
|
|
45
|
+
const onBlurRef = useRef(onBlur);
|
|
46
|
+
onBlurRef.current = onBlur;
|
|
47
|
+
const handleOpenChange = (open) => {
|
|
48
|
+
if (!open) onBlurRef.current?.({});
|
|
49
|
+
setIsOpen(open);
|
|
50
|
+
};
|
|
44
51
|
const dialogTriggerProps = {
|
|
45
52
|
isOpen,
|
|
46
|
-
onOpenChange:
|
|
53
|
+
onOpenChange: handleOpenChange
|
|
47
54
|
};
|
|
48
55
|
return /* @__PURE__ */ jsx(FormField, {
|
|
49
56
|
...formFieldProps,
|
|
@@ -68,23 +75,24 @@ const SelectMobile = ({ ref, error, showSelectionContent, inputClassName, contai
|
|
|
68
75
|
isSearchable: false,
|
|
69
76
|
isClearable,
|
|
70
77
|
showSelectionContent,
|
|
71
|
-
onBlur,
|
|
78
|
+
onBlur: void 0,
|
|
72
79
|
fieldProps,
|
|
73
80
|
headerProps,
|
|
74
81
|
collapseAfter,
|
|
75
82
|
selectedTagsType
|
|
76
83
|
}), /* @__PURE__ */ jsx(BottomSheet, {
|
|
77
84
|
isOpen,
|
|
78
|
-
onOpenChange:
|
|
85
|
+
onOpenChange: handleOpenChange,
|
|
79
86
|
onStateChange: (state) => {
|
|
80
87
|
if (state === "opened") searchInputRef.current?.focus();
|
|
81
88
|
},
|
|
82
89
|
label,
|
|
83
90
|
footer: isMultiple && /* @__PURE__ */ jsx(SelectListBoxSelectionBar, {}),
|
|
84
91
|
isDismissable: true,
|
|
92
|
+
hideHeader: isSearchable,
|
|
85
93
|
children: (close) => /* @__PURE__ */ jsxs("div", {
|
|
86
94
|
className: "flex max-h-full flex-col overflow-hidden",
|
|
87
|
-
children: [isSearchable
|
|
95
|
+
children: [isSearchable && /* @__PURE__ */ jsx(TextInput, {
|
|
88
96
|
ref: searchInputRef,
|
|
89
97
|
label,
|
|
90
98
|
placeholder,
|
|
@@ -92,11 +100,8 @@ const SelectMobile = ({ ref, error, showSelectionContent, inputClassName, contai
|
|
|
92
100
|
onChange: onInputChange,
|
|
93
101
|
rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close }),
|
|
94
102
|
inputClassName,
|
|
95
|
-
className: "mb-
|
|
96
|
-
|
|
97
|
-
label,
|
|
98
|
-
rightContent: /* @__PURE__ */ jsx(FormFieldHeaderClose, { onClose: close }),
|
|
99
|
-
className: "mb-1-5! px-4 pt-3"
|
|
103
|
+
className: "mb-list-height-title-bottom px-list-side-title",
|
|
104
|
+
leadingIcon: !hideSearchIcon ? /* @__PURE__ */ jsx(SearchIcon, { className: "size-6" }) : void 0
|
|
100
105
|
}), /* @__PURE__ */ jsx(SelectListBox, {
|
|
101
106
|
...props,
|
|
102
107
|
autoFocus: !isSearchable,
|
|
@@ -108,4 +113,5 @@ const SelectMobile = ({ ref, error, showSelectionContent, inputClassName, contai
|
|
|
108
113
|
})
|
|
109
114
|
});
|
|
110
115
|
};
|
|
116
|
+
//#endregion
|
|
111
117
|
export { SelectMobile };
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { useSelectItems } from "./useSelectItems.js";
|
|
2
2
|
import { useDebounceCallback } from "../../../../hooks/useDebounceCallback.js";
|
|
3
3
|
import { jsx } from "react/jsx-runtime";
|
|
4
4
|
import { createContext, use, useCallback, useEffect, useMemo, useRef, useState } from "react";
|
|
5
|
-
|
|
5
|
+
//#region src/components/inputs/Selection/shared/select.context.tsx
|
|
6
|
+
var SelectContext;
|
|
6
7
|
(function(_SelectContext) {
|
|
7
8
|
const Context = createContext({});
|
|
8
9
|
const defaultMapInitialToSelectItem = (item) => ({
|
|
@@ -45,10 +46,10 @@ let SelectContext;
|
|
|
45
46
|
});
|
|
46
47
|
const selectedItems = useMemo(() => allItems.filter(({ id }) => Array.isArray(fieldState.value) ? fieldState.value.includes(id) : id === fieldState.value), [allItems, fieldState.value]);
|
|
47
48
|
const selectedIds = useMemo(() => selectedItems.map(({ id }) => id), [selectedItems]);
|
|
48
|
-
const getItem = useCallback((value
|
|
49
|
-
const updateValue = useCallback((value
|
|
50
|
-
if (Array.isArray(value
|
|
51
|
-
else valueRef.current = getItem(value
|
|
49
|
+
const getItem = useCallback((value) => allItems.find((item) => item && item.id === value) ?? null, [allItems]);
|
|
50
|
+
const updateValue = useCallback((value) => {
|
|
51
|
+
if (Array.isArray(value)) valueRef.current = value.map((id) => getItem(id)).filter((item) => item !== null);
|
|
52
|
+
else valueRef.current = getItem(value);
|
|
52
53
|
}, [getItem]);
|
|
53
54
|
const getValueIds = () => Array.isArray(valueRef.current) ? valueRef.current.map(({ id }) => id) : valueRef.current?.id ?? null;
|
|
54
55
|
const emitStateChanges = useCallback((changes, skipSelectionChange) => {
|
|
@@ -67,10 +68,10 @@ let SelectContext;
|
|
|
67
68
|
onSearchChangeDebounced,
|
|
68
69
|
updateValue
|
|
69
70
|
]);
|
|
70
|
-
const syncFieldState = (value
|
|
71
|
+
const syncFieldState = (value) => {
|
|
71
72
|
const newFieldState = {
|
|
72
|
-
value
|
|
73
|
-
inputValue: isMultiple || Array.isArray(value
|
|
73
|
+
value,
|
|
74
|
+
inputValue: isMultiple || Array.isArray(value) ? fieldState.inputValue : getItem(value)?.label ?? "",
|
|
74
75
|
searchValue: ""
|
|
75
76
|
};
|
|
76
77
|
setFieldState(newFieldState);
|
|
@@ -78,9 +79,9 @@ let SelectContext;
|
|
|
78
79
|
if (!isMultiple) setShowAll(true);
|
|
79
80
|
};
|
|
80
81
|
useEffect(() => {
|
|
81
|
-
const value
|
|
82
|
-
if (JSON.stringify(value
|
|
83
|
-
else updateValue(value
|
|
82
|
+
const value = props.value ?? null;
|
|
83
|
+
if (JSON.stringify(value) !== JSON.stringify(fieldState.value)) syncFieldState(value);
|
|
84
|
+
else updateValue(value);
|
|
84
85
|
}, [props.value]);
|
|
85
86
|
useEffect(() => {
|
|
86
87
|
if (!isMultiple && fieldState.value && fieldState.inputValue === "" && getItem(fieldState.value)?.label) syncFieldState(fieldState.value);
|
|
@@ -100,12 +101,12 @@ let SelectContext;
|
|
|
100
101
|
fieldState.value,
|
|
101
102
|
isMultiple
|
|
102
103
|
]);
|
|
103
|
-
const onChange = useCallback((value
|
|
104
|
-
if (value
|
|
104
|
+
const onChange = useCallback((value) => {
|
|
105
|
+
if (value === "new-item-id") onNewItemOption?.(fieldState.inputValue);
|
|
105
106
|
else {
|
|
106
107
|
const newFieldState = {
|
|
107
|
-
value
|
|
108
|
-
inputValue: isMultiple || Array.isArray(value
|
|
108
|
+
value,
|
|
109
|
+
inputValue: isMultiple || Array.isArray(value) ? "" : getItem(value)?.label ?? "",
|
|
109
110
|
searchValue: ""
|
|
110
111
|
};
|
|
111
112
|
setFieldState(newFieldState);
|
|
@@ -136,8 +137,8 @@ let SelectContext;
|
|
|
136
137
|
const onSelectAll = useCallback(() => {
|
|
137
138
|
onChange(selectableListItems.map(({ id }) => id));
|
|
138
139
|
}, [selectableListItems, onChange]);
|
|
139
|
-
const onRemove = useCallback((value
|
|
140
|
-
if (isMultiple && Array.isArray(fieldState.value)) onChange(fieldState.value.filter((id) => id !== value
|
|
140
|
+
const onRemove = useCallback((value) => {
|
|
141
|
+
if (isMultiple && Array.isArray(fieldState.value)) onChange(fieldState.value.filter((id) => id !== value));
|
|
141
142
|
}, [
|
|
142
143
|
isMultiple,
|
|
143
144
|
fieldState.value,
|
|
@@ -187,4 +188,5 @@ let SelectContext;
|
|
|
187
188
|
return use(Context);
|
|
188
189
|
};
|
|
189
190
|
})(SelectContext || (SelectContext = {}));
|
|
191
|
+
//#endregion
|
|
190
192
|
export { SelectContext };
|
|
@@ -1,24 +1,25 @@
|
|
|
1
1
|
import { useMemo } from "react";
|
|
2
2
|
import { useFilter } from "react-aria-components";
|
|
3
|
-
|
|
3
|
+
//#region src/components/inputs/Selection/shared/useSelectItems.tsx
|
|
4
|
+
var SelectAllItemId = "all-item-id";
|
|
4
5
|
var SelectAllItem = (inputValue) => ({
|
|
5
6
|
id: SelectAllItemId,
|
|
6
7
|
label: inputValue,
|
|
7
8
|
isSelectAllItem: true
|
|
8
9
|
});
|
|
9
|
-
|
|
10
|
+
var NewItemId = "new-item-id";
|
|
10
11
|
var NewItem = (inputValue) => ({
|
|
11
12
|
id: NewItemId,
|
|
12
13
|
label: inputValue,
|
|
13
14
|
isNewItem: true
|
|
14
15
|
});
|
|
15
|
-
|
|
16
|
+
var LoadingItemId = "loading-item-id";
|
|
16
17
|
var LoadingItem = (inputValue) => ({
|
|
17
18
|
id: LoadingItemId,
|
|
18
19
|
label: inputValue,
|
|
19
20
|
isLoadingItem: true
|
|
20
21
|
});
|
|
21
|
-
|
|
22
|
+
var ReservedItemIds = [
|
|
22
23
|
SelectAllItemId,
|
|
23
24
|
NewItemId,
|
|
24
25
|
LoadingItemId
|
|
@@ -79,4 +80,5 @@ function useSelectItems({ initialSelectedItems, selectedItems, cachedItems, inpu
|
|
|
79
80
|
selectableListItems: useMemo(() => listItems.filter((item) => !item.isDisabled && !ReservedItemIds.includes(String(item.id))), [listItems])
|
|
80
81
|
};
|
|
81
82
|
}
|
|
83
|
+
//#endregion
|
|
82
84
|
export { NewItemId, SelectAllItemId, useSelectItems };
|
|
@@ -7,6 +7,7 @@ import { clsx } from "clsx";
|
|
|
7
7
|
import { Slider, SliderThumb, SliderTrack } from "react-aria-components";
|
|
8
8
|
import { mergeRefs } from "@react-aria/utils";
|
|
9
9
|
import { Controller } from "react-hook-form";
|
|
10
|
+
//#region src/components/inputs/Slider/Slider.tsx
|
|
10
11
|
var SliderBase = (props) => {
|
|
11
12
|
const ui = UIConfig.useConfig();
|
|
12
13
|
const { label, tooltipText, helperText, isRequired, rightContent, isDisabled, headerClassName, errorClassName, isHeaderHidden, error, unit, hideLabel = ui.input.hideLabel, minValue = ui.slider.minValue, maxValue = ui.slider.maxValue, ...rest } = props;
|
|
@@ -72,7 +73,7 @@ var SliderBase = (props) => {
|
|
|
72
73
|
})
|
|
73
74
|
});
|
|
74
75
|
};
|
|
75
|
-
|
|
76
|
+
var Slider$1 = (props) => {
|
|
76
77
|
if ("formControl" in props && props.formControl) {
|
|
77
78
|
const { formControl, ref, ...innerProps } = props;
|
|
78
79
|
return /* @__PURE__ */ jsx(Controller, {
|
|
@@ -90,4 +91,5 @@ const Slider$1 = (props) => {
|
|
|
90
91
|
}
|
|
91
92
|
return /* @__PURE__ */ jsx(SliderBase, { ...props });
|
|
92
93
|
};
|
|
94
|
+
//#endregion
|
|
93
95
|
export { Slider$1 as Slider };
|
|
@@ -20,6 +20,7 @@ import { TextStyle } from "@tiptap/extension-text-style";
|
|
|
20
20
|
import { Underline } from "@tiptap/extension-underline";
|
|
21
21
|
import { EditorContent, useEditor } from "@tiptap/react";
|
|
22
22
|
import { StarterKit } from "@tiptap/starter-kit";
|
|
23
|
+
//#region src/components/inputs/TextEditor/TextEditor.tsx
|
|
23
24
|
var extensions = [
|
|
24
25
|
StarterKit.configure({ heading: { levels: [
|
|
25
26
|
1,
|
|
@@ -129,7 +130,7 @@ var TextEditorBase = ({ ref, as = "default", placeholder, label, hideLabel, tool
|
|
|
129
130
|
})
|
|
130
131
|
});
|
|
131
132
|
};
|
|
132
|
-
|
|
133
|
+
var TextEditor = (props) => {
|
|
133
134
|
if ("formControl" in props && props.formControl) {
|
|
134
135
|
const { formControl, ref, ...innerProps } = props;
|
|
135
136
|
return /* @__PURE__ */ jsx(Controller, {
|
|
@@ -147,4 +148,5 @@ const TextEditor = (props) => {
|
|
|
147
148
|
}
|
|
148
149
|
return /* @__PURE__ */ jsx(TextEditorBase, { ...props });
|
|
149
150
|
};
|
|
151
|
+
//#endregion
|
|
150
152
|
export { TextEditor };
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { jsx } from "react/jsx-runtime";
|
|
2
2
|
import { clsx } from "clsx";
|
|
3
3
|
import { ColorSwatch, ColorSwatchPicker, ColorSwatchPickerItem } from "react-aria-components";
|
|
4
|
-
|
|
4
|
+
//#region src/components/inputs/TextEditor/Toolbar/ColorPicker.tsx
|
|
5
|
+
var ColorPicker = ({ colors, value, onChange }) => {
|
|
5
6
|
return /* @__PURE__ */ jsx(ColorSwatchPicker, {
|
|
6
7
|
value,
|
|
7
8
|
onChange: (color) => onChange(color.toString("hex")),
|
|
@@ -13,4 +14,5 @@ const ColorPicker = ({ colors, value, onChange }) => {
|
|
|
13
14
|
}, color))
|
|
14
15
|
});
|
|
15
16
|
};
|
|
17
|
+
//#endregion
|
|
16
18
|
export { ColorPicker };
|
|
@@ -8,7 +8,8 @@ import { jsx, jsxs } from "react/jsx-runtime";
|
|
|
8
8
|
import { clsx } from "clsx";
|
|
9
9
|
import { useState } from "react";
|
|
10
10
|
import { Button, Dialog, DialogTrigger, Popover } from "react-aria-components";
|
|
11
|
-
|
|
11
|
+
//#region src/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.tsx
|
|
12
|
+
var ColorPickerDropdown = ({ colors, value, onChange, isDisabled, children }) => {
|
|
12
13
|
const inputCva = useInputCva();
|
|
13
14
|
const popoverCva = UIStyle.useCva("popover.cva", popover);
|
|
14
15
|
const [isOpen, setIsOpen] = useState(false);
|
|
@@ -51,4 +52,5 @@ const ColorPickerDropdown = ({ colors, value, onChange, isDisabled, children })
|
|
|
51
52
|
})]
|
|
52
53
|
});
|
|
53
54
|
};
|
|
55
|
+
//#endregion
|
|
54
56
|
export { ColorPickerDropdown };
|
|
@@ -1,14 +1,15 @@
|
|
|
1
1
|
import { LinkIcon } from "../../../../assets/icons/Link.js";
|
|
2
2
|
import { Button } from "../../../buttons/Button/Button.js";
|
|
3
3
|
import { InlineIconButton } from "../../../buttons/InlineIconButton/InlineIconButton.js";
|
|
4
|
-
import
|
|
4
|
+
import "../../../../config/i18n.js";
|
|
5
5
|
import { TextInput } from "../../Input/TextInput/TextInput.js";
|
|
6
6
|
import { ResponsivePopover } from "../../../overlays/ResponsivePopover/ResponsivePopover.js";
|
|
7
7
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
8
8
|
import { clsx } from "clsx";
|
|
9
9
|
import { useEffect, useState } from "react";
|
|
10
10
|
import { useTranslation } from "react-i18next";
|
|
11
|
-
|
|
11
|
+
//#region src/components/inputs/TextEditor/Toolbar/HyperlinkAction.tsx
|
|
12
|
+
var HyperlinkAction = ({ editor }) => {
|
|
12
13
|
const { t } = useTranslation("ui");
|
|
13
14
|
const [isOpen, setIsOpen] = useState(false);
|
|
14
15
|
const [url, setUrl] = useState("");
|
|
@@ -67,4 +68,5 @@ const HyperlinkAction = ({ editor }) => {
|
|
|
67
68
|
})]
|
|
68
69
|
});
|
|
69
70
|
};
|
|
71
|
+
//#endregion
|
|
70
72
|
export { HyperlinkAction };
|
|
@@ -2,11 +2,12 @@ import { AlignCenterIcon } from "../../../../assets/icons/AlignCenter.js";
|
|
|
2
2
|
import { AlignLeftIcon } from "../../../../assets/icons/AlignLeft.js";
|
|
3
3
|
import { AlignLeftRightIcon } from "../../../../assets/icons/AlignLeftRight.js";
|
|
4
4
|
import { AlignRightIcon } from "../../../../assets/icons/AlignRight.js";
|
|
5
|
-
import
|
|
5
|
+
import "../../../../config/i18n.js";
|
|
6
6
|
import { Select } from "../../Selection/Select/Select.js";
|
|
7
7
|
import { jsx } from "react/jsx-runtime";
|
|
8
8
|
import { useTranslation } from "react-i18next";
|
|
9
|
-
|
|
9
|
+
//#region src/components/inputs/TextEditor/Toolbar/TextAlignSelect.tsx
|
|
10
|
+
var TextAlignSelect = ({ editor }) => {
|
|
10
11
|
const { t } = useTranslation("ui");
|
|
11
12
|
if (!!!editor.extensionManager.extensions.find((extension) => extension.name === "textAlign")) return null;
|
|
12
13
|
const onChange = (val) => {
|
|
@@ -41,4 +42,5 @@ const TextAlignSelect = ({ editor }) => {
|
|
|
41
42
|
isDisabled: !editor.isEditable
|
|
42
43
|
});
|
|
43
44
|
};
|
|
45
|
+
//#endregion
|
|
44
46
|
export { TextAlignSelect };
|