plataforma-fundacao-componentes 2.22.10 → 2.22.15
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/assets/icons/FilterIcon.d.ts +3 -0
- package/dist/components/checkbox/Checkbox.d.ts +3 -2
- package/dist/components/dropdownItem/DropdownItem.d.ts +2 -2
- package/dist/components/dropdownMenu/DropdownMenu.d.ts +1 -1
- package/dist/components/dropdownMenu/DropdownMenu.stories.d.ts +8 -6
- package/dist/components/table/components/TableUpperHeader/TableUpperHeader.d.ts +13 -5
- package/dist/components/tableWithOverflow/TableWithOverflow.d.ts +1 -5
- package/dist/components/tableWithOverflow/TableWithOverflow.stories.d.ts +1 -0
- package/dist/hooks/useDraggableScroll/useDraggableScroll.d.ts +3 -1
- package/dist/index.css +20 -16
- package/dist/index.js +144 -96
- package/dist/index.js.map +1 -1
- package/dist/index.modern.js +144 -96
- package/dist/index.modern.js.map +1 -1
- package/dist/utils/ArrayUtils.d.ts +17 -0
- package/package.json +11 -8
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
import React from 'react';
|
|
2
2
|
import { CheckboxThemes } from '../../libraries/CheckboxThemes';
|
|
3
3
|
import { TooltipPosition } from '../../libraries/Tooltips';
|
|
4
4
|
import './Checkbox.scss';
|
|
@@ -7,8 +7,9 @@ export interface CheckboxProps {
|
|
|
7
7
|
'tooltip-text'?: string;
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
value?: boolean;
|
|
10
|
-
onChange?: (value: boolean) => void;
|
|
10
|
+
onChange?: (value: boolean, evt: React.MouseEvent<HTMLElement>) => void;
|
|
11
11
|
theme?: CheckboxThemes;
|
|
12
|
+
tag?: 'button' | 'div';
|
|
12
13
|
}
|
|
13
14
|
declare function Checkbox(props: CheckboxProps): JSX.Element;
|
|
14
15
|
declare namespace Checkbox {
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
import DropdownMenu from './DropdownMenu';
|
|
3
|
+
declare const _default: {
|
|
4
|
+
title: string;
|
|
5
|
+
component: typeof DropdownMenu;
|
|
6
|
+
};
|
|
5
7
|
export default _default;
|
|
6
|
-
export
|
|
7
|
-
|
|
8
|
+
export declare const Example: () => JSX.Element;
|
|
9
|
+
export declare const Oversized: () => JSX.Element;
|
|
@@ -1,17 +1,25 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { ReactNode } from 'react';
|
|
2
|
+
import { DropdownMenuProps } from '../../../dropdownMenu/DropdownMenu';
|
|
2
3
|
import './TableUpperHeader.scss';
|
|
3
|
-
|
|
4
|
+
interface upperHeaderButtonType {
|
|
5
|
+
type: 'Button';
|
|
4
6
|
id?: string;
|
|
5
7
|
onClick?: () => void;
|
|
6
8
|
label?: string;
|
|
7
9
|
leftIcon?: JSX.Element | React.ReactNode;
|
|
8
10
|
rightIcon?: JSX.Element | React.ReactNode;
|
|
9
11
|
disabled?: boolean;
|
|
10
|
-
}
|
|
12
|
+
}
|
|
13
|
+
export interface upperHeaderDropdownMenuType extends DropdownMenuProps {
|
|
14
|
+
type: 'DropdownMenu';
|
|
15
|
+
children: upperHeaderButtonType;
|
|
16
|
+
}
|
|
11
17
|
export interface TableUpperHeaderProps {
|
|
12
18
|
active?: boolean;
|
|
13
|
-
leftContent?: upperHeaderButtonType[];
|
|
14
|
-
rightContent?: upperHeaderButtonType[];
|
|
19
|
+
leftContent?: (upperHeaderButtonType | upperHeaderDropdownMenuType)[];
|
|
20
|
+
rightContent?: (upperHeaderButtonType | upperHeaderDropdownMenuType)[];
|
|
21
|
+
opened?: boolean;
|
|
22
|
+
collapsedContent?: ReactNode;
|
|
15
23
|
}
|
|
16
24
|
declare function TableUpperHeader(props: TableUpperHeaderProps): JSX.Element;
|
|
17
25
|
declare const _default: React.MemoExoticComponent<typeof TableUpperHeader>;
|
|
@@ -4,7 +4,7 @@ import './TableWithOverflow.scss';
|
|
|
4
4
|
interface TableCell extends React.HTMLAttributes<HTMLTableCellElement> {
|
|
5
5
|
align?: 'left' | 'center' | 'right' | 'justify' | 'char';
|
|
6
6
|
}
|
|
7
|
-
declare type ColumnObject = {
|
|
7
|
+
export declare type ColumnObject = {
|
|
8
8
|
key: string;
|
|
9
9
|
props?: TableCell;
|
|
10
10
|
value: any;
|
|
@@ -16,8 +16,6 @@ declare type ColumnObject = {
|
|
|
16
16
|
};
|
|
17
17
|
interface TableWithOverflowProps {
|
|
18
18
|
upperHeader?: TableUpperHeaderProps;
|
|
19
|
-
showArrowControl?: boolean;
|
|
20
|
-
hasActionsCol?: boolean;
|
|
21
19
|
showTopNavigator?: boolean;
|
|
22
20
|
columns: ColumnObject[];
|
|
23
21
|
lines?: any[];
|
|
@@ -25,8 +23,6 @@ interface TableWithOverflowProps {
|
|
|
25
23
|
declare function TableWithOverflow(props: TableWithOverflowProps): JSX.Element;
|
|
26
24
|
declare namespace TableWithOverflow {
|
|
27
25
|
var defaultProps: {
|
|
28
|
-
showArrowControl: boolean;
|
|
29
|
-
hasActionsCol: boolean;
|
|
30
26
|
showTopNavigator: boolean;
|
|
31
27
|
};
|
|
32
28
|
}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
export default function useDraggableScroll<T extends HTMLElement>(reference: React.RefObject<T
|
|
2
|
+
export default function useDraggableScroll<T extends HTMLElement>(reference: React.RefObject<T>, options?: {
|
|
3
|
+
mouseDownCondition: (target: HTMLElement) => boolean;
|
|
4
|
+
}): void;
|
package/dist/index.css
CHANGED
|
@@ -3861,12 +3861,12 @@ h5 {
|
|
|
3861
3861
|
justify-content: center;
|
|
3862
3862
|
align-items: center;
|
|
3863
3863
|
transition: background-color 0.3s ease, opacity 0.3s ease; }
|
|
3864
|
-
.component-checkbox:not(:disabled) {
|
|
3864
|
+
.component-checkbox:not(:disabled), .component-checkbox:not(.component-checkbox[aria-disabled='true']) {
|
|
3865
3865
|
cursor: pointer; }
|
|
3866
3866
|
.component-checkbox:focus {
|
|
3867
3867
|
outline: none; }
|
|
3868
3868
|
|
|
3869
|
-
.component-checkbox-primary:disabled {
|
|
3869
|
+
.component-checkbox-primary:disabled, .component-checkbox-primary[aria-disabled='true'] {
|
|
3870
3870
|
opacity: 0.6; }
|
|
3871
3871
|
|
|
3872
3872
|
.component-checkbox-primary.component-checkbox-not {
|
|
@@ -3875,7 +3875,7 @@ h5 {
|
|
|
3875
3875
|
.component-checkbox-primary.component-checkbox-checked {
|
|
3876
3876
|
background-color: #3fa110; }
|
|
3877
3877
|
|
|
3878
|
-
.component-checkbox-dark:disabled {
|
|
3878
|
+
.component-checkbox-dark:disabled, .component-checkbox-dark[aria-disabled='true'] {
|
|
3879
3879
|
opacity: 0.6; }
|
|
3880
3880
|
|
|
3881
3881
|
.component-checkbox-dark.component-checkbox-not {
|
|
@@ -3884,7 +3884,7 @@ h5 {
|
|
|
3884
3884
|
.component-checkbox-dark.component-checkbox-checked {
|
|
3885
3885
|
background-color: #323c32; }
|
|
3886
3886
|
|
|
3887
|
-
.component-checkbox-blue:disabled {
|
|
3887
|
+
.component-checkbox-blue:disabled, .component-checkbox-blue[aria-disabled='true'] {
|
|
3888
3888
|
opacity: 0.6; }
|
|
3889
3889
|
|
|
3890
3890
|
.component-checkbox-blue.component-checkbox-not {
|
|
@@ -3904,9 +3904,9 @@ h5 {
|
|
|
3904
3904
|
height: 10px;
|
|
3905
3905
|
background-color: rgba(0, 0, 0, 0);
|
|
3906
3906
|
transition: background-color 0.3s ease; }
|
|
3907
|
-
.component-checkbox-classic:disabled {
|
|
3907
|
+
.component-checkbox-classic:disabled, .component-checkbox-classic[aria-disabled='true'] {
|
|
3908
3908
|
border-color: #828a82; }
|
|
3909
|
-
.component-checkbox-classic:disabled.component-checkbox-checked::after {
|
|
3909
|
+
.component-checkbox-classic:disabled.component-checkbox-checked::after, .component-checkbox-classic[aria-disabled='true'].component-checkbox-checked::after {
|
|
3910
3910
|
background-color: #828a82; }
|
|
3911
3911
|
.component-checkbox-classic.component-checkbox-checked::after {
|
|
3912
3912
|
background-color: #3fa110; }
|
|
@@ -7876,7 +7876,9 @@ h5 {
|
|
|
7876
7876
|
background-color: #fefefe;
|
|
7877
7877
|
position: fixed;
|
|
7878
7878
|
border-radius: 8px;
|
|
7879
|
-
box-shadow: 0 1px 2px 0 rgba(90, 100, 90, 0.3);
|
|
7879
|
+
box-shadow: 0 1px 2px 0 rgba(90, 100, 90, 0.3);
|
|
7880
|
+
overflow: overlay;
|
|
7881
|
+
max-height: calc(49% - 46px); }
|
|
7880
7882
|
|
|
7881
7883
|
.component-dropdown-menu-panel-fade-enter {
|
|
7882
7884
|
transition: transform 0.3s ease, opacity 0.3s ease;
|
|
@@ -15238,7 +15240,7 @@ h5 {
|
|
|
15238
15240
|
.component-upper-header-table {
|
|
15239
15241
|
width: 100%;
|
|
15240
15242
|
border-radius: 8px 8px 0 0;
|
|
15241
|
-
padding: 0
|
|
15243
|
+
padding: 0;
|
|
15242
15244
|
display: flex;
|
|
15243
15245
|
align-items: center;
|
|
15244
15246
|
justify-content: space-between;
|
|
@@ -15248,7 +15250,7 @@ h5 {
|
|
|
15248
15250
|
background-color: #cdd3cd;
|
|
15249
15251
|
color: #828a82;
|
|
15250
15252
|
border-color: #828a82; }
|
|
15251
|
-
.component-upper-header-table
|
|
15253
|
+
.component-upper-header-table .component-upper-header-table-btn {
|
|
15252
15254
|
font-size: 16px;
|
|
15253
15255
|
color: #828a82;
|
|
15254
15256
|
border-color: #828a82;
|
|
@@ -15261,32 +15263,34 @@ h5 {
|
|
|
15261
15263
|
align-items: center;
|
|
15262
15264
|
justify-content: flex-start;
|
|
15263
15265
|
background-color: rgba(0, 0, 0, 0); }
|
|
15264
|
-
.component-upper-header-table
|
|
15266
|
+
.component-upper-header-table .component-upper-header-table-btn:not(:disabled) {
|
|
15265
15267
|
cursor: pointer; }
|
|
15266
|
-
.component-upper-header-table
|
|
15268
|
+
.component-upper-header-table .component-upper-header-table-btn:not(:disabled):active {
|
|
15267
15269
|
transform: scale(0.95, 0.9); }
|
|
15268
|
-
.component-upper-header-table
|
|
15270
|
+
.component-upper-header-table .component-upper-header-table-btn span {
|
|
15269
15271
|
display: flex;
|
|
15270
15272
|
align-items: center;
|
|
15271
15273
|
justify-content: center; }
|
|
15272
|
-
.component-upper-header-table
|
|
15274
|
+
.component-upper-header-table .component-upper-header-table-btn span:first-child {
|
|
15273
15275
|
padding-right: 8px; }
|
|
15274
|
-
.component-upper-header-table
|
|
15276
|
+
.component-upper-header-table .component-upper-header-table-btn span:last-child {
|
|
15275
15277
|
padding-left: 8px; }
|
|
15276
|
-
.component-upper-header-table
|
|
15278
|
+
.component-upper-header-table .component-upper-header-table-btn span svg {
|
|
15277
15279
|
max-width: 20px !important;
|
|
15278
15280
|
max-height: 20px !important; }
|
|
15279
15281
|
.component-upper-header-table.active {
|
|
15280
15282
|
background-color: #d7e6c8;
|
|
15281
15283
|
color: #3fa110;
|
|
15282
15284
|
border-color: #3fa110; }
|
|
15283
|
-
.component-upper-header-table.active
|
|
15285
|
+
.component-upper-header-table.active .component-upper-header-table-btn:not(:disabled) {
|
|
15284
15286
|
background-color: #d7e6c8;
|
|
15285
15287
|
color: #3fa110; }
|
|
15286
15288
|
.component-upper-header-table .component-upper-header-table-left {
|
|
15289
|
+
padding-left: 8px;
|
|
15287
15290
|
display: flex;
|
|
15288
15291
|
flex-wrap: wrap; }
|
|
15289
15292
|
.component-upper-header-table .component-upper-header-table-right {
|
|
15293
|
+
padding-right: 8px;
|
|
15290
15294
|
display: flex;
|
|
15291
15295
|
flex-wrap: wrap; }
|
|
15292
15296
|
|
package/dist/index.js
CHANGED
|
@@ -1336,26 +1336,32 @@ var TrashIcon = function TrashIcon() {
|
|
|
1336
1336
|
|
|
1337
1337
|
var rootClassName$s = 'component-checkbox';
|
|
1338
1338
|
function Checkbox(props) {
|
|
1339
|
-
var
|
|
1340
|
-
|
|
1341
|
-
props.onChange
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1339
|
+
var fProps = React.useMemo(function () {
|
|
1340
|
+
var handleClick = function handleClick(evt) {
|
|
1341
|
+
if (typeof props.onChange === 'function' && !props.disabled) {
|
|
1342
|
+
props.onChange(!props.value, evt);
|
|
1343
|
+
evt.stopPropagation();
|
|
1344
|
+
}
|
|
1345
|
+
};
|
|
1345
1346
|
|
|
1346
|
-
var getProps = function getProps() {
|
|
1347
1347
|
var p = _extends({}, props, {
|
|
1348
1348
|
className: getMergedClassNames([rootClassName$s, rootClassName$s + "-" + props.theme, rootClassName$s + "-" + (props.value ? 'checked' : 'not')]),
|
|
1349
|
+
'aria-disabled': props.disabled || props['aria-disabled'],
|
|
1349
1350
|
onClick: handleClick
|
|
1350
1351
|
});
|
|
1351
1352
|
|
|
1352
1353
|
delete p.value;
|
|
1354
|
+
delete p.tag;
|
|
1353
1355
|
delete p.onChange;
|
|
1354
1356
|
delete p.theme;
|
|
1355
1357
|
return p;
|
|
1356
|
-
};
|
|
1358
|
+
}, [props]);
|
|
1359
|
+
|
|
1360
|
+
if (props.tag === 'div') {
|
|
1361
|
+
return React__default.createElement("div", Object.assign({}, fProps));
|
|
1362
|
+
}
|
|
1357
1363
|
|
|
1358
|
-
return React__default.createElement("button", Object.assign({},
|
|
1364
|
+
return React__default.createElement("button", Object.assign({}, fProps));
|
|
1359
1365
|
}
|
|
1360
1366
|
Checkbox.defaultProps = {
|
|
1361
1367
|
disabled: false,
|
|
@@ -4396,6 +4402,7 @@ function DropdownItem(props) {
|
|
|
4396
4402
|
return React__default.createElement("button", {
|
|
4397
4403
|
id: props.id,
|
|
4398
4404
|
disabled: props.disabled,
|
|
4405
|
+
"aria-disabled": props.disabled,
|
|
4399
4406
|
className: getMergedClassNames([rootClassName$R, props.alignRight ? 'align-right' : '']),
|
|
4400
4407
|
onClick: function onClick(evt) {
|
|
4401
4408
|
if (typeof props.onClick === 'function' && !props.disabled) {
|
|
@@ -4444,19 +4451,19 @@ function DropdownMenu(props) {
|
|
|
4444
4451
|
var windowWidth = window.innerWidth;
|
|
4445
4452
|
|
|
4446
4453
|
if (pontoCentralX < windowWidth / 2) {
|
|
4454
|
+
painel.style.left = bound.x + "px";
|
|
4455
|
+
|
|
4447
4456
|
if (pontoCentralY < windowHeight / 2) {
|
|
4448
|
-
painel.style.left = bound.x + "px";
|
|
4449
4457
|
painel.style.top = bound.y + bound.height + "px";
|
|
4450
4458
|
} else {
|
|
4451
|
-
painel.style.left = bound.x + "px";
|
|
4452
4459
|
painel.style.top = bound.y - painel.getBoundingClientRect().height + "px";
|
|
4453
4460
|
}
|
|
4454
4461
|
} else {
|
|
4462
|
+
painel.style.right = windowWidth - bound.x - bound.width + "px";
|
|
4463
|
+
|
|
4455
4464
|
if (pontoCentralY < windowHeight / 2) {
|
|
4456
|
-
painel.style.right = windowWidth - bound.x - bound.width + "px";
|
|
4457
4465
|
painel.style.top = bound.y + bound.height + "px";
|
|
4458
4466
|
} else {
|
|
4459
|
-
painel.style.right = windowWidth - bound.x - bound.width + "px";
|
|
4460
4467
|
painel.style.top = bound.y - painel.getBoundingClientRect().height + "px";
|
|
4461
4468
|
}
|
|
4462
4469
|
}
|
|
@@ -4486,7 +4493,7 @@ function DropdownMenu(props) {
|
|
|
4486
4493
|
var deveFechar = true;
|
|
4487
4494
|
|
|
4488
4495
|
while (aux && aux.id !== 'root') {
|
|
4489
|
-
if (aux && aux.id && aux.id === id && aux.classList.contains(
|
|
4496
|
+
if (aux && aux.id && aux.id === id && aux.classList.contains(rootClassName$S)) {
|
|
4490
4497
|
deveFechar = false;
|
|
4491
4498
|
break;
|
|
4492
4499
|
}
|
|
@@ -4550,7 +4557,7 @@ function DropdownMenu(props) {
|
|
|
4550
4557
|
classNames: rootClassName$S + "-panel-fade",
|
|
4551
4558
|
unmountOnExit: true
|
|
4552
4559
|
}, React__default.createElement("div", {
|
|
4553
|
-
className: rootClassName$S + "-panel"
|
|
4560
|
+
className: rootClassName$S + "-panel scroll-white"
|
|
4554
4561
|
}, props.content)));
|
|
4555
4562
|
}
|
|
4556
4563
|
DropdownMenu.defaultProps = {
|
|
@@ -9573,7 +9580,7 @@ var LeftCheckboxWithLabel = function LeftCheckboxWithLabel(props) {
|
|
|
9573
9580
|
var _props$spanProps3;
|
|
9574
9581
|
|
|
9575
9582
|
if (props.anchorLabelToCheckbox) {
|
|
9576
|
-
props.onChange(!props.value);
|
|
9583
|
+
props.onChange(!props.value, evt);
|
|
9577
9584
|
}
|
|
9578
9585
|
|
|
9579
9586
|
if (props.spanProps && typeof props.spanProps.onClick === 'function') (_props$spanProps3 = props.spanProps) === null || _props$spanProps3 === void 0 ? void 0 : _props$spanProps3.onClick(evt);
|
|
@@ -9757,7 +9764,7 @@ var CircleArrowLeft = function CircleArrowLeft() {
|
|
|
9757
9764
|
}))));
|
|
9758
9765
|
};
|
|
9759
9766
|
|
|
9760
|
-
function useDraggableScroll(reference) {
|
|
9767
|
+
function useDraggableScroll(reference, options) {
|
|
9761
9768
|
React.useEffect(function () {
|
|
9762
9769
|
var element = reference.current;
|
|
9763
9770
|
var pos = {
|
|
@@ -9767,6 +9774,10 @@ function useDraggableScroll(reference) {
|
|
|
9767
9774
|
var moving = false;
|
|
9768
9775
|
|
|
9769
9776
|
var mouseDownHandler = function mouseDownHandler(evt) {
|
|
9777
|
+
if (options && typeof options.mouseDownCondition === 'function' && !options.mouseDownCondition(evt.target)) {
|
|
9778
|
+
return;
|
|
9779
|
+
}
|
|
9780
|
+
|
|
9770
9781
|
if (evt.button === 0 && (element === null || element === void 0 ? void 0 : element.scrollWidth) > (element === null || element === void 0 ? void 0 : element.clientWidth)) {
|
|
9771
9782
|
moving = true;
|
|
9772
9783
|
pos = {
|
|
@@ -9799,6 +9810,58 @@ function useDraggableScroll(reference) {
|
|
|
9799
9810
|
}, [reference]);
|
|
9800
9811
|
}
|
|
9801
9812
|
|
|
9813
|
+
var ScreenSize;
|
|
9814
|
+
|
|
9815
|
+
(function (ScreenSize) {
|
|
9816
|
+
ScreenSize["xs"] = "xs";
|
|
9817
|
+
ScreenSize["sm"] = "sm";
|
|
9818
|
+
ScreenSize["md"] = "md";
|
|
9819
|
+
ScreenSize["lg"] = "lg";
|
|
9820
|
+
ScreenSize["xl"] = "xl";
|
|
9821
|
+
})(ScreenSize || (ScreenSize = {}));
|
|
9822
|
+
|
|
9823
|
+
function useScreenSize() {
|
|
9824
|
+
var _useState = React.useState(),
|
|
9825
|
+
value = _useState[0],
|
|
9826
|
+
setValue = _useState[1];
|
|
9827
|
+
|
|
9828
|
+
var valueRef = React.useRef(value);
|
|
9829
|
+
valueRef.current = value;
|
|
9830
|
+
|
|
9831
|
+
var f = function f() {
|
|
9832
|
+
if (window.innerWidth <= 575.98) {
|
|
9833
|
+
if (valueRef.current !== ScreenSize.xs) {
|
|
9834
|
+
setValue(ScreenSize.xs);
|
|
9835
|
+
}
|
|
9836
|
+
} else if (window.innerWidth <= 767.98) {
|
|
9837
|
+
if (valueRef.current !== ScreenSize.sm) {
|
|
9838
|
+
setValue(ScreenSize.sm);
|
|
9839
|
+
}
|
|
9840
|
+
} else if (window.innerWidth <= 991.98) {
|
|
9841
|
+
if (valueRef.current !== ScreenSize.md) {
|
|
9842
|
+
setValue(ScreenSize.md);
|
|
9843
|
+
}
|
|
9844
|
+
} else if (window.innerWidth <= 1199.98) {
|
|
9845
|
+
if (valueRef.current !== ScreenSize.lg) {
|
|
9846
|
+
setValue(ScreenSize.lg);
|
|
9847
|
+
}
|
|
9848
|
+
} else if (window.innerWidth > 1199.98) {
|
|
9849
|
+
if (valueRef.current !== ScreenSize.xl) {
|
|
9850
|
+
setValue(ScreenSize.xl);
|
|
9851
|
+
}
|
|
9852
|
+
}
|
|
9853
|
+
};
|
|
9854
|
+
|
|
9855
|
+
React.useLayoutEffect(function () {
|
|
9856
|
+
f();
|
|
9857
|
+
window.addEventListener('resize', f);
|
|
9858
|
+
return function () {
|
|
9859
|
+
window.removeEventListener('resize', f);
|
|
9860
|
+
};
|
|
9861
|
+
}, []);
|
|
9862
|
+
return value;
|
|
9863
|
+
}
|
|
9864
|
+
|
|
9802
9865
|
var rootClassName$1A = 'component-upper-header-table';
|
|
9803
9866
|
|
|
9804
9867
|
function TableUpperHeader(props) {
|
|
@@ -9809,20 +9872,47 @@ function TableUpperHeader(props) {
|
|
|
9809
9872
|
}, React__default.createElement("div", {
|
|
9810
9873
|
className: rootClassName$1A + "-left"
|
|
9811
9874
|
}, (_props$leftContent = props.leftContent) === null || _props$leftContent === void 0 ? void 0 : _props$leftContent.map(function (btn, i) {
|
|
9812
|
-
return React__default.createElement("button",
|
|
9875
|
+
return btn.type === 'Button' ? React__default.createElement("button", {
|
|
9876
|
+
key: i,
|
|
9877
|
+
id: btn.id,
|
|
9878
|
+
onClick: btn.onClick,
|
|
9879
|
+
disabled: !props.active || (btn === null || btn === void 0 ? void 0 : btn.disabled) || false,
|
|
9880
|
+
className: rootClassName$1A + "-btn",
|
|
9881
|
+
type: 'button'
|
|
9882
|
+
}, btn.leftIcon && React__default.createElement("span", null, btn.leftIcon), btn.label, btn.rightIcon && React__default.createElement("span", null, btn.rightIcon)) : React__default.createElement(DropdownMenu, Object.assign({}, btn, {
|
|
9813
9883
|
key: i
|
|
9814
|
-
},
|
|
9815
|
-
|
|
9816
|
-
|
|
9884
|
+
}), React__default.createElement("button", {
|
|
9885
|
+
key: i,
|
|
9886
|
+
id: btn.children.id,
|
|
9887
|
+
onClick: btn.children.onClick,
|
|
9888
|
+
className: rootClassName$1A + "-btn",
|
|
9889
|
+
disabled: !props.active || (btn === null || btn === void 0 ? void 0 : btn.children.disabled) || false,
|
|
9890
|
+
type: 'button'
|
|
9891
|
+
}, btn.children.leftIcon && React__default.createElement("span", null, btn.children.leftIcon), btn.children.label, btn.children.rightIcon && React__default.createElement("span", null, btn.children.rightIcon)));
|
|
9817
9892
|
})), React__default.createElement("div", {
|
|
9818
9893
|
className: rootClassName$1A + "-right"
|
|
9819
9894
|
}, (_props$rightContent = props.rightContent) === null || _props$rightContent === void 0 ? void 0 : _props$rightContent.map(function (btn, i) {
|
|
9820
|
-
return React__default.createElement("button",
|
|
9821
|
-
key: i
|
|
9822
|
-
|
|
9823
|
-
|
|
9824
|
-
|
|
9825
|
-
|
|
9895
|
+
return btn.type === 'Button' ? React__default.createElement("button", {
|
|
9896
|
+
key: i,
|
|
9897
|
+
id: btn.id,
|
|
9898
|
+
onClick: btn.onClick,
|
|
9899
|
+
disabled: !props.active || (btn === null || btn === void 0 ? void 0 : btn.disabled) || false,
|
|
9900
|
+
className: rootClassName$1A + "-btn",
|
|
9901
|
+
type: 'button'
|
|
9902
|
+
}, btn.leftIcon && React__default.createElement("span", null, btn.leftIcon), btn.label, btn.rightIcon && React__default.createElement("span", null, btn.rightIcon)) : React__default.createElement(DropdownMenu, Object.assign({}, btn, {
|
|
9903
|
+
key: "children_" + i
|
|
9904
|
+
}), React__default.createElement("button", {
|
|
9905
|
+
key: i,
|
|
9906
|
+
id: btn.children.id,
|
|
9907
|
+
onClick: btn.children.onClick,
|
|
9908
|
+
disabled: !props.active || (btn === null || btn === void 0 ? void 0 : btn.children.disabled) || false,
|
|
9909
|
+
className: rootClassName$1A + "-btn",
|
|
9910
|
+
type: 'button'
|
|
9911
|
+
}, btn.children.leftIcon && React__default.createElement("span", null, btn.children.leftIcon), btn.children.label, btn.children.rightIcon && React__default.createElement("span", null, btn.children.rightIcon)));
|
|
9912
|
+
})), props.collapsedContent ? React__default.createElement(Collapse$1, {
|
|
9913
|
+
opened: props.opened,
|
|
9914
|
+
animateOpacity: true
|
|
9915
|
+
}, props.collapsedContent) : undefined);
|
|
9826
9916
|
}
|
|
9827
9917
|
|
|
9828
9918
|
var TableUpperHeader$1 = React.memo(TableUpperHeader);
|
|
@@ -9832,11 +9922,16 @@ var rootClassName$1B = 'component-table-with-overflow';
|
|
|
9832
9922
|
function TableWithOverflow(props) {
|
|
9833
9923
|
var _props$columns, _props$lines;
|
|
9834
9924
|
|
|
9925
|
+
var mediaQuery = useScreenSize();
|
|
9835
9926
|
var wrapperClassName = React.useMemo(function () {
|
|
9836
|
-
return getMergedClassNames([rootClassName$1B + "-wrapper", props.
|
|
9837
|
-
}, [props.
|
|
9927
|
+
return getMergedClassNames([rootClassName$1B + "-wrapper", props.upperHeader ? 'has-upper-header' : '', 'left-columns-padding']);
|
|
9928
|
+
}, [props.upperHeader]);
|
|
9838
9929
|
var outerTableRef = React.createRef();
|
|
9839
|
-
useDraggableScroll(outerTableRef
|
|
9930
|
+
useDraggableScroll(outerTableRef, {
|
|
9931
|
+
mouseDownCondition: function mouseDownCondition(el) {
|
|
9932
|
+
return ['xl', 'lg', 'md'].includes(mediaQuery) && el.hasAttribute('data-draggable') && el.getAttribute('data-draggable') === 'true';
|
|
9933
|
+
}
|
|
9934
|
+
});
|
|
9840
9935
|
|
|
9841
9936
|
var handleArrowClick = function handleArrowClick(toAdd) {
|
|
9842
9937
|
if (toAdd === void 0) {
|
|
@@ -9855,22 +9950,27 @@ function TableWithOverflow(props) {
|
|
|
9855
9950
|
}
|
|
9856
9951
|
};
|
|
9857
9952
|
|
|
9953
|
+
var atLeastOneStaticColumn = React.useMemo(function () {
|
|
9954
|
+
return props.columns.some(function (c) {
|
|
9955
|
+
return !c.absolute;
|
|
9956
|
+
});
|
|
9957
|
+
}, [props.columns]);
|
|
9858
9958
|
var paddingLeft = React.useMemo(function () {
|
|
9859
|
-
return props.columns.reduce(function (prev, atual) {
|
|
9959
|
+
return atLeastOneStaticColumn ? props.columns.reduce(function (prev, atual) {
|
|
9860
9960
|
var _atual$absolute;
|
|
9861
9961
|
|
|
9862
9962
|
var n = (_atual$absolute = atual.absolute) !== null && _atual$absolute !== void 0 && _atual$absolute.left ? parseInt(atual.absolute.width) : 0;
|
|
9863
9963
|
return prev + n;
|
|
9864
|
-
}, 8) + "px";
|
|
9865
|
-
}, [props.columns]);
|
|
9964
|
+
}, 8) + "px" : '8px';
|
|
9965
|
+
}, [props.columns, atLeastOneStaticColumn]);
|
|
9866
9966
|
var paddingRight = React.useMemo(function () {
|
|
9867
|
-
return props.columns.reduce(function (prev, atual) {
|
|
9967
|
+
return atLeastOneStaticColumn ? props.columns.reduce(function (prev, atual) {
|
|
9868
9968
|
var _atual$absolute2;
|
|
9869
9969
|
|
|
9870
9970
|
var n = (_atual$absolute2 = atual.absolute) !== null && _atual$absolute2 !== void 0 && _atual$absolute2.right ? parseInt(atual.absolute.width) : 0;
|
|
9871
9971
|
return prev + n;
|
|
9872
|
-
}, 8) + "px";
|
|
9873
|
-
}, [props.columns]);
|
|
9972
|
+
}, 8) + "px" : '8px';
|
|
9973
|
+
}, [props.columns, atLeastOneStaticColumn]);
|
|
9874
9974
|
return React__default.createElement("div", {
|
|
9875
9975
|
className: rootClassName$1B
|
|
9876
9976
|
}, props.upperHeader ? React__default.createElement("div", {
|
|
@@ -9901,12 +10001,13 @@ function TableWithOverflow(props) {
|
|
|
9901
10001
|
}), (_props$columns = props.columns) === null || _props$columns === void 0 ? void 0 : _props$columns.map(function (column) {
|
|
9902
10002
|
var _column$props;
|
|
9903
10003
|
|
|
10004
|
+
var absoluteObj = atLeastOneStaticColumn && column.absolute ? column.absolute : {};
|
|
9904
10005
|
return React__default.createElement("th", Object.assign({
|
|
9905
10006
|
key: "header-" + column.key,
|
|
9906
|
-
"data-draggable": !Boolean(
|
|
10007
|
+
"data-draggable": atLeastOneStaticColumn && !Boolean(absoluteObj)
|
|
9907
10008
|
}, column.props, {
|
|
9908
|
-
style: _extends({}, (_column$props = column.props) === null || _column$props === void 0 ? void 0 : _column$props.style,
|
|
9909
|
-
className: getMergedClassNames([column.key + "-cell", column.absolute ? 'absolute' : ''])
|
|
10009
|
+
style: _extends({}, (_column$props = column.props) === null || _column$props === void 0 ? void 0 : _column$props.style, absoluteObj),
|
|
10010
|
+
className: getMergedClassNames([column.key + "-cell", atLeastOneStaticColumn && column.absolute ? 'absolute' : ''])
|
|
9910
10011
|
}), column.value);
|
|
9911
10012
|
}), React__default.createElement("th", {
|
|
9912
10013
|
className: 'absolute right-0'
|
|
@@ -9922,12 +10023,13 @@ function TableWithOverflow(props) {
|
|
|
9922
10023
|
}), (_props$columns2 = props.columns) === null || _props$columns2 === void 0 ? void 0 : _props$columns2.map(function (column) {
|
|
9923
10024
|
var _column$props2, _column$props3;
|
|
9924
10025
|
|
|
10026
|
+
var absoluteObj = atLeastOneStaticColumn && column.absolute ? column.absolute : {};
|
|
9925
10027
|
return React__default.createElement("td", Object.assign({
|
|
9926
|
-
"data-draggable": !Boolean(column.absolute),
|
|
10028
|
+
"data-draggable": atLeastOneStaticColumn && !Boolean(column.absolute),
|
|
9927
10029
|
key: lineIndex + "-" + column.key
|
|
9928
10030
|
}, column.props, {
|
|
9929
|
-
style: _extends({}, (_column$props2 = column.props) === null || _column$props2 === void 0 ? void 0 : _column$props2.style,
|
|
9930
|
-
className: getMergedClassNames([(_column$props3 = column.props) === null || _column$props3 === void 0 ? void 0 : _column$props3.className, column.key + "-cell", column.absolute ? 'absolute' : ''])
|
|
10031
|
+
style: _extends({}, (_column$props2 = column.props) === null || _column$props2 === void 0 ? void 0 : _column$props2.style, absoluteObj),
|
|
10032
|
+
className: getMergedClassNames([(_column$props3 = column.props) === null || _column$props3 === void 0 ? void 0 : _column$props3.className, column.key + "-cell", atLeastOneStaticColumn && column.absolute ? 'absolute' : ''])
|
|
9931
10033
|
}), line[column.key]);
|
|
9932
10034
|
}), React__default.createElement("td", {
|
|
9933
10035
|
className: 'absolute right-0'
|
|
@@ -9936,8 +10038,6 @@ function TableWithOverflow(props) {
|
|
|
9936
10038
|
}
|
|
9937
10039
|
|
|
9938
10040
|
TableWithOverflow.defaultProps = {
|
|
9939
|
-
showArrowControl: true,
|
|
9940
|
-
hasActionsCol: true,
|
|
9941
10041
|
showTopNavigator: true
|
|
9942
10042
|
};
|
|
9943
10043
|
var TableWithOverflow$1 = React.memo(TableWithOverflow);
|
|
@@ -11501,58 +11601,6 @@ function useModalManager() {
|
|
|
11501
11601
|
}))), openModal, closeModal];
|
|
11502
11602
|
}
|
|
11503
11603
|
|
|
11504
|
-
var ScreenSize;
|
|
11505
|
-
|
|
11506
|
-
(function (ScreenSize) {
|
|
11507
|
-
ScreenSize["xs"] = "xs";
|
|
11508
|
-
ScreenSize["sm"] = "sm";
|
|
11509
|
-
ScreenSize["md"] = "md";
|
|
11510
|
-
ScreenSize["lg"] = "lg";
|
|
11511
|
-
ScreenSize["xl"] = "xl";
|
|
11512
|
-
})(ScreenSize || (ScreenSize = {}));
|
|
11513
|
-
|
|
11514
|
-
function useScreenSize() {
|
|
11515
|
-
var _useState = React.useState(),
|
|
11516
|
-
value = _useState[0],
|
|
11517
|
-
setValue = _useState[1];
|
|
11518
|
-
|
|
11519
|
-
var valueRef = React.useRef(value);
|
|
11520
|
-
valueRef.current = value;
|
|
11521
|
-
|
|
11522
|
-
var f = function f() {
|
|
11523
|
-
if (window.innerWidth <= 575.98) {
|
|
11524
|
-
if (valueRef.current !== ScreenSize.xs) {
|
|
11525
|
-
setValue(ScreenSize.xs);
|
|
11526
|
-
}
|
|
11527
|
-
} else if (window.innerWidth <= 767.98) {
|
|
11528
|
-
if (valueRef.current !== ScreenSize.sm) {
|
|
11529
|
-
setValue(ScreenSize.sm);
|
|
11530
|
-
}
|
|
11531
|
-
} else if (window.innerWidth <= 991.98) {
|
|
11532
|
-
if (valueRef.current !== ScreenSize.md) {
|
|
11533
|
-
setValue(ScreenSize.md);
|
|
11534
|
-
}
|
|
11535
|
-
} else if (window.innerWidth <= 1199.98) {
|
|
11536
|
-
if (valueRef.current !== ScreenSize.lg) {
|
|
11537
|
-
setValue(ScreenSize.lg);
|
|
11538
|
-
}
|
|
11539
|
-
} else if (window.innerWidth > 1199.98) {
|
|
11540
|
-
if (valueRef.current !== ScreenSize.xl) {
|
|
11541
|
-
setValue(ScreenSize.xl);
|
|
11542
|
-
}
|
|
11543
|
-
}
|
|
11544
|
-
};
|
|
11545
|
-
|
|
11546
|
-
React.useLayoutEffect(function () {
|
|
11547
|
-
f();
|
|
11548
|
-
window.addEventListener('resize', f);
|
|
11549
|
-
return function () {
|
|
11550
|
-
window.removeEventListener('resize', f);
|
|
11551
|
-
};
|
|
11552
|
-
}, []);
|
|
11553
|
-
return value;
|
|
11554
|
-
}
|
|
11555
|
-
|
|
11556
11604
|
var rootClassName$22 = 'comp-toast-manager';
|
|
11557
11605
|
var count$1 = 0;
|
|
11558
11606
|
function useToastManager(props) {
|