vxe-pc-ui 4.15.1 → 4.15.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 (45) hide show
  1. package/dist/all.esm.js +107 -11
  2. package/es/date-panel/src/util.js +12 -0
  3. package/es/date-picker/src/date-picker.js +71 -5
  4. package/es/date-range-picker/src/date-range-picker.js +17 -2
  5. package/es/number-input/src/number-input.js +2 -3
  6. package/es/splitter/src/splitter.js +5 -1
  7. package/es/ui/index.js +1 -1
  8. package/es/ui/src/log.js +1 -1
  9. package/lib/date-panel/src/util.js +13 -0
  10. package/lib/date-panel/src/util.min.js +1 -1
  11. package/lib/date-picker/src/date-picker.js +82 -3
  12. package/lib/date-picker/src/date-picker.min.js +1 -1
  13. package/lib/date-range-picker/src/date-range-picker.js +17 -2
  14. package/lib/date-range-picker/src/date-range-picker.min.js +1 -1
  15. package/lib/index.umd.js +120 -11
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/number-input/src/number-input.js +2 -3
  18. package/lib/splitter/src/splitter.js +5 -1
  19. package/lib/splitter/src/splitter.min.js +1 -1
  20. package/lib/ui/index.js +1 -1
  21. package/lib/ui/index.min.js +1 -1
  22. package/lib/ui/src/log.js +1 -1
  23. package/lib/ui/src/log.min.js +1 -1
  24. package/package.json +1 -1
  25. package/packages/date-panel/src/util.ts +13 -0
  26. package/packages/date-picker/src/date-picker.ts +73 -5
  27. package/packages/date-range-picker/src/date-range-picker.ts +15 -2
  28. package/packages/number-input/src/number-input.ts +2 -6
  29. package/packages/splitter/src/splitter.ts +5 -1
  30. package/types/components/date-picker.d.ts +18 -0
  31. package/types/components/date-range-picker.d.ts +4 -0
  32. package/types/components/splitter.d.ts +1 -0
  33. package/types/components/table.d.ts +29 -3
  34. /package/es/icon/{iconfont.1781675429363.ttf → iconfont.1781753592499.ttf} +0 -0
  35. /package/es/icon/{iconfont.1781675429363.woff → iconfont.1781753592499.woff} +0 -0
  36. /package/es/icon/{iconfont.1781675429363.woff2 → iconfont.1781753592499.woff2} +0 -0
  37. /package/es/{iconfont.1781675429363.ttf → iconfont.1781753592499.ttf} +0 -0
  38. /package/es/{iconfont.1781675429363.woff → iconfont.1781753592499.woff} +0 -0
  39. /package/es/{iconfont.1781675429363.woff2 → iconfont.1781753592499.woff2} +0 -0
  40. /package/lib/icon/style/{iconfont.1781675429363.ttf → iconfont.1781753592499.ttf} +0 -0
  41. /package/lib/icon/style/{iconfont.1781675429363.woff → iconfont.1781753592499.woff} +0 -0
  42. /package/lib/icon/style/{iconfont.1781675429363.woff2 → iconfont.1781753592499.woff2} +0 -0
  43. /package/lib/{iconfont.1781675429363.ttf → iconfont.1781753592499.ttf} +0 -0
  44. /package/lib/{iconfont.1781675429363.woff → iconfont.1781753592499.woff} +0 -0
  45. /package/lib/{iconfont.1781675429363.woff2 → iconfont.1781753592499.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -4646,7 +4646,7 @@ function checkDynamic() {
4646
4646
  }
4647
4647
  ;// ./packages/ui/src/log.ts
4648
4648
 
4649
- const log_version = `ui v${"4.15.1"}`;
4649
+ const log_version = `ui v${"4.15.2"}`;
4650
4650
  const warnLog = log.create('warn', log_version);
4651
4651
  const errLog = log.create('error', log_version);
4652
4652
  ;// ./packages/ui/index.ts
@@ -4654,7 +4654,7 @@ const errLog = log.create('error', log_version);
4654
4654
 
4655
4655
 
4656
4656
 
4657
- const ui_version = "4.15.1";
4657
+ const ui_version = "4.15.2";
4658
4658
  VxeUI.uiVersion = ui_version;
4659
4659
  VxeUI.dynamicApp = dynamicApp;
4660
4660
  function config(options) {
@@ -9399,6 +9399,18 @@ function handleValueFormat(type, valueFormat) {
9399
9399
  }
9400
9400
  return 'yyyy-MM-dd';
9401
9401
  }
9402
+ function handleInputFormat(type, inputFormat) {
9403
+ if (inputFormat) {
9404
+ return inputFormat;
9405
+ }
9406
+ if (type === 'time') {
9407
+ return 'HH:mm:ss';
9408
+ }
9409
+ if (type === 'datetime') {
9410
+ return 'yyyy-MM-dd HH:mm:ss';
9411
+ }
9412
+ return 'yyyy-MM-dd';
9413
+ }
9402
9414
  function toStringTimeDate(str) {
9403
9415
  const rest = new Date(2e3, 0, 1);
9404
9416
  if (str) {
@@ -18530,7 +18542,6 @@ function hexToRgb(str) {
18530
18542
  type: String,
18531
18543
  default: () => getConfig().numberInput.size || getConfig().size
18532
18544
  },
18533
- // number、integer、float
18534
18545
  min: {
18535
18546
  type: [String, Number],
18536
18547
  default: null
@@ -18553,12 +18564,12 @@ function hexToRgb(str) {
18553
18564
  default: () => getConfig().numberInput.currencySymbol
18554
18565
  },
18555
18566
  controlConfig: Object,
18556
- // float
18567
+ // number、float、amount
18557
18568
  roundingMode: {
18558
18569
  type: String,
18559
18570
  default: () => getConfig().numberInput.roundingMode
18560
18571
  },
18561
- // float
18572
+ // float、amount
18562
18573
  digits: {
18563
18574
  type: [String, Number],
18564
18575
  default: null
@@ -23871,6 +23882,7 @@ const DatePanel = VxeDatePanel;
23871
23882
  labelFormat: String,
23872
23883
  valueFormat: String,
23873
23884
  timeFormat: String,
23885
+ inputFormat: String,
23874
23886
  editable: {
23875
23887
  type: Boolean,
23876
23888
  default: true
@@ -23900,6 +23912,7 @@ const DatePanel = VxeDatePanel;
23900
23912
  type: Boolean,
23901
23913
  default: () => getConfig().datePicker.autoClose
23902
23914
  },
23915
+ controlConfig: Object,
23903
23916
  prefixIcon: String,
23904
23917
  suffixIcon: String,
23905
23918
  placement: String,
@@ -23940,7 +23953,8 @@ const DatePanel = VxeDatePanel;
23940
23953
  inputLabel: ''
23941
23954
  });
23942
23955
  const internalData = {
23943
- hpTimeout: undefined
23956
+ // hpTimeout: undefined,
23957
+ parseInputKayMaps: {}
23944
23958
  };
23945
23959
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
23946
23960
  const refInputTarget = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
@@ -24079,6 +24093,13 @@ const DatePanel = VxeDatePanel;
24079
24093
  } = props;
24080
24094
  return handleValueFormat(type, valueFormat);
24081
24095
  });
