@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.
Files changed (154) hide show
  1. package/CHANGELOG.md +31 -0
  2. package/dist/components/atoms/Accordion/animations.d.ts +4 -4
  3. package/dist/components/atoms/Button/hooks/useMouseHover.d.ts +1 -1
  4. package/dist/components/atoms/Button/hooks/useMousePressed.d.ts +1 -1
  5. package/dist/components/molecules/DatePicker/DatePicker.d.ts +1 -1
  6. package/dist/components/molecules/DatePicker/Modal.d.ts +1 -1
  7. package/dist/components/molecules/Grid/Item/Item.d.ts +1 -1
  8. package/dist/components/molecules/IconTextButton/IconTextButton.js +85 -0
  9. package/dist/components/molecules/IconTextButton/IconTextButton.js.map +1 -0
  10. package/dist/components/molecules/IconTextButton/TextComponent.js +42 -0
  11. package/dist/components/molecules/IconTextButton/TextComponent.js.map +1 -0
  12. package/dist/components/molecules/IconTextButton/hooks/useIconTextButton.d.ts +1 -1
  13. package/dist/components/molecules/IconTextButton/hooks/useIconTextButton.js +30 -0
  14. package/dist/components/molecules/IconTextButton/hooks/useIconTextButton.js.map +1 -0
  15. package/dist/components/molecules/IconTextButton/styled.js +23 -0
  16. package/dist/components/molecules/IconTextButton/styled.js.map +1 -0
  17. package/dist/components/molecules/Select/Select.js +4 -9
  18. package/dist/components/molecules/Select/Select.js.map +1 -1
  19. package/dist/components/molecules/Select/functions.d.ts +1 -1
  20. package/dist/components/organisms/DataGrid/DataGrid.d.ts +1 -1
  21. package/dist/components/organisms/DataGrid/Row/Row.d.ts +1 -1
  22. package/dist/index.d.ts +5 -4
  23. package/dist/index.js +2 -0
  24. package/dist/index.js.map +1 -1
  25. package/esm/components/atoms/Accordion/animations.d.ts +4 -4
  26. package/esm/components/atoms/Button/hooks/useMouseHover.d.ts +1 -1
  27. package/esm/components/atoms/Button/hooks/useMousePressed.d.ts +1 -1
  28. package/esm/components/molecules/DatePicker/DatePicker.d.ts +1 -1
  29. package/esm/components/molecules/DatePicker/Modal.d.ts +1 -1
  30. package/esm/components/molecules/Grid/Item/Item.d.ts +1 -1
  31. package/esm/components/molecules/IconTextButton/IconTextButton.js +65 -37
  32. package/esm/components/molecules/IconTextButton/IconTextButton.js.map +1 -1
  33. package/esm/components/molecules/IconTextButton/TextComponent.js +31 -18
  34. package/esm/components/molecules/IconTextButton/TextComponent.js.map +1 -1
  35. package/esm/components/molecules/IconTextButton/hooks/useIconTextButton.d.ts +1 -1
  36. package/esm/components/molecules/IconTextButton/hooks/useIconTextButton.js +17 -11
  37. package/esm/components/molecules/IconTextButton/hooks/useIconTextButton.js.map +1 -1
  38. package/esm/components/molecules/IconTextButton/styled.js +15 -29
  39. package/esm/components/molecules/IconTextButton/styled.js.map +1 -1
  40. package/esm/components/molecules/Select/Select.js +4 -9
  41. package/esm/components/molecules/Select/Select.js.map +1 -1
  42. package/esm/components/molecules/Select/functions.d.ts +1 -1
  43. package/esm/components/organisms/DataGrid/DataGrid.d.ts +1 -1
  44. package/esm/components/organisms/DataGrid/Row/Row.d.ts +1 -1
  45. package/esm/index.d.ts +5 -4
  46. package/esm/index.js +1 -0
  47. package/esm/index.js.map +1 -1
  48. package/package.json +3 -3
  49. package/src/components/molecules/Select/Select.tsx +4 -10
  50. package/src/index.ts +6 -4
  51. package/esm/components/atoms/Accordion/index.js +0 -2
  52. package/esm/components/atoms/Accordion/index.js.map +0 -1
  53. package/esm/components/atoms/Badge/index.js +0 -2
  54. package/esm/components/atoms/Badge/index.js.map +0 -1
  55. package/esm/components/atoms/Button/index.js +0 -3
  56. package/esm/components/atoms/Button/index.js.map +0 -1
  57. package/esm/components/atoms/Input/index.js +0 -2
  58. package/esm/components/atoms/Input/index.js.map +0 -1
  59. package/esm/components/atoms/InputMask/index.js +0 -2
  60. package/esm/components/atoms/InputMask/index.js.map +0 -1
  61. package/esm/components/atoms/Modal/index.js +0 -2
  62. package/esm/components/atoms/Modal/index.js.map +0 -1
  63. package/esm/components/atoms/Overlay/index.js +0 -2
  64. package/esm/components/atoms/Overlay/index.js.map +0 -1
  65. package/esm/components/atoms/Skeleton/index.js +0 -2
  66. package/esm/components/atoms/Skeleton/index.js.map +0 -1
  67. package/esm/components/atoms/Table/Body/index.js +0 -2
  68. package/esm/components/atoms/Table/Body/index.js.map +0 -1
  69. package/esm/components/atoms/Table/Cell/index.js +0 -2
  70. package/esm/components/atoms/Table/Cell/index.js.map +0 -1
  71. package/esm/components/atoms/Table/Container/index.js +0 -2
  72. package/esm/components/atoms/Table/Container/index.js.map +0 -1
  73. package/esm/components/atoms/Table/Footer/index.js +0 -2
  74. package/esm/components/atoms/Table/Footer/index.js.map +0 -1
  75. package/esm/components/atoms/Table/Header/index.js +0 -3
  76. package/esm/components/atoms/Table/Header/index.js.map +0 -1
  77. package/esm/components/atoms/Table/Row/index.js +0 -2
  78. package/esm/components/atoms/Table/Row/index.js.map +0 -1
  79. package/esm/components/atoms/Table/Toolbar/index.js +0 -2
  80. package/esm/components/atoms/Table/Toolbar/index.js.map +0 -1
  81. package/esm/components/atoms/Table/index.js +0 -9
  82. package/esm/components/atoms/Table/index.js.map +0 -1
  83. package/esm/components/atoms/Tag/index.js +0 -2
  84. package/esm/components/atoms/Tag/index.js.map +0 -1
  85. package/esm/components/atoms/Tooltip/index.js +0 -2
  86. package/esm/components/atoms/Tooltip/index.js.map +0 -1
  87. package/esm/components/molecules/Breadcrumbs/BreadcrumbItem/index.js +0 -3
  88. package/esm/components/molecules/Breadcrumbs/BreadcrumbItem/index.js.map +0 -1
  89. package/esm/components/molecules/Breadcrumbs/index.js +0 -2
  90. package/esm/components/molecules/Breadcrumbs/index.js.map +0 -1
  91. package/esm/components/molecules/DatePicker/Modal.js +0 -27
  92. package/esm/components/molecules/DatePicker/Modal.js.map +0 -1
  93. package/esm/components/molecules/DatePicker/index.js +0 -2
  94. package/esm/components/molecules/DatePicker/index.js.map +0 -1
  95. package/esm/components/molecules/DatePicker/styled.js +0 -23
  96. package/esm/components/molecules/DatePicker/styled.js.map +0 -1
  97. package/esm/components/molecules/DateTimePicker/Modal.js +0 -26
  98. package/esm/components/molecules/DateTimePicker/Modal.js.map +0 -1
  99. package/esm/components/molecules/DateTimePicker/index.js +0 -2
  100. package/esm/components/molecules/DateTimePicker/index.js.map +0 -1
  101. package/esm/components/molecules/DateTimePicker/styled.js +0 -18
  102. package/esm/components/molecules/DateTimePicker/styled.js.map +0 -1
  103. package/esm/components/molecules/Drawer/index.js +0 -2
  104. package/esm/components/molecules/Drawer/index.js.map +0 -1
  105. package/esm/components/molecules/Grid/Item/index.js +0 -2
  106. package/esm/components/molecules/Grid/Item/index.js.map +0 -1
  107. package/esm/components/molecules/Grid/index.js +0 -3
  108. package/esm/components/molecules/Grid/index.js.map +0 -1
  109. package/esm/components/molecules/IconTextButton/index.js +0 -2
  110. package/esm/components/molecules/IconTextButton/index.js.map +0 -1
  111. package/esm/components/molecules/InputPassword/index.js +0 -2
  112. package/esm/components/molecules/InputPassword/index.js.map +0 -1
  113. package/esm/components/molecules/LabeledSwitch/index.js +0 -2
  114. package/esm/components/molecules/LabeledSwitch/index.js.map +0 -1
  115. package/esm/components/molecules/Masonry/index.js +0 -2
  116. package/esm/components/molecules/Masonry/index.js.map +0 -1
  117. package/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/index.js +0 -2
  118. package/esm/components/molecules/Menubar/MenuBlock/MenuItem/SubMenuBlock/index.js.map +0 -1
  119. package/esm/components/molecules/Menubar/MenuBlock/MenuItem/index.js +0 -2
  120. package/esm/components/molecules/Menubar/MenuBlock/MenuItem/index.js.map +0 -1
  121. package/esm/components/molecules/Menubar/MenuBlock/index.js +0 -2
  122. package/esm/components/molecules/Menubar/MenuBlock/index.js.map +0 -1
  123. package/esm/components/molecules/Menubar/MostUsed/index.js +0 -2
  124. package/esm/components/molecules/Menubar/MostUsed/index.js.map +0 -1
  125. package/esm/components/molecules/Menubar/SearchResultItem/index.js +0 -2
  126. package/esm/components/molecules/Menubar/SearchResultItem/index.js.map +0 -1
  127. package/esm/components/molecules/Menubar/index.js +0 -3
  128. package/esm/components/molecules/Menubar/index.js.map +0 -1
  129. package/esm/components/molecules/Menubar/types.js +0 -2
  130. package/esm/components/molecules/Menubar/types.js.map +0 -1
  131. package/esm/components/molecules/Select/Dropdown/components/index.js +0 -2
  132. package/esm/components/molecules/Select/Dropdown/components/index.js.map +0 -1
  133. package/esm/components/molecules/Select/Dropdown/index.js +0 -2
  134. package/esm/components/molecules/Select/Dropdown/index.js.map +0 -1
  135. package/esm/components/molecules/Select/SelectItem/index.js +0 -2
  136. package/esm/components/molecules/Select/SelectItem/index.js.map +0 -1
  137. package/esm/components/molecules/Select/index.js +0 -2
  138. package/esm/components/molecules/Select/index.js.map +0 -1
  139. package/esm/components/molecules/Snackbar/index.js +0 -2
  140. package/esm/components/molecules/Snackbar/index.js.map +0 -1
  141. package/esm/components/molecules/TextArea/index.js +0 -2
  142. package/esm/components/molecules/TextArea/index.js.map +0 -1
  143. package/esm/components/organisms/DataGrid/Footer/index.js +0 -2
  144. package/esm/components/organisms/DataGrid/Footer/index.js.map +0 -1
  145. package/esm/components/organisms/DataGrid/Header/index.js +0 -2
  146. package/esm/components/organisms/DataGrid/Header/index.js.map +0 -1
  147. package/esm/components/organisms/DataGrid/Row/index.js +0 -2
  148. package/esm/components/organisms/DataGrid/Row/index.js.map +0 -1
  149. package/esm/components/organisms/DataGrid/index.js +0 -3
  150. package/esm/components/organisms/DataGrid/index.js.map +0 -1
  151. package/esm/components/organisms/DataGrid/types.js +0 -2
  152. package/esm/components/organisms/DataGrid/types.js.map +0 -1
  153. package/esm/hooks/index.js +0 -4
  154. package/esm/hooks/index.js.map +0 -1
