@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.
Files changed (93) hide show
  1. package/package.json +3 -4
  2. package/build/FxActionsTray/FxActionsTray.js +0 -351
  3. package/build/FxActionsTray/actions_tray_types.d.js +0 -4
  4. package/build/FxActionsTray/index.js +0 -11
  5. package/build/FxActionsTray/styles/actions_tray.styles.js +0 -160
  6. package/build/FxAggregationsBar/FxAggregations.js +0 -41
  7. package/build/FxAggregationsBar/aggregations_types.d.js +0 -4
  8. package/build/FxAggregationsBar/helpers/structureReader.js +0 -78
  9. package/build/FxAggregationsBar/index.js +0 -11
  10. package/build/FxAggregationsBar/operations/query.js +0 -73
  11. package/build/FxAsyncDropdown/FxAsyncDropdown.js +0 -456
  12. package/build/FxAsyncDropdown/async_dropdown_types.d.js +0 -4
  13. package/build/FxAsyncDropdown/helpers/helpers.js +0 -151
  14. package/build/FxAsyncDropdown/index.js +0 -11
  15. package/build/FxAsyncDropdown/styles/dropdown.styles.js +0 -230
  16. package/build/FxAvatar/FxAvatar.js +0 -145
  17. package/build/FxAvatar/avatar_types.d.js +0 -4
  18. package/build/FxAvatar/helpers/stringToColor.js +0 -23
  19. package/build/FxAvatar/index.js +0 -11
  20. package/build/FxAvatar/styles/avatar.styles.js +0 -193
  21. package/build/FxButton/FxButton.js +0 -106
  22. package/build/FxButton/index.js +0 -11
  23. package/build/FxButton/styles/button.styles.js +0 -23
  24. package/build/FxChip/FxChip.js +0 -37
  25. package/build/FxChip/chip_types.d.js +0 -4
  26. package/build/FxChip/index.js +0 -11
  27. package/build/FxChip/styles/chip.styles.js +0 -62
  28. package/build/FxIcon/FxIcon.js +0 -147
  29. package/build/FxIcon/content/dynamic_icon.js +0 -20
  30. package/build/FxIcon/content/index.js +0 -20
  31. package/build/FxIcon/content/lazy_icon.js +0 -137
  32. package/build/FxIcon/icon_types.d.js +0 -4
  33. package/build/FxIcon/index.js +0 -20
  34. package/build/FxModal/FxModal.js +0 -171
  35. package/build/FxModal/index.js +0 -11
  36. package/build/FxModal/modal_types.d.js +0 -4
  37. package/build/FxModal/styles/modal.style.js +0 -59
  38. package/build/FxNotes/FxNotes.js +0 -216
  39. package/build/FxNotes/helpers/stringToColor.js +0 -26
  40. package/build/FxNotes/index.js +0 -11
  41. package/build/FxNotes/note_types.d.js +0 -4
  42. package/build/FxNotes/operations/queries.js +0 -35
  43. package/build/FxNotes/styles/notes.styles.js +0 -169
  44. package/build/FxNumberField/FxNumberField.js +0 -109
  45. package/build/FxNumberField/index.js +0 -11
  46. package/build/FxNumberField/number_field_types.d.js +0 -4
  47. package/build/FxNumberField/styles/number_field.styles.js +0 -94
  48. package/build/FxProgressCircle/FxProgressCircle.js +0 -65
  49. package/build/FxProgressCircle/index.js +0 -11
  50. package/build/FxProgressCircle/progress_circle_types.d.js +0 -4
  51. package/build/FxProgressCircle/styles/progress_circle.styles.js +0 -106
  52. package/build/FxProgressCounter/ProgressCounter.js +0 -168
  53. package/build/FxProgressCounter/index.js +0 -11
  54. package/build/FxProgressCounter/progress_counter_types.d.js +0 -4
  55. package/build/FxProgressCounter/styles/progress_counter.styles.js +0 -61
  56. package/build/FxScore/FxScore.js +0 -207
  57. package/build/FxScore/index.js +0 -11
  58. package/build/FxScore/score_types.d.js +0 -4
  59. package/build/FxScore/styles/score.styles.js +0 -96
  60. package/build/FxShowMore/FxShowMore.js +0 -80
  61. package/build/FxShowMore/index.js +0 -11
  62. package/build/FxShowMore/show_more_types.d.js +0 -4
  63. package/build/FxShowMore/styles/show_more.styles.js +0 -134
  64. package/build/FxSlider/FxSlider.js +0 -49
  65. package/build/FxSlider/index.js +0 -11
  66. package/build/FxSlider/slider_types.d.js +0 -4
  67. package/build/FxStatisticsBar/FxStatisticsBar.js +0 -191
  68. package/build/FxStatisticsBar/index.js +0 -11
  69. package/build/FxStatisticsBar/statistics_bar_types.d.js +0 -4
  70. package/build/FxStatisticsBar/styles/statistics.styles.js +0 -98
  71. package/build/FxStatusBar/FxStatusBar.js +0 -143
  72. package/build/FxStatusBar/helpers/constants.js +0 -22
  73. package/build/FxStatusBar/index.js +0 -20
  74. package/build/FxStatusBar/status_bar_types.d.js +0 -4
  75. package/build/FxStatusBar/styles/statusBar.styles.js +0 -131
  76. package/build/FxStyledComponents/index.js +0 -311
  77. package/build/FxTag/FxTag.js +0 -41
  78. package/build/FxTag/fxtag_types.d.js +0 -4
  79. package/build/FxTag/index.js +0 -20
  80. package/build/FxTag/styles/tag.styles.js +0 -94
  81. package/build/FxTextField/FxTextField.js +0 -208
  82. package/build/FxTextField/index.js +0 -11
  83. package/build/FxTextField/text_field_types.d.js +0 -4
  84. package/build/FxTodo/FxTodo.js +0 -95
  85. package/build/FxTodo/index.js +0 -23
  86. package/build/FxTodo/styles/todo.styles.js +0 -183
  87. package/build/FxTodo/todo_types.d.js +0 -4
  88. package/build/FxWizard/FxWizard.js +0 -179
  89. package/build/FxWizard/WizardContext.js +0 -207
  90. package/build/FxWizard/index.js +0 -23
  91. package/build/FxWizard/styles/wizard.styles.js +0 -89
  92. package/build/FxWizard/wizard_types.d.js +0 -4
  93. 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
- });
@@ -1,4 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", {
3
- value: true
4
- });