@qoretechnologies/reqore 0.35.1 → 0.35.3
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__/helpers/table.test.tsx +20 -0
- package/dist/components/Collection/index.d.ts +11 -2
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +33 -7
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +1 -1
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts +1 -0
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Menu/divider.d.ts +1 -0
- package/dist/components/Menu/divider.d.ts.map +1 -1
- package/dist/components/Menu/divider.js +3 -2
- package/dist/components/Menu/divider.js.map +1 -1
- package/dist/components/Spacer/index.d.ts.map +1 -1
- package/dist/components/Spacer/index.js +1 -1
- package/dist/components/Spacer/index.js.map +1 -1
- package/dist/components/Table/body.d.ts +10 -4
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +44 -9
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.d.ts.map +1 -1
- package/dist/components/Table/cell.js +2 -2
- package/dist/components/Table/cell.js.map +1 -1
- package/dist/components/Table/header.d.ts +8 -7
- package/dist/components/Table/header.d.ts.map +1 -1
- package/dist/components/Table/header.js +34 -37
- package/dist/components/Table/header.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts +2 -2
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.js +25 -7
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +2 -0
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +28 -2
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +9 -2
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +175 -15
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +17 -28
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Tree/index.d.ts +3 -1
- package/dist/components/Tree/index.d.ts.map +1 -1
- package/dist/components/Tree/index.js +9 -2
- package/dist/components/Tree/index.js.map +1 -1
- package/dist/constants/paging.d.ts +1 -0
- package/dist/constants/paging.d.ts.map +1 -1
- package/dist/constants/paging.js +20 -1
- package/dist/constants/paging.js.map +1 -1
- package/dist/constants/sizes.d.ts +15 -0
- package/dist/constants/sizes.d.ts.map +1 -1
- package/dist/constants/sizes.js +16 -1
- package/dist/constants/sizes.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Collection/index.tsx +41 -6
- package/src/components/ControlGroup/index.tsx +1 -0
- package/src/components/Dropdown/list.tsx +1 -0
- package/src/components/Menu/divider.tsx +31 -21
- package/src/components/Spacer/index.tsx +2 -2
- package/src/components/Table/body.tsx +87 -36
- package/src/components/Table/cell.tsx +4 -1
- package/src/components/Table/header.tsx +133 -124
- package/src/components/Table/headerCell.tsx +34 -8
- package/src/components/Table/helpers.ts +42 -2
- package/src/components/Table/index.tsx +251 -53
- package/src/components/Table/row.tsx +34 -53
- package/src/components/Tree/index.tsx +13 -2
- package/src/constants/paging.ts +22 -0
- package/src/constants/sizes.ts +17 -0
- package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +0 -3
- package/src/stories/Collection/Collection.stories.tsx +16 -0
- package/src/stories/Table/Table.stories.tsx +96 -1
- package/src/stories/Tree/Tree.stories.tsx +13 -0
- package/tests.json +1 -1
|
@@ -125,6 +125,22 @@ SelectedFirst.args = {
|
|
|
125
125
|
showSelectedFirst: true,
|
|
126
126
|
};
|
|
127
127
|
|
|
128
|
+
export const Zoomable = Template.bind({});
|
|
129
|
+
Zoomable.args = {
|
|
130
|
+
label: 'Collection of items',
|
|
131
|
+
items,
|
|
132
|
+
zoomable: true,
|
|
133
|
+
};
|
|
134
|
+
|
|
135
|
+
export const WithDefaultZoom = Template.bind({});
|
|
136
|
+
WithDefaultZoom.args = {
|
|
137
|
+
label: 'Collection of items',
|
|
138
|
+
items,
|
|
139
|
+
zoomable: true,
|
|
140
|
+
size: 'tiny',
|
|
141
|
+
defaultZoom: 2,
|
|
142
|
+
};
|
|
143
|
+
|
|
128
144
|
export const CustomColumnsData = Template.bind({});
|
|
129
145
|
CustomColumnsData.args = {
|
|
130
146
|
columns: 2,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
2
|
import { StyledEffect } from '../../components/Effect';
|
|
3
|
-
import { IReqoreTableColumn, IReqoreTableProps } from '../../components/Table';
|
|
3
|
+
import { IReqoreTableColumn, IReqoreTableProps, IReqoreTableRowData } from '../../components/Table';
|
|
4
4
|
import { IReqoreCustomTableBodyCellProps } from '../../components/Table/cell';
|
|
5
5
|
import { IReqoreCustomHeaderCellProps } from '../../components/Table/header';
|
|
6
|
+
import { TReqorePaginationType } from '../../constants/paging';
|
|
6
7
|
import {
|
|
7
8
|
ReqoreH3,
|
|
8
9
|
ReqoreH4,
|
|
@@ -20,6 +21,7 @@ const { createArg } = argManager<IReqoreTableProps>();
|
|
|
20
21
|
const defaultColumns: IReqoreTableColumn[] = [
|
|
21
22
|
{
|
|
22
23
|
dataId: 'id',
|
|
24
|
+
intent: 'info',
|
|
23
25
|
header: {
|
|
24
26
|
label: 'ID',
|
|
25
27
|
tooltip: 'Custom ID tooltip nice',
|
|
@@ -37,6 +39,8 @@ const defaultColumns: IReqoreTableColumn[] = [
|
|
|
37
39
|
columns: [
|
|
38
40
|
{
|
|
39
41
|
dataId: 'firstName',
|
|
42
|
+
minWidth: 50,
|
|
43
|
+
maxWidth: 500,
|
|
40
44
|
header: {
|
|
41
45
|
icon: 'SlideshowLine',
|
|
42
46
|
label: 'First Name',
|
|
@@ -158,6 +162,33 @@ const defaultColumns: IReqoreTableColumn[] = [
|
|
|
158
162
|
}),
|
|
159
163
|
},
|
|
160
164
|
},
|
|
165
|
+
{
|
|
166
|
+
dataId: 'actions',
|
|
167
|
+
header: {
|
|
168
|
+
icon: 'SettingsLine',
|
|
169
|
+
},
|
|
170
|
+
width: 100,
|
|
171
|
+
align: 'center',
|
|
172
|
+
pin: 'right',
|
|
173
|
+
|
|
174
|
+
cell: {
|
|
175
|
+
padded: 'none',
|
|
176
|
+
actions: () => [
|
|
177
|
+
{
|
|
178
|
+
icon: 'AddLine',
|
|
179
|
+
intent: 'info',
|
|
180
|
+
},
|
|
181
|
+
{
|
|
182
|
+
icon: 'EditLine',
|
|
183
|
+
intent: 'warning',
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
icon: 'DeleteBinLine',
|
|
187
|
+
intent: 'danger',
|
|
188
|
+
},
|
|
189
|
+
],
|
|
190
|
+
},
|
|
191
|
+
},
|
|
161
192
|
];
|
|
162
193
|
|
|
163
194
|
const defaultColumnsWithFilters = defaultColumns.map((column, index) => {
|
|
@@ -212,6 +243,41 @@ const defaultColumnsWithHiddenColumns = defaultColumns.map((column, index) => {
|
|
|
212
243
|
return column;
|
|
213
244
|
});
|
|
214
245
|
|
|
246
|
+
const defaultColumnsWithPinnedColumns = defaultColumns.map((column, index) => {
|
|
247
|
+
if (index === 0) {
|
|
248
|
+
return {
|
|
249
|
+
...column,
|
|
250
|
+
pin: 'left',
|
|
251
|
+
};
|
|
252
|
+
}
|
|
253
|
+
|
|
254
|
+
if (index === 1) {
|
|
255
|
+
return {
|
|
256
|
+
...column,
|
|
257
|
+
header: {
|
|
258
|
+
...column.header,
|
|
259
|
+
columns: column.header.columns.map((subColumn, subIndex) =>
|
|
260
|
+
subIndex === 1
|
|
261
|
+
? {
|
|
262
|
+
...subColumn,
|
|
263
|
+
pin: 'left',
|
|
264
|
+
}
|
|
265
|
+
: subColumn
|
|
266
|
+
),
|
|
267
|
+
},
|
|
268
|
+
};
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
if (index === 3) {
|
|
272
|
+
return {
|
|
273
|
+
...column,
|
|
274
|
+
pin: 'right',
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
|
|
278
|
+
return column;
|
|
279
|
+
});
|
|
280
|
+
|
|
215
281
|
export default {
|
|
216
282
|
title: 'Collections/Table/Stories',
|
|
217
283
|
argTypes: {
|
|
@@ -330,11 +396,24 @@ HiddenColumns.args = {
|
|
|
330
396
|
columns: defaultColumnsWithHiddenColumns,
|
|
331
397
|
};
|
|
332
398
|
|
|
399
|
+
export const PinnedColumns = Template.bind({});
|
|
400
|
+
PinnedColumns.args = {
|
|
401
|
+
columns: defaultColumnsWithPinnedColumns,
|
|
402
|
+
zoomable: true,
|
|
403
|
+
filterable: true,
|
|
404
|
+
};
|
|
405
|
+
|
|
333
406
|
export const Selectable = Template.bind({});
|
|
334
407
|
Selectable.args = {
|
|
335
408
|
selectable: true,
|
|
336
409
|
};
|
|
337
410
|
|
|
411
|
+
export const PreselectedRows = Template.bind({});
|
|
412
|
+
PreselectedRows.args = {
|
|
413
|
+
selected: [274, 280],
|
|
414
|
+
selectable: true,
|
|
415
|
+
};
|
|
416
|
+
|
|
338
417
|
export const Zoomable = Template.bind({});
|
|
339
418
|
Zoomable.args = {
|
|
340
419
|
zoomable: true,
|
|
@@ -352,6 +431,22 @@ Sizes.args = {
|
|
|
352
431
|
wrapperSize: 'big',
|
|
353
432
|
};
|
|
354
433
|
|
|
434
|
+
export const DefaultPaging = Template.bind({});
|
|
435
|
+
DefaultPaging.args = {
|
|
436
|
+
paging: 'buttons',
|
|
437
|
+
};
|
|
438
|
+
|
|
439
|
+
export const CustomPaging = Template.bind({});
|
|
440
|
+
CustomPaging.args = {
|
|
441
|
+
paging: {
|
|
442
|
+
fluid: true,
|
|
443
|
+
loadMoreLabel: 'Load more rows...',
|
|
444
|
+
showLabels: true,
|
|
445
|
+
infinite: true,
|
|
446
|
+
itemsPerPage: 100,
|
|
447
|
+
} as TReqorePaginationType<IReqoreTableRowData>,
|
|
448
|
+
};
|
|
449
|
+
|
|
355
450
|
const CustomHeaderCell = (props: IReqoreCustomHeaderCellProps) => {
|
|
356
451
|
if (props.hasColumns) {
|
|
357
452
|
return <ReqoreH3 intent='success'>{props.label}</ReqoreH3>;
|
|
@@ -47,3 +47,16 @@ export const NoControls = Template.bind({});
|
|
|
47
47
|
NoControls.args = {
|
|
48
48
|
showControls: false,
|
|
49
49
|
};
|
|
50
|
+
|
|
51
|
+
export const Zoomable = Template.bind({});
|
|
52
|
+
Zoomable.args = {
|
|
53
|
+
zoomable: true,
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const WithDefaultZoom = Template.bind({});
|
|
57
|
+
WithDefaultZoom.args = {
|
|
58
|
+
label: 'Collection of items',
|
|
59
|
+
zoomable: true,
|
|
60
|
+
size: 'tiny',
|
|
61
|
+
defaultZoom: 2,
|
|
62
|
+
};
|