vxe-pc-ui 4.4.1 → 4.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 (80) hide show
  1. package/es/color-picker/src/color-picker.js +2 -2
  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 +57 -16
  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 +2 -2
  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 +69 -28
  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 +51 -11
  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 +3 -3
  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 +57 -16
  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/ui/global-icon.d.ts +1 -0
  69. /package/es/icon/{iconfont.1741079794679.ttf → iconfont.1741176270611.ttf} +0 -0
  70. /package/es/icon/{iconfont.1741079794679.woff → iconfont.1741176270611.woff} +0 -0
  71. /package/es/icon/{iconfont.1741079794679.woff2 → iconfont.1741176270611.woff2} +0 -0
  72. /package/es/{iconfont.1741079794679.ttf → iconfont.1741176270611.ttf} +0 -0
  73. /package/es/{iconfont.1741079794679.woff → iconfont.1741176270611.woff} +0 -0
  74. /package/es/{iconfont.1741079794679.woff2 → iconfont.1741176270611.woff2} +0 -0
  75. /package/lib/icon/style/{iconfont.1741079794679.ttf → iconfont.1741176270611.ttf} +0 -0
  76. /package/lib/icon/style/{iconfont.1741079794679.woff → iconfont.1741176270611.woff} +0 -0
  77. /package/lib/icon/style/{iconfont.1741079794679.woff2 → iconfont.1741176270611.woff2} +0 -0
  78. /package/lib/{iconfont.1741079794679.ttf → iconfont.1741176270611.ttf} +0 -0
  79. /package/lib/{iconfont.1741079794679.woff → iconfont.1741176270611.woff} +0 -0
  80. /package/lib/{iconfont.1741079794679.woff2 → iconfont.1741176270611.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -4149,14 +4149,14 @@ function checkDynamic() {
4149
4149
  }
4150
4150
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
4151
4151
 
4152
- const log_version = `ui v${"4.4.1"}`;
4152
+ const log_version = `ui v${"4.4.2"}`;
4153
4153
  const warnLog = log.create('warn', log_version);
4154
4154
  const errLog = log.create('error', log_version);
4155
4155
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
4156
4156
 
4157
4157
 
4158
4158
 
4159
- const ui_version = "4.4.1";
4159
+ const ui_version = "4.4.2";
4160
4160
  index_esm_VxeUI.uiVersion = ui_version;
4161
4161
  index_esm_VxeUI.dynamicApp = dynamicApp;
4162
4162
  function config(options) {
@@ -4514,6 +4514,7 @@ setIcon({
4514
4514
  SELECT_LOADED: iconPrefix + 'spinner roll',
4515
4515
  SELECT_OPEN: iconPrefix + 'caret-down rotate180',
4516
4516
  SELECT_CLOSE: iconPrefix + 'caret-down',
4517
+ ADD_OPTION: iconPrefix + 'add',
4517
4518
  // icon-picker
4518
4519
  ICON_PICKER_OPEN: iconPrefix + 'caret-down rotate180',
4519
4520
  ICON_PICKER_CLOSE: iconPrefix + 'caret-down',
@@ -11072,7 +11073,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
11072
11073
  const hidePanel = () => {
11073
11074
  return new Promise(resolve => {
11074
11075
  reactData.visiblePanel = false;
11075
- internalData.hpTimeout = window.setTimeout(() => {
11076
+ internalData.hpTimeout = setTimeout(() => {
11076
11077
  reactData.isAniVisible = false;
11077
11078
  resolve();
11078
11079
  }, 350);
@@ -11403,7 +11404,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
11403
11404
  }, evnt);
11404
11405
  };
11405
11406
  const numberDownNextEvent = evnt => {
11406
- internalData.dnTimeout = window.setTimeout(() => {
11407
+ internalData.dnTimeout = setTimeout(() => {
11407
11408
  numberNextEvent(evnt);
11408
11409
  numberDownNextEvent(evnt);
11409
11410
  }, 60);
@@ -11473,7 +11474,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
11473
11474
  }
11474
11475
  };
11475
11476
  const numberDownPrevEvent = evnt => {
11476
- internalData.dnTimeout = window.setTimeout(() => {
11477
+ internalData.dnTimeout = setTimeout(() => {
11477
11478
  numberPrevEvent(evnt);
11478
11479
  numberDownPrevEvent(evnt);
11479
11480
  }, 60);
@@ -11487,7 +11488,7 @@ function toFloatValueFixed(inputValue, digitsValue) {
11487
11488
  } else {
11488
11489
  numberNextEvent(evnt);
11489
11490
  }
11490
- internalData.dnTimeout = window.setTimeout(() => {
11491
+ internalData.dnTimeout = setTimeout(() => {
11491
11492
  if (isPrevNumber) {
11492
11493
  numberDownPrevEvent(evnt);
11493
11494
  } else {
@@ -12893,7 +12894,6 @@ function toFloatValueFixed(inputValue, digitsValue) {
12893
12894
 
12894
12895
 
12895
12896
 
12896
- const WinEyeDropper = window.EyeDropper;
12897
12897
  /* harmony default export */ var color_picker = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
12898
12898
  name: 'VxeColorPicker',
12899
12899
  props: {
@@ -12961,6 +12961,7 @@ const WinEyeDropper = window.EyeDropper;
12961
12961
  const $xeTable = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeTable', null);
12962
12962
  const $xeForm = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('$xeForm', null);
12963
12963
  const formItemInfo = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.inject)('xeFormItemInfo', null);
12964
+ const WinEyeDropper = typeof window !== 'undefined' ? window.EyeDropper : null;
12964
12965
  const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
12965
12966
  const {
12966
12967
  computeSize
@@ -13245,7 +13246,7 @@ const WinEyeDropper = window.EyeDropper;
13245
13246
  };
13246
13247
  const hideOptionPanel = () => {
13247
13248
  reactData.visiblePanel = false;
13248
- internalData.hpTimeout = window.setTimeout(() => {
13249
+ internalData.hpTimeout = setTimeout(() => {
13249
13250
  reactData.isAniVisible = false;
13250
13251
  }, 350);
13251
13252
  };
@@ -14981,7 +14982,7 @@ const Countdown = VxeCountdown;
14981
14982
  const hidePanel = () => {
14982
14983
  return new Promise(resolve => {
14983
14984
  reactData.visiblePanel = false;
14984
- internalData.hpTimeout = window.setTimeout(() => {
14985
+ internalData.hpTimeout = setTimeout(() => {
14985
14986
  reactData.isAniVisible = false;
14986
14987
  resolve();
14987
14988
  }, 350);
@@ -18658,7 +18659,7 @@ const validErrorRuleValue = (rule, val) => {
18658
18659
  }
18659
18660
  }).catch(() => {
18660
18661
  return new Promise(resolve => {
18661
- internalData.meTimeout = window.setTimeout(() => {
18662
+ internalData.meTimeout = setTimeout(() => {
18662
18663
  itemList.forEach(item => {
18663
18664
  if (item.errRule) {
18664
18665
  item.showError = true;
@@ -24101,6 +24102,10 @@ function getOptUniqueId() {
24101
24102
  default: () => getConfig().select.multiCharOverflow
24102
24103
  },
24103
24104
  prefixIcon: String,
24105
+ allowCreate: {
24106
+ type: Boolean,
24107
+ default: () => getConfig().select.allowCreate
24108
+ },
24104
24109
  placement: String,
24105
24110
  options: Array,
24106
24111
  optionProps: Object,
@@ -24179,6 +24184,7 @@ function getOptUniqueId() {
24179
24184
  const internalData = {
24180
24185
  synchData: [],
24181
24186
  fullData: [],
24187
+ optAddMaps: {},
24182
24188
  optGroupKeyMaps: {},
24183
24189
  optFullValMaps: {},
24184
24190
  remoteValMaps: {},
@@ -24568,7 +24574,7 @@ function getOptUniqueId() {
24568
24574
  reactData.searchValue = '';
24569
24575
  reactData.searchLoading = false;
24570
24576
  reactData.visiblePanel = false;
24571
- internalData.hpTimeout = window.setTimeout(() => {
24577
+ internalData.hpTimeout = setTimeout(() => {
24572
24578
  reactData.isAniVisible = false;
24573
24579
  }, 350);
24574
24580
  };
@@ -24779,7 +24785,7 @@ function getOptUniqueId() {
24779
24785
  showOptionPanel();
24780
24786
  setTimeout(() => {
24781
24787
  reactData.triggerFocusPanel = false;
24782
- }, 150);
24788
+ }, 500);
24783
24789
  }
24784
24790
  }
24785
24791
  dispatchEvent('focus', {}, evnt);
@@ -24863,14 +24869,34 @@ function getOptUniqueId() {
24863
24869
  reactData.topSpaceHeight = scrollYLoad ? Math.max(scrollYStore.startIndex * scrollYStore.rowHeight, 0) : 0;
24864
24870
  };
24865
24871
  const handleData = () => {
24872
+ const {
24873
+ filterable,
24874
+ allowCreate
24875
+ } = props;
24866
24876
  const {
24867
24877
  scrollYLoad,
24868
- afterVisibleList
24878
+ afterVisibleList,
24879
+ searchValue
24869
24880
  } = reactData;
24870
24881
  const {
24882
+ optAddMaps,
24871
24883
  scrollYStore
24872
24884
  } = internalData;
24873
- reactData.optList = scrollYLoad ? afterVisibleList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : afterVisibleList.slice(0);
24885
+ const labelField = computeLabelField.value;
24886
+ const valueField = computeValueField.value;
24887
+ const restList = scrollYLoad ? afterVisibleList.slice(scrollYStore.startIndex, scrollYStore.endIndex) : afterVisibleList.slice(0);
24888
+ if (filterable && allowCreate && searchValue) {
24889
+ if (!restList.some(option => option[labelField] === searchValue)) {
24890
+ const addItem = optAddMaps[searchValue] || {
24891
+ [getOptKey()]: searchValue,
24892
+ [labelField]: searchValue,
24893
+ [valueField]: searchValue
24894
+ };
24895
+ optAddMaps[searchValue] = addItem;
24896
+ restList.unshift(addItem);
24897
+ }
24898
+ }
24899
+ reactData.optList = restList;
24874
24900
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
24875
24901
  };
24876
24902
  const updateYData = () => {
@@ -25175,12 +25201,16 @@ function getOptUniqueId() {
25175
25201
  Object.assign($xeSelect, selectMethods);
25176
25202
  const renderOption = (list, group) => {
25177
25203
  const {
25204
+ allowCreate,
25178
25205
  optionKey,
25179
25206
  modelValue
25180
25207
  } = props;
25181
25208
  const {
25182
25209
  currentOption
25183
25210
  } = reactData;
25211
+ const {
25212
+ optAddMaps
25213
+ } = internalData;
25184
25214
  const optionOpts = computeOptionOpts.value;
25185
25215
  const labelField = computeLabelField.value;
25186
25216
  const valueField = computeValueField.value;
@@ -25197,21 +25227,24 @@ function getOptUniqueId() {
25197
25227
  const optid = getOptId(option);
25198
25228
  const optionValue = option[valueField];
25199
25229
  const isOptGroup = hasOptGroupById(optid);
25200
- const isSelected = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue.indexOf(optionValue) > -1 : modelValue === optionValue;
25201
- const isVisible = !isOptGroup || isOptionVisible(option);
25202
- const isDisabled = checkOptionDisabled(isSelected, option, group);
25230
+ const isAdd = !!(allowCreate && optAddMaps[optid]);
25231
+ const isSelected = !isAdd && (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isArray(modelValue) ? modelValue.indexOf(optionValue) > -1 : modelValue === optionValue);
25232
+ const isVisible = isAdd || !isOptGroup || isOptionVisible(option);
25233
+ const isDisabled = !isAdd && checkOptionDisabled(isSelected, option, group);
25203
25234
  const defaultSlot = slots ? slots.default : null;
25204
25235
  const optParams = {
25205
25236
  option,
25206
25237
  group: null,
25207
25238
  $select: $xeSelect
25208
25239
  };
25240
+ const optVNs = optionSlot ? callSlot(optionSlot, optParams) : defaultSlot ? callSlot(defaultSlot, optParams) : getFuncText(option[isOptGroup ? groupLabelField : labelField]);
25209
25241
  return isVisible ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
25210
25242
  key: useKey || optionKey ? optid : cIndex,
25211
25243
  class: ['vxe-select-option', className ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(className) ? className(optParams) : className : '', {
25212
25244
  'vxe-select-optgroup': isOptGroup,
25213
25245
  'is--disabled': isDisabled,
25214
25246
  'is--selected': isSelected,
25247
+ 'is--add': isAdd,
25215
25248
  'is--hover': currentOption && getOptId(currentOption) === optid
25216
25249
  }],
25217
25250
  // attrs
@@ -25233,7 +25266,15 @@ function getOptUniqueId() {
25233
25266
  setCurrentOption(option);
25234
25267
  }
25235
25268
  }
25236
- }, optionSlot ? callSlot(optionSlot, optParams) : defaultSlot ? callSlot(defaultSlot, optParams) : getFuncText(option[isOptGroup ? groupLabelField : labelField])) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)();
25269
+ }, allowCreate ? [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
25270
+ key: 1,
25271
+ class: 'vxe-select-option--label'
25272
+ }, optVNs), isAdd ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
25273
+ key: 2,
25274
+ class: 'vxe-select-option--add-icon'
25275
+ }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
25276
+ class: getIcon().ADD_OPTION
25277
+ })]) : renderEmptyElement($xeSelect)] : optVNs) : renderEmptyElement($xeSelect);
25237
25278
  });
25238
25279
  };
25239
25280
  const renderOpts = () => {
@@ -25357,9 +25398,9 @@ function getOptUniqueId() {
25357
25398
  onFocus: focusSearchEvent,
25358
25399
  onChange: triggerSearchEvent,
25359
25400
  onSearch: triggerSearchEvent
25360
- })]) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
25401
+ })]) : renderEmptyElement($xeSelect), headerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
25361
25402
  class: 'vxe-select--panel-header'
25362
- }, headerSlot({})) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)(), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
25403
+ }, headerSlot({})) : renderEmptyElement($xeSelect), (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
25363
25404
  class: 'vxe-select--panel-body'
25364
25405
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
25365
25406
  ref: refVirtualWrapper,
@@ -25378,7 +25419,7 @@ function getOptUniqueId() {
25378
25419
  }
25379
25420
  }, renderOpts())])]), footerSlot ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
25380
25421
  class: 'vxe-select--panel-footer'
25381
- }, footerSlot({})) : (0,external_commonjs_vue_commonjs2_vue_root_Vue_.createCommentVNode)()])] : [])])]);
25422
+ }, footerSlot({})) : renderEmptyElement($xeSelect)])] : [])])]);
25382
25423
  };
