vxe-pc-ui 4.5.4 → 4.5.5

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 (44) hide show
  1. package/es/collapse/src/collapse.js +5 -1
  2. package/es/form/src/form.js +12 -16
  3. package/es/icon/style.css +1 -1
  4. package/es/split/src/split.js +113 -30
  5. package/es/style.css +1 -1
  6. package/es/style.min.css +1 -1
  7. package/es/ui/index.js +1 -1
  8. package/es/ui/src/log.js +1 -1
  9. package/lib/collapse/src/collapse.js +8 -1
  10. package/lib/collapse/src/collapse.min.js +1 -1
  11. package/lib/form/src/form.js +12 -16
  12. package/lib/form/src/form.min.js +1 -1
  13. package/lib/icon/style/style.css +1 -1
  14. package/lib/icon/style/style.min.css +1 -1
  15. package/lib/index.umd.js +147 -47
  16. package/lib/index.umd.min.js +1 -1
  17. package/lib/split/src/split.js +128 -30
  18. package/lib/split/src/split.min.js +1 -1
  19. package/lib/style.css +1 -1
  20. package/lib/style.min.css +1 -1
  21. package/lib/ui/index.js +1 -1
  22. package/lib/ui/index.min.js +1 -1
  23. package/lib/ui/src/log.js +1 -1
  24. package/lib/ui/src/log.min.js +1 -1
  25. package/package.json +1 -1
  26. package/packages/collapse/src/collapse.ts +5 -1
  27. package/packages/form/src/form.ts +12 -16
  28. package/packages/split/src/split.ts +120 -33
  29. package/types/components/carousel.d.ts +13 -3
  30. package/types/components/collapse.d.ts +23 -4
  31. package/types/components/split-item.d.ts +3 -0
  32. package/types/components/split.d.ts +62 -1
  33. /package/es/icon/{iconfont.1743125694154.ttf → iconfont.1743138565378.ttf} +0 -0
  34. /package/es/icon/{iconfont.1743125694154.woff → iconfont.1743138565378.woff} +0 -0
  35. /package/es/icon/{iconfont.1743125694154.woff2 → iconfont.1743138565378.woff2} +0 -0
  36. /package/es/{iconfont.1743125694154.ttf → iconfont.1743138565378.ttf} +0 -0
  37. /package/es/{iconfont.1743125694154.woff → iconfont.1743138565378.woff} +0 -0
  38. /package/es/{iconfont.1743125694154.woff2 → iconfont.1743138565378.woff2} +0 -0
  39. /package/lib/icon/style/{iconfont.1743125694154.ttf → iconfont.1743138565378.ttf} +0 -0
  40. /package/lib/icon/style/{iconfont.1743125694154.woff → iconfont.1743138565378.woff} +0 -0
  41. /package/lib/icon/style/{iconfont.1743125694154.woff2 → iconfont.1743138565378.woff2} +0 -0
  42. /package/lib/{iconfont.1743125694154.ttf → iconfont.1743138565378.ttf} +0 -0
  43. /package/lib/{iconfont.1743125694154.woff → iconfont.1743138565378.woff} +0 -0
  44. /package/lib/{iconfont.1743125694154.woff2 → iconfont.1743138565378.woff2} +0 -0
package/lib/index.umd.js CHANGED
@@ -4183,14 +4183,14 @@ function checkDynamic() {
4183
4183
  }
4184
4184
  ;// CONCATENATED MODULE: ./packages/ui/src/log.ts
4185
4185
 
4186
- const log_version = `ui v${"4.5.4"}`;
4186
+ const log_version = `ui v${"4.5.5"}`;
4187
4187
  const warnLog = log.create('warn', log_version);
4188
4188
  const errLog = log.create('error', log_version);
4189
4189
  ;// CONCATENATED MODULE: ./packages/ui/index.ts
4190
4190
 
4191
4191
 
4192
4192
 
4193
- const ui_version = "4.5.4";
4193
+ const ui_version = "4.5.5";
4194
4194
  index_esm_VxeUI.uiVersion = ui_version;
4195
4195
  index_esm_VxeUI.dynamicApp = dynamicApp;
4196
4196
  function config(options) {
@@ -9664,7 +9664,7 @@ const Col = VxeCol;
9664
9664
  default: () => getConfig().collapse.size || getConfig().size
9665
9665
  }
