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