onekijs-ui 0.19.20 → 0.19.22
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/components/alert/components/AlertComponent.d.ts +4 -0
- package/dist/components/alert/index.d.ts +2 -0
- package/dist/components/alert/style.d.ts +4 -0
- package/dist/components/alert/typings.d.ts +11 -0
- package/dist/components/card/typings.d.ts +1 -0
- package/dist/components/icon/CrossIcon.d.ts +2 -1
- package/dist/components/icon/typings.d.ts +3 -1
- package/dist/components/table/TableService.d.ts +2 -1
- package/dist/components/table/seralizers/defaultCellSerializer.d.ts +3 -0
- package/dist/components/table/typings.d.ts +6 -1
- package/dist/components/wizard/typings.d.ts +1 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +330 -112
- package/dist/index.js.map +1 -1
- package/dist/index.module.js +326 -113
- package/dist/index.module.js.map +1 -1
- package/dist/styles/border.d.ts +1 -1
- package/dist/styles/flex.d.ts +1 -1
- package/dist/styles/size.d.ts +6 -6
- package/dist/styles/typography.d.ts +2 -2
- package/dist/utils/formatter.d.ts +1 -0
- package/package.json +3 -3
- package/src/components/alert/components/AlertComponent.tsx +56 -0
- package/src/components/alert/index.tsx +9 -0
- package/src/components/alert/style.ts +57 -0
- package/src/components/alert/typings.ts +12 -0
- package/src/components/card/FormCard.tsx +8 -2
- package/src/components/card/typings.ts +1 -0
- package/src/components/icon/CloseAllIcon.tsx +4 -1
- package/src/components/icon/CloseIcon.tsx +4 -1
- package/src/components/icon/CrossIcon.tsx +4 -1
- package/src/components/icon/DebugIcon.tsx +4 -1
- package/src/components/icon/ErrorIcon.tsx +4 -1
- package/src/components/icon/FileIcon.tsx +4 -1
- package/src/components/icon/FilterIcon.tsx +4 -1
- package/src/components/icon/FolderIcon.tsx +4 -1
- package/src/components/icon/HelpIcon.tsx +4 -1
- package/src/components/icon/HideIcon.tsx +4 -1
- package/src/components/icon/InfoIcon.tsx +7 -3
- package/src/components/icon/LoadingIcon.tsx +5 -0
- package/src/components/icon/MenuIcon.tsx +4 -1
- package/src/components/icon/RefreshIcon.tsx +4 -1
- package/src/components/icon/RemoveIcon.tsx +4 -1
- package/src/components/icon/SearchIcon.tsx +4 -1
- package/src/components/icon/ShowIcon.tsx +4 -1
- package/src/components/icon/SuccessIcon.tsx +4 -1
- package/src/components/icon/TogglerIcon.tsx +5 -1
- package/src/components/icon/WarningIcon.tsx +4 -1
- package/src/components/icon/typings.ts +3 -1
- package/src/components/table/TableService.ts +44 -2
- package/src/components/table/columns/checkboxColumn.ts +2 -0
- package/src/components/table/columns/enumColumn.tsx +20 -1
- package/src/components/table/columns/inputColumn.ts +2 -0
- package/src/components/table/columns/numberColumn.ts +2 -0
- package/src/components/table/columns/selectColumn.ts +23 -1
- package/src/components/table/columns/textColumn.ts +2 -0
- package/src/components/table/columns/textareaColumn.ts +2 -0
- package/src/components/table/seralizers/defaultCellSerializer.tsx +8 -0
- package/src/components/table/typings.ts +8 -1
- package/src/components/wizard/components/Step.tsx +3 -0
- package/src/components/wizard/typings.ts +1 -0
- package/src/index.ts +8 -0
- package/src/utils/formatter.ts +20 -0
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { SpacingPropertyTheme, StylableProps } from '../../styles/typings';
|
|
3
|
+
import { IconProps } from '../icon/typings';
|
|
4
|
+
export type AlertProps = StylableProps & {
|
|
5
|
+
kind?: 'success' | 'info' | 'warning' | 'error' | 'debug';
|
|
6
|
+
icon?: boolean;
|
|
7
|
+
IconComponent?: React.FC<IconProps>;
|
|
8
|
+
marginBottom?: SpacingPropertyTheme;
|
|
9
|
+
marginTop?: SpacingPropertyTheme;
|
|
10
|
+
size?: 'small' | 'medium' | 'large';
|
|
11
|
+
};
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
|
|
2
|
+
import { IconProps } from './typings';
|
|
3
|
+
declare const CrossIcon: import("styled-components").StyledComponent<React.FC<IconProps>, import("styled-components").DefaultTheme, {}, never>;
|
|
3
4
|
export default CrossIcon;
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
/// <reference types="react" />
|
|
2
2
|
import { Property } from 'csstype';
|
|
3
|
-
import { ColorPropertyTheme } from '../../styles/typings';
|
|
3
|
+
import { ColorPropertyTheme, SpacingPropertyTheme, TLength } from '../../styles/typings';
|
|
4
4
|
export type IconProps = React.InputHTMLAttributes<HTMLDivElement> & {
|
|
5
5
|
color?: ColorPropertyTheme | Property.Color;
|
|
6
|
+
marginRight?: SpacingPropertyTheme | Property.MarginRight<TLength>;
|
|
7
|
+
marginLeft?: SpacingPropertyTheme | Property.MarginLeft<TLength>;
|
|
6
8
|
};
|
|
7
9
|
export type TogglerIconProps = IconProps & {
|
|
8
10
|
open?: boolean;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { AnonymousObject, CollectionService } from 'onekijs-framework';
|
|
2
2
|
import React from 'react';
|
|
3
|
-
import { TableColumn, TableColumnWidth, TableConfig, TableController, TableItem, TableState } from './typings';
|
|
3
|
+
import { TableColumn, TableColumnWidth, TableConfig, TableController, TableItem, TableSerializerFormat, TableState } from './typings';
|
|
4
4
|
export declare const parseColumnWidth: (width?: string | number) => TableColumnWidth;
|
|
5
5
|
declare class TableService<T = any, I extends TableItem<T> = TableItem<T>, S extends TableState<T, I> = TableState<T, I>> extends CollectionService<T, I, S> implements TableController<T, I> {
|
|
6
6
|
protected cells: AnonymousObject<AnonymousObject<React.RefObject<HTMLDivElement>>>;
|
|
@@ -13,6 +13,7 @@ declare class TableService<T = any, I extends TableItem<T> = TableItem<T>, S ext
|
|
|
13
13
|
initCell(rowNumber: number | 'header-title' | 'header-filter' | 'footer', colId: string, ref: React.RefObject<HTMLDivElement>): void;
|
|
14
14
|
removeColumn(id: string): void;
|
|
15
15
|
resetWidth(): void;
|
|
16
|
+
serialize(data: T[], format: TableSerializerFormat): string;
|
|
16
17
|
toggle(item: I): void;
|
|
17
18
|
protected _setCellWidth(fit: boolean): void;
|
|
18
19
|
}
|
|
@@ -92,6 +92,7 @@ export type TableBodyRowProps<T = any, I extends TableItem<T> = TableItem<T>> =
|
|
|
92
92
|
onCollapsing?: (item: I | undefined, index: number) => void;
|
|
93
93
|
onCollapsed?: (item: I | undefined, index: number) => void;
|
|
94
94
|
};
|
|
95
|
+
export type TableSerializerFormat = 'csv' | 'json';
|
|
95
96
|
export type TableConfig<T = any, I extends TableItem<T> = TableItem<T>> = {
|
|
96
97
|
autoRefresh?: number;
|
|
97
98
|
bodyClassName?: string;
|
|
@@ -127,6 +128,7 @@ export type TableConfig<T = any, I extends TableItem<T> = TableItem<T>> = {
|
|
|
127
128
|
preload?: number;
|
|
128
129
|
rowClassName?: string | ((item: I | undefined, rowIndex: number, columns: TableColumn<T, I>[]) => string);
|
|
129
130
|
RowComponent?: React.FC<TableBodyRowProps<T, I>>;
|
|
131
|
+
serializer?: (data: T[], format: TableSerializerFormat) => string;
|
|
130
132
|
sortable?: boolean;
|
|
131
133
|
stripRows?: boolean;
|
|
132
134
|
tail?: boolean;
|
|
@@ -147,6 +149,7 @@ export type TableController<T = any, I extends TableItem<T> = TableItem<T>, S ex
|
|
|
147
149
|
initCell(rowIndex: number | 'header-title' | 'header-filter' | 'footer', colId: string, ref: React.RefObject<HTMLDivElement>): void;
|
|
148
150
|
removeColumn(id: string): void;
|
|
149
151
|
removeSelected<B extends keyof CollectionBy<T, I>>(by: B, target: CollectionBy<T, I>[B] | CollectionBy<T, I>[B][]): I[];
|
|
152
|
+
serialize: (data: T[], format: TableSerializerFormat) => string;
|
|
150
153
|
setSelected<B extends keyof CollectionBy<T, I>>(by: B, target: CollectionBy<T, I>[B] | CollectionBy<T, I>[B][]): I[];
|
|
151
154
|
startAutoRefresh: (interval: number) => void;
|
|
152
155
|
stopAutoRefresh: () => void;
|
|
@@ -167,6 +170,7 @@ export type TableCellDisplayerProps<T, I extends TableItem<T> = TableItem<T>> =
|
|
|
167
170
|
value: T;
|
|
168
171
|
format: FormDisplayerProps['format'];
|
|
169
172
|
};
|
|
173
|
+
export type TableCellSerializer<T, I extends TableItem<T> = TableItem<T>> = (data: T, column: TableColumn<T, I>, format: TableSerializerFormat) => any;
|
|
170
174
|
export type TableColumnSpec<T, I extends TableItem<T> = TableItem<T>> = {
|
|
171
175
|
className?: string | ((item: I, column: TableColumn<T, I>, rowIndex: number) => string);
|
|
172
176
|
CellComponent?: Cell<T, I>;
|
|
@@ -177,15 +181,16 @@ export type TableColumnSpec<T, I extends TableItem<T> = TableItem<T>> = {
|
|
|
177
181
|
filterable?: boolean;
|
|
178
182
|
FilterComponent?: React.FC<TableHeaderCellProps<T, I>>;
|
|
179
183
|
headerClassName?: string | ((column: TableColumn<T, I>) => string);
|
|
184
|
+
help?: ReactNode;
|
|
180
185
|
id: string;
|
|
181
186
|
maxWidth?: string;
|
|
182
187
|
minWidth?: string;
|
|
188
|
+
serializer?: TableCellSerializer<T, I>;
|
|
183
189
|
sortable?: boolean;
|
|
184
190
|
title?: string;
|
|
185
191
|
TitleComponent?: React.FC<TableHeaderCellProps<T, I>>;
|
|
186
192
|
weight?: number;
|
|
187
193
|
width?: string;
|
|
188
|
-
help?: ReactNode;
|
|
189
194
|
};
|
|
190
195
|
export type TableColumnWidth = {
|
|
191
196
|
auto?: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -158,9 +158,13 @@ export { default as useTableController } from './components/table/hooks/useTable
|
|
|
158
158
|
export { default as useTableService } from './components/table/hooks/useTableService';
|
|
159
159
|
export { default as useTextColumn } from './components/table/hooks/useTextColumn';
|
|
160
160
|
export { default as useTextareaColumn } from './components/table/hooks/useTextareaColumn';
|
|
161
|
+
export { default as AlertComponent } from './components/alert/components/AlertComponent';
|
|
162
|
+
export { default as Alert } from './components/alert';
|
|
163
|
+
export { default as alertStyle } from './components/alert/style';
|
|
164
|
+
export { AlertProps } from './components/alert/typings';
|
|
161
165
|
export { default as FormCardDisplayer } from './components/card/FormCardDisplayer';
|
|
162
166
|
export { filterListStyle, tableStyle } from './components/table/style';
|
|
163
|
-
export { ArrayTableProps, Cell, CheckboxColumn, CheckboxColumnOptions, ControllerTableProps, EnumColumnOptions, FormCellDisplayerProps, FormTableContext, FormTableItemDisplayerProps, FormTableProps, TableValueDisplayerProps, InputColumn, InputColumnOptions, LinkColumnOptions, SelectCell, SelectColumn, SelectColumnOptions, TableBodyCellProps, TableBodyProps, TableBodyRowProps, TableCellDisplayerProps, TableColumn, TableColumnComputedWidth, TableColumnOptions, TableColumnSpec, TableColumnWidth, TableColumnsState, TableConfig, TableController, TableExpandedProps, TableFilterOperator, TableFilterOperatorProps, TableFooterCellProps, TableFooterProps, TableHeaderCellProps, TableHeaderProps, TableItem, TableItemAdaptee, TableItemAdapter, TableItems, TableNotFoundProps, TableProps, TableRowHandler, TableSortProps, TableState, TextareaColumn, TextareaColumnOptions, UseTableController, UseTableOptions, } from './components/table/typings';
|
|
167
|
+
export { ArrayTableProps, Cell, CheckboxColumn, CheckboxColumnOptions, ControllerTableProps, EnumColumnOptions, FormCellDisplayerProps, FormTableContext, FormTableItemDisplayerProps, FormTableProps, TableValueDisplayerProps, InputColumn, InputColumnOptions, LinkColumnOptions, SelectCell, SelectColumn, SelectColumnOptions, TableBodyCellProps, TableBodyProps, TableBodyRowProps, TableCellDisplayerProps, TableColumn, TableColumnComputedWidth, TableColumnOptions, TableColumnSpec, TableColumnWidth, TableColumnsState, TableConfig, TableController, TableExpandedProps, TableFilterOperator, TableFilterOperatorProps, TableFooterCellProps, TableFooterProps, TableHeaderCellProps, TableHeaderProps, TableItem, TableItemAdaptee, TableItemAdapter, TableItems, TableNotFoundProps, TableProps, TableRowHandler, TableSortProps, TableState, TextareaColumn, TextareaColumnOptions, UseTableController, UseTableOptions, TableCellSerializer, TableSerializerFormat } from './components/table/typings';
|
|
164
168
|
export { default as Tag } from './components/tag';
|
|
165
169
|
export { default as TagComponent } from './components/tag/components/TagComponent';
|
|
166
170
|
export { tagStyle } from './components/tag/style';
|
|
@@ -182,6 +186,7 @@ export { default as ArrayTreeComponent } from './components/tree/components/Arra
|
|
|
182
186
|
export { default as ControllerTreeComponent } from './components/tree/components/ControllerTreeComponent';
|
|
183
187
|
export { default as TreeBodyComponent } from './components/tree/components/TreeBodyComponent';
|
|
184
188
|
export { default as TreeComponent } from './components/tree/components/TreeComponent';
|
|
189
|
+
export { default as defaultCellSerializer } from './components/table/seralizers/defaultCellSerializer';
|
|
185
190
|
export { default as TreeItemComponent, TreeItemContent, TreeItemToggler, } from './components/tree/components/TreeItemComponent';
|
|
186
191
|
export { default as TreeListComponent } from './components/tree/components/TreeListComponent';
|
|
187
192
|
export { default as VirtualTreeBodyComponent } from './components/tree/components/VirtualTreeBodyComponent';
|