@@ -1,51 +1,79 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
-
3
1
  import { IconComponent } from '@tecsinapse/react-core';
4
2
  import React from 'react';
5
- import useIconTextButton from "./hooks/useIconTextButton";
6
- import { StyledIconTextButton } from "./styled";
7
- import TextComponent from "./TextComponent";
3
+ import useIconTextButton from './hooks/useIconTextButton.js';
4
+ import { StyledIconTextButton } from './styled.js';
5
+ import TextComponent from './TextComponent.js';
8
6
 
9
- const IconTextButton = _ref => {
10
- let {
7
+ var __defProp = Object.defineProperty;
8
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
9
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
10
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
11
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
12
+ var __spreadValues = (a, b) => {
13
+ for (var prop in b || (b = {}))
14
+ if (__hasOwnProp.call(b, prop))
15
+ __defNormalProp(a, prop, b[prop]);
16
+ if (__getOwnPropSymbols)
17
+ for (var prop of __getOwnPropSymbols(b)) {
18
+ if (__propIsEnum.call(b, prop))
19
+ __defNormalProp(a, prop, b[prop]);
20
+ }
21
+ return a;
22
+ };
23
+ var __objRest = (source, exclude) => {
24
+ var target = {};
25
+ for (var prop in source)
26
+ if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0)
27
+ target[prop] = source[prop];
28
+ if (source != null && __getOwnPropSymbols)
29
+ for (var prop of __getOwnPropSymbols(source)) {
30
+ if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop))
31
+ target[prop] = source[prop];
32
+ }
33
+ return target;
34
+ };
35
+ const IconTextButton = (_a) => {
36
+ var _b = _a, {
11
37
  iconProps,
12
- iconPosition = 'left',
38
+ iconPosition = "left",
13
39
  textProps,
14
40
  label,
15
- variant = 'filled',
16
- size = 'default',
17
- ...rest
18
- } = _ref;
19
- const {
20
- handleHover,
21
- handlePressed,
22
- defaultFontColor
23
- } = useIconTextButton(variant);
24
- return React.createElement(StyledIconTextButton, _extends({
41
+ variant = "filled",
42
+ size = "default"
43
+ } = _b, rest = __objRest(_b, [
44
+ "iconProps",
45
+ "iconPosition",
46
+ "textProps",
47
+ "label",
48
+ "variant",
49
+ "size"
50
+ ]);
51
+ const { handleHover, handlePressed, defaultFontColor } = useIconTextButton(variant);
52
+ return /* @__PURE__ */ React.createElement(StyledIconTextButton, __spreadValues({
25
53
  boxed: !label,
26
- variant: variant,
27
- size: size,
54
+ variant,
55
+ size,
28
56
  onMouseOut: () => handleHover(true),
29
57
  onMouseOver: () => handleHover(false),
30
58
  onPressIn: () => handlePressed(true),
31
59
  onPressOut: () => handlePressed(false)
32
- }, rest), iconPosition === 'left' ? React.createElement(IconComponent, {
33
- iconProps: iconProps,
34
- size: size,
35
- defaultFontColor: defaultFontColor
36
- }) : React.createElement(React.Fragment, null), React.createElement(TextComponent, {
37
- label: label,
38
- defaultFontColor: defaultFontColor,
60
+ }, rest), iconPosition === "left" ? /* @__PURE__ */ React.createElement(IconComponent, {
61
+ iconProps,
62
+ size,
63
+ defaultFontColor
64
+ }) : /* @__PURE__ */ React.createElement(React.Fragment, null), /* @__PURE__ */ React.createElement(TextComponent, {
65
+ label,
66
+ defaultFontColor,
39
67
  hasIcon: !!iconProps,
40
- iconPosition: iconPosition,
41
- textProps: textProps,
42
- size: size
43
- }), iconPosition === 'right' ? React.createElement(IconComponent, {
44
- iconProps: iconProps,
45
- size: size,
46
- defaultFontColor: defaultFontColor
47
- }) : React.createElement(React.Fragment, null));
68
+ iconPosition,
69
+ textProps,
70
+ size
71
+ }), iconPosition === "right" ? /* @__PURE__ */ React.createElement(IconComponent, {
72
+ iconProps,
73
+ size,
74
+ defaultFontColor
75
+ }) : /* @__PURE__ */ React.createElement(React.Fragment, null));
48
76
  };
