@povio/ui 3.1.0 → 3.2.0
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 +26 -11
- package/dist/assets/icons/AlignLeft.js +26 -11
- package/dist/assets/icons/AlignLeftRight.js +26 -11
- package/dist/assets/icons/AlignRight.js +26 -11
- package/dist/assets/icons/ArrowDropDown.js +26 -11
- package/dist/assets/icons/ArrowDropUp.js +26 -11
- package/dist/assets/icons/ArrowLeft.js +26 -11
- package/dist/assets/icons/ArrowRight.js +26 -11
- package/dist/assets/icons/Bold.js +26 -11
- package/dist/assets/icons/BulletedList.js +26 -11
- package/dist/assets/icons/Calendar.js +28 -13
- package/dist/assets/icons/Check.js +28 -13
- package/dist/assets/icons/CheckCircle.js +26 -11
- package/dist/assets/icons/CheckboxCheckmark.js +29 -14
- package/dist/assets/icons/CheckboxIndeterminate.js +29 -14
- package/dist/assets/icons/ChevronDown.js +28 -13
- package/dist/assets/icons/ChevronLeft.js +28 -13
- package/dist/assets/icons/ChevronRight.js +28 -13
- package/dist/assets/icons/ChevronUp.js +28 -13
- package/dist/assets/icons/ChevronsLeft.js +28 -13
- package/dist/assets/icons/ChevronsRight.js +28 -13
- package/dist/assets/icons/Clock.js +26 -11
- package/dist/assets/icons/Close.js +26 -11
- package/dist/assets/icons/DateTime.js +35 -14
- package/dist/assets/icons/DragIndicator.js +26 -11
- package/dist/assets/icons/File.js +28 -13
- package/dist/assets/icons/Highlight.js +26 -11
- package/dist/assets/icons/HighlightOn.js +49 -15
- package/dist/assets/icons/Home.js +26 -11
- package/dist/assets/icons/Info.js +37 -16
- package/dist/assets/icons/Italic.js +26 -11
- package/dist/assets/icons/Link.js +26 -11
- package/dist/assets/icons/Menu.js +26 -11
- package/dist/assets/icons/NumberedList.js +26 -11
- package/dist/assets/icons/PointerHorizontal.js +26 -11
- package/dist/assets/icons/PointerVertical.js +26 -11
- package/dist/assets/icons/Search.js +26 -11
- package/dist/assets/icons/Send.js +28 -13
- package/dist/assets/icons/Strikethrough.js +26 -11
- package/dist/assets/icons/TextColor.js +48 -14
- package/dist/assets/icons/Today.js +26 -11
- package/dist/assets/icons/Underlined.js +28 -13
- package/dist/assets/icons/Upload.js +35 -14
- package/dist/assets/icons/Visibility.js +26 -11
- package/dist/assets/icons/VisibilityOff.js +26 -11
- package/dist/assets/icons/WarningFilled.js +28 -13
- package/dist/components/Breadcrumbs/Breadcrumbs.js +207 -56
- package/dist/components/Menu/Menu.js +18 -2
- package/dist/components/Menu/MenuDesktop.js +41 -7
- package/dist/components/Menu/MenuItem.js +32 -9
- package/dist/components/Menu/MenuMobile.js +102 -39
- package/dist/components/Menu/MenuPopover.js +105 -29
- package/dist/components/buttons/Button/button.cva.d.ts +3 -3
- package/dist/components/buttons/IconButton/IconButton.js +40 -8
- package/dist/components/buttons/InlineIconButton/InlineIconButton.d.ts +2 -1
- package/dist/components/buttons/InlineIconButton/InlineIconButton.js +34 -9
- package/dist/components/buttons/PillButton/PillButton.js +55 -17
- package/dist/components/buttons/PillButton/pillButton.cva.d.ts +1 -1
- package/dist/components/buttons/SplitButton/SplitButton.js +103 -18
- package/dist/components/buttons/TextButton/TextButton.js +30 -8
- package/dist/components/buttons/ToggleButton/ToggleButton.js +28 -8
- package/dist/components/buttons/shared/ButtonContent.js +80 -22
- package/dist/components/inputs/Checkbox/Checkbox.d.ts +1 -0
- package/dist/components/inputs/Checkbox/Checkbox.js +201 -35
- package/dist/components/inputs/Checkbox/CheckboxCheckmark.js +24 -10
- package/dist/components/inputs/Checkbox/checkbox.cva.d.ts +3 -0
- package/dist/components/inputs/Checkbox/checkbox.cva.js +2 -1
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DatePicker/DatePicker.js +380 -75
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.d.ts +12 -5
- package/dist/components/inputs/DateTime/DateRangePicker/DateRangePicker.js +499 -186
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.d.ts +14 -5
- package/dist/components/inputs/DateTime/DateTimePicker/DateTimePicker.js +280 -46
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.d.ts +7 -3
- package/dist/components/inputs/DateTime/TimePicker/TimePicker.js +616 -121
- package/dist/components/inputs/DateTime/shared/Calendar.d.ts +5 -2
- package/dist/components/inputs/DateTime/shared/Calendar.js +342 -119
- package/dist/components/inputs/DateTime/shared/CalendarCell.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarCell.js +310 -103
- package/dist/components/inputs/DateTime/shared/CalendarGrid.d.ts +4 -2
- package/dist/components/inputs/DateTime/shared/CalendarGrid.js +150 -33
- package/dist/components/inputs/DateTime/shared/CalendarHeader.js +233 -98
- package/dist/components/inputs/DateTime/shared/CalendarSelectHeader.js +318 -137
- package/dist/components/inputs/DateTime/shared/DateField.d.ts +2 -1
- package/dist/components/inputs/DateTime/shared/DateField.js +288 -112
- package/dist/components/inputs/DateTime/shared/DatePickerInput.d.ts +14 -3
- package/dist/components/inputs/DateTime/shared/DatePickerInput.js +359 -129
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.d.ts +18 -1
- package/dist/components/inputs/DateTime/shared/DateSegmentItem.js +104 -11
- package/dist/components/inputs/DateTime/shared/DateTimeDialog.js +83 -28
- package/dist/components/inputs/DateTime/shared/DateTimeDialogFooter.js +59 -10
- package/dist/components/inputs/DateTime/shared/MonthPicker.js +103 -58
- package/dist/components/inputs/DateTime/shared/RangeCalendar.js +193 -82
- package/dist/components/inputs/DateTime/shared/TimeField.js +27 -8
- package/dist/components/inputs/DateTime/shared/TimePickerForm.js +279 -110
- package/dist/components/inputs/DateTime/shared/TimePickerInput.d.ts +4 -1
- package/dist/components/inputs/DateTime/shared/TimePickerInput.js +211 -65
- package/dist/components/inputs/DateTime/shared/YearPicker.js +119 -68
- package/dist/components/inputs/DateTime/shared/datePicker.types.d.ts +5 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.d.ts +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerInput.cva.js +16 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.d.ts +15 -0
- package/dist/components/inputs/DateTime/shared/datePickerTodayIcon.js +32 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.d.ts +2 -0
- package/dist/components/inputs/DateTime/shared/dateSegment.utils.spec.d.ts +1 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.d.ts +41 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.js +99 -0
- package/dist/components/inputs/DateTime/shared/staticDateTimeSegments.spec.d.ts +1 -0
- package/dist/components/inputs/File/FileUpload.js +91 -46
- package/dist/components/inputs/File/FileUploadContainer.js +15 -7
- package/dist/components/inputs/File/InputUpload.js +317 -79
- package/dist/components/inputs/File/index.d.ts +1 -1
- package/dist/components/inputs/File/shared/FileCard.js +104 -41
- package/dist/components/inputs/File/shared/FileCardList.js +47 -12
- package/dist/components/inputs/File/shared/FileUploadContent.js +175 -44
- package/dist/components/inputs/File/shared/FileUploadContentEmpty.js +149 -46
- package/dist/components/inputs/File/shared/FileUploadContentError.js +234 -93
- package/dist/components/inputs/File/shared/FileUploadContentFilled.js +230 -97
- package/dist/components/inputs/File/shared/FileUploadContentLoading.js +199 -55
- package/dist/components/inputs/File/shared/InputUploadContent.js +148 -34
- package/dist/components/inputs/File/shared/InputUploadFilled.js +49 -8
- package/dist/components/inputs/File/shared/ProgressBar.js +102 -15
- package/dist/components/inputs/File/shared/fileUpload.cva.d.ts +0 -11
- package/dist/components/inputs/File/shared/fileUpload.cva.js +1 -18
- package/dist/components/inputs/FormField/FormField.d.ts +3 -3
- package/dist/components/inputs/FormField/FormField.js +119 -37
- package/dist/components/inputs/FormField/FormFieldError.js +25 -5
- package/dist/components/inputs/FormField/FormFieldHeader.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldHeader.js +81 -22
- package/dist/components/inputs/FormField/FormFieldHeaderClose.js +31 -7
- package/dist/components/inputs/FormField/FormFieldHelper.js +26 -6
- package/dist/components/inputs/FormField/FormFieldLabel.d.ts +2 -2
- package/dist/components/inputs/FormField/FormFieldLabel.js +40 -9
- package/dist/components/inputs/FormField/formFieldHeader.cva.d.ts +13 -0
- package/dist/components/inputs/FormField/formFieldHeader.cva.js +14 -0
- package/dist/components/inputs/Input/NumberInput/NumberInput.d.ts +5 -2
- package/dist/components/inputs/Input/NumberInput/NumberInput.js +446 -97
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.d.ts +45 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeField.js +571 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.d.ts +35 -0
- package/dist/components/inputs/Input/NumberRangeInput/NumberRangeInput.js +574 -0
- package/dist/components/inputs/Input/PasswordInput/PasswordInput.js +48 -9
- package/dist/components/inputs/Input/TextArea/TextArea.cva.d.ts +8 -0
- package/dist/components/inputs/Input/TextArea/TextArea.cva.js +5 -0
- package/dist/components/inputs/Input/TextArea/TextArea.js +305 -90
- package/dist/components/inputs/Input/TextInput/TextInput.d.ts +3 -1
- package/dist/components/inputs/Input/TextInput/TextInput.js +429 -90
- package/dist/components/inputs/Input/shared/InputContent.js +193 -59
- package/dist/components/inputs/Input/shared/numberStatic.utils.d.ts +1 -0
- package/dist/components/inputs/Input/shared/numberStatic.utils.js +7 -0
- package/dist/components/inputs/Inputs/Form.js +40 -11
- package/dist/components/inputs/Inputs/InputItem.d.ts +15 -21
- package/dist/components/inputs/Inputs/InputItem.js +69 -14
- package/dist/components/inputs/Inputs/Inputs.js +37 -11
- package/dist/components/inputs/RadioGroup/RadioGroup.d.ts +3 -1
- package/dist/components/inputs/RadioGroup/RadioGroup.js +353 -61
- package/dist/components/inputs/RadioGroup/radio.cva.d.ts +45 -0
- package/dist/components/inputs/RadioGroup/radio.cva.js +48 -1
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.d.ts +6 -2
- package/dist/components/inputs/Selection/Autocomplete/Autocomplete.js +217 -22
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.d.ts +3 -18
- package/dist/components/inputs/Selection/Autocomplete/QueryAutocomplete.js +107 -8
- package/dist/components/inputs/Selection/Autocomplete/queryAutocomplete.types.d.ts +37 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.d.ts +14 -0
- package/dist/components/inputs/Selection/Select/QuerySelect.js +178 -0
- package/dist/components/inputs/Selection/Select/Select.d.ts +7 -3
- package/dist/components/inputs/Selection/Select/Select.js +227 -18
- package/dist/components/inputs/Selection/shared/SelectBase.d.ts +8 -1
- package/dist/components/inputs/Selection/shared/SelectBase.js +69 -18
- package/dist/components/inputs/Selection/shared/SelectDesktop.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectDesktop.js +393 -138
- package/dist/components/inputs/Selection/shared/SelectInput.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectInput.js +397 -116
- package/dist/components/inputs/Selection/shared/SelectInputTags.js +99 -25
- package/dist/components/inputs/Selection/shared/SelectListBox.d.ts +2 -2
- package/dist/components/inputs/Selection/shared/SelectListBox.js +164 -52
- package/dist/components/inputs/Selection/shared/SelectListBoxItem.js +85 -35
- package/dist/components/inputs/Selection/shared/SelectListBoxItemSelectAll.js +69 -16
- package/dist/components/inputs/Selection/shared/SelectListBoxLoadingItem.js +70 -21
- package/dist/components/inputs/Selection/shared/SelectListBoxSelectionBar.js +58 -9
- package/dist/components/inputs/Selection/shared/SelectMobile.d.ts +1 -1
- package/dist/components/inputs/Selection/shared/SelectMobile.js +9 -3
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.d.ts +9 -0
- package/dist/components/inputs/Selection/shared/StaticSelectTrailingContent.js +47 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.d.ts +14 -0
- package/dist/components/inputs/Selection/shared/querySelect.utils.js +43 -0
- package/dist/components/inputs/Selection/shared/select.context.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/select.context.js +67 -36
- package/dist/components/inputs/Selection/shared/select.types.d.ts +3 -2
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.d.ts +6 -0
- package/dist/components/inputs/Selection/shared/selectDesktop.cva.js +5 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.d.ts +12 -0
- package/dist/components/inputs/Selection/shared/selectInput.cva.js +8 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.d.ts +23 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.js +54 -0
- package/dist/components/inputs/Selection/shared/staticSelect.utils.spec.d.ts +1 -0
- package/dist/components/inputs/Selection/shared/useSelectItems.js +109 -49
- package/dist/components/inputs/Skeleton/InputFrame.d.ts +83 -0
- package/dist/components/inputs/Skeleton/InputFrame.js +612 -0
- package/dist/components/inputs/Slider/Slider.d.ts +2 -1
- package/dist/components/inputs/Slider/Slider.js +265 -76
- package/dist/components/inputs/TextEditor/TextEditor.d.ts +1 -0
- package/dist/components/inputs/TextEditor/TextEditor.js +447 -98
- package/dist/components/inputs/TextEditor/Toolbar/ColorPicker.js +37 -11
- package/dist/components/inputs/TextEditor/Toolbar/ColorPickerDropdown.js +102 -30
- package/dist/components/inputs/TextEditor/Toolbar/HyperlinkAction.js +194 -45
- package/dist/components/inputs/TextEditor/Toolbar/TextAlignSelect.js +88 -28
- package/dist/components/inputs/TextEditor/Toolbar/TextColorSelect.js +48 -14
- package/dist/components/inputs/TextEditor/Toolbar/TextEditorToolbar.js +66 -19
- package/dist/components/inputs/TextEditor/Toolbar/TextHighlightSelect.js +49 -15
- package/dist/components/inputs/TextEditor/Toolbar/TextListActions.js +92 -32
- package/dist/components/inputs/TextEditor/Toolbar/TextMarksActions.js +126 -54
- package/dist/components/inputs/TextEditor/Toolbar/TextStyleSelect.js +141 -38
- package/dist/components/inputs/Toggle/Toggle.d.ts +1 -0
- package/dist/components/inputs/Toggle/Toggle.js +214 -37
- package/dist/components/inputs/Toggle/toggle.cva.d.ts +3 -0
- package/dist/components/inputs/Toggle/toggle.cva.js +2 -1
- package/dist/components/inputs/shared/CheckContent.d.ts +2 -1
- package/dist/components/inputs/shared/CheckContent.js +21 -11
- package/dist/components/inputs/shared/InputClear.d.ts +2 -1
- package/dist/components/inputs/shared/InputClear.js +88 -12
- package/dist/components/inputs/shared/TooltipWrapper.js +50 -11
- package/dist/components/inputs/shared/input.cva.d.ts +28 -0
- package/dist/components/inputs/shared/input.cva.js +38 -4
- package/dist/components/inputs/shared/tooltipWrapper.cva.d.ts +8 -0
- package/dist/components/inputs/shared/tooltipWrapper.cva.js +5 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.d.ts +15 -0
- package/dist/components/inputs/shared/useStaticInputHandoff.js +112 -0
- package/dist/components/navigation/Accordion/Accordion.js +69 -22
- package/dist/components/navigation/Accordion/AccordionItem.js +86 -41
- package/dist/components/navigation/Stepper/Stepper.js +67 -22
- package/dist/components/navigation/Stepper/StepperItem.js +104 -31
- package/dist/components/navigation/Stepper/StepperSeparator.js +23 -5
- package/dist/components/overlays/ActionModal/ActionModal.js +169 -35
- package/dist/components/overlays/BottomSheet/BottomSheet.js +96 -23
- package/dist/components/overlays/BottomSheet/BottomSheetHeader.js +48 -8
- package/dist/components/overlays/Drawer/Drawer.js +62 -20
- package/dist/components/overlays/ResponsivePopover/ResponsivePopover.js +85 -28
- package/dist/components/overlays/Tooltip/Tooltip.js +137 -28
- package/dist/components/overlays/Tooltip/TooltipEllipsis.js +37 -12
- package/dist/components/segment/Segment.js +218 -57
- package/dist/components/segment/SegmentItem.js +67 -10
- package/dist/components/shared/pagination/Pagination.js +108 -22
- package/dist/components/shared/pagination/PaginationList.js +167 -64
- package/dist/components/shared/pagination/minWidth.cva.d.ts +1 -1
- package/dist/components/status/Alert/Alert.js +97 -30
- package/dist/components/status/Loader/Loader.js +77 -22
- package/dist/components/status/Toast/Toast.js +28 -14
- package/dist/components/status/Toast/toast.cva.d.ts +1 -1
- package/dist/components/status/Toast/useToast.js +62 -57
- package/dist/components/table/ColumnConfig.js +158 -54
- package/dist/components/table/InfiniteTable.js +67 -16
- package/dist/components/table/PaginatedTable.js +84 -18
- package/dist/components/table/Table.js +28 -27
- package/dist/components/text/Link/Link.js +19 -7
- package/dist/components/text/Typography/Typography.js +23 -8
- package/dist/config/confirmation.context.js +1 -1
- package/dist/config/link.context.js +23 -9
- package/dist/config/router.context.js +42 -16
- package/dist/config/theme.context.js +98 -45
- package/dist/config/uiConfig.context.d.ts +20 -6
- package/dist/config/uiConfig.context.js +68 -14
- package/dist/config/uiOverrides.context.d.ts +30 -11
- package/dist/config/uiOverrides.context.js +54 -14
- package/dist/helpers/dynamicInputs.d.ts +12 -9
- package/dist/helpers/dynamicInputs.js +13 -8
- package/dist/hooks/useAutosave.d.ts +2 -1
- package/dist/hooks/useAutosave.js +12 -4
- package/dist/hooks/useAutosave.spec.d.ts +1 -0
- package/dist/hooks/useBreakpoint.js +16 -3
- package/dist/hooks/useDebounceCallback.js +51 -17
- package/dist/hooks/useFilters.js +125 -64
- package/dist/hooks/useForm.js +42 -8
- package/dist/hooks/useFormAutosave.d.ts +3 -1
- package/dist/hooks/useFormAutosave.js +122 -30
- package/dist/hooks/useFormAutosave.spec.d.ts +1 -0
- package/dist/hooks/useIntersectionObserver.d.ts +1 -1
- package/dist/hooks/useIntersectionObserver.js +91 -24
- package/dist/hooks/useKeyInteractions.d.ts +20 -0
- package/dist/hooks/useKeyInteractions.js +54 -0
- package/dist/hooks/useKeyInteractions.spec.d.ts +1 -0
- package/dist/hooks/useLocalStorage.js +43 -10
- package/dist/hooks/useLongPressRepeat.js +55 -20
- package/dist/hooks/usePagination.js +49 -19
- package/dist/hooks/useQueryAutocomplete.d.ts +14 -0
- package/dist/hooks/useQueryAutocomplete.js +72 -0
- package/dist/hooks/useScrollableListBox.js +37 -16
- package/dist/hooks/useSorting.js +69 -28
- package/dist/hooks/useStateAndRef.js +21 -7
- package/dist/hooks/useTableColumnConfig.js +124 -31
- package/dist/hooks/useTranslationMemo.js +25 -5
- package/dist/index.d.ts +18 -3
- package/dist/index.js +15 -5
- package/dist/tw-ui-plugin.js +6 -0
- package/dist/utils/date-time.utils.d.ts +38 -10
- package/dist/utils/date-time.utils.js +136 -22
- package/dist/utils/query.utils.d.ts +4 -0
- package/dist/utils/query.utils.js +8 -0
- package/dist/utils/zod.utils.d.ts +2 -0
- package/dist/utils/zod.utils.js +5 -0
- package/package.json +2 -2
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
"use no memo";
|
|
1
2
|
import { ChevronDownIcon } from "../../assets/icons/ChevronDown.js";
|
|
2
3
|
import { ChevronUpIcon } from "../../assets/icons/ChevronUp.js";
|
|
3
4
|
import { UIOverrides } from "../../config/uiOverrides.context.js";
|
|
@@ -26,8 +27,8 @@ var CustomCellContext = (context) => {
|
|
|
26
27
|
value: context.getValue()
|
|
27
28
|
};
|
|
28
29
|
};
|
|
29
|
-
var
|
|
30
|
-
const rendered =
|
|
30
|
+
var renderCell = (Comp, props) => {
|
|
31
|
+
const rendered = flexRender(Comp, props);
|
|
31
32
|
return typeof rendered === "string" ? /* @__PURE__ */ jsx(CellText, { children: rendered }) : rendered;
|
|
32
33
|
};
|
|
33
34
|
var RowDragHandleCell = ({ rowId }) => {
|
|
@@ -68,7 +69,7 @@ var DraggableRow = ({ row, showCellBorder, onRowClick, onDoubleClick, tableRowCv
|
|
|
68
69
|
return /* @__PURE__ */ jsx("td", {
|
|
69
70
|
tabIndex: -1,
|
|
70
71
|
className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta.cellClass, columnMeta.width),
|
|
71
|
-
children:
|
|
72
|
+
children: renderCell(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
|
|
72
73
|
}, cell.id);
|
|
73
74
|
})
|
|
74
75
|
});
|
|
@@ -155,8 +156,8 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
155
156
|
if (!active || !over || active.id === over.id) return;
|
|
156
157
|
if (getRowId && (onReorder || onDragEnd)) {
|
|
157
158
|
if (onReorder) {
|
|
158
|
-
const oldIndex = items.findIndex((
|
|
159
|
-
const newIndex = items.findIndex((
|
|
159
|
+
const oldIndex = items.findIndex((item_0) => getRowId(item_0) === active.id);
|
|
160
|
+
const newIndex = items.findIndex((item_1) => getRowId(item_1) === over.id);
|
|
160
161
|
if (oldIndex !== -1 && newIndex !== -1) onReorder(arrayMove(items, oldIndex, newIndex));
|
|
161
162
|
}
|
|
162
163
|
onDragEnd?.(event);
|
|
@@ -186,18 +187,18 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
186
187
|
children: headerGroup.headers.filter((header) => {
|
|
187
188
|
if (isAnyRowSelected && header.index > 0) return false;
|
|
188
189
|
return header.column.getIsVisible();
|
|
189
|
-
}).map((
|
|
190
|
-
const columnMeta =
|
|
190
|
+
}).map((header_0, index) => {
|
|
191
|
+
const columnMeta = header_0.column.columnDef.meta ?? {};
|
|
191
192
|
return /* @__PURE__ */ jsx("th", {
|
|
192
|
-
colSpan: isAnyRowSelected ? columnCount :
|
|
193
|
+
colSpan: isAnyRowSelected ? columnCount : header_0.colSpan,
|
|
193
194
|
tabIndex: -1,
|
|
194
195
|
className: clsx(tableHeadDataCva({ hasRightBorder: index > 0 && showCellBorder }), columnMeta.headerClass, columnMeta.width),
|
|
195
196
|
children: isAnyRowSelected ? /* @__PURE__ */ jsx(ActionHeader, { table }) : /* @__PURE__ */ jsxs("button", {
|
|
196
197
|
type: "button",
|
|
197
198
|
"aria-label": "Sort column",
|
|
198
|
-
className: clsx("flex select-none items-center gap-1 text-text-default-1",
|
|
199
|
-
onClick:
|
|
200
|
-
children: [typeof
|
|
199
|
+
className: clsx("flex select-none items-center gap-1 text-text-default-1", header_0.column.getCanSort() ? "h-6 cursor-pointer rounded-xs px-1 hover:bg-elevation-fill-default-2" : "cursor-default", columnMeta.sortClass),
|
|
200
|
+
onClick: header_0.column.getToggleSortingHandler(),
|
|
201
|
+
children: [typeof header_0.column.columnDef.header === "function" ? flexRender(header_0.column.columnDef.header, header_0.getContext()) : /* @__PURE__ */ jsx(HeaderText, { children: header_0.column.columnDef.header }), {
|
|
201
202
|
asc: /* @__PURE__ */ jsx(ChevronUpIcon, {
|
|
202
203
|
width: 18,
|
|
203
204
|
height: 18
|
|
@@ -206,9 +207,9 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
206
207
|
width: 18,
|
|
207
208
|
height: 18
|
|
208
209
|
})
|
|
209
|
-
}[
|
|
210
|
+
}[header_0.column.getIsSorted()] ?? null]
|
|
210
211
|
})
|
|
211
|
-
},
|
|
212
|
+
}, header_0.id);
|
|
212
213
|
})
|
|
213
214
|
}, headerGroup.id))]
|
|
214
215
|
}), /* @__PURE__ */ jsx("tbody", {
|
|
@@ -217,8 +218,8 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
217
218
|
children: enableDragDrop ? /* @__PURE__ */ jsx(SortableContext, {
|
|
218
219
|
items: dataIds,
|
|
219
220
|
strategy: verticalListSortingStrategy,
|
|
220
|
-
children: table.getRowModel().rows.map((
|
|
221
|
-
row,
|
|
221
|
+
children: table.getRowModel().rows.map((row_0) => /* @__PURE__ */ jsx(DraggableRow, {
|
|
222
|
+
row: row_0,
|
|
222
223
|
showCellBorder,
|
|
223
224
|
onRowClick,
|
|
224
225
|
onDoubleClick,
|
|
@@ -227,29 +228,29 @@ var Table = ({ items, showCellBorder, columns, onRowClick, onDoubleClick, classN
|
|
|
227
228
|
tableDataCva,
|
|
228
229
|
hasOnClick,
|
|
229
230
|
...props
|
|
230
|
-
},
|
|
231
|
-
}) : table.getRowModel().rows.map((
|
|
231
|
+
}, row_0.id))
|
|
232
|
+
}) : table.getRowModel().rows.map((row_1) => {
|
|
232
233
|
return /* @__PURE__ */ jsx("tr", {
|
|
233
234
|
className: clsx(tableRowCva({ ...props })),
|
|
234
235
|
onClick: () => {
|
|
235
236
|
if (onRowClick) {
|
|
236
|
-
onRowClick(
|
|
237
|
+
onRowClick(row_1.original);
|
|
237
238
|
return;
|
|
238
239
|
}
|
|
239
|
-
if (
|
|
240
|
+
if (row_1.getCanSelect()) row_1.toggleSelected();
|
|
240
241
|
},
|
|
241
|
-
onDoubleClick: () => onDoubleClick?.(
|
|
242
|
-
"data-clickable": hasOnClick ||
|
|
243
|
-
"data-selected":
|
|
244
|
-
children:
|
|
245
|
-
const
|
|
242
|
+
onDoubleClick: () => onDoubleClick?.(row_1.original),
|
|
243
|
+
"data-clickable": hasOnClick || row_1.getCanSelect() || void 0,
|
|
244
|
+
"data-selected": row_1.getIsSelected() || void 0,
|
|
245
|
+
children: row_1.getVisibleCells().map((cell, cellIndex) => {
|
|
246
|
+
const columnMeta_0 = cell.column.columnDef.meta ?? {};
|
|
246
247
|
return /* @__PURE__ */ jsx("td", {
|
|
247
248
|
tabIndex: -1,
|
|
248
|
-
className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }),
|
|
249
|
-
children:
|
|
249
|
+
className: clsx(tableDataCva({ hasRightBorder: cellIndex > 0 && showCellBorder }), columnMeta_0.cellClass, columnMeta_0.width),
|
|
250
|
+
children: renderCell(cell.column.columnDef.cell, CustomCellContext(cell.getContext()))
|
|
250
251
|
}, cell.id);
|
|
251
252
|
})
|
|
252
|
-
},
|
|
253
|
+
}, row_1.id);
|
|
253
254
|
})
|
|
254
255
|
})]
|
|
255
256
|
});
|
|
@@ -1,21 +1,33 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { LinkContext } from "../../../config/link.context.js";
|
|
3
3
|
import { linkDefinition } from "./link.cva.js";
|
|
4
|
+
import { c } from "react/compiler-runtime";
|
|
4
5
|
import { jsx } from "react/jsx-runtime";
|
|
5
6
|
import { Link } from "react-aria-components";
|
|
6
7
|
//#region src/components/text/Link/Link.tsx
|
|
7
|
-
var Link$1 = (
|
|
8
|
+
var Link$1 = (t0) => {
|
|
9
|
+
const $ = c(4);
|
|
10
|
+
const { variant, ...props } = t0;
|
|
8
11
|
const linkContext = LinkContext.useLinkContext();
|
|
9
12
|
const linkCva = UIOverrides.useCva("link.cva", linkDefinition);
|
|
10
13
|
const LinkComponent = linkContext?.LinkComponent ?? Link;
|
|
11
14
|
if (!props.to && props.href) props.to = props.href;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
className:
|
|
15
|
-
variant,
|
|
16
|
-
className: props.className
|
|
17
|
-
})
|
|
15
|
+
const t1 = linkCva({
|
|
16
|
+
variant,
|
|
17
|
+
className: props.className
|
|
18
18
|
});
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[0] !== LinkComponent || $[1] !== props || $[2] !== t1) {
|
|
21
|
+
t2 = /* @__PURE__ */ jsx(LinkComponent, {
|
|
22
|
+
...props,
|
|
23
|
+
className: t1
|
|
24
|
+
});
|
|
25
|
+
$[0] = LinkComponent;
|
|
26
|
+
$[1] = props;
|
|
27
|
+
$[2] = t1;
|
|
28
|
+
$[3] = t2;
|
|
29
|
+
} else t2 = $[3];
|
|
30
|
+
return t2;
|
|
19
31
|
};
|
|
20
32
|
//#endregion
|
|
21
33
|
export { Link$1 as Link };
|
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
import { UIOverrides } from "../../../config/uiOverrides.context.js";
|
|
2
2
|
import { typographyDefinition } from "./typography.cva.js";
|
|
3
|
+
import { c } from "react/compiler-runtime";
|
|
3
4
|
import { jsx } from "react/jsx-runtime";
|
|
4
5
|
//#region src/components/text/Typography/Typography.tsx
|
|
5
|
-
var Typography = (
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
...props
|
|
6
|
+
var Typography = (t0) => {
|
|
7
|
+
const $ = c(4);
|
|
8
|
+
const { as: t1, className, ...props } = t0;
|
|
9
|
+
const as = t1 === void 0 ? "p" : t1;
|
|
10
|
+
const typographyCva = UIOverrides.useCva("typography.cva", typographyDefinition);
|
|
11
|
+
const Tag = as;
|
|
12
|
+
const t2 = typographyCva({
|
|
13
|
+
...props,
|
|
14
|
+
sizeMobile: props.sizeMobile ?? props.size,
|
|
15
|
+
className
|
|
13
16
|
});
|
|
17
|
+
let t3;
|
|
18
|
+
if ($[0] !== Tag || $[1] !== props || $[2] !== t2) {
|
|
19
|
+
t3 = /* @__PURE__ */ jsx(Tag, {
|
|
20
|
+
className: t2,
|
|
21
|
+
...props
|
|
22
|
+
});
|
|
23
|
+
$[0] = Tag;
|
|
24
|
+
$[1] = props;
|
|
25
|
+
$[2] = t2;
|
|
26
|
+
$[3] = t3;
|
|
27
|
+
} else t3 = $[3];
|
|
28
|
+
return t3;
|
|
14
29
|
};
|
|
15
30
|
//#endregion
|
|
16
31
|
export { Typography };
|
|
@@ -24,7 +24,7 @@ var Confirmation;
|
|
|
24
24
|
const [state, setState] = useState(DEFAULT_STATE);
|
|
25
25
|
const { t } = useTranslation("ui");
|
|
26
26
|
const onCancel = () => setState(DEFAULT_STATE);
|
|
27
|
-
const confirm = useCallback(async ({ heading, description, buttonSize, textAlign, modalClassName, cancelLabel = t(($) => $.ui.confirmation.cancel), confirmLabel = t(($) =>
|
|
27
|
+
const confirm = useCallback(async ({ heading, description, buttonSize, textAlign, modalClassName, cancelLabel = t(($) => $.ui.confirmation.cancel), confirmLabel = t(($_0) => $_0.ui.confirmation.confirm), confirmVariant, confirmColor, cancelVariant, cancelColor }) => {
|
|
28
28
|
return new Promise((resolve) => {
|
|
29
29
|
setState({
|
|
30
30
|
heading,
|
|
@@ -1,17 +1,31 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, use
|
|
3
|
+
import { createContext, use } from "react";
|
|
3
4
|
//#region src/config/link.context.tsx
|
|
4
5
|
var LinkContext;
|
|
5
6
|
(function(_LinkContext) {
|
|
6
7
|
const LinkContextInternal = createContext(null);
|
|
7
|
-
_LinkContext.LinkContextProvider = (
|
|
8
|
-
const
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
8
|
+
_LinkContext.LinkContextProvider = (t0) => {
|
|
9
|
+
const $ = c(5);
|
|
10
|
+
const { children, LinkComponent } = t0;
|
|
11
|
+
let t1;
|
|
12
|
+
if ($[0] !== LinkComponent) {
|
|
13
|
+
t1 = { LinkComponent };
|
|
14
|
+
$[0] = LinkComponent;
|
|
15
|
+
$[1] = t1;
|
|
16
|
+
} else t1 = $[1];
|
|
17
|
+
const value = t1;
|
|
18
|
+
let t2;
|
|
19
|
+
if ($[2] !== children || $[3] !== value) {
|
|
20
|
+
t2 = /* @__PURE__ */ jsx(LinkContextInternal.Provider, {
|
|
21
|
+
value,
|
|
22
|
+
children
|
|
23
|
+
});
|
|
24
|
+
$[2] = children;
|
|
25
|
+
$[3] = value;
|
|
26
|
+
$[4] = t2;
|
|
27
|
+
} else t2 = $[4];
|
|
28
|
+
return t2;
|
|
15
29
|
};
|
|
16
30
|
_LinkContext.useLinkContext = () => {
|
|
17
31
|
return use(LinkContextInternal);
|
|
@@ -1,31 +1,57 @@
|
|
|
1
|
+
import { c } from "react/compiler-runtime";
|
|
1
2
|
import { jsx } from "react/jsx-runtime";
|
|
2
|
-
import { createContext, use
|
|
3
|
+
import { createContext, use } from "react";
|
|
3
4
|
import { RouterProvider } from "react-aria";
|
|
4
5
|
//#region src/config/router.context.tsx
|
|
5
6
|
var UIRouter;
|
|
6
7
|
(function(_UIRouter) {
|
|
7
8
|
const UIRouterContext = createContext(null);
|
|
8
|
-
_UIRouter.UIRouterProvider = (
|
|
9
|
-
const
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
_UIRouter.UIRouterProvider = (t0) => {
|
|
10
|
+
const $ = c(13);
|
|
11
|
+
const { children, push, replace, searchString } = t0;
|
|
12
|
+
let t1;
|
|
13
|
+
if ($[0] !== searchString) {
|
|
14
|
+
t1 = new URLSearchParams(searchString);
|
|
15
|
+
$[0] = searchString;
|
|
16
|
+
$[1] = t1;
|
|
17
|
+
} else t1 = $[1];
|
|
18
|
+
const searchParams = t1;
|
|
19
|
+
let t2;
|
|
20
|
+
if ($[2] !== push || $[3] !== replace || $[4] !== searchParams || $[5] !== searchString) {
|
|
21
|
+
t2 = {
|
|
14
22
|
searchParams,
|
|
15
23
|
push,
|
|
16
24
|
searchString,
|
|
17
25
|
replace
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
]
|
|
24
|
-
|
|
26
|
+
};
|
|
27
|
+
$[2] = push;
|
|
28
|
+
$[3] = replace;
|
|
29
|
+
$[4] = searchParams;
|
|
30
|
+
$[5] = searchString;
|
|
31
|
+
$[6] = t2;
|
|
32
|
+
} else t2 = $[6];
|
|
33
|
+
const value = t2;
|
|
34
|
+
let t3;
|
|
35
|
+
if ($[7] !== children || $[8] !== push) {
|
|
36
|
+
t3 = /* @__PURE__ */ jsx(RouterProvider, {
|
|
25
37
|
navigate: push,
|
|
26
38
|
children
|
|
27
|
-
})
|
|
28
|
-
|
|
39
|
+
});
|
|
40
|
+
$[7] = children;
|
|
41
|
+
$[8] = push;
|
|
42
|
+
$[9] = t3;
|
|
43
|
+
} else t3 = $[9];
|
|
44
|
+
let t4;
|
|
45
|
+
if ($[10] !== t3 || $[11] !== value) {
|
|
46
|
+
t4 = /* @__PURE__ */ jsx(UIRouterContext, {
|
|
47
|
+
value,
|
|
48
|
+
children: t3
|
|
49
|
+
});
|
|
50
|
+
$[10] = t3;
|
|
51
|
+
$[11] = value;
|
|
52
|
+
$[12] = t4;
|
|
53
|
+
} else t4 = $[12];
|
|
54
|
+
return t4;
|
|
29
55
|
};
|
|
30
56
|
_UIRouter.useUIRouter = () => {
|
|
31
57
|
const context = use(UIRouterContext);
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useLocalStorage } from "../hooks/useLocalStorage.js";
|
|
2
|
+
import { c } from "react/compiler-runtime";
|
|
2
3
|
import { jsx } from "react/jsx-runtime";
|
|
3
|
-
import { createContext, use,
|
|
4
|
+
import { createContext, use, useEffect, useState } from "react";
|
|
4
5
|
import { z } from "zod";
|
|
5
6
|
//#region src/config/theme.context.tsx
|
|
6
7
|
var ThemeContext;
|
|
@@ -12,56 +13,108 @@ var ThemeContext;
|
|
|
12
13
|
"system"
|
|
13
14
|
]);
|
|
14
15
|
const ThemeContext = createContext(null);
|
|
15
|
-
_ThemeContext.ThemeContextProvider = (
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
set(theme);
|
|
26
|
-
}, [set]);
|
|
27
|
-
useEffect(() => {
|
|
28
|
-
if (typeof window === "undefined") return;
|
|
29
|
-
const onChange = (event) => {
|
|
30
|
-
setSystemTheme(event.matches ? "dark" : "light");
|
|
16
|
+
_ThemeContext.ThemeContextProvider = (t0) => {
|
|
17
|
+
const $ = c(17);
|
|
18
|
+
const { children, storageKey: t1 } = t0;
|
|
19
|
+
const storageKey = t1 === void 0 ? DEFAULT_STORAGE_KEY : t1;
|
|
20
|
+
const [systemTheme, setSystemTheme] = useState(_temp);
|
|
21
|
+
let t2;
|
|
22
|
+
if ($[0] !== storageKey) {
|
|
23
|
+
t2 = {
|
|
24
|
+
key: storageKey,
|
|
25
|
+
schema: ThemeSchema
|
|
31
26
|
};
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
27
|
+
$[0] = storageKey;
|
|
28
|
+
$[1] = t2;
|
|
29
|
+
} else t2 = $[1];
|
|
30
|
+
const { value: theme, set } = useLocalStorage(t2);
|
|
31
|
+
let t3;
|
|
32
|
+
if ($[2] !== set) {
|
|
33
|
+
t3 = (theme_0) => {
|
|
34
|
+
set(theme_0);
|
|
36
35
|
};
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
36
|
+
$[2] = set;
|
|
37
|
+
$[3] = t3;
|
|
38
|
+
} else t3 = $[3];
|
|
39
|
+
const updateTheme = t3;
|
|
40
|
+
let t4;
|
|
41
|
+
let t5;
|
|
42
|
+
if ($[4] === Symbol.for("react.memo_cache_sentinel")) {
|
|
43
|
+
t4 = () => {
|
|
44
|
+
if (typeof window === "undefined") return;
|
|
45
|
+
const onChange = (event) => {
|
|
46
|
+
setSystemTheme(event.matches ? "dark" : "light");
|
|
47
|
+
};
|
|
48
|
+
const media_0 = window.matchMedia("(prefers-color-scheme: dark)");
|
|
49
|
+
media_0.addEventListener("change", onChange);
|
|
50
|
+
return () => {
|
|
51
|
+
media_0.removeEventListener("change", onChange);
|
|
52
|
+
};
|
|
53
|
+
};
|
|
54
|
+
t5 = [];
|
|
55
|
+
$[4] = t4;
|
|
56
|
+
$[5] = t5;
|
|
57
|
+
} else {
|
|
58
|
+
t4 = $[4];
|
|
59
|
+
t5 = $[5];
|
|
60
|
+
}
|
|
61
|
+
useEffect(t4, t5);
|
|
62
|
+
let t6;
|
|
63
|
+
let t7;
|
|
64
|
+
if ($[6] !== systemTheme || $[7] !== theme) {
|
|
65
|
+
t6 = () => {
|
|
66
|
+
document.documentElement.classList.remove("dark");
|
|
67
|
+
if ((!theme || theme === "system") && systemTheme === "dark" || theme === "dark") {
|
|
68
|
+
document.documentElement.classList.add("dark");
|
|
69
|
+
document.documentElement.style.colorScheme = "dark";
|
|
70
|
+
} else if (theme === "light") {
|
|
71
|
+
document.documentElement.classList.add("light");
|
|
72
|
+
document.documentElement.style.colorScheme = "light";
|
|
73
|
+
} else document.documentElement.style.colorScheme = "light";
|
|
74
|
+
};
|
|
75
|
+
t7 = [theme, systemTheme];
|
|
76
|
+
$[6] = systemTheme;
|
|
77
|
+
$[7] = theme;
|
|
78
|
+
$[8] = t6;
|
|
79
|
+
$[9] = t7;
|
|
80
|
+
} else {
|
|
81
|
+
t6 = $[8];
|
|
82
|
+
t7 = $[9];
|
|
83
|
+
}
|
|
84
|
+
useEffect(t6, t7);
|
|
85
|
+
const t8 = theme ?? "system";
|
|
86
|
+
let t9;
|
|
87
|
+
if ($[10] !== systemTheme || $[11] !== t8 || $[12] !== updateTheme) {
|
|
88
|
+
t9 = {
|
|
89
|
+
theme: t8,
|
|
90
|
+
systemTheme,
|
|
91
|
+
updateTheme
|
|
92
|
+
};
|
|
93
|
+
$[10] = systemTheme;
|
|
94
|
+
$[11] = t8;
|
|
95
|
+
$[12] = updateTheme;
|
|
96
|
+
$[13] = t9;
|
|
97
|
+
} else t9 = $[13];
|
|
98
|
+
const contextValue = t9;
|
|
99
|
+
let t10;
|
|
100
|
+
if ($[14] !== children || $[15] !== contextValue) {
|
|
101
|
+
t10 = /* @__PURE__ */ jsx(ThemeContext.Provider, {
|
|
102
|
+
value: contextValue,
|
|
103
|
+
children
|
|
104
|
+
});
|
|
105
|
+
$[14] = children;
|
|
106
|
+
$[15] = contextValue;
|
|
107
|
+
$[16] = t10;
|
|
108
|
+
} else t10 = $[16];
|
|
109
|
+
return t10;
|
|
61
110
|
};
|
|
62
111
|
_ThemeContext.useTheme = () => {
|
|
63
112
|
return use(ThemeContext);
|
|
64
113
|
};
|
|
65
114
|
})(ThemeContext || (ThemeContext = {}));
|
|
115
|
+
function _temp() {
|
|
116
|
+
if (typeof window === "undefined") return;
|
|
117
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
118
|
+
}
|
|
66
119
|
//#endregion
|
|
67
120
|
export { ThemeContext };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PropsWithChildren } from 'react';
|
|
1
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
2
2
|
import { ButtonProps } from '../components/buttons/Button/Button';
|
|
3
3
|
import { CheckboxProps } from '../components/inputs/Checkbox/Checkbox';
|
|
4
4
|
import { DatePickerProps } from '../components/inputs/DateTime/DatePicker/DatePicker';
|
|
@@ -20,17 +20,31 @@ export declare namespace UIConfig {
|
|
|
20
20
|
[P in keyof T]-?: T[P] extends object ? DeepRequired<T[P]> : Exclude<T[P], null | undefined>;
|
|
21
21
|
};
|
|
22
22
|
export interface Options {
|
|
23
|
+
renderStaticInput: boolean;
|
|
23
24
|
input: Pick<TextInputProps, "variant" | "isClearable" | "hideLabel" | "as" | "size"> & {
|
|
24
25
|
alwaysShowClear?: boolean;
|
|
25
26
|
};
|
|
26
27
|
button: Pick<ButtonProps, "variant" | "size">;
|
|
27
28
|
numberInput: Pick<NumberInputProps, "formatOptions">;
|
|
28
|
-
radioGroup: Pick<RadioGroupProps, "variant" | "hideLabel">;
|
|
29
|
-
checkbox: Pick<CheckboxProps, "variant">;
|
|
30
|
-
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType" | "hideSearchIcon">;
|
|
31
|
-
|
|
29
|
+
radioGroup: Pick<RadioGroupProps, "variant" | "hideLabel" | "fireBlurOnChange">;
|
|
30
|
+
checkbox: Pick<CheckboxProps, "variant" | "fireBlurOnChange">;
|
|
31
|
+
select: Pick<SelectBaseProps, "selectionMode" | "isSearchable" | "collapseAfter" | "selectedTagsType" | "hideSearchIcon" | "fireBlurOnChange">;
|
|
32
|
+
queryAutocomplete: {
|
|
33
|
+
isInitialQueryDisabled?: boolean;
|
|
34
|
+
};
|
|
35
|
+
querySelect: {
|
|
36
|
+
isInitialQueryDisabled?: boolean;
|
|
37
|
+
};
|
|
38
|
+
toggle: Pick<ToggleProps, "variant" | "fireBlurOnChange">;
|
|
32
39
|
slider: Pick<SliderProps, "minValue" | "maxValue">;
|
|
33
|
-
dateInput: Pick<DatePickerProps, "todayIcon" | "shouldForceLeadingZeros" | "disableManualEntry" | "shouldUpdateDateOnMonthYearChange" | "granularity" | "autoFixYear"
|
|
40
|
+
dateInput: Pick<DatePickerProps, "todayIcon" | "todayIconButtonSize" | "todayIconPlacement" | "shouldForceLeadingZeros" | "disableManualEntry" | "shouldUpdateDateOnMonthYearChange" | "granularity" | "autoFixYear" | "fireBlurOnChange"> & {
|
|
41
|
+
calendarIcon?: ReactElement;
|
|
42
|
+
dateTimeIcon?: ReactElement;
|
|
43
|
+
timeIcon?: ReactElement;
|
|
44
|
+
setDateValueOnDateSelection?: boolean;
|
|
45
|
+
timeZone?: string;
|
|
46
|
+
todayIconButtonComponent?: DatePickerProps["todayIconButtonComponent"];
|
|
47
|
+
};
|
|
34
48
|
actionModal: Pick<ActionModalProps, "titleTypography" | "descriptionTypography">;
|
|
35
49
|
bottomSheet: Pick<BottomSheetProps, "closeDragThreshold" | "closeVelocityThreshold" | "hideThumb" | "headerTypography">;
|
|
36
50
|
tableHeaderText: Pick<HeaderTextProps, "variant" | "size">;
|
|
@@ -1,11 +1,16 @@
|
|
|
1
|
+
import { CalendarIcon } from "../assets/icons/Calendar.js";
|
|
2
|
+
import { ClockIcon } from "../assets/icons/Clock.js";
|
|
3
|
+
import { DateTimeIcon } from "../assets/icons/DateTime.js";
|
|
1
4
|
import { ObjectUtils } from "../utils/object.utils.js";
|
|
2
5
|
import { useDeepCompareMemo } from "../hooks/useDeepCompare.js";
|
|
6
|
+
import { c } from "react/compiler-runtime";
|
|
3
7
|
import { jsx } from "react/jsx-runtime";
|
|
4
8
|
import { createContext, use } from "react";
|
|
5
9
|
//#region src/config/uiConfig.context.tsx
|
|
6
10
|
var UIConfig;
|
|
7
11
|
(function(_UIConfig) {
|
|
8
12
|
const DEFAULT_CONFIG = {
|
|
13
|
+
renderStaticInput: true,
|
|
9
14
|
input: {
|
|
10
15
|
variant: "outlined",
|
|
11
16
|
as: "default",
|
|
@@ -24,28 +29,47 @@ var UIConfig;
|
|
|
24
29
|
} },
|
|
25
30
|
radioGroup: {
|
|
26
31
|
variant: "default",
|
|
27
|
-
hideLabel: false
|
|
32
|
+
hideLabel: false,
|
|
33
|
+
fireBlurOnChange: false
|
|
34
|
+
},
|
|
35
|
+
checkbox: {
|
|
36
|
+
variant: "default",
|
|
37
|
+
fireBlurOnChange: false
|
|
28
38
|
},
|
|
29
|
-
checkbox: { variant: "default" },
|
|
30
39
|
select: {
|
|
31
40
|
selectionMode: "single",
|
|
32
41
|
isSearchable: false,
|
|
33
42
|
selectedTagsType: "list",
|
|
34
43
|
collapseAfter: 3,
|
|
35
|
-
hideSearchIcon: false
|
|
44
|
+
hideSearchIcon: false,
|
|
45
|
+
fireBlurOnChange: false
|
|
46
|
+
},
|
|
47
|
+
queryAutocomplete: { isInitialQueryDisabled: false },
|
|
48
|
+
querySelect: { isInitialQueryDisabled: false },
|
|
49
|
+
toggle: {
|
|
50
|
+
variant: "default",
|
|
51
|
+
fireBlurOnChange: false
|
|
36
52
|
},
|
|
37
|
-
toggle: { variant: "default" },
|
|
38
53
|
slider: {
|
|
39
54
|
minValue: 0,
|
|
40
55
|
maxValue: 100
|
|
41
56
|
},
|
|
42
57
|
dateInput: {
|
|
43
58
|
todayIcon: false,
|
|
59
|
+
todayIconButtonSize: "none",
|
|
60
|
+
todayIconButtonComponent: "iconButton",
|
|
61
|
+
todayIconPlacement: "content",
|
|
44
62
|
shouldForceLeadingZeros: false,
|
|
45
63
|
disableManualEntry: false,
|
|
46
|
-
|
|
64
|
+
autoFixYear: false,
|
|
65
|
+
fireBlurOnChange: false,
|
|
66
|
+
calendarIcon: /* @__PURE__ */ jsx(CalendarIcon, { className: "size-5" }),
|
|
67
|
+
dateTimeIcon: /* @__PURE__ */ jsx(DateTimeIcon, { className: "size-5" }),
|
|
68
|
+
timeIcon: /* @__PURE__ */ jsx(ClockIcon, { className: "size-6 text-interactive-text-secondary-idle" }),
|
|
69
|
+
setDateValueOnDateSelection: false,
|
|
70
|
+
timeZone: "clientLocal",
|
|
47
71
|
granularity: "day",
|
|
48
|
-
|
|
72
|
+
shouldUpdateDateOnMonthYearChange: false
|
|
49
73
|
},
|
|
50
74
|
actionModal: {
|
|
51
75
|
titleTypography: {
|
|
@@ -81,15 +105,42 @@ var UIConfig;
|
|
|
81
105
|
}
|
|
82
106
|
};
|
|
83
107
|
const Context = createContext(DEFAULT_CONFIG);
|
|
84
|
-
_UIConfig.Provider = (
|
|
108
|
+
_UIConfig.Provider = (t0) => {
|
|
109
|
+
const $ = c(9);
|
|
110
|
+
const { config: t1, children } = t0;
|
|
111
|
+
let t2;
|
|
112
|
+
if ($[0] !== t1) {
|
|
113
|
+
t2 = t1 === void 0 ? {} : t1;
|
|
114
|
+
$[0] = t1;
|
|
115
|
+
$[1] = t2;
|
|
116
|
+
} else t2 = $[1];
|
|
117
|
+
const config = t2;
|
|
85
118
|
const parentConfig = use(Context) || DEFAULT_CONFIG;
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
119
|
+
let t3;
|
|
120
|
+
let t4;
|
|
121
|
+
if ($[2] !== config || $[3] !== parentConfig) {
|
|
122
|
+
t3 = () => ObjectUtils.deepConditionalMerge(parentConfig, config, _temp);
|
|
123
|
+
t4 = [config, parentConfig];
|
|
124
|
+
$[2] = config;
|
|
125
|
+
$[3] = parentConfig;
|
|
126
|
+
$[4] = t3;
|
|
127
|
+
$[5] = t4;
|
|
128
|
+
} else {
|
|
129
|
+
t3 = $[4];
|
|
130
|
+
t4 = $[5];
|
|
131
|
+
}
|
|
132
|
+
const value = useDeepCompareMemo(t3, t4);
|
|
133
|
+
let t5;
|
|
134
|
+
if ($[6] !== children || $[7] !== value) {
|
|
135
|
+
t5 = /* @__PURE__ */ jsx(Context.Provider, {
|
|
136
|
+
value,
|
|
137
|
+
children
|
|
138
|
+
});
|
|
139
|
+
$[6] = children;
|
|
140
|
+
$[7] = value;
|
|
141
|
+
$[8] = t5;
|
|
142
|
+
} else t5 = $[8];
|
|
143
|
+
return t5;
|
|
93
144
|
};
|
|
94
145
|
_UIConfig.useConfig = () => {
|
|
95
146
|
const context = use(Context);
|
|
@@ -97,5 +148,8 @@ var UIConfig;
|
|
|
97
148
|
return context;
|
|
98
149
|
};
|
|
99
150
|
})(UIConfig || (UIConfig = {}));
|
|
151
|
+
function _temp(val) {
|
|
152
|
+
return val !== null && val !== void 0;
|
|
153
|
+
}
|
|
100
154
|
//#endregion
|
|
101
155
|
export { UIConfig };
|