techsbcn-storybook 0.14.0 → 0.14.1
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/fields/TextFieldComponent/TextFieldComponent.d.ts +1 -2
- package/dist/components/forms/ChangePasswordForm.d.ts +1 -0
- package/dist/components/tables/SimpleTableComponent/SimpleTableComponent.d.ts +2 -2
- package/dist/components/tables/TableComponent/TableComponent.d.ts +2 -2
- package/dist/data/_globalization/es.d.ts +1 -0
- package/dist/techsbcn-storybook.cjs.development.js +10 -11
- package/dist/techsbcn-storybook.cjs.development.js.map +1 -1
- package/dist/techsbcn-storybook.cjs.production.min.js +1 -1
- package/dist/techsbcn-storybook.cjs.production.min.js.map +1 -1
- package/dist/techsbcn-storybook.esm.js +10 -11
- package/dist/techsbcn-storybook.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/fields/TextFieldComponent/TextFieldComponent.tsx +1 -1
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.tsx +2 -2
- package/src/components/forms/ChangePasswordForm.tsx +5 -2
- package/src/components/tables/SimpleTableComponent/SimpleTableComponent.tsx +3 -5
- package/src/components/tables/TableComponent/TableComponent.tsx +3 -3
- package/src/data/Values.tsx +1 -0
- package/src/data/_globalization/es.js +1 -0
- package/src/stories/Tables/Tables.stories.tsx +11 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './TextFieldComponent.scss';
|
|
3
3
|
export declare type InputType = 'text' | 'radio' | 'checkbox' | 'textarea' | 'submit' | 'date' | 'hidden' | 'number' | 'range' | 'password' | 'time' | 'file';
|
|
4
|
-
interface TextFieldComponentProps {
|
|
4
|
+
export interface TextFieldComponentProps {
|
|
5
5
|
id?: string;
|
|
6
6
|
label?: string;
|
|
7
7
|
name?: string;
|
|
@@ -31,4 +31,3 @@ interface TextFieldComponentProps {
|
|
|
31
31
|
noBorders?: boolean;
|
|
32
32
|
}
|
|
33
33
|
export declare const TextFieldComponent: React.FC<TextFieldComponentProps>;
|
|
34
|
-
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { ObjectKey } from '../../../interfaces';
|
|
3
3
|
import './SimpleTableComponent.scss';
|
|
4
|
-
import {
|
|
4
|
+
import { TextFieldComponentProps } from '../../fields/TextFieldComponent/TextFieldComponent';
|
|
5
5
|
interface SimpleTableComponentProps {
|
|
6
6
|
rows: any[];
|
|
7
7
|
values: ObjectKey;
|
|
@@ -65,7 +65,7 @@ interface ActionProps {
|
|
|
65
65
|
}
|
|
66
66
|
interface EditableCellProps {
|
|
67
67
|
isTextField?: {
|
|
68
|
-
|
|
68
|
+
textFieldProps?: TextFieldComponentProps;
|
|
69
69
|
onCellValueChange: (data: any) => void;
|
|
70
70
|
};
|
|
71
71
|
isSelectField?: {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SearchFilters, ObjectKey } from '../../../interfaces';
|
|
3
3
|
import './TableComponent.scss';
|
|
4
|
-
import {
|
|
4
|
+
import { TextFieldComponentProps } from '../../fields/TextFieldComponent/TextFieldComponent';
|
|
5
5
|
interface TableComponentProps {
|
|
6
6
|
rows: any[];
|
|
7
7
|
values: ObjectKey;
|
|
@@ -67,7 +67,7 @@ interface ActionProps {
|
|
|
67
67
|
}
|
|
68
68
|
interface EditableCellProps {
|
|
69
69
|
isTextField?: {
|
|
70
|
-
|
|
70
|
+
textFieldProps?: TextFieldComponentProps;
|
|
71
71
|
onCellValueChange: (data: any) => void;
|
|
72
72
|
};
|
|
73
73
|
isSelectField?: {
|
|
@@ -559,12 +559,11 @@ var TableComponent = function TableComponent(props) {
|
|
|
559
559
|
setUpdate();
|
|
560
560
|
};
|
|
561
561
|
|
|
562
|
-
return React__default.createElement(TextFieldComponent, {
|
|
563
|
-
type: editableCell.isTextField.type,
|
|
562
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
564
563
|
onChange: handleTextFieldChange,
|
|
565
564
|
name: fieldName,
|
|
566
565
|
defaultValue: value
|
|
567
|
-
});
|
|
566
|
+
}));
|
|
568
567
|
} else {
|
|
569
568
|
return value;
|
|
570
569
|
}
|
|
@@ -935,14 +934,11 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
935
934
|
setUpdate();
|
|
936
935
|
};
|
|
937
936
|
|
|
938
|
-
return React__default.createElement(TextFieldComponent, {
|
|
939
|
-
type: editableCell.isTextField.type,
|
|
937
|
+
return React__default.createElement(TextFieldComponent, Object.assign({}, editableCell.isTextField.textFieldProps, {
|
|
940
938
|
onChange: handleTextFieldChange,
|
|
941
939
|
name: fieldName,
|
|
942
|
-
defaultValue: value
|
|
943
|
-
|
|
944
|
-
minNumber: 0
|
|
945
|
-
});
|
|
940
|
+
defaultValue: value
|
|
941
|
+
}));
|
|
946
942
|
} else {
|
|
947
943
|
return value;
|
|
948
944
|
}
|
|
@@ -1483,7 +1479,10 @@ var TextSimpleComponent = function TextSimpleComponent(props) {
|
|
|
1483
1479
|
width: "" + (props.fullWidth ? 'auto' : 'fit-content')
|
|
1484
1480
|
}, props.startIcon && React__default.createElement(_.Box, {
|
|
1485
1481
|
mr: 1
|
|
1486
|
-
}, props.startIcon), props.
|
|
1482
|
+
}, props.startIcon), props.isLoading ? React__default.createElement(_.CircularProgress, {
|
|
1483
|
+
className: "circular-progress-main-color",
|
|
1484
|
+
size: 20
|
|
1485
|
+
}) : props.value, props.endIcon && React__default.createElement(_.Box, {
|
|
1487
1486
|
ml: "" + (props.fullWidth ? 'auto' : 1)
|
|
1488
1487
|
}, props.endIcon)), props.helperText && React__default.createElement(_.Box, {
|
|
1489
1488
|
className: "helper-text " + (props.error ? 'has-error' : '')
|
|
@@ -2599,7 +2598,7 @@ var LoginForm = function LoginForm(props) {
|
|
|
2599
2598
|
|
|
2600
2599
|
var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
2601
2600
|
var validationSchema = yup.object().shape({
|
|
2602
|
-
password: yup.string().required(props.requiredText.requiredTextPassword),
|
|
2601
|
+
password: yup.string().required(props.requiredText.requiredTextPassword).matches(/^(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.{6,})/, props.requiredText.requiredPasswordPolices),
|
|
2603
2602
|
passwordConfirmation: yup.string().when('password', function (password, schema) {
|
|
2604
2603
|
if (password) return schema.required(props.requiredText.requiredTextPassword);
|
|
2605
2604
|
}).oneOf([yup.ref('password'), null], props.requiredText.requiredTextSamePassword)
|