49
77
 
50
- export default IconTextButton;
51
- //# sourceMappingURL=IconTextButton.js.map
78
+ export { IconTextButton as default };
79
+ //# sourceMappingURL=IconTextButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"IconTextButton.js","names":["IconComponent","React","useIconTextButton","StyledIconTextButton","TextComponent","IconTextButton","iconProps","iconPosition","textProps","label","variant","size","rest","handleHover","handlePressed","defaultFontColor"],"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"],"mappings":";;AAAA,SAASA,aAAT,QAAmD,wBAAnD;AACA,OAAOC,KAAP,MAAkB,OAAlB;AAEA,OAAOC,iBAAP;AACA,SAASC,oBAAT;AACA,OAAOC,aAAP;;AAKA,MAAMC,cAAgD,GAAG,QAQtC;EAAA,IARuC;IACxDC,SADwD;IAExDC,YAAY,GAAG,MAFyC;IAGxDC,SAHwD;IAIxDC,KAJwD;IAKxDC,OAAO,GAAG,QAL8C;IAMxDC,IAAI,GAAG,SANiD;IAOxD,GAAGC;EAPqD,CAQvC;EACjB,MAAM;IAAEC,WAAF;IAAeC,aAAf;IAA8BC;EAA9B,IACJb,iBAAiB,CAACQ,OAAD,CADnB;EAGA,OACE,oBAAC,oBAAD;IACE,KAAK,EAAE,CAACD,KADV;IAEE,OAAO,EAAEC,OAFX;IAGE,IAAI,EAAEC,IAHR;IAIE,UAAU,EAAE,MAAME,WAAW,CAAC,IAAD,CAJ/B;IAKE,WAAW,EAAE,MAAMA,WAAW,CAAC,KAAD,CALhC;IAME,SAAS,EAAE,MAAMC,aAAa,CAAC,IAAD,CANhC;IAOE,UAAU,EAAE,MAAMA,aAAa,CAAC,KAAD;EAPjC,GAQMF,IARN,GAUGL,YAAY,KAAK,MAAjB,GACC,oBAAC,aAAD;IACE,SAAS,EAAED,SADb;IAEE,IAAI,EAAEK,IAFR;IAGE,gBAAgB,EAAEI;EAHpB,EADD,GAOC,yCAjBJ,EAmBE,oBAAC,aAAD;IACE,KAAK,EAAEN,KADT;IAEE,gBAAgB,EAAEM,gBAFpB;IAGE,OAAO,EAAE,CAAC,CAACT,SAHb;IAIE,YAAY,EAAEC,YAJhB;IAKE,SAAS,EAAEC,SALb;IAME,IAAI,EAAEG;EANR,EAnBF,EA2BGJ,YAAY,KAAK,OAAjB,GACC,oBAAC,aAAD;IACE,SAAS,EAAED,SADb;IAEE,IAAI,EAAEK,IAFR;IAGE,gBAAgB,EAAEI;EAHpB,EADD,GAOC,yCAlCJ,CADF;AAuCD,CAnDD;;AAqDA,eAAeV,cAAf"}
1
+ {"version":3,"file":"IconTextButton.js","sources":["../../../../src/components/molecules/IconTextButton/IconTextButton.tsx"],"sourcesContent":["import { IconComponent, IconTextButtonProps } from '@tecsinapse/react-core';\nimport React from 'react';\nimport { WebButtonProps } from '../../atoms/Button';\nimport useIconTextButton from './hooks/useIconTextButton';\nimport { StyledIconTextButton } from './styled';\nimport TextComponent from './TextComponent';\n\nexport type WebIconTextButtonProps = IconTextButtonProps &\n Omit<WebButtonProps, 'ButtonProps'>;\n\nconst IconTextButton: React.FC<WebIconTextButtonProps> = ({\n iconProps,\n iconPosition = 'left',\n textProps,\n label,\n variant = 'filled',\n size = 'default',\n ...rest\n}): JSX.Element => {\n const { handleHover, handlePressed, defaultFontColor } =\n useIconTextButton(variant);\n\n return (\n <StyledIconTextButton\n boxed={!label}\n variant={variant}\n size={size}\n onMouseOut={() => handleHover(true)}\n onMouseOver={() => handleHover(false)}\n onPressIn={() => handlePressed(true)}\n onPressOut={() => handlePressed(false)}\n {...rest}\n >\n {iconPosition === 'left' ? (\n <IconComponent\n iconProps={iconProps}\n size={size}\n defaultFontColor={defaultFontColor}\n />\n ) : (\n <></>\n )}\n <TextComponent\n label={label}\n defaultFontColor={defaultFontColor}\n hasIcon={!!iconProps}\n iconPosition={iconPosition}\n textProps={textProps}\n size={size}\n />\n {iconPosition === 'right' ? (\n <IconComponent\n iconProps={iconProps}\n size={size}\n defaultFontColor={defaultFontColor}\n />\n ) : (\n <></>\n )}\n </StyledIconTextButton>\n );\n};\n\nexport default IconTextButton;\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,uBACG,KAAA,CAAA,aAAA,CAAA,oBAAA,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,mBACf,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA;AAAA,IACC,SAAA;AAAA,IACA,IAAA;AAAA,IACA,gBAAA;AAAA,GACF,CAAA,mBAEE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,CAAA,kBAEH,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA;AAAA,IACC,KAAA;AAAA,IACA,gBAAA;AAAA,IACA,OAAA,EAAS,CAAC,CAAC,SAAA;AAAA,IACX,YAAA;AAAA,IACA,SAAA;AAAA,IACA,IAAA;AAAA,GACF,CAAA,EACC,YAAiB,KAAA,OAAA,mBACf,KAAA,CAAA,aAAA,CAAA,aAAA,EAAA;AAAA,IACC,SAAA;AAAA,IACA,IAAA;AAAA,IACA,gBAAA;AAAA,GACF,CAAA,2DAEE,CAEN,CAAA,CAAA;AAEJ;;;;"}
@@ -1,23 +1,36 @@
1
- function _extends() { _extends = Object.assign ? Object.assign.bind() : 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); }
2
-
3
1
  import { Text } from '@tecsinapse/react-core';