24096
+ const computeDateInputFormat = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
24097
+ const {
24098
+ type,
24099
+ inputFormat
24100
+ } = props;
24101
+ return handleInputFormat(type, inputFormat);
24102
+ });
24082
24103
  const computeFirstDayOfWeek = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
24083
24104
  const {
24084
24105
  startDay
@@ -24106,6 +24127,9 @@ const DatePanel = VxeDatePanel;
24106
24127
  return dateObj.label;
24107
24128
  }).join(', ');
24108
24129
  });
24130
+ const computeControlOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
24131
+ return Object.assign({}, getConfig().datePicker.controlConfig, props.controlConfig);
24132
+ });
24109
24133
  const updateModelValue = () => {
24110
24134
  const {
24111
24135
  modelValue
@@ -24200,6 +24224,8 @@ const DatePanel = VxeDatePanel;
24200
24224
  reactData.isActivated = true;
24201
24225
  if (!trigger || trigger === 'default') {
24202
24226
  datePickerOpenEvent(evnt);
24227
+ } else if (trigger === 'icon') {
24228
+ hidePanel();
24203
24229
  }
24204
24230
  triggerEvent(evnt);
24205
24231
  };
@@ -24244,6 +24270,37 @@ const DatePanel = VxeDatePanel;
24244
24270
  }, evnt);
24245
24271
  }
24246
24272
  };
