@tecsinapse/react-web-kit 3.3.6 → 3.3.9

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.
@@ -70,10 +70,6 @@ const DatePicker = ({
70
70
  onChange?.(auxData);
71
71
  }
72
72
  }
73
- if (controlledInput?.length === 0) {
74
- setError(true);
75
- callbackAfterValidated?.(false, invalidDateLabel);
76
- }
77
73
  },
78
74
  disabled,
79
75
  mask: reactCore.Masks.DATE,
@@ -104,13 +104,25 @@ const Select = ({
104
104
  () => setDropDownVisible((prev) => !prev),
105
105
  [setDropDownVisible]
106
106
  );
107
+ const RightComponent = React.useMemo(
108
+ () => /* @__PURE__ */ React.createElement(
109
+ styled.StyledIconComponent,
110
+ {
111
+ name: "chevron-down",
112
+ type: "material-community",
113
+ size: "centi",
114
+ disabled
115
+ }
116
+ ),
117
+ [disabled]
118
+ );
107
119
  return /* @__PURE__ */ React.createElement(styled.StyledContainer, { ref: refDropDown, ...rest }, /* @__PURE__ */ React.createElement(styled.StyledInputContainer, { onFocus: handlePressInput }, /* @__PURE__ */ React.createElement(
108
120
  reactCore.PressableInputContainer,
109
121
  {
110
122
  label: _label,
111
123
  onPress,
112
124
  disabled,
113
- rightComponent: styled.RightComponent
125
+ rightComponent: RightComponent
114
126
  },
115
127
  /* @__PURE__ */ React.createElement(
116
128
  reactCore.Text,
@@ -36,7 +36,7 @@ const SelectItem = ({
36
36
  ) !== void 0
37
37
  );
38
38
  }
39
- }, [checkedAll]);
39
+ }, [checkedAll, value]);
40
40
  const clickItem = React.useCallback(
41
41
  (item2, _value) => {
42
42
  const key = item2;
@@ -2,7 +2,7 @@
2
2
 
3
3
  var styled = require('@emotion/styled');
4
4
  var reactCore = require('@tecsinapse/react-core');
5
- var React = require('react');
5
+ var styled$1 = require('@emotion/native');
6
6
 
7
7
  const StyledContainer = styled("div")`
8
8
  display: flex;
@@ -15,16 +15,11 @@ const StyledContainer = styled("div")`
15
15
  const StyledInputContainer = styled("div")`
16
16
  width: 100%;
17
17
  `;
18
- const RightComponent = /* @__PURE__ */ React.createElement(
19
- reactCore.Icon,
20
- {
21
- name: "chevron-down",
22
- type: "material-community",
23
- size: "centi",
24
- style: { marginRight: 12 }
25
- }
26
- );
18
+ const StyledIconComponent = styled$1(reactCore.Icon)`
19
+ margin-right: 12px;
20
+ color: ${({ disabled, theme }) => disabled ? theme.color.secondary.light : "inherit"};
21
+ `;
27
22
 
28
- exports.RightComponent = RightComponent;
29
23
  exports.StyledContainer = StyledContainer;
24
+ exports.StyledIconComponent = StyledIconComponent;
30
25
  exports.StyledInputContainer = StyledInputContainer;
@@ -68,10 +68,6 @@ const DatePicker = ({
68
68
  onChange?.(auxData);
69
69
  }
70
70
  }
71
- if (controlledInput?.length === 0) {
72
- setError(true);
73
- callbackAfterValidated?.(false, invalidDateLabel);
74
- }
75
71
  },
76
72
  disabled,
77
73
  mask: Masks.DATE,
@@ -1,11 +1,11 @@
1
1
  import { PressableInputContainer, Text } from '@tecsinapse/react-core';
2
- import React__default, { useState, useId, useEffect } from 'react';
2
+ import React__default, { useState, useId, useEffect, useMemo } from 'react';
3
3
  import { Transition } from 'react-transition-group';
4
4
  import { useClickAwayListener } from '../../../hooks/useClickAwayListener.js';
5
5
  import { defaultStyles, transition } from './animations.js';
6
6
  import Dropdown from './Dropdown/Dropdown.js';
7
7
  import { getDisplayValue } from './functions.js';
8
- import { StyledContainer, StyledInputContainer, RightComponent } from './styled.js';
8
+ import { StyledIconComponent, StyledContainer, StyledInputContainer } from './styled.js';
9
9
 
10
10
  const Select = ({
11
11
  value,
@@ -102,6 +102,18 @@ const Select = ({
102
102
  () => setDropDownVisible((prev) => !prev),
103
103
  [setDropDownVisible]
104
104
  );
105
+ const RightComponent = useMemo(
106
+ () => /* @__PURE__ */ React__default.createElement(
107
+ StyledIconComponent,
108
+ {
109
+ name: "chevron-down",
110
+ type: "material-community",
111
+ size: "centi",
112
+ disabled
113
+ }
114
+ ),
115
+ [disabled]
116
+ );
105
117
  return /* @__PURE__ */ React__default.createElement(StyledContainer, { ref: refDropDown, ...rest }, /* @__PURE__ */ React__default.createElement(StyledInputContainer, { onFocus: handlePressInput }, /* @__PURE__ */ React__default.createElement(
106
118
  PressableInputContainer,
107
119
  {
@@ -34,7 +34,7 @@ const SelectItem = ({
34
34
  ) !== void 0
35
35
  );
36
36
  }
37
- }, [checkedAll]);
37
+ }, [checkedAll, value]);
38
38
  const clickItem = React__default.useCallback(
39
39
  (item2, _value) => {
40
40
  const key = item2;
@@ -1,6 +1,6 @@
1
1
  import styled from '@emotion/styled';
2
2
  import { Icon } from '@tecsinapse/react-core';
3
- import React__default from 'react';
3
+ import styled$1 from '@emotion/native';
4
4
 
5
5
  const StyledContainer = styled("div")`
6
6
  display: flex;
@@ -13,14 +13,9 @@ const StyledContainer = styled("div")`
13
13
  const StyledInputContainer = styled("div")`
14
14
  width: 100%;
15
15
  `;
16
- const RightComponent = /* @__PURE__ */ React__default.createElement(
17
- Icon,
18
- {
19
- name: "chevron-down",
20
- type: "material-community",
21
- size: "centi",
22
- style: { marginRight: 12 }
23
- }
24
- );
16
+ const StyledIconComponent = styled$1(Icon)`
17
+ margin-right: 12px;
18
+ color: ${({ disabled, theme }) => disabled ? theme.color.secondary.light : "inherit"};
19
+ `;
25
20
 
26
- export { RightComponent, StyledContainer, StyledInputContainer };
21
+ export { StyledContainer, StyledIconComponent, StyledInputContainer };
@@ -1,10 +1,15 @@
1
- import React from 'react';
1
+ /// <reference types="react" />
2
2
  export declare const StyledContainer: import("@emotion/styled").StyledComponent<{
3
3
  theme?: import("@emotion/react").Theme | undefined;
4
- as?: React.ElementType<any> | undefined;
5
- } & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
4
+ as?: import("react").ElementType<any> | undefined;
5
+ } & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
6
6
  export declare const StyledInputContainer: import("@emotion/styled").StyledComponent<{
7
7
  theme?: import("@emotion/react").Theme | undefined;
8
- as?: React.ElementType<any> | undefined;
9
- } & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
- export declare const RightComponent: JSX.Element;
8
+ as?: import("react").ElementType<any> | undefined;
9
+ } & Partial<import("@tecsinapse/react-core").ThemeProviderProps>, import("react").DetailedHTMLProps<import("react").HTMLAttributes<HTMLDivElement>, HTMLDivElement>, {}>;
10
+ export declare const StyledIconComponent: import("@emotion/native").StyledComponent<import("@tecsinapse/react-core").IconProps & {
11
+ theme?: import("@emotion/react").Theme | undefined;
12
+ as?: import("react").ElementType<any> | undefined;
13
+ } & Partial<import("@tecsinapse/react-core").ThemeProviderProps & {
14
+ disabled: boolean;
15
+ }>, {}, {}>;
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": "3.3.6",
4
+ "version": "3.3.9",
5
5
  "license": "MIT",
6
6
  "main": "dist/esm/index.js",
7
7
  "module": "dist/esm/index.js",
@@ -21,7 +21,7 @@
21
21
  "@emotion/native": "~11.11.0",
22
22
  "@emotion/react": "~11.11.0",
23
23
  "@emotion/styled": "~11.11.0",
24
- "@tecsinapse/react-core": "3.3.3",
24
+ "@tecsinapse/react-core": "3.3.6",
25
25
  "date-fns": "~2.30.0",
26
26
  "react-native-vector-icons": "^9.2.0",
27
27
  "react-transition-group": "~4.4.5"
@@ -40,5 +40,5 @@
40
40
  "react-dom": "^18.0.0",
41
41
  "react-native-web": ">=0.18.0 <1"
42
42
  },
43
- "gitHead": "e3ea51cc7a576d13fbba675264e92ae48c552b50"
43
+ "gitHead": "a1489e62337d020ca4e197c864e64f464a20d1a1"
44
44
  }