4
2
  import React from 'react';
5
3
 
6
- const TextComponent = _ref => {
7
- var _textProps$typography, _textProps$fontWeight, _textProps$fontColor;
8
-
9
- let {
10
- textProps,
11
- size = 'default',
12
- defaultFontColor,
13
- label
14
- } = _ref;
15
- return label ? React.createElement(Text, _extends({
16
- typography: ((_textProps$typography = textProps === null || textProps === void 0 ? void 0 : textProps.typography) !== null && _textProps$typography !== void 0 ? _textProps$typography : size === 'small') ? 'sub' : 'base',
17
- fontWeight: (_textProps$fontWeight = textProps === null || textProps === void 0 ? void 0 : textProps.fontWeight) !== null && _textProps$fontWeight !== void 0 ? _textProps$fontWeight : 'bold',
18
- fontColor: (_textProps$fontColor = textProps === null || textProps === void 0 ? void 0 : textProps.fontColor) !== null && _textProps$fontColor !== void 0 ? _textProps$fontColor : defaultFontColor
19
- }, textProps), label) : React.createElement(React.Fragment, null);
4
+ var __defProp = Object.defineProperty;
5
+ var __getOwnPropSymbols = Object.getOwnPropertySymbols;
6
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
7
+ var __propIsEnum = Object.prototype.propertyIsEnumerable;
8
+ var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
9
+ var __spreadValues = (a, b) => {
10
+ for (var prop in b || (b = {}))
11
+ if (__hasOwnProp.call(b, prop))
12
+ __defNormalProp(a, prop, b[prop]);
13
+ if (__getOwnPropSymbols)
14
+ for (var prop of __getOwnPropSymbols(b)) {
15
+ if (__propIsEnum.call(b, prop))
16
+ __defNormalProp(a, prop, b[prop]);
17
+ }
18
+ return a;
19
+ };
20
+ const TextComponent = ({
21
+ textProps,
22
+ size = "default",
23
+ defaultFontColor,
24
+ label
25
+ }) => {
26
+ var _a, _b, _c;
27
+ return label ? /* @__PURE__ */ React.createElement(Text, __spreadValues({
28
+ typography: ((_a = textProps == null ? void 0 : textProps.typography) != null ? _a : size === "small") ? "sub" : "base",
29
+ fontWeight: (_b = textProps == null ? void 0 : textProps.fontWeight) != null ? _b : "bold",
30
+ fontColor: (_c = textProps == null ? void 0 : textProps.fontColor) != null ? _c : defaultFontColor
31
+ }, textProps), label) : /* @__PURE__ */ React.createElement(React.Fragment, null);
20
32
  };
33
+ var TextComponent$1 = React.memo(TextComponent);
21
34
 
22
- export default React.memo(TextComponent);
23
- //# sourceMappingURL=TextComponent.js.map
35
+ export { TextComponent$1 as default };
36
+ //# sourceMappingURL=TextComponent.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"TextComponent.js","names":["Text","React","TextComponent","textProps","size","defaultFontColor","label","typography","fontWeight","fontColor","memo"],"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"],"mappings":";;AAAA,SAIEA,IAJF,QAMO,wBANP;AAOA,OAAOC,KAAP,MAA0B,OAA1B;;AAWA,MAAMC,aAAqC,GAAG,QAKxC;EAAA;;EAAA,IALyC;IAC7CC,SAD6C;IAE7CC,IAAI,GAAG,SAFsC;IAG7CC,gBAH6C;IAI7CC;EAJ6C,CAKzC;EACJ,OAAOA,KAAK,GACV,oBAAC,IAAD;IACE,UAAU,EAAE,0BAAAH,SAAS,SAAT,IAAAA,SAAS,WAAT,YAAAA,SAAS,CAAEI,UAAX,yEAAyBH,IAAI,KAAK,OAAlC,IAA4C,KAA5C,GAAoD,MADlE;IAEE,UAAU,2BAAED,SAAF,aAAEA,SAAF,uBAAEA,SAAS,CAAEK,UAAb,yEAA2B,MAFvC;IAGE,SAAS,0BAAEL,SAAF,aAAEA,SAAF,uBAAEA,SAAS,CAAEM,SAAb,uEAA0BJ;EAHrC,GAIMF,SAJN,GAMGG,KANH,CADU,GAUV,yCAVF;AAYD,CAlBD;;AAoBA,eAAeL,KAAK,CAACS,IAAN,CAAWR,aAAX,CAAf"}
1
+ {"version":3,"file":"TextComponent.js","sources":["../../../../src/components/molecules/IconTextButton/TextComponent.tsx"],"sourcesContent":["import {\n ButtonSizeType,\n FontColor,\n IconPositionOptions,\n Text,\n TextProps,\n} from '@tecsinapse/react-core';\nimport React, { FC } from 'react';\n\ninterface TextComponentProps {\n textProps?: TextProps;\n size?: ButtonSizeType;\n defaultFontColor: keyof FontColor;\n label?: string;\n iconPosition?: IconPositionOptions;\n hasIcon?: boolean;\n}\n\nconst TextComponent: FC<TextComponentProps> = ({\n textProps,\n size = 'default',\n defaultFontColor,\n label,\n}) => {\n return label ? (\n <Text\n typography={textProps?.typography ?? size === 'small' ? 'sub' : 'base'}\n fontWeight={textProps?.fontWeight ?? 'bold'}\n fontColor={textProps?.fontColor ?? defaultFontColor}\n {...textProps}\n >\n {label}\n </Text>\n ) : (\n <></>\n );\n};\n\nexport default React.memo(TextComponent);\n"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;AAkBA,MAAM,gBAAwC,CAAC;AAAA,EAC7C,SAAA;AAAA,EACA,IAAO,GAAA,SAAA;AAAA,EACP,gBAAA;AAAA,EACA,KAAA;AACF,CAAM,KAAA;AAvBN,EAAA,IAAA,EAAA,EAAA,EAAA,EAAA,EAAA,CAAA;AAwBE,EAAA,OAAO,wBACJ,KAAA,CAAA,aAAA,CAAA,IAAA,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,mBAEE,KAAA,CAAA,aAAA,CAAA,KAAA,CAAA,QAAA,EAAA,IAAA,CAAA,CAAA;AAEN,CAAA,CAAA;AAEA,sBAAe,KAAA,CAAM,KAAK,aAAa,CAAA;;;;"}
@@ -1,4 +1,4 @@
1
- declare const useIconTextButton: (variant: any) => {
1
+ declare const useIconTextButton: (variant: VariantType) => {
2
2
  handleHover: (value: boolean) => void;
3
3
  handlePressed: (value: boolean) => void;
4
4
  defaultFontColor: any;
@@ -1,16 +1,22 @@
1
1
  import { fontColorVC } from '@tecsinapse/react-core';
2
- import { useCallback, useState } from 'react';
2
+ import { useState, useCallback } from 'react';
3
3
 
4
- const useIconTextButton = variant => {
4
+ const useIconTextButton = (variant) => {
5
5
  const [hover, setHover] = useState(false);
6
6
  const [pressed, setPressed] = useState(false);
7
- const defaultFontColor = !pressed && hover ? 'light' : fontColorVC[variant];
8
- const handleHover = useCallback(value => {
9
- setHover(value);
10
- }, [setHover]);
11
- const handlePressed = useCallback(value => {
12
- setPressed(value);
13
- }, [setPressed]);
7
+ const defaultFontColor = !pressed && hover ? "light" : fontColorVC[variant];
8
+ const handleHover = useCallback(
9
+ (value) => {
10
+ setHover(value);
11
+ },
12
+ [setHover]
13
+ );
14
+ const handlePressed = useCallback(
15
+ (value) => {
16
+ setPressed(value);
17
+ },
18
+ [setPressed]
19
+ );
14
20
  return {
15
21
  handleHover,
16
22
  handlePressed,
@@ -18,5 +24,5 @@ const useIconTextButton = variant => {
18
24
  };
19
25
  };
20
26
 
21
- export default useIconTextButton;
22
- //# sourceMappingURL=useIconTextButton.js.map
27
+ export { useIconTextButton as default };
28
+ //# sourceMappingURL=useIconTextButton.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"useIconTextButton.js","names":["fontColorVC","useCallback","useState","useIconTextButton","variant","hover","setHover","pressed","setPressed","defaultFontColor","handleHover","value","handlePressed"],"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"],"mappings":"AAAA,SAASA,WAAT,QAAyC,wBAAzC;AACA,SAASC,WAAT,EAAsBC,QAAtB,QAAsC,OAAtC;;AAEA,MAAMC,iBAAiB,GAAIC,OAAD,IAA0B;EAClD,MAAM,CAACC,KAAD,EAAQC,QAAR,IAAoBJ,QAAQ,CAAU,KAAV,CAAlC;EACA,MAAM,CAACK,OAAD,EAAUC,UAAV,IAAwBN,QAAQ,CAAU,KAAV,CAAtC;EAEA,MAAMO,gBAAgB,GAAG,CAACF,OAAD,IAAYF,KAAZ,GAAoB,OAApB,GAA8BL,WAAW,CAACI,OAAD,CAAlE;EAEA,MAAMM,WAAW,GAAGT,WAAW,CAC5BU,KAAD,IAAoB;IAClBL,QAAQ,CAACK,KAAD,CAAR;EACD,CAH4B,EAI7B,CAACL,QAAD,CAJ6B,CAA/B;EAOA,MAAMM,aAAa,GAAGX,WAAW,CAC9BU,KAAD,IAAoB;IAClBH,UAAU,CAACG,KAAD,CAAV;EACD,CAH8B,EAI/B,CAACH,UAAD,CAJ+B,CAAjC;EAOA,OAAO;IACLE,WADK;IAELE,aAFK;IAGLH;EAHK,CAAP;AAKD,CAzBD;;AA2BA,eAAeN,iBAAf"}
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":[],"mappings":";;;AAGM,MAAA,iBAAA,GAAoB,CAAC,OAAyB,KAAA;AAClD,EAAA,MAAM,CAAC,KAAA,EAAO,QAAQ,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AACjD,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,SAAkB,KAAK,CAAA,CAAA;AAErD,EAAA,MAAM,gBAAmB,GAAA,CAAC,OAAW,IAAA,KAAA,GAAQ,UAAU,WAAY,CAAA,OAAA,CAAA,CAAA;AAEnE,EAAA,MAAM,WAAc,GAAA,WAAA;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,GAAA,WAAA;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;;;;"}
@@ -1,29 +1,15 @@
1
- var _templateObject;
2
-
3
- function _taggedTemplateLiteral(strings, raw) { if (!raw) { raw = strings.slice(0); } return Object.freeze(Object.defineProperties(strings, { raw: { value: Object.freeze(raw) } })); }
4
-
5
- import styled from '@emotion/native';
6
- import { Button } from "../../atoms/Button";
7
-
8
- const boxedStyle = _ref => {
9
- let {
10
- theme
11
- } = _ref;
12
- return "\n padding: ".concat(theme === null || theme === void 0 ? void 0 : theme.spacing.centi, ";\n aspect-ratio: 1;\n ");
13
- };
14
-
15
- export const StyledIconTextButton = styled(Button)(_templateObject || (_templateObject = _taggedTemplateLiteral(["\n gap: ", ";\n ", ";\n"])), _ref2 => {
16
- let {
17
- theme
18
- } = _ref2;
19
- return theme === null || theme === void 0 ? void 0 : theme.spacing.mili;
20
- }, _ref3 => {
21
- let {
22
- boxed,
23
- theme
24
- } = _ref3;
25
- return boxed && boxedStyle({
26
- theme
27
- });
28
- });
29
- //# sourceMappingURL=styled.js.map
1
+ import nativeStyled from '@emotion/native';
2
+ import Button from '../../atoms/Button/Button.js';
3
+ import 'react';
4
+
5
+ const boxedStyle = ({ theme }) => `
6
+ padding: ${theme == null ? void 0 : theme.spacing.centi};
7
+ aspect-ratio: 1;
8
+ `;
9
+ const StyledIconTextButton = nativeStyled(Button)`
10
+ gap: ${({ theme }) => theme == null ? void 0 : theme.spacing.mili};
11
+ ${({ boxed, theme }) => boxed && boxedStyle({ theme })};
12
+ `;
13
+
14
+ export { StyledIconTextButton };
15
+ //# sourceMappingURL=styled.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"styled.js","names":["styled","Button","boxedStyle","theme","spacing","centi","StyledIconTextButton","mili","boxed"],"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"],"mappings":";;;;AAAA,OAAOA,MAAP,MAAmB,iBAAnB;AAEA,SAASC,MAAT;;AAEA,MAAMC,UAAU,GAAG;EAAA,IAAC;IAAEC;EAAF,CAAD;EAAA,gCAEJA,KAFI,aAEJA,KAFI,uBAEJA,KAAK,CAAEC,OAAP,CAAeC,KAFX;AAAA,CAAnB;;AAMA,OAAO,MAAMC,oBAAoB,GAAGN,MAAM,CAACC,MAAD,CAAT,+FAKxB;EAAA,IAAC;IAAEE;EAAF,CAAD;EAAA,OAAeA,KAAf,aAAeA,KAAf,uBAAeA,KAAK,CAAEC,OAAP,CAAeG,IAA9B;AAAA,CALwB,EAM7B;EAAA,IAAC;IAAEC,KAAF;IAASL;EAAT,CAAD;EAAA,OAAsBK,KAAK,IAAIN,UAAU,CAAC;IAAEC;EAAF,CAAD,CAAzC;AAAA,CAN6B,CAA1B"}
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,aAAO,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;;;;"}
@@ -93,25 +93,20 @@ const Select = (_a) => {
93
93
  keyExtractor,
94
94
  labelExtractor
95
95
  );
96
- useEffect(() => {
97
- if (typeof options !== "function") {
98
- setSelectOptions(options);
99
- }
100
- }, [options]);
101
96
  const handleLazyFocus = React.useCallback(async () => {
102
97
  if (!dropDownVisible && typeof options === "function") {
103
98
  try {
104
99
  const result = await options();
105
100
  if (result) {
106
- setSelectOptions(result);
101
+ setSelectOptions(result != null ? result : []);
107
102
  }
108
103
  } catch (e) {
109
104
  }
110
105
  }
111
- }, [options, value, setSelectOptions, dropDownVisible]);
106
+ }, [options, setSelectOptions, dropDownVisible]);
112
107
  const handleOnSearch = React.useCallback(
113
108
  async (searchInput) => {
114
- if (searchInput !== void 0 && onSearch) {
109
+ if (searchInput !== void 0 && onSearch && dropDownVisible) {
115
110
  try {
116
111
  const result = await onSearch(searchInput);
117
112
  if (result) {
@@ -139,7 +134,7 @@ const Select = (_a) => {
139
134
  }
140
135
  }
141
136
  },
142
- [options, value, keyExtractor]
137
+ [onSearch, value, keyExtractor, dropDownVisible, setSelectOptions]
143
138
  );
144
139
  const handlePressInput = async () => {
145
140
  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":[],"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;AAAA,IACA,gBAAA;AAAA,GAAA,CAAA,CAA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A,IAC3B,QAAA;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,EAAK,aAAkB,CAAA,EAAA,UAAA,CAAW,MAAQ,CAAA,CAAA,KAAA,CAAA,CAAA;AAAA,IACjD,kBAAA;AAAA,IACA,MAAA;AAAA,IACA,cAAA;AAAA,GACF,CAEJ,CACF,CAAA,CAAA;AAEJ;;;;"}
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 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":[],"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,EAA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,YACH,CACF,CACF,CAAA,kBACC,KAAA,CAAA,aAAA,CAAA,UAAA,EAAA;AAAA,IAAW,EAAI,EAAA,eAAA;AAAA,IAAiB,OAAS,EAAA,GAAA;AAAA,GAAA,EACvC,2BACE,KAAA,CAAA,aAAA,CAAA,QAAA,EAAA;AAAA,IACC,OAAA,EAAS,wCAAiB,EAAC;AAAA,IAC3B,QAAA;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,EAAK,aAAkB,CAAA,EAAA,UAAA,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 | undefined) => string, labelExtractor: (option: Data) => string) => string | Data | Data[] | undefined;
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: _rowsPerPageOptions, rowsPerPageLabel: _rowsPerPageLabel, exportLabel, exportFunction, rowsCount, page, onPageChange, loading, skeletonComponent, emptyPlaceholder, exportComponent, ...rest }: DataGridProps<Data>) => JSX.Element;
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: _checked, handleSelect, selectable, headers, }: {
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/esm/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, } from './components/molecules/Breadcrumbs';
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 { IGridWeb, IGridItemWeb } from './components/molecules/Grid';
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, } from './components/molecules/Menubar';
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, } from './components/organisms/DataGrid';
45
+ export type { DataGridProps, HeadersType } from './components/organisms/DataGrid';
45
46
  export * from './hooks';
package/esm/index.js CHANGED
@@ -16,6 +16,7 @@ export { DateTimePicker } from './components/molecules/DateTimePicker/DateTimePi
16
16
  export { default as Drawer } from './components/molecules/Drawer/Drawer.js';
17
17
  export { default as GridItem } from './components/molecules/Grid/Item/Item.js';
18
18
  export { default as Grid } from './components/molecules/Grid/Grid.js';
19
+ export { default as IconTextButton } from './components/molecules/IconTextButton/IconTextButton.js';
19
20
  export { default as InputPassword } from './components/molecules/InputPassword/InputPassword.js';
20
21
  export { default as LabeledSwitch } from './components/molecules/LabeledSwitch/LabeledSwitch.js';
21
22
  export { default as Menubar } from './components/molecules/Menubar/Menubar.js';
package/esm/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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tecsinapse/react-web-kit",
3
3
  "description": "TecSinapse React components",
4
- "version": "1.22.0-beta.11+cb2e0a1",
4
+ "version": "1.22.0",
5
5
  "main": "dist/index.js",
6
6
  "module": "esm/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -20,7 +20,7 @@
20
20
  "@emotion/native": "^11.10.0",
21
21
  "@emotion/react": "^11.10.0",
22
22
  "@emotion/styled": "^11.10.0",
23
- "@tecsinapse/react-core": "^1.21.0-beta.13+cb2e0a1",
23
+ "@tecsinapse/react-core": "^1.21.0",
24
24
  "@types/react-native": "^0.64.4",
25
25
  "react-native-vector-icons": "^9.2.0",
26
26
  "react-transition-group": "^4.4.2"
@@ -39,5 +39,5 @@
39
39
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0",
40
40
  "react-native-web": "^0.17.1 || ^0.18.0"
41
41
  },
42
- "gitHead": "cb2e0a1873cfc3f45e793b5443297fb6fffce1b5"
42
+ "gitHead": "92debfcee6bd043a295edc3697e3795dccabf8f6"
43
43
  }
