@ostack.tech/ui 1.2.0-beta.0 → 1.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/chunks/en-DGLb7rrz.js.map +1 -1
- package/dist/locales/fr-FR.js.map +1 -1
- package/dist/locales/pt-PT.js.map +1 -1
- package/dist/ostack-ui.css +8 -16
- package/dist/ostack-ui.js +26835 -7981
- package/dist/ostack-ui.js.map +1 -1
- package/package.json +15 -13
- package/scss/components/Button/_Button.scss +4 -18
- package/scss/components/ButtonGroup/_ButtonGroup.scss +2 -6
- package/scss/components/Calendar/_Calendar-variables.scss +4 -12
- package/scss/components/Calendar/_Calendar.scss +19 -38
- package/scss/components/Card/_Card-variables.scss +4 -12
- package/scss/components/Card/_Card.scss +8 -28
- package/scss/components/Collapsible/_Collapsible.scss +2 -8
- package/scss/components/CommandMenu/_CommandMenu-variables.scss +2 -6
- package/scss/components/CommandMenu/_CommandMenu.scss +5 -13
- package/scss/components/ControlAddon/_ControlAddon-variables.scss +4 -12
- package/scss/components/ControlAddon/_ControlAddon.scss +16 -52
- package/scss/components/DataTable/_DataTable.scss +1 -2
- package/scss/components/DateRangeInput/_DateRangeInput-variables.scss +1 -3
- package/scss/components/DateRangeInput/_DateRangeInput.scss +7 -21
- package/scss/components/Dialog/_Dialog.scss +6 -19
- package/scss/components/DropdownMenu/_DropdownMenu.scss +1 -2
- package/scss/components/Feedback/_Feedback-variables.scss +1 -6
- package/scss/components/Feedback/_Feedback.scss +8 -33
- package/scss/components/FieldGroup/_FieldGroup.scss +1 -4
- package/scss/components/Grid/_Grid.scss +4 -12
- package/scss/components/HelperText/_HelperText.scss +1 -4
- package/scss/components/Input/_Input.scss +11 -32
- package/scss/components/Label/_Label.scss +2 -6
- package/scss/components/Link/_Link.scss +1 -2
- package/scss/components/MenuList/_MenuList.scss +2 -6
- package/scss/components/Overlay/_Overlay-variables.scss +1 -3
- package/scss/components/Overlay/_Overlay.scss +2 -4
- package/scss/components/Root/_Root.scss +4 -16
- package/scss/components/Select/_Select-variables.scss +4 -12
- package/scss/components/Select/_Select.scss +1 -2
- package/scss/components/Separator/_Separator.scss +2 -8
- package/scss/components/Spinner/_Spinner.scss +2 -8
- package/scss/components/Stepper/_Stepper-variables.scss +5 -15
- package/scss/components/Stepper/_Stepper.scss +2 -5
- package/scss/components/Table/_Table-variables.scss +16 -47
- package/scss/components/Table/_Table.scss +30 -112
- package/scss/components/Tabs/_Tabs-variables.scss +15 -43
- package/scss/components/Tabs/_Tabs.scss +13 -46
- package/scss/components/Tag/_Tag-variables.scss +1 -4
- package/scss/components/Tag/_Tag.scss +5 -14
- package/scss/components/Toast/_Toast.scss +3 -8
- package/scss/components/Tooltip/_Tooltip-variables.scss +1 -3
- package/scss/components/Tooltip/_Tooltip.scss +4 -12
- package/scss/scss/_base-variables.scss +6 -7
- package/scss/scss/placeholders/button/_button.scss +2 -8
- package/scss/scss/placeholders/checkable/_checkable.scss +15 -60
- package/scss/scss/placeholders/control/_control-variables.scss +3 -10
- package/scss/scss/placeholders/control/_control.scss +10 -38
- package/scss/scss/placeholders/menu/_menu-variables.scss +14 -42
- package/scss/scss/placeholders/menu/_menu.scss +22 -82
- package/scss/scss/placeholders/notification/_notification.scss +2 -4
- package/scss/scss/placeholders/popover/_popover-variables.scss +1 -3
- package/scss/scss/placeholders/popover/_popover.scss +4 -11
- package/scss/scss/utils/_breakpoints.scss +1 -4
- package/scss/scss/utils/_responsive-values.scss +2 -5
- package/scss/scss/utils/_spinner.scss +1 -2
- package/types/components/Actions/Action.d.ts +6 -6
- package/types/components/Actions/ActionGroup.d.ts +10 -14
- package/types/components/Actions/ActionMenu.d.ts +13 -17
- package/types/components/Actions/ActionSplit.d.ts +4 -4
- package/types/components/Actions/Actions.d.ts +20 -25
- package/types/components/Actions/ActionsSecondary.d.ts +1 -1
- package/types/components/Alert/Alert.d.ts +8 -9
- package/types/components/Alert/AlertTitle.d.ts +3 -3
- package/types/components/AlertDialog/AlertDialog.d.ts +16 -20
- package/types/components/AlertDialog/AlertDialogAction.d.ts +2 -2
- package/types/components/AlertDialog/AlertDialogCancel.d.ts +2 -2
- package/types/components/AlertDialog/AlertDialogContent.d.ts +2 -3
- package/types/components/AlertDialog/AlertDialogDescription.d.ts +4 -5
- package/types/components/Button/Button.d.ts +32 -39
- package/types/components/ButtonGroup/ButtonGroup.d.ts +3 -3
- package/types/components/Calendar/Calendar.d.ts +2 -3
- package/types/components/Calendar/CalendarDay.d.ts +3 -4
- package/types/components/Calendar/CalendarHeader.d.ts +2 -2
- package/types/components/Card/Card.d.ts +6 -13
- package/types/components/Card/CardBody.d.ts +3 -3
- package/types/components/Card/CardFooter.d.ts +3 -3
- package/types/components/Card/CardHeader.d.ts +3 -3
- package/types/components/Card/CardTitle.d.ts +3 -3
- package/types/components/Checkbox/Checkbox.d.ts +17 -29
- package/types/components/CheckboxGroup/CheckboxGroup.d.ts +24 -38
- package/types/components/CheckboxGroup/CheckboxGroupContext.d.ts +5 -6
- package/types/components/CloseButton/CloseButton.d.ts +1 -1
- package/types/components/Code/Code.d.ts +4 -5
- package/types/components/Collapsible/Collapsible.d.ts +3 -9
- package/types/components/Collapsible/CollapsibleTrigger.d.ts +1 -4
- package/types/components/CommandMenu/CommandMenu.d.ts +6 -7
- package/types/components/CommandMenu/CommandMenuDialog.d.ts +6 -10
- package/types/components/CommandMenu/CommandMenuItem.d.ts +3 -3
- package/types/components/CommandMenu/cmdk/index.d.ts +73 -112
- package/types/components/Container/Container.d.ts +17 -21
- package/types/components/Control/Control.d.ts +21 -27
- package/types/components/Control/ControlWithContainerRef.d.ts +5 -6
- package/types/components/ControlAddon/ControlAddon.d.ts +9 -13
- package/types/components/ControlCode/ControlCode.d.ts +5 -8
- package/types/components/DataTable/DataTable.d.ts +59 -90
- package/types/components/DataTable/DataTableApi.d.ts +11 -12
- package/types/components/DataTable/DataTableColumn.d.ts +18 -21
- package/types/components/DataTable/DataTableColumnGroup.d.ts +3 -4
- package/types/components/DataTable/DataTableColumns.d.ts +4 -4
- package/types/components/DataTable/DataTableContent.d.ts +2 -5
- package/types/components/DataTable/DataTableEmptyOrLoadingRows.d.ts +1 -4
- package/types/components/DataTable/DataTableFilter.d.ts +3 -3
- package/types/components/DataTable/DataTablePagination.d.ts +5 -9
- package/types/components/DataTable/DataTableRowsPerPage.d.ts +4 -5
- package/types/components/DataTable/DataTableSelectionTrigger.d.ts +5 -11
- package/types/components/DataTable/PagedDataTablePagination.d.ts +1 -1
- package/types/components/DataTable/PagedDataTableRows.d.ts +1 -1
- package/types/components/DataTable/ScrolledDataTableRows.d.ts +1 -1
- package/types/components/DataTable/index.d.ts +1 -1
- package/types/components/DataTable/{getRowKey.d.ts → keyUtils.d.ts} +2 -0
- package/types/components/DataTable/spliceWindow.d.ts +3 -4
- package/types/components/DateInput/DateInput.d.ts +21 -34
- package/types/components/DateRangeInput/DateRangeInput.d.ts +41 -70
- package/types/components/DescriptionList/DescriptionList.d.ts +5 -10
- package/types/components/Dialog/Dialog.d.ts +9 -11
- package/types/components/Dialog/DialogContent.d.ts +3 -4
- package/types/components/Dialog/DialogDescription.d.ts +2 -3
- package/types/components/DropdownMenu/DropdownMenu.d.ts +10 -21
- package/types/components/DropdownMenu/DropdownMenuCheckboxItem.d.ts +1 -1
- package/types/components/DropdownMenu/DropdownMenuItem.d.ts +3 -3
- package/types/components/DropdownMenu/DropdownMenuRadioItem.d.ts +1 -1
- package/types/components/DropdownMenu/DropdownMenuSubContent.d.ts +1 -4
- package/types/components/DropdownMenu/DropdownMenuSubTrigger.d.ts +1 -4
- package/types/components/ErrorBoundary/ErrorBoundary.d.ts +21 -27
- package/types/components/Feedback/Feedback.d.ts +6 -6
- package/types/components/Feedback/FeedbackPopover.d.ts +3 -3
- package/types/components/Feedback/FeedbackProvider.d.ts +3 -4
- package/types/components/Feedback/feedbackUtils.d.ts +5 -8
- package/types/components/Field/Field.d.ts +9 -11
- package/types/components/Field/fieldUtils.d.ts +2 -2
- package/types/components/FieldGroup/FieldGroup.d.ts +4 -5
- package/types/components/FieldGroup/FieldGroupBody.d.ts +3 -3
- package/types/components/FieldGroup/FieldGroupHeader.d.ts +4 -4
- package/types/components/FieldGroup/FieldGroupTitle.d.ts +3 -3
- package/types/components/Form/Form.d.ts +25 -40
- package/types/components/Form/FormContext.d.ts +2 -2
- package/types/components/Form/FormError.d.ts +6 -11
- package/types/components/Form/FormState.d.ts +2 -2
- package/types/components/Form/formUtils.d.ts +1 -1
- package/types/components/Form/useRegisterFormControl.d.ts +1 -1
- package/types/components/Grid/Grid.d.ts +19 -24
- package/types/components/Heading/Heading.d.ts +9 -10
- package/types/components/HelperText/HelperText.d.ts +3 -3
- package/types/components/HelperText/HelperTextProvider.d.ts +3 -4
- package/types/components/Icon/Icon.d.ts +9 -16
- package/types/components/IconButton/IconButton.d.ts +35 -53
- package/types/components/Input/Input.d.ts +5 -12
- package/types/components/Keybinds/KeyPress.d.ts +1 -1
- package/types/components/Keybinds/Keybind.d.ts +1 -1
- package/types/components/Keybinds/Keybinds.d.ts +3 -9
- package/types/components/Keyboard/Keyboard.d.ts +7 -8
- package/types/components/Label/Label.d.ts +5 -6
- package/types/components/Label/LabelProvider.d.ts +3 -4
- package/types/components/Label/labelUtils.d.ts +2 -2
- package/types/components/Layer/Layer.d.ts +4 -4
- package/types/components/Link/Link.d.ts +13 -13
- package/types/components/Mark/Mark.d.ts +6 -7
- package/types/components/MenuList/MenuList.d.ts +6 -7
- package/types/components/MenuList/MenuListGroup.d.ts +5 -6
- package/types/components/MenuList/MenuListItem.d.ts +21 -25
- package/types/components/NumericInput/NumericInput.d.ts +20 -34
- package/types/components/NumericInput/numericInputUtils.d.ts +4 -5
- package/types/components/Output/Output.d.ts +12 -13
- package/types/components/Popover/Popover.d.ts +6 -13
- package/types/components/Popover/PopoverAnchor.d.ts +2 -2
- package/types/components/Popover/PopoverTrigger.d.ts +2 -2
- package/types/components/Portal/Portal.d.ts +3 -4
- package/types/components/Printer/Printer.d.ts +40 -54
- package/types/components/Printer/PrinterContent.d.ts +6 -6
- package/types/components/Printer/PrinterContentContext.d.ts +4 -5
- package/types/components/Printer/PrinterContext.d.ts +4 -4
- package/types/components/Printer/PrinterTrigger.d.ts +5 -6
- package/types/components/Printer/index.d.ts +1 -1
- package/types/components/RadioGroup/Radio.d.ts +10 -13
- package/types/components/RadioGroup/RadioGroup.d.ts +21 -34
- package/types/components/Root/Root.d.ts +21 -27
- package/types/components/Root/RootContext.d.ts +1 -4
- package/types/components/Select/Option.d.ts +3 -3
- package/types/components/Select/Select.d.ts +14 -26
- package/types/components/Select/SelectNative.d.ts +1 -1
- package/types/components/Separator/Separator.d.ts +3 -4
- package/types/components/Slot/Slottable.d.ts +1 -4
- package/types/components/Spinner/Spinner.d.ts +5 -12
- package/types/components/Stack/Stack.d.ts +9 -13
- package/types/components/Stepper/Step.d.ts +6 -6
- package/types/components/Stepper/StepContent.d.ts +3 -3
- package/types/components/Stepper/StepList.d.ts +4 -5
- package/types/components/Stepper/Stepper.d.ts +4 -5
- package/types/components/Stepper/StepperFinishTrigger.d.ts +3 -9
- package/types/components/Stepper/StepperNextTrigger.d.ts +3 -6
- package/types/components/Stepper/StepperPreviousTrigger.d.ts +4 -10
- package/types/components/Table/Table.d.ts +42 -58
- package/types/components/Table/TableCell.d.ts +15 -19
- package/types/components/Table/TableColumn.d.ts +15 -27
- package/types/components/Table/TableColumnGroup.d.ts +2 -3
- package/types/components/Table/TableHead.d.ts +5 -5
- package/types/components/Tabs/TabContent.d.ts +2 -2
- package/types/components/Tabs/TabList.d.ts +1 -1
- package/types/components/Tabs/Tabs.d.ts +4 -8
- package/types/components/Tag/Tag.d.ts +8 -8
- package/types/components/TextArea/TextArea.d.ts +7 -13
- package/types/components/Toast/Toast.d.ts +25 -38
- package/types/components/Toast/ToastProvider.d.ts +2 -5
- package/types/components/Toast/ToastViewport.d.ts +2 -5
- package/types/components/Tooltip/Tooltip.d.ts +11 -11
- package/types/components/VisuallyHidden/VisuallyHidden.d.ts +7 -11
- package/types/index.d.ts +2 -1
- package/types/providers/AlertDialogProvider/AlertDialogProviderContext.d.ts +17 -19
- package/types/providers/AlertDialogProvider/useAlertDialog.d.ts +50 -58
- package/types/providers/DocumentTitleProvider/DocumentTitle.d.ts +1 -4
- package/types/providers/ErrorReportingProvider/ErrorReport.d.ts +4 -7
- package/types/providers/ErrorReportingProvider/ErrorReportingProvider.d.ts +12 -17
- package/types/providers/LocalizationProvider/useLocale.d.ts +1 -4
- package/types/providers/PrefixProvider/defaultPrefix.d.ts +2 -3
- package/types/providers/PrefixProvider/usePrefix.d.ts +3 -6
- package/types/providers/ToastManagerProvider/ToastManagerContext.d.ts +3 -3
- package/types/providers/ToastManagerProvider/useToastManager.d.ts +11 -14
- package/types/utils/__tests__/useCombinedRef.test.d.ts +1 -0
- package/types/utils/breakpoints.d.ts +5 -6
- package/types/utils/combineAriaIds.d.ts +1 -1
- package/types/utils/cx.d.ts +2 -5
- package/types/utils/filtering.d.ts +2 -2
- package/types/utils/keyboardShortcut.d.ts +18 -25
- package/types/utils/navigate.d.ts +2 -2
- package/types/utils/numericStringUtils.d.ts +6 -13
- package/types/utils/parseChildren.d.ts +5 -9
- package/types/utils/reactCompilerUtils.d.ts +7 -0
- package/types/utils/setNativeProperty.d.ts +2 -3
- package/types/utils/sorting.d.ts +2 -2
- package/types/utils/useCombinedEventHandler.d.ts +30 -0
- package/types/utils/useCombinedRef.d.ts +6 -4
- package/types/utils/useCssVars.d.ts +9 -20
- package/types/utils/useDateTransformer.d.ts +4 -8
- package/types/utils/useIntersectionObserver.d.ts +2 -5
- package/types/utils/useLatestRef.d.ts +1 -2
- package/types/utils/useLocation.d.ts +5 -8
- package/types/utils/useMeasure.d.ts +2 -5
- package/types/utils/useMediaQuery.d.ts +1 -4
- package/types/utils/useNumericTransformer.d.ts +12 -19
- package/types/utils/usePrevious.d.ts +3 -4
- package/types/utils/useResponsiveValues.d.ts +7 -10
- package/types/utils/useScrollPosition.d.ts +1 -6
- package/types/utils/useSearchParam.d.ts +2 -6
- package/types/utils/useSearchParams.d.ts +1 -4
- package/types/utils/useSpacing.d.ts +1 -4
- package/types/utils/zustandUtils.d.ts +3 -2
- package/types/utils/combineEventHandlers.d.ts +0 -24
- /package/types/utils/__tests__/{combineEventHandlers.test.d.ts → useCombinedEventHandler.test.d.ts} +0 -0
|
@@ -12,35 +12,33 @@ export interface DataTableColumnObject<T = unknown, TValue = any> extends Omit<T
|
|
|
12
12
|
/**
|
|
13
13
|
* Locale of the formatted value.
|
|
14
14
|
*
|
|
15
|
-
* Used when sorting and filtering when a custom `compare`/`match` is not
|
|
16
|
-
* provided.
|
|
15
|
+
* Used when sorting and filtering when a custom `compare`/`match` is not provided.
|
|
17
16
|
*/
|
|
18
17
|
locale?: string;
|
|
19
18
|
/**
|
|
20
|
-
* Optional function used to get the value associated with this column from
|
|
21
|
-
*
|
|
22
|
-
* access the row.
|
|
19
|
+
* Optional function used to get the value associated with this column from the row. The default
|
|
20
|
+
* getter uses the column identifier as a property to access the row.
|
|
23
21
|
*/
|
|
24
22
|
getValue?: (getValueData: DataTableColumnGetValueData<T>) => TValue;
|
|
25
23
|
/**
|
|
26
|
-
* Function used to format the value as a string. Automatic filtering is based
|
|
27
|
-
*
|
|
24
|
+
* Function used to format the value as a string. Automatic filtering is based on this string. By
|
|
25
|
+
* default, `.toString()` is used.
|
|
28
26
|
*/
|
|
29
27
|
format?: (formatData: DataTableColumnFormatData<T, TValue>) => string;
|
|
30
28
|
/**
|
|
31
|
-
* Function used to render the cell's content. By default, the formatted value
|
|
32
|
-
*
|
|
29
|
+
* Function used to render the cell's content. By default, the formatted value is rendered,
|
|
30
|
+
* possibly highlighted when it matches the filter.
|
|
33
31
|
*/
|
|
34
32
|
render?: ReactNode | ((renderData: DataTableColumnRenderData<T, TValue>) => ReactNode);
|
|
35
33
|
/**
|
|
36
|
-
* Comparison function used when sorting values of this column. The default
|
|
37
|
-
*
|
|
38
|
-
*
|
|
34
|
+
* Comparison function used when sorting values of this column. The default sorting function can
|
|
35
|
+
* handle primitive values and dates. When sorting other objects, their string representation is
|
|
36
|
+
* used in the comparison.
|
|
39
37
|
*/
|
|
40
38
|
compare?: (value1: TValue, value2: TValue) => number;
|
|
41
39
|
/**
|
|
42
|
-
* Match function used when filtering values of this column. Should return
|
|
43
|
-
*
|
|
40
|
+
* Match function used when filtering values of this column. Should return `null` if the value
|
|
41
|
+
* does not match.
|
|
44
42
|
*/
|
|
45
43
|
match?: (value: string, filter: string) => MatchAgainstFilter | null;
|
|
46
44
|
/** Options used when sorting when a custom `compare` is not provided. */
|
|
@@ -77,9 +75,8 @@ export interface DataTableColumnRenderData<T = unknown, TValue = unknown> extend
|
|
|
77
75
|
/** Match of the formatted value against the filter. */
|
|
78
76
|
match: MatchAgainstFilter | null;
|
|
79
77
|
/**
|
|
80
|
-
* Formatted value possibly marked by the filter. When the formatted value
|
|
81
|
-
*
|
|
82
|
-
* `formattedValue`.
|
|
78
|
+
* Formatted value possibly marked by the filter. When the formatted value doesn't match the
|
|
79
|
+
* filter, this property will be the same as `formattedValue`.
|
|
83
80
|
*/
|
|
84
81
|
markedValue: ReactNode;
|
|
85
82
|
}
|
|
@@ -97,15 +94,15 @@ export interface DataTableColumnProps<T = any, TValue = any> extends Omit<DataTa
|
|
|
97
94
|
/** Identifier of the data table column. */
|
|
98
95
|
id: string;
|
|
99
96
|
/**
|
|
100
|
-
* Rendered content of the column's cell. If both `render` and `children` are
|
|
101
|
-
*
|
|
97
|
+
* Rendered content of the column's cell. If both `render` and `children` are provided, `render`
|
|
98
|
+
* takes priority.
|
|
102
99
|
*/
|
|
103
100
|
children?: DataTableColumnObject<T, TValue>["render"];
|
|
104
101
|
}
|
|
105
102
|
/**
|
|
106
103
|
* Definition of a data table column.
|
|
107
104
|
*
|
|
108
|
-
* This component doesn't actually render anything by itself; it is used by the
|
|
109
|
-
*
|
|
105
|
+
* This component doesn't actually render anything by itself; it is used by the `DataTable`
|
|
106
|
+
* component to automatically create the `columns` object.
|
|
110
107
|
*/
|
|
111
108
|
export declare function DataTableColumn<T = any, TValue = any>(_props: DataTableColumnProps<T, TValue>): null;
|
|
@@ -6,8 +6,7 @@ export interface DataTableColumnGroupObject<T = unknown> extends Omit<TableColum
|
|
|
6
6
|
/** Sub-columns of the data table column group. */
|
|
7
7
|
subColumns: DataTableColumnsObject<T>;
|
|
8
8
|
/**
|
|
9
|
-
* Whether the column group should be shown while the data table is being
|
|
10
|
-
* printed.
|
|
9
|
+
* Whether the column group should be shown while the data table is being printed.
|
|
11
10
|
*
|
|
12
11
|
* @default true
|
|
13
12
|
*/
|
|
@@ -25,7 +24,7 @@ export interface DataTableColumnGroupProps extends Omit<DataTableColumnGroupObje
|
|
|
25
24
|
/**
|
|
26
25
|
* Definition of a data table column group.
|
|
27
26
|
*
|
|
28
|
-
* This component doesn't actually render anything by itself; it is used by the
|
|
29
|
-
*
|
|
27
|
+
* This component doesn't actually render anything by itself; it is used by the `DataTable`
|
|
28
|
+
* component to automatically create the `columns` object.
|
|
30
29
|
*/
|
|
31
30
|
export declare function DataTableColumnGroup(_props: DataTableColumnGroupProps): null;
|
|
@@ -5,10 +5,10 @@ export interface DataTableColumnsProps {
|
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
|
-
* Container for the definition of all data table columns. This component must
|
|
9
|
-
*
|
|
8
|
+
* Container for the definition of all data table columns. This component must be a direct child of
|
|
9
|
+
* the `DataTable` component.
|
|
10
10
|
*
|
|
11
|
-
* This component doesn't actually render anything by itself; it is used by the
|
|
12
|
-
*
|
|
11
|
+
* This component doesn't actually render anything by itself; it is used by the `DataTable`
|
|
12
|
+
* component to automatically create the `columns` object.
|
|
13
13
|
*/
|
|
14
14
|
export declare function DataTableColumns(_props: DataTableColumnsProps): null;
|
|
@@ -21,8 +21,5 @@ export interface DataTableContentProps extends Omit<TableProps, "layout"> {
|
|
|
21
21
|
/** Properties to pass to the component containing the empty message. */
|
|
22
22
|
emptyMessageProps?: ComponentProps<"div">;
|
|
23
23
|
}
|
|
24
|
-
/**
|
|
25
|
-
|
|
26
|
-
* itself.
|
|
27
|
-
*/
|
|
28
|
-
export declare function DataTableContent({ emptyMessage, tableFootContent, showTableFootWhenEmpty, containerProps, scrollableProps, tableHeadProps, tableBodyProps, tableFootProps, emptyMessageProps, className, ref, ...otherProps }: DataTableContentProps): import("react").JSX.Element;
|
|
24
|
+
/** Component containing the "main content" of the data table, i.e. the table itself. */
|
|
25
|
+
export declare function DataTableContent({ emptyMessage: emptyMessageProp, tableFootContent, showTableFootWhenEmpty, containerProps, scrollableProps, tableHeadProps, tableBodyProps, tableFootProps, emptyMessageProps, className, ref, ...otherProps }: DataTableContentProps): import("react").JSX.Element;
|
|
@@ -2,8 +2,5 @@ import type { DataTableContentProps } from "./DataTableContent.tsx";
|
|
|
2
2
|
/** Properties of the data table empty/loading row. */
|
|
3
3
|
export interface DataTableEmptyOrLoadingRowProps extends Pick<DataTableContentProps, "emptyMessage" | "emptyMessageProps"> {
|
|
4
4
|
}
|
|
5
|
-
/**
|
|
6
|
-
* Data table rows displayed when the data table is either loading or has no
|
|
7
|
-
* rows.
|
|
8
|
-
*/
|
|
5
|
+
/** Data table rows displayed when the data table is either loading or has no rows. */
|
|
9
6
|
export declare function DataTableEmptyOrLoadingRows({ emptyMessage, emptyMessageProps, }: DataTableEmptyOrLoadingRowProps): import("react").JSX.Element | import("react").JSX.Element[];
|
|
@@ -2,12 +2,12 @@ import { type InputNonFileProps } from "../Input";
|
|
|
2
2
|
/** Properties of the data table filter component. */
|
|
3
3
|
export interface DataTableFilterProps extends Omit<InputNonFileProps, "defaultValue" | "value"> {
|
|
4
4
|
/**
|
|
5
|
-
* Whether the component should preferably be aligned to the right. This only
|
|
6
|
-
*
|
|
5
|
+
* Whether the component should preferably be aligned to the right. This only has an effect when
|
|
6
|
+
* the component is nested directly under the `DataTable`.
|
|
7
7
|
*
|
|
8
8
|
* @default true
|
|
9
9
|
*/
|
|
10
10
|
preferRightAlignment?: boolean;
|
|
11
11
|
}
|
|
12
12
|
/** Input used to globally filter a data table. */
|
|
13
|
-
export declare function DataTableFilter({ preferRightAlignment, endAdornment, placeholder,
|
|
13
|
+
export declare function DataTableFilter({ preferRightAlignment, endAdornment, placeholder: placeholderProp, "aria-label": ariaLabelProp, onValueChange, className, rootProps, ...otherProps }: DataTableFilterProps): import("react").JSX.Element;
|
|
@@ -5,8 +5,7 @@ export interface DataTablePaginationProps extends ComponentProps<"div"> {
|
|
|
5
5
|
/**
|
|
6
6
|
* Function used to render the range of displayed rows.
|
|
7
7
|
*
|
|
8
|
-
* @param range Node representing the range of rows (note that, in paged mode,
|
|
9
|
-
* this is a select).
|
|
8
|
+
* @param range Node representing the range of rows (note that, in paged mode, this is a select).
|
|
10
9
|
* @param total Total number of rows.
|
|
11
10
|
*/
|
|
12
11
|
rowsRange?: (range: ReactNode, total: number) => ReactNode;
|
|
@@ -17,19 +16,16 @@ export interface DataTablePaginationProps extends ComponentProps<"div"> {
|
|
|
17
16
|
/** Label of the next page button (only relevant in paged mode). */
|
|
18
17
|
nextPageButtonLabel?: string;
|
|
19
18
|
/**
|
|
20
|
-
* Whether the component should preferably be aligned to the right. This only
|
|
21
|
-
*
|
|
19
|
+
* Whether the component should preferably be aligned to the right. This only has an effect when
|
|
20
|
+
* the component is nested directly under the `DataTable`.
|
|
22
21
|
*
|
|
23
22
|
* @default true
|
|
24
23
|
*/
|
|
25
24
|
preferRightAlignment?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
* Properties to pass to the previous page button (only relevant in paged
|
|
28
|
-
* mode).
|
|
29
|
-
*/
|
|
25
|
+
/** Properties to pass to the previous page button (only relevant in paged mode). */
|
|
30
26
|
previousPageButtonProps?: IconButtonProps;
|
|
31
27
|
/** Properties to pass to the next page button (only relevant in paged mode). */
|
|
32
28
|
nextPageButtonProps?: IconButtonProps;
|
|
33
29
|
}
|
|
34
30
|
/** Component used to provide pagination to the data table. */
|
|
35
|
-
export declare function DataTablePagination({ rowsRange, rowsRangeSelectLabel, previousPageButtonLabel, nextPageButtonLabel, previousPageButtonProps, nextPageButtonProps, preferRightAlignment, ...otherProps }: DataTablePaginationProps): import("react").JSX.Element | null;
|
|
31
|
+
export declare function DataTablePagination({ rowsRange: rowsRangeProp, rowsRangeSelectLabel: rowsRangeSelectLabelProp, previousPageButtonLabel: previousPageButtonLabelProp, nextPageButtonLabel: nextPageButtonLabelProp, previousPageButtonProps, nextPageButtonProps, preferRightAlignment, ...otherProps }: DataTablePaginationProps): import("react").JSX.Element | null;
|
|
@@ -2,8 +2,7 @@ import { type ComponentProps, type ReactNode } from "react";
|
|
|
2
2
|
/** Properties of the data table rows per page component. */
|
|
3
3
|
export interface DataTableRowsPerPageProps extends ComponentProps<"div"> {
|
|
4
4
|
/**
|
|
5
|
-
* Options used to set the data table's `limit` (the maximum number of rows
|
|
6
|
-
* shown per page).
|
|
5
|
+
* Options used to set the data table's `limit` (the maximum number of rows shown per page).
|
|
7
6
|
*
|
|
8
7
|
* @default [10, 15, 25, 50]
|
|
9
8
|
*/
|
|
@@ -15,12 +14,12 @@ export interface DataTableRowsPerPageProps extends ComponentProps<"div"> {
|
|
|
15
14
|
*/
|
|
16
15
|
label?: ReactNode;
|
|
17
16
|
/**
|
|
18
|
-
* Whether the component should preferably be aligned to the right. This only
|
|
19
|
-
*
|
|
17
|
+
* Whether the component should preferably be aligned to the right. This only has an effect when
|
|
18
|
+
* the component is nested directly under the `DataTable`.
|
|
20
19
|
*
|
|
21
20
|
* @default false
|
|
22
21
|
*/
|
|
23
22
|
preferRightAlignment?: boolean;
|
|
24
23
|
}
|
|
25
24
|
/** Component displaying a select used to change the number of rows per page. */
|
|
26
|
-
export declare function DataTableRowsPerPage({ limitOptions, label, preferRightAlignment, className, ...otherProps }: DataTableRowsPerPageProps): import("react").JSX.Element;
|
|
25
|
+
export declare function DataTableRowsPerPage({ limitOptions, label: labelProp, preferRightAlignment, className, ...otherProps }: DataTableRowsPerPageProps): import("react").JSX.Element;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ComponentProps, Key, MouseEvent, ReactNode } from "react";
|
|
2
2
|
import { type ActionButtonProps } from "../Actions";
|
|
3
3
|
import type { DataTableSelectionMode } from "./DataTable.tsx";
|
|
4
4
|
/** Properties of the data table selection trigger component. */
|
|
@@ -6,8 +6,8 @@ export type DataTableSelectionTriggerProps = DataTableSelectionTriggerChildlessP
|
|
|
6
6
|
/** Base properties of the data table selection trigger component. */
|
|
7
7
|
export interface DataTableSelectionTriggerPropsBase {
|
|
8
8
|
/**
|
|
9
|
-
* Whether the component should preferably be aligned to the right. This only
|
|
10
|
-
*
|
|
9
|
+
* Whether the component should preferably be aligned to the right. This only has an effect when
|
|
10
|
+
* the component is nested directly under the `DataTable`.
|
|
11
11
|
*
|
|
12
12
|
* @default true
|
|
13
13
|
*/
|
|
@@ -27,17 +27,11 @@ export interface DataTableSelectionTriggerPropsBase {
|
|
|
27
27
|
*/
|
|
28
28
|
onClick: (selectedRows: Key[], selectionMode: DataTableSelectionMode, event: MouseEvent) => void;
|
|
29
29
|
}
|
|
30
|
-
/**
|
|
31
|
-
* Properties of the data table selection trigger component when rendered
|
|
32
|
-
* without children.
|
|
33
|
-
*/
|
|
30
|
+
/** Properties of the data table selection trigger component when rendered without children. */
|
|
34
31
|
export interface DataTableSelectionTriggerChildlessProps extends DataTableSelectionTriggerPropsBase, Omit<ActionButtonProps, "onClick"> {
|
|
35
32
|
children?: never;
|
|
36
33
|
}
|
|
37
|
-
/**
|
|
38
|
-
* Properties of the data table selection trigger component when rendered with
|
|
39
|
-
* children.
|
|
40
|
-
*/
|
|
34
|
+
/** Properties of the data table selection trigger component when rendered with children. */
|
|
41
35
|
export interface DataTableSelectionTriggerChildrenProps extends DataTableSelectionTriggerPropsBase, Omit<ComponentProps<"button">, "onClick"> {
|
|
42
36
|
children: ReactNode;
|
|
43
37
|
}
|
|
@@ -4,4 +4,4 @@ import type { DataTablePaginationProps } from "./DataTablePagination.tsx";
|
|
|
4
4
|
export interface PagedDataTablePaginationProps extends ComponentProps<"div">, Pick<DataTablePaginationProps, "rowsRange" | "rowsRangeSelectLabel" | "previousPageButtonLabel" | "nextPageButtonLabel" | "preferRightAlignment" | "previousPageButtonProps" | "nextPageButtonProps"> {
|
|
5
5
|
}
|
|
6
6
|
/** Pagination component of the scrolled data table. */
|
|
7
|
-
export declare function PagedDataTablePagination({ rowsRange, rowsRangeSelectLabel, previousPageButtonLabel, nextPageButtonLabel, preferRightAlignment, previousPageButtonProps, nextPageButtonProps, className, "aria-label":
|
|
7
|
+
export declare function PagedDataTablePagination({ rowsRange, rowsRangeSelectLabel, previousPageButtonLabel, nextPageButtonLabel, preferRightAlignment, previousPageButtonProps, nextPageButtonProps, className, "aria-label": ariaLabelProp, ...otherProps }: PagedDataTablePaginationProps): import("react").JSX.Element;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
/** Body of the data table in "paged" display mode. */
|
|
2
|
-
export declare function PagedDataTableRows
|
|
2
|
+
export declare function PagedDataTableRows(): import("react").JSX.Element[];
|
|
@@ -3,5 +3,5 @@ import type { DataTableBodyProps } from "./DataTableBody.tsx";
|
|
|
3
3
|
interface ScrolledDataTableRowsProps extends Pick<DataTableBodyProps, "scrollableRef"> {
|
|
4
4
|
}
|
|
5
5
|
/** Body of the data table in "scrolled" display mode. */
|
|
6
|
-
export declare function ScrolledDataTableRows
|
|
6
|
+
export declare function ScrolledDataTableRows({ scrollableRef }: ScrolledDataTableRowsProps): import("react").JSX.Element;
|
|
7
7
|
export {};
|
|
@@ -5,7 +5,7 @@ export * from "./DataTableColumn.tsx";
|
|
|
5
5
|
export * from "./DataTableColumnGroup.tsx";
|
|
6
6
|
export * from "./DataTableColumns.tsx";
|
|
7
7
|
export * from "./DataTableContent.tsx";
|
|
8
|
-
export { useDataTableColumnLabel, useDataTableColumnLabelId
|
|
8
|
+
export { useDataTableColumnLabel, useDataTableColumnLabelId } from "./DataTableContext.ts";
|
|
9
9
|
export * from "./DataTableFilter.tsx";
|
|
10
10
|
export * from "./DataTablePagination.tsx";
|
|
11
11
|
export * from "./DataTableRow.tsx";
|
|
@@ -2,3 +2,5 @@ import type { Key } from "react";
|
|
|
2
2
|
import type { DataTableProps } from "./DataTable.tsx";
|
|
3
3
|
/** Returns the key of a row. */
|
|
4
4
|
export declare function getRowKey<T = unknown>(row: T, rowKey: DataTableProps<T>["rowKey"]): Key;
|
|
5
|
+
/** Compare table row keys. */
|
|
6
|
+
export declare function compareRowKeys(k1: Key, k2: Key): number;
|
|
@@ -3,14 +3,13 @@ export interface SpliceWindowResult<T = unknown> {
|
|
|
3
3
|
/** New total number of rows. */
|
|
4
4
|
totalCount: number;
|
|
5
5
|
/**
|
|
6
|
-
* New visible window. If the window didn't change, then this window will be
|
|
7
|
-
* the
|
|
6
|
+
* New visible window. If the window didn't change, then this window will be the same object as
|
|
7
|
+
* the one provided, otherwise it will be a new object.
|
|
8
8
|
*/
|
|
9
9
|
window: (T | undefined)[];
|
|
10
10
|
}
|
|
11
11
|
/**
|
|
12
|
-
* Applies the splice performed on the table to the window containing the
|
|
13
|
-
* visible rows.
|
|
12
|
+
* Applies the splice performed on the table to the window containing the visible rows.
|
|
14
13
|
*
|
|
15
14
|
* @param totalCount Total number of rows.
|
|
16
15
|
* @param offset Window offset.
|
|
@@ -20,27 +20,23 @@ export interface DateInputProps extends Omit<ControlNonFileInputProps, "defaultV
|
|
|
20
20
|
*/
|
|
21
21
|
onValueChange?: (valueRepresentations: DateValueRepresentations) => void;
|
|
22
22
|
/**
|
|
23
|
-
* Minimum date allowed. When a string it provided, it should represent the
|
|
24
|
-
*
|
|
25
|
-
* of a formatted `"01/01/2020"`.
|
|
23
|
+
* Minimum date allowed. When a string it provided, it should represent the date in the ISO 8601
|
|
24
|
+
* format, i.e. `"2020-01-01"` should be provided instead of a formatted `"01/01/2020"`.
|
|
26
25
|
*/
|
|
27
26
|
minDate?: string | Date | null;
|
|
28
27
|
/**
|
|
29
|
-
* Maximum date allowed. When a string it provided, it should represent the
|
|
30
|
-
*
|
|
31
|
-
* of a formatted `"01/01/2020"`.
|
|
28
|
+
* Maximum date allowed. When a string it provided, it should represent the date in the ISO 8601
|
|
29
|
+
* format, i.e. `"2020-01-01"` should be provided instead of a formatted `"01/01/2020"`.
|
|
32
30
|
*/
|
|
33
31
|
maxDate?: string | Date | null;
|
|
34
32
|
/**
|
|
35
|
-
* Minimum month allowed. When a string it provided, it should represent the
|
|
36
|
-
*
|
|
37
|
-
* a formatted `"01/2020"`.
|
|
33
|
+
* Minimum month allowed. When a string it provided, it should represent the date in the ISO 8601
|
|
34
|
+
* format, i.e. `"2020-01"` should be provided instead of a formatted `"01/2020"`.
|
|
38
35
|
*/
|
|
39
36
|
minMonth?: string | Date | null;
|
|
40
37
|
/**
|
|
41
|
-
* Maximum month allowed. When a string it provided, it should represent the
|
|
42
|
-
*
|
|
43
|
-
* a formatted `"01/2020"`.
|
|
38
|
+
* Maximum month allowed. When a string it provided, it should represent the date in the ISO 8601
|
|
39
|
+
* format, i.e. `"2020-01"` should be provided instead of a formatted `"01/2020"`.
|
|
44
40
|
*/
|
|
45
41
|
maxMonth?: string | Date | null;
|
|
46
42
|
/** Minimum year allowed. */
|
|
@@ -48,30 +44,22 @@ export interface DateInputProps extends Omit<ControlNonFileInputProps, "defaultV
|
|
|
48
44
|
/** Maximum year allowed. */
|
|
49
45
|
maxYear?: number;
|
|
50
46
|
/**
|
|
51
|
-
* Format of the date, as supported by
|
|
52
|
-
*
|
|
53
|
-
* text.
|
|
47
|
+
* Format of the date, as supported by [`date-fns`](https://date-fns.org/docs/format), used for
|
|
48
|
+
* the written input text.
|
|
54
49
|
*/
|
|
55
50
|
format?: string;
|
|
56
51
|
/**
|
|
57
|
-
* Announced format of the date, as supported by
|
|
58
|
-
*
|
|
59
|
-
* to assistive technologies.
|
|
52
|
+
* Announced format of the date, as supported by [`date-fns`](https://date-fns.org/docs/format),
|
|
53
|
+
* used to announce the date to assistive technologies.
|
|
60
54
|
*/
|
|
61
55
|
announcedFormat?: string;
|
|
62
56
|
/** Description of the short format provided to assistive technologies. */
|
|
63
57
|
formatDescription?: ReactNode;
|
|
64
58
|
/** Description of the selected date, announced to assistive technologies. */
|
|
65
59
|
selectedDateDescription?: (date: string) => ReactNode;
|
|
66
|
-
/**
|
|
67
|
-
* Custom validation function meant to validate the control when it is part of
|
|
68
|
-
* a `Form`.
|
|
69
|
-
*/
|
|
60
|
+
/** Custom validation function meant to validate the control when it is part of a `Form`. */
|
|
70
61
|
validate?: FormControlValidateFn<string | null>;
|
|
71
|
-
/**
|
|
72
|
-
* Specifies when the control should be validated. Defaults to the value
|
|
73
|
-
* specified in the `Form`.
|
|
74
|
-
*/
|
|
62
|
+
/** Specifies when the control should be validated. Defaults to the value specified in the `Form`. */
|
|
75
63
|
validationMode?: FormValidationMode;
|
|
76
64
|
/** Label of the button that opens the input's calendar. */
|
|
77
65
|
calendarButtonLabel?: ReactNode;
|
|
@@ -98,16 +86,15 @@ export interface DateValueRepresentations {
|
|
|
98
86
|
dateValue: Date | null;
|
|
99
87
|
}
|
|
100
88
|
/**
|
|
101
|
-
* The date input component is used to allow a user to enter a date with the aid
|
|
102
|
-
*
|
|
103
|
-
* [`Input`](/docs/ostack-ui-forms-input--docs),
|
|
89
|
+
* The date input component is used to allow a user to enter a date with the aid of a popover
|
|
90
|
+
* calendar. It is built on top of the [`Input`](/docs/ostack-ui-forms-input--docs),
|
|
104
91
|
* [`Popover`](/docs/ostack-ui-overlay-popover--docs), and
|
|
105
|
-
* [`Calendar`](/docs/ostack-ui-data-display-calendar--docs) components (and, by
|
|
106
|
-
*
|
|
92
|
+
* [`Calendar`](/docs/ostack-ui-data-display-calendar--docs) components (and, by extension, the
|
|
93
|
+
* browser's [`<input>`
|
|
107
94
|
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input)).
|
|
108
95
|
*
|
|
109
|
-
* For accessibility purposes, date inputs are usually included within a `Field`
|
|
110
|
-
*
|
|
96
|
+
* For accessibility purposes, date inputs are usually included within a `Field` together with a
|
|
97
|
+
* `Label` and optionally `HelperText` and/or `Feedback`.
|
|
111
98
|
*
|
|
112
99
|
* Example usage:
|
|
113
100
|
*
|
|
@@ -119,4 +106,4 @@ export interface DateValueRepresentations {
|
|
|
119
106
|
* }
|
|
120
107
|
* ```
|
|
121
108
|
*/
|
|
122
|
-
export declare function DateInput({ name, value: controlledValue, defaultValue, onValueChange, onChange, onFocus, disabled, loading, readOnly, status, showClearButton, endAdornment, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, required, autoComplete, format, announcedFormat, formatDescription, selectedDateDescription, form, validate, validationMode, calendarButtonLabel, onPopoverOpenChange, onBlurToOutside, containerProps, clearButtonProps, calendarButtonTooltipProps, calendarButtonProps, calendarButtonIconProps, calendarProps, popoverContentProps, className, placeholder, "aria-disabled": ariaDisabled, "aria-describedby": ariaDescribedBy, ref, ...otherProps }: DateInputProps): import("react").JSX.Element;
|
|
109
|
+
export declare function DateInput({ name, value: controlledValue, defaultValue, onValueChange, onChange, onFocus, disabled: disabledProp, loading, readOnly, status: statusProp, showClearButton, endAdornment, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, required, autoComplete, format, announcedFormat: announcedFormatProp, formatDescription: formatDescriptionProp, selectedDateDescription: selectedDateDescriptionProp, form, validate, validationMode, calendarButtonLabel: calendarButtonLabelProp, onPopoverOpenChange, onBlurToOutside, containerProps, clearButtonProps, calendarButtonTooltipProps, calendarButtonProps, calendarButtonIconProps, calendarProps, popoverContentProps, className, placeholder: placeholderProp, "aria-disabled": ariaDisabled, "aria-describedby": ariaDescribedBy, ref, ...otherProps }: DateInputProps): import("react").JSX.Element;
|
|
@@ -30,8 +30,8 @@ export interface DateRangeInputProps extends Omit<ComponentProps<"div">, "defaul
|
|
|
30
30
|
/** Name of the control. Both inputs will share the same name. */
|
|
31
31
|
name?: string;
|
|
32
32
|
/**
|
|
33
|
-
* Date-range input's style variant. Defaults to the default variant unless
|
|
34
|
-
*
|
|
33
|
+
* Date-range input's style variant. Defaults to the default variant unless when rendering inside
|
|
34
|
+
* a table cell (in which it defaults to `"cell"`).
|
|
35
35
|
*/
|
|
36
36
|
variant?: ControlVariant;
|
|
37
37
|
/** Sets the status of the date-range input. */
|
|
@@ -45,8 +45,7 @@ export interface DateRangeInputProps extends Omit<ComponentProps<"div">, "defaul
|
|
|
45
45
|
/**
|
|
46
46
|
* Function called whenever the value of the date-range input changes.
|
|
47
47
|
*
|
|
48
|
-
* @param valueRepresentations Different representations of the date-range
|
|
49
|
-
* value.
|
|
48
|
+
* @param valueRepresentations Different representations of the date-range value.
|
|
50
49
|
*/
|
|
51
50
|
onValueChange?: (valueRepresentations: DateRangeValueRepresentations) => void;
|
|
52
51
|
/** Whether the data-range input is required. */
|
|
@@ -70,43 +69,35 @@ export interface DateRangeInputProps extends Omit<ComponentProps<"div">, "defaul
|
|
|
70
69
|
/**
|
|
71
70
|
* Renders the date-range input in a **loading** state.
|
|
72
71
|
*
|
|
73
|
-
* When `true`, the date-range input is “soft-disabled”: it looks disabled and
|
|
74
|
-
*
|
|
75
|
-
*
|
|
72
|
+
* When `true`, the date-range input is “soft-disabled”: it looks disabled and ignores user
|
|
73
|
+
* interaction but remains focusable. By default, spinners are shown (i.e. `showSpinners` is set
|
|
74
|
+
* to `true` unless overridden).
|
|
76
75
|
*
|
|
77
|
-
* The date-range input's accessible description while loading can be
|
|
78
|
-
*
|
|
76
|
+
* The date-range input's accessible description while loading can be controlled via
|
|
77
|
+
* `loadingDescription`.
|
|
79
78
|
*
|
|
80
|
-
* To only show spinners without “soft-disabling” the date-range input, set
|
|
81
|
-
*
|
|
79
|
+
* To only show spinners without “soft-disabling” the date-range input, set `showSpinners`
|
|
80
|
+
* instead.
|
|
82
81
|
*
|
|
83
82
|
* @example
|
|
84
|
-
*
|
|
85
|
-
* ```tsx
|
|
86
|
-
* <DateRangeInput loading={fetching} loadingDescription="Fetching…" />;
|
|
87
|
-
* ```
|
|
83
|
+
* <DateRangeInput loading={fetching} loadingDescription="Fetching…" />;
|
|
88
84
|
*
|
|
89
85
|
* @default false
|
|
90
86
|
*/
|
|
91
87
|
loading?: boolean;
|
|
92
|
-
/**
|
|
93
|
-
* Accessible description of the date-range input when it is in a “loading”
|
|
94
|
-
* state.
|
|
95
|
-
*/
|
|
88
|
+
/** Accessible description of the date-range input when it is in a “loading” state. */
|
|
96
89
|
loadingDescription?: ReactNode;
|
|
97
90
|
/**
|
|
98
|
-
* Whether to show spinners in the start and end parts of the date-range
|
|
99
|
-
* input.
|
|
91
|
+
* Whether to show spinners in the start and end parts of the date-range input.
|
|
100
92
|
*
|
|
101
|
-
* Defaults to the value of the `loading` property. In most cases, prefer
|
|
102
|
-
*
|
|
93
|
+
* Defaults to the value of the `loading` property. In most cases, prefer `loading`, which also
|
|
94
|
+
* “soft-disables” the date-range input.
|
|
103
95
|
*
|
|
104
|
-
* Use `showSpinners` when you want spinners **without** “soft-disabling” the
|
|
105
|
-
*
|
|
106
|
-
* `true` and `showSpinners` to `false`.
|
|
96
|
+
* Use `showSpinners` when you want spinners **without** “soft-disabling” the date-range input. To
|
|
97
|
+
* “soft-disable” **without** spinners, set `loading` to `true` and `showSpinners` to `false`.
|
|
107
98
|
*
|
|
108
|
-
* Use `showStartSpinner` or `showEndSpinner` to individually control whether
|
|
109
|
-
*
|
|
99
|
+
* Use `showStartSpinner` or `showEndSpinner` to individually control whether to show a spinner in
|
|
100
|
+
* the start or end parts of the date-range input.
|
|
110
101
|
*
|
|
111
102
|
* @default loading
|
|
112
103
|
*/
|
|
@@ -134,8 +125,7 @@ export interface DateRangeInputProps extends Omit<ComponentProps<"div">, "defaul
|
|
|
134
125
|
/** Date-range input's end adornment. */
|
|
135
126
|
endAdornment?: ReactNode;
|
|
136
127
|
/**
|
|
137
|
-
* Whether to show buttons to clear the start/end inputs when they have
|
|
138
|
-
* content.
|
|
128
|
+
* Whether to show buttons to clear the start/end inputs when they have content.
|
|
139
129
|
*
|
|
140
130
|
* @default true
|
|
141
131
|
*/
|
|
@@ -143,45 +133,34 @@ export interface DateRangeInputProps extends Omit<ComponentProps<"div">, "defaul
|
|
|
143
133
|
/** Label of the clear buttons announced to assistive technologies. */
|
|
144
134
|
clearButtonsLabel?: string;
|
|
145
135
|
/**
|
|
146
|
-
* Format of the dates, as supported by
|
|
147
|
-
*
|
|
148
|
-
* text.
|
|
136
|
+
* Format of the dates, as supported by [`date-fns`](https://date-fns.org/docs/format), used for
|
|
137
|
+
* the written input text.
|
|
149
138
|
*/
|
|
150
139
|
format?: string;
|
|
151
140
|
/**
|
|
152
|
-
* Announced format of the dates, as supported by
|
|
153
|
-
*
|
|
154
|
-
* to assistive technologies.
|
|
141
|
+
* Announced format of the dates, as supported by [`date-fns`](https://date-fns.org/docs/format),
|
|
142
|
+
* used to announce the dates to assistive technologies.
|
|
155
143
|
*/
|
|
156
144
|
announcedFormat?: string;
|
|
157
145
|
/** Description of the short format provided to assistive technologies. */
|
|
158
146
|
formatDescription?: ReactNode;
|
|
159
147
|
/**
|
|
160
|
-
* Label announced to assistive technologies for the start input (so that the
|
|
161
|
-
*
|
|
148
|
+
* Label announced to assistive technologies for the start input (so that the user knows that they
|
|
149
|
+
* are interacting with the start input).
|
|
162
150
|
*/
|
|
163
151
|
startInputLabel?: ReactNode;
|
|
164
152
|
/**
|
|
165
|
-
* Label announced to assistive technologies for the end input (so that the
|
|
166
|
-
*
|
|
153
|
+
* Label announced to assistive technologies for the end input (so that the user knows that they
|
|
154
|
+
* are interacting with the end input).
|
|
167
155
|
*/
|
|
168
156
|
endInputLabel?: ReactNode;
|
|
169
157
|
/** Prefix used when announcing a selected date to assistive technologies. */
|
|
170
158
|
selectedDateDescription?: (date: string) => ReactNode;
|
|
171
|
-
/**
|
|
172
|
-
* Prefix used when announcing the selected date-range to assistive
|
|
173
|
-
* technologies.
|
|
174
|
-
*/
|
|
159
|
+
/** Prefix used when announcing the selected date-range to assistive technologies. */
|
|
175
160
|
selectedDateRangeDescription?: (dateRange: FormattedRange) => ReactNode;
|
|
176
|
-
/**
|
|
177
|
-
* Custom validation function meant to validate the control when it is part of
|
|
178
|
-
* a `Form`.
|
|
179
|
-
*/
|
|
161
|
+
/** Custom validation function meant to validate the control when it is part of a `Form`. */
|
|
180
162
|
validate?: FormControlValidateFn<StringRange | null>;
|
|
181
|
-
/**
|
|
182
|
-
* Specifies when the control should be validated. Defaults to the value
|
|
183
|
-
* specified in the `Form`.
|
|
184
|
-
*/
|
|
163
|
+
/** Specifies when the control should be validated. Defaults to the value specified in the `Form`. */
|
|
185
164
|
validationMode?: FormValidationMode;
|
|
186
165
|
/** Label of the button that opens the input's calendar. */
|
|
187
166
|
calendarButtonLabel?: ReactNode;
|
|
@@ -196,8 +175,7 @@ export interface DateRangeInputProps extends Omit<ComponentProps<"div">, "defaul
|
|
|
196
175
|
/**
|
|
197
176
|
* Function called when the focus moves out of the control as a whole.
|
|
198
177
|
*
|
|
199
|
-
* This is useful when there is a need to know when the user stops interacting
|
|
200
|
-
* with the control.
|
|
178
|
+
* This is useful when there is a need to know when the user stops interacting with the control.
|
|
201
179
|
*/
|
|
202
180
|
onBlurToOutside?: (event: FocusEvent) => void;
|
|
203
181
|
/** Form attribute of the inputs. */
|
|
@@ -241,16 +219,14 @@ export interface DateRangeValueRepresentations {
|
|
|
241
219
|
dateValue: DateRange;
|
|
242
220
|
}
|
|
243
221
|
/**
|
|
244
|
-
* The date-range input component displays two inputs used to allow a user to
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* [`Calendar`](/docs/ostack-ui-data-display-calendar--docs) components, as well
|
|
248
|
-
*
|
|
249
|
-
* element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input).
|
|
222
|
+
* The date-range input component displays two inputs used to allow a user to specify a date
|
|
223
|
+
* interval with the aid of popover calendars. It is built on top of the
|
|
224
|
+
* [`Popover`](/docs/ostack-ui-overlay-popover--docs) and
|
|
225
|
+
* [`Calendar`](/docs/ostack-ui-data-display-calendar--docs) components, as well as the browser's
|
|
226
|
+
* [`<input>` element](https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input).
|
|
250
227
|
*
|
|
251
|
-
* For accessibility purposes, date-range inputs are usually included within a
|
|
252
|
-
*
|
|
253
|
-
* `Feedback`.
|
|
228
|
+
* For accessibility purposes, date-range inputs are usually included within a `Field` together with
|
|
229
|
+
* a `Label` and optionally `HelperText` and/or `Feedback`.
|
|
254
230
|
*
|
|
255
231
|
* Example usage:
|
|
256
232
|
*
|
|
@@ -258,13 +234,8 @@ export interface DateRangeValueRepresentations {
|
|
|
258
234
|
* import { DateRangeInput } from "@ostack.tech/ui";
|
|
259
235
|
*
|
|
260
236
|
* function HolidayDates() {
|
|
261
|
-
* return
|
|
262
|
-
* <DateRangeInput
|
|
263
|
-
* startPlaceholder="Holiday start…"
|
|
264
|
-
* endPlaceholder="Holiday end…"
|
|
265
|
-
* />
|
|
266
|
-
* );
|
|
237
|
+
* return <DateRangeInput startPlaceholder="Holiday start…" endPlaceholder="Holiday end…" />;
|
|
267
238
|
* }
|
|
268
239
|
* ```
|
|
269
240
|
*/
|
|
270
|
-
export declare function DateRangeInput({ name, variant, status, code, value: controlledValue, defaultValue, onValueChange, required, disabled, readOnly, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, loading, loadingDescription, showSpinners, showStartSpinner, showEndSpinner, align, startAdornment, startMiddleAdornment, endMiddleAdornment, endAdornment, showClearButtons, clearButtonsLabel, format, announcedFormat, formatDescription, startInputLabel, endInputLabel, selectedDateDescription, selectedDateRangeDescription, calendarButtonLabel, placeholder, startPlaceholder, endPlaceholder, className, onPopoverOpenChange, onBlurToOutside, form, validate, validationMode, codeProps, popoverAnchorProps, startContainerProps, endContainerProps, startInputProps, endInputProps, startClearButtonProps, endClearButtonProps, spinnerProps, calendarButtonTooltipProps, calendarButtonProps, calendarButtonIconProps, calendarProps, popoverContentProps, "aria-disabled": ariaDisabled, ...otherProps }: DateRangeInputProps): import("react").JSX.Element;
|
|
241
|
+
export declare function DateRangeInput({ name, variant: variantProp, status: statusProp, code, value: controlledValue, defaultValue, onValueChange, required, disabled: disabledProp, readOnly, minDate, maxDate, minMonth, maxMonth, minYear, maxYear, loading, loadingDescription: loadingDescriptionProp, showSpinners, showStartSpinner, showEndSpinner, align, startAdornment, startMiddleAdornment, endMiddleAdornment, endAdornment, showClearButtons, clearButtonsLabel: clearButtonsLabelProp, format, announcedFormat: announcedFormatProp, formatDescription: formatDescriptionProp, startInputLabel: startInputLabelProp, endInputLabel: endInputLabelProp, selectedDateDescription: selectedDateDescriptionProp, selectedDateRangeDescription: selectedDateRangeDescriptionProp, calendarButtonLabel: calendarButtonLabelProp, placeholder: placeholderProp, startPlaceholder, endPlaceholder, className, onPopoverOpenChange, onBlurToOutside, form, validate, validationMode, codeProps, popoverAnchorProps, startContainerProps, endContainerProps, startInputProps, endInputProps, startClearButtonProps, endClearButtonProps, spinnerProps, calendarButtonTooltipProps, calendarButtonProps, calendarButtonIconProps, calendarProps, popoverContentProps, "aria-disabled": ariaDisabled, ...otherProps }: DateRangeInputProps): import("react").JSX.Element;
|