@yugu-ui/flow-ui 0.1.25 → 0.1.26

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.js CHANGED
@@ -1,4 +1,4 @@
1
- import { NAvatar, NButton, NCard, NCheckbox, NCheckboxGroup, NCollapse, NCollapseItem, NDrawer, NDrawerContent, NEllipsis, NEmpty, NForm, NFormItem, NImage, NInput, NInputGroup, NInputGroupLabel, NInputNumber, NModal, NPopover, NRadio, NRadioButton, NRadioGroup, NSelect, NSpace, NSpin, NSwitch, NTab, NTabs, NTag, NTooltip, useThemeVars } from "naive-ui";
1
+ import { NAvatar, NButton, NCard, NCheckbox, NCheckboxGroup, NCollapse, NCollapseItem, NDrawer, NDrawerContent, NDropdown, NEllipsis, NEmpty, NForm, NFormItem, NImage, NInput, NInputGroup, NInputGroupLabel, NInputNumber, NModal, NPopover, NRadio, NRadioButton, NRadioGroup, NSelect, NSpace, NSpin, NSwitch, NTab, NTabs, NTag, NTooltip, useThemeVars } from "naive-ui";
2
2
  import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createSlots, createTextVNode, createVNode, defineComponent, guardReactiveProps, h, inject, markRaw, mergeModels, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, provide, reactive, ref, renderList, renderSlot, resolveDynamicComponent, shallowRef, toDisplayString, toRef, unref, useModel, useSlots, vModelText, vShow, watch, withCtx, withDirectives, withModifiers } from "vue";
3
3
  import { Graph } from "@antv/x6";
4
4
  import { VueShapeView, getTeleport, register } from "@antv/x6-vue-shape";
