bkui-vue 0.0.1-beta.92 → 0.0.1-beta.95

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.
package/dist/index.esm.js CHANGED
@@ -9078,9 +9078,10 @@ var Component$w = defineComponent({
9078
9078
  var _a2;
9079
9079
  isFocused.value = false;
9080
9080
  ctx.emit(EVENTS$2.BLUR, e);
9081
- if (isNumberInput.value && e.target.value > props.max) {
9082
- ctx.emit(EVENTS$2.UPDATE, props.max);
9083
- ctx.emit(EVENTS$2.CHANGE, props.max);
9081
+ if (isNumberInput.value && (e.target.value > props.max || e.target.value < props.min)) {
9082
+ const val = e.target.value > props.max ? props.max : props.min;
9083
+ ctx.emit(EVENTS$2.UPDATE, val);
9084
+ ctx.emit(EVENTS$2.CHANGE, val);
9084
9085
  }
9085
9086
  (_a2 = formItem == null ? void 0 : formItem.validate) == null ? void 0 : _a2.call(formItem, "blur");
9086
9087
  }
@@ -12533,6 +12534,9 @@ var Component$f = defineComponent({
12533
12534
  });
12534
12535
  defaultSteps.value.splice(0, defaultSteps.value.length, ...defaults);
12535
12536
  };
12537
+ const updateCurStep = (curStep) => {
12538
+ stepsProps.curStep = curStep;
12539
+ };
12536
12540
  const init = () => {
12537
12541
  var _a;
12538
12542
  defaultSteps.value.splice(0, defaultSteps.value.length, ...[{
@@ -12566,6 +12570,16 @@ var Component$f = defineComponent({
12566
12570
  }
12567
12571
  };
12568
12572
  onMounted(init);
12573
+ watch(() => props.steps, () => {
12574
+ updateSteps(props.steps);
12575
+ }, {
12576
+ deep: true
12577
+ });
12578
+ watch(() => props.curStep, () => {
12579
+ updateCurStep(props.curStep);
12580
+ }, {
12581
+ deep: true
12582
+ });
12569
12583
  return {
12570
12584
  defaultSteps,
12571
12585
  jumpTo
@@ -12591,7 +12605,12 @@ var Component$f = defineComponent({
12591
12605
  }
12592
12606
  return typeof step === "string";
12593
12607
  };
12594
- const isIcon = (index, step) => step.icon ? step.icon : index + 1;
12608
+ const isNumberIcon = (index, step) => {
12609
+ if (!step.icon) {
12610
+ step.icon = index;
12611
+ }
12612
+ return !isNaN(step.icon);
12613
+ };
12595
12614
  const isLoadingStatus = (step) => step.status === "loading";
12596
12615
  const isErrorStatus = (step) => step.status === "error";
12597
12616
  const renderIcon = (index, step) => {
@@ -12610,7 +12629,7 @@ var Component$f = defineComponent({
12610
12629
  "class": "bk-steps-icon"
12611
12630
  }, null);
12612
12631
  }
12613
- return createVNode("span", null, [isIcon(index, step)]);
12632
+ return createVNode("span", null, [isNumberIcon(index, step) ? index + 1 : createVNode(step.icon, null, null)]);
12614
12633
  };
12615
12634
  return createVNode("div", {
12616
12635
  "class": stepsCls
@@ -12619,7 +12638,7 @@ var Component$f = defineComponent({
12619
12638
  return createVNode("div", {
12620
12639
  "class": ["bk-step", !step.title ? "bk-step-no-content" : "", isDone(index) ? "done" : "", isCurrent(index) ? "current" : "", isCurrent(index) && this.status === "error" ? "isError" : "", step.status && isCurrent(index) ? [`bk-step-${step.status}`] : ""]
12621
12640
  }, [createVNode("span", {
12622
- "class": ["bk-step-indicator", `bk-step-${iconType(step) ? "icon" : "number"}`],
12641
+ "class": ["bk-step-indicator", `bk-step-${iconType(step) ? "icon" : "number"}`, `bk-step-icon${step.status}`],
12623
12642
  "style": {
12624
12643
  cursor: this.controllable ? "pointer" : ""
12625
12644
  },
@@ -13255,7 +13274,7 @@ const tableProps = {
13255
13274
  rowKey: PropTypes.oneOfType([
13256
13275
  PropTypes.string,
13257
13276
  PropTypes.func
13258
- ]).def(void 0)
13277
+ ]).def(TABLE_ROW_ATTRIBUTE.ROW_INDEX)
13259
13278
  };
13260
13279
  function _isSlot$2(s2) {
13261
13280
  return typeof s2 === "function" || Object.prototype.toString.call(s2) === "[object Object]" && !isVNode(s2);
@@ -14001,7 +14020,7 @@ const resolveHeadConfig = (props) => {
14001
14020
  };
14002
14021
  const getRowText = (row, key, column) => {
14003
14022
  if (column.type === "index") {
14004
- return row[TABLE_ROW_ATTRIBUTE.ROW_INDEX];
14023
+ return row[TABLE_ROW_ATTRIBUTE.ROW_INDEX] + 1;
14005
14024
  }
14006
14025
  return row[key];
14007
14026
  };
@@ -14017,8 +14036,11 @@ const formatPropAsArray = (prop, args) => {
14017
14036
  }
14018
14037
  return [];
14019
14038
  };
14020
- const getRowKey = (item, props) => {
14039
+ const getRowKey = (item, props, index) => {
14021
14040
  if (typeof props.rowKey === "string") {
14041
+ if (props.rowKey === TABLE_ROW_ATTRIBUTE.ROW_INDEX) {
14042
+ return `__ROW_INDEX_${index}`;
14043
+ }
14022
14044
  const keys = props.rowKey.split(".");
14023
14045
  return keys.reduce((pre, cur) => {
14024
14046
  if (Object.prototype.hasOwnProperty.call(pre, cur)) {
@@ -14684,7 +14706,9 @@ class TableRender {
14684
14706
  cell: true,
14685
14707
  "expand-cell": column.type === "expand"
14686
14708
  };
14709
+ const cellKey = `__CELL_${rowIndex}_${index}`;
14687
14710
  return createVNode("td", {
14711
+ "key": cellKey,
14688
14712
  "class": cellClass,
14689
14713
  "style": cellStyle,
14690
14714
  "colspan": 1,
@@ -14752,7 +14776,7 @@ class TableRender {
14752
14776
  }
14753
14777
  const cell = getRowText(row, resolvePropVal(column, "field", [column, row]), column);
14754
14778
  if (typeof column.render === "function") {
14755
- return column.render(cell, row, index, rows);
14779
+ return column.render(cell, this.props.data[row[TABLE_ROW_ATTRIBUTE.ROW_INDEX]], row, column, index, rows);
14756
14780
  }
14757
14781
  return cell;
14758
14782
  }
@@ -15066,9 +15090,9 @@ const useInit = (props) => {
15066
15090
  const indexData = reactive([]);
15067
15091
  const initIndexData = (keepLocalAction = false) => {
15068
15092
  indexData.splice(0, indexData.length, ...props.data.map((item, index) => {
15069
- const rowId = getRowKey(item, props);
15093
+ const rowId = getRowKey(item, props, index);
15070
15094
  return __spreadProps(__spreadValues({}, item), {
15071
- [TABLE_ROW_ATTRIBUTE.ROW_INDEX]: index + 1,
15095
+ [TABLE_ROW_ATTRIBUTE.ROW_INDEX]: index,
15072
15096
  [TABLE_ROW_ATTRIBUTE.ROW_UID]: rowId,
15073
15097
  [TABLE_ROW_ATTRIBUTE.ROW_EXPAND]: keepLocalAction ? isRowExpand(rowId) : false
15074
15098
  });
@@ -22027,7 +22051,7 @@ var useNodeAsync = (props, flatData) => {
22027
22051
  };
22028
22052
  };
22029
22053
  var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption) => {
22030
- let selectedNodeId = null;
22054
+ let selectedNodeId = props.selected;
22031
22055
  const {
22032
22056
  setNodeAttr,
22033
22057
  getNodePath,
@@ -22126,7 +22150,7 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
22126
22150
  setNodeAttr(item, NODE_ATTRIBUTES.IS_OPEN, newVal);
22127
22151
  if (fireEmit) {
22128
22152
  const emitEvent = isItemOpen(item) ? EVENTS.NODE_EXPAND : EVENTS.NODE_COLLAPSE;
22129
- ctx.emit(emitEvent, [item, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e]);
22153
+ ctx.emit(emitEvent, item, resolveScopedSlotParam(item), getSchemaVal2(item[NODE_ATTRIBUTES.UUID]), e);
22130
22154
  }
22131
22155
  };
22132
22156
  const setNodeAction = (args, action, value) => {
@@ -22143,7 +22167,7 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
22143
22167
  }
22144
22168
  if (autoOpenParents) {
22145
22169
  if (isOpen) {
22146
- setNodeAction(resolvedItem, NODE_ATTRIBUTES.IS_OPEN, isOpen);
22170
+ setNodeAction(resolvedItem, NODE_ATTRIBUTES.IS_OPEN, true);
22147
22171
  if (!isRootNode(resolvedItem)) {
22148
22172
  const parentId = getNodeAttr2(resolvedItem, NODE_ATTRIBUTES.PARENT_ID);
22149
22173
  setOpen(parentId, true, true);
@@ -22165,10 +22189,10 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
22165
22189
  if (getNodeAttr2(item, NODE_ATTRIBUTES.IS_LOADING)) {
22166
22190
  registerNextLoop("setNodeOpenedAfterLoading", {
22167
22191
  type: "once",
22168
- fn: () => setNodeOpened(item, !isOpen, e)
22192
+ fn: () => setNodeOpened(item, true, e)
22169
22193
  });
22170
22194
  } else {
22171
- setNodeOpened(item, !isOpen, e);
22195
+ setNodeOpened(item, true, e);
22172
22196
  }
22173
22197
  });
22174
22198
  };
@@ -22193,6 +22217,11 @@ var useNodeAction = (props, ctx, flatData, renderData, schemaValues, initOption)
22193
22217
  [NODE_ATTRIBUTES.UUID]: selectedNodeId
22194
22218
  }, NODE_ATTRIBUTES.IS_SELECTED, !selected);
22195
22219
  }
22220
+ if (props.selected && props.selected !== selectedNodeId) {
22221
+ setNodeAttr({
22222
+ [NODE_ATTRIBUTES.UUID]: props.selected
22223
+ }, NODE_ATTRIBUTES.IS_SELECTED, !selected);
22224
+ }
22196
22225
  setNodeAttr(resolvedItem, NODE_ATTRIBUTES.IS_SELECTED, selected);
22197
22226
  selectedNodeId = getNodeId(resolvedItem);
22198
22227
  if (autoOpen && nodeList2.length === 1) {
@@ -22521,8 +22550,8 @@ var useTreeInit = (props) => {
22521
22550
  flatten(item, depth, parent, path);
22522
22551
  } else {
22523
22552
  if (typeof item === "object" && item !== null) {
22524
- const uuid2 = `${getUid(item)}`;
22525
22553
  const currentPath = path !== null ? `${path}-${i}` : `${i}`;
22554
+ const uuid2 = `${getUid(item)}`;
22526
22555
  const hasChildren = !!(item[children] || []).length;
22527
22556
  let isOpened = getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_OPEN);
22528
22557
  if (props2.autoOpenParentNode) {
@@ -22530,7 +22559,10 @@ var useTreeInit = (props) => {
22530
22559
  } else {
22531
22560
  isOpened = isNodeOpend(uuid2, item, parent);
22532
22561
  }
22533
- const attrs = {
22562
+ Object.assign(item, {
22563
+ [NODE_ATTRIBUTES.UUID]: uuid2
22564
+ });
22565
+ schema.set(uuid2, {
22534
22566
  [NODE_ATTRIBUTES.DEPTH]: depth,
22535
22567
  [NODE_ATTRIBUTES.INDEX]: i,
22536
22568
  [NODE_ATTRIBUTES.UUID]: uuid2,
@@ -22547,13 +22579,10 @@ var useTreeInit = (props) => {
22547
22579
  [NODE_ATTRIBUTES.IS_ASYNC]: getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_ASYNC),
22548
22580
  [NODE_ATTRIBUTES.IS_LOADING]: getCachedTreeNodeAttr(uuid2, item, NODE_ATTRIBUTES.IS_LOADING),
22549
22581
  [children]: null
22550
- };
22551
- Object.assign(item, {
22552
- [NODE_ATTRIBUTES.UUID]: uuid2
22553
22582
  });
22554
- schema.set(uuid2, attrs);
22555
22583
  order2 += 1;
22556
- outputData.push(__spreadProps(__spreadValues({}, item), {
22584
+ outputData.push(__spreadProps(__spreadValues({}, JSON.parse(JSON.stringify(item, (k2, v2) => k2 === props2.children ? null : v2))), {
22585
+ [NODE_ATTRIBUTES.IS_OPEN]: isOpened,
22557
22586
  [children]: null
22558
22587
  }));
22559
22588
  if (Object.prototype.hasOwnProperty.call(item, children)) {
@@ -22637,7 +22666,6 @@ var useTreeInit = (props) => {
22637
22666
  };
22638
22667
  watch(() => [props.data], (newData) => {
22639
22668
  var _a2, _b;
22640
- console.log("watch data changed");
22641
22669
  const formatData2 = getFlatdata(props, newData, schemaValues.value);
22642
22670
  flatData.data = formatData2[0];
22643
22671
  flatData.schema = formatData2[1];
@@ -22650,7 +22678,6 @@ var useTreeInit = (props) => {
22650
22678
  });
22651
22679
  if (props.selectable) {
22652
22680
  watch(() => props.selected, (newData) => {
22653
- console.log("watch selected changed");
22654
22681
  afterSelectWatch.length = 0;
22655
22682
  afterSelectEvents.forEach((event) => {
22656
22683
  Reflect.apply(event, globalThis, [newData]);
@@ -22741,7 +22768,7 @@ var Component$5 = defineComponent({
22741
22768
  setNodeAction(resolveNodeItem(item), NODE_ATTRIBUTES.IS_CHECKED, checked);
22742
22769
  };
22743
22770
  onSelected((newData) => {
22744
- setSelect(newData, true, true);
22771
+ setSelect(newData, true, props.autoOpenParentNode);
22745
22772
  });
22746
22773
  const getData = () => flatData;
22747
22774
  ctx.expose({
@@ -24686,7 +24713,6 @@ var Component$1 = defineComponent({
24686
24713
  }) {
24687
24714
  const defaultTimelines = ref([]);
24688
24715
  const updateTimelines = (timelines) => {
24689
- console.log("timelines", timelines);
24690
24716
  const defaults = [];
24691
24717
  timelines.forEach((timeline2) => {
24692
24718
  var _a;
@@ -24727,6 +24753,11 @@ var Component$1 = defineComponent({
24727
24753
  }
24728
24754
  };
24729
24755
  onMounted(init);
24756
+ watch(() => props.list, () => {
24757
+ updateTimelines(props.list);
24758
+ }, {
24759
+ deep: true
24760
+ });
24730
24761
  return {
24731
24762
  defaultTimelines,
24732
24763
  titleSelect