vxe-pc-ui 4.15.7 → 4.15.9

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 (49) hide show
  1. package/dist/all.esm.js +71 -37
  2. package/dist/style.css +1 -1
  3. package/dist/style.min.css +1 -1
  4. package/es/date-panel/src/date-panel.js +14 -6
  5. package/es/date-panel/src/util.js +1 -1
  6. package/es/date-picker/src/date-picker.js +53 -27
  7. package/es/icon/style.css +1 -1
  8. package/es/style.css +1 -1
  9. package/es/style.min.css +1 -1
  10. package/es/ui/index.js +1 -1
  11. package/es/ui/src/log.js +1 -1
  12. package/es/upload/src/upload.js +2 -2
  13. package/lib/date-panel/src/date-panel.js +14 -6
  14. package/lib/date-panel/src/date-panel.min.js +1 -1
  15. package/lib/date-panel/src/util.js +2 -2
  16. package/lib/date-panel/src/util.min.js +1 -1
  17. package/lib/date-picker/src/date-picker.js +57 -25
  18. package/lib/date-picker/src/date-picker.min.js +1 -1
  19. package/lib/icon/style/style.css +1 -1
  20. package/lib/icon/style/style.min.css +1 -1
  21. package/lib/index.umd.js +75 -36
  22. package/lib/index.umd.min.js +1 -1
  23. package/lib/style.css +1 -1
  24. package/lib/style.min.css +1 -1
  25. package/lib/ui/index.js +1 -1
  26. package/lib/ui/index.min.js +1 -1
  27. package/lib/ui/src/log.js +1 -1
  28. package/lib/ui/src/log.min.js +1 -1
  29. package/lib/upload/src/upload.js +1 -2
  30. package/lib/upload/src/upload.min.js +1 -1
  31. package/package.json +2 -2
  32. package/packages/date-panel/src/date-panel.ts +14 -6
  33. package/packages/date-panel/src/util.ts +1 -1
  34. package/packages/date-picker/src/date-picker.ts +56 -30
  35. package/packages/upload/src/upload.ts +2 -2
  36. package/types/components/date-picker.d.ts +1 -0
  37. package/types/components/gantt.d.ts +1 -0
  38. /package/es/icon/{iconfont.1782112308661.ttf → iconfont.1782144837167.ttf} +0 -0
  39. /package/es/icon/{iconfont.1782112308661.woff → iconfont.1782144837167.woff} +0 -0
  40. /package/es/icon/{iconfont.1782112308661.woff2 → iconfont.1782144837167.woff2} +0 -0
  41. /package/es/{iconfont.1782112308661.ttf → iconfont.1782144837167.ttf} +0 -0
  42. /package/es/{iconfont.1782112308661.woff → iconfont.1782144837167.woff} +0 -0
  43. /package/es/{iconfont.1782112308661.woff2 → iconfont.1782144837167.woff2} +0 -0
  44. /package/lib/icon/style/{iconfont.1782112308661.ttf → iconfont.1782144837167.ttf} +0 -0
  45. /package/lib/icon/style/{iconfont.1782112308661.woff → iconfont.1782144837167.woff} +0 -0
  46. /package/lib/icon/style/{iconfont.1782112308661.woff2 → iconfont.1782144837167.woff2} +0 -0
  47. /package/lib/{iconfont.1782112308661.ttf → iconfont.1782144837167.ttf} +0 -0
  48. /package/lib/{iconfont.1782112308661.woff → iconfont.1782144837167.woff} +0 -0
  49. /package/lib/{iconfont.1782112308661.woff2 → iconfont.1782144837167.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -4649,7 +4649,7 @@ function checkDynamic() {
4649
4649
  const {
4650
4650
  log: log_log
4651
4651
  } = VxeUI;
4652
- const uiVersion = `ui v${"4.15.7"}`;
4652
+ const uiVersion = `ui v${"4.15.9"}`;
4653
4653
  function createComponentLog(name) {
4654
4654
  const tableVersion = VxeUI.tableVersion ? `table v${VxeUI.tableVersion}` : '';
4655
4655
  const ganttVersion = VxeUI.ganttVersion ? `gantt v${VxeUI.ganttVersion}` : '';
@@ -4666,7 +4666,7 @@ const errLog = log_log.create('error', uiVersion);
4666
4666
 
4667
4667
 
4668
4668
 
4669
- const ui_version = "4.15.7";
4669
+ const ui_version = "4.15.9";
4670
4670
  VxeUI.uiVersion = ui_version;
4671
4671
  VxeUI.dynamicApp = dynamicApp;
4672
4672
  function config(options) {
@@ -9663,7 +9663,7 @@ function isAllSameChar(str, char) {
9663
9663
  }
9664
9664
  return true;
9665
9665
  }
9666
- function checkDateFormat(numStr, formatKey) {
9666
+ function checkDateInputFormat(numStr, formatKey) {
9667
9667
  const numVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(numStr);
9668
9668
  switch (formatKey) {
9669
9669
  case 'yyyy':
@@ -22182,10 +22182,10 @@ const Countdown = VxeCountdown;
22182
22182
  const isDateTimeType = computeIsDateTimeType.value;
22183
22183
  return isDateTimeType || ['date', 'week', 'month', 'quarter', 'year'].indexOf(props.type) > -1;
22184
22184
  });
22185
- const computeDateStartTime = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
22185
+ const computeDateStartDate = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
22186
22186
  return props.startDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(props.startDate) : null;
22187
22187
  });
22188
- const computeDateEndTime = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
22188
+ const computeDateEndDate = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
22189
22189
  return props.endDate ? external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toStringDate(props.endDate) : null;
22190
22190
  });
