@tecsinapse/react-web-kit 3.5.0 → 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 +25 -21
- 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 +25 -21
- 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/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,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import { Text } from '@tecsinapse/react-core';
|
|
3
4
|
import MenuItem from './MenuItem/MenuItem.js';
|
|
@@ -5,26 +6,32 @@ import { StyledContainerMenu, StyledLeftComponent, StyledContainerItems } from '
|
|
|
5
6
|
import Masonry from '../../Masonry/Masonry.js';
|
|
6
7
|
|
|
7
8
|
const MenuBlock = ({ options, toggle }) => {
|
|
8
|
-
return /* @__PURE__ */
|
|
9
|
-
({
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
}) => /* @__PURE__ */ React__default.createElement(
|
|
16
|
-
MenuItem,
|
|
17
|
-
{
|
|
18
|
-
items,
|
|
19
|
-
key: title,
|
|
9
|
+
return /* @__PURE__ */ jsx(Masonry, { columns: 4, spacingTop: "kilo", spacingLeft: "mega", children: options.map((data) => /* @__PURE__ */ jsxs(React__default.Fragment, { children: [
|
|
10
|
+
/* @__PURE__ */ jsxs(StyledContainerMenu, { children: [
|
|
11
|
+
data.leftComponents && /* @__PURE__ */ jsx(StyledLeftComponent, { children: data.leftComponents }),
|
|
12
|
+
/* @__PURE__ */ jsx(Text, { fontWeight: "bold", children: data.title })
|
|
13
|
+
] }),
|
|
14
|
+
/* @__PURE__ */ jsx(StyledContainerItems, { children: data.items.map(
|
|
15
|
+
({
|
|
20
16
|
title,
|
|
21
17
|
Component,
|
|
22
|
-
rightComponents,
|
|
23
18
|
props,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
19
|
+
rightComponents,
|
|
20
|
+
items
|
|
21
|
+
}) => /* @__PURE__ */ jsx(
|
|
22
|
+
MenuItem,
|
|
23
|
+
{
|
|
24
|
+
items,
|
|
25
|
+
title,
|
|
26
|
+
Component,
|
|
27
|
+
rightComponents,
|
|
28
|
+
props,
|
|
29
|
+
toggle
|
|
30
|
+
},
|
|
31
|
+
title
|
|
32
|
+
)
|
|
33
|
+
) })
|
|
34
|
+
] }, `${data.title}`)) });
|
|
28
35
|
};
|
|
29
36
|
var MenuBlock$1 = React__default.memo(MenuBlock);
|
|
30
37
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import { Text, Icon } from '@tecsinapse/react-core';
|
|
3
4
|
import SubMenuBlock from './SubMenuBlock/SubMenuBlock.js';
|
|
@@ -16,21 +17,28 @@ const MenuItem = ({
|
|
|
16
17
|
const noTextDecoration = { textDecoration: "none" };
|
|
17
18
|
const getIconName = () => open ? "arrow-up-drop-circle-outline" : "arrow-down-drop-circle-outline";
|
|
18
19
|
const handleMenuAction = () => setOpen(!open);
|
|
19
|
-
return /* @__PURE__ */
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
20
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
21
|
+
/* @__PURE__ */ jsxs(StyledContainerItemText, { children: [
|
|
22
|
+
/* @__PURE__ */ jsx(Component, { ...props, style: noTextDecoration, onClick: toggle, children: /* @__PURE__ */ jsx(
|
|
23
|
+
Text,
|
|
24
|
+
{
|
|
25
|
+
colorVariant: open ? "primary" : "secondary",
|
|
26
|
+
colorTone: open ? "medium" : "dark",
|
|
27
|
+
children: /* @__PURE__ */ jsx(StyledText, { children: title })
|
|
28
|
+
}
|
|
29
|
+
) }),
|
|
30
|
+
rightComponents && !items && /* @__PURE__ */ jsx(StyledRightComponent, { children: rightComponents }),
|
|
31
|
+
items && /* @__PURE__ */ jsx(StyledSubButton, { onClick: handleMenuAction, children: /* @__PURE__ */ jsx(
|
|
32
|
+
Icon,
|
|
33
|
+
{
|
|
34
|
+
name: getIconName(),
|
|
35
|
+
type: "material-community",
|
|
36
|
+
fontColor: "orange"
|
|
37
|
+
}
|
|
38
|
+
) })
|
|
39
|
+
] }, title),
|
|
40
|
+
open && items?.map((subItem) => /* @__PURE__ */ jsx(SubMenuBlock, { data: subItem, toggle }, subItem.title))
|
|
41
|
+
] });
|
|
34
42
|
};
|
|
35
43
|
|
|
36
44
|
export { MenuItem as default };
|
package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
2
2
|
import { Text } from '@tecsinapse/react-core';
|
|
3
3
|
import { StyledText, StyledRightComponent } from '../../styled.js';
|
|
4
4
|
import { StyledContainerItem, DummyBorder } from './styled.js';
|
|
@@ -6,7 +6,11 @@ import { StyledContainerItem, DummyBorder } from './styled.js';
|
|
|
6
6
|
const SubMenuBlock = ({ data, toggle }) => {
|
|
7
7
|
const { Component, props, rightComponents, title } = data;
|
|
8
8
|
const noTextDecoration = { textDecoration: "none" };
|
|
9
|
-
return /* @__PURE__ */
|
|
9
|
+
return /* @__PURE__ */ jsxs(StyledContainerItem, { children: [
|
|
10
|
+
/* @__PURE__ */ jsx(DummyBorder, {}),
|
|
11
|
+
/* @__PURE__ */ jsx(Component, { ...props, style: noTextDecoration, onClick: toggle, children: /* @__PURE__ */ jsx(Text, { colorVariant: "secondary", colorTone: "medium", typography: "sub", children: /* @__PURE__ */ jsx(StyledText, { children: title }) }) }),
|
|
12
|
+
rightComponents && /* @__PURE__ */ jsx(StyledRightComponent, { children: rightComponents })
|
|
13
|
+
] });
|
|
10
14
|
};
|
|
11
15
|
|
|
12
16
|
export { SubMenuBlock as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
1
2
|
import React__default, { useRef } from 'react';
|
|
2
3
|
import { useDebouncedState, Icon, Text } from '@tecsinapse/react-core';
|
|
3
4
|
import { Transition } from 'react-transition-group';
|
|
@@ -36,69 +37,83 @@ const Menubar = ({
|
|
|
36
37
|
if (search === "") return;
|
|
37
38
|
setResults(filterAndTransform(options, search));
|
|
38
39
|
}, [search]);
|
|
39
|
-
return /* @__PURE__ */
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
name: "menu",
|
|
44
|
-
type: "material-community",
|
|
45
|
-
fontColor: "light"
|
|
46
|
-
}
|
|
47
|
-
) : /* @__PURE__ */ React__default.createElement(
|
|
48
|
-
Icon,
|
|
49
|
-
{
|
|
50
|
-
size: "deca",
|
|
51
|
-
name: "close",
|
|
52
|
-
type: "material-community",
|
|
53
|
-
fontColor: "light"
|
|
54
|
-
}
|
|
55
|
-
)), leftComponents, /* @__PURE__ */ React__default.createElement(Transition, { in: open, timeout: 250, nodeRef: transitionInputRef }, (state) => /* @__PURE__ */ React__default.createElement(
|
|
56
|
-
StyledInputContainer,
|
|
57
|
-
{
|
|
58
|
-
style: getInputContainerStyles(state),
|
|
59
|
-
ref: transitionInputRef
|
|
60
|
-
},
|
|
61
|
-
searchable && /* @__PURE__ */ React__default.createElement(
|
|
62
|
-
StyledInput,
|
|
63
|
-
{
|
|
64
|
-
placeholder: searchPlaceholder,
|
|
65
|
-
leftComponent: /* @__PURE__ */ React__default.createElement(StyledIconInput, null, /* @__PURE__ */ React__default.createElement(Icon, { name: "magnify", type: "material-community" })),
|
|
66
|
-
value: input,
|
|
67
|
-
onChange: setInput
|
|
68
|
-
}
|
|
69
|
-
)
|
|
70
|
-
)), rightComponents), /* @__PURE__ */ React__default.createElement(
|
|
71
|
-
Transition,
|
|
72
|
-
{
|
|
73
|
-
in: open,
|
|
74
|
-
timeout: 250,
|
|
75
|
-
nodeRef: transitionMenuRef,
|
|
76
|
-
unmountOnExit: true
|
|
77
|
-
},
|
|
78
|
-
(state) => /* @__PURE__ */ React__default.createElement(
|
|
79
|
-
StyledContainerOpenMenu,
|
|
80
|
-
{
|
|
81
|
-
style: getContainerOpenMenuStyles(state),
|
|
82
|
-
ref: transitionMenuRef
|
|
83
|
-
},
|
|
84
|
-
!search ? /* @__PURE__ */ React__default.createElement(React__default.Fragment, null, mostUsed && /* @__PURE__ */ React__default.createElement(
|
|
85
|
-
MostUsed,
|
|
40
|
+
return /* @__PURE__ */ jsxs("div", { ref: (ref) => menuRef.current = ref, ...rest, children: [
|
|
41
|
+
/* @__PURE__ */ jsxs(StyledMenuBar, { children: [
|
|
42
|
+
/* @__PURE__ */ jsx(StyledMenuButton, { variant: "filled", color: "primary", onPress: toggleOpen, children: !open ? /* @__PURE__ */ jsx(
|
|
43
|
+
Icon,
|
|
86
44
|
{
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
45
|
+
size: "deca",
|
|
46
|
+
name: "menu",
|
|
47
|
+
type: "material-community",
|
|
48
|
+
fontColor: "light"
|
|
90
49
|
}
|
|
91
|
-
)
|
|
92
|
-
|
|
50
|
+
) : /* @__PURE__ */ jsx(
|
|
51
|
+
Icon,
|
|
93
52
|
{
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
53
|
+
size: "deca",
|
|
54
|
+
name: "close",
|
|
55
|
+
type: "material-community",
|
|
56
|
+
fontColor: "light"
|
|
98
57
|
}
|
|
99
|
-
))
|
|
58
|
+
) }),
|
|
59
|
+
leftComponents,
|
|
60
|
+
/* @__PURE__ */ jsx(Transition, { in: open, timeout: 250, nodeRef: transitionInputRef, children: (state) => /* @__PURE__ */ jsx(
|
|
61
|
+
StyledInputContainer,
|
|
62
|
+
{
|
|
63
|
+
style: getInputContainerStyles(state),
|
|
64
|
+
ref: transitionInputRef,
|
|
65
|
+
children: searchable && /* @__PURE__ */ jsx(
|
|
66
|
+
StyledInput,
|
|
67
|
+
{
|
|
68
|
+
placeholder: searchPlaceholder,
|
|
69
|
+
leftComponent: /* @__PURE__ */ jsx(StyledIconInput, { children: /* @__PURE__ */ jsx(Icon, { name: "magnify", type: "material-community" }) }),
|
|
70
|
+
value: input,
|
|
71
|
+
onChange: setInput
|
|
72
|
+
}
|
|
73
|
+
)
|
|
74
|
+
}
|
|
75
|
+
) }),
|
|
76
|
+
rightComponents
|
|
77
|
+
] }),
|
|
78
|
+
/* @__PURE__ */ jsx(
|
|
79
|
+
Transition,
|
|
80
|
+
{
|
|
81
|
+
in: open,
|
|
82
|
+
timeout: 250,
|
|
83
|
+
nodeRef: transitionMenuRef,
|
|
84
|
+
unmountOnExit: true,
|
|
85
|
+
children: (state) => /* @__PURE__ */ jsx(
|
|
86
|
+
StyledContainerOpenMenu,
|
|
87
|
+
{
|
|
88
|
+
style: getContainerOpenMenuStyles(state),
|
|
89
|
+
ref: transitionMenuRef,
|
|
90
|
+
children: !search ? /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
91
|
+
mostUsed && /* @__PURE__ */ jsx(
|
|
92
|
+
MostUsed,
|
|
93
|
+
{
|
|
94
|
+
label: mostUsedLabel,
|
|
95
|
+
data: mostUsed,
|
|
96
|
+
toggle: toggleOpen
|
|
97
|
+
}
|
|
98
|
+
),
|
|
99
|
+
/* @__PURE__ */ jsx(MenuBlock, { options, toggle: toggleOpen })
|
|
100
|
+
] }) : /* @__PURE__ */ jsxs(StyledSearchResultsContainer, { children: [
|
|
101
|
+
/* @__PURE__ */ jsx(StyledSearchTextContainer, { children: /* @__PURE__ */ jsx(Text, { fontWeight: "bold", children: searchResultsLabel }) }),
|
|
102
|
+
results.map((result) => /* @__PURE__ */ jsx(
|
|
103
|
+
SearchResultItem,
|
|
104
|
+
{
|
|
105
|
+
data: result,
|
|
106
|
+
searchTerm: search,
|
|
107
|
+
toggle: toggleOpen
|
|
108
|
+
},
|
|
109
|
+
`${result.title}-${result.category}`
|
|
110
|
+
))
|
|
111
|
+
] })
|
|
112
|
+
}
|
|
113
|
+
)
|
|
114
|
+
}
|
|
100
115
|
)
|
|
101
|
-
)
|
|
116
|
+
] });
|
|
102
117
|
};
|
|
103
118
|
|
|
104
119
|
export { Menubar as default };
|
|
@@ -1,34 +1,41 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsxs, Fragment, jsx } from 'react/jsx-runtime';
|
|
2
|
+
import React__default, { createElement } from 'react';
|
|
2
3
|
import { Text } from '@tecsinapse/react-core';
|
|
3
4
|
import { StyledCardContainer, StyledCard } from './styled.js';
|
|
4
5
|
|
|
5
6
|
const MostUsed = ({ data, label, toggle }) => {
|
|
6
7
|
const noTextDecoration = { textDecoration: "none" };
|
|
7
|
-
return /* @__PURE__ */
|
|
8
|
-
({
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
style: noTextDecoration,
|
|
18
|
-
key: `${title}-${category}`,
|
|
19
|
-
onClick: toggle
|
|
20
|
-
},
|
|
21
|
-
/* @__PURE__ */ React__default.createElement(StyledCard, { elevated: true, key: `${title}-${category}` }, /* @__PURE__ */ React__default.createElement(Text, { fontWeight: "bold", colorVariant: "primary" }, title), /* @__PURE__ */ React__default.createElement(
|
|
22
|
-
Text,
|
|
8
|
+
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
9
|
+
/* @__PURE__ */ jsx(Text, { fontWeight: "bold", children: label }),
|
|
10
|
+
/* @__PURE__ */ jsx(StyledCardContainer, { children: data.slice(0, 4).map(
|
|
11
|
+
({
|
|
12
|
+
title,
|
|
13
|
+
category,
|
|
14
|
+
Component = "a",
|
|
15
|
+
props = {}
|
|
16
|
+
}) => /* @__PURE__ */ createElement(
|
|
17
|
+
Component,
|
|
23
18
|
{
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
19
|
+
...props,
|
|
20
|
+
style: noTextDecoration,
|
|
21
|
+
key: `${title}-${category}`,
|
|
22
|
+
onClick: toggle
|
|
27
23
|
},
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
24
|
+
/* @__PURE__ */ jsxs(StyledCard, { elevated: true, children: [
|
|
25
|
+
/* @__PURE__ */ jsx(Text, { fontWeight: "bold", colorVariant: "primary", children: title }),
|
|
26
|
+
/* @__PURE__ */ jsx(
|
|
27
|
+
Text,
|
|
28
|
+
{
|
|
29
|
+
fontWeight: "bold",
|
|
30
|
+
colorVariant: "secondary",
|
|
31
|
+
typography: "label",
|
|
32
|
+
children: category
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
] }, `${title}-${category}`)
|
|
36
|
+
)
|
|
37
|
+
) })
|
|
38
|
+
] });
|
|
32
39
|
};
|
|
33
40
|
var MostUsed$1 = React__default.memo(MostUsed);
|
|
34
41
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import { Text } from '@tecsinapse/react-core';
|
|
3
3
|
import { StyledSearchItemContainer, HighlightText } from './styled.js';
|
|
4
4
|
import { highlight } from './utils.js';
|
|
@@ -11,16 +11,19 @@ const SearchResultItem = ({
|
|
|
11
11
|
const { title, category, Component, props } = data;
|
|
12
12
|
const noTextDecoration = { textDecoration: "none" };
|
|
13
13
|
const textProps = { fontColor: "orange", fontWeight: "bold" };
|
|
14
|
-
return /* @__PURE__ */
|
|
15
|
-
Text,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
14
|
+
return /* @__PURE__ */ jsx(Component, { ...props, style: noTextDecoration, onClick: toggle, children: /* @__PURE__ */ jsxs(StyledSearchItemContainer, { children: [
|
|
15
|
+
/* @__PURE__ */ jsx(Text, { typography: "base", colorVariant: "secondary", colorTone: "dark", children: highlight(searchTerm, title, HighlightText, textProps) }),
|
|
16
|
+
/* @__PURE__ */ jsx(
|
|
17
|
+
Text,
|
|
18
|
+
{
|
|
19
|
+
typography: "sub",
|
|
20
|
+
fontWeight: "bold",
|
|
21
|
+
colorVariant: "secondary",
|
|
22
|
+
colorTone: "medium",
|
|
23
|
+
children: category
|
|
24
|
+
}
|
|
25
|
+
)
|
|
26
|
+
] }) });
|
|
24
27
|
};
|
|
25
28
|
|
|
26
29
|
export { SearchResultItem as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
|
|
3
3
|
const normalize = (str) => {
|
|
4
4
|
return str.normalize("NFD").replace(/[\u0300-\u036f]/g, "").replace(/[-[\]{}()*+?.,\\^$|#]/g, " ").toLowerCase();
|
|
@@ -29,7 +29,7 @@ const highlightReplacer = (searchTerm, textToReplace, Component, props) => {
|
|
|
29
29
|
const indexes = matches.map((match) => match.index);
|
|
30
30
|
const splited = matchSpliter(textToReplace, indexes, searchTerm.length);
|
|
31
31
|
return splited.map((value, idx) => {
|
|
32
|
-
return normalize(value) === search ? /* @__PURE__ */
|
|
32
|
+
return normalize(value) === search ? /* @__PURE__ */ jsx(Component, { ...props, children: value }, `highlight-${value}${idx}`) : /* @__PURE__ */ jsx(Fragment, { children: value });
|
|
33
33
|
});
|
|
34
34
|
};
|
|
35
35
|
const highlight = (searchTerm, textToReplace, Component, props) => {
|
package/dist/esm/components/molecules/ScrollableMonthYearPicker/ScrollableMonthYearPicker.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
1
2
|
import * as React from 'react';
|
|
2
3
|
import { DivStyledColumn, DivStyledRow } from './styled.js';
|
|
3
4
|
import ScrollableDigit from '../DateTimePickerSelector/components/ScrollableDigit.js';
|
|
@@ -33,30 +34,33 @@ const ScrollableMonthYearPicker = ({
|
|
|
33
34
|
const selectedIndex = data.findIndex((item) => item === value);
|
|
34
35
|
return selectedIndex >= 0 ? selectedIndex : 0;
|
|
35
36
|
};
|
|
36
|
-
return /* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
37
|
+
return /* @__PURE__ */ jsx(DivStyledColumn, { children: /* @__PURE__ */ jsxs(DivStyledRow, { children: [
|
|
38
|
+
/* @__PURE__ */ jsx(
|
|
39
|
+
ScrollableDigit,
|
|
40
|
+
{
|
|
41
|
+
data: months,
|
|
42
|
+
timeLabel: monthLabel ?? "Month",
|
|
43
|
+
handleTimeChange: handleMonthYearChange,
|
|
44
|
+
initialScrollIndex: getInitialScrollIndex(
|
|
45
|
+
months[date.getMonth()],
|
|
46
|
+
months
|
|
47
|
+
),
|
|
48
|
+
updateType: "month",
|
|
49
|
+
currentTime: months[date.getMonth()]
|
|
50
|
+
}
|
|
51
|
+
),
|
|
52
|
+
/* @__PURE__ */ jsx(
|
|
53
|
+
ScrollableDigit,
|
|
54
|
+
{
|
|
55
|
+
data: years,
|
|
56
|
+
timeLabel: yearLabel ?? "Year",
|
|
57
|
+
handleTimeChange: handleMonthYearChange,
|
|
58
|
+
initialScrollIndex: getInitialScrollIndex(date.getFullYear(), years),
|
|
59
|
+
updateType: "year",
|
|
60
|
+
currentTime: date?.getFullYear().toString()
|
|
61
|
+
}
|
|
62
|
+
)
|
|
63
|
+
] }) });
|
|
60
64
|
};
|
|
61
65
|
|
|
62
66
|
export { ScrollableMonthYearPicker as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { jsx, jsxs } from 'react/jsx-runtime';
|
|
2
2
|
import ScrollableDigit from '../DateTimePickerSelector/components/ScrollableDigit.js';
|
|
3
3
|
import '../DateTimePickerSelector/components/MemoizedTimeCard.js';
|
|
4
4
|
import { DivStyledColumn, DivStyledRow } from './styled.js';
|
|
@@ -24,33 +24,36 @@ const ScrollableTimePicker = ({
|
|
|
24
24
|
const selectedIndex = data.findIndex((item) => item === value);
|
|
25
25
|
return selectedIndex >= 0 ? selectedIndex : 0;
|
|
26
26
|
};
|
|
27
|
-
return /* @__PURE__ */
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
27
|
+
return /* @__PURE__ */ jsx(DivStyledColumn, { children: /* @__PURE__ */ jsxs(DivStyledRow, { children: [
|
|
28
|
+
/* @__PURE__ */ jsx(
|
|
29
|
+
ScrollableDigit,
|
|
30
|
+
{
|
|
31
|
+
data: hours,
|
|
32
|
+
timeLabel: hourLabel ?? "Hour",
|
|
33
|
+
handleTimeChange,
|
|
34
|
+
currentTime: date?.getHours().toString(),
|
|
35
|
+
updateType: "hour",
|
|
36
|
+
initialScrollIndex: getInitialScrollIndex(
|
|
37
|
+
date.getHours().toString(),
|
|
38
|
+
hours
|
|
39
|
+
)
|
|
40
|
+
}
|
|
41
|
+
),
|
|
42
|
+
/* @__PURE__ */ jsx(
|
|
43
|
+
ScrollableDigit,
|
|
44
|
+
{
|
|
45
|
+
data: minutes,
|
|
46
|
+
timeLabel: minuteLabel ?? "Minute",
|
|
47
|
+
updateType: "minute",
|
|
48
|
+
currentTime: date?.getMinutes().toString(),
|
|
49
|
+
handleTimeChange,
|
|
50
|
+
initialScrollIndex: getInitialScrollIndex(
|
|
51
|
+
date.getMinutes().toString(),
|
|
52
|
+
minutes
|
|
53
|
+
)
|
|
54
|
+
}
|
|
55
|
+
)
|
|
56
|
+
] }) });
|
|
54
57
|
};
|
|
55
58
|
|
|
56
59
|
export { ScrollableTimePicker as default };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { jsxs, jsx } from 'react/jsx-runtime';
|
|
1
2
|
import React__default from 'react';
|
|
2
3
|
import { useDebouncedState, Checkbox, Text } from '@tecsinapse/react-core';
|
|
3
4
|
import ItemSelect from '../SelectItem/SelectItem.js';
|
|
@@ -44,56 +45,60 @@ const Component = ({
|
|
|
44
45
|
(text) => setSearchArg(text),
|
|
45
46
|
[setSearchArg]
|
|
46
47
|
);
|
|
47
|
-
return /* @__PURE__ */
|
|
48
|
+
return /* @__PURE__ */ jsxs(
|
|
48
49
|
StyledContainerDropdown,
|
|
49
50
|
{
|
|
50
51
|
lengthOptions,
|
|
51
52
|
style,
|
|
52
53
|
anchor,
|
|
53
|
-
ref
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
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
|
-
|
|
54
|
+
ref,
|
|
55
|
+
children: [
|
|
56
|
+
type === "multi" && /* @__PURE__ */ jsxs(
|
|
57
|
+
StyledContainerCheckAll,
|
|
58
|
+
{
|
|
59
|
+
onClick: hideSearchBar ? onClickCheckAll : void 0,
|
|
60
|
+
children: [
|
|
61
|
+
/* @__PURE__ */ jsx(Checkbox, { checked: checkedAll, onChange: onClickCheckAll }),
|
|
62
|
+
!hideSearchBar ? /* @__PURE__ */ jsx(SearchBarContainer, { children: /* @__PURE__ */ jsx(
|
|
63
|
+
SearchInput,
|
|
64
|
+
{
|
|
65
|
+
searchArg,
|
|
66
|
+
onChange,
|
|
67
|
+
fullWidth,
|
|
68
|
+
placeholder: searchBarPlaceholder
|
|
69
|
+
}
|
|
70
|
+
) }) : /* @__PURE__ */ jsx(StyledContainerTextLabel, { children: /* @__PURE__ */ jsx(Text, { fontWeight: "bold", children: /* @__PURE__ */ jsx(StyledSpan, { children: selectAllLabel }) }) })
|
|
71
|
+
]
|
|
72
|
+
}
|
|
73
|
+
),
|
|
74
|
+
type === "single" && !hideSearchBar && /* @__PURE__ */ jsx(PaddedContainer, { children: /* @__PURE__ */ jsx(
|
|
75
|
+
SearchInput,
|
|
76
|
+
{
|
|
77
|
+
searchArg,
|
|
78
|
+
onChange,
|
|
79
|
+
fullWidth,
|
|
80
|
+
placeholder: searchBarPlaceholder
|
|
81
|
+
}
|
|
82
|
+
) }),
|
|
83
|
+
/* @__PURE__ */ jsx(OptionsContainer, { lengthOptions: options.length, children: options.map((item, index) => /* @__PURE__ */ jsx(
|
|
84
|
+
ItemSelect,
|
|
85
|
+
{
|
|
86
|
+
type,
|
|
87
|
+
item,
|
|
88
|
+
onSelect,
|
|
89
|
+
value,
|
|
90
|
+
keyExtractor,
|
|
91
|
+
index,
|
|
92
|
+
labelExtractor,
|
|
93
|
+
setDropDownVisible,
|
|
94
|
+
checkedAll,
|
|
95
|
+
setCheckedAll,
|
|
96
|
+
lenghtOptions: lengthOptions
|
|
97
|
+
},
|
|
98
|
+
keyExtractor(item)
|
|
99
|
+
)) })
|
|
100
|
+
]
|
|
101
|
+
}
|
|
97
102
|
);
|
|
98
103
|
};
|
|
99
104
|
const Dropdown = React__default.forwardRef(Component);
|