@tecsinapse/react-web-kit 3.4.21 → 3.5.1-beta.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/dist/cjs/components/atoms/Accordion/Accordion.js +36 -29
- package/dist/cjs/components/atoms/Badge/Badge.js +5 -5
- package/dist/cjs/components/atoms/Button/Button.js +5 -5
- package/dist/cjs/components/atoms/Dropdown/index.js +6 -5
- package/dist/cjs/components/atoms/Input/Input.js +34 -30
- package/dist/cjs/components/atoms/InputMask/InputMask.js +34 -30
- package/dist/cjs/components/atoms/Modal/Modal.js +17 -13
- package/dist/cjs/components/atoms/Overlay/Overlay.js +6 -5
- package/dist/cjs/components/atoms/Skeleton/Skeleton.js +12 -12
- package/dist/cjs/components/atoms/Switch/Switch.js +13 -12
- package/dist/cjs/components/atoms/Table/Body/TBody.js +2 -2
- package/dist/cjs/components/atoms/Table/Cell/Td.js +2 -2
- package/dist/cjs/components/atoms/Table/Container/TableContainer.js +2 -2
- package/dist/cjs/components/atoms/Table/Footer/TFoot.js +2 -2
- package/dist/cjs/components/atoms/Table/Header/THead.js +5 -2
- package/dist/cjs/components/atoms/Table/Header/Th.js +2 -2
- package/dist/cjs/components/atoms/Table/Row/Tr.js +2 -2
- package/dist/cjs/components/atoms/Table/Table.js +2 -2
- package/dist/cjs/components/atoms/Table/Toolbar/TableToolbar.js +8 -2
- package/dist/cjs/components/atoms/Tag/Tag.js +6 -6
- package/dist/cjs/components/atoms/Tooltip/Tooltip.js +21 -17
- package/dist/cjs/components/molecules/Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js +13 -10
- package/dist/cjs/components/molecules/Breadcrumbs/Breadcrumbs.js +6 -6
- package/dist/cjs/components/molecules/DatePicker/DatePicker.js +13 -12
- package/dist/cjs/components/molecules/DateTimePicker/DateTimePicker.js +4 -3
- package/dist/cjs/components/molecules/DateTimePickerSelector/DateTimePickerSelector.js +53 -64
- package/dist/cjs/components/molecules/DateTimePickerSelector/components/MemoizedTimeCard.js +6 -5
- package/dist/cjs/components/molecules/DateTimePickerSelector/components/ScrollableDigit.js +26 -22
- package/dist/cjs/components/molecules/Drawer/Drawer.js +16 -12
- package/dist/cjs/components/molecules/Grid/Grid.js +25 -24
- package/dist/cjs/components/molecules/Grid/Item/Item.js +2 -1
- package/dist/cjs/components/molecules/IconTextButton/IconTextButton.js +33 -31
- package/dist/cjs/components/molecules/IconTextButton/TextComponent.js +6 -5
- package/dist/cjs/components/molecules/InputPassword/InputPassword.js +13 -9
- package/dist/cjs/components/molecules/LabeledSwitch/LabelComponent.js +6 -5
- package/dist/cjs/components/molecules/LabeledSwitch/LabeledSwitch.js +36 -32
- package/dist/cjs/components/molecules/Masonry/Masonry.js +4 -3
- package/dist/cjs/components/molecules/Menubar/MenuBlock/MenuBlock.js +24 -17
- package/dist/cjs/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.js +23 -15
- package/dist/cjs/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js +6 -2
- package/dist/cjs/components/molecules/Menubar/Menubar.js +73 -58
- package/dist/cjs/components/molecules/Menubar/MostUsed/MostUsed.js +30 -23
- package/dist/cjs/components/molecules/Menubar/SearchResultItem/SearchResultItem.js +14 -11
- package/dist/cjs/components/molecules/Menubar/SearchResultItem/utils.js +2 -2
- package/dist/cjs/components/molecules/ScrollableMonthYearPicker/ScrollableMonthYearPicker.js +28 -24
- package/dist/cjs/components/molecules/ScrollableTimePicker/ScrollableTimePicker.js +31 -47
- package/dist/cjs/components/molecules/Select/Dropdown/Dropdown.js +50 -45
- package/dist/cjs/components/molecules/Select/Dropdown/components/SearchInput.js +3 -2
- package/dist/cjs/components/molecules/Select/Select.js +50 -45
- package/dist/cjs/components/molecules/Select/SelectItem/SelectItem.js +5 -1
- package/dist/cjs/components/molecules/Snackbar/Snackbar.js +2 -2
- package/dist/cjs/components/molecules/TextArea/TextArea.js +19 -19
- package/dist/cjs/components/organisms/DataGrid/DataGrid.js +55 -47
- package/dist/cjs/components/organisms/DataGrid/Footer/Footer.js +72 -57
- package/dist/cjs/components/organisms/DataGrid/Footer/styled.js +2 -1
- package/dist/cjs/components/organisms/DataGrid/Header/Header.js +28 -22
- package/dist/cjs/components/organisms/DataGrid/Header/styled.js +1 -1
- package/dist/cjs/components/organisms/DataGrid/Row/Row.js +11 -7
- package/dist/cjs/components/organisms/DataGrid/styled.js +1 -1
- package/dist/esm/components/atoms/Accordion/Accordion.js +36 -29
- package/dist/esm/components/atoms/Badge/Badge.js +5 -5
- package/dist/esm/components/atoms/Button/Button.js +5 -5
- package/dist/esm/components/atoms/Dropdown/index.js +6 -5
- package/dist/esm/components/atoms/Input/Input.js +34 -30
- package/dist/esm/components/atoms/InputMask/InputMask.js +34 -30
- package/dist/esm/components/atoms/Modal/Modal.js +18 -14
- package/dist/esm/components/atoms/Overlay/Overlay.js +7 -6
- package/dist/esm/components/atoms/Skeleton/Skeleton.js +12 -12
- package/dist/esm/components/atoms/Switch/Switch.js +14 -13
- package/dist/esm/components/atoms/Table/Body/TBody.js +2 -2
- package/dist/esm/components/atoms/Table/Cell/Td.js +2 -2
- package/dist/esm/components/atoms/Table/Container/TableContainer.js +2 -2
- package/dist/esm/components/atoms/Table/Footer/TFoot.js +2 -2
- package/dist/esm/components/atoms/Table/Header/THead.js +5 -2
- package/dist/esm/components/atoms/Table/Header/Th.js +2 -2
- package/dist/esm/components/atoms/Table/Row/Tr.js +2 -2
- package/dist/esm/components/atoms/Table/Table.js +2 -2
- package/dist/esm/components/atoms/Table/Toolbar/TableToolbar.js +8 -2
- package/dist/esm/components/atoms/Tag/Tag.js +6 -6
- package/dist/esm/components/atoms/Tooltip/Tooltip.js +21 -17
- package/dist/esm/components/molecules/Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js +13 -10
- package/dist/esm/components/molecules/Breadcrumbs/Breadcrumbs.js +6 -6
- package/dist/esm/components/molecules/DatePicker/DatePicker.js +14 -13
- package/dist/esm/components/molecules/DateTimePicker/DateTimePicker.js +5 -4
- package/dist/esm/components/molecules/DateTimePickerSelector/DateTimePickerSelector.js +53 -45
- package/dist/esm/components/molecules/DateTimePickerSelector/components/MemoizedTimeCard.js +6 -5
- package/dist/esm/components/molecules/DateTimePickerSelector/components/ScrollableDigit.js +26 -22
- package/dist/esm/components/molecules/Drawer/Drawer.js +17 -13
- package/dist/esm/components/molecules/Grid/Grid.js +25 -24
- package/dist/esm/components/molecules/Grid/Item/Item.js +2 -1
- package/dist/esm/components/molecules/IconTextButton/IconTextButton.js +33 -31
- package/dist/esm/components/molecules/IconTextButton/TextComponent.js +6 -5
- package/dist/esm/components/molecules/InputPassword/InputPassword.js +13 -9
- package/dist/esm/components/molecules/LabeledSwitch/LabelComponent.js +6 -5
- package/dist/esm/components/molecules/LabeledSwitch/LabeledSwitch.js +36 -32
- package/dist/esm/components/molecules/Masonry/Masonry.js +4 -3
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuBlock.js +24 -17
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.js +23 -15
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js +6 -2
- package/dist/esm/components/molecules/Menubar/Menubar.js +73 -58
- package/dist/esm/components/molecules/Menubar/MostUsed/MostUsed.js +31 -24
- package/dist/esm/components/molecules/Menubar/SearchResultItem/SearchResultItem.js +14 -11
- package/dist/esm/components/molecules/Menubar/SearchResultItem/utils.js +2 -2
- package/dist/esm/components/molecules/ScrollableMonthYearPicker/ScrollableMonthYearPicker.js +28 -24
- package/dist/esm/components/molecules/ScrollableTimePicker/ScrollableTimePicker.js +31 -28
- package/dist/esm/components/molecules/Select/Dropdown/Dropdown.js +50 -45
- package/dist/esm/components/molecules/Select/Dropdown/components/SearchInput.js +3 -2
- package/dist/esm/components/molecules/Select/Select.js +50 -45
- package/dist/esm/components/molecules/Select/SelectItem/SelectItem.js +5 -1
- package/dist/esm/components/molecules/Snackbar/Snackbar.js +2 -2
- package/dist/esm/components/molecules/TextArea/TextArea.js +19 -19
- package/dist/esm/components/organisms/DataGrid/DataGrid.js +55 -47
- package/dist/esm/components/organisms/DataGrid/Footer/Footer.js +72 -57
- package/dist/esm/components/organisms/DataGrid/Footer/styled.js +2 -1
- package/dist/esm/components/organisms/DataGrid/Header/Header.js +28 -22
- package/dist/esm/components/organisms/DataGrid/Header/styled.js +1 -1
- package/dist/esm/components/organisms/DataGrid/Row/Row.js +11 -7
- package/dist/esm/components/organisms/DataGrid/styled.js +1 -1
- package/dist/types/components/atoms/Accordion/Accordion.d.ts +1 -1
- package/dist/types/components/molecules/DateTimePickerSelector/components/ScrollableDigit.d.ts +1 -1
- package/dist/types/components/molecules/Select/Dropdown/components/SearchInput.d.ts +1 -1
- package/dist/types/components/organisms/DataGrid/Row/Row.d.ts +1 -1
- package/package.json +3 -3
|
@@ -1,8 +1,9 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import { Icon } from '@tecsinapse/react-core';
|
|
3
4
|
import Input from '../../../../atoms/Input/Input.js';
|
|
4
5
|
|
|
5
|
-
const InputIcon = /* @__PURE__ */
|
|
6
|
+
const InputIcon = /* @__PURE__ */ jsx(
|
|
6
7
|
Icon,
|
|
7
8
|
{
|
|
8
9
|
name: "magnify",
|
|
@@ -12,7 +13,7 @@ const InputIcon = /* @__PURE__ */ React__default.createElement(
|
|
|
12
13
|
}
|
|
13
14
|
);
|
|
14
15
|
const SearchInput = ({ fullWidth, searchArg, onChange, placeholder }) => {
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
+
return /* @__PURE__ */ jsx(
|
|
16
17
|
Input,
|
|
17
18
|
{
|
|
18
19
|
style: fullWidth,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import { PressableInputContainer, Text, Hint } from '@tecsinapse/react-core';
|
|
2
3
|
import React__default, { useState, useId, useEffect, useMemo } from 'react';
|
|
3
4
|
import { Transition } from 'react-transition-group';
|
|
@@ -34,7 +35,7 @@ const Select = ({
|
|
|
34
35
|
const refDropDown = React__default.useRef(null);
|
|
35
36
|
const transitionRef = React__default.useRef(null);
|
|
36
37
|
useClickAwayListener(refDropDown, setDropDownVisible);
|
|
37
|
-
const _hint = hintComponent || /* @__PURE__ */
|
|
38
|
+
const _hint = hintComponent || /* @__PURE__ */ jsx(Hint, { text: hint, variant });
|
|
38
39
|
const instanceid = useId();
|
|
39
40
|
useEffect(() => {
|
|
40
41
|
if (typeof options !== "function") {
|
|
@@ -106,7 +107,7 @@ const Select = ({
|
|
|
106
107
|
[setDropDownVisible]
|
|
107
108
|
);
|
|
108
109
|
const RightComponent = useMemo(
|
|
109
|
-
() => /* @__PURE__ */
|
|
110
|
+
() => /* @__PURE__ */ jsx(
|
|
110
111
|
StyledIconComponent,
|
|
111
112
|
{
|
|
112
113
|
name: "chevron-down",
|
|
@@ -117,52 +118,56 @@ const Select = ({
|
|
|
117
118
|
),
|
|
118
119
|
[disabled]
|
|
119
120
|
);
|
|
120
|
-
return /* @__PURE__ */
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
label: _label,
|
|
124
|
-
onPress,
|
|
125
|
-
disabled,
|
|
126
|
-
rightComponent: RightComponent
|
|
127
|
-
},
|
|
128
|
-
/* @__PURE__ */ React__default.createElement(
|
|
129
|
-
Text,
|
|
130
|
-
{
|
|
131
|
-
...displayTextProps,
|
|
132
|
-
colorTone: _valueColorTone,
|
|
133
|
-
colorVariant: _valueColorVariant,
|
|
134
|
-
fontWeight: "bold"
|
|
135
|
-
},
|
|
136
|
-
displayValue
|
|
137
|
-
)
|
|
138
|
-
)), /* @__PURE__ */ React__default.createElement(StyledHintContainer, null, _hint), /* @__PURE__ */ React__default.createElement(
|
|
139
|
-
Transition,
|
|
140
|
-
{
|
|
141
|
-
in: dropDownVisible,
|
|
142
|
-
timeout: 300,
|
|
143
|
-
nodeRef: transitionRef,
|
|
144
|
-
key: instanceid
|
|
145
|
-
},
|
|
146
|
-
(state) => /* @__PURE__ */ React__default.createElement(
|
|
147
|
-
Dropdown,
|
|
121
|
+
return /* @__PURE__ */ jsxs(StyledContainer, { ref: refDropDown, ...rest, children: [
|
|
122
|
+
/* @__PURE__ */ jsx(StyledInputContainer, { onFocus: handlePressInput, children: /* @__PURE__ */ jsx(
|
|
123
|
+
PressableInputContainer,
|
|
148
124
|
{
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
125
|
+
label: _label,
|
|
126
|
+
onPress,
|
|
127
|
+
disabled,
|
|
128
|
+
rightComponent: RightComponent,
|
|
129
|
+
children: /* @__PURE__ */ jsx(
|
|
130
|
+
Text,
|
|
131
|
+
{
|
|
132
|
+
...displayTextProps,
|
|
133
|
+
colorTone: _valueColorTone,
|
|
134
|
+
colorVariant: _valueColorVariant,
|
|
135
|
+
fontWeight: "bold",
|
|
136
|
+
children: displayValue
|
|
137
|
+
}
|
|
138
|
+
)
|
|
163
139
|
}
|
|
140
|
+
) }),
|
|
141
|
+
/* @__PURE__ */ jsx(StyledHintContainer, { children: _hint }),
|
|
142
|
+
/* @__PURE__ */ jsx(
|
|
143
|
+
Transition,
|
|
144
|
+
{
|
|
145
|
+
in: dropDownVisible,
|
|
146
|
+
timeout: 300,
|
|
147
|
+
nodeRef: transitionRef,
|
|
148
|
+
children: (state) => /* @__PURE__ */ jsx(
|
|
149
|
+
Dropdown,
|
|
150
|
+
{
|
|
151
|
+
ref: transitionRef,
|
|
152
|
+
options: selectOptions ?? [],
|
|
153
|
+
onSelect,
|
|
154
|
+
value,
|
|
155
|
+
type,
|
|
156
|
+
keyExtractor,
|
|
157
|
+
labelExtractor,
|
|
158
|
+
hideSearchBar,
|
|
159
|
+
searchBarPlaceholder,
|
|
160
|
+
onSearch: handleOnSearch,
|
|
161
|
+
style: { ...defaultStyles, ...transition[anchor][state] },
|
|
162
|
+
setDropDownVisible,
|
|
163
|
+
anchor,
|
|
164
|
+
selectAllLabel
|
|
165
|
+
}
|
|
166
|
+
)
|
|
167
|
+
},
|
|
168
|
+
instanceid
|
|
164
169
|
)
|
|
165
|
-
)
|
|
170
|
+
] });
|
|
166
171
|
};
|
|
167
172
|
|
|
168
173
|
export { Select as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import { Checkbox, Text } from '@tecsinapse/react-core';
|
|
3
4
|
import { ContainerItemSelect, StyledContainerTextLabel, StyledSpan } from './styled.js';
|
|
@@ -60,7 +61,10 @@ const SelectItem = ({
|
|
|
60
61
|
},
|
|
61
62
|
[onSelect, setDropDownVisible, setCheckedAll, setChecked, checked]
|
|
62
63
|
);
|
|
63
|
-
return /* @__PURE__ */
|
|
64
|
+
return /* @__PURE__ */ jsxs(ContainerItemSelect, { onClick: () => clickItem(item, value), children: [
|
|
65
|
+
isMulti && /* @__PURE__ */ jsx(Checkbox, { checked, onChange: () => clickItem(item, value) }),
|
|
66
|
+
/* @__PURE__ */ jsx(StyledContainerTextLabel, { children: /* @__PURE__ */ jsx(Text, { fontWeight: "bold", ellipsizeMode: "tail", numberOfLines: 1, children: /* @__PURE__ */ jsx(StyledSpan, { singleHighligh: type === "single" && value === item, children: labelExtractor(item) }) }) })
|
|
67
|
+
] });
|
|
64
68
|
};
|
|
65
69
|
var ItemSelect = React__default.memo(SelectItem);
|
|
66
70
|
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
1
2
|
import { Text } from '@tecsinapse/react-core';
|
|
2
|
-
import React__default from 'react';
|
|
3
3
|
import { SnackbarStyled } from './styled.js';
|
|
4
4
|
|
|
5
5
|
const Snackbar = ({
|
|
@@ -7,7 +7,7 @@ const Snackbar = ({
|
|
|
7
7
|
textProps = { colorVariant: "primary", colorTone: "medium" },
|
|
8
8
|
...rest
|
|
9
9
|
}) => {
|
|
10
|
-
return /* @__PURE__ */
|
|
10
|
+
return /* @__PURE__ */ jsx(SnackbarStyled, { ...rest, showProgressBar: false, children: /* @__PURE__ */ jsx(Text, { fontWeight: "bold", typography: "base", ...textProps, children: value }) });
|
|
11
11
|
};
|
|
12
12
|
|
|
13
13
|
export { Snackbar as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { useInputFocus, TextArea as TextArea$1, Text } from '@tecsinapse/react-core';
|
|
3
3
|
import { StyledWebInput } from './styled.js';
|
|
4
4
|
|
|
@@ -33,7 +33,7 @@ const TextArea = ({
|
|
|
33
33
|
onBlur,
|
|
34
34
|
!disabled
|
|
35
35
|
);
|
|
36
|
-
return /* @__PURE__ */
|
|
36
|
+
return /* @__PURE__ */ jsx(
|
|
37
37
|
TextArea$1,
|
|
38
38
|
{
|
|
39
39
|
label,
|
|
@@ -57,23 +57,23 @@ const TextArea = ({
|
|
|
57
57
|
hint,
|
|
58
58
|
style,
|
|
59
59
|
TextComponent: Text,
|
|
60
|
-
maxLength
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
60
|
+
maxLength,
|
|
61
|
+
children: /* @__PURE__ */ jsx(
|
|
62
|
+
StyledWebInput,
|
|
63
|
+
{
|
|
64
|
+
...rest,
|
|
65
|
+
fontStack: inputFontStack,
|
|
66
|
+
fontWeight: inputFontWeight,
|
|
67
|
+
disabled,
|
|
68
|
+
onFocus: handleFocus,
|
|
69
|
+
onBlur: handleBlur,
|
|
70
|
+
textAlignVertical: "top",
|
|
71
|
+
multiline: true,
|
|
72
|
+
value,
|
|
73
|
+
maxLength
|
|
74
|
+
}
|
|
75
|
+
)
|
|
76
|
+
}
|
|
77
77
|
);
|
|
78
78
|
};
|
|
79
79
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import TBody from '../../atoms/Table/Body/TBody.js';
|
|
3
4
|
import Td from '../../atoms/Table/Cell/Td.js';
|
|
@@ -67,55 +68,62 @@ const DataGrid = ({
|
|
|
67
68
|
},
|
|
68
69
|
[onSelectedRows, rowKeyExtractor]
|
|
69
70
|
);
|
|
70
|
-
return /* @__PURE__ */
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
title: toolbarTitle,
|
|
74
|
-
rightIcons: toolbarRightIcons,
|
|
75
|
-
footer: toolbarFooter
|
|
76
|
-
}
|
|
77
|
-
), /* @__PURE__ */ React__default.createElement(Table, null, /* @__PURE__ */ React__default.createElement(
|
|
78
|
-
Header,
|
|
79
|
-
{
|
|
80
|
-
selectable,
|
|
81
|
-
headers,
|
|
82
|
-
data,
|
|
83
|
-
rowsCount: rowsCount ?? data.length,
|
|
84
|
-
rowKeyExtractor,
|
|
85
|
-
selectedRows,
|
|
86
|
-
onSelected: onSelectedRows
|
|
87
|
-
}
|
|
88
|
-
), !loading ? /* @__PURE__ */ React__default.createElement(TBody, null, data.length > 0 ? getData(data, rowsCount, page, rowsPerPage, pagination).map(
|
|
89
|
-
(item) => /* @__PURE__ */ React__default.createElement(
|
|
90
|
-
Row,
|
|
71
|
+
return /* @__PURE__ */ jsxs(TableContainer, { ...rest, children: [
|
|
72
|
+
/* @__PURE__ */ jsx(
|
|
73
|
+
TableToolbar,
|
|
91
74
|
{
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
selectable,
|
|
96
|
-
headers,
|
|
97
|
-
data: item,
|
|
98
|
-
checked: selectedRows?.some(
|
|
99
|
-
(sel) => rowKeyExtractor(sel) === rowKeyExtractor(item)
|
|
100
|
-
)
|
|
75
|
+
title: toolbarTitle,
|
|
76
|
+
rightIcons: toolbarRightIcons,
|
|
77
|
+
footer: toolbarFooter
|
|
101
78
|
}
|
|
102
|
-
)
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
79
|
+
),
|
|
80
|
+
/* @__PURE__ */ jsxs(Table, { children: [
|
|
81
|
+
/* @__PURE__ */ jsx(
|
|
82
|
+
Header,
|
|
83
|
+
{
|
|
84
|
+
selectable,
|
|
85
|
+
headers,
|
|
86
|
+
data,
|
|
87
|
+
rowsCount: rowsCount ?? data.length,
|
|
88
|
+
rowKeyExtractor,
|
|
89
|
+
selectedRows,
|
|
90
|
+
onSelected: onSelectedRows
|
|
91
|
+
}
|
|
92
|
+
),
|
|
93
|
+
!loading ? /* @__PURE__ */ jsx(TBody, { children: data.length > 0 ? getData(data, rowsCount, page, rowsPerPage, pagination).map(
|
|
94
|
+
(item) => /* @__PURE__ */ jsx(
|
|
95
|
+
Row,
|
|
96
|
+
{
|
|
97
|
+
rowKeyExtractor,
|
|
98
|
+
handleSelect,
|
|
99
|
+
selectable,
|
|
100
|
+
headers,
|
|
101
|
+
data: item,
|
|
102
|
+
checked: selectedRows?.some(
|
|
103
|
+
(sel) => rowKeyExtractor(sel) === rowKeyExtractor(item)
|
|
104
|
+
)
|
|
105
|
+
},
|
|
106
|
+
rowKeyExtractor(item)
|
|
107
|
+
)
|
|
108
|
+
) : /* @__PURE__ */ jsx("tr", { children: /* @__PURE__ */ jsx("td", { colSpan: 99, children: emptyPlaceholder }) }) }) : /* @__PURE__ */ jsx(TBody, { children: [...Array(rowsPerPage).keys()].map((idx) => /* @__PURE__ */ jsx(Tr, { children: /* @__PURE__ */ jsx(Td, { colSpan: 99, style: { padding: 0 }, children: skeletonComponent ?? /* @__PURE__ */ jsx(Skeleton, { height: 55, radius: "mili", animation: "wave", children: /* @__PURE__ */ jsx("div", { style: { width: "100%" } }) }) }) }, `skeleton-${idx}`)) }),
|
|
109
|
+
(Number(rowsCount) > 0 || data.length > 0) && /* @__PURE__ */ jsx(
|
|
110
|
+
Footer,
|
|
111
|
+
{
|
|
112
|
+
exportFunction,
|
|
113
|
+
exportLabel,
|
|
114
|
+
rowsPerPageLabel,
|
|
115
|
+
rowsPerPage,
|
|
116
|
+
onRowsPerPageChange,
|
|
117
|
+
rowsPerPageOptions,
|
|
118
|
+
rowsCount: rowsCount ?? data.length,
|
|
119
|
+
page,
|
|
120
|
+
onPageChange,
|
|
121
|
+
pagination,
|
|
122
|
+
exportComponent
|
|
123
|
+
}
|
|
124
|
+
)
|
|
125
|
+
] })
|
|
126
|
+
] });
|
|
119
127
|
};
|
|
120
128
|
|
|
121
129
|
export { DataGrid as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import Button from '../../../atoms/Button/Button.js';
|
|
3
4
|
import { Text, Icon } from '@tecsinapse/react-core';
|
|
@@ -51,63 +52,77 @@ const Footer = ({
|
|
|
51
52
|
);
|
|
52
53
|
const currentInitItem = page * rowsPerPage + 1;
|
|
53
54
|
const currentFinalItem = (page + 1) * rowsPerPage > rowsCount ? rowsCount : (page + 1) * rowsPerPage;
|
|
54
|
-
return /* @__PURE__ */
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
fontColor: "
|
|
70
|
-
},
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
55
|
+
return /* @__PURE__ */ jsx(TFoot, { children: /* @__PURE__ */ jsx(Tr, { children: /* @__PURE__ */ jsx(TdFooterStyled, { colSpan: 99, children: /* @__PURE__ */ jsxs(FooterContainer, { children: [
|
|
56
|
+
/* @__PURE__ */ jsxs(FooterContainerStart, { children: [
|
|
57
|
+
pagination && /* @__PURE__ */ jsx(SelectContainer, { children: /* @__PURE__ */ jsx(
|
|
58
|
+
Select,
|
|
59
|
+
{
|
|
60
|
+
options: rowsPerPageOptions,
|
|
61
|
+
onSelect: handleRowsPerPage,
|
|
62
|
+
value: rowsPerPage,
|
|
63
|
+
type: "single",
|
|
64
|
+
keyExtractor: (value) => String(value),
|
|
65
|
+
labelExtractor: rowsPerPageLabel,
|
|
66
|
+
anchor: "top"
|
|
67
|
+
}
|
|
68
|
+
) }),
|
|
69
|
+
exportComponent && !exportFunction && /* @__PURE__ */ jsx(Fragment, { children: exportComponent }),
|
|
70
|
+
exportFunction && /* @__PURE__ */ jsx(HoveredText, { children: /* @__PURE__ */ jsx(Button, { variant: "outlined", onPress: () => exportFunction(), children: /* @__PURE__ */ jsx(Text, { fontColor: "orange", fontWeight: "bold", children: exportLabel }) }) })
|
|
71
|
+
] }),
|
|
72
|
+
pagination && /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
73
|
+
/* @__PURE__ */ jsx(
|
|
74
|
+
TextPagination,
|
|
75
|
+
{
|
|
76
|
+
fontWeight: "bold",
|
|
77
|
+
fontColor: "medium",
|
|
78
|
+
children: `Exibindo ${currentInitItem} a ${currentFinalItem} de ${rowsCount} registros`
|
|
79
|
+
}
|
|
80
|
+
),
|
|
81
|
+
/* @__PURE__ */ jsxs(FooterContainerEnd, { children: [
|
|
82
|
+
/* @__PURE__ */ jsx(
|
|
83
|
+
NavigationButton,
|
|
84
|
+
{
|
|
85
|
+
onPress: () => onPageChange?.(page - 1),
|
|
86
|
+
disabled: page === 0,
|
|
87
|
+
children: /* @__PURE__ */ jsx(
|
|
88
|
+
Icon,
|
|
89
|
+
{
|
|
90
|
+
name: "chevron-left",
|
|
91
|
+
type: "material-community",
|
|
92
|
+
fontColor: "light"
|
|
93
|
+
}
|
|
94
|
+
)
|
|
95
|
+
}
|
|
96
|
+
),
|
|
97
|
+
/* @__PURE__ */ jsx(PagesContainer, { children: [...Array(Math.ceil(rowsCount / rowsPerPage)).keys()].slice(
|
|
98
|
+
getPaginationSlice().start,
|
|
99
|
+
getPaginationSlice().end
|
|
100
|
+
).map((value) => /* @__PURE__ */ jsx(HoveredText, { children: /* @__PURE__ */ jsx(
|
|
101
|
+
PageButton,
|
|
102
|
+
{
|
|
103
|
+
variant: page === value ? "outlined" : "text",
|
|
104
|
+
onPress: () => onPageChange?.(value),
|
|
105
|
+
children: /* @__PURE__ */ jsx(Text, { fontColor: "medium", fontWeight: "bold", children: value + 1 })
|
|
106
|
+
}
|
|
107
|
+
) }, `page-${value}`)) }),
|
|
108
|
+
/* @__PURE__ */ jsx(
|
|
109
|
+
NavigationButton,
|
|
110
|
+
{
|
|
111
|
+
onPress: () => onPageChange?.(page + 1),
|
|
112
|
+
disabled: page === Math.ceil(rowsCount / rowsPerPage) - 1,
|
|
113
|
+
children: /* @__PURE__ */ jsx(
|
|
114
|
+
Icon,
|
|
115
|
+
{
|
|
116
|
+
name: "chevron-right",
|
|
117
|
+
type: "material-community",
|
|
118
|
+
fontColor: "light"
|
|
119
|
+
}
|
|
120
|
+
)
|
|
121
|
+
}
|
|
122
|
+
)
|
|
123
|
+
] })
|
|
124
|
+
] })
|
|
125
|
+
] }) }) }) });
|
|
111
126
|
};
|
|
112
127
|
var Footer$1 = React__default.memo(Footer);
|
|
113
128
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import styled from '@emotion/styled';
|
|
2
2
|
import styled$1 from '@emotion/native';
|
|
3
3
|
import { Text } from '@tecsinapse/react-core';
|
|
4
|
-
import 'react';
|
|
4
|
+
import 'react/jsx-runtime';
|
|
5
5
|
import Td from '../../../atoms/Table/Cell/Td.js';
|
|
6
6
|
import '../../../atoms/Table/Container/styled.js';
|
|
7
7
|
import '../../../atoms/Table/Footer/styled.js';
|
|
@@ -10,6 +10,7 @@ import '../../../atoms/Table/Row/styled.js';
|
|
|
10
10
|
import '../../../atoms/Table/Toolbar/styled.js';
|
|
11
11
|
import '../../../atoms/Table/styled.js';
|
|
12
12
|
import Button from '../../../atoms/Button/Button.js';
|
|
13
|
+
import 'react';
|
|
13
14
|
|
|
14
15
|
const TdFooterStyled = styled(Td)`
|
|
15
16
|
padding: ${({ theme }) => theme.spacing.centi} 0 0 0;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import { Checkbox, PressableSurface, Icon } from '@tecsinapse/react-core';
|
|
3
4
|
import '../../../atoms/Table/Cell/styled.js';
|
|
@@ -52,31 +53,36 @@ const Header = ({
|
|
|
52
53
|
}
|
|
53
54
|
onSelected?.(selectedRows.concat(unselectedItemsOnData));
|
|
54
55
|
};
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
)), headers.map(({ label, sort, justifyContent = "flex-start" }) => /* @__PURE__ */ React__default.createElement(Th, { key: label }, /* @__PURE__ */ React__default.createElement(
|
|
62
|
-
"div",
|
|
63
|
-
{
|
|
64
|
-
style: {
|
|
65
|
-
display: "flex",
|
|
66
|
-
alignItems: "center",
|
|
67
|
-
justifyContent
|
|
56
|
+
return /* @__PURE__ */ jsx(THead, { children: /* @__PURE__ */ jsxs(Tr, { children: [
|
|
57
|
+
selectable && /* @__PURE__ */ jsx(CheckboxHeader, { children: /* @__PURE__ */ jsx(
|
|
58
|
+
Checkbox,
|
|
59
|
+
{
|
|
60
|
+
checked: rowsCount === selectedRows?.length,
|
|
61
|
+
onChange: handleSelectAll
|
|
68
62
|
}
|
|
69
|
-
},
|
|
70
|
-
label,
|
|
71
|
-
|
|
72
|
-
Icon,
|
|
63
|
+
) }),
|
|
64
|
+
headers.map(({ label, sort, justifyContent = "flex-start" }) => /* @__PURE__ */ jsx(Th, { children: /* @__PURE__ */ jsxs(
|
|
65
|
+
"div",
|
|
73
66
|
{
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
style: {
|
|
68
|
+
display: "flex",
|
|
69
|
+
alignItems: "center",
|
|
70
|
+
justifyContent
|
|
71
|
+
},
|
|
72
|
+
children: [
|
|
73
|
+
label,
|
|
74
|
+
sort && /* @__PURE__ */ jsx("div", { style: { marginLeft: 8 }, children: /* @__PURE__ */ jsx(PressableSurface, { onPress: () => handleSortDirection(sort), children: /* @__PURE__ */ jsx(
|
|
75
|
+
Icon,
|
|
76
|
+
{
|
|
77
|
+
name: `sort-alphabetical-${getIconSuffix(sortDirection)}`,
|
|
78
|
+
type: "material-community",
|
|
79
|
+
fontColor: getIconColor(sortDirection)
|
|
80
|
+
}
|
|
81
|
+
) }) })
|
|
82
|
+
]
|
|
77
83
|
}
|
|
78
|
-
)))
|
|
79
|
-
))
|
|
84
|
+
) }, label))
|
|
85
|
+
] }) });
|
|
80
86
|
};
|
|
81
87
|
|
|
82
88
|
export { Header as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import { Checkbox } from '@tecsinapse/react-core';
|
|
3
4
|
import { CheckboxCell } from '../styled.js';
|
|
@@ -17,13 +18,16 @@ const Row = ({
|
|
|
17
18
|
selectable,
|
|
18
19
|
headers
|
|
19
20
|
}) => {
|
|
20
|
-
return /* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
21
|
+
return /* @__PURE__ */ jsxs(Tr, { children: [
|
|
22
|
+
selectable && /* @__PURE__ */ jsx(CheckboxCell, { children: /* @__PURE__ */ jsx(
|
|
23
|
+
Checkbox,
|
|
24
|
+
{
|
|
25
|
+
checked: _checked,
|
|
26
|
+
onChange: (checked) => handleSelect(data, checked)
|
|
27
|
+
}
|
|
28
|
+
) }),
|
|
29
|
+
headers.map(({ label, render }) => /* @__PURE__ */ jsx(Td, { children: render(data) }, `row-${rowKeyExtractor(data)}-column-${label}`))
|
|
30
|
+
] }, rowKeyExtractor(data));
|
|
27
31
|
};
|
|
28
32
|
var Row$1 = React__default.memo(Row);
|
|
29
33
|
|
|
@@ -5,5 +5,5 @@ export interface AccordionProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
5
5
|
title: string;
|
|
6
6
|
transition?: number;
|
|
7
7
|
}
|
|
8
|
-
declare const Accordion: ({ title, open: _open, onChange, transition, children, ...rest }: PropsWithChildren<AccordionProps>) =>
|
|
8
|
+
declare const Accordion: ({ title, open: _open, onChange, transition, children, ...rest }: PropsWithChildren<AccordionProps>) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default Accordion;
|