@qoretechnologies/reqore 0.34.13 → 0.35.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/__tests__/helpers/table.test.tsx +47 -0
- package/__tests__/table.test.tsx +158 -123
- package/dist/components/Button/index.d.ts +2 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +7 -4
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Collection/index.d.ts +2 -1
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +5 -11
- 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 +4 -3
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts +4 -1
- package/dist/components/Dropdown/index.d.ts.map +1 -1
- package/dist/components/Dropdown/index.js +2 -2
- package/dist/components/Dropdown/index.js.map +1 -1
- package/dist/components/Dropdown/list.d.ts +4 -1
- package/dist/components/Dropdown/list.d.ts.map +1 -1
- package/dist/components/Dropdown/list.js +10 -5
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Input/index.js +4 -4
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Panel/index.d.ts +4 -1
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Table/cell.d.ts +12 -0
- package/dist/components/Table/cell.d.ts.map +1 -0
- package/dist/components/Table/cell.js +89 -0
- package/dist/components/Table/cell.js.map +1 -0
- package/dist/components/Table/header.d.ts +15 -2
- package/dist/components/Table/header.d.ts.map +1 -1
- package/dist/components/Table/header.js +31 -14
- package/dist/components/Table/header.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts +8 -6
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.js +60 -51
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/helpers.d.ts +39 -1
- package/dist/components/Table/helpers.d.ts.map +1 -1
- package/dist/components/Table/helpers.js +145 -1
- package/dist/components/Table/helpers.js.map +1 -1
- package/dist/components/Table/index.d.ts +39 -25
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js +139 -52
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +9 -4
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +30 -54
- package/dist/components/Table/row.js.map +1 -1
- package/dist/hooks/useQueryWithDelay.d.ts +8 -0
- package/dist/hooks/useQueryWithDelay.d.ts.map +1 -0
- package/dist/hooks/useQueryWithDelay.js +25 -0
- package/dist/hooks/useQueryWithDelay.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Button/index.tsx +6 -1
- package/src/components/Collection/index.tsx +9 -15
- package/src/components/ControlGroup/index.tsx +10 -5
- package/src/components/Dropdown/index.tsx +9 -0
- package/src/components/Dropdown/list.tsx +18 -6
- package/src/components/Input/index.tsx +3 -3
- package/src/components/Panel/index.tsx +3 -1
- package/src/components/Table/cell.tsx +117 -0
- package/src/components/Table/header.tsx +102 -45
- package/src/components/Table/headerCell.tsx +123 -80
- package/src/components/Table/helpers.ts +206 -1
- package/src/components/Table/index.tsx +288 -90
- package/src/components/Table/row.tsx +47 -125
- package/src/hooks/useQueryWithDelay.ts +30 -0
- package/src/index.tsx +3 -0
- package/src/mock/tableData.ts +40 -20
- package/src/stories/Breadcrumbs/Breadcrumbs.stories.tsx +1 -1
- package/src/stories/Button/Button.stories.tsx +1 -1
- package/src/stories/Checkbox/Checkbox.stories.tsx +1 -1
- package/src/stories/Collection/Collection.stories.tsx +19 -1
- package/src/stories/Columns/Columns.stories.tsx +1 -1
- package/src/stories/Comment/Comment.stories.tsx +1 -1
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +1 -1
- package/src/stories/Drawer/Drawer.stories.tsx +5 -5
- package/src/stories/Dropdown/Dropdown.stories.tsx +11 -1
- package/src/stories/Header/Header.stories.tsx +1 -1
- package/src/stories/Icon/Icon.stories.tsx +1 -1
- package/src/stories/Input/Input.stories.tsx +1 -1
- package/src/stories/Menu/Menu.stories.tsx +1 -1
- package/src/stories/Message/Message.stories.tsx +1 -1
- package/src/stories/Modal/Modal.stories.tsx +1 -1
- package/src/stories/MultiSelect/MultiSelect.stories.tsx +1 -1
- package/src/stories/Navbar/Navbar.stories.tsx +1 -1
- package/src/stories/Notifications/Interactive.stories.tsx +1 -1
- package/src/stories/Notifications/Notification.stories.tsx +1 -1
- package/src/stories/Notifications/Notifications.stories.tsx +1 -1
- package/src/stories/Paging/Paging.stories.tsx +1 -1
- package/src/stories/Panel/Panel.stories.tsx +5 -5
- package/src/stories/Paragraph/Paragraph.stories.tsx +1 -1
- package/src/stories/Popover/Popover.stories.tsx +2 -2
- package/src/stories/RadioGroup/RadioGroup.stories.tsx +1 -1
- package/src/stories/Sidebar/Sidebar.stories.tsx +2 -2
- package/src/stories/Spacer/Spacer.stories.tsx +1 -1
- package/src/stories/Spinner/Spinner.stories.tsx +1 -1
- package/src/stories/Table/Table.stories.tsx +277 -78
- package/src/stories/Tabs/Tabs.stories.tsx +1 -1
- package/src/stories/Tag/Tag.stories.tsx +1 -1
- package/src/stories/TextArea/TextArea.stories.tsx +2 -2
- package/src/stories/Tree/Tree.stories.tsx +2 -2
- package/src/stories/utils/args.ts +1 -1
- package/tests.json +1 -1
|
@@ -11,7 +11,7 @@ import { FlatArg, IconArg, IntentArg, SizeArg, argManager } from '../utils/args'
|
|
|
11
11
|
const { createArg } = argManager<IReqorePanelProps>();
|
|
12
12
|
|
|
13
13
|
export default {
|
|
14
|
-
title: '
|
|
14
|
+
title: 'Layout/Panel/Stories',
|
|
15
15
|
parameters: {
|
|
16
16
|
chromatic: {
|
|
17
17
|
viewports: [450, 600, 1440],
|
|
@@ -230,8 +230,8 @@ const Template: Story<IReqorePanelProps> = (args: IReqorePanelProps) => {
|
|
|
230
230
|
{
|
|
231
231
|
label: 'More actions',
|
|
232
232
|
actions: [
|
|
233
|
-
{
|
|
234
|
-
{
|
|
233
|
+
{ label: 'Sub Test', icon: 'FileDownloadLine' },
|
|
234
|
+
{ label: 'Sub Test 2', icon: 'FileDownloadLine', intent: 'success' },
|
|
235
235
|
],
|
|
236
236
|
intent: 'info',
|
|
237
237
|
},
|
|
@@ -249,8 +249,8 @@ const Template: Story<IReqorePanelProps> = (args: IReqorePanelProps) => {
|
|
|
249
249
|
label: 'More actions',
|
|
250
250
|
position: 'right',
|
|
251
251
|
actions: [
|
|
252
|
-
{
|
|
253
|
-
{
|
|
252
|
+
{ label: 'Sub Test', icon: 'FileDownloadLine', intent: 'success' },
|
|
253
|
+
{ label: 'Sub Test 2', icon: 'FileDownloadLine' },
|
|
254
254
|
],
|
|
255
255
|
},
|
|
256
256
|
]}
|
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
ReqorePopover,
|
|
12
12
|
ReqoreSpacer,
|
|
13
13
|
} from '../../index';
|
|
14
|
-
import {
|
|
14
|
+
import { FlatArg, argManager } from '../utils/args';
|
|
15
15
|
|
|
16
16
|
const { createArg } = argManager<IReqorePopoverProps>();
|
|
17
17
|
|
|
18
18
|
export default {
|
|
19
|
-
title: '
|
|
19
|
+
title: 'Other/Popover/Stories',
|
|
20
20
|
argTypes: {
|
|
21
21
|
...createArg('transparent', {
|
|
22
22
|
defaultValue: false,
|
|
@@ -6,7 +6,7 @@ import { DisabledArg, SizeArg, argManager } from '../utils/args';
|
|
|
6
6
|
const { createArg } = argManager<IReqoreRadioGroupProps>();
|
|
7
7
|
|
|
8
8
|
export default {
|
|
9
|
-
title: '
|
|
9
|
+
title: 'Form/Radio Group/Stories',
|
|
10
10
|
argTypes: {
|
|
11
11
|
...createArg('asSwitch', {
|
|
12
12
|
type: 'boolean',
|
|
@@ -3,12 +3,12 @@ import { noop } from 'lodash';
|
|
|
3
3
|
import { IQorusSidebarProps } from '../../components/Sidebar';
|
|
4
4
|
import { ReqorePanel, ReqoreSidebar } from '../../index';
|
|
5
5
|
import { qorusSidebarItems } from '../../mock/menu';
|
|
6
|
-
import {
|
|
6
|
+
import { FlatArg, NoContentArg, argManager } from '../utils/args';
|
|
7
7
|
|
|
8
8
|
const { disableArg, createArg } = argManager<IQorusSidebarProps>();
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
|
-
title: '
|
|
11
|
+
title: 'Navigation/Sidebar/Stories',
|
|
12
12
|
argTypes: {
|
|
13
13
|
...disableArg('items'),
|
|
14
14
|
...FlatArg,
|
|
@@ -3,7 +3,7 @@ import { IReqoreSpinnerProps, ReqoreSpinner } from '../../components/Spinner';
|
|
|
3
3
|
import { ReqoreControlGroup } from '../../index';
|
|
4
4
|
|
|
5
5
|
export default {
|
|
6
|
-
title: '
|
|
6
|
+
title: 'Utilities/Spinner/Stories',
|
|
7
7
|
} as Meta;
|
|
8
8
|
|
|
9
9
|
const Template: Story<IReqoreSpinnerProps> = (args) => {
|
|
@@ -1,13 +1,199 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react/types-6-0';
|
|
2
|
+
import { StyledEffect } from '../../components/Effect';
|
|
2
3
|
import { IReqoreTableColumn, IReqoreTableProps } from '../../components/Table';
|
|
3
|
-
import {
|
|
4
|
+
import { IReqoreCustomTableBodyCellProps } from '../../components/Table/cell';
|
|
5
|
+
import { IReqoreCustomHeaderCellProps } from '../../components/Table/header';
|
|
6
|
+
import { ReqoreH3, ReqoreH4, ReqoreIcon, ReqoreP, ReqoreTable, ReqoreTag } from '../../index';
|
|
4
7
|
import tableData from '../../mock/tableData';
|
|
5
|
-
import {
|
|
8
|
+
import { CustomIntentArg, FlatArg, IntentArg, SizeArg, argManager } from '../utils/args';
|
|
6
9
|
|
|
7
10
|
const { createArg } = argManager<IReqoreTableProps>();
|
|
8
11
|
|
|
12
|
+
const defaultColumns: IReqoreTableColumn[] = [
|
|
13
|
+
{
|
|
14
|
+
dataId: 'id',
|
|
15
|
+
header: {
|
|
16
|
+
label: 'ID',
|
|
17
|
+
tooltip: 'Custom ID tooltip nice',
|
|
18
|
+
},
|
|
19
|
+
cell: {
|
|
20
|
+
content: 'tag',
|
|
21
|
+
},
|
|
22
|
+
width: 80,
|
|
23
|
+
align: 'center',
|
|
24
|
+
sortable: true,
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
header: {
|
|
28
|
+
label: 'Name',
|
|
29
|
+
columns: [
|
|
30
|
+
{
|
|
31
|
+
dataId: 'firstName',
|
|
32
|
+
header: {
|
|
33
|
+
icon: 'SlideshowLine',
|
|
34
|
+
label: 'First Name',
|
|
35
|
+
effect: {
|
|
36
|
+
gradient: {
|
|
37
|
+
colors: {
|
|
38
|
+
0: 'success',
|
|
39
|
+
100: 'info',
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
width: 150,
|
|
45
|
+
grow: 2,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
dataId: 'lastName',
|
|
49
|
+
header: {
|
|
50
|
+
icon: 'SlideshowLine',
|
|
51
|
+
label: 'Last Name',
|
|
52
|
+
},
|
|
53
|
+
width: 150,
|
|
54
|
+
grow: 1,
|
|
55
|
+
sortable: true,
|
|
56
|
+
cell: {
|
|
57
|
+
onClick: ({ lastName }) => alert(`Clicked last name cell ${lastName}`),
|
|
58
|
+
content: 'title:info',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
},
|
|
63
|
+
dataId: 'name',
|
|
64
|
+
grow: 3,
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
dataId: 'address',
|
|
68
|
+
header: {
|
|
69
|
+
label: 'Address',
|
|
70
|
+
description: 'This is the address',
|
|
71
|
+
onClick: () => alert('clicked address'),
|
|
72
|
+
},
|
|
73
|
+
width: 300,
|
|
74
|
+
grow: 2,
|
|
75
|
+
resizable: false,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
dataId: 'age',
|
|
79
|
+
header: {
|
|
80
|
+
label: 'Really long age header',
|
|
81
|
+
icon: 'User4Line',
|
|
82
|
+
tooltip: 'Custom age tooltip',
|
|
83
|
+
},
|
|
84
|
+
width: 100,
|
|
85
|
+
align: 'center',
|
|
86
|
+
sortable: true,
|
|
87
|
+
|
|
88
|
+
cell: {
|
|
89
|
+
intent: 'danger',
|
|
90
|
+
content: 'tag:#000000',
|
|
91
|
+
tooltip: (value) => `Age is ${value}`,
|
|
92
|
+
onClick: ({ age }) => alert(`Clicked age cell ${age}`),
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
header: {
|
|
97
|
+
label: 'Data',
|
|
98
|
+
columns: [
|
|
99
|
+
{
|
|
100
|
+
dataId: 'occupation',
|
|
101
|
+
header: { label: 'Ocuppation' },
|
|
102
|
+
width: 200,
|
|
103
|
+
cell: { content: 'text:warning' },
|
|
104
|
+
filterable: true,
|
|
105
|
+
filterPlaceholder: 'Search occupation',
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
dataId: 'group',
|
|
109
|
+
align: 'right',
|
|
110
|
+
header: { label: <ReqoreTag label='Group' icon='Group2Line' size='small' /> },
|
|
111
|
+
width: 150,
|
|
112
|
+
cell: { intent: 'muted' },
|
|
113
|
+
filterable: true,
|
|
114
|
+
},
|
|
115
|
+
],
|
|
116
|
+
},
|
|
117
|
+
dataId: 'data',
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
dataId: 'date',
|
|
121
|
+
header: { label: 'Date' },
|
|
122
|
+
sortable: true,
|
|
123
|
+
grow: 2,
|
|
124
|
+
width: 150,
|
|
125
|
+
cell: {
|
|
126
|
+
content: 'time-ago',
|
|
127
|
+
tooltip: () => ({
|
|
128
|
+
title: 'Custom tooltip',
|
|
129
|
+
content: 'This is a custom tooltip',
|
|
130
|
+
effect: {
|
|
131
|
+
gradient: {
|
|
132
|
+
colors: {
|
|
133
|
+
0: 'warning',
|
|
134
|
+
100: 'info',
|
|
135
|
+
},
|
|
136
|
+
},
|
|
137
|
+
},
|
|
138
|
+
}),
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
];
|
|
142
|
+
|
|
143
|
+
const defaultColumnsWithFilters = defaultColumns.map((column, index) => {
|
|
144
|
+
if (index === 4) {
|
|
145
|
+
return {
|
|
146
|
+
...column,
|
|
147
|
+
header: {
|
|
148
|
+
...column.header,
|
|
149
|
+
columns: column.header.columns.map((subColumn, subIndex) =>
|
|
150
|
+
subIndex === 0
|
|
151
|
+
? {
|
|
152
|
+
...subColumn,
|
|
153
|
+
filter: 'Advisor',
|
|
154
|
+
}
|
|
155
|
+
: {
|
|
156
|
+
...subColumn,
|
|
157
|
+
filter: 'net',
|
|
158
|
+
}
|
|
159
|
+
),
|
|
160
|
+
},
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
return column;
|
|
165
|
+
});
|
|
166
|
+
|
|
167
|
+
const defaultColumnsWithHiddenColumns = defaultColumns.map((column, index) => {
|
|
168
|
+
if (index === 4) {
|
|
169
|
+
return {
|
|
170
|
+
...column,
|
|
171
|
+
header: {
|
|
172
|
+
...column.header,
|
|
173
|
+
columns: column.header.columns.map((subColumn, subIndex) =>
|
|
174
|
+
subIndex === 0
|
|
175
|
+
? {
|
|
176
|
+
...subColumn,
|
|
177
|
+
show: false,
|
|
178
|
+
}
|
|
179
|
+
: subColumn
|
|
180
|
+
),
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
if (index === 2) {
|
|
186
|
+
return {
|
|
187
|
+
...column,
|
|
188
|
+
show: false,
|
|
189
|
+
};
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
return column;
|
|
193
|
+
});
|
|
194
|
+
|
|
9
195
|
export default {
|
|
10
|
-
title: '
|
|
196
|
+
title: 'Collections/Table/Stories',
|
|
11
197
|
argTypes: {
|
|
12
198
|
...createArg('rounded', {
|
|
13
199
|
type: 'boolean',
|
|
@@ -26,77 +212,11 @@ export default {
|
|
|
26
212
|
}),
|
|
27
213
|
...createArg('columns', {
|
|
28
214
|
name: 'Columns',
|
|
29
|
-
defaultValue:
|
|
30
|
-
{
|
|
31
|
-
dataId: 'id',
|
|
32
|
-
header: 'ID',
|
|
33
|
-
width: 50,
|
|
34
|
-
align: 'center',
|
|
35
|
-
sortable: true,
|
|
36
|
-
tooltip: 'Custom ID tooltip nice',
|
|
37
|
-
content: 'tag',
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
header: 'Name',
|
|
41
|
-
dataId: 'name',
|
|
42
|
-
grow: 3,
|
|
43
|
-
columns: [
|
|
44
|
-
{
|
|
45
|
-
icon: 'SlideshowLine',
|
|
46
|
-
dataId: 'firstName',
|
|
47
|
-
header: 'First Name',
|
|
48
|
-
width: 150,
|
|
49
|
-
grow: 2,
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
icon: 'SlideshowLine',
|
|
53
|
-
dataId: 'lastName',
|
|
54
|
-
header: 'Last Name',
|
|
55
|
-
width: 150,
|
|
56
|
-
grow: 1,
|
|
57
|
-
sortable: true,
|
|
58
|
-
onCellClick: ({ lastName }) => alert(`Clicked last name cell ${lastName}`),
|
|
59
|
-
content: 'title:info',
|
|
60
|
-
},
|
|
61
|
-
],
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
dataId: 'address',
|
|
65
|
-
header: 'Address',
|
|
66
|
-
width: 300,
|
|
67
|
-
grow: 2,
|
|
68
|
-
onClick: () => alert('clicked address'),
|
|
69
|
-
},
|
|
70
|
-
{
|
|
71
|
-
icon: 'User4Line',
|
|
72
|
-
dataId: 'age',
|
|
73
|
-
header: 'Really long age header',
|
|
74
|
-
width: 50,
|
|
75
|
-
align: 'center',
|
|
76
|
-
sortable: true,
|
|
77
|
-
intent: 'danger',
|
|
78
|
-
content: 'tag:#000000',
|
|
79
|
-
onCellClick: ({ age }) => alert(`Clicked age cell ${age}`),
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
header: 'Data',
|
|
83
|
-
dataId: 'data',
|
|
84
|
-
columns: [
|
|
85
|
-
{ dataId: 'occupation', header: 'Ocuppation', width: 200, content: 'text:warning' },
|
|
86
|
-
{ dataId: 'group', header: 'Group', width: 150, intent: 'muted' },
|
|
87
|
-
],
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
dataId: 'date',
|
|
91
|
-
header: 'Date',
|
|
92
|
-
sortable: true,
|
|
93
|
-
content: 'time-ago',
|
|
94
|
-
},
|
|
95
|
-
] as IReqoreTableColumn[],
|
|
215
|
+
defaultValue: defaultColumns,
|
|
96
216
|
}),
|
|
97
217
|
...createArg('width', {
|
|
98
218
|
type: 'number',
|
|
99
|
-
defaultValue:
|
|
219
|
+
defaultValue: undefined,
|
|
100
220
|
name: 'Width',
|
|
101
221
|
description: 'The width of the table',
|
|
102
222
|
}),
|
|
@@ -135,28 +255,107 @@ export default {
|
|
|
135
255
|
} as Meta<IReqoreTableProps>;
|
|
136
256
|
|
|
137
257
|
const Template: Story<IReqoreTableProps> = (args) => {
|
|
138
|
-
return <ReqoreTable {...args} sort={{ by: '
|
|
258
|
+
return <ReqoreTable label='Table' {...args} sort={{ by: 'lastName', direction: 'desc' }} />;
|
|
139
259
|
};
|
|
140
260
|
|
|
141
261
|
export const Basic = Template.bind({});
|
|
142
|
-
export const
|
|
143
|
-
|
|
144
|
-
|
|
262
|
+
export const NoLabel = Template.bind({});
|
|
263
|
+
NoLabel.args = {
|
|
264
|
+
label: undefined,
|
|
265
|
+
};
|
|
266
|
+
|
|
267
|
+
export const CustomWidth = Template.bind({});
|
|
268
|
+
CustomWidth.args = {
|
|
269
|
+
width: 400,
|
|
270
|
+
};
|
|
271
|
+
|
|
272
|
+
export const NotFlat = Template.bind({});
|
|
273
|
+
NotFlat.args = {
|
|
274
|
+
flat: false,
|
|
145
275
|
};
|
|
146
276
|
export const Striped = Template.bind({});
|
|
147
277
|
Striped.args = {
|
|
148
278
|
striped: true,
|
|
149
279
|
};
|
|
150
|
-
export const
|
|
151
|
-
|
|
152
|
-
|
|
280
|
+
export const Filterable = Template.bind({});
|
|
281
|
+
Filterable.args = {
|
|
282
|
+
filterable: true,
|
|
283
|
+
};
|
|
284
|
+
export const DefaultFilter = Template.bind({});
|
|
285
|
+
DefaultFilter.args = {
|
|
286
|
+
filterable: true,
|
|
287
|
+
filter: 'Village',
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export const NoDataMessage = Template.bind({});
|
|
291
|
+
NoDataMessage.args = {
|
|
292
|
+
filterable: true,
|
|
293
|
+
filter: 'asjkghakshgjkashg',
|
|
294
|
+
};
|
|
295
|
+
|
|
296
|
+
export const FilterableColumns = Template.bind({});
|
|
297
|
+
FilterableColumns.args = {
|
|
298
|
+
columns: defaultColumnsWithFilters,
|
|
299
|
+
};
|
|
300
|
+
|
|
301
|
+
export const AllFiltersActive = Template.bind({});
|
|
302
|
+
AllFiltersActive.args = {
|
|
303
|
+
filterable: true,
|
|
304
|
+
filter: 'Road',
|
|
305
|
+
columns: defaultColumnsWithFilters,
|
|
153
306
|
};
|
|
307
|
+
|
|
308
|
+
export const HiddenColumns = Template.bind({});
|
|
309
|
+
HiddenColumns.args = {
|
|
310
|
+
columns: defaultColumnsWithHiddenColumns,
|
|
311
|
+
};
|
|
312
|
+
|
|
154
313
|
export const Selectable = Template.bind({});
|
|
155
314
|
Selectable.args = {
|
|
156
315
|
selectable: true,
|
|
157
316
|
};
|
|
158
317
|
|
|
318
|
+
export const Zoomable = Template.bind({});
|
|
319
|
+
Zoomable.args = {
|
|
320
|
+
zoomable: true,
|
|
321
|
+
};
|
|
322
|
+
|
|
159
323
|
export const FillParent = Template.bind({});
|
|
160
324
|
FillParent.args = {
|
|
161
325
|
fill: true,
|
|
162
326
|
};
|
|
327
|
+
|
|
328
|
+
export const Sizes = Template.bind({});
|
|
329
|
+
Sizes.args = {
|
|
330
|
+
size: 'small',
|
|
331
|
+
filterable: true,
|
|
332
|
+
wrapperSize: 'big',
|
|
333
|
+
};
|
|
334
|
+
|
|
335
|
+
const CustomHeaderCell = (props: IReqoreCustomHeaderCellProps) => {
|
|
336
|
+
if (props.hasColumns) {
|
|
337
|
+
return <ReqoreH3 intent='success'>{props.label}</ReqoreH3>;
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
return (
|
|
341
|
+
<ReqoreH4 style={{ width: props.width, flexGrow: props.grow }}>
|
|
342
|
+
<ReqoreIcon icon={props.icon} />
|
|
343
|
+
{props.label}
|
|
344
|
+
</ReqoreH4>
|
|
345
|
+
);
|
|
346
|
+
};
|
|
347
|
+
|
|
348
|
+
const CustomCell = (props: IReqoreCustomTableBodyCellProps) => {
|
|
349
|
+
return <ReqoreP style={{ width: props.width, flexGrow: props.grow }}>{props.children}</ReqoreP>;
|
|
350
|
+
};
|
|
351
|
+
|
|
352
|
+
const CustomRow = (props: IReqoreCustomTableBodyCellProps) => {
|
|
353
|
+
return <StyledEffect style={props.style}>{props.children}</StyledEffect>;
|
|
354
|
+
};
|
|
355
|
+
|
|
356
|
+
export const CustomCellsAndRows = Template.bind({});
|
|
357
|
+
CustomCellsAndRows.args = {
|
|
358
|
+
headerCellComponent: CustomHeaderCell,
|
|
359
|
+
bodyCellComponent: CustomCell,
|
|
360
|
+
rowComponent: CustomRow,
|
|
361
|
+
};
|
|
@@ -103,7 +103,7 @@ const tabs = [
|
|
|
103
103
|
const { createArg } = argManager<IReqoreTabsProps & { tabPadding: TReqoreTabsContentPadding }>();
|
|
104
104
|
|
|
105
105
|
export default {
|
|
106
|
-
title: '
|
|
106
|
+
title: 'Navigation/Tabs/Stories',
|
|
107
107
|
argTypes: {
|
|
108
108
|
...SizeArg,
|
|
109
109
|
...IntentArg,
|
|
@@ -8,7 +8,7 @@ import { SizeArg, argManager } from '../utils/args';
|
|
|
8
8
|
const { createArg } = argManager<IReqoreTagGroup & IReqoreTagProps>();
|
|
9
9
|
|
|
10
10
|
export default {
|
|
11
|
-
title: '
|
|
11
|
+
title: 'Form/Tag/Stories',
|
|
12
12
|
argTypes: {
|
|
13
13
|
...SizeArg,
|
|
14
14
|
...createArg('columns', {
|
|
@@ -2,12 +2,12 @@ import { Meta, Story } from '@storybook/react/types-6-0';
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { IReqoreTextareaProps } from '../../components/Textarea';
|
|
4
4
|
import { ReqoreControlGroup, ReqoreTextarea } from '../../index';
|
|
5
|
-
import {
|
|
5
|
+
import { DisabledArg, MinimalArg, SizeArg, argManager } from '../utils/args';
|
|
6
6
|
|
|
7
7
|
const { createArg } = argManager<IReqoreTextareaProps>();
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
|
-
title: '
|
|
10
|
+
title: 'Form/TextArea/Stories',
|
|
11
11
|
argTypes: {
|
|
12
12
|
...MinimalArg(),
|
|
13
13
|
...DisabledArg,
|
|
@@ -2,12 +2,12 @@ import { Meta, Story } from '@storybook/react/types-6-0';
|
|
|
2
2
|
import { noop } from 'lodash';
|
|
3
3
|
import { IReqoreTreeProps, ReqoreTree } from '../../components/Tree';
|
|
4
4
|
import MockObject from '../../mock/object.json';
|
|
5
|
-
import {
|
|
5
|
+
import { SizeArg, argManager } from '../utils/args';
|
|
6
6
|
|
|
7
7
|
const { createArg } = argManager<IReqoreTreeProps>();
|
|
8
8
|
|
|
9
9
|
export default {
|
|
10
|
-
title: '
|
|
10
|
+
title: 'Collections/Tree/Stories',
|
|
11
11
|
argTypes: {
|
|
12
12
|
...createArg('withLabelCopy', {
|
|
13
13
|
name: 'With label copy',
|