@robot-admin/naive-ui-components 0.17.5 → 0.18.0
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/CHANGELOG.md +16 -0
- package/dist/C_AntV.css +10 -10
- package/dist/C_AntV.d.cts +2 -2
- package/dist/C_AntV.d.ts +2 -2
- package/dist/C_AntV2.cjs +1 -1
- package/dist/C_AntV2.js +1 -1
- package/dist/C_Date.cjs +1 -1
- package/dist/C_Date.css +5 -5
- package/dist/C_Date.d.cts +18 -2
- package/dist/C_Date.d.ts +18 -2
- package/dist/C_Date.js +1 -1
- package/dist/C_Date2.cjs +1 -1
- package/dist/C_Date2.js +1 -1
- package/dist/C_Draggable.css +53 -53
- package/dist/C_Draggable.d.cts +2 -2
- package/dist/C_Draggable.d.ts +2 -2
- package/dist/C_Draggable2.cjs +1 -1
- package/dist/C_Draggable2.js +1 -1
- package/dist/C_Editor.d.cts +1 -1
- package/dist/C_Editor.d.ts +1 -1
- package/dist/C_FormModal.d.cts +1 -1
- package/dist/C_FormModal.d.ts +1 -1
- package/dist/C_FormSearch.cjs +1 -1
- package/dist/C_FormSearch.css +52 -52
- package/dist/C_FormSearch.d.cts +18 -2
- package/dist/C_FormSearch.d.ts +18 -2
- package/dist/C_FormSearch.js +1 -1
- package/dist/C_FormSearch2.cjs +1 -1
- package/dist/C_FormSearch2.js +1 -1
- package/dist/C_Guide.d.cts +1 -1
- package/dist/C_Guide.d.ts +1 -1
- package/dist/C_Icon.d.cts +1 -1
- package/dist/C_Icon.d.ts +1 -1
- package/dist/C_Language.d.cts +1 -1
- package/dist/C_Language.d.ts +1 -1
- package/dist/C_Loading.d.cts +1 -1
- package/dist/C_Loading.d.ts +1 -1
- package/dist/C_Login.d.cts +1 -1
- package/dist/C_Login.d.ts +1 -1
- package/dist/C_Markdown.d.cts +1 -1
- package/dist/C_Markdown.d.ts +1 -1
- package/dist/C_Menu.d.ts +1 -1
- package/dist/C_OrgChart.d.cts +1 -1
- package/dist/C_OrgChart.d.ts +1 -1
- package/dist/C_Progress.d.cts +1 -1
- package/dist/C_Progress.d.ts +1 -1
- package/dist/C_Skeleton.d.cts +1 -1
- package/dist/C_Skeleton.d.ts +1 -1
- package/dist/C_Steps.d.cts +1 -1
- package/dist/C_Steps.d.ts +1 -1
- package/dist/C_Table.base.css +144 -155
- package/dist/C_Table.css +144 -155
- package/dist/C_Table.d.cts +2 -2
- package/dist/C_Table.d.ts +6 -6
- package/dist/C_TagsView.d.cts +1 -1
- package/dist/C_TagsView.d.ts +1 -1
- package/dist/C_Theme.d.cts +1 -1
- package/dist/C_Theme.d.ts +1 -1
- package/dist/C_Time.cjs +1 -1
- package/dist/C_Time.css +4 -4
- package/dist/C_Time.d.cts +18 -2
- package/dist/C_Time.d.ts +18 -2
- package/dist/C_Time.js +1 -1
- package/dist/C_Time2.cjs +1 -1
- package/dist/C_Time2.js +1 -1
- package/dist/C_Timeline.d.cts +1 -1
- package/dist/C_Timeline.d.ts +1 -1
- package/dist/C_Transfer.css +26 -26
- package/dist/C_Transfer.d.cts +2 -2
- package/dist/C_Transfer.d.ts +2 -2
- package/dist/C_Transfer2.cjs +1 -1
- package/dist/C_Transfer2.js +1 -1
- package/dist/C_Tree.css +23 -23
- package/dist/C_Tree.d.ts +4 -4
- package/dist/C_Tree2.cjs +1 -1
- package/dist/C_Tree2.js +1 -1
- package/dist/C_VtableGantt.cjs +1 -1
- package/dist/C_VtableGantt.css +31 -31
- package/dist/C_VtableGantt.d.cts +18 -2
- package/dist/C_VtableGantt.d.ts +18 -2
- package/dist/C_VtableGantt.js +1 -1
- package/dist/C_WorkFlow.css +150 -150
- package/dist/C_WorkFlow.d.cts +2 -2
- package/dist/C_WorkFlow.d.ts +2 -2
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/constants3.d.cts +2 -2
- package/dist/constants3.d.ts +2 -2
- package/dist/constants4.d.cts +5 -5
- package/dist/constants4.d.ts +5 -5
- package/dist/constants5.d.cts +2 -2
- package/dist/constants5.d.ts +2 -2
- package/dist/data.d.cts +9 -9
- package/dist/data.d.ts +9 -9
- package/dist/dateRange.d.cts +197 -0
- package/dist/dateRange.d.ts +197 -0
- package/dist/graphics.cjs +1 -0
- package/dist/graphics.d.cts +837 -0
- package/dist/graphics.d.ts +837 -0
- package/dist/graphics.js +1 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +47 -43
- package/dist/index.d.ts +47 -44
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +4 -4
- package/dist/index.vue.d.ts +4 -4
- package/dist/index10.vue.d.cts +3 -3
- package/dist/index10.vue.d.ts +54 -69
- package/dist/index11.vue.d.cts +54 -69
- package/dist/index11.vue.d.ts +52 -58
- package/dist/index12.vue.d.cts +52 -58
- package/dist/index12.vue.d.ts +124 -50
- package/dist/index13.vue.d.cts +124 -50
- package/dist/index13.vue.d.ts +51 -123
- package/dist/index14.vue.d.cts +51 -123
- package/dist/index14.vue.d.ts +26 -52
- package/dist/index15.vue.d.cts +26 -52
- package/dist/index15.vue.d.ts +12 -26
- package/dist/index16.vue.d.cts +12 -26
- package/dist/index16.vue.d.ts +129 -13
- package/dist/index17.vue.d.cts +129 -13
- package/dist/index17.vue.d.ts +76 -129
- package/dist/index18.vue.d.cts +76 -129
- package/dist/index18.vue.d.ts +65 -75
- package/dist/index19.vue.d.cts +97 -75
- package/dist/index19.vue.d.ts +94 -62
- package/dist/index20.vue.d.cts +40 -91
- package/dist/index20.vue.d.ts +40 -91
- package/dist/index21.vue.d.cts +89 -40
- package/dist/index21.vue.d.ts +89 -40
- package/dist/index22.vue.d.cts +37 -95
- package/dist/index22.vue.d.ts +37 -95
- package/dist/index23.vue.d.cts +8 -34
- package/dist/index23.vue.d.ts +8 -34
- package/dist/index24.vue.d.cts +86 -9
- package/dist/index24.vue.d.ts +86 -9
- package/dist/index25.vue.d.cts +99 -654
- package/dist/index25.vue.d.ts +99 -654
- package/dist/index26.vue.d.cts +66 -87
- package/dist/index26.vue.d.ts +66 -87
- package/dist/index3.vue.d.cts +5 -5
- package/dist/index3.vue.d.ts +5 -5
- package/dist/index4.vue.d.cts +3 -3
- package/dist/index6.vue.d.ts +1 -1
- package/dist/index7.vue.d.cts +1 -1
- package/dist/index8.vue.d.ts +2 -2
- package/dist/index9.vue.d.cts +2 -2
- package/dist/index9.vue.d.ts +3 -3
- package/dist/mapUtils.d.cts +1 -1
- package/dist/mapUtils.d.ts +1 -1
- package/dist/presets.d.cts +1 -1
- package/dist/presets.d.ts +1 -1
- package/dist/style.css +499 -510
- package/dist/types.d.ts +51 -0
- package/dist/types2.d.cts +51 -0
- package/dist/useCalendarEvents.d.cts +3 -3
- package/dist/useCalendarEvents.d.ts +3 -3
- package/dist/useCollapsePanel.d.cts +7 -7
- package/dist/useCollapsePanel.d.ts +7 -7
- package/dist/useCropperCore.d.cts +7 -7
- package/dist/useCropperCore.d.ts +7 -7
- package/dist/useDraggableLayout.d.cts +94 -125
- package/dist/useDraggableLayout.d.ts +94 -125
- package/dist/useDynamicFormState.d.cts +24 -11
- package/dist/useDynamicFormState.d.ts +24 -11
- package/dist/useEdgeInteraction.d.cts +10 -5
- package/dist/useEdgeInteraction.d.ts +10 -5
- package/dist/useFullscreen.d.cts +3 -3
- package/dist/useFullscreen.d.ts +3 -3
- package/dist/useQRCode.d.cts +5 -5
- package/dist/useQRCode.d.ts +5 -5
- package/dist/useSignatureHistory.d.cts +5 -5
- package/dist/useSignatureHistory.d.ts +5 -5
- package/dist/useSplitResize.d.cts +6 -6
- package/dist/useSplitResize.d.ts +6 -6
- package/dist/useTableQuery.cjs +2 -2
- package/dist/useTableQuery.d.cts +475 -463
- package/dist/useTableQuery.d.ts +475 -463
- package/dist/useTableQuery.js +2 -2
- package/dist/useTimeSelection.d.cts +19 -52
- package/dist/useTimeSelection.d.ts +19 -52
- package/dist/useWorkflowValidation.d.cts +533 -154
- package/dist/useWorkflowValidation.d.ts +533 -154
- package/docs/guides/usage.en.md +15 -0
- package/docs/guides/usage.md +15 -0
- package/package.json +1 -1
- package/dist/C_VtableGantt2.cjs +0 -1
- package/dist/C_VtableGantt2.js +0 -1
- package/dist/index27.vue.d.cts +0 -111
- package/dist/index27.vue.d.ts +0 -111
- package/dist/index28.vue.d.cts +0 -84
- package/dist/index28.vue.d.ts +0 -84
- package/dist/useSearchState.d.cts +0 -163
- package/dist/useSearchState.d.ts +0 -163
package/docs/guides/usage.en.md
CHANGED
|
@@ -654,3 +654,18 @@ loading.finish(id)
|
|
|
654
654
|
`createHighlight()` and `setupHighlight()` own isolated highlighters. Component `useHighlight()` reads the app injection; standalone calls create separate APIs. Default installation does not write `window.hljs`; use `exposeToWindow: true` only for explicit legacy integration.
|
|
655
655
|
|
|
656
656
|
The full plugin owns one form registry per application. Migrate global `registerRenderer()` usage to `createFormRendererRegistry()` and the plugin's `formRenderers` option. With component subpaths, provide `FORM_RENDERER_REGISTRY_KEY` explicitly. See [architecture and isolation](../architecture.en.md) for examples, precedence and ownership rules.
|
|
657
|
+
|
|
658
|
+
### Business models and public types (0.18)
|
|
659
|
+
|
|
660
|
+
Define domain models in the application. Components preserve their types without requiring `DataRecord`, `SearchFormParams`, or `TreeNodeData` inheritance. Those defaults support dynamic configuration; adding an open string index weakens field-name checks.
|
|
661
|
+
|
|
662
|
+
- Keep `defineFormOptions<Model>(...)`: initial values and `valueWhen` correlate with `prop`. Declare nullable fields explicitly. Recursive field paths use an internal depth bound.
|
|
663
|
+
- Search infers the query model from `v-model` across fields, configuration and events. Use `SearchDateRangeValue` for ranges; `onSearch` can return a request Promise directly.
|
|
664
|
+
- Use `defineTableColumns<Row>(...)` for field checks and `TableConfig<Row, Child>` / `TableInstance<Row, Child>` for nested tables. Expansion receives typed child records and selection state; events and public methods preserve both models.
|
|
665
|
+
- Tree, draggable and transfer callbacks and slots preserve the model inferred from input data. Domain-specific fields remain application-owned.
|
|
666
|
+
- Prefer standard `v-model` with date/time `mode`. Static modes infer scalar or range values; dynamic modes retain a union. Legacy aliases remain compatible.
|
|
667
|
+
- Workflow nodes narrow their payload through `node.type`. Import `WorkflowExpose`, `DiagramExpose`, or `GanttExpose` instead of rebuilding instance handles. Gantt SDK configuration and layout contexts are typed; extend `GanttTask` for domain metadata. Declare `children?: MyTask[]` for homogeneous trees; callbacks preserve heterogeneous descendant unions for domain narrowing. SDK-edited task dates are `string | Date`.
|
|
668
|
+
|
|
669
|
+
CRUD bindings remain structural. `@robot-admin/request-core` 0.6.3 accepts component columns directly, without application converters or a dependency between the two packages.
|
|
670
|
+
|
|
671
|
+
For a concrete business model, enable dynamic insertion with the existing `dynamicRows.defaultRowData` factory returning a complete row and valid unique key; `false` still disables it directly. Factory keys retain their original type. Copying with a string key preserves business fields and takes a fresh key from the factory. With a function key, the factory receives an optional source copy and returns a complete new record. Missing, duplicate or invalid factory keys report failure without changing data. Open dynamic records retain the legacy empty-row shorthand.
|
package/docs/guides/usage.md
CHANGED
|
@@ -737,3 +737,18 @@ loading.finish(id)
|
|
|
737
737
|
`createHighlight()`、`setupHighlight()` 各自持有独立高亮实例;组件中的 `useHighlight()` 读取应用注入,独立调用创建新的 API。默认不写入 `window.hljs`,只有兼容旧窗口用法时显式开启 `exposeToWindow: true`。
|
|
738
738
|
|
|
739
739
|
全量插件为每个应用持有独立表单 registry。已有全局 `registerRenderer()` 用法应迁移到 `createFormRendererRegistry()` 与插件的 `formRenderers` 选项;子路径接入可以显式提供 `FORM_RENDERER_REGISTRY_KEY`。示例、优先级和所有权规则见[架构与隔离](../architecture.md)。
|
|
740
|
+
|
|
741
|
+
### 业务模型与公开类型(0.18)
|
|
742
|
+
|
|
743
|
+
使用侧定义业务模型,组件负责保留其类型,无需继承 `DataRecord`、`SearchFormParams` 或 `TreeNodeData`。这些宽松默认类型用于动态配置;继承字符串索引会削弱字段拼写检查。
|
|
744
|
+
|
|
745
|
+
- 表单继续使用 `defineFormOptions<Model>(...)`;字段初值和 `valueWhen` 返回值与 `prop` 关联,空值应在业务模型中如实声明。递归模型支持有限深度的常用字段路径,避免类型循环展开。
|
|
746
|
+
- 搜索从 `v-model` 推导查询模型,字段名、配置回调与事件同步保留类型;日期范围可使用 `SearchDateRangeValue`。`config.onSearch` 可以直接返回请求 Promise,无需额外包装。
|
|
747
|
+
- 表格用 `defineTableColumns<Row>(...)` 校验业务字段;父子表使用 `TableConfig<Row, Child>`、`TableInstance<Row, Child>`。配置、模板事件及公开实例保留父子记录类型,展开回调直接获得 `Child[]` 与 `ChildSelectionState`。
|
|
748
|
+
- 树、拖拽与穿梭框由 `data` / `modelValue` 推导业务项,回调与插槽无需强制断言。业务扩展字段仍由项目模型定义。
|
|
749
|
+
- 日期/时间推荐 `mode` 加标准 `v-model`;静态模式推导单值或范围,动态模式保留联合值类型。旧别名继续兼容。
|
|
750
|
+
- 工作流节点可通过 `node.type` 直接缩窄对应 `node.data`。复杂组件可导入 `WorkflowExpose`、`DiagramExpose`、`GanttExpose`,甘特配置和布局上下文沿用 SDK 的准确类型;业务任务属性通过扩展 `GanttTask` 定义。同构任务声明 `children?: MyTask[]`;异构后代在回调中保留联合,按业务判别字段缩窄。SDK 编辑后的任务日期为 `string | Date`。
|
|
751
|
+
|
|
752
|
+
CRUD 控制器只需满足结构契约;`@robot-admin/request-core` 0.6.3 起可直接接收组件列,无需应用内列转换器。组件库与请求包保持独立依赖关系。
|
|
753
|
+
|
|
754
|
+
明确业务模型启用动态增行时,提供已有 `dynamicRows.defaultRowData` 工厂返回完整记录和合法唯一主键;`false` 仍可直接关闭。工厂主键不会被组件改成字符串。复制使用字符串主键时保留原业务字段、从工厂取得新主键;函数主键场景由工厂接收可选原行副本并返回完整新记录。缺失、重复或无效主键会反馈失败并保持原数据。宽松动态记录继续支持原有空行简写。
|
package/package.json
CHANGED
package/dist/C_VtableGantt2.cjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`);const i={headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:1,fontSize:14,fontWeight:`bold`},bodyStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:[1,0,1,0],fontSize:13}},a={basic:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:220,tree:!0},{field:`start`,title:`开始时间`,width:120},{field:`end`,title:`结束时间`,width:120},{field:`progress`,title:`进度`,width:80}],tableWidth:420,minTableWidth:300,theme:i},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`#e1e4e8`,cornerRadius:6},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:2}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:18,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:4,borderLineWidth:0},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:1,fillColor:`#ffd666`,width:12}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:12,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},project:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:200,tree:!0,editor:`input`},{field:`start`,title:`开始时间`,width:120,editor:`date-input`},{field:`end`,title:`结束时间`,width:120,editor:`date-input`},{field:`priority`,title:`优先级`,width:80,editor:`input`},{field:`progress`,title:`进度%`,width:80,editor:`input`}],tableWidth:480,minTableWidth:350,maxTableWidth:800,theme:i,hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(24, 144, 255, 0.3)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:12,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:6,borderLineWidth:0}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,startOfWeek:`monday`,format:e=>`第${e.dateIndex}周`,style:{fontSize:13,fontWeight:`bold`,textAlign:`center`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11,textAlign:`center`}}]},rowSeriesNumber:{title:`序号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},timeline:{overscrollBehavior:`none`,headerRowHeight:45,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`事件名称`,width:250,tree:!0},{field:`start`,title:`时间`,width:150}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...i.headerStyle},bodyStyle:i.bodyStyle}},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`rgba(128, 128, 128, 0.3)`,cornerRadius:4},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:22,barColor:`#722ed1`,completedBarColor:`#b37feb`,cornerRadius:8,borderLineWidth:0}},timelineHeader:{colWidth:60,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},milestone:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:38,taskListTable:{columns:[{field:`title`,title:`里程碑`,width:200,tree:!0},{field:`start`,title:`目标日期`,width:120},{field:`priority`,title:`重要性`,width:100}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...i.headerStyle,borderColor:`#ffa940`},bodyStyle:{...i.bodyStyle,borderColor:`#ffa940`}}},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#ffa940`,cornerRadius:6},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`},horizontalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`}},taskBar:{startDateField:`start`,endDateField:`start`,labelText:`{title}`,labelTextStyle:{fontSize:12,fontWeight:`bold`},barStyle:{width:0,barColor:`transparent`},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:2,fillColor:`#ffd666`,width:16}},timelineHeader:{colWidth:80,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},official:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`title`,width:180,sort:!0,tree:!0,editor:`input`},{field:`start`,title:`start`,width:120,sort:!0,editor:`date-input`},{field:`end`,title:`end`,width:120,sort:!0,editor:`date-input`},{field:`priority`,title:`priority`,width:80,sort:!0,editor:`input`},{field:`progress`,title:`progress`,width:80,sort:!0,editor:`input`}],tableWidth:460,minTableWidth:350,maxTableWidth:800,theme:{headerStyle:{...i.headerStyle,fontSize:18,color:`red`},bodyStyle:{...i.bodyStyle,fontSize:16,color:`#4D4D4D`}},hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3},horizontalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(99, 144, 0, 0.4)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:16,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#ee8800`,completedBarColor:`#91e8e0`,cornerRadius:8,borderLineWidth:1,borderColor:`black`},milestoneStyle:{borderColor:`red`,borderLineWidth:1,fillColor:`green`,width:15}},timelineHeader:{backgroundColor:`#EEF1F5`,colWidth:60,horizontalLine:{lineWidth:1,lineColor:`#e1e4e8`},verticalLine:{lineWidth:1,lineColor:`#e1e4e8`},scales:[{unit:`week`,step:1,startOfWeek:`sunday`,format:e=>`Week ${e.dateIndex}`,style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`,textStick:!0}},{unit:`day`,step:1,format:e=>e.dateIndex.toString(),style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`}}]},markLine:[{date:`2024-07-28`,style:{lineWidth:1,lineColor:`blue`,lineDash:[8,4]}},{date:`2024-08-17`,style:{lineWidth:2,lineColor:`red`,lineDash:[8,4]}}],rowSeriesNumber:{title:`行号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}}},o=new Set([`__proto__`,`prototype`,`constructor`]),s=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null};function c(e,t){let n=new WeakMap,r=(e,t)=>{let i=n.get(t);if(i)return i;let a={...e};n.set(t,a);for(let[n,i]of Object.entries(t))o.has(n)||(a[n]=s(i)?r(s(e[n])?e[n]:{},i):i);return a};return r(e,t)}function l(e,t,n){e.on(`click_task_bar`,e=>{e.record&&t(e.record,e.event)}),e.on(`change_date_range`,e=>{if(e.record){let t={start:e.startDate,end:e.endDate};n({...e.record,...t},t)}}),e.on(`progress_update`,e=>{if(e.record){let t={progress:e.progress};n({...e.record,...t},t)}});let r=e.taskListTableInstance;r&&(r.on(`click_cell`,e=>{let n=r.getCellOriginRecord(e.col,e.row);n&&typeof n==`object`&&`id`in n&&t(n,e.event)}),r.on(`change_cell_value`,e=>{let t=r.getCellOriginRecord(e.col,e.row),i=r.getHeaderField(e.col,e.row);t&&typeof i==`string`&&n({...t,[i]:e.changedValue},{[i]:e.changedValue})}))}const u={class:`c-vtable-gantt-wrapper`},d={key:0,class:`gantt-toolbar`},f={class:`toolbar-left`},p={class:`gantt-title`},m={class:`toolbar-right`},h={class:`gantt-body`},g=(0,n.defineComponent)({name:`C_VtableGantt`,__name:`index`,props:{data:{default:()=>[]},options:{default:()=>({})},preset:{default:`basic`},height:{default:`600px`},title:{default:``},showToolbar:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},theme:{default:`light`}},emits:[`ganttCreated`,`taskClick`,`taskChange`,`error`],setup(t,{expose:i,emit:o}){let s=t,g=o,_=(0,n.ref)(),v=(0,n.shallowRef)(),y=(0,n.ref)(!1),b=(0,n.ref)(!1),x=(0,n.shallowRef)(),S=0,C,w,T=!1,E=(0,n.computed)(()=>typeof s.height==`number`?`${s.height}px`:s.height),D=(e,t)=>!T&&e===S&&_.value===t,O=e=>e.map(e=>({...e,title:e.title||`任务${e.id}`,children:e.children?O(e.children):void 0})),k=e=>({underlayBackgroundColor:e?`#1e1e1e`:`#ffffff`,timelineHeaderBg:e?`#2d2d2d`:`#EEF1F5`,gridBg:e?`#1e1e1e`:`#ffffff`,lineColor:e?`rgba(255, 255, 255, 0.1)`:`rgba(128, 128, 128, 0.2)`,textColor:e?`#ffffff`:`#000000`}),A=(e,t)=>({...e,backgroundColor:t.timelineHeaderBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor},scales:e?.scales?.map(e=>({...e,style:{...e.style,color:t.textColor}}))}),j=(e,t)=>({...e,backgroundColor:t.gridBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor}}),M=(e,t,n,r)=>({...e,records:t,underlayBackgroundColor:r.underlayBackgroundColor,taskListTable:{...e.taskListTable,theme:n.extends(e.taskListTable?.theme??{})},timelineHeader:A(e.timelineHeader,r),grid:j(e.grid,r)}),N=e=>{let t=s.theme===`dark`;return M(c(a[s.preset]||a.basic,s.options),O(s.data),t?e.DARK:e.DEFAULT,k(t))},P=e=>{if(e)try{e.release()}catch(e){console.warn(`销毁甘特图失败:`,e)}},F=(e,t,n)=>{e.editor(t)||e.editor(t,n())},I=async()=>{clearTimeout(C),C=void 0;let e=_.value;if(!e||T)return;let t=++S;b.value=!0,x.value=void 0;let n;try{let[{Gantt:r},{themes:i,register:a},{InputEditor:o,DateInputEditor:s}]=await Promise.all([import(`@visactor/vtable-gantt`),import(`@visactor/vtable`),import(`@visactor/vtable-editors`)]);if(!D(t,e))return;F(a,`input`,()=>new o),F(a,`date-input`,()=>new s);let c=N(i);H();let u=new r(e,c);if(n=u,!D(t,e)){u.release();return}l(u,(e,t)=>g(`taskClick`,e,t),(e,t)=>g(`taskChange`,e,t)),v.value=u,n=void 0,g(`ganttCreated`,u)}catch(r){if(P(n),!D(t,e))return;x.value=r instanceof Error?r:Error(String(r)),g(`error`,x.value)}finally{D(t,e)&&(b.value=!1)}},L=()=>{w&&clearTimeout(w),w=setTimeout(()=>{w=void 0,T||v.value?.resize?.()},100)},R=async()=>{let e=_.value;if(e)try{document.fullscreenElement===e?await document.exitFullscreen():await e.requestFullscreen(),y.value=document.fullscreenElement===e,L()}catch(t){console.warn(`全屏切换失败:`,t),y.value=document.fullscreenElement===e}},z=()=>{y.value=document.fullscreenElement===_.value,L()},B=e=>{if(v.value&&e)try{v.value.setRecords(O(e))}catch(e){console.warn(`更新数据失败:`,e)}},V=e=>{if(v.value&&e)try{v.value.updateOption(e)}catch(e){console.warn(`更新配置失败:`,e)}},H=()=>{let e=v.value;v.value=void 0,P(e)};return(0,n.watch)(()=>s.data,e=>{e&&v.value&&B(e)},{deep:!0}),(0,n.watch)(()=>[s.options,s.preset,s.theme],()=>void I(),{deep:!0,flush:`post`}),(0,n.onMounted)(()=>{T=!1,document.addEventListener(`fullscreenchange`,z),(0,n.nextTick)(()=>{T||S>0||(C=setTimeout(()=>I(),100))})}),(0,n.onUnmounted)(()=>{T=!0,b.value=!1,S+=1,C&&clearTimeout(C),w&&clearTimeout(w),document.removeEventListener(`fullscreenchange`,z),H()}),i({ganttInstance:v,loading:b,error:x,reload:I,updateData:B,updateOptions:V,toggleFullscreen:R}),(i,a)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,u,[t.showToolbar?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,d,[(0,n.createElementVNode)(`div`,f,[(0,n.createElementVNode)(`span`,p,(0,n.toDisplayString)(t.title||`甘特图`),1)]),(0,n.createElementVNode)(`div`,m,[t.showFullscreenButton?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NButton),{key:0,size:`small`,onClick:R},{icon:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:y.value?`carbon:minimize`:`carbon:maximize`,size:16,color:`currentColor`},null,8,[`name`])]),default:(0,n.withCtx)(()=>[(0,n.createTextVNode)(` `+(0,n.toDisplayString)(y.value?`退出全屏`:`全屏`),1)]),_:1})):(0,n.createCommentVNode)(`v-if`,!0)])])):(0,n.createCommentVNode)(`v-if`,!0),(0,n.createElementVNode)(`div`,h,[(0,n.createElementVNode)(`div`,{ref_key:`ganttContainerRef`,ref:_,class:`gantt-container`,style:(0,n.normalizeStyle)({height:E.value})},null,4),x.value?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NResult),{key:0,class:`gantt-error`,status:`error`,title:`甘特图加载失败`,description:x.value.message},{footer:(0,n.withCtx)(()=>[(0,n.createVNode)((0,n.unref)(r.NButton),{loading:b.value,onClick:I},{default:(0,n.withCtx)(()=>[...a[0]||=[(0,n.createTextVNode)(`重试`,-1)]]),_:1},8,[`loading`])]),_:1},8,[`description`])):(0,n.createCommentVNode)(`v-if`,!0)])]))}});var _=t.t(g,[[`__scopeId`,`data-v-dbfd25e4`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return a}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return _}});
|
package/dist/C_VtableGantt2.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{computed as n,createBlock as r,createCommentVNode as i,createElementBlock as a,createElementVNode as o,createTextVNode as s,createVNode as c,defineComponent as l,nextTick as ee,normalizeStyle as te,onMounted as ne,onUnmounted as re,openBlock as u,ref as d,shallowRef as f,toDisplayString as p,unref as m,watch as h,withCtx as g}from"vue";import{NButton as _,NResult as v}from"naive-ui";const y={headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:1,fontSize:14,fontWeight:`bold`},bodyStyle:{borderColor:`rgba(128, 128, 128, 0.2)`,borderLineWidth:[1,0,1,0],fontSize:13}},b={basic:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:220,tree:!0},{field:`start`,title:`开始时间`,width:120},{field:`end`,title:`结束时间`,width:120},{field:`progress`,title:`进度`,width:80}],tableWidth:420,minTableWidth:300,theme:y},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`#e1e4e8`,cornerRadius:6},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:2}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:18,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:4,borderLineWidth:0},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:1,fillColor:`#ffd666`,width:12}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:12,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},project:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`任务名称`,width:200,tree:!0,editor:`input`},{field:`start`,title:`开始时间`,width:120,editor:`date-input`},{field:`end`,title:`结束时间`,width:120,editor:`date-input`},{field:`priority`,title:`优先级`,width:80,editor:`input`},{field:`progress`,title:`进度%`,width:80,editor:`input`}],tableWidth:480,minTableWidth:350,maxTableWidth:800,theme:y,hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(24, 144, 255, 0.3)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:12,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#1890ff`,completedBarColor:`#52c41a`,cornerRadius:6,borderLineWidth:0}},timelineHeader:{colWidth:60,horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},scales:[{unit:`week`,step:1,startOfWeek:`monday`,format:e=>`第${e.dateIndex}周`,style:{fontSize:13,fontWeight:`bold`,textAlign:`center`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11,textAlign:`center`}}]},rowSeriesNumber:{title:`序号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},timeline:{overscrollBehavior:`none`,headerRowHeight:45,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`事件名称`,width:250,tree:!0},{field:`start`,title:`时间`,width:150}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...y.headerStyle},bodyStyle:y.bodyStyle}},frame:{outerFrameStyle:{borderLineWidth:1,borderColor:`rgba(128, 128, 128, 0.3)`,cornerRadius:4},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,labelText:`{title}`,labelTextStyle:{fontSize:12,textAlign:`left`},barStyle:{width:22,barColor:`#722ed1`,completedBarColor:`#b37feb`,cornerRadius:8,borderLineWidth:0}},timelineHeader:{colWidth:60,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`day`,step:1,format:e=>`${e.dateIndex}`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},milestone:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:38,taskListTable:{columns:[{field:`title`,title:`里程碑`,width:200,tree:!0},{field:`start`,title:`目标日期`,width:120},{field:`priority`,title:`重要性`,width:100}],tableWidth:400,minTableWidth:300,theme:{headerStyle:{...y.headerStyle,borderColor:`#ffa940`},bodyStyle:{...y.bodyStyle,borderColor:`#ffa940`}}},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#ffa940`,cornerRadius:6},verticalSplitLineMoveable:!0},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`},horizontalLine:{lineWidth:1,lineColor:`rgba(255, 168, 64, 0.3)`}},taskBar:{startDateField:`start`,endDateField:`start`,labelText:`{title}`,labelTextStyle:{fontSize:12,fontWeight:`bold`},barStyle:{width:0,barColor:`transparent`},milestoneStyle:{borderColor:`#fa8c16`,borderLineWidth:2,fillColor:`#ffd666`,width:16}},timelineHeader:{colWidth:80,scales:[{unit:`month`,step:1,format:e=>`${e.dateIndex}月`,style:{fontSize:13,fontWeight:`bold`}},{unit:`week`,step:1,format:e=>`第${e.dateIndex}周`,style:{fontSize:11}}]},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}},official:{overscrollBehavior:`none`,headerRowHeight:40,rowHeight:40,taskListTable:{columns:[{field:`title`,title:`title`,width:180,sort:!0,tree:!0,editor:`input`},{field:`start`,title:`start`,width:120,sort:!0,editor:`date-input`},{field:`end`,title:`end`,width:120,sort:!0,editor:`date-input`},{field:`priority`,title:`priority`,width:80,sort:!0,editor:`input`},{field:`progress`,title:`progress`,width:80,sort:!0,editor:`input`}],tableWidth:460,minTableWidth:350,maxTableWidth:800,theme:{headerStyle:{...y.headerStyle,fontSize:18,color:`red`},bodyStyle:{...y.bodyStyle,fontSize:16,color:`#4D4D4D`}},hierarchyExpandLevel:2},frame:{outerFrameStyle:{borderLineWidth:2,borderColor:`#e1e4e8`,cornerRadius:8},verticalSplitLineMoveable:!0,verticalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3},horizontalSplitLine:{lineColor:`#e1e4e8`,lineWidth:3}},grid:{verticalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`},horizontalLine:{lineWidth:1,lineColor:`rgba(128, 128, 128, 0.2)`}},taskBar:{startDateField:`start`,endDateField:`end`,progressField:`progress`,moveable:!0,resizable:!0,hoverBarStyle:{barOverlayColor:`rgba(99, 144, 0, 0.4)`},labelText:`{title} {progress}%`,labelTextStyle:{fontSize:16,textAlign:`left`,textOverflow:`ellipsis`},barStyle:{width:20,barColor:`#ee8800`,completedBarColor:`#91e8e0`,cornerRadius:8,borderLineWidth:1,borderColor:`black`},milestoneStyle:{borderColor:`red`,borderLineWidth:1,fillColor:`green`,width:15}},timelineHeader:{backgroundColor:`#EEF1F5`,colWidth:60,horizontalLine:{lineWidth:1,lineColor:`#e1e4e8`},verticalLine:{lineWidth:1,lineColor:`#e1e4e8`},scales:[{unit:`week`,step:1,startOfWeek:`sunday`,format:e=>`Week ${e.dateIndex}`,style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`,textStick:!0}},{unit:`day`,step:1,format:e=>e.dateIndex.toString(),style:{fontSize:20,fontWeight:`bold`,color:`white`,strokeColor:`black`,textAlign:`right`,textBaseline:`bottom`}}]},markLine:[{date:`2024-07-28`,style:{lineWidth:1,lineColor:`blue`,lineDash:[8,4]}},{date:`2024-08-17`,style:{lineWidth:2,lineColor:`red`,lineDash:[8,4]}}],rowSeriesNumber:{title:`行号`,dragOrder:!0,headerStyle:{borderColor:`rgba(128, 128, 128, 0.2)`},style:{borderColor:`rgba(128, 128, 128, 0.2)`}},scrollStyle:{scrollRailColor:`rgba(246,246,246,0.5)`,visible:`scrolling`,width:6,scrollSliderCornerRadius:2,scrollSliderColor:`#1890ff`}}},x=new Set([`__proto__`,`prototype`,`constructor`]),S=e=>{if(typeof e!=`object`||!e)return!1;let t=Object.getPrototypeOf(e);return t===Object.prototype||t===null};function ie(e,t){let n=new WeakMap,r=(e,t)=>{let i=n.get(t);if(i)return i;let a={...e};n.set(t,a);for(let[n,i]of Object.entries(t))x.has(n)||(a[n]=S(i)?r(S(e[n])?e[n]:{},i):i);return a};return r(e,t)}function ae(e,t,n){e.on(`click_task_bar`,e=>{e.record&&t(e.record,e.event)}),e.on(`change_date_range`,e=>{if(e.record){let t={start:e.startDate,end:e.endDate};n({...e.record,...t},t)}}),e.on(`progress_update`,e=>{if(e.record){let t={progress:e.progress};n({...e.record,...t},t)}});let r=e.taskListTableInstance;r&&(r.on(`click_cell`,e=>{let n=r.getCellOriginRecord(e.col,e.row);n&&typeof n==`object`&&`id`in n&&t(n,e.event)}),r.on(`change_cell_value`,e=>{let t=r.getCellOriginRecord(e.col,e.row),i=r.getHeaderField(e.col,e.row);t&&typeof i==`string`&&n({...t,[i]:e.changedValue},{[i]:e.changedValue})}))}const C={class:`c-vtable-gantt-wrapper`},w={key:0,class:`gantt-toolbar`},T={class:`toolbar-left`},E={class:`gantt-title`},D={class:`toolbar-right`},O={class:`gantt-body`};var k=t(l({name:`C_VtableGantt`,__name:`index`,props:{data:{default:()=>[]},options:{default:()=>({})},preset:{default:`basic`},height:{default:`600px`},title:{default:``},showToolbar:{type:Boolean,default:!0},showFullscreenButton:{type:Boolean,default:!0},theme:{default:`light`}},emits:[`ganttCreated`,`taskClick`,`taskChange`,`error`],setup(t,{expose:l,emit:y}){let x=t,S=y,k=d(),A=f(),j=d(!1),M=d(!1),N=f(),P=0,F,I,L=!1,R=n(()=>typeof x.height==`number`?`${x.height}px`:x.height),z=(e,t)=>!L&&e===P&&k.value===t,B=e=>e.map(e=>({...e,title:e.title||`任务${e.id}`,children:e.children?B(e.children):void 0})),V=e=>({underlayBackgroundColor:e?`#1e1e1e`:`#ffffff`,timelineHeaderBg:e?`#2d2d2d`:`#EEF1F5`,gridBg:e?`#1e1e1e`:`#ffffff`,lineColor:e?`rgba(255, 255, 255, 0.1)`:`rgba(128, 128, 128, 0.2)`,textColor:e?`#ffffff`:`#000000`}),H=(e,t)=>({...e,backgroundColor:t.timelineHeaderBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor},scales:e?.scales?.map(e=>({...e,style:{...e.style,color:t.textColor}}))}),U=(e,t)=>({...e,backgroundColor:t.gridBg,horizontalLine:{...e?.horizontalLine,lineColor:t.lineColor},verticalLine:{...e?.verticalLine,lineColor:t.lineColor}}),W=(e,t,n,r)=>({...e,records:t,underlayBackgroundColor:r.underlayBackgroundColor,taskListTable:{...e.taskListTable,theme:n.extends(e.taskListTable?.theme??{})},timelineHeader:H(e.timelineHeader,r),grid:U(e.grid,r)}),G=e=>{let t=x.theme===`dark`;return W(ie(b[x.preset]||b.basic,x.options),B(x.data),t?e.DARK:e.DEFAULT,V(t))},K=e=>{if(e)try{e.release()}catch(e){console.warn(`销毁甘特图失败:`,e)}},q=(e,t,n)=>{e.editor(t)||e.editor(t,n())},J=async()=>{clearTimeout(F),F=void 0;let e=k.value;if(!e||L)return;let t=++P;M.value=!0,N.value=void 0;let n;try{let[{Gantt:r},{themes:i,register:a},{InputEditor:o,DateInputEditor:s}]=await Promise.all([import(`@visactor/vtable-gantt`),import(`@visactor/vtable`),import(`@visactor/vtable-editors`)]);if(!z(t,e))return;q(a,`input`,()=>new o),q(a,`date-input`,()=>new s);let c=G(i);$();let l=new r(e,c);if(n=l,!z(t,e)){l.release();return}ae(l,(e,t)=>S(`taskClick`,e,t),(e,t)=>S(`taskChange`,e,t)),A.value=l,n=void 0,S(`ganttCreated`,l)}catch(r){if(K(n),!z(t,e))return;N.value=r instanceof Error?r:Error(String(r)),S(`error`,N.value)}finally{z(t,e)&&(M.value=!1)}},Y=()=>{I&&clearTimeout(I),I=setTimeout(()=>{I=void 0,L||A.value?.resize?.()},100)},X=async()=>{let e=k.value;if(e)try{document.fullscreenElement===e?await document.exitFullscreen():await e.requestFullscreen(),j.value=document.fullscreenElement===e,Y()}catch(t){console.warn(`全屏切换失败:`,t),j.value=document.fullscreenElement===e}},Z=()=>{j.value=document.fullscreenElement===k.value,Y()},Q=e=>{if(A.value&&e)try{A.value.setRecords(B(e))}catch(e){console.warn(`更新数据失败:`,e)}},oe=e=>{if(A.value&&e)try{A.value.updateOption(e)}catch(e){console.warn(`更新配置失败:`,e)}},$=()=>{let e=A.value;A.value=void 0,K(e)};return h(()=>x.data,e=>{e&&A.value&&Q(e)},{deep:!0}),h(()=>[x.options,x.preset,x.theme],()=>void J(),{deep:!0,flush:`post`}),ne(()=>{L=!1,document.addEventListener(`fullscreenchange`,Z),ee(()=>{L||P>0||(F=setTimeout(()=>J(),100))})}),re(()=>{L=!0,M.value=!1,P+=1,F&&clearTimeout(F),I&&clearTimeout(I),document.removeEventListener(`fullscreenchange`,Z),$()}),l({ganttInstance:A,loading:M,error:N,reload:J,updateData:Q,updateOptions:oe,toggleFullscreen:X}),(n,l)=>(u(),a(`div`,C,[t.showToolbar?(u(),a(`div`,w,[o(`div`,T,[o(`span`,E,p(t.title||`甘特图`),1)]),o(`div`,D,[t.showFullscreenButton?(u(),r(m(_),{key:0,size:`small`,onClick:X},{icon:g(()=>[c(e,{name:j.value?`carbon:minimize`:`carbon:maximize`,size:16,color:`currentColor`},null,8,[`name`])]),default:g(()=>[s(` `+p(j.value?`退出全屏`:`全屏`),1)]),_:1})):i(`v-if`,!0)])])):i(`v-if`,!0),o(`div`,O,[o(`div`,{ref_key:`ganttContainerRef`,ref:k,class:`gantt-container`,style:te({height:R.value})},null,4),N.value?(u(),r(m(v),{key:0,class:`gantt-error`,status:`error`,title:`甘特图加载失败`,description:N.value.message},{footer:g(()=>[c(m(_),{loading:M.value,onClick:J},{default:g(()=>[...l[0]||=[s(`重试`,-1)]]),_:1},8,[`loading`])]),_:1},8,[`description`])):i(`v-if`,!0)])]))}}),[[`__scopeId`,`data-v-dbfd25e4`]]);export{b as n,k as t};
|
package/dist/index27.vue.d.cts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import * as vue from "vue";
|
|
2
|
-
|
|
3
|
-
//#region src/components/C_Timeline/types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* @Description: 时间线组件类型定义
|
|
6
|
-
*/
|
|
7
|
-
/** 单条时间线节点 */
|
|
8
|
-
interface TimelineItem {
|
|
9
|
-
/** 唯一标识 */
|
|
10
|
-
id: string | number;
|
|
11
|
-
/** 标题 */
|
|
12
|
-
title: string;
|
|
13
|
-
/** 描述内容(支持 HTML 字符串) */
|
|
14
|
-
content?: string;
|
|
15
|
-
/** 时间标签 */
|
|
16
|
-
time?: string;
|
|
17
|
-
/** 节点颜色(CSS 颜色值) */
|
|
18
|
-
color?: string;
|
|
19
|
-
/** 节点图标(Iconify 图标名) */
|
|
20
|
-
icon?: string;
|
|
21
|
-
/** 节点状态 */
|
|
22
|
-
status?: 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
23
|
-
/** 是否可展开/折叠详情 */
|
|
24
|
-
collapsible?: boolean;
|
|
25
|
-
/** 初始是否展开 */
|
|
26
|
-
defaultExpanded?: boolean;
|
|
27
|
-
/** 附加标签组 */
|
|
28
|
-
tags?: Array<{
|
|
29
|
-
text: string;
|
|
30
|
-
type?: string;
|
|
31
|
-
}>;
|
|
32
|
-
/** 自定义额外数据 */
|
|
33
|
-
extra?: Record<string, unknown>;
|
|
34
|
-
}
|
|
35
|
-
/** 组件 Props */
|
|
36
|
-
interface TimelineProps {
|
|
37
|
-
/** 时间线数据 */
|
|
38
|
-
items: TimelineItem[];
|
|
39
|
-
/** 布局方向 */
|
|
40
|
-
mode?: 'vertical' | 'horizontal';
|
|
41
|
-
/** 垂直模式下时间标签位置 */
|
|
42
|
-
labelPlacement?: 'left' | 'right' | 'alternate';
|
|
43
|
-
/** 是否显示尾部加载更多指示 */
|
|
44
|
-
pending?: boolean;
|
|
45
|
-
/** 加载更多文案 */
|
|
46
|
-
pendingText?: string;
|
|
47
|
-
/** 是否反转排列(最新在前) */
|
|
48
|
-
reverse?: boolean;
|
|
49
|
-
/** 节点大小 */
|
|
50
|
-
size?: 'small' | 'medium' | 'large';
|
|
51
|
-
/** 连接线样式 */
|
|
52
|
-
lineType?: 'solid' | 'dashed' | 'dotted';
|
|
53
|
-
/** 是否显示时间标签 */
|
|
54
|
-
showTime?: boolean;
|
|
55
|
-
}
|
|
56
|
-
/** 默认 Props */
|
|
57
|
-
declare const DEFAULT_TIMELINE_PROPS: {
|
|
58
|
-
mode: "vertical";
|
|
59
|
-
labelPlacement: "right";
|
|
60
|
-
pending: boolean;
|
|
61
|
-
pendingText: string;
|
|
62
|
-
reverse: boolean;
|
|
63
|
-
size: "medium";
|
|
64
|
-
lineType: "solid";
|
|
65
|
-
showTime: boolean;
|
|
66
|
-
};
|
|
67
|
-
/** 状态 → 颜色映射 */
|
|
68
|
-
declare const STATUS_COLOR_MAP: Record<string, string>;
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/components/C_Timeline/index.vue.d.ts
|
|
71
|
-
declare var __VLS_1: {
|
|
72
|
-
item: TimelineItem;
|
|
73
|
-
index: number;
|
|
74
|
-
}, __VLS_8: {
|
|
75
|
-
item: TimelineItem;
|
|
76
|
-
index: number;
|
|
77
|
-
};
|
|
78
|
-
type __VLS_Slots = {} & {
|
|
79
|
-
dot?: (props: typeof __VLS_1) => any;
|
|
80
|
-
} & {
|
|
81
|
-
title?: (props: typeof __VLS_8) => any;
|
|
82
|
-
};
|
|
83
|
-
declare const __VLS_base: vue.DefineComponent<TimelineProps, {
|
|
84
|
-
/** 展开全部 */expandAll: () => void; /** 折叠全部 */
|
|
85
|
-
collapseAll: () => void;
|
|
86
|
-
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
87
|
-
"item-click": (item: TimelineItem, index: number) => any;
|
|
88
|
-
expand: (item: TimelineItem, expanded: boolean) => any;
|
|
89
|
-
}, string, vue.PublicProps, Readonly<TimelineProps> & Readonly<{
|
|
90
|
-
"onItem-click"?: ((item: TimelineItem, index: number) => any) | undefined;
|
|
91
|
-
onExpand?: ((item: TimelineItem, expanded: boolean) => any) | undefined;
|
|
92
|
-
}>, {
|
|
93
|
-
size: "small" | "medium" | "large";
|
|
94
|
-
labelPlacement: "left" | "right" | "alternate";
|
|
95
|
-
mode: "vertical" | "horizontal";
|
|
96
|
-
reverse: boolean;
|
|
97
|
-
items: TimelineItem[];
|
|
98
|
-
pending: boolean;
|
|
99
|
-
pendingText: string;
|
|
100
|
-
lineType: "solid" | "dashed" | "dotted";
|
|
101
|
-
showTime: boolean;
|
|
102
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
103
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
104
|
-
declare const _default: typeof __VLS_export;
|
|
105
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
106
|
-
new (): {
|
|
107
|
-
$slots: S;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
//#endregion
|
|
111
|
-
export { TimelineProps as a, TimelineItem as i, DEFAULT_TIMELINE_PROPS as n, STATUS_COLOR_MAP as r, _default as t };
|
package/dist/index27.vue.d.ts
DELETED
|
@@ -1,111 +0,0 @@
|
|
|
1
|
-
import * as vue from "vue";
|
|
2
|
-
|
|
3
|
-
//#region src/components/C_Timeline/types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* @Description: 时间线组件类型定义
|
|
6
|
-
*/
|
|
7
|
-
/** 单条时间线节点 */
|
|
8
|
-
interface TimelineItem {
|
|
9
|
-
/** 唯一标识 */
|
|
10
|
-
id: string | number;
|
|
11
|
-
/** 标题 */
|
|
12
|
-
title: string;
|
|
13
|
-
/** 描述内容(支持 HTML 字符串) */
|
|
14
|
-
content?: string;
|
|
15
|
-
/** 时间标签 */
|
|
16
|
-
time?: string;
|
|
17
|
-
/** 节点颜色(CSS 颜色值) */
|
|
18
|
-
color?: string;
|
|
19
|
-
/** 节点图标(Iconify 图标名) */
|
|
20
|
-
icon?: string;
|
|
21
|
-
/** 节点状态 */
|
|
22
|
-
status?: 'default' | 'success' | 'warning' | 'error' | 'info';
|
|
23
|
-
/** 是否可展开/折叠详情 */
|
|
24
|
-
collapsible?: boolean;
|
|
25
|
-
/** 初始是否展开 */
|
|
26
|
-
defaultExpanded?: boolean;
|
|
27
|
-
/** 附加标签组 */
|
|
28
|
-
tags?: Array<{
|
|
29
|
-
text: string;
|
|
30
|
-
type?: string;
|
|
31
|
-
}>;
|
|
32
|
-
/** 自定义额外数据 */
|
|
33
|
-
extra?: Record<string, unknown>;
|
|
34
|
-
}
|
|
35
|
-
/** 组件 Props */
|
|
36
|
-
interface TimelineProps {
|
|
37
|
-
/** 时间线数据 */
|
|
38
|
-
items: TimelineItem[];
|
|
39
|
-
/** 布局方向 */
|
|
40
|
-
mode?: 'vertical' | 'horizontal';
|
|
41
|
-
/** 垂直模式下时间标签位置 */
|
|
42
|
-
labelPlacement?: 'left' | 'right' | 'alternate';
|
|
43
|
-
/** 是否显示尾部加载更多指示 */
|
|
44
|
-
pending?: boolean;
|
|
45
|
-
/** 加载更多文案 */
|
|
46
|
-
pendingText?: string;
|
|
47
|
-
/** 是否反转排列(最新在前) */
|
|
48
|
-
reverse?: boolean;
|
|
49
|
-
/** 节点大小 */
|
|
50
|
-
size?: 'small' | 'medium' | 'large';
|
|
51
|
-
/** 连接线样式 */
|
|
52
|
-
lineType?: 'solid' | 'dashed' | 'dotted';
|
|
53
|
-
/** 是否显示时间标签 */
|
|
54
|
-
showTime?: boolean;
|
|
55
|
-
}
|
|
56
|
-
/** 默认 Props */
|
|
57
|
-
declare const DEFAULT_TIMELINE_PROPS: {
|
|
58
|
-
mode: "vertical";
|
|
59
|
-
labelPlacement: "right";
|
|
60
|
-
pending: boolean;
|
|
61
|
-
pendingText: string;
|
|
62
|
-
reverse: boolean;
|
|
63
|
-
size: "medium";
|
|
64
|
-
lineType: "solid";
|
|
65
|
-
showTime: boolean;
|
|
66
|
-
};
|
|
67
|
-
/** 状态 → 颜色映射 */
|
|
68
|
-
declare const STATUS_COLOR_MAP: Record<string, string>;
|
|
69
|
-
//#endregion
|
|
70
|
-
//#region src/components/C_Timeline/index.vue.d.ts
|
|
71
|
-
declare var __VLS_1: {
|
|
72
|
-
item: TimelineItem;
|
|
73
|
-
index: number;
|
|
74
|
-
}, __VLS_8: {
|
|
75
|
-
item: TimelineItem;
|
|
76
|
-
index: number;
|
|
77
|
-
};
|
|
78
|
-
type __VLS_Slots = {} & {
|
|
79
|
-
dot?: (props: typeof __VLS_1) => any;
|
|
80
|
-
} & {
|
|
81
|
-
title?: (props: typeof __VLS_8) => any;
|
|
82
|
-
};
|
|
83
|
-
declare const __VLS_base: vue.DefineComponent<TimelineProps, {
|
|
84
|
-
/** 展开全部 */expandAll: () => void; /** 折叠全部 */
|
|
85
|
-
collapseAll: () => void;
|
|
86
|
-
}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {} & {
|
|
87
|
-
"item-click": (item: TimelineItem, index: number) => any;
|
|
88
|
-
expand: (item: TimelineItem, expanded: boolean) => any;
|
|
89
|
-
}, string, vue.PublicProps, Readonly<TimelineProps> & Readonly<{
|
|
90
|
-
"onItem-click"?: ((item: TimelineItem, index: number) => any) | undefined;
|
|
91
|
-
onExpand?: ((item: TimelineItem, expanded: boolean) => any) | undefined;
|
|
92
|
-
}>, {
|
|
93
|
-
size: "small" | "medium" | "large";
|
|
94
|
-
labelPlacement: "left" | "right" | "alternate";
|
|
95
|
-
mode: "vertical" | "horizontal";
|
|
96
|
-
reverse: boolean;
|
|
97
|
-
items: TimelineItem[];
|
|
98
|
-
pending: boolean;
|
|
99
|
-
pendingText: string;
|
|
100
|
-
lineType: "solid" | "dashed" | "dotted";
|
|
101
|
-
showTime: boolean;
|
|
102
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
103
|
-
declare const __VLS_export: __VLS_WithSlots<typeof __VLS_base, __VLS_Slots>;
|
|
104
|
-
declare const _default: typeof __VLS_export;
|
|
105
|
-
type __VLS_WithSlots<T, S> = T & {
|
|
106
|
-
new (): {
|
|
107
|
-
$slots: S;
|
|
108
|
-
};
|
|
109
|
-
};
|
|
110
|
-
//#endregion
|
|
111
|
-
export { TimelineProps as a, TimelineItem as i, DEFAULT_TIMELINE_PROPS as n, STATUS_COLOR_MAP as r, _default as t };
|
package/dist/index28.vue.d.cts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import * as vue from "vue";
|
|
2
|
-
|
|
3
|
-
//#region src/components/C_Transfer/types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* @Description: 穿梭框组件类型定义
|
|
6
|
-
*/
|
|
7
|
-
/** 穿梭框数据项 */
|
|
8
|
-
interface TransferItem {
|
|
9
|
-
/** 唯一标识 */
|
|
10
|
-
key: string | number;
|
|
11
|
-
/** 显示标签 */
|
|
12
|
-
label: string;
|
|
13
|
-
/** 是否禁用 */
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
/** 分组名称 */
|
|
16
|
-
group?: string;
|
|
17
|
-
/** 描述信息(用于详细模式) */
|
|
18
|
-
description?: string;
|
|
19
|
-
/** 图标(Iconify) */
|
|
20
|
-
icon?: string;
|
|
21
|
-
/** 额外数据 */
|
|
22
|
-
extra?: Record<string, unknown>;
|
|
23
|
-
}
|
|
24
|
-
/** 组件 Props */
|
|
25
|
-
interface TransferProps {
|
|
26
|
-
/** 数据源 */
|
|
27
|
-
data: TransferItem[];
|
|
28
|
-
/** 右侧已选 key 列表 (v-model) */
|
|
29
|
-
modelValue: Array<string | number>;
|
|
30
|
-
/** 左右栏标题 */
|
|
31
|
-
titles?: [string, string];
|
|
32
|
-
/** 是否可搜索 */
|
|
33
|
-
filterable?: boolean;
|
|
34
|
-
/** 搜索占位符 */
|
|
35
|
-
filterPlaceholder?: string;
|
|
36
|
-
/** 自定义筛选函数 */
|
|
37
|
-
filterMethod?: (query: string, item: TransferItem) => boolean;
|
|
38
|
-
/** 是否显示全选复选框 */
|
|
39
|
-
showSelectAll?: boolean;
|
|
40
|
-
/** 左侧空状态描述 */
|
|
41
|
-
sourceEmptyText?: string;
|
|
42
|
-
/** 右侧空状态描述 */
|
|
43
|
-
targetEmptyText?: string;
|
|
44
|
-
/** 尺寸 */
|
|
45
|
-
size?: 'small' | 'medium' | 'large';
|
|
46
|
-
/** 大列表自动使用虚拟滚动;自定义可变行高或需要完整 DOM 时可关闭。默认 true,100 项起启用。 */
|
|
47
|
-
virtualScroll?: boolean;
|
|
48
|
-
}
|
|
49
|
-
/** 默认 Props */
|
|
50
|
-
declare const DEFAULT_TRANSFER_PROPS: Partial<TransferProps>;
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/components/C_Transfer/index.vue.d.ts
|
|
53
|
-
type __VLS_Props = {
|
|
54
|
-
data: TransferProps['data'];
|
|
55
|
-
modelValue: TransferProps['modelValue'];
|
|
56
|
-
titles?: TransferProps['titles'];
|
|
57
|
-
filterable?: boolean;
|
|
58
|
-
filterPlaceholder?: string;
|
|
59
|
-
filterMethod?: TransferProps['filterMethod'];
|
|
60
|
-
showSelectAll?: boolean;
|
|
61
|
-
sourceEmptyText?: string;
|
|
62
|
-
targetEmptyText?: string;
|
|
63
|
-
size?: TransferProps['size'];
|
|
64
|
-
virtualScroll?: boolean;
|
|
65
|
-
};
|
|
66
|
-
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
67
|
-
"update:modelValue": (value: (string | number)[]) => any;
|
|
68
|
-
change: (targetKeys: (string | number)[], direction: "left" | "right", moveKeys: (string | number)[]) => any;
|
|
69
|
-
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
70
|
-
"onUpdate:modelValue"?: ((value: (string | number)[]) => any) | undefined;
|
|
71
|
-
onChange?: ((targetKeys: (string | number)[], direction: "left" | "right", moveKeys: (string | number)[]) => any) | undefined;
|
|
72
|
-
}>, {
|
|
73
|
-
size: "small" | "medium" | "large";
|
|
74
|
-
filterable: boolean;
|
|
75
|
-
virtualScroll: boolean;
|
|
76
|
-
titles: [string, string];
|
|
77
|
-
filterPlaceholder: string;
|
|
78
|
-
showSelectAll: boolean;
|
|
79
|
-
sourceEmptyText: string;
|
|
80
|
-
targetEmptyText: string;
|
|
81
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
82
|
-
declare const _default: typeof __VLS_export;
|
|
83
|
-
//#endregion
|
|
84
|
-
export { TransferProps as i, DEFAULT_TRANSFER_PROPS as n, TransferItem as r, _default as t };
|
package/dist/index28.vue.d.ts
DELETED
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import * as vue from "vue";
|
|
2
|
-
|
|
3
|
-
//#region src/components/C_Transfer/types.d.ts
|
|
4
|
-
/**
|
|
5
|
-
* @Description: 穿梭框组件类型定义
|
|
6
|
-
*/
|
|
7
|
-
/** 穿梭框数据项 */
|
|
8
|
-
interface TransferItem {
|
|
9
|
-
/** 唯一标识 */
|
|
10
|
-
key: string | number;
|
|
11
|
-
/** 显示标签 */
|
|
12
|
-
label: string;
|
|
13
|
-
/** 是否禁用 */
|
|
14
|
-
disabled?: boolean;
|
|
15
|
-
/** 分组名称 */
|
|
16
|
-
group?: string;
|
|
17
|
-
/** 描述信息(用于详细模式) */
|
|
18
|
-
description?: string;
|
|
19
|
-
/** 图标(Iconify) */
|
|
20
|
-
icon?: string;
|
|
21
|
-
/** 额外数据 */
|
|
22
|
-
extra?: Record<string, unknown>;
|
|
23
|
-
}
|
|
24
|
-
/** 组件 Props */
|
|
25
|
-
interface TransferProps {
|
|
26
|
-
/** 数据源 */
|
|
27
|
-
data: TransferItem[];
|
|
28
|
-
/** 右侧已选 key 列表 (v-model) */
|
|
29
|
-
modelValue: Array<string | number>;
|
|
30
|
-
/** 左右栏标题 */
|
|
31
|
-
titles?: [string, string];
|
|
32
|
-
/** 是否可搜索 */
|
|
33
|
-
filterable?: boolean;
|
|
34
|
-
/** 搜索占位符 */
|
|
35
|
-
filterPlaceholder?: string;
|
|
36
|
-
/** 自定义筛选函数 */
|
|
37
|
-
filterMethod?: (query: string, item: TransferItem) => boolean;
|
|
38
|
-
/** 是否显示全选复选框 */
|
|
39
|
-
showSelectAll?: boolean;
|
|
40
|
-
/** 左侧空状态描述 */
|
|
41
|
-
sourceEmptyText?: string;
|
|
42
|
-
/** 右侧空状态描述 */
|
|
43
|
-
targetEmptyText?: string;
|
|
44
|
-
/** 尺寸 */
|
|
45
|
-
size?: 'small' | 'medium' | 'large';
|
|
46
|
-
/** 大列表自动使用虚拟滚动;自定义可变行高或需要完整 DOM 时可关闭。默认 true,100 项起启用。 */
|
|
47
|
-
virtualScroll?: boolean;
|
|
48
|
-
}
|
|
49
|
-
/** 默认 Props */
|
|
50
|
-
declare const DEFAULT_TRANSFER_PROPS: Partial<TransferProps>;
|
|
51
|
-
//#endregion
|
|
52
|
-
//#region src/components/C_Transfer/index.vue.d.ts
|
|
53
|
-
type __VLS_Props = {
|
|
54
|
-
data: TransferProps['data'];
|
|
55
|
-
modelValue: TransferProps['modelValue'];
|
|
56
|
-
titles?: TransferProps['titles'];
|
|
57
|
-
filterable?: boolean;
|
|
58
|
-
filterPlaceholder?: string;
|
|
59
|
-
filterMethod?: TransferProps['filterMethod'];
|
|
60
|
-
showSelectAll?: boolean;
|
|
61
|
-
sourceEmptyText?: string;
|
|
62
|
-
targetEmptyText?: string;
|
|
63
|
-
size?: TransferProps['size'];
|
|
64
|
-
virtualScroll?: boolean;
|
|
65
|
-
};
|
|
66
|
-
declare const __VLS_export: vue.DefineComponent<__VLS_Props, {}, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
67
|
-
"update:modelValue": (value: (string | number)[]) => any;
|
|
68
|
-
change: (targetKeys: (string | number)[], direction: "left" | "right", moveKeys: (string | number)[]) => any;
|
|
69
|
-
}, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
70
|
-
"onUpdate:modelValue"?: ((value: (string | number)[]) => any) | undefined;
|
|
71
|
-
onChange?: ((targetKeys: (string | number)[], direction: "left" | "right", moveKeys: (string | number)[]) => any) | undefined;
|
|
72
|
-
}>, {
|
|
73
|
-
size: "small" | "medium" | "large";
|
|
74
|
-
filterable: boolean;
|
|
75
|
-
virtualScroll: boolean;
|
|
76
|
-
titles: [string, string];
|
|
77
|
-
filterPlaceholder: string;
|
|
78
|
-
showSelectAll: boolean;
|
|
79
|
-
sourceEmptyText: string;
|
|
80
|
-
targetEmptyText: string;
|
|
81
|
-
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
82
|
-
declare const _default: typeof __VLS_export;
|
|
83
|
-
//#endregion
|
|
84
|
-
export { TransferProps as i, DEFAULT_TRANSFER_PROPS as n, TransferItem as r, _default as t };
|