@dcs-tech/ui 0.2.0 → 0.4.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/README.md +32 -6
- package/dist/ChartImageMenu-HILSfn5A.js +1115 -0
- package/dist/ChartView-Cehrcr05.js +1703 -0
- package/dist/SummaryChart-y27q_BBN.js +29 -0
- package/dist/SummaryImage-DDNEEu_K.js +18 -0
- package/dist/SummarySeeAll-0dX-_LFe.js +101 -0
- package/dist/defaults-DL745PK1.js +708 -0
- package/dist/exportContext-CdpsOzE8.js +235 -0
- package/dist/exportEngine-DL-jEXFU.js +890 -0
- package/dist/geometry-CG2nOEnw.js +1796 -0
- package/dist/index.js +23238 -15993
- package/dist/scrollArea-CkPGDYH2.js +210 -0
- package/dist/style.css +1 -1
- package/dist/summaryChartData-Djo73zb8.js +81 -0
- package/dist/types/components/AppBar/AppBar.d.ts +16 -0
- package/dist/types/components/ArrowKeyFocus/useArrowKeyFocus.d.ts +10 -0
- package/dist/types/components/Avatar/Avatar.d.ts +22 -0
- package/dist/types/{shared-web-ui/src → components}/Badge/Badge.d.ts +0 -11
- package/dist/types/components/Breadcrumbs/Breadcrumbs.d.ts +18 -0
- package/dist/types/{shared-web-ui/src → components}/Button/Button.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/ButtonGroup.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/ButtonGroupContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Button/index.d.ts +1 -1
- package/dist/types/components/Card/Card.d.ts +17 -0
- package/dist/types/components/Charts/AnchoredMenu.d.ts +17 -0
- package/dist/types/components/Charts/BarList.d.ts +12 -0
- package/dist/types/components/Charts/CalendarHeatmap.d.ts +17 -0
- package/dist/types/components/Charts/Chart.d.ts +20 -0
- package/dist/types/components/Charts/ChartIcon.d.ts +5 -0
- package/dist/types/components/Charts/ChartImageMenu.d.ts +4 -0
- package/dist/types/components/Charts/ChartTable.d.ts +8 -0
- package/dist/types/components/Charts/ChartTooltip.d.ts +58 -0
- package/dist/types/components/Charts/ChartView.d.ts +15 -0
- package/dist/types/components/Charts/ColumnChart.d.ts +15 -0
- package/dist/types/components/Charts/Donut.d.ts +14 -0
- package/dist/types/components/Charts/Funnel.d.ts +10 -0
- package/dist/types/components/Charts/Gauge.d.ts +15 -0
- package/dist/types/components/Charts/Legend.d.ts +6 -0
- package/dist/types/components/Charts/LineChart.d.ts +13 -0
- package/dist/types/components/Charts/NumberTrend.d.ts +21 -0
- package/dist/types/components/Charts/Progress.d.ts +12 -0
- package/dist/types/components/Charts/StackedBar.d.ts +11 -0
- package/dist/types/components/Charts/Treemap.d.ts +12 -0
- package/dist/types/components/Charts/chartData.d.ts +69 -0
- package/dist/types/components/Charts/chartImage.d.ts +121 -0
- package/dist/types/components/Charts/geometry.d.ts +180 -0
- package/dist/types/components/Charts/index.d.ts +32 -0
- package/dist/types/components/Charts/labels.d.ts +46 -0
- package/dist/types/components/Charts/menuPlacement.d.ts +25 -0
- package/dist/types/components/Charts/palette.d.ts +81 -0
- package/dist/types/components/Charts/parts.d.ts +25 -0
- package/dist/types/components/Charts/pointer.d.ts +41 -0
- package/dist/types/components/Charts/types.d.ts +51 -0
- package/dist/types/components/Charts/ui.d.ts +3 -0
- package/dist/types/components/Charts/useBoxSize.d.ts +6 -0
- package/dist/types/components/Charts/useLegendFit.d.ts +1 -0
- package/dist/types/components/Charts/useUiScale.d.ts +1 -0
- package/dist/types/{shared-web-ui/src → components}/Checkbox/Checkbox.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Checkbox/CheckboxGroup.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Checkbox/CheckboxGroupContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Checkbox/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/ChipInput/ChipInput.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/ChipInput/index.d.ts +2 -2
- package/dist/types/{shared-web-ui/src → components}/ChipInput/useChipSuggestions.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/Collapsible.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/CollapsibleContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Collapsible/CollapsibleItem.d.ts +1 -3
- package/dist/types/{shared-web-ui/src → components}/Collapsible/index.d.ts +1 -1
- package/dist/types/components/ColorSchemeSelect/ColorSchemeSelect.d.ts +11 -0
- package/dist/types/components/CommandPalette/CommandPalette.d.ts +25 -0
- package/dist/types/components/DataTable/DataTable.d.ts +16 -0
- package/dist/types/components/DataTable/DataTable.storyData.d.ts +23 -0
- package/dist/types/components/DataTable/DisplayPopover.d.ts +22 -0
- package/dist/types/components/DataTable/HeaderMenu.d.ts +31 -0
- package/dist/types/components/DataTable/ManageModal.d.ts +31 -0
- package/dist/types/components/DataTable/PressButton.d.ts +2 -0
- package/dist/types/components/DataTable/SingleRowView.d.ts +9 -0
- package/dist/types/components/DataTable/SortModal.d.ts +16 -0
- package/dist/types/components/DataTable/StatusRow.d.ts +49 -0
- package/dist/types/components/DataTable/TableColumnModal.d.ts +18 -0
- package/dist/types/components/DataTable/TableControls.d.ts +48 -0
- package/dist/types/components/DataTable/TablePagination.d.ts +38 -0
- package/dist/types/components/DataTable/TableScrollStrip.d.ts +2 -0
- package/dist/types/components/DataTable/TableToolbar.d.ts +69 -0
- package/dist/types/components/DataTable/TableView.d.ts +61 -0
- package/dist/types/components/DataTable/bulk/BulkConfirmDialog.d.ts +13 -0
- package/dist/types/components/DataTable/bulk/TableToast.d.ts +13 -0
- package/dist/types/components/DataTable/bulk/bulkActions.d.ts +23 -0
- package/dist/types/components/DataTable/cards/CardFieldsEditor.d.ts +16 -0
- package/dist/types/components/DataTable/cards/CardView.d.ts +50 -0
- package/dist/types/components/DataTable/cards/cardFields.d.ts +32 -0
- package/dist/types/components/DataTable/cards/rowParts.d.ts +38 -0
- package/dist/types/components/DataTable/data/useServerData.d.ts +28 -0
- package/dist/types/components/DataTable/defaults.d.ts +18 -0
- package/dist/types/components/DataTable/detail/BuiltInDetail.d.ts +10 -0
- package/dist/types/components/DataTable/detail/DetailHost.d.ts +13 -0
- package/dist/types/components/DataTable/export/ExportPopover.d.ts +18 -0
- package/dist/types/components/DataTable/export/ExportPreviewModal.d.ts +11 -0
- package/dist/types/components/DataTable/export/ExportSettingsModal.d.ts +31 -0
- package/dist/types/components/DataTable/export/ExportTemplateCards.d.ts +19 -0
- package/dist/types/components/DataTable/export/exportContext.d.ts +10 -0
- package/dist/types/components/DataTable/export/exportEngine.d.ts +77 -0
- package/dist/types/components/DataTable/export/exportRows.d.ts +10 -0
- package/dist/types/components/DataTable/export/templateDisplay.d.ts +7 -0
- package/dist/types/components/DataTable/export/templateOptions.d.ts +6 -0
- package/dist/types/components/DataTable/export/useTableExport.d.ts +53 -0
- package/dist/types/components/DataTable/filters/ColumnFilterPopover.d.ts +14 -0
- package/dist/types/components/DataTable/filters/FilterChips.d.ts +9 -0
- package/dist/types/components/DataTable/filters/FilterConditionRow.d.ts +11 -0
- package/dist/types/components/DataTable/filters/FilterGroup.d.ts +12 -0
- package/dist/types/components/DataTable/filters/FilterModal.d.ts +14 -0
- package/dist/types/components/DataTable/filters/FilterRow.d.ts +20 -0
- package/dist/types/components/DataTable/filters/columnFilterModel.d.ts +29 -0
- package/dist/types/components/DataTable/filters/filterEngine.d.ts +16 -0
- package/dist/types/components/DataTable/filters/filterRowModel.d.ts +28 -0
- package/dist/types/components/DataTable/filters/quickFilterMatch.d.ts +3 -0
- package/dist/types/components/DataTable/grouping/GroupUi.d.ts +36 -0
- package/dist/types/components/DataTable/grouping/groupModel.d.ts +82 -0
- package/dist/types/components/DataTable/grouping/useGrouping.d.ts +39 -0
- package/dist/types/components/DataTable/host.d.ts +14 -0
- package/dist/types/components/DataTable/index.d.ts +18 -0
- package/dist/types/components/DataTable/keyboard/ShortcutsDialog.d.ts +14 -0
- package/dist/types/components/DataTable/keyboard/shortcuts.d.ts +22 -0
- package/dist/types/components/DataTable/keyboard/useGridKeyboard.d.ts +48 -0
- package/dist/types/components/DataTable/labels.d.ts +618 -0
- package/dist/types/components/DataTable/layout/LayoutSwitcher.d.ts +9 -0
- package/dist/types/components/DataTable/layout/layouts.d.ts +20 -0
- package/dist/types/components/DataTable/layout/scrollArea.d.ts +2 -0
- package/dist/types/components/DataTable/layout/useFillHeight.d.ts +11 -0
- package/dist/types/components/DataTable/menu/RowMenu.d.ts +56 -0
- package/dist/types/components/DataTable/menu/buildRowMenu.d.ts +35 -0
- package/dist/types/components/DataTable/menu/clipboard.d.ts +4 -0
- package/dist/types/components/DataTable/menu/layers.d.ts +1 -0
- package/dist/types/components/DataTable/menu/valueFilter.d.ts +15 -0
- package/dist/types/components/DataTable/motion/useRowMotion.d.ts +32 -0
- package/dist/types/components/DataTable/persistence/adapters.d.ts +6 -0
- package/dist/types/components/DataTable/persistence/reconcile.d.ts +64 -0
- package/dist/types/components/DataTable/persistence/useColumnPersistence.d.ts +51 -0
- package/dist/types/components/DataTable/persistence/useManagePrefs.d.ts +23 -0
- package/dist/types/components/DataTable/persistence/useOrphanPrefs.d.ts +3 -0
- package/dist/types/components/DataTable/pinning.d.ts +10 -0
- package/dist/types/components/DataTable/rows/PressRow.d.ts +7 -0
- package/dist/types/components/DataTable/rows/RowActions.d.ts +15 -0
- package/dist/types/components/DataTable/rows/rowPress.d.ts +35 -0
- package/dist/types/components/DataTable/sharing/Sharing.d.ts +21 -0
- package/dist/types/components/DataTable/split/SplitView.d.ts +29 -0
- package/dist/types/components/DataTable/summary/ManageSummaryCards.d.ts +18 -0
- package/dist/types/components/DataTable/summary/SummaryChart.d.ts +11 -0
- package/dist/types/components/DataTable/summary/SummaryControls.d.ts +33 -0
- package/dist/types/components/DataTable/summary/SummaryImage.d.ts +12 -0
- package/dist/types/components/DataTable/summary/SummarySeeAll.d.ts +17 -0
- package/dist/types/components/DataTable/summary/TableSummary.d.ts +34 -0
- package/dist/types/components/DataTable/summary/summaryCatalogue.d.ts +64 -0
- package/dist/types/components/DataTable/summary/summaryChartData.d.ts +9 -0
- package/dist/types/components/DataTable/summary/summaryModel.d.ts +152 -0
- package/dist/types/components/DataTable/summary/summaryWidth.d.ts +22 -0
- package/dist/types/components/DataTable/summary/useTableSummary.d.ts +18 -0
- package/dist/types/components/DataTable/types.d.ts +1145 -0
- package/dist/types/components/DataTable/ui-local/AutoHeight.d.ts +9 -0
- package/dist/types/components/DataTable/ui-local/DateRangePicker.d.ts +16 -0
- package/dist/types/components/DataTable/ui-local/DragAndDropList/DragAndDropList.d.ts +4 -0
- package/dist/types/components/DataTable/ui-local/DragAndDropList/index.d.ts +3 -0
- package/dist/types/components/DataTable/ui-local/DragAndDropList/types.d.ts +70 -0
- package/dist/types/components/DataTable/ui-local/ReactModal.d.ts +20 -0
- package/dist/types/components/DataTable/ui-local/scrollLock.d.ts +1 -0
- package/dist/types/components/DataTable/ui.d.ts +13 -0
- package/dist/types/components/DataTable/useDataChangeTracker.d.ts +11 -0
- package/dist/types/components/DataTable/useTable.d.ts +12 -0
- package/dist/types/components/DataTable/vendor/columnOrder.d.ts +1 -0
- package/dist/types/components/DataTable/vendor/diff.d.ts +5 -0
- package/dist/types/components/DataTable/vendor/fileActions.d.ts +19 -0
- package/dist/types/components/DataTable/vendor/index.d.ts +3 -0
- package/dist/types/components/DataTable/virtual/useVirtualLines.d.ts +27 -0
- package/dist/types/components/DatePicker/Calendar.d.ts +14 -0
- package/dist/types/components/DatePicker/DatePicker.d.ts +5 -0
- package/dist/types/components/DatePicker/TimeField.d.ts +16 -0
- package/dist/types/components/DatePicker/index.d.ts +4 -0
- package/dist/types/components/DatePicker/useOneMonthPane.d.ts +2 -0
- package/dist/types/components/Dialog/Dialog.d.ts +56 -0
- package/dist/types/components/Dialog/DialogHost.d.ts +44 -0
- package/dist/types/components/DropdownMenu/DropdownMenu.d.ts +49 -0
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTable.d.ts +1 -6
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableActions.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/EditableTable/EditableTableCell.d.ts +2 -20
- package/dist/types/components/EditableTable/EditableTableRow.d.ts +14 -0
- package/dist/types/components/EditableTable/EditableTableSummary.d.ts +11 -0
- package/dist/types/{shared-web-ui/src → components}/EditableTable/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/EditableTable/useEditableTable.d.ts +3 -3
- package/dist/types/components/EditableTable/useRowAnimation.d.ts +12 -0
- package/dist/types/components/FieldContext/FieldContext.d.ts +3 -0
- package/dist/types/components/FieldContext/FieldProvider.d.ts +4 -0
- package/dist/types/{shared-web-ui/src → components}/FieldContext/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldContext/useField.d.ts +2 -29
- package/dist/types/components/FieldContext/useFieldSurface.d.ts +34 -0
- package/dist/types/{shared-web-ui/src → components}/FieldContext/useFormKeyboard.d.ts +1 -4
- package/dist/types/{shared-web-ui/src → components}/FieldWrapper/FieldWrapper.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/FieldWrapper/index.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/Field.d.ts +1 -1
- package/dist/types/components/Fields/FieldButton.d.ts +17 -0
- package/dist/types/{shared-web-ui/src → components}/Fields/Fields.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldBlur.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldChange.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldCondition.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldDisabled.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldRender.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldSelect.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldValidation.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/hooks/useFieldValue.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Fields/index.d.ts +1 -1
- package/dist/types/components/Floating/index.d.ts +3 -0
- package/dist/types/components/Floating/layers.d.ts +4 -0
- package/dist/types/components/Floating/scrollLock.d.ts +2 -0
- package/dist/types/components/Floating/useFloatingLayer.d.ts +20 -0
- package/dist/types/{shared-web-ui/src → components}/Form/Form.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Form/index.d.ts +1 -1
- package/dist/types/components/Image/ImagePicker.d.ts +23 -0
- package/dist/types/components/Image/ImageStrip.d.ts +13 -0
- package/dist/types/components/Image/ImageViewer.d.ts +16 -0
- package/dist/types/components/Image/index.d.ts +8 -0
- package/dist/types/components/Image/prepareImage.d.ts +19 -0
- package/dist/types/{shared-web-ui/src → components}/Input/Input.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Input/index.d.ts +1 -1
- package/dist/types/components/Popover/Popover.d.ts +25 -0
- package/dist/types/components/Popover/floatingPosition.d.ts +17 -0
- package/dist/types/components/Press/index.d.ts +2 -0
- package/dist/types/components/Press/usePress.d.ts +9 -0
- package/dist/types/{shared-web-ui/src → components}/Radio/Radio.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Radio/RadioGroup.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Radio/RadioGroupContext.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Radio/index.d.ts +1 -1
- package/dist/types/components/Scroll/ScrollRule.d.ts +2 -0
- package/dist/types/components/Scroll/ScrollStrip.d.ts +9 -0
- package/dist/types/components/Scroll/index.d.ts +4 -0
- package/dist/types/components/Scroll/labels.d.ts +5 -0
- package/dist/types/components/Scroll/scrollActivity.d.ts +14 -0
- package/dist/types/components/Scroll/ui.d.ts +1 -0
- package/dist/types/{shared-web-ui/src → components}/Select/Select.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Select/index.d.ts +1 -1
- package/dist/types/components/Select/useSelect.d.ts +2 -0
- package/dist/types/components/Sidebar/Sidebar.d.ts +24 -0
- package/dist/types/components/Skeleton/Skeleton.d.ts +18 -0
- package/dist/types/components/Stepper/Stepper.d.ts +17 -0
- package/dist/types/components/Stepper/index.d.ts +2 -0
- package/dist/types/{shared-web-ui/src → components}/Suggest/Suggest.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Suggest/SuggestionList.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Suggest/index.d.ts +2 -2
- package/dist/types/{shared-web-ui/src → components}/Suggest/searchFilters.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Suggest/useSuggest.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Switch/Switch.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Switch/index.d.ts +1 -1
- package/dist/types/components/Tabs/Tabs.d.ts +36 -0
- package/dist/types/components/Toast/ToastHost.d.ts +8 -0
- package/dist/types/components/Toast/ToastItem.d.ts +10 -0
- package/dist/types/{shared-web-ui/src → components}/Toast/toast.types.d.ts +0 -13
- package/dist/types/components/Tooltip/Tooltip.d.ts +9 -0
- package/dist/types/components/Tooltip/useTooltip.d.ts +15 -0
- package/dist/types/{shared-web-ui/src → components}/Typography/Typography.d.ts +1 -1
- package/dist/types/{shared-web-ui/src → components}/Typography/index.d.ts +1 -1
- package/dist/types/components/UIProvider/UIPortalContext.d.ts +2 -0
- package/dist/types/components/UIProvider/UIProvider.d.ts +13 -0
- package/dist/types/components/UIProvider/UIThemeContext.d.ts +9 -0
- package/dist/types/core/hooks/index.d.ts +3 -0
- package/dist/types/core/hooks/useDebounced.d.ts +7 -0
- package/dist/types/core/hooks/usePresence.d.ts +5 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/button.logic.d.ts +1 -1
- package/dist/types/core/logic/cellRules.logic.d.ts +32 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/chipinput.logic.d.ts +1 -13
- package/dist/types/{shared-logic/src/ui → core/logic}/collapsible.logic.d.ts +1 -8
- package/dist/types/{shared-logic/src/ui → core/logic}/colorScheme.d.ts +0 -14
- package/dist/types/core/logic/columnOrder.logic.d.ts +1 -0
- package/dist/types/core/logic/datePicker.logic.d.ts +136 -0
- package/dist/types/core/logic/displayOrder.logic.d.ts +4 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/editableTable.logic.d.ts +5 -28
- package/dist/types/core/logic/fieldControl.logic.d.ts +12 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/fieldWrapper.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/fields.logic.d.ts +1 -1
- package/dist/types/{shared-logic/src/ui → core/logic}/form.logic.d.ts +0 -8
- package/dist/types/core/logic/index.d.ts +33 -0
- package/dist/types/core/logic/keyboard.logic.d.ts +12 -0
- package/dist/types/core/logic/motion.logic.d.ts +1 -0
- package/dist/types/core/logic/navigation.logic.d.ts +6 -0
- package/dist/types/core/logic/popover.logic.d.ts +59 -0
- package/dist/types/core/logic/popupList.logic.d.ts +19 -0
- package/dist/types/core/logic/press.logic.d.ts +14 -0
- package/dist/types/core/logic/quickAddGrid.logic.d.ts +183 -0
- package/dist/types/core/logic/select.logic.d.ts +17 -0
- package/dist/types/core/logic/stepper.logic.d.ts +6 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/suggest.logic.d.ts +1 -1
- package/dist/types/core/logic/tableLayout.logic.d.ts +13 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/tableSummary.logic.d.ts +1 -20
- package/dist/types/core/logic/timeField.logic.d.ts +26 -0
- package/dist/types/core/logic/tooltip.logic.d.ts +11 -0
- package/dist/types/{shared-logic/src/ui → core/logic}/typography.logic.d.ts +1 -1
- package/dist/types/core/logic/uiScale.logic.d.ts +1 -0
- package/dist/types/core/logic/useMergeRefs.d.ts +2 -0
- package/dist/types/{shared-types/src/ui → core/types}/button.types.d.ts +1 -11
- package/dist/types/{shared-types/src/ui → core/types}/checkbox.types.d.ts +0 -4
- package/dist/types/{shared-types/src/ui → core/types}/chipinput.types.d.ts +0 -10
- package/dist/types/{shared-types/src/ui → core/types}/collapsible.types.d.ts +0 -18
- package/dist/types/core/types/common.types.d.ts +3 -0
- package/dist/types/core/types/control.types.d.ts +36 -0
- package/dist/types/core/types/datePicker.types.d.ts +46 -0
- package/dist/types/{shared-types/src/ui → core/types}/editableTable.types.d.ts +0 -79
- package/dist/types/core/types/field.types.d.ts +80 -0
- package/dist/types/{shared-types/src/ui → core/types}/fieldWrapper.types.d.ts +0 -10
- package/dist/types/{shared-types/src/ui → core/types}/fields.types.d.ts +0 -45
- package/dist/types/{shared-types/src/ui → core/types}/form.types.d.ts +0 -30
- package/dist/types/core/types/index.d.ts +22 -0
- package/dist/types/{shared-types/src/ui → core/types}/input.types.d.ts +0 -4
- package/dist/types/core/types/keyboard.types.d.ts +48 -0
- package/dist/types/core/types/navigation.types.d.ts +13 -0
- package/dist/types/{shared-types/src/ui → core/types}/radio.types.d.ts +0 -6
- package/dist/types/{shared-types/src/ui → core/types}/select.types.d.ts +0 -41
- package/dist/types/{shared-types/src/ui → core/types}/suggest.types.d.ts +1 -10
- package/dist/types/{shared-types/src/ui → core/types}/switch.types.d.ts +0 -4
- package/dist/types/{shared-types/src/ui → core/types}/table.types.d.ts +0 -59
- package/dist/types/core/types/tooltip.types.d.ts +43 -0
- package/dist/types/{shared-types/src/ui → core/types}/typography.types.d.ts +0 -4
- package/dist/types/index.d.ts +86 -0
- package/package.json +27 -26
- package/dist/types/published/dcs-ui/src/index.d.ts +0 -32
- package/dist/types/published/dcs-ui/src/publicLogic.d.ts +0 -35
- package/dist/types/published/dcs-ui/src/publicTypes.d.ts +0 -14
- package/dist/types/shared-logic/src/report/aggregate.d.ts +0 -29
- package/dist/types/shared-logic/src/report/canvas.d.ts +0 -106
- package/dist/types/shared-logic/src/report/conditions.d.ts +0 -18
- package/dist/types/shared-logic/src/report/constants.d.ts +0 -46
- package/dist/types/shared-logic/src/report/dataset.d.ts +0 -49
- package/dist/types/shared-logic/src/report/edit.d.ts +0 -188
- package/dist/types/shared-logic/src/report/fields.d.ts +0 -80
- package/dist/types/shared-logic/src/report/format.d.ts +0 -27
- package/dist/types/shared-logic/src/report/fromColumns.d.ts +0 -61
- package/dist/types/shared-logic/src/report/index.d.ts +0 -19
- package/dist/types/shared-logic/src/report/layout.d.ts +0 -85
- package/dist/types/shared-logic/src/report/metrics.d.ts +0 -62
- package/dist/types/shared-logic/src/report/migrate.d.ts +0 -77
- package/dist/types/shared-logic/src/report/paginate.d.ts +0 -40
- package/dist/types/shared-logic/src/report/renderers/html.d.ts +0 -29
- package/dist/types/shared-logic/src/report/renderers/pdfmake.d.ts +0 -45
- package/dist/types/shared-logic/src/report/resolve.d.ts +0 -40
- package/dist/types/shared-logic/src/report/scope.d.ts +0 -52
- package/dist/types/shared-logic/src/report/storage.d.ts +0 -112
- package/dist/types/shared-logic/src/report/validate.d.ts +0 -28
- package/dist/types/shared-logic/src/ui/cellRules.logic.d.ts +0 -67
- package/dist/types/shared-logic/src/ui/columnOrder.logic.d.ts +0 -12
- package/dist/types/shared-logic/src/ui/fieldControl.logic.d.ts +0 -24
- package/dist/types/shared-logic/src/ui/index.d.ts +0 -55
- package/dist/types/shared-logic/src/ui/keyboard.logic.d.ts +0 -72
- package/dist/types/shared-logic/src/ui/navigation.logic.d.ts +0 -30
- package/dist/types/shared-logic/src/ui/popover.logic.d.ts +0 -57
- package/dist/types/shared-logic/src/ui/popupList.logic.d.ts +0 -54
- package/dist/types/shared-logic/src/ui/select.logic.d.ts +0 -31
- package/dist/types/shared-logic/src/ui/tableLayout.logic.d.ts +0 -47
- package/dist/types/shared-logic/src/ui/tooltip.logic.d.ts +0 -35
- package/dist/types/shared-logic/src/ui/useMergeRefs.d.ts +0 -10
- package/dist/types/shared-types/src/report/bands.d.ts +0 -32
- package/dist/types/shared-types/src/report/blocks.d.ts +0 -181
- package/dist/types/shared-types/src/report/conditions.d.ts +0 -24
- package/dist/types/shared-types/src/report/dataset.d.ts +0 -106
- package/dist/types/shared-types/src/report/document.d.ts +0 -201
- package/dist/types/shared-types/src/report/index.d.ts +0 -9
- package/dist/types/shared-types/src/report/primitives.d.ts +0 -109
- package/dist/types/shared-types/src/report/registry.d.ts +0 -85
- package/dist/types/shared-types/src/report/storage.d.ts +0 -41
- package/dist/types/shared-types/src/report/template.d.ts +0 -92
- package/dist/types/shared-types/src/ui/common.types.d.ts +0 -14
- package/dist/types/shared-types/src/ui/control.types.d.ts +0 -133
- package/dist/types/shared-types/src/ui/field.types.d.ts +0 -200
- package/dist/types/shared-types/src/ui/index.d.ts +0 -37
- package/dist/types/shared-types/src/ui/keyboard.types.d.ts +0 -155
- package/dist/types/shared-types/src/ui/navigation.types.d.ts +0 -35
- package/dist/types/shared-types/src/ui/tooltip.types.d.ts +0 -68
- package/dist/types/shared-web-ui/src/AppBar/AppBar.d.ts +0 -25
- package/dist/types/shared-web-ui/src/ArrowKeyFocus/useArrowKeyFocus.d.ts +0 -29
- package/dist/types/shared-web-ui/src/Avatar/Avatar.d.ts +0 -36
- package/dist/types/shared-web-ui/src/Breadcrumbs/Breadcrumbs.d.ts +0 -70
- package/dist/types/shared-web-ui/src/Card/Card.d.ts +0 -33
- package/dist/types/shared-web-ui/src/ColorSchemeSelect/ColorSchemeSelect.d.ts +0 -26
- package/dist/types/shared-web-ui/src/CommandPalette/CommandPalette.d.ts +0 -52
- package/dist/types/shared-web-ui/src/Dialog/Dialog.d.ts +0 -101
- package/dist/types/shared-web-ui/src/Dialog/DialogHost.d.ts +0 -80
- package/dist/types/shared-web-ui/src/DropdownMenu/DropdownMenu.d.ts +0 -49
- package/dist/types/shared-web-ui/src/EditableTable/EditableTableRow.d.ts +0 -25
- package/dist/types/shared-web-ui/src/EditableTable/EditableTableSummary.d.ts +0 -22
- package/dist/types/shared-web-ui/src/EditableTable/useRowAnimation.d.ts +0 -44
- package/dist/types/shared-web-ui/src/FieldContext/FieldContext.d.ts +0 -18
- package/dist/types/shared-web-ui/src/FieldContext/FieldProvider.d.ts +0 -13
- package/dist/types/shared-web-ui/src/FieldContext/useFieldSurface.d.ts +0 -57
- package/dist/types/shared-web-ui/src/Fields/FieldButton.d.ts +0 -32
- package/dist/types/shared-web-ui/src/Popover/Popover.d.ts +0 -44
- package/dist/types/shared-web-ui/src/ReportDesigner/AlignedRowsEditor.d.ts +0 -4
- package/dist/types/shared-web-ui/src/ReportDesigner/BandList.d.ts +0 -26
- package/dist/types/shared-web-ui/src/ReportDesigner/BlockEditor.d.ts +0 -44
- package/dist/types/shared-web-ui/src/ReportDesigner/ColumnEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/ConditionEditor.d.ts +0 -7
- package/dist/types/shared-web-ui/src/ReportDesigner/FieldPicker.d.ts +0 -25
- package/dist/types/shared-web-ui/src/ReportDesigner/FieldSelect.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/FormatEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/Inspector.d.ts +0 -14
- package/dist/types/shared-web-ui/src/ReportDesigner/OptionsEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/ReportDesigner.d.ts +0 -34
- package/dist/types/shared-web-ui/src/ReportDesigner/StyleEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/TableEditor.d.ts +0 -10
- package/dist/types/shared-web-ui/src/ReportDesigner/WatermarkEditor.d.ts +0 -2
- package/dist/types/shared-web-ui/src/ReportDesigner/chipSources.d.ts +0 -6
- package/dist/types/shared-web-ui/src/ReportDesigner/icons.d.ts +0 -21
- package/dist/types/shared-web-ui/src/ReportDesigner/index.d.ts +0 -16
- package/dist/types/shared-web-ui/src/ReportDesigner/labels.d.ts +0 -34
- package/dist/types/shared-web-ui/src/ReportDesigner/parts.d.ts +0 -63
- package/dist/types/shared-web-ui/src/ReportDesigner/types.d.ts +0 -106
- package/dist/types/shared-web-ui/src/ReportPreview/ReportPreview.d.ts +0 -44
- package/dist/types/shared-web-ui/src/ReportPreview/index.d.ts +0 -1
- package/dist/types/shared-web-ui/src/Select/useSelect.d.ts +0 -2
- package/dist/types/shared-web-ui/src/Sidebar/Sidebar.d.ts +0 -55
- package/dist/types/shared-web-ui/src/Skeleton/Skeleton.d.ts +0 -33
- package/dist/types/shared-web-ui/src/Tabs/Tabs.d.ts +0 -79
- package/dist/types/shared-web-ui/src/Toast/ToastHost.d.ts +0 -22
- package/dist/types/shared-web-ui/src/Toast/ToastItem.d.ts +0 -19
- package/dist/types/shared-web-ui/src/Tooltip/Tooltip.d.ts +0 -25
- package/dist/types/shared-web-ui/src/Tooltip/useTooltip.d.ts +0 -24
- package/dist/types/shared-web-ui/src/UIProvider/UIPortalContext.d.ts +0 -16
- package/dist/types/shared-web-ui/src/UIProvider/UIProvider.d.ts +0 -54
- package/dist/types/shared-web-ui/src/UIProvider/UIThemeContext.d.ts +0 -17
- package/dist/types/shared-web-ui/src/index.d.ts +0 -78
- /package/dist/types/{shared-web-ui/src → components}/AppBar/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Avatar/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Badge/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Breadcrumbs/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Card/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/ColorSchemeSelect/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/CommandPalette/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Dialog/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/DropdownMenu/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Popover/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Sidebar/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Skeleton/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Suggest/fuseSearch.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Tabs/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Toast/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/Tooltip/index.d.ts +0 -0
- /package/dist/types/{shared-web-ui/src → components}/UIProvider/index.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/checkbox.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/input.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/radio.logic.d.ts +0 -0
- /package/dist/types/{shared-logic/src/ui → core/logic}/switch.logic.d.ts +0 -0
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
import type { FieldChangeEvent } from './control.types';
|
|
3
|
+
import type { FieldPopupProps, TextFieldProps } from './field.types';
|
|
4
|
+
export type DateDisplayFormat = 'dd-mm-yyyy' | 'dd/mm/yyyy' | 'yyyy-mm-dd';
|
|
5
|
+
export type DateTextOrder = 'dmy' | 'mdy' | 'ymd';
|
|
6
|
+
export interface DateRangeValue {
|
|
7
|
+
from: string;
|
|
8
|
+
to: string;
|
|
9
|
+
}
|
|
10
|
+
export interface DatePickerBaseProps extends Omit<TextFieldProps<string, HTMLInputElement, FieldChangeEvent<string>>, 'value' | 'onChange'>, FieldPopupProps {
|
|
11
|
+
withTime?: boolean;
|
|
12
|
+
min?: string;
|
|
13
|
+
max?: string;
|
|
14
|
+
displayFormat?: DateDisplayFormat;
|
|
15
|
+
textOrder?: DateTextOrder;
|
|
16
|
+
weekStart?: number;
|
|
17
|
+
months?: number;
|
|
18
|
+
currentMonthSide?: 'left' | 'right';
|
|
19
|
+
showOutsideDays?: boolean;
|
|
20
|
+
presets?: boolean | string[];
|
|
21
|
+
fyStartMonth?: number;
|
|
22
|
+
monthNames?: string[];
|
|
23
|
+
weekdayNames?: string[];
|
|
24
|
+
clearLabel?: string;
|
|
25
|
+
applyLabel?: string;
|
|
26
|
+
timeToggle?: boolean;
|
|
27
|
+
placement?: 'top' | 'top-start' | 'top-end' | 'bottom' | 'bottom-start' | 'bottom-end' | 'left' | 'left-start' | 'left-end' | 'right' | 'right-start' | 'right-end';
|
|
28
|
+
showCalendarIcon?: boolean;
|
|
29
|
+
clearable?: boolean;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
hint?: ReactNode;
|
|
32
|
+
error?: ReactNode;
|
|
33
|
+
}
|
|
34
|
+
export interface DatePickerSingleProps extends DatePickerBaseProps {
|
|
35
|
+
range?: false;
|
|
36
|
+
value?: string;
|
|
37
|
+
onChange?: (event: FieldChangeEvent<string>) => void;
|
|
38
|
+
onApply?: (value: string) => void;
|
|
39
|
+
}
|
|
40
|
+
export interface DatePickerRangeProps extends DatePickerBaseProps {
|
|
41
|
+
range: true;
|
|
42
|
+
value?: DateRangeValue;
|
|
43
|
+
onChange?: (event: FieldChangeEvent<DateRangeValue>) => void;
|
|
44
|
+
onApply?: (value: DateRangeValue) => void;
|
|
45
|
+
}
|
|
46
|
+
export type DatePickerProps = DatePickerSingleProps | DatePickerRangeProps;
|
|
@@ -2,15 +2,7 @@ import type { ReactNode, CSSProperties, ChangeEvent, KeyboardEvent } from 'react
|
|
|
2
2
|
import type { FieldKeyboardConfig } from './keyboard.types';
|
|
3
3
|
import type { TableColumnDisplayProps, TableSummaryConfig, SummaryLicenseConfig } from './table.types';
|
|
4
4
|
import type { CheckboxFieldDefinition, InputFieldDefinition, SwitchFieldDefinition, SelectFieldDefinition, SuggestFieldDefinition, RadioFieldDefinition, ButtonFieldDefinition, ChildFieldDefinition } from './fields.types';
|
|
5
|
-
/**
|
|
6
|
-
* A column: a field definition (what edits the value) plus the Table's display
|
|
7
|
-
* props (how the cell is laid out and what it shows when read-only).
|
|
8
|
-
*
|
|
9
|
-
* Intersected rather than added to `BaseFieldDefinition` so an ordinary form
|
|
10
|
-
* field never grows a meaningless `width` or `sticky`.
|
|
11
|
-
*/
|
|
12
5
|
export type EditableTableColumnDefinition<T = any> = (InputFieldDefinition<T> | SwitchFieldDefinition<T> | SelectFieldDefinition<T> | SuggestFieldDefinition<T> | RadioFieldDefinition<T> | CheckboxFieldDefinition<T> | ButtonFieldDefinition<T> | ChildFieldDefinition<T>) & TableColumnDisplayProps<T>;
|
|
13
|
-
/** Row operations a summary can drive — so a screen can put "Add from stock" beside its totals. */
|
|
14
6
|
export interface EditableTableSummaryActions {
|
|
15
7
|
addRow: () => void;
|
|
16
8
|
copyRow: () => void;
|
|
@@ -19,7 +11,6 @@ export interface EditableTableSummaryActions {
|
|
|
19
11
|
}
|
|
20
12
|
export interface EditableTableSummaryContext<T = any> {
|
|
21
13
|
rows: T[];
|
|
22
|
-
/** Resolved column totals, keyed by column `name`. */
|
|
23
14
|
totals: Record<string, number | string>;
|
|
24
15
|
focusedRowIndex: number | null;
|
|
25
16
|
actions: EditableTableSummaryActions;
|
|
@@ -46,24 +37,12 @@ export interface EditableTableAddConfig {
|
|
|
46
37
|
rowData: any;
|
|
47
38
|
tableData: any[];
|
|
48
39
|
}) => Record<string, any>;
|
|
49
|
-
/**
|
|
50
|
-
* The consumer's own veto on creating a row. Runs after the built-in policy below.
|
|
51
|
-
* (Was declared but never called before 2026-09-17 — it is wired now.)
|
|
52
|
-
*/
|
|
53
40
|
canAdd?: (context: {
|
|
54
41
|
rowIndex: number;
|
|
55
42
|
rowData: any;
|
|
56
43
|
tableData: any[];
|
|
57
44
|
}) => boolean;
|
|
58
|
-
/**
|
|
59
|
-
* Allow a new row while a BLANK one is already there. Default `false`: holding Enter at
|
|
60
|
-
* the end of a table used to append an empty row per press, so an invoice ended with a
|
|
61
|
-
* tail of blanks. With the default, the blank row must be filled before the next appears.
|
|
62
|
-
*/
|
|
63
45
|
allowWhenBlankRow?: boolean;
|
|
64
|
-
/**
|
|
65
|
-
* Allow a new row while some row still fails a `'block'` rule. Default `false`.
|
|
66
|
-
*/
|
|
67
46
|
allowWhenInvalid?: boolean;
|
|
68
47
|
}
|
|
69
48
|
export interface EditableTableDeleteConfig {
|
|
@@ -74,51 +53,31 @@ export interface EditableTableDeleteConfig {
|
|
|
74
53
|
tableData: any[];
|
|
75
54
|
}) => boolean;
|
|
76
55
|
}
|
|
77
|
-
/** One cell that failed, with the message the cell is showing. */
|
|
78
56
|
export interface EditableTableRowFailure {
|
|
79
57
|
cellindex: number;
|
|
80
|
-
/** The column's `name`, so a caller can report "Qty" without knowing column order. */
|
|
81
58
|
column: string;
|
|
82
59
|
message: string;
|
|
83
60
|
severity: 'block' | 'warn';
|
|
84
61
|
}
|
|
85
62
|
export interface EditableTableRowValidity {
|
|
86
63
|
rowIndex: number;
|
|
87
|
-
/** No failures at all — warnings included. */
|
|
88
64
|
valid: boolean;
|
|
89
|
-
/** At least one `'block'` failure: this row is what refuses a new row, and your save. */
|
|
90
65
|
blocked: boolean;
|
|
91
66
|
failures: EditableTableRowFailure[];
|
|
92
67
|
}
|
|
93
68
|
export interface EditableTableValidity {
|
|
94
|
-
/** Every row passes, warnings included. */
|
|
95
69
|
valid: boolean;
|
|
96
|
-
/** Nothing is BLOCKING — the answer a save button wants. */
|
|
97
70
|
blocked: boolean;
|
|
98
|
-
/** Only the rows with something to report. An untouched row is never judged. */
|
|
99
71
|
rows: EditableTableRowValidity[];
|
|
100
|
-
/** Where to send the operator first, or `null`. */
|
|
101
72
|
firstBlocking: {
|
|
102
73
|
rowIndex: number;
|
|
103
74
|
cellindex: number;
|
|
104
75
|
message: string;
|
|
105
76
|
} | null;
|
|
106
77
|
}
|
|
107
|
-
/**
|
|
108
|
-
* The table's imperative handle — the same shape of thing as `FormMethods`, obtained the
|
|
109
|
-
* same way (a `ref`), because a table is the other half of the same entry screen.
|
|
110
|
-
*
|
|
111
|
-
* The validity answers are already computed for the red edges; this hands them out, so a
|
|
112
|
-
* consumer's save asks "may I?" instead of re-implementing a single rule. For LIVE state —
|
|
113
|
-
* a Save button that disables itself as someone types — use the `onValidityChange` prop: a
|
|
114
|
-
* ref is imperative and re-renders nothing.
|
|
115
|
-
*/
|
|
116
78
|
export interface EditableTableMethods<T = any> {
|
|
117
|
-
/** Resolve every row's rules now. Synchronous: the rules are pure. */
|
|
118
79
|
validate: () => EditableTableValidity;
|
|
119
|
-
/** `true` when nothing blocks — the one-line form of `validate()`. */
|
|
120
80
|
isValid: () => boolean;
|
|
121
|
-
/** Focus the first blocking cell; `false` when there is nothing to go to. */
|
|
122
81
|
focusFirstInvalid: () => boolean;
|
|
123
82
|
getRows: () => T[];
|
|
124
83
|
getRowValidity: (rowIndex: number) => EditableTableRowValidity;
|
|
@@ -151,48 +110,18 @@ export interface EditableTableProps<T = any> {
|
|
|
151
110
|
title?: string | ReactNode;
|
|
152
111
|
footerConfig?: EditableTableFooterConfig;
|
|
153
112
|
onFocusChange?: (focus: EditableTableFocusState) => void;
|
|
154
|
-
/**
|
|
155
|
-
* Fires when the table's validity changes — for live UI, such as a Save button that
|
|
156
|
-
* disables itself. The imperative `ref` answers the same question at save time.
|
|
157
|
-
*/
|
|
158
113
|
onValidityChange?: (validity: EditableTableValidity) => void;
|
|
159
|
-
/**
|
|
160
|
-
* Animate rows arriving and leaving, and flash the cell focus lands on afterwards.
|
|
161
|
-
* Default `true`. `prefers-reduced-motion` switches it off regardless — including the
|
|
162
|
-
* short delay a leaving row needs, so nobody gets a slower delete for no animation.
|
|
163
|
-
*/
|
|
164
114
|
animateRows?: boolean;
|
|
165
115
|
copyConfig?: EditableTableCopyConfig;
|
|
166
116
|
addConfig?: EditableTableAddConfig;
|
|
167
117
|
deleteConfig?: EditableTableDeleteConfig;
|
|
168
|
-
/** Icons for action buttons — replaces direct react-icons imports */
|
|
169
118
|
addIcon?: ReactNode;
|
|
170
119
|
copyIcon?: ReactNode;
|
|
171
120
|
deleteIcon?: ReactNode;
|
|
172
121
|
additionalActions?: EditableTableAdditionalAction<T>[];
|
|
173
|
-
/**
|
|
174
|
-
* The area under the table — for everything that is not a column total.
|
|
175
|
-
*
|
|
176
|
-
* The config form is the client Table's `TableSummaryConfig`, unchanged, so a
|
|
177
|
-
* summary written for a report table works here as-is. The render form is the
|
|
178
|
-
* escape hatch: rows, resolved totals and the row actions, for custom figures
|
|
179
|
-
* or action buttons. Column totals themselves come from each column's
|
|
180
|
-
* `summable` / `summary` and render in the pinned footer row.
|
|
181
|
-
*/
|
|
182
122
|
summary?: TableSummaryConfig<T> | ((context: EditableTableSummaryContext<T>) => ReactNode);
|
|
183
|
-
/** Wraps a license-gated summary entry. Without it, gated entries render ungated. */
|
|
184
123
|
renderLicense?: (license: SummaryLicenseConfig, children: ReactNode) => ReactNode;
|
|
185
|
-
/**
|
|
186
|
-
* Height of the scrolling body. Bounded on purpose: the header pins to its top
|
|
187
|
-
* and the totals row to its bottom, so however many rows are added both stay
|
|
188
|
-
* visible. Default `'min(70vh, 700px)'`.
|
|
189
|
-
*/
|
|
190
124
|
maxHeight?: number | string;
|
|
191
|
-
/**
|
|
192
|
-
* Keyboard policy for every cell. Merged over `GRID_CELL_KEYBOARD_DEFAULTS`,
|
|
193
|
-
* so a table names only what it wants to change — most often `editKey`,
|
|
194
|
-
* since the default `Insert` is absent from Mac and compact keyboards.
|
|
195
|
-
*/
|
|
196
125
|
keyboard?: FieldKeyboardConfig;
|
|
197
126
|
[key: string]: any;
|
|
198
127
|
}
|
|
@@ -203,11 +132,6 @@ export interface EditableTableRowProps<T = any> {
|
|
|
203
132
|
columnFields: EditableTableColumnDefinition<any>[];
|
|
204
133
|
editableTableData: T;
|
|
205
134
|
onChange: (event: ChangeEvent<any>, rowIndex: number) => void;
|
|
206
|
-
/**
|
|
207
|
-
* @deprecated Cells reach the grid through `keyboard.onNavigate`, which the
|
|
208
|
-
* table sets once on a `FieldProvider`. Optional so a custom row renderer
|
|
209
|
-
* that still passes one keeps compiling.
|
|
210
|
-
*/
|
|
211
135
|
onKeyDown?: (event: KeyboardEvent<any>, rowIndex: number) => void;
|
|
212
136
|
onSelect?: (selected: any, fieldName: string, rowIndex: number) => void;
|
|
213
137
|
onCellFocus: (rowIndex: number, cellindex: number) => void;
|
|
@@ -216,11 +140,8 @@ export interface EditableTableRowProps<T = any> {
|
|
|
216
140
|
isFocusedRow: boolean;
|
|
217
141
|
focusedCellIndex: number | null;
|
|
218
142
|
tableDataKey?: string;
|
|
219
|
-
/** Render prop for authorize — passed through to Fields */
|
|
220
143
|
renderAuthorize?: (authorize: any, children: ReactNode) => ReactNode;
|
|
221
|
-
/** Render prop for tooltip — passed through to Fields */
|
|
222
144
|
renderTooltip?: (tooltipProps: any, children: ReactNode) => ReactNode;
|
|
223
|
-
/** Component registry — passed through to Fields */
|
|
224
145
|
componentRegistry?: any;
|
|
225
146
|
[key: string]: any;
|
|
226
147
|
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import type { CSSProperties, FocusEvent, KeyboardEvent, ReactNode } from 'react';
|
|
2
|
+
import type { DataAttributes } from './common.types';
|
|
3
|
+
import type { FieldTooltipSupport } from './fieldWrapper.types';
|
|
4
|
+
import type { ControlLabelPosition, ControlLayout, ControlSize, ControlVariant, FieldCellContext, FieldChangeEvent, FieldColor, ToggleVariant } from './control.types';
|
|
5
|
+
import type { FieldKeyboardConfig } from './keyboard.types';
|
|
6
|
+
export interface FieldIdentityProps<V = any, C = FieldChangeEvent<V>> {
|
|
7
|
+
id?: string;
|
|
8
|
+
name?: string;
|
|
9
|
+
value?: V;
|
|
10
|
+
defaultValue?: V;
|
|
11
|
+
onChange?: (event: C) => void;
|
|
12
|
+
}
|
|
13
|
+
export interface FieldSurfaceProps {
|
|
14
|
+
size?: ControlSize;
|
|
15
|
+
disabled?: boolean;
|
|
16
|
+
readOnly?: boolean;
|
|
17
|
+
}
|
|
18
|
+
export interface ControlSurfaceProps extends FieldSurfaceProps {
|
|
19
|
+
variant?: ControlVariant;
|
|
20
|
+
layout?: ControlLayout;
|
|
21
|
+
}
|
|
22
|
+
export interface ToggleSurfaceProps extends FieldSurfaceProps {
|
|
23
|
+
variant?: ToggleVariant;
|
|
24
|
+
color?: FieldColor;
|
|
25
|
+
labelPosition?: ControlLabelPosition;
|
|
26
|
+
}
|
|
27
|
+
export interface FieldChromeProps {
|
|
28
|
+
label?: ReactNode;
|
|
29
|
+
hint?: ReactNode;
|
|
30
|
+
error?: ReactNode;
|
|
31
|
+
required?: boolean;
|
|
32
|
+
className?: string;
|
|
33
|
+
labelClassName?: string;
|
|
34
|
+
style?: CSSProperties;
|
|
35
|
+
fullWidth?: boolean;
|
|
36
|
+
}
|
|
37
|
+
export interface FieldA11yProps {
|
|
38
|
+
'aria-label'?: string;
|
|
39
|
+
'aria-labelledby'?: string;
|
|
40
|
+
'aria-describedby'?: string;
|
|
41
|
+
'aria-required'?: boolean;
|
|
42
|
+
'aria-invalid'?: boolean;
|
|
43
|
+
'aria-activedescendant'?: string;
|
|
44
|
+
'aria-controls'?: string;
|
|
45
|
+
}
|
|
46
|
+
export type FieldFocusEvent = FocusEvent<HTMLElement>;
|
|
47
|
+
export interface FieldInteractionProps<E extends HTMLElement = HTMLElement> {
|
|
48
|
+
autoFocus?: boolean;
|
|
49
|
+
tabIndex?: number;
|
|
50
|
+
onFocus?: (event: FocusEvent<E>) => void;
|
|
51
|
+
onBlur?: (event: FocusEvent<E>) => void;
|
|
52
|
+
onKeyDown?: (event: KeyboardEvent<E>) => void;
|
|
53
|
+
keyboard?: FieldKeyboardConfig;
|
|
54
|
+
}
|
|
55
|
+
export type OpenReason = 'type' | 'focus' | 'key' | 'click' | 'select' | 'escape' | 'blur' | 'programmatic';
|
|
56
|
+
export interface FieldPopupProps {
|
|
57
|
+
open?: boolean;
|
|
58
|
+
defaultOpen?: boolean;
|
|
59
|
+
onOpenChange?: (open: boolean, reason: OpenReason) => void;
|
|
60
|
+
}
|
|
61
|
+
export interface FieldHandle {
|
|
62
|
+
focus(opts?: {
|
|
63
|
+
select?: boolean;
|
|
64
|
+
caret?: 'start' | 'end';
|
|
65
|
+
}): void;
|
|
66
|
+
blur(): void;
|
|
67
|
+
beginEdit(seed?: string): void;
|
|
68
|
+
endEdit(commit: boolean): void;
|
|
69
|
+
openPopup(reason?: OpenReason): void;
|
|
70
|
+
closePopup(reason?: OpenReason): void;
|
|
71
|
+
readonly isOpen: boolean;
|
|
72
|
+
readonly element: HTMLElement | null;
|
|
73
|
+
}
|
|
74
|
+
export type BaseFieldProps<V = any, E extends HTMLElement = HTMLElement, C = FieldChangeEvent<V>> = FieldIdentityProps<V, C> & FieldChromeProps & FieldA11yProps & FieldInteractionProps<E> & FieldCellContext & FieldTooltipSupport & DataAttributes;
|
|
75
|
+
export type TextFieldProps<V = any, E extends HTMLElement = HTMLElement, C = FieldChangeEvent<V>> = BaseFieldProps<V, E, C> & ControlSurfaceProps & {
|
|
76
|
+
placeholder?: string;
|
|
77
|
+
inputMode?: 'text' | 'decimal' | 'numeric' | 'tel' | 'search' | 'email' | 'url' | 'none';
|
|
78
|
+
spellCheck?: boolean;
|
|
79
|
+
};
|
|
80
|
+
export type ToggleFieldProps<V = any, E extends HTMLElement = HTMLInputElement, C = FieldChangeEvent<V>> = BaseFieldProps<V, E, C> & ToggleSurfaceProps;
|
|
@@ -1,26 +1,16 @@
|
|
|
1
1
|
import { CSSProperties, ReactNode, Ref } from 'react';
|
|
2
2
|
import type { TooltipProp, TooltipTrigger } from './tooltip.types';
|
|
3
3
|
import type { ControlLayout, ControlSize, ControlVariant } from './control.types';
|
|
4
|
-
/** @see ControlLayout — the shared vocabulary in `control.types`. */
|
|
5
4
|
export type FieldLayout = ControlLayout;
|
|
6
|
-
/** @see ControlSize — the shared vocabulary in `control.types`. */
|
|
7
5
|
export type FieldSize = ControlSize;
|
|
8
|
-
/** @see ControlVariant — the shared vocabulary in `control.types`. */
|
|
9
6
|
export type FieldVariant = ControlVariant;
|
|
10
7
|
export type { ToggleVariant } from './control.types';
|
|
11
|
-
/**
|
|
12
|
-
* Every control that renders through FieldWrapper accepts these, so a tooltip
|
|
13
|
-
* behaves identically on an Input, a Select or a Checkbox.
|
|
14
|
-
*/
|
|
15
8
|
export interface FieldTooltipSupport {
|
|
16
9
|
tooltip?: TooltipProp;
|
|
17
|
-
/** `icon` (default) puts a ⓘ after the label; `control` uses the field itself. */
|
|
18
10
|
tooltipTrigger?: TooltipTrigger;
|
|
19
11
|
}
|
|
20
12
|
export interface FieldWrapperProps extends FieldTooltipSupport {
|
|
21
13
|
label?: ReactNode;
|
|
22
|
-
/** ReactNode, not string: Checkbox/Radio/Switch allow rich error and helper
|
|
23
|
-
content, and they render their messages through this wrapper too. */
|
|
24
14
|
error?: ReactNode;
|
|
25
15
|
hint?: ReactNode;
|
|
26
16
|
required?: boolean;
|
|
@@ -48,30 +48,10 @@ export type ConditionRegexObject<T> = {
|
|
|
48
48
|
export type ConditionFunction<T> = (data: T, context?: ConditionContext) => boolean;
|
|
49
49
|
export type ConditionSimpleKey<T> = NestedKeys<T>;
|
|
50
50
|
export type Condition<T> = boolean | ConditionSimpleKey<T> | ConditionObject<T> | ConditionRegexObject<T> | ConditionFunction<T> | Array<ConditionSimpleKey<T> | ConditionObject<T> | ConditionRegexObject<T> | ConditionFunction<T>>;
|
|
51
|
-
/**
|
|
52
|
-
* One rule on one cell.
|
|
53
|
-
*
|
|
54
|
-
* Rules are **per cell and dynamic**, not per row and not static: a minimum-quantity rule
|
|
55
|
-
* belongs on Qty and S.Qty but not on Price, and it may not apply at all depending on other
|
|
56
|
-
* settings ("unsaved items allowed" switches the item rule off). So a rule speaks the same
|
|
57
|
-
* `Condition` vocabulary `disabled` and `render` already use — it sees the whole row, the
|
|
58
|
-
* defaults and the cell's position, and it can be a plain function when that is simpler.
|
|
59
|
-
*/
|
|
60
51
|
export interface CellRule<T> {
|
|
61
|
-
/** When this rule APPLIES at all. Omitted = always. */
|
|
62
52
|
when?: Condition<T>;
|
|
63
|
-
/** The cell is VALID while this holds. */
|
|
64
53
|
valid: Condition<T>;
|
|
65
|
-
/** Shown on the cell itself — red edge, message in the control's tooltip. */
|
|
66
54
|
message: string;
|
|
67
|
-
/**
|
|
68
|
-
* `'block'` (default) also traps in-grid keyboard movement in the cell until it is valid,
|
|
69
|
-
* and refuses a new row. `'warn'` only marks it.
|
|
70
|
-
*
|
|
71
|
-
* Neither severity hijacks the mouse, Tab out of the grid, or Escape: a pointer cannot be
|
|
72
|
-
* trapped without fighting the browser, so an invalid cell keeps its mark and blocks what
|
|
73
|
-
* it can — the next row, and the consumer's save.
|
|
74
|
-
*/
|
|
75
55
|
severity?: 'block' | 'warn';
|
|
76
56
|
}
|
|
77
57
|
export interface ConditionContext {
|
|
@@ -130,30 +110,17 @@ export interface EditableTableCustomPropContext<T> extends FieldEditableTablePro
|
|
|
130
110
|
basePath: string;
|
|
131
111
|
field: FieldDefinition<T>;
|
|
132
112
|
}
|
|
133
|
-
/**
|
|
134
|
-
* What a cell can ask its table to DO.
|
|
135
|
-
*
|
|
136
|
-
* Handed to a button cell's `onClick` so the button can act on its own row — delete it,
|
|
137
|
-
* copy it, write back what a modal returned — without the column definition closing over
|
|
138
|
-
* the table's state. Optional to use; a button that only reads `rowData` ignores it.
|
|
139
|
-
*/
|
|
140
113
|
export interface EditableTableCellActions {
|
|
141
114
|
addRow: (insertIndex?: number) => void;
|
|
142
115
|
copyRow: (insertIndex?: number) => void;
|
|
143
116
|
deleteRow: (rowIndex?: number) => void;
|
|
144
117
|
focusCell: (rowIndex: number, cellindex: number) => void;
|
|
145
|
-
/** Merge a patch into one row — the write-back path for a modal or a lookup. */
|
|
146
118
|
updateRow: (rowIndex: number, patch: Record<string, any>) => void;
|
|
147
119
|
}
|
|
148
|
-
/**
|
|
149
|
-
* Everything a button cell knows about where it was pressed. One argument, so a handler
|
|
150
|
-
* that needs none of it stays `() => doThing()`.
|
|
151
|
-
*/
|
|
152
120
|
export interface ButtonCellContext<T> {
|
|
153
121
|
rowIndex: number;
|
|
154
122
|
cellindex: number;
|
|
155
123
|
rowData: any;
|
|
156
|
-
/** This column's own value in that row, when the column names one. */
|
|
157
124
|
value: any;
|
|
158
125
|
tableData: any[];
|
|
159
126
|
actions: EditableTableCellActions;
|
|
@@ -169,13 +136,7 @@ export interface FieldEditableTableProps<T> {
|
|
|
169
136
|
onCellFocus?: (rowIndex: number, cellindex: number) => void;
|
|
170
137
|
registerCellRef: (rowIndex: number, cellindex: number, ref: any) => void;
|
|
171
138
|
onSelect?: (...args: any[]) => void;
|
|
172
|
-
/** The table's own row operations, for cells that act (see `EditableTableCellActions`). */
|
|
173
139
|
actions?: EditableTableCellActions;
|
|
174
|
-
/**
|
|
175
|
-
* @deprecated A cell reaches its container through `keyboard.onNavigate`,
|
|
176
|
-
* which the grid sets once on a `FieldProvider`. Optional so a custom row
|
|
177
|
-
* renderer that still supplies one keeps compiling.
|
|
178
|
-
*/
|
|
179
140
|
onKeyDown?: (event: any) => void;
|
|
180
141
|
[key: string]: any;
|
|
181
142
|
}
|
|
@@ -184,7 +145,6 @@ export interface BaseFieldDefinition<T> {
|
|
|
184
145
|
header?: string;
|
|
185
146
|
render?: Condition<T>;
|
|
186
147
|
disabled?: Condition<T>;
|
|
187
|
-
/** Validation for THIS cell — see `CellRule`. Evaluated per row, in order; first failure wins. */
|
|
188
148
|
rules?: Array<CellRule<T>>;
|
|
189
149
|
authorize?: FieldAuthorize;
|
|
190
150
|
tooltip?: FieldTooltipProps;
|
|
@@ -226,11 +186,6 @@ export interface CheckboxFieldDefinition<T> extends BaseFieldDefinition<T> {
|
|
|
226
186
|
export interface ButtonFieldDefinition<T> extends BaseFieldDefinition<T> {
|
|
227
187
|
field: 'button';
|
|
228
188
|
fprop?: Partial<ButtonProps>;
|
|
229
|
-
/**
|
|
230
|
-
* Column-level click, with the row/cell context and the table's actions — the generic
|
|
231
|
-
* form, since a button in row 7 must not need a column definition built for row 7.
|
|
232
|
-
* `fprop.onClick` still works and still receives only the DOM event.
|
|
233
|
-
*/
|
|
234
189
|
onClick?: (context: ButtonCellContext<T>) => void;
|
|
235
190
|
}
|
|
236
191
|
export interface ChildFieldDefinition<T> extends BaseFieldDefinition<T> {
|
|
@@ -4,8 +4,6 @@ import type { FieldDefinition, ErrorObject, TouchedObject } from './fields.types
|
|
|
4
4
|
import type { ControlSize } from './control.types';
|
|
5
5
|
import type { FieldKeyboardConfig } from './keyboard.types';
|
|
6
6
|
export type FormLayout = 'vertical' | 'horizontal' | 'grid' | 'inline';
|
|
7
|
-
/** @see ControlSize — a Form's size is the density every field inside it
|
|
8
|
-
inherits, so it has to span the same six steps the fields do. */
|
|
9
7
|
export type FormSize = ControlSize;
|
|
10
8
|
export type FormVariant = 'default' | 'card' | 'outlined' | 'elevated';
|
|
11
9
|
export interface FormSection<T = any> {
|
|
@@ -24,20 +22,13 @@ export interface FormSection<T = any> {
|
|
|
24
22
|
style?: CSSProperties;
|
|
25
23
|
}
|
|
26
24
|
export interface FormValidation<T = any> {
|
|
27
|
-
/** Validation schema (e.g. Yup schema) — passed to validate function */
|
|
28
25
|
schema?: any;
|
|
29
26
|
validateOnChange?: boolean;
|
|
30
27
|
validateOnBlur?: boolean;
|
|
31
28
|
validateOnSubmit?: boolean;
|
|
32
29
|
debounceMs?: number;
|
|
33
|
-
/** Custom validation function (runs after schema validation) */
|
|
34
30
|
customValidator?: (data: T) => Promise<ErrorObject> | ErrorObject;
|
|
35
31
|
showErrorsAfterTouched?: boolean;
|
|
36
|
-
/**
|
|
37
|
-
* App-provided validation function.
|
|
38
|
-
* Called with (schema, data) — should return { valid, errors }.
|
|
39
|
-
* Decouples the form from any specific validation library (Yup, Zod, etc).
|
|
40
|
-
*/
|
|
41
32
|
validate?: (schema: any, data: T) => Promise<{
|
|
42
33
|
valid: boolean;
|
|
43
34
|
errors: ErrorObject;
|
|
@@ -87,9 +78,7 @@ export interface FormHeader {
|
|
|
87
78
|
subtitle?: string | ReactNode;
|
|
88
79
|
icon?: ReactNode;
|
|
89
80
|
divider?: boolean;
|
|
90
|
-
/** Navigation link — app provides onNavigate callback to handle it */
|
|
91
81
|
navLink?: string;
|
|
92
|
-
/** Icon for the nav link button */
|
|
93
82
|
navIcon?: ReactNode;
|
|
94
83
|
actions?: ReactNode;
|
|
95
84
|
customHeader?: ReactNode;
|
|
@@ -102,12 +91,6 @@ export interface FormFooter {
|
|
|
102
91
|
className?: string;
|
|
103
92
|
}
|
|
104
93
|
export interface FormCallbacks<T = any> {
|
|
105
|
-
/**
|
|
106
|
-
* The generic here used to sit on the *implementer* — `<R = void>(...) => R | Promise<R>`
|
|
107
|
-
* — which meant the caller chose `R` and no ordinary callback could satisfy
|
|
108
|
-
* it: `onSubmit={(data) => {...}}` did not type-check without a cast. The
|
|
109
|
-
* return value is awaited and discarded, so the generic bought nothing.
|
|
110
|
-
*/
|
|
111
94
|
onSubmit?: (data: T, methods: FormMethods<T>, event?: FormEvent<HTMLFormElement>) => unknown;
|
|
112
95
|
onReset?: (methods: FormMethods<T>) => void;
|
|
113
96
|
onChange?: (data: T, changedField?: string, methods?: FormMethods<T>) => void;
|
|
@@ -115,9 +98,7 @@ export interface FormCallbacks<T = any> {
|
|
|
115
98
|
onError?: (errors: ErrorObject, methods: FormMethods<T>) => void;
|
|
116
99
|
onValidationSuccess?: (methods: FormMethods<T>) => void;
|
|
117
100
|
onUnhandledError?: (error: Error, methods: FormMethods<T>) => void;
|
|
118
|
-
/** Toast callback — replaces direct ReactToast import. Called with (type, message). */
|
|
119
101
|
onToast?: (type: 'success' | 'error' | 'info' | 'warning', message: string) => void;
|
|
120
|
-
/** Navigation callback — replaces direct useNavigate import. Called with (path). */
|
|
121
102
|
onNavigate?: (path: string) => void;
|
|
122
103
|
}
|
|
123
104
|
export interface FormProps<T = any> extends FormCallbacks<T> {
|
|
@@ -144,13 +125,6 @@ export interface FormProps<T = any> extends FormCallbacks<T> {
|
|
|
144
125
|
loadingMessage?: string;
|
|
145
126
|
disabled?: boolean;
|
|
146
127
|
readonly?: boolean;
|
|
147
|
-
/**
|
|
148
|
-
* The keyboard policy for every field in this form.
|
|
149
|
-
*
|
|
150
|
-
* `{ enter: 'next' }` gives traditional ERP entry — Enter walks the fields
|
|
151
|
-
* and, past the last one, submits; Ctrl+Enter submits from anywhere. The
|
|
152
|
-
* default stays `'submit'`, which is what a `<form>` does on the web.
|
|
153
|
-
*/
|
|
154
128
|
keyboard?: FieldKeyboardConfig;
|
|
155
129
|
formRef?: MutableRefObject<FormMethods<T> | null>;
|
|
156
130
|
children?: ReactNode | ((data: T, methods: FormMethods<T>) => ReactNode);
|
|
@@ -164,13 +138,9 @@ export interface FormProps<T = any> extends FormCallbacks<T> {
|
|
|
164
138
|
requiredIndicator?: ReactNode;
|
|
165
139
|
enableNestedFields?: boolean;
|
|
166
140
|
debug?: boolean;
|
|
167
|
-
/** Render prop for loading overlay — replaces direct FullPageLoading import */
|
|
168
141
|
renderLoading?: (isOpen: boolean, message?: string) => ReactNode;
|
|
169
|
-
/** Render prop for authorize wrapping — passed through to Fields */
|
|
170
142
|
renderAuthorize?: (authorize: any, children: ReactNode) => ReactNode;
|
|
171
|
-
/** Render prop for tooltip wrapping — passed through to Fields */
|
|
172
143
|
renderTooltip?: (tooltipProps: any, children: ReactNode) => ReactNode;
|
|
173
|
-
/** Component registry — passed through to Fields */
|
|
174
144
|
componentRegistry?: any;
|
|
175
145
|
}
|
|
176
146
|
export interface FormState<T = any> {
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export * from './control.types';
|
|
2
|
+
export * from './tooltip.types';
|
|
3
|
+
export * from './typography.types';
|
|
4
|
+
export * from './button.types';
|
|
5
|
+
export * from './fieldWrapper.types';
|
|
6
|
+
export * from './keyboard.types';
|
|
7
|
+
export * from './field.types';
|
|
8
|
+
export * from './checkbox.types';
|
|
9
|
+
export * from './radio.types';
|
|
10
|
+
export * from './switch.types';
|
|
11
|
+
export * from './input.types';
|
|
12
|
+
export * from './datePicker.types';
|
|
13
|
+
export * from './select.types';
|
|
14
|
+
export * from './suggest.types';
|
|
15
|
+
export * from './collapsible.types';
|
|
16
|
+
export * from './fields.types';
|
|
17
|
+
export * from './form.types';
|
|
18
|
+
export * from './chipinput.types';
|
|
19
|
+
export * from './table.types';
|
|
20
|
+
export * from './editableTable.types';
|
|
21
|
+
export * from './navigation.types';
|
|
22
|
+
export type { DataAttributes } from './common.types';
|
|
@@ -21,10 +21,6 @@ export interface IconConfig {
|
|
|
21
21
|
end?: ReactNode;
|
|
22
22
|
onClick?: (type: 'start' | 'end') => void;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
* @see FieldCellContext — the one grid-cell contract, in `control.types`.
|
|
26
|
-
* Kept as a name because Select imports it and the published barrel exports it.
|
|
27
|
-
*/
|
|
28
24
|
export type InputEditableTableCellProps = FieldCellContext;
|
|
29
25
|
export interface InputProps extends TextFieldProps<string | number, HTMLInputElement | HTMLTextAreaElement, ChangeEvent<HTMLInputElement | HTMLTextAreaElement>> {
|
|
30
26
|
type?: InputType;
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
export type FieldWidget = 'text' | 'number' | 'textarea' | 'select' | 'suggest' | 'date' | 'toggle' | 'button' | 'custom';
|
|
2
|
+
export type NavAction = 'next' | 'prev' | 'up' | 'down' | 'left' | 'right' | 'firstCell' | 'lastCell' | 'firstCellOfTable' | 'lastCellOfTable' | 'pageUp' | 'pageDown' | 'newRow' | 'copyRow' | 'deleteRow' | 'edit' | 'commit' | 'revert' | 'clear' | 'submit' | 'exitGrid' | 'none';
|
|
3
|
+
export type GridMode = 'navigate' | 'edit';
|
|
4
|
+
export interface FieldKeyState {
|
|
5
|
+
mode: GridMode;
|
|
6
|
+
isOpen: boolean;
|
|
7
|
+
hasOptions?: boolean;
|
|
8
|
+
caretAtStart?: boolean;
|
|
9
|
+
caretAtEnd?: boolean;
|
|
10
|
+
hasSelection?: boolean;
|
|
11
|
+
isEmpty?: boolean;
|
|
12
|
+
multi?: boolean;
|
|
13
|
+
}
|
|
14
|
+
export interface KeyEventLike {
|
|
15
|
+
key: string;
|
|
16
|
+
ctrlKey?: boolean;
|
|
17
|
+
shiftKey?: boolean;
|
|
18
|
+
altKey?: boolean;
|
|
19
|
+
metaKey?: boolean;
|
|
20
|
+
}
|
|
21
|
+
export type FieldKeyAction = 'native' | 'open' | 'close' | 'highlightNext' | 'highlightPrev' | 'highlightFirst' | 'highlightLast' | 'highlightLeft' | 'highlightRight' | 'highlightPrevPage' | 'highlightNextPage' | 'pick' | 'toggleOption' | 'beginEdit' | 'clear' | 'stepUp' | 'stepDown' | 'insertNewline';
|
|
22
|
+
export type KeyResolution = {
|
|
23
|
+
owner: 'field';
|
|
24
|
+
action: FieldKeyAction;
|
|
25
|
+
preventDefault: boolean;
|
|
26
|
+
} | {
|
|
27
|
+
owner: 'container';
|
|
28
|
+
action: NavAction;
|
|
29
|
+
preventDefault: boolean;
|
|
30
|
+
};
|
|
31
|
+
export interface FieldKeyboardConfig {
|
|
32
|
+
mode?: 'field' | 'grid';
|
|
33
|
+
enter?: 'next' | 'submit' | 'native' | 'none';
|
|
34
|
+
arrows?: 'container' | 'native';
|
|
35
|
+
arrowsInEdit?: 'cell' | 'caret';
|
|
36
|
+
typeBehaviour?: 'replace' | 'append';
|
|
37
|
+
editKey?: string;
|
|
38
|
+
openOn?: 'focus' | 'type' | 'manual';
|
|
39
|
+
advanceOnSelect?: boolean;
|
|
40
|
+
stepKeys?: 'none' | 'arrows' | 'ctrlArrows';
|
|
41
|
+
bindings?: Record<string, NavAction>;
|
|
42
|
+
onNavigate?: (action: NavAction, event: KeyEventLike) => void;
|
|
43
|
+
}
|
|
44
|
+
export interface KeyResolutionContext {
|
|
45
|
+
widget: FieldWidget;
|
|
46
|
+
state: FieldKeyState;
|
|
47
|
+
config: FieldKeyboardConfig;
|
|
48
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface NavItem {
|
|
3
|
+
id: string;
|
|
4
|
+
label: ReactNode;
|
|
5
|
+
icon?: ReactNode;
|
|
6
|
+
badge?: ReactNode;
|
|
7
|
+
keywords?: string;
|
|
8
|
+
disabled?: boolean;
|
|
9
|
+
href?: string;
|
|
10
|
+
props?: Record<string, unknown>;
|
|
11
|
+
children?: NavItem[];
|
|
12
|
+
group?: boolean;
|
|
13
|
+
}
|
|
@@ -19,13 +19,7 @@ export interface RadioGroupContextValue {
|
|
|
19
19
|
export interface RadioProps extends ToggleFieldProps<string | number, HTMLInputElement, ChangeEvent<HTMLInputElement>> {
|
|
20
20
|
checked?: boolean;
|
|
21
21
|
defaultChecked?: boolean;
|
|
22
|
-
/** Required here, unlike every other field: a radio without a value cannot
|
|
23
|
-
report which option it is. */
|
|
24
22
|
value: string | number;
|
|
25
|
-
/**
|
|
26
|
-
* @deprecated Use `hint` — the shared name for this slot, which is what
|
|
27
|
-
* FieldWrapper renders. Kept until the components migrate (step 0c).
|
|
28
|
-
*/
|
|
29
23
|
helperText?: string | ReactNode;
|
|
30
24
|
radioClassName?: string;
|
|
31
25
|
checkedIcon?: ReactNode;
|