@@ -86,28 +86,22 @@ const Select = <Data, Type extends 'single' | 'multi'>({
86
86
  labelExtractor
87
87
  );
88
88
 
89
- useEffect(() => {
90
- if (typeof options !== 'function') {
91
- setSelectOptions(options);
92
- }
93
- }, [options]);
94
-
95
89
  const handleLazyFocus = React.useCallback(async () => {
96
90
  if (!dropDownVisible && typeof options === 'function') {
97
91
  try {
98
92
  const result = await options();
99
93
  if (result) {
100
- setSelectOptions(result);
94
+ setSelectOptions(result ?? []);
101
95
  }
102
96
  } catch (e) {
103
97
  // TODO: Catch error
104
98
  }
105
99
  }
106
- }, [options, value, setSelectOptions, dropDownVisible]);
100
+ }, [options, setSelectOptions, dropDownVisible]);
107
101
 
108
102
  const handleOnSearch = React.useCallback(
109
103
  async (searchInput: string | undefined) => {
110
- if (searchInput !== undefined && onSearch) {
104
+ if (searchInput !== undefined && onSearch && dropDownVisible) {
111
105
  try {
112
106
  //TODO: Remove code duplicated below (Select in react-native-kit)
113
107
  const result = await onSearch(searchInput);
@@ -142,7 +136,7 @@ const Select = <Data, Type extends 'single' | 'multi'>({
142
136
  }
143
137
  }
144
138
  },
145
- [options, value, keyExtractor]
139
+ [onSearch, value, keyExtractor, dropDownVisible, setSelectOptions]
146
140
  );
147
141
 
148
142
  const handlePressInput = async () => {
package/src/index.ts CHANGED
@@ -21,7 +21,7 @@ export type { ITooltip } from './components/atoms/Tooltip';
21
21
  export { Breadcrumbs } from './components/molecules/Breadcrumbs';
22
22
  export type {
23
23
  BreadcrumbsProps,
24
- BreadcrumbType,
24
+ BreadcrumbType
25
25
  } from './components/molecules/Breadcrumbs';
26
26
  export { DatePicker } from './components/molecules/DatePicker';
27
27
  export type { WebDatePickerProps } from './components/molecules/DatePicker';
@@ -30,7 +30,8 @@ export type { WebDateTimePickerProps } from './components/molecules/DateTimePick
30
30
  export { Drawer } from './components/molecules/Drawer';
31
31
  export type { DrawerProps } from './components/molecules/Drawer';
32
32
  export { Grid, GridItem } from './components/molecules/Grid';
33
- export type { IGridWeb, IGridItemWeb } from './components/molecules/Grid';
33
+ export type { IGridItemWeb, IGridWeb } from './components/molecules/Grid';
34
+ export { IconTextButton } from './components/molecules/IconTextButton';
34
35
  export { InputPassword } from './components/molecules/InputPassword';
35
36
  export type { InputPasswordWebProps } from './components/molecules/InputPassword';
36
37
  export { LabeledSwitch } from './components/molecules/LabeledSwitch';
@@ -40,7 +41,7 @@ export type {
40
41
  MenubarItemsOptions,
41
42
  MenubarMostUsedType,
42
43
  MenubarOptionsType,
43
- MenubarProps,
44
+ MenubarProps
44
45
  } from './components/molecules/Menubar';
45
46
  export { Select } from './components/molecules/Select';
46
47
  export type { SelectProps } from './components/molecules/Select';
@@ -51,6 +52,7 @@ export type { TextAreaProps } from './components/molecules/TextArea';
51
52
  export { DataGrid } from './components/organisms/DataGrid';
52
53
  export type {
53
54
  DataGridProps,
54
- HeadersType,
55
+ HeadersType
55
56
  } from './components/organisms/DataGrid';
56
57
  export * from './hooks';
58
+
@@ -1,2 +0,0 @@
1
- export { default as Accordion } from "./Accordion";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["default","Accordion"],"sources":["../../../../src/components/atoms/Accordion/index.ts"],"sourcesContent":["export { default as Accordion } from './Accordion';\nexport type { AccordionProps } from './Accordion';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,SAApB"}
@@ -1,2 +0,0 @@
1
- export { default as Badge } from "./Badge";
2
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","names":["default","Badge"],"sources":["../../../../src/components/atoms/Badge/index.ts"],"sourcesContent":["export { default as Badge } from './Badge';\nexport type { BadgeWebProps } from './Badge';\n"],"mappings":"AAAA,SAASA,OAAO,IAAIC,KAApB"}