@yugu-ui/flow-ui 0.1.22 → 0.1.23

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
@@ -6020,15 +6020,15 @@ function formatTime(value, format = "YYYY-MM-DD HH:mm:ss") {
6020
6020
  var FLOW_STATUS_MAP = {
6021
6021
  [-1]: {
6022
6022
  label: "已驳回",
6023
- type: "error"
6023
+ type: "rejected"
6024
6024
  },
6025
6025
  0: {
6026
6026
  label: "已撤销",
6027
- type: "default"
6027
+ type: "cancelled"
6028
6028
  },
6029
6029
  1: {
6030
6030
  label: "审批中",
6031
- type: "warning"
6031
+ type: "processing"
6032
6032
  },
6033
6033
  2: {
6034
6034
  label: "已通过",
@@ -6191,6 +6191,14 @@ var FlowNodesPanel_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
6191
6191
  if (props.mode === "form") return withEndNode(props.nodes ?? [], "form");
6192
6192
  return withEndNode(props.data ? mapTimelineNodes(props.data) : props.nodes ?? [], "display");
6193
6193
  });
6194
+ /** 语义状态 → NTag 配色(仅组件内部渲染适配,业务侧统一用 StatusTag 等宿主状态标签组件) */
6195
+ const N_TAG_TYPE_MAP = {
6196
+ pending: "warning",
6197
+ processing: "info",
6198
+ success: "success",
6199
+ cancelled: "default",
6200
+ rejected: "error"
6201
+ };
6194
6202
  /** 折叠面板标题流程状态标签 */
6195
6203
  const panelStatusTag = computed(() => props.data ? getFlowStatusTag(props.mode, props.data) : props.statusTag);
6196
6204
  return (_ctx, _cache) => {
@@ -6208,7 +6216,7 @@ var FlowNodesPanel_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
6208
6216
  default: withCtx(() => [createVNode(_component_NCollapseItem, { name: "flow" }, {
6209
6217
  header: withCtx(() => [createElementVNode("span", _hoisted_1$3, [createTextVNode(toDisplayString(__props.title) + " ", 1), panelStatusTag.value ? (openBlock(), createBlock(_component_NTag, {
6210
6218
  key: 0,
6211
- type: panelStatusTag.value.type,
6219
+ type: N_TAG_TYPE_MAP[panelStatusTag.value.type],
6212
6220
  size: "small"
6213
6221
  }, {
6214
6222
  default: withCtx(() => [createTextVNode(toDisplayString(panelStatusTag.value.text), 1)]),
@@ -6245,7 +6253,7 @@ var FlowNodesPanel_default = /* @__PURE__ */ _plugin_vue_export_helper_default(/
6245
6253
  });
6246
6254
  };
6247
6255
  }
6248
- }), [["__scopeId", "data-v-25e5146e"]]);
6256
+ }), [["__scopeId", "data-v-45c00590"]]);
6249
6257
  //#endregion
6250
6258
  //#region src/composables/form.ts
6251
6259
  var invalidLiterals = [
package/dist/style.css CHANGED
@@ -2262,39 +2262,39 @@ to {
2262
2262
  }
2263
2263
 
2264
2264
  /* Developed collaboratively with vscode - 改动代码行数: 31行(折叠面板样式自 FlowLayout.vue 迁入:单个折叠项间距/标题行布局/标题字号与底边框/内容区留白) */
2265
- .flow-node[data-v-25e5146e] {
2265
+ .flow-node[data-v-45c00590] {
2266
2266
  /* 单个折叠项:去掉默认上外边距,上下间距统一由 header 内边距控制 */
2267
2267
  }
2268
- .flow-node[data-v-25e5146e] .n-collapse-item {
2268
+ .flow-node[data-v-45c00590] .n-collapse-item {
2269
2269
  margin: 0;
2270
2270
  }
2271
- .flow-node[data-v-25e5146e] {
2271
+ .flow-node[data-v-45c00590] {
2272
2272
  /* 标题行:文字左对齐、箭头右对齐;左右留白放在 header-main 上,保证 header 底边框顶满两侧 */
2273
2273
  }
2274
- .flow-node[data-v-25e5146e] .n-collapse-item__header-main {
2274
+ .flow-node[data-v-45c00590] .n-collapse-item__header-main {
2275
2275
  justify-content: space-between;
2276
2276
  padding: 0 16px;
2277
2277
  }
2278
- .flow-node[data-v-25e5146e] {
2278
+ .flow-node[data-v-45c00590] {
2279
2279
  /* 标题插槽包装:标题文案与状态标签横向排列、垂直居中;自身为 header-main 单一 flex 项,不参与 space-between 分离 */
2280
2280
  }
2281
- .flow-node .flow-node__title[data-v-25e5146e] {
2281
+ .flow-node .flow-node__title[data-v-45c00590] {
2282
2282
  display: inline-flex;
2283
2283
  align-items: center;
2284
2284
  gap: 8px;
2285
2285
  }
2286
- .flow-node[data-v-25e5146e] {
2286
+ .flow-node[data-v-45c00590] {
2287
2287
  /* 标题字号增大,上下等距内边距 + 底部分隔边框;用 first-child 提高优先级,覆盖 naive-ui 对首个折叠项 header 强制的 padding-top: 0 */
2288
2288
  }
2289
- .flow-node[data-v-25e5146e] .n-collapse-item:first-child > .n-collapse-item__header {
2289
+ .flow-node[data-v-45c00590] .n-collapse-item:first-child > .n-collapse-item__header {
2290
2290
  padding: 16px 0;
2291
2291
  font-size: 16px;
2292
2292
  border-bottom: 1px solid var(--n-divider-color, rgba(0, 0, 0, 0.09));
2293
2293
  }
2294
- .flow-node[data-v-25e5146e] {
2294
+ .flow-node[data-v-45c00590] {
2295
2295
  /* 内容区留白与标题行对齐 */
2296
2296
  }
2297
- .flow-node[data-v-25e5146e] .n-collapse-item__content-wrapper {
2297
+ .flow-node[data-v-45c00590] .n-collapse-item__content-wrapper {
2298
2298
  padding: 0 16px 16px;
2299
2299
  }
2300
2300
  /* Developed collaboratively with vscode - 改动代码行数: 3行 */
@@ -4,14 +4,14 @@ import { WflowTodoDetail, WflowTodoRecord } from '../adapter/wflow';
4
4
  export type FlowTimelineData = Pick<WflowTodoDetail, 'nodes' | 'finished' | 'status'>;
5
5
  /** FlowActions 审批操作数据:FlowTimelineData 基础上补充 undo_id(同意/驳回接口入参)与 undo_finished(操作按钮显隐)——待办详情接口整份数据可直接传入 */
6
6
  export type FlowApprovalData = FlowTimelineData & Pick<WflowTodoDetail, 'undo_id' | 'undo_finished'>;
7
- /** 流程状态标签颜色(对齐 NTag type) */
8
- export type FlowStatusType = 'success' | 'error' | 'warning' | 'default';
9
- /** 流程状态展示信息:文案 + 标签颜色 */
7
+ /** 流程状态语义类型(对齐全系统 UI「列表枚举值标签样式规范」的 5 类语义:待处理/进行中/成功/取消/拒绝) */
8
+ export type FlowStatusType = 'pending' | 'processing' | 'success' | 'cancelled' | 'rejected';
9
+ /** 流程状态展示信息:文案 + 语义类型(宿主状态标签组件按语义类型统一配色) */
10
10
  export interface FlowStatusInfo {
11
11
  label: string;
12
12
  type: FlowStatusType;
13
13
  }
14
- /** 流程状态标签(getFlowStatusTag 返回):颜色映射 已通过=success / 已驳回=error / 已撤销=default / 审批中=warning */
14
+ /** 流程状态标签(getFlowStatusTag 返回):颜色由语义类型决定,审批中=processing / 已通过=success / 已驳回=rejected / 已撤销=cancelled */
15
15
  export interface FlowStatusTag {
16
16
  text: string;
17
17
  type: FlowStatusType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@yugu-ui/flow-ui",
3
- "version": "0.1.22",
3
+ "version": "0.1.23",
4
4
  "description": "堉古商城流程组件库:流程设计器(config)/ 审批时间线(timeline)/ 流程列表(FlowList)",
5
5
  "type": "module",
6
6
  "license": "UNLICENSED",