vxe-pc-ui 3.4.0 → 3.4.2

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 (81) hide show
  1. package/es/color-picker/src/color-picker.js +6 -4
  2. package/es/date-picker/src/date-picker.js +1 -1
  3. package/es/form/src/form.js +1 -1
  4. package/es/icon/style.css +1 -1
  5. package/es/icon-picker/src/icon-picker.js +1 -1
  6. package/es/input/src/input.js +4 -4
  7. package/es/number-input/src/number-input.js +3 -3
  8. package/es/pulldown/src/pulldown.js +1 -1
  9. package/es/select/src/select.js +53 -10
  10. package/es/select/style.css +17 -0
  11. package/es/select/style.min.css +1 -1
  12. package/es/style.css +1 -1
  13. package/es/style.min.css +1 -1
  14. package/es/table-select/src/table-select.js +1 -1
  15. package/es/tree-select/src/tree-select.js +1 -1
  16. package/es/ui/index.js +2 -1
  17. package/es/ui/src/log.js +1 -1
  18. package/es/vxe-select/style.css +17 -0
  19. package/es/vxe-select/style.min.css +1 -1
  20. package/lib/color-picker/src/color-picker.js +6 -4
  21. package/lib/color-picker/src/color-picker.min.js +1 -1
  22. package/lib/date-picker/src/date-picker.js +1 -1
  23. package/lib/date-picker/src/date-picker.min.js +1 -1
  24. package/lib/form/src/form.js +1 -1
  25. package/lib/form/src/form.min.js +1 -1
  26. package/lib/icon/style/style.css +1 -1
  27. package/lib/icon/style/style.min.css +1 -1
  28. package/lib/icon-picker/src/icon-picker.js +1 -1
  29. package/lib/icon-picker/src/icon-picker.min.js +1 -1
  30. package/lib/index.umd.js +70 -29
  31. package/lib/index.umd.min.js +1 -1
  32. package/lib/input/src/input.js +4 -4
  33. package/lib/input/src/input.min.js +1 -1
  34. package/lib/number-input/src/number-input.js +3 -3
  35. package/lib/number-input/src/number-input.min.js +1 -1
  36. package/lib/pulldown/src/pulldown.js +1 -1
  37. package/lib/pulldown/src/pulldown.min.js +1 -1
  38. package/lib/select/src/select.js +48 -10
  39. package/lib/select/src/select.min.js +1 -1
  40. package/lib/select/style/style.css +17 -0
  41. package/lib/select/style/style.min.css +1 -1
  42. package/lib/style.css +1 -1
  43. package/lib/style.min.css +1 -1
  44. package/lib/table-select/src/table-select.js +1 -1
  45. package/lib/table-select/src/table-select.min.js +1 -1
  46. package/lib/tree-select/src/tree-select.js +1 -1
  47. package/lib/tree-select/src/tree-select.min.js +1 -1
  48. package/lib/ui/index.js +2 -1
  49. package/lib/ui/index.min.js +1 -1
  50. package/lib/ui/src/log.js +1 -1
  51. package/lib/ui/src/log.min.js +1 -1
  52. package/lib/vxe-select/style/style.css +17 -0
  53. package/lib/vxe-select/style/style.min.css +1 -1
  54. package/package.json +1 -1
  55. package/packages/color-picker/src/color-picker.ts +6 -4
  56. package/packages/date-picker/src/date-picker.ts +1 -1
  57. package/packages/form/src/form.ts +1 -1
  58. package/packages/icon-picker/src/icon-picker.ts +1 -1
  59. package/packages/input/src/input.ts +4 -4
  60. package/packages/number-input/src/number-input.ts +3 -3
  61. package/packages/pulldown/src/pulldown.ts +1 -1
  62. package/packages/select/src/select.ts +53 -10
  63. package/packages/table-select/src/table-select.ts +1 -1
  64. package/packages/tree-select/src/tree-select.ts +1 -1
  65. package/packages/ui/index.ts +1 -0
  66. package/styles/components/select.scss +19 -0
  67. package/types/components/select.d.ts +3 -0
  68. package/types/components/table.d.ts +10 -2
  69. package/types/ui/global-icon.d.ts +1 -0
  70. /package/es/icon/{iconfont.1741051466512.ttf → iconfont.1741176247715.ttf} +0 -0
  71. /package/es/icon/{iconfont.1741051466512.woff → iconfont.1741176247715.woff} +0 -0
  72. /package/es/icon/{iconfont.1741051466512.woff2 → iconfont.1741176247715.woff2} +0 -0
  73. /package/es/{iconfont.1741051466512.ttf → iconfont.1741176247715.ttf} +0 -0
  74. /package/es/{iconfont.1741051466512.woff → iconfont.1741176247715.woff} +0 -0
  75. /package/es/{iconfont.1741051466512.woff2 → iconfont.1741176247715.woff2} +0 -0
  76. /package/lib/icon/style/{iconfont.1741051466512.ttf → iconfont.1741176247715.ttf} +0 -0
  77. /package/lib/icon/style/{iconfont.1741051466512.woff → iconfont.1741176247715.woff} +0 -0
  78. /package/lib/icon/style/{iconfont.1741051466512.woff2 → iconfont.1741176247715.woff2} +0 -0
  79. /package/lib/{iconfont.1741051466512.ttf → iconfont.1741176247715.ttf} +0 -0
  80. /package/lib/{iconfont.1741051466512.woff → iconfont.1741176247715.woff} +0 -0
  81. /package/lib/{iconfont.1741051466512.woff2 → iconfont.1741176247715.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -12854,14 +12854,14 @@ var defineVxeComponent = function defineVxeComponent(options) {
12854
12854
  };
12855
12855
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
12856
12856
 
12857
- var log_version = "ui v".concat("3.4.0");
12857
+ var log_version = "ui v".concat("3.4.2");
12858
12858
  var warnLog = log.create('warn', log_version);
12859
12859
  var errLog = log.create('error', log_version);
12860
12860
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
12861
12861
 
12862
12862
 
12863
12863
 
12864
- var ui_version = "3.4.0";
12864
+ var ui_version = "3.4.2";
12865
12865
  index_esm_VxeUI.uiVersion = ui_version;
12866
12866
  index_esm_VxeUI.dynamicApp = dynamicApp;
12867
12867
  function config(options) {
@@ -13219,6 +13219,7 @@ setIcon({
13219
13219
  SELECT_LOADED: iconPrefix + 'spinner roll',
13220
13220
  SELECT_OPEN: iconPrefix + 'caret-down rotate180',
13221
13221
  SELECT_CLOSE: iconPrefix + 'caret-down',
13222
+ ADD_OPTION: iconPrefix + 'add',
13222
13223
  // icon-picker
13223
13224
  ICON_PICKER_OPEN: iconPrefix + 'caret-down rotate180',
13224
13225
  ICON_PICKER_CLOSE: iconPrefix + 'caret-down',
@@ -20683,7 +20684,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
20683
20684
  var internalData = $xeInput.internalData;
20684
20685
  return new Promise(function (resolve) {
20685
20686
  reactData.visiblePanel = false;
20686
- internalData.hpTimeout = window.setTimeout(function () {
20687
+ internalData.hpTimeout = setTimeout(function () {
20687
20688
  reactData.isAniVisible = false;
20688
20689
  resolve();
20689
20690
  }, 350);
@@ -21031,7 +21032,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
21031
21032
  numberDownNextEvent: function numberDownNextEvent(evnt) {
21032
21033
  var $xeInput = this;
21033
21034
  var internalData = $xeInput.internalData;
21034
- internalData.dnTimeout = window.setTimeout(function () {
21035
+ internalData.dnTimeout = setTimeout(function () {
21035
21036
  $xeInput.numberNextEvent(evnt);
21036
21037
  $xeInput.numberDownNextEvent(evnt);
21037
21038
  }, 60);
@@ -21107,7 +21108,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
21107
21108
  numberDownPrevEvent: function numberDownPrevEvent(evnt) {
21108
21109
  var $xeInput = this;
21109
21110
  var internalData = $xeInput.internalData;
21110
- internalData.dnTimeout = window.setTimeout(function () {
21111
+ internalData.dnTimeout = setTimeout(function () {
21111
21112
  $xeInput.numberPrevEvent(evnt);
21112
21113
  $xeInput.numberDownPrevEvent(evnt);
21113
21114
  }, 60);
@@ -21123,7 +21124,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
21123
21124
  } else {
21124
21125
  $xeInput.numberNextEvent(evnt);
21125
21126
  }
21126
- internalData.dnTimeout = window.setTimeout(function () {
21127
+ internalData.dnTimeout = setTimeout(function () {
21127
21128
  if (isPrevNumber) {
21128
21129
  $xeInput.numberDownPrevEvent(evnt);
21129
21130
  } else {
@@ -22642,7 +22643,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
22642
22643
 
22643
22644
 
22644
22645
 
22645
- var WinEyeDropper = window.EyeDropper;
22646
+ var WinEyeDropper = typeof window !== 'undefined' ? window.EyeDropper : null;
22646
22647
  /* harmony default export */ var color_picker = (/* define-vxe-component start */defineVxeComponent({
22647
22648
  name: 'VxeColorPicker',
22648
22649
  mixins: [globalMixins.sizeMixin],
@@ -23051,7 +23052,7 @@ var WinEyeDropper = window.EyeDropper;
23051
23052
  var reactData = $xeColorPicker.reactData;
23052
23053
  var internalData = $xeColorPicker.internalData;
23053
23054
  reactData.visiblePanel = false;
23054
- internalData.hpTimeout = window.setTimeout(function () {
23055
+ internalData.hpTimeout = setTimeout(function () {
23055
23056
  reactData.isAniVisible = false;
23056
23057
  }, 350);
23057
23058
  },
@@ -23277,14 +23278,16 @@ var WinEyeDropper = window.EyeDropper;
23277
23278
  colorActiveEl.style.left = toCssUnit(offsetLeft);
23278
23279
  }
23279
23280
  },
23280
- handleEyeDropperEvent: function handleEyeDropperEvent(evnt) {
23281
+ handleEyeDropperEvent: function handleEyeDropperEvent() {
23281
23282
  var $xeColorPicker = this;
23283
+ var reactData = $xeColorPicker.reactData;
23282
23284
  if (WinEyeDropper) {
23283
23285
  try {
23284
23286
  var eyeDropper = new WinEyeDropper();
23285
23287
  eyeDropper.open().then(function (rest) {
23286
23288
  if (rest && rest.sRGBHex) {
23287
- $xeColorPicker.changeEvent(evnt, rest.sRGBHex);
23289
+ reactData.selectColor = rest.sRGBHex;
23290
+ $xeColorPicker.updateModelColor();
23288
23291
  }
23289
23292
  }).catch(function () {});
23290
23293
  } catch (e) {}
@@ -24991,7 +24994,7 @@ var Countdown = VxeCountdown;
24991
24994
  var internalData = $xeDatePicker.internalData;
24992
24995
  return new Promise(function (resolve) {
24993
24996
  reactData.visiblePanel = false;
24994
- internalData.hpTimeout = window.setTimeout(function () {
24997
+ internalData.hpTimeout = setTimeout(function () {
24995
24998
  reactData.isAniVisible = false;
24996
24999
  resolve();
24997
25000
  }, 350);
@@ -29002,7 +29005,7 @@ var validErrorRuleValue = function validErrorRuleValue(rule, val) {
29002
29005
  }
29003
29006
  }).catch(function () {
29004
29007
  return new Promise(function (resolve) {
29005
- internalData.meTimeout = window.setTimeout(function () {
29008
+ internalData.meTimeout = setTimeout(function () {
29006
29009
  itemList.forEach(function (item) {
29007
29010
  if (item.errRule) {
29008
29011
  item.showError = true;
@@ -30616,7 +30619,7 @@ var Icon = VxeIcon;
30616
30619
  var reactData = $xeIconPicker.reactData;
30617
30620
  var internalData = $xeIconPicker.internalData;
30618
30621
  reactData.visiblePanel = false;
30619
- internalData.hpTimeout = window.setTimeout(function () {
30622
+ internalData.hpTimeout = setTimeout(function () {
30620
30623
  reactData.isAniVisible = false;
30621
30624
  }, 350);
30622
30625
  },
@@ -36204,7 +36207,7 @@ var handleNumberString = function handleNumberString(val) {
36204
36207
  numberDownNextEvent: function numberDownNextEvent(evnt) {
36205
36208
  var $xeNumberInput = this;
36206
36209
  var internalData = $xeNumberInput.internalData;
36207
- internalData.dnTimeout = window.setTimeout(function () {
36210
+ internalData.dnTimeout = setTimeout(function () {
36208
36211
  $xeNumberInput.numberNextEvent(evnt);
36209
36212
  $xeNumberInput.numberDownNextEvent(evnt);
36210
36213
  }, 60);
@@ -36278,7 +36281,7 @@ var handleNumberString = function handleNumberString(val) {
36278
36281
  numberDownPrevEvent: function numberDownPrevEvent(evnt) {
36279
36282
  var $xeNumberInput = this;
36280
36283
  var internalData = $xeNumberInput.internalData;
36281
- internalData.dnTimeout = window.setTimeout(function () {
36284
+ internalData.dnTimeout = setTimeout(function () {
36282
36285
  $xeNumberInput.numberPrevEvent(evnt);
36283
36286
  $xeNumberInput.numberDownPrevEvent(evnt);
36284
36287
  }, 60);
@@ -36294,7 +36297,7 @@ var handleNumberString = function handleNumberString(val) {
36294
36297
  } else {
36295
36298
  $xeNumberInput.numberNextEvent(evnt);
36296
36299
  }
36297
- internalData.dnTimeout = window.setTimeout(function () {
36300
+ internalData.dnTimeout = setTimeout(function () {
36298
36301
  if (isPrevNumber) {
36299
36302
  $xeNumberInput.numberDownPrevEvent(evnt);
36300
36303
  } else {
@@ -36936,6 +36939,12 @@ function getOptUniqueId() {
36936
36939
  }
36937
36940
  },
36938
36941
  prefixIcon: String,
36942
+ allowCreate: {
36943
+ type: Boolean,
36944
+ default: function _default() {
36945
+ return getConfig().select.allowCreate;
36946
+ }
36947
+ },
36939
36948
  placement: String,
36940
36949
  options: Array,
36941
36950
  optionProps: Object,
@@ -37023,6 +37032,7 @@ function getOptUniqueId() {
37023
37032
  var internalData = {
37024
37033
  synchData: [],
37025
37034
  fullData: [],
37035
+ optAddMaps: {},
37026
37036
  optGroupKeyMaps: {},
37027
37037
  optFullValMaps: {},
37028
37038
  remoteValMaps: {},
@@ -37572,7 +37582,7 @@ function getOptUniqueId() {
37572
37582
  reactData.searchValue = '';
37573
37583
  reactData.searchLoading = false;
37574
37584
  reactData.visiblePanel = false;
37575
- internalData.hpTimeout = window.setTimeout(function () {
37585
+ internalData.hpTimeout = setTimeout(function () {
37576
37586
  reactData.isAniVisible = false;
37577
37587
  }, 350);
37578
37588
  },
@@ -37798,7 +37808,7 @@ function getOptUniqueId() {
37798
37808
  $xeSelect.showOptionPanel();
37799
37809
  setTimeout(function () {
37800
37810
  reactData.triggerFocusPanel = false;
37801
- }, 150);
37811
+ }, 500);
37802
37812
  }
37803
37813
  }
37804
37814
  $xeSelect.dispatchEvent('focus', {}, evnt);
@@ -37896,12 +37906,29 @@ function getOptUniqueId() {
37896
37906
  },
37897
37907
  handleData: function handleData() {
37898
37908
  var $xeSelect = this;
37909
+ var props = $xeSelect;
37899
37910
  var reactData = $xeSelect.reactData;
37900
37911
  var internalData = $xeSelect.internalData;
37912
+ var filterable = props.filterable,
37913
+ allowCreate = props.allowCreate;
37901
37914
  var scrollYLoad = reactData.scrollYLoad,
37902
- afterVisibleList = reactData.afterVisibleList;
37903
- var scrollYStore = internalData.scrollYStore;
37904
- reactData.optList = scrollYLoad ? afterVisibleList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : afterVisibleList.slice(0);
37915
+ afterVisibleList = reactData.afterVisibleList,
37916
+ searchValue = reactData.searchValue;
37917
+ var optAddMaps = internalData.optAddMaps,
37918
+ scrollYStore = internalData.scrollYStore;
37919
+ var labelField = $xeSelect.computeLabelField;
37920
+ var valueField = $xeSelect.computeValueField;
37921
+ var restList = scrollYLoad ? afterVisibleList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : afterVisibleList.slice(0);
37922
+ if (filterable && allowCreate && searchValue) {
37923
+ if (!restList.some(function (option) {
37924
+ return option[labelField] === searchValue;
37925
+ })) {
37926
+ var addItem = optAddMaps[searchValue] || _defineProperty(_defineProperty(_defineProperty({}, $xeSelect.getOptKey(), searchValue), labelField, searchValue), valueField, searchValue);
37927
+ optAddMaps[searchValue] = addItem;
37928
+ restList.unshift(addItem);
37929
+ }
37930
+ }
37931
+ reactData.optList = restList;
37905
37932
  return $xeSelect.$nextTick();
37906
37933
  },
37907
37934
  updateYData: function updateYData() {
@@ -38172,9 +38199,12 @@ function getOptUniqueId() {
38172
38199
  var props = $xeSelect;
38173
38200
  var slots = $xeSelect.$scopedSlots;
38174
38201
  var reactData = $xeSelect.reactData;
38175
- var optionKey = props.optionKey,
38202
+ var internalData = $xeSelect.internalData;
38203
+ var allowCreate = props.allowCreate,
38204
+ optionKey = props.optionKey,
38176
38205
  value = props.value;
38177
38206
  var currentOption = reactData.currentOption;
38207
+ var optAddMaps = internalData.optAddMaps;
38178
38208
  var optionOpts = $xeSelect.computeOptionOpts;
38179
38209
  var labelField = $xeSelect.computeLabelField;
38180
38210
  var valueField = $xeSelect.computeValueField;
@@ -38187,21 +38217,24 @@ function getOptUniqueId() {
38187
38217
  var optid = $xeSelect.getOptId(option);
38188
38218
  var optionValue = option[valueField];
38189
38219
  var isOptGroup = $xeSelect.hasOptGroupById(optid);
38190
- var isSelected = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(value) ? value.indexOf(optionValue) > -1 : value === optionValue;
38191
- var isVisible = !isOptGroup || isOptionVisible(option);
38192
- var isDisabled = $xeSelect.checkOptionDisabled(isSelected, option, group);
38220
+ var isAdd = !!(allowCreate && optAddMaps[optid]);
38221
+ var isSelected = !isAdd && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(value) ? value.indexOf(optionValue) > -1 : value === optionValue);
38222
+ var isVisible = isAdd || !isOptGroup || isOptionVisible(option);
38223
+ var isDisabled = !isAdd && $xeSelect.checkOptionDisabled(isSelected, option, group);
38193
38224
  var defaultSlot = slots ? slots.default : null;
38194
38225
  var optParams = {
38195
38226
  option: option,
38196
38227
  group: null,
38197
38228
  $select: $xeSelect
38198
38229
  };
38230
+ var optVNs = optionSlot ? $xeSelect.callSlot(optionSlot, optParams, h) : defaultSlot ? $xeSelect.callSlot(defaultSlot, optParams, h) : getFuncText(option[isOptGroup ? groupLabelField : labelField]);
38199
38231
  return isVisible ? h('div', {
38200
38232
  key: useKey || optionKey ? optid : cIndex,
38201
38233
  class: ['vxe-select-option', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className(optParams) : className : '', {
38202
38234
  'vxe-select-optgroup': isOptGroup,
38203
38235
  'is--disabled': isDisabled,
38204
38236
  'is--selected': isSelected,
38237
+ 'is--add': isAdd,
38205
38238
  'is--hover': currentOption && $xeSelect.getOptId(currentOption) === optid
38206
38239
  }],
38207
38240
  attrs: {
@@ -38225,7 +38258,15 @@ function getOptUniqueId() {
38225
38258
  }
38226
38259
  }
38227
38260
  }
38228
- }, optionSlot ? $xeSelect.callSlot(optionSlot, optParams, h) : defaultSlot ? $xeSelect.callSlot(defaultSlot, optParams, h) : getFuncText(option[isOptGroup ? groupLabelField : labelField])) : renderEmptyElement($xeSelect);
38261
+ }, allowCreate ? [h('span', {
38262
+ key: 1,
38263
+ class: 'vxe-select-option--label'
38264
+ }, optVNs), isAdd ? h('span', {
38265
+ key: 2,
38266
+ class: 'vxe-select-option--add-icon'
38267
+ }, [h('i', {
38268
+ class: getIcon().ADD_OPTION
38269
+ })]) : renderEmptyElement($xeSelect)] : optVNs) : renderEmptyElement($xeSelect);
38229
38270
  });
38230
38271
  },
38231
38272
  renderOpts: function renderOpts(h) {
@@ -40467,7 +40508,7 @@ var Print = VxePrint;
40467
40508
  $xePulldown.emitModel(false);
40468
40509
  return new Promise(function (resolve) {
40469
40510
  if (reactData.isAniVisible) {
40470
- internalData.hpTimeout = window.setTimeout(function () {
40511
+ internalData.hpTimeout = setTimeout(function () {
40471
40512
  reactData.isAniVisible = false;
40472
40513
  $xePulldown.$nextTick(function () {
40473
40514
  resolve();
@@ -43002,7 +43043,7 @@ function getRowUniqueId() {
43002
43043
  var reactData = $xeTableSelect.reactData;
43003
43044
  var internalData = $xeTableSelect.internalData;
43004
43045
  reactData.visiblePanel = false;
43005
- internalData.hpTimeout = window.setTimeout(function () {
43046
+ internalData.hpTimeout = setTimeout(function () {
43006
43047
  reactData.isAniVisible = false;
43007
43048
  }, 350);
43008
43049
  },
@@ -46946,7 +46987,7 @@ function tree_select_getOptUniqueId() {
46946
46987
  var reactData = $xeTreeSelect.reactData;
46947
46988
  var internalData = $xeTreeSelect.internalData;
46948
46989
  reactData.visiblePanel = false;
46949
- internalData.hpTimeout = window.setTimeout(function () {
46990
+ internalData.hpTimeout = setTimeout(function () {
46950
46991
  reactData.isAniVisible = false;
46951
46992
  }, 350);
46952
46993
  },