9666
9666
  },
9667
- emits: ['update:modelValue', 'load', 'change'],
9667
+ emits: ['update:modelValue', 'load', 'change', 'toggle-expand'],
9668
9668
  setup(props, context) {
9669
9669
  const {
9670
9670
  emit,
@@ -9790,7 +9790,9 @@ const Col = VxeCol;
9790
9790
  } = item;
9791
9791
  if (name) {
9792
9792
  const aIndex = activeNames.indexOf(name);
9793
+ let expanded = false;
9793
9794
  if (aIndex === -1) {
9795
+ expanded = true;
9794
9796
  activeNames.push(name);
9795
9797
  } else {
9796
9798
  activeNames.splice(aIndex, 1);
@@ -9800,6 +9802,11 @@ const Col = VxeCol;
9800
9802
  value: activeNames,
9801
9803
  name
9802
9804
  }, evnt);
9805
+ dispatchEvent('toggle-expand', {
9806
+ value: activeNames,
9807
+ name,
9808
+ expanded
9809
+ }, evnt);
9803
9810
  }
9804
9811
  };
9805
9812
  const collapsePrivateMethods = {};
@@ -18439,19 +18446,17 @@ const validErrorRuleValue = (rule, val) => {
18439
18446
  };
18440
18447
  const loadItem = list => {
18441
18448
  if (list.length) {
18442
- if (true) {
18443
- list.forEach(item => {
18444
- if (item.slots) {
18445
- external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(item.slots, func => {
18446
- if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(func)) {
18447
- if (!slots[func]) {
18448
- errLog('vxe.error.notSlot', [func]);
18449
- }
18449
+ list.forEach(item => {
18450
+ if (item.slots) {
18451
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(item.slots, func => {
18452
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(func)) {
18453
+ if (!slots[func]) {
18454
+ errLog('vxe.error.notSlot', [func]);
18450
18455
  }
18451
- });
18452
- }
18453
- });
18454
- }
18456
+ }
18457
+ });
18458
+ }
18459
+ });
18455
18460
  }
18456
18461
  reactData.staticItems = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().mapTree(list, item => createItem($xeForm, item), {
18457
18462
  children: 'children'
@@ -19058,10 +19063,8 @@ const validErrorRuleValue = (rule, val) => {
19058
19063
  });
19059
19064
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
19060
19065
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)(() => {
19061
- if (true) {
19062
- if (props.customLayout && props.items) {
19063
- errLog('vxe.error.errConflicts', ['custom-layout', 'items']);
19064
- }
19066
+ if (props.customLayout && props.items) {
19067
+ errLog('vxe.error.errConflicts', ['custom-layout', 'items']);
19065
19068
  }
19066
19069
  });
19067
19070
  });
@@ -45112,6 +45115,7 @@ const Select = VxeSelect;
45112
45115
 
45113
45116
 
45114
45117
 
