@tecsinapse/react-web-kit 1.7.8 → 1.8.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/CHANGELOG.md +11 -0
- package/dist/components/atoms/Accordion/Accordion.d.ts +1 -1
- package/dist/components/atoms/Accordion/Accordion.js +3 -2
- package/dist/components/atoms/Accordion/Accordion.js.map +1 -1
- package/dist/components/atoms/Modal/Modal.d.ts +2 -3
- package/dist/components/atoms/Modal/Modal.js +6 -3
- package/dist/components/atoms/Modal/Modal.js.map +1 -1
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.d.ts +2 -2
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js +3 -2
- package/dist/components/molecules/Breadcrumbs/Breadcrumbs.js.map +1 -1
- package/dist/components/molecules/Drawer/Drawer.d.ts +4 -3
- package/dist/components/molecules/Drawer/Drawer.js +10 -4
- package/dist/components/molecules/Drawer/Drawer.js.map +1 -1
- package/dist/components/molecules/Drawer/animations.d.ts +3 -12
- package/dist/components/molecules/Drawer/animations.js +1 -1
- package/dist/components/molecules/Drawer/animations.js.map +1 -1
- package/dist/components/molecules/Menubar/Menubar.d.ts +1 -1
- package/dist/components/molecules/Menubar/Menubar.js +7 -3
- package/dist/components/molecules/Menubar/Menubar.js.map +1 -1
- package/dist/components/molecules/Select/Dropdown/Dropdown.d.ts +1 -3
- package/dist/components/molecules/Select/Dropdown/Dropdown.js +6 -4
- package/dist/components/molecules/Select/Dropdown/Dropdown.js.map +1 -1
- package/dist/components/molecules/Select/Dropdown/styled.d.ts +1 -1
- package/dist/components/molecules/Select/Dropdown/styled.js +26 -10
- package/dist/components/molecules/Select/Dropdown/styled.js.map +1 -1
- package/dist/components/molecules/Select/Select.d.ts +7 -2
- package/dist/components/molecules/Select/Select.js +15 -8
- package/dist/components/molecules/Select/Select.js.map +1 -1
- package/dist/components/molecules/Select/SelectItem/SelectItem.js +1 -1
- package/dist/components/molecules/Select/SelectItem/SelectItem.js.map +1 -1
- package/dist/components/molecules/Select/animations.d.ts +42 -18
- package/dist/components/molecules/Select/animations.js +42 -18
- package/dist/components/molecules/Select/animations.js.map +1 -1
- package/dist/components/organisms/DataGrid/DataGrid.d.ts +3 -4
- package/dist/components/organisms/DataGrid/DataGrid.js +3 -5
- package/dist/components/organisms/DataGrid/DataGrid.js.map +1 -1
- package/package.json +4 -3
- package/src/components/atoms/Accordion/Accordion.tsx +3 -2
- package/src/components/atoms/Modal/Modal.tsx +10 -4
- package/src/components/molecules/Breadcrumbs/Breadcrumbs.tsx +3 -3
- package/src/components/molecules/Drawer/Drawer.tsx +13 -5
- package/src/components/molecules/Drawer/animations.ts +9 -3
- package/src/components/molecules/Menubar/Menubar.tsx +5 -7
- package/src/components/molecules/Select/Dropdown/Dropdown.tsx +10 -6
- package/src/components/molecules/Select/Dropdown/styled.ts +32 -13
- package/src/components/molecules/Select/Select.tsx +22 -6
- package/src/components/molecules/Select/SelectItem/SelectItem.tsx +1 -1
- package/src/components/molecules/Select/animations.ts +31 -7
- package/src/components/organisms/DataGrid/DataGrid.tsx +5 -6
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,17 @@
|
|
|
3
3
|
All notable changes to this project will be documented in this file.
|
|
4
4
|
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
|
|
5
5
|
|
|
6
|
+
# [1.8.0](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.7.8...@tecsinapse/react-web-kit@1.8.0) (2021-09-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* extend web components from html div element ([ebc700a](https://github.com/tecsinapse/design-system/commit/ebc700aad0068b34eb31ebbb705b2485d410c72e))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
|
|
6
17
|
## [1.7.8](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.7.7...@tecsinapse/react-web-kit@1.7.8) (2021-09-27)
|
|
7
18
|
|
|
8
19
|
**Note:** Version bump only for package @tecsinapse/react-web-kit
|
|
@@ -26,7 +26,8 @@ const Accordion = ({
|
|
|
26
26
|
open: _open = false,
|
|
27
27
|
onChange,
|
|
28
28
|
transition = 200,
|
|
29
|
-
children
|
|
29
|
+
children,
|
|
30
|
+
...rest
|
|
30
31
|
}) => {
|
|
31
32
|
const [open, setOpen] = _react.default.useState(_open);
|
|
32
33
|
|
|
@@ -53,7 +54,7 @@ const Accordion = ({
|
|
|
53
54
|
setOpen(state => !state);
|
|
54
55
|
}, [onChange]);
|
|
55
56
|
|
|
56
|
-
return _react.default.createElement(_styled.AccordionContainer,
|
|
57
|
+
return _react.default.createElement(_styled.AccordionContainer, rest, _react.default.createElement(_styled.TitleContainer, {
|
|
57
58
|
onClick: handleClick
|
|
58
59
|
}, _react.default.createElement(_reactTransitionGroup.Transition, {
|
|
59
60
|
in: open,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Accordion/Accordion.tsx"],"names":["Accordion","title","open","_open","onChange","transition","children","setOpen","React","useState","contentHeight","setContentHeight","theme","ref","useEffect","useLayoutEffect","size","Array","from","current","reduce","prev","curr","clientHeight","handleClick","useCallback","state","htmlEl"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AAMA;;AACA;;AAMA;;;;;;AAUA,MAAMA,SAAmC,GAAG,CAAC;AAC3CC,EAAAA,KAD2C;AAE3CC,EAAAA,IAAI,EAAEC,KAAK,GAAG,KAF6B;AAG3CC,EAAAA,QAH2C;AAI3CC,EAAAA,UAAU,GAAG,GAJ8B;AAK3CC,EAAAA;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Accordion/Accordion.tsx"],"names":["Accordion","title","open","_open","onChange","transition","children","rest","setOpen","React","useState","contentHeight","setContentHeight","theme","ref","useEffect","useLayoutEffect","size","Array","from","current","reduce","prev","curr","clientHeight","handleClick","useCallback","state","htmlEl"],"mappings":";;;;;;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6BAAC,gCAAD;AAAY,IAAA,EAAE,EAAEvB,IAAhB;AAAsB,IAAA,OAAO,EAAEG;AAA/B,KACGsB,KAAK,IACJ,6BAAC,eAAD;AACE,IAAA,UAAU,EAAC,IADb;AAEE,IAAA,UAAU,EAAC,MAFb;AAGE,IAAA,KAAK,EAAE,EACL,GAAG,4BAAWtB,UAAX,EAAuBQ,KAAvB,CADE;AAEL,SAAG,iCAAgBA,KAAhB,EAAuBc,KAAvB;AAFE;AAHT,KAQG1B,KARH,CAFJ,CADF,EAeE,6BAAC,qBAAD,QACE,6BAAC,eAAD;AACE,IAAA,IAAI,EAAC,oBADP;AAEE,IAAA,IAAI,EAAEC,IAAI,GAAG,YAAH,GAAkB,cAF9B;AAGE,IAAA,IAAI,EAAC,MAHP;AAIE,IAAA,SAAS,EAAC;AAJZ,IADF,CAfF,CADF,EAyBE,6BAAC,gCAAD;AAAY,IAAA,EAAE,EAAEA,IAAhB;AAAsB,IAAA,OAAO,EAAEG;AAA/B,KACGsB,KAAK,IACJ,6BAAC,wBAAD;AACE,IAAA,GAAG,EAAEC,MAAM,IAAKd,GAAG,CAACM,OAAJ,GAAcQ,MADhC;AAEE,IAAA,KAAK,EAAE,EACL,GAAG,8BAAa1B,IAAb,EAAmBG,UAAnB,EAA+BM,aAA/B,EAA8CE,KAA9C,CADE;AAEL,SAAG,mCAAkBF,aAAlB,EAAiCE,KAAjC,EAAwCc,KAAxC;AAFE;AAFT,KAOGrB,QAPH,CAFJ,CAzBF,CADF;AAyCD,CAxED;;eA0EeN,S","sourcesContent":["import React, { useRef } from 'react';\nimport { Icon, Text, ThemeProp } from '@tecsinapse/react-core';\nimport {\n AccordionContainer,\n IconContainer,\n TitleContainer,\n ContentContainer,\n} from './styled';\nimport { Transition } from 'react-transition-group';\nimport {\n contentStyle,\n contentTransition,\n titleStyle,\n titleTransition,\n} from './animations';\nimport { useTheme } from '@emotion/react';\n\nexport interface AccordionProps extends React.HTMLAttributes<HTMLDivElement> {\n open?: boolean;\n onChange?: () => void;\n title: string;\n /** Transition time for collapse effect in ms */\n transition?: number;\n}\n\nconst Accordion: React.FC<AccordionProps> = ({\n title,\n open: _open = false,\n onChange,\n transition = 200,\n children,\n ...rest\n}) => {\n const [open, setOpen] = React.useState(_open);\n const [contentHeight, setContentHeight] = React.useState(0);\n const theme = useTheme() as ThemeProp;\n\n const ref = useRef<HTMLDivElement | null>(null);\n\n React.useEffect(() => setOpen(_open), [_open]);\n\n React.useLayoutEffect(() => {\n const size = Array.from(\n (ref.current?.children || []) as HTMLCollection\n ).reduce((prev, curr) => prev + curr.clientHeight, 0);\n setContentHeight(size);\n }, []);\n\n const handleClick = React.useCallback(() => {\n if (onChange) {\n onChange();\n return;\n }\n setOpen(state => !state);\n }, [onChange]);\n\n return (\n <AccordionContainer {...rest}>\n <TitleContainer onClick={handleClick}>\n <Transition in={open} timeout={transition}>\n {state => (\n <Text\n typography=\"h4\"\n fontWeight=\"bold\"\n style={{\n ...titleStyle(transition, theme),\n ...titleTransition(theme)[state],\n }}\n >\n {title}\n </Text>\n )}\n </Transition>\n <IconContainer>\n <Icon\n type=\"material-community\"\n name={open ? 'chevron-up' : 'chevron-down'}\n size=\"kilo\"\n fontColor=\"medium\"\n />\n </IconContainer>\n </TitleContainer>\n <Transition in={open} timeout={transition}>\n {state => (\n <ContentContainer\n ref={htmlEl => (ref.current = htmlEl)}\n style={{\n ...contentStyle(open, transition, contentHeight, theme),\n ...contentTransition(contentHeight, theme)[state],\n }}\n >\n {children}\n </ContentContainer>\n )}\n </Transition>\n </AccordionContainer>\n );\n};\n\nexport default Accordion;\n"],"file":"Accordion.js"}
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import React
|
|
2
|
-
export interface ModalProps {
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface ModalProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
3
|
open: boolean;
|
|
4
4
|
onClose: () => void;
|
|
5
|
-
style?: CSSProperties;
|
|
6
5
|
}
|
|
7
6
|
declare const Modal: React.FC<ModalProps>;
|
|
8
7
|
export default Modal;
|
|
@@ -17,11 +17,14 @@ var _animations = require("./animations");
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
20
22
|
const Modal = ({
|
|
21
23
|
children,
|
|
22
24
|
open,
|
|
23
25
|
onClose,
|
|
24
|
-
style
|
|
26
|
+
style,
|
|
27
|
+
...rest
|
|
25
28
|
}) => {
|
|
26
29
|
return _react.default.createElement(_react.default.Fragment, null, _react.default.createElement(_Overlay.Overlay, {
|
|
27
30
|
open: open,
|
|
@@ -30,12 +33,12 @@ const Modal = ({
|
|
|
30
33
|
}), _react.default.createElement(_reactTransitionGroup.Transition, {
|
|
31
34
|
in: open,
|
|
32
35
|
timeout: 400
|
|
33
|
-
}, state => _react.default.createElement(_styled.ModalContainer, {
|
|
36
|
+
}, state => _react.default.createElement(_styled.ModalContainer, _extends({
|
|
34
37
|
style: { ...style,
|
|
35
38
|
..._animations.defaultStyleOverlay,
|
|
36
39
|
..._animations.transitionStylesOverlay[state]
|
|
37
40
|
}
|
|
38
|
-
}, children)));
|
|
41
|
+
}, rest), children)));
|
|
39
42
|
};
|
|
40
43
|
|
|
41
44
|
var _default = Modal;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/atoms/Modal/Modal.tsx"],"names":["Modal","children","open","onClose","style","state","defaultStyleOverlay","transitionStylesOverlay"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/atoms/Modal/Modal.tsx"],"names":["Modal","children","open","onClose","style","rest","state","defaultStyleOverlay","transitionStylesOverlay"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAOA,MAAMA,KAA2B,GAAG,CAAC;AACnCC,EAAAA,QADmC;AAEnCC,EAAAA,IAFmC;AAGnCC,EAAAA,OAHmC;AAInCC,EAAAA,KAJmC;AAKnC,KAAGC;AALgC,CAAD,KAM9B;AACJ,SACE,4DACE,6BAAC,gBAAD;AAAS,IAAA,IAAI,EAAEH,IAAf;AAAqB,IAAA,OAAO,EAAEC,OAA9B;AAAuC,IAAA,MAAM,EAAC;AAA9C,IADF,EAEE,6BAAC,gCAAD;AAAY,IAAA,EAAE,EAAED,IAAhB;AAAsB,IAAA,OAAO,EAAE;AAA/B,KACGI,KAAK,IACJ,6BAAC,sBAAD;AACE,IAAA,KAAK,EAAE,EACL,GAAGF,KADE;AAEL,SAAGG,+BAFE;AAGL,SAAGC,oCAAwBF,KAAxB;AAHE;AADT,KAMMD,IANN,GAQGJ,QARH,CAFJ,CAFF,CADF;AAmBD,CA1BD;;eA4BeD,K","sourcesContent":["import React from 'react';\nimport { Transition } from 'react-transition-group';\nimport { Overlay } from '../Overlay';\nimport { ModalContainer } from './styled';\nimport { defaultStyleOverlay, transitionStylesOverlay } from './animations';\n\nexport interface ModalProps extends React.HTMLAttributes<HTMLDivElement> {\n open: boolean;\n onClose: () => void;\n}\n\nconst Modal: React.FC<ModalProps> = ({\n children,\n open,\n onClose,\n style,\n ...rest\n}) => {\n return (\n <>\n <Overlay open={open} onClose={onClose} zIndex=\"modal\" />\n <Transition in={open} timeout={400}>\n {state => (\n <ModalContainer\n style={{\n ...style,\n ...defaultStyleOverlay,\n ...transitionStylesOverlay[state],\n }}\n {...rest}\n >\n {children}\n </ModalContainer>\n )}\n </Transition>\n </>\n );\n};\n\nexport default Modal;\n"],"file":"Modal.js"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { ElementType, FC } from 'react';
|
|
1
|
+
import React, { ElementType, FC } from 'react';
|
|
2
2
|
export declare type BreadcrumbType = {
|
|
3
3
|
title: string;
|
|
4
4
|
Component: ElementType;
|
|
5
5
|
props?: any;
|
|
6
6
|
};
|
|
7
|
-
export interface BreadcrumbsProps {
|
|
7
|
+
export interface BreadcrumbsProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
8
8
|
breadcrumbs: BreadcrumbType[];
|
|
9
9
|
}
|
|
10
10
|
declare const Breadcrumbs: FC<BreadcrumbsProps>;
|
|
@@ -14,9 +14,10 @@ var _BreadcrumbItem = require("./BreadcrumbItem");
|
|
|
14
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
15
15
|
|
|
16
16
|
const Breadcrumbs = ({
|
|
17
|
-
breadcrumbs
|
|
17
|
+
breadcrumbs,
|
|
18
|
+
...rest
|
|
18
19
|
}) => {
|
|
19
|
-
return _react.default.createElement(_styled.StyledContainerBreadcrumbs,
|
|
20
|
+
return _react.default.createElement(_styled.StyledContainerBreadcrumbs, rest, breadcrumbs.map((item, index) => {
|
|
20
21
|
const {
|
|
21
22
|
props,
|
|
22
23
|
Component = 'a',
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/Breadcrumbs/Breadcrumbs.tsx"],"names":["Breadcrumbs","breadcrumbs","map","item","index","props","Component","title","length"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAYA,MAAMA,WAAiC,GAAG,CAAC;AAAEC,EAAAA;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/Breadcrumbs/Breadcrumbs.tsx"],"names":["Breadcrumbs","breadcrumbs","rest","map","item","index","props","Component","title","length"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;;;AAYA,MAAMA,WAAiC,GAAG,CAAC;AAAEC,EAAAA,WAAF;AAAe,KAAGC;AAAlB,CAAD,KAA8B;AACtE,SACE,6BAAC,kCAAD,EAAgCA,IAAhC,EACGD,WAAW,CAACE,GAAZ,CAAgB,CAACC,IAAD,EAAOC,KAAP,KAAiB;AAChC,UAAM;AAAEC,MAAAA,KAAF;AAASC,MAAAA,SAAS,GAAG,GAArB;AAA0BC,MAAAA;AAA1B,QAAoCJ,IAA1C;AACA,WACE,6BAAC,8BAAD;AACE,MAAA,GAAG,EAAEC,KADP;AAEE,MAAA,SAAS,EAAEE,SAFb;AAGE,MAAA,KAAK,EAAED,KAHT;AAIE,MAAA,MAAM,EAAEL,WAAW,CAACQ,MAAZ,GAAqB,CAArB,KAA2BJ,KAJrC;AAKE,MAAA,KAAK,EAAEG;AALT,MADF;AASD,GAXA,CADH,CADF;AAgBD,CAjBD;;eAmBeR,W","sourcesContent":["import React, { ElementType, FC } from 'react';\nimport { StyledContainerBreadcrumbs } from './styled';\nimport { BreadcrumbItem } from './BreadcrumbItem';\n\nexport type BreadcrumbType = {\n title: string;\n Component: ElementType;\n props?: any;\n};\n\nexport interface BreadcrumbsProps extends React.HTMLAttributes<HTMLDivElement> {\n breadcrumbs: BreadcrumbType[];\n}\n\nconst Breadcrumbs: FC<BreadcrumbsProps> = ({ breadcrumbs, ...rest }) => {\n return (\n <StyledContainerBreadcrumbs {...rest}>\n {breadcrumbs.map((item, index) => {\n const { props, Component = 'a', title } = item;\n return (\n <BreadcrumbItem\n key={index}\n Component={Component}\n props={props}\n isLast={breadcrumbs.length - 1 === index}\n title={title}\n />\n );\n })}\n </StyledContainerBreadcrumbs>\n );\n};\n\nexport default Breadcrumbs;\n"],"file":"Breadcrumbs.js"}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
import { FC } from 'react';
|
|
2
|
-
|
|
1
|
+
import React, { FC } from 'react';
|
|
2
|
+
declare type AnchorPosition = 'left' | 'right' | 'top' | 'bottom';
|
|
3
|
+
export interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
3
4
|
open: boolean;
|
|
4
5
|
onClose: () => void;
|
|
5
|
-
anchorPosition:
|
|
6
|
+
anchorPosition: AnchorPosition;
|
|
6
7
|
}
|
|
7
8
|
declare const Drawer: FC<DrawerProps>;
|
|
8
9
|
export default Drawer;
|
|
@@ -17,11 +17,15 @@ var _animations = require("./animations");
|
|
|
17
17
|
|
|
18
18
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
19
19
|
|
|
20
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
21
|
+
|
|
20
22
|
const Drawer = ({
|
|
21
23
|
open,
|
|
22
24
|
anchorPosition = 'right',
|
|
23
25
|
onClose,
|
|
24
|
-
children
|
|
26
|
+
children,
|
|
27
|
+
style,
|
|
28
|
+
...rest
|
|
25
29
|
}) => {
|
|
26
30
|
const getStyles = (anchorPosition, state) => {
|
|
27
31
|
const stylesLeftRight = (0, _animations.defaultStylesLeftRight)(anchorPosition);
|
|
@@ -48,12 +52,14 @@ const Drawer = ({
|
|
|
48
52
|
}), _react.default.createElement(_reactTransitionGroup.Transition, {
|
|
49
53
|
in: open,
|
|
50
54
|
timeout: 300
|
|
51
|
-
}, state => _react.default.createElement(_styled.StyledContainerDrawer, {
|
|
52
|
-
style:
|
|
55
|
+
}, state => _react.default.createElement(_styled.StyledContainerDrawer, _extends({
|
|
56
|
+
style: { ...style,
|
|
57
|
+
...getStyles(anchorPosition, state)
|
|
58
|
+
},
|
|
53
59
|
anchorPosition: anchorPosition,
|
|
54
60
|
onClose: onClose,
|
|
55
61
|
open: open
|
|
56
|
-
}, children)));
|
|
62
|
+
}, rest), children)));
|
|
57
63
|
};
|
|
58
64
|
|
|
59
65
|
var _default = Drawer;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/Drawer/Drawer.tsx"],"names":["Drawer","open","anchorPosition","onClose","children","getStyles","state","stylesLeftRight","transitionLeftRight","stylesTopBottom","transitionTopBottom","includes"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/Drawer/Drawer.tsx"],"names":["Drawer","open","anchorPosition","onClose","children","style","rest","getStyles","state","stylesLeftRight","transitionLeftRight","stylesTopBottom","transitionTopBottom","includes"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AACA;;;;;;AAeA,MAAMA,MAAuB,GAAG,CAAC;AAC/BC,EAAAA,IAD+B;AAE/BC,EAAAA,cAAc,GAAG,OAFc;AAG/BC,EAAAA,OAH+B;AAI/BC,EAAAA,QAJ+B;AAK/BC,EAAAA,KAL+B;AAM/B,KAAGC;AAN4B,CAAD,KAO1B;AACJ,QAAMC,SAAS,GAAG,CAChBL,cADgB,EAEhBM,KAFgB,KAGb;AACH,UAAMC,eAAe,GAAG,wCAAuBP,cAAvB,CAAxB;AACA,UAAMQ,mBAAmB,GAAG,2CAA0BR,cAA1B,CAA5B;AACA,UAAMS,eAAe,GAAG,wCAAuBT,cAAvB,CAAxB;AACA,UAAMU,mBAAmB,GAAG,2CAA0BV,cAA1B,CAA5B;;AAEA,QAAI,CAAC,MAAD,EAAS,OAAT,EAAkBW,QAAlB,CAA2BX,cAA3B,CAAJ,EAAgD;AAC9C,aAAO,EACL,GAAGO,eADE;AAEL,WAAGC,mBAAmB,CAACF,KAAD;AAFjB,OAAP;AAID,KALD,MAKO;AACL,aAAO,EACL,GAAGG,eADE;AAEL,WAAGC,mBAAmB,CAACJ,KAAD;AAFjB,OAAP;AAID;AACF,GApBD;;AAsBA,SACE,4DACE,6BAAC,gBAAD;AAAS,IAAA,OAAO,EAAE,GAAlB;AAAuB,IAAA,IAAI,EAAEP,IAA7B;AAAmC,IAAA,OAAO,EAAEE,OAA5C;AAAqD,IAAA,MAAM,EAAC;AAA5D,IADF,EAEE,6BAAC,gCAAD;AAAY,IAAA,EAAE,EAAEF,IAAhB;AAAsB,IAAA,OAAO,EAAE;AAA/B,KACGO,KAAK,IACJ,6BAAC,6BAAD;AACE,IAAA,KAAK,EAAE,EAAE,GAAGH,KAAL;AAAY,SAAGE,SAAS,CAACL,cAAD,EAAiBM,KAAjB;AAAxB,KADT;AAEE,IAAA,cAAc,EAAEN,cAFlB;AAGE,IAAA,OAAO,EAAEC,OAHX;AAIE,IAAA,IAAI,EAAEF;AAJR,KAKMK,IALN,GAOGF,QAPH,CAFJ,CAFF,CADF;AAkBD,CAhDD;;eAkDeJ,M","sourcesContent":["import React, { FC } from 'react';\nimport { StyledContainerDrawer } from './styled';\nimport { Transition, TransitionStatus } from 'react-transition-group';\nimport { Overlay } from '../../atoms/Overlay';\nimport {\n transitionStylesTopBottom,\n defaultStylesTopBottom,\n defaultStylesLeftRight,\n transitionStylesLeftRight,\n} from './animations';\n\ntype AnchorPosition = 'left' | 'right' | 'top' | 'bottom';\n\nexport interface DrawerProps extends React.HTMLAttributes<HTMLDivElement> {\n open: boolean;\n onClose: () => void;\n anchorPosition: AnchorPosition;\n}\n\nconst Drawer: FC<DrawerProps> = ({\n open,\n anchorPosition = 'right',\n onClose,\n children,\n style,\n ...rest\n}) => {\n const getStyles = (\n anchorPosition: AnchorPosition,\n state: TransitionStatus\n ) => {\n const stylesLeftRight = defaultStylesLeftRight(anchorPosition);\n const transitionLeftRight = transitionStylesLeftRight(anchorPosition);\n const stylesTopBottom = defaultStylesTopBottom(anchorPosition);\n const transitionTopBottom = transitionStylesTopBottom(anchorPosition);\n\n if (['left', 'right'].includes(anchorPosition)) {\n return {\n ...stylesLeftRight,\n ...transitionLeftRight[state],\n };\n } else {\n return {\n ...stylesTopBottom,\n ...transitionTopBottom[state],\n };\n }\n };\n\n return (\n <>\n <Overlay timeout={300} open={open} onClose={onClose} zIndex=\"drawer\" />\n <Transition in={open} timeout={300}>\n {state => (\n <StyledContainerDrawer\n style={{ ...style, ...getStyles(anchorPosition, state) }}\n anchorPosition={anchorPosition}\n onClose={onClose}\n open={open}\n {...rest}\n >\n {children}\n </StyledContainerDrawer>\n )}\n </Transition>\n </>\n );\n};\n\nexport default Drawer;\n"],"file":"Drawer.js"}
|
|
@@ -1,13 +1,9 @@
|
|
|
1
|
+
import { CSSProperties } from 'react';
|
|
1
2
|
export declare const transformLeftRigthClose: (anchorPosition: string) => "translateX(100%)" | "translateX(-100%)";
|
|
2
3
|
export declare const transformLeftRigthOpen = "translateX(0)";
|
|
3
4
|
export declare const transformTopBottomClose: (anchorPosition: string) => "translateY(-100%)" | "translateY(100%)";
|
|
4
5
|
export declare const transformTopBottomOpen = "translateY(0%)";
|
|
5
|
-
export declare const defaultStylesLeftRight: (anchorPosition: string) =>
|
|
6
|
-
transition: string;
|
|
7
|
-
transform: () => "translateX(100%)" | "translateX(-100%)";
|
|
8
|
-
overflowX: string;
|
|
9
|
-
overflowY: string;
|
|
10
|
-
};
|
|
6
|
+
export declare const defaultStylesLeftRight: (anchorPosition: string) => CSSProperties;
|
|
11
7
|
export declare const transitionStylesLeftRight: (anchorPosition: string) => {
|
|
12
8
|
entering: {
|
|
13
9
|
transform: string;
|
|
@@ -22,12 +18,7 @@ export declare const transitionStylesLeftRight: (anchorPosition: string) => {
|
|
|
22
18
|
transform: string;
|
|
23
19
|
};
|
|
24
20
|
};
|
|
25
|
-
export declare const defaultStylesTopBottom: (anchorPosition: string) =>
|
|
26
|
-
transition: string;
|
|
27
|
-
transform: string;
|
|
28
|
-
overflowX: string;
|
|
29
|
-
overflowY: string;
|
|
30
|
-
};
|
|
21
|
+
export declare const defaultStylesTopBottom: (anchorPosition: string) => CSSProperties;
|
|
31
22
|
export declare const transitionStylesTopBottom: (anchorPosition: string) => {
|
|
32
23
|
entering: {
|
|
33
24
|
transform: string;
|
|
@@ -20,7 +20,7 @@ exports.transformTopBottomOpen = transformTopBottomOpen;
|
|
|
20
20
|
const defaultStylesLeftRight = anchorPosition => {
|
|
21
21
|
return {
|
|
22
22
|
transition: 'transform 300ms ease-in-out',
|
|
23
|
-
transform:
|
|
23
|
+
transform: transformLeftRigthClose(anchorPosition),
|
|
24
24
|
overflowX: 'hidden',
|
|
25
25
|
overflowY: 'auto'
|
|
26
26
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/Drawer/animations.ts"],"names":["transformLeftRigthClose","anchorPosition","transformLeftRigthOpen","transformTopBottomClose","transformTopBottomOpen","defaultStylesLeftRight","transition","transform","overflowX","overflowY","transitionStylesLeftRight","entering","entered","exiting","exited","defaultStylesTopBottom","transitionStylesTopBottom"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/Drawer/animations.ts"],"names":["transformLeftRigthClose","anchorPosition","transformLeftRigthOpen","transformTopBottomClose","transformTopBottomOpen","defaultStylesLeftRight","transition","transform","overflowX","overflowY","transitionStylesLeftRight","entering","entered","exiting","exited","defaultStylesTopBottom","transitionStylesTopBottom"],"mappings":";;;;;;;AAEO,MAAMA,uBAAuB,GAAIC,cAAD,IACrCA,cAAc,KAAK,OAAnB,GAA6B,kBAA7B,GAAkD,mBAD7C;;;AAGA,MAAMC,sBAAsB,GAAG,eAA/B;;;AAEA,MAAMC,uBAAuB,GAAIF,cAAD,IACrCA,cAAc,KAAK,KAAnB,GAA2B,mBAA3B,GAAiD,kBAD5C;;;AAGA,MAAMG,sBAAsB,GAAG,gBAA/B;;;AAEA,MAAMC,sBAAsB,GACjCJ,cADoC,IAElB;AAClB,SAAO;AACLK,IAAAA,UAAU,EAAE,6BADP;AAELC,IAAAA,SAAS,EAAEP,uBAAuB,CAACC,cAAD,CAF7B;AAGLO,IAAAA,SAAS,EAAE,QAHN;AAILC,IAAAA,SAAS,EAAE;AAJN,GAAP;AAMD,CATM;;;;AAWA,MAAMC,yBAAyB,GAAIT,cAAD,IAA4B;AACnE,SAAO;AACLU,IAAAA,QAAQ,EAAE;AAAEJ,MAAAA,SAAS,EAAEP,uBAAuB,CAACC,cAAD;AAApC,KADL;AAELW,IAAAA,OAAO,EAAE;AACPL,MAAAA,SAAS,EAAEL;AADJ,KAFJ;AAKLW,IAAAA,OAAO,EAAE;AACPN,MAAAA,SAAS,EAAEL;AADJ,KALJ;AAQLY,IAAAA,MAAM,EAAE;AAAEP,MAAAA,SAAS,EAAEP,uBAAuB,CAACC,cAAD;AAApC;AARH,GAAP;AAUD,CAXM;;;;AAaA,MAAMc,sBAAsB,GACjCd,cADoC,IAElB;AAClB,SAAO;AACLK,IAAAA,UAAU,EAAE,6BADP;AAELC,IAAAA,SAAS,EAAEJ,uBAAuB,CAACF,cAAD,CAF7B;AAGLO,IAAAA,SAAS,EAAE,QAHN;AAILC,IAAAA,SAAS,EAAE;AAJN,GAAP;AAMD,CATM;;;;AAUA,MAAMO,yBAAyB,GAAIf,cAAD,IAA4B;AACnE,SAAO;AACLU,IAAAA,QAAQ,EAAE;AAAEJ,MAAAA,SAAS,EAAEJ,uBAAuB,CAACF,cAAD;AAApC,KADL;AAELW,IAAAA,OAAO,EAAE;AACPL,MAAAA,SAAS,EAAEH;AADJ,KAFJ;AAKLS,IAAAA,OAAO,EAAE;AACPN,MAAAA,SAAS,EAAEH;AADJ,KALJ;AAQLU,IAAAA,MAAM,EAAE;AAAEP,MAAAA,SAAS,EAAEJ,uBAAuB,CAACF,cAAD;AAApC;AARH,GAAP;AAUD,CAXM","sourcesContent":["import { CSSProperties } from 'react';\n\nexport const transformLeftRigthClose = (anchorPosition: string) =>\n anchorPosition === 'right' ? 'translateX(100%)' : 'translateX(-100%)';\n\nexport const transformLeftRigthOpen = 'translateX(0)';\n\nexport const transformTopBottomClose = (anchorPosition: string) =>\n anchorPosition === 'top' ? 'translateY(-100%)' : 'translateY(100%)';\n\nexport const transformTopBottomOpen = 'translateY(0%)';\n\nexport const defaultStylesLeftRight = (\n anchorPosition: string\n): CSSProperties => {\n return {\n transition: 'transform 300ms ease-in-out',\n transform: transformLeftRigthClose(anchorPosition),\n overflowX: 'hidden',\n overflowY: 'auto',\n };\n};\n\nexport const transitionStylesLeftRight = (anchorPosition: string) => {\n return {\n entering: { transform: transformLeftRigthClose(anchorPosition) },\n entered: {\n transform: transformLeftRigthOpen,\n },\n exiting: {\n transform: transformLeftRigthOpen,\n },\n exited: { transform: transformLeftRigthClose(anchorPosition) },\n };\n};\n\nexport const defaultStylesTopBottom = (\n anchorPosition: string\n): CSSProperties => {\n return {\n transition: 'transform 300ms ease-in-out',\n transform: transformTopBottomClose(anchorPosition),\n overflowX: 'hidden',\n overflowY: 'auto',\n };\n};\nexport const transitionStylesTopBottom = (anchorPosition: string) => {\n return {\n entering: { transform: transformTopBottomClose(anchorPosition) },\n entered: {\n transform: transformTopBottomOpen,\n },\n exiting: {\n transform: transformTopBottomOpen,\n },\n exited: { transform: transformTopBottomClose(anchorPosition) },\n };\n};\n"],"file":"animations.js"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { MostUsedType, OptionsType } from './types';
|
|
3
|
-
export interface MenubarProps {
|
|
3
|
+
export interface MenubarProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
4
4
|
options: OptionsType[];
|
|
5
5
|
leftComponents?: React.ReactNode;
|
|
6
6
|
rightComponents?: React.ReactNode;
|
|
@@ -29,6 +29,8 @@ function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "functio
|
|
|
29
29
|
|
|
30
30
|
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
31
31
|
|
|
32
|
+
function _extends() { _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; }; return _extends.apply(this, arguments); }
|
|
33
|
+
|
|
32
34
|
const Menubar = ({
|
|
33
35
|
leftComponents,
|
|
34
36
|
rightComponents,
|
|
@@ -37,7 +39,8 @@ const Menubar = ({
|
|
|
37
39
|
mostUsed,
|
|
38
40
|
mostUsedLabel = 'Mais acessados',
|
|
39
41
|
searchResultsLabel = 'Resultados da busca',
|
|
40
|
-
searchable = true
|
|
42
|
+
searchable = true,
|
|
43
|
+
...rest
|
|
41
44
|
}) => {
|
|
42
45
|
const [search, setSearch] = _react.default.useState('');
|
|
43
46
|
|
|
@@ -57,7 +60,9 @@ const Menubar = ({
|
|
|
57
60
|
setResults((0, _utils.filterAndTransform)(options, search));
|
|
58
61
|
}, [search]);
|
|
59
62
|
|
|
60
|
-
return _react.default.createElement(
|
|
63
|
+
return _react.default.createElement("div", _extends({
|
|
64
|
+
ref: ref => menuRef.current = ref
|
|
65
|
+
}, rest), _react.default.createElement(_styled.StyledMenuBar, null, _react.default.createElement(_styled.StyledMenuButton, {
|
|
61
66
|
variant: "filled",
|
|
62
67
|
color: "primary",
|
|
63
68
|
onPress: toggleOpen
|
|
@@ -88,7 +93,6 @@ const Menubar = ({
|
|
|
88
93
|
in: open,
|
|
89
94
|
timeout: 250
|
|
90
95
|
}, state => _react.default.createElement(_styled.StyledContainerOpenMenu, {
|
|
91
|
-
ref: ref => menuRef.current = ref,
|
|
92
96
|
style: (0, _animations.getContainerOpenMenuStyles)(state)
|
|
93
97
|
}, !search ? _react.default.createElement(_react.default.Fragment, null, mostUsed && _react.default.createElement(_MostUsed.MostUsed, {
|
|
94
98
|
label: mostUsedLabel,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/components/molecules/Menubar/Menubar.tsx"],"names":["Menubar","leftComponents","rightComponents","searchPlaceholder","options","mostUsed","mostUsedLabel","searchResultsLabel","searchable","search","setSearch","React","useState","results","setResults","input","setInput","open","setOpen","menuRef","toggleOpen","useCallback","state","useEffect","ref","current","map","result","title","category"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AAIA
|
|
1
|
+
{"version":3,"sources":["../../../../src/components/molecules/Menubar/Menubar.tsx"],"names":["Menubar","leftComponents","rightComponents","searchPlaceholder","options","mostUsed","mostUsedLabel","searchResultsLabel","searchable","rest","search","setSearch","React","useState","results","setResults","input","setInput","open","setOpen","menuRef","toggleOpen","useCallback","state","useEffect","ref","current","map","result","title","category"],"mappings":";;;;;;;AAAA;;AACA;;AACA;;AACA;;AAWA;;AACA;;AACA;;AACA;;AACA;;AAIA;;;;;;;;AAcA,MAAMA,OAA+B,GAAG,CAAC;AACvCC,EAAAA,cADuC;AAEvCC,EAAAA,eAFuC;AAGvCC,EAAAA,iBAAiB,GAAG,2BAHmB;AAIvCC,EAAAA,OAJuC;AAKvCC,EAAAA,QALuC;AAMvCC,EAAAA,aAAa,GAAG,gBANuB;AAOvCC,EAAAA,kBAAkB,GAAG,qBAPkB;AAQvCC,EAAAA,UAAU,GAAG,IAR0B;AASvC,KAAGC;AAToC,CAAD,KAUlC;AACJ,QAAM,CAACC,MAAD,EAASC,SAAT,IAAsBC,eAAMC,QAAN,CAAuB,EAAvB,CAA5B;;AACA,QAAM,CAACC,OAAD,EAAUC,UAAV,IAAwBH,eAAMC,QAAN,CAA+B,EAA/B,CAA9B;;AACA,QAAM,CAACG,KAAD,EAAQC,QAAR,IAAoB,kCAA0B,EAA1B,EAA8BN,SAA9B,CAA1B;;AACA,QAAM,CAACO,IAAD,EAAOC,OAAP,IAAkBP,eAAMC,QAAN,CAAwB,KAAxB,CAAxB;;AACA,QAAMO,OAAO,GAAG,mBAA8B,IAA9B,CAAhB;AACA,mCAAqBA,OAArB,EAA8BD,OAA9B;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AHJ;AAOE,IAAA,KAAK,EAAEa,KAPT;AAQE,IAAA,QAAQ,EAAEC;AARZ,IAFJ,CAFJ,CAnBF,EAqCGf,eArCH,CADF,EAwCE,6BAAC,gCAAD;AAAY,IAAA,EAAE,EAAEgB,IAAhB;AAAsB,IAAA,OAAO,EAAE;AAA/B,KACGK,KAAK,IACJ,6BAAC,+BAAD;AAAyB,IAAA,KAAK,EAAE,4CAA2BA,KAA3B;AAAhC,KACG,CAACb,MAAD,GACC,4DACGL,QAAQ,IACP,6BAAC,kBAAD;AACE,IAAA,KAAK,EAAEC,aADT;AAEE,IAAA,IAAI,EAAED,QAFR;AAGE,IAAA,MAAM,EAAEgB;AAHV,IAFJ,EAQE,6BAAC,oBAAD;AAAW,IAAA,OAAO,EAAEjB,OAApB;AAA6B,IAAA,MAAM,EAAEiB;AAArC,IARF,CADD,GAYC,6BAAC,oCAAD,QACE,6BAAC,iCAAD,QACE,6BAAC,eAAD;AAAM,IAAA,UAAU,EAAC;AAAjB,KAAyBd,kBAAzB,CADF,CADF,EAIGO,OAAO,CAACa,GAAR,CAAYC,MAAM,IACjB,6BAAC,kCAAD;AACE,IAAA,GAAG,EAAG,GAAEA,MAAM,CAACC,KAAM,IAAGD,MAAM,CAACE,QAAS,EAD1C;AAEE,IAAA,IAAI,EAAEF,MAFR;AAGE,IAAA,UAAU,EAAElB,MAHd;AAIE,IAAA,MAAM,EAAEW;AAJV,IADD,CAJH,CAbJ,CAFJ,CAxCF,CADF;AA2ED,CAtGD;;eAwGerB,O","sourcesContent":["import React, { useRef } from 'react';\nimport { Icon, Text, useDebouncedState } from '@tecsinapse/react-core';\nimport { Transition } from 'react-transition-group';\nimport {\n StyledIconInput,\n StyledMenuBar,\n StyledMenuButton,\n StyledContainerOpenMenu,\n StyledInput,\n StyledInputContainer,\n StyledSearchResultsContainer,\n StyledSearchTextContainer,\n} from './styled';\nimport { MostUsedType, OptionsType } from './types';\nimport { MostUsed } from './MostUsed';\nimport { MenuBlock } from './MenuBlock';\nimport { SearchResultItem } from './SearchResultItem';\nimport { filterAndTransform } from './utils';\nimport {\n getContainerOpenMenuStyles,\n getInputContainerStyles,\n} from './animations';\nimport { useClickAwayListener } from '../../../hooks';\n\nexport interface MenubarProps extends React.HTMLAttributes<HTMLDivElement> {\n options: OptionsType[];\n leftComponents?: React.ReactNode;\n rightComponents?: React.ReactNode;\n /** Limited to first 4 elements */\n mostUsed?: MostUsedType[];\n mostUsedLabel?: string;\n searchable?: boolean;\n searchPlaceholder?: string;\n searchResultsLabel?: string;\n}\n\nconst Menubar: React.FC<MenubarProps> = ({\n leftComponents,\n rightComponents,\n searchPlaceholder = 'O quê você deseja buscar?',\n options,\n mostUsed,\n mostUsedLabel = 'Mais acessados',\n searchResultsLabel = 'Resultados da busca',\n searchable = true,\n ...rest\n}) => {\n const [search, setSearch] = React.useState<string>('');\n const [results, setResults] = React.useState<MostUsedType[]>([]);\n const [input, setInput] = useDebouncedState<string>('', setSearch);\n const [open, setOpen] = React.useState<boolean>(false);\n const menuRef = useRef<HTMLDivElement | null>(null);\n useClickAwayListener(menuRef, setOpen);\n\n const toggleOpen = React.useCallback(() => setOpen(state => !state), [\n setOpen,\n ]);\n\n React.useEffect(() => {\n if (search === '') return;\n setResults(filterAndTransform(options, search));\n }, [search]);\n\n return (\n <div ref={ref => (menuRef.current = ref)} {...rest}>\n <StyledMenuBar>\n <StyledMenuButton variant=\"filled\" color=\"primary\" onPress={toggleOpen}>\n {!open ? (\n <Icon\n size=\"deca\"\n name=\"menu\"\n type=\"material-community\"\n fontColor=\"light\"\n />\n ) : (\n <Icon\n size=\"deca\"\n name=\"close\"\n type=\"material-community\"\n fontColor=\"light\"\n />\n )}\n </StyledMenuButton>\n {leftComponents}\n <Transition in={open} timeout={250}>\n {state => (\n <StyledInputContainer style={getInputContainerStyles(state)}>\n {searchable && (\n <StyledInput\n placeholder={searchPlaceholder}\n leftComponent={\n <StyledIconInput>\n <Icon name=\"magnify\" type=\"material-community\" />\n </StyledIconInput>\n }\n value={input}\n onChange={setInput}\n />\n )}\n </StyledInputContainer>\n )}\n </Transition>\n {rightComponents}\n </StyledMenuBar>\n <Transition in={open} timeout={250}>\n {state => (\n <StyledContainerOpenMenu style={getContainerOpenMenuStyles(state)}>\n {!search ? (\n <>\n {mostUsed && (\n <MostUsed\n label={mostUsedLabel}\n data={mostUsed}\n toggle={toggleOpen}\n />\n )}\n <MenuBlock options={options} toggle={toggleOpen} />\n </>\n ) : (\n <StyledSearchResultsContainer>\n <StyledSearchTextContainer>\n <Text fontWeight=\"bold\">{searchResultsLabel}</Text>\n </StyledSearchTextContainer>\n {results.map(result => (\n <SearchResultItem\n key={`${result.title}-${result.category}`}\n data={result}\n searchTerm={search}\n toggle={toggleOpen}\n />\n ))}\n </StyledSearchResultsContainer>\n )}\n </StyledContainerOpenMenu>\n )}\n </Transition>\n </div>\n );\n};\n\nexport default Menubar;\n"],"file":"Menubar.js"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { CSSProperties } from 'react';
|
|
2
1
|
import { SelectProps } from '../Select';
|
|
3
|
-
declare const Dropdown: <Data, Type extends "single" | "multi">({ options, onSearch, type, hideSearchBar, onSelect, value, keyExtractor, labelExtractor, setDropDownVisible, style, }: SelectProps<Data, Type> & {
|
|
2
|
+
declare const Dropdown: <Data, Type extends "single" | "multi">({ options, onSearch, type, hideSearchBar, onSelect, value, keyExtractor, labelExtractor, setDropDownVisible, style, anchor, }: SelectProps<Data, Type> & {
|
|
4
3
|
setDropDownVisible: (t: boolean) => void;
|
|
5
|
-
style: CSSProperties;
|
|
6
4
|
}) => JSX.Element;
|
|
7
5
|
export default Dropdown;
|
|
@@ -27,7 +27,8 @@ const Dropdown = ({
|
|
|
27
27
|
keyExtractor,
|
|
28
28
|
labelExtractor,
|
|
29
29
|
setDropDownVisible,
|
|
30
|
-
style
|
|
30
|
+
style,
|
|
31
|
+
anchor
|
|
31
32
|
}) => {
|
|
32
33
|
const [searchArg, setSearchArg] = (0, _reactCore.useDebouncedState)('', onSearch);
|
|
33
34
|
const lengthOptions = options.length;
|
|
@@ -44,7 +45,8 @@ const Dropdown = ({
|
|
|
44
45
|
|
|
45
46
|
return _react.default.createElement(_styled.StyledContainerDropdown, {
|
|
46
47
|
lengthOptions: lengthOptions,
|
|
47
|
-
style: style
|
|
48
|
+
style: style,
|
|
49
|
+
anchor: anchor
|
|
48
50
|
}, type === 'multi' && _react.default.createElement(_styled.StyledContainerCheckAll, {
|
|
49
51
|
onClick: hideSearchBar ? onClickCheckAll : undefined
|
|
50
52
|
}, _react.default.createElement(_reactCore.Checkbox, {
|
|
@@ -67,8 +69,8 @@ const Dropdown = ({
|
|
|
67
69
|
onChange: text => setSearchArg(text)
|
|
68
70
|
})) : _react.default.createElement(_styled.StyledContainerTextLabel, null, _react.default.createElement(_reactCore.Text, {
|
|
69
71
|
fontWeight: "bold"
|
|
70
|
-
}, _react.default.createElement(_styled.StyledSpan, null, "Selecionar todos")))), _react.default.createElement(_styled.
|
|
71
|
-
|
|
72
|
+
}, _react.default.createElement(_styled.StyledSpan, null, "Selecionar todos")))), _react.default.createElement(_styled.OptionsContainer, {
|
|
73
|
+
lengthOptions: options.length
|
|
72
74
|
}, options.map((item, index) => _react.default.createElement(_SelectItem.ItemSelect, {
|
|
73
75
|
type: type,
|
|
74
76
|
key: index,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/molecules/Select/Dropdown/Dropdown.tsx"],"names":["Dropdown","options","onSearch","type","hideSearchBar","onSelect","value","keyExtractor","labelExtractor","setDropDownVisible","style","searchArg","setSearchArg","lengthOptions","length","checkedAll","setCheckedAll","React","useState","onClickCheckAll","items","map","option","aux","auxArray","undefined","width","marginHorizontal","text","item","index"],"mappings":";;;;;;;AAAA;;AACA;;AAMA;;AACA;;AAEA;;;;AASA,MAAMA,QAAQ,GAAG,CAAwC;AACvDC,EAAAA,OADuD;AAEvDC,EAAAA,QAFuD;AAGvDC,EAAAA,IAHuD;AAIvDC,EAAAA,aAJuD;AAKvDC,EAAAA,QALuD;AAMvDC,EAAAA,KANuD;AAOvDC,EAAAA,YAPuD;AAQvDC,EAAAA,cARuD;AASvDC,EAAAA,kBATuD;AAUvDC,EAAAA;
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/molecules/Select/Dropdown/Dropdown.tsx"],"names":["Dropdown","options","onSearch","type","hideSearchBar","onSelect","value","keyExtractor","labelExtractor","setDropDownVisible","style","anchor","searchArg","setSearchArg","lengthOptions","length","checkedAll","setCheckedAll","React","useState","onClickCheckAll","items","map","option","aux","auxArray","undefined","width","marginHorizontal","text","item","index"],"mappings":";;;;;;;AAAA;;AACA;;AAMA;;AACA;;AAEA;;;;AASA,MAAMA,QAAQ,GAAG,CAAwC;AACvDC,EAAAA,OADuD;AAEvDC,EAAAA,QAFuD;AAGvDC,EAAAA,IAHuD;AAIvDC,EAAAA,aAJuD;AAKvDC,EAAAA,QALuD;AAMvDC,EAAAA,KANuD;AAOvDC,EAAAA,YAPuD;AAQvDC,EAAAA,cARuD;AASvDC,EAAAA,kBATuD;AAUvDC,EAAAA,KAVuD;AAWvDC,EAAAA;AAXuD,CAAxC,KAcE;AACjB,QAAM,CAACC,SAAD,EAAYC,YAAZ,IAA4B,kCAA0B,EAA1B,EAA8BX,QAA9B,CAAlC;AACA,QAAMY,aAAa,GAAGb,OAAO,CAACc,MAA9B;;AAEA,QAAM,CAACC,UAAD,EAAaC,aAAb,IAA8BC,eAAMC,QAAN,CAClChB,IAAI,KAAK,OAAT,IAAoB,CAACG,KAAD,aAACA,KAAD,uBAACA,KAAD,CAAmBS,MAAnB,MAA8BD,aADhB,CAApC;;AAIA,QAAMM,eAAe,GAAG,MAAM;AAC5B,UAAMC,KAAK,GAAGpB,OAAO,CAACqB,GAAR,CAAYC,MAAM,IAAIA,MAAtB,CAAd;AACAN,IAAAA,aAAa,CAAC,CAACD,UAAF,CAAb;AACA,UAAMQ,GAAG,GAAG,CAACR,UAAb;AAEA,UAAMS,Q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,EAAED,IAHR;AAIE,IAAA,QAAQ,EAAEzB,QAJZ;AAKE,IAAA,KAAK,EAAEC,KALT;AAME,IAAA,YAAY,EAAEC,YANhB;AAOE,IAAA,KAAK,EAAEwB,KAPT;AAQE,IAAA,cAAc,EAAEvB,cARlB;AASE,IAAA,kBAAkB,EAAEC,kBATtB;AAUE,IAAA,UAAU,EAAEO,UAVd;AAWE,IAAA,aAAa,EAAEC,aAXjB;AAYE,IAAA,aAAa,EAAEhB,OAAO,CAACc;AAZzB,IADD,CADH,CApCF,CADF;AAyDD,CAxFD;;eA0Fef,Q","sourcesContent":["import React from 'react';\nimport {\n Checkbox,\n Text,\n Icon,\n useDebouncedState,\n} from '@tecsinapse/react-core';\nimport { Input } from '../../../atoms/Input';\nimport { ItemSelect } from '../SelectItem';\nimport { SelectProps } from '../Select';\nimport {\n SearchBarContainer,\n StyledContainerCheckAll,\n StyledContainerDropdown,\n StyledContainerTextLabel,\n StyledSpan,\n OptionsContainer,\n} from './styled';\n\nconst Dropdown = <Data, Type extends 'single' | 'multi'>({\n options,\n onSearch,\n type,\n hideSearchBar,\n onSelect,\n value,\n keyExtractor,\n labelExtractor,\n setDropDownVisible,\n style,\n anchor,\n}: SelectProps<Data, Type> & {\n setDropDownVisible: (t: boolean) => void;\n}): JSX.Element => {\n const [searchArg, setSearchArg] = useDebouncedState<string>('', onSearch);\n const lengthOptions = options.length;\n\n const [checkedAll, setCheckedAll] = React.useState<boolean>(\n type === 'multi' && (value as Data[])?.length === lengthOptions\n );\n\n const onClickCheckAll = () => {\n const items = options.map(option => option);\n setCheckedAll(!checkedAll);\n const aux = !checkedAll;\n type OnSelectArg = Parameters<typeof onSelect>[0];\n const auxArray: Data[] = [];\n !aux ? onSelect(auxArray as OnSelectArg) : onSelect(items as OnSelectArg);\n };\n\n return (\n <StyledContainerDropdown\n lengthOptions={lengthOptions}\n style={style}\n anchor={anchor}\n >\n {type === 'multi' && (\n <StyledContainerCheckAll\n onClick={hideSearchBar ? onClickCheckAll : undefined}\n >\n <Checkbox checked={checkedAll} onChange={onClickCheckAll} />\n {!hideSearchBar ? (\n <SearchBarContainer>\n <Input\n style={{ width: '100%' }}\n placeholder=\"Busque a opção desejada\"\n value={searchArg}\n leftComponent={\n <Icon\n name=\"magnify\"\n type=\"material-community\"\n size=\"centi\"\n style={{ marginHorizontal: 12 }}\n />\n }\n onChange={text => setSearchArg(text)}\n />\n </SearchBarContainer>\n ) : (\n <StyledContainerTextLabel>\n <Text fontWeight=\"bold\">\n <StyledSpan>Selecionar todos</StyledSpan>\n </Text>\n </StyledContainerTextLabel>\n )}\n </StyledContainerCheckAll>\n )}\n <OptionsContainer lengthOptions={options.length}>\n {options.map((item, index) => (\n <ItemSelect\n type={type}\n key={index}\n item={item}\n onSelect={onSelect}\n value={value}\n keyExtractor={keyExtractor}\n index={index}\n labelExtractor={labelExtractor}\n setDropDownVisible={setDropDownVisible}\n checkedAll={checkedAll}\n setCheckedAll={setCheckedAll}\n lenghtOptions={options.length}\n />\n ))}\n </OptionsContainer>\n </StyledContainerDropdown>\n );\n};\n\nexport default Dropdown;\n"],"file":"Dropdown.js"}
|
|
@@ -3,7 +3,7 @@ export declare const StyledContainerDropdown: import("@emotion/styled").StyledCo
|
|
|
3
3
|
theme?: import("@emotion/react").Theme | undefined;
|
|
4
4
|
as?: import("react").ElementType<any> | undefined;
|
|
5
5
|
} & Partial<any>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
6
|
-
export declare const
|
|
6
|
+
export declare const OptionsContainer: import("@emotion/styled").StyledComponent<{
|
|
7
7
|
theme?: import("@emotion/react").Theme | undefined;
|
|
8
8
|
as?: import("react").ElementType<any> | undefined;
|
|
9
9
|
} & Partial<any>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
|
|
@@ -3,14 +3,32 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.StyledContainerTextLabel = exports.StyledSpan = exports.StyledContainerCheckAll = exports.SearchBarContainer = exports.
|
|
6
|
+
exports.StyledContainerTextLabel = exports.StyledSpan = exports.StyledContainerCheckAll = exports.SearchBarContainer = exports.OptionsContainer = exports.StyledContainerDropdown = void 0;
|
|
7
7
|
|
|
8
8
|
var _styled = _interopRequireDefault(require("@emotion/styled"));
|
|
9
9
|
|
|
10
10
|
var _reactCore = require("@tecsinapse/react-core");
|
|
11
11
|
|
|
12
|
+
var _react = require("@emotion/react");
|
|
13
|
+
|
|
12
14
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
13
15
|
|
|
16
|
+
const anchorBottom = ({
|
|
17
|
+
theme,
|
|
18
|
+
anchor
|
|
19
|
+
}) => anchor === 'bottom' && (0, _react.css)`
|
|
20
|
+
margin-top: ${theme.spacing.centi};
|
|
21
|
+
top: 100%;
|
|
22
|
+
`;
|
|
23
|
+
|
|
24
|
+
const anchorTop = ({
|
|
25
|
+
theme,
|
|
26
|
+
anchor
|
|
27
|
+
}) => anchor === 'top' && (0, _react.css)`
|
|
28
|
+
margin-bottom: ${theme.spacing.centi};
|
|
29
|
+
bottom: 100%;
|
|
30
|
+
`;
|
|
31
|
+
|
|
14
32
|
const StyledContainerDropdown = (0, _styled.default)('div')`
|
|
15
33
|
width: 100%;
|
|
16
34
|
background-color: ${({
|
|
@@ -19,14 +37,10 @@ const StyledContainerDropdown = (0, _styled.default)('div')`
|
|
|
19
37
|
border-radius: ${({
|
|
20
38
|
theme
|
|
21
39
|
}) => theme.borderRadius.mili};
|
|
22
|
-
box-shadow:
|
|
40
|
+
box-shadow: 0 2px 8px
|
|
23
41
|
${({
|
|
24
42
|
theme
|
|
25
43
|
}) => (0, _reactCore.hex2rgba)(theme.miscellaneous.shadow, 0.08)};
|
|
26
|
-
margin-top: ${({
|
|
27
|
-
theme
|
|
28
|
-
}) => theme.spacing.centi};
|
|
29
|
-
top: 100%;
|
|
30
44
|
position: absolute;
|
|
31
45
|
padding-top: ${({
|
|
32
46
|
theme,
|
|
@@ -38,14 +52,16 @@ const StyledContainerDropdown = (0, _styled.default)('div')`
|
|
|
38
52
|
z-index: ${({
|
|
39
53
|
theme
|
|
40
54
|
}) => theme.zIndex.select};
|
|
55
|
+
${anchorTop}
|
|
56
|
+
${anchorBottom}
|
|
41
57
|
`;
|
|
42
58
|
exports.StyledContainerDropdown = StyledContainerDropdown;
|
|
43
|
-
const
|
|
59
|
+
const OptionsContainer = (0, _styled.default)('div')`
|
|
44
60
|
max-height: 250px;
|
|
45
61
|
top: 100%;
|
|
46
62
|
overflow-y: ${({
|
|
47
|
-
|
|
48
|
-
}) =>
|
|
63
|
+
lengthOptions = 0
|
|
64
|
+
}) => lengthOptions > 5 ? 'scroll' : 'hidden'};
|
|
49
65
|
::-webkit-scrollbar {
|
|
50
66
|
width: 8px;
|
|
51
67
|
}
|
|
@@ -63,7 +79,7 @@ const StyledTest = (0, _styled.default)('div')`
|
|
|
63
79
|
}) => theme.color.primary.light};
|
|
64
80
|
},
|
|
65
81
|
`;
|
|
66
|
-
exports.
|
|
82
|
+
exports.OptionsContainer = OptionsContainer;
|
|
67
83
|
const SearchBarContainer = (0, _styled.default)('div')`
|
|
68
84
|
padding-left: ${({
|
|
69
85
|
theme
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/components/molecules/Select/Dropdown/styled.ts"],"names":["
|
|
1
|
+
{"version":3,"sources":["../../../../../src/components/molecules/Select/Dropdown/styled.ts"],"names":["anchorBottom","theme","anchor","spacing","centi","anchorTop","StyledContainerDropdown","miscellaneous","surfaceColor","borderRadius","mili","shadow","hideSearchBar","deca","zIndex","select","OptionsContainer","lengthOptions","color","secondary","light","primary","SearchBarContainer","StyledContainerCheckAll","xlight","medium","StyledSpan","StyledContainerTextLabel"],"mappings":";;;;;;;AAAA;;AACA;;AAEA;;;;AAMA,MAAMA,YAAY,GAA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AAG,qBAAO,KAAP,CAAmC;AAC3E,kBAAkB,CAAC;AAAE1B,EAAAA;AAAF,CAAD,KAAeA,KAAK,CAACE,OAAN,CAAcO,IAAK;AACpD;AACA;AACA;AACA,CALO","sourcesContent":["import styled from '@emotion/styled';\nimport { hex2rgba, StyleProps } from '@tecsinapse/react-core';\nimport { SelectProps } from '../Select';\nimport { css } from '@emotion/react';\n\ntype InjectedProps = Partial<\n StyleProps & SelectProps<any, any> & { lengthOptions: number }\n>;\n\nconst anchorBottom = ({\n theme,\n anchor,\n}: StyleProps & Omit<InjectedProps, 'theme'>) =>\n anchor === 'bottom' &&\n css`\n margin-top: ${theme.spacing.centi};\n top: 100%;\n `;\n\nconst anchorTop = ({\n theme,\n anchor,\n}: StyleProps & Omit<InjectedProps, 'theme'>) =>\n anchor === 'top' &&\n css`\n margin-bottom: ${theme.spacing.centi};\n bottom: 100%;\n `;\n\nexport const StyledContainerDropdown = styled('div')<InjectedProps>`\n width: 100%;\n background-color: ${({ theme }: StyleProps) =>\n theme.miscellaneous.surfaceColor};\n border-radius: ${({ theme }: StyleProps) => theme.borderRadius.mili};\n box-shadow: 0 2px 8px\n ${({ theme }: StyleProps) => hex2rgba(theme.miscellaneous.shadow, 0.08)};\n position: absolute;\n padding-top: ${({\n theme,\n hideSearchBar,\n }: StyleProps & Partial<SelectProps<any, any>>) =>\n !hideSearchBar ? `${theme.spacing.deca}` : '0px'};\n padding-bottom: ${({ theme }: StyleProps) => theme.spacing.mili};\n z-index: ${({ theme }: StyleProps) => theme.zIndex.select};\n ${anchorTop}\n ${anchorBottom}\n`;\n\nexport const OptionsContainer = styled('div')<InjectedProps>`\n max-height: 250px;\n top: 100%;\n overflow-y: ${({ lengthOptions = 0 }: InjectedProps) =>\n lengthOptions > 5 ? 'scroll' : 'hidden'};\n ::-webkit-scrollbar {\n width: 8px;\n }\n ::-webkit-scrollbar-thumb {\n border-radius: ${({ theme }: StyleProps) => theme.borderRadius.centi};\n background-color: ${({ theme }: StyleProps) => theme.color.secondary.light};\n }\n ::-webkit-scrollbar-thumb:hover {\n background-color: ${({ theme }: StyleProps) => theme.color.primary.light};\n },\n`;\n\nexport const SearchBarContainer = styled('div')<Partial<StyleProps>>`\n padding-left: ${({ theme }) => theme.spacing.mili};\n width: 100%;\n`;\n\nexport const StyledContainerCheckAll = styled('div')<Partial<StyleProps>>`\n padding: ${({ theme }) => `${theme.spacing.mili} ${theme.spacing.deca}`};\n flex-direction: row;\n display: flex;\n justify-content: flex-start;\n align-items: center;\n cursor: pointer;\n &:hover {\n background-color: ${({ theme }) => theme.color.primary.xlight};\n }\n &:hover span {\n color: ${({ theme }) => theme.color.primary.medium};\n }\n`;\n\nexport const StyledSpan = styled('span')<Partial<StyleProps>>`\n color: ${({ theme }) => theme.color.primary.medium};\n padding: ${({ theme }) => `${theme.spacing.mili} 0px`};\n`;\n\nexport const StyledContainerTextLabel = styled('div')<Partial<StyleProps>>`\n padding-left: ${({ theme }) => theme.spacing.mili};\n width: 100%;\n display: flex;\n overflow: hidden;\n`;\n"],"file":"styled.js"}
|