24273
+ const handleArrowInputDate = (evnt, isUpArrow) => {
24274
+ const {
24275
+ multiple
24276
+ } = props;
24277
+ if (multiple) {
24278
+ return;
24279
+ }
24280
+ const {
24281
+ inputValue
24282
+ } = reactData;
24283
+ if (!inputValue) {
24284
+ return;
24285
+ }
24286
+ const targetElem = refInputTarget.value;
24287
+ if (!targetElem) {
24288
+ return;
24289
+ }
24290
+ const {
24291
+ parseInputKayMaps
24292
+ } = internalData;
24293
+ const inputFormat = computeDateInputFormat.value;
24294
+ const selectionStart = targetElem.selectionStart || 0;
24295
+ let selectKey = inputFormat[selectionStart];
24296
+ if (!parseInputKayMaps[selectKey]) {
24297
+ selectKey = inputFormat[selectionStart - 1];
24298
+ }
24299
+ const inputPaesrFn = parseInputKayMaps[selectKey];
24300
+ if (inputPaesrFn) {
24301
+ inputPaesrFn(evnt, targetElem, isUpArrow);
24302
+ }
24303
+ };
24247
24304
  const blurEvent = evnt => {
24248
24305
  const $datePanel = refDatePanel.value;
24249
24306
  const {
@@ -24270,6 +24327,15 @@ const DatePanel = VxeDatePanel;
24270
24327
  }
24271
24328
  };
24272
24329
  const keydownEvent = evnt => {
24330
+ const {
24331
+ controlConfig
24332
+ } = props;
24333
+ const controlOpts = computeControlOpts.value;
24334
+ const isUpArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_UP);
24335
+ const isDwArrow = globalEvents.hasKey(evnt, GLOBAL_EVENT_KEYS.ARROW_DOWN);
24336
+ if ((isUpArrow || isDwArrow) && controlOpts.isArrow && (controlConfig || controlOpts.enabled)) {
24337
+ handleArrowInputDate(evnt, isUpArrow);
24338
+ }
24273
24339
  triggerEvent(evnt);
24274
24340
  };
24275
24341
  const keyupEvent = evnt => {
@@ -24410,6 +24476,9 @@ const DatePanel = VxeDatePanel;
24410
24476
  } = reactData;
24411
24477
  const targetElem = refInputTarget.value;
24412
24478
  const panelElem = refInputPanel.value;
24479
+ if (!panelElem) {
24480
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
24481
+ }
24413
24482
  const btnTransfer = computeBtnTransfer.value;
24414
24483
  const popupOpts = computePopupOpts.value;
24415
24484
  const handleStyle = () => {
@@ -24459,12 +24528,19 @@ const DatePanel = VxeDatePanel;
24459
24528
  }
24460
24529
  };
24461
24530
  const clickIconEvent = evnt => {
24531
+ const {
24532
+ visiblePanel
24533
+ } = reactData;
24462
24534
  const popupOpts = computePopupOpts.value;
24463
24535
  const {
24464
24536
  trigger
24465
24537
  } = popupOpts;
24466
24538
  if (!trigger || trigger === 'default' || trigger === 'icon') {
24467
- datePickerOpenEvent(evnt);
24539
+ if (visiblePanel) {
24540
+ hidePanel();
24541
+ } else {
24542
+ datePickerOpenEvent(evnt);
24543
+ }
24468
24544
  }
24469
24545
  };
24470
24546
  const clickEvent = evnt => {
@@ -24594,6 +24670,10 @@ const DatePanel = VxeDatePanel;
24594
24670
  return renderEmptyElement($xeDatePicker);
24595
24671
  };
24596
24672
  const renderPanel = () => {
24673
+ const popupOpts = computePopupOpts.value;
24674
+ if (popupOpts.enabled === false) {
24675
+ return renderEmptyElement($xeDatePicker);
24676
+ }
24597
24677
  const {
24598
24678
  type,
24599
24679
  multiple,
@@ -24615,7 +24695,6 @@ const DatePanel = VxeDatePanel;
24615
24695
  const isDateTimeType = computeIsDateTimeType.value;
24616
24696
  const shortcutList = computeShortcutList.value;
24617
24697
  const timeOpts = computeTimeOpts.value;
24618
- const popupOpts = computePopupOpts.value;
24619
24698
  const {
24620
24699
  position
24621
24700
  } = shortcutOpts;
@@ -24835,6 +24914,17 @@ const DatePanel = VxeDatePanel;
24835
24914
  globalEvents.on($xeDatePicker, 'blur', handleGlobalBlurEvent);
24836
24915
  globalEvents.on($xeDatePicker, 'resize', handleGlobalResizeEvent);
24837
24916
  });