45118
+
45115
45119
  /* harmony default export */ var split = ((0,external_commonjs_vue_commonjs2_vue_root_Vue_.defineComponent)({
45116
45120
  name: 'VxeSplit',
45117
45121
  props: {
@@ -45129,11 +45133,12 @@ const Select = VxeSelect;
45129
45133
  type: Boolean,
45130
45134
  default: () => getConfig().split.padding
45131
45135
  },
45136
+ items: Array,
45132
45137
  itemConfig: Object,
45133
45138
  barConfig: Object,
45134
45139
  actionConfig: Object
45135
45140
  },
45136
- emits: ['action-dblclick', 'action-click', 'resize-start', 'resize-drag', 'resize-end'],
45141
+ emits: ['action-dblclick', 'action-click', 'toggle-expand', 'resize-start', 'resize-drag', 'resize-end'],
45137
45142
  setup(props, context) {
45138
45143
  const {
45139
45144
  emit,
@@ -45142,7 +45147,8 @@ const Select = VxeSelect;
45142
45147
  const xID = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId();
45143
45148
  const refElem = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)();
45144
45149
  const reactData = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.reactive)({
45145
- staticItems: []
45150
+ staticItems: [],
45151
+ itemList: []
45146
45152
  });
45147
45153
  const internalData = {};
45148
45154
  const computeItemOpts = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.computed)(() => {
@@ -45243,9 +45249,9 @@ const Select = VxeSelect;
45243
45249
  };
45244
45250
  const reset = () => {
45245
45251
  const {
45246
- staticItems
45252
+ itemList
45247
45253
  } = reactData;
45248
- staticItems.forEach(item => {
45254
+ itemList.forEach(item => {
45249
45255
  item.isExpand = true;
45250
45256
  item.isVisible = true;
45251
45257
  item.foldHeight = 0;
@@ -45255,13 +45261,52 @@ const Select = VxeSelect;
45255
45261
  });
45256
45262
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)();
45257
45263
  };
45264
+ const handleLoadItem = (list, isReset) => {
45265
+ const {
45266
+ staticItems
45267
+ } = reactData;
45268
+ const itemDef = {
45269
+ isVisible: true,
45270
+ isExpand: true,
45271
+ renderWidth: 0,
45272
+ resizeWidth: 0,
45273
+ foldWidth: 0,
45274
+ renderHeight: 0,
45275
+ resizeHeight: 0,
45276
+ foldHeight: 0
45277
+ };
45278
+ reactData.itemList = list.map(item => {
45279
+ if (item.slots) {
45280
+ external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().each(item.slots, func => {
45281
+ if (!external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().isFunction(func)) {
45282
+ if (!slots[func]) {
45283
+ errLog('vxe.error.notSlot', [func]);
45284
+ }
45285
+ }
45286
+ });
45287
+ }
45288
+ return Object.assign({}, isReset ? null : itemDef, item, isReset ? itemDef : null, {
45289
+ id: external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().uniqueId()
45290
+ });
45291
+ });
45292
+ if (staticItems.length) {
45293
+ errLog('vxe.error.errConflicts', ['<vxe-split-item ...>', 'items']);
45294
+ }
45295
+ return recalculate();
45296
+ };
45297
+ const loadItem = list => {
45298
+ return handleLoadItem(list || [], false);
45299
+ };
45300
+ const reloadItem = list => {
45301
+ return handleLoadItem(list || [], true);
45302
+ };
45258
45303
  const recalculate = () => {
45259
45304
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.nextTick)().then(() => {
45260
45305
  const {
45261
45306
  vertical
45262
45307
  } = props;
45263
45308
  const {
45264
- staticItems
45309
+ itemList
45265
45310
  } = reactData;
45266
45311
  const el = refElem.value;
45267
45312
  if (!el) {
@@ -45278,7 +45323,7 @@ const Select = VxeSelect;
45278
45323
  const residueItems = [];
45279
45324
  if (vertical) {
45280
45325
  let countHeight = 0;
45281
- staticItems.forEach(item => {
45326
+ itemList.forEach(item => {
45282
45327
  const {
45283
45328
  height
45284
45329
  } = item;
@@ -45303,7 +45348,7 @@ const Select = VxeSelect;
45303
45348
  }
45304
45349
  } else {
45305
45350
  let countWidth = 0;
45306
- staticItems.forEach(item => {
45351
+ itemList.forEach(item => {
45307
45352
  const {
45308
45353
  width
45309
45354
  } = item;
@@ -45335,7 +45380,7 @@ const Select = VxeSelect;
45335
45380
  vertical
45336
45381
  } = props;
45337
45382
  const {
45338
- staticItems
45383
+ itemList
45339
45384
  } = reactData;
45340
45385
  const barEl = evnt.currentTarget;
45341
45386
  const handleEl = barEl.parentElement;
@@ -45344,8 +45389,8 @@ const Select = VxeSelect;
45344
45389
  return;
45345
45390
  }
45346
45391
  const itemId = handleEl.getAttribute('itemid');
45347
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(staticItems, item => item.id === itemId);
45348
- const item = staticItems[itemIndex];
45392
+ const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
45393
+ const item = itemList[itemIndex];
45349
45394
  if (!item) {
45350
45395
  return;
45351
45396
  }
@@ -45356,7 +45401,7 @@ const Select = VxeSelect;
45356
45401
  const itemOpts = computeItemOpts.value;
45357
45402
  const allMinWidth = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minWidth);
45358
45403
  const allMinHeight = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().toNumber(itemOpts.minHeight);
45359
- const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)];
45404
+ const targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)];
45360
45405
  const targetItemEl = targetItem ? el.querySelector(`.vxe-split-item[itemid="${targetItem.id}"]`) : null;
45361
45406
  const currItemEl = item ? el.querySelector(`.vxe-split-item[itemid="${item.id}"]`) : null;
45362
45407
  const targetWidth = targetItemEl ? targetItemEl.clientWidth : 0;
@@ -45470,15 +45515,15 @@ const Select = VxeSelect;
45470
45515
  vertical
45471
45516
  } = props;
45472
45517
  const {
45473
- staticItems
45518
+ itemList
45474
45519
  } = reactData;
45475
45520
  const isFoldNext = computeIsFoldNext.value;
45476
45521
  const btnEl = evnt.currentTarget;
45477
45522
  const handleEl = btnEl.parentElement;
45478
45523
  const itemId = handleEl.getAttribute('itemid');
45479
- const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(staticItems, item => item.id === itemId);
45480
- const item = staticItems[itemIndex];
45481
- const targetItem = staticItems[itemIndex + (isFoldNext ? 1 : -1)];
45524
+ const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
45525
+ const item = itemList[itemIndex];
45526
+ const targetItem = itemList[itemIndex + (isFoldNext ? 1 : -1)];
45482
45527
  if (item) {
45483
45528
  const {
45484
45529
  showAction,
@@ -45502,7 +45547,7 @@ const Select = VxeSelect;
45502
45547
  item.foldWidth = isExpand ? (targetItem.resizeWidth || targetItem.renderWidth) + (item.resizeWidth || item.renderWidth) : 0;
45503
45548
  }
45504
45549
  }
45505
- dispatchEvent(evnt.type === 'dblclick' ? 'action-dblclick' : 'action-click', {
45550
+ dispatchEvent('toggle-expand', {
45506
45551
  item,
45507
45552
  name: item.name,
45508
45553
  targetItem,
@@ -45513,13 +45558,51 @@ const Select = VxeSelect;
45513
45558
  }
45514
45559
  }
45515
45560
  };
45561
+ const handleActionDblclickEvent = evnt => {
45562
+ const {
45563
+ itemList
45564
+ } = reactData;
45565
+ const actionOpts = computeActionOpts.value;
45566
+ const btnEl = evnt.currentTarget;
45567
+ const handleEl = btnEl.parentElement;
45568
+ const itemId = handleEl.getAttribute('itemid');
45569
+ const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
45570
+ const item = itemList[itemIndex];
45571
+ if (actionOpts.trigger === 'dblclick') {
45572
+ handleItemActionEvent(evnt);
45573
+ }
45574
+ dispatchEvent('action-dblclick', {
45575
+ item,
45576
+ name: item ? item.name : ''
45577
+ }, evnt);
45578
+ };
45579
+ const handleActionClickEvent = evnt => {
45580
+ const {
45581
+ itemList
45582
+ } = reactData;
45583
+ const actionOpts = computeActionOpts.value;
45584
+ const btnEl = evnt.currentTarget;
45585
+ const handleEl = btnEl.parentElement;
45586
+ const itemId = handleEl.getAttribute('itemid');
45587
+ const itemIndex = external_root_XEUtils_commonjs_xe_utils_commonjs2_xe_utils_amd_xe_utils_default().findIndexOf(itemList, item => item.id === itemId);
45588
+ const item = itemList[itemIndex];
45589
+ if (actionOpts.trigger !== 'dblclick') {
45590
+ handleItemActionEvent(evnt);
45591
+ }
45592
+ dispatchEvent('action-click', {
45593
+ item,
45594
+ name: item ? item.name : ''
45595
+ }, evnt);
45596
+ };
45516
45597
  const handleGlobalResizeEvent = () => {
45517
45598
  recalculate();
45518
45599
  };
45519
45600
  const splitMethods = {
45520
45601
  dispatchEvent,
45521
45602
  recalculate,
45522
- reset
45603
+ reset,
45604
+ loadItem,
45605
+ reloadItem
45523
45606
  };
45524
45607
  const splitPrivateMethods = {};
45525
45608
  Object.assign($xeSplit, splitMethods, splitPrivateMethods);
@@ -45532,12 +45615,6 @@ const Select = VxeSelect;
45532
45615
  isExpand,
45533
45616
  showAction
45534
45617
  } = item;
45535
- const btnOns = {};
45536
- if (actionOpts.trigger === 'dblclick') {
45537
- btnOns.onDblclick = handleItemActionEvent;
45538
- } else {
45539
- btnOns.onClick = handleItemActionEvent;
45540
- }
45541
45618
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
45542
45619
  itemid: id,
45543
45620
  class: ['vxe-split-item-handle', isFoldNext ? 'to--next' : 'to--prev']
@@ -45547,7 +45624,8 @@ const Select = VxeSelect;
45547
45624
  onMousedown: dragEvent
45548
45625
  }), showAction ? (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('span', {
45549
45626
  class: 'vxe-split-item-action-btn',
45550
- ...btnOns
45627
+ onDblclick: handleActionDblclickEvent,
45628
+ onClick: handleActionClickEvent
45551
45629
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('i', {
45552
45630
  class: (isExpand ? actionOpts.openIcon : actionOpts.closeIcon) || getDefaultActionIcon(item)
45553
45631
  })]) : renderEmptyElement($xeSplit)]);
@@ -45559,13 +45637,14 @@ const Select = VxeSelect;
45559
45637
  vertical
45560
45638
  } = props;
45561
45639
  const {
45562
- staticItems
45640
+ itemList
45563
45641
  } = reactData;
45564
45642
  const isFoldNext = computeIsFoldNext.value;
45565
45643
  const itemVNs = [];
45566
- staticItems.forEach((item, index) => {
45644
+ itemList.forEach((item, index) => {
45567
45645
  const {
45568
45646
  id,
45647
+ name,
45569
45648
  slots,
45570
45649
  renderHeight,
45571
45650
  resizeHeight,
@@ -45607,7 +45686,11 @@ const Select = VxeSelect;
45607
45686
  class: 'vxe-split-item--wrapper'
45608
45687
  }, [(0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
45609
45688
  class: 'vxe-split-item--inner'
45610
- }, defaultSlot ? callSlot(defaultSlot, {}) : [])]), isFoldNext && index < staticItems.length - 1 ? renderHandleBar(item) : renderEmptyElement($xeSplit)]));
45689
+ }, defaultSlot ? callSlot(defaultSlot, {
45690
+ name,
45691
+ isVisible,
45692
+ isExpand
45693
+ }) : [])]), isFoldNext && index < itemList.length - 1 ? renderHandleBar(item) : renderEmptyElement($xeSplit)]));
45611
45694
  });
