@mezzanine-ui/react 0.11.2 → 0.12.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/AppBar/AppBar.d.ts +2 -2
- package/AppBar/AppBarBrand.d.ts +1 -1
- package/AppBar/AppBarMain.d.ts +1 -1
- package/AppBar/AppBarSupport.d.ts +1 -1
- package/Badge/BadgeContainer.d.ts +1 -1
- package/Button/Button.d.ts +1 -1
- package/Button/ButtonGroup.d.ts +1 -1
- package/Button/IconButton.d.ts +1 -1
- package/Button/index.d.ts +2 -2
- package/Button/typings.d.ts +1 -1
- package/Calendar/CalendarContext.d.ts +1 -1
- package/Calendar/useCalendarControlModifiers.d.ts +2 -2
- package/Form/FormMessage.d.ts +1 -1
- package/Form/typings.d.ts +1 -1
- package/Form/useAutoCompleteValueControl.d.ts +5 -5
- package/Form/useInputWithTagsModeValue.d.ts +1 -1
- package/Form/useSelectValueControl.d.ts +6 -6
- package/Menu/MenuDivider.d.ts +1 -1
- package/Message/Message.d.ts +1 -1
- package/Modal/ModalBody.d.ts +1 -1
- package/Modal/ModalFooter.d.ts +1 -1
- package/Navigation/Navigation.d.ts +2 -2
- package/Navigation/NavigationSubMenu.d.ts +7 -2
- package/Navigation/NavigationSubMenu.js +2 -2
- package/Notifier/typings.d.ts +1 -1
- package/Pagination/Pagination.d.ts +30 -3
- package/Pagination/Pagination.js +3 -2
- package/Pagination/PaginationItem.d.ts +1 -1
- package/Pagination/PaginationJumper.d.ts +1 -1
- package/Pagination/PaginationPageSize.d.ts +38 -0
- package/Pagination/PaginationPageSize.js +19 -0
- package/Pagination/index.d.ts +1 -0
- package/Pagination/index.js +1 -0
- package/Pagination/usePagination.js +1 -1
- package/Picker/usePickerValue.d.ts +1 -1
- package/Popper/Popper.d.ts +2 -2
- package/Select/AutoComplete.d.ts +3 -3
- package/Select/Select.d.ts +3 -3
- package/Select/SelectTrigger.d.ts +5 -5
- package/Select/SelectTrigger.js +4 -1
- package/Slider/Slider.d.ts +4 -4
- package/Table/Table.d.ts +6 -4
- package/Table/Table.js +13 -13
- package/Table/TableBodyRow.js +3 -3
- package/Table/TableContext.d.ts +5 -3
- package/Table/TableExpandedTable.js +1 -1
- package/Table/pagination/TablePagination.js +3 -2
- package/Table/sorting/useTableSorting.d.ts +1 -1
- package/Table/useTableScroll.d.ts +3 -0
- package/Tabs/Tabs.d.ts +1 -1
- package/TextField/TextField.js +4 -1
- package/Transition/Fade.d.ts +1 -1
- package/Transition/SlideFade.d.ts +1 -1
- package/Transition/Transition.d.ts +6 -6
- package/Transition/Zoom.d.ts +1 -1
- package/Tree/TreeNode.d.ts +1 -1
- package/Tree/TreeNodeList.d.ts +1 -1
- package/Tree/typings.d.ts +7 -7
- package/Typography/Typography.d.ts +2 -2
- package/Typography/index.d.ts +1 -1
- package/Upload/UploadPicture.d.ts +1 -1
- package/Upload/UploadPictureBlock.d.ts +1 -0
- package/Upload/UploadPictureBlock.js +2 -2
- package/Upload/UploadPictureWall.d.ts +7 -2
- package/Upload/UploadPictureWall.js +2 -2
- package/Upload/UploadPictureWallItem.d.ts +1 -0
- package/Upload/UploadPictureWallItem.js +2 -2
- package/hooks/useClickAway.d.ts +3 -3
- package/hooks/useDocumentEscapeKeyDown.d.ts +1 -1
- package/hooks/useDocumentEvents.d.ts +1 -1
- package/hooks/useDocumentTabKeyDown.d.ts +1 -1
- package/index.d.ts +1 -1
- package/index.js +1 -0
- package/package.json +17 -17
- package/utils/composeRefs.d.ts +2 -2
- package/utils/general.d.ts +2 -2
- package/utils/getElement.d.ts +1 -1
- package/utils/jsx-types.d.ts +5 -5
package/Select/AutoComplete.d.ts
CHANGED
|
@@ -53,7 +53,7 @@ export interface AutoCompleteBaseProps extends Omit<SelectTriggerProps, 'active'
|
|
|
53
53
|
*/
|
|
54
54
|
size?: SelectInputSize;
|
|
55
55
|
}
|
|
56
|
-
export
|
|
56
|
+
export type AutoCompleteMultipleProps = AutoCompleteBaseProps & {
|
|
57
57
|
/**
|
|
58
58
|
* The default selection
|
|
59
59
|
*/
|
|
@@ -72,7 +72,7 @@ export declare type AutoCompleteMultipleProps = AutoCompleteBaseProps & {
|
|
|
72
72
|
*/
|
|
73
73
|
value?: SelectValue[];
|
|
74
74
|
};
|
|
75
|
-
export
|
|
75
|
+
export type AutoCompleteSingleProps = AutoCompleteBaseProps & {
|
|
76
76
|
/**
|
|
77
77
|
* The default selection
|
|
78
78
|
*/
|
|
@@ -91,7 +91,7 @@ export declare type AutoCompleteSingleProps = AutoCompleteBaseProps & {
|
|
|
91
91
|
*/
|
|
92
92
|
value?: SelectValue | null;
|
|
93
93
|
};
|
|
94
|
-
export
|
|
94
|
+
export type AutoCompleteProps = AutoCompleteMultipleProps | AutoCompleteSingleProps;
|
|
95
95
|
/**
|
|
96
96
|
* The AutoComplete component for react. <br />
|
|
97
97
|
* Note that if you need search for ONLY given options, not included your typings,
|
package/Select/Select.d.ts
CHANGED
|
@@ -36,7 +36,7 @@ export interface SelectBaseProps extends Omit<SelectTriggerProps, 'active' | 'in
|
|
|
36
36
|
*/
|
|
37
37
|
size?: SelectInputSize;
|
|
38
38
|
}
|
|
39
|
-
export
|
|
39
|
+
export type SelectMultipleProps = SelectBaseProps & {
|
|
40
40
|
/**
|
|
41
41
|
* The default selection
|
|
42
42
|
*/
|
|
@@ -59,7 +59,7 @@ export declare type SelectMultipleProps = SelectBaseProps & {
|
|
|
59
59
|
*/
|
|
60
60
|
value?: SelectValue[];
|
|
61
61
|
};
|
|
62
|
-
export
|
|
62
|
+
export type SelectSingleProps = SelectBaseProps & {
|
|
63
63
|
/**
|
|
64
64
|
* The default selection
|
|
65
65
|
*/
|
|
@@ -82,6 +82,6 @@ export declare type SelectSingleProps = SelectBaseProps & {
|
|
|
82
82
|
*/
|
|
83
83
|
value?: SelectValue | null;
|
|
84
84
|
};
|
|
85
|
-
export
|
|
85
|
+
export type SelectProps = SelectMultipleProps | SelectSingleProps;
|
|
86
86
|
declare const Select: import("react").ForwardRefExoticComponent<SelectProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
87
87
|
export default Select;
|
|
@@ -2,7 +2,7 @@ import { Ref } from 'react';
|
|
|
2
2
|
import { TextFieldProps } from '../TextField';
|
|
3
3
|
import { SelectValue } from './typings';
|
|
4
4
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
5
|
-
export
|
|
5
|
+
export type SelectTriggerInputProps = Omit<NativeElementPropsWithoutKeyAndRef<'input'>, 'autoComplete' | 'children' | 'defaultValue' | 'disabled' | 'readOnly' | 'required' | 'type' | 'value' | `aria-${'autocomplete' | 'disabled' | 'haspopup' | 'multiline' | 'readonly' | 'required'}`>;
|
|
6
6
|
export interface SelectTriggerBaseProps extends Omit<TextFieldProps, 'active' | 'children' | 'defaultChecked' | 'suffix'> {
|
|
7
7
|
/**
|
|
8
8
|
* Controls the chevron icon layout.
|
|
@@ -51,7 +51,7 @@ export interface SelectTriggerBaseProps extends Omit<TextFieldProps, 'active' |
|
|
|
51
51
|
showTextInputAfterTags?: boolean;
|
|
52
52
|
suffixAction?: VoidFunction;
|
|
53
53
|
}
|
|
54
|
-
export
|
|
54
|
+
export type SelectTriggerMultipleProps = SelectTriggerBaseProps & {
|
|
55
55
|
/**
|
|
56
56
|
* Controls the layout of trigger.
|
|
57
57
|
*/
|
|
@@ -67,7 +67,7 @@ export declare type SelectTriggerMultipleProps = SelectTriggerBaseProps & {
|
|
|
67
67
|
*/
|
|
68
68
|
renderValue?: (value: SelectValue[]) => string;
|
|
69
69
|
};
|
|
70
|
-
export
|
|
70
|
+
export type SelectTriggerSingleProps = SelectTriggerBaseProps & {
|
|
71
71
|
/**
|
|
72
72
|
* Controls the layout of trigger.
|
|
73
73
|
*/
|
|
@@ -83,7 +83,7 @@ export declare type SelectTriggerSingleProps = SelectTriggerBaseProps & {
|
|
|
83
83
|
*/
|
|
84
84
|
renderValue?: (value: SelectValue | null) => string;
|
|
85
85
|
};
|
|
86
|
-
export
|
|
87
|
-
export
|
|
86
|
+
export type SelectTriggerComponentProps = SelectTriggerMultipleProps | SelectTriggerSingleProps;
|
|
87
|
+
export type SelectTriggerProps = Omit<SelectTriggerComponentProps, 'innerRef'>;
|
|
88
88
|
declare const SelectTrigger: import("react").ForwardRefExoticComponent<SelectTriggerProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
89
89
|
export default SelectTrigger;
|
package/Select/SelectTrigger.js
CHANGED
|
@@ -23,7 +23,10 @@ function SelectTriggerComponent(props) {
|
|
|
23
23
|
return '';
|
|
24
24
|
};
|
|
25
25
|
/** Compute suffix action icon */
|
|
26
|
-
const suffixActionIcon = suffixActionIconProp || (jsx(Icon, { icon: ChevronDownIcon, onClick:
|
|
26
|
+
const suffixActionIcon = suffixActionIconProp || (jsx(Icon, { icon: ChevronDownIcon, onClick: (e) => {
|
|
27
|
+
e.stopPropagation();
|
|
28
|
+
suffixAction === null || suffixAction === void 0 ? void 0 : suffixAction();
|
|
29
|
+
}, className: cx(selectClasses.triggerSuffixActionIcon, {
|
|
27
30
|
[selectClasses.triggerSuffixActionIconActive]: active,
|
|
28
31
|
}) }));
|
|
29
32
|
const getTextFieldActive = () => {
|
package/Slider/Slider.d.ts
CHANGED
|
@@ -32,16 +32,16 @@ export interface SliderBaseProps extends Omit<NativeElementPropsWithoutKeyAndRef
|
|
|
32
32
|
*/
|
|
33
33
|
innerRef?: Ref<HTMLDivElement>;
|
|
34
34
|
}
|
|
35
|
-
export
|
|
35
|
+
export type SingleSliderProps = SliderBaseProps & {
|
|
36
36
|
onChange?: (value: SingleSliderValue) => void;
|
|
37
37
|
value: UseSingleSliderProps['value'];
|
|
38
38
|
};
|
|
39
|
-
export
|
|
39
|
+
export type RangeSliderProps = SliderBaseProps & {
|
|
40
40
|
onChange?: (value: RangeSliderValue) => void;
|
|
41
41
|
value: UseRangeSliderProps['value'];
|
|
42
42
|
};
|
|
43
|
-
export
|
|
44
|
-
export
|
|
43
|
+
export type SliderComponentProps = SingleSliderProps | RangeSliderProps;
|
|
44
|
+
export type SliderProps = Omit<SliderComponentProps, 'innerRef'>;
|
|
45
45
|
/**
|
|
46
46
|
* The react component for `mezzanine` slider.
|
|
47
47
|
* The outcome will be base on the type of given value.
|
package/Table/Table.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { TableColumn, TableComponents, TableDataSource, TableRowSelection, TableExpandable, TableFetchMore, TablePagination as TablePaginationType, TableRefresh as TableRefreshType } from '@mezzanine-ui/core/table';
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TableColumn, TableComponents, TableDataSource, TableRowSelection, TableExpandable, TableFetchMore, TablePagination as TablePaginationType, TableRefresh as TableRefreshType, ExpandRowBySources } from '@mezzanine-ui/core/table';
|
|
3
3
|
import { EmptyProps } from '../Empty';
|
|
4
4
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
5
5
|
export interface TableBaseProps<T> extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'role'> {
|
|
@@ -36,7 +36,9 @@ export interface TableBaseProps<T> extends Omit<NativeElementPropsWithoutKeyAndR
|
|
|
36
36
|
* When `expandable.rowExpandable` is given, it will control whether row data is expandable or not
|
|
37
37
|
* `expandable.expandedRowRender` is a callback to helps you decides what data should be rendered.
|
|
38
38
|
*/
|
|
39
|
-
expandable?: TableExpandable<T
|
|
39
|
+
expandable?: Omit<TableExpandable<T>, 'expandedRowRender'> & {
|
|
40
|
+
expandedRowRender(record: T): ReactNode | ExpandRowBySources;
|
|
41
|
+
};
|
|
40
42
|
/**
|
|
41
43
|
* customized header className
|
|
42
44
|
*/
|
|
@@ -81,6 +83,6 @@ export interface TableWithPagination<T> extends TableBaseProps<T> {
|
|
|
81
83
|
pagination?: TablePaginationType;
|
|
82
84
|
fetchMore?: undefined;
|
|
83
85
|
}
|
|
84
|
-
export
|
|
86
|
+
export type TableProps<T> = TableWithFetchMore<T> | TableWithPagination<T>;
|
|
85
87
|
declare const Table: import("react").ForwardRefExoticComponent<TableProps<Record<string, unknown>> & import("react").RefAttributes<HTMLDivElement>>;
|
|
86
88
|
export default Table;
|
package/Table/Table.js
CHANGED
|
@@ -58,7 +58,7 @@ const Table = forwardRef(function Table(props, ref) {
|
|
|
58
58
|
}, [refreshProp === null || refreshProp === void 0 ? void 0 : refreshProp.show]);
|
|
59
59
|
/** context */
|
|
60
60
|
const tableContextValue = useMemo(() => {
|
|
61
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j
|
|
61
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
62
62
|
return ({
|
|
63
63
|
scrollBarSize: 4,
|
|
64
64
|
emptyProps,
|
|
@@ -83,13 +83,10 @@ const Table = forwardRef(function Table(props, ref) {
|
|
|
83
83
|
onChange: paginationProp.onChange,
|
|
84
84
|
total: (_b = paginationProp.total) !== null && _b !== void 0 ? _b : dataSource.length,
|
|
85
85
|
options: {
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
hidePreviousButton: (_l = (_k = paginationProp.options) === null || _k === void 0 ? void 0 : _k.hidePreviousButton) !== null && _l !== void 0 ? _l : false,
|
|
91
|
-
pageSize: (_o = (_m = paginationProp.options) === null || _m === void 0 ? void 0 : _m.pageSize) !== null && _o !== void 0 ? _o : 10,
|
|
92
|
-
siblingCount: (_q = (_p = paginationProp.options) === null || _p === void 0 ? void 0 : _p.siblingCount) !== null && _q !== void 0 ? _q : 1,
|
|
86
|
+
...((_c = paginationProp.options) !== null && _c !== void 0 ? _c : {}),
|
|
87
|
+
boundaryCount: (_e = (_d = paginationProp.options) === null || _d === void 0 ? void 0 : _d.boundaryCount) !== null && _e !== void 0 ? _e : 1,
|
|
88
|
+
pageSize: (_g = (_f = paginationProp.options) === null || _f === void 0 ? void 0 : _f.pageSize) !== null && _g !== void 0 ? _g : 10,
|
|
89
|
+
siblingCount: (_j = (_h = paginationProp.options) === null || _h === void 0 ? void 0 : _h.siblingCount) !== null && _j !== void 0 ? _j : 1,
|
|
93
90
|
},
|
|
94
91
|
} : undefined,
|
|
95
92
|
});
|
|
@@ -109,13 +106,16 @@ const Table = forwardRef(function Table(props, ref) {
|
|
|
109
106
|
isReachEnd,
|
|
110
107
|
paginationProp,
|
|
111
108
|
]);
|
|
112
|
-
const tableDataContextValue = {
|
|
109
|
+
const tableDataContextValue = useMemo(() => ({
|
|
113
110
|
columns,
|
|
114
111
|
dataSource,
|
|
115
|
-
};
|
|
116
|
-
const tableComponentContextValue = {
|
|
117
|
-
|
|
118
|
-
|
|
112
|
+
}), [columns, dataSource]);
|
|
113
|
+
const tableComponentContextValue = useMemo(() => {
|
|
114
|
+
var _a;
|
|
115
|
+
return ({
|
|
116
|
+
bodyCell: (_a = components === null || components === void 0 ? void 0 : components.body) === null || _a === void 0 ? void 0 : _a.cell,
|
|
117
|
+
});
|
|
118
|
+
}, [(_a = components === null || components === void 0 ? void 0 : components.body) === null || _a === void 0 ? void 0 : _a.cell]);
|
|
119
119
|
return (jsx(Loading, { loading: loading, stretch: true, tip: "\u8CC7\u6599\u8F09\u5165\u4E2D...", children: jsx("div", { ref: ref, ...rest, className: cx(tableClasses.host, className), role: "grid", children: jsx(TableContext.Provider, { value: tableContextValue, children: jsx(TableDataContext.Provider, { value: tableDataContextValue, children: jsxs(TableComponentContext.Provider, { value: tableComponentContextValue, children: [isRefreshShow ? (jsx(TableRefresh, { onClick: refreshProp.onClick })) : null, jsx(TableHeader, { className: headerClassName }), jsx(TableBody, { ref: bodyRef, className: bodyClassName, rowClassName: bodyRowClassName }), paginationProp ? (jsx(TablePagination, { bodyRef: bodyRef })) : null] }) }) }) }) }));
|
|
120
120
|
});
|
|
121
121
|
var Table$1 = Table;
|
package/Table/TableBodyRow.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsxs, jsx
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { forwardRef, useContext, useState, useMemo, Fragment } from 'react';
|
|
3
3
|
import { tableClasses, getColumnStyle, getCellStyle } from '@mezzanine-ui/core/table';
|
|
4
4
|
import get from 'lodash/get';
|
|
@@ -33,8 +33,8 @@ const TableBodyRow = forwardRef(function TableBodyRow(props, ref) {
|
|
|
33
33
|
var _a, _b, _c, _d;
|
|
34
34
|
const ellipsis = !!(get(rowData, column.dataIndex)) && ((_a = column.ellipsis) !== null && _a !== void 0 ? _a : true);
|
|
35
35
|
const tooltipTitle = ((_c = (_b = column.renderTooltipTitle) === null || _b === void 0 ? void 0 : _b.call(column, rowData)) !== null && _c !== void 0 ? _c : get(rowData, column.dataIndex));
|
|
36
|
-
return (jsx("div", { className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle(column), children: jsx(TableEditRenderWrapper, { ...column, rowData: rowData, children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle(column), tooltipTitle: tooltipTitle, children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column,
|
|
37
|
-
})] }), renderedExpandedContent ? (jsx(
|
|
36
|
+
return (jsx("div", { className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle(column), children: jsx(TableEditRenderWrapper, { ...column, rowData: rowData, children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle(column), tooltipTitle: tooltipTitle, children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column, rowData, rowIndex, column)) || get(rowData, column.dataIndex) }) }) }, `${column.dataIndex}-${column.title}`));
|
|
37
|
+
})] }), renderedExpandedContent ? (jsx(AccordionDetails, { className: cx(expanding.className, tableClasses.bodyRowExpandedTableWrapper), expanded: expanded, children: (renderedExpandedContent === null || renderedExpandedContent === void 0 ? void 0 : renderedExpandedContent.dataSource) ? (jsx(TableExpandedTable, { renderedExpandedContent: renderedExpandedContent })) : renderedExpandedContent })) : null] }));
|
|
38
38
|
});
|
|
39
39
|
var TableBodyRow$1 = TableBodyRow;
|
|
40
40
|
|
package/Table/TableContext.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
import { TableRowSelection, TableColumn, TableExpandable, TablePagination, TableDataSource, TableRecord } from '@mezzanine-ui/core/table';
|
|
1
|
+
import { ReactNode } from 'react';
|
|
2
|
+
import { TableRowSelection, TableColumn, TableExpandable, TablePagination, TableDataSource, TableRecord, ExpandRowBySources } from '@mezzanine-ui/core/table';
|
|
3
3
|
import { EmptyProps } from '../Empty';
|
|
4
4
|
/** typeof rowSelection */
|
|
5
5
|
export interface RowSelectionContext extends Pick<TableRowSelection, 'actions'> {
|
|
@@ -30,7 +30,9 @@ export interface TableContextProps {
|
|
|
30
30
|
sorting?: SortingContext;
|
|
31
31
|
loading?: boolean;
|
|
32
32
|
setLoading?(l: boolean): void;
|
|
33
|
-
expanding?: TableExpandable<TableRecord<unknown
|
|
33
|
+
expanding?: Omit<TableExpandable<TableRecord<unknown>>, 'expandedRowRender'> & {
|
|
34
|
+
expandedRowRender(record: TableRecord<unknown>): ReactNode | ExpandRowBySources;
|
|
35
|
+
};
|
|
34
36
|
fetchMore?: FetchMoreContext;
|
|
35
37
|
pagination?: TablePagination;
|
|
36
38
|
}
|
|
@@ -17,7 +17,7 @@ const TableExpandedTable = forwardRef(function TableExpandedTable(props, ref) {
|
|
|
17
17
|
var _a, _b, _c, _d;
|
|
18
18
|
const ellipsis = !!(get(source, column.dataIndex)) && ((_a = column.ellipsis) !== null && _a !== void 0 ? _a : true);
|
|
19
19
|
const tooltipTitle = ((_c = (_b = column.renderTooltipTitle) === null || _b === void 0 ? void 0 : _b.call(column, source)) !== null && _c !== void 0 ? _c : get(source, column.dataIndex));
|
|
20
|
-
return (jsx("div", { className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle((columns !== null && columns !== void 0 ? columns : [])[index]), children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle((columns !== null && columns !== void 0 ? columns : [])[index]), tooltipTitle: tooltipTitle || '', children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column,
|
|
20
|
+
return (jsx("div", { className: cx(tableClasses.bodyRowCellWrapper, column.bodyClassName), style: getColumnStyle((columns !== null && columns !== void 0 ? columns : [])[index]), children: jsx(TableCell, { ellipsis: ellipsis, forceShownTooltipWhenHovered: column.forceShownTooltipWhenHovered, style: getCellStyle((columns !== null && columns !== void 0 ? columns : [])[index]), tooltipTitle: tooltipTitle || '', children: ((_d = column.render) === null || _d === void 0 ? void 0 : _d.call(column, source, sourceIndex, column)) || get(source, column.dataIndex) }) }, `${column.dataIndex}-${index}`));
|
|
21
21
|
})] }, (source.key || source.id)));
|
|
22
22
|
}) }));
|
|
23
23
|
});
|
|
@@ -7,6 +7,7 @@ import Pagination from '../../Pagination/Pagination.js';
|
|
|
7
7
|
import cx from 'clsx';
|
|
8
8
|
|
|
9
9
|
const TablePagination = forwardRef(function TablePagination(props, ref) {
|
|
10
|
+
var _a;
|
|
10
11
|
const { className, bodyRef, ...rest } = props;
|
|
11
12
|
const { pagination, } = useContext(TableContext) || {};
|
|
12
13
|
const { current: currentPageProp, onChange: onChangePageProp, total, options: paginationOptions = {}, } = pagination || {};
|
|
@@ -15,10 +16,10 @@ const TablePagination = forwardRef(function TablePagination(props, ref) {
|
|
|
15
16
|
current: currentPageProp,
|
|
16
17
|
onChange: onChangePageProp,
|
|
17
18
|
});
|
|
18
|
-
const { boundaryCount, className: paginationClassName, disabled, hideNextButton, hidePreviousButton, pageSize: pageSizeProp, siblingCount, } = paginationOptions;
|
|
19
|
+
const { boundaryCount, className: paginationClassName, disabled, hideNextButton, hidePreviousButton, jumperButtonText, jumperHintText, jumperInputPlaceholder, onChangePageSize, pageSize: pageSizeProp, pageSizeLabel, pageSizeOptions, pageSizeUnit, renderPageSizeOptionName, renderPaginationSummary, showJumper, showPageSizeOptions, siblingCount, } = paginationOptions;
|
|
19
20
|
const currentStartCount = (pageSizeProp * (currentPage - 1)) + 1;
|
|
20
21
|
const currentEndCount = Math.min(pageSizeProp * currentPage, total);
|
|
21
|
-
return (jsxs("div", { ...rest, ref: ref, className: cx(tableClasses.pagination, className), children: [jsx("span", { className: tableClasses.paginationIndicator, children: `目前顯示 ${currentStartCount} - ${currentEndCount} 筆,共 ${total} 筆資料` }), jsx("div", { className: tableClasses.paginationActions, children: jsx(Pagination, { boundaryCount: boundaryCount, className: paginationClassName, current: currentPage, disabled: disabled, hideNextButton: hideNextButton, hidePreviousButton: hidePreviousButton, onChange: setCurrentPage, pageSize: pageSizeProp, siblingCount: siblingCount, total: total }) })] }));
|
|
22
|
+
return (jsxs("div", { ...rest, ref: ref, className: cx(tableClasses.pagination, className), children: [jsx("span", { className: tableClasses.paginationIndicator, children: (_a = renderPaginationSummary === null || renderPaginationSummary === void 0 ? void 0 : renderPaginationSummary(currentStartCount, currentEndCount)) !== null && _a !== void 0 ? _a : `目前顯示 ${currentStartCount} - ${currentEndCount} 筆,共 ${total} 筆資料` }), jsx("div", { className: tableClasses.paginationActions, children: jsx(Pagination, { boundaryCount: boundaryCount, buttonText: jumperButtonText, className: paginationClassName, current: currentPage, disabled: disabled, hideNextButton: hideNextButton, hidePreviousButton: hidePreviousButton, hintText: jumperHintText, inputPlaceholder: jumperInputPlaceholder, onChange: setCurrentPage, onChangePageSize: onChangePageSize, pageSize: pageSizeProp, pageSizeLabel: pageSizeLabel, pageSizeOptions: pageSizeOptions, pageSizeUnit: pageSizeUnit, renderPageSizeOptionName: renderPageSizeOptionName, showJumper: showJumper, showPageSizeOptions: showPageSizeOptions, siblingCount: siblingCount, total: total }) })] }));
|
|
22
23
|
});
|
|
23
24
|
var TablePagination$1 = TablePagination;
|
|
24
25
|
|
|
@@ -2,7 +2,7 @@ import { TableDataSource, TableColumn, TableRecord } from '@mezzanine-ui/core/ta
|
|
|
2
2
|
export interface UseTableSorting {
|
|
3
3
|
dataSource: TableDataSource[];
|
|
4
4
|
}
|
|
5
|
-
export
|
|
5
|
+
export type SortedType = 'desc' | 'asc' | 'none';
|
|
6
6
|
export declare function useTableSorting(props: UseTableSorting): readonly [TableDataSource[], (v: Pick<TableColumn<TableRecord<unknown>>, "dataIndex" | "sorter" | "onSorted">) => void, {
|
|
7
7
|
readonly sortedOn: string;
|
|
8
8
|
readonly sortedType: SortedType;
|
|
@@ -25,6 +25,7 @@ export default function useTableScroll(): readonly [{
|
|
|
25
25
|
hidden?: boolean | undefined;
|
|
26
26
|
id?: string | undefined;
|
|
27
27
|
lang?: string | undefined;
|
|
28
|
+
nonce?: string | undefined;
|
|
28
29
|
placeholder?: string | undefined;
|
|
29
30
|
slot?: string | undefined;
|
|
30
31
|
spellCheck?: (boolean | "true" | "false") | undefined;
|
|
@@ -176,6 +177,8 @@ export default function useTableScroll(): readonly [{
|
|
|
176
177
|
onProgressCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
177
178
|
onRateChange?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
178
179
|
onRateChangeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
180
|
+
onResize?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
181
|
+
onResizeCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
179
182
|
onSeeked?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
180
183
|
onSeekedCapture?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
|
181
184
|
onSeeking?: import("react").ReactEventHandler<HTMLDivElement> | undefined;
|
package/Tabs/Tabs.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Key, MouseEvent, ReactElement, ReactNode } from 'react';
|
|
2
2
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
3
|
import { TabPaneProps } from './TabPane';
|
|
4
|
-
export
|
|
4
|
+
export type TabsChild = ReactElement<TabPaneProps>;
|
|
5
5
|
export interface TabsProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'onChange' | 'children'> {
|
|
6
6
|
/**
|
|
7
7
|
* Current TabPane's index
|
package/TextField/TextField.js
CHANGED
|
@@ -19,7 +19,10 @@ const TextField = forwardRef(function TextField(props, ref) {
|
|
|
19
19
|
});
|
|
20
20
|
return (
|
|
21
21
|
// eslint-disable-next-line jsx-a11y/no-static-element-interactions
|
|
22
|
-
jsxs("div", { ...rest, ref: ref, role: roleProp || role, onClick:
|
|
22
|
+
jsxs("div", { ...rest, ref: ref, role: roleProp || role, onClick: (evt) => {
|
|
23
|
+
evt.stopPropagation();
|
|
24
|
+
onClick === null || onClick === void 0 ? void 0 : onClick(evt);
|
|
25
|
+
}, onKeyDown: onKeyDown, className: cx(textFieldClasses.host, textFieldClasses.size(size), {
|
|
23
26
|
[textFieldClasses.active]: active,
|
|
24
27
|
[textFieldClasses.clearable]: clearable,
|
|
25
28
|
[textFieldClasses.disabled]: disabled,
|
package/Transition/Fade.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TransitionImplementationProps } from './Transition';
|
|
3
|
-
export
|
|
3
|
+
export type FadeProps = TransitionImplementationProps;
|
|
4
4
|
/**
|
|
5
5
|
* The react component for `mezzanine` transition fade.
|
|
6
6
|
*/
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TransitionImplementationProps } from './Transition';
|
|
3
|
-
export
|
|
3
|
+
export type SlideFadeDirection = 'left' | 'right' | 'up' | 'down';
|
|
4
4
|
export interface SlideFadeProps extends TransitionImplementationProps {
|
|
5
5
|
/**
|
|
6
6
|
* The direction of child element will enter to.
|
|
@@ -2,18 +2,18 @@ import { RefObject, CSSProperties, ReactElement, JSXElementConstructor, Ref } fr
|
|
|
2
2
|
import { TransitionStatus as TransitionState, TransitionChildren } from 'react-transition-group/Transition';
|
|
3
3
|
import { NativeElementTag } from '../utils/jsx-types';
|
|
4
4
|
export { TransitionState };
|
|
5
|
-
export
|
|
6
|
-
export
|
|
5
|
+
export type TransitionMode = 'enter' | 'exit';
|
|
6
|
+
export type TransitionDuration = 'auto' | number | {
|
|
7
7
|
[mode in TransitionMode]?: number;
|
|
8
8
|
};
|
|
9
|
-
export
|
|
9
|
+
export type TransitionEasing = string | {
|
|
10
10
|
[mode in TransitionMode]?: string;
|
|
11
11
|
};
|
|
12
|
-
export
|
|
12
|
+
export type TransitionDelay = number | {
|
|
13
13
|
[mode in TransitionMode]?: number;
|
|
14
14
|
};
|
|
15
|
-
export
|
|
16
|
-
export
|
|
15
|
+
export type TransitionEnterHandler = (node: HTMLElement, isAppearing: boolean) => void;
|
|
16
|
+
export type TransitionExitHandler = (node: HTMLElement) => void;
|
|
17
17
|
export interface TransitionImplementationChildProps {
|
|
18
18
|
ref?: Ref<HTMLElement>;
|
|
19
19
|
style?: CSSProperties;
|
package/Transition/Zoom.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { TransitionImplementationProps } from './Transition';
|
|
3
|
-
export
|
|
3
|
+
export type ZoomProps = TransitionImplementationProps;
|
|
4
4
|
/**
|
|
5
5
|
* The react component for `mezzanine` transition zoom.
|
|
6
6
|
*/
|
package/Tree/TreeNode.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { TreeNodeValue, TreeSize } from '@mezzanine-ui/core/tree';
|
|
|
3
3
|
import { CollapseProps } from '../Transition';
|
|
4
4
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
5
5
|
import { TreeNodeData } from './typings';
|
|
6
|
-
export
|
|
6
|
+
export type TreeNodeElementProps = Omit<NativeElementPropsWithoutKeyAndRef<'li'>, 'children' | 'value' | 'onSelect'>;
|
|
7
7
|
export interface TreeNodeProps extends TreeNodeData, TreeNodeElementProps {
|
|
8
8
|
/**
|
|
9
9
|
* Provided children will be wrapped under `Collapse`.
|
package/Tree/TreeNodeList.d.ts
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
3
|
import { TreeNodeElementProps, TreeNodeProps } from './TreeNode';
|
|
4
4
|
import { TreeNodeData, TreeNodeRefs } from './typings';
|
|
5
|
-
export
|
|
5
|
+
export type TreeNodeListElementProps = Omit<NativeElementPropsWithoutKeyAndRef<'ul'>, 'children' | 'onSelect'>;
|
|
6
6
|
export interface TreeNodeListProps extends TreeNodeListElementProps, Pick<TreeNodeProps, 'multiple' | 'onExpand' | 'onSelect' | 'selectable' | 'size'> {
|
|
7
7
|
/**
|
|
8
8
|
* Given nodes will be passed to `TreeNode` component orderly.
|
package/Tree/typings.d.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { MutableRefObject, ReactNode } from 'react';
|
|
2
2
|
import { TreeNodeDataShape, TreeNodeEntityShape, TreeNodePropShape, TreeNodeValue } from '@mezzanine-ui/core/tree';
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
7
|
-
export
|
|
8
|
-
export
|
|
9
|
-
export
|
|
3
|
+
export type TreeNodeProp = TreeNodePropShape<ReactNode>;
|
|
4
|
+
export type TreeNodeData = TreeNodeDataShape<ReactNode>;
|
|
5
|
+
export type TreeNodeEntity = TreeNodeEntityShape<ReactNode>;
|
|
6
|
+
export type TreeNodeEntities = Map<TreeNodeValue, TreeNodeEntity>;
|
|
7
|
+
export type TreeNodeRefsShape = Record<TreeNodeValue, HTMLLIElement>;
|
|
8
|
+
export type TreeNodeRefs = MutableRefObject<TreeNodeRefsShape | undefined>;
|
|
9
|
+
export type TreeExpandControl = {
|
|
10
10
|
collapse: (value: TreeNodeValue) => void;
|
|
11
11
|
collapseAll: () => void;
|
|
12
12
|
collapseAllFrom: (value: TreeNodeValue) => void;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { JSXElementConstructor } from 'react';
|
|
2
2
|
import { TypographyAlign, TypographyColor, TypographyDisplay, TypographyVariant } from '@mezzanine-ui/core/typography';
|
|
3
3
|
import { ComponentOverridableForwardRefComponentPropsFactory } from '../utils/jsx-types';
|
|
4
|
-
export
|
|
4
|
+
export type TypographyComponent = `h${1 | 2 | 3 | 4 | 5 | 6}` | 'p' | 'span' | 'label' | 'div' | 'caption' | 'a' | JSXElementConstructor<any>;
|
|
5
5
|
interface TypographyPropsBase {
|
|
6
6
|
/**
|
|
7
7
|
* The css variable for `text-align`.
|
|
@@ -33,7 +33,7 @@ interface TypographyPropsBase {
|
|
|
33
33
|
*/
|
|
34
34
|
variant?: TypographyVariant;
|
|
35
35
|
}
|
|
36
|
-
export
|
|
36
|
+
export type TypographyProps<C extends TypographyComponent = 'p'> = ComponentOverridableForwardRefComponentPropsFactory<TypographyComponent, C, TypographyPropsBase>;
|
|
37
37
|
/**
|
|
38
38
|
* The react component for `mezzanine` typography.
|
|
39
39
|
*/
|
package/Typography/index.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ export type { TypographyComponent, TypographyProps, };
|
|
|
6
6
|
* @remark
|
|
7
7
|
* Add type alias here for parsable to react docgen typescript.
|
|
8
8
|
*/
|
|
9
|
-
|
|
9
|
+
type GenericTypography = <C extends TypographyComponent = 'p'>(props: PropsWithoutRef<TypographyProps<C>> & RefAttributes<ElementRef<C>>) => ReactElement;
|
|
10
10
|
declare const _default: GenericTypography;
|
|
11
11
|
export default _default;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
|
-
export
|
|
3
|
+
export type UploadPictureControl = {
|
|
4
4
|
getData: () => void;
|
|
5
5
|
};
|
|
6
6
|
export interface UploadPictureProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'children' | 'onChange' | 'onError' | 'value'> {
|
|
@@ -3,6 +3,7 @@ import { ImageUploader } from '@mezzanine-ui/core/upload';
|
|
|
3
3
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
4
4
|
export interface UploadPictureBlockProps extends Omit<NativeElementPropsWithoutKeyAndRef<'button'>, 'children' | 'onChange' | 'value'> {
|
|
5
5
|
accept?: string;
|
|
6
|
+
fileHost?: string;
|
|
6
7
|
imageLoader: ImageUploader;
|
|
7
8
|
multiple?: boolean;
|
|
8
9
|
onDelete?: MouseEventHandler;
|
|
@@ -8,7 +8,7 @@ import Icon from '../Icon/Icon.js';
|
|
|
8
8
|
import cx from 'clsx';
|
|
9
9
|
|
|
10
10
|
const UploadPictureBlock = forwardRef(function UploadPictureBlock(props, ref) {
|
|
11
|
-
const { accept = 'image/*', disabled = false, imageLoader, multiple = false, onDelete, onUpload, onValueChange, } = props;
|
|
11
|
+
const { accept = 'image/*', disabled = false, imageLoader, multiple = false, onDelete, onUpload, onValueChange, fileHost, } = props;
|
|
12
12
|
const [previewImage, setPreviewImage] = useState(imageLoader.getPreview() || '');
|
|
13
13
|
const [value, setValue] = useState(imageLoader.getUrl() || '');
|
|
14
14
|
const [percentage, setPercentage] = useState(imageLoader.getPercentage() || 0);
|
|
@@ -75,7 +75,7 @@ const UploadPictureBlock = forwardRef(function UploadPictureBlock(props, ref) {
|
|
|
75
75
|
[uploadPictureBlockClasses.disabled]: disabled,
|
|
76
76
|
}), style: style, children: [jsx(UploadInput, { ref: inputRef, accept: accept, disabled: disabled, multiple: multiple, onUpload: onUpload }), isError ? (jsxs("div", { className: uploadPictureBlockClasses.group, children: [jsx(Icon, { icon: TimesIcon }), jsx("span", { className: uploadPictureBlockClasses.status, children: "\u4E0A\u50B3\u932F\u8AA4" })] })) : (
|
|
77
77
|
// eslint-disable-next-line react/jsx-no-useless-fragment
|
|
78
|
-
jsx(Fragment, { children: showImage ? (jsxs(Fragment, { children: [jsx("img", { alt: "", src: (value || previewImage), className: uploadPictureBlockClasses.preview }), isLoading ? (jsxs("div", { className: uploadPictureBlockClasses.group, children: [jsx(Icon, { icon: SpinnerIcon, spin: true }), jsx("span", { className: uploadPictureBlockClasses.status, children: "\u4E0A\u50B3\u4E2D..." })] })) : null] })) : (jsxs("div", { className: uploadPictureBlockClasses.group, children: [jsx(Icon, { icon: UploadIcon }), jsx("span", { className: uploadPictureBlockClasses.status, children: "\u4E0A\u50B3\u5F71\u50CF" })] })) })), !disabled && canDeleteImage && (jsx("div", { className: uploadPictureBlockClasses.delete, children: jsx(Icon, { icon: TrashIcon }) }))] }));
|
|
78
|
+
jsx(Fragment, { children: showImage ? (jsxs(Fragment, { children: [jsx("img", { alt: "", src: (value ? `${fileHost || ''}${value}` : previewImage), className: uploadPictureBlockClasses.preview }), isLoading ? (jsxs("div", { className: uploadPictureBlockClasses.group, children: [jsx(Icon, { icon: SpinnerIcon, spin: true }), jsx("span", { className: uploadPictureBlockClasses.status, children: "\u4E0A\u50B3\u4E2D..." })] })) : null] })) : (jsxs("div", { className: uploadPictureBlockClasses.group, children: [jsx(Icon, { icon: UploadIcon }), jsx("span", { className: uploadPictureBlockClasses.status, children: "\u4E0A\u50B3\u5F71\u50CF" })] })) })), !disabled && canDeleteImage && (jsx("div", { className: uploadPictureBlockClasses.delete, children: jsx(Icon, { icon: TrashIcon }) }))] }));
|
|
79
79
|
});
|
|
80
80
|
var UploadPictureBlock$1 = UploadPictureBlock;
|
|
81
81
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Ref } from 'react';
|
|
2
2
|
import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
3
|
-
export
|
|
3
|
+
export type UploadPictureWallControl = {
|
|
4
4
|
getAllData: () => void;
|
|
5
5
|
};
|
|
6
6
|
export interface UploadPictureWallBaseProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'children' | 'onChange' | 'onError' | 'value'> {
|
|
@@ -22,6 +22,11 @@ export interface UploadPictureWallBaseProps extends Omit<NativeElementPropsWitho
|
|
|
22
22
|
* @default false
|
|
23
23
|
*/
|
|
24
24
|
disabled?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* File hostname such as http://xxxx.xxxx/
|
|
27
|
+
* @default ''
|
|
28
|
+
*/
|
|
29
|
+
fileHost?: string;
|
|
25
30
|
/**
|
|
26
31
|
* maximum file lengths
|
|
27
32
|
*/
|
|
@@ -70,6 +75,6 @@ export interface UploadPictureWallMultiUploadProps extends UploadPictureWallBase
|
|
|
70
75
|
onUpload?: undefined;
|
|
71
76
|
parallel?: undefined;
|
|
72
77
|
}
|
|
73
|
-
export
|
|
78
|
+
export type UploadPictureWallProps = UploadPictureWallSingleUploadProps | UploadPictureWallMultiUploadProps;
|
|
74
79
|
declare const UploadPictureWall: import("react").ForwardRefExoticComponent<UploadPictureWallProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
75
80
|
export default UploadPictureWall;
|
|
@@ -9,7 +9,7 @@ import UploadPictureWallItem from './UploadPictureWallItem.js';
|
|
|
9
9
|
import cx from 'clsx';
|
|
10
10
|
|
|
11
11
|
const UploadPictureWall = forwardRef(function UploadPictureWall(props, ref) {
|
|
12
|
-
const { accept = 'image/*', className, controllerRef, defaultValues, disabled = false, maxLength, multiple = true, onChange, onDelete, onError, onMultiUpload, onUpload, onUploadSuccess, parallel = false, style, } = props;
|
|
12
|
+
const { accept = 'image/*', className, controllerRef, defaultValues, disabled = false, fileHost = '', maxLength, multiple = true, onChange, onDelete, onError, onMultiUpload, onUpload, onUploadSuccess, parallel = false, style, } = props;
|
|
13
13
|
const [uploadPictureImageLoaders, setUploadPictureImageLoader] = useState(defaultValues ? compact(defaultValues).map((value) => new ImageUploader(undefined, value)) : []);
|
|
14
14
|
const [needUploadImageLoaders, setNeedUploadImageLoaders] = useState([]);
|
|
15
15
|
const [needUploadImageLoaderSets, setNeedUploadImageLoaderSets] = useState([]);
|
|
@@ -150,7 +150,7 @@ const UploadPictureWall = forwardRef(function UploadPictureWall(props, ref) {
|
|
|
150
150
|
useImperativeHandle(controllerRef, () => ({
|
|
151
151
|
getAllData: () => uploadPictureImageLoaders.map((loader) => loader.getAll()),
|
|
152
152
|
}));
|
|
153
|
-
return (jsxs("div", { ref: ref, className: cx(uploadPictureWallClasses.host, className), style: style, children: [loaderList.map((up) => (jsx(UploadPictureWallItem, { accept: accept, disabled: disabled, imageLoader: up, multiple: multiple, onDelete: () => onImageDelete(up.getUid()) }, up.getUid()))), maxLength && loaderList.length >= maxLength ? null : (jsx(UploadPictureWallItem, { accept: accept, disabled: disabled, imageLoader: new ImageUploader(), multiple: multiple, onUpload: onImagesUpload }))] }));
|
|
153
|
+
return (jsxs("div", { ref: ref, className: cx(uploadPictureWallClasses.host, className), style: style, children: [loaderList.map((up) => (jsx(UploadPictureWallItem, { accept: accept, disabled: disabled, imageLoader: up, multiple: multiple, onDelete: () => onImageDelete(up.getUid()), fileHost: fileHost }, up.getUid()))), maxLength && loaderList.length >= maxLength ? null : (jsx(UploadPictureWallItem, { accept: accept, disabled: disabled, imageLoader: new ImageUploader(), multiple: multiple, onUpload: onImagesUpload, fileHost: fileHost }))] }));
|
|
154
154
|
});
|
|
155
155
|
var UploadPictureWall$1 = UploadPictureWall;
|
|
156
156
|
|
|
@@ -4,6 +4,7 @@ import { NativeElementPropsWithoutKeyAndRef } from '../utils/jsx-types';
|
|
|
4
4
|
export interface UploadPictureWallItemProps extends Omit<NativeElementPropsWithoutKeyAndRef<'div'>, 'value' | 'onChange' | 'children'> {
|
|
5
5
|
accept?: string;
|
|
6
6
|
disabled?: boolean;
|
|
7
|
+
fileHost?: string;
|
|
7
8
|
imageLoader: ImageUploader;
|
|
8
9
|
multiple?: boolean;
|
|
9
10
|
onDelete?: MouseEventHandler;
|
|
@@ -5,14 +5,14 @@ import UploadPictureBlock from './UploadPictureBlock.js';
|
|
|
5
5
|
import cx from 'clsx';
|
|
6
6
|
|
|
7
7
|
const UploadPictureWallItem = (props) => {
|
|
8
|
-
const { accept, disabled, imageLoader, multiple, onDelete, onUpload, } = props;
|
|
8
|
+
const { accept, disabled, imageLoader, multiple, onDelete, onUpload, fileHost, } = props;
|
|
9
9
|
const loader = useRef(imageLoader);
|
|
10
10
|
useEffect(() => {
|
|
11
11
|
if (!loader.current.getPreview()) {
|
|
12
12
|
loader.current.setPreview();
|
|
13
13
|
}
|
|
14
14
|
}, []);
|
|
15
|
-
return (jsx("div", { className: cx(uploadPictureWallClasses.item), children: jsx(UploadPictureBlock, { accept: accept, disabled: disabled, imageLoader: loader.current, multiple: multiple, onDelete: onDelete, onUpload: onUpload }) }));
|
|
15
|
+
return (jsx("div", { className: cx(uploadPictureWallClasses.item), children: jsx(UploadPictureBlock, { accept: accept, disabled: disabled, imageLoader: loader.current, multiple: multiple, onDelete: onDelete, onUpload: onUpload, fileHost: fileHost }) }));
|
|
16
16
|
};
|
|
17
17
|
var UploadPictureWallItem$1 = UploadPictureWallItem;
|
|
18
18
|
|
package/hooks/useClickAway.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { RefObject, DependencyList } from 'react';
|
|
2
|
-
export
|
|
3
|
-
export
|
|
4
|
-
export
|
|
2
|
+
export type ClickAwayEvent = MouseEvent | TouchEvent | PointerEvent;
|
|
3
|
+
export type ClickAwayHandler = (event: ClickAwayEvent) => void;
|
|
4
|
+
export type ClickAwayHandlerFactory = () => ClickAwayHandler | undefined;
|
|
5
5
|
export declare function useClickAway(factory: ClickAwayHandlerFactory, containerRef: RefObject<HTMLElement>, deps?: DependencyList): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DependencyList } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type DocumentEscapeKeyDownHandlerFactory = () => ((event: KeyboardEvent) => void) | undefined;
|
|
3
3
|
export declare function useDocumentEscapeKeyDown(factory: DocumentEscapeKeyDownHandlerFactory, deps?: DependencyList): void;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { DependencyList } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type DocumentEventHandlersFactory = () => {
|
|
3
3
|
[event in keyof DocumentEventMap]?: (event: DocumentEventMap[event]) => void;
|
|
4
4
|
} | undefined;
|
|
5
5
|
export declare function useDocumentEvents(factory: DocumentEventHandlersFactory, deps?: DependencyList): void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DependencyList } from 'react';
|
|
2
|
-
export
|
|
2
|
+
export type DocumentTabKeyDownHandlerFactory = () => ((event: KeyboardEvent) => void) | undefined;
|
|
3
3
|
export declare function useDocumentTabKeyDown(factory: DocumentTabKeyDownHandlerFactory, deps?: DependencyList): void;
|