@trilogy-ds/react 0.0.1-beta.35 → 0.0.1-beta.45
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/lib/components/accordion/header/AccordionHeader.native.js +1 -1
- package/lib/components/accordion/item/AccordionItem.native.js +2 -3
- package/lib/components/accordion/item/AccordionItem.native.js.map +1 -1
- package/lib/components/enumsComponentsName.d.ts +0 -5
- package/lib/components/enumsComponentsName.js +0 -5
- package/lib/components/enumsComponentsName.js.map +1 -1
- package/lib/components/index.d.ts +0 -1
- package/lib/components/index.js +0 -1
- package/lib/components/index.js.map +1 -1
- package/lib/components/input/Input.d.ts +28 -4
- package/lib/components/input/Input.js +90 -260
- package/lib/components/input/Input.js.map +1 -1
- package/lib/components/input/Input.native.d.ts +6 -4
- package/lib/components/input/Input.native.js +126 -334
- package/lib/components/input/Input.native.js.map +1 -1
- package/lib/components/{autocomplete → input/autocomplete}/AutoComplete.d.ts +2 -3
- package/lib/components/{autocomplete → input/autocomplete}/AutoComplete.js +13 -21
- package/lib/components/input/autocomplete/AutoComplete.js.map +1 -0
- package/lib/components/input/autocomplete/AutoComplete.native.d.ts +4 -0
- package/lib/components/{autocomplete → input/autocomplete}/AutoComplete.native.js +8 -11
- package/lib/components/input/autocomplete/AutoComplete.native.js.map +1 -0
- package/lib/components/{autocomplete → input/autocomplete}/AutoCompleteProps.d.ts +1 -3
- package/lib/components/input/autocomplete/AutoCompleteProps.js +2 -0
- package/lib/components/input/autocomplete/AutoCompleteProps.js.map +1 -0
- package/lib/components/input/autocomplete/Autocomplete.helpers.js.map +1 -0
- package/lib/components/input/autocomplete/index.js.map +1 -0
- package/lib/components/input/autocomplete/item/AutoCompleteIem.native.d.ts +4 -0
- package/lib/components/input/autocomplete/item/AutoCompleteIem.native.js +15 -0
- package/lib/components/input/autocomplete/item/AutoCompleteIem.native.js.map +1 -0
- package/lib/components/{autocomplete → input/autocomplete}/item/AutoCompleteItem.d.ts +2 -2
- package/lib/components/{autocomplete → input/autocomplete}/item/AutoCompleteItem.js +6 -6
- package/lib/components/input/autocomplete/item/AutoCompleteItem.js.map +1 -0
- package/lib/components/input/autocomplete/item/AutoCompleteItemProps.js.map +1 -0
- package/lib/components/input/autocomplete/item/index.js.map +1 -0
- package/lib/components/{autocomplete → input/autocomplete}/menu/AutoCompleteMenu.d.ts +2 -2
- package/lib/components/{autocomplete → input/autocomplete}/menu/AutoCompleteMenu.js +7 -7
- package/lib/components/input/autocomplete/menu/AutoCompleteMenu.js.map +1 -0
- package/lib/components/input/autocomplete/menu/AutoCompleteMenu.native.d.ts +4 -0
- package/lib/components/{autocomplete → input/autocomplete}/menu/AutoCompleteMenu.native.js +6 -8
- package/lib/components/input/autocomplete/menu/AutoCompleteMenu.native.js.map +1 -0
- package/lib/components/input/autocomplete/menu/AutoCompleteMenuProps.js.map +1 -0
- package/lib/components/input/autocomplete/menu/index.js.map +1 -0
- package/lib/components/input/autocomplete/utils/debounce.js.map +1 -0
- package/lib/components/input/autocomplete/utils/index.js.map +1 -0
- package/lib/components/input/gauge/InputGauge.d.ts +9 -0
- package/lib/components/input/gauge/InputGauge.js +29 -0
- package/lib/components/input/gauge/InputGauge.js.map +1 -0
- package/lib/components/input/gauge/InputGauge.native.d.ts +8 -0
- package/lib/components/input/gauge/InputGauge.native.js +53 -0
- package/lib/components/input/gauge/InputGauge.native.js.map +1 -0
- package/lib/components/input/gauge/hook/useGauge.d.ts +32 -0
- package/lib/components/input/gauge/hook/useGauge.js +75 -0
- package/lib/components/input/gauge/hook/useGauge.js.map +1 -0
- package/lib/components/link/Link.native.d.ts +0 -1
- package/lib/components/link/Link.native.js +36 -27
- package/lib/components/link/Link.native.js.map +1 -1
- package/lib/components/range/Range.js +6 -0
- package/lib/components/range/Range.js.map +1 -1
- package/lib/components/select/web/SelectDynamic.js +14 -8
- package/lib/components/select/web/SelectDynamic.js.map +1 -1
- package/lib/context/interfaces.d.ts +1 -0
- package/lib/context/providerTheme.js +1 -0
- package/lib/context/providerTheme.js.map +1 -1
- package/lib/context/providerTheme.native.js +1 -0
- package/lib/context/providerTheme.native.js.map +1 -1
- package/lib/objects/Typography/TypographyBold.d.ts +1 -1
- package/lib/objects/Typography/TypographyBold.js +13 -10
- package/lib/objects/Typography/TypographyBold.js.map +1 -1
- package/lib/objects/facets/Color.js.map +1 -1
- package/package.json +1 -1
- package/lib/components/autocomplete/AutoComplete.js.map +0 -1
- package/lib/components/autocomplete/AutoComplete.native.d.ts +0 -8
- package/lib/components/autocomplete/AutoComplete.native.js.map +0 -1
- package/lib/components/autocomplete/AutoCompleteProps.js +0 -2
- package/lib/components/autocomplete/AutoCompleteProps.js.map +0 -1
- package/lib/components/autocomplete/Autocomplete.helpers.js.map +0 -1
- package/lib/components/autocomplete/index.js.map +0 -1
- package/lib/components/autocomplete/item/AutoCompleteIem.native.d.ts +0 -8
- package/lib/components/autocomplete/item/AutoCompleteIem.native.js +0 -17
- package/lib/components/autocomplete/item/AutoCompleteIem.native.js.map +0 -1
- package/lib/components/autocomplete/item/AutoCompleteItem.js.map +0 -1
- package/lib/components/autocomplete/item/AutoCompleteItemProps.js.map +0 -1
- package/lib/components/autocomplete/item/index.js.map +0 -1
- package/lib/components/autocomplete/menu/AutoCompleteMenu.js.map +0 -1
- package/lib/components/autocomplete/menu/AutoCompleteMenu.native.d.ts +0 -8
- package/lib/components/autocomplete/menu/AutoCompleteMenu.native.js.map +0 -1
- package/lib/components/autocomplete/menu/AutoCompleteMenuProps.js.map +0 -1
- package/lib/components/autocomplete/menu/index.js.map +0 -1
- package/lib/components/autocomplete/utils/debounce.js.map +0 -1
- package/lib/components/autocomplete/utils/index.js.map +0 -1
- /package/lib/components/{autocomplete → input/autocomplete}/Autocomplete.helpers.d.ts +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/Autocomplete.helpers.js +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/index.d.ts +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/index.js +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/item/AutoCompleteItemProps.d.ts +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/item/AutoCompleteItemProps.js +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/item/index.d.ts +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/item/index.js +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/menu/AutoCompleteMenuProps.d.ts +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/menu/AutoCompleteMenuProps.js +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/menu/index.d.ts +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/menu/index.js +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/utils/debounce.d.ts +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/utils/debounce.js +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/utils/index.d.ts +0 -0
- /package/lib/components/{autocomplete → input/autocomplete}/utils/index.js +0 -0
|
@@ -33,9 +33,8 @@ const AccordionItem = ({ active, id, onClick, disabled, onOpen, onClose, childre
|
|
|
33
33
|
? getColorStyle(TrilogyColor.DISABLED, 1)
|
|
34
34
|
: getColorStyle(TrilogyColor.BACKGROUND),
|
|
35
35
|
borderWidth: 1,
|
|
36
|
-
borderColor: (
|
|
37
|
-
|
|
38
|
-
getColorStyle(TrilogyColor.FONT, 1),
|
|
36
|
+
borderColor: (disabled && getColorStyle(TrilogyColor.DISABLED, 1)) ||
|
|
37
|
+
getColorStyle(TrilogyColor.FONT, 1)
|
|
39
38
|
},
|
|
40
39
|
bodyBackground: {
|
|
41
40
|
borderRadius: 6,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AccordionItem.native.js","sourceRoot":"","sources":["../../../../components/accordion/item/AccordionItem.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,EACL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CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,QAAQ,EAAE,CAAC,CAAC;gBACzC,CAAC,CAAC,aAAa,CAAC,YAAY,CAAC,UAAU,CAAC;YAC1C,WAAW,EAAE,CAAC;YACd,WAAW,EACT,CAAC,QAAQ,IAAI,aAAa,CAAC,YAAY,CAAC,
|
|
1
|
+
{"version":3,"file":"AccordionItem.native.js","sourceRoot":"","sources":["../../../../components/accordion/item/AccordionItem.native.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,SAAS,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAA;AAC1D,OAAO,EACL,QAAQ,EACR,MAAM,EACN,UAAU,EACV,wBAAwB,EACxB,IAAI,GACL,MAAM,cAAc,CAAA;AAErB,OAAO,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,+BAA+B,CAAA;AAC3E,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAA;AACvD,OAAO,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAClD,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,cAAc,CAAA;AACjD,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAA;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAA;AAOzD;;;;;;;;;GASG;AACH,MAAM,aAAa,GAAG,CAAC,EACrB,MAAM,EACN,EAAE,EACF,OAAO,EACP,QAAQ,EACR,MAAM,EACN,OAAO,EACP,QAAQ,EACR,GAAG,MAAM,EACU,EAAe,EAAE;IACpC,MAAM,CAAC,QAAQ,EAAE,WAAW,CAAC,GAAG,QAAQ,CACtC,OAAO,CAAC,OAAO,MAAM,KAAK,WAAW,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CACxD,CAAA;IACD,MAAM,kBAAkB,GAAG,MAAM,CAAC,IAAI,QAAQ,CAAC,KAAK,CAAC,CAAC,CAAC,CAA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|
5
5
|
AccordionBody = "AccordionBody",
|
|
6
6
|
AutoLayout = "AutoLayout",
|
|
7
7
|
AutoLayoutWrapper = "AutoLayoutWrapper",
|
|
8
|
-
AutoComplete = "AutoComplete",
|
|
9
|
-
AutoCompleteItem = "AutoCompleteItem",
|
|
10
|
-
AutoCompleteItemNative = "AutoCompleteItemNative",
|
|
11
|
-
AutoCompleteMenuNative = "AutoCompleteMenuNative",
|
|
12
|
-
AutoCompleteMenu = "AutoCompleteMenu",
|
|
13
8
|
AlertState = "AlertState",
|
|
14
9
|
Badge = "Badge",
|
|
15
10
|
BadgeTextDirection = "BadgeTextDirection",
|
|
@@ -6,11 +6,6 @@ export var ComponentName;
|
|
|
6
6
|
ComponentName["AccordionBody"] = "AccordionBody";
|
|
7
7
|
ComponentName["AutoLayout"] = "AutoLayout";
|
|
8
8
|
ComponentName["AutoLayoutWrapper"] = "AutoLayoutWrapper";
|
|
9
|
-
ComponentName["AutoComplete"] = "AutoComplete";
|
|
10
|
-
ComponentName["AutoCompleteItem"] = "AutoCompleteItem";
|
|
11
|
-
ComponentName["AutoCompleteItemNative"] = "AutoCompleteItemNative";
|
|
12
|
-
ComponentName["AutoCompleteMenuNative"] = "AutoCompleteMenuNative";
|
|
13
|
-
ComponentName["AutoCompleteMenu"] = "AutoCompleteMenu";
|
|
14
9
|
ComponentName["AlertState"] = "AlertState";
|
|
15
10
|
ComponentName["Badge"] = "Badge";
|
|
16
11
|
ComponentName["BadgeTextDirection"] = "BadgeTextDirection";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enumsComponentsName.js","sourceRoot":"","sources":["../../components/enumsComponentsName.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,
|
|
1
|
+
{"version":3,"file":"enumsComponentsName.js","sourceRoot":"","sources":["../../components/enumsComponentsName.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,aA4JX;AA5JD,WAAY,aAAa;IACvB,wCAAuB,CAAA;IACvB,gDAA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A;IACf,wCAAuB,CAAA;IACvB,wCAAuB,CAAA;IACvB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;IACb,sCAAqB,CAAA;IACrB,4BAAW,CAAA;IACX,0CAAyB,CAAA;IACzB,oCAAmB,CAAA;IACnB,8BAAa,CAAA;IACb,sCAAqB,CAAA;IACrB,0CAAyB,CAAA;IACzB,0CAAyB,CAAA;IACzB,kDAAiC,CAAA;IACjC,sCAAqB,CAAA;IACrB,sCAAqB,CAAA;IACrB,8CAA6B,CAAA;IAC7B,oDAAmC,CAAA;IACnC,kDAAiC,CAAA;IACjC,gCAAe,CAAA;IACf,oDAAmC,CAAA;IACnC,8CAA6B,CAAA;IAC7B,4CAA2B,CAAA;IAC3B,8CAA6B,CAAA;IAC7B,8BAAa,CAAA;IACb,0CAAyB,CAAA;IACzB,kDAAiC,CAAA;IACjC,0DAAyC,CAAA;IACzC,gCAAe,CAAA;IACf,gCAAe,CAAA;IACf,wCAAuB,CAAA;IACvB,gCAAe,CAAA;AACjB,CAAC,EA5JW,aAAa,KAAb,aAAa,QA4JxB"}
|
package/lib/components/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../components/index.ts"],"names":[],"mappings":"AAAA,qBAAqB;AACrB,cAAc,aAAa,CAAA;AAC3B,cAAc,SAAS,CAAA;AACvB,cAAc,cAAc,CAAA;AAC5B,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,UAAU,CAAA;AACxB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,WAAW,CAAA;AACzB,cAAc,aAAa,CAAA;AAC3B,cAAc,aAAa,CAAA;AAC3B,cAAc,WAAW,CAAA;AACzB,cAAc,YAAY,CAAA;AAC1B,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,QAAQ,CAAA;AACtB,cAAc,SAAS,CAAA;AACvB,cAAc,OAAO,CAAA;AACrB,cAAc,cAAc,CAAA;AAC5B,cAAc,WAAW,CAAA;AACzB,cAAc,SAAS,CAAA;AACvB,cAAc,gBAAgB,CAAA;AAC9B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,eAAe,CAAA;AAC7B,cAAc,WAAW,CAAA;AACzB,cAAc,mBAAmB,CAAA;AACjC,cAAc,UAAU,CAAA;AACxB,cAAc,YAAY,CAAA;AAC1B,cAAc,UAAU,CAAA;AACxB,cAAc,WAAW,CAAA;AACzB,cAAc,WAAW,CAAA;AACzB,cAAc,UAAU,CAAA;AACxB,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA;AACtB,cAAc,OAAO,CAAA;AACrB,cAAc,QAAQ,CAAA;AACtB,cAAc,YAAY,CAAA;AAC1B,cAAc,YAAY,CAAA;AAC1B,cAAc,SAAS,CAAA;AACvB,cAAc,QAAQ,CAAA"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import { InputProps, InputWebEvents } from
|
|
3
|
-
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { InputProps, InputWebEvents } from './InputProps';
|
|
3
|
+
import { AutoCompleteProps, Item } from './autocomplete';
|
|
4
|
+
export interface InputProp extends InputProps, InputWebEvents {
|
|
4
5
|
}
|
|
5
6
|
/**
|
|
6
7
|
* Input Component
|
|
@@ -49,5 +50,28 @@ interface InputProp extends InputProps, InputWebEvents {
|
|
|
49
50
|
* - -------------------------- NATIVE PROPERTIES -------------------------------
|
|
50
51
|
* @param autoCompleteType {InputAutoCompleteType} Auto complete input type
|
|
51
52
|
*/
|
|
52
|
-
declare const Input:
|
|
53
|
+
declare const Input: {
|
|
54
|
+
({ forceControl, className, disabled, onChange, onKeyPress, onKeyUp, onIconClick, onClick, onFocus, onBlur, patternValidator, onMouseEnter, onMouseLeave, name, placeholder, type, defaultValue, value, loading, hovered, focused, hasIcon, customIcon, status, help, iconClassname, search, reference, onStatusChange, customValidator, onSubmit, minLength, maxLength, testId, accessibilityLabel, autoCompleteType, customIconLeft, customIconRight, securityGauge, validationRules, required, ...others }: InputProp): JSX.Element;
|
|
55
|
+
/**
|
|
56
|
+
* AutoComplete Component
|
|
57
|
+
* @param placeholder {string} placeholder for input
|
|
58
|
+
* @param defaultValue {string} Default Value for Input
|
|
59
|
+
* @param data {string[]} Datas AutoComplete list Item
|
|
60
|
+
* @param value {string} Value of Input
|
|
61
|
+
* @param onChange {Function} OnChange Input Event
|
|
62
|
+
* @param onFocus {Function} OnFocus Input Event
|
|
63
|
+
* @param children {Function} Custom Component for dropdown list
|
|
64
|
+
* @param displayMenu {boolean} Display Autocomplete Menu (default: true)
|
|
65
|
+
* @param matching {Function} matching function
|
|
66
|
+
* - ------------------ WEB PROPERTIES -----------------------
|
|
67
|
+
* @param classNameMenu {string} Additionnal CSS Classes for Menu
|
|
68
|
+
* @param absoluteMenu {boolean} Absolute position for Menu
|
|
69
|
+
* @param fullwidthMenu {boolean} Fullwidth size for Menu
|
|
70
|
+
* @param className {string} Additionnal CSS Classes
|
|
71
|
+
* @param onItemSelected {Function} OnSelectedItemList event
|
|
72
|
+
* @param customIcon {string} Additional icon classes
|
|
73
|
+
* @param debounceSuggestionsTimeout {number} Timeout for getSuggestions debounce
|
|
74
|
+
*/
|
|
75
|
+
AutoComplete<T extends string | Item<unknown> = string>(props: AutoCompleteProps<T>): React.JSX.Element;
|
|
76
|
+
};
|
|
53
77
|
export default Input;
|
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
1
|
+
import clsx from 'clsx';
|
|
2
|
+
import React, { useCallback, useEffect, useState } from 'react';
|
|
3
|
+
import { useTrilogyContext } from '../../context';
|
|
4
|
+
import { hashClass } from '../../helpers';
|
|
5
|
+
import { has, is } from '../../services';
|
|
6
|
+
import { Icon, IconColor, IconName, IconSize } from '../icon';
|
|
7
|
+
import { Text } from '../text';
|
|
8
|
+
import { InputStatus, InputType } from './InputEnum';
|
|
9
|
+
import { AutoComplete } from './autocomplete';
|
|
10
|
+
import InputGauge from './gauge/InputGauge';
|
|
10
11
|
/**
|
|
11
12
|
* Input Component
|
|
12
13
|
* @param name {string} Input name
|
|
@@ -54,170 +55,77 @@ import { getColorStyle, TrilogyColor } from "../../objects";
|
|
|
54
55
|
* - -------------------------- NATIVE PROPERTIES -------------------------------
|
|
55
56
|
* @param autoCompleteType {InputAutoCompleteType} Auto complete input type
|
|
56
57
|
*/
|
|
57
|
-
const Input = ({ forceControl, className, disabled, onChange, onKeyPress, onKeyUp, onIconClick, onClick, onFocus, onBlur, patternValidator, onMouseEnter, onMouseLeave, name, placeholder, type =
|
|
58
|
+
const Input = ({ forceControl, className, disabled, onChange, onKeyPress, onKeyUp, onIconClick, onClick, onFocus, onBlur, patternValidator, onMouseEnter, onMouseLeave, name, placeholder, type = 'text', defaultValue, value, loading, hovered, focused, hasIcon, customIcon, status, help, iconClassname, search = false, reference, onStatusChange, customValidator, onSubmit, minLength, maxLength, testId, accessibilityLabel, autoCompleteType, customIconLeft, customIconRight, securityGauge, validationRules, required, ...others }) => {
|
|
58
59
|
const { styled } = useTrilogyContext();
|
|
59
|
-
const
|
|
60
|
-
const
|
|
60
|
+
const hasPlaceholder = placeholder !== undefined && placeholder.length > 0;
|
|
61
|
+
const inputIcon = new Map();
|
|
62
|
+
inputIcon.set(InputStatus.SUCCESS, IconName.CHECK_CIRCLE);
|
|
63
|
+
inputIcon.set(InputStatus.WARNING, IconName.EXCLAMATION_CIRCLE);
|
|
64
|
+
inputIcon.set(InputStatus.ERROR, IconName.EXCLAMATION_CIRCLE);
|
|
65
|
+
const [_value, setValue] = useState(defaultValue !== null && defaultValue !== void 0 ? defaultValue : '');
|
|
61
66
|
const [isFocused, setIsFocused] = useState(focused !== null && focused !== void 0 ? focused : false);
|
|
62
67
|
const [isDirty, setIsDirty] = useState(false);
|
|
63
68
|
const [isTouched, setIsTouched] = useState(false);
|
|
64
69
|
const [localStatus, setLocalStatus] = useState(status || InputStatus.DEFAULT);
|
|
70
|
+
const [inputType, setInputType] = useState(type);
|
|
71
|
+
const [isShowPwd, setIsShowPwd] = useState(false);
|
|
72
|
+
const helpClasses = clsx('help', localStatus && is(localStatus));
|
|
73
|
+
const classes = hashClass(styled, clsx('input', localStatus && is(localStatus)));
|
|
74
|
+
const wrapperClasses = hashClass(styled, clsx('field', className, type === 'password' && securityGauge && 'has-gauge'));
|
|
75
|
+
const controlClasses = hashClass(styled, clsx('control', hasPlaceholder && !search && has('dynamic-placeholder'), {
|
|
76
|
+
[has('icons-right')]: hasIcon !== null && hasIcon !== void 0 ? hasIcon : (customIcon || customIconRight || type === 'password'),
|
|
77
|
+
['has-icons-left']: customIconLeft || search,
|
|
78
|
+
}));
|
|
79
|
+
const onPressKey = useCallback((e) => {
|
|
80
|
+
const target = e.target;
|
|
81
|
+
return {
|
|
82
|
+
inputName: target.name,
|
|
83
|
+
inputValue: target.value,
|
|
84
|
+
inputKeyCode: e.keyCode,
|
|
85
|
+
preventDefault: () => e.preventDefault(),
|
|
86
|
+
};
|
|
87
|
+
}, []);
|
|
88
|
+
const IconWrapper = useCallback(({ className, name, color, closeIconSearch, onPress }) => {
|
|
89
|
+
return (React.createElement("div", { "data-show-pwd": true, onClick: () => {
|
|
90
|
+
onPress && onPress();
|
|
91
|
+
if (onIconClick) {
|
|
92
|
+
onIconClick({ inputName: name !== null && name !== void 0 ? name : '', inputValue: _value });
|
|
93
|
+
}
|
|
94
|
+
} },
|
|
95
|
+
React.createElement(Icon, { className: className, name: name, size: IconSize.SMALL, color: color }),
|
|
96
|
+
_value && _value.length > 0 && closeIconSearch && (React.createElement(Icon, { onClick: () => setValue(''), className: hashClass(styled, clsx(is('justified-self'))), name: IconName.TIMES_CIRCLE, size: IconSize.SMALL }))));
|
|
97
|
+
}, [_value, styled]);
|
|
65
98
|
const validator = !customValidator && patternValidator
|
|
66
99
|
? (value) => (patternValidator.test(value) ? InputStatus.SUCCESS : InputStatus.ERROR)
|
|
67
100
|
: customValidator;
|
|
68
|
-
const [inputType, setInputType] = useState(type);
|
|
69
|
-
const [isShowPwd, setIsShowPwd] = useState(false);
|
|
70
101
|
useEffect(() => {
|
|
71
102
|
var _a;
|
|
72
|
-
setValue((_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a :
|
|
103
|
+
setValue((_a = value !== null && value !== void 0 ? value : defaultValue) !== null && _a !== void 0 ? _a : '');
|
|
73
104
|
}, [value, defaultValue]);
|
|
74
|
-
useEffect(() => {
|
|
75
|
-
setIsHovered(hovered !== null && hovered !== void 0 ? hovered : false);
|
|
76
|
-
}, [hovered]);
|
|
77
105
|
useEffect(() => {
|
|
78
106
|
setIsFocused(focused !== null && focused !== void 0 ? focused : false);
|
|
79
107
|
}, [focused]);
|
|
80
108
|
useEffect(() => {
|
|
81
|
-
if (isFocused)
|
|
109
|
+
if (isFocused)
|
|
82
110
|
setIsDirty(true);
|
|
83
|
-
|
|
84
|
-
else if (isDirty) {
|
|
111
|
+
else if (isDirty)
|
|
85
112
|
setIsTouched(true);
|
|
86
|
-
}
|
|
87
113
|
}, [isFocused, isDirty]);
|
|
88
114
|
useEffect(() => {
|
|
89
|
-
if (!validator || !isTouched)
|
|
115
|
+
if (!validator || !isTouched)
|
|
90
116
|
return;
|
|
91
|
-
}
|
|
92
117
|
setLocalStatus(validator(_value));
|
|
93
118
|
}, [isFocused, isTouched]);
|
|
94
119
|
useEffect(() => {
|
|
95
120
|
setLocalStatus(status || InputStatus.DEFAULT);
|
|
96
121
|
}, [status]);
|
|
97
122
|
useEffect(() => {
|
|
98
|
-
if (onStatusChange)
|
|
123
|
+
if (onStatusChange)
|
|
99
124
|
onStatusChange(localStatus);
|
|
100
|
-
}
|
|
101
125
|
}, [localStatus]);
|
|
102
|
-
const inputIcon = new Map();
|
|
103
|
-
inputIcon.set(InputStatus.SUCCESS, IconName.CHECK_CIRCLE);
|
|
104
|
-
inputIcon.set(InputStatus.WARNING, IconName.EXCLAMATION_CIRCLE);
|
|
105
|
-
inputIcon.set(InputStatus.ERROR, IconName.EXCLAMATION_CIRCLE);
|
|
106
|
-
const wrapperClasses = hashClass(styled, clsx("field", className, type === "password" && securityGauge && "has-gauge"));
|
|
107
|
-
const hasPlaceholder = placeholder !== undefined && placeholder.length > 0;
|
|
108
|
-
const iconTimesClasse = hashClass(styled, clsx("tri-times"));
|
|
109
|
-
const iconCheckClasse = hashClass(styled, clsx("tri-check-circle"));
|
|
110
|
-
const successClasse = hashClass(styled, clsx("is-success"));
|
|
111
|
-
const iconClasse = hashClass(styled, clsx("icon"));
|
|
112
|
-
const controlClasses = hashClass(styled, clsx("control", hasPlaceholder && !search && has("dynamic-placeholder"), {
|
|
113
|
-
[has("icons-right")]: hasIcon !== null && hasIcon !== void 0 ? hasIcon : (customIcon || customIconRight || type === "password"),
|
|
114
|
-
["has-icons-left"]: customIconLeft || search,
|
|
115
|
-
}));
|
|
116
|
-
const classes = hashClass(styled, clsx("input", localStatus && is(localStatus)));
|
|
117
|
-
const helpClasses = clsx("help", localStatus && is(localStatus));
|
|
118
|
-
const refLengthVerify = React.useRef(null);
|
|
119
|
-
const refSpecialCharsVerify = React.useRef(null);
|
|
120
|
-
const refNumberVerify = React.useRef(null);
|
|
121
|
-
const refUppercaseVerify = React.useRef(null);
|
|
122
|
-
const refLowerercaseVerify = React.useRef(null);
|
|
123
|
-
const [points, setPoints] = React.useState(0);
|
|
124
|
-
const [nbAllVerifies, setNbAllVerifies] = React.useState(0);
|
|
125
|
-
const [verifies, setVerifies] = React.useState({});
|
|
126
|
-
const lengthVerify = {
|
|
127
|
-
fn: (e) => {
|
|
128
|
-
var _a, _b, _c, _d;
|
|
129
|
-
if (((_a = validationRules === null || validationRules === void 0 ? void 0 : validationRules.length) === null || _a === void 0 ? void 0 : _a.max) && !validationRules.length.min) {
|
|
130
|
-
return e.length > 0 && e.length <= validationRules.length.max;
|
|
131
|
-
}
|
|
132
|
-
if (((_b = validationRules === null || validationRules === void 0 ? void 0 : validationRules.length) === null || _b === void 0 ? void 0 : _b.min) && !((_c = validationRules === null || validationRules === void 0 ? void 0 : validationRules.length) === null || _c === void 0 ? void 0 : _c.max)) {
|
|
133
|
-
return e.length >= validationRules.length.min;
|
|
134
|
-
}
|
|
135
|
-
if (((_d = validationRules === null || validationRules === void 0 ? void 0 : validationRules.length) === null || _d === void 0 ? void 0 : _d.max) && validationRules.length.min) {
|
|
136
|
-
return (e.length >= validationRules.length.min &&
|
|
137
|
-
e.length <= validationRules.length.max);
|
|
138
|
-
}
|
|
139
|
-
return false;
|
|
140
|
-
},
|
|
141
|
-
ref: refLengthVerify,
|
|
142
|
-
};
|
|
143
|
-
const specialCharsverify = {
|
|
144
|
-
// eslint-disable-next-line
|
|
145
|
-
fn: (e) => /[^\w\*]/.test(e),
|
|
146
|
-
ref: refSpecialCharsVerify,
|
|
147
|
-
};
|
|
148
|
-
const numberVerify = {
|
|
149
|
-
// eslint-disable-next-line
|
|
150
|
-
fn: (e) => /[0-9]/.test(e),
|
|
151
|
-
ref: refNumberVerify,
|
|
152
|
-
};
|
|
153
|
-
const uppercaseVerify = {
|
|
154
|
-
// eslint-disable-next-line
|
|
155
|
-
fn: (e) => /[A-Z]/.test(e),
|
|
156
|
-
ref: refUppercaseVerify,
|
|
157
|
-
};
|
|
158
|
-
const lowercaseVerify = {
|
|
159
|
-
// eslint-disable-next-line
|
|
160
|
-
fn: (e) => /[a-z]/.test(e),
|
|
161
|
-
ref: refLowerercaseVerify,
|
|
162
|
-
};
|
|
163
|
-
React.useEffect(() => {
|
|
164
|
-
const data = {};
|
|
165
|
-
validationRules &&
|
|
166
|
-
Object.keys(validationRules).map((key) => {
|
|
167
|
-
if (key === "number")
|
|
168
|
-
Object.assign(data, { numberVerify });
|
|
169
|
-
if (key === "length")
|
|
170
|
-
Object.assign(data, { lengthVerify });
|
|
171
|
-
if (key === "lowercase")
|
|
172
|
-
Object.assign(data, { lowercaseVerify });
|
|
173
|
-
if (key === "uppercase")
|
|
174
|
-
Object.assign(data, { uppercaseVerify });
|
|
175
|
-
if (key === "specialChars")
|
|
176
|
-
Object.assign(data, { specialCharsverify });
|
|
177
|
-
});
|
|
178
|
-
setVerifies(data);
|
|
179
|
-
setNbAllVerifies(Object.keys(data).length);
|
|
180
|
-
}, [validationRules]);
|
|
181
|
-
const handleVerifyPwd = (e) => {
|
|
182
|
-
const verifiesTests = [];
|
|
183
|
-
Object.keys(verifies).map((key) => {
|
|
184
|
-
var _a, _b, _c, _d;
|
|
185
|
-
const test = verifies[key].fn(e);
|
|
186
|
-
verifiesTests.push(test);
|
|
187
|
-
if (test) {
|
|
188
|
-
(_a = verifies[key].ref.current) === null || _a === void 0 ? void 0 : _a.classList.remove(iconTimesClasse);
|
|
189
|
-
(_b = verifies[key].ref.current) === null || _b === void 0 ? void 0 : _b.classList.add(iconCheckClasse, successClasse);
|
|
190
|
-
}
|
|
191
|
-
else {
|
|
192
|
-
(_c = verifies[key].ref.current) === null || _c === void 0 ? void 0 : _c.classList.remove(iconCheckClasse, successClasse);
|
|
193
|
-
(_d = verifies[key].ref.current) === null || _d === void 0 ? void 0 : _d.classList.add(iconTimesClasse);
|
|
194
|
-
}
|
|
195
|
-
});
|
|
196
|
-
setPoints(verifiesTests.filter((item) => item).length);
|
|
197
|
-
};
|
|
198
|
-
const widthGauge = React.useMemo(() => {
|
|
199
|
-
const calc = Number(((points / nbAllVerifies) * 100).toFixed(0));
|
|
200
|
-
if (calc <= 50 && calc > 0)
|
|
201
|
-
return "50%";
|
|
202
|
-
if (calc <= 99 && calc > 50)
|
|
203
|
-
return "75%";
|
|
204
|
-
if (calc === 100)
|
|
205
|
-
return "100%";
|
|
206
|
-
return "0%";
|
|
207
|
-
}, [points, nbAllVerifies]);
|
|
208
|
-
const colorGauge = React.useMemo(() => {
|
|
209
|
-
const calc = Number(((points / nbAllVerifies) * 100).toFixed(0));
|
|
210
|
-
if (calc <= 50 && calc > 0)
|
|
211
|
-
return getColorStyle(TrilogyColor.ERROR);
|
|
212
|
-
if (calc <= 99 && calc > 50)
|
|
213
|
-
return getColorStyle(TrilogyColor.WARNING);
|
|
214
|
-
if (calc === 100)
|
|
215
|
-
return getColorStyle(TrilogyColor.SUCCESS);
|
|
216
|
-
return getColorStyle(TrilogyColor.NEUTRAL_LIGHT);
|
|
217
|
-
}, [points, nbAllVerifies]);
|
|
218
126
|
return (React.createElement("div", { className: wrapperClasses, "data-has-gauge": securityGauge ? true : undefined },
|
|
219
127
|
React.createElement("div", { className: controlClasses },
|
|
220
|
-
React.createElement("input", { required: required, role:
|
|
128
|
+
React.createElement("input", { required: required, role: 'textbox', ...others, "data-testid": testId, "aria-label": accessibilityLabel, type: inputType, className: classes, value: _value, defaultValue: defaultValue, name: name, onSubmit: onSubmit, ref: reference, disabled: disabled, minLength: minLength, maxLength: maxLength, autoComplete: autoCompleteType, onKeyUp: (e) => onKeyUp && onKeyUp(onPressKey(e)), onKeyPress: (e) => onKeyPress && onKeyPress(onPressKey(e)), onMouseEnter: (e) => onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e), onMouseLeave: (e) => onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e), placeholder: placeholder, onClick: (e) => {
|
|
221
129
|
const target = e.target;
|
|
222
130
|
if (onClick) {
|
|
223
131
|
onClick({
|
|
@@ -225,26 +133,6 @@ const Input = ({ forceControl, className, disabled, onChange, onKeyPress, onKeyU
|
|
|
225
133
|
inputValue: target.value,
|
|
226
134
|
});
|
|
227
135
|
}
|
|
228
|
-
}, onKeyUp: (e) => {
|
|
229
|
-
const target = e.target;
|
|
230
|
-
if (onKeyUp) {
|
|
231
|
-
onKeyUp({
|
|
232
|
-
inputName: target.name,
|
|
233
|
-
inputValue: target.value,
|
|
234
|
-
inputKeyCode: e.keyCode,
|
|
235
|
-
preventDefault: () => e.preventDefault()
|
|
236
|
-
});
|
|
237
|
-
}
|
|
238
|
-
}, onKeyPress: (e) => {
|
|
239
|
-
const target = e.target;
|
|
240
|
-
if (onKeyPress) {
|
|
241
|
-
onKeyPress({
|
|
242
|
-
inputName: target.name,
|
|
243
|
-
inputValue: target.value,
|
|
244
|
-
inputKeyCode: e.keyCode,
|
|
245
|
-
preventDefault: () => e.preventDefault()
|
|
246
|
-
});
|
|
247
|
-
}
|
|
248
136
|
}, onChange: (e) => {
|
|
249
137
|
// --- solution to prevent cursor jump ---
|
|
250
138
|
if (inputType !== InputType.DATE &&
|
|
@@ -269,116 +157,58 @@ const Input = ({ forceControl, className, disabled, onChange, onKeyPress, onKeyU
|
|
|
269
157
|
inputSelectionStart: e.target.selectionStart,
|
|
270
158
|
});
|
|
271
159
|
}
|
|
272
|
-
if (type === "password" && securityGauge) {
|
|
273
|
-
handleVerifyPwd(e.target.value);
|
|
274
|
-
}
|
|
275
160
|
}, onFocus: (e) => {
|
|
276
161
|
onFocus === null || onFocus === void 0 ? void 0 : onFocus(e);
|
|
277
162
|
setIsFocused(true);
|
|
278
163
|
}, onBlur: (e) => {
|
|
279
164
|
onBlur === null || onBlur === void 0 ? void 0 : onBlur(e);
|
|
280
165
|
setIsFocused(false);
|
|
281
|
-
}
|
|
282
|
-
onMouseEnter === null || onMouseEnter === void 0 ? void 0 : onMouseEnter(e);
|
|
283
|
-
setIsHovered(true);
|
|
284
|
-
}, onMouseLeave: (e) => {
|
|
285
|
-
onMouseLeave === null || onMouseLeave === void 0 ? void 0 : onMouseLeave(e);
|
|
286
|
-
setIsHovered(false);
|
|
287
|
-
}, placeholder: placeholder }),
|
|
166
|
+
} }),
|
|
288
167
|
hasPlaceholder && !search && React.createElement("label", null, placeholder),
|
|
289
|
-
hasIcon &&
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
if (
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
} },
|
|
299
|
-
React.createElement(Icon, { className: iconClassname, name: inputIcon.get(localStatus), size: IconSize.SMALL }))),
|
|
300
|
-
customIcon && !localStatus && !loading && (React.createElement("div", { onClick: () => {
|
|
301
|
-
if (onIconClick) {
|
|
302
|
-
onIconClick({ inputName: name !== null && name !== void 0 ? name : "", inputValue: _value });
|
|
303
|
-
}
|
|
304
|
-
} },
|
|
305
|
-
React.createElement(Icon, { className: iconClassname, name: customIcon, size: IconSize.SMALL }))),
|
|
306
|
-
customIconLeft && !loading && (React.createElement("div", { onClick: () => {
|
|
307
|
-
if (onIconClick) {
|
|
308
|
-
onIconClick({ inputName: name !== null && name !== void 0 ? name : "", inputValue: _value });
|
|
309
|
-
}
|
|
310
|
-
} },
|
|
311
|
-
React.createElement(Icon, { className: clsx(customIconLeft && "icon-left", iconClassname), name: customIconLeft, size: IconSize.SMALL }))),
|
|
312
|
-
customIconRight && !loading && type !== "password" && (React.createElement("div", { onClick: () => {
|
|
313
|
-
if (onIconClick) {
|
|
314
|
-
onIconClick({ inputName: name !== null && name !== void 0 ? name : "", inputValue: _value });
|
|
315
|
-
}
|
|
316
|
-
} },
|
|
317
|
-
React.createElement(Icon, { className: clsx(customIconRight && "icon-right", iconClassname), name: customIconRight, size: IconSize.SMALL }))),
|
|
318
|
-
!loading && type === "password" && (React.createElement("div", { "data-show-pwd": true, onClick: () => {
|
|
319
|
-
if (inputType === "password") {
|
|
320
|
-
setInputType("text");
|
|
168
|
+
hasIcon && localStatus && !customIcon && !loading && !customIconLeft && !customIconRight && (React.createElement(IconWrapper, { className: iconClassname, name: inputIcon.get(localStatus) })),
|
|
169
|
+
customIcon && !localStatus && !loading && React.createElement(IconWrapper, { className: iconClassname, name: customIcon }),
|
|
170
|
+
customIconLeft && !loading && (React.createElement(IconWrapper, { className: clsx(customIconLeft && 'icon-left', iconClassname), name: customIconLeft })),
|
|
171
|
+
customIconRight && !loading && type !== 'password' && (React.createElement(IconWrapper, { className: clsx(customIconRight && 'icon-right', iconClassname), name: customIconRight })),
|
|
172
|
+
!loading && type === 'password' && (React.createElement(IconWrapper, { className: clsx('icon-right', iconClassname), name: isShowPwd ? 'tri-eye-slash' : 'tri-eye', onPress: () => {
|
|
173
|
+
console.log('oui');
|
|
174
|
+
if (inputType === 'password') {
|
|
175
|
+
setInputType('text');
|
|
321
176
|
setIsShowPwd(true);
|
|
322
177
|
}
|
|
323
178
|
else {
|
|
324
|
-
setInputType(
|
|
179
|
+
setInputType('password');
|
|
325
180
|
setIsShowPwd(false);
|
|
326
181
|
}
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
React.createElement(Icon, { className: clsx("icon-right", iconClassname), name: isShowPwd ? "tri-eye-slash" : "tri-eye", size: IconSize.SMALL }))),
|
|
332
|
-
customIcon && localStatus && !loading && (React.createElement("div", { onClick: () => {
|
|
333
|
-
if (onIconClick) {
|
|
334
|
-
onIconClick({ inputName: name !== null && name !== void 0 ? name : "", inputValue: _value });
|
|
335
|
-
}
|
|
336
|
-
} },
|
|
337
|
-
React.createElement(Icon, { className: iconClassname, name: customIcon, size: IconSize.SMALL }))),
|
|
338
|
-
search && !customIcon && localStatus === "default" && !loading && (React.createElement("div", { onClick: () => {
|
|
339
|
-
if (onIconClick) {
|
|
340
|
-
onIconClick({ inputName: name !== null && name !== void 0 ? name : "", inputValue: _value });
|
|
341
|
-
}
|
|
342
|
-
} },
|
|
343
|
-
React.createElement(Icon, { color: IconColor.MAIN, className: iconClassname, name: IconName.SEARCH, size: IconSize.SMALL }),
|
|
344
|
-
_value && _value.length > 0 && (React.createElement(Icon, { onClick: () => setValue(""), className: hashClass(styled, clsx(is("justified-self"))), name: IconName.TIMES_CIRCLE, size: IconSize.SMALL })))),
|
|
345
|
-
loading && (React.createElement("span", { className: hashClass(styled, clsx(is("searching"))) }))),
|
|
182
|
+
} })),
|
|
183
|
+
customIcon && localStatus && !loading && React.createElement(IconWrapper, { className: iconClassname, name: customIcon }),
|
|
184
|
+
search && !customIcon && localStatus === 'default' && !loading && (React.createElement(IconWrapper, { color: IconColor.MAIN, className: iconClassname, name: IconName.SEARCH, closeIconSearch: true })),
|
|
185
|
+
loading && React.createElement("span", { className: hashClass(styled, clsx(is('searching'))) })),
|
|
346
186
|
help && React.createElement(Text, { className: helpClasses }, help),
|
|
347
|
-
securityGauge && type ===
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
React.createElement("span", null, "Chiffre")))),
|
|
373
|
-
React.createElement("div", null,
|
|
374
|
-
validationRules && validationRules.uppercase && (React.createElement("div", { "data-security-uppercase": true, className: hashClass(styled, clsx("security security-uppercase")) },
|
|
375
|
-
React.createElement("span", { "data-icon-securities": true, className: iconClasse },
|
|
376
|
-
React.createElement("i", { ref: refUppercaseVerify, className: iconTimesClasse })),
|
|
377
|
-
React.createElement("span", null, "Majuscule"))),
|
|
378
|
-
validationRules && validationRules.lowercase && (React.createElement("div", { "data-security-lowercase": true, className: hashClass(styled, clsx("security security-lowercase")) },
|
|
379
|
-
React.createElement("span", { "data-icon-securities": true, className: iconClasse },
|
|
380
|
-
React.createElement("i", { ref: refLowerercaseVerify, className: iconTimesClasse })),
|
|
381
|
-
React.createElement("span", null, "Minuscule")))))))));
|
|
187
|
+
securityGauge && type === 'password' && (React.createElement(InputGauge, { validationRules: validationRules, styled: styled, inputValue: _value }))));
|
|
188
|
+
};
|
|
189
|
+
/**
|
|
190
|
+
* AutoComplete Component
|
|
191
|
+
* @param placeholder {string} placeholder for input
|
|
192
|
+
* @param defaultValue {string} Default Value for Input
|
|
193
|
+
* @param data {string[]} Datas AutoComplete list Item
|
|
194
|
+
* @param value {string} Value of Input
|
|
195
|
+
* @param onChange {Function} OnChange Input Event
|
|
196
|
+
* @param onFocus {Function} OnFocus Input Event
|
|
197
|
+
* @param children {Function} Custom Component for dropdown list
|
|
198
|
+
* @param displayMenu {boolean} Display Autocomplete Menu (default: true)
|
|
199
|
+
* @param matching {Function} matching function
|
|
200
|
+
* - ------------------ WEB PROPERTIES -----------------------
|
|
201
|
+
* @param classNameMenu {string} Additionnal CSS Classes for Menu
|
|
202
|
+
* @param absoluteMenu {boolean} Absolute position for Menu
|
|
203
|
+
* @param fullwidthMenu {boolean} Fullwidth size for Menu
|
|
204
|
+
* @param className {string} Additionnal CSS Classes
|
|
205
|
+
* @param onItemSelected {Function} OnSelectedItemList event
|
|
206
|
+
* @param customIcon {string} Additional icon classes
|
|
207
|
+
* @param debounceSuggestionsTimeout {number} Timeout for getSuggestions debounce
|
|
208
|
+
*/
|
|
209
|
+
Input.AutoComplete = (props) => {
|
|
210
|
+
const newProps = { ...props, Input };
|
|
211
|
+
return React.createElement(AutoComplete, { ...newProps });
|
|
382
212
|
};
|
|
383
213
|
export default Input;
|
|
384
214
|
//# sourceMappingURL=Input.js.map
|