@shaonq/vue 1.1.11 → 1.1.12

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.
Files changed (3) hide show
  1. package/lib/index.d.ts +127 -120
  2. package/lib/index.js +1336 -1325
  3. package/package.json +1 -1
package/lib/index.d.ts CHANGED
@@ -157,69 +157,6 @@ declare function downLoadPdf(name: string, element: HTMLElement, option?: {
157
157
 
158
158
  declare function findObject<T extends RecordAny>(obj: T, keys?: string | string[]): T;
159
159
 
160
- /** 描述表单项的属性。 */
161
- declare type FormItemType = {
162
- /**
163
- * 可以使使用的 Arco 组件类型 也可以使用自定义组件
164
- * @example 'a-input', 'a-select' 等。
165
- */
166
- type?: string | Component;
167
- /** 表单项的文本名称或标题 */
168
- name: string;
169
- /** 用于双向数据绑定的模型属性 */
170
- model: string;
171
- /** 控制表单项是否显示。 */
172
- show?: boolean;
173
- /** 表单项的默认值 */
174
- defaultValue?: any;
175
- /** 触发验证的时机 */
176
- validateTrigger?: 'change' | 'input' | 'focus' | 'blur';
177
- /** 组件属性对象 */
178
- componentAttr?: Record<string, any>;
179
- /** 自定义类名,可以是字符串或函数 */
180
- customClass?: string | ((itemConfig: FormItemType, models: Record<string, any>) => string);
181
- /** 开启多选 转义[a,b]=>'a,b' ,默认组件支持请开启 componentAttr:{multiple:true} */
182
- dotNotation?: boolean;
183
- /** 数据字典键名 */
184
- datadict?: string;
185
- /** 配置项 */
186
- options?: {
187
- /** 必填 */
188
- required?: boolean;
189
- /** 栅格 24 */
190
- span?: number;
191
- /** 禁用 */
192
- disabled?: boolean;
193
- /** 占位符 */
194
- placeholder?: string;
195
- /** 帮助文案 */
196
- help?: string;
197
- /** 提示信息 */
198
- tooltip?: string;
199
- };
200
- /** 验证规则 */
201
- rules?: Record<string, any>[];
202
- /** 事件处理器 */
203
- events?: {
204
- /** 组件挂载后执行 */
205
- onMounted?: (util: FormUtilType & FormItemType['events']) => any | Promise<any>;
206
- /** 值改变时触发 */
207
- onChange?: (val: any, util: FormUtilType & FormItemType['events']) => void | Promise<void>;
208
- /** watch 更新时触发 */
209
- onUpdate?: (val: any, oldVal: any, util: FormUtilType & FormItemType['events']) => void | Promise<void>;
210
- };
211
- /** 扩展字符 */
212
- note?: string;
213
- };
214
-
215
- declare type FormSubmitEvent = {
216
- data: Record<string, any>;
217
- utils: {
218
- setVisible: (a: boolean) => void;
219
- setLoading: (a: boolean) => void;
220
- };
221
- };
222
-
223
160
  declare type FormUtilType = {
224
161
  getModelOption: (model: string) => any;
225
162
  getModel: (model: string) => any;
@@ -627,8 +564,12 @@ declare type ModalInstance = InstanceType<typeof Modal>;
627
564
  /** omit object */
628
565
  declare function omitObject<T extends RecordAny>(obj: T, keys?: string | string[]): T;
629
566
 
567
+ declare function onShow(): void;
568
+
630
569
  declare function onSubmit(): Promise<[boolean, any]>;
631
570
 
571
+ declare function onSubmit_2(): Promise<void>;
572
+
632
573
  export declare const OrcDesign: DefineComponent<{
633
574
  readonly: BooleanConstructor;
634
575
  data: {
@@ -674,10 +615,10 @@ export declare const OrcDesignPrint: DefineComponent<{}, {
674
615
  getHtml(): any;
675
616
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<{}>>, {}, {}>;
676
617
 
677
- export declare const OrcForm: __VLS_WithTemplateSlots_3< DefineComponent<{
618
+ export declare const OrcForm: __VLS_WithTemplateSlots_5< DefineComponent<{
678
619
  /** @example ``` [{ type: 'a-input', model: 'billNumber', name: '类型编码', options: { disabled: true, placeholder: '' }] ``` */
679
620
  config: {
680
- type: PropType<FormItemType[]>;
621
+ type: PropType<OrcFormItem[]>;
681
622
  default(): never[];
682
623
  };
683
624
  labelWidth: {
@@ -727,7 +668,7 @@ export declare const OrcForm: __VLS_WithTemplateSlots_3< DefineComponent<{
727
668
  }, string, PublicProps, Readonly< ExtractPropTypes<{
728
669
  /** @example ``` [{ type: 'a-input', model: 'billNumber', name: '类型编码', options: { disabled: true, placeholder: '' }] ``` */
729
670
  config: {
730
- type: PropType<FormItemType[]>;
671
+ type: PropType<OrcFormItem[]>;
731
672
  default(): never[];
732
673
  };
733
674
  labelWidth: {
@@ -775,7 +716,7 @@ export declare const OrcForm: __VLS_WithTemplateSlots_3< DefineComponent<{
775
716
  modelValue: Record<string, any>;
776
717
  span: number;
777
718
  formProps: Record<string, any>;
778
- config: FormItemType[];
719
+ config: OrcFormItem[];
779
720
  labelWidth: string;
780
721
  labelAlign: "left" | "right";
781
722
  hideSubmit: boolean;
@@ -787,26 +728,92 @@ export declare const OrcForm: __VLS_WithTemplateSlots_3< DefineComponent<{
787
728
  }): any;
788
729
  }>;
789
730
 
790
- export declare const OrcFormButton: __VLS_WithTemplateSlots_4< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
731
+ export declare const OrcFormButton: __VLS_WithTemplateSlots_6< DefineComponent<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_3<Props_2>, {
791
732
  title: string;
792
733
  modelValue: undefined;
793
734
  }>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {
794
- submit: (data: FormSubmitEvent) => void;
735
+ "update:modelValue": (data: RecordAny) => void;
736
+ submit: (data: OrcFormSubmit) => void;
795
737
  error: (data: any) => void;
796
- }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {
738
+ }, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_3<Props_2>, {
797
739
  title: string;
798
740
  modelValue: undefined;
799
741
  }>>> & {
800
- onSubmit?: ((data: FormSubmitEvent) => any) | undefined;
742
+ onSubmit?: ((data: OrcFormSubmit) => any) | undefined;
801
743
  onError?: ((data: any) => any) | undefined;
744
+ "onUpdate:modelValue"?: ((data: RecordAny) => any) | undefined;
802
745
  }, {
803
746
  title: string;
804
747
  modelValue: RecordAny;
805
748
  }, {}>, {
806
- default?(_: {}): any;
749
+ icon?(_: {}): any;
750
+ default?(_: {
751
+ onSubmit: typeof onSubmit_2;
752
+ onShow: typeof onShow;
753
+ }): any;
807
754
  }>;
808
755
 
809
- export declare const OrcHiddenView: __VLS_WithTemplateSlots_5< DefineComponent<__VLS_WithDefaults_2<__VLS_TypePropsToRuntimeProps_2<{
756
+ /** 描述表单项的属性。 */
757
+ export declare type OrcFormItem = {
758
+ /**
759
+ * 可以使使用的 Arco 组件类型 也可以使用自定义组件
760
+ * @example 'a-input', 'a-select' 等。
761
+ */
762
+ type?: string | Component;
763
+ /** 表单项的文本名称或标题 */
764
+ name: string;
765
+ /** 用于双向数据绑定的模型属性 */
766
+ model: string;
767
+ /** 控制表单项是否显示。 */
768
+ show?: boolean;
769
+ /** 表单项的默认值 */
770
+ defaultValue?: any;
771
+ /** 触发验证的时机 */
772
+ validateTrigger?: 'change' | 'input' | 'focus' | 'blur';
773
+ /** 组件属性对象 */
774
+ componentAttr?: Record<string, any>;
775
+ /** 自定义类名,可以是字符串或函数 */
776
+ customClass?: string | ((itemConfig: OrcFormItem, models: Record<string, any>) => string);
777
+ /** 开启多选 转义[a,b]=>'a,b' ,默认组件支持请开启 componentAttr:{multiple:true} */
778
+ dotNotation?: boolean;
779
+ /** 数据字典键名 */
780
+ datadict?: string;
781
+ /** 配置项 */
782
+ options?: {
783
+ /** 必填 */
784
+ required?: boolean;
785
+ /** 栅格 24 */
786
+ span?: number;
787
+ /** 禁用 */
788
+ disabled?: boolean;
789
+ /** 占位符 */
790
+ placeholder?: string;
791
+ /** 帮助文案 */
792
+ help?: string;
793
+ /** 提示信息 */
794
+ tooltip?: string;
795
+ };
796
+ /** 验证规则 */
797
+ rules?: Record<string, any>[];
798
+ /** 事件处理器 */
799
+ events?: {
800
+ /** 组件挂载后执行 */
801
+ onMounted?: (util: FormUtilType & OrcFormItem['events']) => any | Promise<any>;
802
+ /** 值改变时触发 */
803
+ onChange?: (val: any, util: FormUtilType & OrcFormItem['events']) => void | Promise<void>;
804
+ /** watch 更新时触发 */
805
+ onUpdate?: (val: any, oldVal: any, util: FormUtilType & OrcFormItem['events']) => void | Promise<void>;
806
+ };
807
+ /** 扩展字符 */
808
+ note?: string;
809
+ };
810
+
811
+ export declare type OrcFormSubmit = [Record<string, any>, {
812
+ setVisible: (a: boolean) => void;
813
+ setLoading: (a: boolean) => void;
814
+ }];
815
+
816
+ export declare const OrcHiddenView: __VLS_WithTemplateSlots_2< DefineComponent<__VLS_WithDefaults_2<__VLS_TypePropsToRuntimeProps_2<{
810
817
  isShow?: boolean | undefined;
811
818
  isDirection?: boolean | undefined;
812
819
  formProps?: Record<string, any> | undefined;
@@ -818,7 +825,7 @@ export declare const OrcHiddenView: __VLS_WithTemplateSlots_5< DefineComponent<_
818
825
  default?(_: {}): any;
819
826
  }>;
820
827
 
821
- export declare const OrcProvider: __VLS_WithTemplateSlots_6< DefineComponent<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_3<Props_2>, {}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults_3<__VLS_TypePropsToRuntimeProps_3<Props_2>, {}>>>, {}, {}>, {
828
+ export declare const OrcProvider: __VLS_WithTemplateSlots< DefineComponent<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {}>, {}, unknown, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, {}, string, PublicProps, Readonly< ExtractPropTypes<__VLS_WithDefaults<__VLS_TypePropsToRuntimeProps<Props>, {}>>>, {}, {}>, {
822
829
  default?(_: {}): any;
823
830
  }>;
824
831
 
@@ -849,11 +856,11 @@ export declare const OrcQuill: DefineComponent<{
849
856
  toolbar: string | unknown[];
850
857
  }, {}>;
851
858
 
852
- export declare const OrcSearch: __VLS_WithTemplateSlots_2< DefineComponent<{
859
+ export declare const OrcSearch: __VLS_WithTemplateSlots_4< DefineComponent<{
853
860
  loading: BooleanConstructor;
854
861
  readonly: BooleanConstructor;
855
862
  options: {
856
- type: PropType<TypeSearchItem[]>;
863
+ type: PropType<OrcSearchItem[]>;
857
864
  default(): never[];
858
865
  };
859
866
  modelValue: {
@@ -879,7 +886,7 @@ export declare const OrcSearch: __VLS_WithTemplateSlots_2< DefineComponent<{
879
886
  loading: BooleanConstructor;
880
887
  readonly: BooleanConstructor;
881
888
  options: {
882
- type: PropType<TypeSearchItem[]>;
889
+ type: PropType<OrcSearchItem[]>;
883
890
  default(): never[];
884
891
  };
885
892
  modelValue: {
@@ -905,7 +912,7 @@ export declare const OrcSearch: __VLS_WithTemplateSlots_2< DefineComponent<{
905
912
  loading: boolean;
906
913
  size: string;
907
914
  modelValue: Record<string, any>;
908
- options: TypeSearchItem[];
915
+ options: OrcSearchItem[];
909
916
  readonly: boolean;
910
917
  labelWidth: string;
911
918
  inputWidth: string;
@@ -914,7 +921,40 @@ export declare const OrcSearch: __VLS_WithTemplateSlots_2< DefineComponent<{
914
921
  default?(_: {}): any;
915
922
  }>;
916
923
 
917
- export declare const OrcTable: __VLS_WithTemplateSlots< DefineComponent<{
924
+ export declare interface OrcSearchItem extends RecordAny {
925
+ /** input 类型 */
926
+ type?: string;
927
+ /** 同form [name] */
928
+ name: string;
929
+ /** 标签名称 */
930
+ label: string;
931
+ /** 初始值 */
932
+ defaultValue?: string | boolean | number | string[];
933
+ /** 默认是显示 */
934
+ show?: boolean;
935
+ /** type =number 最小值 */
936
+ min?: number;
937
+ /** type =number 最大值 */
938
+ max?: number;
939
+ /** type=select | type=date */
940
+ multiple?: boolean;
941
+ /** type=select */
942
+ options?: {
943
+ label: string;
944
+ value: string;
945
+ disabled?: boolean;
946
+ }[];
947
+ /** type=date */
948
+ format?: string;
949
+ /** type=date */
950
+ showTime?: boolean;
951
+ /** 必填 */
952
+ required?: boolean;
953
+ /** 表单验证 */
954
+ rules?: RecordAny | RecordAny[];
955
+ }
956
+
957
+ export declare const OrcTable: __VLS_WithTemplateSlots_3< DefineComponent<{
918
958
  title: StringConstructor;
919
959
  /** auto(铺满父容器,必须确保存在父节点且不允许存在相邻元素 ,), %, px */
920
960
  height: (StringConstructor | NumberConstructor)[];
@@ -1127,21 +1167,22 @@ export declare interface OrcTableOption extends RecordAny_2 {
1127
1167
  }
1128
1168
 
1129
1169
  declare interface Props {
1170
+ useErrData?: <T = Record<string, any>>(config: Record<string, any>) => Promise<[boolean, T]>;
1171
+ }
1172
+
1173
+ declare interface Props_2 {
1174
+ isView?: boolean;
1130
1175
  disabled?: boolean;
1131
1176
  title?: string;
1132
1177
  span?: number;
1133
1178
  gutter?: number;
1134
- config: FormItemType[];
1179
+ config: OrcFormItem[];
1135
1180
  modelValue?: RecordAny;
1136
1181
  labelWidth?: string;
1137
1182
  buttonAttrs?: ButtonInstance['$props'];
1138
1183
  modalAttrs?: ModalInstance['$props'];
1139
1184
  }
1140
1185
 
1141
- declare interface Props_2 {
1142
- useErrData?: <T = Record<string, any>>(config: Record<string, any>) => Promise<[boolean, T]>;
1143
- }
1144
-
1145
1186
  export declare type RecordAny = Record<string, any>;
1146
1187
 
1147
1188
  declare type RecordAny_2 = Record<string, any>;
@@ -1225,39 +1266,6 @@ declare interface TableGridTwoType extends RecordAny_2 {
1225
1266
 
1226
1267
  declare type TableInstance = InstanceType<typeof VxeTable>;
1227
1268
 
1228
- declare interface TypeSearchItem extends RecordAny {
1229
- /** input 类型 */
1230
- type?: string;
1231
- /** 同form [name] */
1232
- name: string;
1233
- /** 标签名称 */
1234
- label: string;
1235
- /** 初始值 */
1236
- defaultValue?: string | boolean | number | string[];
1237
- /** 默认是显示 */
1238
- show?: boolean;
1239
- /** type =number 最小值 */
1240
- min?: number;
1241
- /** type =number 最大值 */
1242
- max?: number;
1243
- /** type=select | type=date */
1244
- multiple?: boolean;
1245
- /** type=select */
1246
- options?: {
1247
- label: string;
1248
- value: string;
1249
- disabled?: boolean;
1250
- }[];
1251
- /** type=date */
1252
- format?: string;
1253
- /** type=date */
1254
- showTime?: boolean;
1255
- /** 必填 */
1256
- required?: boolean;
1257
- /** 表单验证 */
1258
- rules?: RecordAny | RecordAny[];
1259
- }
1260
-
1261
1269
  /**
1262
1270
  * @example
1263
1271
  * ```
@@ -1277,7 +1285,7 @@ declare interface TypeSearchItem extends RecordAny {
1277
1285
  * { type: 'date', name: 'd2', label: '日期范围', multiple: true, defaultValue: '2024-07-01,2024-08-07' },
1278
1286
  * ```
1279
1287
  */
1280
- export declare function useOrcSearch(list: TypeSearchItem[]): readonly [ Ref<{
1288
+ export declare function useOrcSearch(list: OrcSearchItem[]): readonly [ Ref<{
1281
1289
  [x: string]: any;
1282
1290
  type?: string | undefined;
1283
1291
  name: string;
@@ -1781,7 +1789,7 @@ export declare const useOrcTable: (option: OrcTableOption) => {
1781
1789
  selectedKeys: Ref<string[], string[]>;
1782
1790
  };
1783
1791
 
1784
- declare function useState<T extends RecordAny>(initValue: T, formsRef?: Ref<{
1792
+ export declare function useState<T extends RecordAny>(initValue: T, formsRef?: Ref<{
1785
1793
  resetFields?: () => void;
1786
1794
  }>): readonly [Ref<T, T>, (defValue?: Partial<T>) => void];
1787
1795
 
@@ -1795,7 +1803,6 @@ export declare const utils: {
1795
1803
  mergeConfig: typeof mergeConfig;
1796
1804
  generateQRcodeBase64: typeof generateQRcodeBase64;
1797
1805
  downLoadPdf: typeof downLoadPdf;
1798
- useState: typeof useState;
1799
1806
  findObject: typeof findObject;
1800
1807
  omitObject: typeof omitObject;
1801
1808
  deepClone: <T = RecordAny | RecordAny[]>(origin: T) => T;