techsbcn-storybook 0.13.5 → 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 +1 -0
- package/dist/techsbcn-storybook.cjs.development.js +58 -38
- 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 +58 -38
- 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.tsx +1 -0
- 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/wrappers/MainWrapperComponent/MainWrapperComponent.tsx +29 -31
- package/src/interfaces/search/SearchFilters.tsx +1 -1
- package/src/stories/Fields/Fields.stories.tsx +1 -1
|
@@ -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 {};
|
|
@@ -259,10 +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(
|
|
262
|
+
return React__default.createElement(_.Box, {
|
|
263
263
|
className: "main-wrapper-component",
|
|
264
264
|
height: "100%"
|
|
265
265
|
}, React__default.createElement(_.Box, {
|
|
266
|
+
height: "4px"
|
|
267
|
+
}, props.loadingProgressBar && React__default.createElement(LinearProgressComponent, null)), React__default.createElement(_.Box, {
|
|
266
268
|
py: 2
|
|
267
269
|
}, props.loading ? React__default.createElement(_.Box, {
|
|
268
270
|
display: "flex",
|
|
@@ -287,7 +289,7 @@ var MainWrapperComponent = function MainWrapperComponent(props) {
|
|
|
287
289
|
px: 2
|
|
288
290
|
}, React__default.createElement(_.CircularProgress, {
|
|
289
291
|
className: "circular-progress-main-color"
|
|
290
|
-
})) : React__default.createElement(React__default.Fragment, null))))
|
|
292
|
+
})) : React__default.createElement(React__default.Fragment, null))));
|
|
291
293
|
};
|
|
292
294
|
|
|
293
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}";
|
|
@@ -1518,13 +1520,16 @@ var SelectField = function SelectField(props) {
|
|
|
1518
1520
|
ref: props.inputRef,
|
|
1519
1521
|
isDisabled: props.disabled,
|
|
1520
1522
|
isClearable: props.isClearable,
|
|
1521
|
-
isSearchable: props.isSearchable
|
|
1523
|
+
isSearchable: props.isSearchable,
|
|
1524
|
+
isLoading: props.isLoading,
|
|
1525
|
+
menuPlacement: props.menuPlacement
|
|
1522
1526
|
}), props.helperText && React__default.createElement("div", {
|
|
1523
1527
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
1524
1528
|
}, props.helperText));
|
|
1525
1529
|
};
|
|
1526
1530
|
SelectField.defaultProps = {
|
|
1527
|
-
isClearable: true
|
|
1531
|
+
isClearable: true,
|
|
1532
|
+
menuPlacement: 'auto'
|
|
1528
1533
|
};
|
|
1529
1534
|
|
|
1530
1535
|
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {
|
|
@@ -2411,13 +2416,15 @@ var SelectAsyncField = function SelectAsyncField(props) {
|
|
|
2411
2416
|
selectRef: props.inputRef,
|
|
2412
2417
|
isDisabled: props.disabled,
|
|
2413
2418
|
isClearable: props.isClearable,
|
|
2414
|
-
loadOptions: loadOptions
|
|
2419
|
+
loadOptions: loadOptions,
|
|
2420
|
+
menuPlacement: props.menuPlacement
|
|
2415
2421
|
}), props.helperText && React__default.createElement("div", {
|
|
2416
2422
|
className: "helper-text " + (props.invalid ? 'has-error' : '')
|
|
2417
2423
|
}, props.helperText));
|
|
2418
2424
|
};
|
|
2419
2425
|
SelectAsyncField.defaultProps = {
|
|
2420
|
-
isClearable: true
|
|
2426
|
+
isClearable: true,
|
|
2427
|
+
menuPlacement: 'auto'
|
|
2421
2428
|
};
|
|
2422
2429
|
|
|
2423
2430
|
var LoginForm = function LoginForm(props) {
|
|
@@ -2443,10 +2450,6 @@ var LoginForm = function LoginForm(props) {
|
|
|
2443
2450
|
trigger = _useForm.trigger,
|
|
2444
2451
|
errors = _useForm.formState.errors;
|
|
2445
2452
|
|
|
2446
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2447
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2448
|
-
};
|
|
2449
|
-
|
|
2450
2453
|
return React__default.createElement(material.Box, {
|
|
2451
2454
|
m: 2
|
|
2452
2455
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2487,17 +2490,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2487
2490
|
while (1) {
|
|
2488
2491
|
switch (_context.prev = _context.next) {
|
|
2489
2492
|
case 0:
|
|
2490
|
-
|
|
2493
|
+
if (!(e.key === 'Enter')) {
|
|
2494
|
+
_context.next = 5;
|
|
2495
|
+
break;
|
|
2496
|
+
}
|
|
2497
|
+
|
|
2498
|
+
_context.next = 3;
|
|
2491
2499
|
return trigger();
|
|
2492
2500
|
|
|
2493
|
-
case
|
|
2501
|
+
case 3:
|
|
2494
2502
|
result = _context.sent;
|
|
2495
2503
|
|
|
2496
2504
|
if (result) {
|
|
2497
|
-
|
|
2505
|
+
props.onClick(getValues());
|
|
2498
2506
|
}
|
|
2499
2507
|
|
|
2500
|
-
case
|
|
2508
|
+
case 5:
|
|
2501
2509
|
case "end":
|
|
2502
2510
|
return _context.stop();
|
|
2503
2511
|
}
|
|
@@ -2543,17 +2551,22 @@ var LoginForm = function LoginForm(props) {
|
|
|
2543
2551
|
while (1) {
|
|
2544
2552
|
switch (_context2.prev = _context2.next) {
|
|
2545
2553
|
case 0:
|
|
2546
|
-
|
|
2554
|
+
if (!(e.key === 'Enter')) {
|
|
2555
|
+
_context2.next = 5;
|
|
2556
|
+
break;
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
_context2.next = 3;
|
|
2547
2560
|
return trigger();
|
|
2548
2561
|
|
|
2549
|
-
case
|
|
2562
|
+
case 3:
|
|
2550
2563
|
result = _context2.sent;
|
|
2551
2564
|
|
|
2552
2565
|
if (result) {
|
|
2553
|
-
|
|
2566
|
+
props.onClick(getValues());
|
|
2554
2567
|
}
|
|
2555
2568
|
|
|
2556
|
-
case
|
|
2569
|
+
case 5:
|
|
2557
2570
|
case "end":
|
|
2558
2571
|
return _context2.stop();
|
|
2559
2572
|
}
|
|
@@ -2613,10 +2626,6 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2613
2626
|
event.preventDefault();
|
|
2614
2627
|
};
|
|
2615
2628
|
|
|
2616
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2617
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2618
|
-
};
|
|
2619
|
-
|
|
2620
2629
|
return React__default.createElement(_.Box, {
|
|
2621
2630
|
m: 2
|
|
2622
2631
|
}, props.topComponent && React__default.createElement(_.Box, {
|
|
@@ -2657,17 +2666,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2657
2666
|
while (1) {
|
|
2658
2667
|
switch (_context.prev = _context.next) {
|
|
2659
2668
|
case 0:
|
|
2660
|
-
|
|
2669
|
+
if (!(e.key === 'Enter')) {
|
|
2670
|
+
_context.next = 5;
|
|
2671
|
+
break;
|
|
2672
|
+
}
|
|
2673
|
+
|
|
2674
|
+
_context.next = 3;
|
|
2661
2675
|
return trigger();
|
|
2662
2676
|
|
|
2663
|
-
case
|
|
2677
|
+
case 3:
|
|
2664
2678
|
result = _context.sent;
|
|
2665
2679
|
|
|
2666
2680
|
if (result) {
|
|
2667
|
-
|
|
2681
|
+
props.onClick(getValues());
|
|
2668
2682
|
}
|
|
2669
2683
|
|
|
2670
|
-
case
|
|
2684
|
+
case 5:
|
|
2671
2685
|
case "end":
|
|
2672
2686
|
return _context.stop();
|
|
2673
2687
|
}
|
|
@@ -2719,17 +2733,22 @@ var ChangePasswordForm = function ChangePasswordForm(props) {
|
|
|
2719
2733
|
while (1) {
|
|
2720
2734
|
switch (_context2.prev = _context2.next) {
|
|
2721
2735
|
case 0:
|
|
2722
|
-
|
|
2736
|
+
if (!(e.key === 'Enter')) {
|
|
2737
|
+
_context2.next = 5;
|
|
2738
|
+
break;
|
|
2739
|
+
}
|
|
2740
|
+
|
|
2741
|
+
_context2.next = 3;
|
|
2723
2742
|
return trigger();
|
|
2724
2743
|
|
|
2725
|
-
case
|
|
2744
|
+
case 3:
|
|
2726
2745
|
result = _context2.sent;
|
|
2727
2746
|
|
|
2728
2747
|
if (result) {
|
|
2729
|
-
|
|
2748
|
+
props.onClick(getValues());
|
|
2730
2749
|
}
|
|
2731
2750
|
|
|
2732
|
-
case
|
|
2751
|
+
case 5:
|
|
2733
2752
|
case "end":
|
|
2734
2753
|
return _context2.stop();
|
|
2735
2754
|
}
|
|
@@ -2775,10 +2794,6 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2775
2794
|
trigger = _useForm.trigger,
|
|
2776
2795
|
errors = _useForm.formState.errors;
|
|
2777
2796
|
|
|
2778
|
-
var onHandleKeyChange = function onHandleKeyChange(event) {
|
|
2779
|
-
if (event.key === 'Enter') props.onClick(getValues());
|
|
2780
|
-
};
|
|
2781
|
-
|
|
2782
2797
|
return React__default.createElement(material.Box, {
|
|
2783
2798
|
m: 2
|
|
2784
2799
|
}, props.topComponent && React__default.createElement(material.Box, {
|
|
@@ -2813,17 +2828,22 @@ var ResetPasswordForm = function ResetPasswordForm(props) {
|
|
|
2813
2828
|
while (1) {
|
|
2814
2829
|
switch (_context.prev = _context.next) {
|
|
2815
2830
|
case 0:
|
|
2816
|
-
|
|
2831
|
+
if (!(e.key === 'Enter')) {
|
|
2832
|
+
_context.next = 5;
|
|
2833
|
+
break;
|
|
2834
|
+
}
|
|
2835
|
+
|
|
2836
|
+
_context.next = 3;
|
|
2817
2837
|
return trigger();
|
|
2818
2838
|
|
|
2819
|
-
case
|
|
2839
|
+
case 3:
|
|
2820
2840
|
result = _context.sent;
|
|
2821
2841
|
|
|
2822
2842
|
if (result) {
|
|
2823
|
-
|
|
2843
|
+
props.onClick(getValues());
|
|
2824
2844
|
}
|
|
2825
2845
|
|
|
2826
|
-
case
|
|
2846
|
+
case 5:
|
|
2827
2847
|
case "end":
|
|
2828
2848
|
return _context.stop();
|
|
2829
2849
|
}
|