22191
22191
  const computeDateListValue = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
@@ -22256,7 +22256,7 @@ const Countdown = VxeCountdown;
22256
22256
  return val;
22257
22257
  });
22258
22258
  const computeIsDisabledPrevDateBtn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
22259
- const dateStartTime = computeDateStartTime.value;
22259
+ const dateStartTime = computeDateStartDate.value;
22260
22260
  const {
22261
22261
  selectMonth
22262
22262
  } = reactData;
@@ -22266,7 +22266,7 @@ const Countdown = VxeCountdown;
22266
22266
  return false;
22267
22267
  });
22268
22268
  const computeIsDisabledNextDateBtn = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
22269
- const dateEndTime = computeDateEndTime.value;
22269
+ const dateEndTime = computeDateEndDate.value;
22270
22270
  const {
22271
22271
  selectMonth
22272
22272
  } = reactData;
@@ -22730,6 +22730,8 @@ const Countdown = VxeCountdown;
22730
22730
  datetimePanelValue
22731
22731
  } = reactData;
22732
22732
  const dateLabelFormat = computeDateLabelFormat.value;
22733
+ const dateStartDate = computeDateStartDate.value;
22734
+ const dateEndDate = computeDateEndDate.value;
22733
22735
  if (inpVal) {
22734
22736
  let inpDateVal = parseDate(inpVal, dateLabelFormat);
22735
22737
  if (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isValidDate(inpDateVal)) {
@@ -22742,6 +22744,12 @@ const Countdown = VxeCountdown;
22742
22744
  }
22743
22745
  reactData.inputLabel = inpDateVal;
22744
22746
  } else {
22747
+ if (dateEndDate && inpDateVal > dateEndDate) {
22748
+ inpDateVal = dateEndDate;
22749
+ }
22750
+ if (dateStartDate && inpDateVal < dateStartDate) {
22751
+ inpDateVal = dateStartDate;
22752
+ }
22745
22753
  let isChange = false;
22746
22754
  const firstDayOfWeek = computeFirstDayOfWeek.value;
22747
22755
  if (type === 'datetime') {
@@ -23095,8 +23103,8 @@ const Countdown = VxeCountdown;
23095
23103
  }
23096
23104
  };