@@ -6674,6 +6674,38 @@ var FlowListItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6674
6674
  setup(__props, { emit: __emit }) {
6675
6675
  const props = __props;
6676
6676
  const emit = __emit;
6677
+ /** 卡片操作项 */
6678
+ const cardActions = computed(() => {
6679
+ const actions = [];
6680
+ if (props.showEdit) actions.push({
6681
+ key: "edit",
6682
+ label: "编辑"
6683
+ });
6684
+ if (props.showDelete) actions.push({
6685
+ key: "delete",
6686
+ label: "删除"
6687
+ });
6688
+ actions.push({
6689
+ key: "design",
6690
+ label: "配置"
6691
+ });
6692
+ return actions;
6693
+ });
6694
+ /** 唯一启用的操作(仅 1 个时直接展示按钮,不收下拉) */
6695
+ const soloAction = computed(() => cardActions.value.length === 1 ? cardActions.value[0] : void 0);
6696
+ const themeVars = useThemeVars();
6697
+ /** 「···」下拉选项(删除项用主题 error 色警示) */
6698
+ const dropdownOptions = computed(() => cardActions.value.map((action) => ({
6699
+ key: action.key,
6700
+ label: action.label,
6701
+ props: action.key === "delete" ? { style: { color: themeVars.value.errorColor } } : void 0
6702
+ })));
6703
+ /** 操作分发(编辑=卡片点击同链路,删除/配置各自上报,确认与接口由使用方处理) */
6704
+ function handleActionSelect(key) {
6705
+ if (key === "edit") emit("itemClick", props.item);
6706
+ else if (key === "delete") emit("delete", props.item);
6707
+ else emit("design", props.item);
6708
+ }
6677
6709
  /** 图标加载失败标记 */
6678
6710
  const imgFailed = ref(false);
6679
6711
  watch(() => props.item.icon, () => {
@@ -6686,9 +6718,10 @@ var FlowListItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6686
6718
  return (_ctx, _cache) => {
6687
6719
  const _component_NAvatar = NAvatar;
6688
6720
  const _component_NButton = NButton;
6721
+ const _component_NDropdown = NDropdown;
6689
6722
  return openBlock(), createElementBlock("div", {
6690
6723
  class: normalizeClass(["flow-item", { "flow-item--clickable": __props.clickable }]),
6691
- onClick: _cache[4] || (_cache[4] = ($event) => __props.clickable && emit("itemClick", __props.item))
6724
+ onClick: _cache[3] || (_cache[3] = ($event) => __props.clickable && emit("itemClick", __props.item))
6692
6725
  }, [
6693
6726
  createVNode(_component_NAvatar, {
6694
6727
  class: "flow-item__avatar",
@@ -6706,44 +6739,65 @@ var FlowListItem_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/*
6706
6739
  class: "flow-item__label",
6707
6740
  title: __props.item.name
6708
6741
  }, toDisplayString(__props.item.name), 9, _hoisted_3$1),
6709
- __props.showActions ? (openBlock(), createElementBlock("div", _hoisted_4$1, [
6710
- __props.showEdit ? (openBlock(), createBlock(_component_NButton, {
6711
- key: 0,
6712
- class: "flow-item__btn",
6713
- size: "small",
6714
- quaternary: "",
6715
- type: "primary",
6716
- onClick: _cache[1] || (_cache[1] = ($event) => emit("itemClick", __props.item))
6717
- }, {
6718
- default: withCtx(() => [..._cache[5] || (_cache[5] = [createTextVNode(" 编辑 ", -1)])]),
6719
- _: 1
6720
- })) : createCommentVNode("", true),
6721
- __props.showDelete ? (openBlock(), createBlock(_component_NButton, {
6722
- key: 1,
6723
- class: "flow-item__btn",
6742
+ __props.showActions ? (openBlock(), createElementBlock("div", _hoisted_4$1, [soloAction.value ? (openBlock(), createBlock(_component_NButton, {
6743
+ key: 0,
6744
+ class: "flow-item__btn",
6745
+ size: "small",
6746
+ type: soloAction.value.key === "delete" ? "error" : "primary",
6747
+ quaternary: soloAction.value.key !== "design",
6748
+ secondary: soloAction.value.key === "design",
6749
+ onClick: _cache[1] || (_cache[1] = ($event) => handleActionSelect(soloAction.value.key))
6750
+ }, {
6751
+ default: withCtx(() => [createTextVNode(toDisplayString(soloAction.value.label), 1)]),
6752
+ _: 1
6753
+ }, 8, [
6754
+ "type",
6755
+ "quaternary",
6756
+ "secondary"
6757
+ ])) : (openBlock(), createBlock(_component_NDropdown, {
6758
+ key: 1,
6759
+ trigger: "click",
6760
+ options: dropdownOptions.value,
6761
+ onSelect: handleActionSelect
6762
+ }, {
6763
+ default: withCtx(() => [createVNode(_component_NButton, {
6764
+ class: "flow-item__btn flow-item__more",
6724
6765
  size: "small",
6725
6766
  quaternary: "",
6726
- type: "error",
6727
- onClick: _cache[2] || (_cache[2] = ($event) => emit("delete", __props.item))
6767
+ onClick: _cache[2] || (_cache[2] = withModifiers(() => {}, ["stop"]))
6728
6768
  }, {
6729
- default: withCtx(() => [..._cache[6] || (_cache[6] = [createTextVNode(" 删除 ", -1)])]),
6730
- _: 1
6731
- })) : createCommentVNode("", true),
6732
- createVNode(_component_NButton, {
6733
- class: "flow-item__btn",
6734
- size: "small",
6735
- secondary: "",
6736
- type: "primary",
6737
- onClick: _cache[3] || (_cache[3] = ($event) => emit("design", __props.item))
6738
- }, {
6739
- default: withCtx(() => [..._cache[7] || (_cache[7] = [createTextVNode("配置", -1)])]),
6769
+ default: withCtx(() => [..._cache[4] || (_cache[4] = [createElementVNode("svg", {
6770
+ "aria-hidden": "true",
6771
+ viewBox: "0 0 16 16",
6772
+ class: "flow-item__more-icon"
6773
+ }, [
6774
+ createElementVNode("circle", {
6775
+ cx: "3",
6776
+ cy: "8",
6777
+ r: "1.6",
6778
+ fill: "currentColor"
6779
+ }),
6780
+ createElementVNode("circle", {
6781
+ cx: "8",
6782
+ cy: "8",
6783
+ r: "1.6",
6784
+ fill: "currentColor"
6785
+ }),
6786
+ createElementVNode("circle", {
6787
+ cx: "13",
6788
+ cy: "8",
6789
+ r: "1.6",
6790
+ fill: "currentColor"
6791
+ })
6792
+ ], -1)])]),
6740
6793
  _: 1
6741
- })
6742
- ])) : createCommentVNode("", true)
6794
+ })]),
6795
+ _: 1
6796
+ }, 8, ["options"]))])) : createCommentVNode("", true)
6743
6797
  ], 2);
6744
6798
  };
6745
6799
  }
6746
- }), [["__scopeId", "data-v-0c9de524"]]);
6800
+ }), [["__scopeId", "data-v-c6d34e6e"]]);
6747
6801
  //#endregion
6748
6802
  //#region src/flow-list/modules/FlowListGroup.vue?vue&type=script&setup=true&lang.ts
6749
6803
  var _hoisted_1 = { class: "flow-group" };
package/dist/style.css CHANGED
@@ -2302,7 +2302,7 @@ to {
2302
2302
  width: 100%;
2303
2303
  }
2304
2304
 
2305
- .flow-item[data-v-0c9de524] {
2305
+ .flow-item[data-v-c6d34e6e] {
2306
2306
  display: flex;
2307
2307
  align-items: center;
2308
2308
  gap: 12px;
@@ -2316,32 +2316,32 @@ to {
2316
2316
  user-select: none;
2317
2317
  transition: transform 0.2s ease, box-shadow 0.2s ease;
2318
2318
  }
2319
- .flow-item[data-v-0c9de524]:hover {
2319
+ .flow-item[data-v-c6d34e6e]:hover {
2320
2320
  transform: translateY(-2px);
2321
2321
  /* Developed collaboratively with vscode - 改动代码行数: 1行(阴影色改用全局文本色变量) */
2322
2322
  box-shadow: rgb(var(--base-text-color)/0.25) 0 12px 28px;
2323
2323
  }
2324
- .flow-item[data-v-0c9de524]:active {
2324
+ .flow-item[data-v-c6d34e6e]:active {
2325
2325
  transform: translateY(0);
2326
2326
  /* Developed collaboratively with vscode - 改动代码行数: 1行(阴影色改用全局文本色变量) */
2327
2327
  box-shadow: rgb(var(--base-text-color)/0.15) 0 4px 12px;
2328
2328
  transition-duration: 0.08s;
2329
2329
  }
2330
- .flow-item[data-v-0c9de524] {
2330
+ .flow-item[data-v-c6d34e6e] {
2331
2331
  /* Developed collaboratively with vscode - 改动代码行数: 1行(clickable 卡片:pointer 光标明示可点击,hover 上浮动效沿用通用样式) */
2332
2332
  }
2333
- .flow-item--clickable[data-v-0c9de524] {
2333
+ .flow-item--clickable[data-v-c6d34e6e] {
2334
2334
  cursor: pointer;
2335
2335
  }
2336
- .flow-item__avatar[data-v-0c9de524] {
2336
+ .flow-item__avatar[data-v-c6d34e6e] {
2337
2337
  flex-shrink: 0;
2338
2338
  }
2339
- .flow-item__avatar-text[data-v-0c9de524] {
2339
+ .flow-item__avatar-text[data-v-c6d34e6e] {
2340
2340
  font-size: 15px;
2341
2341
  font-weight: 600;
2342
2342
  color: var(--fl-primary);
2343
2343
  }
2344
- .flow-item__label[data-v-0c9de524] {
2344
+ .flow-item__label[data-v-c6d34e6e] {
2345
2345
  display: -webkit-box;
2346
2346
  flex-grow: 1;
2347
2347
  /* Developed collaboratively with vscode - 改动代码行数: 3行(中英混排按字符接排换行:不整体掉词填满行宽,防止收缩被内容撑破) */
@@ -2355,11 +2355,22 @@ to {
2355
2355
  -webkit-box-orient: vertical;
2356
2356
  -webkit-line-clamp: 2;
2357
2357
  }
2358
- .flow-item__actions[data-v-0c9de524] {
2358
+ .flow-item__actions[data-v-c6d34e6e] {
2359
2359
  display: flex;
2360
2360
  flex-shrink: 0;
2361
2361
  gap: 6px;
2362
2362
  }
2363
+ .flow-item[data-v-c6d34e6e] {
2364
+ /* Developed collaboratively with vscode - 新增9行(「···」更多按钮:收窄内边距成紧凑方钮,三点图标居中) */
2365
+ }
2366
+ .flow-item__more[data-v-c6d34e6e] {
2367
+ padding: 0 8px;
2368
+ }
2369
+ .flow-item__more-icon[data-v-c6d34e6e] {
2370
+ display: block;
2371
+ width: 16px;
2372
+ height: 16px;
2373
+ }
2363
2374
  .flow-group[data-v-0587937e] {
2364
2375
  padding: 0 20px;
2365
2376
  background: var(--fl-card-color);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yugu-ui/flow-ui",
3
- "version": "0.1.25",
3
+ "version": "0.1.26",
4
4
  "description": "堉古商城流程组件库:流程设计器(config)/ 审批时间线(timeline)/ 流程列表(FlowList)",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",