@producteca/producteca-ui-kit 1.8.0 → 1.9.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/inputs/checkboxInput/checkboxInput.d.ts +4 -17
- package/dist/components/inputs/checkboxInput/checkboxInputGroup.d.ts +22 -0
- package/dist/components/inputs/checkboxInput/index.d.ts +2 -2
- package/dist/components/inputs/index.d.ts +1 -0
- package/dist/components/inputs/switchInput/index.d.ts +4 -0
- package/dist/components/inputs/switchInput/switchInput.d.ts +31 -0
- package/dist/locales/description.d.ts +3 -3
- package/dist/locales/es.d.ts +3 -2
- package/dist/producteca-ui-kit.es.js +3139 -3055
- package/dist/producteca-ui-kit.umd.js +130 -130
- package/dist/style.css +1 -1
- package/package.json +1 -1
- package/dist/components/inputs/checkboxInput/singleCheckboxInput.d.ts +0 -19
|
@@ -1,22 +1,9 @@
|
|
|
1
1
|
import { default as React } from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import { CheckboxInputProps } from './checkboxInputGroup';
|
|
3
3
|
|
|
4
|
-
export
|
|
5
|
-
id?: string;
|
|
6
|
-
name?: string;
|
|
7
|
-
label: string;
|
|
8
|
-
value?: any;
|
|
4
|
+
export declare const CheckboxInput: React.FC<Omit<CheckboxInputProps, 'items'> & {
|
|
9
5
|
checked?: boolean;
|
|
6
|
+
label: string;
|
|
10
7
|
disabled?: boolean;
|
|
11
|
-
}
|
|
12
|
-
export interface CheckboxInputProps {
|
|
13
|
-
name: string;
|
|
14
|
-
items: CheckboxItem[];
|
|
15
|
-
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
-
title?: string;
|
|
17
|
-
type?: 'checkbox' | 'radio';
|
|
18
|
-
size?: 'sm' | 'md' | 'lg';
|
|
19
|
-
input?: ReduxFormInput;
|
|
20
|
-
}
|
|
21
|
-
export declare const CheckboxInput: React.FC<CheckboxInputProps>;
|
|
8
|
+
}>;
|
|
22
9
|
export default CheckboxInput;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ReduxFormInput } from '../../../hooks/useReduxFormField';
|
|
3
|
+
|
|
4
|
+
export interface CheckboxItem {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
value?: any;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface CheckboxInputProps {
|
|
13
|
+
name: string;
|
|
14
|
+
items: CheckboxItem[];
|
|
15
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
+
title?: string;
|
|
17
|
+
type?: 'checkbox' | 'radio';
|
|
18
|
+
size?: 'sm' | 'md' | 'lg';
|
|
19
|
+
input?: ReduxFormInput;
|
|
20
|
+
}
|
|
21
|
+
export declare const CheckboxInputGroup: React.FC<CheckboxInputProps>;
|
|
22
|
+
export default CheckboxInputGroup;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SingleCheckboxInput } from './singleCheckboxInput';
|
|
2
1
|
import { CheckboxInput } from './checkboxInput';
|
|
2
|
+
import { CheckboxInputGroup } from './checkboxInputGroup';
|
|
3
3
|
|
|
4
|
-
export {
|
|
4
|
+
export { CheckboxInput, CheckboxInput as Checkbox, CheckboxInputGroup, CheckboxInputGroup as CheckboxGroup };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { default as React } from 'react';
|
|
2
|
+
import { ReduxFormInput } from '../../../hooks/useReduxFormField';
|
|
3
|
+
|
|
4
|
+
export interface SwitchItem {
|
|
5
|
+
id?: string;
|
|
6
|
+
name?: string;
|
|
7
|
+
label: string;
|
|
8
|
+
value?: any;
|
|
9
|
+
checked?: boolean;
|
|
10
|
+
disabled?: boolean;
|
|
11
|
+
}
|
|
12
|
+
export interface SwitchInputProps {
|
|
13
|
+
name: string;
|
|
14
|
+
items: SwitchItem[];
|
|
15
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
16
|
+
title?: string;
|
|
17
|
+
size?: 'sm' | 'md' | 'lg';
|
|
18
|
+
input?: ReduxFormInput;
|
|
19
|
+
}
|
|
20
|
+
export declare const SwitchInputGroup: React.FC<SwitchInputProps>;
|
|
21
|
+
export declare const SwitchInput: React.FC<{
|
|
22
|
+
name: string;
|
|
23
|
+
checked?: boolean;
|
|
24
|
+
onChange?: (event: React.ChangeEvent<HTMLInputElement>) => void;
|
|
25
|
+
label: string;
|
|
26
|
+
title?: string;
|
|
27
|
+
disabled?: boolean;
|
|
28
|
+
size?: 'sm' | 'md' | 'lg';
|
|
29
|
+
input?: ReduxFormInput;
|
|
30
|
+
}>;
|
|
31
|
+
export default SwitchInput;
|
|
@@ -7,8 +7,8 @@ export declare const isOptionDisabled = " \n Funcion que recibe un valor de t
|
|
|
7
7
|
export declare const selectFieldDescription = "\n #### Ejemplo de uso \n ```typescript\n <SelectField\n name=\"productId\"\n options={[{ label: \"1\", value: 1 }, { label: \"2\", value: 2, tooltipMessage: \"Este valor no es representativo\" }]}\n onChange={(event) => handleChange(event.target.name, event.target.value)}\n isMultiple\n isClearable={false}\n label={localize('product')}\n isOptionDisabled={(option) => option.value == 2}\n rightModifier={shouldShowLoader && <Spinner />}\n />\n ```\n";
|
|
8
8
|
export declare const formFieldExample = "\n #### Ejemplo de uso\n \n ``` typescript\n <FormField\n label=\"T\u00EDtulo\"\n name=\"textInput\"\n onChange={(event) => handleChange(event.target.name, event.target.value)}\n placeholder=\"Placeholder\"\n size=\"md\"\n type=\"text\"\n isValid={(inputValue) => _.isNumber(inputValue)}\n />\n ```\n";
|
|
9
9
|
export declare const isValidInput = "\n Funcion que recibe un valor de tipo inputValue y deberia devolver un valor booleano.\n \n #### Por ejemplo: (inputValue) => _.isNumber(inputValue)\n \n ``` typescript\n type inputValue = string | number; \n ```\n";
|
|
10
|
-
export declare const
|
|
11
|
-
export declare const
|
|
10
|
+
export declare const checkboxInputGroupExample = "\n #### Ejemplo de uso\n \n ``` typescript\n <CheckboxInput\n items={[\n {\n id: '1',\n label: 'Opci\u00F3n 1'\n },\n {\n id: '2',\n label: 'Opci\u00F3n 2'\n },\n {\n disabled: true,\n id: '3',\n label: 'Opci\u00F3n 3'\n }\n ]}\n name=\"CheckboxList\"\n onChange={(event) => handleChange(event.target.name, event.target.value)}\n size=\"lg\"\n title=\"Selecciona una opci\u00F3n\"\n type=\"checkbox\"\n />\n ```\n";
|
|
11
|
+
export declare const checkboxInputExample = " \n Versi\u00F3n con una sola opci\u00F3n tipo checkbox y un label personalizado:\n \n ```typescript\n const [checked, setChecked] = React.useState(false)\n <CheckboxInput\n name=\"Toggle\"\n checked={checked}\n onChange={setChecked}\n label={\"Amazon\"}\n title={locale('syncStockFromChannel')}\n />\n ```\n";
|
|
12
12
|
export declare const searcherExample = " \n Note la diferencia entre onChange y onInputChange (oficia de onSearch):\n \n ```typescript\n <Searcher\n label=\"Search label\"\n name=\"Searcher\"\n onChange={(event) => onSelectOption(event.target.value)}\n onInputChange={(event) => handleSearch(event.target.value)}\n options={[{ label: 'text', value: 1 }]}\n />\n ```\n";
|
|
13
13
|
export declare const saveBarExample = "\n #### Uso b\u00E1sico\n ```typescript\n <SaveBar\n saveProps={{\n onSave: () => handleSave(),\n label: 'Save'\n }}\n cancelProps={{\n onCancel: () => handleCancel(),\n label: 'Cancel'\n }}\n />\n ```\n #### Con bot\u00F3n de navegaci\u00F3n\n ```typescript\n <SaveBar\n saveProps={{\n onSave: () => handleSave(),\n label: 'Save',\n variant: 'primary'\n }}\n cancelProps={{\n onCancel: () => handleCancel(),\n label: 'Cancel'\n }}\n previousProps={{\n onPrevious: () => handlePrevious(),\n label: 'Previous'\n }}\n />\n ```\n #### Ejemplo completo\n ```typescript\n <SaveBar\n saveProps={{\n onSave: () => handleSave(),\n label: 'Guardar cambios',\n variant: 'success',\n disabled: false,\n onClick: () => {},\n }}\n cancelProps={{\n onCancel: () => handleCancel(),\n label: 'Descartar',\n }}\n previousProps={{\n onPrevious: () => handlePrevious(),\n label: 'Anterior',\n variant: 'primary',\n outline: true,\n disabled: false,\n onClick: () => console.log('Previous clicked'),\n }}\n />\n ```\n";
|
|
14
|
-
export declare const
|
|
14
|
+
export declare const checkboxInputReduxFormExample = "\n #### Ejemplo de uso con Redux Form - CheckboxInput\n \n ```typescript\n <Field\n name=\"salesSync\"\n component={CheckboxInput}\n classComponent={'decrease-stock'}\n props={{\n name: 'cancelSales',\n value: this.salesSync().cancelSales,\n checked: this.salesSync().cancelSales,\n label: this.context.localize('settings.cancelSales')\n }}\n />\n ```\n";
|
package/dist/locales/es.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ declare const _default: {
|
|
|
19
19
|
save: string;
|
|
20
20
|
hideSelectedOptionsExplainText: string;
|
|
21
21
|
description: {
|
|
22
|
-
|
|
22
|
+
checkboxInputReduxFormExample: string;
|
|
23
23
|
onChangeSelectField: string;
|
|
24
24
|
onInputChange: string;
|
|
25
25
|
onChangeSearcher: string;
|
|
@@ -53,7 +53,8 @@ declare const _default: {
|
|
|
53
53
|
};
|
|
54
54
|
checkboxInput: {
|
|
55
55
|
example: string;
|
|
56
|
-
|
|
56
|
+
checkboxInputExample: string;
|
|
57
|
+
checkboxInputGroupExample: string;
|
|
57
58
|
};
|
|
58
59
|
icons: {
|
|
59
60
|
size: string;
|