@tecsinapse/react-web-kit 1.22.7 → 1.22.8
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 +20 -47
- package/dist/cjs/components/atoms/Accordion/Accordion.js.map +1 -1
- package/dist/cjs/components/atoms/Badge/Badge.js +9 -43
- package/dist/cjs/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/cjs/components/atoms/Button/Button.js +15 -55
- package/dist/cjs/components/atoms/Button/Button.js.map +1 -1
- package/dist/cjs/components/atoms/Button/hooks/useMouseHover.js +2 -2
- package/dist/cjs/components/atoms/Button/hooks/useMouseHover.js.map +1 -1
- package/dist/cjs/components/atoms/Button/hooks/useMousePressed.js +2 -2
- package/dist/cjs/components/atoms/Button/hooks/useMousePressed.js.map +1 -1
- package/dist/cjs/components/atoms/Button/styled.js +2 -2
- package/dist/cjs/components/atoms/Button/styled.js.map +1 -1
- package/dist/cjs/components/atoms/Dropdown/index.js +1 -17
- package/dist/cjs/components/atoms/Dropdown/index.js.map +1 -1
- package/dist/cjs/components/atoms/Input/Input.js +27 -79
- package/dist/cjs/components/atoms/Input/Input.js.map +1 -1
- package/dist/cjs/components/atoms/InputMask/InputMask.js +27 -79
- package/dist/cjs/components/atoms/InputMask/InputMask.js.map +1 -1
- package/dist/cjs/components/atoms/Modal/Modal.js +15 -43
- package/dist/cjs/components/atoms/Modal/Modal.js.map +1 -1
- package/dist/cjs/components/atoms/Overlay/Overlay.js +4 -17
- package/dist/cjs/components/atoms/Overlay/Overlay.js.map +1 -1
- package/dist/cjs/components/atoms/Skeleton/Skeleton.js +13 -47
- package/dist/cjs/components/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/cjs/components/atoms/Skeleton/styled.js +2 -8
- package/dist/cjs/components/atoms/Skeleton/styled.js.map +1 -1
- package/dist/cjs/components/atoms/Switch/Switch.js +21 -53
- package/dist/cjs/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/cjs/components/atoms/Table/Body/TBody.js +7 -35
- package/dist/cjs/components/atoms/Table/Body/TBody.js.map +1 -1
- package/dist/cjs/components/atoms/Table/Cell/Td.js +7 -35
- package/dist/cjs/components/atoms/Table/Cell/Td.js.map +1 -1
- package/dist/cjs/components/atoms/Table/Container/TableContainer.js +7 -35
- package/dist/cjs/components/atoms/Table/Container/TableContainer.js.map +1 -1
- package/dist/cjs/components/atoms/Table/Footer/TFoot.js +7 -35
- package/dist/cjs/components/atoms/Table/Footer/TFoot.js.map +1 -1
- package/dist/cjs/components/atoms/Table/Header/THead.js +7 -35
- package/dist/cjs/components/atoms/Table/Header/THead.js.map +1 -1
- package/dist/cjs/components/atoms/Table/Header/Th.js +7 -35
- package/dist/cjs/components/atoms/Table/Header/Th.js.map +1 -1
- package/dist/cjs/components/atoms/Table/Row/Tr.js +7 -35
- package/dist/cjs/components/atoms/Table/Row/Tr.js.map +1 -1
- package/dist/cjs/components/atoms/Table/Table.js +7 -35
- package/dist/cjs/components/atoms/Table/Table.js.map +1 -1
- package/dist/cjs/components/atoms/Table/Toolbar/TableToolbar.js +9 -39
- package/dist/cjs/components/atoms/Table/Toolbar/TableToolbar.js.map +1 -1
- package/dist/cjs/components/atoms/Tag/Tag.js +9 -39
- package/dist/cjs/components/atoms/Tag/Tag.js.map +1 -1
- package/dist/cjs/components/atoms/Tooltip/Tooltip.js +2 -3
- package/dist/cjs/components/atoms/Tooltip/Tooltip.js.map +1 -1
- package/dist/cjs/components/molecules/Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js +3 -21
- package/dist/cjs/components/molecules/Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js.map +1 -1
- package/dist/cjs/components/molecules/Breadcrumbs/Breadcrumbs.js +4 -31
- package/dist/cjs/components/molecules/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/cjs/components/molecules/DatePicker/DatePicker.js +22 -57
- package/dist/cjs/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/cjs/components/molecules/DateTimePicker/DateTimePicker.js +4 -35
- package/dist/cjs/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/cjs/components/molecules/Drawer/Drawer.js +21 -48
- package/dist/cjs/components/molecules/Drawer/Drawer.js.map +1 -1
- package/dist/cjs/components/molecules/Grid/Grid.js +24 -57
- package/dist/cjs/components/molecules/Grid/Grid.js.map +1 -1
- package/dist/cjs/components/molecules/Grid/Item/Item.js +30 -76
- package/dist/cjs/components/molecules/Grid/Item/Item.js.map +1 -1
- package/dist/cjs/components/molecules/Grid/Item/functions.js +2 -3
- package/dist/cjs/components/molecules/Grid/Item/functions.js.map +1 -1
- package/dist/cjs/components/molecules/IconTextButton/IconTextButton.js +13 -47
- package/dist/cjs/components/molecules/IconTextButton/IconTextButton.js.map +1 -1
- package/dist/cjs/components/molecules/IconTextButton/TextComponent.js +6 -22
- package/dist/cjs/components/molecules/IconTextButton/TextComponent.js.map +1 -1
- package/dist/cjs/components/molecules/IconTextButton/styled.js +2 -2
- package/dist/cjs/components/molecules/IconTextButton/styled.js.map +1 -1
- package/dist/cjs/components/molecules/InputPassword/InputPassword.js +4 -35
- package/dist/cjs/components/molecules/InputPassword/InputPassword.js.map +1 -1
- package/dist/cjs/components/molecules/LabeledSwitch/LabelComponent.js +15 -47
- package/dist/cjs/components/molecules/LabeledSwitch/LabelComponent.js.map +1 -1
- package/dist/cjs/components/molecules/LabeledSwitch/LabeledSwitch.js +14 -49
- package/dist/cjs/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -1
- package/dist/cjs/components/molecules/LabeledSwitch/styled.js +2 -2
- package/dist/cjs/components/molecules/LabeledSwitch/styled.js.map +1 -1
- package/dist/cjs/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.js +5 -23
- package/dist/cjs/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.js.map +1 -1
- package/dist/cjs/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js +3 -21
- package/dist/cjs/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js.map +1 -1
- package/dist/cjs/components/molecules/Menubar/Menubar.js +15 -51
- package/dist/cjs/components/molecules/Menubar/Menubar.js.map +1 -1
- package/dist/cjs/components/molecules/Menubar/MostUsed/MostUsed.js +3 -21
- package/dist/cjs/components/molecules/Menubar/MostUsed/MostUsed.js.map +1 -1
- package/dist/cjs/components/molecules/Menubar/SearchResultItem/SearchResultItem.js +3 -21
- package/dist/cjs/components/molecules/Menubar/SearchResultItem/SearchResultItem.js.map +1 -1
- package/dist/cjs/components/molecules/Menubar/SearchResultItem/utils.js +4 -19
- package/dist/cjs/components/molecules/Menubar/SearchResultItem/utils.js.map +1 -1
- package/dist/cjs/components/molecules/Menubar/animations.js +8 -18
- package/dist/cjs/components/molecules/Menubar/animations.js.map +1 -1
- package/dist/cjs/components/molecules/Menubar/utils.js +1 -2
- package/dist/cjs/components/molecules/Menubar/utils.js.map +1 -1
- package/dist/cjs/components/molecules/Select/Dropdown/Dropdown.js +2 -2
- package/dist/cjs/components/molecules/Select/Dropdown/Dropdown.js.map +1 -1
- package/dist/cjs/components/molecules/Select/Select.js +28 -73
- package/dist/cjs/components/molecules/Select/Select.js.map +1 -1
- package/dist/cjs/components/molecules/Snackbar/Snackbar.js +10 -41
- package/dist/cjs/components/molecules/Snackbar/Snackbar.js.map +1 -1
- package/dist/cjs/components/molecules/TextArea/TextArea.js +29 -83
- package/dist/cjs/components/molecules/TextArea/TextArea.js.map +1 -1
- package/dist/cjs/components/organisms/DataGrid/DataGrid.js +36 -86
- package/dist/cjs/components/organisms/DataGrid/DataGrid.js.map +1 -1
- package/dist/cjs/components/organisms/DataGrid/Footer/Footer.js +5 -5
- package/dist/cjs/components/organisms/DataGrid/Footer/Footer.js.map +1 -1
- package/dist/cjs/components/organisms/DataGrid/Header/Header.js +5 -5
- package/dist/cjs/components/organisms/DataGrid/Header/Header.js.map +1 -1
- package/dist/esm/components/atoms/Accordion/Accordion.js +21 -48
- package/dist/esm/components/atoms/Accordion/Accordion.js.map +1 -1
- package/dist/esm/components/atoms/Badge/Badge.js +9 -43
- package/dist/esm/components/atoms/Badge/Badge.js.map +1 -1
- package/dist/esm/components/atoms/Button/Button.js +15 -55
- package/dist/esm/components/atoms/Button/Button.js.map +1 -1
- package/dist/esm/components/atoms/Button/hooks/useMouseHover.js +2 -2
- package/dist/esm/components/atoms/Button/hooks/useMouseHover.js.map +1 -1
- package/dist/esm/components/atoms/Button/hooks/useMousePressed.js +2 -2
- package/dist/esm/components/atoms/Button/hooks/useMousePressed.js.map +1 -1
- package/dist/esm/components/atoms/Button/styled.js +2 -2
- package/dist/esm/components/atoms/Button/styled.js.map +1 -1
- package/dist/esm/components/atoms/Dropdown/index.js +1 -17
- package/dist/esm/components/atoms/Dropdown/index.js.map +1 -1
- package/dist/esm/components/atoms/Input/Input.js +27 -79
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputMask/InputMask.js +27 -79
- package/dist/esm/components/atoms/InputMask/InputMask.js.map +1 -1
- package/dist/esm/components/atoms/Modal/Modal.js +15 -43
- package/dist/esm/components/atoms/Modal/Modal.js.map +1 -1
- package/dist/esm/components/atoms/Overlay/Overlay.js +4 -17
- package/dist/esm/components/atoms/Overlay/Overlay.js.map +1 -1
- package/dist/esm/components/atoms/Skeleton/Skeleton.js +13 -47
- package/dist/esm/components/atoms/Skeleton/Skeleton.js.map +1 -1
- package/dist/esm/components/atoms/Skeleton/styled.js +2 -8
- package/dist/esm/components/atoms/Skeleton/styled.js.map +1 -1
- package/dist/esm/components/atoms/Switch/Switch.js +21 -53
- package/dist/esm/components/atoms/Switch/Switch.js.map +1 -1
- package/dist/esm/components/atoms/Table/Body/TBody.js +7 -35
- package/dist/esm/components/atoms/Table/Body/TBody.js.map +1 -1
- package/dist/esm/components/atoms/Table/Cell/Td.js +7 -35
- package/dist/esm/components/atoms/Table/Cell/Td.js.map +1 -1
- package/dist/esm/components/atoms/Table/Container/TableContainer.js +7 -35
- package/dist/esm/components/atoms/Table/Container/TableContainer.js.map +1 -1
- package/dist/esm/components/atoms/Table/Footer/TFoot.js +7 -35
- package/dist/esm/components/atoms/Table/Footer/TFoot.js.map +1 -1
- package/dist/esm/components/atoms/Table/Header/THead.js +7 -35
- package/dist/esm/components/atoms/Table/Header/THead.js.map +1 -1
- package/dist/esm/components/atoms/Table/Header/Th.js +7 -35
- package/dist/esm/components/atoms/Table/Header/Th.js.map +1 -1
- package/dist/esm/components/atoms/Table/Row/Tr.js +7 -35
- package/dist/esm/components/atoms/Table/Row/Tr.js.map +1 -1
- package/dist/esm/components/atoms/Table/Table.js +7 -35
- package/dist/esm/components/atoms/Table/Table.js.map +1 -1
- package/dist/esm/components/atoms/Table/Toolbar/TableToolbar.js +9 -39
- package/dist/esm/components/atoms/Table/Toolbar/TableToolbar.js.map +1 -1
- package/dist/esm/components/atoms/Tag/Tag.js +9 -39
- package/dist/esm/components/atoms/Tag/Tag.js.map +1 -1
- package/dist/esm/components/atoms/Tooltip/Tooltip.js +2 -3
- package/dist/esm/components/atoms/Tooltip/Tooltip.js.map +1 -1
- package/dist/esm/components/molecules/Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js +3 -21
- package/dist/esm/components/molecules/Breadcrumbs/BreadcrumbItem/BreadcrumbItem.js.map +1 -1
- package/dist/esm/components/molecules/Breadcrumbs/Breadcrumbs.js +4 -31
- package/dist/esm/components/molecules/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/esm/components/molecules/DatePicker/DatePicker.js +22 -57
- package/dist/esm/components/molecules/DatePicker/DatePicker.js.map +1 -1
- package/dist/esm/components/molecules/DateTimePicker/DateTimePicker.js +4 -35
- package/dist/esm/components/molecules/DateTimePicker/DateTimePicker.js.map +1 -1
- package/dist/esm/components/molecules/Drawer/Drawer.js +21 -48
- package/dist/esm/components/molecules/Drawer/Drawer.js.map +1 -1
- package/dist/esm/components/molecules/Grid/Grid.js +24 -57
- package/dist/esm/components/molecules/Grid/Grid.js.map +1 -1
- package/dist/esm/components/molecules/Grid/Item/Item.js +30 -76
- package/dist/esm/components/molecules/Grid/Item/Item.js.map +1 -1
- package/dist/esm/components/molecules/Grid/Item/functions.js +2 -3
- package/dist/esm/components/molecules/Grid/Item/functions.js.map +1 -1
- package/dist/esm/components/molecules/IconTextButton/IconTextButton.js +13 -47
- package/dist/esm/components/molecules/IconTextButton/IconTextButton.js.map +1 -1
- package/dist/esm/components/molecules/IconTextButton/TextComponent.js +6 -22
- package/dist/esm/components/molecules/IconTextButton/TextComponent.js.map +1 -1
- package/dist/esm/components/molecules/IconTextButton/styled.js +2 -2
- package/dist/esm/components/molecules/IconTextButton/styled.js.map +1 -1
- package/dist/esm/components/molecules/InputPassword/InputPassword.js +4 -35
- package/dist/esm/components/molecules/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/molecules/LabeledSwitch/LabelComponent.js +15 -47
- package/dist/esm/components/molecules/LabeledSwitch/LabelComponent.js.map +1 -1
- package/dist/esm/components/molecules/LabeledSwitch/LabeledSwitch.js +14 -49
- package/dist/esm/components/molecules/LabeledSwitch/LabeledSwitch.js.map +1 -1
- package/dist/esm/components/molecules/LabeledSwitch/styled.js +2 -2
- package/dist/esm/components/molecules/LabeledSwitch/styled.js.map +1 -1
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.js +5 -23
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.js.map +1 -1
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js +3 -21
- package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js.map +1 -1
- package/dist/esm/components/molecules/Menubar/Menubar.js +15 -51
- package/dist/esm/components/molecules/Menubar/Menubar.js.map +1 -1
- package/dist/esm/components/molecules/Menubar/MostUsed/MostUsed.js +3 -21
- package/dist/esm/components/molecules/Menubar/MostUsed/MostUsed.js.map +1 -1
- package/dist/esm/components/molecules/Menubar/SearchResultItem/SearchResultItem.js +3 -21
- package/dist/esm/components/molecules/Menubar/SearchResultItem/SearchResultItem.js.map +1 -1
- package/dist/esm/components/molecules/Menubar/SearchResultItem/utils.js +4 -19
- package/dist/esm/components/molecules/Menubar/SearchResultItem/utils.js.map +1 -1
- package/dist/esm/components/molecules/Menubar/animations.js +8 -18
- package/dist/esm/components/molecules/Menubar/animations.js.map +1 -1
- package/dist/esm/components/molecules/Menubar/utils.js +1 -2
- package/dist/esm/components/molecules/Menubar/utils.js.map +1 -1
- package/dist/esm/components/molecules/Select/Dropdown/Dropdown.js +2 -2
- package/dist/esm/components/molecules/Select/Dropdown/Dropdown.js.map +1 -1
- package/dist/esm/components/molecules/Select/Select.js +29 -74
- package/dist/esm/components/molecules/Select/Select.js.map +1 -1
- package/dist/esm/components/molecules/Snackbar/Snackbar.js +10 -41
- package/dist/esm/components/molecules/Snackbar/Snackbar.js.map +1 -1
- package/dist/esm/components/molecules/TextArea/TextArea.js +29 -83
- package/dist/esm/components/molecules/TextArea/TextArea.js.map +1 -1
- package/dist/esm/components/organisms/DataGrid/DataGrid.js +36 -86
- package/dist/esm/components/organisms/DataGrid/DataGrid.js.map +1 -1
- package/dist/esm/components/organisms/DataGrid/Footer/Footer.js +5 -5
- package/dist/esm/components/organisms/DataGrid/Footer/Footer.js.map +1 -1
- package/dist/esm/components/organisms/DataGrid/Header/Header.js +5 -5
- package/dist/esm/components/organisms/DataGrid/Header/Header.js.map +1 -1
- package/package.json +3 -3
|
@@ -1,13 +1,12 @@
|
|
|
1
1
|
const getSpan = (value, sm, md, lg) => {
|
|
2
|
-
var _a, _b, _c;
|
|
3
2
|
if (!value)
|
|
4
3
|
return 0;
|
|
5
4
|
if (sm)
|
|
6
5
|
return value.sm;
|
|
7
6
|
if (md)
|
|
8
|
-
return
|
|
7
|
+
return value?.md ?? value.sm;
|
|
9
8
|
if (lg)
|
|
10
|
-
return
|
|
9
|
+
return value?.lg ?? value?.md ?? value.sm;
|
|
11
10
|
return 0;
|
|
12
11
|
};
|
|
13
12
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"functions.js","sources":["../../../../../../src/components/molecules/Grid/Item/functions.ts"],"sourcesContent":["import { Span } from './Item';\n\nexport const getSpan = (\n value: Span,\n sm: boolean,\n md: boolean,\n lg: boolean\n): number => {\n if (!value) return 0;\n if (sm) return value.sm;\n if (md) return value?.md ?? value.sm;\n if (lg) return value?.lg ?? value?.md ?? value.sm;\n return 0;\n};\n"],"names":[],"mappings":"AAEO,MAAM,OAAU,GAAA,CACrB,KACA,EAAA,EAAA,EACA,IACA,EACW,KAAA;
|
|
1
|
+
{"version":3,"file":"functions.js","sources":["../../../../../../src/components/molecules/Grid/Item/functions.ts"],"sourcesContent":["import { Span } from './Item';\n\nexport const getSpan = (\n value: Span,\n sm: boolean,\n md: boolean,\n lg: boolean\n): number => {\n if (!value) return 0;\n if (sm) return value.sm;\n if (md) return value?.md ?? value.sm;\n if (lg) return value?.lg ?? value?.md ?? value.sm;\n return 0;\n};\n"],"names":[],"mappings":"AAEO,MAAM,OAAU,GAAA,CACrB,KACA,EAAA,EAAA,EACA,IACA,EACW,KAAA;AACX,EAAA,IAAI,CAAC,KAAA;AAAO,IAAO,OAAA,CAAA,CAAA;AACnB,EAAI,IAAA,EAAA;AAAI,IAAA,OAAO,KAAM,CAAA,EAAA,CAAA;AACrB,EAAI,IAAA,EAAA;AAAI,IAAO,OAAA,KAAA,EAAO,MAAM,KAAM,CAAA,EAAA,CAAA;AAClC,EAAI,IAAA,EAAA;AAAI,IAAA,OAAO,KAAO,EAAA,EAAA,IAAM,KAAO,EAAA,EAAA,IAAM,KAAM,CAAA,EAAA,CAAA;AAC/C,EAAO,OAAA,CAAA,CAAA;AACT;;;;"}
|
|
@@ -4,60 +4,26 @@ import useIconTextButton from './hooks/useIconTextButton.js';
|
|
|
4
4
|
import { StyledIconTextButton } from './styled.js';
|
|
5
5
|
import TextComponent from './TextComponent.js';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __objRest = (source, exclude) => {
|
|
24
|
-
var target = {};
|
|
25
|
-
for (var prop in source)
|
|
26
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
27
|
-
target[prop] = source[prop];
|
|
28
|
-
if (source != null && __getOwnPropSymbols)
|
|
29
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
30
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
31
|
-
target[prop] = source[prop];
|
|
32
|
-
}
|
|
33
|
-
return target;
|
|
34
|
-
};
|
|
35
|
-
const IconTextButton = (_a) => {
|
|
36
|
-
var _b = _a, {
|
|
37
|
-
iconProps,
|
|
38
|
-
iconPosition = "left",
|
|
39
|
-
textProps,
|
|
40
|
-
label,
|
|
41
|
-
variant = "filled",
|
|
42
|
-
size = "default"
|
|
43
|
-
} = _b, rest = __objRest(_b, [
|
|
44
|
-
"iconProps",
|
|
45
|
-
"iconPosition",
|
|
46
|
-
"textProps",
|
|
47
|
-
"label",
|
|
48
|
-
"variant",
|
|
49
|
-
"size"
|
|
50
|
-
]);
|
|
7
|
+
const IconTextButton = ({
|
|
8
|
+
iconProps,
|
|
9
|
+
iconPosition = "left",
|
|
10
|
+
textProps,
|
|
11
|
+
label,
|
|
12
|
+
variant = "filled",
|
|
13
|
+
size = "default",
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
51
16
|
const { handleHover, handlePressed, defaultFontColor } = useIconTextButton(variant);
|
|
52
|
-
return /* @__PURE__ */ React.createElement(StyledIconTextButton,
|
|
17
|
+
return /* @__PURE__ */ React.createElement(StyledIconTextButton, {
|
|
53
18
|
boxed: !label,
|
|
54
19
|
variant,
|
|
55
20
|
size,
|
|
56
21
|
onMouseOut: () => handleHover(true),
|
|
57
22
|
onMouseOver: () => handleHover(false),
|
|
58
23
|
onPressIn: () => handlePressed(true),
|
|
59
|
-
onPressOut: () => handlePressed(false)
|
|
60
|
-
|
|
24
|
+
onPressOut: () => handlePressed(false),
|
|
25
|
+
...rest
|
|
26
|
+
}, iconPosition === "left" ? /* @__PURE__ */ React.createElement(IconComponent, {
|
|
61
27
|
iconProps,
|
|
62
28
|
size,
|
|
63
29
|
defaultFontColor
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IconTextButton.js","sources":["../../../../../src/components/molecules/IconTextButton/IconTextButton.tsx"],"sourcesContent":["import { IconComponent, IconTextButtonProps } from '@tecsinapse/react-core';\nimport React from 'react';\nimport { WebButtonProps } from '../../atoms/Button';\nimport useIconTextButton from './hooks/useIconTextButton';\nimport { StyledIconTextButton } from './styled';\nimport TextComponent from './TextComponent';\n\nexport type WebIconTextButtonProps = IconTextButtonProps &\n Omit<WebButtonProps, 'ButtonProps'>;\n\nconst IconTextButton: React.FC<WebIconTextButtonProps> = ({\n iconProps,\n iconPosition = 'left',\n textProps,\n label,\n variant = 'filled',\n size = 'default',\n ...rest\n}): JSX.Element => {\n const { handleHover, handlePressed, defaultFontColor } =\n useIconTextButton(variant);\n\n return (\n <StyledIconTextButton\n boxed={!label}\n variant={variant}\n size={size}\n onMouseOut={() => handleHover(true)}\n onMouseOver={() => handleHover(false)}\n onPressIn={() => handlePressed(true)}\n onPressOut={() => handlePressed(false)}\n {...rest}\n >\n {iconPosition === 'left' ? (\n <IconComponent\n iconProps={iconProps}\n size={size}\n defaultFontColor={defaultFontColor}\n />\n ) : (\n <></>\n )}\n <TextComponent\n label={label}\n defaultFontColor={defaultFontColor}\n hasIcon={!!iconProps}\n iconPosition={iconPosition}\n textProps={textProps}\n size={size}\n />\n {iconPosition === 'right' ? (\n <IconComponent\n iconProps={iconProps}\n size={size}\n defaultFontColor={defaultFontColor}\n />\n ) : (\n <></>\n )}\n </StyledIconTextButton>\n );\n};\n\nexport default IconTextButton;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"IconTextButton.js","sources":["../../../../../src/components/molecules/IconTextButton/IconTextButton.tsx"],"sourcesContent":["import { IconComponent, IconTextButtonProps } from '@tecsinapse/react-core';\nimport React from 'react';\nimport { WebButtonProps } from '../../atoms/Button';\nimport useIconTextButton from './hooks/useIconTextButton';\nimport { StyledIconTextButton } from './styled';\nimport TextComponent from './TextComponent';\n\nexport type WebIconTextButtonProps = IconTextButtonProps &\n Omit<WebButtonProps, 'ButtonProps'>;\n\nconst IconTextButton: React.FC<WebIconTextButtonProps> = ({\n iconProps,\n iconPosition = 'left',\n textProps,\n label,\n variant = 'filled',\n size = 'default',\n ...rest\n}): JSX.Element => {\n const { handleHover, handlePressed, defaultFontColor } =\n useIconTextButton(variant);\n\n return (\n <StyledIconTextButton\n boxed={!label}\n variant={variant}\n size={size}\n onMouseOut={() => handleHover(true)}\n onMouseOver={() => handleHover(false)}\n onPressIn={() => handlePressed(true)}\n onPressOut={() => handlePressed(false)}\n {...rest}\n >\n {iconPosition === 'left' ? (\n <IconComponent\n iconProps={iconProps}\n size={size}\n defaultFontColor={defaultFontColor}\n />\n ) : (\n <></>\n )}\n <TextComponent\n label={label}\n defaultFontColor={defaultFontColor}\n hasIcon={!!iconProps}\n iconPosition={iconPosition}\n textProps={textProps}\n size={size}\n />\n {iconPosition === 'right' ? (\n <IconComponent\n iconProps={iconProps}\n size={size}\n defaultFontColor={defaultFontColor}\n />\n ) : (\n <></>\n )}\n </StyledIconTextButton>\n );\n};\n\nexport default IconTextButton;\n"],"names":[],"mappings":";;;;;;AAUA,MAAM,iBAAmD,CAAC;AAAA,EACxD,SAAA;AAAA,EACA,YAAe,GAAA,MAAA;AAAA,EACf,SAAA;AAAA,EACA,KAAA;AAAA,EACA,OAAU,GAAA,QAAA;AAAA,EACV,IAAO,GAAA,SAAA;AAAA,EACJ,GAAA,IAAA;AACL,CAAmB,KAAA;AACjB,EAAA,MAAM,EAAE,WAAa,EAAA,aAAA,EAAe,gBAAiB,EAAA,GACnD,kBAAkB,OAAO,CAAA,CAAA;AAE3B,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,oBAAA,EAAA;AAAA,IACC,OAAO,CAAC,KAAA;AAAA,IACR,OAAA;AAAA,IACA,IAAA;AAAA,IACA,UAAA,EAAY,MAAM,WAAA,CAAY,IAAI,CAAA;AAAA,IAClC,WAAA,EAAa,MAAM,WAAA,CAAY,KAAK,CAAA;AAAA,IACpC,SAAA,EAAW,MAAM,aAAA,CAAc,IAAI,CAAA;AAAA,IACnC,UAAA,EAAY,MAAM,aAAA,CAAc,KAAK,CAAA;AAAA,IACpC,GAAG,IAAA;AAAA,GAEH,EAAA,YAAA,KAAiB,yBACf,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA;AAAA,IACC,SAAA;AAAA,IACA,IAAA;AAAA,IACA,gBAAA;AAAA,GACF,CAAA,mBAEE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,CAAA,kBAEH,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA;AAAA,IACC,KAAA;AAAA,IACA,gBAAA;AAAA,IACA,OAAA,EAAS,CAAC,CAAC,SAAA;AAAA,IACX,YAAA;AAAA,IACA,SAAA;AAAA,IACA,IAAA;AAAA,GACF,CAAA,EACC,YAAiB,KAAA,OAAA,mBACf,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA;AAAA,IACC,SAAA;AAAA,IACA,IAAA;AAAA,IACA,gBAAA;AAAA,GACF,CAAA,2DAEE,CAEN,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
import { Text } from '@tecsinapse/react-core';
|
|
2
2
|
import React from 'react';
|
|
3
3
|
|
|
4
|
-
var __defProp = Object.defineProperty;
|
|
5
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
6
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
7
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
8
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
9
|
-
var __spreadValues = (a, b) => {
|
|
10
|
-
for (var prop in b || (b = {}))
|
|
11
|
-
if (__hasOwnProp.call(b, prop))
|
|
12
|
-
__defNormalProp(a, prop, b[prop]);
|
|
13
|
-
if (__getOwnPropSymbols)
|
|
14
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
15
|
-
if (__propIsEnum.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
}
|
|
18
|
-
return a;
|
|
19
|
-
};
|
|
20
4
|
const TextComponent = ({
|
|
21
5
|
textProps,
|
|
22
6
|
size = "default",
|
|
23
7
|
defaultFontColor,
|
|
24
8
|
label
|
|
25
9
|
}) => {
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
},
|
|
10
|
+
return label ? /* @__PURE__ */ React.createElement(Text, {
|
|
11
|
+
typography: textProps?.typography ?? size === "small" ? "sub" : "base",
|
|
12
|
+
fontWeight: textProps?.fontWeight ?? "bold",
|
|
13
|
+
fontColor: textProps?.fontColor ?? defaultFontColor,
|
|
14
|
+
...textProps
|
|
15
|
+
}, label) : /* @__PURE__ */ React.createElement(React.Fragment, null);
|
|
32
16
|
};
|
|
33
17
|
var TextComponent$1 = React.memo(TextComponent);
|
|
34
18
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TextComponent.js","sources":["../../../../../src/components/molecules/IconTextButton/TextComponent.tsx"],"sourcesContent":["import {\n ButtonSizeType,\n FontColor,\n IconPositionOptions,\n Text,\n TextProps,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\n\ninterface TextComponentProps {\n textProps?: TextProps;\n size?: ButtonSizeType;\n defaultFontColor: keyof FontColor;\n label?: string;\n iconPosition?: IconPositionOptions;\n hasIcon?: boolean;\n}\n\nconst TextComponent: FC<TextComponentProps> = ({\n textProps,\n size = 'default',\n defaultFontColor,\n label,\n}) => {\n return label ? (\n <Text\n typography={textProps?.typography ?? size === 'small' ? 'sub' : 'base'}\n fontWeight={textProps?.fontWeight ?? 'bold'}\n fontColor={textProps?.fontColor ?? defaultFontColor}\n {...textProps}\n >\n {label}\n </Text>\n ) : (\n <></>\n );\n};\n\nexport default React.memo(TextComponent);\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"TextComponent.js","sources":["../../../../../src/components/molecules/IconTextButton/TextComponent.tsx"],"sourcesContent":["import {\n ButtonSizeType,\n FontColor,\n IconPositionOptions,\n Text,\n TextProps,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\n\ninterface TextComponentProps {\n textProps?: TextProps;\n size?: ButtonSizeType;\n defaultFontColor: keyof FontColor;\n label?: string;\n iconPosition?: IconPositionOptions;\n hasIcon?: boolean;\n}\n\nconst TextComponent: FC<TextComponentProps> = ({\n textProps,\n size = 'default',\n defaultFontColor,\n label,\n}) => {\n return label ? (\n <Text\n typography={textProps?.typography ?? size === 'small' ? 'sub' : 'base'}\n fontWeight={textProps?.fontWeight ?? 'bold'}\n fontColor={textProps?.fontColor ?? defaultFontColor}\n {...textProps}\n >\n {label}\n </Text>\n ) : (\n <></>\n );\n};\n\nexport default React.memo(TextComponent);\n"],"names":[],"mappings":";;;AAkBA,MAAM,gBAAwC,CAAC;AAAA,EAC7C,SAAA;AAAA,EACA,IAAO,GAAA,SAAA;AAAA,EACP,gBAAA;AAAA,EACA,KAAA;AACF,CAAM,KAAA;AACJ,EAAA,OAAO,wBACJ,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,IACC,UAAY,EAAA,SAAA,EAAW,UAAc,IAAA,IAAA,KAAS,UAAU,KAAQ,GAAA,MAAA;AAAA,IAChE,UAAA,EAAY,WAAW,UAAc,IAAA,MAAA;AAAA,IACrC,SAAA,EAAW,WAAW,SAAa,IAAA,gBAAA;AAAA,IAClC,GAAG,SAAA;AAAA,GAEH,EAAA,KACH,oBAEE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,CAAA,CAAA;AAEN,CAAA,CAAA;AAEA,sBAAe,KAAA,CAAM,KAAK,aAAa,CAAA;;;;"}
|
|
@@ -3,11 +3,11 @@ import Button from '../../atoms/Button/Button.js';
|
|
|
3
3
|
import 'react';
|
|
4
4
|
|
|
5
5
|
const boxedStyle = ({ theme }) => `
|
|
6
|
-
padding: ${theme
|
|
6
|
+
padding: ${theme?.spacing.centi};
|
|
7
7
|
aspect-ratio: 1;
|
|
8
8
|
`;
|
|
9
9
|
const StyledIconTextButton = nativeStyled(Button)`
|
|
10
|
-
gap: ${({ theme }) => theme
|
|
10
|
+
gap: ${({ theme }) => theme?.spacing.mili};
|
|
11
11
|
${({ boxed, theme }) => boxed && boxedStyle({ theme })};
|
|
12
12
|
`;
|
|
13
13
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../../src/components/molecules/IconTextButton/styled.ts"],"sourcesContent":["import styled from '@emotion/native';\nimport { StyleProps } from '@tecsinapse/react-core';\nimport { Button } from '../../atoms/Button';\n\nconst boxedStyle = ({ theme }: Partial<StyleProps>) =>\n `\n padding: ${theme?.spacing.centi};\n aspect-ratio: 1;\n `;\n\nexport const StyledIconTextButton = styled(Button)<\n Partial<StyleProps> & {\n boxed: boolean;\n }\n>`\n gap: ${({ theme }) => theme?.spacing.mili};\n ${({ boxed, theme }) => boxed && boxedStyle({ theme })};\n`;\n"],"names":["styled"],"mappings":";;;;AAIA,MAAM,UAAa,GAAA,CAAC,EAAE,KAAA,EACpB,KAAA,CAAA;AAAA,aAAA,EACa
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../../src/components/molecules/IconTextButton/styled.ts"],"sourcesContent":["import styled from '@emotion/native';\nimport { StyleProps } from '@tecsinapse/react-core';\nimport { Button } from '../../atoms/Button';\n\nconst boxedStyle = ({ theme }: Partial<StyleProps>) =>\n `\n padding: ${theme?.spacing.centi};\n aspect-ratio: 1;\n `;\n\nexport const StyledIconTextButton = styled(Button)<\n Partial<StyleProps> & {\n boxed: boolean;\n }\n>`\n gap: ${({ theme }) => theme?.spacing.mili};\n ${({ boxed, theme }) => boxed && boxedStyle({ theme })};\n`;\n"],"names":["styled"],"mappings":";;;;AAIA,MAAM,UAAa,GAAA,CAAC,EAAE,KAAA,EACpB,KAAA,CAAA;AAAA,aAAA,EACa,OAAO,OAAQ,CAAA,KAAA,CAAA;AAAA;AAAA,EAAA,CAAA,CAAA;AAIjB,MAAA,oBAAA,GAAuBA,aAAO,MAAM,CAAA,CAAA;AAAA,OAAA,EAKxC,CAAC,EAAE,KAAM,EAAA,KAAM,OAAO,OAAQ,CAAA,IAAA,CAAA;AAAA,EACnC,EAAA,CAAC,EAAE,KAAO,EAAA,KAAA,OAAY,KAAS,IAAA,UAAA,CAAW,EAAE,KAAA,EAAO,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -2,42 +2,11 @@ import { InputPasswordIcon } from '@tecsinapse/react-core';
|
|
|
2
2
|
import React, { useState } from 'react';
|
|
3
3
|
import Input from '../../atoms/Input/Input.js';
|
|
4
4
|
|
|
5
|
-
var __defProp = Object.defineProperty;
|
|
6
|
-
var __defProps = Object.defineProperties;
|
|
7
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
8
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
9
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
10
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
11
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
12
|
-
var __spreadValues = (a, b) => {
|
|
13
|
-
for (var prop in b || (b = {}))
|
|
14
|
-
if (__hasOwnProp.call(b, prop))
|
|
15
|
-
__defNormalProp(a, prop, b[prop]);
|
|
16
|
-
if (__getOwnPropSymbols)
|
|
17
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
18
|
-
if (__propIsEnum.call(b, prop))
|
|
19
|
-
__defNormalProp(a, prop, b[prop]);
|
|
20
|
-
}
|
|
21
|
-
return a;
|
|
22
|
-
};
|
|
23
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
24
|
-
var __objRest = (source, exclude) => {
|
|
25
|
-
var target = {};
|
|
26
|
-
for (var prop in source)
|
|
27
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
28
|
-
target[prop] = source[prop];
|
|
29
|
-
if (source != null && __getOwnPropSymbols)
|
|
30
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
31
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
32
|
-
target[prop] = source[prop];
|
|
33
|
-
}
|
|
34
|
-
return target;
|
|
35
|
-
};
|
|
36
5
|
const InputPassword = React.forwardRef(
|
|
37
|
-
(
|
|
38
|
-
var _b = _a, { rightComponent } = _b, rest = __objRest(_b, ["rightComponent"]);
|
|
6
|
+
({ rightComponent, ...rest }, ref) => {
|
|
39
7
|
const [revealed, setRevealed] = useState(false);
|
|
40
|
-
return /* @__PURE__ */ React.createElement(Input,
|
|
8
|
+
return /* @__PURE__ */ React.createElement(Input, {
|
|
9
|
+
...rest,
|
|
41
10
|
ref,
|
|
42
11
|
secureTextEntry: !revealed,
|
|
43
12
|
rightComponent: /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(InputPasswordIcon, {
|
|
@@ -45,7 +14,7 @@ const InputPassword = React.forwardRef(
|
|
|
45
14
|
revealed,
|
|
46
15
|
effect: "none"
|
|
47
16
|
}), rightComponent)
|
|
48
|
-
})
|
|
17
|
+
});
|
|
49
18
|
}
|
|
50
19
|
);
|
|
51
20
|
InputPassword.displayName = "InputPassword";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputPassword.js","sources":["../../../../../src/components/molecules/InputPassword/InputPassword.tsx"],"sourcesContent":["import { InputPasswordIcon } from '@tecsinapse/react-core';\nimport React, { FC, useState } from 'react';\nimport { Input, InputWebProps } from '../../atoms/Input';\n\nexport type InputPasswordWebProps = InputWebProps;\n\nconst InputPassword: FC<InputPasswordWebProps> = React.forwardRef(\n ({ rightComponent, ...rest }, ref) => {\n const [revealed, setRevealed] = useState(false);\n return (\n <Input\n {...rest}\n ref={ref}\n secureTextEntry={!revealed}\n rightComponent={\n <>\n <InputPasswordIcon\n onChangeState={setRevealed}\n revealed={revealed}\n effect=\"none\"\n />\n {rightComponent}\n </>\n }\n />\n );\n }\n);\n\nInputPassword.displayName = 'InputPassword';\n\nexport default InputPassword;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"InputPassword.js","sources":["../../../../../src/components/molecules/InputPassword/InputPassword.tsx"],"sourcesContent":["import { InputPasswordIcon } from '@tecsinapse/react-core';\nimport React, { FC, useState } from 'react';\nimport { Input, InputWebProps } from '../../atoms/Input';\n\nexport type InputPasswordWebProps = InputWebProps;\n\nconst InputPassword: FC<InputPasswordWebProps> = React.forwardRef(\n ({ rightComponent, ...rest }, ref) => {\n const [revealed, setRevealed] = useState(false);\n return (\n <Input\n {...rest}\n ref={ref}\n secureTextEntry={!revealed}\n rightComponent={\n <>\n <InputPasswordIcon\n onChangeState={setRevealed}\n revealed={revealed}\n effect=\"none\"\n />\n {rightComponent}\n </>\n }\n />\n );\n }\n);\n\nInputPassword.displayName = 'InputPassword';\n\nexport default InputPassword;\n"],"names":[],"mappings":";;;;AAMA,MAAM,gBAA2C,KAAM,CAAA,UAAA;AAAA,EACrD,CAAC,EAAE,cAAmB,EAAA,GAAA,IAAA,IAAQ,GAAQ,KAAA;AACpC,IAAA,MAAM,CAAC,QAAA,EAAU,WAAW,CAAA,GAAI,SAAS,KAAK,CAAA,CAAA;AAC9C,IAAA,uBACG,KAAA,CAAA,aAAA,CAAA,KAAA,EAAA;AAAA,MACE,GAAG,IAAA;AAAA,MACJ,GAAA;AAAA,MACA,iBAAiB,CAAC,QAAA;AAAA,MAClB,cAAA,4EAEK,KAAA,CAAA,aAAA,CAAA,iBAAA,EAAA;AAAA,QACC,aAAe,EAAA,WAAA;AAAA,QACf,QAAA;AAAA,QACA,MAAO,EAAA,MAAA;AAAA,OACT,GACC,cACH,CAAA;AAAA,KAEJ,CAAA,CAAA;AAAA,GAEJ;AACF,EAAA;AAEA,aAAA,CAAc,WAAc,GAAA,eAAA;;;;"}
|
|
@@ -2,56 +2,24 @@ import React from 'react';
|
|
|
2
2
|
import { Pressable } from 'react-native-web';
|
|
3
3
|
import { StyledLabel } from './styled.js';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
__defNormalProp(a, prop, b[prop]);
|
|
14
|
-
if (__getOwnPropSymbols)
|
|
15
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
16
|
-
if (__propIsEnum.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
}
|
|
19
|
-
return a;
|
|
20
|
-
};
|
|
21
|
-
var __objRest = (source, exclude) => {
|
|
22
|
-
var target = {};
|
|
23
|
-
for (var prop in source)
|
|
24
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
25
|
-
target[prop] = source[prop];
|
|
26
|
-
if (source != null && __getOwnPropSymbols)
|
|
27
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
28
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
29
|
-
target[prop] = source[prop];
|
|
30
|
-
}
|
|
31
|
-
return target;
|
|
32
|
-
};
|
|
33
|
-
const LabelComponent = (_a) => {
|
|
34
|
-
var _b = _a, {
|
|
35
|
-
label,
|
|
36
|
-
labelPosition,
|
|
37
|
-
labelProps,
|
|
38
|
-
active,
|
|
39
|
-
switchDisabled = false
|
|
40
|
-
} = _b, rest = __objRest(_b, [
|
|
41
|
-
"label",
|
|
42
|
-
"labelPosition",
|
|
43
|
-
"labelProps",
|
|
44
|
-
"active",
|
|
45
|
-
"switchDisabled"
|
|
46
|
-
]);
|
|
47
|
-
var _a2, _b2;
|
|
5
|
+
const LabelComponent = ({
|
|
6
|
+
label,
|
|
7
|
+
labelPosition,
|
|
8
|
+
labelProps,
|
|
9
|
+
active,
|
|
10
|
+
switchDisabled = false,
|
|
11
|
+
...rest
|
|
12
|
+
}) => {
|
|
48
13
|
const defaultFontColor = active && !switchDisabled ? "dark" : "medium";
|
|
49
14
|
const defaultFontWeight = active && !switchDisabled ? "bold" : "regular";
|
|
50
|
-
return /* @__PURE__ */ React.createElement(Pressable,
|
|
15
|
+
return /* @__PURE__ */ React.createElement(Pressable, {
|
|
16
|
+
...rest
|
|
17
|
+
}, /* @__PURE__ */ React.createElement(StyledLabel, {
|
|
51
18
|
labelPosition,
|
|
52
|
-
fontColor:
|
|
53
|
-
fontWeight:
|
|
54
|
-
|
|
19
|
+
fontColor: labelProps?.fontColor ?? defaultFontColor,
|
|
20
|
+
fontWeight: labelProps?.fontWeight ?? defaultFontWeight,
|
|
21
|
+
...labelProps
|
|
22
|
+
}, label));
|
|
55
23
|
};
|
|
56
24
|
var LabelComponent$1 = React.memo(LabelComponent);
|
|
57
25
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabelComponent.js","sources":["../../../../../src/components/molecules/LabeledSwitch/LabelComponent.tsx"],"sourcesContent":["import {\n FontColor,\n FontWeight,\n LabelPositionOptions,\n TextProps,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { Pressable, PressableProps } from 'react-native';\nimport { StyledLabel } from './styled';\n\nexport interface LabelComponentProps extends PressableProps {\n label: string;\n labelPosition: LabelPositionOptions;\n labelProps?: TextProps;\n active: boolean;\n switchDisabled?: boolean;\n}\n\nconst LabelComponent: FC<LabelComponentProps> = ({\n label,\n labelPosition,\n labelProps,\n active,\n switchDisabled = false,\n ...rest\n}) => {\n const defaultFontColor: keyof FontColor =\n active && !switchDisabled ? 'dark' : 'medium';\n const defaultFontWeight: keyof FontWeight =\n active && !switchDisabled ? 'bold' : 'regular';\n\n return (\n <Pressable {...rest}>\n <StyledLabel\n labelPosition={labelPosition}\n fontColor={labelProps?.fontColor ?? defaultFontColor}\n fontWeight={labelProps?.fontWeight ?? defaultFontWeight}\n {...labelProps}\n >\n {label}\n </StyledLabel>\n </Pressable>\n );\n};\n\nexport default React.memo(LabelComponent);\n"],"names":[
|
|
1
|
+
{"version":3,"file":"LabelComponent.js","sources":["../../../../../src/components/molecules/LabeledSwitch/LabelComponent.tsx"],"sourcesContent":["import {\n FontColor,\n FontWeight,\n LabelPositionOptions,\n TextProps,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport { Pressable, PressableProps } from 'react-native';\nimport { StyledLabel } from './styled';\n\nexport interface LabelComponentProps extends PressableProps {\n label: string;\n labelPosition: LabelPositionOptions;\n labelProps?: TextProps;\n active: boolean;\n switchDisabled?: boolean;\n}\n\nconst LabelComponent: FC<LabelComponentProps> = ({\n label,\n labelPosition,\n labelProps,\n active,\n switchDisabled = false,\n ...rest\n}) => {\n const defaultFontColor: keyof FontColor =\n active && !switchDisabled ? 'dark' : 'medium';\n const defaultFontWeight: keyof FontWeight =\n active && !switchDisabled ? 'bold' : 'regular';\n\n return (\n <Pressable {...rest}>\n <StyledLabel\n labelPosition={labelPosition}\n fontColor={labelProps?.fontColor ?? defaultFontColor}\n fontWeight={labelProps?.fontWeight ?? defaultFontWeight}\n {...labelProps}\n >\n {label}\n </StyledLabel>\n </Pressable>\n );\n};\n\nexport default React.memo(LabelComponent);\n"],"names":[],"mappings":";;;;AAkBA,MAAM,iBAA0C,CAAC;AAAA,EAC/C,KAAA;AAAA,EACA,aAAA;AAAA,EACA,UAAA;AAAA,EACA,MAAA;AAAA,EACA,cAAiB,GAAA,KAAA;AAAA,EACd,GAAA,IAAA;AACL,CAAM,KAAA;AACJ,EAAA,MAAM,gBACJ,GAAA,MAAA,IAAU,CAAC,cAAA,GAAiB,MAAS,GAAA,QAAA,CAAA;AACvC,EAAA,MAAM,iBACJ,GAAA,MAAA,IAAU,CAAC,cAAA,GAAiB,MAAS,GAAA,SAAA,CAAA;AAEvC,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,IAAW,GAAG,IAAA;AAAA,GAAA,kBACZ,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA;AAAA,IACC,aAAA;AAAA,IACA,SAAA,EAAW,YAAY,SAAa,IAAA,gBAAA;AAAA,IACpC,UAAA,EAAY,YAAY,UAAc,IAAA,iBAAA;AAAA,IACrC,GAAG,UAAA;AAAA,GAAA,EAEH,KACH,CACF,CAAA,CAAA;AAEJ,CAAA,CAAA;AAEA,uBAAe,KAAA,CAAM,KAAK,cAAc,CAAA;;;;"}
|
|
@@ -3,52 +3,16 @@ import LabelComponent from './LabelComponent.js';
|
|
|
3
3
|
import { StyledDiv } from './styled.js';
|
|
4
4
|
import Switch from '../../atoms/Switch/Switch.js';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
17
|
-
if (__propIsEnum.call(b, prop))
|
|
18
|
-
__defNormalProp(a, prop, b[prop]);
|
|
19
|
-
}
|
|
20
|
-
return a;
|
|
21
|
-
};
|
|
22
|
-
var __objRest = (source, exclude) => {
|
|
23
|
-
var target = {};
|
|
24
|
-
for (var prop in source)
|
|
25
|
-
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
26
|
-
target[prop] = source[prop];
|
|
27
|
-
if (source != null && __getOwnPropSymbols)
|
|
28
|
-
for (var prop of __getOwnPropSymbols(source)) {
|
|
29
|
-
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
30
|
-
target[prop] = source[prop];
|
|
31
|
-
}
|
|
32
|
-
return target;
|
|
33
|
-
};
|
|
34
|
-
const LabeledSwitch = (_a) => {
|
|
35
|
-
var _b = _a, {
|
|
36
|
-
label,
|
|
37
|
-
labelPosition = "right",
|
|
38
|
-
labelProps,
|
|
39
|
-
pressableLabel = false,
|
|
40
|
-
disabled,
|
|
41
|
-
active,
|
|
42
|
-
onChange
|
|
43
|
-
} = _b, rest = __objRest(_b, [
|
|
44
|
-
"label",
|
|
45
|
-
"labelPosition",
|
|
46
|
-
"labelProps",
|
|
47
|
-
"pressableLabel",
|
|
48
|
-
"disabled",
|
|
49
|
-
"active",
|
|
50
|
-
"onChange"
|
|
51
|
-
]);
|
|
6
|
+
const LabeledSwitch = ({
|
|
7
|
+
label,
|
|
8
|
+
labelPosition = "right",
|
|
9
|
+
labelProps,
|
|
10
|
+
pressableLabel = false,
|
|
11
|
+
disabled,
|
|
12
|
+
active,
|
|
13
|
+
onChange,
|
|
14
|
+
...rest
|
|
15
|
+
}) => {
|
|
52
16
|
return /* @__PURE__ */ React.createElement(StyledDiv, null, labelPosition === "left" ? /* @__PURE__ */ React.createElement(LabelComponent, {
|
|
53
17
|
active,
|
|
54
18
|
label,
|
|
@@ -57,11 +21,12 @@ const LabeledSwitch = (_a) => {
|
|
|
57
21
|
disabled: !pressableLabel || disabled,
|
|
58
22
|
switchDisabled: disabled,
|
|
59
23
|
onPress: () => onChange(!active)
|
|
60
|
-
}) : /* @__PURE__ */ React.createElement(React.Fragment, null), /* @__PURE__ */ React.createElement(Switch,
|
|
24
|
+
}) : /* @__PURE__ */ React.createElement(React.Fragment, null), /* @__PURE__ */ React.createElement(Switch, {
|
|
61
25
|
active,
|
|
62
26
|
disabled,
|
|
63
|
-
onChange
|
|
64
|
-
|
|
27
|
+
onChange,
|
|
28
|
+
...rest
|
|
29
|
+
}), labelPosition === "right" ? /* @__PURE__ */ React.createElement(LabelComponent, {
|
|
65
30
|
active,
|
|
66
31
|
label,
|
|
67
32
|
labelPosition: "right",
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LabeledSwitch.js","sources":["../../../../../src/components/molecules/LabeledSwitch/LabeledSwitch.tsx"],"sourcesContent":["import { LabeledSwitchProps, TextProps } from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport LabelComponent from './LabelComponent';\nimport { StyledDiv } from './styled';\nimport Switch from '../../atoms/Switch/Switch';\n\nexport type LabeledSwitchWebProps = LabeledSwitchProps & {\n labelProps?: TextProps;\n};\n\nconst LabeledSwitch: FC<LabeledSwitchWebProps> = ({\n label,\n labelPosition = 'right',\n labelProps,\n pressableLabel = false,\n disabled,\n active,\n onChange,\n ...rest\n}) => {\n return (\n <StyledDiv>\n {labelPosition === 'left' ? (\n <LabelComponent\n active={active}\n label={label}\n labelPosition={'left'}\n labelProps={labelProps}\n disabled={!pressableLabel || disabled}\n switchDisabled={disabled}\n onPress={() => onChange(!active)}\n />\n ) : (\n <></>\n )}\n <Switch\n active={active}\n disabled={disabled}\n onChange={onChange}\n {...rest}\n />\n {labelPosition === 'right' ? (\n <LabelComponent\n active={active}\n label={label}\n labelPosition={'right'}\n labelProps={labelProps}\n disabled={!pressableLabel || disabled}\n switchDisabled={disabled}\n onPress={() => onChange(!active)}\n />\n ) : (\n <></>\n )}\n </StyledDiv>\n );\n};\n\nexport default LabeledSwitch;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"LabeledSwitch.js","sources":["../../../../../src/components/molecules/LabeledSwitch/LabeledSwitch.tsx"],"sourcesContent":["import { LabeledSwitchProps, TextProps } from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\nimport LabelComponent from './LabelComponent';\nimport { StyledDiv } from './styled';\nimport Switch from '../../atoms/Switch/Switch';\n\nexport type LabeledSwitchWebProps = LabeledSwitchProps & {\n labelProps?: TextProps;\n};\n\nconst LabeledSwitch: FC<LabeledSwitchWebProps> = ({\n label,\n labelPosition = 'right',\n labelProps,\n pressableLabel = false,\n disabled,\n active,\n onChange,\n ...rest\n}) => {\n return (\n <StyledDiv>\n {labelPosition === 'left' ? (\n <LabelComponent\n active={active}\n label={label}\n labelPosition={'left'}\n labelProps={labelProps}\n disabled={!pressableLabel || disabled}\n switchDisabled={disabled}\n onPress={() => onChange(!active)}\n />\n ) : (\n <></>\n )}\n <Switch\n active={active}\n disabled={disabled}\n onChange={onChange}\n {...rest}\n />\n {labelPosition === 'right' ? (\n <LabelComponent\n active={active}\n label={label}\n labelPosition={'right'}\n labelProps={labelProps}\n disabled={!pressableLabel || disabled}\n switchDisabled={disabled}\n onPress={() => onChange(!active)}\n />\n ) : (\n <></>\n )}\n </StyledDiv>\n );\n};\n\nexport default LabeledSwitch;\n"],"names":[],"mappings":";;;;;AAUA,MAAM,gBAA2C,CAAC;AAAA,EAChD,KAAA;AAAA,EACA,aAAgB,GAAA,OAAA;AAAA,EAChB,UAAA;AAAA,EACA,cAAiB,GAAA,KAAA;AAAA,EACjB,QAAA;AAAA,EACA,MAAA;AAAA,EACA,QAAA;AAAA,EACG,GAAA,IAAA;AACL,CAAM,KAAA;AACJ,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA,IAAA,EACE,aAAkB,KAAA,MAAA,mBAChB,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA;AAAA,IACC,MAAA;AAAA,IACA,KAAA;AAAA,IACA,aAAe,EAAA,MAAA;AAAA,IACf,UAAA;AAAA,IACA,QAAA,EAAU,CAAC,cAAkB,IAAA,QAAA;AAAA,IAC7B,cAAgB,EAAA,QAAA;AAAA,IAChB,OAAS,EAAA,MAAM,QAAS,CAAA,CAAC,MAAM,CAAA;AAAA,GACjC,CAAA,mBAEE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,CAAA,kBAEH,KAAA,CAAA,aAAA,CAAA,MAAA,EAAA;AAAA,IACC,MAAA;AAAA,IACA,QAAA;AAAA,IACA,QAAA;AAAA,IACC,GAAG,IAAA;AAAA,GACN,CAAA,EACC,aAAkB,KAAA,OAAA,mBAChB,KAAA,CAAA,aAAA,CAAA,cAAA,EAAA;AAAA,IACC,MAAA;AAAA,IACA,KAAA;AAAA,IACA,aAAe,EAAA,OAAA;AAAA,IACf,UAAA;AAAA,IACA,QAAA,EAAU,CAAC,cAAkB,IAAA,QAAA;AAAA,IAC7B,cAAgB,EAAA,QAAA;AAAA,IAChB,OAAS,EAAA,MAAM,QAAS,CAAA,CAAC,MAAM,CAAA;AAAA,GACjC,CAAA,2DAEE,CAEN,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -11,11 +11,11 @@ const StyledLabel = nativeStyled(Text)`
|
|
|
11
11
|
${({ theme, labelPosition }) => {
|
|
12
12
|
if (labelPosition === "right")
|
|
13
13
|
return css`
|
|
14
|
-
margin-left: ${theme
|
|
14
|
+
margin-left: ${theme?.spacing.centi};
|
|
15
15
|
`;
|
|
16
16
|
else if (labelPosition === "left")
|
|
17
17
|
return css`
|
|
18
|
-
margin-right: ${theme
|
|
18
|
+
margin-right: ${theme?.spacing.centi};
|
|
19
19
|
`;
|
|
20
20
|
}}
|
|
21
21
|
`;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"styled.js","sources":["../../../../../src/components/molecules/LabeledSwitch/styled.ts"],"sourcesContent":["import { css, default as nativeStyled } from '@emotion/native';\nimport { default as webStyled } from '@emotion/styled';\nimport { LabelPositionOptions, StyleProps, Text } from '@tecsinapse/react-core';\n\nexport const StyledDiv = webStyled('div')`\n display: flex;\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledLabel = nativeStyled(Text)<\n Partial<StyleProps> & {\n labelPosition: LabelPositionOptions;\n }\n>`\n ${({ theme, labelPosition }) => {\n if (labelPosition === 'right')\n return css`\n margin-left: ${theme?.spacing.centi};\n `;\n else if (labelPosition === 'left')\n return css`\n margin-right: ${theme?.spacing.centi};\n `;\n }}\n`;\n"],"names":["webStyled"],"mappings":";;;;AAIa,MAAA,SAAA,GAAYA,OAAU,KAAK,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAM3B,MAAA,WAAA,GAAc,aAAa,IAAI,CAAA,CAAA;AAAA,EAAA,EAKxC,CAAC,EAAE,KAAO,EAAA,aAAA,EAAoB,KAAA;AAC9B,EAAA,IAAI,aAAkB,KAAA,OAAA;AACpB,IAAO,OAAA,GAAA,CAAA;AAAA,qBAAA,EACU
|
|
1
|
+
{"version":3,"file":"styled.js","sources":["../../../../../src/components/molecules/LabeledSwitch/styled.ts"],"sourcesContent":["import { css, default as nativeStyled } from '@emotion/native';\nimport { default as webStyled } from '@emotion/styled';\nimport { LabelPositionOptions, StyleProps, Text } from '@tecsinapse/react-core';\n\nexport const StyledDiv = webStyled('div')`\n display: flex;\n flex-direction: row;\n align-items: center;\n`;\n\nexport const StyledLabel = nativeStyled(Text)<\n Partial<StyleProps> & {\n labelPosition: LabelPositionOptions;\n }\n>`\n ${({ theme, labelPosition }) => {\n if (labelPosition === 'right')\n return css`\n margin-left: ${theme?.spacing.centi};\n `;\n else if (labelPosition === 'left')\n return css`\n margin-right: ${theme?.spacing.centi};\n `;\n }}\n`;\n"],"names":["webStyled"],"mappings":";;;;AAIa,MAAA,SAAA,GAAYA,OAAU,KAAK,CAAA,CAAA;AAAA;AAAA;AAAA;AAAA,EAAA;AAM3B,MAAA,WAAA,GAAc,aAAa,IAAI,CAAA,CAAA;AAAA,EAAA,EAKxC,CAAC,EAAE,KAAO,EAAA,aAAA,EAAoB,KAAA;AAC9B,EAAA,IAAI,aAAkB,KAAA,OAAA;AACpB,IAAO,OAAA,GAAA,CAAA;AAAA,qBAAA,EACU,OAAO,OAAQ,CAAA,KAAA,CAAA;AAAA,MAAA,CAAA,CAAA;AAAA,OAAA,IAEzB,aAAkB,KAAA,MAAA;AACzB,IAAO,OAAA,GAAA,CAAA;AAAA,sBAAA,EACW,OAAO,OAAQ,CAAA,KAAA,CAAA;AAAA,MAAA,CAAA,CAAA;AAErC,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -4,25 +4,6 @@ import SubMenuBlock from './SubMenuBlock/SubMenuBlock.js';
|
|
|
4
4
|
import { StyledText, StyledRightComponent } from '../styled.js';
|
|
5
5
|
import { StyledContainerItemText, StyledSubButton } from './styled.js';
|
|
6
6
|
|
|
7
|
-
var __defProp = Object.defineProperty;
|
|
8
|
-
var __defProps = Object.defineProperties;
|
|
9
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
10
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
11
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
12
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
13
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
14
|
-
var __spreadValues = (a, b) => {
|
|
15
|
-
for (var prop in b || (b = {}))
|
|
16
|
-
if (__hasOwnProp.call(b, prop))
|
|
17
|
-
__defNormalProp(a, prop, b[prop]);
|
|
18
|
-
if (__getOwnPropSymbols)
|
|
19
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
20
|
-
if (__propIsEnum.call(b, prop))
|
|
21
|
-
__defNormalProp(a, prop, b[prop]);
|
|
22
|
-
}
|
|
23
|
-
return a;
|
|
24
|
-
};
|
|
25
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
26
7
|
const MenuItem = ({
|
|
27
8
|
title,
|
|
28
9
|
Component = "a",
|
|
@@ -37,10 +18,11 @@ const MenuItem = ({
|
|
|
37
18
|
const handleMenuAction = () => setOpen(!open);
|
|
38
19
|
return /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(StyledContainerItemText, {
|
|
39
20
|
key: title
|
|
40
|
-
}, /* @__PURE__ */ React.createElement(Component,
|
|
21
|
+
}, /* @__PURE__ */ React.createElement(Component, {
|
|
22
|
+
...props,
|
|
41
23
|
style: noTextDecoration,
|
|
42
24
|
onClick: toggle
|
|
43
|
-
}
|
|
25
|
+
}, /* @__PURE__ */ React.createElement(Text, {
|
|
44
26
|
colorVariant: open ? "primary" : "secondary",
|
|
45
27
|
colorTone: open ? "medium" : "dark"
|
|
46
28
|
}, /* @__PURE__ */ React.createElement(StyledText, null, title))), rightComponents && !items && /* @__PURE__ */ React.createElement(StyledRightComponent, null, rightComponents), items && /* @__PURE__ */ React.createElement(StyledSubButton, {
|
|
@@ -49,11 +31,11 @@ const MenuItem = ({
|
|
|
49
31
|
name: getIconName(),
|
|
50
32
|
type: "material-community",
|
|
51
33
|
fontColor: "orange"
|
|
52
|
-
}))), open &&
|
|
34
|
+
}))), open && items?.map((subItem) => /* @__PURE__ */ React.createElement(SubMenuBlock, {
|
|
53
35
|
key: subItem.title,
|
|
54
36
|
data: subItem,
|
|
55
37
|
toggle
|
|
56
|
-
})))
|
|
38
|
+
})));
|
|
57
39
|
};
|
|
58
40
|
|
|
59
41
|
export { MenuItem as default };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MenuItem.js","sources":["../../../../../../../src/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.tsx"],"sourcesContent":["import React, { ElementType } from 'react';\nimport { Icon, Text } from '@tecsinapse/react-core';\nimport { SubMenuBlock } from './SubMenuBlock';\nimport { StyledRightComponent, StyledText } from '../styled';\nimport { StyledContainerItemText, StyledSubButton } from './styled';\nimport { ItemsOptions } from '../../types';\n\ninterface MenuItemProps {\n title: string;\n /** Wrapping component for element. This is used for navigation */\n Component: ElementType;\n /** Properties spread to wrapping Component */\n props: any;\n toggle: () => void;\n rightComponents?: React.ReactNode;\n items?: ItemsOptions[];\n}\n\nconst MenuItem: React.FC<MenuItemProps> = ({\n title,\n Component = 'a',\n props = {},\n rightComponents,\n items,\n toggle,\n}) => {\n const [open, setOpen] = React.useState<boolean>(false);\n\n const noTextDecoration = { textDecoration: 'none' };\n\n const getIconName = () =>\n open ? 'arrow-up-drop-circle-outline' : 'arrow-down-drop-circle-outline';\n\n const handleMenuAction = () => setOpen(!open);\n\n return (\n <>\n <StyledContainerItemText key={title}>\n <Component {...props} style={noTextDecoration} onClick={toggle}>\n <Text\n colorVariant={open ? 'primary' : 'secondary'}\n colorTone={open ? 'medium' : 'dark'}\n >\n <StyledText>{title}</StyledText>\n </Text>\n </Component>\n {rightComponents && !items && (\n <StyledRightComponent>{rightComponents}</StyledRightComponent>\n )}\n {items && (\n <StyledSubButton onClick={handleMenuAction}>\n <Icon\n name={getIconName()}\n type=\"material-community\"\n fontColor=\"orange\"\n />\n </StyledSubButton>\n )}\n </StyledContainerItemText>\n {open &&\n items?.map(subItem => (\n <SubMenuBlock key={subItem.title} data={subItem} toggle={toggle} />\n ))}\n </>\n );\n};\n\nexport default MenuItem;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"MenuItem.js","sources":["../../../../../../../src/components/molecules/Menubar/MenuBlock/MenuItem/MenuItem.tsx"],"sourcesContent":["import React, { ElementType } from 'react';\nimport { Icon, Text } from '@tecsinapse/react-core';\nimport { SubMenuBlock } from './SubMenuBlock';\nimport { StyledRightComponent, StyledText } from '../styled';\nimport { StyledContainerItemText, StyledSubButton } from './styled';\nimport { ItemsOptions } from '../../types';\n\ninterface MenuItemProps {\n title: string;\n /** Wrapping component for element. This is used for navigation */\n Component: ElementType;\n /** Properties spread to wrapping Component */\n props: any;\n toggle: () => void;\n rightComponents?: React.ReactNode;\n items?: ItemsOptions[];\n}\n\nconst MenuItem: React.FC<MenuItemProps> = ({\n title,\n Component = 'a',\n props = {},\n rightComponents,\n items,\n toggle,\n}) => {\n const [open, setOpen] = React.useState<boolean>(false);\n\n const noTextDecoration = { textDecoration: 'none' };\n\n const getIconName = () =>\n open ? 'arrow-up-drop-circle-outline' : 'arrow-down-drop-circle-outline';\n\n const handleMenuAction = () => setOpen(!open);\n\n return (\n <>\n <StyledContainerItemText key={title}>\n <Component {...props} style={noTextDecoration} onClick={toggle}>\n <Text\n colorVariant={open ? 'primary' : 'secondary'}\n colorTone={open ? 'medium' : 'dark'}\n >\n <StyledText>{title}</StyledText>\n </Text>\n </Component>\n {rightComponents && !items && (\n <StyledRightComponent>{rightComponents}</StyledRightComponent>\n )}\n {items && (\n <StyledSubButton onClick={handleMenuAction}>\n <Icon\n name={getIconName()}\n type=\"material-community\"\n fontColor=\"orange\"\n />\n </StyledSubButton>\n )}\n </StyledContainerItemText>\n {open &&\n items?.map(subItem => (\n <SubMenuBlock key={subItem.title} data={subItem} toggle={toggle} />\n ))}\n </>\n );\n};\n\nexport default MenuItem;\n"],"names":[],"mappings":";;;;;;AAkBA,MAAM,WAAoC,CAAC;AAAA,EACzC,KAAA;AAAA,EACA,SAAY,GAAA,GAAA;AAAA,EACZ,QAAQ,EAAC;AAAA,EACT,eAAA;AAAA,EACA,KAAA;AAAA,EACA,MAAA;AACF,CAAM,KAAA;AACJ,EAAA,MAAM,CAAC,IAAM,EAAA,OAAO,CAAI,GAAA,KAAA,CAAM,SAAkB,KAAK,CAAA,CAAA;AAErD,EAAM,MAAA,gBAAA,GAAmB,EAAE,cAAA,EAAgB,MAAO,EAAA,CAAA;AAElD,EAAM,MAAA,WAAA,GAAc,MAClB,IAAA,GAAO,8BAAiC,GAAA,gCAAA,CAAA;AAE1C,EAAA,MAAM,gBAAmB,GAAA,MAAM,OAAQ,CAAA,CAAC,IAAI,CAAA,CAAA;AAE5C,EAAA,iFAEK,KAAA,CAAA,aAAA,CAAA,uBAAA,EAAA;AAAA,IAAwB,GAAK,EAAA,KAAA;AAAA,GAAA,kBAC3B,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,IAAW,GAAG,KAAA;AAAA,IAAO,KAAO,EAAA,gBAAA;AAAA,IAAkB,OAAS,EAAA,MAAA;AAAA,GAAA,kBACrD,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,IACC,YAAA,EAAc,OAAO,SAAY,GAAA,WAAA;AAAA,IACjC,SAAA,EAAW,OAAO,QAAW,GAAA,MAAA;AAAA,GAAA,kBAE5B,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA,IAAA,EAAY,KAAM,CACrB,CACF,CACC,EAAA,eAAA,IAAmB,CAAC,KAAA,oBAClB,KAAA,CAAA,aAAA,CAAA,oBAAA,EAAA,IAAA,EAAsB,eAAgB,CAAA,EAExC,yBACE,KAAA,CAAA,aAAA,CAAA,eAAA,EAAA;AAAA,IAAgB,OAAS,EAAA,gBAAA;AAAA,GAAA,kBACvB,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,IACC,MAAM,WAAY,EAAA;AAAA,IAClB,IAAK,EAAA,oBAAA;AAAA,IACL,SAAU,EAAA,QAAA;AAAA,GACZ,CACF,CAEJ,CAAA,EACC,QACC,KAAO,EAAA,GAAA,CAAI,6BACR,KAAA,CAAA,aAAA,CAAA,YAAA,EAAA;AAAA,IAAa,KAAK,OAAQ,CAAA,KAAA;AAAA,IAAO,IAAM,EAAA,OAAA;AAAA,IAAS,MAAA;AAAA,GAAgB,CAClE,CACL,CAAA,CAAA;AAEJ;;;;"}
|
package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js
CHANGED
|
@@ -3,32 +3,14 @@ import { Text } from '@tecsinapse/react-core';
|
|
|
3
3
|
import { StyledText, StyledRightComponent } from '../../styled.js';
|
|
4
4
|
import { StyledContainerItem, DummyBorder } from './styled.js';
|
|
5
5
|
|
|
6
|
-
var __defProp = Object.defineProperty;
|
|
7
|
-
var __defProps = Object.defineProperties;
|
|
8
|
-
var __getOwnPropDescs = Object.getOwnPropertyDescriptors;
|
|
9
|
-
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
10
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
11
|
-
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
12
|
-
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
13
|
-
var __spreadValues = (a, b) => {
|
|
14
|
-
for (var prop in b || (b = {}))
|
|
15
|
-
if (__hasOwnProp.call(b, prop))
|
|
16
|
-
__defNormalProp(a, prop, b[prop]);
|
|
17
|
-
if (__getOwnPropSymbols)
|
|
18
|
-
for (var prop of __getOwnPropSymbols(b)) {
|
|
19
|
-
if (__propIsEnum.call(b, prop))
|
|
20
|
-
__defNormalProp(a, prop, b[prop]);
|
|
21
|
-
}
|
|
22
|
-
return a;
|
|
23
|
-
};
|
|
24
|
-
var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b));
|
|
25
6
|
const SubMenuBlock = ({ data, toggle }) => {
|
|
26
7
|
const { Component, props, rightComponents, title } = data;
|
|
27
8
|
const noTextDecoration = { textDecoration: "none" };
|
|
28
|
-
return /* @__PURE__ */ React.createElement(StyledContainerItem, null, /* @__PURE__ */ React.createElement(DummyBorder, null), /* @__PURE__ */ React.createElement(Component,
|
|
9
|
+
return /* @__PURE__ */ React.createElement(StyledContainerItem, null, /* @__PURE__ */ React.createElement(DummyBorder, null), /* @__PURE__ */ React.createElement(Component, {
|
|
10
|
+
...props,
|
|
29
11
|
style: noTextDecoration,
|
|
30
12
|
onClick: toggle
|
|
31
|
-
}
|
|
13
|
+
}, /* @__PURE__ */ React.createElement(Text, {
|
|
32
14
|
colorVariant: "secondary",
|
|
33
15
|
colorTone: "medium",
|
|
34
16
|
typography: "sub"
|
package/dist/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"SubMenuBlock.js","sources":["../../../../../../../../src/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from '@tecsinapse/react-core';\nimport { StyledRightComponent, StyledText } from '../../styled';\nimport { ItemsOptions } from '../../../types';\nimport { DummyBorder, StyledContainerItem } from './styled';\n\ninterface SubMenuBlockProps {\n data: ItemsOptions;\n toggle: () => void;\n}\n\nconst SubMenuBlock: React.FC<SubMenuBlockProps> = ({ data, toggle }) => {\n const { Component, props, rightComponents, title } = data;\n\n const noTextDecoration = { textDecoration: 'none' };\n\n return (\n <StyledContainerItem>\n <DummyBorder />\n <Component {...props} style={noTextDecoration} onClick={toggle}>\n <Text colorVariant=\"secondary\" colorTone=\"medium\" typography=\"sub\">\n <StyledText>{title}</StyledText>\n </Text>\n </Component>\n {rightComponents && (\n <StyledRightComponent>{rightComponents}</StyledRightComponent>\n )}\n </StyledContainerItem>\n );\n};\n\nexport default SubMenuBlock;\n"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"SubMenuBlock.js","sources":["../../../../../../../../src/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/SubMenuBlock.tsx"],"sourcesContent":["import React from 'react';\nimport { Text } from '@tecsinapse/react-core';\nimport { StyledRightComponent, StyledText } from '../../styled';\nimport { ItemsOptions } from '../../../types';\nimport { DummyBorder, StyledContainerItem } from './styled';\n\ninterface SubMenuBlockProps {\n data: ItemsOptions;\n toggle: () => void;\n}\n\nconst SubMenuBlock: React.FC<SubMenuBlockProps> = ({ data, toggle }) => {\n const { Component, props, rightComponents, title } = data;\n\n const noTextDecoration = { textDecoration: 'none' };\n\n return (\n <StyledContainerItem>\n <DummyBorder />\n <Component {...props} style={noTextDecoration} onClick={toggle}>\n <Text colorVariant=\"secondary\" colorTone=\"medium\" typography=\"sub\">\n <StyledText>{title}</StyledText>\n </Text>\n </Component>\n {rightComponents && (\n <StyledRightComponent>{rightComponents}</StyledRightComponent>\n )}\n </StyledContainerItem>\n );\n};\n\nexport default SubMenuBlock;\n"],"names":[],"mappings":";;;;;AAWA,MAAM,YAA4C,GAAA,CAAC,EAAE,IAAA,EAAM,QAAa,KAAA;AACtE,EAAA,MAAM,EAAE,SAAA,EAAW,KAAO,EAAA,eAAA,EAAiB,OAAU,GAAA,IAAA,CAAA;AAErD,EAAM,MAAA,gBAAA,GAAmB,EAAE,cAAA,EAAgB,MAAO,EAAA,CAAA;AAElD,EAAA,uBACG,KAAA,CAAA,aAAA,CAAA,mBAAA,EAAA,IAAA,kBACE,KAAA,CAAA,aAAA,CAAA,WAAA,EAAA,IAAY,mBACZ,KAAA,CAAA,aAAA,CAAA,SAAA,EAAA;AAAA,IAAW,GAAG,KAAA;AAAA,IAAO,KAAO,EAAA,gBAAA;AAAA,IAAkB,OAAS,EAAA,MAAA;AAAA,GAAA,kBACrD,KAAA,CAAA,aAAA,CAAA,IAAA,EAAA;AAAA,IAAK,YAAa,EAAA,WAAA;AAAA,IAAY,SAAU,EAAA,QAAA;AAAA,IAAS,UAAW,EAAA,KAAA;AAAA,GAC3D,kBAAA,KAAA,CAAA,aAAA,CAAC,UAAY,EAAA,IAAA,EAAA,KAAM,CACrB,CACF,GACC,eACC,oBAAA,KAAA,CAAA,aAAA,CAAC,oBAAsB,EAAA,IAAA,EAAA,eAAgB,CAE3C,CAAA,CAAA;AAEJ;;;;"}
|