@fixefy/fixefy-ui-components 0.0.45 → 0.0.47
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/package.json +3 -4
- package/build/FxActionsTray/FxActionsTray.js +0 -351
- package/build/FxActionsTray/actions_tray_types.d.js +0 -4
- package/build/FxActionsTray/index.js +0 -11
- package/build/FxActionsTray/styles/actions_tray.styles.js +0 -160
- package/build/FxAggregationsBar/FxAggregations.js +0 -41
- package/build/FxAggregationsBar/aggregations_types.d.js +0 -4
- package/build/FxAggregationsBar/helpers/structureReader.js +0 -78
- package/build/FxAggregationsBar/index.js +0 -11
- package/build/FxAggregationsBar/operations/query.js +0 -73
- package/build/FxAsyncDropdown/FxAsyncDropdown.js +0 -456
- package/build/FxAsyncDropdown/async_dropdown_types.d.js +0 -4
- package/build/FxAsyncDropdown/helpers/helpers.js +0 -151
- package/build/FxAsyncDropdown/index.js +0 -11
- package/build/FxAsyncDropdown/styles/dropdown.styles.js +0 -230
- package/build/FxAvatar/FxAvatar.js +0 -145
- package/build/FxAvatar/avatar_types.d.js +0 -4
- package/build/FxAvatar/helpers/stringToColor.js +0 -23
- package/build/FxAvatar/index.js +0 -11
- package/build/FxAvatar/styles/avatar.styles.js +0 -193
- package/build/FxButton/FxButton.js +0 -106
- package/build/FxButton/index.js +0 -11
- package/build/FxButton/styles/button.styles.js +0 -23
- package/build/FxChip/FxChip.js +0 -37
- package/build/FxChip/chip_types.d.js +0 -4
- package/build/FxChip/index.js +0 -11
- package/build/FxChip/styles/chip.styles.js +0 -62
- package/build/FxIcon/FxIcon.js +0 -147
- package/build/FxIcon/content/dynamic_icon.js +0 -20
- package/build/FxIcon/content/index.js +0 -20
- package/build/FxIcon/content/lazy_icon.js +0 -137
- package/build/FxIcon/icon_types.d.js +0 -4
- package/build/FxIcon/index.js +0 -20
- package/build/FxModal/FxModal.js +0 -171
- package/build/FxModal/index.js +0 -11
- package/build/FxModal/modal_types.d.js +0 -4
- package/build/FxModal/styles/modal.style.js +0 -59
- package/build/FxNotes/FxNotes.js +0 -216
- package/build/FxNotes/helpers/stringToColor.js +0 -26
- package/build/FxNotes/index.js +0 -11
- package/build/FxNotes/note_types.d.js +0 -4
- package/build/FxNotes/operations/queries.js +0 -35
- package/build/FxNotes/styles/notes.styles.js +0 -169
- package/build/FxNumberField/FxNumberField.js +0 -109
- package/build/FxNumberField/index.js +0 -11
- package/build/FxNumberField/number_field_types.d.js +0 -4
- package/build/FxNumberField/styles/number_field.styles.js +0 -94
- package/build/FxProgressCircle/FxProgressCircle.js +0 -65
- package/build/FxProgressCircle/index.js +0 -11
- package/build/FxProgressCircle/progress_circle_types.d.js +0 -4
- package/build/FxProgressCircle/styles/progress_circle.styles.js +0 -106
- package/build/FxProgressCounter/ProgressCounter.js +0 -168
- package/build/FxProgressCounter/index.js +0 -11
- package/build/FxProgressCounter/progress_counter_types.d.js +0 -4
- package/build/FxProgressCounter/styles/progress_counter.styles.js +0 -61
- package/build/FxScore/FxScore.js +0 -207
- package/build/FxScore/index.js +0 -11
- package/build/FxScore/score_types.d.js +0 -4
- package/build/FxScore/styles/score.styles.js +0 -96
- package/build/FxShowMore/FxShowMore.js +0 -80
- package/build/FxShowMore/index.js +0 -11
- package/build/FxShowMore/show_more_types.d.js +0 -4
- package/build/FxShowMore/styles/show_more.styles.js +0 -134
- package/build/FxSlider/FxSlider.js +0 -49
- package/build/FxSlider/index.js +0 -11
- package/build/FxSlider/slider_types.d.js +0 -4
- package/build/FxStatisticsBar/FxStatisticsBar.js +0 -191
- package/build/FxStatisticsBar/index.js +0 -11
- package/build/FxStatisticsBar/statistics_bar_types.d.js +0 -4
- package/build/FxStatisticsBar/styles/statistics.styles.js +0 -98
- package/build/FxStatusBar/FxStatusBar.js +0 -143
- package/build/FxStatusBar/helpers/constants.js +0 -22
- package/build/FxStatusBar/index.js +0 -20
- package/build/FxStatusBar/status_bar_types.d.js +0 -4
- package/build/FxStatusBar/styles/statusBar.styles.js +0 -131
- package/build/FxStyledComponents/index.js +0 -311
- package/build/FxTag/FxTag.js +0 -41
- package/build/FxTag/fxtag_types.d.js +0 -4
- package/build/FxTag/index.js +0 -20
- package/build/FxTag/styles/tag.styles.js +0 -94
- package/build/FxTextField/FxTextField.js +0 -208
- package/build/FxTextField/index.js +0 -11
- package/build/FxTextField/text_field_types.d.js +0 -4
- package/build/FxTodo/FxTodo.js +0 -95
- package/build/FxTodo/index.js +0 -23
- package/build/FxTodo/styles/todo.styles.js +0 -183
- package/build/FxTodo/todo_types.d.js +0 -4
- package/build/FxWizard/FxWizard.js +0 -179
- package/build/FxWizard/WizardContext.js +0 -207
- package/build/FxWizard/index.js +0 -23
- package/build/FxWizard/styles/wizard.styles.js +0 -89
- package/build/FxWizard/wizard_types.d.js +0 -4
- package/build/index.js +0 -182
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "FxAggregationsBar", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return _FxAggregations.FxAggregationsBar;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _FxAggregations = require("./FxAggregations");
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
Object.defineProperty(exports, "STRUCTURES", {
|
|
6
|
-
enumerable: true,
|
|
7
|
-
get: function() {
|
|
8
|
-
return STRUCTURES;
|
|
9
|
-
}
|
|
10
|
-
});
|
|
11
|
-
const _graphqltag = require("graphql-tag");
|
|
12
|
-
const STRUCTURES = (0, _graphqltag.gql)`
|
|
13
|
-
query STRUCTURES {
|
|
14
|
-
structure(where: { name: "aggregations_invoice" }) {
|
|
15
|
-
_id
|
|
16
|
-
bundle_name
|
|
17
|
-
name
|
|
18
|
-
title
|
|
19
|
-
type
|
|
20
|
-
input_type {
|
|
21
|
-
name
|
|
22
|
-
value
|
|
23
|
-
}
|
|
24
|
-
readable_id
|
|
25
|
-
extended {
|
|
26
|
-
format
|
|
27
|
-
gql_operation
|
|
28
|
-
title_path
|
|
29
|
-
object_path
|
|
30
|
-
filter
|
|
31
|
-
variables
|
|
32
|
-
}
|
|
33
|
-
children(sort: { index: 1 }) {
|
|
34
|
-
_id
|
|
35
|
-
name
|
|
36
|
-
title
|
|
37
|
-
type
|
|
38
|
-
input_type {
|
|
39
|
-
name
|
|
40
|
-
value
|
|
41
|
-
}
|
|
42
|
-
readable_id
|
|
43
|
-
extended {
|
|
44
|
-
format
|
|
45
|
-
gql_operation
|
|
46
|
-
title_path
|
|
47
|
-
object_path
|
|
48
|
-
filter
|
|
49
|
-
variables
|
|
50
|
-
}
|
|
51
|
-
children(sort: { index: 1 }) {
|
|
52
|
-
_id
|
|
53
|
-
name
|
|
54
|
-
title
|
|
55
|
-
type
|
|
56
|
-
input_type {
|
|
57
|
-
name
|
|
58
|
-
value
|
|
59
|
-
}
|
|
60
|
-
readable_id
|
|
61
|
-
extended {
|
|
62
|
-
format
|
|
63
|
-
gql_operation
|
|
64
|
-
title_path
|
|
65
|
-
object_path
|
|
66
|
-
filter
|
|
67
|
-
variables
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
`;
|
|
@@ -1,456 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
"use strict";
|
|
3
|
-
Object.defineProperty(exports, "__esModule", {
|
|
4
|
-
value: true
|
|
5
|
-
});
|
|
6
|
-
Object.defineProperty(exports, "FxAsyncDropdown", {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: function() {
|
|
9
|
-
return FxAsyncDropdown;
|
|
10
|
-
}
|
|
11
|
-
});
|
|
12
|
-
const _jsxruntime = require("react/jsx-runtime");
|
|
13
|
-
const _lodash = /*#__PURE__*/ _interop_require_default(require("lodash"));
|
|
14
|
-
const _iconsmaterial = require("@mui/icons-material");
|
|
15
|
-
const _graphqltag = require("graphql-tag");
|
|
16
|
-
const _client = require("@apollo/client");
|
|
17
|
-
const _fixefyuiutils = require("@fixefy/fixefy-ui-utils");
|
|
18
|
-
const _react = /*#__PURE__*/ _interop_require_wildcard(require("react"));
|
|
19
|
-
const _material = require("@mui/material");
|
|
20
|
-
const _dropdownstyles = require("./styles/dropdown.styles");
|
|
21
|
-
function _define_property(obj, key, value) {
|
|
22
|
-
if (key in obj) {
|
|
23
|
-
Object.defineProperty(obj, key, {
|
|
24
|
-
value: value,
|
|
25
|
-
enumerable: true,
|
|
26
|
-
configurable: true,
|
|
27
|
-
writable: true
|
|
28
|
-
});
|
|
29
|
-
} else {
|
|
30
|
-
obj[key] = value;
|
|
31
|
-
}
|
|
32
|
-
return obj;
|
|
33
|
-
}
|
|
34
|
-
function _interop_require_default(obj) {
|
|
35
|
-
return obj && obj.__esModule ? obj : {
|
|
36
|
-
default: obj
|
|
37
|
-
};
|
|
38
|
-
}
|
|
39
|
-
function _getRequireWildcardCache(nodeInterop) {
|
|
40
|
-
if (typeof WeakMap !== "function") return null;
|
|
41
|
-
var cacheBabelInterop = new WeakMap();
|
|
42
|
-
var cacheNodeInterop = new WeakMap();
|
|
43
|
-
return (_getRequireWildcardCache = function(nodeInterop) {
|
|
44
|
-
return nodeInterop ? cacheNodeInterop : cacheBabelInterop;
|
|
45
|
-
})(nodeInterop);
|
|
46
|
-
}
|
|
47
|
-
function _interop_require_wildcard(obj, nodeInterop) {
|
|
48
|
-
if (!nodeInterop && obj && obj.__esModule) {
|
|
49
|
-
return obj;
|
|
50
|
-
}
|
|
51
|
-
if (obj === null || typeof obj !== "object" && typeof obj !== "function") {
|
|
52
|
-
return {
|
|
53
|
-
default: obj
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
var cache = _getRequireWildcardCache(nodeInterop);
|
|
57
|
-
if (cache && cache.has(obj)) {
|
|
58
|
-
return cache.get(obj);
|
|
59
|
-
}
|
|
60
|
-
var newObj = {
|
|
61
|
-
__proto__: null
|
|
62
|
-
};
|
|
63
|
-
var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor;
|
|
64
|
-
for(var key in obj){
|
|
65
|
-
if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) {
|
|
66
|
-
var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null;
|
|
67
|
-
if (desc && (desc.get || desc.set)) {
|
|
68
|
-
Object.defineProperty(newObj, key, desc);
|
|
69
|
-
} else {
|
|
70
|
-
newObj[key] = obj[key];
|
|
71
|
-
}
|
|
72
|
-
}
|
|
73
|
-
}
|
|
74
|
-
newObj.default = obj;
|
|
75
|
-
if (cache) {
|
|
76
|
-
cache.set(obj, newObj);
|
|
77
|
-
}
|
|
78
|
-
return newObj;
|
|
79
|
-
}
|
|
80
|
-
function _object_spread(target) {
|
|
81
|
-
for(var i = 1; i < arguments.length; i++){
|
|
82
|
-
var source = arguments[i] != null ? arguments[i] : {};
|
|
83
|
-
var ownKeys = Object.keys(source);
|
|
84
|
-
if (typeof Object.getOwnPropertySymbols === "function") {
|
|
85
|
-
ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
|
|
86
|
-
return Object.getOwnPropertyDescriptor(source, sym).enumerable;
|
|
87
|
-
}));
|
|
88
|
-
}
|
|
89
|
-
ownKeys.forEach(function(key) {
|
|
90
|
-
_define_property(target, key, source[key]);
|
|
91
|
-
});
|
|
92
|
-
}
|
|
93
|
-
return target;
|
|
94
|
-
}
|
|
95
|
-
function ownKeys(object, enumerableOnly) {
|
|
96
|
-
var keys = Object.keys(object);
|
|
97
|
-
if (Object.getOwnPropertySymbols) {
|
|
98
|
-
var symbols = Object.getOwnPropertySymbols(object);
|
|
99
|
-
if (enumerableOnly) {
|
|
100
|
-
symbols = symbols.filter(function(sym) {
|
|
101
|
-
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
|
|
102
|
-
});
|
|
103
|
-
}
|
|
104
|
-
keys.push.apply(keys, symbols);
|
|
105
|
-
}
|
|
106
|
-
return keys;
|
|
107
|
-
}
|
|
108
|
-
function _object_spread_props(target, source) {
|
|
109
|
-
source = source != null ? source : {};
|
|
110
|
-
if (Object.getOwnPropertyDescriptors) {
|
|
111
|
-
Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
|
|
112
|
-
} else {
|
|
113
|
-
ownKeys(Object(source)).forEach(function(key) {
|
|
114
|
-
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
|
|
115
|
-
});
|
|
116
|
-
}
|
|
117
|
-
return target;
|
|
118
|
-
}
|
|
119
|
-
function _object_without_properties(source, excluded) {
|
|
120
|
-
if (source == null) return {};
|
|
121
|
-
var target = _object_without_properties_loose(source, excluded);
|
|
122
|
-
var key, i;
|
|
123
|
-
if (Object.getOwnPropertySymbols) {
|
|
124
|
-
var sourceSymbolKeys = Object.getOwnPropertySymbols(source);
|
|
125
|
-
for(i = 0; i < sourceSymbolKeys.length; i++){
|
|
126
|
-
key = sourceSymbolKeys[i];
|
|
127
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
128
|
-
if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue;
|
|
129
|
-
target[key] = source[key];
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
return target;
|
|
133
|
-
}
|
|
134
|
-
function _object_without_properties_loose(source, excluded) {
|
|
135
|
-
if (source == null) return {};
|
|
136
|
-
var target = {};
|
|
137
|
-
var sourceKeys = Object.keys(source);
|
|
138
|
-
var key, i;
|
|
139
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
140
|
-
key = sourceKeys[i];
|
|
141
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
142
|
-
target[key] = source[key];
|
|
143
|
-
}
|
|
144
|
-
return target;
|
|
145
|
-
}
|
|
146
|
-
const icon = /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CheckBoxOutlineBlank, {
|
|
147
|
-
fontSize: "small"
|
|
148
|
-
});
|
|
149
|
-
const checkedIcon = /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.CheckBox, {
|
|
150
|
-
fontSize: "small"
|
|
151
|
-
});
|
|
152
|
-
const FxAsyncDropdown = /*#__PURE__*/ _react.default.forwardRef((props, parentRef)=>{
|
|
153
|
-
var _structure_extended, _props_styles, _props_styles1, _props_styles2;
|
|
154
|
-
const ref = (0, _react.useRef)(null);
|
|
155
|
-
const theme = (0, _material.useTheme)();
|
|
156
|
-
const [options, setOptions] = (0, _react.useState)([]);
|
|
157
|
-
const [loadingData, setLoadingData] = (0, _react.useState)(false);
|
|
158
|
-
const [isLastPage, setIsLastPage] = (0, _react.useState)(false);
|
|
159
|
-
const [searchValue, setSearchValue] = (0, _react.useState)(null);
|
|
160
|
-
const [hasClearBtn, setHasClearBtn] = (0, _react.useState)(false);
|
|
161
|
-
const [page, setPage] = (0, _react.useState)(1);
|
|
162
|
-
const [prevPage, setPrevPage] = (0, _react.useState)(0);
|
|
163
|
-
const [pageSize] = (0, _react.useState)(20);
|
|
164
|
-
const { debug, structure, onChange, onClear, renderOptions, fetcher, initialValue = {}, multiple, disabled, type = 'text', showSelectedValue } = props, rest = _object_without_properties(props, [
|
|
165
|
-
"debug",
|
|
166
|
-
"structure",
|
|
167
|
-
"onChange",
|
|
168
|
-
"onClear",
|
|
169
|
-
"renderOptions",
|
|
170
|
-
"fetcher",
|
|
171
|
-
"initialValue",
|
|
172
|
-
"multiple",
|
|
173
|
-
"disabled",
|
|
174
|
-
"type",
|
|
175
|
-
"showSelectedValue"
|
|
176
|
-
]);
|
|
177
|
-
const { name, extended, children } = structure;
|
|
178
|
-
const { search_path, variables } = extended;
|
|
179
|
-
const { method_name } = variables;
|
|
180
|
-
const [fetch, { data, loading }] = (0, _client.useLazyQuery)((0, _graphqltag.gql)(fetcher.query), _object_spread_props(_object_spread({}, fetcher.queryOptions), {
|
|
181
|
-
variables: _object_spread_props(_object_spread({}, fetcher.queryOptions.variables), {
|
|
182
|
-
where: searchValue ? _object_spread_props(_object_spread({}, fetcher.queryOptions.variables.where), {
|
|
183
|
-
[search_path]: searchValue
|
|
184
|
-
}) : _object_spread({}, fetcher.queryOptions.variables.where),
|
|
185
|
-
skip: page * pageSize - pageSize,
|
|
186
|
-
limit: pageSize
|
|
187
|
-
})
|
|
188
|
-
}));
|
|
189
|
-
var _structure_extended_title_path;
|
|
190
|
-
const labelOption = (_structure_extended_title_path = structure === null || structure === void 0 ? void 0 : (_structure_extended = structure.extended) === null || _structure_extended === void 0 ? void 0 : _structure_extended.title_path) !== null && _structure_extended_title_path !== void 0 ? _structure_extended_title_path : 'title';
|
|
191
|
-
const { getRootProps, getInputProps, getClearProps, getListboxProps, getOptionProps, groupedOptions, value, popupOpen, focused, setAnchorEl } = (0, _material.useAutocomplete)(_object_spread_props(_object_spread({}, rest), {
|
|
192
|
-
defaultValue: initialValue,
|
|
193
|
-
options: options,
|
|
194
|
-
disableCloseOnSelect: !!multiple,
|
|
195
|
-
multiple,
|
|
196
|
-
disabled: disabled,
|
|
197
|
-
isOptionEqualToValue: (option, value)=>{
|
|
198
|
-
return option._id === value._id;
|
|
199
|
-
},
|
|
200
|
-
getOptionLabel: (option)=>{
|
|
201
|
-
var _option_labelOption;
|
|
202
|
-
return (0, _fixefyuiutils.titleCase)((_option_labelOption = option[labelOption]) !== null && _option_labelOption !== void 0 ? _option_labelOption : option.title);
|
|
203
|
-
}
|
|
204
|
-
}));
|
|
205
|
-
const onPopupScroll = _lodash.default.debounce(()=>{
|
|
206
|
-
if (ref && ref.current) {
|
|
207
|
-
//@ts-ignore
|
|
208
|
-
const threshHold = ref.current.scrollHeight / 2;
|
|
209
|
-
//@ts-ignore
|
|
210
|
-
if (ref.current.scrollTop > threshHold && !loadingData && !isLastPage) {
|
|
211
|
-
setLoadingData(true);
|
|
212
|
-
setPage((prevPage)=>prevPage + 1);
|
|
213
|
-
setPrevPage((prevPage)=>prevPage + 1);
|
|
214
|
-
}
|
|
215
|
-
}
|
|
216
|
-
}, 800);
|
|
217
|
-
const createTitle = ()=>{
|
|
218
|
-
if (Array.isArray(value)) {
|
|
219
|
-
if (value && value.length) {
|
|
220
|
-
return `${(0, _fixefyuiutils.titleCase)(name)} (${value.length})`;
|
|
221
|
-
}
|
|
222
|
-
}
|
|
223
|
-
return (0, _fixefyuiutils.titleCase)(name);
|
|
224
|
-
};
|
|
225
|
-
const handleSearch = _lodash.default.debounce((e)=>{
|
|
226
|
-
setSearchValue(e.target.value);
|
|
227
|
-
setPage(1);
|
|
228
|
-
}, 300);
|
|
229
|
-
const handleChildrens = (_param)=>{
|
|
230
|
-
var { structure } = _param, rest = _object_without_properties(_param, [
|
|
231
|
-
"structure"
|
|
232
|
-
]);
|
|
233
|
-
let rv = null;
|
|
234
|
-
const { type, children } = structure;
|
|
235
|
-
debug === true && console.log('handleChildrens', structure);
|
|
236
|
-
switch(type){
|
|
237
|
-
case 'dropdownOptions':
|
|
238
|
-
case 'dropdown_options':
|
|
239
|
-
{
|
|
240
|
-
rv = children.map((child)=>handleChildrens(_object_spread({
|
|
241
|
-
structure: child
|
|
242
|
-
}, rest)));
|
|
243
|
-
break;
|
|
244
|
-
}
|
|
245
|
-
case 'clear':
|
|
246
|
-
{
|
|
247
|
-
if (!hasClearBtn) {
|
|
248
|
-
setHasClearBtn(true);
|
|
249
|
-
}
|
|
250
|
-
rv = /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Button, _object_spread_props(_object_spread({}, rest), {
|
|
251
|
-
children: structure.title
|
|
252
|
-
}));
|
|
253
|
-
break;
|
|
254
|
-
}
|
|
255
|
-
default:
|
|
256
|
-
{
|
|
257
|
-
break;
|
|
258
|
-
}
|
|
259
|
-
}
|
|
260
|
-
return rv;
|
|
261
|
-
};
|
|
262
|
-
const handleRenderOptions = ()=>{
|
|
263
|
-
debug === true && console.log('renderOptions: ', renderOptions);
|
|
264
|
-
if (renderOptions) {
|
|
265
|
-
return groupedOptions.map((option, index)=>{
|
|
266
|
-
const CustomeComponent = renderOptions(option, index);
|
|
267
|
-
//@ts-ignore
|
|
268
|
-
return /*#__PURE__*/ _react.default.cloneElement(CustomeComponent, _object_spread({}, getOptionProps({
|
|
269
|
-
option,
|
|
270
|
-
index
|
|
271
|
-
})));
|
|
272
|
-
});
|
|
273
|
-
} else {
|
|
274
|
-
switch(type){
|
|
275
|
-
case 'checkbox':
|
|
276
|
-
{
|
|
277
|
-
return groupedOptions.map((option, index)=>{
|
|
278
|
-
const isSelected = getOptionProps({
|
|
279
|
-
option,
|
|
280
|
-
index
|
|
281
|
-
})['aria-selected'];
|
|
282
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)("li", _object_spread_props(_object_spread({}, getOptionProps({
|
|
283
|
-
option,
|
|
284
|
-
index
|
|
285
|
-
})), {
|
|
286
|
-
children: [
|
|
287
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Checkbox, {
|
|
288
|
-
icon: icon,
|
|
289
|
-
checked: Boolean(isSelected),
|
|
290
|
-
checkedIcon: checkedIcon,
|
|
291
|
-
sx: {
|
|
292
|
-
mr: 1,
|
|
293
|
-
minWidth: 24,
|
|
294
|
-
minHeight: 24,
|
|
295
|
-
p: 0,
|
|
296
|
-
['& svg']: {
|
|
297
|
-
fill: theme.palette.primary.light
|
|
298
|
-
}
|
|
299
|
-
}
|
|
300
|
-
}),
|
|
301
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
302
|
-
variant: "table",
|
|
303
|
-
color: theme.palette.typography.title,
|
|
304
|
-
children: (0, _fixefyuiutils.titleCase)(option === null || option === void 0 ? void 0 : option.title)
|
|
305
|
-
})
|
|
306
|
-
]
|
|
307
|
-
}));
|
|
308
|
-
});
|
|
309
|
-
}
|
|
310
|
-
case 'text':
|
|
311
|
-
{
|
|
312
|
-
return groupedOptions.map((option, index)=>{
|
|
313
|
-
var _structure_extended, _structure_extended1, _structure_extended2;
|
|
314
|
-
debug === true && console.log('renderOptions: ', structure === null || structure === void 0 ? void 0 : (_structure_extended = structure.extended) === null || _structure_extended === void 0 ? void 0 : _structure_extended.title_path, option[structure === null || structure === void 0 ? void 0 : (_structure_extended1 = structure.extended) === null || _structure_extended1 === void 0 ? void 0 : _structure_extended1.title_path], options);
|
|
315
|
-
var _option_structure_extended_title_path;
|
|
316
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("li", _object_spread_props(_object_spread({}, getOptionProps({
|
|
317
|
-
option,
|
|
318
|
-
index
|
|
319
|
-
})), {
|
|
320
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
321
|
-
variant: "table",
|
|
322
|
-
color: theme.palette.typography.title,
|
|
323
|
-
children: (0, _fixefyuiutils.titleCase)((_option_structure_extended_title_path = option[structure === null || structure === void 0 ? void 0 : (_structure_extended2 = structure.extended) === null || _structure_extended2 === void 0 ? void 0 : _structure_extended2.title_path]) !== null && _option_structure_extended_title_path !== void 0 ? _option_structure_extended_title_path : option.title)
|
|
324
|
-
})
|
|
325
|
-
}));
|
|
326
|
-
});
|
|
327
|
-
}
|
|
328
|
-
default:
|
|
329
|
-
{
|
|
330
|
-
return groupedOptions.map((option, index)=>{
|
|
331
|
-
var _structure_extended, _structure_extended1, _structure_extended2;
|
|
332
|
-
debug === true && console.log('renderOptions: ', structure === null || structure === void 0 ? void 0 : (_structure_extended = structure.extended) === null || _structure_extended === void 0 ? void 0 : _structure_extended.title_path, option[structure === null || structure === void 0 ? void 0 : (_structure_extended1 = structure.extended) === null || _structure_extended1 === void 0 ? void 0 : _structure_extended1.title_path], options);
|
|
333
|
-
var _option_structure_extended_title_path;
|
|
334
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsx)("li", _object_spread_props(_object_spread({}, getOptionProps({
|
|
335
|
-
option,
|
|
336
|
-
index
|
|
337
|
-
})), {
|
|
338
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.Typography, {
|
|
339
|
-
variant: "table",
|
|
340
|
-
color: theme.palette.typography.title,
|
|
341
|
-
children: (0, _fixefyuiutils.titleCase)((_option_structure_extended_title_path = option[structure === null || structure === void 0 ? void 0 : (_structure_extended2 = structure.extended) === null || _structure_extended2 === void 0 ? void 0 : _structure_extended2.title_path]) !== null && _option_structure_extended_title_path !== void 0 ? _option_structure_extended_title_path : option.title)
|
|
342
|
-
})
|
|
343
|
-
}));
|
|
344
|
-
});
|
|
345
|
-
}
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
};
|
|
349
|
-
(0, _react.useImperativeHandle)(parentRef, ()=>({
|
|
350
|
-
clearDDL: ()=>{
|
|
351
|
-
var //@ts-ignore
|
|
352
|
-
_getClearProps;
|
|
353
|
-
(_getClearProps = getClearProps()) === null || _getClearProps === void 0 ? void 0 : _getClearProps.onClick(null);
|
|
354
|
-
}
|
|
355
|
-
}));
|
|
356
|
-
(0, _react.useEffect)(()=>{
|
|
357
|
-
if (ref && ref.current) {
|
|
358
|
-
//@ts-ignore
|
|
359
|
-
ref.current.addEventListener('scroll', ()=>onPopupScroll());
|
|
360
|
-
}
|
|
361
|
-
return ()=>{
|
|
362
|
-
if (ref && ref.current) {
|
|
363
|
-
//@ts-ignore
|
|
364
|
-
ref.current.removeEventListener('scroll', ()=>onPopupScroll());
|
|
365
|
-
}
|
|
366
|
-
};
|
|
367
|
-
}, [
|
|
368
|
-
groupedOptions
|
|
369
|
-
]);
|
|
370
|
-
(0, _react.useEffect)(()=>{
|
|
371
|
-
onChange && onChange(value, name);
|
|
372
|
-
}, [
|
|
373
|
-
value
|
|
374
|
-
]);
|
|
375
|
-
(0, _react.useEffect)(()=>{
|
|
376
|
-
if (popupOpen && !isLastPage && prevPage < page && !disabled) {
|
|
377
|
-
fetch();
|
|
378
|
-
}
|
|
379
|
-
}, [
|
|
380
|
-
popupOpen
|
|
381
|
-
]);
|
|
382
|
-
(0, _react.useEffect)(()=>{
|
|
383
|
-
if (!disabled) {
|
|
384
|
-
fetch();
|
|
385
|
-
}
|
|
386
|
-
}, []);
|
|
387
|
-
(0, _react.useEffect)(()=>{
|
|
388
|
-
if (data && !isLastPage && prevPage < page) {
|
|
389
|
-
const newOptions = data[method_name];
|
|
390
|
-
if (newOptions.length === 0 || newOptions.length < pageSize) {
|
|
391
|
-
setIsLastPage(true);
|
|
392
|
-
}
|
|
393
|
-
setOptions([
|
|
394
|
-
...newOptions,
|
|
395
|
-
...options
|
|
396
|
-
]);
|
|
397
|
-
setLoadingData(false);
|
|
398
|
-
}
|
|
399
|
-
}, [
|
|
400
|
-
data
|
|
401
|
-
]);
|
|
402
|
-
var _props_styles_width, _props_styles_maxWidth;
|
|
403
|
-
return /*#__PURE__*/ (0, _jsxruntime.jsxs)(_dropdownstyles.Root, {
|
|
404
|
-
children: [
|
|
405
|
-
/*#__PURE__*/ (0, _jsxruntime.jsxs)(_dropdownstyles.InputWrapper, _object_spread_props(_object_spread({
|
|
406
|
-
hasValue: !!(value && Object.keys(value).length),
|
|
407
|
-
disabled: disabled,
|
|
408
|
-
sx: {
|
|
409
|
-
width: (_props_styles_width = (_props_styles = props.styles) === null || _props_styles === void 0 ? void 0 : _props_styles.width) !== null && _props_styles_width !== void 0 ? _props_styles_width : 180,
|
|
410
|
-
maxWidth: (_props_styles_maxWidth = (_props_styles1 = props.styles) === null || _props_styles1 === void 0 ? void 0 : _props_styles1.maxWidth) !== null && _props_styles_maxWidth !== void 0 ? _props_styles_maxWidth : 300
|
|
411
|
-
}
|
|
412
|
-
}, getRootProps()), {
|
|
413
|
-
ref: setAnchorEl,
|
|
414
|
-
className: focused ? 'focused' : '',
|
|
415
|
-
children: [
|
|
416
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)("input", _object_spread_props(_object_spread({}, getInputProps()), {
|
|
417
|
-
readOnly: true,
|
|
418
|
-
onChange: (e)=>{
|
|
419
|
-
var //@ts-ignore
|
|
420
|
-
_getInputProps;
|
|
421
|
-
(_getInputProps = getInputProps()) === null || _getInputProps === void 0 ? void 0 : _getInputProps.onChange(e);
|
|
422
|
-
handleSearch(e);
|
|
423
|
-
},
|
|
424
|
-
placeholder: createTitle(),
|
|
425
|
-
value: showSelectedValue ? (0, _fixefyuiutils.titleCase)(value.title) : undefined
|
|
426
|
-
})),
|
|
427
|
-
loading ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_dropdownstyles.Loading, {
|
|
428
|
-
children: /*#__PURE__*/ (0, _jsxruntime.jsx)(_material.CircularProgress, {})
|
|
429
|
-
}) : /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.KeyboardArrowDown, {})
|
|
430
|
-
]
|
|
431
|
-
})),
|
|
432
|
-
groupedOptions.length > 0 && !disabled ? /*#__PURE__*/ (0, _jsxruntime.jsxs)(_dropdownstyles.Listbox, _object_spread_props(_object_spread({}, getListboxProps()), {
|
|
433
|
-
children: [
|
|
434
|
-
/*#__PURE__*/ (0, _jsxruntime.jsx)(_dropdownstyles.StyledListBox, {
|
|
435
|
-
sx: _object_spread({}, (_props_styles2 = props.styles) === null || _props_styles2 === void 0 ? void 0 : _props_styles2.menuSx),
|
|
436
|
-
hasClearBtn: children === null || children === void 0 ? void 0 : children.length,
|
|
437
|
-
ref: ref,
|
|
438
|
-
children: handleRenderOptions()
|
|
439
|
-
}),
|
|
440
|
-
children && children.length ? /*#__PURE__*/ (0, _jsxruntime.jsx)(_dropdownstyles.StyledClose, {
|
|
441
|
-
children: handleChildrens({
|
|
442
|
-
structure: children[0],
|
|
443
|
-
onClick: (e)=>{
|
|
444
|
-
var //@ts-ignore
|
|
445
|
-
_getClearProps;
|
|
446
|
-
onClear && onClear();
|
|
447
|
-
(_getClearProps = getClearProps()) === null || _getClearProps === void 0 ? void 0 : _getClearProps.onClick(e);
|
|
448
|
-
},
|
|
449
|
-
startIcon: /*#__PURE__*/ (0, _jsxruntime.jsx)(_iconsmaterial.Close, {})
|
|
450
|
-
})
|
|
451
|
-
}) : null
|
|
452
|
-
]
|
|
453
|
-
})) : null
|
|
454
|
-
]
|
|
455
|
-
});
|
|
456
|
-
});
|