23097
23105
  const isRangeDisabled = item => {
23098
- const dateStartTime = computeDateStartTime.value;
23099
- const dateEndTime = computeDateEndTime.value;
23106
+ const dateStartTime = computeDateStartDate.value;
23107
+ const dateEndTime = computeDateEndDate.value;
23100
23108
  const {
23101
23109
  date
23102
23110
  } = item;
@@ -24009,6 +24017,7 @@ const {
24009
24017
  warnLog: date_picker_warnLog,
24010
24018
  errLog: date_picker_errLog
24011
24019
  } = createComponentLog('date-picker');
24020
+ const defaultMaskPlaceholder = '*';
24012
24021
  const maskedTypes = ['year', 'month', 'date', 'datetime', 'time'];
24013
24022
  const inputMaskedKeys = ['y', 'M', 'd', 'H', 'm', 'n', 's'];
24014
24023
  const parseInputKayMaps = {};
@@ -24031,6 +24040,7 @@ function date_picker_createReactData() {
24031
24040
  function date_picker_createInternalData() {
24032
24041
  return {
24033
24042
  // hpTimeout: undefined,
24043
+ // fsTimeout: undefined,
24034
24044
  inputLabel: '',
24035
24045
  laseFocusMasked: 0
24036
24046
  };
@@ -24383,7 +24393,7 @@ function date_picker_createInternalData() {
24383
24393
  const {
24384
24394
  maskPlaceholder
24385
24395
  } = maskedOpts;
24386
- return (maskPlaceholder ? ('' + maskPlaceholder)[0] : '') || '*';
24396
+ return (maskPlaceholder ? ('' + maskPlaceholder)[0] : '') || defaultMaskPlaceholder;
24387
24397
  });
24388
24398
  const updateModelValue = () => {
24389
24399
  const {
@@ -24579,6 +24589,8 @@ function date_picker_createInternalData() {
24579
24589
  } = internalData;
24580
24590
  const dateLabelFormat = computeDateLabelFormat.value;
24581
24591
  const maskedOpts = computeMaskedOpts.value;
24592
+ const dateStartDate = computeDateStartDate.value;
24593
+ const dateEndDate = computeDateEndDate.value;
24582
24594
  if (!inpVal) {
24583
24595
  handleChange('', {
24584
24596
  type: 'check'
@@ -24592,12 +24604,16 @@ function date_picker_createInternalData() {
24592
24604
  allMaskedKeys.forEach(formatKey => {
24593
24605
  const fkIndex = dateLabelFormat.indexOf(formatKey);
24594
24606
  if (fkIndex > -1) {
24595
- let val = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(inpVal.slice(fkIndex, formatKey.length).replace(/\D/g, ''));
24607
+ const valStr = inpVal.slice(fkIndex, fkIndex + formatKey.length).replace(/\D/g, '');
24608
+ if (!valStr) {
24609
+ return;
24610
+ }
24611
+ let valNum = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(valStr);
24596
24612
  // 自动纠错最小值
24597
- if (!val && ['MM', 'dd'].includes(formatKey)) {
24598
- val = 1;
24613
+ if (!valNum && ['MM', 'dd'].includes(formatKey)) {
24614
+ valNum = 1;
24599
24615
  }
24600
- inpVal = inpVal.slice(0, fkIndex) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().padStart(checkDateFormat(val, formatKey), formatKey.length, '0') + inpVal.slice(fkIndex + formatKey.length);
24616
+ inpVal = inpVal.slice(0, fkIndex) + external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().padStart(checkDateInputFormat(valNum, formatKey), formatKey.length, '0') + inpVal.slice(fkIndex + formatKey.length);
24601
24617
  }
24602
24618
  });
24603
24619
  }
@@ -24623,6 +24639,12 @@ function date_picker_createInternalData() {
24623
24639
  handleInputLabel(inpDateVal, true);
24624
24640
  return;
24625
24641
  }
24642
+ if (dateEndDate && inpDateVal > dateEndDate) {
24643
+ inpDateVal = dateEndDate;
24644
+ }
24645
+ if (dateStartDate && inpDateVal < dateStartDate) {
24646
+ inpDateVal = dateStartDate;
24647
+ }
24626
24648
  let isChange = false;
24627
24649
  const firstDayOfWeek = computeFirstDayOfWeek.value;
24628
24650
  if (type === 'datetime') {
@@ -24668,11 +24690,22 @@ function date_picker_createInternalData() {
24668
24690
  align
24669
24691
  } = maskedOpts;
24670
24692
  const maskChar = computeMaskChar.value;
24671
- const restVal = checkDateFormat(external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(numStr), chunkFormat);
24693
+ const numVal = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(numStr);
24694
+ let restVal = checkDateInputFormat(numVal, chunkFormat);
24695
+ if (isFull) {
24696
+ // 自动纠错最小值
24697
+ if (!restVal && ['MM', 'dd'].includes(chunkFormat)) {
24698
+ restVal = 1;
24699
+ }
24700
+ }
24701
+ let restStr = '' + restVal;
24702
+ if (numStr.length > restStr.length) {
24703
+ restStr = restStr.padStart(numStr.length, '0');
24704
+ }
24672
24705
  if (isFull) {
24673
- return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().padStart(restVal, chunkFormat.length, '0');
24706
+ return external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().padStart(restStr, chunkFormat.length, '0');
24674
24707
  }
24675
- return (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default())[align === 'right' ? 'padStart' : 'padEnd'](restVal, chunkFormat.length, maskChar);
24708
+ return (external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default())[align === 'right' ? 'padStart' : 'padEnd'](restStr, chunkFormat.length, maskChar);
24676
24709
  };
24677
24710
  const handleArrowInputDate = (evnt, isUpArrow, isDwArrow, isLtArrow, isRtArrow) => {
24678
24711
  const {
@@ -24710,7 +24743,7 @@ function date_picker_createInternalData() {
24710
24743
  const chunkValue = inpValue.slice(chunkStartIndex, chunkEndIndex);
24711
24744
  if (parseInputKayMaps[selectKey]) {
24712
24745
  const chunkNum = (isAllSameChar(chunkValue, maskChar) ? getChunkDefaultNum(selectKey) : external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(chunkValue)) + (isUpArrow ? 1 : -1);
24713
- const restValue = inpValue.slice(0, chunkStartIndex) + checkMaskedInputValue(chunkNum, chunkFormat, true) + inpValue.slice(chunkEndIndex);
24746
+ const restValue = inpValue.slice(0, chunkStartIndex) + checkMaskedInputValue('' + chunkNum, chunkFormat, true) + inpValue.slice(chunkEndIndex);
24714
24747
  evnt.preventDefault();
24715
24748
  if (restValue.indexOf(maskChar) === -1) {
24716
24749
  // 解析日期
@@ -24889,6 +24922,7 @@ function date_picker_createInternalData() {
24889
24922
  internalData.isTriggerMasked = false;
24890
24923
  };
24891
24924
  const handleMaskedSelectedDate = (evnt, isFocus) => {
24925
+ internalData.fsTimeout = undefined;
24892
24926
  const {
24893
24927
  type,
24894
24928
  multiple,
@@ -24968,7 +25002,7 @@ function date_picker_createInternalData() {
24968
25002
  selectKey = dateMaskedFormat[selectionStart - 1];
24969
25003
  }
24970
25004
  if (selectKey) {
24971
- evnt.preventDefault();
25005
+ evnt.stopPropagation();
24972
25006
  const skRest = dateMaskedFormat.match(new RegExp(selectKey + '+'));
24973
25007
  if (skRest) {
24974
25008
  const chunkFormat = skRest[0] || '';
@@ -25011,41 +25045,47 @@ function date_picker_createInternalData() {
25011
25045
  editable,
25012
25046
  maskedConfig
25013
25047
  } = props;
25048
+ const {
25049
+ fsTimeout
25050
+ } = internalData;
25014
25051
  const maskedOpts = computeMaskedOpts.value;
25015
25052
  const popupOpts = computePopupOpts.value;
25016
25053
  const {
25017
25054
  trigger
25018
25055
  } = popupOpts;
25019
25056
  reactData.isActivated = true;
25057
+ if (fsTimeout) {
25058
+ clearTimeout(fsTimeout);
25059
+ }
25020
25060
  if (!trigger || trigger === 'default') {
25021
25061
  datePickerOpenEvent(evnt);
25022
- setTimeout(() => {
25023
- if (editable && !multiple && (isEnableConf(maskedConfig) || maskedOpts.enabled)) {
25024
- handleMaskedSelectedDate(evnt, true);
25025
- }
25026
- }, 15);
25027
25062
  } else if (trigger === 'icon') {
25028
25063
  hidePanel();
25029
- setTimeout(() => {
25030
- if (editable && !multiple && (isEnableConf(maskedConfig) || maskedOpts.enabled)) {
25031
- handleMaskedSelectedDate(evnt, true);
25032
- }
25033
- }, 15);
25034
- } else {
25035
- if (editable && !multiple && (isEnableConf(maskedConfig) || maskedOpts.enabled)) {
25064
+ }
25065
+ if (editable && !multiple && (isEnableConf(maskedConfig) || maskedOpts.enabled)) {
25066
+ internalData.fsTimeout = setTimeout(() => {
25036
25067
  handleMaskedSelectedDate(evnt, true);
25037
- }
25068
+ }, 20);
25038
25069
  }
25039
25070
  triggerEvent(evnt);
25040
25071
  };
25041
25072
  const clickEvent = evnt => {
25042
25073
  const {
25074
+ multiple,
25043
25075
  editable,
25044
25076
  maskedConfig
25045
25077
  } = props;
25078
+ const {
25079
+ fsTimeout
25080
+ } = internalData;
25046
25081
  const maskedOpts = computeMaskedOpts.value;
25047
- if (editable && (isEnableConf(maskedConfig) || maskedOpts.enabled)) {
25048
- handleMaskedSelectedDate(evnt);
25082
+ if (fsTimeout) {
25083
+ clearTimeout(fsTimeout);
25084
+ }
25085
+ if (editable && !multiple && (isEnableConf(maskedConfig) || maskedOpts.enabled)) {
25086
+ internalData.fsTimeout = setTimeout(() => {
25087
+ handleMaskedSelectedDate(evnt);
25088
+ }, 10);
25049
25089
  }
25050
25090
  triggerEvent(evnt);
25051
25091
  };
@@ -51728,7 +51768,6 @@ function upload_createInternalData() {
51728
51768
  const handleUploadFile = (files, evnt) => {
51729
51769
  const {
51730
51770
  multiple,
51731
- urlMode,
51732
51771
  showLimitSize,
51733
51772
  limitSizeText,
51734
51773
  showLimitCount,
@@ -51860,7 +51899,7 @@ function upload_createInternalData() {
51860
51899
  option: item
51861
51900
  }, evnt);
51862
51901
  });
51863
- Promise.all(urlMode ? uploadPromiseRests : []).then(() => {
51902
+ Promise.all(uploadPromiseRests).then(() => {
51864
51903
  const restFileList = reactData.fileList;
51865
51904
  dispatchEvent('upload-queue-end', {
51866
51905
  options: restFileList,