@robot-admin/naive-ui-components 0.16.0 → 0.17.1
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 +39 -0
- package/README.md +12 -9
- package/README_EN.md +12 -9
- package/dist/C_ActionBar.css +56 -48
- package/dist/C_ActionBar2.cjs +1 -1
- package/dist/C_ActionBar2.js +1 -1
- package/dist/C_AntV2.cjs +1 -1
- package/dist/C_AntV2.js +3 -3
- package/dist/C_Barcode.css +6 -6
- package/dist/C_Barcode2.cjs +1 -1
- package/dist/C_Barcode2.js +1 -1
- package/dist/C_Chat.css +269 -185
- package/dist/C_Chat2.cjs +1 -1
- package/dist/C_Chat2.js +1 -1
- package/dist/C_Code.css +26 -26
- package/dist/C_Code2.cjs +1 -1
- package/dist/C_Code2.js +1 -1
- package/dist/C_Draggable2.cjs +1 -1
- package/dist/C_Draggable2.js +1 -1
- package/dist/C_FilePreview.css +96 -57
- package/dist/C_FilePreview2.cjs +1 -1
- package/dist/C_FilePreview2.js +1 -1
- package/dist/C_Form.base.css +295 -277
- package/dist/C_Form.css +295 -277
- package/dist/C_Form.d.cts +2 -1
- package/dist/C_Form.d.ts +2 -1
- package/dist/C_FormModal.css +10 -10
- package/dist/C_FormModal2.cjs +1 -1
- package/dist/C_FormModal2.js +1 -1
- package/dist/C_FormSearch.css +67 -68
- package/dist/C_FormSearch.d.cts +2 -1
- package/dist/C_FormSearch.d.ts +2 -1
- package/dist/C_FormSearch2.cjs +1 -1
- package/dist/C_FormSearch2.js +1 -1
- package/dist/C_FullCalendar2.cjs +1 -1
- package/dist/C_FullCalendar2.js +1 -1
- package/dist/C_GlobalSearch.css +140 -118
- package/dist/C_GlobalSearch2.cjs +1 -1
- package/dist/C_GlobalSearch2.js +1 -1
- package/dist/C_ImageCropper.css +12 -10
- package/dist/C_ImageCropper2.cjs +1 -1
- package/dist/C_ImageCropper2.js +1 -1
- package/dist/C_Login.css +79 -79
- package/dist/C_Login2.cjs +1 -1
- package/dist/C_Login2.js +1 -1
- package/dist/C_Map.css +10 -10
- package/dist/C_Map2.cjs +1 -1
- package/dist/C_Map2.js +1 -1
- package/dist/C_OrgChart.css +28 -4
- package/dist/C_OrgChart2.cjs +1 -1
- package/dist/C_OrgChart2.js +1 -1
- package/dist/C_QRCode2.cjs +1 -1
- package/dist/C_QRCode2.js +1 -1
- package/dist/C_Signature.css +15 -15
- package/dist/C_Signature2.cjs +1 -1
- package/dist/C_Signature2.js +1 -1
- package/dist/C_SplitPane.cjs +1 -1
- package/dist/C_SplitPane.css +251 -109
- package/dist/C_SplitPane.js +1 -1
- package/dist/C_SplitPane2.cjs +1 -1
- package/dist/C_SplitPane2.js +1 -1
- package/dist/C_Table.base.css +491 -563
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +491 -563
- package/dist/C_Table.d.cts +3 -2
- package/dist/C_Table.d.ts +4 -2
- package/dist/C_Table.js +1 -1
- package/dist/C_TagsView2.cjs +1 -1
- package/dist/C_TagsView2.js +1 -1
- package/dist/C_Transfer.css +93 -84
- package/dist/C_Transfer2.cjs +1 -1
- package/dist/C_Transfer2.js +1 -1
- package/dist/C_Tree.css +72 -125
- package/dist/C_Tree.d.cts +3 -2
- package/dist/C_Tree.d.ts +15 -2
- package/dist/C_Tree2.cjs +1 -1
- package/dist/C_Tree2.js +1 -1
- package/dist/C_Upload.css +5 -5
- package/dist/C_Upload2.cjs +1 -1
- package/dist/C_Upload2.js +1 -1
- package/dist/C_VideoPlayer2.cjs +4 -3
- package/dist/C_VideoPlayer2.js +4 -3
- package/dist/C_VtableGantt.css +29 -28
- package/dist/C_VtableGantt2.cjs +1 -1
- package/dist/C_VtableGantt2.js +1 -1
- package/dist/C_WaterFall.css +29 -29
- package/dist/C_WaterFall2.cjs +1 -1
- package/dist/C_WaterFall2.js +1 -1
- package/dist/C_WorkFlow2.cjs +1 -1
- package/dist/C_WorkFlow2.js +1 -1
- package/dist/Card.cjs +1 -1
- package/dist/Card.js +1 -1
- package/dist/Custom.cjs +1 -1
- package/dist/Custom.js +1 -1
- package/dist/Dynamic.cjs +1 -1
- package/dist/Dynamic.js +1 -1
- package/dist/Steps.cjs +1 -1
- package/dist/Steps.js +1 -1
- package/dist/Tabs.cjs +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/constants.d.cts +2 -2
- package/dist/constants.d.ts +2 -2
- package/dist/constants2.d.cts +2 -2
- package/dist/constants2.d.ts +2 -2
- package/dist/constants3.d.cts +2 -2
- package/dist/constants3.d.ts +2 -2
- package/dist/constants4.d.cts +4 -4
- package/dist/constants4.d.ts +4 -4
- package/dist/constants5.d.cts +3 -7
- package/dist/constants5.d.ts +3 -7
- package/dist/data.d.cts +10 -10
- package/dist/data.d.ts +10 -10
- package/dist/density.cjs +1 -0
- package/dist/density.d.cts +15 -0
- package/dist/density.d.ts +15 -0
- package/dist/density.js +1 -0
- package/dist/helpers.cjs +1 -1
- package/dist/helpers.js +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +5 -3
- package/dist/index.js +1 -1
- package/dist/index.vue.d.cts +5 -5
- package/dist/index.vue.d.ts +5 -5
- package/dist/index10.vue.d.cts +5 -5
- package/dist/index10.vue.d.ts +3 -3
- package/dist/index11.vue.d.cts +3 -3
- package/dist/index11.vue.d.ts +5 -5
- package/dist/index12.vue.d.cts +5 -5
- package/dist/index13.vue.d.ts +5 -5
- package/dist/index14.vue.d.cts +5 -5
- package/dist/index14.vue.d.ts +9 -9
- package/dist/index15.vue.d.cts +9 -9
- package/dist/index15.vue.d.ts +3 -3
- package/dist/index16.vue.d.cts +3 -3
- package/dist/index17.vue.d.ts +1 -1
- package/dist/index18.vue.d.cts +1 -1
- package/dist/index18.vue.d.ts +7 -7
- package/dist/index19.vue.d.cts +7 -7
- package/dist/index19.vue.d.ts +5 -5
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index20.vue.d.cts +6 -2
- package/dist/index20.vue.d.ts +6 -2
- package/dist/index21.vue.d.cts +2 -2
- package/dist/index21.vue.d.ts +2 -2
- package/dist/index22.vue.d.cts +2 -2
- package/dist/index22.vue.d.ts +2 -2
- package/dist/index23.vue.d.cts +2 -2
- package/dist/index23.vue.d.ts +2 -2
- package/dist/index25.vue.d.cts +5 -5
- package/dist/index25.vue.d.ts +5 -5
- package/dist/index27.vue.d.cts +2 -2
- package/dist/index27.vue.d.ts +2 -2
- package/dist/index28.vue.d.cts +7 -3
- package/dist/index28.vue.d.ts +7 -3
- package/dist/index3.vue.d.cts +3 -3
- package/dist/index3.vue.d.ts +3 -3
- package/dist/index4.vue.d.cts +5 -5
- package/dist/index5.vue.d.ts +2 -2
- package/dist/index6.vue.d.cts +2 -2
- package/dist/index6.vue.d.ts +7 -4
- package/dist/index7.vue.d.cts +7 -4
- package/dist/index7.vue.d.ts +2 -2
- package/dist/index8.vue.d.cts +2 -2
- package/dist/index8.vue.d.ts +4 -6
- package/dist/index9.vue.d.cts +4 -6
- package/dist/index9.vue.d.ts +5 -5
- package/dist/mapUtils.d.cts +4 -4
- package/dist/mapUtils.d.ts +4 -4
- package/dist/presets.d.cts +4 -1
- package/dist/presets.d.ts +4 -1
- package/dist/style.css +1763 -1566
- package/dist/useCalendarEvents.d.cts +10 -9
- package/dist/useCalendarEvents.d.ts +10 -9
- package/dist/useCollapsePanel.d.cts +3 -3
- package/dist/useCollapsePanel.d.ts +3 -3
- package/dist/useCropperCore.d.cts +9 -9
- package/dist/useCropperCore.d.ts +9 -9
- package/dist/useDraggableLayout.d.cts +15 -13
- package/dist/useDraggableLayout.d.ts +15 -13
- package/dist/useDynamicFormState.d.cts +5 -2
- package/dist/useDynamicFormState.d.ts +5 -2
- package/dist/useEdgeInteraction.d.cts +3 -3
- package/dist/useEdgeInteraction.d.ts +3 -3
- package/dist/useFullscreen.d.cts +4 -0
- package/dist/useFullscreen.d.ts +4 -0
- package/dist/useGlobalSearch.d.cts +9 -4
- package/dist/useGlobalSearch.d.ts +9 -4
- package/dist/useInfiniteScroll.d.cts +4 -1
- package/dist/useInfiniteScroll.d.ts +4 -1
- package/dist/useQRCode.d.cts +3 -3
- package/dist/useQRCode.d.ts +3 -3
- package/dist/useSearchState.d.cts +8 -6
- package/dist/useSearchState.d.ts +8 -6
- package/dist/useSignatureHistory.d.cts +7 -7
- package/dist/useSignatureHistory.d.ts +7 -7
- package/dist/useSplitResize.d.cts +50 -61
- package/dist/useSplitResize.d.ts +50 -61
- package/dist/useTableQuery.cjs +3 -3
- package/dist/useTableQuery.d.cts +237 -13
- package/dist/useTableQuery.d.ts +237 -13
- package/dist/useTableQuery.js +3 -3
- package/dist/useTimeSelection.d.cts +2 -2
- package/dist/useTimeSelection.d.ts +2 -2
- package/dist/useWorkflowValidation.d.cts +3 -3
- package/dist/useWorkflowValidation.d.ts +3 -3
- package/dist/verification.d.cts +5 -5
- package/dist/verification.d.ts +5 -5
- package/docs/component-review-20261019.md +55 -0
- package/docs/guides/form-density.en.md +42 -0
- package/docs/guides/form-density.md +59 -0
- package/docs/guides/runtime-performance.md +38 -0
- package/docs/guides/split-pane.en.md +103 -0
- package/docs/guides/split-pane.md +126 -0
- package/docs/guides/table-density.md +87 -0
- package/docs/guides/transfer.md +11 -0
- package/docs/guides/tree.md +157 -0
- package/docs/guides/usage.en.md +2 -0
- package/docs/guides/usage.md +2 -0
- package/docs/runtime-review-20261019.md +41 -0
- package/docs/wl-ui-produce-coverage.md +62 -0
- package/package.json +4 -2
- package/dist/useTreeOperations.d.cts +0 -185
- package/dist/useTreeOperations.d.ts +0 -185
package/dist/C_Table.d.cts
CHANGED
|
@@ -1,2 +1,3 @@
|
|
|
1
|
-
import { $ as
|
|
2
|
-
|
|
1
|
+
import { $ as MaybeRefLike, $t as printPresets, At as ExpandConfig, B as useRowEdit, Bt as exportTableData, Ct as useTableGlobalConfig, Dt as DisplayConfig, Et as CrudBinding, F as useCellEdit, Ft as TreeConfig, G as _default, Gt as RowDragConfig, H as defineTableColumns, Ht as UseCrossPageSelectionOptions, I as usePagination, It as VirtualScrollConfig, J as ChildSelectionState, Jt as useRowDrag, K as ApiFunction, Kt as UseRowDragOptions, L as useTableActions, Lt as createEditModeChecker, Mt as SummaryConfig, Nt as TableConfig, Ot as EditConfig, P as useModalEdit, Pt as ToolbarConfig, Q as EditMode, Qt as PrintWatermarkOptions, R as useTableExpand, Rt as resolveConfig, St as mergeGlobalConfig, Tt as ColumnDragConfig, U as defineTableConfig, Ut as UseCrossPageSelectionReturn, V as useTableColumns, Vt as CrossPageSelectionConfig, W as validateTableRowKeys, Wt as useCrossPageSelection, X as CustomAction, Xt as DynamicRowsReturn, Y as ColumnWithKey, Yt as DynamicRowsOptions, Z as DataRecord, Zt as useDynamicRows, _t as FormatterConfig, at as SelectOption, bt as TableGlobalConfig, ct as TableColumn, dt as TableProps, en as usePrintWatermark, et as NormalTableColumn, ft as TableRowKey, gt as ColumnFormatter, ht as UseTableExpandReturn, i as useTableQuery, it as RowAction, jt as SelectionConfig, kt as ErrorConfig, lt as TableEmits, mt as UseTableExpandOptions, n as TableQueryResult, nt as ParentChildLinkMode, ot as SimpleTableActions, pt as TableRowKeyIssue, q as BuiltInTableColumn, qt as UseRowDragReturn, r as UseTableQueryOptions, rt as RenderFunction, st as StrictTableColumn, t as TableQueryContext, tt as PaginationConfig, ut as TableInstance, vt as FormatterType, wt as BatchActionsConfig, xt as applyFormatter, yt as TABLE_GLOBAL_CONFIG_KEY, z as useTableManager, zt as ExportConfig } from "./useTableQuery.cjs";
|
|
2
|
+
import { r as resolveComponentDensity, t as ComponentDensity } from "./density.cjs";
|
|
3
|
+
export { type ApiFunction, type BatchActionsConfig, type BuiltInTableColumn, _default as C_Table, type ChildSelectionState, type ColumnDragConfig, type ColumnFormatter, type ColumnWithKey, type ComponentDensity, type CrossPageSelectionConfig, type CrudBinding, type CustomAction, type DataRecord, type DisplayConfig, type DynamicRowsOptions, type DynamicRowsReturn, type EditConfig, type EditMode, type ErrorConfig, type ExpandConfig, type ExportConfig, type FormatterConfig, type FormatterType, type MaybeRefLike, type NormalTableColumn, type PaginationConfig, type ParentChildLinkMode, type PrintWatermarkOptions, type RenderFunction, type RowAction, type RowDragConfig, type SelectOption, type SimpleTableActions, type StrictTableColumn, type SummaryConfig, TABLE_GLOBAL_CONFIG_KEY, type TableColumn, type TableConfig, type TableEmits, type TableGlobalConfig, type TableInstance, type TableProps, type TableQueryContext, type TableQueryResult, type TableRowKey, type TableRowKeyIssue, type SelectionConfig as TableSelectionConfig, type ToolbarConfig, type TreeConfig, type UseCrossPageSelectionOptions, type UseCrossPageSelectionReturn, type UseRowDragOptions, type UseRowDragReturn, type UseTableExpandOptions, type UseTableExpandReturn, type UseTableQueryOptions, type VirtualScrollConfig, applyFormatter, createEditModeChecker, defineTableColumns, defineTableConfig, exportTableData, mergeGlobalConfig, printPresets, resolveComponentDensity, resolveConfig, useCellEdit, useCrossPageSelection, useDynamicRows, useModalEdit, usePagination, usePrintWatermark, useRowDrag, useRowEdit, useTableActions, useTableColumns, useTableExpand, useTableGlobalConfig, useTableManager, useTableQuery, validateTableRowKeys };
|
package/dist/C_Table.d.ts
CHANGED
|
@@ -2,12 +2,14 @@ import "./presets.js";
|
|
|
2
2
|
import "./useEdgeInteraction.js";
|
|
3
3
|
import "./public.js";
|
|
4
4
|
import "./index4.vue.js";
|
|
5
|
-
import { $ as
|
|
5
|
+
import { $ as MaybeRefLike, $t as printPresets, At as ExpandConfig, B as useRowEdit, Bt as exportTableData, Ct as useTableGlobalConfig, Dt as DisplayConfig, Et as CrudBinding, F as useCellEdit, Ft as TreeConfig, G as _default, Gt as RowDragConfig, H as defineTableColumns, Ht as UseCrossPageSelectionOptions, I as usePagination, It as VirtualScrollConfig, J as ChildSelectionState, Jt as useRowDrag, K as ApiFunction, Kt as UseRowDragOptions, L as useTableActions, Lt as createEditModeChecker, Mt as SummaryConfig, Nt as TableConfig, Ot as EditConfig, P as useModalEdit, Pt as ToolbarConfig, Q as EditMode, Qt as PrintWatermarkOptions, R as useTableExpand, Rt as resolveConfig, St as mergeGlobalConfig, Tt as ColumnDragConfig, U as defineTableConfig, Ut as UseCrossPageSelectionReturn, V as useTableColumns, Vt as CrossPageSelectionConfig, W as validateTableRowKeys, Wt as useCrossPageSelection, X as CustomAction, Xt as DynamicRowsReturn, Y as ColumnWithKey, Yt as DynamicRowsOptions, Z as DataRecord, Zt as useDynamicRows, _t as FormatterConfig, at as SelectOption, bt as TableGlobalConfig, ct as TableColumn, dt as TableProps, en as usePrintWatermark, et as NormalTableColumn, ft as TableRowKey, gt as ColumnFormatter, ht as UseTableExpandReturn, i as useTableQuery, it as RowAction, jt as SelectionConfig, kt as ErrorConfig, lt as TableEmits, mt as UseTableExpandOptions, n as TableQueryResult, nt as ParentChildLinkMode, ot as SimpleTableActions, pt as TableRowKeyIssue, q as BuiltInTableColumn, qt as UseRowDragReturn, r as UseTableQueryOptions, rt as RenderFunction, st as StrictTableColumn, t as TableQueryContext, tt as PaginationConfig, ut as TableInstance, vt as FormatterType, wt as BatchActionsConfig, xt as applyFormatter, yt as TABLE_GLOBAL_CONFIG_KEY, z as useTableManager, zt as ExportConfig } from "./useTableQuery.js";
|
|
6
|
+
import "./useDraggableLayout.js";
|
|
6
7
|
import "./useDynamicFormState.js";
|
|
8
|
+
import { r as resolveComponentDensity, t as ComponentDensity } from "./density.js";
|
|
7
9
|
import "./index12.vue.js";
|
|
8
10
|
import "./useSearchState.js";
|
|
9
11
|
import "./mapUtils.js";
|
|
10
12
|
import "./index19.vue.js";
|
|
11
13
|
import "./constants5.js";
|
|
12
14
|
import "./index26.vue.js";
|
|
13
|
-
export { type ApiFunction, type BatchActionsConfig, type BuiltInTableColumn, _default as C_Table, type ChildSelectionState, type ColumnDragConfig, type ColumnFormatter, type ColumnWithKey, type CrossPageSelectionConfig, type CrudBinding, type CustomAction, type DataRecord, type DisplayConfig, type DynamicRowsOptions, type DynamicRowsReturn, type EditConfig, type EditMode, type ErrorConfig, type ExpandConfig, type ExportConfig, type FormatterConfig, type FormatterType, type MaybeRefLike, type NormalTableColumn, type PaginationConfig, type ParentChildLinkMode, type PrintWatermarkOptions, type RenderFunction, type RowAction, type RowDragConfig, type SelectOption, type SimpleTableActions, type StrictTableColumn, type SummaryConfig, TABLE_GLOBAL_CONFIG_KEY, type TableColumn, type TableConfig, type TableEmits, type TableGlobalConfig, type TableInstance, type TableProps, type TableQueryContext, type TableQueryResult, type TableRowKey, type TableRowKeyIssue, type SelectionConfig as TableSelectionConfig, type ToolbarConfig, type TreeConfig, type UseCrossPageSelectionOptions, type UseCrossPageSelectionReturn, type UseRowDragOptions, type UseRowDragReturn, type UseTableExpandOptions, type UseTableExpandReturn, type UseTableQueryOptions, type VirtualScrollConfig, applyFormatter, createEditModeChecker, defineTableColumns, defineTableConfig, exportTableData, mergeGlobalConfig, printPresets, resolveConfig, useCellEdit, useCrossPageSelection, useDynamicRows, useModalEdit, usePagination, usePrintWatermark, useRowDrag, useRowEdit, useTableActions, useTableColumns, useTableExpand, useTableGlobalConfig, useTableManager, useTableQuery, validateTableRowKeys };
|
|
15
|
+
export { type ApiFunction, type BatchActionsConfig, type BuiltInTableColumn, _default as C_Table, type ChildSelectionState, type ColumnDragConfig, type ColumnFormatter, type ColumnWithKey, type ComponentDensity, type CrossPageSelectionConfig, type CrudBinding, type CustomAction, type DataRecord, type DisplayConfig, type DynamicRowsOptions, type DynamicRowsReturn, type EditConfig, type EditMode, type ErrorConfig, type ExpandConfig, type ExportConfig, type FormatterConfig, type FormatterType, type MaybeRefLike, type NormalTableColumn, type PaginationConfig, type ParentChildLinkMode, type PrintWatermarkOptions, type RenderFunction, type RowAction, type RowDragConfig, type SelectOption, type SimpleTableActions, type StrictTableColumn, type SummaryConfig, TABLE_GLOBAL_CONFIG_KEY, type TableColumn, type TableConfig, type TableEmits, type TableGlobalConfig, type TableInstance, type TableProps, type TableQueryContext, type TableQueryResult, type TableRowKey, type TableRowKeyIssue, type SelectionConfig as TableSelectionConfig, type ToolbarConfig, type TreeConfig, type UseCrossPageSelectionOptions, type UseCrossPageSelectionReturn, type UseRowDragOptions, type UseRowDragReturn, type UseTableExpandOptions, type UseTableExpandReturn, type UseTableQueryOptions, type VirtualScrollConfig, applyFormatter, createEditModeChecker, defineTableColumns, defineTableConfig, exportTableData, mergeGlobalConfig, printPresets, resolveComponentDensity, resolveConfig, useCellEdit, useCrossPageSelection, useDynamicRows, useModalEdit, usePagination, usePrintWatermark, useRowDrag, useRowEdit, useTableActions, useTableColumns, useTableExpand, useTableGlobalConfig, useTableManager, useTableQuery, validateTableRowKeys };
|
package/dist/C_Table.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import"./C_Icon2.js";import"./C_Loading2.js";import"./C_ActionBar2.js";import{C as
|
|
1
|
+
import{t as e}from"./density.js";import"./C_Icon2.js";import"./C_Loading2.js";import"./C_ActionBar2.js";import{C as t,S as n,T as r,_ as i,a,b as o,c as s,d as c,f as l,g as u,h as d,i as f,l as p,m,n as h,o as g,p as _,r as v,s as y,t as b,u as x,v as S,w as C,x as w,y as T}from"./useTableQuery.js";export{h as C_Table,y as TABLE_GLOBAL_CONFIG_KEY,s as applyFormatter,C as createEditModeChecker,S as defineTableColumns,T as defineTableConfig,v as exportTableData,p as mergeGlobalConfig,d as printPresets,e as resolveComponentDensity,r as resolveConfig,n as useCellEdit,f as useCrossPageSelection,m as useDynamicRows,w as useModalEdit,l as usePagination,u as usePrintWatermark,a as useRowDrag,t as useRowEdit,c as useTableActions,g as useTableColumns,i as useTableExpand,x as useTableGlobalConfig,_ as useTableManager,b as useTableQuery,o as validateTableRowKeys};
|
package/dist/C_TagsView2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`),i=require(`vue-router`);const a=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.path==`string`&&t.path.startsWith(`/`)&&!t.path.startsWith(`//`)&&typeof t.title==`string`},o=e=>{if(!(!e||typeof e!=`object`||Array.isArray(e)))return Object.fromEntries(Object.entries(e).filter(([e,t])=>![`__proto__`,`prototype`,`constructor`].includes(e)&&(e!==`affix`||typeof t==`boolean`)))};function s(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>a(e)?[{path:e.path,title:e.title,originalTitle:typeof e.originalTitle==`string`?e.originalTitle:void 0,icon:typeof e.icon==`string`?e.icon:void 0,meta:o(e.meta)}]:[]):[]}catch{return[]}}function c(e={}){let{persistKey:t=`__tags_view_list__`,homePath:r=`/home`}=e,i=()=>{if(!t)return[];try{return s(localStorage.getItem(t))}catch{return[]}},a=e=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},o=(0,n.ref)(i()),c=(0,n.ref)(``),l=()=>a(o.value),u=e=>{e?o.value=e:o.value=[...new Map(o.value.map(e=>[e.path,e])).values()],l()},d=e=>{c.value=e};return{tagsViewList:o,activeTag:c,homePath:r,initTags:u,setActiveTag:d,addTag:e=>{let t=o.value.findIndex(t=>t.path===e.path);if(t===-1)o.value.push(e);else{let n=o.value[t];(n.title!==e.title||!n.originalTitle)&&(n.title=e.title,n.originalTitle=e.originalTitle||n.originalTitle)}d(e.path),l()},removeTag:e=>{if(e>=0&&e<o.value.length){let t=o.value.splice(e,1)[0]?.path??null;return l(),t}return null},removeOtherTags:e=>{
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`),i=require(`vue-router`);const a=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.path==`string`&&t.path.startsWith(`/`)&&!t.path.startsWith(`//`)&&typeof t.title==`string`},o=e=>{if(!(!e||typeof e!=`object`||Array.isArray(e)))return Object.fromEntries(Object.entries(e).filter(([e,t])=>![`__proto__`,`prototype`,`constructor`].includes(e)&&(e!==`affix`||typeof t==`boolean`)))};function s(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>a(e)?[{path:e.path,title:e.title,originalTitle:typeof e.originalTitle==`string`?e.originalTitle:void 0,icon:typeof e.icon==`string`?e.icon:void 0,meta:o(e.meta)}]:[]):[]}catch{return[]}}function c(e={}){let{persistKey:t=`__tags_view_list__`,homePath:r=`/home`}=e,i=()=>{if(!t)return[];try{return s(localStorage.getItem(t))}catch{return[]}},a=e=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},o=(0,n.ref)(i()),c=(0,n.ref)(``),l=()=>a(o.value),u=e=>{e?o.value=e:o.value=[...new Map(o.value.map(e=>[e.path,e])).values()],l()},d=e=>{c.value=e};return{tagsViewList:o,activeTag:c,homePath:r,initTags:u,setActiveTag:d,addTag:e=>{let t=o.value.findIndex(t=>t.path===e.path);if(t===-1)o.value.push(e);else{let n=o.value[t];(n.title!==e.title||!n.originalTitle)&&(n.title=e.title,n.originalTitle=e.originalTitle||n.originalTitle)}d(e.path),l()},removeTag:e=>{if(e>=0&&e<o.value.length){let t=o.value.splice(e,1)[0]?.path??null;return l(),t}return null},removeOtherTags:e=>{o.value=o.value.filter((t,n)=>n===0||t.meta?.affix||n===e),l()},removeLeftTags:e=>{o.value=o.value.filter((t,n)=>n===0||t.meta?.affix||n>=e),l()},removeRightTags:e=>{o.value=o.value.filter((t,n)=>t.meta?.affix||n<=e),l()},removeAllTags:()=>{o.value=o.value.filter(e=>e.meta?.affix),l()}}}const l={class:`tags-view-container`},u=(0,n.defineComponent)({name:`C_TagsView`,__name:`index`,props:{labelFormatter:{},homePath:{default:`/home`},homeTitle:{default:`首页`},homeIcon:{default:`mdi:home`},persistKey:{default:`__tags_view_list__`},contextMenuLabels:{default:()=>({close:`关闭`,closeOthers:`关闭其他`,closeLeft:`关闭左侧`,closeRight:`关闭右侧`,closeAll:`关闭所有`})},tagsViewOptions:{}},emits:[`close`,`closeAll`],setup(t,{expose:a,emit:o}){let s=t,u=o,d=(0,i.useRoute)(),f=(0,i.useRouter)(),p=c(s.tagsViewOptions??{persistKey:s.persistKey,homePath:s.homePath});if(p.tagsViewList.value.length>0&&s.labelFormatter){let e=f.getRoutes(),t=p.tagsViewList.value.map(t=>{let n=e.find(e=>e.path===t.path),r=t.originalTitle||n?.meta?.title||t.title;return{...t,originalTitle:r,title:s.labelFormatter(r)}});p.initTags(t)}let m=e=>s.labelFormatter?s.labelFormatter(e):e,h=(0,n.ref)(!1),g=(0,n.ref)(0),_=(0,n.ref)(0),v=(0,n.ref)(null),y=(0,n.ref)(-1),b=(0,n.ref)(),x=(0,n.ref)(),S=e=>e.path===d.path,C=e=>e.meta?.affix,w=e=>{let t=x.value;t&&(e.preventDefault(),t.scrollTo({left:t.scrollLeft+e.deltaY,behavior:`smooth`}))},T=e=>{(0,n.nextTick)(()=>{let t=[...x.value?.querySelectorAll(`[data-path]`)??[]].find(t=>t.dataset.path===e);t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})})},E=e=>{e.path!==d.path&&f.push(e.path).catch(()=>void 0),T(e.path)},D=(e,t)=>{if(C(e))return;let n=S(e),r=p.tagsViewList.value.length;if(p.removeTag(t),n){let e=p.tagsViewList.value,n=t===r-1,i;i=n?e[t-1]?.path||s.homePath:e[e.length-1]?.path||s.homePath,f.push(i).catch(()=>void 0),u(`close`,i)}},O=(e,t,n)=>{e.preventDefault(),v.value=t,y.value=n,h.value=!0,g.value=e.clientX,_.value=e.clientY},k=()=>h.value=!1,A=(0,n.computed)(()=>{let e=s.contextMenuLabels;return[{type:`option`,label:e.close??`关闭`,key:`close`,disabled:C(v.value),icon:()=>(0,n.h)(`span`,{class:`i-mdi:close`})},{type:`option`,label:e.closeOthers??`关闭其他`,key:`closeOthers`,icon:()=>(0,n.h)(`span`,{class:`i-mdi:arrow-left-right-bold`})},{type:`option`,label:e.closeLeft??`关闭左侧`,key:`closeLeft`,icon:()=>(0,n.h)(`span`,{class:`i-mdi:align-horizontal-left`})},{type:`option`,label:e.closeRight??`关闭右侧`,key:`closeRight`,icon:()=>(0,n.h)(`span`,{class:`i-mdi:align-horizontal-right`})},{type:`option`,label:e.closeAll??`关闭所有`,key:`closeAll`,icon:()=>(0,n.h)(`span`,{class:`i-mdi:tally-mark-5`})}]}),j=e=>{if(!(!v.value||y.value===-1)){switch(e){case`close`:D(v.value,y.value);break;case`closeOthers`:p.removeOtherTags(y.value);break;case`closeLeft`:p.removeLeftTags(y.value);break;case`closeRight`:p.removeRightTags(y.value);break;case`closeAll`:p.removeAllTags(),f.push(s.homePath).catch(()=>void 0),u(`closeAll`);break}k()}};return(0,n.watch)(()=>d.path,e=>{let t=e===s.homePath?s.homeTitle:d.meta.title||`Unnamed Page`;p.addTag({path:e,originalTitle:t,title:m(t),icon:e===s.homePath?s.homeIcon:d.meta.icon,meta:{affix:d.meta.affix}}),p.setActiveTag(e),T(e)},{immediate:!0}),a({tags:p,scrollToTag:T}),(t,i)=>{let a=r.NTag,o=r.NDropdown;return(0,n.openBlock)(),(0,n.createElementBlock)(`div`,l,[(0,n.createElementVNode)(`div`,{class:`tags-track`,ref_key:`tagsTrack`,ref:b,onWheel:w},[(0,n.createElementVNode)(`div`,{class:`tags-container`,ref_key:`tagsContainer`,ref:x},[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)((0,n.unref)(p).tagsViewList.value,(t,r)=>((0,n.openBlock)(),(0,n.createBlock)(a,{key:t.path,type:S(t)?`primary`:`default`,closable:!C(t),"data-path":t.path,onClose:(0,n.withModifiers)(e=>D(t,r),[`stop`]),onClick:e=>E(t),onContextmenu:(0,n.withModifiers)(e=>O(e,t,r),[`prevent`])},{icon:(0,n.withCtx)(()=>[t.icon?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(e.t),{key:0,name:t.icon,size:12},null,8,[`name`])):(0,n.createCommentVNode)(`v-if`,!0)]),default:(0,n.withCtx)(()=>[(0,n.createTextVNode)(` `+(0,n.toDisplayString)(t.title),1)]),_:2},1032,[`type`,`closable`,`data-path`,`onClose`,`onClick`,`onContextmenu`]))),128))],512)],544),h.value?((0,n.openBlock)(),(0,n.createBlock)(o,{key:0,show:h.value,options:A.value,x:g.value,y:_.value,onClickoutside:k,onSelect:j},null,8,[`show`,`options`,`x`,`y`])):(0,n.createCommentVNode)(`v-if`,!0)])}}});var d=t.t(u,[[`__scopeId`,`data-v-83599594`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return d}});
|
package/dist/C_TagsView2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,defineComponent as l,h as u,nextTick as d,openBlock as f,ref as p,renderList as m,resolveComponent as h,toDisplayString as g,unref as _,watch as v,withCtx as y,withModifiers as b}from"vue";import{NDropdown as x,NTag as S}from"naive-ui";import{useRoute as C,useRouter as w}from"vue-router";const T=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.path==`string`&&t.path.startsWith(`/`)&&!t.path.startsWith(`//`)&&typeof t.title==`string`},E=e=>{if(!(!e||typeof e!=`object`||Array.isArray(e)))return Object.fromEntries(Object.entries(e).filter(([e,t])=>![`__proto__`,`prototype`,`constructor`].includes(e)&&(e!==`affix`||typeof t==`boolean`)))};function D(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>T(e)?[{path:e.path,title:e.title,originalTitle:typeof e.originalTitle==`string`?e.originalTitle:void 0,icon:typeof e.icon==`string`?e.icon:void 0,meta:E(e.meta)}]:[]):[]}catch{return[]}}function O(e={}){let{persistKey:t=`__tags_view_list__`,homePath:n=`/home`}=e,r=()=>{if(!t)return[];try{return D(localStorage.getItem(t))}catch{return[]}},i=e=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},a=p(r()),o=p(``),s=()=>i(a.value),c=e=>{e?a.value=e:a.value=[...new Map(a.value.map(e=>[e.path,e])).values()],s()},l=e=>{o.value=e};return{tagsViewList:a,activeTag:o,homePath:n,initTags:c,setActiveTag:l,addTag:e=>{let t=a.value.findIndex(t=>t.path===e.path);if(t===-1)a.value.push(e);else{let n=a.value[t];(n.title!==e.title||!n.originalTitle)&&(n.title=e.title,n.originalTitle=e.originalTitle||n.originalTitle)}l(e.path),s()},removeTag:e=>{if(e>=0&&e<a.value.length){let t=a.value.splice(e,1)[0]?.path??null;return s(),t}return null},removeOtherTags:e=>{
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,defineComponent as l,h as u,nextTick as d,openBlock as f,ref as p,renderList as m,resolveComponent as h,toDisplayString as g,unref as _,watch as v,withCtx as y,withModifiers as b}from"vue";import{NDropdown as x,NTag as S}from"naive-ui";import{useRoute as C,useRouter as w}from"vue-router";const T=e=>{if(!e||typeof e!=`object`)return!1;let t=e;return typeof t.path==`string`&&t.path.startsWith(`/`)&&!t.path.startsWith(`//`)&&typeof t.title==`string`},E=e=>{if(!(!e||typeof e!=`object`||Array.isArray(e)))return Object.fromEntries(Object.entries(e).filter(([e,t])=>![`__proto__`,`prototype`,`constructor`].includes(e)&&(e!==`affix`||typeof t==`boolean`)))};function D(e){if(!e)return[];try{let t=JSON.parse(e);return Array.isArray(t)?t.flatMap(e=>T(e)?[{path:e.path,title:e.title,originalTitle:typeof e.originalTitle==`string`?e.originalTitle:void 0,icon:typeof e.icon==`string`?e.icon:void 0,meta:E(e.meta)}]:[]):[]}catch{return[]}}function O(e={}){let{persistKey:t=`__tags_view_list__`,homePath:n=`/home`}=e,r=()=>{if(!t)return[];try{return D(localStorage.getItem(t))}catch{return[]}},i=e=>{if(t)try{localStorage.setItem(t,JSON.stringify(e))}catch{}},a=p(r()),o=p(``),s=()=>i(a.value),c=e=>{e?a.value=e:a.value=[...new Map(a.value.map(e=>[e.path,e])).values()],s()},l=e=>{o.value=e};return{tagsViewList:a,activeTag:o,homePath:n,initTags:c,setActiveTag:l,addTag:e=>{let t=a.value.findIndex(t=>t.path===e.path);if(t===-1)a.value.push(e);else{let n=a.value[t];(n.title!==e.title||!n.originalTitle)&&(n.title=e.title,n.originalTitle=e.originalTitle||n.originalTitle)}l(e.path),s()},removeTag:e=>{if(e>=0&&e<a.value.length){let t=a.value.splice(e,1)[0]?.path??null;return s(),t}return null},removeOtherTags:e=>{a.value=a.value.filter((t,n)=>n===0||t.meta?.affix||n===e),s()},removeLeftTags:e=>{a.value=a.value.filter((t,n)=>n===0||t.meta?.affix||n>=e),s()},removeRightTags:e=>{a.value=a.value.filter((t,n)=>t.meta?.affix||n<=e),s()},removeAllTags:()=>{a.value=a.value.filter(e=>e.meta?.affix),s()}}}const k={class:`tags-view-container`};var A=t(l({name:`C_TagsView`,__name:`index`,props:{labelFormatter:{},homePath:{default:`/home`},homeTitle:{default:`首页`},homeIcon:{default:`mdi:home`},persistKey:{default:`__tags_view_list__`},contextMenuLabels:{default:()=>({close:`关闭`,closeOthers:`关闭其他`,closeLeft:`关闭左侧`,closeRight:`关闭右侧`,closeAll:`关闭所有`})},tagsViewOptions:{}},emits:[`close`,`closeAll`],setup(t,{expose:l,emit:h}){let T=t,E=h,D=C(),A=w(),j=O(T.tagsViewOptions??{persistKey:T.persistKey,homePath:T.homePath});if(j.tagsViewList.value.length>0&&T.labelFormatter){let e=A.getRoutes(),t=j.tagsViewList.value.map(t=>{let n=e.find(e=>e.path===t.path),r=t.originalTitle||n?.meta?.title||t.title;return{...t,originalTitle:r,title:T.labelFormatter(r)}});j.initTags(t)}let M=e=>T.labelFormatter?T.labelFormatter(e):e,N=p(!1),P=p(0),F=p(0),I=p(null),L=p(-1),R=p(),z=p(),B=e=>e.path===D.path,V=e=>e.meta?.affix,H=e=>{let t=z.value;t&&(e.preventDefault(),t.scrollTo({left:t.scrollLeft+e.deltaY,behavior:`smooth`}))},U=e=>{d(()=>{let t=[...z.value?.querySelectorAll(`[data-path]`)??[]].find(t=>t.dataset.path===e);t&&t.scrollIntoView({behavior:`smooth`,block:`nearest`,inline:`center`})})},W=e=>{e.path!==D.path&&A.push(e.path).catch(()=>void 0),U(e.path)},G=(e,t)=>{if(V(e))return;let n=B(e),r=j.tagsViewList.value.length;if(j.removeTag(t),n){let e=j.tagsViewList.value,n=t===r-1,i;i=n?e[t-1]?.path||T.homePath:e[e.length-1]?.path||T.homePath,A.push(i).catch(()=>void 0),E(`close`,i)}},K=(e,t,n)=>{e.preventDefault(),I.value=t,L.value=n,N.value=!0,P.value=e.clientX,F.value=e.clientY},q=()=>N.value=!1,J=r(()=>{let e=T.contextMenuLabels;return[{type:`option`,label:e.close??`关闭`,key:`close`,disabled:V(I.value),icon:()=>u(`span`,{class:`i-mdi:close`})},{type:`option`,label:e.closeOthers??`关闭其他`,key:`closeOthers`,icon:()=>u(`span`,{class:`i-mdi:arrow-left-right-bold`})},{type:`option`,label:e.closeLeft??`关闭左侧`,key:`closeLeft`,icon:()=>u(`span`,{class:`i-mdi:align-horizontal-left`})},{type:`option`,label:e.closeRight??`关闭右侧`,key:`closeRight`,icon:()=>u(`span`,{class:`i-mdi:align-horizontal-right`})},{type:`option`,label:e.closeAll??`关闭所有`,key:`closeAll`,icon:()=>u(`span`,{class:`i-mdi:tally-mark-5`})}]}),Y=e=>{if(!(!I.value||L.value===-1)){switch(e){case`close`:G(I.value,L.value);break;case`closeOthers`:j.removeOtherTags(L.value);break;case`closeLeft`:j.removeLeftTags(L.value);break;case`closeRight`:j.removeRightTags(L.value);break;case`closeAll`:j.removeAllTags(),A.push(T.homePath).catch(()=>void 0),E(`closeAll`);break}q()}};return v(()=>D.path,e=>{let t=e===T.homePath?T.homeTitle:D.meta.title||`Unnamed Page`;j.addTag({path:e,originalTitle:t,title:M(t),icon:e===T.homePath?T.homeIcon:D.meta.icon,meta:{affix:D.meta.affix}}),j.setActiveTag(e),U(e)},{immediate:!0}),l({tags:j,scrollToTag:U}),(t,r)=>{let l=S,u=x;return f(),o(`div`,k,[s(`div`,{class:`tags-track`,ref_key:`tagsTrack`,ref:R,onWheel:H},[s(`div`,{class:`tags-container`,ref_key:`tagsContainer`,ref:z},[(f(!0),o(n,null,m(_(j).tagsViewList.value,(t,n)=>(f(),i(l,{key:t.path,type:B(t)?`primary`:`default`,closable:!V(t),"data-path":t.path,onClose:b(e=>G(t,n),[`stop`]),onClick:e=>W(t),onContextmenu:b(e=>K(e,t,n),[`prevent`])},{icon:y(()=>[t.icon?(f(),i(_(e),{key:0,name:t.icon,size:12},null,8,[`name`])):a(`v-if`,!0)]),default:y(()=>[c(` `+g(t.title),1)]),_:2},1032,[`type`,`closable`,`data-path`,`onClose`,`onClick`,`onContextmenu`]))),128))],512)],544),N.value?(f(),i(u,{key:0,show:N.value,options:J.value,x:P.value,y:F.value,onClickoutside:q,onSelect:Y},null,8,[`show`,`options`,`x`,`y`])):a(`v-if`,!0)])}}}),[[`__scopeId`,`data-v-83599594`]]);export{O as n,A as t};
|
package/dist/C_Transfer.css
CHANGED
|
@@ -65,6 +65,64 @@
|
|
|
65
65
|
.transform[data-v-075758a0]{transform:translateX(var(--un-translate-x)) translateY(var(--un-translate-y)) translateZ(var(--un-translate-z)) rotate(var(--un-rotate)) rotateX(var(--un-rotate-x)) rotateY(var(--un-rotate-y)) rotateZ(var(--un-rotate-z)) skewX(var(--un-skew-x)) skewY(var(--un-skew-y)) scaleX(var(--un-scale-x)) scaleY(var(--un-scale-y)) scaleZ(var(--un-scale-z));}
|
|
66
66
|
.px[data-v-075758a0]{padding-left:1rem;padding-right:1rem;}
|
|
67
67
|
|
|
68
|
+
.c-transfer__list[data-v-2d5e8cab] {
|
|
69
|
+
flex: 1;
|
|
70
|
+
overflow-y: auto;
|
|
71
|
+
padding: 4px 0;
|
|
72
|
+
min-height: 0;
|
|
73
|
+
max-height: var(--tf-height);
|
|
74
|
+
}
|
|
75
|
+
.c-transfer__list--virtual[data-v-2d5e8cab] {
|
|
76
|
+
padding: 0;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/* layer: default */
|
|
80
|
+
.flex[data-v-2d5e8cab]{display:flex;}
|
|
81
|
+
|
|
82
|
+
.c-transfer__item[data-v-af0b7c2e] {
|
|
83
|
+
display: flex;
|
|
84
|
+
align-items: center;
|
|
85
|
+
box-sizing: border-box;
|
|
86
|
+
height: var(--tf-item-height);
|
|
87
|
+
gap: 8px;
|
|
88
|
+
padding: 0 var(--tf-item-padding);
|
|
89
|
+
cursor: pointer;
|
|
90
|
+
transition: background 0.15s;
|
|
91
|
+
font-size: var(--tf-item-font-size);
|
|
92
|
+
color: var(--c-text-1, var(--text-color-1, #262626));
|
|
93
|
+
}
|
|
94
|
+
.c-transfer__item[data-v-af0b7c2e]:hover {
|
|
95
|
+
background: var(--tf-item-hover);
|
|
96
|
+
}
|
|
97
|
+
.c-transfer__item.is-disabled[data-v-af0b7c2e] {
|
|
98
|
+
opacity: 0.45;
|
|
99
|
+
cursor: not-allowed;
|
|
100
|
+
}
|
|
101
|
+
.c-transfer__item.is-disabled[data-v-af0b7c2e]:hover {
|
|
102
|
+
background: transparent;
|
|
103
|
+
}
|
|
104
|
+
.c-transfer__item.is-checked[data-v-af0b7c2e] {
|
|
105
|
+
color: var(--tf-accent);
|
|
106
|
+
font-weight: 500;
|
|
107
|
+
}
|
|
108
|
+
.c-transfer__item-icon[data-v-af0b7c2e] {
|
|
109
|
+
font-size: 16px;
|
|
110
|
+
flex-shrink: 0;
|
|
111
|
+
color: var(--c-text-3, var(--text-color-3, #a3a3a3));
|
|
112
|
+
}
|
|
113
|
+
.c-transfer__item-label[data-v-af0b7c2e] {
|
|
114
|
+
flex: 1;
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
text-overflow: ellipsis;
|
|
117
|
+
white-space: nowrap;
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/* layer: default */
|
|
121
|
+
.hidden[data-v-af0b7c2e]{display:none;}
|
|
122
|
+
.flex[data-v-af0b7c2e]{display:flex;}
|
|
123
|
+
.flex-shrink[data-v-af0b7c2e]{flex-shrink:1;}
|
|
124
|
+
.transition[data-v-af0b7c2e]{transition-property:color,background-color,border-color,text-decoration-color,fill,stroke,opacity,box-shadow,transform,filter,backdrop-filter;transition-timing-function:cubic-bezier(0.4, 0, 0.2, 1);transition-duration:150ms;}
|
|
125
|
+
|
|
68
126
|
/**
|
|
69
127
|
* C_Transfer — 穿梭框组件样式
|
|
70
128
|
* 变量说明:
|
|
@@ -74,7 +132,7 @@
|
|
|
74
132
|
* --tf-accent : 操作按钮主色
|
|
75
133
|
* --tf-height : 面板高度
|
|
76
134
|
*/
|
|
77
|
-
.c-transfer[data-v-
|
|
135
|
+
.c-transfer[data-v-65658ed2] {
|
|
78
136
|
--tf-border: var(--c-border, var(--border-color, #e5e7eb));
|
|
79
137
|
--tf-header-bg: color-mix(
|
|
80
138
|
in srgb,
|
|
@@ -88,13 +146,16 @@
|
|
|
88
146
|
);
|
|
89
147
|
--tf-accent: var(--c-primary, var(--primary-color, #2080f0));
|
|
90
148
|
--tf-height: 380px;
|
|
149
|
+
--tf-item-height: 34px;
|
|
150
|
+
--tf-item-padding: 14px;
|
|
151
|
+
--tf-item-font-size: 13px;
|
|
91
152
|
display: flex;
|
|
92
153
|
align-items: stretch;
|
|
93
154
|
gap: 16px;
|
|
94
155
|
user-select: none;
|
|
95
156
|
/* ======================== Panel ======================== */
|
|
96
157
|
}
|
|
97
|
-
.c-transfer__panel[data-v-
|
|
158
|
+
.c-transfer__panel[data-v-65658ed2] {
|
|
98
159
|
flex: 1;
|
|
99
160
|
display: flex;
|
|
100
161
|
flex-direction: column;
|
|
@@ -105,13 +166,13 @@
|
|
|
105
166
|
box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
|
|
106
167
|
transition: box-shadow 0.2s;
|
|
107
168
|
}
|
|
108
|
-
.c-transfer__panel[data-v-
|
|
169
|
+
.c-transfer__panel[data-v-65658ed2]:hover {
|
|
109
170
|
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.07);
|
|
110
171
|
}
|
|
111
|
-
.c-transfer[data-v-
|
|
172
|
+
.c-transfer[data-v-65658ed2] {
|
|
112
173
|
/* ---- Header ---- */
|
|
113
174
|
}
|
|
114
|
-
.c-transfer__header[data-v-
|
|
175
|
+
.c-transfer__header[data-v-65658ed2] {
|
|
115
176
|
display: flex;
|
|
116
177
|
align-items: center;
|
|
117
178
|
justify-content: space-between;
|
|
@@ -122,76 +183,26 @@
|
|
|
122
183
|
font-size: 13px;
|
|
123
184
|
color: var(--c-text-1, var(--text-color-1, #262626));
|
|
124
185
|
}
|
|
125
|
-
.c-transfer__count[data-v-
|
|
186
|
+
.c-transfer__count[data-v-65658ed2] {
|
|
126
187
|
font-weight: 400;
|
|
127
188
|
font-size: 12px;
|
|
128
189
|
color: var(--c-text-3, var(--text-color-3, #a3a3a3));
|
|
129
190
|
}
|
|
130
|
-
.c-transfer[data-v-
|
|
191
|
+
.c-transfer[data-v-65658ed2] {
|
|
131
192
|
/* ---- Filter ---- */
|
|
132
193
|
}
|
|
133
|
-
.c-transfer__filter[data-v-
|
|
194
|
+
.c-transfer__filter[data-v-65658ed2] {
|
|
134
195
|
padding: 8px 10px;
|
|
135
196
|
border-bottom: 1px solid var(--tf-border);
|
|
136
197
|
}
|
|
137
|
-
.c-transfer__filter .n-input[data-v-
|
|
198
|
+
.c-transfer__filter .n-input[data-v-65658ed2] {
|
|
138
199
|
--n-border: 1px solid var(--tf-border);
|
|
139
200
|
--n-border-focus: 1px solid var(--tf-accent);
|
|
140
201
|
}
|
|
141
|
-
.c-transfer[data-v-
|
|
142
|
-
/* ---- List ---- */
|
|
143
|
-
}
|
|
144
|
-
.c-transfer__list[data-v-faa66718] {
|
|
145
|
-
flex: 1;
|
|
146
|
-
overflow-y: auto;
|
|
147
|
-
padding: 4px 0;
|
|
148
|
-
min-height: 0;
|
|
149
|
-
max-height: var(--tf-height);
|
|
150
|
-
}
|
|
151
|
-
.c-transfer__item[data-v-faa66718] {
|
|
152
|
-
display: flex;
|
|
153
|
-
align-items: center;
|
|
154
|
-
gap: 8px;
|
|
155
|
-
padding: 7px 14px;
|
|
156
|
-
cursor: pointer;
|
|
157
|
-
transition: background 0.15s;
|
|
158
|
-
font-size: 13px;
|
|
159
|
-
color: var(--c-text-1, var(--text-color-1, #262626));
|
|
160
|
-
}
|
|
161
|
-
.c-transfer__item[data-v-faa66718]:hover {
|
|
162
|
-
background: var(--tf-item-hover);
|
|
163
|
-
}
|
|
164
|
-
.c-transfer__item.is-disabled[data-v-faa66718] {
|
|
165
|
-
opacity: 0.45;
|
|
166
|
-
cursor: not-allowed;
|
|
167
|
-
}
|
|
168
|
-
.c-transfer__item.is-disabled[data-v-faa66718]:hover {
|
|
169
|
-
background: transparent;
|
|
170
|
-
}
|
|
171
|
-
.c-transfer__item.is-checked[data-v-faa66718] {
|
|
172
|
-
color: var(--tf-accent);
|
|
173
|
-
font-weight: 500;
|
|
174
|
-
}
|
|
175
|
-
.c-transfer__item-icon[data-v-faa66718] {
|
|
176
|
-
font-size: 16px;
|
|
177
|
-
flex-shrink: 0;
|
|
178
|
-
color: var(--c-text-3, var(--text-color-3, #a3a3a3));
|
|
179
|
-
}
|
|
180
|
-
.c-transfer__item-label[data-v-faa66718] {
|
|
181
|
-
flex: 1;
|
|
182
|
-
overflow: hidden;
|
|
183
|
-
text-overflow: ellipsis;
|
|
184
|
-
white-space: nowrap;
|
|
185
|
-
}
|
|
186
|
-
.c-transfer__item-desc[data-v-faa66718] {
|
|
187
|
-
font-size: 11px;
|
|
188
|
-
color: var(--c-text-3, var(--text-color-3, #a3a3a3));
|
|
189
|
-
margin-top: 2px;
|
|
190
|
-
}
|
|
191
|
-
.c-transfer[data-v-faa66718] {
|
|
202
|
+
.c-transfer[data-v-65658ed2] {
|
|
192
203
|
/* ---- Empty ---- */
|
|
193
204
|
}
|
|
194
|
-
.c-transfer__empty[data-v-
|
|
205
|
+
.c-transfer__empty[data-v-65658ed2] {
|
|
195
206
|
display: flex;
|
|
196
207
|
align-items: center;
|
|
197
208
|
justify-content: center;
|
|
@@ -200,16 +211,16 @@
|
|
|
200
211
|
font-size: 13px;
|
|
201
212
|
padding: 32px 0;
|
|
202
213
|
}
|
|
203
|
-
.c-transfer[data-v-
|
|
214
|
+
.c-transfer[data-v-65658ed2] {
|
|
204
215
|
/* ======================== Actions ======================== */
|
|
205
216
|
}
|
|
206
|
-
.c-transfer__actions[data-v-
|
|
217
|
+
.c-transfer__actions[data-v-65658ed2] {
|
|
207
218
|
display: flex;
|
|
208
219
|
flex-direction: column;
|
|
209
220
|
justify-content: center;
|
|
210
221
|
gap: 10px;
|
|
211
222
|
}
|
|
212
|
-
.c-transfer__btn[data-v-
|
|
223
|
+
.c-transfer__btn[data-v-65658ed2] {
|
|
213
224
|
display: inline-flex;
|
|
214
225
|
align-items: center;
|
|
215
226
|
justify-content: center;
|
|
@@ -223,54 +234,52 @@
|
|
|
223
234
|
cursor: pointer;
|
|
224
235
|
transition: background 0.2s, color 0.2s, box-shadow 0.2s;
|
|
225
236
|
}
|
|
226
|
-
.c-transfer__btn[data-v-
|
|
237
|
+
.c-transfer__btn[data-v-65658ed2]:hover:not(.is-disabled) {
|
|
227
238
|
background: var(--tf-accent);
|
|
228
239
|
color: #fff;
|
|
229
240
|
box-shadow: 0 2px 8px color-mix(in srgb, var(--tf-accent) 30%, transparent);
|
|
230
241
|
}
|
|
231
|
-
.c-transfer__btn.is-disabled[data-v-
|
|
242
|
+
.c-transfer__btn.is-disabled[data-v-65658ed2] {
|
|
232
243
|
opacity: 0.35;
|
|
233
244
|
cursor: not-allowed;
|
|
234
245
|
}
|
|
235
|
-
.c-transfer[data-v-
|
|
246
|
+
.c-transfer[data-v-65658ed2] {
|
|
236
247
|
/* ======================== Sizes ======================== */
|
|
237
248
|
}
|
|
238
|
-
.c-transfer.is-small[data-v-
|
|
249
|
+
.c-transfer.is-small[data-v-65658ed2] {
|
|
239
250
|
--tf-height: 280px;
|
|
251
|
+
--tf-item-height: 28px;
|
|
252
|
+
--tf-item-padding: 12px;
|
|
253
|
+
--tf-item-font-size: 12px;
|
|
240
254
|
}
|
|
241
|
-
.c-transfer.is-small .c-transfer__header[data-v-
|
|
255
|
+
.c-transfer.is-small .c-transfer__header[data-v-65658ed2] {
|
|
242
256
|
padding: 8px 12px;
|
|
243
257
|
font-size: 12px;
|
|
244
258
|
}
|
|
245
|
-
.c-transfer.is-small .c-
|
|
246
|
-
padding: 5px 12px;
|
|
247
|
-
font-size: 12px;
|
|
248
|
-
}
|
|
249
|
-
.c-transfer.is-small .c-transfer__btn[data-v-faa66718] {
|
|
259
|
+
.c-transfer.is-small .c-transfer__btn[data-v-65658ed2] {
|
|
250
260
|
width: 30px;
|
|
251
261
|
height: 30px;
|
|
252
262
|
font-size: 15px;
|
|
253
263
|
}
|
|
254
|
-
.c-transfer.is-large[data-v-
|
|
264
|
+
.c-transfer.is-large[data-v-65658ed2] {
|
|
255
265
|
--tf-height: 480px;
|
|
266
|
+
--tf-item-height: 40px;
|
|
267
|
+
--tf-item-padding: 16px;
|
|
268
|
+
--tf-item-font-size: 14px;
|
|
256
269
|
}
|
|
257
|
-
.c-transfer.is-large .c-transfer__header[data-v-
|
|
270
|
+
.c-transfer.is-large .c-transfer__header[data-v-65658ed2] {
|
|
258
271
|
padding: 12px 16px;
|
|
259
272
|
font-size: 14px;
|
|
260
273
|
}
|
|
261
|
-
.c-transfer.is-large .c-
|
|
262
|
-
padding: 9px 16px;
|
|
263
|
-
font-size: 14px;
|
|
264
|
-
}
|
|
265
|
-
.c-transfer.is-large .c-transfer__btn[data-v-faa66718] {
|
|
274
|
+
.c-transfer.is-large .c-transfer__btn[data-v-65658ed2] {
|
|
266
275
|
width: 42px;
|
|
267
276
|
height: 42px;
|
|
268
277
|
font-size: 20px;
|
|
269
278
|
}
|
|
270
|
-
.c-transfer[data-v-
|
|
279
|
+
.c-transfer[data-v-65658ed2] {
|
|
271
280
|
/* ======================== Group divider ======================== */
|
|
272
281
|
}
|
|
273
|
-
.c-transfer__group[data-v-
|
|
282
|
+
.c-transfer__group[data-v-65658ed2] {
|
|
274
283
|
padding: 6px 14px 4px;
|
|
275
284
|
font-size: 11px;
|
|
276
285
|
font-weight: 600;
|
|
@@ -280,4 +289,4 @@
|
|
|
280
289
|
}
|
|
281
290
|
|
|
282
291
|
/* layer: default */
|
|
283
|
-
.visible[data-v-
|
|
292
|
+
.visible[data-v-65658ed2]{visibility:visible;}
|
package/dist/C_Transfer2.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`);
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./C_Icon2.cjs`),t=require(`./export-helper.cjs`);let n=require(`vue`),r=require(`naive-ui`),i=require(`vueuc`);const a={class:`c-transfer__item-label`},o=(0,n.defineComponent)({__name:`TransferRow`,props:{item:{},checked:{type:Boolean}},emits:[`check`],setup(t,{emit:i}){let o=t,s=i,c=()=>{o.item.disabled||s(`check`,o.item.key)};return(i,o)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{class:(0,n.normalizeClass)([`c-transfer__item`,{"is-disabled":t.item.disabled,"is-checked":t.checked}]),onClick:c},[(0,n.createVNode)((0,n.unref)(r.NCheckbox),{checked:t.checked,disabled:t.item.disabled,"aria-label":t.item.label,size:`small`,"onUpdate:checked":c,onClick:o[0]||=(0,n.withModifiers)(()=>{},[`stop`])},null,8,[`checked`,`disabled`,`aria-label`]),t.item.icon?((0,n.openBlock)(),(0,n.createBlock)(e.t,{key:0,name:t.item.icon,class:`c-transfer__item-icon`},null,8,[`name`])):(0,n.createCommentVNode)(`v-if`,!0),(0,n.createElementVNode)(`span`,a,(0,n.toDisplayString)(t.item.label),1)],2))}});var s=t.t(o,[[`__scopeId`,`data-v-af0b7c2e`]]);const c={key:1,class:`c-transfer__list`},l=(0,n.defineComponent)({__name:`TransferList`,props:{items:{},checked:{},size:{},virtualScroll:{type:Boolean},query:{}},emits:[`check`],setup(e,{emit:t}){let r=e,a=t,o=(0,n.shallowRef)(),l=(0,n.computed)(()=>r.size===`small`?28:r.size===`large`?40:34),u=(0,n.computed)(()=>r.virtualScroll!==!1&&r.items.length>=100);return(0,n.watch)(()=>r.query,()=>o.value?.scrollTo({top:0}),{flush:`post`}),(t,r)=>u.value?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(i.VVirtualList),{key:0,ref_key:`virtualList`,ref:o,class:`c-transfer__list c-transfer__list--virtual`,items:e.items,"item-size":l.value,"padding-top":4,"padding-bottom":4,style:(0,n.normalizeStyle)({height:`min(var(--tf-height), ${e.items.length*l.value+8}px)`})},{default:(0,n.withCtx)(({item:t})=>[(0,n.createVNode)(s,{item:t,checked:e.checked.has(t.key),onCheck:r[0]||=e=>a(`check`,e)},null,8,[`item`,`checked`])]),_:1},8,[`items`,`item-size`,`style`])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,c,[((0,n.openBlock)(!0),(0,n.createElementBlock)(n.Fragment,null,(0,n.renderList)(e.items,t=>((0,n.openBlock)(),(0,n.createBlock)(s,{key:t.key,item:t,checked:e.checked.has(t.key),onCheck:r[1]||=e=>a(`check`,e)},null,8,[`item`,`checked`]))),128))]))}});var u=t.t(l,[[`__scopeId`,`data-v-2d5e8cab`]]);function d(e,t){if(!t.size)return[];let n=[];for(let r of e)!r.disabled&&t.has(r.key)&&n.push(r.key);return n}function f(e,t){let n=!1;for(let r of e)if(!r.disabled){if(!t.has(r.key))return!1;n=!0}return n}const p={titles:[`可选列表`,`已选列表`],filterable:!1,filterPlaceholder:`搜索...`,showSelectAll:!0,sourceEmptyText:`暂无数据`,targetEmptyText:`未选择任何项`,size:`medium`,virtualScroll:!0},m={class:`c-transfer__panel`},h={class:`c-transfer__header`},g={key:1,class:`c-transfer__title`},_={class:`c-transfer__count`},v={key:0,class:`c-transfer__filter`},y={key:2,class:`c-transfer__empty`},b={class:`c-transfer__actions`},x=[`disabled`],S=[`disabled`],C={class:`c-transfer__panel`},w={class:`c-transfer__header`},T={key:1,class:`c-transfer__title`},E={class:`c-transfer__count`},D={key:0,class:`c-transfer__filter`},O={key:2,class:`c-transfer__empty`},k=(0,n.defineComponent)({__name:`index`,props:{data:{},modelValue:{},titles:{default:()=>p.titles},filterable:{type:Boolean,default:p.filterable},filterPlaceholder:{default:p.filterPlaceholder},filterMethod:{},showSelectAll:{type:Boolean,default:p.showSelectAll},sourceEmptyText:{default:p.sourceEmptyText},targetEmptyText:{default:p.targetEmptyText},size:{default:p.size},virtualScroll:{type:Boolean,default:p.virtualScroll}},emits:[`update:modelValue`,`change`],setup(t,{emit:i}){let a=t,o=i,s=(0,n.computed)(()=>({...p,...a})),c=(0,n.computed)(()=>{let e=new Map;for(let t of a.data)e.set(t.key,t);return e}),l=(0,n.computed)(()=>new Set(a.modelValue)),k=(0,n.computed)(()=>[...c.value.values()].filter(e=>!l.value.has(e.key))),A=(0,n.computed)(()=>{let e=[];for(let t of new Set(a.modelValue)){let n=c.value.get(t);n&&e.push(n)}return e}),j=(0,n.ref)(``),M=(0,n.ref)(``);function N(e,t){return t.label.toLowerCase().includes(e.toLowerCase())}let P=(0,n.computed)(()=>a.filterMethod??N),F=(0,n.computed)(()=>{let e=j.value.trim();return e?k.value.filter(t=>P.value(e,t)):k.value}),I=(0,n.computed)(()=>{let e=M.value.trim();return e?A.value.filter(t=>P.value(e,t)):A.value}),L=(0,n.reactive)(new Set),R=(0,n.reactive)(new Set),z=(0,n.computed)(()=>d(k.value,L)),B=(0,n.computed)(()=>d(A.value,R));(0,n.watch)([k,A],()=>{let e=new Set(k.value.filter(e=>!e.disabled).map(e=>e.key)),t=new Set(A.value.filter(e=>!e.disabled).map(e=>e.key));for(let t of L)e.has(t)||L.delete(t);for(let e of R)t.has(e)||R.delete(e)});function V(e){L.has(e)?L.delete(e):L.add(e)}function H(e){R.has(e)?R.delete(e):R.add(e)}let U=(0,n.computed)(()=>f(F.value,L)),W=(0,n.computed)(()=>!U.value&&F.value.some(e=>L.has(e.key))),G=(0,n.computed)(()=>f(I.value,R)),K=(0,n.computed)(()=>!G.value&&I.value.some(e=>R.has(e.key)));function q(e){for(let t of F.value)t.disabled||(e?L.add(t.key):L.delete(t.key))}function J(e){for(let t of I.value)t.disabled||(e?R.add(t.key):R.delete(t.key))}function Y(){let e=z.value;if(e.length===0)return;let t=[...new Set([...a.modelValue,...e])];o(`update:modelValue`,t),o(`change`,t,`right`,e),L.clear()}function X(){let e=B.value;if(e.length===0)return;let t=new Set(e),n=a.modelValue.filter(e=>!t.has(e));o(`update:modelValue`,n),o(`change`,n,`left`,e),R.clear()}return(t,i)=>((0,n.openBlock)(),(0,n.createElementBlock)(`div`,{class:(0,n.normalizeClass)([`c-transfer`,[`is-${s.value.size}`]])},[(0,n.createCommentVNode)(` ================ Source Panel ================ `),(0,n.createElementVNode)(`div`,m,[(0,n.createElementVNode)(`div`,h,[s.value.showSelectAll?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NCheckbox),{key:0,checked:U.value,indeterminate:W.value,"onUpdate:checked":q},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(s.value.titles?.[0]),1)]),_:1},8,[`checked`,`indeterminate`])):((0,n.openBlock)(),(0,n.createElementBlock)(`span`,g,(0,n.toDisplayString)(s.value.titles?.[0]),1)),(0,n.createElementVNode)(`span`,_,(0,n.toDisplayString)(L.size)+` / `+(0,n.toDisplayString)(k.value.length),1)]),s.value.filterable?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,v,[(0,n.createVNode)((0,n.unref)(r.NInput),{value:j.value,"onUpdate:value":i[0]||=e=>j.value=e,clearable:``,size:`small`,placeholder:s.value.filterPlaceholder,"input-props":{"aria-label":`搜索可选列表`}},{prefix:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:`mdi:magnify`})]),_:1},8,[`value`,`placeholder`])])):(0,n.createCommentVNode)(`v-if`,!0),F.value.length?((0,n.openBlock)(),(0,n.createBlock)(u,{key:1,items:F.value,checked:L,query:j.value,size:s.value.size,"virtual-scroll":s.value.virtualScroll,onCheck:V},null,8,[`items`,`checked`,`query`,`size`,`virtual-scroll`])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,y,(0,n.toDisplayString)(s.value.sourceEmptyText),1))]),(0,n.createCommentVNode)(` ================ Actions ================ `),(0,n.createElementVNode)(`div`,b,[(0,n.createElementVNode)(`button`,{type:`button`,class:(0,n.normalizeClass)([`c-transfer__btn`,{"is-disabled":z.value.length===0}]),"aria-label":`移至已选列表`,disabled:z.value.length===0,onClick:Y},[(0,n.createVNode)(e.t,{name:`mdi:chevron-right`})],10,x),(0,n.createElementVNode)(`button`,{type:`button`,class:(0,n.normalizeClass)([`c-transfer__btn`,{"is-disabled":B.value.length===0}]),"aria-label":`移回可选列表`,disabled:B.value.length===0,onClick:X},[(0,n.createVNode)(e.t,{name:`mdi:chevron-left`})],10,S)]),(0,n.createCommentVNode)(` ================ Target Panel ================ `),(0,n.createElementVNode)(`div`,C,[(0,n.createElementVNode)(`div`,w,[s.value.showSelectAll?((0,n.openBlock)(),(0,n.createBlock)((0,n.unref)(r.NCheckbox),{key:0,checked:G.value,indeterminate:K.value,"onUpdate:checked":J},{default:(0,n.withCtx)(()=>[(0,n.createTextVNode)((0,n.toDisplayString)(s.value.titles?.[1]),1)]),_:1},8,[`checked`,`indeterminate`])):((0,n.openBlock)(),(0,n.createElementBlock)(`span`,T,(0,n.toDisplayString)(s.value.titles?.[1]),1)),(0,n.createElementVNode)(`span`,E,(0,n.toDisplayString)(R.size)+` / `+(0,n.toDisplayString)(A.value.length),1)]),s.value.filterable?((0,n.openBlock)(),(0,n.createElementBlock)(`div`,D,[(0,n.createVNode)((0,n.unref)(r.NInput),{value:M.value,"onUpdate:value":i[1]||=e=>M.value=e,clearable:``,size:`small`,placeholder:s.value.filterPlaceholder,"input-props":{"aria-label":`搜索已选列表`}},{prefix:(0,n.withCtx)(()=>[(0,n.createVNode)(e.t,{name:`mdi:magnify`})]),_:1},8,[`value`,`placeholder`])])):(0,n.createCommentVNode)(`v-if`,!0),I.value.length?((0,n.openBlock)(),(0,n.createBlock)(u,{key:1,items:I.value,checked:R,query:M.value,size:s.value.size,"virtual-scroll":s.value.virtualScroll,onCheck:H},null,8,[`items`,`checked`,`query`,`size`,`virtual-scroll`])):((0,n.openBlock)(),(0,n.createElementBlock)(`div`,O,(0,n.toDisplayString)(s.value.targetEmptyText),1))])],2))}});var A=t.t(k,[[`__scopeId`,`data-v-65658ed2`]]);Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return A}});
|
package/dist/C_Transfer2.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,createVNode as l,defineComponent as u,normalizeClass as d,
|
|
1
|
+
import{t as e}from"./C_Icon2.js";import{t}from"./export-helper.js";import{Fragment as n,computed as r,createBlock as i,createCommentVNode as a,createElementBlock as o,createElementVNode as s,createTextVNode as c,createVNode as l,defineComponent as u,normalizeClass as d,normalizeStyle as f,openBlock as p,reactive as m,ref as h,renderList as g,shallowRef as _,toDisplayString as v,unref as y,watch as b,withCtx as x,withModifiers as S}from"vue";import{NCheckbox as C,NInput as w}from"naive-ui";import{VVirtualList as T}from"vueuc";const E={class:`c-transfer__item-label`};var D=t(u({__name:`TransferRow`,props:{item:{},checked:{type:Boolean}},emits:[`check`],setup(t,{emit:n}){let r=t,c=n,u=()=>{r.item.disabled||c(`check`,r.item.key)};return(n,r)=>(p(),o(`div`,{class:d([`c-transfer__item`,{"is-disabled":t.item.disabled,"is-checked":t.checked}]),onClick:u},[l(y(C),{checked:t.checked,disabled:t.item.disabled,"aria-label":t.item.label,size:`small`,"onUpdate:checked":u,onClick:r[0]||=S(()=>{},[`stop`])},null,8,[`checked`,`disabled`,`aria-label`]),t.item.icon?(p(),i(e,{key:0,name:t.item.icon,class:`c-transfer__item-icon`},null,8,[`name`])):a(`v-if`,!0),s(`span`,E,v(t.item.label),1)],2))}}),[[`__scopeId`,`data-v-af0b7c2e`]]);const O={key:1,class:`c-transfer__list`};var k=t(u({__name:`TransferList`,props:{items:{},checked:{},size:{},virtualScroll:{type:Boolean},query:{}},emits:[`check`],setup(e,{emit:t}){let a=e,s=t,c=_(),u=r(()=>a.size===`small`?28:a.size===`large`?40:34),d=r(()=>a.virtualScroll!==!1&&a.items.length>=100);return b(()=>a.query,()=>c.value?.scrollTo({top:0}),{flush:`post`}),(t,r)=>d.value?(p(),i(y(T),{key:0,ref_key:`virtualList`,ref:c,class:`c-transfer__list c-transfer__list--virtual`,items:e.items,"item-size":u.value,"padding-top":4,"padding-bottom":4,style:f({height:`min(var(--tf-height), ${e.items.length*u.value+8}px)`})},{default:x(({item:t})=>[l(D,{item:t,checked:e.checked.has(t.key),onCheck:r[0]||=e=>s(`check`,e)},null,8,[`item`,`checked`])]),_:1},8,[`items`,`item-size`,`style`])):(p(),o(`div`,O,[(p(!0),o(n,null,g(e.items,t=>(p(),i(D,{key:t.key,item:t,checked:e.checked.has(t.key),onCheck:r[1]||=e=>s(`check`,e)},null,8,[`item`,`checked`]))),128))]))}}),[[`__scopeId`,`data-v-2d5e8cab`]]);function A(e,t){if(!t.size)return[];let n=[];for(let r of e)!r.disabled&&t.has(r.key)&&n.push(r.key);return n}function j(e,t){let n=!1;for(let r of e)if(!r.disabled){if(!t.has(r.key))return!1;n=!0}return n}const M={titles:[`可选列表`,`已选列表`],filterable:!1,filterPlaceholder:`搜索...`,showSelectAll:!0,sourceEmptyText:`暂无数据`,targetEmptyText:`未选择任何项`,size:`medium`,virtualScroll:!0},N={class:`c-transfer__panel`},P={class:`c-transfer__header`},F={key:1,class:`c-transfer__title`},I={class:`c-transfer__count`},L={key:0,class:`c-transfer__filter`},R={key:2,class:`c-transfer__empty`},ee={class:`c-transfer__actions`},te=[`disabled`],ne=[`disabled`],re={class:`c-transfer__panel`},ie={class:`c-transfer__header`},z={key:1,class:`c-transfer__title`},B={class:`c-transfer__count`},V={key:0,class:`c-transfer__filter`},H={key:2,class:`c-transfer__empty`};var U=t(u({__name:`index`,props:{data:{},modelValue:{},titles:{default:()=>M.titles},filterable:{type:Boolean,default:M.filterable},filterPlaceholder:{default:M.filterPlaceholder},filterMethod:{},showSelectAll:{type:Boolean,default:M.showSelectAll},sourceEmptyText:{default:M.sourceEmptyText},targetEmptyText:{default:M.targetEmptyText},size:{default:M.size},virtualScroll:{type:Boolean,default:M.virtualScroll}},emits:[`update:modelValue`,`change`],setup(t,{emit:n}){let u=t,f=n,g=r(()=>({...M,...u})),_=r(()=>{let e=new Map;for(let t of u.data)e.set(t.key,t);return e}),S=r(()=>new Set(u.modelValue)),T=r(()=>[..._.value.values()].filter(e=>!S.value.has(e.key))),E=r(()=>{let e=[];for(let t of new Set(u.modelValue)){let n=_.value.get(t);n&&e.push(n)}return e}),D=h(``),O=h(``);function U(e,t){return t.label.toLowerCase().includes(e.toLowerCase())}let W=r(()=>u.filterMethod??U),G=r(()=>{let e=D.value.trim();return e?T.value.filter(t=>W.value(e,t)):T.value}),K=r(()=>{let e=O.value.trim();return e?E.value.filter(t=>W.value(e,t)):E.value}),q=m(new Set),J=m(new Set),Y=r(()=>A(T.value,q)),X=r(()=>A(E.value,J));b([T,E],()=>{let e=new Set(T.value.filter(e=>!e.disabled).map(e=>e.key)),t=new Set(E.value.filter(e=>!e.disabled).map(e=>e.key));for(let t of q)e.has(t)||q.delete(t);for(let e of J)t.has(e)||J.delete(e)});function ae(e){q.has(e)?q.delete(e):q.add(e)}function oe(e){J.has(e)?J.delete(e):J.add(e)}let Z=r(()=>j(G.value,q)),se=r(()=>!Z.value&&G.value.some(e=>q.has(e.key))),Q=r(()=>j(K.value,J)),ce=r(()=>!Q.value&&K.value.some(e=>J.has(e.key)));function le(e){for(let t of G.value)t.disabled||(e?q.add(t.key):q.delete(t.key))}function $(e){for(let t of K.value)t.disabled||(e?J.add(t.key):J.delete(t.key))}function ue(){let e=Y.value;if(e.length===0)return;let t=[...new Set([...u.modelValue,...e])];f(`update:modelValue`,t),f(`change`,t,`right`,e),q.clear()}function de(){let e=X.value;if(e.length===0)return;let t=new Set(e),n=u.modelValue.filter(e=>!t.has(e));f(`update:modelValue`,n),f(`change`,n,`left`,e),J.clear()}return(t,n)=>(p(),o(`div`,{class:d([`c-transfer`,[`is-${g.value.size}`]])},[a(` ================ Source Panel ================ `),s(`div`,N,[s(`div`,P,[g.value.showSelectAll?(p(),i(y(C),{key:0,checked:Z.value,indeterminate:se.value,"onUpdate:checked":le},{default:x(()=>[c(v(g.value.titles?.[0]),1)]),_:1},8,[`checked`,`indeterminate`])):(p(),o(`span`,F,v(g.value.titles?.[0]),1)),s(`span`,I,v(q.size)+` / `+v(T.value.length),1)]),g.value.filterable?(p(),o(`div`,L,[l(y(w),{value:D.value,"onUpdate:value":n[0]||=e=>D.value=e,clearable:``,size:`small`,placeholder:g.value.filterPlaceholder,"input-props":{"aria-label":`搜索可选列表`}},{prefix:x(()=>[l(e,{name:`mdi:magnify`})]),_:1},8,[`value`,`placeholder`])])):a(`v-if`,!0),G.value.length?(p(),i(k,{key:1,items:G.value,checked:q,query:D.value,size:g.value.size,"virtual-scroll":g.value.virtualScroll,onCheck:ae},null,8,[`items`,`checked`,`query`,`size`,`virtual-scroll`])):(p(),o(`div`,R,v(g.value.sourceEmptyText),1))]),a(` ================ Actions ================ `),s(`div`,ee,[s(`button`,{type:`button`,class:d([`c-transfer__btn`,{"is-disabled":Y.value.length===0}]),"aria-label":`移至已选列表`,disabled:Y.value.length===0,onClick:ue},[l(e,{name:`mdi:chevron-right`})],10,te),s(`button`,{type:`button`,class:d([`c-transfer__btn`,{"is-disabled":X.value.length===0}]),"aria-label":`移回可选列表`,disabled:X.value.length===0,onClick:de},[l(e,{name:`mdi:chevron-left`})],10,ne)]),a(` ================ Target Panel ================ `),s(`div`,re,[s(`div`,ie,[g.value.showSelectAll?(p(),i(y(C),{key:0,checked:Q.value,indeterminate:ce.value,"onUpdate:checked":$},{default:x(()=>[c(v(g.value.titles?.[1]),1)]),_:1},8,[`checked`,`indeterminate`])):(p(),o(`span`,z,v(g.value.titles?.[1]),1)),s(`span`,B,v(J.size)+` / `+v(E.value.length),1)]),g.value.filterable?(p(),o(`div`,V,[l(y(w),{value:O.value,"onUpdate:value":n[1]||=e=>O.value=e,clearable:``,size:`small`,placeholder:g.value.filterPlaceholder,"input-props":{"aria-label":`搜索已选列表`}},{prefix:x(()=>[l(e,{name:`mdi:magnify`})]),_:1},8,[`value`,`placeholder`])])):a(`v-if`,!0),K.value.length?(p(),i(k,{key:1,items:K.value,checked:J,query:O.value,size:g.value.size,"virtual-scroll":g.value.virtualScroll,onCheck:oe},null,8,[`items`,`checked`,`query`,`size`,`virtual-scroll`])):(p(),o(`div`,H,v(g.value.targetEmptyText),1))])],2))}}),[[`__scopeId`,`data-v-65658ed2`]]);export{M as n,U as t};
|