@fixefy/fixefy-ui-components 0.3.108 → 0.3.110
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/FxAsyncDropdown/FxAsyncDropdown.js +3 -3
- package/dist/FxDatesProgress/styles/progress.styles.js +1 -1
- package/dist/FxUserImage/FxUserImage.js +2 -2
- package/dist/fixefy-ui-components/src/FxActionsTray/FxActionsTray.js +111 -0
- package/dist/fixefy-ui-components/src/FxActionsTray/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxActionsTray/styles/actionsTray.style.js +114 -0
- package/dist/fixefy-ui-components/src/FxAggregationsBar/FxAggregations.js +41 -0
- package/dist/fixefy-ui-components/src/FxAggregationsBar/helpers/structureReader.js +80 -0
- package/dist/fixefy-ui-components/src/FxAggregationsBar/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxAggregationsBar/operations/query.js +73 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/FxAsyncDropdown.js +500 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/CheckboxIcon.js +44 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/ChipOption.js +35 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/ChosenIcon.js +45 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/DeleteButton.js +37 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/LogoOption.js +101 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/TextOption.js +74 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/components/index.js +36 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/helpers/helpers.js +233 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/styles/dropdown.styles.js +211 -0
- package/dist/fixefy-ui-components/src/FxAsyncDropdown/types.js +4 -0
- package/dist/fixefy-ui-components/src/FxAvatar/FxAvatar.js +145 -0
- package/dist/fixefy-ui-components/src/FxAvatar/helpers/stringToColor.js +23 -0
- package/dist/fixefy-ui-components/src/FxAvatar/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxAvatar/styles/avatar.styles.js +233 -0
- package/dist/fixefy-ui-components/src/FxButton/FxButton.js +106 -0
- package/dist/fixefy-ui-components/src/FxButton/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxButton/styles/button.styles.js +28 -0
- package/dist/fixefy-ui-components/src/FxButtonModalWithComponent/FxButtonModalWithComponent.js +118 -0
- package/dist/fixefy-ui-components/src/FxButtonModalWithComponent/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxButtonModalWithMenu/FxButtonModalWithMenu.js +126 -0
- package/dist/fixefy-ui-components/src/FxButtonModalWithMenu/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxChip/FxChip.js +75 -0
- package/dist/fixefy-ui-components/src/FxChip/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxChip/styles/chip.styles.js +147 -0
- package/dist/fixefy-ui-components/src/FxDatesProgress/FxDatesProgress.js +126 -0
- package/dist/fixefy-ui-components/src/FxDatesProgress/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxDatesProgress/styles/progress.styles.js +24 -0
- package/dist/fixefy-ui-components/src/FxGeneralModal/FxGeneralModal.js +107 -0
- package/dist/fixefy-ui-components/src/FxGeneralModal/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxGridEmptyState/FxGridEmptyState.js +86 -0
- package/dist/fixefy-ui-components/src/FxGridEmptyState/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxGridError/FxGridError.js +91 -0
- package/dist/fixefy-ui-components/src/FxGridError/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxIcon/FxIcon.js +118 -0
- package/dist/fixefy-ui-components/src/FxIcon/content/dynamic_icon.js +20 -0
- package/dist/fixefy-ui-components/src/FxIcon/content/index.js +20 -0
- package/dist/fixefy-ui-components/src/FxIcon/content/lazy_icon.js +87 -0
- package/dist/fixefy-ui-components/src/FxIcon/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxMenuItemWithIcon/FxMenuItemWithIcon.js +84 -0
- package/dist/fixefy-ui-components/src/FxMenuItemWithIcon/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxModal/FxModal.js +171 -0
- package/dist/fixefy-ui-components/src/FxModal/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxModal/styles/modal.style.js +66 -0
- package/dist/fixefy-ui-components/src/FxNotes/FxNotes.js +216 -0
- package/dist/fixefy-ui-components/src/FxNotes/helpers/stringToColor.js +26 -0
- package/dist/fixefy-ui-components/src/FxNotes/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxNotes/operations/queries.js +35 -0
- package/dist/fixefy-ui-components/src/FxNotes/styles/notes.styles.js +168 -0
- package/dist/fixefy-ui-components/src/FxNumberField/FxNumberField.js +108 -0
- package/dist/fixefy-ui-components/src/FxNumberField/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxNumberField/styles/number_field.styles.js +99 -0
- package/dist/fixefy-ui-components/src/FxObjStaticDropdown/FxObjStaticDropdown.js +548 -0
- package/dist/fixefy-ui-components/src/FxObjStaticDropdown/index.js +25 -0
- package/dist/fixefy-ui-components/src/FxObjStaticDropdown/styles/dropdown.styles.js +211 -0
- package/dist/fixefy-ui-components/src/FxPopper/Popper.js +139 -0
- package/dist/fixefy-ui-components/src/FxPopper/PopperWithOutside.js +116 -0
- package/dist/fixefy-ui-components/src/FxPopper/content/PopperHeader.js +36 -0
- package/dist/fixefy-ui-components/src/FxPopper/content/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxPopper/index.js +24 -0
- package/dist/fixefy-ui-components/src/FxPopper/styles/popper.styles.js +138 -0
- package/dist/fixefy-ui-components/src/FxProgressCircle/FxProgressCircle.js +65 -0
- package/dist/fixefy-ui-components/src/FxProgressCircle/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxProgressCircle/styles/progress_circle.styles.js +106 -0
- package/dist/fixefy-ui-components/src/FxProgressCounter/ProgressCounter.js +168 -0
- package/dist/fixefy-ui-components/src/FxProgressCounter/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxProgressCounter/styles/progress_counter.styles.js +66 -0
- package/dist/fixefy-ui-components/src/FxScore/FxScore.js +215 -0
- package/dist/fixefy-ui-components/src/FxScore/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxScore/styles/score.styles.js +102 -0
- package/dist/fixefy-ui-components/src/FxShowMore/FxShowMore.js +80 -0
- package/dist/fixefy-ui-components/src/FxShowMore/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxShowMore/styles/show_more.styles.js +143 -0
- package/dist/fixefy-ui-components/src/FxSlider/FxSlider.js +49 -0
- package/dist/fixefy-ui-components/src/FxSlider/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxStatisticsBar/FxStatisticsBar.js +198 -0
- package/dist/fixefy-ui-components/src/FxStatisticsBar/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxStatisticsBar/styles/statistics.styles.js +103 -0
- package/dist/fixefy-ui-components/src/FxStatusBar/FxStatusBar.js +149 -0
- package/dist/fixefy-ui-components/src/FxStatusBar/helpers/constants.js +22 -0
- package/dist/fixefy-ui-components/src/FxStatusBar/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxStatusBar/styles/statusBar.styles.js +138 -0
- package/dist/fixefy-ui-components/src/FxStrStaticDropdown/FxStrStaticDropdown.js +382 -0
- package/dist/fixefy-ui-components/src/FxStrStaticDropdown/helpers/helpers.js +22 -0
- package/dist/fixefy-ui-components/src/FxStrStaticDropdown/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxStrStaticDropdown/styles/dropdown.styles.js +190 -0
- package/dist/fixefy-ui-components/src/FxStyledButton/FxStyledButton.js +57 -0
- package/dist/fixefy-ui-components/src/FxStyledButton/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxStyledComponents/index.js +319 -0
- package/dist/fixefy-ui-components/src/FxSwitch/FxSwitch.js +106 -0
- package/dist/fixefy-ui-components/src/FxSwitch/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxSwitch/styles/switch.styles.js +42 -0
- package/dist/fixefy-ui-components/src/FxTabs/FxTabs.js +79 -0
- package/dist/fixefy-ui-components/src/FxTabs/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxTag/FxTag.js +50 -0
- package/dist/fixefy-ui-components/src/FxTag/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxTag/styles/tag.styles.js +106 -0
- package/dist/fixefy-ui-components/src/FxTextField/FxTextField.js +211 -0
- package/dist/fixefy-ui-components/src/FxTextField/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxTodo/FxTodo.js +95 -0
- package/dist/fixefy-ui-components/src/FxTodo/index.js +22 -0
- package/dist/fixefy-ui-components/src/FxTodo/styles/todo.styles.js +183 -0
- package/dist/fixefy-ui-components/src/FxToggleButtons/FxToggleButtons.js +69 -0
- package/dist/fixefy-ui-components/src/FxToggleButtons/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxUserImage/FxUserImage.js +236 -0
- package/dist/fixefy-ui-components/src/FxUserImage/index.js +11 -0
- package/dist/fixefy-ui-components/src/FxWizard/FxWizard.js +50 -0
- package/dist/fixefy-ui-components/src/FxWizard/index.js +19 -0
- package/dist/fixefy-ui-components/src/FxWizard/steps launcher/StepsLauncher.js +52 -0
- package/dist/fixefy-ui-components/src/FxWizard/steps launcher/index.js +18 -0
- package/dist/fixefy-ui-components/src/index.js +277 -0
- package/package.json +4 -5
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "LogoOption", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return LogoOption;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
13
|
+
const _FxIcon = require("../../FxIcon");
|
|
14
|
+
const _Box = /*#__PURE__*/ _interop_require_default(require("@mui/material/Box"));
|
|
15
|
+
const _Typography = /*#__PURE__*/ _interop_require_default(require("@mui/material/Typography"));
|
|
16
|
+
const _styles = require("@mui/material/styles");
|
|
17
|
+
const _helpers = require("../helpers/helpers");
|
|
18
|
+
const _fixefyhooks = require("@fixefy/fixefy-hooks");
|
|
19
|
+
const _DeleteButton = require("./DeleteButton");
|
|
20
|
+
const _ChosenIcon = require("./ChosenIcon");
|
|
21
|
+
function _interop_require_default(obj) {
|
|
22
|
+
return obj && obj.__esModule ? obj : {
|
|
23
|
+
default: obj
|
|
24
|
+
};
|
|
25
|
+
}
|
|
26
|
+
const LogoOption = ({ option, curValue, modal, fetchedProps, displayed, setDisplayed })=>{
|
|
27
|
+
const theme = (0, _styles.useTheme)();
|
|
28
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Box.default, {
|
|
29
|
+
sx: {
|
|
30
|
+
display: 'flex',
|
|
31
|
+
justifyContent: 'space-between',
|
|
32
|
+
width: '100%',
|
|
33
|
+
gap: 1,
|
|
34
|
+
color: 'grey',
|
|
35
|
+
cursor: 'pointer'
|
|
36
|
+
},
|
|
37
|
+
children: [
|
|
38
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_Box.default, {
|
|
39
|
+
sx: {
|
|
40
|
+
width: '100%',
|
|
41
|
+
display: 'flex',
|
|
42
|
+
justifyContent: 'flex-start',
|
|
43
|
+
gap: 1,
|
|
44
|
+
alignItems: 'center'
|
|
45
|
+
},
|
|
46
|
+
children: [
|
|
47
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(Logo, {
|
|
48
|
+
option: option,
|
|
49
|
+
fetchedProps: fetchedProps
|
|
50
|
+
}),
|
|
51
|
+
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_Box.default, {
|
|
52
|
+
sx: {
|
|
53
|
+
display: 'flex',
|
|
54
|
+
justifyContent: 'space-between',
|
|
55
|
+
width: '100%'
|
|
56
|
+
},
|
|
57
|
+
children: [
|
|
58
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Typography.default, {
|
|
59
|
+
variant: "subtitle2",
|
|
60
|
+
color: theme.palette.typography.title,
|
|
61
|
+
children: (0, _helpers.titleCase)(curValue)
|
|
62
|
+
}),
|
|
63
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteButton.DeleteButton, {
|
|
64
|
+
option: option,
|
|
65
|
+
isDisplay: modal == 'displayed',
|
|
66
|
+
fetchedProps: fetchedProps,
|
|
67
|
+
displayed: displayed,
|
|
68
|
+
setDisplayed: setDisplayed
|
|
69
|
+
})
|
|
70
|
+
]
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
}),
|
|
74
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ChosenIcon.ChosenIcon, {
|
|
75
|
+
option: option,
|
|
76
|
+
isDisplay: modal == 'list',
|
|
77
|
+
fetchedProps: fetchedProps,
|
|
78
|
+
displayed: displayed
|
|
79
|
+
})
|
|
80
|
+
]
|
|
81
|
+
}, option._id);
|
|
82
|
+
};
|
|
83
|
+
const Logo = ({ option, fetchedProps })=>{
|
|
84
|
+
const getRandomColor = (0, _fixefyhooks.useRandomColor)();
|
|
85
|
+
const { assetUrl, logo_folder_name, logo_placeholder, name } = fetchedProps !== null && fetchedProps !== void 0 ? fetchedProps : {};
|
|
86
|
+
var _option_name;
|
|
87
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsx)("span", {
|
|
88
|
+
style: {
|
|
89
|
+
width: '70px'
|
|
90
|
+
},
|
|
91
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_FxIcon.FxIcon, {
|
|
92
|
+
assetUrl: assetUrl,
|
|
93
|
+
icon: `${option.logo ? `${logo_folder_name}/${option.logo}` : logo_placeholder ? logo_placeholder : (_option_name = option === null || option === void 0 ? void 0 : option[name]) !== null && _option_name !== void 0 ? _option_name : 'x'}`,
|
|
94
|
+
width: 70,
|
|
95
|
+
height: 16,
|
|
96
|
+
variant: "rounded",
|
|
97
|
+
fontSize: 17,
|
|
98
|
+
background: getRandomColor()
|
|
99
|
+
})
|
|
100
|
+
});
|
|
101
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "TextOption", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return TextOption;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _jsxruntime = require("react/jsx-runtime");
|
|
12
|
+
const _react = /*#__PURE__*/ _interop_require_default(require("react"));
|
|
13
|
+
const _Box = /*#__PURE__*/ _interop_require_default(require("@mui/material/Box"));
|
|
14
|
+
const _Typography = /*#__PURE__*/ _interop_require_default(require("@mui/material/Typography"));
|
|
15
|
+
const _styles = require("@mui/material/styles");
|
|
16
|
+
const _helpers = require("../helpers/helpers");
|
|
17
|
+
const _DeleteButton = require("./DeleteButton");
|
|
18
|
+
const _ChosenIcon = require("./ChosenIcon");
|
|
19
|
+
function _interop_require_default(obj) {
|
|
20
|
+
return obj && obj.__esModule ? obj : {
|
|
21
|
+
default: obj
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
const TextOption = ({ option, curValue, modal, fetchedProps, displayed, setDisplayed })=>{
|
|
25
|
+
const theme = (0, _styles.useTheme)();
|
|
26
|
+
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Box.default, {
|
|
27
|
+
sx: {
|
|
28
|
+
display: 'flex',
|
|
29
|
+
justifyContent: 'space-between',
|
|
30
|
+
width: '100%',
|
|
31
|
+
gap: 1,
|
|
32
|
+
color: 'grey',
|
|
33
|
+
cursor: 'pointer'
|
|
34
|
+
},
|
|
35
|
+
children: [
|
|
36
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Box.default, {
|
|
37
|
+
sx: {
|
|
38
|
+
width: '100%',
|
|
39
|
+
display: 'flex',
|
|
40
|
+
justifyContent: 'flex-start',
|
|
41
|
+
gap: 1,
|
|
42
|
+
alignItems: 'center'
|
|
43
|
+
},
|
|
44
|
+
children: /*#__PURE__*/ (0, _jsxruntime.jsxs)(_Box.default, {
|
|
45
|
+
sx: {
|
|
46
|
+
display: 'flex',
|
|
47
|
+
justifyContent: 'space-between',
|
|
48
|
+
width: '100%'
|
|
49
|
+
},
|
|
50
|
+
children: [
|
|
51
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_Typography.default, {
|
|
52
|
+
variant: "subtitle2",
|
|
53
|
+
color: theme.palette.typography.title,
|
|
54
|
+
children: (0, _helpers.titleCase)(curValue)
|
|
55
|
+
}),
|
|
56
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_DeleteButton.DeleteButton, {
|
|
57
|
+
option: option,
|
|
58
|
+
isDisplay: modal == 'displayed',
|
|
59
|
+
fetchedProps: fetchedProps,
|
|
60
|
+
displayed: displayed,
|
|
61
|
+
setDisplayed: setDisplayed
|
|
62
|
+
})
|
|
63
|
+
]
|
|
64
|
+
})
|
|
65
|
+
}),
|
|
66
|
+
/*#__PURE__*/ (0, _jsxruntime.jsx)(_ChosenIcon.ChosenIcon, {
|
|
67
|
+
option: option,
|
|
68
|
+
isDisplay: modal == 'list',
|
|
69
|
+
fetchedProps: fetchedProps,
|
|
70
|
+
displayed: displayed
|
|
71
|
+
})
|
|
72
|
+
]
|
|
73
|
+
}, option._id);
|
|
74
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
CheckboxIcon: function() {
|
|
13
|
+
return _CheckboxIcon.CheckboxIcon;
|
|
14
|
+
},
|
|
15
|
+
ChipOption: function() {
|
|
16
|
+
return _ChipOption.ChipOption;
|
|
17
|
+
},
|
|
18
|
+
ChosenIcon: function() {
|
|
19
|
+
return _ChosenIcon.ChosenIcon;
|
|
20
|
+
},
|
|
21
|
+
DeleteButton: function() {
|
|
22
|
+
return _DeleteButton.DeleteButton;
|
|
23
|
+
},
|
|
24
|
+
LogoOption: function() {
|
|
25
|
+
return _LogoOption.LogoOption;
|
|
26
|
+
},
|
|
27
|
+
TextOption: function() {
|
|
28
|
+
return _TextOption.TextOption;
|
|
29
|
+
}
|
|
30
|
+
});
|
|
31
|
+
const _CheckboxIcon = require("./CheckboxIcon");
|
|
32
|
+
const _ChipOption = require("./ChipOption");
|
|
33
|
+
const _ChosenIcon = require("./ChosenIcon");
|
|
34
|
+
const _DeleteButton = require("./DeleteButton");
|
|
35
|
+
const _LogoOption = require("./LogoOption");
|
|
36
|
+
const _TextOption = require("./TextOption");
|
|
@@ -0,0 +1,233 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
addToStoredDisplayed: function() {
|
|
13
|
+
return addToStoredDisplayed;
|
|
14
|
+
},
|
|
15
|
+
deleteOneItem: function() {
|
|
16
|
+
return deleteOneItem;
|
|
17
|
+
},
|
|
18
|
+
getJPart: function() {
|
|
19
|
+
return getJPart;
|
|
20
|
+
},
|
|
21
|
+
getOption: function() {
|
|
22
|
+
return getOption;
|
|
23
|
+
},
|
|
24
|
+
isArrayValid: function() {
|
|
25
|
+
return isArrayValid;
|
|
26
|
+
},
|
|
27
|
+
isChecked: function() {
|
|
28
|
+
return isChecked;
|
|
29
|
+
},
|
|
30
|
+
isObjectValid: function() {
|
|
31
|
+
return isObjectValid;
|
|
32
|
+
},
|
|
33
|
+
isStringValid: function() {
|
|
34
|
+
return isStringValid;
|
|
35
|
+
},
|
|
36
|
+
removeOneFromStoredDisplayed: function() {
|
|
37
|
+
return removeOneFromStoredDisplayed;
|
|
38
|
+
},
|
|
39
|
+
titleCase: function() {
|
|
40
|
+
return titleCase;
|
|
41
|
+
},
|
|
42
|
+
toPascalCase: function() {
|
|
43
|
+
return toPascalCase;
|
|
44
|
+
},
|
|
45
|
+
useRandomColor: function() {
|
|
46
|
+
return useRandomColor;
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
function _define_property(obj, key, value) {
|
|
50
|
+
if (key in obj) {
|
|
51
|
+
Object.defineProperty(obj, key, {
|
|
52
|
+
value: value,
|
|
53
|
+
enumerable: true,
|
|
54
|
+
configurable: true,
|
|
55
|
+
writable: true
|
|
56
|
+
});
|
|
57
|
+
} else {
|
|
58
|
+
obj[key] = value;
|
|
59
|
+
}
|
|
60
|
+
return obj;
|
|
61
|
+
}
|
|
62
|
+
function _object_spread(target) {
|
|
63
|
+
for(var i = 1; i < arguments.length; i++){
|
|
64
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
65
|
+
var ownKeys = Object.keys(source);
|
|
66
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
67
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
68
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
ownKeys.forEach(function(key) {
|
|
72
|
+
_define_property(target, key, source[key]);
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
return target;
|
|
76
|
+
}
|
|
77
|
+
const getJPart = (j, jsonPath, defaultValue, separator = '.', replacer = '^\\.*', joiner = '.')=>{
|
|
78
|
+
// if key is invalid - return error
|
|
79
|
+
if (j == null) return defaultValue;
|
|
80
|
+
// convert indexes to properties
|
|
81
|
+
jsonPath = jsonPath.replace(/\[(['"]?)(.*?)\1\]/g, `${separator}$2`);
|
|
82
|
+
// strip all leading dots
|
|
83
|
+
jsonPath = jsonPath.replace(replacer, '');
|
|
84
|
+
// split path by '.'
|
|
85
|
+
let isArrValid = false, isStrValid = false, currentPathPart;
|
|
86
|
+
const pathParts = jsonPath.split(separator);
|
|
87
|
+
for(let i = 0, n = pathParts.length; i < n; ++i){
|
|
88
|
+
currentPathPart = pathParts[i];
|
|
89
|
+
isStrValid = isStringValid(j);
|
|
90
|
+
isArrValid = isArrayValid(j);
|
|
91
|
+
if (isStrValid === true || isArrValid === true) {
|
|
92
|
+
if (isStrValid === true) {
|
|
93
|
+
j = JSON.parse(j);
|
|
94
|
+
} else {
|
|
95
|
+
j = j.reduce((acc, cur)=>{
|
|
96
|
+
const innerJ = getJPart(cur, pathParts.slice(i).join(joiner !== null && joiner !== void 0 ? joiner : separator), defaultValue);
|
|
97
|
+
if (isArrayValid(innerJ)) {
|
|
98
|
+
acc.push(...innerJ);
|
|
99
|
+
} else {
|
|
100
|
+
acc.push(innerJ);
|
|
101
|
+
}
|
|
102
|
+
return acc;
|
|
103
|
+
}, []);
|
|
104
|
+
break;
|
|
105
|
+
}
|
|
106
|
+
} else {
|
|
107
|
+
if (j[currentPathPart] != null && currentPathPart in j) {
|
|
108
|
+
j = j[currentPathPart];
|
|
109
|
+
} else {
|
|
110
|
+
// if something in the process failed:
|
|
111
|
+
// 1. set the rv as the default value
|
|
112
|
+
// 2. stop the loop`
|
|
113
|
+
j = defaultValue;
|
|
114
|
+
break;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
return j;
|
|
119
|
+
};
|
|
120
|
+
const isArrayValid = (arr, minLength = 1, maxLength = 0)=>{
|
|
121
|
+
let rv = isObjectValid(arr) && arr.length >= minLength && //arr instanceof Array
|
|
122
|
+
Object.prototype.toString.call(arr) == '[object Array]';
|
|
123
|
+
if (maxLength > 0) {
|
|
124
|
+
rv = rv && arr.length <= maxLength;
|
|
125
|
+
}
|
|
126
|
+
return rv;
|
|
127
|
+
};
|
|
128
|
+
const isObjectValid = (obj, isCheckKeys = false)=>{
|
|
129
|
+
let rv = typeof obj !== 'undefined' && obj !== null;
|
|
130
|
+
if (isCheckKeys) {
|
|
131
|
+
rv = rv && Object.keys(obj).length > 0;
|
|
132
|
+
}
|
|
133
|
+
return rv;
|
|
134
|
+
};
|
|
135
|
+
const isStringValid = (str, minLength = null, maxLength = null, isValidateType = true)=>{
|
|
136
|
+
let rv = isObjectValid(str) && str.toString().length > 0 && (isValidateType ? typeof str === 'string' : true);
|
|
137
|
+
if (rv === false) return false;
|
|
138
|
+
if (minLength && isNaN(minLength) === false && minLength > 0) {
|
|
139
|
+
rv = rv && str.toString().length >= minLength;
|
|
140
|
+
}
|
|
141
|
+
if (rv === false) return false;
|
|
142
|
+
if (maxLength && isNaN(maxLength) === false && maxLength > 0) {
|
|
143
|
+
rv = rv && str.toString().length <= maxLength;
|
|
144
|
+
}
|
|
145
|
+
return rv;
|
|
146
|
+
};
|
|
147
|
+
const titleCase = (str = '')=>str && toPascalCase(str.toString(), true);
|
|
148
|
+
const toPascalCase = (string, title = false)=>{
|
|
149
|
+
return string && string.replace(/(_[a-z])?(^[a-z])?(_|\s[a-z])?/g, ($1)=>$1.toUpperCase().replace('_', title ? ' ' : ''));
|
|
150
|
+
};
|
|
151
|
+
const useRandomColor = (theme)=>{
|
|
152
|
+
const paletteColors = _object_spread({}, theme.palette.colors);
|
|
153
|
+
const colors = Object.entries(paletteColors).filter(([key])=>!key.includes('light')).map(([_, value])=>value);
|
|
154
|
+
const getRandomColor = ()=>{
|
|
155
|
+
const randomIndex = Math.floor(Math.random() * colors.length);
|
|
156
|
+
return colors[randomIndex];
|
|
157
|
+
};
|
|
158
|
+
return getRandomColor;
|
|
159
|
+
};
|
|
160
|
+
const getOption = (option, title_path)=>{
|
|
161
|
+
if (option != '') {
|
|
162
|
+
let curOption = getJPart(option, title_path, 0);
|
|
163
|
+
if (curOption !== null && isArrayValid(curOption)) {
|
|
164
|
+
curOption = curOption[0];
|
|
165
|
+
}
|
|
166
|
+
return curOption;
|
|
167
|
+
}
|
|
168
|
+
return null;
|
|
169
|
+
};
|
|
170
|
+
const removeOneFromStoredDisplayed = (option, fetchedProps)=>{
|
|
171
|
+
const { multiple, title_path, name, _id, query } = fetchedProps !== null && fetchedProps !== void 0 ? fetchedProps : {};
|
|
172
|
+
let storedDisplayed = sessionStorage.getItem(`dropdown-${query}-${name}-${_id}`);
|
|
173
|
+
if (storedDisplayed) {
|
|
174
|
+
storedDisplayed = JSON.parse(storedDisplayed);
|
|
175
|
+
if (multiple) {
|
|
176
|
+
const newDisplayed = storedDisplayed[name].filter((opt)=>opt[title_path] !== option[title_path]);
|
|
177
|
+
storedDisplayed[name] = newDisplayed;
|
|
178
|
+
} else {
|
|
179
|
+
delete storedDisplayed[name];
|
|
180
|
+
}
|
|
181
|
+
sessionStorage.setItem(`dropdown-${query}-${name}-${_id}`, JSON.stringify(storedDisplayed));
|
|
182
|
+
}
|
|
183
|
+
};
|
|
184
|
+
const deleteOneItem = (item, fetchedProps, displayed, setDisplayed)=>{
|
|
185
|
+
const { multiple, title_path, onRemoveOne } = fetchedProps !== null && fetchedProps !== void 0 ? fetchedProps : {};
|
|
186
|
+
if (multiple) {
|
|
187
|
+
const newDisplayed = displayed.filter((opt)=>opt[title_path] !== item[title_path]);
|
|
188
|
+
setDisplayed(newDisplayed);
|
|
189
|
+
} else {
|
|
190
|
+
setDisplayed('');
|
|
191
|
+
}
|
|
192
|
+
if (onRemoveOne) {
|
|
193
|
+
onRemoveOne(item);
|
|
194
|
+
}
|
|
195
|
+
removeOneFromStoredDisplayed(item, fetchedProps);
|
|
196
|
+
};
|
|
197
|
+
const addToStoredDisplayed = (option, fetchedProps)=>{
|
|
198
|
+
const { name, multiple, query, _id } = fetchedProps !== null && fetchedProps !== void 0 ? fetchedProps : {};
|
|
199
|
+
const prevStored = sessionStorage.getItem(`dropdown-${query}-${name}-${_id}`);
|
|
200
|
+
const data = prevStored ? JSON.parse(prevStored) : {};
|
|
201
|
+
if (data[name]) {
|
|
202
|
+
if (multiple) {
|
|
203
|
+
data[name] = [
|
|
204
|
+
...data[name],
|
|
205
|
+
option
|
|
206
|
+
];
|
|
207
|
+
} else {
|
|
208
|
+
data[name] = [
|
|
209
|
+
option
|
|
210
|
+
];
|
|
211
|
+
}
|
|
212
|
+
} else {
|
|
213
|
+
data[name] = [
|
|
214
|
+
option
|
|
215
|
+
];
|
|
216
|
+
}
|
|
217
|
+
sessionStorage.setItem(`dropdown-${query}-${name}-${_id}`, JSON.stringify(data));
|
|
218
|
+
};
|
|
219
|
+
const isChecked = (option, displayed, fetchedProps)=>{
|
|
220
|
+
const { multiple, title_path, search_path } = fetchedProps !== null && fetchedProps !== void 0 ? fetchedProps : {};
|
|
221
|
+
const clicked = getOption(option, title_path);
|
|
222
|
+
if (typeof displayed === 'string') {
|
|
223
|
+
return false;
|
|
224
|
+
} else {
|
|
225
|
+
if (multiple) {
|
|
226
|
+
return displayed.map((item)=>{
|
|
227
|
+
return item[title_path];
|
|
228
|
+
}).includes(clicked);
|
|
229
|
+
} else {
|
|
230
|
+
return displayed[search_path] === clicked;
|
|
231
|
+
}
|
|
232
|
+
}
|
|
233
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
Object.defineProperty(exports, "FxAsyncDropdown", {
|
|
6
|
+
enumerable: true,
|
|
7
|
+
get: function() {
|
|
8
|
+
return _FxAsyncDropdown.FxAsyncDropdown;
|
|
9
|
+
}
|
|
10
|
+
});
|
|
11
|
+
const _FxAsyncDropdown = require("./FxAsyncDropdown");
|
|
@@ -0,0 +1,211 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", {
|
|
3
|
+
value: true
|
|
4
|
+
});
|
|
5
|
+
function _export(target, all) {
|
|
6
|
+
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: all[name]
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
_export(exports, {
|
|
12
|
+
InputWrapper: function() {
|
|
13
|
+
return InputWrapper;
|
|
14
|
+
},
|
|
15
|
+
Loading: function() {
|
|
16
|
+
return Loading;
|
|
17
|
+
},
|
|
18
|
+
Root: function() {
|
|
19
|
+
return Root;
|
|
20
|
+
},
|
|
21
|
+
StyledListBox: function() {
|
|
22
|
+
return StyledListBox;
|
|
23
|
+
}
|
|
24
|
+
});
|
|
25
|
+
const _styles = require("@mui/material/styles");
|
|
26
|
+
function _define_property(obj, key, value) {
|
|
27
|
+
if (key in obj) {
|
|
28
|
+
Object.defineProperty(obj, key, {
|
|
29
|
+
value: value,
|
|
30
|
+
enumerable: true,
|
|
31
|
+
configurable: true,
|
|
32
|
+
writable: true
|
|
33
|
+
});
|
|
34
|
+
} else {
|
|
35
|
+
obj[key] = value;
|
|
36
|
+
}
|
|
37
|
+
return obj;
|
|
38
|
+
}
|
|
39
|
+
function _object_spread(target) {
|
|
40
|
+
for(var i = 1; i < arguments.length; i++){
|
|
41
|
+
var source = arguments[i] != null ? arguments[i] : {};
|
|
42
|
+
var ownKeys = Object.keys(source);
|
|
43
|
+
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
44
|
+
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
45
|
+
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
46
|
+
}));
|
|
47
|
+
}
|
|
48
|
+
ownKeys.forEach(function(key) {
|
|
49
|
+
_define_property(target, key, source[key]);
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
return target;
|
|
53
|
+
}
|
|
54
|
+
function ownKeys(object, enumerableOnly) {
|
|
55
|
+
var keys = Object.keys(object);
|
|
56
|
+
if (Object.getOwnPropertySymbols) {
|
|
57
|
+
var symbols = Object.getOwnPropertySymbols(object);
|
|
58
|
+
if (enumerableOnly) {
|
|
59
|
+
symbols = symbols.filter(function(sym) {
|
|
60
|
+
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
keys.push.apply(keys, symbols);
|
|
64
|
+
}
|
|
65
|
+
return keys;
|
|
66
|
+
}
|
|
67
|
+
function _object_spread_props(target, source) {
|
|
68
|
+
source = source != null ? source : {};
|
|
69
|
+
if (Object.getOwnPropertyDescriptors) {
|
|
70
|
+
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
71
|
+
} else {
|
|
72
|
+
ownKeys(Object(source)).forEach(function(key) {
|
|
73
|
+
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
return target;
|
|
77
|
+
}
|
|
78
|
+
const Root = (0, _styles.styled)('div')(({ props })=>{
|
|
79
|
+
return _object_spread_props(_object_spread({
|
|
80
|
+
color: 'rgba(0,0,0,.85)',
|
|
81
|
+
fontSize: 14,
|
|
82
|
+
background: '#FFFFFF',
|
|
83
|
+
padding: '0 16px',
|
|
84
|
+
position: 'relative',
|
|
85
|
+
' & .MuiBox-root': {
|
|
86
|
+
['& > div']: {
|
|
87
|
+
padding: 0
|
|
88
|
+
}
|
|
89
|
+
},
|
|
90
|
+
minWidth: 270
|
|
91
|
+
}, props), {
|
|
92
|
+
width: 'min-content'
|
|
93
|
+
});
|
|
94
|
+
});
|
|
95
|
+
const Loading = (0, _styles.styled)('div')(()=>({
|
|
96
|
+
width: 30,
|
|
97
|
+
height: 30,
|
|
98
|
+
display: 'flex',
|
|
99
|
+
alignItems: 'center',
|
|
100
|
+
justifyContent: 'center',
|
|
101
|
+
['& span']: {
|
|
102
|
+
width: '20px !important',
|
|
103
|
+
height: '20px !important'
|
|
104
|
+
}
|
|
105
|
+
}));
|
|
106
|
+
const InputWrapper = (0, _styles.styled)('div')(({ theme, hasValue, disabled })=>{
|
|
107
|
+
const disabledBorder = `1px solid ${theme.palette.greyscale[200]}`;
|
|
108
|
+
const activeBorder = `1px solid ${theme.palette.primary[500]}`;
|
|
109
|
+
return {
|
|
110
|
+
backgroundColor: theme.palette.common.white,
|
|
111
|
+
borderRadius: 4,
|
|
112
|
+
padding: 1,
|
|
113
|
+
display: 'flex',
|
|
114
|
+
alignItems: 'center',
|
|
115
|
+
flexWrap: 'wrap',
|
|
116
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
117
|
+
width: '100%',
|
|
118
|
+
border: 'none !important',
|
|
119
|
+
outline: 'none !important',
|
|
120
|
+
['&:hover']: {
|
|
121
|
+
border: disabled ? disabledBorder : activeBorder,
|
|
122
|
+
borderRadius: 4
|
|
123
|
+
},
|
|
124
|
+
['&:focus']: {
|
|
125
|
+
border: disabled ? disabledBorder : activeBorder,
|
|
126
|
+
borderRadius: 4
|
|
127
|
+
},
|
|
128
|
+
['& > svg']: {
|
|
129
|
+
color: disabled ? theme.palette.greyscale[300] : theme.palette.primary['500'],
|
|
130
|
+
marginRight: 8
|
|
131
|
+
},
|
|
132
|
+
['& input']: _object_spread_props(_object_spread({
|
|
133
|
+
border: 'none',
|
|
134
|
+
outline: 'none',
|
|
135
|
+
cursor: disabled ? 'not-allowed' : 'pointer',
|
|
136
|
+
backgroundColor: theme.palette.common.white,
|
|
137
|
+
color: theme.palette.typography.title,
|
|
138
|
+
height: 36,
|
|
139
|
+
boxSizing: 'border-box',
|
|
140
|
+
width: 0,
|
|
141
|
+
minWidth: 30,
|
|
142
|
+
flexGrow: 1,
|
|
143
|
+
margin: 0
|
|
144
|
+
}, theme.typography.body1), {
|
|
145
|
+
lineHeight: '20px',
|
|
146
|
+
['& ::placeholder']: {
|
|
147
|
+
color: hasValue ? theme.palette.typography.title : theme.palette.greyscale[400]
|
|
148
|
+
}
|
|
149
|
+
})
|
|
150
|
+
};
|
|
151
|
+
});
|
|
152
|
+
const StyledListBox = (0, _styles.styled)('ul')(({ theme })=>{
|
|
153
|
+
return {
|
|
154
|
+
margin: 0,
|
|
155
|
+
padding: '8px 0px',
|
|
156
|
+
listStyle: 'none',
|
|
157
|
+
backgroundColor: theme.palette.common.white,
|
|
158
|
+
overflow: 'auto',
|
|
159
|
+
zIndex: 1,
|
|
160
|
+
textOverflow: 'ellipsis',
|
|
161
|
+
whiteSpace: 'nowrap',
|
|
162
|
+
overflowX: 'hidden',
|
|
163
|
+
minWidth: 270,
|
|
164
|
+
'&::-webkit-scrollbar': {
|
|
165
|
+
width: '8px',
|
|
166
|
+
backgroundColor: 'transparent'
|
|
167
|
+
},
|
|
168
|
+
'&::-webkit-scrollbar-thumb': {
|
|
169
|
+
backgroundColor: '#8B9092',
|
|
170
|
+
borderRadius: '8px'
|
|
171
|
+
},
|
|
172
|
+
// To support Firefox
|
|
173
|
+
scrollbarWidth: 'thin',
|
|
174
|
+
scrollbarColor: '#8B9092 transparent',
|
|
175
|
+
maxHeight: '300px',
|
|
176
|
+
overflowY: 'auto',
|
|
177
|
+
['& div']: {
|
|
178
|
+
textOverflow: 'ellipsis',
|
|
179
|
+
whiteSpace: 'nowrap',
|
|
180
|
+
overflow: 'hidden',
|
|
181
|
+
margin: 'auto 0'
|
|
182
|
+
},
|
|
183
|
+
['& li']: {
|
|
184
|
+
display: 'flex',
|
|
185
|
+
alignItems: 'center',
|
|
186
|
+
justifyContent: 'flex-start',
|
|
187
|
+
height: 40,
|
|
188
|
+
cursor: 'pointer',
|
|
189
|
+
textOverflow: 'ellipsis',
|
|
190
|
+
whiteSpace: 'nowrap',
|
|
191
|
+
overflow: 'hidden',
|
|
192
|
+
width: '100%',
|
|
193
|
+
minWidth: 270,
|
|
194
|
+
marginBottom: 2
|
|
195
|
+
},
|
|
196
|
+
['& li:hover']: {
|
|
197
|
+
backgroundColor: '#F6F9FA'
|
|
198
|
+
},
|
|
199
|
+
['& li[aria-selected=\'true\']']: {
|
|
200
|
+
fontWeight: 900,
|
|
201
|
+
backgroundColor: '#F6F9FA'
|
|
202
|
+
},
|
|
203
|
+
['& li[data-focus=\'true\']']: {
|
|
204
|
+
backgroundColor: '#F6F9FA',
|
|
205
|
+
cursor: 'pointer',
|
|
206
|
+
['& svg ']: {
|
|
207
|
+
color: 'currentColor'
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
};
|
|
211
|
+
});
|