@qoretechnologies/reqore 0.34.0 → 0.34.1
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/Collection/index.d.ts +4 -3
- package/dist/components/Collection/index.d.ts.map +1 -1
- package/dist/components/Collection/index.js +30 -13
- package/dist/components/Collection/index.js.map +1 -1
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +15 -8
- package/dist/components/Panel/index.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Collection/index.tsx +54 -26
- package/src/components/Panel/index.tsx +23 -15
- package/src/stories/Collection/Collection.stories.tsx +6 -4
- package/src/stories/Panel/Panel.stories.tsx +18 -1
- package/tests.json +1 -1
|
@@ -372,9 +372,10 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
372
372
|
);
|
|
373
373
|
|
|
374
374
|
const renderResponsiveActions = useCallback(
|
|
375
|
-
(
|
|
376
|
-
|
|
377
|
-
|
|
375
|
+
(align: 'flex-start' | 'center' | 'flex-end' = 'flex-end') =>
|
|
376
|
+
(action: IReqorePanelAction, index: number) => {
|
|
377
|
+
return renderActions(action, index, true, align);
|
|
378
|
+
},
|
|
378
379
|
[actions]
|
|
379
380
|
);
|
|
380
381
|
|
|
@@ -391,14 +392,20 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
391
392
|
);
|
|
392
393
|
|
|
393
394
|
const renderNonResponsiveActions = useCallback(
|
|
394
|
-
(
|
|
395
|
-
|
|
396
|
-
|
|
395
|
+
(align: 'flex-start' | 'center' | 'flex-end' = 'flex-end') =>
|
|
396
|
+
(action: IReqorePanelAction, index: number) => {
|
|
397
|
+
return renderActions(action, index, false, align);
|
|
398
|
+
},
|
|
397
399
|
[actions]
|
|
398
400
|
);
|
|
399
401
|
|
|
400
402
|
const renderActions = useCallback(
|
|
401
|
-
(
|
|
403
|
+
(
|
|
404
|
+
action: IReqorePanelAction,
|
|
405
|
+
index: number,
|
|
406
|
+
includeResponsive,
|
|
407
|
+
align: 'flex-start' | 'center' | 'flex-end' = 'flex-end'
|
|
408
|
+
) => {
|
|
402
409
|
if (
|
|
403
410
|
action.show === false ||
|
|
404
411
|
(includeResponsive && action.responsive === false) ||
|
|
@@ -429,6 +436,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
429
436
|
fixed={rest.fixed}
|
|
430
437
|
fluid={rest.fluid}
|
|
431
438
|
key={index}
|
|
439
|
+
horizontalAlign={align}
|
|
432
440
|
>
|
|
433
441
|
{group.map((action, index) => renderActions(action, index, true))}
|
|
434
442
|
</ReqoreControlGroup>
|
|
@@ -598,18 +606,18 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
598
606
|
customTheme={theme}
|
|
599
607
|
size={panelSize}
|
|
600
608
|
>
|
|
601
|
-
{actions.map(renderResponsiveActions)}
|
|
609
|
+
{actions.map(renderResponsiveActions())}
|
|
602
610
|
</ReqoreControlGroup>
|
|
603
611
|
)}
|
|
604
612
|
{collapsible || onClose || hasNonResponsiveActions(actions) ? (
|
|
605
613
|
<>
|
|
606
614
|
<ReqoreControlGroup
|
|
607
|
-
fixed={
|
|
608
|
-
fluid={isMobile}
|
|
615
|
+
fixed={isMobile ? false : hasResponsiveActions(actions)}
|
|
616
|
+
fluid={isMobile ? true : !hasResponsiveActions(actions)}
|
|
609
617
|
horizontalAlign='flex-end'
|
|
610
618
|
size={panelSize}
|
|
611
619
|
>
|
|
612
|
-
{actions.map(renderNonResponsiveActions)}
|
|
620
|
+
{actions.map(renderNonResponsiveActions())}
|
|
613
621
|
{collapsible && (
|
|
614
622
|
<ReqoreButton
|
|
615
623
|
customTheme={theme}
|
|
@@ -662,7 +670,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
662
670
|
>
|
|
663
671
|
{hasNonResponsiveActions(leftBottomActions) ? (
|
|
664
672
|
<ReqoreControlGroup size={panelSize}>
|
|
665
|
-
{leftBottomActions.map(renderNonResponsiveActions)}
|
|
673
|
+
{leftBottomActions.map(renderNonResponsiveActions('flex-start'))}
|
|
666
674
|
</ReqoreControlGroup>
|
|
667
675
|
) : null}
|
|
668
676
|
{hasResponsiveActions(leftBottomActions) && (
|
|
@@ -672,7 +680,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
672
680
|
customTheme={theme}
|
|
673
681
|
size={panelSize}
|
|
674
682
|
>
|
|
675
|
-
{leftBottomActions.map(renderResponsiveActions)}
|
|
683
|
+
{leftBottomActions.map(renderResponsiveActions('flex-start'))}
|
|
676
684
|
</ReqoreControlGroup>
|
|
677
685
|
)}
|
|
678
686
|
{hasResponsiveActions(rightBottomActions) && (
|
|
@@ -683,12 +691,12 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
683
691
|
customTheme={theme}
|
|
684
692
|
size={panelSize}
|
|
685
693
|
>
|
|
686
|
-
{rightBottomActions.map(renderResponsiveActions)}
|
|
694
|
+
{rightBottomActions.map(renderResponsiveActions())}
|
|
687
695
|
</ReqoreControlGroup>
|
|
688
696
|
)}
|
|
689
697
|
{hasNonResponsiveActions(rightBottomActions) ? (
|
|
690
698
|
<ReqoreControlGroup horizontalAlign='flex-end' size={panelSize}>
|
|
691
|
-
{rightBottomActions.map(renderNonResponsiveActions)}
|
|
699
|
+
{rightBottomActions.map(renderNonResponsiveActions())}
|
|
692
700
|
</ReqoreControlGroup>
|
|
693
701
|
) : null}
|
|
694
702
|
</StyledPanelBottomActions>
|
|
@@ -143,6 +143,7 @@ CustomPropsAndTexts.args = {
|
|
|
143
143
|
export const ChildrenBeforeAndAfter = Template.bind({});
|
|
144
144
|
ChildrenBeforeAndAfter.args = {
|
|
145
145
|
label: 'Collection of items',
|
|
146
|
+
padded: false,
|
|
146
147
|
items,
|
|
147
148
|
contentRenderer: (children) => (
|
|
148
149
|
<>
|
|
@@ -191,7 +192,6 @@ FilteringSearchingPaging.args = {
|
|
|
191
192
|
paging: 'buttons',
|
|
192
193
|
size: 'big',
|
|
193
194
|
padded: false,
|
|
194
|
-
fill: true,
|
|
195
195
|
items: bigCollection,
|
|
196
196
|
} as IReqoreCollectionProps;
|
|
197
197
|
|
|
@@ -205,11 +205,13 @@ CustomFilteringSearchingPaging.args = {
|
|
|
205
205
|
},
|
|
206
206
|
},
|
|
207
207
|
paging: {
|
|
208
|
-
itemsPerPage:
|
|
208
|
+
itemsPerPage: 55,
|
|
209
209
|
scrollToTopOnPageChange: true,
|
|
210
210
|
},
|
|
211
|
+
inputInTitle: false,
|
|
212
|
+
responsiveTitle: true,
|
|
211
213
|
size: 'small',
|
|
212
214
|
padded: false,
|
|
213
|
-
|
|
214
|
-
items: bigCollection,
|
|
215
|
+
fill: true,
|
|
216
|
+
items: [...bigCollection, ...bigCollection, ...bigCollection, ...bigCollection, ...bigCollection],
|
|
215
217
|
} as IReqoreCollectionProps;
|
|
@@ -3,7 +3,7 @@ import { noop } from 'lodash';
|
|
|
3
3
|
import ReqoreInput, { IReqoreInputProps } from '../../components/Input';
|
|
4
4
|
import { IReqorePanelAction, IReqorePanelProps, ReqorePanel } from '../../components/Panel';
|
|
5
5
|
import { ReqoreVerticalSpacer } from '../../components/Spacer';
|
|
6
|
-
import {
|
|
6
|
+
import { FlatArg, IconArg, IntentArg, SizeArg, argManager } from '../utils/args';
|
|
7
7
|
|
|
8
8
|
const { createArg } = argManager<IReqorePanelProps>();
|
|
9
9
|
|
|
@@ -356,6 +356,23 @@ NoActions.args = {
|
|
|
356
356
|
'This is a really long title that should stretch all the way to the right of the panel, all the way to the end and not end in the middle',
|
|
357
357
|
};
|
|
358
358
|
|
|
359
|
+
export const NoLabel: Story<IReqorePanelProps> = Template.bind({});
|
|
360
|
+
NoLabel.args = {
|
|
361
|
+
collapsible: false,
|
|
362
|
+
actions: [
|
|
363
|
+
{
|
|
364
|
+
responsive: false,
|
|
365
|
+
group: [
|
|
366
|
+
{ label: 'Stacked Action 1', icon: 'BallPenLine', intent: 'warning' },
|
|
367
|
+
{ icon: 'CopperCoinFill', intent: 'danger' },
|
|
368
|
+
],
|
|
369
|
+
},
|
|
370
|
+
],
|
|
371
|
+
label: undefined,
|
|
372
|
+
icon: undefined,
|
|
373
|
+
badge: undefined,
|
|
374
|
+
};
|
|
375
|
+
|
|
359
376
|
export const ImageAsIcon: Story<IReqorePanelProps> = Template.bind({});
|
|
360
377
|
ImageAsIcon.args = {
|
|
361
378
|
iconImage:
|