@qoretechnologies/reqore 0.36.5 → 0.36.7
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__/control_group.test.tsx +0 -1
- package/dist/components/Button/index.d.ts +2 -1
- package/dist/components/Button/index.d.ts.map +1 -1
- package/dist/components/Button/index.js +4 -1
- package/dist/components/Button/index.js.map +1 -1
- package/dist/components/ControlGroup/index.d.ts +2 -1
- package/dist/components/ControlGroup/index.d.ts.map +1 -1
- package/dist/components/ControlGroup/index.js +29 -14
- package/dist/components/ControlGroup/index.js.map +1 -1
- package/dist/components/Input/index.d.ts +2 -3
- package/dist/components/Input/index.d.ts.map +1 -1
- package/dist/components/Input/index.js.map +1 -1
- package/dist/components/Panel/index.d.ts +1 -0
- package/dist/components/Panel/index.d.ts.map +1 -1
- package/dist/components/Panel/index.js +10 -9
- package/dist/components/Panel/index.js.map +1 -1
- package/dist/components/Table/body.d.ts +2 -2
- package/dist/components/Table/body.d.ts.map +1 -1
- package/dist/components/Table/body.js +1 -1
- package/dist/components/Table/body.js.map +1 -1
- package/dist/components/Table/cell.d.ts +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 +3 -3
- package/dist/components/Table/header.d.ts.map +1 -1
- package/dist/components/Table/header.js +3 -3
- package/dist/components/Table/header.js.map +1 -1
- package/dist/components/Table/headerCell.d.ts +3 -3
- package/dist/components/Table/headerCell.d.ts.map +1 -1
- package/dist/components/Table/headerCell.js +5 -6
- package/dist/components/Table/headerCell.js.map +1 -1
- package/dist/components/Table/index.d.ts +3 -2
- package/dist/components/Table/index.d.ts.map +1 -1
- package/dist/components/Table/index.js.map +1 -1
- package/dist/components/Table/row.d.ts +1 -1
- package/dist/components/Table/row.d.ts.map +1 -1
- package/dist/components/Table/row.js +3 -3
- package/dist/components/Table/row.js.map +1 -1
- package/dist/components/Table/value.d.ts +2 -1
- package/dist/components/Table/value.d.ts.map +1 -1
- package/dist/components/Table/value.js +3 -3
- package/dist/components/Table/value.js.map +1 -1
- package/dist/helpers/utils.d.ts +2 -0
- package/dist/helpers/utils.d.ts.map +1 -1
- package/dist/helpers/utils.js +25 -1
- package/dist/helpers/utils.js.map +1 -1
- package/dist/hooks/usePopover.d.ts +1 -0
- package/dist/hooks/usePopover.d.ts.map +1 -1
- package/dist/hooks/usePopover.js +1 -1
- package/dist/hooks/usePopover.js.map +1 -1
- package/dist/hooks/useTooltip.d.ts.map +1 -1
- package/dist/hooks/useTooltip.js +3 -2
- package/dist/hooks/useTooltip.js.map +1 -1
- package/package.json +2 -1
- package/src/components/Button/index.tsx +3 -1
- package/src/components/ControlGroup/index.tsx +54 -24
- package/src/components/Input/index.tsx +4 -2
- package/src/components/Panel/index.tsx +10 -5
- package/src/components/Table/body.tsx +2 -2
- package/src/components/Table/cell.tsx +9 -7
- package/src/components/Table/header.tsx +11 -14
- package/src/components/Table/headerCell.tsx +151 -144
- package/src/components/Table/index.tsx +4 -2
- package/src/components/Table/row.tsx +193 -173
- package/src/components/Table/value.tsx +3 -2
- package/src/helpers/utils.ts +22 -0
- package/src/hooks/usePopover.tsx +2 -1
- package/src/hooks/useTooltip.ts +7 -3
- package/src/stories/ControlGroup/ControlGroup.stories.tsx +1 -1
- package/src/stories/Panel/Panel.stories.tsx +26 -0
- package/src/stories/Table/Table.stories.tsx +23 -1
- package/tests.json +1 -1
- package/src/stories/Table/Tests.stories.tsx +0 -9
|
@@ -26,6 +26,7 @@ export interface IPopover extends IReqoreIntent, IWithReqoreMinimal, IWithReqore
|
|
|
26
26
|
maxHeight?: string;
|
|
27
27
|
icon?: IReqoreIconName;
|
|
28
28
|
title?: string;
|
|
29
|
+
updater?: string | number;
|
|
29
30
|
}
|
|
30
31
|
export interface IPopoverOptions extends IPopover {
|
|
31
32
|
targetElement?: HTMLElement;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":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C;CAC3B;AAED,MAAM,WAAW,eAAgB,SAAQ,QAAQ;IAC/C,aAAa,CAAC,EAAE,WAAW,CAAC;IAC5B,eAAe,CAAC,EAAE,CAAC,IAAI,EAAE,gBAAgB,KAAK,IAAI,CAAC;CACpD;AAED,QAAA,MAAM,UAAU,oIAYb,eAAe,KAAG,gBAsIpB,CAAC;AAEF,eAAe,UAAU,CAAC"}
|
package/dist/hooks/usePopover.js
CHANGED
|
@@ -99,7 +99,7 @@ var usePopover = function (_a) {
|
|
|
99
99
|
if (openOnMount && targetElement) {
|
|
100
100
|
_addPopover();
|
|
101
101
|
}
|
|
102
|
-
}, [targetElement === null || targetElement === void 0 ? void 0 : targetElement.
|
|
102
|
+
}, [targetElement === null || targetElement === void 0 ? void 0 : targetElement.outerHTML]);
|
|
103
103
|
(0, react_1.useEffect)(function () {
|
|
104
104
|
if (targetElement && content) {
|
|
105
105
|
targetElement.addEventListener(startEvent, _addPopover);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"usePopover.js","sourceRoot":"","sources":["../../src/hooks/usePopover.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAqE;AACrE,uCAAwD;AACxD,oDAA8B;AAC9B,6DAAkD;AAClD,wBAAuC;AAEvC,6EAAuD;AASvD,IAAM,WAAW,GAAG;IAClB,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,YAAY;IACvB,KAAK,EAAE,OAAO;IACd,KAAK,EAAE,SAAS;CACjB,CAAC;AAEF,IAAM,SAAS,GAAG;IAChB,KAAK,EAAE,YAAY;IACnB,SAAS,EAAE,IAAI;IACf,KAAK,EAAE,IAAI;IACX,KAAK,EAAE,IAAI;CACZ,CAAC;
|
|
1
|
+
{"version":3,"file":"usePopover.js","sourceRoot":"","sources":["../../src/hooks/usePopover.tsx"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;AACA,+BAAqE;AACrE,uCAAwD;AACxD,oDAA8B;AAC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3D,IAAI,QAAQ,EAAE;oBACZ,aAAa,CAAC,mBAAmB,CAAC,QAAQ,EAAE,cAAc,CAAC,CAAC;iBAC7D;gBAED,IAAI,OAAO,KAAK,WAAW,EAAE;oBAC3B,aAAa,CAAC,mBAAmB,CAAC,YAAY,EAAE,aAAa,CAAC,CAAC;iBAChE;aACF;QACH,CAAC,CAAC;IACJ,CAAC,EAAE,CAAC,aAAa,aAAb,aAAa,uBAAb,aAAa,CAAE,QAAQ,EAAE,EAAE,OAAO,EAAE,OAAO,EAAE,cAAc,CAAC,CAAC,CAAC;IAElE,IAAA,sBAAU,EAAC;QACT,aAAa,EAAE,CAAC;IAClB,CAAC,CAAC,CAAC;IAEH,OAAO;QACL,EAAE,EAAE,OAAO;QACX,IAAI,EAAE;YACJ,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE;gBAC3B,WAAW,EAAE,CAAC;aACf;QACH,CAAC;QACD,KAAK,EAAE,cAAM,OAAA,cAAc,EAAE,EAAhB,CAAgB;QAC7B,MAAM,EAAE,cAAM,OAAA,aAAa,CAAC,OAAO,CAAC,EAAtB,CAAsB;KACrC,CAAC;AACJ,CAAC,CAAC;AAEF,qBAAe,UAAU,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/hooks/useTooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrE,eAAO,MAAM,UAAU,kBACN,WAAW,GAAG,SAAS,YAC5B,kBAAkB,KAC3B,
|
|
1
|
+
{"version":3,"file":"useTooltip.d.ts","sourceRoot":"","sources":["../../src/hooks/useTooltip.ts"],"names":[],"mappings":"AACA,OAAO,EAAkB,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAGrE,eAAO,MAAM,UAAU,kBACN,WAAW,GAAG,SAAS,YAC5B,kBAAkB,KAC3B,IAsBF,CAAC"}
|
package/dist/hooks/useTooltip.js
CHANGED
|
@@ -20,12 +20,13 @@ var usePopover_1 = __importDefault(require("./usePopover"));
|
|
|
20
20
|
var useTooltip = function (targetElement, tooltip) {
|
|
21
21
|
var _a = (0, react_1.useState)(undefined), element = _a[0], setElement = _a[1];
|
|
22
22
|
var _b = (0, react_1.useState)(undefined), data = _b[0], setData = _b[1];
|
|
23
|
+
var content = (0, react_1.useMemo)(function () { return (typeof tooltip === 'object' ? tooltip === null || tooltip === void 0 ? void 0 : tooltip.content : tooltip); }, [tooltip]);
|
|
23
24
|
(0, react_1.useEffect)(function () {
|
|
24
|
-
if (targetElement &&
|
|
25
|
+
if (targetElement && content) {
|
|
25
26
|
setElement(targetElement);
|
|
26
27
|
setData(tooltip);
|
|
27
28
|
}
|
|
28
|
-
}, [targetElement
|
|
29
|
+
}, [targetElement, content]);
|
|
29
30
|
var popoverData = typeof data === 'string' ? { content: data } : data;
|
|
30
31
|
(0, usePopover_1["default"])(__assign(__assign({}, popoverData), { targetElement: element, show: !!(popoverData === null || popoverData === void 0 ? void 0 : popoverData.content) }));
|
|
31
32
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useTooltip.js","sourceRoot":"","sources":["../../src/hooks/useTooltip.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+
|
|
1
|
+
{"version":3,"file":"useTooltip.js","sourceRoot":"","sources":["../../src/hooks/useTooltip.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,+BAAqD;AAErD,4DAAsC;AAE/B,IAAM,UAAU,GAAG,UACxB,aAAsC,EACtC,OAA4B;IAEtB,IAAA,KAAwB,IAAA,gBAAQ,EAA0B,SAAS,CAAC,EAAnE,OAAO,QAAA,EAAE,UAAU,QAAgD,CAAC;IACrE,IAAA,KAAkB,IAAA,gBAAQ,EAAsC,SAAS,CAAC,EAAzE,IAAI,QAAA,EAAE,OAAO,QAA4D,CAAC;IACjF,IAAM,OAAO,GAAG,IAAA,eAAO,EACrB,cAAM,OAAA,CAAC,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,EAA1D,CAA0D,EAChE,CAAC,OAAO,CAAC,CACV,CAAC;IAEF,IAAA,iBAAS,EAAC;QACR,IAAI,aAAa,IAAI,OAAO,EAAE;YAC5B,UAAU,CAAC,aAAa,CAAC,CAAC;YAC1B,OAAO,CAAC,OAAO,CAAC,CAAC;SAClB;IACH,CAAC,EAAE,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC,CAAC;IAE7B,IAAM,WAAW,GAAG,OAAO,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC;IAExE,IAAA,uBAAU,wBACL,WAAW,KACd,aAAa,EAAE,OAAO,EACtB,IAAI,EAAE,CAAC,CAAC,CAAA,WAAW,aAAX,WAAW,uBAAX,WAAW,CAAE,OAAO,CAAA,IAC5B,CAAC;AACL,CAAC,CAAC;AAzBW,QAAA,UAAU,cAyBrB"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@qoretechnologies/reqore",
|
|
3
|
-
"version": "0.36.
|
|
3
|
+
"version": "0.36.7",
|
|
4
4
|
"description": "ReQore is a highly theme-able and modular UI library for React",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -96,6 +96,7 @@
|
|
|
96
96
|
"@react-spring/web": "^9.6.1",
|
|
97
97
|
"classnames": "^2.2.6",
|
|
98
98
|
"epoch-timeago": "^1.1.9",
|
|
99
|
+
"fast-json-stable-stringify": "^2.1.0",
|
|
99
100
|
"lodash": "^4.17.21",
|
|
100
101
|
"polished": "^4.2.2",
|
|
101
102
|
"re-resizable": "^6.9.0",
|
|
@@ -79,7 +79,8 @@ export interface IReqoreButtonProps
|
|
|
79
79
|
descriptionEffect?: IReqoreEffect;
|
|
80
80
|
label?: React.HTMLAttributes<HTMLButtonElement>['children'];
|
|
81
81
|
as?: string | React.ElementType;
|
|
82
|
-
grow?: 1 | 2 | 3 | 4;
|
|
82
|
+
grow?: 0 | 1 | 2 | 3 | 4;
|
|
83
|
+
shrink?: 0 | 1 | 2 | 3 | 4;
|
|
83
84
|
rounded?: boolean;
|
|
84
85
|
}
|
|
85
86
|
|
|
@@ -132,6 +133,7 @@ export const StyledButton = styled(StyledEffect)<IReqoreButtonStyle>`
|
|
|
132
133
|
: null}
|
|
133
134
|
|
|
134
135
|
flex: ${({ fluid, fixed }) => (fixed ? '0 0 auto' : fluid ? '1 auto' : '0 0 auto')};
|
|
136
|
+
flex-shrink: ${({ shrink }) => shrink};
|
|
135
137
|
flex-grow: ${({ grow }) => grow};
|
|
136
138
|
align-self: ${({ fixed, fluid }) => (fixed ? 'flex-start' : fluid ? 'stretch' : undefined)};
|
|
137
139
|
|
|
@@ -45,6 +45,7 @@ export interface IReqoreControlGroupProps
|
|
|
45
45
|
isLastInFirstGroup?: boolean;
|
|
46
46
|
isLastInLastGroup?: boolean;
|
|
47
47
|
isFirstInLastGroup?: boolean;
|
|
48
|
+
isMasterGroupRounded?: boolean;
|
|
48
49
|
childrenCount?: number;
|
|
49
50
|
childId?: number;
|
|
50
51
|
isChild?: boolean;
|
|
@@ -131,6 +132,7 @@ const ReqoreControlGroup = memo(
|
|
|
131
132
|
stack,
|
|
132
133
|
isInsideStackGroup,
|
|
133
134
|
isInsideVerticalGroup,
|
|
135
|
+
isMasterGroupRounded,
|
|
134
136
|
intent,
|
|
135
137
|
customTheme,
|
|
136
138
|
isFirst,
|
|
@@ -246,7 +248,14 @@ const ReqoreControlGroup = memo(
|
|
|
246
248
|
: isLastGroup && (isLast || isLast !== false) && index === realChildCount - 1;
|
|
247
249
|
};
|
|
248
250
|
|
|
249
|
-
const getBorderTopLeftRadius = (
|
|
251
|
+
const getBorderTopLeftRadius = (
|
|
252
|
+
index: number,
|
|
253
|
+
isChildRounded?: boolean
|
|
254
|
+
): number | undefined => {
|
|
255
|
+
if (isMasterGroupRounded === false || isChildRounded === false) {
|
|
256
|
+
return undefined;
|
|
257
|
+
}
|
|
258
|
+
|
|
250
259
|
const _isFirstGroup =
|
|
251
260
|
!isInsideStackGroup || childrenCount === 1 ? true : isChild ? isFirstGroup : index === 0;
|
|
252
261
|
|
|
@@ -258,7 +267,14 @@ const ReqoreControlGroup = memo(
|
|
|
258
267
|
return undefined;
|
|
259
268
|
};
|
|
260
269
|
|
|
261
|
-
const getBorderTopRightRadius = (
|
|
270
|
+
const getBorderTopRightRadius = (
|
|
271
|
+
index: number,
|
|
272
|
+
isChildRounded?: boolean
|
|
273
|
+
): number | undefined => {
|
|
274
|
+
if (isMasterGroupRounded === false || isChildRounded === false) {
|
|
275
|
+
return undefined;
|
|
276
|
+
}
|
|
277
|
+
|
|
262
278
|
// If this group is not vertical we need to style the very last item
|
|
263
279
|
if (!isVertical || !isStack) {
|
|
264
280
|
const _isLastGroup =
|
|
@@ -284,7 +300,14 @@ const ReqoreControlGroup = memo(
|
|
|
284
300
|
return undefined;
|
|
285
301
|
};
|
|
286
302
|
|
|
287
|
-
const getBorderBottomLeftRadius = (
|
|
303
|
+
const getBorderBottomLeftRadius = (
|
|
304
|
+
index: number,
|
|
305
|
+
isChildRounded?: boolean
|
|
306
|
+
): number | undefined => {
|
|
307
|
+
if (isMasterGroupRounded === false || isChildRounded === false) {
|
|
308
|
+
return undefined;
|
|
309
|
+
}
|
|
310
|
+
|
|
288
311
|
// If this group is not vertical we need to style the very first item
|
|
289
312
|
if (!isVertical || !isStack) {
|
|
290
313
|
const _isFirstGroup =
|
|
@@ -306,7 +329,14 @@ const ReqoreControlGroup = memo(
|
|
|
306
329
|
return undefined;
|
|
307
330
|
};
|
|
308
331
|
|
|
309
|
-
const getBorderBottomRightRadius = (
|
|
332
|
+
const getBorderBottomRightRadius = (
|
|
333
|
+
index: number,
|
|
334
|
+
isChildRounded?: boolean
|
|
335
|
+
): number | undefined => {
|
|
336
|
+
if (isMasterGroupRounded === false || isChildRounded === false) {
|
|
337
|
+
return undefined;
|
|
338
|
+
}
|
|
339
|
+
|
|
310
340
|
const _isLastGroup =
|
|
311
341
|
!isInsideStackGroup || childrenCount === 1
|
|
312
342
|
? true
|
|
@@ -334,7 +364,7 @@ const ReqoreControlGroup = memo(
|
|
|
334
364
|
|
|
335
365
|
let newProps = {
|
|
336
366
|
...child.props,
|
|
337
|
-
key: child.props.reactKey ||
|
|
367
|
+
key: child.props.reactKey || _index,
|
|
338
368
|
minimal:
|
|
339
369
|
child.props?.minimal || child.props?.minimal === false
|
|
340
370
|
? child.props.minimal
|
|
@@ -354,18 +384,20 @@ const ReqoreControlGroup = memo(
|
|
|
354
384
|
newProps = {
|
|
355
385
|
...newProps,
|
|
356
386
|
style: {
|
|
357
|
-
borderTopLeftRadius:
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
borderTopRightRadius:
|
|
362
|
-
child.props?.rounded === false ? undefined : getBorderTopRightRadius(index),
|
|
363
|
-
borderBottomRightRadius:
|
|
364
|
-
child.props?.rounded === false ? undefined : getBorderBottomRightRadius(index),
|
|
387
|
+
borderTopLeftRadius: getBorderTopLeftRadius(index, child.props?.rounded),
|
|
388
|
+
borderBottomLeftRadius: getBorderBottomLeftRadius(index, child.props?.rounded),
|
|
389
|
+
borderTopRightRadius: getBorderTopRightRadius(index, child.props?.rounded),
|
|
390
|
+
borderBottomRightRadius: getBorderBottomRightRadius(index, child.props?.rounded),
|
|
365
391
|
...(child.props?.style || {}),
|
|
366
392
|
},
|
|
367
393
|
isChild: true,
|
|
368
|
-
rounded:
|
|
394
|
+
rounded:
|
|
395
|
+
isMasterGroupRounded === false
|
|
396
|
+
? false
|
|
397
|
+
: child.props?.rounded || child.props?.rounded === false
|
|
398
|
+
? child.props.rounded
|
|
399
|
+
: !isStack,
|
|
400
|
+
isMasterGroupRounded: isChild ? isMasterGroupRounded : rounded,
|
|
369
401
|
isInsideStackGroup: isStack,
|
|
370
402
|
isInsideVerticalGroup: isVertical,
|
|
371
403
|
isFirst: isChild ? getIsFirst(index) : undefined,
|
|
@@ -410,6 +442,7 @@ const ReqoreControlGroup = memo(
|
|
|
410
442
|
minimal,
|
|
411
443
|
size,
|
|
412
444
|
intent,
|
|
445
|
+
rounded,
|
|
413
446
|
]
|
|
414
447
|
);
|
|
415
448
|
|
|
@@ -431,13 +464,14 @@ const ReqoreControlGroup = memo(
|
|
|
431
464
|
icon='MenuLine'
|
|
432
465
|
customTheme={customTheme}
|
|
433
466
|
tooltip={{
|
|
434
|
-
|
|
467
|
+
handler: 'click',
|
|
468
|
+
content: (
|
|
469
|
+
<ReqoreControlGroup fluid wrap>
|
|
470
|
+
{overflownChildren}
|
|
471
|
+
</ReqoreControlGroup>
|
|
472
|
+
),
|
|
435
473
|
}}
|
|
436
474
|
active={isOverflownDialogOpen}
|
|
437
|
-
onClick={(e: React.MouseEvent<HTMLButtonElement>) => {
|
|
438
|
-
e.stopPropagation();
|
|
439
|
-
setIsOverflownDialogOpen(!isOverflownDialogOpen);
|
|
440
|
-
}}
|
|
441
475
|
flat
|
|
442
476
|
fixed
|
|
443
477
|
/>,
|
|
@@ -460,11 +494,7 @@ const ReqoreControlGroup = memo(
|
|
|
460
494
|
label='Hidden items'
|
|
461
495
|
minSize='100px'
|
|
462
496
|
size='auto'
|
|
463
|
-
>
|
|
464
|
-
<ReqoreControlGroup fluid wrap>
|
|
465
|
-
{overflownChildren}
|
|
466
|
-
</ReqoreControlGroup>
|
|
467
|
-
</ReqoreDrawer>
|
|
497
|
+
></ReqoreDrawer>
|
|
468
498
|
) : null}
|
|
469
499
|
<StyledReqoreControlGroup
|
|
470
500
|
as='div'
|
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
IReqoreReadOnly,
|
|
23
23
|
IWithReqoreCustomTheme,
|
|
24
24
|
IWithReqoreEffect,
|
|
25
|
+
IWithReqoreTooltip,
|
|
25
26
|
} from '../../types/global';
|
|
26
27
|
import { IReqoreIconName } from '../../types/icons';
|
|
27
28
|
import { StyledEffect, TReqoreEffectColor } from '../Effect';
|
|
@@ -34,9 +35,10 @@ export interface IReqoreInputProps
|
|
|
34
35
|
IReqoreReadOnly,
|
|
35
36
|
IReqoreIntent,
|
|
36
37
|
IWithReqoreCustomTheme,
|
|
37
|
-
IWithReqoreEffect
|
|
38
|
+
IWithReqoreEffect,
|
|
39
|
+
IWithReqoreTooltip {
|
|
38
40
|
autoFocus?: boolean;
|
|
39
|
-
|
|
41
|
+
|
|
40
42
|
width?: number;
|
|
41
43
|
size?: TSizes;
|
|
42
44
|
minimal?: boolean;
|
|
@@ -98,8 +98,11 @@ export interface IReqorePanelProps
|
|
|
98
98
|
closeButtonProps?: IReqoreButtonProps;
|
|
99
99
|
|
|
100
100
|
rounded?: boolean;
|
|
101
|
+
|
|
101
102
|
actions?: TReqorePanelActions;
|
|
102
103
|
bottomActions?: TReqorePanelBottomActions;
|
|
104
|
+
showActionsWhenCollapsed?: boolean;
|
|
105
|
+
|
|
103
106
|
unMountContentOnCollapse?: boolean;
|
|
104
107
|
onCollapseChange?: (isCollapsed?: boolean) => void;
|
|
105
108
|
fill?: boolean;
|
|
@@ -353,6 +356,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
353
356
|
headerProps = {},
|
|
354
357
|
disabled,
|
|
355
358
|
breadcrumbs,
|
|
359
|
+
showActionsWhenCollapsed = true,
|
|
356
360
|
...rest
|
|
357
361
|
}: IReqorePanelProps,
|
|
358
362
|
ref
|
|
@@ -436,21 +440,21 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
436
440
|
(action: IReqorePanelAction, index: number) => {
|
|
437
441
|
return renderActions(action, index, true, align);
|
|
438
442
|
},
|
|
439
|
-
[actions]
|
|
443
|
+
[actions, showActionsWhenCollapsed, _isCollapsed]
|
|
440
444
|
);
|
|
441
445
|
|
|
442
446
|
const hasNonResponsiveActions = useCallback(
|
|
443
447
|
(data: TReqorePanelActions) =>
|
|
444
448
|
(!responsiveActions && size(data)) ||
|
|
445
449
|
data.some((action) => action.responsive === false && action.show !== false),
|
|
446
|
-
[actions, bottomActions, responsiveActions]
|
|
450
|
+
[actions, bottomActions, responsiveActions, showActionsWhenCollapsed, _isCollapsed]
|
|
447
451
|
);
|
|
448
452
|
|
|
449
453
|
const hasResponsiveActions = useCallback(
|
|
450
454
|
(data: TReqorePanelActions) =>
|
|
451
455
|
responsiveActions &&
|
|
452
456
|
data.some((action) => action.responsive !== false && action.show !== false),
|
|
453
|
-
[actions, bottomActions, responsiveActions]
|
|
457
|
+
[actions, bottomActions, responsiveActions, showActionsWhenCollapsed, _isCollapsed]
|
|
454
458
|
);
|
|
455
459
|
|
|
456
460
|
const renderNonResponsiveActions = useCallback(
|
|
@@ -458,7 +462,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
458
462
|
(action: IReqorePanelAction, index: number) => {
|
|
459
463
|
return renderActions(action, index, false, align);
|
|
460
464
|
},
|
|
461
|
-
[actions, bottomActions, responsiveActions]
|
|
465
|
+
[actions, bottomActions, responsiveActions, showActionsWhenCollapsed, _isCollapsed]
|
|
462
466
|
);
|
|
463
467
|
|
|
464
468
|
const renderActions = useCallback(
|
|
@@ -470,6 +474,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
470
474
|
) => {
|
|
471
475
|
if (
|
|
472
476
|
action.show === false ||
|
|
477
|
+
(showActionsWhenCollapsed === false && _isCollapsed === true) ||
|
|
473
478
|
(includeResponsive && action.responsive === false) ||
|
|
474
479
|
(!includeResponsive &&
|
|
475
480
|
responsiveActions &&
|
|
@@ -569,7 +574,7 @@ export const ReqorePanel = forwardRef<HTMLDivElement, IReqorePanelProps>(
|
|
|
569
574
|
</ReqoreButton>
|
|
570
575
|
);
|
|
571
576
|
},
|
|
572
|
-
[actions, theme]
|
|
577
|
+
[actions, theme, showActionsWhenCollapsed, _isCollapsed]
|
|
573
578
|
);
|
|
574
579
|
|
|
575
580
|
const interactive: boolean = !!(
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import count from 'lodash/size';
|
|
2
|
-
import { forwardRef, useMemo } from 'react';
|
|
2
|
+
import { forwardRef, memo, useMemo } from 'react';
|
|
3
3
|
import { useMount } from 'react-use';
|
|
4
4
|
import { FixedSizeList as List } from 'react-window';
|
|
5
5
|
import styled from 'styled-components';
|
|
@@ -106,4 +106,4 @@ const ReqoreTableBody = forwardRef<HTMLDivElement, IReqoreTableSectionBodyProps>
|
|
|
106
106
|
}
|
|
107
107
|
);
|
|
108
108
|
|
|
109
|
-
export default ReqoreTableBody;
|
|
109
|
+
export default memo(ReqoreTableBody);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { lighten, rgba } from 'polished';
|
|
2
|
-
import { forwardRef } from 'react';
|
|
2
|
+
import { forwardRef, memo } from 'react';
|
|
3
3
|
import styled, { css } from 'styled-components';
|
|
4
4
|
import { IReqoreTableColumn } from '.';
|
|
5
5
|
import { TEXT_FROM_SIZE } from '../../constants/sizes';
|
|
@@ -123,12 +123,14 @@ export const StyledTableCell = styled.div<IReqoreTableCellStyle>`
|
|
|
123
123
|
}}
|
|
124
124
|
`;
|
|
125
125
|
|
|
126
|
-
export const ReqoreTableBodyCell =
|
|
127
|
-
|
|
128
|
-
|
|
126
|
+
export const ReqoreTableBodyCell = memo(
|
|
127
|
+
forwardRef<HTMLButtonElement, IReqoreTableBodyCellProps>(
|
|
128
|
+
(props: IReqoreTableBodyCellProps, ref) => {
|
|
129
|
+
const { targetRef } = useCombinedRefs(ref);
|
|
129
130
|
|
|
130
|
-
|
|
131
|
+
useTooltip(targetRef.current, props.tooltip);
|
|
131
132
|
|
|
132
|
-
|
|
133
|
-
|
|
133
|
+
return <StyledTableCell {...props} ref={targetRef} />;
|
|
134
|
+
}
|
|
135
|
+
)
|
|
134
136
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { omit } from 'lodash';
|
|
2
|
-
import { forwardRef, useCallback } from 'react';
|
|
2
|
+
import { forwardRef, memo, useCallback } from 'react';
|
|
3
3
|
import { useMount } from 'react-use';
|
|
4
4
|
import styled, { css } from 'styled-components';
|
|
5
5
|
import { IReqoreTableColumn, IReqoreTableSort } from '.';
|
|
@@ -25,7 +25,7 @@ export interface IReqoreCustomHeaderCellProps
|
|
|
25
25
|
'sortData' | 'onSortChange' | 'onColumnsUpdate' | 'onFilterChange'
|
|
26
26
|
>,
|
|
27
27
|
Omit<IReqoreTableColumn, 'cell' | 'header'>,
|
|
28
|
-
Omit<IReqoreButtonProps, 'maxWidth'> {
|
|
28
|
+
Omit<IReqoreButtonProps, 'maxWidth' | 'content'> {
|
|
29
29
|
hasColumns?: boolean;
|
|
30
30
|
}
|
|
31
31
|
export interface IReqoreCustomHeaderCellComponent extends React.FC<IReqoreCustomHeaderCellProps> {}
|
|
@@ -165,20 +165,17 @@ const ReqoreTableHeader = forwardRef<HTMLDivElement, IReqoreTableSectionProps>(
|
|
|
165
165
|
|
|
166
166
|
const renderColumns = (columns: IReqoreTableColumn[]) =>
|
|
167
167
|
getOnlyShownColumns(columns).map(
|
|
168
|
-
(
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
},
|
|
176
|
-
index
|
|
177
|
-
) =>
|
|
168
|
+
({
|
|
169
|
+
grow,
|
|
170
|
+
align,
|
|
171
|
+
dataId,
|
|
172
|
+
header: { columns, onClick, component: headerComponent, ...rest },
|
|
173
|
+
...colRest
|
|
174
|
+
}) =>
|
|
178
175
|
columns ? (
|
|
179
176
|
<StyledColumnGroup
|
|
180
177
|
grow={getOnlyShownColumns(columns).reduce((gr, col) => gr + col.grow, 0)}
|
|
181
|
-
key={
|
|
178
|
+
key={dataId}
|
|
182
179
|
className='reqore-table-column-group'
|
|
183
180
|
width={getOnlyShownColumns(columns).reduce(
|
|
184
181
|
(wid, col) => wid + (col.resizedWidth || col.width || 80),
|
|
@@ -236,4 +233,4 @@ const ReqoreTableHeader = forwardRef<HTMLDivElement, IReqoreTableSectionProps>(
|
|
|
236
233
|
}
|
|
237
234
|
);
|
|
238
235
|
|
|
239
|
-
export default ReqoreTableHeader;
|
|
236
|
+
export default memo(ReqoreTableHeader);
|