@fixefy/fixefy-ui-components 0.0.5 → 0.0.6
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/ActionsTray/{actions_tray.jsx → ActionsTray.jsx} +46 -46
- package/dist-cjs/ActionsTray/index.js +4 -0
- package/dist-cjs/ActionsTray/styles/{actionsTray.styles.jsx → actions_tray.styles.jsx} +1 -1
- package/dist-cjs/AggregationsBar/Aggregations.jsx +27 -0
- package/dist-cjs/AggregationsBar/helpers/structureReader.jsx +41 -0
- package/dist-cjs/AggregationsBar/index.js +5 -0
- package/dist-cjs/AggregationsBar/operations/query.js +66 -0
- package/dist-cjs/AsyncDropdown/AsyncDropdown.jsx +209 -0
- package/dist-cjs/AsyncDropdown/helpers/helpers.js +81 -0
- package/dist-cjs/AsyncDropdown/index.js +5 -0
- package/dist-cjs/AsyncDropdown/styles/dropdown.styles.jsx +130 -0
- package/dist-cjs/FxAvatar/FxAvatar.jsx +34 -0
- package/dist-cjs/FxAvatar/helpers/stringToColor.js +17 -0
- package/dist-cjs/FxAvatar/index.js +5 -0
- package/dist-cjs/FxAvatar/styles/avatar.styles.jsx +75 -0
- package/dist-cjs/FxButton/{button.jsx → FxButton.jsx} +3 -3
- package/dist-cjs/FxButton/index.js +3 -3
- package/dist-cjs/FxChip/FxChip.jsx +14 -0
- package/dist-cjs/FxChip/index.js +5 -0
- package/dist-cjs/FxChip/styles/chip.styles.jsx +48 -0
- package/dist-cjs/FxIcon/FxIcon.jsx +29 -0
- package/dist-cjs/FxIcon/content/dynamic_icon.jsx +7 -0
- package/dist-cjs/FxIcon/content/index.js +7 -0
- package/dist-cjs/FxIcon/content/lazy_icon.jsx +22 -0
- package/dist-cjs/FxIcon/index.js +5 -0
- package/dist-cjs/FxModal/FxModal.jsx +36 -0
- package/dist-cjs/FxModal/index.js +5 -0
- package/dist-cjs/FxModal/styles/modal.style.jsx +34 -0
- package/dist-cjs/FxNotes/FxNotes.jsx +101 -0
- package/dist-cjs/FxNotes/helpers/stringToColor.js +20 -0
- package/dist-cjs/FxNotes/index.js +5 -0
- package/dist-cjs/FxNotes/operations/queries.js +24 -0
- package/dist-cjs/FxNotes/styles/notes.styles.jsx +120 -0
- package/dist-cjs/FxNumberField/FxNumberField.jsx +30 -0
- package/dist-cjs/FxNumberField/index.js +5 -0
- package/dist-cjs/FxNumberField/styles/number_field.styles.js +87 -0
- package/dist-cjs/FxProgressCircle/FxProgressCircle.jsx +28 -0
- package/dist-cjs/FxProgressCircle/index.js +5 -0
- package/dist-cjs/FxProgressCircle/styles/progress_circle.styles.jsx +27 -0
- package/dist-cjs/FxProgressCounter/ProgressCounter.jsx +45 -0
- package/dist-cjs/FxProgressCounter/index.js +5 -0
- package/dist-cjs/FxProgressCounter/styles/progress_counter.styles.js +36 -0
- package/dist-cjs/FxShowMore/FxShowMore.jsx +47 -0
- package/dist-cjs/FxShowMore/index.js +5 -0
- package/dist-cjs/FxShowMore/styles/show_more.styles.js +43 -0
- package/dist-cjs/FxSlider/FxSlider.jsx +10 -0
- package/dist-cjs/FxSlider/index.js +5 -0
- package/dist-cjs/Score/Score.jsx +57 -0
- package/dist-cjs/Score/index.js +5 -0
- package/dist-cjs/Score/styles/score.styles.js +33 -0
- package/dist-cjs/StatisticsBar/StatisticsBar.jsx +95 -0
- package/dist-cjs/StatisticsBar/index.js +5 -0
- package/dist-cjs/StatisticsBar/styles/statistics.styles.js +33 -0
- package/dist-cjs/Tag/Tag.jsx +6 -6
- package/dist-cjs/index.js +15 -3
- package/dist-es/ActionsTray/{actions_tray.jsx → ActionsTray.jsx} +1 -1
- package/dist-es/ActionsTray/index.js +1 -1
- package/dist-es/ActionsTray/styles/{actionsTray.styles.jsx → actions_tray.styles.jsx} +2 -2
- package/dist-es/AggregationsBar/Aggregations.jsx +22 -0
- package/dist-es/AggregationsBar/helpers/structureReader.jsx +32 -0
- package/dist-es/AggregationsBar/index.js +1 -0
- package/dist-es/AggregationsBar/operations/query.js +63 -0
- package/dist-es/AsyncDropdown/AsyncDropdown.jsx +228 -0
- package/dist-es/AsyncDropdown/helpers/helpers.js +77 -0
- package/dist-es/AsyncDropdown/index.js +1 -0
- package/dist-es/AsyncDropdown/styles/dropdown.styles.jsx +143 -0
- package/dist-es/FxAvatar/FxAvatar.jsx +32 -0
- package/dist-es/FxAvatar/helpers/stringToColor.js +13 -0
- package/dist-es/FxAvatar/index.js +1 -0
- package/dist-es/FxAvatar/styles/avatar.styles.jsx +68 -0
- package/dist-es/FxButton/{button.jsx → FxButton.jsx} +1 -1
- package/dist-es/FxButton/index.js +1 -1
- package/dist-es/FxChip/FxChip.jsx +9 -0
- package/dist-es/FxChip/index.js +1 -0
- package/dist-es/FxChip/styles/chip.styles.jsx +45 -0
- package/dist-es/FxIcon/FxIcon.jsx +24 -0
- package/dist-es/FxIcon/content/dynamic_icon.jsx +2 -0
- package/dist-es/FxIcon/content/index.js +2 -0
- package/dist-es/FxIcon/content/lazy_icon.jsx +17 -0
- package/dist-es/FxIcon/index.js +1 -0
- package/dist-es/FxModal/FxModal.jsx +30 -0
- package/dist-es/FxModal/index.js +1 -0
- package/dist-es/FxModal/styles/modal.style.jsx +31 -0
- package/dist-es/FxNotes/FxNotes.jsx +102 -0
- package/dist-es/FxNotes/helpers/stringToColor.js +16 -0
- package/dist-es/FxNotes/index.js +1 -0
- package/dist-es/FxNotes/operations/queries.js +20 -0
- package/dist-es/FxNotes/styles/notes.styles.jsx +116 -0
- package/dist-es/FxNumberField/FxNumberField.jsx +25 -0
- package/dist-es/FxNumberField/index.js +1 -0
- package/dist-es/FxNumberField/styles/number_field.styles.js +84 -0
- package/dist-es/FxProgressCircle/FxProgressCircle.jsx +23 -0
- package/dist-es/FxProgressCircle/index.js +1 -0
- package/dist-es/FxProgressCircle/styles/progress_circle.styles.jsx +28 -0
- package/dist-es/FxProgressCounter/ProgressCounter.jsx +38 -0
- package/dist-es/FxProgressCounter/index.js +1 -0
- package/dist-es/FxProgressCounter/styles/progress_counter.styles.js +33 -0
- package/dist-es/FxShowMore/FxShowMore.jsx +42 -0
- package/dist-es/FxShowMore/index.js +1 -0
- package/dist-es/FxShowMore/styles/show_more.styles.js +53 -0
- package/dist-es/FxSlider/FxSlider.jsx +5 -0
- package/dist-es/FxSlider/index.js +1 -0
- package/dist-es/Score/Score.jsx +57 -0
- package/dist-es/Score/index.js +1 -0
- package/dist-es/Score/styles/score.styles.js +35 -0
- package/dist-es/StatisticsBar/StatisticsBar.jsx +91 -0
- package/dist-es/StatisticsBar/index.js +1 -0
- package/dist-es/StatisticsBar/styles/statistics.styles.js +38 -0
- package/dist-es/Tag/Tag.jsx +6 -6
- package/dist-es/index.js +7 -1
- package/dist-types/ActionsTray/{actions_tray.d.ts → ActionsTray.d.ts} +2 -2
- package/dist-types/ActionsTray/index.d.ts +2 -0
- package/dist-types/AggregationsBar/Aggregations.d.ts +3 -0
- package/dist-types/AggregationsBar/helpers/structureReader.d.ts +1 -0
- package/dist-types/AggregationsBar/index.d.ts +2 -0
- package/dist-types/AggregationsBar/operations/query.d.ts +1 -0
- package/dist-types/AsyncDropdown/AsyncDropdown.d.ts +3 -0
- package/dist-types/AsyncDropdown/helpers/helpers.d.ts +4 -0
- package/dist-types/AsyncDropdown/index.d.ts +2 -0
- package/dist-types/AsyncDropdown/styles/dropdown.styles.d.ts +7 -0
- package/dist-types/FxAvatar/FxAvatar.d.ts +3 -0
- package/dist-types/FxAvatar/helpers/stringToColor.d.ts +1 -0
- package/dist-types/FxAvatar/index.d.ts +2 -0
- package/dist-types/FxAvatar/styles/avatar.styles.d.ts +7 -0
- package/dist-types/FxButton/FxButton.d.ts +6 -0
- package/dist-types/FxButton/index.d.ts +2 -2
- package/dist-types/FxChip/FxChip.d.ts +3 -0
- package/dist-types/FxChip/index.d.ts +2 -0
- package/dist-types/FxChip/styles/chip.styles.d.ts +3 -0
- package/dist-types/FxIcon/FxIcon.d.ts +3 -0
- package/dist-types/FxIcon/content/dynamic_icon.d.ts +5 -0
- package/dist-types/FxIcon/content/index.d.ts +2 -0
- package/dist-types/FxIcon/content/lazy_icon.d.ts +9 -0
- package/dist-types/FxIcon/index.d.ts +1 -0
- package/dist-types/FxModal/FxModal.d.ts +3 -0
- package/dist-types/FxModal/index.d.ts +2 -0
- package/dist-types/FxModal/styles/modal.style.d.ts +4 -0
- package/dist-types/FxNotes/FxNotes.d.ts +3 -0
- package/dist-types/FxNotes/helpers/stringToColor.d.ts +1 -0
- package/dist-types/FxNotes/index.d.ts +2 -0
- package/dist-types/FxNotes/operations/queries.d.ts +1 -0
- package/dist-types/FxNotes/styles/notes.styles.d.ts +13 -0
- package/dist-types/FxNumberField/FxNumberField.d.ts +3 -0
- package/dist-types/FxNumberField/index.d.ts +2 -0
- package/dist-types/FxNumberField/styles/number_field.styles.d.ts +1 -0
- package/dist-types/FxProgressCircle/FxProgressCircle.d.ts +3 -0
- package/dist-types/FxProgressCircle/index.d.ts +2 -0
- package/dist-types/FxProgressCircle/styles/progress_circle.styles.d.ts +5 -0
- package/dist-types/FxProgressCounter/ProgressCounter.d.ts +3 -0
- package/dist-types/FxProgressCounter/index.d.ts +2 -0
- package/dist-types/FxProgressCounter/styles/progress_counter.styles.d.ts +5 -0
- package/dist-types/FxShowMore/FxShowMore.d.ts +3 -0
- package/dist-types/FxShowMore/index.d.ts +2 -0
- package/dist-types/FxShowMore/styles/show_more.styles.d.ts +6 -0
- package/dist-types/FxSlider/FxSlider.d.ts +3 -0
- package/dist-types/FxSlider/index.d.ts +2 -0
- package/dist-types/Score/Score.d.ts +3 -0
- package/dist-types/Score/index.d.ts +2 -0
- package/dist-types/Score/styles/score.styles.d.ts +7 -0
- package/dist-types/StatisticsBar/StatisticsBar.d.ts +3 -0
- package/dist-types/StatisticsBar/index.d.ts +2 -0
- package/dist-types/StatisticsBar/styles/statistics.styles.d.ts +2 -0
- package/dist-types/Tag/Tag.d.ts +2 -2
- package/dist-types/Tag/index.d.ts +1 -1
- package/dist-types/index.d.ts +9 -4
- package/package.json +5 -2
- package/dist-types/FxButton/button.d.ts +0 -6
- /package/dist-types/ActionsTray/styles/{actionsTray.styles.d.ts → actions_tray.styles.d.ts} +0 -0
|
@@ -6,7 +6,7 @@ const react_1 = tslib_1.__importDefault(require("react"));
|
|
|
6
6
|
const image_1 = tslib_1.__importDefault(require("next/image"));
|
|
7
7
|
const material_1 = require("@mui/material");
|
|
8
8
|
const fixefy_ui_utils_1 = require("@fixefy/fixefy-ui-utils");
|
|
9
|
-
const
|
|
9
|
+
const actions_tray_styles_1 = require("./styles/actions_tray.styles");
|
|
10
10
|
function ActionsTray({ type, onApprove, onChallenge, onClick, show, onClose, chargesCount, container, direction = 'up' }) {
|
|
11
11
|
const renderActions = () => {
|
|
12
12
|
switch (type) {
|
|
@@ -24,123 +24,123 @@ function ActionsTray({ type, onApprove, onChallenge, onClick, show, onClose, cha
|
|
|
24
24
|
};
|
|
25
25
|
return (<div>
|
|
26
26
|
<material_1.Slide direction={direction} in={show} mountOnEnter unmountOnExit timeout={400} container={container}>
|
|
27
|
-
<
|
|
28
|
-
<
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
</
|
|
32
|
-
<
|
|
27
|
+
<actions_tray_styles_1.Container>
|
|
28
|
+
<actions_tray_styles_1.TitleWrapper>
|
|
29
|
+
<actions_tray_styles_1.ChargesCount>{chargesCount}</actions_tray_styles_1.ChargesCount>
|
|
30
|
+
<actions_tray_styles_1.ChargesTitle>charges selected</actions_tray_styles_1.ChargesTitle>
|
|
31
|
+
</actions_tray_styles_1.TitleWrapper>
|
|
32
|
+
<actions_tray_styles_1.Divider />
|
|
33
33
|
<div>
|
|
34
34
|
{renderActions()}
|
|
35
35
|
|
|
36
36
|
</div>
|
|
37
|
-
<
|
|
37
|
+
<actions_tray_styles_1.Divider />
|
|
38
38
|
<div onClick={onClose}>
|
|
39
|
-
<
|
|
39
|
+
<actions_tray_styles_1.Close>close</actions_tray_styles_1.Close>
|
|
40
40
|
</div>
|
|
41
|
-
</
|
|
41
|
+
</actions_tray_styles_1.Container>
|
|
42
42
|
</material_1.Slide>
|
|
43
43
|
</div>);
|
|
44
44
|
}
|
|
45
45
|
exports.ActionsTray = ActionsTray;
|
|
46
46
|
const ChallengeActions = ({ onChallenge, onApprove }) => {
|
|
47
47
|
return (<>
|
|
48
|
-
<
|
|
48
|
+
<actions_tray_styles_1.ActionBtn onClick={onChallenge} type="low">
|
|
49
49
|
<image_1.default alt="challenge" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
50
50
|
root: 'https://cdn-dev.fixefy.me/',
|
|
51
51
|
src: 'actions/challenge.svg',
|
|
52
52
|
})} src={'actions/challenge.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
53
|
-
<
|
|
54
|
-
</
|
|
55
|
-
<
|
|
53
|
+
<actions_tray_styles_1.ActionTitle>challenge</actions_tray_styles_1.ActionTitle>
|
|
54
|
+
</actions_tray_styles_1.ActionBtn>
|
|
55
|
+
<actions_tray_styles_1.ActionBtn onClick={onApprove}>
|
|
56
56
|
<image_1.default alt="approve" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
57
57
|
root: 'https://cdn-dev.fixefy.me/',
|
|
58
58
|
src: 'actions/approve.svg',
|
|
59
59
|
})} src={'actions/approve.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
60
|
-
<
|
|
61
|
-
</
|
|
62
|
-
<
|
|
60
|
+
<actions_tray_styles_1.ActionTitle>approve</actions_tray_styles_1.ActionTitle>
|
|
61
|
+
</actions_tray_styles_1.ActionBtn>
|
|
62
|
+
<actions_tray_styles_1.ActionBtn onClick={onApprove}>
|
|
63
63
|
<image_1.default alt="ignore and approve" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
64
64
|
root: 'https://cdn-dev.fixefy.me/',
|
|
65
65
|
src: 'actions/ignore_and_approve.svg',
|
|
66
66
|
})} src={'actions/ignore_and_approve.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
67
|
-
<
|
|
68
|
-
</
|
|
69
|
-
<
|
|
67
|
+
<actions_tray_styles_1.ActionTitle>ignore & approve</actions_tray_styles_1.ActionTitle>
|
|
68
|
+
</actions_tray_styles_1.ActionBtn>
|
|
69
|
+
<actions_tray_styles_1.ActionBtn onClick={onApprove}>
|
|
70
70
|
<image_1.default alt="change exception" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
71
71
|
root: 'https://cdn-dev.fixefy.me/',
|
|
72
72
|
src: 'actions/change_exception.svg',
|
|
73
73
|
})} src={'actions/change_exception.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
74
|
-
<
|
|
75
|
-
</
|
|
74
|
+
<actions_tray_styles_1.ActionTitle>Change exeption</actions_tray_styles_1.ActionTitle>
|
|
75
|
+
</actions_tray_styles_1.ActionBtn>
|
|
76
76
|
</>);
|
|
77
77
|
};
|
|
78
78
|
const PendingActions = ({ onApprove, onChallenge }) => {
|
|
79
79
|
return (<>
|
|
80
|
-
<
|
|
80
|
+
<actions_tray_styles_1.ActionBtn onClick={onApprove} type="excellent">
|
|
81
81
|
<image_1.default alt="approve" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
82
82
|
root: 'https://cdn-dev.fixefy.me/',
|
|
83
83
|
src: 'actions/approve.svg',
|
|
84
84
|
})} src={'actions/approve.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
85
|
-
<
|
|
86
|
-
</
|
|
87
|
-
<
|
|
85
|
+
<actions_tray_styles_1.ActionTitle>approve</actions_tray_styles_1.ActionTitle>
|
|
86
|
+
</actions_tray_styles_1.ActionBtn>
|
|
87
|
+
<actions_tray_styles_1.ActionBtn onClick={onChallenge}>
|
|
88
88
|
<image_1.default alt="challenge" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
89
89
|
root: 'https://cdn-dev.fixefy.me/',
|
|
90
90
|
src: 'actions/challenge.svg',
|
|
91
91
|
})} src={'actions/challenge.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
92
|
-
<
|
|
93
|
-
</
|
|
92
|
+
<actions_tray_styles_1.ActionTitle>challenge</actions_tray_styles_1.ActionTitle>
|
|
93
|
+
</actions_tray_styles_1.ActionBtn>
|
|
94
94
|
|
|
95
|
-
<
|
|
95
|
+
<actions_tray_styles_1.ActionBtn onClick={onChallenge}>
|
|
96
96
|
<image_1.default alt="dive in" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
97
97
|
root: 'https://cdn-dev.fixefy.me/',
|
|
98
98
|
src: 'actions/dive_in.svg',
|
|
99
99
|
})} src={'actions/dive_in.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
100
|
-
<
|
|
101
|
-
</
|
|
100
|
+
<actions_tray_styles_1.ActionTitle>dive in</actions_tray_styles_1.ActionTitle>
|
|
101
|
+
</actions_tray_styles_1.ActionBtn>
|
|
102
102
|
</>);
|
|
103
103
|
};
|
|
104
104
|
const NoPricingActions = ({ onApprove, onChallenge }) => {
|
|
105
105
|
return (<>
|
|
106
|
-
<
|
|
106
|
+
<actions_tray_styles_1.ActionBtn onClick={onChallenge}>
|
|
107
107
|
<image_1.default alt="dive in" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
108
108
|
root: 'https://cdn-dev.fixefy.me/',
|
|
109
109
|
src: 'actions/dive_in.svg',
|
|
110
110
|
})} src={'actions/dive_in.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
111
|
-
<
|
|
112
|
-
</
|
|
113
|
-
<
|
|
111
|
+
<actions_tray_styles_1.ActionTitle>dive in</actions_tray_styles_1.ActionTitle>
|
|
112
|
+
</actions_tray_styles_1.ActionBtn>
|
|
113
|
+
<actions_tray_styles_1.ActionBtn onClick={onApprove}>
|
|
114
114
|
<image_1.default alt="solve" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
115
115
|
root: 'https://cdn-dev.fixefy.me/',
|
|
116
116
|
src: 'actions/solve.svg',
|
|
117
117
|
})} src={'actions/solve.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
118
|
-
<
|
|
119
|
-
</
|
|
120
|
-
<
|
|
118
|
+
<actions_tray_styles_1.ActionTitle>solve</actions_tray_styles_1.ActionTitle>
|
|
119
|
+
</actions_tray_styles_1.ActionBtn>
|
|
120
|
+
<actions_tray_styles_1.ActionBtn onClick={onApprove}>
|
|
121
121
|
<image_1.default alt="ignore and approve" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
122
122
|
root: 'https://cdn-dev.fixefy.me/',
|
|
123
123
|
src: 'actions/ignore_and_approve.svg',
|
|
124
124
|
})} src={'actions/ignore_and_approve.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
125
|
-
<
|
|
126
|
-
</
|
|
125
|
+
<actions_tray_styles_1.ActionTitle>ignore & approve</actions_tray_styles_1.ActionTitle>
|
|
126
|
+
</actions_tray_styles_1.ActionBtn>
|
|
127
127
|
</>);
|
|
128
128
|
};
|
|
129
129
|
const ApprovedActions = ({ onChallenge }) => {
|
|
130
130
|
return (<>
|
|
131
|
-
<
|
|
131
|
+
<actions_tray_styles_1.ActionBtn onClick={onChallenge}>
|
|
132
132
|
<image_1.default alt="dive in" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
133
133
|
root: 'https://cdn-dev.fixefy.me/',
|
|
134
134
|
src: 'actionsCards/check_exceptions.svg',
|
|
135
135
|
})} src={'actionsCards/check_exceptions.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
136
|
-
<
|
|
137
|
-
</
|
|
138
|
-
<
|
|
136
|
+
<actions_tray_styles_1.ActionTitle>dive in</actions_tray_styles_1.ActionTitle>
|
|
137
|
+
</actions_tray_styles_1.ActionBtn>
|
|
138
|
+
<actions_tray_styles_1.ActionBtn onClick={onChallenge}>
|
|
139
139
|
<image_1.default alt="challenge" loader={() => (0, fixefy_ui_utils_1.imageLoader)({
|
|
140
140
|
root: 'https://cdn-dev.fixefy.me/',
|
|
141
141
|
src: 'actions/undo.svg',
|
|
142
142
|
})} src={'actions/undo.svg'} width={20} height={20} onLoad={() => console.log('loaded')} onError={(e) => console.log('error:', e)}/>
|
|
143
|
-
<
|
|
144
|
-
</
|
|
143
|
+
<actions_tray_styles_1.ActionTitle>undo</actions_tray_styles_1.ActionTitle>
|
|
144
|
+
</actions_tray_styles_1.ActionBtn>
|
|
145
145
|
</>);
|
|
146
146
|
};
|
|
@@ -1 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ActionsTray = void 0;
|
|
4
|
+
var ActionsTray_1 = require("./ActionsTray");
|
|
5
|
+
Object.defineProperty(exports, "ActionsTray", { enumerable: true, get: function () { return ActionsTray_1.ActionsTray; } });
|
|
@@ -34,7 +34,7 @@ exports.Divider = (0, styles_1.styled)('div')(({ theme }) => ({
|
|
|
34
34
|
marginRight: 24,
|
|
35
35
|
marginLeft: 24,
|
|
36
36
|
}));
|
|
37
|
-
exports.ActionBtn = (0, styles_1.styled)(FxButton_1.
|
|
37
|
+
exports.ActionBtn = (0, styles_1.styled)(FxButton_1.FxButton)(({ theme, type }) => ({
|
|
38
38
|
height: 40,
|
|
39
39
|
maxHeight: 40,
|
|
40
40
|
borderRadius: 100,
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AggregationsBar = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const Stack_1 = tslib_1.__importDefault(require("@mui/material/Stack"));
|
|
7
|
+
const structureReader_1 = require("./helpers/structureReader");
|
|
8
|
+
const AggregationsBar = (props) => {
|
|
9
|
+
const { structure, minWidth, mb, filter, initialValues } = props;
|
|
10
|
+
const { children, extended } = structure;
|
|
11
|
+
const { variables } = extended;
|
|
12
|
+
const { collapsed } = variables;
|
|
13
|
+
return (<Stack_1.default direction="row" spacing={1.5} sx={{
|
|
14
|
+
mb: mb ? mb : 0,
|
|
15
|
+
['& div']: {
|
|
16
|
+
minWidth: minWidth,
|
|
17
|
+
},
|
|
18
|
+
['& > span']: {
|
|
19
|
+
minWidth: minWidth,
|
|
20
|
+
},
|
|
21
|
+
}}>
|
|
22
|
+
{children.map((child, index) => {
|
|
23
|
+
return (0, structureReader_1.structureReader)(child, filter, collapsed, initialValues);
|
|
24
|
+
})}
|
|
25
|
+
</Stack_1.default>);
|
|
26
|
+
};
|
|
27
|
+
exports.AggregationsBar = AggregationsBar;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.structureReader = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const react_1 = tslib_1.__importDefault(require("react"));
|
|
6
|
+
const material_1 = require("@mui/material");
|
|
7
|
+
const Score_1 = require("../../Score");
|
|
8
|
+
const StatisticsBar_1 = require("../../StatisticsBar");
|
|
9
|
+
const FxProgressCounter_1 = require("../../FxProgressCounter");
|
|
10
|
+
const structureReader = (structure, filter, collapsed, initialValues) => {
|
|
11
|
+
var _a;
|
|
12
|
+
const { extended, type } = structure;
|
|
13
|
+
switch (type) {
|
|
14
|
+
case 'aggregations_primary_container':
|
|
15
|
+
return structure.children.map((child, index) => {
|
|
16
|
+
var _a, _b, _c;
|
|
17
|
+
return ((_a = child.input_type) === null || _a === void 0 ? void 0 : _a.value) === 'percentage' ? (<Score_1.Score structure={child} key={index} filter={filter} value={initialValues === null || initialValues === void 0 ? void 0 : initialValues.score}/>) : ((_b = child.input_type) === null || _b === void 0 ? void 0 : _b.value) === 'progress' ? (<FxProgressCounter_1.FxProgressCounter structure={child} filter={filter} key={index} values={initialValues}/>) : (<material_1.Box sx={{
|
|
18
|
+
display: 'flex',
|
|
19
|
+
justifyContent: 'center',
|
|
20
|
+
alignItems: 'center',
|
|
21
|
+
width: 'fit-content',
|
|
22
|
+
padding: 2,
|
|
23
|
+
borderRadius: 2,
|
|
24
|
+
backgroundColor: ((_c = extended === null || extended === void 0 ? void 0 : extended.variables) === null || _c === void 0 ? void 0 : _c.bg) || '#FFFFFF',
|
|
25
|
+
}}>
|
|
26
|
+
<StatisticsBar_1.StatisticsBar structure={child} key={index} filter={filter} collapsed={collapsed} value={initialValues ? initialValues[child.extended.object_path] : null}/>
|
|
27
|
+
</material_1.Box>);
|
|
28
|
+
});
|
|
29
|
+
case 'aggregations_secondary_container':
|
|
30
|
+
return (<material_1.Stack direction="row" divider={<material_1.Divider orientation="vertical" flexItem/>} spacing={2} sx={{
|
|
31
|
+
backgroundColor: ((_a = extended === null || extended === void 0 ? void 0 : extended.variables) === null || _a === void 0 ? void 0 : _a.bg) || '#FFFFFF',
|
|
32
|
+
borderRadius: '8px',
|
|
33
|
+
padding: '24px 16px',
|
|
34
|
+
}}>
|
|
35
|
+
{structure.children.map((child, index) => {
|
|
36
|
+
return <StatisticsBar_1.StatisticsBar structure={child} key={index} filter={filter} collapsed={collapsed} value={initialValues ? initialValues[child.extended.object_path] : null}/>;
|
|
37
|
+
})}
|
|
38
|
+
</material_1.Stack>);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.structureReader = structureReader;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AggregationsBar = void 0;
|
|
4
|
+
var Aggregations_1 = require("./Aggregations");
|
|
5
|
+
Object.defineProperty(exports, "AggregationsBar", { enumerable: true, get: function () { return Aggregations_1.AggregationsBar; } });
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.STRUCTURES = void 0;
|
|
4
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
5
|
+
exports.STRUCTURES = (0, graphql_tag_1.gql) `
|
|
6
|
+
query STRUCTURES {
|
|
7
|
+
structure(where: { name: "aggregations_invoice" }) {
|
|
8
|
+
_id
|
|
9
|
+
bundle_name
|
|
10
|
+
name
|
|
11
|
+
title
|
|
12
|
+
type
|
|
13
|
+
input_type {
|
|
14
|
+
name
|
|
15
|
+
value
|
|
16
|
+
}
|
|
17
|
+
readable_id
|
|
18
|
+
extended {
|
|
19
|
+
format
|
|
20
|
+
gql_operation
|
|
21
|
+
title_path
|
|
22
|
+
object_path
|
|
23
|
+
filter
|
|
24
|
+
variables
|
|
25
|
+
}
|
|
26
|
+
children(sort: { index: 1 }) {
|
|
27
|
+
_id
|
|
28
|
+
name
|
|
29
|
+
title
|
|
30
|
+
type
|
|
31
|
+
input_type {
|
|
32
|
+
name
|
|
33
|
+
value
|
|
34
|
+
}
|
|
35
|
+
readable_id
|
|
36
|
+
extended {
|
|
37
|
+
format
|
|
38
|
+
gql_operation
|
|
39
|
+
title_path
|
|
40
|
+
object_path
|
|
41
|
+
filter
|
|
42
|
+
variables
|
|
43
|
+
}
|
|
44
|
+
children(sort: { index: 1 }) {
|
|
45
|
+
_id
|
|
46
|
+
name
|
|
47
|
+
title
|
|
48
|
+
type
|
|
49
|
+
input_type {
|
|
50
|
+
name
|
|
51
|
+
value
|
|
52
|
+
}
|
|
53
|
+
readable_id
|
|
54
|
+
extended {
|
|
55
|
+
format
|
|
56
|
+
gql_operation
|
|
57
|
+
title_path
|
|
58
|
+
object_path
|
|
59
|
+
filter
|
|
60
|
+
variables
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
`;
|
|
@@ -0,0 +1,209 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyncDropdown = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const lodash_1 = tslib_1.__importDefault(require("lodash"));
|
|
6
|
+
const icons_material_1 = require("@mui/icons-material");
|
|
7
|
+
const graphql_tag_1 = require("graphql-tag");
|
|
8
|
+
const client_1 = require("@apollo/client");
|
|
9
|
+
const fixefy_ui_utils_1 = require("@fixefy/fixefy-ui-utils");
|
|
10
|
+
const react_1 = tslib_1.__importStar(require("react"));
|
|
11
|
+
const material_1 = require("@mui/material");
|
|
12
|
+
const dropdown_styles_1 = require("./styles/dropdown.styles");
|
|
13
|
+
const icon = <icons_material_1.CheckBoxOutlineBlank fontSize="small"/>;
|
|
14
|
+
const checkedIcon = <icons_material_1.CheckBox fontSize="small"/>;
|
|
15
|
+
exports.AsyncDropdown = react_1.default.forwardRef((props, parentRef) => {
|
|
16
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
17
|
+
const ref = (0, react_1.useRef)(null);
|
|
18
|
+
const theme = (0, material_1.useTheme)();
|
|
19
|
+
const [options, setOptions] = (0, react_1.useState)([]);
|
|
20
|
+
const [loadingData, setLoadingData] = (0, react_1.useState)(false);
|
|
21
|
+
const [isLastPage, setIsLastPage] = (0, react_1.useState)(false);
|
|
22
|
+
const [searchValue, setSearchValue] = (0, react_1.useState)(null);
|
|
23
|
+
const [hasClearBtn, setHasClearBtn] = (0, react_1.useState)(false);
|
|
24
|
+
const [page, setPage] = (0, react_1.useState)(1);
|
|
25
|
+
const [prevPage, setPrevPage] = (0, react_1.useState)(0);
|
|
26
|
+
const [pageSize, setPageSize] = (0, react_1.useState)(20);
|
|
27
|
+
const { debug, structure, onChange, onClear, renderOptions, fetcher, initialValue = {}, multiple, disabled, type = 'text', showSelectedValue } = props, rest = tslib_1.__rest(props, ["debug", "structure", "onChange", "onClear", "renderOptions", "fetcher", "initialValue", "multiple", "disabled", "type", "showSelectedValue"]);
|
|
28
|
+
const { name, extended, children } = structure;
|
|
29
|
+
const { search_path, variables } = extended;
|
|
30
|
+
const { method_name } = variables;
|
|
31
|
+
const [fetch, { data, error, loading }] = (0, client_1.useLazyQuery)((0, graphql_tag_1.gql)(fetcher.query), Object.assign(Object.assign({}, fetcher.queryOptions), { variables: Object.assign(Object.assign({}, fetcher.queryOptions.variables), { where: searchValue
|
|
32
|
+
? Object.assign(Object.assign({}, fetcher.queryOptions.variables.where), { [search_path]: searchValue }) : Object.assign({}, fetcher.queryOptions.variables.where), skip: page * pageSize - pageSize, limit: pageSize }) }));
|
|
33
|
+
const labelOption = (_b = (_a = structure === null || structure === void 0 ? void 0 : structure.extended) === null || _a === void 0 ? void 0 : _a.title_path) !== null && _b !== void 0 ? _b : 'title';
|
|
34
|
+
const { getRootProps, getInputProps, getClearProps, getListboxProps, getOptionProps, groupedOptions, value, popupOpen, focused, setAnchorEl } = (0, material_1.useAutocomplete)(Object.assign(Object.assign({}, rest), { defaultValue: initialValue, options: options, disableCloseOnSelect: !!multiple, multiple, disabled: disabled, isOptionEqualToValue: (option, value) => {
|
|
35
|
+
return option._id === value._id;
|
|
36
|
+
}, getOptionLabel: (option) => { var _a; return (0, fixefy_ui_utils_1.titleCase)((_a = option[labelOption]) !== null && _a !== void 0 ? _a : option.title); } }));
|
|
37
|
+
const onPopupScroll = lodash_1.default.debounce(() => {
|
|
38
|
+
if (ref && ref.current) {
|
|
39
|
+
const threshHold = ref.current.scrollHeight / 2;
|
|
40
|
+
if (ref.current.scrollTop > threshHold && !loadingData && !isLastPage) {
|
|
41
|
+
setLoadingData(true);
|
|
42
|
+
setPage((prevPage) => prevPage + 1);
|
|
43
|
+
setPrevPage((prevPage) => prevPage + 1);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
}, 800);
|
|
47
|
+
const createTitle = () => {
|
|
48
|
+
if (Array.isArray(value)) {
|
|
49
|
+
if (value && value.length) {
|
|
50
|
+
return `${(0, fixefy_ui_utils_1.titleCase)(name)} (${value.length})`;
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return (0, fixefy_ui_utils_1.titleCase)(name);
|
|
54
|
+
};
|
|
55
|
+
const handleSearch = lodash_1.default.debounce((e) => {
|
|
56
|
+
setSearchValue(e.target.value);
|
|
57
|
+
setPage(1);
|
|
58
|
+
}, 300);
|
|
59
|
+
const handleChildrens = (_a) => {
|
|
60
|
+
var { structure } = _a, rest = tslib_1.__rest(_a, ["structure"]);
|
|
61
|
+
const { type, children } = structure;
|
|
62
|
+
debug === true && console.log('handleChildrens', structure);
|
|
63
|
+
switch (type) {
|
|
64
|
+
case 'dropdownOptions':
|
|
65
|
+
case 'dropdown_options': {
|
|
66
|
+
children.map((child) => {
|
|
67
|
+
return handleChildrens(Object.assign({ structure: child }, rest));
|
|
68
|
+
});
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
case 'clear': {
|
|
72
|
+
if (!hasClearBtn) {
|
|
73
|
+
setHasClearBtn(true);
|
|
74
|
+
}
|
|
75
|
+
return <material_1.Button {...rest}>{structure.title}</material_1.Button>;
|
|
76
|
+
}
|
|
77
|
+
default: {
|
|
78
|
+
break;
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
};
|
|
82
|
+
const handleRenderOptions = () => {
|
|
83
|
+
debug === true && console.log('renderOptions: ', renderOptions);
|
|
84
|
+
if (renderOptions) {
|
|
85
|
+
return groupedOptions.map((option, index) => {
|
|
86
|
+
const CustomeComponent = renderOptions(option, index);
|
|
87
|
+
return react_1.default.cloneElement(CustomeComponent, Object.assign({}, getOptionProps({ option, index })));
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
switch (type) {
|
|
92
|
+
case 'checkbox': {
|
|
93
|
+
return groupedOptions.map((option, index) => {
|
|
94
|
+
const isSelected = getOptionProps({
|
|
95
|
+
option,
|
|
96
|
+
index,
|
|
97
|
+
})['aria-selected'];
|
|
98
|
+
return (<li {...getOptionProps({ option, index })}>
|
|
99
|
+
<material_1.Checkbox icon={icon} checked={Boolean(isSelected)} checkedIcon={checkedIcon} sx={{
|
|
100
|
+
mr: 1,
|
|
101
|
+
minWidth: 24,
|
|
102
|
+
minHeight: 24,
|
|
103
|
+
p: 0,
|
|
104
|
+
['& svg']: { fill: theme.palette.primary.light },
|
|
105
|
+
}}/>
|
|
106
|
+
<material_1.Typography variant="table" color={theme.palette.typography.title}>
|
|
107
|
+
{(0, fixefy_ui_utils_1.titleCase)(option === null || option === void 0 ? void 0 : option.title)}
|
|
108
|
+
</material_1.Typography>
|
|
109
|
+
</li>);
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
case 'text': {
|
|
113
|
+
return groupedOptions.map((option, index) => {
|
|
114
|
+
var _a, _b, _c, _d;
|
|
115
|
+
debug === true && console.log('renderOptions: ', (_a = structure === null || structure === void 0 ? void 0 : structure.extended) === null || _a === void 0 ? void 0 : _a.title_path, option[(_b = structure === null || structure === void 0 ? void 0 : structure.extended) === null || _b === void 0 ? void 0 : _b.title_path], options);
|
|
116
|
+
return (<li {...getOptionProps({ option, index })}>
|
|
117
|
+
<material_1.Typography variant="table" color={theme.palette.typography.title}>
|
|
118
|
+
{(0, fixefy_ui_utils_1.titleCase)((_d = option[(_c = structure === null || structure === void 0 ? void 0 : structure.extended) === null || _c === void 0 ? void 0 : _c.title_path]) !== null && _d !== void 0 ? _d : option.title)}
|
|
119
|
+
</material_1.Typography>
|
|
120
|
+
</li>);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
default: {
|
|
124
|
+
return groupedOptions.map((option, index) => {
|
|
125
|
+
var _a, _b, _c, _d;
|
|
126
|
+
debug === true && console.log('renderOptions: ', (_a = structure === null || structure === void 0 ? void 0 : structure.extended) === null || _a === void 0 ? void 0 : _a.title_path, option[(_b = structure === null || structure === void 0 ? void 0 : structure.extended) === null || _b === void 0 ? void 0 : _b.title_path], options);
|
|
127
|
+
return (<li {...getOptionProps({ option, index })}>
|
|
128
|
+
<material_1.Typography variant="table" color={theme.palette.typography.title}>
|
|
129
|
+
{(0, fixefy_ui_utils_1.titleCase)((_d = option[(_c = structure === null || structure === void 0 ? void 0 : structure.extended) === null || _c === void 0 ? void 0 : _c.title_path]) !== null && _d !== void 0 ? _d : option.title)}
|
|
130
|
+
</material_1.Typography>
|
|
131
|
+
</li>);
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
};
|
|
137
|
+
(0, react_1.useImperativeHandle)(parentRef, () => ({
|
|
138
|
+
clearDDL: () => {
|
|
139
|
+
var _a;
|
|
140
|
+
(_a = getClearProps()) === null || _a === void 0 ? void 0 : _a.onClick(null);
|
|
141
|
+
},
|
|
142
|
+
}));
|
|
143
|
+
(0, react_1.useEffect)(() => {
|
|
144
|
+
if (ref && ref.current) {
|
|
145
|
+
ref.current.addEventListener('scroll', () => onPopupScroll());
|
|
146
|
+
}
|
|
147
|
+
return () => {
|
|
148
|
+
if (ref && ref.current) {
|
|
149
|
+
ref.current.removeEventListener('scroll', () => onPopupScroll());
|
|
150
|
+
}
|
|
151
|
+
};
|
|
152
|
+
}, [groupedOptions]);
|
|
153
|
+
(0, react_1.useEffect)(() => {
|
|
154
|
+
onChange && onChange(value, name);
|
|
155
|
+
}, [value]);
|
|
156
|
+
(0, react_1.useEffect)(() => {
|
|
157
|
+
if (popupOpen && !isLastPage && prevPage < page && !disabled) {
|
|
158
|
+
fetch();
|
|
159
|
+
}
|
|
160
|
+
}, [popupOpen]);
|
|
161
|
+
(0, react_1.useEffect)(() => {
|
|
162
|
+
if (!disabled) {
|
|
163
|
+
fetch();
|
|
164
|
+
}
|
|
165
|
+
}, []);
|
|
166
|
+
(0, react_1.useEffect)(() => {
|
|
167
|
+
if (data && !isLastPage && prevPage < page) {
|
|
168
|
+
const newOptions = data[method_name];
|
|
169
|
+
if (newOptions.length === 0 || newOptions.length < pageSize) {
|
|
170
|
+
setIsLastPage(true);
|
|
171
|
+
}
|
|
172
|
+
setOptions([...newOptions, ...options]);
|
|
173
|
+
setLoadingData(false);
|
|
174
|
+
}
|
|
175
|
+
}, [data]);
|
|
176
|
+
return (<dropdown_styles_1.Root>
|
|
177
|
+
<dropdown_styles_1.InputWrapper hasValue={!!(value && Object.keys(value).length)} disabled={disabled} sx={{
|
|
178
|
+
width: (_d = (_c = props.styles) === null || _c === void 0 ? void 0 : _c.width) !== null && _d !== void 0 ? _d : 180,
|
|
179
|
+
maxWidth: (_f = (_e = props.styles) === null || _e === void 0 ? void 0 : _e.maxWidth) !== null && _f !== void 0 ? _f : 300,
|
|
180
|
+
}} {...getRootProps()} ref={setAnchorEl} className={focused ? 'focused' : ''}>
|
|
181
|
+
<input {...getInputProps()} readOnly onChange={(e) => {
|
|
182
|
+
var _a;
|
|
183
|
+
(_a = getInputProps()) === null || _a === void 0 ? void 0 : _a.onChange(e);
|
|
184
|
+
handleSearch(e);
|
|
185
|
+
}} placeholder={createTitle()} value={showSelectedValue ? (0, fixefy_ui_utils_1.titleCase)(value.title) : undefined}/>
|
|
186
|
+
{loading ? (<dropdown_styles_1.Loading>
|
|
187
|
+
<material_1.CircularProgress />
|
|
188
|
+
</dropdown_styles_1.Loading>) : (<icons_material_1.KeyboardArrowDown />)}
|
|
189
|
+
</dropdown_styles_1.InputWrapper>
|
|
190
|
+
|
|
191
|
+
{groupedOptions.length > 0 && !disabled ? (<dropdown_styles_1.Listbox {...getListboxProps()}>
|
|
192
|
+
<dropdown_styles_1.StyledListBox sx={Object.assign({}, (_g = props.styles) === null || _g === void 0 ? void 0 : _g.menuSx)} hasClearBtn={children === null || children === void 0 ? void 0 : children.length} ref={ref}>
|
|
193
|
+
{handleRenderOptions()}
|
|
194
|
+
</dropdown_styles_1.StyledListBox>
|
|
195
|
+
|
|
196
|
+
{children && children.length ? (<dropdown_styles_1.StyledClose>
|
|
197
|
+
{handleChildrens({
|
|
198
|
+
structure: children[0],
|
|
199
|
+
onClick: (e) => {
|
|
200
|
+
var _a;
|
|
201
|
+
onClear && onClear();
|
|
202
|
+
(_a = getClearProps()) === null || _a === void 0 ? void 0 : _a.onClick(e);
|
|
203
|
+
},
|
|
204
|
+
startIcon: <icons_material_1.Close />,
|
|
205
|
+
})}
|
|
206
|
+
</dropdown_styles_1.StyledClose>) : null}
|
|
207
|
+
</dropdown_styles_1.Listbox>) : null}
|
|
208
|
+
</dropdown_styles_1.Root>);
|
|
209
|
+
});
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isStringValid = exports.isObjectValid = exports.isArrayValid = exports.getJPart = void 0;
|
|
4
|
+
const getJPart = (j, jsonPath, defaultValue) => {
|
|
5
|
+
if ((0, exports.isObjectValid)(j) === false)
|
|
6
|
+
return defaultValue;
|
|
7
|
+
jsonPath = jsonPath.replace(/\[(\w+)\]/g, '.$1');
|
|
8
|
+
jsonPath = jsonPath.replace(/^\./, '');
|
|
9
|
+
let _isArrayValid = false;
|
|
10
|
+
let _isStringValid = false;
|
|
11
|
+
let currentPathPart;
|
|
12
|
+
let pathParts = jsonPath.split('.');
|
|
13
|
+
let isLoop = true;
|
|
14
|
+
for (let i = 0, n = pathParts.length; isLoop && i < n; ++i) {
|
|
15
|
+
currentPathPart = pathParts[i];
|
|
16
|
+
_isStringValid = (0, exports.isStringValid)(j);
|
|
17
|
+
_isArrayValid = (0, exports.isArrayValid)(j);
|
|
18
|
+
if (_isStringValid === true || _isArrayValid === true) {
|
|
19
|
+
if (_isStringValid === true) {
|
|
20
|
+
j = JSON.parse(j);
|
|
21
|
+
}
|
|
22
|
+
else {
|
|
23
|
+
j = j.reduce((acc, cur, idx, src) => {
|
|
24
|
+
const innerJ = (0, exports.getJPart)(cur, pathParts.slice(i).join('.'), defaultValue);
|
|
25
|
+
if ((0, exports.isArrayValid)(innerJ)) {
|
|
26
|
+
acc.push(...innerJ);
|
|
27
|
+
}
|
|
28
|
+
else {
|
|
29
|
+
acc.push(Object.assign(Object.assign({}, innerJ), { value: innerJ._id }));
|
|
30
|
+
}
|
|
31
|
+
return acc;
|
|
32
|
+
}, []);
|
|
33
|
+
isLoop = false;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
if (currentPathPart in j) {
|
|
38
|
+
j = j[currentPathPart];
|
|
39
|
+
}
|
|
40
|
+
else {
|
|
41
|
+
j = defaultValue;
|
|
42
|
+
isLoop = false;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return j;
|
|
47
|
+
};
|
|
48
|
+
exports.getJPart = getJPart;
|
|
49
|
+
const isArrayValid = (arr, minLength = 1, maxLength = 0) => {
|
|
50
|
+
let rv = (0, exports.isObjectValid)(arr) &&
|
|
51
|
+
arr.length >= minLength &&
|
|
52
|
+
Object.prototype.toString.call(arr) == '[object Array]';
|
|
53
|
+
if (maxLength > 0) {
|
|
54
|
+
rv = rv && arr.length <= maxLength;
|
|
55
|
+
}
|
|
56
|
+
return rv;
|
|
57
|
+
};
|
|
58
|
+
exports.isArrayValid = isArrayValid;
|
|
59
|
+
const isObjectValid = (obj, isCheckKeys = false) => {
|
|
60
|
+
let rv = typeof obj !== 'undefined' && obj !== null;
|
|
61
|
+
if (isCheckKeys) {
|
|
62
|
+
rv = rv && Object.keys(obj).length > 0;
|
|
63
|
+
}
|
|
64
|
+
return rv;
|
|
65
|
+
};
|
|
66
|
+
exports.isObjectValid = isObjectValid;
|
|
67
|
+
const isStringValid = (str, minLength = null, maxLength = null, isValidateType = true) => {
|
|
68
|
+
let rv = (0, exports.isObjectValid)(str) && str.toString().length > 0 && (isValidateType ? typeof str === 'string' : true);
|
|
69
|
+
if (rv === false)
|
|
70
|
+
return false;
|
|
71
|
+
if (minLength && isNaN(minLength) === false && minLength > 0) {
|
|
72
|
+
rv = rv && str.toString().length >= minLength;
|
|
73
|
+
}
|
|
74
|
+
if (rv === false)
|
|
75
|
+
return false;
|
|
76
|
+
if (maxLength && isNaN(maxLength) === false && maxLength > 0) {
|
|
77
|
+
rv = rv && str.toString().length <= maxLength;
|
|
78
|
+
}
|
|
79
|
+
return rv;
|
|
80
|
+
};
|
|
81
|
+
exports.isStringValid = isStringValid;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AsyncDropdown = void 0;
|
|
4
|
+
var AsyncDropdown_1 = require("./AsyncDropdown");
|
|
5
|
+
Object.defineProperty(exports, "AsyncDropdown", { enumerable: true, get: function () { return AsyncDropdown_1.AsyncDropdown; } });
|