@tecsinapse/react-web-kit 1.22.0-beta.11 → 1.22.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 +31 -0
- package/dist/components/atoms/Accordion/animations.d.ts +4 -4
- package/dist/components/atoms/Button/hooks/useMouseHover.d.ts +1 -1
- package/dist/components/atoms/Button/hooks/useMousePressed.d.ts +1 -1
- package/dist/components/molecules/DatePicker/DatePicker.d.ts +1 -1
- package/dist/components/molecules/DatePicker/Modal.d.ts +1 -1
- package/dist/components/molecules/Grid/Item/Item.d.ts +1 -1
- package/dist/components/molecules/IconTextButton/IconTextButton.js +85 -0
- package/dist/components/molecules/IconTextButton/IconTextButton.js.map +1 -0
- package/dist/components/molecules/IconTextButton/TextComponent.js +42 -0
- package/dist/components/molecules/IconTextButton/TextComponent.js.map +1 -0
- package/dist/components/molecules/IconTextButton/hooks/useIconTextButton.d.ts +1 -1
- package/dist/components/molecules/IconTextButton/hooks/useIconTextButton.js +30 -0
- package/dist/components/molecules/IconTextButton/hooks/useIconTextButton.js.map +1 -0
- package/dist/components/molecules/IconTextButton/styled.js +23 -0
- package/dist/components/molecules/IconTextButton/styled.js.map +1 -0
- package/dist/components/molecules/Select/Select.js +4 -9
- package/dist/components/molecules/Select/Select.js.map +1 -1
- package/dist/components/molecules/Select/functions.d.ts +1 -1
- package/dist/components/organisms/DataGrid/DataGrid.d.ts +1 -1
- package/dist/components/organisms/DataGrid/Row/Row.d.ts +1 -1
- package/dist/index.d.ts +5 -4
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/esm/components/atoms/Accordion/animations.d.ts +4 -4
- package/esm/components/atoms/Button/hooks/useMouseHover.d.ts +1 -1
- package/esm/components/atoms/Button/hooks/useMousePressed.d.ts +1 -1
- package/esm/components/molecules/DatePicker/DatePicker.d.ts +1 -1
- package/esm/components/molecules/DatePicker/Modal.d.ts +1 -1
- package/esm/components/molecules/Grid/Item/Item.d.ts +1 -1
- package/esm/components/molecules/IconTextButton/IconTextButton.js +65 -37
- package/esm/components/molecules/IconTextButton/IconTextButton.js.map +1 -1
- package/esm/components/molecules/IconTextButton/TextComponent.js +31 -18
- package/esm/components/molecules/IconTextButton/TextComponent.js.map +1 -1
- package/esm/components/molecules/IconTextButton/hooks/useIconTextButton.d.ts +1 -1
- package/esm/components/molecules/IconTextButton/hooks/useIconTextButton.js +17 -11
- package/esm/components/molecules/IconTextButton/hooks/useIconTextButton.js.map +1 -1
- package/esm/components/molecules/IconTextButton/styled.js +15 -29
- package/esm/components/molecules/IconTextButton/styled.js.map +1 -1
- package/esm/components/molecules/Select/Select.js +4 -9
- package/esm/components/molecules/Select/Select.js.map +1 -1
- package/esm/components/molecules/Select/functions.d.ts +1 -1
- package/esm/components/organisms/DataGrid/DataGrid.d.ts +1 -1
- package/esm/components/organisms/DataGrid/Row/Row.d.ts +1 -1
- package/esm/index.d.ts +5 -4
- package/esm/index.js +1 -0
- package/esm/index.js.map +1 -1
- package/package.json +3 -3
- package/src/components/molecules/Select/Select.tsx +4 -10
- package/src/index.ts +6 -4
- package/esm/components/atoms/Accordion/index.js +0 -2
- package/esm/components/atoms/Accordion/index.js.map +0 -1
- package/esm/components/atoms/Badge/index.js +0 -2
- package/esm/components/atoms/Badge/index.js.map +0 -1
- package/esm/components/atoms/Button/index.js +0 -3
- package/esm/components/atoms/Button/index.js.map +0 -1
- package/esm/components/atoms/Input/index.js +0 -2
- package/esm/components/atoms/Input/index.js.map +0 -1
- package/esm/components/atoms/InputMask/index.js +0 -2
- package/esm/components/atoms/InputMask/index.js.map +0 -1
- package/esm/components/atoms/Modal/index.js +0 -2
- package/esm/components/atoms/Modal/index.js.map +0 -1
- package/esm/components/atoms/Overlay/index.js +0 -2
- package/esm/components/atoms/Overlay/index.js.map +0 -1
- package/esm/components/atoms/Skeleton/index.js +0 -2
- package/esm/components/atoms/Skeleton/index.js.map +0 -1
- package/esm/components/atoms/Table/Body/index.js +0 -2
- package/esm/components/atoms/Table/Body/index.js.map +0 -1
- package/esm/components/atoms/Table/Cell/index.js +0 -2
- package/esm/components/atoms/Table/Cell/index.js.map +0 -1
- package/esm/components/atoms/Table/Container/index.js +0 -2
- package/esm/components/atoms/Table/Container/index.js.map +0 -1
- package/esm/components/atoms/Table/Footer/index.js +0 -2
- package/esm/components/atoms/Table/Footer/index.js.map +0 -1
- package/esm/components/atoms/Table/Header/index.js +0 -3
- package/esm/components/atoms/Table/Header/index.js.map +0 -1
- package/esm/components/atoms/Table/Row/index.js +0 -2
- package/esm/components/atoms/Table/Row/index.js.map +0 -1
- package/esm/components/atoms/Table/Toolbar/index.js +0 -2
- package/esm/components/atoms/Table/Toolbar/index.js.map +0 -1
- package/esm/components/atoms/Table/index.js +0 -9
- package/esm/components/atoms/Table/index.js.map +0 -1
- package/esm/components/atoms/Tag/index.js +0 -2
- package/esm/components/atoms/Tag/index.js.map +0 -1
- package/esm/components/atoms/Tooltip/index.js +0 -2
- package/esm/components/atoms/Tooltip/index.js.map +0 -1
- package/esm/components/molecules/Breadcrumbs/BreadcrumbItem/index.js +0 -3
- package/esm/components/molecules/Breadcrumbs/BreadcrumbItem/index.js.map +0 -1
- package/esm/components/molecules/Breadcrumbs/index.js +0 -2
- package/esm/components/molecules/Breadcrumbs/index.js.map +0 -1
- package/esm/components/molecules/DatePicker/Modal.js +0 -27
- package/esm/components/molecules/DatePicker/Modal.js.map +0 -1
- package/esm/components/molecules/DatePicker/index.js +0 -2
- package/esm/components/molecules/DatePicker/index.js.map +0 -1
- package/esm/components/molecules/DatePicker/styled.js +0 -23
- package/esm/components/molecules/DatePicker/styled.js.map +0 -1
- package/esm/components/molecules/DateTimePicker/Modal.js +0 -26
- package/esm/components/molecules/DateTimePicker/Modal.js.map +0 -1
- package/esm/components/molecules/DateTimePicker/index.js +0 -2
- package/esm/components/molecules/DateTimePicker/index.js.map +0 -1
- package/esm/components/molecules/DateTimePicker/styled.js +0 -18
- package/esm/components/molecules/DateTimePicker/styled.js.map +0 -1
- package/esm/components/molecules/Drawer/index.js +0 -2
- package/esm/components/molecules/Drawer/index.js.map +0 -1
- package/esm/components/molecules/Grid/Item/index.js +0 -2
- package/esm/components/molecules/Grid/Item/index.js.map +0 -1
- package/esm/components/molecules/Grid/index.js +0 -3
- package/esm/components/molecules/Grid/index.js.map +0 -1
- package/esm/components/molecules/IconTextButton/index.js +0 -2
- package/esm/components/molecules/IconTextButton/index.js.map +0 -1
- package/esm/components/molecules/InputPassword/index.js +0 -2
- package/esm/components/molecules/InputPassword/index.js.map +0 -1
- package/esm/components/molecules/LabeledSwitch/index.js +0 -2
- package/esm/components/molecules/LabeledSwitch/index.js.map +0 -1
- package/esm/components/molecules/Masonry/index.js +0 -2
- package/esm/components/molecules/Masonry/index.js.map +0 -1
- package/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/index.js +0 -2
- package/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/index.js.map +0 -1
- package/esm/components/molecules/Menubar/MenuBlock/MenuItem/index.js +0 -2
- package/esm/components/molecules/Menubar/MenuBlock/MenuItem/index.js.map +0 -1
- package/esm/components/molecules/Menubar/MenuBlock/index.js +0 -2
- package/esm/components/molecules/Menubar/MenuBlock/index.js.map +0 -1
- package/esm/components/molecules/Menubar/MostUsed/index.js +0 -2
- package/esm/components/molecules/Menubar/MostUsed/index.js.map +0 -1
- package/esm/components/molecules/Menubar/SearchResultItem/index.js +0 -2
- package/esm/components/molecules/Menubar/SearchResultItem/index.js.map +0 -1
- package/esm/components/molecules/Menubar/index.js +0 -3
- package/esm/components/molecules/Menubar/index.js.map +0 -1
- package/esm/components/molecules/Menubar/types.js +0 -2
- package/esm/components/molecules/Menubar/types.js.map +0 -1
- package/esm/components/molecules/Select/Dropdown/components/index.js +0 -2
- package/esm/components/molecules/Select/Dropdown/components/index.js.map +0 -1
- package/esm/components/molecules/Select/Dropdown/index.js +0 -2
- package/esm/components/molecules/Select/Dropdown/index.js.map +0 -1
- package/esm/components/molecules/Select/SelectItem/index.js +0 -2
- package/esm/components/molecules/Select/SelectItem/index.js.map +0 -1
- package/esm/components/molecules/Select/index.js +0 -2
- package/esm/components/molecules/Select/index.js.map +0 -1
- package/esm/components/molecules/Snackbar/index.js +0 -2
- package/esm/components/molecules/Snackbar/index.js.map +0 -1
- package/esm/components/molecules/TextArea/index.js +0 -2
- package/esm/components/molecules/TextArea/index.js.map +0 -1
- package/esm/components/organisms/DataGrid/Footer/index.js +0 -2
- package/esm/components/organisms/DataGrid/Footer/index.js.map +0 -1
- package/esm/components/organisms/DataGrid/Header/index.js +0 -2
- package/esm/components/organisms/DataGrid/Header/index.js.map +0 -1
- package/esm/components/organisms/DataGrid/Row/index.js +0 -2
- package/esm/components/organisms/DataGrid/Row/index.js.map +0 -1
- package/esm/components/organisms/DataGrid/index.js +0 -3
- package/esm/components/organisms/DataGrid/index.js.map +0 -1
- package/esm/components/organisms/DataGrid/types.js +0 -2
- package/esm/components/organisms/DataGrid/types.js.map +0 -1
- package/esm/hooks/index.js +0 -4
- package/esm/hooks/index.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,37 @@
|
|
|
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.22.0](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.21.3...@tecsinapse/react-web-kit@1.22.0) (2022-09-28)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Bug Fixes
|
|
10
|
+
|
|
11
|
+
* add babel target ([88f3dd8](https://github.com/tecsinapse/design-system/commit/88f3dd8a7865ef507855d76ed4f420c6bd1c1a39))
|
|
12
|
+
* project scripts ([cb2e0a1](https://github.com/tecsinapse/design-system/commit/cb2e0a1873cfc3f45e793b5443297fb6fffce1b5))
|
|
13
|
+
* stories import ([8d0cc3f](https://github.com/tecsinapse/design-system/commit/8d0cc3fdc51fb2331f73ab3cd6c1ec3cfa37941c))
|
|
14
|
+
* use run-p to parallelize scripts ([31ee9eb](https://github.com/tecsinapse/design-system/commit/31ee9eb0441f3b2f663e337c7f86549284108982))
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Features
|
|
18
|
+
|
|
19
|
+
* finish compiler config ([af9f2ae](https://github.com/tecsinapse/design-system/commit/af9f2ae2dd2b08e9842778d0159ecd3d44bef89a))
|
|
20
|
+
* finish rollup config for core and web ([0ce9636](https://github.com/tecsinapse/design-system/commit/0ce9636d0b44bd2a80cf5614b8ed93f126dba8d2))
|
|
21
|
+
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## [1.21.3](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.21.2...@tecsinapse/react-web-kit@1.21.3) (2022-09-23)
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
### Bug Fixes
|
|
30
|
+
|
|
31
|
+
* dependencies and verification lazy select ([3cb68af](https://github.com/tecsinapse/design-system/commit/3cb68af91d8df6b487c6cab8f707b2604fb9e55e))
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
|
|
6
37
|
## [1.21.2](https://github.com/tecsinapse/design-system/compare/@tecsinapse/react-web-kit@1.21.1...@tecsinapse/react-web-kit@1.21.2) (2022-09-16)
|
|
7
38
|
|
|
8
39
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const contentStyle: (open: boolean, transition: number, value: number, theme:
|
|
1
|
+
export declare const contentStyle: (open: boolean, transition: number, value: number, theme: ThemeProp) => {
|
|
2
2
|
transition: string;
|
|
3
3
|
paddingBottom: any;
|
|
4
4
|
height: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const contentTransition: (value: number, theme:
|
|
6
|
+
export declare const contentTransition: (value: number, theme: ThemeProp) => {
|
|
7
7
|
entering: {
|
|
8
8
|
paddingBottom: any;
|
|
9
9
|
height: number;
|
|
@@ -21,11 +21,11 @@ export declare const contentTransition: (value: number, theme: any) => {
|
|
|
21
21
|
height: number;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
export declare const titleStyle: (transition: number, theme:
|
|
24
|
+
export declare const titleStyle: (transition: number, theme: ThemeProp) => {
|
|
25
25
|
transition: string;
|
|
26
26
|
color: any;
|
|
27
27
|
};
|
|
28
|
-
export declare const titleTransition: (theme:
|
|
28
|
+
export declare const titleTransition: (theme: ThemeProp) => {
|
|
29
29
|
entering: {
|
|
30
30
|
color: any;
|
|
31
31
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useMouseHover: (active: boolean, onMouseOver?: (
|
|
1
|
+
export declare const useMouseHover: (active: boolean, onMouseOver?: () => void, onMouseOut?: () => void) => {
|
|
2
2
|
mouseOver: boolean;
|
|
3
3
|
handleMouseOver: () => void;
|
|
4
4
|
handleMouseOut: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useMousePressed: (active: boolean, onPressIn?: (
|
|
1
|
+
export declare const useMousePressed: (active: boolean, onPressIn?: () => void, onPressOut?: () => void) => {
|
|
2
2
|
pressed: boolean;
|
|
3
3
|
handlePressIn: () => void;
|
|
4
4
|
handlePressOut: () => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DatePickerProps, SelectionType } from '@tecsinapse/react-core';
|
|
2
2
|
export declare type WebDatePickerProps<T extends SelectionType> = Omit<DatePickerProps<T>, 'CalendarComponent' | 'renderCalendar' | 'requestCloseCalendar' | 'requestShowCalendar'>;
|
|
3
|
-
export declare const DatePicker: <T extends
|
|
3
|
+
export declare const DatePicker: <T extends SelectionType>({ value, type, ...rest }: WebDatePickerProps<T>) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CalendarProps } from '@tecsinapse/react-core';
|
|
2
2
|
import { ModalProps } from 'react-native';
|
|
3
|
-
export declare const Modal: <T extends
|
|
3
|
+
export declare const Modal: <T extends SelectionType>({ onRequestClose, children, ...modalProps }: any) => JSX.Element;
|
|
@@ -5,5 +5,5 @@ export interface IGridItemWeb extends Omit<IGridItem, 'span'>, Omit<React.HTMLAt
|
|
|
5
5
|
span: number | Span;
|
|
6
6
|
flexBasis?: string | 'content' | 'auto' | 'max-content' | 'min-content' | 'fit-content';
|
|
7
7
|
}
|
|
8
|
-
declare const GridItem: ({ children, span
|
|
8
|
+
declare const GridItem: ({ children, span, columns, loadingComponent, loading, spacing, wrapper, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, justifyContent, flexBasis, style, ...rest }: IGridItemWeb) => JSX.Element;
|
|
9
9
|
export default GridItem;
|
|
@@ -0,0 +1,85 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactCore = require('@tecsinapse/react-core');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
var useIconTextButton = require('./hooks/useIconTextButton.js');
|
|
6
|
+
var styled = require('./styled.js');
|
|
7
|
+
var TextComponent = require('./TextComponent.js');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
12
|
+
|
|
13
|
+
var __defProp = Object.defineProperty;
|
|
14
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
15
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
16
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
17
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
18
|
+
var __spreadValues = (a, b) => {
|
|
19
|
+
for (var prop in b || (b = {}))
|
|
20
|
+
if (__hasOwnProp.call(b, prop))
|
|
21
|
+
__defNormalProp(a, prop, b[prop]);
|
|
22
|
+
if (__getOwnPropSymbols)
|
|
23
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
24
|
+
if (__propIsEnum.call(b, prop))
|
|
25
|
+
__defNormalProp(a, prop, b[prop]);
|
|
26
|
+
}
|
|
27
|
+
return a;
|
|
28
|
+
};
|
|
29
|
+
var __objRest = (source, exclude) => {
|
|
30
|
+
var target = {};
|
|
31
|
+
for (var prop in source)
|
|
32
|
+
if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
|
|
33
|
+
target[prop] = source[prop];
|
|
34
|
+
if (source != null && __getOwnPropSymbols)
|
|
35
|
+
for (var prop of __getOwnPropSymbols(source)) {
|
|
36
|
+
if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
|
|
37
|
+
target[prop] = source[prop];
|
|
38
|
+
}
|
|
39
|
+
return target;
|
|
40
|
+
};
|
|
41
|
+
const IconTextButton = (_a) => {
|
|
42
|
+
var _b = _a, {
|
|
43
|
+
iconProps,
|
|
44
|
+
iconPosition = "left",
|
|
45
|
+
textProps,
|
|
46
|
+
label,
|
|
47
|
+
variant = "filled",
|
|
48
|
+
size = "default"
|
|
49
|
+
} = _b, rest = __objRest(_b, [
|
|
50
|
+
"iconProps",
|
|
51
|
+
"iconPosition",
|
|
52
|
+
"textProps",
|
|
53
|
+
"label",
|
|
54
|
+
"variant",
|
|
55
|
+
"size"
|
|
56
|
+
]);
|
|
57
|
+
const { handleHover, handlePressed, defaultFontColor } = useIconTextButton(variant);
|
|
58
|
+
return /* @__PURE__ */ React__default["default"].createElement(styled.StyledIconTextButton, __spreadValues({
|
|
59
|
+
boxed: !label,
|
|
60
|
+
variant,
|
|
61
|
+
size,
|
|
62
|
+
onMouseOut: () => handleHover(true),
|
|
63
|
+
onMouseOver: () => handleHover(false),
|
|
64
|
+
onPressIn: () => handlePressed(true),
|
|
65
|
+
onPressOut: () => handlePressed(false)
|
|
66
|
+
}, rest), iconPosition === "left" ? /* @__PURE__ */ React__default["default"].createElement(reactCore.IconComponent, {
|
|
67
|
+
iconProps,
|
|
68
|
+
size,
|
|
69
|
+
defaultFontColor
|
|
70
|
+
}) : /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null), /* @__PURE__ */ React__default["default"].createElement(TextComponent, {
|
|
71
|
+
label,
|
|
72
|
+
defaultFontColor,
|
|
73
|
+
hasIcon: !!iconProps,
|
|
74
|
+
iconPosition,
|
|
75
|
+
textProps,
|
|
76
|
+
size
|
|
77
|
+
}), iconPosition === "right" ? /* @__PURE__ */ React__default["default"].createElement(reactCore.IconComponent, {
|
|
78
|
+
iconProps,
|
|
79
|
+
size,
|
|
80
|
+
defaultFontColor
|
|
81
|
+
}) : /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null));
|
|
82
|
+
};
|
|
83
|
+
|
|
84
|
+
module.exports = IconTextButton;
|
|
85
|
+
//# sourceMappingURL=IconTextButton.js.map
|
|
@@ -0,0 +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":["React","StyledIconTextButton","IconComponent"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAUM,MAAA,cAAA,GAAmD,CAAC,EAQvC,KAAA;AARuC,EACxD,IAAA,EAAA,GAAA,EAAA,EAAA;AAAA,IAAA,SAAA;AAAA,IACA,YAAe,GAAA,MAAA;AAAA,IACf,SAAA;AAAA,IACA,KAAA;AAAA,IACA,OAAU,GAAA,QAAA;AAAA,IACV,IAAO,GAAA,SAAA;AAAA,GAhBT,GAU0D,EAOrD,EAAA,IAAA,GAAA,SAAA,CAPqD,EAOrD,EAAA;AAAA,IANH,WAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,OAAA;AAAA,IACA,SAAA;AAAA,IACA,MAAA;AAAA,GAAA,CAAA,CAAA;AAGA,EAAA,MAAM,EAAE,WAAa,EAAA,aAAA,EAAe,gBAAiB,EAAA,GACnD,kBAAkB,OAAO,CAAA,CAAA;AAE3B,EAAA,uBACGA,yBAAA,CAAA,aAAA,CAAAC,2BAAA,EAAA,cAAA,CAAA;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,GACjC,EAAA,IAAA,CAAA,EAEH,YAAiB,KAAA,MAAA,mBACfD,yBAAA,CAAA,aAAA,CAAAE,uBAAA,EAAA;AAAA,IACC,SAAA;AAAA,IACA,IAAA;AAAA,IACA,gBAAA;AAAA,GACF,CAAA,mBAEEF,yBAAA,CAAA,aAAA,CAAAA,yBAAA,CAAA,QAAA,EAAA,IAAA,CAAA,kBAEHA,yBAAA,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,mBACfA,yBAAA,CAAA,aAAA,CAAAE,uBAAA,EAAA;AAAA,IACC,SAAA;AAAA,IACA,IAAA;AAAA,IACA,gBAAA;AAAA,GACF,CAAA,mGAEE,CAEN,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactCore = require('@tecsinapse/react-core');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
7
|
+
|
|
8
|
+
var React__default = /*#__PURE__*/_interopDefaultLegacy(React);
|
|
9
|
+
|
|
10
|
+
var __defProp = Object.defineProperty;
|
|
11
|
+
var __getOwnPropSymbols = Object.getOwnPropertySymbols;
|
|
12
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
13
|
+
var __propIsEnum = Object.prototype.propertyIsEnumerable;
|
|
14
|
+
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
15
|
+
var __spreadValues = (a, b) => {
|
|
16
|
+
for (var prop in b || (b = {}))
|
|
17
|
+
if (__hasOwnProp.call(b, prop))
|
|
18
|
+
__defNormalProp(a, prop, b[prop]);
|
|
19
|
+
if (__getOwnPropSymbols)
|
|
20
|
+
for (var prop of __getOwnPropSymbols(b)) {
|
|
21
|
+
if (__propIsEnum.call(b, prop))
|
|
22
|
+
__defNormalProp(a, prop, b[prop]);
|
|
23
|
+
}
|
|
24
|
+
return a;
|
|
25
|
+
};
|
|
26
|
+
const TextComponent = ({
|
|
27
|
+
textProps,
|
|
28
|
+
size = "default",
|
|
29
|
+
defaultFontColor,
|
|
30
|
+
label
|
|
31
|
+
}) => {
|
|
32
|
+
var _a, _b, _c;
|
|
33
|
+
return label ? /* @__PURE__ */ React__default["default"].createElement(reactCore.Text, __spreadValues({
|
|
34
|
+
typography: ((_a = textProps == null ? void 0 : textProps.typography) != null ? _a : size === "small") ? "sub" : "base",
|
|
35
|
+
fontWeight: (_b = textProps == null ? void 0 : textProps.fontWeight) != null ? _b : "bold",
|
|
36
|
+
fontColor: (_c = textProps == null ? void 0 : textProps.fontColor) != null ? _c : defaultFontColor
|
|
37
|
+
}, textProps), label) : /* @__PURE__ */ React__default["default"].createElement(React__default["default"].Fragment, null);
|
|
38
|
+
};
|
|
39
|
+
var TextComponent$1 = React__default["default"].memo(TextComponent);
|
|
40
|
+
|
|
41
|
+
module.exports = TextComponent$1;
|
|
42
|
+
//# sourceMappingURL=TextComponent.js.map
|
|
@@ -0,0 +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":["React","Text"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;AAkBA,MAAM,gBAAwC,CAAC;AAAA,EAC7C,SAAA;AAAA,EACA,IAAO,GAAA,SAAA;AAAA,EACP,gBAAA;AAAA,EACA,KAAA;AACF,CAAM,KAAA;AAvBN,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAwBE,EAAA,OAAO,wBACJA,yBAAA,CAAA,aAAA,CAAAC,cAAA,EAAA,cAAA,CAAA;AAAA,IACC,cAAY,EAAW,GAAA,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,UAAA,KAAX,IAAyB,GAAA,EAAA,GAAA,IAAA,KAAS,WAAU,KAAQ,GAAA,MAAA;AAAA,IAChE,UAAA,EAAA,CAAY,EAAW,GAAA,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,UAAA,KAAX,IAAyB,GAAA,EAAA,GAAA,MAAA;AAAA,IACrC,SAAA,EAAA,CAAW,EAAW,GAAA,SAAA,IAAA,IAAA,GAAA,KAAA,CAAA,GAAA,SAAA,CAAA,SAAA,KAAX,IAAwB,GAAA,EAAA,GAAA,gBAAA;AAAA,GAC/B,EAAA,SAAA,CAAA,EAEH,KACH,CAAA,mBAEED,yBAAA,CAAA,aAAA,CAAAA,yBAAA,CAAA,QAAA,EAAA,IAAA,CAAA,CAAA;AAEN,CAAA,CAAA;AAEA,sBAAeA,yBAAA,CAAM,KAAK,aAAa,CAAA;;;;"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var reactCore = require('@tecsinapse/react-core');
|
|
4
|
+
var React = require('react');
|
|
5
|
+
|
|
6
|
+
const useIconTextButton = (variant) => {
|
|
7
|
+
const [hover, setHover] = React.useState(false);
|
|
8
|
+
const [pressed, setPressed] = React.useState(false);
|
|
9
|
+
const defaultFontColor = !pressed && hover ? "light" : reactCore.fontColorVC[variant];
|
|
10
|
+
const handleHover = React.useCallback(
|
|
11
|
+
(value) => {
|
|
12
|
+
setHover(value);
|
|
13
|
+
},
|
|
14
|
+
[setHover]
|
|
15
|
+
);
|
|
16
|
+
const handlePressed = React.useCallback(
|
|
17
|
+
(value) => {
|
|
18
|
+
setPressed(value);
|
|
19
|
+
},
|
|
20
|
+
[setPressed]
|
|
21
|
+
);
|
|
22
|
+
return {
|
|
23
|
+
handleHover,
|
|
24
|
+
handlePressed,
|
|
25
|
+
defaultFontColor
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
module.exports = useIconTextButton;
|
|
30
|
+
//# sourceMappingURL=useIconTextButton.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useIconTextButton.js","sources":["../../../../../src/components/molecules/IconTextButton/hooks/useIconTextButton.ts"],"sourcesContent":["import { fontColorVC, VariantType } from '@tecsinapse/react-core';\nimport { useCallback, useState } from 'react';\n\nconst useIconTextButton = (variant: VariantType) => {\n const [hover, setHover] = useState<boolean>(false);\n const [pressed, setPressed] = useState<boolean>(false);\n\n const defaultFontColor = !pressed && hover ? 'light' : fontColorVC[variant];\n\n const handleHover = useCallback(\n (value: boolean) => {\n setHover(value);\n },\n [setHover]\n );\n\n const handlePressed = useCallback(\n (value: boolean) => {\n setPressed(value);\n },\n [setPressed]\n );\n\n return {\n handleHover,\n handlePressed,\n defaultFontColor,\n };\n};\n\nexport default useIconTextButton;\n"],"names":["useState","fontColorVC","useCallback"],"mappings":";;;;;AAGM,MAAA,iBAAA,GAAoB,CAAC,OAAyB,KAAA;AAClD,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAIA,eAAkB,KAAK,CAAA,CAAA;AACjD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAIA,eAAkB,KAAK,CAAA,CAAA;AAErD,EAAA,MAAM,gBAAmB,GAAA,CAAC,OAAW,IAAA,KAAA,GAAQ,UAAUC,qBAAY,CAAA,OAAA,CAAA,CAAA;AAEnE,EAAA,MAAM,WAAc,GAAAC,iBAAA;AAAA,IAClB,CAAC,KAAmB,KAAA;AAClB,MAAA,QAAA,CAAS,KAAK,CAAA,CAAA;AAAA,KAChB;AAAA,IACA,CAAC,QAAQ,CAAA;AAAA,GACX,CAAA;AAEA,EAAA,MAAM,aAAgB,GAAAA,iBAAA;AAAA,IACpB,CAAC,KAAmB,KAAA;AAClB,MAAA,UAAA,CAAW,KAAK,CAAA,CAAA;AAAA,KAClB;AAAA,IACA,CAAC,UAAU,CAAA;AAAA,GACb,CAAA;AAEA,EAAO,OAAA;AAAA,IACL,WAAA;AAAA,IACA,aAAA;AAAA,IACA,gBAAA;AAAA,GACF,CAAA;AACF;;;;"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
4
|
+
|
|
5
|
+
var nativeStyled = require('@emotion/native');
|
|
6
|
+
var Button = require('../../atoms/Button/Button.js');
|
|
7
|
+
require('react');
|
|
8
|
+
|
|
9
|
+
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
|
|
10
|
+
|
|
11
|
+
var nativeStyled__default = /*#__PURE__*/_interopDefaultLegacy(nativeStyled);
|
|
12
|
+
|
|
13
|
+
const boxedStyle = ({ theme }) => `
|
|
14
|
+
padding: ${theme == null ? void 0 : theme.spacing.centi};
|
|
15
|
+
aspect-ratio: 1;
|
|
16
|
+
`;
|
|
17
|
+
const StyledIconTextButton = nativeStyled__default["default"](Button)`
|
|
18
|
+
gap: ${({ theme }) => theme == null ? void 0 : theme.spacing.mili};
|
|
19
|
+
${({ boxed, theme }) => boxed && boxedStyle({ theme })};
|
|
20
|
+
`;
|
|
21
|
+
|
|
22
|
+
exports.StyledIconTextButton = StyledIconTextButton;
|
|
23
|
+
//# sourceMappingURL=styled.js.map
|
|
@@ -0,0 +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,+BAAO,OAAQ,CAAA,KAAA,CAAA;AAAA;AAAA,EAAA,CAAA,CAAA;AAIjB,MAAA,oBAAA,GAAuBA,iCAAO,MAAM,CAAA,CAAA;AAAA,OAAA,EAKxC,CAAC,EAAE,KAAM,EAAA,KAAM,+BAAO,OAAQ,CAAA,IAAA,CAAA;AAAA,EACnC,EAAA,CAAC,EAAE,KAAO,EAAA,KAAA,OAAY,KAAS,IAAA,UAAA,CAAW,EAAE,KAAA,EAAO,CAAA,CAAA;AAAA;;;;"}
|
|
@@ -99,25 +99,20 @@ const Select = (_a) => {
|
|
|
99
99
|
keyExtractor,
|
|
100
100
|
labelExtractor
|
|
101
101
|
);
|
|
102
|
-
React.useEffect(() => {
|
|
103
|
-
if (typeof options !== "function") {
|
|
104
|
-
setSelectOptions(options);
|
|
105
|
-
}
|
|
106
|
-
}, [options]);
|
|
107
102
|
const handleLazyFocus = React__default["default"].useCallback(async () => {
|
|
108
103
|
if (!dropDownVisible && typeof options === "function") {
|
|
109
104
|
try {
|
|
110
105
|
const result = await options();
|
|
111
106
|
if (result) {
|
|
112
|
-
setSelectOptions(result);
|
|
107
|
+
setSelectOptions(result != null ? result : []);
|
|
113
108
|
}
|
|
114
109
|
} catch (e) {
|
|
115
110
|
}
|
|
116
111
|
}
|
|
117
|
-
}, [options,
|
|
112
|
+
}, [options, setSelectOptions, dropDownVisible]);
|
|
118
113
|
const handleOnSearch = React__default["default"].useCallback(
|
|
119
114
|
async (searchInput) => {
|
|
120
|
-
if (searchInput !== void 0 && onSearch) {
|
|
115
|
+
if (searchInput !== void 0 && onSearch && dropDownVisible) {
|
|
121
116
|
try {
|
|
122
117
|
const result = await onSearch(searchInput);
|
|
123
118
|
if (result) {
|
|
@@ -145,7 +140,7 @@ const Select = (_a) => {
|
|
|
145
140
|
}
|
|
146
141
|
}
|
|
147
142
|
},
|
|
148
|
-
[
|
|
143
|
+
[onSearch, value, keyExtractor, dropDownVisible, setSelectOptions]
|
|
149
144
|
);
|
|
150
145
|
const handlePressInput = async () => {
|
|
151
146
|
await handleLazyFocus();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Select.js","sources":["../../../../src/components/molecules/Select/Select.tsx"],"sourcesContent":["import {\n PressableInputContainer,\n Text,\n TextProps,\n} from '@tecsinapse/react-core';\nimport React, { useEffect, useState } from 'react';\nimport { Transition } from 'react-transition-group';\nimport { useClickAwayListener } from '../../../hooks';\nimport { defaultStyles, transition } from './animations';\nimport { Dropdown } from './Dropdown';\nimport { getDisplayValue } from './functions';\nimport {\n RightComponent,\n StyledContainer,\n StyledInputContainer,\n} from './styled';\n\nexport interface SelectProps<Data, Type extends 'single' | 'multi'>\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n options: ((searchInput?: string) => Promise<Data[]>) | Data[];\n onSelect: (\n option: Type extends 'single' ? Data | undefined : Data[]\n ) => never | void;\n value: Type extends 'single' ? Data | undefined : Data[];\n type: Type;\n keyExtractor: (t: Data, index?: number) => string;\n labelExtractor: (t: Data) => string;\n placeholder?: string;\n onSearch?:\n | ((searchArg: string) => void)\n | ((searchInput?: string) => Promise<Data[]>)\n | never;\n searchBarPlaceholder?: string;\n hideSearchBar?: boolean;\n selectAllLabel?: string;\n disabled?: boolean;\n label?: string;\n anchor?: 'top' | 'bottom';\n displayTextProps?: TextProps;\n}\n\n/** NOTE: For better performance, you should memoize options and handlers */\nconst Select = <Data, Type extends 'single' | 'multi'>({\n value,\n options,\n keyExtractor,\n onSelect,\n type,\n labelExtractor,\n placeholder,\n onSearch,\n searchBarPlaceholder = 'Busque a opção desejada',\n hideSearchBar = true,\n label,\n disabled = false,\n anchor = 'bottom',\n displayTextProps,\n selectAllLabel = 'Selecionar todos',\n ...rest\n}: SelectProps<Data, Type>): JSX.Element => {\n const [dropDownVisible, setDropDownVisible] = React.useState<boolean>(false);\n const [selectOptions, setSelectOptions] = useState<Data[]>([]);\n const refDropDown = React.useRef(null);\n useClickAwayListener(refDropDown, setDropDownVisible);\n\n useEffect(() => {\n if (typeof options !== 'function') {\n setSelectOptions(options);\n }\n }, [options]);\n\n // TODO: Add Skeleton to modal height when loading is true\n\n const onlyLabel = label && !placeholder;\n const hasValue =\n type === 'single' ? !!value : ((value || []) as []).length > 0;\n const _placeholder = onlyLabel ? label : placeholder;\n const _label = hasValue ? label : undefined;\n\n const displayValue = getDisplayValue<Data>(\n type,\n value,\n selectOptions,\n _placeholder,\n keyExtractor,\n labelExtractor\n );\n\n useEffect(() => {\n if (typeof options !== 'function') {\n setSelectOptions(options);\n }\n }, [options]);\n\n const handleLazyFocus = React.useCallback(async () => {\n if (!dropDownVisible && typeof options === 'function') {\n try {\n const result = await options();\n if (result) {\n setSelectOptions(result);\n }\n } catch (e) {\n // TODO: Catch error\n }\n }\n }, [options, value, setSelectOptions, dropDownVisible]);\n\n const handleOnSearch = React.useCallback(\n async (searchInput: string | undefined) => {\n if (searchInput !== undefined && onSearch) {\n try {\n //TODO: Remove code duplicated below (Select in react-native-kit)\n const result = await onSearch(searchInput);\n if (result) {\n if (type === 'single') {\n if (\n value &&\n !result.find(\n v => keyExtractor(value as Data) === keyExtractor(v)\n )\n ) {\n setSelectOptions([value as Data, ...result]);\n } else setSelectOptions(result);\n } else {\n if ((value as Data[]).length > 0) {\n const selectedValues =\n (value as Data[]).filter(\n v =>\n !result.find(\n current =>\n keyExtractor(v as Data) === keyExtractor(current)\n )\n ) || [];\n setSelectOptions([...selectedValues, ...result]);\n } else {\n setSelectOptions(result);\n }\n }\n }\n } catch (e) {\n // TODO: Catch error\n }\n }\n },\n [options, value, keyExtractor]\n );\n\n const handlePressInput = async () => {\n await handleLazyFocus();\n };\n\n const onPress = React.useCallback(\n () => setDropDownVisible(prev => !prev),\n [setDropDownVisible]\n );\n\n return (\n <StyledContainer ref={refDropDown} {...rest}>\n <StyledInputContainer onFocus={handlePressInput}>\n <PressableInputContainer\n label={_label}\n onPress={onPress}\n disabled={disabled}\n rightComponent={RightComponent}\n >\n <Text\n {...displayTextProps}\n ellipsizeMode=\"tail\"\n numberOfLines={1}\n fontWeight={'bold'}\n >\n {displayValue}\n </Text>\n </PressableInputContainer>\n </StyledInputContainer>\n <Transition in={dropDownVisible} timeout={300}>\n {state => (\n <Dropdown\n options={selectOptions ?? []}\n onSelect={onSelect}\n value={value}\n type={type}\n keyExtractor={keyExtractor}\n labelExtractor={labelExtractor}\n hideSearchBar={hideSearchBar}\n searchBarPlaceholder={searchBarPlaceholder}\n onSearch={handleOnSearch}\n style={{ ...defaultStyles, ...transition[anchor][state] }}\n setDropDownVisible={setDropDownVisible}\n anchor={anchor}\n selectAllLabel={selectAllLabel}\n />\n )}\n </Transition>\n </StyledContainer>\n );\n};\n\nexport default Select;\n"],"names":["React","useState","useClickAwayListener","useEffect","getDisplayValue","StyledContainer","StyledInputContainer","PressableInputContainer","RightComponent","Text","Transition","defaultStyles","transition"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;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"version":3,"file":"Select.js","sources":["../../../../src/components/molecules/Select/Select.tsx"],"sourcesContent":["import {\n PressableInputContainer,\n Text,\n TextProps,\n} from '@tecsinapse/react-core';\nimport React, { useEffect, useState } from 'react';\nimport { Transition } from 'react-transition-group';\nimport { useClickAwayListener } from '../../../hooks';\nimport { defaultStyles, transition } from './animations';\nimport { Dropdown } from './Dropdown';\nimport { getDisplayValue } from './functions';\nimport {\n RightComponent,\n StyledContainer,\n StyledInputContainer,\n} from './styled';\n\nexport interface SelectProps<Data, Type extends 'single' | 'multi'>\n extends Omit<React.HTMLAttributes<HTMLDivElement>, 'onSelect'> {\n options: ((searchInput?: string) => Promise<Data[]>) | Data[];\n onSelect: (\n option: Type extends 'single' ? Data | undefined : Data[]\n ) => never | void;\n value: Type extends 'single' ? Data | undefined : Data[];\n type: Type;\n keyExtractor: (t: Data, index?: number) => string;\n labelExtractor: (t: Data) => string;\n placeholder?: string;\n onSearch?:\n | ((searchArg: string) => void)\n | ((searchInput?: string) => Promise<Data[]>)\n | never;\n searchBarPlaceholder?: string;\n hideSearchBar?: boolean;\n selectAllLabel?: string;\n disabled?: boolean;\n label?: string;\n anchor?: 'top' | 'bottom';\n displayTextProps?: TextProps;\n}\n\n/** NOTE: For better performance, you should memoize options and handlers */\nconst Select = <Data, Type extends 'single' | 'multi'>({\n value,\n options,\n keyExtractor,\n onSelect,\n type,\n labelExtractor,\n placeholder,\n onSearch,\n searchBarPlaceholder = 'Busque a opção desejada',\n hideSearchBar = true,\n label,\n disabled = false,\n anchor = 'bottom',\n displayTextProps,\n selectAllLabel = 'Selecionar todos',\n ...rest\n}: SelectProps<Data, Type>): JSX.Element => {\n const [dropDownVisible, setDropDownVisible] = React.useState<boolean>(false);\n const [selectOptions, setSelectOptions] = useState<Data[]>([]);\n const refDropDown = React.useRef(null);\n useClickAwayListener(refDropDown, setDropDownVisible);\n\n useEffect(() => {\n if (typeof options !== 'function') {\n setSelectOptions(options);\n }\n }, [options]);\n\n // TODO: Add Skeleton to modal height when loading is true\n\n const onlyLabel = label && !placeholder;\n const hasValue =\n type === 'single' ? !!value : ((value || []) as []).length > 0;\n const _placeholder = onlyLabel ? label : placeholder;\n const _label = hasValue ? label : undefined;\n\n const displayValue = getDisplayValue<Data>(\n type,\n value,\n selectOptions,\n _placeholder,\n keyExtractor,\n labelExtractor\n );\n\n const handleLazyFocus = React.useCallback(async () => {\n if (!dropDownVisible && typeof options === 'function') {\n try {\n const result = await options();\n if (result) {\n setSelectOptions(result ?? []);\n }\n } catch (e) {\n // TODO: Catch error\n }\n }\n }, [options, setSelectOptions, dropDownVisible]);\n\n const handleOnSearch = React.useCallback(\n async (searchInput: string | undefined) => {\n if (searchInput !== undefined && onSearch && dropDownVisible) {\n try {\n //TODO: Remove code duplicated below (Select in react-native-kit)\n const result = await onSearch(searchInput);\n if (result) {\n if (type === 'single') {\n if (\n value &&\n !result.find(\n v => keyExtractor(value as Data) === keyExtractor(v)\n )\n ) {\n setSelectOptions([value as Data, ...result]);\n } else setSelectOptions(result);\n } else {\n if ((value as Data[]).length > 0) {\n const selectedValues =\n (value as Data[]).filter(\n v =>\n !result.find(\n current =>\n keyExtractor(v as Data) === keyExtractor(current)\n )\n ) || [];\n setSelectOptions([...selectedValues, ...result]);\n } else {\n setSelectOptions(result);\n }\n }\n }\n } catch (e) {\n // TODO: Catch error\n }\n }\n },\n [onSearch, value, keyExtractor, dropDownVisible, setSelectOptions]\n );\n\n const handlePressInput = async () => {\n await handleLazyFocus();\n };\n\n const onPress = React.useCallback(\n () => setDropDownVisible(prev => !prev),\n [setDropDownVisible]\n );\n\n return (\n <StyledContainer ref={refDropDown} {...rest}>\n <StyledInputContainer onFocus={handlePressInput}>\n <PressableInputContainer\n label={_label}\n onPress={onPress}\n disabled={disabled}\n rightComponent={RightComponent}\n >\n <Text\n {...displayTextProps}\n ellipsizeMode=\"tail\"\n numberOfLines={1}\n fontWeight={'bold'}\n >\n {displayValue}\n </Text>\n </PressableInputContainer>\n </StyledInputContainer>\n <Transition in={dropDownVisible} timeout={300}>\n {state => (\n <Dropdown\n options={selectOptions ?? []}\n onSelect={onSelect}\n value={value}\n type={type}\n keyExtractor={keyExtractor}\n labelExtractor={labelExtractor}\n hideSearchBar={hideSearchBar}\n searchBarPlaceholder={searchBarPlaceholder}\n onSearch={handleOnSearch}\n style={{ ...defaultStyles, ...transition[anchor][state] }}\n setDropDownVisible={setDropDownVisible}\n anchor={anchor}\n selectAllLabel={selectAllLabel}\n />\n )}\n </Transition>\n </StyledContainer>\n );\n};\n\nexport default Select;\n"],"names":["React","useState","useClickAwayListener","useEffect","getDisplayValue","StyledContainer","StyledInputContainer","PressableInputContainer","RightComponent","Text","Transition","defaultStyles","transition"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0CM,MAAA,MAAA,GAAS,CAAwC,EAiBX,KAAA;AAjBW,EACrD,IAAA,EAAA,GAAA,EAAA,EAAA;AAAA,IAAA,KAAA;AAAA,IACA,OAAA;AAAA,IACA,YAAA;AAAA,IACA,QAAA;AAAA,IACA,IAAA;AAAA,IACA,cAAA;AAAA,IACA,WAAA;AAAA,IACA,QAAA;AAAA,IACA,oBAAuB,GAAA,+BAAA;AAAA,IACvB,aAAgB,GAAA,IAAA;AAAA,IAChB,KAAA;AAAA,IACA,QAAW,GAAA,KAAA;AAAA,IACX,MAAS,GAAA,QAAA;AAAA,IACT,gBAAA;AAAA,IACA,cAAiB,GAAA,kBAAA;AAAA,GAzDnB,GA0CuD,EAgBlD,EAAA,IAAA,GAAA,SAAA,CAhBkD,EAgBlD,EAAA;AAAA,IAfH,OAAA;AAAA,IACA,SAAA;AAAA,IACA,cAAA;AAAA,IACA,UAAA;AAAA,IACA,MAAA;AAAA,IACA,gBAAA;AAAA,IACA,aAAA;AAAA,IACA,UAAA;AAAA,IACA,sBAAA;AAAA,IACA,eAAA;AAAA,IACA,OAAA;AAAA,IACA,UAAA;AAAA,IACA,QAAA;AAAA,IACA,kBAAA;A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AAAA,IACA,KAAA;AAAA,IACA,IAAA;AAAA,IACA,YAAA;AAAA,IACA,cAAA;AAAA,IACA,aAAA;AAAA,IACA,oBAAA;AAAA,IACA,QAAU,EAAA,cAAA;AAAA,IACV,KAAO,EAAA,cAAA,CAAA,cAAA,CAAA,EAAA,EAAKW,wBAAkB,CAAA,EAAAC,qBAAA,CAAW,MAAQ,CAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IACjD,kBAAA;AAAA,IACA,MAAA;AAAA,IACA,cAAA;AAAA,GACF,CAEJ,CACF,CAAA,CAAA;AAEJ;;;;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const getDisplayValue: <Data>(type: 'multi' | 'single', value: Data | Data[] | undefined, options: Data[], placeholder: string | undefined, keyExtractor: (option: Data, idx?: number
|
|
1
|
+
export declare const getDisplayValue: <Data>(type: 'multi' | 'single', value: Data | Data[] | undefined, options: Data[], placeholder: string | undefined, keyExtractor: (option: Data, idx?: number) => string, labelExtractor: (option: Data) => string) => string | Data | Data[] | undefined;
|
|
@@ -25,5 +25,5 @@ export interface DataGridProps<Data> extends React.HTMLAttributes<HTMLDivElement
|
|
|
25
25
|
emptyPlaceholder?: React.ReactNode;
|
|
26
26
|
exportComponent?: React.ReactNode;
|
|
27
27
|
}
|
|
28
|
-
declare const DataGrid: <Data>({ headers, data, rowKeyExtractor, toolbarTitle, toolbarFooter, toolbarRightIcons, selectable, selectedRows, onSelectedRows, pagination, rowsPerPage, onRowsPerPageChange, rowsPerPageOptions
|
|
28
|
+
declare const DataGrid: <Data>({ headers, data, rowKeyExtractor, toolbarTitle, toolbarFooter, toolbarRightIcons, selectable, selectedRows, onSelectedRows, pagination, rowsPerPage, onRowsPerPageChange, rowsPerPageOptions, rowsPerPageLabel, exportLabel, exportFunction, rowsCount, page, onPageChange, loading, skeletonComponent, emptyPlaceholder, exportComponent, ...rest }: DataGridProps<Data>) => JSX.Element;
|
|
29
29
|
export default DataGrid;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
declare const _default: React.MemoExoticComponent<({ rowKeyExtractor, data, checked
|
|
2
|
+
declare const _default: React.MemoExoticComponent<({ rowKeyExtractor, data, checked, handleSelect, selectable, headers, }: {
|
|
3
3
|
rowKeyExtractor: any;
|
|
4
4
|
data: any;
|
|
5
5
|
checked: any;
|
package/dist/index.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export type { TagProps } from './components/atoms/Tag';
|
|
|
19
19
|
export { Tooltip } from './components/atoms/Tooltip';
|
|
20
20
|
export type { ITooltip } from './components/atoms/Tooltip';
|
|
21
21
|
export { Breadcrumbs } from './components/molecules/Breadcrumbs';
|
|
22
|
-
export type { BreadcrumbsProps, BreadcrumbType
|
|
22
|
+
export type { BreadcrumbsProps, BreadcrumbType } from './components/molecules/Breadcrumbs';
|
|
23
23
|
export { DatePicker } from './components/molecules/DatePicker';
|
|
24
24
|
export type { WebDatePickerProps } from './components/molecules/DatePicker';
|
|
25
25
|
export { DateTimePicker } from './components/molecules/DateTimePicker';
|
|
@@ -27,13 +27,14 @@ export type { WebDateTimePickerProps } from './components/molecules/DateTimePick
|
|
|
27
27
|
export { Drawer } from './components/molecules/Drawer';
|
|
28
28
|
export type { DrawerProps } from './components/molecules/Drawer';
|
|
29
29
|
export { Grid, GridItem } from './components/molecules/Grid';
|
|
30
|
-
export type {
|
|
30
|
+
export type { IGridItemWeb, IGridWeb } from './components/molecules/Grid';
|
|
31
|
+
export { IconTextButton } from './components/molecules/IconTextButton';
|
|
31
32
|
export { InputPassword } from './components/molecules/InputPassword';
|
|
32
33
|
export type { InputPasswordWebProps } from './components/molecules/InputPassword';
|
|
33
34
|
export { LabeledSwitch } from './components/molecules/LabeledSwitch';
|
|
34
35
|
export type { LabeledSwitchWebProps } from './components/molecules/LabeledSwitch';
|
|
35
36
|
export { Menubar } from './components/molecules/Menubar';
|
|
36
|
-
export type { MenubarItemsOptions, MenubarMostUsedType, MenubarOptionsType, MenubarProps
|
|
37
|
+
export type { MenubarItemsOptions, MenubarMostUsedType, MenubarOptionsType, MenubarProps } from './components/molecules/Menubar';
|
|
37
38
|
export { Select } from './components/molecules/Select';
|
|
38
39
|
export type { SelectProps } from './components/molecules/Select';
|
|
39
40
|
export { Snackbar } from './components/molecules/Snackbar';
|
|
@@ -41,5 +42,5 @@ export type { SnackbarWebProps } from './components/molecules/Snackbar';
|
|
|
41
42
|
export { TextArea } from './components/molecules/TextArea';
|
|
42
43
|
export type { TextAreaProps } from './components/molecules/TextArea';
|
|
43
44
|
export { DataGrid } from './components/organisms/DataGrid';
|
|
44
|
-
export type { DataGridProps, HeadersType
|
|
45
|
+
export type { DataGridProps, HeadersType } from './components/organisms/DataGrid';
|
|
45
46
|
export * from './hooks';
|
package/dist/index.js
CHANGED
|
@@ -19,6 +19,7 @@ var DateTimePicker = require('./components/molecules/DateTimePicker/DateTimePick
|
|
|
19
19
|
var Drawer = require('./components/molecules/Drawer/Drawer.js');
|
|
20
20
|
var Item = require('./components/molecules/Grid/Item/Item.js');
|
|
21
21
|
var Grid = require('./components/molecules/Grid/Grid.js');
|
|
22
|
+
var IconTextButton = require('./components/molecules/IconTextButton/IconTextButton.js');
|
|
22
23
|
var InputPassword = require('./components/molecules/InputPassword/InputPassword.js');
|
|
23
24
|
var LabeledSwitch = require('./components/molecules/LabeledSwitch/LabeledSwitch.js');
|
|
24
25
|
var Menubar = require('./components/molecules/Menubar/Menubar.js');
|
|
@@ -56,6 +57,7 @@ exports.DateTimePicker = DateTimePicker.DateTimePicker;
|
|
|
56
57
|
exports.Drawer = Drawer;
|
|
57
58
|
exports.GridItem = Item;
|
|
58
59
|
exports.Grid = Grid;
|
|
60
|
+
exports.IconTextButton = IconTextButton;
|
|
59
61
|
exports.InputPassword = InputPassword;
|
|
60
62
|
exports.LabeledSwitch = LabeledSwitch;
|
|
61
63
|
exports.Menubar = Menubar;
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
export declare const contentStyle: (open: boolean, transition: number, value: number, theme:
|
|
1
|
+
export declare const contentStyle: (open: boolean, transition: number, value: number, theme: ThemeProp) => {
|
|
2
2
|
transition: string;
|
|
3
3
|
paddingBottom: any;
|
|
4
4
|
height: number;
|
|
5
5
|
};
|
|
6
|
-
export declare const contentTransition: (value: number, theme:
|
|
6
|
+
export declare const contentTransition: (value: number, theme: ThemeProp) => {
|
|
7
7
|
entering: {
|
|
8
8
|
paddingBottom: any;
|
|
9
9
|
height: number;
|
|
@@ -21,11 +21,11 @@ export declare const contentTransition: (value: number, theme: any) => {
|
|
|
21
21
|
height: number;
|
|
22
22
|
};
|
|
23
23
|
};
|
|
24
|
-
export declare const titleStyle: (transition: number, theme:
|
|
24
|
+
export declare const titleStyle: (transition: number, theme: ThemeProp) => {
|
|
25
25
|
transition: string;
|
|
26
26
|
color: any;
|
|
27
27
|
};
|
|
28
|
-
export declare const titleTransition: (theme:
|
|
28
|
+
export declare const titleTransition: (theme: ThemeProp) => {
|
|
29
29
|
entering: {
|
|
30
30
|
color: any;
|
|
31
31
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useMouseHover: (active: boolean, onMouseOver?: (
|
|
1
|
+
export declare const useMouseHover: (active: boolean, onMouseOver?: () => void, onMouseOut?: () => void) => {
|
|
2
2
|
mouseOver: boolean;
|
|
3
3
|
handleMouseOver: () => void;
|
|
4
4
|
handleMouseOut: () => void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export declare const useMousePressed: (active: boolean, onPressIn?: (
|
|
1
|
+
export declare const useMousePressed: (active: boolean, onPressIn?: () => void, onPressOut?: () => void) => {
|
|
2
2
|
pressed: boolean;
|
|
3
3
|
handlePressIn: () => void;
|
|
4
4
|
handlePressOut: () => void;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { DatePickerProps, SelectionType } from '@tecsinapse/react-core';
|
|
2
2
|
export declare type WebDatePickerProps<T extends SelectionType> = Omit<DatePickerProps<T>, 'CalendarComponent' | 'renderCalendar' | 'requestCloseCalendar' | 'requestShowCalendar'>;
|
|
3
|
-
export declare const DatePicker: <T extends
|
|
3
|
+
export declare const DatePicker: <T extends SelectionType>({ value, type, ...rest }: WebDatePickerProps<T>) => JSX.Element;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { CalendarProps } from '@tecsinapse/react-core';
|
|
2
2
|
import { ModalProps } from 'react-native';
|
|
3
|
-
export declare const Modal: <T extends
|
|
3
|
+
export declare const Modal: <T extends SelectionType>({ onRequestClose, children, ...modalProps }: any) => JSX.Element;
|
|
@@ -5,5 +5,5 @@ export interface IGridItemWeb extends Omit<IGridItem, 'span'>, Omit<React.HTMLAt
|
|
|
5
5
|
span: number | Span;
|
|
6
6
|
flexBasis?: string | 'content' | 'auto' | 'max-content' | 'min-content' | 'fit-content';
|
|
7
7
|
}
|
|
8
|
-
declare const GridItem: ({ children, span
|
|
8
|
+
declare const GridItem: ({ children, span, columns, loadingComponent, loading, spacing, wrapper, alignContent, alignItems, alignSelf, flex, flexDirection, flexGrow, flexShrink, justifyContent, flexBasis, style, ...rest }: IGridItemWeb) => JSX.Element;
|
|
9
9
|
export default GridItem;
|