24917
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
24918
+ const {
24919
+ parseInputKayMaps
24920
+ } = internalData;
24921
+ const inputKeys = ['y', 'M', 'd', 'H', 'm', 'n'];
24922
+ inputKeys.forEach(key => {
24923
+ parseInputKayMaps[key] = evnt => {
24924
+ evnt.preventDefault();
24925
+ };
24926
+ });
24927
+ });
24838
24928
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onUnmounted)(() => {
24839
24929
  globalEvents.off($xeDatePicker, 'mousewheel');
24840
24930
  globalEvents.off($xeDatePicker, 'mousedown');
@@ -25377,6 +25467,8 @@ const DatePicker = VxeDatePicker;
25377
25467
  reactData.isActivated = true;
25378
25468
  if (!trigger || trigger === 'default') {
25379
25469
  dateRangePickerOpenEvent(evnt);
25470
+ } else if (trigger === 'icon') {
25471
+ hidePanel();
25380
25472
  }
25381
25473
  triggerEvent(evnt);
25382
25474
  };
@@ -25759,6 +25851,9 @@ const DatePicker = VxeDatePicker;
25759
25851
  } = reactData;
25760
25852
  const targetElem = refInputTarget.value;
25761
25853
  const panelElem = refInputPanel.value;
25854
+ if (!panelElem) {
25855
+ return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
25856
+ }
25762
25857
  const btnTransfer = computeBtnTransfer.value;
25763
25858
  const popupOpts = computePopupOpts.value;
25764
25859
  const handleStyle = () => {
@@ -25809,12 +25904,19 @@ const DatePicker = VxeDatePicker;
25809
25904
  }
25810
25905
  };
25811
25906
  const clickIconEvent = evnt => {
25907
+ const {
25908
+ visiblePanel
25909
+ } = reactData;
25812
25910
  const popupOpts = computePopupOpts.value;
25813
25911
  const {
25814
25912
  trigger
25815
25913
  } = popupOpts;
25816
25914
  if (!trigger || trigger === 'default' || trigger === 'icon') {
25817
- dateRangePickerOpenEvent(evnt);
25915
+ if (visiblePanel) {
25916
+ hidePanel();
25917
+ } else {
25918
+ dateRangePickerOpenEvent(evnt);
25919
+ }
25818
25920
  }
25819
25921
  };
25820
25922
  const clickEvent = evnt => {
@@ -25953,6 +26055,10 @@ const DatePicker = VxeDatePicker;
25953
26055
  return renderEmptyElement($xeDateRangePicker);
25954
26056
  };
25955
26057
  const renderPanel = () => {
26058
+ const popupOpts = computePopupOpts.value;
26059
+ if (popupOpts.enabled === false) {
26060
+ return renderEmptyElement($xeDateRangePicker);
26061
+ }
25956
26062
  const {
25957
26063
  type,
25958
26064
  separator,
@@ -25979,7 +26085,6 @@ const DatePicker = VxeDatePicker;
25979
26085
  const defaultDates = computeDefaultDates.value;
25980
26086
  const defaultTimes = computeDefaultTimes.value;
25981
26087
  const timeOpts = computeTimeOpts.value;
25982
- const popupOpts = computePopupOpts.value;
25983
26088
  const {
25984
26089
  startLabel,
25985
26090
  endLabel
@@ -40712,7 +40817,8 @@ const Select = VxeSelect;
40712
40817
  staticItems: [],
40713
40818
  itemList: [],
40714
40819
  barWidth: 0,
40715
- barHeight: 0
40820
+ barHeight: 0,
40821
+ resizeFlag: 0
40716
40822
  });
40717
40823
  const internalData = {
40718
40824
  wrapperWidth: 0,
@@ -41254,6 +41360,7 @@ const Select = VxeSelect;
41254
41360
  document.onmousemove = evnt => {
41255
41361
  evnt.preventDefault();
41256
41362
  handleDrag(evnt);
41363
+ reactData.resizeFlag++;
41257
41364
  };
41258
41365
  document.onmouseup = evnt => {
41259
41366
  document.onmousemove = null;
@@ -41270,6 +41377,7 @@ const Select = VxeSelect;
41270
41377
  offsetWidth: targetOffsetWidth
41271
41378
  }, evnt);
41272
41379
  recalculate();
41380
+ reactData.resizeFlag++;
41273
41381
  };
41274
41382
  if (rsSplitterLineEl) {
41275
41383
  rsSplitterLineEl.style.display = 'block';
@@ -41328,6 +41436,7 @@ const Select = VxeSelect;
41328
41436
  }, evnt);
41329
41437
  }
41330
41438
  recalculate();
41439
+ reactData.resizeFlag++;
41331
41440
  };
41332
41441
  const handlePrevActionDblclickEvent = evnt => {
41333
41442
  const {