techsbcn-storybook 0.13.2 → 0.14.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/fields/SelectFieldComponent/SelectAsyncField.d.ts +2 -0
- package/dist/components/fields/SelectFieldComponent/SelectField.d.ts +3 -0
- package/dist/components/fields/TextSimpleComponent/TextSimpleComponent.d.ts +2 -1
- package/dist/techsbcn-storybook.cjs.development.js +64 -41
- 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 +64 -41
- package/dist/techsbcn-storybook.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/fields/SelectFieldComponent/SelectAsyncField.tsx +5 -0
- package/src/components/fields/SelectFieldComponent/SelectField.tsx +7 -0
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.scss +2 -2
- package/src/components/fields/TextSimpleComponent/TextSimpleComponent.tsx +2 -1
- package/src/components/forms/ChangePasswordForm.tsx +10 -10
- package/src/components/forms/LoginForm.tsx +10 -10
- package/src/components/forms/ResetPasswordForm.tsx +5 -7
- package/src/components/tables/SimpleTableComponent/SimpleTableComponent.tsx +2 -0
- package/src/components/wrappers/MainWrapperComponent/MainWrapperComponent.tsx +29 -31
- package/src/interfaces/search/SearchFilters.tsx +1 -1
- package/src/stories/Fields/Fields.stories.tsx +1 -1
- package/src/stories/Tables/Tables.stories.tsx +1 -0
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import { SearchFilters } from '../../../interfaces';
|
|
3
3
|
import './SelectField.scss';
|
|
4
|
+
declare type MenuPlacement = 'bottom' | 'auto' | 'top';
|
|
4
5
|
interface SelectAsyncFieldProps {
|
|
5
6
|
name: string;
|
|
6
7
|
placeholder?: string;
|
|
@@ -18,6 +19,7 @@ interface SelectAsyncFieldProps {
|
|
|
18
19
|
filters?: any;
|
|
19
20
|
inputRef?: React.Ref<any>;
|
|
20
21
|
label?: string;
|
|
22
|
+
menuPlacement?: MenuPlacement;
|
|
21
23
|
}
|
|
22
24
|
export declare const SelectAsyncField: React.FunctionComponent<SelectAsyncFieldProps>;
|
|
23
25
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './SelectField.scss';
|
|
3
|
+
declare type MenuPlacement = 'bottom' | 'auto' | 'top';
|
|
3
4
|
interface SelectFieldProps {
|
|
4
5
|
name: string;
|
|
5
6
|
placeholder?: string;
|
|
@@ -16,6 +17,8 @@ interface SelectFieldProps {
|
|
|
16
17
|
isSearchable?: boolean;
|
|
17
18
|
inputRef?: React.Ref<any>;
|
|
18
19
|
label?: string;
|
|
20
|
+
menuPlacement?: MenuPlacement;
|
|
21
|
+
isLoading?: boolean;
|
|
19
22
|
}
|
|
20
23
|
export declare const SelectField: React.FunctionComponent<SelectFieldProps>;
|
|
21
24
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import './TextSimpleComponent.scss';
|
|
3
3
|
interface TextSimpleComponentProps {
|
|
4
|
-
label?:
|
|
4
|
+
label?: any;
|
|
5
5
|
value?: any;
|
|
6
6
|
className?: string;
|
|
7
7
|
error?: boolean;
|
|
@@ -11,6 +11,7 @@ interface TextSimpleComponentProps {
|
|
|
11
11
|
noBorders?: boolean;
|
|
12
12
|
fullWidth?: boolean;
|
|
13
13
|
noMargin?: boolean;
|
|
14
|
+
isLoading?: boolean;
|
|
14
15
|
}
|
|
15
16
|
export declare const TextSimpleComponent: React.FC<TextSimpleComponentProps>;
|
|
16
17
|
export {};
|
|
@@ -259,9 +259,12 @@ var css_248z$3 = ".main-wrapper-component {\n background-color: white;\n box-s
|
|
|
259
259
|
styleInject(css_248z$3);
|
|
260
260
|
|
|
261
261
|
var MainWrapperComponent = function MainWrapperComponent(props) {
|
|
262
|
-
return React__default.createElement(
|
|
263
|
-
className: "main-wrapper-component"
|
|
262
|
+
return React__default.createElement(_.Box, {
|
|
263
|
+
className: "main-wrapper-component",
|
|
264
|
+
height: "100%"
|
|
264
265
|
}, React__default.createElement(_.Box, {
|
|
266
|
+
height: "4px"
|
|
267
|
+
}, props.loadingProgressBar && React__default.createElement(LinearProgressComponent, null)), React__default.createElement(_.Box, {
|
|
265
268
|
py: 2
|
|
266
269
|
}, props.loading ? React__default.createElement(_.Box, {
|
|
267
270
|
display: "flex",
|
|
@@ -286,7 +289,7 @@ var MainWrapperComponent = function MainWrapperComponent(props) {
|
|
|
286
289
|
px: 2
|
|
287
290
|
}, React__default.createElement(_.CircularProgress, {
|
|
288
291
|
className: "circular-progress-main-color"
|
|
289
|
-
})) : React__default.createElement(React__default.Fragment, null))))
|
|
292
|
+
})) : React__default.createElement(React__default.Fragment, null))));
|
|
290
293
|
};
|
|
291
294
|
|
|
292
295
|
var css_248z$4 = ".table-component .paper-container {\n box-shadow: none;\n background-color: transparent !important;\n}\n.table-component .paper-container .checkbox-cell .MuiCheckbox-root {\n padding: 0 !important;\n}\n.table-component .paper-container .checkbox-cell .MuiCheckbox-root:hover {\n background-color: transparent !important;\n}\n.table-component .paper-container .checkbox-cell .Mui-checked {\n color: rgba(0, 0, 0, 0.54) !important;\n}\n.table-component .paper-container .checkbox-cell .MuiCheckbox-indeterminate {\n color: #212529 !important;\n}\n.table-component .paper-container .table-container {\n max-height: 68vh;\n border-bottom: 1px solid black;\n}\n.table-component .paper-container .table-container .table-column:first-child {\n border-radius: 5px 0 0 5px;\n}\n.table-component .paper-container .table-container .table-column:last-child {\n border-right: none !important;\n border-radius: 0 5px 5px 0;\n}\n.table-component .paper-container .table-container .table-column {\n font-weight: bold;\n font-size: 1rem !important;\n padding: 10px !important;\n border-top: 1px solid #e0e0e0;\n border-right: 1px solid #e0e0e0;\n border-bottom: 2px solid #e0e0e0;\n}\n.table-component .paper-container .table-container .table-column .table-header-cell {\n color: black;\n padding: 0px 10px 0px 10px !important;\n}\n.table-component .paper-container .table-container .table-rows.row-click {\n cursor: pointer;\n}\n.table-component .paper-container .table-container .table-rows.row-click:hover {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.table-component .paper-container .table-container .table-rows.Mui-selected {\n background-color: rgba(0, 0, 0, 0.04);\n}\n.table-component .paper-container .table-container .table-rows .Mui-selected {\n background-color: transparent !important;\n}\n.table-component .paper-container .table-container .table-rows .MuiTableCell-root {\n padding: 6px !important;\n overflow: hidden;\n}\n.table-component .paper-container .table-container .table-rows .img-table {\n width: 100%;\n height: 110px;\n}\n.table-component .paper-container .table-container .table-rows .img-table img {\n object-fit: contain;\n}\n.table-component .paper-container .table-container .table-rows .actions {\n float: right;\n}\n.table-component .paper-container .table-container .table-rows .btn-action {\n color: rgba(0, 0, 0, 0.54);\n display: inline-block;\n text-decoration: none;\n font-size: 1.6em !important;\n padding: 0px 7px;\n cursor: pointer;\n}\n.table-component .paper-container .MuiTable-root.loading {\n opacity: 0.5;\n}\n.table-component .paper-container .MuiTable-root.loading .MuiCircularProgress-root {\n width: 80px !important;\n height: 80px !important;\n position: absolute;\n left: 0;\n right: 0;\n top: 5px;\n margin: auto;\n color: grey;\n}\n.table-component .paper-container .MuiTablePagination-root {\n overflow: unset;\n}\n.table-component .paper-container .MuiTablePagination-root .MuiToolbar-root {\n justify-content: center !important;\n flex-wrap: wrap;\n padding: 0px !important;\n}\n.table-component .paper-container .MuiTablePagination-root .MuiTablePagination-spacer {\n flex: 0 !important;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination .MuiPaginationItem-page {\n border-radius: 0px;\n margin: 1px;\n color: white !important;\n background-color: #3f4d67;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination .MuiPaginationItem-page.Mui-selected {\n background-color: #3299C7;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination li button {\n padding: 14px;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination li:nth-child(2) .MuiPaginationItem-page {\n border-radius: 5px 0 0 5px !important;\n}\n.table-component .paper-container .MuiTablePagination-root .pagination li:nth-last-child(2) .MuiPaginationItem-page {\n border-radius: 0 5px 5px 0 !important;\n}\n@media (max-width: 992px) {\n .table-component .paper-container .table-container {\n max-height: 60vh;\n border-top: 1px solid #cccccc;\n }\n .table-component .paper-container .table-container .MuiTable-root {\n border-collapse: collapse !important;\n }\n .table-component .paper-container .table-container .MuiTableHead-root {\n display: none !important;\n }\n .table-component .paper-container .table-container .table-rows {\n border-bottom: 2px solid #cccccc;\n }\n .table-component .paper-container .table-container .table-rows .MuiTableCell-root {\n width: auto;\n border-bottom: none !important;\n }\n .table-component .paper-container .table-container .table-rows .MuiTableCell-root .label-cell {\n font-size: 1rem;\n vertical-align: top;\n width: 50%;\n height: auto;\n }\n .table-component .paper-container .table-container .table-rows .MuiTableCell-root .label-cell + div {\n display: inline-block;\n }\n .table-component .paper-container .table-container .table-rows .table-cell {\n display: block !important;\n }\n .table-component .paper-container .table-container .table-rows .format-value {\n text-overflow: ellipsis;\n white-space: nowrap;\n overflow: hidden;\n width: 50%;\n max-width: 299px;\n }\n}";
|
|
@@ -936,7 +939,9 @@ var SimpleTableComponent = function SimpleTableComponent(props) {
|
|
|
936
939
|
type: editableCell.isTextField.type,
|
|
937
940
|
onChange: handleTextFieldChange,
|
|
938
941
|
name: fieldName,
|
|
939
|
-
defaultValue: value
|
|
942
|
+
defaultValue: value,
|
|
943
|
+
step: "any",
|
|
944
|
+
minNumber: 0
|
|
940
945
|
});
|
|
941
946
|
} else {
|
|
942
947
|
return value;
|
|
@@ -1463,7 +1468,7 @@ ButtonComponent.defaultProps = {
|
|
|
1463
1468
|
component: 'button'
|
|
1464
1469
|
};
|
|
1465
1470
|
|
|
1466
|
-
var css_248z$e = ".text-simple-component .MuiFormLabel-root {\n color: #666666
|
|
1471
|
+
var css_248z$e = ".text-simple-component .MuiFormLabel-root {\n color: #666666;\n font-size: calc(12pt + (14 - 12) * calc(100vw - 300px)/1300) !important;\n transform: translate(0, 0.5px) scale(0.85);\n transform-origin: top left;\n text-overflow: initial !important;\n}\n.text-simple-component .MuiFormLabel-root + .text-simple-box.no-border {\n margin-top: 16px !important;\n}\n.text-simple-component .MuiFormLabel-root + .text-simple-box.no-margin.no-border {\n margin-top: 7px !important;\n}\n.text-simple-component .text-simple-box.no-border {\n border: none !important;\n padding: 0 !important;\n}\n.text-simple-component .text-simple-box {\n color: #666666;\n font-size: 1rem;\n border: 1px solid grey;\n padding: 0.868rem;\n border-radius: 3px !important;\n}\n.text-simple-component .helper-text {\n font-size: 0.85rem !important;\n padding: 0 !important;\n margin-top: 3px;\n line-height: 1.66;\n color: #666666 !important;\n letter-spacing: 0.03333em;\n}\n.text-simple-component .has-error-border {\n border-color: #F24726 !important;\n}\n.text-simple-component .has-error {\n color: #F24726 !important;\n}";
|
|
1467
1472
|
styleInject(css_248z$e);
|
|
1468
1473
|
|
|
1469
1474
|
var TextSimpleComponent = function TextSimpleComponent(props) {
|
|
@@ -1515,13 +1520,16 @@ var SelectField = function SelectField(props) {
|
|
|
1515
1520
|
ref: props.inputRef,
|
|
1516
1521
|
isDisabled: props.disabled,
|
|
1517
1522
|
isClearable: props.isClearable,
|
|
1518
|
-
isSearchable: props.isSearchable
|
|
1523
|
+
isSearchable: props.isSearchable,
|
|
1524
|
+
isLoading: props.isLoading,
|
|
1525
|
+
menuPlacement: props.menuPlacement
|
|
1519
1526
|
}), props.helperText && React__default.createElement("div", {
|
|
1520
1527
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
1521
1528
|
}, props.helperText));
|
|
1522
1529
|
};
|
|
1523
1530
|
SelectField.defaultProps = {
|
|
1524
|
-
isClearable: true
|
|
1531
|
+
isClearable: true,
|
|
1532
|
+
menuPlacement: 'auto'
|
|
1525
1533
|
};
|
|
1526
1534
|
|
|
1527
1535
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2408,13 +2416,15 @@ var SelectAsyncField = function SelectAsyncField(props) {
|
|
|
2408
2416
|
selectRef: props.inputRef,
|
|
2409
2417
|
isDisabled: props.disabled,
|
|
2410
2418
|
isClearable: props.isClearable,
|
|
2411
|
-
loadOptions: loadOptions
|
|
2419
|
+
loadOptions: loadOptions,
|
|
2420
|
+
menuPlacement: props.menuPlacement
|
|
2412
2421
|
}), props.helperText && React__default.createElement("div", {
|
|
2413
2422
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
2414
2423
|
}, props.helperText));
|
|
2415
2424
|
};
|
|
2416
2425
|
SelectAsyncField.defaultProps = {
|
|
2417
|
-
isClearable: true
|
|
2426
|
+
isClearable: true,
|
|
2427
|
+
menuPlacement: 'auto'
|
|
2418
2428
|
};
|
|
2419
2429
|
|
|
2420
2430
|
var LoginForm = function LoginForm(props) {
|
|
@@ -2440,10 +2450,6 @@ var LoginForm = function LoginForm(props) {
|
|
|
2440
2450
|
trigger = _useForm.trigger,
|
|
2441
2451
|
errors = _useForm.formState.errors;
|
|
2442
2452
|
|
|
2443
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2444
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2445
|
-
};
|
|
2446
|
-
|
|
2447
2453
|
return React__default.createElement(material.Box, {
|
|
2448
2454
|
m: 2
|
|
2449
2455
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2484,17 +2490,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2484
2490
|
while (1) {
|
|
2485
2491
|
switch (_context.prev = _context.next) {
|
|
2486
2492
|
case 0:
|
|
2487
|
-
|
|
2493
|
+
if (!(e.key === 'Enter')) {
|
|
2494
|
+
_context.next = 5;
|
|
2495
|
+
break;
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
_context.next = 3;
|
|
2488
2499
|
return trigger();
|
|
2489
2500
|
|
|
2490
|
-
case
|
|
2501
|
+
case 3:
|
|
2491
2502
|
result = _context.sent;
|
|
2492
2503
|
|
|
2493
2504
|
if (result) {
|
|
2494
|
-
|
|
2505
|
+
props.onClick(getValues());
|
|
2495
2506
|
}
|
|
2496
2507
|
|
|
2497
|
-
case
|
|
2508
|
+
case 5:
|
|
2498
2509
|
case "end":
|
|
2499
2510
|
return _context.stop();
|
|
2500
2511
|
}
|
|
@@ -2540,17 +2551,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2540
2551
|
while (1) {
|
|
2541
2552
|
switch (_context2.prev = _context2.next) {
|
|
2542
2553
|
case 0:
|
|
2543
|
-
|
|
2554
|
+
if (!(e.key === 'Enter')) {
|
|
2555
|
+
_context2.next = 5;
|
|
2556
|
+
break;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
_context2.next = 3;
|
|
2544
2560
|
return trigger();
|
|
2545
2561
|
|
|
2546
|
-
case
|
|
2562
|
+
case 3:
|
|
2547
2563
|
result = _context2.sent;
|
|
2548
2564
|
|
|
2549
2565
|
if (result) {
|
|
2550
|
-
|
|
2566
|
+
props.onClick(getValues());
|
|
2551
2567
|
}
|
|
2552
2568
|
|
|
2553
|
-
case
|
|
2569
|
+
case 5:
|
|
2554
2570
|
case "end":
|
|
2555
2571
|
return _context2.stop();
|
|
2556
2572
|
}
|
|
@@ -2610,10 +2626,6 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2610
2626
|
event.preventDefault();
|
|
2611
2627
|
};
|
|
2612
2628
|
|
|
2613
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2614
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2615
|
-
};
|
|
2616
|
-
|
|
2617
2629
|
return React__default.createElement(_.Box, {
|
|
2618
2630
|
m: 2
|
|
2619
2631
|
}, props.topComponent && React__default.createElement(_.Box, {
|
|
@@ -2654,17 +2666,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2654
2666
|
while (1) {
|
|
2655
2667
|
switch (_context.prev = _context.next) {
|
|
2656
2668
|
case 0:
|
|
2657
|
-
|
|
2669
|
+
if (!(e.key === 'Enter')) {
|
|
2670
|
+
_context.next = 5;
|
|
2671
|
+
break;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
_context.next = 3;
|
|
2658
2675
|
return trigger();
|
|
2659
2676
|
|
|
2660
|
-
case
|
|
2677
|
+
case 3:
|
|
2661
2678
|
result = _context.sent;
|
|
2662
2679
|
|
|
2663
2680
|
if (result) {
|
|
2664
|
-
|
|
2681
|
+
props.onClick(getValues());
|
|
2665
2682
|
}
|
|
2666
2683
|
|
|
2667
|
-
case
|
|
2684
|
+
case 5:
|
|
2668
2685
|
case "end":
|
|
2669
2686
|
return _context.stop();
|
|
2670
2687
|
}
|
|
@@ -2716,17 +2733,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2716
2733
|
while (1) {
|
|
2717
2734
|
switch (_context2.prev = _context2.next) {
|
|
2718
2735
|
case 0:
|
|
2719
|
-
|
|
2736
|
+
if (!(e.key === 'Enter')) {
|
|
2737
|
+
_context2.next = 5;
|
|
2738
|
+
break;
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
_context2.next = 3;
|
|
2720
2742
|
return trigger();
|
|
2721
2743
|
|
|
2722
|
-
case
|
|
2744
|
+
case 3:
|
|
2723
2745
|
result = _context2.sent;
|
|
2724
2746
|
|
|
2725
2747
|
if (result) {
|
|
2726
|
-
|
|
2748
|
+
props.onClick(getValues());
|
|
2727
2749
|
}
|
|
2728
2750
|
|
|
2729
|
-
case
|
|
2751
|
+
case 5:
|
|
2730
2752
|
case "end":
|
|
2731
2753
|
return _context2.stop();
|
|
2732
2754
|
}
|
|
@@ -2772,10 +2794,6 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2772
2794
|
trigger = _useForm.trigger,
|
|
2773
2795
|
errors = _useForm.formState.errors;
|
|
2774
2796
|
|
|
2775
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2776
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2777
|
-
};
|
|
2778
|
-
|
|
2779
2797
|
return React__default.createElement(material.Box, {
|
|
2780
2798
|
m: 2
|
|
2781
2799
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2810,17 +2828,22 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2810
2828
|
while (1) {
|
|
2811
2829
|
switch (_context.prev = _context.next) {
|
|
2812
2830
|
case 0:
|
|
2813
|
-
|
|
2831
|
+
if (!(e.key === 'Enter')) {
|
|
2832
|
+
_context.next = 5;
|
|
2833
|
+
break;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
_context.next = 3;
|
|
2814
2837
|
return trigger();
|
|
2815
2838
|
|
|
2816
|
-
case
|
|
2839
|
+
case 3:
|
|
2817
2840
|
result = _context.sent;
|
|
2818
2841
|
|
|
2819
2842
|
if (result) {
|
|
2820
|
-
|
|
2843
|
+
props.onClick(getValues());
|
|
2821
2844
|
}
|
|
2822
2845
|
|
|
2823
|
-
case
|
|
2846
|
+
case 5:
|
|
2824
2847
|
case "end":
|
|
2825
2848
|
return _context.stop();
|
|
2826
2849
|
}
|