@itilite/iui-user-management 0.0.14 → 0.0.15

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.
@@ -348,6 +348,51 @@ var commonLoadOptions = function commonLoadOptions(search, loadedOptions, _ref)
348
348
  return Promise.reject(e);
349
349
  }
350
350
  };
351
+ var commonLoadOptionsUM = function commonLoadOptionsUM(search, loadedOptions, _ref2) {
352
+ var page = _ref2.page,
353
+ tabelName = _ref2.tabelName,
354
+ placeholder = _ref2.placeholder,
355
+ defaultData = _ref2.defaultData;
356
+
357
+ try {
358
+ return Promise.resolve(_catch(function () {
359
+ var url = userAddEditUrl.dropdownList() + ("?page=" + page + "&table_name=" + tabelName + "&search=" + search);
360
+ return Promise.resolve(api.get(url).then(function (res) {
361
+ return res.data;
362
+ })).then(function (response) {
363
+ var arrList = response.results.filter(function (item) {
364
+ return item.name !== defaultData;
365
+ });
366
+ var mappedValue = arrList.map(function (item) {
367
+ return {
368
+ value: item.id,
369
+ label: item.name
370
+ };
371
+ });
372
+ return {
373
+ options: mappedValue,
374
+ hasMore: !!response.next,
375
+ additional: {
376
+ page: page + 1,
377
+ tabelName: tabelName
378
+ }
379
+ };
380
+ });
381
+ }, function () {
382
+ return {
383
+ options: [],
384
+ hasMore: false,
385
+ additional: {
386
+ page: 1,
387
+ tabelName: tabelName,
388
+ placeholder: placeholder
389
+ }
390
+ };
391
+ }));
392
+ } catch (e) {
393
+ return Promise.reject(e);
394
+ }
395
+ };
351
396
  var currencyLoadOptions = function currencyLoadOptions(search, loadedOptions, _ref3) {
352
397
  var page = _ref3.page;
353
398
 
@@ -8784,7 +8829,7 @@ function MoveUserDialog(_ref) {
8784
8829
  name: name,
8785
8830
  isMove: isMove,
8786
8831
  customSelectHandler: customSelectHandler,
8787
- loadOption: commonLoadOptions,
8832
+ loadOption: commonLoadOptionsUM,
8788
8833
  isError: isError,
8789
8834
  errorMsg: "Please select " + (name === null || name === void 0 ? void 0 : name.toLowerCase()) + ".",
8790
8835
  placeHolderCheck: name !== undefined && name === ''