@robot-admin/naive-ui-components 0.22.1 → 0.23.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 +16 -0
- package/README.md +7 -5
- package/README_EN.md +7 -5
- package/dist/C_ActionBar.d.cts +2 -1
- package/dist/C_ActionBar.d.ts +2 -1
- package/dist/C_AntV2.cjs +3 -3
- package/dist/C_AntV2.js +3 -3
- package/dist/C_BatchResult.cjs +1 -0
- package/dist/C_BatchResult.css +32 -0
- package/dist/C_BatchResult.d.cts +2 -0
- package/dist/C_BatchResult.d.ts +2 -0
- package/dist/C_BatchResult.js +1 -0
- package/dist/C_BatchResult2.cjs +1 -0
- package/dist/C_BatchResult2.js +1 -0
- package/dist/C_Breadcrumb.d.cts +2 -2
- package/dist/C_Breadcrumb.d.ts +1 -1
- package/dist/C_Cascade.d.cts +1 -1
- package/dist/C_Cascade.d.ts +1 -1
- package/dist/C_Chat.d.cts +1 -1
- package/dist/C_Chat.d.ts +1 -1
- package/dist/C_City.d.cts +1 -1
- package/dist/C_City.d.ts +1 -1
- package/dist/C_Code.d.cts +1 -1
- package/dist/C_Code.d.ts +1 -1
- package/dist/C_ContextMenu.d.cts +1 -1
- package/dist/C_ContextMenu.d.ts +1 -1
- package/dist/C_DataPicker.cjs +1 -0
- package/dist/C_DataPicker.css +55 -0
- package/dist/C_DataPicker.d.cts +2 -0
- package/dist/C_DataPicker.d.ts +5 -0
- package/dist/C_DataPicker.js +1 -0
- package/dist/C_DataPicker2.cjs +1 -0
- package/dist/C_DataPicker2.js +1 -0
- package/dist/C_Date.d.cts +1 -1
- package/dist/C_Date.d.ts +1 -1
- package/dist/C_Density.cjs +1 -0
- package/dist/C_Density.css +1 -0
- package/dist/C_Density.d.cts +3 -0
- package/dist/C_Density.d.ts +3 -0
- package/dist/C_Density.js +1 -0
- package/dist/C_Density2.cjs +1 -0
- package/dist/C_Density2.js +1 -0
- package/dist/C_Editor.d.cts +1 -1
- package/dist/C_Editor.d.ts +1 -1
- package/dist/C_ErrorSummary.cjs +1 -0
- package/dist/C_ErrorSummary.css +29 -0
- package/dist/C_ErrorSummary.d.cts +3 -0
- package/dist/C_ErrorSummary.d.ts +3 -0
- package/dist/C_ErrorSummary.js +1 -0
- package/dist/C_ErrorSummary2.cjs +1 -0
- package/dist/C_ErrorSummary2.js +1 -0
- package/dist/C_Form.base.css +150 -148
- package/dist/C_Form.css +151 -253
- package/dist/C_Form.d.cts +1 -1
- package/dist/C_Form.d.ts +19 -2
- package/dist/C_FormModal.css +1 -2
- package/dist/C_FormModal.d.cts +1 -1
- package/dist/C_FormModal.d.ts +17 -2
- package/dist/C_FormSearch.cjs +1 -1
- package/dist/C_FormSearch.css +124 -52
- package/dist/C_FormSearch.d.cts +3 -3
- package/dist/C_FormSearch.d.ts +5 -4
- package/dist/C_FormSearch.js +1 -1
- package/dist/C_FormulaEditor.d.cts +1 -1
- package/dist/C_FormulaEditor.d.ts +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.cts +2 -2
- 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_SectionNav.cjs +1 -0
- package/dist/C_SectionNav.css +46 -0
- package/dist/C_SectionNav.d.cts +2 -0
- package/dist/C_SectionNav.d.ts +2 -0
- package/dist/C_SectionNav.js +1 -0
- package/dist/C_SectionNav2.cjs +1 -0
- package/dist/C_SectionNav2.js +1 -0
- package/dist/C_Skeleton.d.cts +1 -1
- package/dist/C_Skeleton.d.ts +1 -1
- package/dist/C_SplitPane2.cjs +1 -1
- package/dist/C_SplitPane2.js +1 -1
- package/dist/C_Steps.d.cts +1 -1
- package/dist/C_Steps.d.ts +1 -1
- package/dist/C_Table.base.css +258 -256
- package/dist/C_Table.cjs +1 -1
- package/dist/C_Table.css +109 -1283
- package/dist/C_Table.d.cts +2 -1
- package/dist/C_Table.d.ts +9 -8
- package/dist/C_Table.js +1 -1
- package/dist/C_Table2.cjs +3 -0
- package/dist/C_Table2.js +3 -0
- package/dist/C_Tabs.cjs +1 -1
- package/dist/C_Tabs.d.cts +1 -1
- package/dist/C_Tabs.d.ts +1 -1
- package/dist/C_Tabs.js +1 -1
- package/dist/C_TagsView.d.cts +1 -1
- package/dist/C_Theme.d.cts +1 -1
- package/dist/C_Theme.d.ts +1 -1
- package/dist/C_Timeline.d.cts +1 -1
- package/dist/C_Timeline.d.ts +1 -1
- package/dist/C_Transfer.d.cts +1 -1
- package/dist/C_Transfer.d.ts +1 -1
- package/dist/C_Tree.d.cts +1 -1
- package/dist/C_Tree.d.ts +9 -8
- package/dist/C_Upload.d.cts +1 -1
- package/dist/C_Upload.d.ts +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/Steps.cjs +1 -1
- package/dist/Steps.js +1 -1
- package/dist/Tabs.cjs +1 -1
- package/dist/Tabs.js +1 -1
- package/dist/batchPatch.cjs +1 -0
- package/dist/batchPatch.d.cts +26 -0
- package/dist/batchPatch.d.ts +26 -0
- package/dist/batchPatch.js +1 -0
- package/dist/config.cjs +1 -1
- package/dist/config.d.cts +4 -1
- package/dist/config.d.ts +6 -2
- package/dist/config.js +1 -1
- package/dist/config2.d.ts +1 -1
- package/dist/constants.d.cts +1 -1
- package/dist/constants.d.ts +1 -1
- package/dist/constants2.d.cts +402 -173
- package/dist/constants2.d.ts +402 -173
- package/dist/constants3.d.cts +3 -3
- package/dist/constants3.d.ts +3 -3
- package/dist/constants4.d.cts +173 -402
- package/dist/constants4.d.ts +173 -402
- package/dist/contracts.d.ts +24 -0
- package/dist/data.cjs +1 -1
- package/dist/data.d.cts +5 -108
- package/dist/data.d.ts +5 -108
- package/dist/data.js +1 -1
- package/dist/data2.cjs +1 -1
- package/dist/data2.d.cts +108 -0
- package/dist/data2.d.ts +108 -0
- package/dist/data2.js +1 -1
- package/dist/data3.cjs +1 -0
- package/dist/data3.js +1 -0
- package/dist/dateRange.d.cts +108 -13
- package/dist/dateRange.d.ts +110 -14
- package/dist/density.d.ts +15 -0
- package/dist/dictionary.cjs +1 -0
- package/dist/dictionary.d.cts +38 -0
- package/dist/dictionary.d.ts +38 -0
- package/dist/dictionary.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 +63 -52
- package/dist/index.d.ts +71 -57
- 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 +37 -80
- package/dist/index10.vue.d.ts +77 -53
- package/dist/index11.vue.d.cts +77 -53
- package/dist/index11.vue.d.ts +1117 -45
- package/dist/index12.vue.d.cts +1117 -45
- package/dist/index12.vue.d.ts +17 -128
- package/dist/index13.vue.d.cts +17 -128
- package/dist/index13.vue.d.ts +57 -53
- package/dist/index14.vue.d.cts +57 -53
- package/dist/index14.vue.d.ts +16 -25
- package/dist/index15.vue.d.cts +16 -25
- package/dist/index15.vue.d.ts +52 -12
- package/dist/index16.vue.d.cts +52 -12
- package/dist/index16.vue.d.ts +13 -129
- package/dist/index17.vue.d.cts +13 -129
- package/dist/index17.vue.d.ts +123 -74
- package/dist/index18.vue.d.cts +123 -74
- package/dist/index18.vue.d.ts +48 -71
- package/dist/index19.vue.d.cts +40 -91
- package/dist/index19.vue.d.ts +36 -96
- package/dist/index2.vue.d.cts +2 -2
- package/dist/index2.vue.d.ts +2 -2
- package/dist/index20.vue.d.cts +38 -47
- package/dist/index20.vue.d.ts +13 -48
- package/dist/index21.vue.d.cts +12 -96
- package/dist/index21.vue.d.ts +25 -95
- package/dist/index22.vue.d.cts +20 -32
- package/dist/index22.vue.d.ts +75 -37
- package/dist/index23.vue.d.cts +77 -13
- package/dist/index23.vue.d.ts +71 -13
- package/dist/index24.vue.d.cts +1 -1
- package/dist/index25.vue.d.cts +116 -90
- package/dist/index25.vue.d.ts +116 -90
- package/dist/index26.vue.d.cts +94 -59
- package/dist/index26.vue.d.ts +94 -59
- package/dist/index27.vue.d.cts +75 -0
- package/dist/index27.vue.d.ts +75 -0
- package/dist/index28.vue.d.cts +103 -0
- package/dist/index28.vue.d.ts +103 -0
- package/dist/index29.vue.d.cts +105 -0
- package/dist/index29.vue.d.ts +105 -0
- package/dist/index3.vue.d.cts +4 -4
- package/dist/index3.vue.d.ts +4 -4
- package/dist/index30.vue.d.cts +28 -0
- package/dist/index30.vue.d.ts +28 -0
- package/dist/index4.vue.d.cts +19 -128
- package/dist/index4.vue.d.ts +17 -34
- package/dist/index5.vue.d.cts +127 -35
- package/dist/index5.vue.d.ts +30 -19
- package/dist/index6.vue.d.cts +30 -19
- package/dist/index6.vue.d.ts +22 -118
- package/dist/index7.vue.d.cts +22 -118
- package/dist/index7.vue.d.ts +112 -18
- package/dist/index8.vue.d.cts +112 -18
- package/dist/index8.vue.d.ts +24 -35
- package/dist/index9.vue.d.cts +24 -35
- package/dist/index9.vue.d.ts +37 -80
- package/dist/numberCodec.cjs +1 -0
- package/dist/numberCodec.d.cts +25 -0
- package/dist/numberCodec.d.ts +25 -0
- package/dist/numberCodec.js +1 -0
- package/dist/observer.cjs +1 -0
- package/dist/observer.js +1 -0
- package/dist/presets.d.cts +2 -65
- package/dist/presets.d.ts +2 -65
- package/dist/resolver.cjs +1 -1
- package/dist/resolver.d.cts +1 -1
- package/dist/resolver.d.ts +1 -1
- package/dist/resolver.js +1 -1
- package/dist/serializeSearch.cjs +1 -0
- package/dist/serializeSearch.js +1 -0
- package/dist/style.css +548 -308
- package/dist/types.d.cts +60 -103
- package/dist/types.d.ts +62 -52
- package/dist/types2.d.cts +104 -51
- package/dist/types2.d.ts +56 -0
- package/dist/types3.d.cts +56 -0
- package/dist/useCollapsePanel.d.cts +3 -3
- package/dist/useCollapsePanel.d.ts +3 -3
- package/dist/useComponentLocale.cjs +1 -1
- package/dist/useComponentLocale.js +1 -1
- package/dist/useCropperCore.d.cts +7 -7
- package/dist/useCropperCore.d.ts +7 -7
- package/dist/useDataResource.cjs +1 -0
- package/dist/useDataResource.js +1 -0
- package/dist/useDictionary.cjs +1 -0
- package/dist/useDictionary.js +1 -0
- package/dist/useDynamicFormState.d.cts +960 -10
- package/dist/useDynamicFormState.d.ts +951 -11
- package/dist/useEdgeInteraction.d.cts +2 -2
- package/dist/useEdgeInteraction.d.ts +2 -2
- package/dist/useFormArray.cjs +1 -0
- package/dist/useFormArray.d.cts +69 -0
- package/dist/useFormArray.d.ts +69 -0
- package/dist/useFormArray.js +1 -0
- package/dist/useFormConfig.d.cts +14 -0
- package/dist/useFormConfig.d.ts +17 -38
- package/dist/useGridWidth.cjs +1 -0
- package/dist/useGridWidth.js +1 -0
- package/dist/useInfiniteScroll.d.cts +1 -1
- package/dist/useInfiniteScroll.d.ts +1 -1
- package/dist/useQRCode.d.cts +4 -4
- package/dist/useQRCode.d.ts +4 -4
- package/dist/useSignatureHistory.d.cts +4 -4
- package/dist/useSignatureHistory.d.ts +4 -4
- package/dist/useSplitResize.d.cts +4 -4
- package/dist/useSplitResize.d.ts +4 -4
- package/dist/useTableGlobalConfig.cjs +1 -0
- package/dist/useTableGlobalConfig.js +1 -0
- package/dist/useTableQuery.cjs +1 -3
- package/dist/useTableQuery.js +1 -3
- package/dist/useWorkflowValidation.d.cts +2 -2
- package/dist/useWorkflowValidation.d.ts +2 -2
- package/dist/validation.cjs +1 -0
- package/dist/validation.d.cts +18 -0
- package/dist/validation.d.ts +18 -0
- package/dist/validation.js +1 -0
- package/dist/verification.d.cts +2 -2
- package/dist/verification.d.ts +3 -3
- package/dist/workflows.cjs +1 -0
- package/dist/workflows.d.cts +2 -0
- package/dist/workflows.d.ts +2 -0
- package/dist/workflows.js +1 -0
- package/docs/components.en.md +13 -1
- package/docs/components.md +13 -1
- package/docs/guides/batch-results.md +47 -0
- package/docs/guides/data-picker.md +65 -0
- package/docs/guides/data-workflows.md +123 -0
- package/docs/guides/form-density.en.md +39 -0
- package/docs/guides/form-density.md +39 -0
- package/docs/guides/search-workflows.md +164 -0
- package/package.json +21 -1
- package/dist/C_FormSearch2.cjs +0 -1
- package/dist/C_FormSearch2.js +0 -1
- package/dist/useTableQuery.d.cts +0 -1957
- package/dist/useTableQuery.d.ts +0 -1946
|
@@ -264,10 +264,10 @@ declare const __VLS_export: vue.DefineComponent<Props, {
|
|
|
264
264
|
onReady?: ((graph: Graph) => any) | undefined;
|
|
265
265
|
"onData-change"?: ((data: DiagramData) => any) | undefined;
|
|
266
266
|
}>, {
|
|
267
|
-
height: string | number;
|
|
268
267
|
theme: "light" | "dark";
|
|
269
|
-
readonly: boolean;
|
|
270
268
|
width: string | number;
|
|
269
|
+
height: string | number;
|
|
270
|
+
readonly: boolean;
|
|
271
271
|
showToolbar: boolean;
|
|
272
272
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
273
273
|
declare const _default: typeof __VLS_export;
|
|
@@ -264,10 +264,10 @@ declare const __VLS_export: vue.DefineComponent<Props, {
|
|
|
264
264
|
onReady?: ((graph: Graph) => any) | undefined;
|
|
265
265
|
"onData-change"?: ((data: DiagramData) => any) | undefined;
|
|
266
266
|
}>, {
|
|
267
|
-
height: string | number;
|
|
268
267
|
theme: "light" | "dark";
|
|
269
|
-
readonly: boolean;
|
|
270
268
|
width: string | number;
|
|
269
|
+
height: string | number;
|
|
270
|
+
readonly: boolean;
|
|
271
271
|
showToolbar: boolean;
|
|
272
272
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
273
273
|
declare const _default: typeof __VLS_export;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);const e=require(`./validation.cjs`),t=require(`./data2.cjs`);let n=require(`vue`);function r(t,n){return{...n,source:t,key:e.n(t,n.message,n.target,n.key),target:n.target?{...n.target}:void 0}}function i(){let t=(0,n.shallowRef)(new Map),i=(0,n.shallowRef)([]),a=(0,n.shallowRef)(!1),o=(0,n.shallowRef)(null),s=0,c=!1,l,u,d=0,f=()=>{s++;let e=l;l=void 0,u=void 0,e?.abort(),!l&&!u&&(a.value=!1)},p=e=>{if(c)throw Error(`校验区域已销毁`);let{id:n}=e;if(!n||t.value.has(n))throw Error(`校验区域标识必须唯一:${n}`);if(f(),c)throw Error(`校验区域已销毁`);if(t.value.has(n))throw Error(`校验区域标识必须唯一:${n}`);return t.value=new Map(t.value).set(n,e),()=>{if(t.value.get(n)!==e||(f(),c||t.value.get(n)!==e))return;let r=new Set(i.value.filter(e=>e.source===n));if(d++,o.value=null,c||t.value.get(n)!==e)return;let a=new Map(t.value);a.delete(n),t.value=a,c||(i.value=i.value.filter(e=>!r.has(e)))}},m=()=>{if(c)return Promise.resolve(!1);if(u)return u;let n=s,o=new AbortController;l=o;let d=()=>!c&&n===s&&l===o&&!o.signal.aborted,f=Promise.resolve().then(async()=>{if(c||n!==s)return!1;let a=await Promise.all([...t.value].map(async([t,n])=>{if(!d())return[];try{let e=await n.validate(o.signal);return d()?(e??[]).map(e=>r(t,e)):[]}catch(n){return d()?e.t(n,t):[]}}));if(c||n!==s)return!1;let l=new Map;for(let e of a)for(let t of e)l.set(t.key,t);let u=[...l.values()];return i.value=u,n===s&&!c&&u.length===0}),p=()=>{l===o&&(l=void 0,u=void 0,a.value=!1)},m=f.then(e=>(p(),!c&&n===s&&e),e=>{throw p(),e});return u=m,a.value=!0,m},h=async e=>{if(c)return!1;let n=++d,{source:r}=e,i=t.value.get(r),a=()=>!c&&n===d&&t.value.get(r)===i;if(o.value=null,!a()||!i?.reveal)return!1;try{let t=await i.reveal({...e,target:e.target?{...e.target}:void 0});return a()&&t!==!1}catch(e){return a()&&(o.value=e),!1}},g=()=>{f(),d++,o.value=null,i.value=[]},_=()=>{c||(c=!0,g(),t.value=new Map)};return(0,n.getCurrentScope)()&&(0,n.onScopeDispose)(_),{issues:i,validating:a,navigationError:o,dirty:(0,n.computed)(()=>[...t.value.values()].some(e=>e.dirty?.())),register:p,validate:m,reveal:h,clear:g,dispose:_}}function a(e=[],r={}){let i=r.maxRows??1e3;if(!Number.isInteger(i)||i<1)throw RangeError(`maxRows 必须是正整数`);let a=0,o=t.t(e),s=(0,n.shallowRef)([]),c=e=>({key:`row-${a++}`,value:(0,n.reactive)(t.t(e))}),l=(e=o)=>{if(e.length>i)throw RangeError(`重复表单超出 maxRows`);s.value=e.map(c)};return l(),{items:s,append:e=>{if(s.value.length>=i)throw RangeError(`重复表单超出 maxRows`);let t=c(e);return s.value=[...s.value,t],t.key},remove:e=>{let t=s.value.filter(t=>t.key!==e);return t.length===s.value.length?!1:(s.value=t,!0)},move:(e,t)=>{let n=s.value.find(t=>t.key===e);if(!n||e===t||t!==null&&!s.value.some(e=>e.key===t))return!1;let r=s.value.filter(e=>e!==n),i=t===null?r.length:r.findIndex(e=>e.key===t);return r.splice(i,0,n),s.value=r,!0},reset:l,getValues:()=>s.value.map(e=>t.t(e.value))}}Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return i}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return a}});
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { t as ValidationIssue } from "./validation.cjs";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
import { MaybeRefOrGetter, UnwrapNestedRefs } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/composables/useDataResource.d.ts
|
|
6
|
+
type DataResourceStatus = 'idle' | 'loading' | 'ready' | 'empty' | 'error';
|
|
7
|
+
interface DataResourceOptions<K extends string | number, T> {
|
|
8
|
+
key: MaybeRefOrGetter<K | null | undefined>;
|
|
9
|
+
load: (context: {
|
|
10
|
+
key: K;
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
}) => Promise<T>;
|
|
13
|
+
/** undefined 表示未提供本地源;[]、null 等其它值均由本地源拥有。 */
|
|
14
|
+
source?: MaybeRefOrGetter<T | undefined>;
|
|
15
|
+
immediate?: boolean;
|
|
16
|
+
isEmpty?: (data: T) => boolean;
|
|
17
|
+
onError?: (error: unknown) => void;
|
|
18
|
+
}
|
|
19
|
+
/** 独立区域的请求状态,既不持有全局缓存,也不决定业务主从关系。 */
|
|
20
|
+
declare function useDataResource<K extends string | number, T>(options: DataResourceOptions<K, T>): {
|
|
21
|
+
data: vue.ShallowRef<T | undefined, T | undefined>;
|
|
22
|
+
error: vue.ShallowRef<unknown, unknown>;
|
|
23
|
+
status: vue.ShallowRef<DataResourceStatus, DataResourceStatus>;
|
|
24
|
+
loading: vue.ComputedRef<boolean>; /** 同一 key 刷新失败时保留原展示,但明确标为旧快照。 */
|
|
25
|
+
stale: vue.ComputedRef<boolean>;
|
|
26
|
+
reload: () => Promise<boolean>;
|
|
27
|
+
abort: () => void;
|
|
28
|
+
dispose: () => void;
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/composables/useValidationScope.d.ts
|
|
32
|
+
interface ValidationParticipant {
|
|
33
|
+
id: string;
|
|
34
|
+
dirty?: () => boolean;
|
|
35
|
+
validate: (signal: AbortSignal) => void | readonly ValidationIssue[] | Promise<void | readonly ValidationIssue[]>;
|
|
36
|
+
/** 先切 Tab/展开分区,再定位稳定 rowKey/field;返回 false 表示目标不存在。 */
|
|
37
|
+
reveal?: (issue: ValidationIssue) => boolean | void | Promise<boolean | void>;
|
|
38
|
+
}
|
|
39
|
+
/** 注册当前真实区域,不遍历整张业务单据的数据图。 */
|
|
40
|
+
declare function useValidationScope(): {
|
|
41
|
+
issues: vue.ShallowRef<readonly ValidationIssue[], readonly ValidationIssue[]>;
|
|
42
|
+
validating: vue.ShallowRef<boolean, boolean>;
|
|
43
|
+
navigationError: vue.ShallowRef<unknown, unknown>;
|
|
44
|
+
dirty: vue.ComputedRef<boolean>;
|
|
45
|
+
register: (participant: ValidationParticipant) => () => void;
|
|
46
|
+
validate: () => Promise<boolean>;
|
|
47
|
+
reveal: (issue: ValidationIssue) => Promise<boolean>;
|
|
48
|
+
clear: () => void;
|
|
49
|
+
dispose: () => void;
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/composables/useFormArray.d.ts
|
|
53
|
+
interface FormArrayEntry<T extends object> {
|
|
54
|
+
readonly key: string;
|
|
55
|
+
value: UnwrapNestedRefs<T>;
|
|
56
|
+
}
|
|
57
|
+
/** 所有 key 仅属于此实例,增删移动不会把另一行的校验/草稿借给当前行。 */
|
|
58
|
+
declare function useFormArray<T extends object>(initial?: readonly T[], options?: {
|
|
59
|
+
maxRows?: number;
|
|
60
|
+
}): {
|
|
61
|
+
items: vue.ShallowRef<readonly FormArrayEntry<T>[], readonly FormArrayEntry<T>[]>;
|
|
62
|
+
append: (value: T) => string;
|
|
63
|
+
remove: (key: string) => boolean;
|
|
64
|
+
move: (key: string, before: string | null) => boolean;
|
|
65
|
+
reset: (values?: readonly T[]) => void;
|
|
66
|
+
getValues: () => T[];
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { DataResourceOptions as a, useValidationScope as i, useFormArray as n, DataResourceStatus as o, ValidationParticipant as r, useDataResource as s, FormArrayEntry as t };
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
import { t as ValidationIssue } from "./validation.js";
|
|
2
|
+
import * as vue from "vue";
|
|
3
|
+
import { MaybeRefOrGetter, UnwrapNestedRefs } from "vue";
|
|
4
|
+
|
|
5
|
+
//#region src/composables/useDataResource.d.ts
|
|
6
|
+
type DataResourceStatus = 'idle' | 'loading' | 'ready' | 'empty' | 'error';
|
|
7
|
+
interface DataResourceOptions<K extends string | number, T> {
|
|
8
|
+
key: MaybeRefOrGetter<K | null | undefined>;
|
|
9
|
+
load: (context: {
|
|
10
|
+
key: K;
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
}) => Promise<T>;
|
|
13
|
+
/** undefined 表示未提供本地源;[]、null 等其它值均由本地源拥有。 */
|
|
14
|
+
source?: MaybeRefOrGetter<T | undefined>;
|
|
15
|
+
immediate?: boolean;
|
|
16
|
+
isEmpty?: (data: T) => boolean;
|
|
17
|
+
onError?: (error: unknown) => void;
|
|
18
|
+
}
|
|
19
|
+
/** 独立区域的请求状态,既不持有全局缓存,也不决定业务主从关系。 */
|
|
20
|
+
declare function useDataResource<K extends string | number, T>(options: DataResourceOptions<K, T>): {
|
|
21
|
+
data: vue.ShallowRef<T | undefined, T | undefined>;
|
|
22
|
+
error: vue.ShallowRef<unknown, unknown>;
|
|
23
|
+
status: vue.ShallowRef<DataResourceStatus, DataResourceStatus>;
|
|
24
|
+
loading: vue.ComputedRef<boolean>; /** 同一 key 刷新失败时保留原展示,但明确标为旧快照。 */
|
|
25
|
+
stale: vue.ComputedRef<boolean>;
|
|
26
|
+
reload: () => Promise<boolean>;
|
|
27
|
+
abort: () => void;
|
|
28
|
+
dispose: () => void;
|
|
29
|
+
};
|
|
30
|
+
//#endregion
|
|
31
|
+
//#region src/composables/useValidationScope.d.ts
|
|
32
|
+
interface ValidationParticipant {
|
|
33
|
+
id: string;
|
|
34
|
+
dirty?: () => boolean;
|
|
35
|
+
validate: (signal: AbortSignal) => void | readonly ValidationIssue[] | Promise<void | readonly ValidationIssue[]>;
|
|
36
|
+
/** 先切 Tab/展开分区,再定位稳定 rowKey/field;返回 false 表示目标不存在。 */
|
|
37
|
+
reveal?: (issue: ValidationIssue) => boolean | void | Promise<boolean | void>;
|
|
38
|
+
}
|
|
39
|
+
/** 注册当前真实区域,不遍历整张业务单据的数据图。 */
|
|
40
|
+
declare function useValidationScope(): {
|
|
41
|
+
issues: vue.ShallowRef<readonly ValidationIssue[], readonly ValidationIssue[]>;
|
|
42
|
+
validating: vue.ShallowRef<boolean, boolean>;
|
|
43
|
+
navigationError: vue.ShallowRef<unknown, unknown>;
|
|
44
|
+
dirty: vue.ComputedRef<boolean>;
|
|
45
|
+
register: (participant: ValidationParticipant) => () => void;
|
|
46
|
+
validate: () => Promise<boolean>;
|
|
47
|
+
reveal: (issue: ValidationIssue) => Promise<boolean>;
|
|
48
|
+
clear: () => void;
|
|
49
|
+
dispose: () => void;
|
|
50
|
+
};
|
|
51
|
+
//#endregion
|
|
52
|
+
//#region src/composables/useFormArray.d.ts
|
|
53
|
+
interface FormArrayEntry<T extends object> {
|
|
54
|
+
readonly key: string;
|
|
55
|
+
value: UnwrapNestedRefs<T>;
|
|
56
|
+
}
|
|
57
|
+
/** 所有 key 仅属于此实例,增删移动不会把另一行的校验/草稿借给当前行。 */
|
|
58
|
+
declare function useFormArray<T extends object>(initial?: readonly T[], options?: {
|
|
59
|
+
maxRows?: number;
|
|
60
|
+
}): {
|
|
61
|
+
items: vue.ShallowRef<readonly FormArrayEntry<T>[], readonly FormArrayEntry<T>[]>;
|
|
62
|
+
append: (value: T) => string;
|
|
63
|
+
remove: (key: string) => boolean;
|
|
64
|
+
move: (key: string, before: string | null) => boolean;
|
|
65
|
+
reset: (values?: readonly T[]) => void;
|
|
66
|
+
getValues: () => T[];
|
|
67
|
+
};
|
|
68
|
+
//#endregion
|
|
69
|
+
export { DataResourceOptions as a, useValidationScope as i, useFormArray as n, DataResourceStatus as o, ValidationParticipant as r, useDataResource as s, FormArrayEntry as t };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{n as e,t}from"./validation.js";import{t as n}from"./data2.js";import{computed as r,getCurrentScope as i,onScopeDispose as a,reactive as o,shallowRef as s}from"vue";function c(t,n){return{...n,source:t,key:e(t,n.message,n.target,n.key),target:n.target?{...n.target}:void 0}}function l(){let e=s(new Map),n=s([]),o=s(!1),l=s(null),u=0,d=!1,f,p,m=0,h=()=>{u++;let e=f;f=void 0,p=void 0,e?.abort(),!f&&!p&&(o.value=!1)},g=t=>{if(d)throw Error(`校验区域已销毁`);let{id:r}=t;if(!r||e.value.has(r))throw Error(`校验区域标识必须唯一:${r}`);if(h(),d)throw Error(`校验区域已销毁`);if(e.value.has(r))throw Error(`校验区域标识必须唯一:${r}`);return e.value=new Map(e.value).set(r,t),()=>{if(e.value.get(r)!==t||(h(),d||e.value.get(r)!==t))return;let i=new Set(n.value.filter(e=>e.source===r));if(m++,l.value=null,d||e.value.get(r)!==t)return;let a=new Map(e.value);a.delete(r),e.value=a,d||(n.value=n.value.filter(e=>!i.has(e)))}},_=()=>{if(d)return Promise.resolve(!1);if(p)return p;let r=u,i=new AbortController;f=i;let a=()=>!d&&r===u&&f===i&&!i.signal.aborted,s=Promise.resolve().then(async()=>{if(d||r!==u)return!1;let o=await Promise.all([...e.value].map(async([e,n])=>{if(!a())return[];try{let t=await n.validate(i.signal);return a()?(t??[]).map(t=>c(e,t)):[]}catch(n){return a()?t(n,e):[]}}));if(d||r!==u)return!1;let s=new Map;for(let e of o)for(let t of e)s.set(t.key,t);let l=[...s.values()];return n.value=l,r===u&&!d&&l.length===0}),l=()=>{f===i&&(f=void 0,p=void 0,o.value=!1)},m=s.then(e=>(l(),!d&&r===u&&e),e=>{throw l(),e});return p=m,o.value=!0,m},v=async t=>{if(d)return!1;let n=++m,{source:r}=t,i=e.value.get(r),a=()=>!d&&n===m&&e.value.get(r)===i;if(l.value=null,!a()||!i?.reveal)return!1;try{let e=await i.reveal({...t,target:t.target?{...t.target}:void 0});return a()&&e!==!1}catch(e){return a()&&(l.value=e),!1}},y=()=>{h(),m++,l.value=null,n.value=[]},b=()=>{d||(d=!0,y(),e.value=new Map)};return i()&&a(b),{issues:n,validating:o,navigationError:l,dirty:r(()=>[...e.value.values()].some(e=>e.dirty?.())),register:g,validate:_,reveal:v,clear:y,dispose:b}}function u(e=[],t={}){let r=t.maxRows??1e3;if(!Number.isInteger(r)||r<1)throw RangeError(`maxRows 必须是正整数`);let i=0,a=n(e),c=s([]),l=e=>({key:`row-${i++}`,value:o(n(e))}),u=(e=a)=>{if(e.length>r)throw RangeError(`重复表单超出 maxRows`);c.value=e.map(l)};return u(),{items:c,append:e=>{if(c.value.length>=r)throw RangeError(`重复表单超出 maxRows`);let t=l(e);return c.value=[...c.value,t],t.key},remove:e=>{let t=c.value.filter(t=>t.key!==e);return t.length===c.value.length?!1:(c.value=t,!0)},move:(e,t)=>{let n=c.value.find(t=>t.key===e);if(!n||e===t||t!==null&&!c.value.some(e=>e.key===t))return!1;let r=c.value.filter(e=>e!==n),i=t===null?r.length:r.findIndex(e=>e.key===t);return r.splice(i,0,n),c.value=r,!0},reset:u,getValues:()=>c.value.map(e=>n(e.value))}}export{l as n,u as t};
|
package/dist/useFormConfig.d.cts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { n as ComponentLocale, t as ComponentFeedback } from "./contracts.cjs";
|
|
2
|
+
import { t as DictionaryBinding } from "./dictionary.cjs";
|
|
2
3
|
import { t as ComponentDensity } from "./density.cjs";
|
|
3
4
|
import { CSSProperties, ComputedRef, DeepReadonly, VNode } from "vue";
|
|
4
5
|
import { FormInst, FormItemRule } from "naive-ui";
|
|
@@ -157,6 +158,8 @@ interface ItemLayoutConfig {
|
|
|
157
158
|
*/
|
|
158
159
|
interface GridLayoutConfig {
|
|
159
160
|
cols?: number;
|
|
161
|
+
/** 可选的字段最小宽度(包含 label);responsive=false 时不自动扩展。 */
|
|
162
|
+
minItemWidth?: number;
|
|
160
163
|
gutter?: number;
|
|
161
164
|
yGutter?: number;
|
|
162
165
|
xGap?: number;
|
|
@@ -286,12 +289,21 @@ interface FormOptionBase<T extends object> {
|
|
|
286
289
|
rules?: readonly FormValidationRule[];
|
|
287
290
|
attrs?: Record<string, unknown>;
|
|
288
291
|
children?: OptionItem[];
|
|
292
|
+
/** 应用字典名称或直接选项源;asyncOptions、显式 children 优先。 */
|
|
293
|
+
dictionary?: DictionaryBinding;
|
|
289
294
|
show?: boolean;
|
|
290
295
|
layout?: ItemLayoutConfig;
|
|
291
296
|
help?: string;
|
|
292
297
|
required?: boolean;
|
|
293
298
|
dependsOn?: FieldPath<T> | FieldPath<T>[];
|
|
294
299
|
showWhen?: (formModel: FormModel<T>) => boolean;
|
|
300
|
+
/** 自定义/虚拟控件准备并返回真实焦点目标;由表单校验状态后执行 focus。 */
|
|
301
|
+
focusTarget?: (context: {
|
|
302
|
+
field: FieldPath<T>;
|
|
303
|
+
element: HTMLElement | null;
|
|
304
|
+
model: FormModel<T>;
|
|
305
|
+
signal: AbortSignal;
|
|
306
|
+
}) => MaybePromise<HTMLElement | null>;
|
|
295
307
|
/** 字段级禁用(优先级高于全局 config.disabled) */
|
|
296
308
|
disabled?: boolean | ((formModel: FormModel<T>) => boolean);
|
|
297
309
|
/** 字段级只读(优先级高于全局 config.readonly) */
|
|
@@ -322,6 +334,8 @@ interface SubmitEventPayload<T extends object = FormRecord> {
|
|
|
322
334
|
*/
|
|
323
335
|
interface FormInstance<T extends object = FormRecord> {
|
|
324
336
|
validate(): Promise<void>;
|
|
337
|
+
/** 展开字段所在区域并聚焦可用控件;隐藏、只读、禁用或切换被阻止时返回 false。 */
|
|
338
|
+
revealField(field: string): Promise<boolean>;
|
|
325
339
|
validateField(field: FieldPath<T> | FieldPath<T>[]): Promise<void>;
|
|
326
340
|
validateStep(step: number | string): Promise<boolean>;
|
|
327
341
|
validateTab(tabKey: string): Promise<boolean>;
|
package/dist/useFormConfig.d.ts
CHANGED
|
@@ -1,30 +1,10 @@
|
|
|
1
|
+
import { n as ComponentLocale, t as ComponentFeedback } from "./contracts.js";
|
|
2
|
+
import { t as DictionaryBinding } from "./dictionary.js";
|
|
3
|
+
import { t as ComponentDensity } from "./density.js";
|
|
1
4
|
import { CSSProperties, ComputedRef, DeepReadonly, VNode } from "vue";
|
|
2
5
|
import { FormInst, FormItemRule } from "naive-ui";
|
|
3
6
|
import { NAIVE_COMBOS, NaiveRule, PRESET_RULES, RuleSpec, RuleSpec as RuleSpec$1, SPEC_RULES } from "@robot-admin/form-validate";
|
|
4
7
|
|
|
5
|
-
//#region src/core/contracts.d.ts
|
|
6
|
-
/** UI-independent feedback and locale protocols. No framework runtime is imported here. */
|
|
7
|
-
interface ConfirmOptions {
|
|
8
|
-
title: string;
|
|
9
|
-
content: string;
|
|
10
|
-
positiveText?: string;
|
|
11
|
-
negativeText?: string;
|
|
12
|
-
type?: 'warning' | 'error' | 'info' | 'success';
|
|
13
|
-
}
|
|
14
|
-
interface ComponentFeedback {
|
|
15
|
-
success?: (message: string) => void;
|
|
16
|
-
error?: (message: string, cause?: unknown) => void;
|
|
17
|
-
warning?: (message: string) => void;
|
|
18
|
-
info?: (message: string) => void;
|
|
19
|
-
confirm?: (options: ConfirmOptions) => boolean | Promise<boolean>;
|
|
20
|
-
}
|
|
21
|
-
type ComponentLocaleName = 'zh-CN' | 'en-US';
|
|
22
|
-
interface ComponentLocale {
|
|
23
|
-
locale?: ComponentLocaleName;
|
|
24
|
-
messages?: Record<string, string>;
|
|
25
|
-
t?: (key: string, params?: Record<string, string | number>) => string;
|
|
26
|
-
}
|
|
27
|
-
//#endregion
|
|
28
8
|
//#region src/components/C_Form/utils/formValidation.d.ts
|
|
29
9
|
/** 原生规则、验证库规则和框架无关规则均可直接作为字段配置。 */
|
|
30
10
|
type FormValidationRule = FormItemRule | NaiveRule | RuleSpec;
|
|
@@ -178,6 +158,8 @@ interface ItemLayoutConfig {
|
|
|
178
158
|
*/
|
|
179
159
|
interface GridLayoutConfig {
|
|
180
160
|
cols?: number;
|
|
161
|
+
/** 可选的字段最小宽度(包含 label);responsive=false 时不自动扩展。 */
|
|
162
|
+
minItemWidth?: number;
|
|
181
163
|
gutter?: number;
|
|
182
164
|
yGutter?: number;
|
|
183
165
|
xGap?: number;
|
|
@@ -307,12 +289,21 @@ interface FormOptionBase<T extends object> {
|
|
|
307
289
|
rules?: readonly FormValidationRule[];
|
|
308
290
|
attrs?: Record<string, unknown>;
|
|
309
291
|
children?: OptionItem[];
|
|
292
|
+
/** 应用字典名称或直接选项源;asyncOptions、显式 children 优先。 */
|
|
293
|
+
dictionary?: DictionaryBinding;
|
|
310
294
|
show?: boolean;
|
|
311
295
|
layout?: ItemLayoutConfig;
|
|
312
296
|
help?: string;
|
|
313
297
|
required?: boolean;
|
|
314
298
|
dependsOn?: FieldPath<T> | FieldPath<T>[];
|
|
315
299
|
showWhen?: (formModel: FormModel<T>) => boolean;
|
|
300
|
+
/** 自定义/虚拟控件准备并返回真实焦点目标;由表单校验状态后执行 focus。 */
|
|
301
|
+
focusTarget?: (context: {
|
|
302
|
+
field: FieldPath<T>;
|
|
303
|
+
element: HTMLElement | null;
|
|
304
|
+
model: FormModel<T>;
|
|
305
|
+
signal: AbortSignal;
|
|
306
|
+
}) => MaybePromise<HTMLElement | null>;
|
|
316
307
|
/** 字段级禁用(优先级高于全局 config.disabled) */
|
|
317
308
|
disabled?: boolean | ((formModel: FormModel<T>) => boolean);
|
|
318
309
|
/** 字段级只读(优先级高于全局 config.readonly) */
|
|
@@ -343,6 +334,8 @@ interface SubmitEventPayload<T extends object = FormRecord> {
|
|
|
343
334
|
*/
|
|
344
335
|
interface FormInstance<T extends object = FormRecord> {
|
|
345
336
|
validate(): Promise<void>;
|
|
337
|
+
/** 展开字段所在区域并聚焦可用控件;隐藏、只读、禁用或切换被阻止时返回 false。 */
|
|
338
|
+
revealField(field: string): Promise<boolean>;
|
|
346
339
|
validateField(field: FieldPath<T> | FieldPath<T>[]): Promise<void>;
|
|
347
340
|
validateStep(step: number | string): Promise<boolean>;
|
|
348
341
|
validateTab(tabKey: string): Promise<boolean>;
|
|
@@ -478,20 +471,6 @@ interface DynamicFormController {
|
|
|
478
471
|
initialize(baseFields: FormOption[], config?: Partial<DynamicFormConfig>): void;
|
|
479
472
|
}
|
|
480
473
|
//#endregion
|
|
481
|
-
//#region src/core/density.d.ts
|
|
482
|
-
/** UI 密度协议与纯数据预设,不依赖 Vue、Naive UI 或浏览器。 */
|
|
483
|
-
type ComponentDensity = 'default' | 'compact' | 'comfortable';
|
|
484
|
-
interface ResolvedComponentDensity {
|
|
485
|
-
density: ComponentDensity;
|
|
486
|
-
size: 'small' | 'medium' | 'large';
|
|
487
|
-
gap: number;
|
|
488
|
-
rowGap: number;
|
|
489
|
-
padding: number;
|
|
490
|
-
formItemGap: number;
|
|
491
|
-
}
|
|
492
|
-
/** 每次返回独立预设,显式控件尺寸与布局配置由消费组件在上层覆盖。 */
|
|
493
|
-
declare const resolveComponentDensity: (density?: ComponentDensity) => ResolvedComponentDensity;
|
|
494
|
-
//#endregion
|
|
495
474
|
//#region src/components/C_Form/composables/useFormConfig.d.ts
|
|
496
475
|
/** 布局回调事件 — 替代原先 16 个 emit 中的纯透传事件 */
|
|
497
476
|
interface LayoutCallbacks<T extends object = FormRecord> {
|
|
@@ -608,4 +587,4 @@ declare function resolveFormConfig(config?: FormConfig): ResolvedFormConfig;
|
|
|
608
587
|
*/
|
|
609
588
|
declare function shouldShowActions(resolved: ResolvedFormConfig): boolean;
|
|
610
589
|
//#endregion
|
|
611
|
-
export {
|
|
590
|
+
export { FormTabActionsSlotProps as A, TabsLayoutConfig as B, FormMode as C, FormSlots as D, FormRecord as E, LayoutType as F, SPEC_RULES as G, NAIVE_COMBOS as H, MaybePromise as I, OptionItem as L, InlineLayoutConfig as M, LabelPlacement as N, FormStepActionsSlotProps as O, LayoutConfig as P, StepsLayoutConfig as R, FormInstance as S, FormOption as T, PRESET_RULES as U, FormValidationRule as V, RuleSpec$1 as W, DynamicFormState as _, ResolvedFormConfig as a, FormActionSlotProps as b, shouldShowActions as c, CardLayoutConfig as d, ComponentType as f, DynamicFormController as g, DynamicFormConfig as h, LayoutCallbacks as i, GridLayoutConfig as j, FormSubmitContext as k, useFormGlobalConfig as l, DynamicFieldConfig as m, FormConfig as n, mergeFormConfig as o, CustomLayoutConfig as p, LAYOUTS_WITH_OWN_CONTROLS as r, resolveFormConfig as s, FORM_DEFAULTS as t, AsyncOptionsContext as u, FieldPath as v, FormModel as w, FormErrorContext as x, FieldPathValue as y, SubmitEventPayload as z };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);let e=require(`vue`);function t(t,n){let r=(0,e.ref)(0),i,a=!1,o=!1,s=!1,c=e=>{a&&!s&&Number.isFinite(e)&&e>0&&r.value!==e&&(r.value=e)},l=()=>{a=!1,i?.disconnect(),i=void 0},u=()=>{let e=t.value;if(a||o||s||!e||!n()||(a=!0,c(e.clientWidth),typeof ResizeObserver>`u`))return;let r=new ResizeObserver(([e])=>{i===r&&c(e?.contentRect.width??0)});i=r,r.observe(e)};return(0,e.onMounted)(u),(0,e.onActivated)(()=>{o=!1,u()}),(0,e.onDeactivated)(()=>{o=!0,l()}),(0,e.onScopeDispose)(()=>{s=!0,l()}),(0,e.watch)(n,e=>e?u():l()),r}Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{onActivated as e,onDeactivated as t,onMounted as n,onScopeDispose as r,ref as i,watch as a}from"vue";function o(o,s){let c=i(0),l,u=!1,d=!1,f=!1,p=e=>{u&&!f&&Number.isFinite(e)&&e>0&&c.value!==e&&(c.value=e)},m=()=>{u=!1,l?.disconnect(),l=void 0},h=()=>{let e=o.value;if(u||d||f||!e||!s()||(u=!0,p(e.clientWidth),typeof ResizeObserver>`u`))return;let t=new ResizeObserver(([e])=>{l===t&&p(e?.contentRect.width??0)});l=t,t.observe(e)};return n(h),e(()=>{d=!1,h()}),t(()=>{d=!0,m()}),r(()=>{f=!0,m()}),a(s,e=>e?h():m()),c}export{o as t};
|
|
@@ -87,8 +87,8 @@ declare const __VLS_base: vue.DefineComponent<WaterFallProps, WaterFallExpose, {
|
|
|
87
87
|
"onImage-loaded"?: ((item: WaterFallItem) => any) | undefined;
|
|
88
88
|
"onImage-error"?: ((item: WaterFallItem) => any) | undefined;
|
|
89
89
|
}>, {
|
|
90
|
-
virtualScroll: boolean;
|
|
91
90
|
loading: boolean;
|
|
91
|
+
virtualScroll: boolean;
|
|
92
92
|
columns: number;
|
|
93
93
|
gap: number;
|
|
94
94
|
lazy: boolean;
|
|
@@ -87,8 +87,8 @@ declare const __VLS_base: vue.DefineComponent<WaterFallProps, WaterFallExpose, {
|
|
|
87
87
|
"onImage-loaded"?: ((item: WaterFallItem) => any) | undefined;
|
|
88
88
|
"onImage-error"?: ((item: WaterFallItem) => any) | undefined;
|
|
89
89
|
}>, {
|
|
90
|
-
virtualScroll: boolean;
|
|
91
90
|
loading: boolean;
|
|
91
|
+
virtualScroll: boolean;
|
|
92
92
|
columns: number;
|
|
93
93
|
gap: number;
|
|
94
94
|
lazy: boolean;
|
package/dist/useQRCode.d.cts
CHANGED
|
@@ -50,15 +50,15 @@ declare const __VLS_export: vue.DefineComponent<Props, QRCodeExpose, {}, {}, {},
|
|
|
50
50
|
}, string, vue.PublicProps, Readonly<Props> & Readonly<{
|
|
51
51
|
onError?: ((error: Error) => any) | undefined;
|
|
52
52
|
}>, {
|
|
53
|
-
|
|
53
|
+
label: string;
|
|
54
54
|
size: number;
|
|
55
55
|
color: string;
|
|
56
|
-
|
|
56
|
+
mode: RenderMode;
|
|
57
|
+
margin: number;
|
|
57
58
|
bgColor: string;
|
|
59
|
+
showBorder: boolean;
|
|
58
60
|
errorCorrectionLevel: ErrorCorrectionLevel;
|
|
59
|
-
margin: number;
|
|
60
61
|
logo: LogoOptions;
|
|
61
|
-
showBorder: boolean;
|
|
62
62
|
showLabel: boolean;
|
|
63
63
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
64
64
|
declare const _default: typeof __VLS_export;
|
package/dist/useQRCode.d.ts
CHANGED
|
@@ -50,15 +50,15 @@ declare const __VLS_export: vue.DefineComponent<Props, QRCodeExpose, {}, {}, {},
|
|
|
50
50
|
}, string, vue.PublicProps, Readonly<Props> & Readonly<{
|
|
51
51
|
onError?: ((error: Error) => any) | undefined;
|
|
52
52
|
}>, {
|
|
53
|
-
|
|
53
|
+
label: string;
|
|
54
54
|
size: number;
|
|
55
55
|
color: string;
|
|
56
|
-
|
|
56
|
+
mode: RenderMode;
|
|
57
|
+
margin: number;
|
|
57
58
|
bgColor: string;
|
|
59
|
+
showBorder: boolean;
|
|
58
60
|
errorCorrectionLevel: ErrorCorrectionLevel;
|
|
59
|
-
margin: number;
|
|
60
61
|
logo: LogoOptions;
|
|
61
|
-
showBorder: boolean;
|
|
62
62
|
showLabel: boolean;
|
|
63
63
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
64
64
|
declare const _default: typeof __VLS_export;
|
|
@@ -93,8 +93,8 @@ interface SignatureEmits {
|
|
|
93
93
|
//#region src/components/C_Signature/index.vue.d.ts
|
|
94
94
|
declare const __VLS_export: vue.DefineComponent<SignatureProps, SignatureExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
95
95
|
change: (data: SignatureStroke[]) => any;
|
|
96
|
-
clear: () => any;
|
|
97
96
|
error: (error: Error) => any;
|
|
97
|
+
clear: () => any;
|
|
98
98
|
"start-draw": () => any;
|
|
99
99
|
drawing: (point: SignaturePoint) => any;
|
|
100
100
|
"end-draw": (stroke: SignatureStroke) => any;
|
|
@@ -102,18 +102,18 @@ declare const __VLS_export: vue.DefineComponent<SignatureProps, SignatureExpose,
|
|
|
102
102
|
redo: () => any;
|
|
103
103
|
}, string, vue.PublicProps, Readonly<SignatureProps> & Readonly<{
|
|
104
104
|
onChange?: ((data: SignatureStroke[]) => any) | undefined;
|
|
105
|
-
onClear?: (() => any) | undefined;
|
|
106
105
|
onError?: ((error: Error) => any) | undefined;
|
|
106
|
+
onClear?: (() => any) | undefined;
|
|
107
107
|
"onStart-draw"?: (() => any) | undefined;
|
|
108
108
|
onDrawing?: ((point: SignaturePoint) => any) | undefined;
|
|
109
109
|
"onEnd-draw"?: ((stroke: SignatureStroke) => any) | undefined;
|
|
110
110
|
onUndo?: (() => any) | undefined;
|
|
111
111
|
onRedo?: (() => any) | undefined;
|
|
112
112
|
}>, {
|
|
113
|
-
height: number | string;
|
|
114
113
|
disabled: boolean;
|
|
115
|
-
readonly: boolean;
|
|
116
114
|
width: number | string;
|
|
115
|
+
height: number | string;
|
|
116
|
+
readonly: boolean;
|
|
117
117
|
showToolbar: boolean;
|
|
118
118
|
maxHistory: number;
|
|
119
119
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -93,8 +93,8 @@ interface SignatureEmits {
|
|
|
93
93
|
//#region src/components/C_Signature/index.vue.d.ts
|
|
94
94
|
declare const __VLS_export: vue.DefineComponent<SignatureProps, SignatureExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
95
95
|
change: (data: SignatureStroke[]) => any;
|
|
96
|
-
clear: () => any;
|
|
97
96
|
error: (error: Error) => any;
|
|
97
|
+
clear: () => any;
|
|
98
98
|
"start-draw": () => any;
|
|
99
99
|
drawing: (point: SignaturePoint) => any;
|
|
100
100
|
"end-draw": (stroke: SignatureStroke) => any;
|
|
@@ -102,18 +102,18 @@ declare const __VLS_export: vue.DefineComponent<SignatureProps, SignatureExpose,
|
|
|
102
102
|
redo: () => any;
|
|
103
103
|
}, string, vue.PublicProps, Readonly<SignatureProps> & Readonly<{
|
|
104
104
|
onChange?: ((data: SignatureStroke[]) => any) | undefined;
|
|
105
|
-
onClear?: (() => any) | undefined;
|
|
106
105
|
onError?: ((error: Error) => any) | undefined;
|
|
106
|
+
onClear?: (() => any) | undefined;
|
|
107
107
|
"onStart-draw"?: (() => any) | undefined;
|
|
108
108
|
onDrawing?: ((point: SignaturePoint) => any) | undefined;
|
|
109
109
|
"onEnd-draw"?: ((stroke: SignatureStroke) => any) | undefined;
|
|
110
110
|
onUndo?: (() => any) | undefined;
|
|
111
111
|
onRedo?: (() => any) | undefined;
|
|
112
112
|
}>, {
|
|
113
|
-
height: number | string;
|
|
114
113
|
disabled: boolean;
|
|
115
|
-
readonly: boolean;
|
|
116
114
|
width: number | string;
|
|
115
|
+
height: number | string;
|
|
116
|
+
readonly: boolean;
|
|
117
117
|
showToolbar: boolean;
|
|
118
118
|
maxHistory: number;
|
|
119
119
|
}, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
|
|
@@ -55,17 +55,17 @@ type __VLS_Slots = {
|
|
|
55
55
|
second(props: PanelInfo): unknown;
|
|
56
56
|
};
|
|
57
57
|
declare const __VLS_base: vue.DefineComponent<SplitPaneProps, SplitPaneExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
58
|
-
"update:size": (size: number) => any;
|
|
59
58
|
resize: (firstSize: number, secondSize: number) => any;
|
|
60
|
-
collapse: (target: CollapseTarget) => any;
|
|
61
59
|
expand: (target: CollapseTarget) => any;
|
|
60
|
+
"update:size": (size: number) => any;
|
|
61
|
+
collapse: (target: CollapseTarget) => any;
|
|
62
62
|
"drag-start": (size: number) => any;
|
|
63
63
|
"drag-end": (size: number) => any;
|
|
64
64
|
}, string, vue.PublicProps, Readonly<SplitPaneProps> & Readonly<{
|
|
65
|
-
"onUpdate:size"?: ((size: number) => any) | undefined;
|
|
66
65
|
onResize?: ((firstSize: number, secondSize: number) => any) | undefined;
|
|
67
|
-
onCollapse?: ((target: CollapseTarget) => any) | undefined;
|
|
68
66
|
onExpand?: ((target: CollapseTarget) => any) | undefined;
|
|
67
|
+
"onUpdate:size"?: ((size: number) => any) | undefined;
|
|
68
|
+
onCollapse?: ((target: CollapseTarget) => any) | undefined;
|
|
69
69
|
"onDrag-start"?: ((size: number) => any) | undefined;
|
|
70
70
|
"onDrag-end"?: ((size: number) => any) | undefined;
|
|
71
71
|
}>, {
|
package/dist/useSplitResize.d.ts
CHANGED
|
@@ -55,17 +55,17 @@ type __VLS_Slots = {
|
|
|
55
55
|
second(props: PanelInfo): unknown;
|
|
56
56
|
};
|
|
57
57
|
declare const __VLS_base: vue.DefineComponent<SplitPaneProps, SplitPaneExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
|
|
58
|
-
"update:size": (size: number) => any;
|
|
59
58
|
resize: (firstSize: number, secondSize: number) => any;
|
|
60
|
-
collapse: (target: CollapseTarget) => any;
|
|
61
59
|
expand: (target: CollapseTarget) => any;
|
|
60
|
+
"update:size": (size: number) => any;
|
|
61
|
+
collapse: (target: CollapseTarget) => any;
|
|
62
62
|
"drag-start": (size: number) => any;
|
|
63
63
|
"drag-end": (size: number) => any;
|
|
64
64
|
}, string, vue.PublicProps, Readonly<SplitPaneProps> & Readonly<{
|
|
65
|
-
"onUpdate:size"?: ((size: number) => any) | undefined;
|
|
66
65
|
onResize?: ((firstSize: number, secondSize: number) => any) | undefined;
|
|
67
|
-
onCollapse?: ((target: CollapseTarget) => any) | undefined;
|
|
68
66
|
onExpand?: ((target: CollapseTarget) => any) | undefined;
|
|
67
|
+
"onUpdate:size"?: ((size: number) => any) | undefined;
|
|
68
|
+
onCollapse?: ((target: CollapseTarget) => any) | undefined;
|
|
69
69
|
"onDrag-start"?: ((size: number) => any) | undefined;
|
|
70
70
|
"onDrag-end"?: ((size: number) => any) | undefined;
|
|
71
71
|
}>, {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
require(`./chunk.cjs`);let e=require(`vue`);const t=Symbol(`C_TABLE_GLOBAL_CONFIG`),n={date:{format:`YYYY-MM-DD`},datetime:{format:`YYYY-MM-DD HH:mm:ss`},currency:{prefix:`¥`,precision:2},percent:{precision:2,suffix:`%`},number:{precision:0}};function r(e,t){if(e==null||e===``)return`-`;let n=new Date(typeof e==`number`?e:String(e));if(Number.isNaN(n.getTime()))return String(e);let r=e=>String(e).padStart(2,`0`);return t.replace(`YYYY`,String(n.getFullYear())).replace(`MM`,r(n.getMonth()+1)).replace(`DD`,r(n.getDate())).replace(`HH`,r(n.getHours())).replace(`mm`,r(n.getMinutes())).replace(`ss`,r(n.getSeconds()))}function i(e,t){if(e==null||e===``)return`-`;let n=Number(e);return Number.isNaN(n)?String(e):n.toLocaleString(`zh-CN`,{minimumFractionDigits:t,maximumFractionDigits:t})}const a={date:(e,t)=>r(e,t.format??`YYYY-MM-DD`),datetime:(e,t)=>r(e,t.format??`YYYY-MM-DD HH:mm:ss`),currency:(e,t)=>{let n=i(e,t.precision??2);return n===`-`?`-`:`${t.prefix??`¥`}${n}${t.suffix??``}`},percent:(e,t)=>{if(e==null||e===``)return`-`;let n=Number(e);return Number.isNaN(n)?String(e):`${(n*100).toFixed(t.precision??2)}${t.suffix??`%`}`},number:(e,t)=>i(e,t.precision??0)};function o(e,t,r,i){if(r.fn)return r.fn(e,t);if(r.type===`enum`)return r.mapping?r.mapping[String(e)]??String(e??`-`):String(e??`-`);let o=r.type&&a[r.type];return o?o(e,{...{...n,...i}[r.type],...r.config}):String(e??`-`)}function s(){return(0,e.getCurrentInstance)()?(0,e.inject)(t,{}):{}}const c=(e,t)=>t===void 0?e:t&&e&&typeof t==`object`&&typeof e==`object`&&!Array.isArray(t)&&!Array.isArray(e)?{...e,...t}:t;function l(e,t){let n=t.defaults??{},r={...n,...e};if([`edit`,`pagination`,`expand`,`selection`,`dynamicRows`,`toolbar`,`display`,`virtualScroll`,`summary`,`columnDrag`,`tree`,`rowDrag`,`crossPageSelection`,`export`,`formatterConfig`,`error`,`batchActions`].forEach(t=>{let i=e=>t===`edit`&&typeof e==`string`?{mode:e}:e,a=c(i(n[t]),i(e[t]));a!==void 0&&(r[t]=a)}),t.display){let e=typeof r.display==`object`?r.display:{};r.display={...t.display,...e}}if(t.pageSize&&r.pagination!==!1){let e=typeof r.pagination==`object`?r.pagination:{};e.pageSize||(r.pagination={...e,pageSize:t.pageSize})}return r}Object.defineProperty(exports,`i`,{enumerable:!0,get:function(){return s}}),Object.defineProperty(exports,`n`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`r`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`t`,{enumerable:!0,get:function(){return t}});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{getCurrentInstance as e,inject as t}from"vue";const n=Symbol(`C_TABLE_GLOBAL_CONFIG`),r={date:{format:`YYYY-MM-DD`},datetime:{format:`YYYY-MM-DD HH:mm:ss`},currency:{prefix:`¥`,precision:2},percent:{precision:2,suffix:`%`},number:{precision:0}};function i(e,t){if(e==null||e===``)return`-`;let n=new Date(typeof e==`number`?e:String(e));if(Number.isNaN(n.getTime()))return String(e);let r=e=>String(e).padStart(2,`0`);return t.replace(`YYYY`,String(n.getFullYear())).replace(`MM`,r(n.getMonth()+1)).replace(`DD`,r(n.getDate())).replace(`HH`,r(n.getHours())).replace(`mm`,r(n.getMinutes())).replace(`ss`,r(n.getSeconds()))}function a(e,t){if(e==null||e===``)return`-`;let n=Number(e);return Number.isNaN(n)?String(e):n.toLocaleString(`zh-CN`,{minimumFractionDigits:t,maximumFractionDigits:t})}const o={date:(e,t)=>i(e,t.format??`YYYY-MM-DD`),datetime:(e,t)=>i(e,t.format??`YYYY-MM-DD HH:mm:ss`),currency:(e,t)=>{let n=a(e,t.precision??2);return n===`-`?`-`:`${t.prefix??`¥`}${n}${t.suffix??``}`},percent:(e,t)=>{if(e==null||e===``)return`-`;let n=Number(e);return Number.isNaN(n)?String(e):`${(n*100).toFixed(t.precision??2)}${t.suffix??`%`}`},number:(e,t)=>a(e,t.precision??0)};function s(e,t,n,i){if(n.fn)return n.fn(e,t);if(n.type===`enum`)return n.mapping?n.mapping[String(e)]??String(e??`-`):String(e??`-`);let a=n.type&&o[n.type];return a?a(e,{...{...r,...i}[n.type],...n.config}):String(e??`-`)}function c(){return e()?t(n,{}):{}}const l=(e,t)=>t===void 0?e:t&&e&&typeof t==`object`&&typeof e==`object`&&!Array.isArray(t)&&!Array.isArray(e)?{...e,...t}:t;function u(e,t){let n=t.defaults??{},r={...n,...e};if([`edit`,`pagination`,`expand`,`selection`,`dynamicRows`,`toolbar`,`display`,`virtualScroll`,`summary`,`columnDrag`,`tree`,`rowDrag`,`crossPageSelection`,`export`,`formatterConfig`,`error`,`batchActions`].forEach(t=>{let i=e=>t===`edit`&&typeof e==`string`?{mode:e}:e,a=l(i(n[t]),i(e[t]));a!==void 0&&(r[t]=a)}),t.display){let e=typeof r.display==`object`?r.display:{};r.display={...t.display,...e}}if(t.pageSize&&r.pagination!==!1){let e=typeof r.pagination==`object`?r.pagination:{};e.pageSize||(r.pagination={...e,pageSize:t.pageSize})}return r}export{c as i,s as n,u as r,n as t};
|