45612
45695
  return (0,external_commonjs_vue_commonjs2_vue_root_Vue_.h)('div', {
45613
45696
  class: 'vxe-split-wrapper'
@@ -45635,7 +45718,21 @@ const Select = VxeSelect;
45635
45718
  class: 'vxe-split-slots'
45636
45719
  }, defaultSlot ? defaultSlot({}) : []), renderItems()]);
45637
45720
  };
45638
- (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => reactData.staticItems, () => {
45721
+ const itemFlag = (0,external_commonjs_vue_commonjs2_vue_root_Vue_.ref)(0);
45722
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.items ? props.items.length : -1, () => {
45723
+ itemFlag.value++;
45724
+ });
45725
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => props.items, () => {
45726
+ itemFlag.value++;
45727
+ });
45728
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(itemFlag, () => {
45729
+ loadItem(props.items || []);
45730
+ });
45731
+ (0,external_commonjs_vue_commonjs2_vue_root_Vue_.watch)(() => reactData.staticItems, val => {
45732
+ if (props.items && props.items.length) {
45733
+ errLog('vxe.error.errConflicts', ['<vxe-split-item ...>', 'items']);
45734
+ }
45735
+ reactData.itemList = val;
45639
45736
  recalculate();
45640
45737
  });
45641
45738
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onMounted)(() => {
@@ -45650,6 +45747,9 @@ const Select = VxeSelect;
45650
45747
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.onActivated)(() => {
45651
45748
  recalculate();
45652
45749
  });
45750
+ if (props.items) {
45751
+ loadItem(props.items);
45752
+ }
45653
45753
  (0,external_commonjs_vue_commonjs2_vue_root_Vue_.provide)('$xeSplit', $xeSplit);
45654
45754
  $xeSplit.renderVN = renderVN;
45655
45755
  return $xeSplit;