@itilite/iui-user-management 0.0.13 → 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.
@@ -188,7 +188,7 @@ function toVal(mix) {
188
188
  return str;
189
189
  }
190
190
 
191
- function clsx () {
191
+ function clsx() {
192
192
  var i = 0,
193
193
  tmp,
194
194
  x,
@@ -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 === ''
@@ -8909,7 +8954,7 @@ var UserPanel = function UserPanel(_ref) {
8909
8954
  };
8910
8955
 
8911
8956
  var validation = {
8912
- regexOnChange: /^[A-Za-z]+[A-Za-z0-9()&'\-_. ]*$/,
8957
+ regexOnChange: /^[(A-Z)(a-z)(0-9)&'\-_.,/: ]*$/,
8913
8958
  regexOnBlur: null,
8914
8959
  maxLimit: '',
8915
8960
  minLimit: '',