@rolster/react-components 18.15.13 → 18.15.20
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/dist/cjs/index.js +78 -84
- package/dist/cjs/index.js.map +1 -1
- package/dist/es/index.js +78 -84
- package/dist/es/index.js.map +1 -1
- package/dist/esm/components/atoms/Input/Input.d.ts +2 -2
- package/dist/esm/components/atoms/Input/Input.js +1 -1
- package/dist/esm/components/atoms/Input/Input.js.map +1 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.d.ts +3 -8
- package/dist/esm/components/atoms/InputMoney/InputMoney.js +1 -1
- package/dist/esm/components/atoms/InputMoney/InputMoney.js.map +1 -1
- package/dist/esm/components/atoms/InputNumber/InputNumber.d.ts +2 -10
- package/dist/esm/components/atoms/InputNumber/InputNumber.js +1 -1
- package/dist/esm/components/atoms/InputNumber/InputNumber.js.map +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.d.ts +4 -4
- package/dist/esm/components/atoms/InputPassword/InputPassword.js +1 -1
- package/dist/esm/components/atoms/InputPassword/InputPassword.js.map +1 -1
- package/dist/esm/components/atoms/InputSearch/InputSearch.d.ts +3 -3
- package/dist/esm/components/atoms/InputSearch/InputSearch.js +1 -1
- package/dist/esm/components/atoms/InputSearch/InputSearch.js.map +1 -1
- package/dist/esm/components/atoms/InputText/InputText.d.ts +2 -10
- package/dist/esm/components/atoms/InputText/InputText.js +2 -2
- package/dist/esm/components/atoms/InputText/InputText.js.map +1 -1
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.d.ts +3 -9
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js +2 -2
- package/dist/esm/components/molecules/FieldMoney/FieldMoney.js.map +1 -1
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.d.ts +2 -11
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js +2 -2
- package/dist/esm/components/molecules/FieldNumber/FieldNumber.js.map +1 -1
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.d.ts +4 -3
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js +2 -2
- package/dist/esm/components/molecules/FieldPassword/FieldPassword.js.map +1 -1
- package/dist/esm/components/molecules/FieldText/FieldText.d.ts +2 -11
- package/dist/esm/components/molecules/FieldText/FieldText.js +2 -2
- package/dist/esm/components/molecules/FieldText/FieldText.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.d.ts +2 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js +7 -11
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocomplete.js.map +1 -1
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteHook.js +10 -11
- package/dist/esm/components/organisms/FieldAutocomplete/FieldAutocompleteHook.js.map +1 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.d.ts +2 -1
- package/dist/esm/components/organisms/FieldDate/FieldDate.js +2 -2
- package/dist/esm/components/organisms/FieldDate/FieldDate.js.map +1 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.d.ts +2 -1
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js +2 -2
- package/dist/esm/components/organisms/FieldDateRange/FieldDateRange.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.d.ts +3 -2
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js +12 -13
- package/dist/esm/components/organisms/FieldSelect/FieldSelect.js.map +1 -1
- package/dist/esm/components/organisms/FieldSelect/FieldSelectHook.js +11 -11
- package/dist/esm/components/organisms/FieldSelect/FieldSelectHook.js.map +1 -1
- package/dist/esm/components/types.d.ts +13 -0
- package/dist/esm/components/types.js +2 -0
- package/dist/esm/components/types.js.map +1 -0
- package/dist/esm/hooks/ListControlHook.d.ts +2 -4
- package/dist/esm/hooks/ListControlHook.js +19 -19
- package/dist/esm/hooks/ListControlHook.js.map +1 -1
- package/package.json +2 -2
|
@@ -5,10 +5,10 @@ import './Input.css';
|
|
|
5
5
|
interface InputProps extends RlsComponent {
|
|
6
6
|
disabled?: boolean;
|
|
7
7
|
formControl?: ReactControl<HTMLInputElement>;
|
|
8
|
+
onValue?: (value: any) => void;
|
|
8
9
|
placeholder?: string;
|
|
9
10
|
type?: HTMLInputTypeAttribute;
|
|
10
11
|
value?: any;
|
|
11
|
-
onValue?: (value: any) => void;
|
|
12
12
|
}
|
|
13
|
-
export declare function RlsInput({ children, disabled, formControl, placeholder, type, value
|
|
13
|
+
export declare function RlsInput({ children, disabled, formControl, onValue, placeholder, type, value }: InputProps): import("react/jsx-runtime").JSX.Element;
|
|
14
14
|
export {};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { renderClassStatus } from '../../../helpers/css';
|
|
4
4
|
import './Input.css';
|
|
5
|
-
export function RlsInput({ children, disabled, formControl, placeholder, type, value
|
|
5
|
+
export function RlsInput({ children, disabled, formControl, onValue, placeholder, type, value }) {
|
|
6
6
|
const [focused, setFocused] = useState(false);
|
|
7
7
|
function setValue(value) {
|
|
8
8
|
formControl?.setValue(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../../src/components/atoms/Input/Input.tsx"],"names":[],"mappings":";AACA,OAAO,EAA0B,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAEzD,OAAO,aAAa,CAAC;AAWrB,MAAM,UAAU,QAAQ,CAAC,EACvB,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,WAAW,EACX,IAAI,EACJ,KAAK,
|
|
1
|
+
{"version":3,"file":"Input.js","sourceRoot":"","sources":["../../../../../src/components/atoms/Input/Input.tsx"],"names":[],"mappings":";AACA,OAAO,EAA0B,QAAQ,EAAE,MAAM,OAAO,CAAC;AACzD,OAAO,EAAE,iBAAiB,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E,QAAQ,EAClB,KAAK,EAAE,WAAW,EAAE,KAAK,IAAI,KAAK,IAAI,EAAE,GACxC,EACF,eAAM,SAAS,EAAC,kBAAkB,YAAE,QAAQ,GAAQ,IAChD,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputProps } from '../../types';
|
|
2
2
|
import './InputMoney.css';
|
|
3
|
-
interface InputMoneyProps {
|
|
3
|
+
interface InputMoneyProps extends InputProps<number> {
|
|
4
4
|
decimals?: boolean;
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
formControl?: ReactControl<HTMLInputElement, number>;
|
|
7
|
-
placeholder?: string;
|
|
8
5
|
symbol?: string;
|
|
9
|
-
value?: number;
|
|
10
|
-
onValue?: (value: number) => void;
|
|
11
6
|
}
|
|
12
|
-
export declare function RlsInputMoney({ decimals, disabled, formControl, placeholder, symbol, value
|
|
7
|
+
export declare function RlsInputMoney({ decimals, disabled, formControl, onValue, placeholder, symbol, value }: InputMoneyProps): import("react/jsx-runtime").JSX.Element;
|
|
13
8
|
export {};
|
|
@@ -3,7 +3,7 @@ import { useState } from 'react';
|
|
|
3
3
|
import { RlsAmount } from '../Amount/Amount';
|
|
4
4
|
import { RlsInput } from '../Input/Input';
|
|
5
5
|
import './InputMoney.css';
|
|
6
|
-
export function RlsInputMoney({ decimals, disabled, formControl, placeholder, symbol, value
|
|
6
|
+
export function RlsInputMoney({ decimals, disabled, formControl, onValue, placeholder, symbol, value }) {
|
|
7
7
|
const [valueInput, setValueInput] = useState(value || 0);
|
|
8
8
|
function onChange(value) {
|
|
9
9
|
!formControl && setValueInput(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputMoney.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputMoney/InputMoney.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"InputMoney.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputMoney/InputMoney.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC7C,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,kBAAkB,CAAC;AAO1B,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,OAAO,EACP,WAAW,EACX,MAAM,EACN,KAAK,EACW;IAChB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;IAEzD,SAAS,QAAQ,CAAC,KAAa;QAC7B,CAAC,WAAW,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CACL,cAAK,SAAS,EAAC,iBAAiB,YAC9B,KAAC,QAAQ,IACP,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,QAAQ,YAEjB,KAAC,SAAS,IACR,KAAK,EAAE,WAAW,EAAE,KAAK,IAAI,KAAK,IAAI,UAAU,EAChD,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GAClB,GACO,GACP,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputProps } from '../../types';
|
|
2
2
|
import './InputNumber.css';
|
|
3
|
-
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
formControl?: ReactControl<HTMLInputElement, number>;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
value?: number;
|
|
8
|
-
onValue?: (value: number) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare function RlsInputNumber({ disabled, formControl, placeholder, value, onValue }: InputNumberProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
3
|
+
export declare function RlsInputNumber({ disabled, formControl, onValue, placeholder, value }: InputProps<number>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { RlsInput } from '../Input/Input';
|
|
4
4
|
import './InputNumber.css';
|
|
5
|
-
export function RlsInputNumber({ disabled, formControl, placeholder, value
|
|
5
|
+
export function RlsInputNumber({ disabled, formControl, onValue, placeholder, value }) {
|
|
6
6
|
const [valueInput, setValueInput] = useState(value ?? 0);
|
|
7
7
|
function onChange(value) {
|
|
8
8
|
!formControl && setValueInput(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputNumber.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputNumber/InputNumber.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"InputNumber.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputNumber/InputNumber.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,mBAAmB,CAAC;AAE3B,MAAM,UAAU,cAAc,CAAC,EAC7B,QAAQ,EACR,WAAW,EACX,OAAO,EACP,WAAW,EACX,KAAK,EACc;IACnB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,IAAI,CAAC,CAAC,CAAC;IAEzD,SAAS,QAAQ,CAAC,KAAa;QAC7B,CAAC,WAAW,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CACL,cAAK,SAAS,EAAC,kBAAkB,YAC/B,KAAC,QAAQ,IACP,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,QAAQ,EACb,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,QAAQ,YAEhB,WAAW,EAAE,KAAK,IAAI,KAAK,IAAI,UAAU,GACjC,GACP,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import { ReactControl } from '@rolster/react-forms';
|
|
2
1
|
import { RlsComponent } from '../../definitions';
|
|
2
|
+
import { RolsterControl } from '../../types';
|
|
3
3
|
import './InputPassword.css';
|
|
4
4
|
type InputPasswordType = 'password' | 'text';
|
|
5
5
|
interface InputPasswordProps extends RlsComponent {
|
|
6
6
|
disabled?: boolean;
|
|
7
|
-
formControl?:
|
|
7
|
+
formControl?: RolsterControl<string>;
|
|
8
|
+
onValue?: (value: string) => void;
|
|
8
9
|
placeholder?: string;
|
|
9
10
|
type?: InputPasswordType;
|
|
10
|
-
onValue?: (value: string) => void;
|
|
11
11
|
}
|
|
12
|
-
export declare function RlsInputPassword({ disabled, formControl, placeholder, type
|
|
12
|
+
export declare function RlsInputPassword({ disabled, formControl, onValue, placeholder, type }: InputPasswordProps): import("react/jsx-runtime").JSX.Element;
|
|
13
13
|
export {};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { renderClassStatus } from '../../../helpers/css';
|
|
4
4
|
import './InputPassword.css';
|
|
5
|
-
export function RlsInputPassword({ disabled, formControl, placeholder, type
|
|
5
|
+
export function RlsInputPassword({ disabled, formControl, onValue, placeholder, type }) {
|
|
6
6
|
const [focused, setFocused] = useState(false);
|
|
7
7
|
function onChange(event) {
|
|
8
8
|
formControl?.setValue(event.target.value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputPassword.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputPassword/InputPassword.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"InputPassword.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputPassword/InputPassword.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAGzD,OAAO,qBAAqB,CAAC;AAY7B,MAAM,UAAU,gBAAgB,CAAC,EAC/B,QAAQ,EACR,WAAW,EACX,OAAO,EACP,WAAW,EACX,IAAI,EACe;IACnB,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,KAAK,CAAC,CAAC;IAE9C,SAAS,QAAQ,CAAC,KAAU;QAC1B,WAAW,EAAE,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC1C,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACzC,CAAC;IAED,SAAS,OAAO;QACd,WAAW,EAAE,KAAK,EAAE,CAAC;QACrB,UAAU,CAAC,IAAI,CAAC,CAAC;IACnB,CAAC;IAED,SAAS,MAAM;QACb,WAAW,EAAE,IAAI,EAAE,CAAC;QACpB,UAAU,CAAC,KAAK,CAAC,CAAC;IACpB,CAAC;IAED,OAAO,CACL,cACE,SAAS,EAAE,iBAAiB,CAAC,oBAAoB,EAAE;YACjD,OAAO,EAAE,WAAW,EAAE,OAAO,IAAI,OAAO;YACxC,QAAQ;SACT,CAAC,YAEF,gBACE,SAAS,EAAC,+BAA+B,EACzC,YAAY,EAAC,KAAK,EAClB,IAAI,EAAE,IAAI,IAAI,UAAU,EACxB,WAAW,EAAE,WAAW,EACxB,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,EAChB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,GAClB,GACE,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { RolsterControl } from '../../types';
|
|
2
2
|
import './InputSearch.css';
|
|
3
3
|
interface InputSearchProps {
|
|
4
|
-
formControl?:
|
|
4
|
+
formControl?: RolsterControl<string>;
|
|
5
5
|
onSearch?: () => void;
|
|
6
6
|
placeholder?: string;
|
|
7
7
|
}
|
|
8
|
-
export declare function RlsInputSearch({ formControl,
|
|
8
|
+
export declare function RlsInputSearch({ formControl, onSearch, placeholder }: InputSearchProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export {};
|
|
@@ -2,7 +2,7 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
|
2
2
|
import { RlsButtonAction } from '../ButtonAction/ButtonAction';
|
|
3
3
|
import { RlsInput } from '../Input/Input';
|
|
4
4
|
import './InputSearch.css';
|
|
5
|
-
export function RlsInputSearch({ formControl,
|
|
5
|
+
export function RlsInputSearch({ formControl, onSearch, placeholder }) {
|
|
6
6
|
return (_jsxs("div", { className: "rls-input-search", children: [_jsx(RlsInput, { formControl: formControl, placeholder: placeholder }), onSearch && _jsx(RlsButtonAction, { icon: "search", onClick: onSearch })] }));
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=InputSearch.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputSearch.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputSearch/InputSearch.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"InputSearch.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputSearch/InputSearch.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,8BAA8B,CAAC;AAE/D,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,mBAAmB,CAAC;AAQ3B,MAAM,UAAU,cAAc,CAAC,EAC7B,WAAW,EACX,QAAQ,EACR,WAAW,EACM;IACjB,OAAO,CACL,eAAK,SAAS,EAAC,kBAAkB,aAC/B,KAAC,QAAQ,IAAC,WAAW,EAAE,WAAW,EAAE,WAAW,EAAE,WAAW,GAAI,EAC/D,QAAQ,IAAI,KAAC,eAAe,IAAC,IAAI,EAAC,QAAQ,EAAC,OAAO,EAAE,QAAQ,GAAI,IAC7D,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,11 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InputProps } from '../../types';
|
|
2
2
|
import './InputText.css';
|
|
3
|
-
|
|
4
|
-
disabled?: boolean;
|
|
5
|
-
formControl?: ReactControl<HTMLInputElement, string>;
|
|
6
|
-
placeholder?: string;
|
|
7
|
-
value?: string;
|
|
8
|
-
onValue?: (value: string) => void;
|
|
9
|
-
}
|
|
10
|
-
export declare function RlsInputText({ disabled, formControl, placeholder, value, onValue }: InputTextProps): import("react/jsx-runtime").JSX.Element;
|
|
11
|
-
export {};
|
|
3
|
+
export declare function RlsInputText({ disabled, formControl, onValue, placeholder, value }: InputProps<string>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -2,8 +2,8 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { useState } from 'react';
|
|
3
3
|
import { RlsInput } from '../Input/Input';
|
|
4
4
|
import './InputText.css';
|
|
5
|
-
export function RlsInputText({ disabled, formControl, placeholder, value
|
|
6
|
-
const [valueInput, setValueInput] = useState(value
|
|
5
|
+
export function RlsInputText({ disabled, formControl, onValue, placeholder, value }) {
|
|
6
|
+
const [valueInput, setValueInput] = useState(value ?? '');
|
|
7
7
|
function onChange(value) {
|
|
8
8
|
!formControl && setValueInput(value);
|
|
9
9
|
onValue && onValue(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"InputText.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputText/InputText.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"InputText.js","sourceRoot":"","sources":["../../../../../src/components/atoms/InputText/InputText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AAEjC,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,OAAO,iBAAiB,CAAC;AAEzB,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,WAAW,EACX,OAAO,EACP,WAAW,EACX,KAAK,EACc;IACnB,MAAM,CAAC,UAAU,EAAE,aAAa,CAAC,GAAG,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CAAC;IAE1D,SAAS,QAAQ,CAAC,KAAa;QAC7B,CAAC,WAAW,IAAI,aAAa,CAAC,KAAK,CAAC,CAAC;QACrC,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,CACL,cAAK,SAAS,EAAC,gBAAgB,YAC7B,KAAC,QAAQ,IACP,WAAW,EAAE,WAAW,EACxB,IAAI,EAAC,MAAM,EACX,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,QAAQ,YAEhB,WAAW,EAAE,KAAK,IAAI,KAAK,IAAI,UAAU,GACjC,GACP,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,14 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RlsComponent } from '../../definitions';
|
|
1
|
+
import { FieldBoxProps } from '../../types';
|
|
3
2
|
import './FieldMoney.css';
|
|
4
|
-
interface FieldMoneyProps extends
|
|
3
|
+
interface FieldMoneyProps extends FieldBoxProps<number> {
|
|
5
4
|
decimals?: boolean;
|
|
6
|
-
disabled?: boolean;
|
|
7
|
-
formControl?: ReactControl<HTMLInputElement, number>;
|
|
8
|
-
placeholder?: string;
|
|
9
5
|
symbol?: string;
|
|
10
|
-
value?: number;
|
|
11
|
-
onValue?: (value: number) => void;
|
|
12
6
|
}
|
|
13
|
-
export declare function RlsFieldMoney({ children, decimals, disabled, formControl, placeholder, symbol, rlsTheme, value
|
|
7
|
+
export declare function RlsFieldMoney({ children, decimals, disabled, formControl, msgErrorDisabled, onValue, placeholder, symbol, rlsTheme, value }: FieldMoneyProps): import("react/jsx-runtime").JSX.Element;
|
|
14
8
|
export {};
|
|
@@ -3,11 +3,11 @@ import { renderClassStatus } from '../../../helpers/css';
|
|
|
3
3
|
import { RlsInputMoney } from '../../atoms';
|
|
4
4
|
import { RlsMessageFormError } from '../MessageFormError/MessageFormError';
|
|
5
5
|
import './FieldMoney.css';
|
|
6
|
-
export function RlsFieldMoney({ children, decimals, disabled, formControl, placeholder, symbol, rlsTheme, value
|
|
6
|
+
export function RlsFieldMoney({ children, decimals, disabled, formControl, msgErrorDisabled, onValue, placeholder, symbol, rlsTheme, value }) {
|
|
7
7
|
return (_jsxs("div", { className: renderClassStatus('rls-field-box', {
|
|
8
8
|
focused: formControl?.focused,
|
|
9
9
|
error: formControl?.wrong,
|
|
10
10
|
disabled: formControl?.disabled || disabled
|
|
11
|
-
}, 'rls-field-money'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsx("div", { className: "rls-field-box__body", children: _jsx(RlsInputMoney, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, symbol: symbol, decimals: decimals, onValue: onValue }) }) }), _jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
11
|
+
}, 'rls-field-money'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsx("div", { className: "rls-field-box__body", children: _jsx(RlsInputMoney, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, symbol: symbol, decimals: decimals, onValue: onValue }) }) }), !msgErrorDisabled && (_jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=FieldMoney.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldMoney.js","sourceRoot":"","sources":["../../../../../src/components/molecules/FieldMoney/FieldMoney.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FieldMoney.js","sourceRoot":"","sources":["../../../../../src/components/molecules/FieldMoney/FieldMoney.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAE5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,kBAAkB,CAAC;AAO1B,MAAM,UAAU,aAAa,CAAC,EAC5B,QAAQ,EACR,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,MAAM,EACN,QAAQ,EACR,KAAK,EACW;IAChB,OAAO,CACL,eACE,SAAS,EAAE,iBAAiB,CAC1B,eAAe,EACf;YACE,OAAO,EAAE,WAAW,EAAE,OAAO;YAC7B,KAAK,EAAE,WAAW,EAAE,KAAK;YACzB,QAAQ,EAAE,WAAW,EAAE,QAAQ,IAAI,QAAQ;SAC5C,EACD,iBAAiB,CAClB,eACU,QAAQ,aAElB,QAAQ,IAAI,gBAAO,SAAS,EAAC,sBAAsB,YAAE,QAAQ,GAAS,EAEvE,cAAK,SAAS,EAAC,0BAA0B,YACvC,cAAK,SAAS,EAAC,qBAAqB,YAClC,KAAC,aAAa,IACZ,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,MAAM,EAAE,MAAM,EACd,QAAQ,EAAE,QAAQ,EAClB,OAAO,EAAE,OAAO,GAChB,GACE,GACF,EAEL,CAAC,gBAAgB,IAAI,CACpB,KAAC,mBAAmB,IAClB,SAAS,EAAC,sBAAsB,EAChC,WAAW,EAAE,WAAW,GACxB,CACH,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,12 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { RlsComponent } from '../../definitions';
|
|
1
|
+
import { FieldBoxProps } from '../../types';
|
|
3
2
|
import './FieldNumber.css';
|
|
4
|
-
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
formControl?: ReactControl<HTMLInputElement, number>;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
value?: number;
|
|
9
|
-
onValue?: (value: number) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function RlsFieldNumber({ children, disabled, formControl, placeholder, rlsTheme, value, onValue }: FieldNumberProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
3
|
+
export declare function RlsFieldNumber({ children, disabled, formControl, msgErrorDisabled, onValue, placeholder, rlsTheme, value }: FieldBoxProps<number>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,11 +3,11 @@ import { renderClassStatus } from '../../../helpers/css';
|
|
|
3
3
|
import { RlsInputNumber } from '../../atoms';
|
|
4
4
|
import { RlsMessageFormError } from '../MessageFormError/MessageFormError';
|
|
5
5
|
import './FieldNumber.css';
|
|
6
|
-
export function RlsFieldNumber({ children, disabled, formControl, placeholder, rlsTheme, value
|
|
6
|
+
export function RlsFieldNumber({ children, disabled, formControl, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
7
7
|
return (_jsxs("div", { className: renderClassStatus('rls-field-box', {
|
|
8
8
|
focused: formControl?.focused,
|
|
9
9
|
error: formControl?.wrong,
|
|
10
10
|
disabled: formControl?.disabled || disabled
|
|
11
|
-
}, 'rls-field-number'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsx("div", { className: "rls-field-box__body", children: _jsx(RlsInputNumber, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), _jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
11
|
+
}, 'rls-field-number'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsx("div", { className: "rls-field-box__body", children: _jsx(RlsInputNumber, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), !msgErrorDisabled && (_jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=FieldNumber.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldNumber.js","sourceRoot":"","sources":["../../../../../src/components/molecules/FieldNumber/FieldNumber.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FieldNumber.js","sourceRoot":"","sources":["../../../../../src/components/molecules/FieldNumber/FieldNumber.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAE7C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,mBAAmB,CAAC;AAE3B,MAAM,UAAU,cAAc,CAAC,EAC7B,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,QAAQ,EACR,KAAK,EACiB;IACtB,OAAO,CACL,eACE,SAAS,EAAE,iBAAiB,CAC1B,eAAe,EACf;YACE,OAAO,EAAE,WAAW,EAAE,OAAO;YAC7B,KAAK,EAAE,WAAW,EAAE,KAAK;YACzB,QAAQ,EAAE,WAAW,EAAE,QAAQ,IAAI,QAAQ;SAC5C,EACD,kBAAkB,CACnB,eACU,QAAQ,aAElB,QAAQ,IAAI,gBAAO,SAAS,EAAC,sBAAsB,YAAE,QAAQ,GAAS,EAEvE,cAAK,SAAS,EAAC,0BAA0B,YACvC,cAAK,SAAS,EAAC,qBAAqB,YAClC,KAAC,cAAc,IACb,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,GAChB,GACE,GACF,EAEL,CAAC,gBAAgB,IAAI,CACpB,KAAC,mBAAmB,IAClB,SAAS,EAAC,sBAAsB,EAChC,WAAW,EAAE,WAAW,GACxB,CACH,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -1,10 +1,11 @@
|
|
|
1
|
-
import { ReactControl } from '@rolster/react-forms';
|
|
2
1
|
import { RlsComponent } from '../../definitions';
|
|
2
|
+
import { RolsterControl } from '../../types';
|
|
3
3
|
import './FieldPassword.css';
|
|
4
4
|
interface FieldPasswordProps extends RlsComponent {
|
|
5
5
|
disabled?: boolean;
|
|
6
|
-
formControl?:
|
|
6
|
+
formControl?: RolsterControl<string>;
|
|
7
|
+
msgErrorDisabled?: boolean;
|
|
7
8
|
placeholder?: string;
|
|
8
9
|
}
|
|
9
|
-
export declare function RlsFieldPassword({ children, disabled, formControl, placeholder, rlsTheme }: FieldPasswordProps): import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare function RlsFieldPassword({ children, disabled, formControl, msgErrorDisabled, placeholder, rlsTheme }: FieldPasswordProps): import("react/jsx-runtime").JSX.Element;
|
|
10
11
|
export {};
|
|
@@ -4,7 +4,7 @@ import { renderClassStatus } from '../../../helpers/css';
|
|
|
4
4
|
import { RlsButtonAction, RlsInputPassword } from '../../atoms';
|
|
5
5
|
import { RlsMessageFormError } from '../MessageFormError/MessageFormError';
|
|
6
6
|
import './FieldPassword.css';
|
|
7
|
-
export function RlsFieldPassword({ children, disabled, formControl, placeholder, rlsTheme }) {
|
|
7
|
+
export function RlsFieldPassword({ children, disabled, formControl, msgErrorDisabled, placeholder, rlsTheme }) {
|
|
8
8
|
const [password, setPassword] = useState(true);
|
|
9
9
|
function onToggleInput() {
|
|
10
10
|
setPassword(!password);
|
|
@@ -13,6 +13,6 @@ export function RlsFieldPassword({ children, disabled, formControl, placeholder,
|
|
|
13
13
|
focused: formControl?.focused,
|
|
14
14
|
error: formControl?.wrong,
|
|
15
15
|
disabled: formControl?.disabled || disabled
|
|
16
|
-
}, 'rls-field-password'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsxs("div", { className: "rls-field-box__body", children: [_jsx(RlsInputPassword, { formControl: formControl, disabled: disabled, placeholder: placeholder, type: password ? 'password' : 'text' }), _jsx(RlsButtonAction, { icon: password ? 'eye' : 'eye-off', onClick: onToggleInput })] }) }), _jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
16
|
+
}, 'rls-field-password'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsxs("div", { className: "rls-field-box__body", children: [_jsx(RlsInputPassword, { formControl: formControl, disabled: disabled, placeholder: placeholder, type: password ? 'password' : 'text' }), _jsx(RlsButtonAction, { icon: password ? 'eye' : 'eye-off', onClick: onToggleInput })] }) }), !msgErrorDisabled && (_jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
17
17
|
}
|
|
18
18
|
//# sourceMappingURL=FieldPassword.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldPassword.js","sourceRoot":"","sources":["../../../../../src/components/molecules/FieldPassword/FieldPassword.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FieldPassword.js","sourceRoot":"","sources":["../../../../../src/components/molecules/FieldPassword/FieldPassword.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,OAAO,CAAC;AACjC,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAGhE,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAs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.css';
|
|
4
|
-
|
|
5
|
-
disabled?: boolean;
|
|
6
|
-
formControl?: ReactControl<HTMLInputElement, string>;
|
|
7
|
-
placeholder?: string;
|
|
8
|
-
value?: string;
|
|
9
|
-
onValue?: (value: string) => void;
|
|
10
|
-
}
|
|
11
|
-
export declare function RlsFieldText({ children, disabled, formControl, placeholder, rlsTheme, value, onValue }: FieldTextProps): import("react/jsx-runtime").JSX.Element;
|
|
12
|
-
export {};
|
|
3
|
+
export declare function RlsFieldText({ children, disabled, formControl, msgErrorDisabled, onValue, placeholder, rlsTheme, value }: FieldBoxProps<string>): import("react/jsx-runtime").JSX.Element;
|
|
@@ -3,11 +3,11 @@ import { renderClassStatus } from '../../../helpers/css';
|
|
|
3
3
|
import { RlsInputText } from '../../atoms';
|
|
4
4
|
import { RlsMessageFormError } from '../MessageFormError/MessageFormError';
|
|
5
5
|
import './FieldText.css';
|
|
6
|
-
export function RlsFieldText({ children, disabled, formControl, placeholder, rlsTheme, value
|
|
6
|
+
export function RlsFieldText({ children, disabled, formControl, msgErrorDisabled, onValue, placeholder, rlsTheme, value }) {
|
|
7
7
|
return (_jsxs("div", { className: renderClassStatus('rls-field-box', {
|
|
8
8
|
focused: formControl?.focused,
|
|
9
9
|
error: formControl?.wrong,
|
|
10
10
|
disabled: formControl?.disabled || disabled
|
|
11
|
-
}, 'rls-field-text'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsx("div", { className: "rls-field-box__body", children: _jsx(RlsInputText, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), _jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }));
|
|
11
|
+
}, 'rls-field-text'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsx("div", { className: "rls-field-box__body", children: _jsx(RlsInputText, { formControl: formControl, value: value, disabled: disabled, placeholder: placeholder, onValue: onValue }) }) }), !msgErrorDisabled && (_jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }));
|
|
12
12
|
}
|
|
13
13
|
//# sourceMappingURL=FieldText.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldText.js","sourceRoot":"","sources":["../../../../../src/components/molecules/FieldText/FieldText.tsx"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"FieldText.js","sourceRoot":"","sources":["../../../../../src/components/molecules/FieldText/FieldText.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE3C,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,iBAAiB,CAAC;AAEzB,MAAM,UAAU,YAAY,CAAC,EAC3B,QAAQ,EACR,QAAQ,EACR,WAAW,EACX,gBAAgB,EAChB,OAAO,EACP,WAAW,EACX,QAAQ,EACR,KAAK,EACiB;IACtB,OAAO,CACL,eACE,SAAS,EAAE,iBAAiB,CAC1B,eAAe,EACf;YACE,OAAO,EAAE,WAAW,EAAE,OAAO;YAC7B,KAAK,EAAE,WAAW,EAAE,KAAK;YACzB,QAAQ,EAAE,WAAW,EAAE,QAAQ,IAAI,QAAQ;SAC5C,EACD,gBAAgB,CACjB,eACU,QAAQ,aAElB,QAAQ,IAAI,gBAAO,SAAS,EAAC,sBAAsB,YAAE,QAAQ,GAAS,EAEvE,cAAK,SAAS,EAAC,0BAA0B,YACvC,cAAK,SAAS,EAAC,qBAAqB,YAClC,KAAC,YAAY,IACX,WAAW,EAAE,WAAW,EACxB,KAAK,EAAE,KAAK,EACZ,QAAQ,EAAE,QAAQ,EAClB,WAAW,EAAE,WAAW,EACxB,OAAO,EAAE,OAAO,GAChB,GACE,GACF,EAEL,CAAC,gBAAgB,IAAI,CACpB,KAAC,mBAAmB,IAClB,SAAS,EAAC,sBAAsB,EAChC,WAAW,EAAE,WAAW,GACxB,CACH,IACG,CACP,CAAC;AACJ,CAAC"}
|
|
@@ -8,6 +8,7 @@ interface FieldAutocompleteProps<T = any, E extends Element<T> = Element<T>> ext
|
|
|
8
8
|
disabled?: boolean;
|
|
9
9
|
formControl?: ReactControl<HTMLElement, T | undefined>;
|
|
10
10
|
hiddenIcon?: boolean;
|
|
11
|
+
msgErrorDisabled?: boolean;
|
|
11
12
|
onSearch?: (pattern: string) => void;
|
|
12
13
|
onSelect?: (value: T) => void;
|
|
13
14
|
onValue?: (value?: T) => void;
|
|
@@ -17,6 +18,6 @@ interface FieldAutocompleteProps<T = any, E extends Element<T> = Element<T>> ext
|
|
|
17
18
|
interface FieldAutocompleteTemplateProps<T = any, E extends Element<T> = Element<T>> extends FieldAutocompleteProps<T, E> {
|
|
18
19
|
render: (element: E) => ReactNode;
|
|
19
20
|
}
|
|
20
|
-
export declare function RlsFieldAutocompleteTemplate<T = any, E extends Element<T> = Element<T>>(
|
|
21
|
+
export declare function RlsFieldAutocompleteTemplate<T = any, E extends Element<T> = Element<T>>(props: FieldAutocompleteTemplateProps<T, E>): import("react/jsx-runtime").JSX.Element;
|
|
21
22
|
export declare function RlsFieldAutocomplete<T = any>(props: FieldAutocompleteProps<T, AutocompleteElement<T>>): import("react/jsx-runtime").JSX.Element;
|
|
22
23
|
export {};
|
|
@@ -5,21 +5,17 @@ import { RlsIcon, RlsProgressBar } from '../../atoms';
|
|
|
5
5
|
import { RlsBallot, RlsMessageFormError } from '../../molecules';
|
|
6
6
|
import { useFieldAutocomplete } from './FieldAutocompleteHook';
|
|
7
7
|
import './FieldAutocomplete.css';
|
|
8
|
-
export function RlsFieldAutocompleteTemplate(
|
|
9
|
-
const fieldAutocomplete = useFieldAutocomplete(
|
|
10
|
-
|
|
11
|
-
disabled,
|
|
12
|
-
formControl,
|
|
13
|
-
onSelect,
|
|
14
|
-
onValue
|
|
15
|
-
});
|
|
8
|
+
export function RlsFieldAutocompleteTemplate(props) {
|
|
9
|
+
const fieldAutocomplete = useFieldAutocomplete(props);
|
|
10
|
+
const { render, children, disabled, formControl, hiddenIcon, msgErrorDisabled, onSearch, placeholder, rlsTheme, searching } = props;
|
|
16
11
|
return (_jsxs("div", { ref: fieldAutocomplete.listControl.contentRef, className: renderClassStatus('rls-field-box', {
|
|
17
12
|
disabled,
|
|
18
13
|
focused: fieldAutocomplete.listControl.focused,
|
|
14
|
+
error: formControl?.wrong,
|
|
19
15
|
selected: !!fieldAutocomplete.listControl.value
|
|
20
|
-
}, 'rls-field-list rls-field-autocomplete'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsxs("div", { className: "rls-field-box__body", children: [_jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: fieldAutocomplete.listControl.value, onClick: fieldAutocomplete.onClickControl }), !hiddenIcon && fieldAutocomplete.listControl.value && (_jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: fieldAutocomplete.onClickAction, children: _jsx(RlsIcon, { value: "trash-2" }) }))] }) }), _jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }), _jsxs("div", { className: renderClassStatus('rls-field-list__suggestions', {
|
|
21
|
-
visible: fieldAutocomplete.listControl.
|
|
22
|
-
hide: !fieldAutocomplete.listControl.
|
|
16
|
+
}, 'rls-field-list rls-field-autocomplete'), "rls-theme": rlsTheme, children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsxs("div", { className: "rls-field-box__body", children: [_jsx("input", { className: "rls-field-list__control", readOnly: true, disabled: disabled, placeholder: placeholder, value: fieldAutocomplete.listControl.value, onClick: fieldAutocomplete.onClickControl }), !hiddenIcon && fieldAutocomplete.listControl.value && (_jsx("button", { className: "rls-field-list__action", disabled: disabled, onClick: fieldAutocomplete.onClickAction, children: _jsx(RlsIcon, { value: "trash-2" }) }))] }) }), !msgErrorDisabled && (_jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })), _jsxs("div", { className: renderClassStatus('rls-field-list__suggestions', {
|
|
17
|
+
visible: fieldAutocomplete.listControl.listIsVisible,
|
|
18
|
+
hide: !fieldAutocomplete.listControl.listIsVisible,
|
|
23
19
|
higher: fieldAutocomplete.listControl.higher
|
|
24
20
|
}), children: [_jsx("div", { className: "rls-field-list__suggestions__body", children: _jsxs("ul", { ref: fieldAutocomplete.listControl.listRef, className: "rls-field-list__ul", children: [_jsxs("div", { className: "rls-field-list__ul__search", children: [_jsx("input", { ref: fieldAutocomplete.listControl.inputRef, className: "rls-field-list__ul__control", type: "text", placeholder: reactI18n('listInputPlaceholder'), value: fieldAutocomplete.pattern, onChange: ({ target: { value } }) => {
|
|
25
21
|
fieldAutocomplete.setPattern(value);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldAutocomplete.js","sourceRoot":"","sources":["../../../../../src/components/organisms/FieldAutocomplete/FieldAutocomplete.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAEtD,OAAO,EAAE,SAAS,EAAE,mBAAmB,EAAE,MAAM,iBAAiB,CAAC;AACjE,OAAO,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,yBAAyB,CAAC;
|
|
1
|
+
{"version":3,"file":"FieldAutocomplete.js","sourceRoot":"","sources":["../../../../../src/components/organisms/FieldAutocomplete/FieldAutocomplete.tsx"],"names":[],"mappings":";AAMA,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,OAAO,EAAE,cAAc,E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
|
const [pattern, setPattern] = useState('');
|
|
8
8
|
const [coincidences, setCoincidences] = useState([]);
|
|
9
9
|
const currentStore = useRef({
|
|
10
|
-
pattern: '',
|
|
11
10
|
coincidences: [],
|
|
11
|
+
pattern: '',
|
|
12
12
|
previous: null
|
|
13
13
|
});
|
|
14
14
|
const listControl = useListControl({ suggestions, formControl });
|
|
15
|
-
const { inputRef, navigationElement, navigationInput,
|
|
15
|
+
const { inputRef, navigationElement, navigationInput, setFormValue, setState } = listControl;
|
|
16
16
|
useEffect(() => {
|
|
17
17
|
refreshCoincidences(pattern, true);
|
|
18
18
|
}, [suggestions]);
|
|
@@ -21,23 +21,23 @@ export function useFieldAutocomplete({ disabled, formControl, onSelect, onValue,
|
|
|
21
21
|
}, [pattern]);
|
|
22
22
|
function onClickControl() {
|
|
23
23
|
if (!disabled) {
|
|
24
|
-
|
|
24
|
+
setState({ listIsVisible: true });
|
|
25
25
|
setTimeout(() => {
|
|
26
26
|
inputRef?.current?.focus();
|
|
27
27
|
}, DURATION_ANIMATION);
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
function onFocusInput() {
|
|
31
|
-
|
|
31
|
+
setState({ focused: true });
|
|
32
32
|
}
|
|
33
33
|
function onBlurInput() {
|
|
34
|
-
|
|
34
|
+
setState({ focused: false });
|
|
35
35
|
}
|
|
36
36
|
function onKeydownInput(event) {
|
|
37
37
|
switch (event.code) {
|
|
38
38
|
case 'Escape':
|
|
39
39
|
case 'Tab':
|
|
40
|
-
|
|
40
|
+
setState({ listIsVisible: false });
|
|
41
41
|
break;
|
|
42
42
|
default:
|
|
43
43
|
navigationInput(event);
|
|
@@ -45,13 +45,12 @@ export function useFieldAutocomplete({ disabled, formControl, onSelect, onValue,
|
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
47
|
function onClickAction() {
|
|
48
|
-
|
|
49
|
-
setValue('');
|
|
48
|
+
setState({ listIsVisible: false, value: '' });
|
|
50
49
|
setFormValue(undefined);
|
|
51
50
|
onValue && onValue(undefined);
|
|
52
51
|
}
|
|
53
52
|
function onClickBackdrop() {
|
|
54
|
-
|
|
53
|
+
setState({ listIsVisible: false });
|
|
55
54
|
}
|
|
56
55
|
function onClickElement(element) {
|
|
57
56
|
return () => {
|
|
@@ -64,13 +63,13 @@ export function useFieldAutocomplete({ disabled, formControl, onSelect, onValue,
|
|
|
64
63
|
};
|
|
65
64
|
}
|
|
66
65
|
function onChange({ description, value }) {
|
|
67
|
-
setVisible(false);
|
|
68
66
|
if (onSelect) {
|
|
67
|
+
setState({ listIsVisible: false });
|
|
69
68
|
onSelect(value);
|
|
70
69
|
}
|
|
71
70
|
else {
|
|
71
|
+
setState({ listIsVisible: false, value: description });
|
|
72
72
|
setFormValue(value);
|
|
73
|
-
setValue(description);
|
|
74
73
|
}
|
|
75
74
|
onValue && onValue(value);
|
|
76
75
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FieldAutocompleteHook.js","sourceRoot":"","sources":["../../../../../src/components/organisms/FieldAutocomplete/FieldAutocompleteHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAIL,SAAS,EACT,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAe,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,YAAY,GAAG,CAAC,CAAC;AA4BvB,MAAM,UAAU,oBAAoB,CAGlC,EACA,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,OAAO,EACP,WAAW,EACkB;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAM,EAAE,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,MAAM,CAA0B;QACnD,
|
|
1
|
+
{"version":3,"file":"FieldAutocompleteHook.js","sourceRoot":"","sources":["../../../../../src/components/organisms/FieldAutocomplete/FieldAutocompleteHook.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,uBAAuB,EACxB,MAAM,qBAAqB,CAAC;AAE7B,OAAO,EAIL,SAAS,EACT,MAAM,EACN,QAAQ,EACT,MAAM,OAAO,CAAC;AACf,OAAO,EAAe,cAAc,EAAE,MAAM,gBAAgB,CAAC;AAE7D,MAAM,kBAAkB,GAAG,GAAG,CAAC;AAC/B,MAAM,YAAY,GAAG,CAAC,CAAC;AA4BvB,MAAM,UAAU,oBAAoB,CAGlC,EACA,QAAQ,EACR,WAAW,EACX,QAAQ,EACR,OAAO,EACP,WAAW,EACkB;IAC7B,MAAM,CAAC,OAAO,EAAE,UAAU,CAAC,GAAG,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3C,MAAM,CAAC,YAAY,EAAE,eAAe,CAAC,GAAG,QAAQ,CAAM,EAAE,CAAC,CAAC;IAC1D,MAAM,YAAY,GAAG,MAAM,CAA0B;QACnD,YAAY,EAAE,EAAE;QAChB,OAAO,EAAE,EAAE;QACX,QAAQ,EAAE,IAAI;KACf,CAAC,CAAC;IAEH,MAAM,WAAW,GAAG,cAAc,CAAC,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;IAEjE,MAAM,EACJ,QAAQ,EACR,iBAAiB,EACjB,eAAe,EACf,YAAY,EACZ,QAAQ,EACT,GAAG,WAAW,CAAC;IAEhB,SAAS,CAAC,GAAG,EAAE;QACb,mBAAmB,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACrC,CAAC,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;IAElB,SAAS,CAAC,GAAG,EAAE;QACb,mBAAmB,CAAC,OAAO,CAAC,CAAC;IAC/B,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IAEd,SAAS,cAAc;QACrB,IAAI,CAAC,QAAQ,EAAE,CAAC;YACd,QA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AC,KAAK,CAAC,CAAC;QACxE,CAAC,CAAC;IACJ,CAAC;IAED,SAAS,QAAQ,CAAC,EAAE,WAAW,EAAE,KAAK,EAAc;QAClD,IAAI,QAAQ,EAAE,CAAC;YACb,QAAQ,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,CAAC,CAAC;YACnC,QAAQ,CAAC,KAAK,CAAC,CAAC;QAClB,CAAC;aAAM,CAAC;YACN,QAAQ,CAAC,EAAE,aAAa,EAAE,KAAK,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;YACvD,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;QAED,OAAO,IAAI,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,SAAS,mBAAmB,CAAC,OAAsB,EAAE,MAAM,GAAG,KAAK;QACjE,MAAM,EAAE,UAAU,EAAE,KAAK,EAAE,GAAG,uBAAuB,CAAC;YACpD,OAAO;YACP,WAAW;YACX,MAAM;YACN,KAAK,EAAE,YAAY,CAAC,OAAO;SAC5B,CAAC,CAAC;QAEH,YAAY,CAAC,OAAO,GAAG,KAAK,CAAC;QAC7B,eAAe,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAAE,YAAY,CAAC,CAAC,CAAC;IACrD,CAAC;IAED,OAAO;QACL,YAAY;QACZ,WAAW;QACX,WAAW;QACX,aAAa;QACb,eAAe;QACf,cAAc;QACd,cAAc;QACd,YAAY;QACZ,gBAAgB;QAChB,cAAc;QACd,OAAO;QACP,UAAU;KACX,CAAC;AACJ,CAAC"}
|
|
@@ -8,8 +8,9 @@ interface FieldDateProps extends RlsComponent {
|
|
|
8
8
|
format?: string;
|
|
9
9
|
maxDate?: Date;
|
|
10
10
|
minDate?: Date;
|
|
11
|
+
msgErrorDisabled?: boolean;
|
|
11
12
|
onValue?: (value?: Date) => void;
|
|
12
13
|
placeholder?: string;
|
|
13
14
|
}
|
|
14
|
-
export declare function RlsFieldDate({ children, date, disabled, formControl, format, maxDate, minDate, onValue, placeholder, rlsTheme }: FieldDateProps): import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare function RlsFieldDate({ children, date, disabled, formControl, format, maxDate, minDate, msgErrorDisabled, onValue, placeholder, rlsTheme }: FieldDateProps): import("react/jsx-runtime").JSX.Element;
|
|
15
16
|
export {};
|
|
@@ -9,7 +9,7 @@ import { RlsModal } from '../Modal/Modal';
|
|
|
9
9
|
import { RlsPickerDate } from '../PickerDate/PickerDate';
|
|
10
10
|
import './FieldDate.css';
|
|
11
11
|
const FORMAT_DATE = '{dd}/{mx}/{aa}';
|
|
12
|
-
export function RlsFieldDate({ children, date, disabled, formControl, format, maxDate, minDate, onValue, placeholder, rlsTheme }) {
|
|
12
|
+
export function RlsFieldDate({ children, date, disabled, formControl, format, maxDate, minDate, msgErrorDisabled, onValue, placeholder, rlsTheme }) {
|
|
13
13
|
const today = new Date(); // Initial current date in component
|
|
14
14
|
const [value, setValue] = useState();
|
|
15
15
|
const [modalIsVisible, setModalIsVisible] = useState(false);
|
|
@@ -42,7 +42,7 @@ export function RlsFieldDate({ children, date, disabled, formControl, format, ma
|
|
|
42
42
|
const valueInput = value
|
|
43
43
|
? dateFormatTemplate(value, format || FORMAT_DATE)
|
|
44
44
|
: '';
|
|
45
|
-
return (_jsxs("div", { className: "rls-field-date", "rls-theme": rlsTheme, children: [_jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsxs("div", { className: "rls-field-box__body", children: [_jsx("input", { className: "rls-field-date__control", type: "text", value: valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), _jsx("button", { className: "rls-field-date__action", onClick: onClickAction, disabled: disabled, children: _jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), _jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl })] }), _jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: _jsx(RlsPickerDate, { formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value, type }) => {
|
|
45
|
+
return (_jsxs("div", { className: "rls-field-date", "rls-theme": rlsTheme, children: [_jsxs("div", { className: renderClassStatus('rls-field-box', { disabled }), children: [children && _jsx("label", { className: "rls-field-box__label", children: children }), _jsx("div", { className: "rls-field-box__component", children: _jsxs("div", { className: "rls-field-box__body", children: [_jsx("input", { className: "rls-field-date__control", type: "text", value: valueInput, readOnly: true, placeholder: placeholder, onClick: onClickInput, disabled: disabled }), _jsx("button", { className: "rls-field-date__action", onClick: onClickAction, disabled: disabled, children: _jsx(RlsIcon, { value: value ? 'trash-2' : 'calendar' }) })] }) }), !msgErrorDisabled && (_jsx(RlsMessageFormError, { className: "rls-field-box__error", formControl: formControl }))] }), _jsx(RlsModal, { visible: modalIsVisible, rlsTheme: rlsTheme, children: _jsx(RlsPickerDate, { formControl: formControl, date: date, disabled: disabled, maxDate: maxDate, minDate: minDate, onListener: ({ value, type }) => {
|
|
46
46
|
type !== PickerListenerType.Cancel && onChange(value);
|
|
47
47
|
formControl?.touch();
|
|
48
48
|
setModalIsVisible(false);
|