25383
25424
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => reactData.staticOptions, val => {
25384
25425
  loadData(val);
@@ -30211,7 +30252,7 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30211
30252
  }, evnt);
30212
30253
  };
30213
30254
  const numberDownNextEvent = evnt => {
30214
- internalData.dnTimeout = window.setTimeout(() => {
30255
+ internalData.dnTimeout = setTimeout(() => {
30215
30256
  numberNextEvent(evnt);
30216
30257
  numberDownNextEvent(evnt);
30217
30258
  }, 60);
@@ -30279,7 +30320,7 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30279
30320
  }
30280
30321
  };
30281
30322
  const numberDownPrevEvent = evnt => {
30282
- internalData.dnTimeout = window.setTimeout(() => {
30323
+ internalData.dnTimeout = setTimeout(() => {
30283
30324
  numberPrevEvent(evnt);
30284
30325
  numberDownPrevEvent(evnt);
30285
30326
  }, 60);
@@ -30293,7 +30334,7 @@ const WidgetVxeNumberInputFormComponent = (0,external_commonjs_vue_commonjs2_vue
30293
30334
  } else {
30294
30335
  numberNextEvent(evnt);
30295
30336
  }
30296
- internalData.dnTimeout = window.setTimeout(() => {
30337
+ internalData.dnTimeout = setTimeout(() => {
30297
30338
  if (isPrevNumber) {
30298
30339
  numberDownPrevEvent(evnt);
30299
30340
  } else {
@@ -33119,7 +33160,7 @@ function tree_select_getOptUniqueId() {
33119
33160
  };
33120
33161
  const hideOptionPanel = () => {
33121
33162
  reactData.visiblePanel = false;
33122
- internalData.hpTimeout = window.setTimeout(() => {
33163
+ internalData.hpTimeout = setTimeout(() => {
33123
33164
  reactData.isAniVisible = false;
33124
33165
  }, 350);
33125
33166
  };
@@ -37339,7 +37380,7 @@ const Icon = VxeIcon;
37339
37380
  };
37340
37381
  const hideOptionPanel = () => {
37341
37382
  reactData.visiblePanel = false;
37342
- internalData.hpTimeout = window.setTimeout(() => {
37383
+ internalData.hpTimeout = setTimeout(() => {
37343
37384
  reactData.isAniVisible = false;
37344
37385
  }, 350);
37345
37386
  };
@@ -44373,7 +44414,7 @@ const Print = VxePrint;
44373
44414
  emit('update:modelValue', false);
44374
44415
  return new Promise(resolve => {
44375
44416
  if (reactData.isAniVisible) {
44376
- internalData.hpTimeout = window.setTimeout(() => {
44417
+ internalData.hpTimeout = setTimeout(() => {
44377
44418
  reactData.isAniVisible = false;
44378
44419
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
44379
44420
  resolve();
@@ -45309,7 +45350,7 @@ function getRowUniqueId() {
45309
45350
  if (internalData.hpTimeout) {
45310
45351
  clearTimeout(internalData.hpTimeout);
45311
45352
  }
45312
- internalData.hpTimeout = window.setTimeout(() => {
45353
+ internalData.hpTimeout = setTimeout(() => {
45313
45354
  reactData.isAniVisible = false;
45314
45355
  internalData.hpTimeout = undefined;
45315
45356
  }, 350);