@qoretechnologies/reqore 0.32.3 → 0.33.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__/collection.test.tsx +123 -5
- package/__tests__/hooks/useLatestZIndex.test.tsx +10 -0
- package/__tests__/hooks/useReqorePaging.test.tsx +251 -0
- package/__tests__/hooks/useTheme.test.tsx +31 -0
- package/__tests__/pagination.test.tsx +301 -0
- package/__tests__/popover.test.tsx +20 -6
- package/__tests__/setup.js +8 -0
- package/__tests__/tree.test.tsx +0 -1
- package/dist/components/Button/index.d.ts +1 -0
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +11 -7
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/Collection/index.d.ts +9 -3
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +34 -8
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Dropdown/index.d.ts +5 -2
- 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 +3 -3
- package/dist/components/Dropdown/list.js.map +1 -1
- package/dist/components/Menu/item.d.ts +1 -0
- package/dist/components/Menu/item.d.ts.map +1 -1
- package/dist/components/Menu/item.js +14 -2
- package/dist/components/Menu/item.js.map +1 -1
- package/dist/components/MultiSelect/index.d.ts +1 -1
- package/dist/components/MultiSelect/index.d.ts.map +1 -1
- package/dist/components/Paging/index.d.ts +30 -0
- package/dist/components/Paging/index.d.ts.map +1 -0
- package/dist/components/Paging/index.js +106 -0
- package/dist/components/Paging/index.js.map +1 -0
- package/dist/components/Tag/index.d.ts +3 -2
- package/dist/components/Tag/index.d.ts.map +1 -1
- package/dist/components/Tag/index.js +10 -7
- package/dist/components/Tag/index.js.map +1 -1
- package/dist/constants/colors.d.ts +2 -9
- package/dist/constants/colors.d.ts.map +1 -1
- package/dist/constants/colors.js +3 -1
- package/dist/constants/colors.js.map +1 -1
- package/dist/constants/paging.d.ts +10 -0
- package/dist/constants/paging.d.ts.map +1 -0
- package/dist/constants/paging.js +41 -0
- package/dist/constants/paging.js.map +1 -0
- package/dist/constants/theme.d.ts.map +1 -1
- package/dist/constants/theme.js +8 -7
- package/dist/constants/theme.js.map +1 -1
- package/dist/containers/ReqoreProvider.d.ts.map +1 -1
- package/dist/containers/ReqoreProvider.js +2 -2
- package/dist/containers/ReqoreProvider.js.map +1 -1
- package/dist/containers/UIProvider.d.ts.map +1 -1
- package/dist/containers/UIProvider.js +9 -3
- package/dist/containers/UIProvider.js.map +1 -1
- package/dist/hooks/useCombinedRefs.d.ts +2 -2
- package/dist/hooks/useCombinedRefs.d.ts.map +1 -1
- package/dist/hooks/useCombinedRefs.js.map +1 -1
- package/dist/hooks/usePaging.d.ts +27 -0
- package/dist/hooks/usePaging.d.ts.map +1 -0
- package/dist/hooks/usePaging.js +83 -0
- package/dist/hooks/usePaging.js.map +1 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -2
- package/dist/index.js.map +1 -1
- package/package.json +6 -4
- package/src/components/Button/index.tsx +18 -10
- package/src/components/Collection/index.tsx +96 -44
- package/src/components/ControlGroup/index.tsx +1 -1
- package/src/components/Dropdown/index.tsx +8 -2
- package/src/components/Dropdown/list.tsx +7 -1
- package/src/components/Menu/item.tsx +16 -2
- package/src/components/MultiSelect/index.tsx +1 -1
- package/src/components/Paging/index.tsx +232 -0
- package/src/components/Tag/index.tsx +9 -7
- package/src/constants/colors.ts +5 -1
- package/src/constants/paging.ts +48 -0
- package/src/constants/theme.ts +8 -7
- package/src/containers/ReqoreProvider.tsx +3 -3
- package/src/containers/UIProvider.tsx +17 -4
- package/src/hooks/useCombinedRefs.ts +2 -2
- package/src/hooks/usePaging.ts +110 -0
- package/src/index.tsx +2 -0
- package/src/mock/collectionData.tsx +19 -0
- package/src/mock/tableData.ts +1 -0
- package/src/stories/Button/Button.stories.tsx +25 -8
- package/src/stories/Collection/Collection.stories.tsx +32 -42
- package/src/stories/Dropdown/Dropdown.stories.tsx +24 -1
- package/src/stories/Paging/Paging.stories.tsx +184 -0
- package/src/stories/Tag/Tag.stories.tsx +50 -0
- package/tests.json +1 -1
|
@@ -19,7 +19,7 @@ export default {
|
|
|
19
19
|
|
|
20
20
|
const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
21
21
|
return (
|
|
22
|
-
|
|
22
|
+
<ReqoreControlGroup vertical gapSize='big'>
|
|
23
23
|
<ReqoreControlGroup size={buttonProps.size} wrap>
|
|
24
24
|
<ReqoreButton {...buttonProps} icon='BankFill' rightIcon={null} />
|
|
25
25
|
<ReqoreButton {...buttonProps} />
|
|
@@ -27,7 +27,7 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
27
27
|
{...buttonProps}
|
|
28
28
|
icon='BankFill'
|
|
29
29
|
rightIcon={null}
|
|
30
|
-
|
|
30
|
+
iconsAlign='center'
|
|
31
31
|
style={{ width: '100px' }}
|
|
32
32
|
/>
|
|
33
33
|
<ReqoreButton {...buttonProps}>Default</ReqoreButton>
|
|
@@ -47,7 +47,6 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
47
47
|
Read only
|
|
48
48
|
</ReqoreButton>
|
|
49
49
|
</ReqoreControlGroup>
|
|
50
|
-
<br />
|
|
51
50
|
<ReqoreControlGroup size={buttonProps.size} wrap>
|
|
52
51
|
<ReqoreButton {...buttonProps} active flat={false} tooltip='hello'>
|
|
53
52
|
Active Not Flat
|
|
@@ -72,13 +71,33 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
72
71
|
Disabled not flat
|
|
73
72
|
</ReqoreButton>
|
|
74
73
|
</ReqoreControlGroup>
|
|
75
|
-
<br />
|
|
76
74
|
<ReqoreControlGroup fluid wrap>
|
|
77
75
|
<ReqoreButton {...buttonProps} fluid>
|
|
78
76
|
Fluid button
|
|
79
77
|
</ReqoreButton>
|
|
80
78
|
</ReqoreControlGroup>
|
|
81
|
-
<
|
|
79
|
+
<ReqoreControlGroup fluid wrap>
|
|
80
|
+
<ReqoreButton {...buttonProps} fluid textAlign='center'>
|
|
81
|
+
Fluid button with centered text
|
|
82
|
+
</ReqoreButton>
|
|
83
|
+
</ReqoreControlGroup>
|
|
84
|
+
<ReqoreControlGroup fluid wrap>
|
|
85
|
+
<ReqoreButton {...buttonProps} fluid textAlign='center' iconsAlign='center'>
|
|
86
|
+
Fluid button with centered text & icons
|
|
87
|
+
</ReqoreButton>
|
|
88
|
+
<ReqoreButton
|
|
89
|
+
{...buttonProps}
|
|
90
|
+
rightIcon={null}
|
|
91
|
+
fluid
|
|
92
|
+
textAlign='center'
|
|
93
|
+
iconsAlign='center'
|
|
94
|
+
>
|
|
95
|
+
Fluid button with centered text & icons
|
|
96
|
+
</ReqoreButton>
|
|
97
|
+
<ReqoreButton {...buttonProps} icon={null} fluid textAlign='center' iconsAlign='center'>
|
|
98
|
+
Fluid button with centered text & icons
|
|
99
|
+
</ReqoreButton>
|
|
100
|
+
</ReqoreControlGroup>
|
|
82
101
|
<ReqoreControlGroup fluid wrap>
|
|
83
102
|
<ReqoreButton {...buttonProps}>Left text</ReqoreButton>
|
|
84
103
|
<ReqoreButton
|
|
@@ -112,7 +131,6 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
112
131
|
Right text
|
|
113
132
|
</ReqoreButton>
|
|
114
133
|
</ReqoreControlGroup>
|
|
115
|
-
<br />
|
|
116
134
|
<ReqoreControlGroup wrap>
|
|
117
135
|
<ReqoreButton
|
|
118
136
|
{...buttonProps}
|
|
@@ -171,7 +189,6 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
171
189
|
wrap
|
|
172
190
|
/>
|
|
173
191
|
</ReqoreControlGroup>
|
|
174
|
-
<br />
|
|
175
192
|
<ReqoreControlGroup wrap>
|
|
176
193
|
<ReqoreButton {...buttonProps} readOnly badge={10} onClick={alert}>
|
|
177
194
|
Read only with badge
|
|
@@ -225,7 +242,7 @@ const Template: ComponentStory<typeof ReqoreButton> = (buttonProps) => {
|
|
|
225
242
|
With modified Badge
|
|
226
243
|
</ReqoreButton>
|
|
227
244
|
</ReqoreControlGroup>
|
|
228
|
-
|
|
245
|
+
</ReqoreControlGroup>
|
|
229
246
|
);
|
|
230
247
|
};
|
|
231
248
|
|
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { Meta, Story } from '@storybook/react';
|
|
2
|
-
import { ReqoreButton, ReqoreControlGroup } from '../..';
|
|
2
|
+
import { ReqoreButton, ReqoreControlGroup, ReqoreVerticalSpacer } from '../..';
|
|
3
3
|
import { IReqoreCollectionProps, ReqoreCollection } from '../../components/Collection';
|
|
4
4
|
import { IReqoreColumnsProps } from '../../components/Columns';
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
|
|
5
|
+
import { PADDING_FROM_SIZE } from '../../constants/sizes';
|
|
6
|
+
import items, { bigCollection } from '../../mock/collectionData';
|
|
7
|
+
|
|
8
|
+
import { argManager, IntentArg, SizeArg } from '../utils/args';
|
|
8
9
|
|
|
9
10
|
export interface IColumnsStoryArgs extends IReqoreColumnsProps {
|
|
10
11
|
multipleColumns?: boolean;
|
|
@@ -143,34 +144,38 @@ export const ChildrenBeforeAndAfter = Template.bind({});
|
|
|
143
144
|
ChildrenBeforeAndAfter.args = {
|
|
144
145
|
label: 'Collection of items',
|
|
145
146
|
items,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
<
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
<
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
147
|
+
contentRenderer: (children) => (
|
|
148
|
+
<>
|
|
149
|
+
<ReqoreControlGroup horizontalAlign='center' fluid>
|
|
150
|
+
<ReqoreButton fluid> I could be a filter of some kind</ReqoreButton>
|
|
151
|
+
</ReqoreControlGroup>
|
|
152
|
+
<ReqoreVerticalSpacer height={PADDING_FROM_SIZE.normal} />
|
|
153
|
+
{children}
|
|
154
|
+
<ReqoreVerticalSpacer height={PADDING_FROM_SIZE.normal} />
|
|
155
|
+
<ReqoreControlGroup horizontalAlign='center' fluid>
|
|
156
|
+
<ReqoreControlGroup fluid={false} fixed>
|
|
157
|
+
<ReqoreButton fixed textAlign='center'>
|
|
158
|
+
1
|
|
159
|
+
</ReqoreButton>
|
|
160
|
+
<ReqoreButton fixed textAlign='center'>
|
|
161
|
+
2
|
|
162
|
+
</ReqoreButton>
|
|
163
|
+
<ReqoreButton fixed textAlign='center'>
|
|
164
|
+
3
|
|
165
|
+
</ReqoreButton>
|
|
166
|
+
<ReqoreButton fixed textAlign='center'>
|
|
167
|
+
4
|
|
168
|
+
</ReqoreButton>
|
|
169
|
+
</ReqoreControlGroup>
|
|
166
170
|
</ReqoreControlGroup>
|
|
167
|
-
|
|
171
|
+
</>
|
|
168
172
|
),
|
|
169
173
|
};
|
|
170
174
|
|
|
171
175
|
export const FilteringSearchingPaging = Template.bind({});
|
|
172
176
|
FilteringSearchingPaging.args = {
|
|
173
177
|
inputProps: {
|
|
178
|
+
fluid: true,
|
|
174
179
|
focusRules: {
|
|
175
180
|
type: 'keypress',
|
|
176
181
|
shortcut: 'letters',
|
|
@@ -183,24 +188,9 @@ FilteringSearchingPaging.args = {
|
|
|
183
188
|
sortButtonProps: {
|
|
184
189
|
fixed: false,
|
|
185
190
|
},
|
|
191
|
+
paging: true,
|
|
186
192
|
size: 'big',
|
|
187
193
|
padded: false,
|
|
188
194
|
fill: true,
|
|
189
|
-
items:
|
|
190
|
-
label: `${datum.firstName} ${datum.lastName}`,
|
|
191
|
-
badge: datum.id,
|
|
192
|
-
size: 'small',
|
|
193
|
-
expandable: true,
|
|
194
|
-
content: datum.address,
|
|
195
|
-
tags: [
|
|
196
|
-
{
|
|
197
|
-
labelKey: 'Age',
|
|
198
|
-
label: datum.age,
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
labelKey: 'Occupation',
|
|
202
|
-
label: datum.occupation,
|
|
203
|
-
},
|
|
204
|
-
],
|
|
205
|
-
})),
|
|
195
|
+
items: bigCollection,
|
|
206
196
|
} as IReqoreCollectionProps;
|
|
@@ -11,7 +11,7 @@ export default {
|
|
|
11
11
|
title: 'Components/Dropdown',
|
|
12
12
|
parameters: {
|
|
13
13
|
chromatic: {
|
|
14
|
-
delay:
|
|
14
|
+
delay: 1500,
|
|
15
15
|
},
|
|
16
16
|
},
|
|
17
17
|
argTypes: {
|
|
@@ -132,6 +132,25 @@ export default {
|
|
|
132
132
|
const Template: Story<IReqoreDropdownProps> = (args: IReqoreDropdownProps) => {
|
|
133
133
|
const [selected, setSelected] = useState<(string | number)[]>(['Item 3', 'Item 6']);
|
|
134
134
|
|
|
135
|
+
if (args.scrollToSelected) {
|
|
136
|
+
return (
|
|
137
|
+
<ReqoreControlGroup>
|
|
138
|
+
<ReqoreDropdown
|
|
139
|
+
label='Scrolling to selected'
|
|
140
|
+
isDefaultOpen
|
|
141
|
+
scrollToSelected
|
|
142
|
+
items={Array(130)
|
|
143
|
+
.fill(null)
|
|
144
|
+
.map((_, i) => ({
|
|
145
|
+
label: `Item ${i}`,
|
|
146
|
+
value: `item-${i}`,
|
|
147
|
+
selected: i === 55,
|
|
148
|
+
}))}
|
|
149
|
+
/>
|
|
150
|
+
</ReqoreControlGroup>
|
|
151
|
+
);
|
|
152
|
+
}
|
|
153
|
+
|
|
135
154
|
if (args.multiSelect) {
|
|
136
155
|
return (
|
|
137
156
|
<>
|
|
@@ -226,6 +245,10 @@ CustomComponent.args = {
|
|
|
226
245
|
component: ReqoreInput,
|
|
227
246
|
placeholder: 'Custom component',
|
|
228
247
|
};
|
|
248
|
+
export const ScrollToSelectedItem = Template.bind({});
|
|
249
|
+
ScrollToSelectedItem.args = {
|
|
250
|
+
scrollToSelected: true,
|
|
251
|
+
};
|
|
229
252
|
export const MultiSelect = Template.bind({});
|
|
230
253
|
MultiSelect.args = {
|
|
231
254
|
multiSelect: true,
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { Story, StoryObj } from '@storybook/react/types-6-0';
|
|
2
|
+
import { IReqorePaginationProps, ReqorePagination } from '../../components/Paging';
|
|
3
|
+
import { IReqorePagingOptions } from '../../hooks/usePaging';
|
|
4
|
+
import { ReqoreControlGroup, ReqoreTag, useReqorePaging } from '../../index';
|
|
5
|
+
import { tableData } from '../../mock/tableData';
|
|
6
|
+
|
|
7
|
+
export default {
|
|
8
|
+
title: 'Components/Paging',
|
|
9
|
+
} as StoryObj<typeof ReqorePagination>;
|
|
10
|
+
|
|
11
|
+
const Template: Story<IReqorePaginationProps<any> & { pagingOptions?: IReqorePagingOptions<any> }> =
|
|
12
|
+
(args) => {
|
|
13
|
+
const paging = useReqorePaging<any>({ items: tableData, ...args.pagingOptions });
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<ReqoreControlGroup vertical fluid>
|
|
17
|
+
{paging.items.map((item) => (
|
|
18
|
+
<ReqoreTag fixed='key' labelKey={item.id} label={`${item.firstName} ${item.lastName}`} />
|
|
19
|
+
))}
|
|
20
|
+
<ReqorePagination<any> {...paging} {...args} />
|
|
21
|
+
</ReqoreControlGroup>
|
|
22
|
+
);
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export const Basic = Template.bind({});
|
|
26
|
+
export const NoPageButtons = Template.bind({});
|
|
27
|
+
NoPageButtons.args = {
|
|
28
|
+
showPages: false,
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export const NoControlButtons = Template.bind({});
|
|
32
|
+
NoControlButtons.args = {
|
|
33
|
+
showControls: false,
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const ShowSomePages = Template.bind({});
|
|
37
|
+
ShowSomePages.args = {
|
|
38
|
+
pagingOptions: {
|
|
39
|
+
pagesToShow: 4,
|
|
40
|
+
} as IReqorePagingOptions<any>,
|
|
41
|
+
};
|
|
42
|
+
export const AsList = Template.bind({});
|
|
43
|
+
AsList.args = {
|
|
44
|
+
showPagesAs: 'list',
|
|
45
|
+
pagingOptions: {
|
|
46
|
+
pagesToShow: 5,
|
|
47
|
+
} as IReqorePagingOptions<any>,
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
export const WithStyling: Story<
|
|
51
|
+
IReqorePaginationProps<any> & { pagingOptions?: IReqorePagingOptions<any> }
|
|
52
|
+
> = Template.bind({});
|
|
53
|
+
WithStyling.args = {
|
|
54
|
+
showPagesAs: 'buttons',
|
|
55
|
+
activePageButtonProps: {
|
|
56
|
+
effect: {
|
|
57
|
+
gradient: {
|
|
58
|
+
colors: 'info',
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
},
|
|
62
|
+
pageButtonProps: {
|
|
63
|
+
effect: {
|
|
64
|
+
gradient: {
|
|
65
|
+
colors: 'warning',
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
controlPageButtonProps: {
|
|
70
|
+
effect: {
|
|
71
|
+
gradient: {
|
|
72
|
+
colors: 'success',
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
pagingOptions: {
|
|
77
|
+
pagesToShow: 15,
|
|
78
|
+
} as IReqorePagingOptions<any>,
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export const ListWithStyling: Story<
|
|
82
|
+
IReqorePaginationProps<any> & { pagingOptions?: IReqorePagingOptions<any> }
|
|
83
|
+
> = Template.bind({});
|
|
84
|
+
ListWithStyling.args = {
|
|
85
|
+
showPagesAs: 'list',
|
|
86
|
+
activePageButtonProps: {
|
|
87
|
+
effect: {
|
|
88
|
+
gradient: {
|
|
89
|
+
colors: 'info',
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
},
|
|
93
|
+
pageButtonProps: {
|
|
94
|
+
effect: {
|
|
95
|
+
gradient: {
|
|
96
|
+
colors: 'warning',
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
},
|
|
100
|
+
listPageButtonProps: {
|
|
101
|
+
isDefaultOpen: true,
|
|
102
|
+
effect: {
|
|
103
|
+
gradient: {
|
|
104
|
+
colors: 'info',
|
|
105
|
+
},
|
|
106
|
+
},
|
|
107
|
+
},
|
|
108
|
+
controlPageButtonProps: {
|
|
109
|
+
effect: {
|
|
110
|
+
gradient: {
|
|
111
|
+
colors: 'success',
|
|
112
|
+
},
|
|
113
|
+
},
|
|
114
|
+
},
|
|
115
|
+
pagingOptions: {
|
|
116
|
+
pagesToShow: 15,
|
|
117
|
+
} as IReqorePagingOptions<any>,
|
|
118
|
+
};
|
|
119
|
+
|
|
120
|
+
export const WithLabels: Story<
|
|
121
|
+
IReqorePaginationProps<any> & { pagingOptions?: IReqorePagingOptions<any> }
|
|
122
|
+
> = Template.bind({});
|
|
123
|
+
WithLabels.args = {
|
|
124
|
+
showPagesAs: 'list',
|
|
125
|
+
showLabels: true,
|
|
126
|
+
listPageButtonProps: {
|
|
127
|
+
isDefaultOpen: true,
|
|
128
|
+
},
|
|
129
|
+
pagingOptions: {
|
|
130
|
+
pagesToShow: 15,
|
|
131
|
+
} as IReqorePagingOptions<any>,
|
|
132
|
+
};
|
|
133
|
+
|
|
134
|
+
export const Infinite: Story<
|
|
135
|
+
IReqorePaginationProps<any> & { pagingOptions?: IReqorePagingOptions<any> }
|
|
136
|
+
> = Template.bind({});
|
|
137
|
+
Infinite.args = {
|
|
138
|
+
showLabels: true,
|
|
139
|
+
fluid: true,
|
|
140
|
+
loadMoreButtonProps: {
|
|
141
|
+
textAlign: 'center',
|
|
142
|
+
},
|
|
143
|
+
loadMoreLabel: 'Load 10 more',
|
|
144
|
+
pagingOptions: {
|
|
145
|
+
infinite: true,
|
|
146
|
+
} as IReqorePagingOptions<any>,
|
|
147
|
+
};
|
|
148
|
+
|
|
149
|
+
export const InfiniteWithAutoScroll: Story<
|
|
150
|
+
IReqorePaginationProps<any> & { pagingOptions?: IReqorePagingOptions<any> }
|
|
151
|
+
> = Template.bind({});
|
|
152
|
+
InfiniteWithAutoScroll.args = {
|
|
153
|
+
showLabels: true,
|
|
154
|
+
fluid: true,
|
|
155
|
+
scrollOnLoadMore: true,
|
|
156
|
+
loadMoreButtonProps: {
|
|
157
|
+
textAlign: 'center',
|
|
158
|
+
size: 'big',
|
|
159
|
+
},
|
|
160
|
+
loadMoreLabel: 'Load 100 more',
|
|
161
|
+
pagingOptions: {
|
|
162
|
+
infinite: true,
|
|
163
|
+
itemsPerPage: 100,
|
|
164
|
+
} as IReqorePagingOptions<any>,
|
|
165
|
+
};
|
|
166
|
+
|
|
167
|
+
export const InfiniteWithAutoLoad: Story<
|
|
168
|
+
IReqorePaginationProps<any> & { pagingOptions?: IReqorePagingOptions<any> }
|
|
169
|
+
> = Template.bind({});
|
|
170
|
+
InfiniteWithAutoLoad.args = {
|
|
171
|
+
showLabels: true,
|
|
172
|
+
fluid: true,
|
|
173
|
+
autoLoadMore: true,
|
|
174
|
+
scrollOnLoadMore: true,
|
|
175
|
+
loadMoreButtonProps: {
|
|
176
|
+
textAlign: 'center',
|
|
177
|
+
icon: 'Loader5Line',
|
|
178
|
+
},
|
|
179
|
+
loadMoreLabel: 'Scroll to load 20 more',
|
|
180
|
+
pagingOptions: {
|
|
181
|
+
infinite: true,
|
|
182
|
+
itemsPerPage: 20,
|
|
183
|
+
} as IReqorePagingOptions<any>,
|
|
184
|
+
};
|
|
@@ -267,6 +267,56 @@ const Template: Story<IReqoreTagGroup & IReqoreTagProps> = ({ columns, ...args }
|
|
|
267
267
|
},
|
|
268
268
|
]}
|
|
269
269
|
/>
|
|
270
|
+
<ReqoreTag
|
|
271
|
+
{...args}
|
|
272
|
+
labelKey='Fixed'
|
|
273
|
+
fixed='key'
|
|
274
|
+
label='Wrapped tag with some long text and NO width specified, AND wrap specified, with fixed key'
|
|
275
|
+
icon='DriveLine'
|
|
276
|
+
rightIcon={args.rightIcon}
|
|
277
|
+
wrap
|
|
278
|
+
onRemoveClick={null}
|
|
279
|
+
actions={[
|
|
280
|
+
{
|
|
281
|
+
icon: '24HoursFill',
|
|
282
|
+
onClick: noop,
|
|
283
|
+
disabled: true,
|
|
284
|
+
intent: 'info',
|
|
285
|
+
tooltip: { content: 'I am a tooltip' },
|
|
286
|
+
},
|
|
287
|
+
{
|
|
288
|
+
icon: 'SpyFill',
|
|
289
|
+
onClick: noop,
|
|
290
|
+
intent: 'success',
|
|
291
|
+
tooltip: { content: 'Hm, another tooltip', openOnMount: true },
|
|
292
|
+
},
|
|
293
|
+
]}
|
|
294
|
+
/>
|
|
295
|
+
<ReqoreTag
|
|
296
|
+
{...args}
|
|
297
|
+
labelKey='Wrapped tag with some long text and NO width specified, AND wrap specified, with fixed label, Wrapped tag with some long text and NO width specified, AND wrap specified, with fixed label'
|
|
298
|
+
fixed='label'
|
|
299
|
+
label='Fixed'
|
|
300
|
+
icon='DriveLine'
|
|
301
|
+
rightIcon={args.rightIcon}
|
|
302
|
+
wrap
|
|
303
|
+
onRemoveClick={null}
|
|
304
|
+
actions={[
|
|
305
|
+
{
|
|
306
|
+
icon: '24HoursFill',
|
|
307
|
+
onClick: noop,
|
|
308
|
+
disabled: true,
|
|
309
|
+
intent: 'info',
|
|
310
|
+
tooltip: { content: 'I am a tooltip' },
|
|
311
|
+
},
|
|
312
|
+
{
|
|
313
|
+
icon: 'SpyFill',
|
|
314
|
+
onClick: noop,
|
|
315
|
+
intent: 'success',
|
|
316
|
+
tooltip: { content: 'Hm, another tooltip', openOnMount: true },
|
|
317
|
+
},
|
|
318
|
+
]}
|
|
319
|
+
/>
|
|
270
320
|
</ReqoreTagGroup>
|
|
271
321
|
);
|
|
272
322
|
};
|