@qoretechnologies/reqore 0.36.0 → 0.36.2
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/__tests__/collection.test.tsx +1 -22
- package/__tests__/table.test.tsx +1 -1
- package/__tests__/tree.test.tsx +0 -18
- package/dist/components/Breadcrumbs/index.js +1 -1
- package/dist/components/Breadcrumbs/index.js.map +1 -1
- package/dist/components/Button/index.d.ts +1 -4
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +11 -26
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Collection/index.d.ts +2 -2
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +10 -10
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Collection/item.d.ts +3 -3
- package/dist/components/Collection/item.d.ts.map +1 -1
- package/dist/components/Collection/item.js.map +1 -1
- package/dist/components/Columns/index.d.ts +1 -1
- package/dist/components/Columns/index.d.ts.map +1 -1
- package/dist/components/Comment/index.d.ts +1 -1
- package/dist/components/Comment/index.d.ts.map +1 -1
- package/dist/components/CommentFeed/index.d.ts +1 -1
- package/dist/components/CommentFeed/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.d.ts +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.d.ts +1 -1
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/item.d.ts +2 -2
- package/dist/components/Dropdown/item.d.ts.map +1 -1
- package/dist/components/Dropdown/list.d.ts +1 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Effect/index.d.ts +2 -2
- package/dist/components/Effect/index.d.ts.map +1 -1
- package/dist/components/ExportModal/index.d.ts +11 -0
- package/dist/components/ExportModal/index.d.ts.map +1 -0
- package/dist/components/ExportModal/index.js +91 -0
- package/dist/components/ExportModal/index.js.map +1 -0
- package/dist/components/Header/index.d.ts +7 -7
- package/dist/components/Header/index.d.ts.map +1 -1
- package/dist/components/InputClearButton/index.d.ts +1 -0
- package/dist/components/InputClearButton/index.d.ts.map +1 -1
- package/dist/components/InternalPopover/index.js +2 -2
- package/dist/components/InternalPopover/index.js.map +1 -1
- package/dist/components/KeyValueTable/index.d.ts +7 -4
- package/dist/components/KeyValueTable/index.d.ts.map +1 -1
- package/dist/components/KeyValueTable/index.js +32 -2
- package/dist/components/KeyValueTable/index.js.map +1 -1
- package/dist/components/Layout/content.d.ts +1 -1
- package/dist/components/Layout/content.d.ts.map +1 -1
- package/dist/components/Layout/index.d.ts +1 -1
- package/dist/components/Layout/index.d.ts.map +1 -1
- package/dist/components/Menu/item.d.ts +1 -1
- package/dist/components/Menu/item.d.ts.map +1 -1
- package/dist/components/Menu/item.js +3 -3
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/Message/index.d.ts +1 -0
- package/dist/components/Message/index.d.ts.map +1 -1
- package/dist/components/Message/index.js.map +1 -1
- package/dist/components/Modal/index.d.ts +1 -1
- package/dist/components/Modal/index.d.ts.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +2 -2
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Notifications/notification.d.ts +1 -0
- package/dist/components/Notifications/notification.d.ts.map +1 -1
- package/dist/components/Notifications/notification.js +23 -16
- package/dist/components/Notifications/notification.js.map +1 -1
- package/dist/components/Paging/index.d.ts +1 -1
- package/dist/components/Paging/index.d.ts.map +1 -1
- package/dist/components/Panel/NonResponsiveActions.d.ts +1 -1
- package/dist/components/Panel/NonResponsiveActions.d.ts.map +1 -1
- package/dist/components/Panel/index.js +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Panel/panel.screenshot.d.ts +1 -1
- package/dist/components/Panel/panel.screenshot.d.ts.map +1 -1
- package/dist/components/Paragraph/index.d.ts +1 -1
- package/dist/components/Paragraph/index.d.ts.map +1 -1
- package/dist/components/Popover/index.d.ts +1 -1
- package/dist/components/Popover/index.d.ts.map +1 -1
- package/dist/components/Popover/index.js +2 -0
- package/dist/components/Popover/index.js.map +1 -1
- package/dist/components/RadioGroup/index.d.ts +1 -1
- package/dist/components/RadioGroup/index.d.ts.map +1 -1
- package/dist/components/Sidebar/item.d.ts +1 -1
- package/dist/components/Sidebar/item.d.ts.map +1 -1
- package/dist/components/Spacer/index.d.ts +3 -3
- package/dist/components/Spacer/index.d.ts.map +1 -1
- package/dist/components/Spinner/index.d.ts +1 -1
- package/dist/components/Spinner/index.d.ts.map +1 -1
- package/dist/components/Table/body.d.ts +1 -1
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +26 -21
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.d.ts +3 -2
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +8 -4
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts +1 -1
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/helpers.d.ts +8 -6
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +49 -16
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +5 -4
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +47 -38
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +7 -5
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +38 -36
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Table/value.d.ts +1 -1
- package/dist/components/Table/value.d.ts.map +1 -1
- package/dist/components/Tabs/content.d.ts +1 -1
- package/dist/components/Tabs/content.d.ts.map +1 -1
- package/dist/components/Tabs/index.d.ts +1 -1
- package/dist/components/Tabs/index.d.ts.map +1 -1
- package/dist/components/Tabs/list.d.ts +1 -1
- package/dist/components/Tabs/list.d.ts.map +1 -1
- package/dist/components/Tabs/list.js +1 -1
- package/dist/components/Tabs/list.js.map +1 -1
- package/dist/components/Tag/group.d.ts +1 -1
- package/dist/components/Tag/group.d.ts.map +1 -1
- package/dist/components/Tree/index.d.ts +2 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +35 -31
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/constants/sizes.js +5 -5
- package/dist/containers/Paging.d.ts +1 -1
- package/dist/containers/Paging.d.ts.map +1 -1
- package/dist/containers/ThemeProvider.d.ts +1 -1
- package/dist/containers/ThemeProvider.d.ts.map +1 -1
- package/dist/helpers/utils.d.ts +2 -1
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/helpers/utils.js +20 -2
- package/dist/helpers/utils.js.map +1 -1
- package/dist/hooks/useAutoFocus.d.ts +1 -1
- package/dist/hooks/useAutoFocus.d.ts.map +1 -1
- package/dist/hooks/usePopover.d.ts +1 -0
- package/dist/hooks/usePopover.d.ts.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/styles.d.ts +3 -0
- package/dist/styles.d.ts.map +1 -1
- package/dist/styles.js +49 -11
- package/dist/styles.js.map +1 -1
- package/migration-storybook.log +88 -0
- package/package.json +26 -20
- package/src/components/Breadcrumbs/index.tsx +1 -1
- package/src/components/Button/index.tsx +3 -54
- package/src/components/Collection/index.tsx +18 -15
- package/src/components/Collection/item.tsx +2 -1
- package/src/components/ExportModal/index.tsx +98 -0
- package/src/components/InternalPopover/index.tsx +2 -2
- package/src/components/KeyValueTable/index.tsx +59 -11
- package/src/components/Menu/item.tsx +4 -4
- package/src/components/Message/index.tsx +1 -0
- package/src/components/Notifications/notification.tsx +14 -3
- package/src/components/Panel/index.tsx +2 -2
- package/src/components/Popover/index.tsx +3 -0
- package/src/components/Table/body.tsx +26 -20
- package/src/components/Table/cell.tsx +15 -4
- package/src/components/Table/helpers.ts +52 -21
- package/src/components/Table/index.tsx +119 -75
- package/src/components/Table/row.tsx +47 -46
- package/src/components/Tabs/list.tsx +1 -1
- package/src/components/Tree/index.tsx +82 -75
- package/src/constants/sizes.ts +5 -5
- package/src/helpers/utils.ts +10 -2
- package/src/hooks/useAutoFocus.ts +1 -1
- package/src/index.tsx +1 -1
- package/src/mock/tableData.ts +12 -0
- package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +11 -23
- package/src/stories/Button/Button.stories.tsx +83 -47
- package/src/stories/Checkbox/Checkbox.stories.tsx +19 -9
- package/src/stories/Collection/Collection.stories.tsx +195 -171
- package/src/stories/Columns/Columns.stories.tsx +38 -24
- package/src/stories/Comment/Comment.stories.tsx +15 -6
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +102 -48
- package/src/stories/Drawer/Drawer.stories.tsx +52 -17
- package/src/stories/Dropdown/Dropdown.stories.tsx +184 -152
- package/src/stories/ExportModal/ExportModal.stories.tsx +18 -0
- package/src/stories/Header/Header.stories.tsx +65 -31
- package/src/stories/Icon/Icon.stories.tsx +139 -133
- package/src/stories/Input/Input.stories.tsx +68 -31
- package/src/stories/KeyValueTable/KeyValueTable.stories.tsx +183 -117
- package/src/stories/Menu/Menu.stories.tsx +56 -20
- package/src/stories/Message/Message.stories.tsx +96 -37
- package/src/stories/Modal/Modal.stories.tsx +28 -8
- package/src/stories/MultiSelect/MultiSelect.stories.tsx +66 -35
- package/src/stories/Navbar/Navbar.stories.tsx +15 -5
- package/src/stories/Notifications/Interactive.stories.tsx +40 -28
- package/src/stories/Notifications/Notification.stories.tsx +55 -41
- package/src/stories/Notifications/Notifications.stories.tsx +45 -29
- package/src/stories/Paging/Paging.stories.tsx +206 -177
- package/src/stories/Panel/Panel.stories.tsx +238 -168
- package/src/stories/Paragraph/Paragraph.stories.tsx +66 -31
- package/src/stories/Popover/Popover.stories.tsx +62 -40
- package/src/stories/RadioGroup/RadioGroup.stories.tsx +41 -19
- package/src/stories/Sidebar/Sidebar.stories.tsx +29 -10
- package/src/stories/Spacer/Spacer.stories.tsx +13 -5
- package/src/stories/Spinner/Spinner.stories.tsx +26 -12
- package/src/stories/Table/Table.stories.tsx +200 -144
- package/src/stories/Table/Tests.stories.tsx +9 -0
- package/src/stories/Tabs/Tabs.stories.tsx +82 -46
- package/src/stories/Tag/Tag.stories.tsx +56 -37
- package/src/stories/Tag/TagGroup.stories.tsx +297 -0
- package/src/stories/TextArea/TextArea.stories.tsx +82 -40
- package/src/stories/Tree/Tree.stories.tsx +84 -22
- package/src/stories/utils.ts +22 -1
- package/src/styles.ts +55 -2
- package/tests.json +1 -1
|
@@ -1,9 +1,12 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryObj } from '@storybook/react';
|
|
2
|
+
import { fireEvent, waitFor, within } from '@storybook/testing-library';
|
|
2
3
|
import { StyledEffect } from '../../components/Effect';
|
|
3
4
|
import { IReqoreTableColumn, IReqoreTableProps, IReqoreTableRowData } from '../../components/Table';
|
|
4
5
|
import { IReqoreCustomTableBodyCellProps } from '../../components/Table/cell';
|
|
5
6
|
import { IReqoreCustomHeaderCellProps } from '../../components/Table/header';
|
|
7
|
+
import { IReqoreCustomTableRowProps } from '../../components/Table/row';
|
|
6
8
|
import { TReqorePaginationType } from '../../constants/paging';
|
|
9
|
+
import { sleep } from '../../helpers/utils';
|
|
7
10
|
import {
|
|
8
11
|
ReqoreH3,
|
|
9
12
|
ReqoreH4,
|
|
@@ -14,6 +17,7 @@ import {
|
|
|
14
17
|
ReqoreTag,
|
|
15
18
|
} from '../../index';
|
|
16
19
|
import tableData from '../../mock/tableData';
|
|
20
|
+
import { StoryMeta } from '../utils';
|
|
17
21
|
import { CustomIntentArg, FlatArg, IntentArg, SizeArg, argManager } from '../utils/args';
|
|
18
22
|
|
|
19
23
|
const { createArg } = argManager<IReqoreTableProps>();
|
|
@@ -191,7 +195,7 @@ const defaultColumns: IReqoreTableColumn[] = [
|
|
|
191
195
|
},
|
|
192
196
|
];
|
|
193
197
|
|
|
194
|
-
const defaultColumnsWithFilters = defaultColumns.map((column, index) => {
|
|
198
|
+
const defaultColumnsWithFilters: IReqoreTableColumn[] = defaultColumns.map((column, index) => {
|
|
195
199
|
if (index === 4) {
|
|
196
200
|
return {
|
|
197
201
|
...column,
|
|
@@ -215,71 +219,85 @@ const defaultColumnsWithFilters = defaultColumns.map((column, index) => {
|
|
|
215
219
|
return column;
|
|
216
220
|
});
|
|
217
221
|
|
|
218
|
-
const defaultColumnsWithHiddenColumns = defaultColumns.map(
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
subIndex
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
if (index === 2) {
|
|
237
|
-
return {
|
|
238
|
-
...column,
|
|
239
|
-
show: false,
|
|
240
|
-
};
|
|
241
|
-
}
|
|
222
|
+
const defaultColumnsWithHiddenColumns: IReqoreTableColumn[] = defaultColumns.map(
|
|
223
|
+
(column, index) => {
|
|
224
|
+
if (index === 4) {
|
|
225
|
+
return {
|
|
226
|
+
...column,
|
|
227
|
+
header: {
|
|
228
|
+
...column.header,
|
|
229
|
+
columns: column.header.columns.map((subColumn, subIndex) =>
|
|
230
|
+
subIndex === 0
|
|
231
|
+
? {
|
|
232
|
+
...subColumn,
|
|
233
|
+
show: false,
|
|
234
|
+
}
|
|
235
|
+
: subColumn
|
|
236
|
+
),
|
|
237
|
+
},
|
|
238
|
+
};
|
|
239
|
+
}
|
|
242
240
|
|
|
243
|
-
|
|
244
|
-
|
|
241
|
+
if (index === 2) {
|
|
242
|
+
return {
|
|
243
|
+
...column,
|
|
244
|
+
show: false,
|
|
245
|
+
};
|
|
246
|
+
}
|
|
245
247
|
|
|
246
|
-
|
|
247
|
-
if (index === 0) {
|
|
248
|
-
return {
|
|
249
|
-
...column,
|
|
250
|
-
pin: 'left',
|
|
251
|
-
};
|
|
248
|
+
return column;
|
|
252
249
|
}
|
|
250
|
+
);
|
|
251
|
+
|
|
252
|
+
const defaultColumnsWithPinnedColumns: IReqoreTableColumn[] = defaultColumns.map(
|
|
253
|
+
(column, index) => {
|
|
254
|
+
if (index === 0) {
|
|
255
|
+
return {
|
|
256
|
+
...column,
|
|
257
|
+
pin: 'left',
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
if (index === 1) {
|
|
262
|
+
return {
|
|
263
|
+
...column,
|
|
264
|
+
header: {
|
|
265
|
+
...column.header,
|
|
266
|
+
columns: column.header.columns.map((subColumn, subIndex) =>
|
|
267
|
+
subIndex === 1
|
|
268
|
+
? {
|
|
269
|
+
...subColumn,
|
|
270
|
+
pin: 'left',
|
|
271
|
+
}
|
|
272
|
+
: subColumn
|
|
273
|
+
),
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
}
|
|
253
277
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
subIndex === 1
|
|
261
|
-
? {
|
|
262
|
-
...subColumn,
|
|
263
|
-
pin: 'left',
|
|
264
|
-
}
|
|
265
|
-
: subColumn
|
|
266
|
-
),
|
|
267
|
-
},
|
|
268
|
-
};
|
|
269
|
-
}
|
|
278
|
+
if (index === 3) {
|
|
279
|
+
return {
|
|
280
|
+
...column,
|
|
281
|
+
pin: 'right',
|
|
282
|
+
};
|
|
283
|
+
}
|
|
270
284
|
|
|
271
|
-
|
|
272
|
-
return {
|
|
273
|
-
...column,
|
|
274
|
-
pin: 'right',
|
|
275
|
-
};
|
|
285
|
+
return column;
|
|
276
286
|
}
|
|
287
|
+
);
|
|
277
288
|
|
|
278
|
-
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
export default {
|
|
289
|
+
const meta = {
|
|
282
290
|
title: 'Collections/Table/Stories',
|
|
291
|
+
component: ReqoreTable,
|
|
292
|
+
args: {
|
|
293
|
+
columns: defaultColumns,
|
|
294
|
+
data: tableData.data,
|
|
295
|
+
height: 600,
|
|
296
|
+
selectToggleTooltip: 'Select this row',
|
|
297
|
+
fill: false,
|
|
298
|
+
sort: { by: 'lastName', direction: 'desc' },
|
|
299
|
+
label: 'Table',
|
|
300
|
+
},
|
|
283
301
|
argTypes: {
|
|
284
302
|
...createArg('rounded', {
|
|
285
303
|
type: 'boolean',
|
|
@@ -298,23 +316,19 @@ export default {
|
|
|
298
316
|
}),
|
|
299
317
|
...createArg('columns', {
|
|
300
318
|
name: 'Columns',
|
|
301
|
-
defaultValue: defaultColumns,
|
|
302
319
|
}),
|
|
303
320
|
...createArg('width', {
|
|
304
321
|
type: 'number',
|
|
305
|
-
defaultValue: undefined,
|
|
306
322
|
name: 'Width',
|
|
307
323
|
description: 'The width of the table',
|
|
308
324
|
}),
|
|
309
325
|
...createArg('height', {
|
|
310
326
|
type: 'number',
|
|
311
|
-
defaultValue: 600,
|
|
312
327
|
name: 'Height',
|
|
313
328
|
description: 'The height of the table',
|
|
314
329
|
}),
|
|
315
330
|
...createArg('data', {
|
|
316
331
|
type: 'array',
|
|
317
|
-
defaultValue: tableData.data as any,
|
|
318
332
|
name: 'Data',
|
|
319
333
|
description: 'The data to be displayed in the table',
|
|
320
334
|
table: {
|
|
@@ -323,13 +337,11 @@ export default {
|
|
|
323
337
|
}),
|
|
324
338
|
...createArg('selectToggleTooltip', {
|
|
325
339
|
type: 'string',
|
|
326
|
-
defaultValue: 'Select This Row',
|
|
327
340
|
name: 'Select Toggle Tooltip',
|
|
328
341
|
description: 'The tooltip of the select toggle',
|
|
329
342
|
}),
|
|
330
343
|
...createArg('fill', {
|
|
331
344
|
type: 'boolean',
|
|
332
|
-
defaultValue: false,
|
|
333
345
|
name: 'Fill',
|
|
334
346
|
description: 'Whether the table should fill the parent',
|
|
335
347
|
}),
|
|
@@ -338,113 +350,156 @@ export default {
|
|
|
338
350
|
...IntentArg,
|
|
339
351
|
...CustomIntentArg('selectedRowIntent'),
|
|
340
352
|
},
|
|
341
|
-
} as
|
|
353
|
+
} as StoryMeta<typeof ReqoreTable>;
|
|
354
|
+
|
|
355
|
+
export default meta;
|
|
356
|
+
type Story = StoryObj<typeof meta>;
|
|
357
|
+
|
|
358
|
+
export const Basic: Story = {};
|
|
342
359
|
|
|
343
|
-
const
|
|
344
|
-
|
|
360
|
+
export const NoLabel: Story = {
|
|
361
|
+
args: {
|
|
362
|
+
label: undefined,
|
|
363
|
+
},
|
|
345
364
|
};
|
|
346
365
|
|
|
347
|
-
export const
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
366
|
+
export const CustomWidth: Story = {
|
|
367
|
+
args: {
|
|
368
|
+
width: 400,
|
|
369
|
+
},
|
|
351
370
|
};
|
|
352
371
|
|
|
353
|
-
export const
|
|
354
|
-
|
|
355
|
-
|
|
372
|
+
export const NotFlat: Story = {
|
|
373
|
+
args: {
|
|
374
|
+
flat: false,
|
|
375
|
+
},
|
|
356
376
|
};
|
|
357
377
|
|
|
358
|
-
export const
|
|
359
|
-
|
|
360
|
-
|
|
378
|
+
export const Striped: Story = {
|
|
379
|
+
args: {
|
|
380
|
+
striped: true,
|
|
381
|
+
},
|
|
361
382
|
};
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
383
|
+
|
|
384
|
+
export const Filterable: Story = {
|
|
385
|
+
args: {
|
|
386
|
+
filterable: true,
|
|
387
|
+
},
|
|
365
388
|
};
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
389
|
+
|
|
390
|
+
export const DefaultFilter: Story = {
|
|
391
|
+
args: {
|
|
392
|
+
filterable: true,
|
|
393
|
+
filter: 'Village',
|
|
394
|
+
},
|
|
369
395
|
};
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
396
|
+
|
|
397
|
+
export const NoDataMessage: Story = {
|
|
398
|
+
args: {
|
|
399
|
+
filterable: true,
|
|
400
|
+
filter: 'asjkghakshgjkashg',
|
|
401
|
+
},
|
|
374
402
|
};
|
|
375
403
|
|
|
376
|
-
export const
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
404
|
+
export const FilterableColumns: Story = {
|
|
405
|
+
args: {
|
|
406
|
+
columns: defaultColumnsWithFilters,
|
|
407
|
+
},
|
|
380
408
|
};
|
|
381
409
|
|
|
382
|
-
export const
|
|
383
|
-
|
|
384
|
-
|
|
410
|
+
export const AllFiltersActive: Story = {
|
|
411
|
+
args: {
|
|
412
|
+
filterable: true,
|
|
413
|
+
filter: 'Road',
|
|
414
|
+
columns: defaultColumnsWithFilters,
|
|
415
|
+
},
|
|
385
416
|
};
|
|
386
417
|
|
|
387
|
-
export const
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
columns: defaultColumnsWithFilters,
|
|
418
|
+
export const HiddenColumns: Story = {
|
|
419
|
+
args: {
|
|
420
|
+
columns: defaultColumnsWithHiddenColumns,
|
|
421
|
+
},
|
|
392
422
|
};
|
|
393
423
|
|
|
394
|
-
export const
|
|
395
|
-
|
|
396
|
-
|
|
424
|
+
export const PinnedColumns: Story = {
|
|
425
|
+
args: {
|
|
426
|
+
columns: defaultColumnsWithPinnedColumns,
|
|
427
|
+
zoomable: true,
|
|
428
|
+
filterable: true,
|
|
429
|
+
},
|
|
397
430
|
};
|
|
398
431
|
|
|
399
|
-
export const
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
filterable: true,
|
|
432
|
+
export const Selectable: Story = {
|
|
433
|
+
args: {
|
|
434
|
+
selectable: true,
|
|
435
|
+
},
|
|
404
436
|
};
|
|
405
437
|
|
|
406
|
-
export const
|
|
407
|
-
|
|
408
|
-
|
|
438
|
+
export const PreselectedRows: Story = {
|
|
439
|
+
args: {
|
|
440
|
+
selected: ['274', '280'],
|
|
441
|
+
selectable: true,
|
|
442
|
+
},
|
|
409
443
|
};
|
|
410
444
|
|
|
411
|
-
export const
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
445
|
+
export const Zoomable: Story = {
|
|
446
|
+
args: {
|
|
447
|
+
zoomable: true,
|
|
448
|
+
},
|
|
449
|
+
play: async ({ canvasElement }) => {
|
|
450
|
+
const canvas = within(canvasElement);
|
|
451
|
+
|
|
452
|
+
await sleep(1000);
|
|
453
|
+
await fireEvent.click(document.querySelector('.reqore-table-more'));
|
|
454
|
+
await waitFor(() => canvas.findAllByText('Zoom in'), { timeout: 5000 });
|
|
455
|
+
},
|
|
415
456
|
};
|
|
416
457
|
|
|
417
|
-
export const
|
|
418
|
-
|
|
419
|
-
|
|
458
|
+
export const Exportable: Story = {
|
|
459
|
+
args: {
|
|
460
|
+
exportable: true,
|
|
461
|
+
filterable: true,
|
|
462
|
+
paging: 'buttons',
|
|
463
|
+
},
|
|
464
|
+
play: async ({ canvasElement }) => {
|
|
465
|
+
const canvas = within(canvasElement);
|
|
466
|
+
|
|
467
|
+
await sleep(1000);
|
|
468
|
+
await fireEvent.click(document.querySelector('.reqore-table-more'));
|
|
469
|
+
await waitFor(() => canvas.findAllByText('Export current view'), { timeout: 5000 });
|
|
470
|
+
},
|
|
420
471
|
};
|
|
421
472
|
|
|
422
|
-
export const FillParent =
|
|
423
|
-
|
|
424
|
-
|
|
473
|
+
export const FillParent: Story = {
|
|
474
|
+
args: {
|
|
475
|
+
fill: true,
|
|
476
|
+
},
|
|
425
477
|
};
|
|
426
478
|
|
|
427
|
-
export const Sizes =
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
479
|
+
export const Sizes: Story = {
|
|
480
|
+
args: {
|
|
481
|
+
size: 'small',
|
|
482
|
+
filterable: true,
|
|
483
|
+
wrapperSize: 'big',
|
|
484
|
+
},
|
|
432
485
|
};
|
|
433
486
|
|
|
434
|
-
export const DefaultPaging =
|
|
435
|
-
|
|
436
|
-
|
|
487
|
+
export const DefaultPaging: Story = {
|
|
488
|
+
args: {
|
|
489
|
+
paging: 'buttons',
|
|
490
|
+
},
|
|
437
491
|
};
|
|
438
492
|
|
|
439
|
-
export const CustomPaging =
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
493
|
+
export const CustomPaging: Story = {
|
|
494
|
+
args: {
|
|
495
|
+
paging: {
|
|
496
|
+
fluid: true,
|
|
497
|
+
loadMoreLabel: 'Load more rows...',
|
|
498
|
+
showLabels: true,
|
|
499
|
+
infinite: true,
|
|
500
|
+
itemsPerPage: 100,
|
|
501
|
+
} as TReqorePaginationType<IReqoreTableRowData>,
|
|
502
|
+
},
|
|
448
503
|
};
|
|
449
504
|
|
|
450
505
|
const CustomHeaderCell = (props: IReqoreCustomHeaderCellProps) => {
|
|
@@ -464,13 +519,14 @@ const CustomCell = (props: IReqoreCustomTableBodyCellProps) => {
|
|
|
464
519
|
return <ReqoreP style={{ width: props.width, flexGrow: props.grow }}>{props.children}</ReqoreP>;
|
|
465
520
|
};
|
|
466
521
|
|
|
467
|
-
const CustomRow = (props:
|
|
522
|
+
const CustomRow = (props: IReqoreCustomTableRowProps) => {
|
|
468
523
|
return <StyledEffect style={props.style}>{props.children}</StyledEffect>;
|
|
469
524
|
};
|
|
470
525
|
|
|
471
|
-
export const CustomCellsAndRows =
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
526
|
+
export const CustomCellsAndRows: Story = {
|
|
527
|
+
args: {
|
|
528
|
+
headerCellComponent: CustomHeaderCell,
|
|
529
|
+
bodyCellComponent: CustomCell,
|
|
530
|
+
rowComponent: CustomRow,
|
|
531
|
+
},
|
|
476
532
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { StoryFn, StoryObj } from '@storybook/react';
|
|
2
2
|
import { IReqoreTabsProps } from '../../components/Tabs';
|
|
3
|
-
import { TReqoreTabsContentPadding } from '../../components/Tabs/content';
|
|
4
3
|
import { ReqoreH3, ReqoreTabs, ReqoreTabsContent } from '../../index';
|
|
4
|
+
import { StoryMeta } from '../utils';
|
|
5
5
|
import { IntentArg, SizeArg, argManager } from '../utils/args';
|
|
6
6
|
|
|
7
7
|
const tabs = [
|
|
@@ -100,47 +100,53 @@ const tabs = [
|
|
|
100
100
|
},
|
|
101
101
|
] as IReqoreTabsProps['tabs'];
|
|
102
102
|
|
|
103
|
-
const { createArg } = argManager<IReqoreTabsProps
|
|
103
|
+
const { createArg } = argManager<IReqoreTabsProps>();
|
|
104
104
|
|
|
105
|
-
|
|
105
|
+
const meta = {
|
|
106
106
|
title: 'Navigation/Tabs/Stories',
|
|
107
|
+
component: ReqoreTabs,
|
|
108
|
+
args: {
|
|
109
|
+
flat: true,
|
|
110
|
+
fill: false,
|
|
111
|
+
fillParent: false,
|
|
112
|
+
wrapTabNames: false,
|
|
113
|
+
vertical: false,
|
|
114
|
+
},
|
|
107
115
|
argTypes: {
|
|
108
116
|
...SizeArg,
|
|
109
117
|
...IntentArg,
|
|
110
118
|
...createArg('flat', {
|
|
111
119
|
type: 'boolean',
|
|
112
|
-
defaultValue: true,
|
|
113
120
|
name: 'Flat',
|
|
114
121
|
description: 'Whether the tabs should be flat or not',
|
|
115
122
|
}),
|
|
116
123
|
...createArg('fill', {
|
|
117
124
|
type: 'boolean',
|
|
118
|
-
defaultValue: false,
|
|
119
125
|
name: 'Fill',
|
|
120
126
|
description: 'If the tabs should fill the container',
|
|
121
127
|
}),
|
|
122
128
|
...createArg('fillParent', {
|
|
123
129
|
type: 'boolean',
|
|
124
|
-
defaultValue: false,
|
|
125
130
|
name: 'Fill Parent',
|
|
126
131
|
description: 'If the tabs should fill the parent container',
|
|
127
132
|
}),
|
|
128
133
|
...createArg('wrapTabNames', {
|
|
129
134
|
type: 'boolean',
|
|
130
|
-
defaultValue: false,
|
|
131
135
|
name: 'Wrap Tab Names',
|
|
132
136
|
description: 'If the tab names should wrap',
|
|
133
137
|
}),
|
|
134
138
|
...createArg('vertical', {
|
|
135
139
|
type: 'boolean',
|
|
136
|
-
defaultValue: false,
|
|
137
140
|
name: 'Vertical',
|
|
138
141
|
description: 'If the tabs should be vertical',
|
|
139
142
|
}),
|
|
140
143
|
},
|
|
141
|
-
} as
|
|
144
|
+
} as StoryMeta<typeof ReqoreTabs>;
|
|
145
|
+
|
|
146
|
+
export default meta;
|
|
147
|
+
type Story = StoryObj<typeof meta>;
|
|
142
148
|
|
|
143
|
-
const Template:
|
|
149
|
+
const Template: StoryFn<IReqoreTabsProps> = (args) => {
|
|
144
150
|
return (
|
|
145
151
|
<ReqoreTabs {...args} tabs={tabs}>
|
|
146
152
|
<ReqoreTabsContent tabId='tab1'>
|
|
@@ -229,55 +235,85 @@ const Template: Story<IReqoreTabsProps & { tabPadding: TReqoreTabsContentPadding
|
|
|
229
235
|
);
|
|
230
236
|
};
|
|
231
237
|
|
|
232
|
-
export const Basic =
|
|
233
|
-
|
|
234
|
-
Fill.args = {
|
|
235
|
-
fill: true,
|
|
238
|
+
export const Basic: Story = {
|
|
239
|
+
render: Template,
|
|
236
240
|
};
|
|
237
241
|
|
|
238
|
-
export const
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
+
export const Fill: Story = {
|
|
243
|
+
render: Template,
|
|
244
|
+
|
|
245
|
+
args: {
|
|
246
|
+
fill: true,
|
|
247
|
+
},
|
|
242
248
|
};
|
|
243
249
|
|
|
244
|
-
export const
|
|
245
|
-
|
|
246
|
-
|
|
250
|
+
export const CustomActiveIntent: Story = {
|
|
251
|
+
render: Template,
|
|
252
|
+
|
|
253
|
+
args: {
|
|
254
|
+
activeTabIntent: 'warning',
|
|
255
|
+
activeTab: 'tab8',
|
|
256
|
+
},
|
|
247
257
|
};
|
|
248
258
|
|
|
249
|
-
export const
|
|
250
|
-
|
|
251
|
-
|
|
259
|
+
export const NotFlat: Story = {
|
|
260
|
+
render: Template,
|
|
261
|
+
|
|
262
|
+
args: {
|
|
263
|
+
flat: false,
|
|
264
|
+
},
|
|
252
265
|
};
|
|
253
266
|
|
|
254
|
-
export const
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
267
|
+
export const NoTabsPadding: Story = {
|
|
268
|
+
render: Template,
|
|
269
|
+
|
|
270
|
+
args: {
|
|
271
|
+
padded: false,
|
|
272
|
+
},
|
|
258
273
|
};
|
|
259
274
|
|
|
260
|
-
export const
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
275
|
+
export const Vertical: Story = {
|
|
276
|
+
render: Template,
|
|
277
|
+
|
|
278
|
+
args: {
|
|
279
|
+
vertical: true,
|
|
280
|
+
fillParent: true,
|
|
281
|
+
},
|
|
264
282
|
};
|
|
265
283
|
|
|
266
|
-
export const
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
284
|
+
export const VerticalNoTabsPadding: Story = {
|
|
285
|
+
render: Template,
|
|
286
|
+
|
|
287
|
+
args: {
|
|
288
|
+
padded: false,
|
|
289
|
+
vertical: true,
|
|
290
|
+
},
|
|
271
291
|
};
|
|
272
292
|
|
|
273
|
-
export const
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
293
|
+
export const VerticalWithWrapping: Story = {
|
|
294
|
+
render: Template,
|
|
295
|
+
|
|
296
|
+
args: {
|
|
297
|
+
vertical: true,
|
|
298
|
+
fillParent: true,
|
|
299
|
+
wrapTabNames: true,
|
|
300
|
+
},
|
|
278
301
|
};
|
|
279
302
|
|
|
280
|
-
export const
|
|
281
|
-
|
|
282
|
-
|
|
303
|
+
export const VerticalCustomWidth: Story = {
|
|
304
|
+
render: Template,
|
|
305
|
+
|
|
306
|
+
args: {
|
|
307
|
+
vertical: true,
|
|
308
|
+
fillParent: true,
|
|
309
|
+
width: '300px',
|
|
310
|
+
},
|
|
311
|
+
};
|
|
312
|
+
|
|
313
|
+
export const CustomTabsPadding: Story = {
|
|
314
|
+
render: Template,
|
|
315
|
+
|
|
316
|
+
args: {
|
|
317
|
+
tabsPadding: 'none',
|
|
318
|
+
},
|
|
283
319
|
};
|