@robot-admin/naive-ui-components 0.7.2 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (60) hide show
  1. package/CHANGELOG.md +76 -60
  2. package/dist/C_Form.cjs +1 -1
  3. package/dist/C_Form.d.cts +2 -2
  4. package/dist/C_Form.d.ts +2 -2
  5. package/dist/C_Form.js +1 -1
  6. package/dist/C_Form.js.map +1 -1
  7. package/dist/C_Form2.js +1 -1
  8. package/dist/C_Form2.js.map +1 -1
  9. package/dist/C_Table.js.map +1 -1
  10. package/dist/C_Table2.js +3 -3
  11. package/dist/C_Table2.js.map +1 -1
  12. package/dist/constants.d.ts +4 -4
  13. package/dist/constants2.d.ts +5 -5
  14. package/dist/constants3.d.ts +5 -5
  15. package/dist/constants4.d.ts +4 -4
  16. package/dist/constants5.d.ts +2 -2
  17. package/dist/data.d.ts +2 -2
  18. package/dist/index.cjs +1 -1
  19. package/dist/index.d.cts +2 -2
  20. package/dist/index.d.ts +2 -2
  21. package/dist/index.js +1 -1
  22. package/dist/index.js.map +1 -1
  23. package/dist/index10.vue.d.ts +4 -4
  24. package/dist/index11.vue.d.ts +5 -5
  25. package/dist/index12.vue.d.ts +4 -4
  26. package/dist/index13.vue.d.ts +4 -4
  27. package/dist/index14.vue.d.ts +1 -1
  28. package/dist/index15.vue.d.ts +5 -5
  29. package/dist/index16.vue.d.ts +2 -2
  30. package/dist/index17.vue.d.ts +1 -1
  31. package/dist/index18.vue.d.ts +5 -5
  32. package/dist/index2.vue.d.ts +6 -6
  33. package/dist/index20.vue.d.ts +1 -1
  34. package/dist/index21.vue.d.ts +2 -2
  35. package/dist/index22.vue.d.ts +1 -1
  36. package/dist/index24.vue.d.ts +1 -1
  37. package/dist/index26.vue.d.ts +1 -1
  38. package/dist/index27.vue.d.ts +2 -2
  39. package/dist/index28.vue.d.ts +3 -3
  40. package/dist/index3.vue.d.ts +1 -1
  41. package/dist/index4.vue.d.ts +4 -4
  42. package/dist/index6.vue.d.ts +5 -5
  43. package/dist/index7.vue.d.ts +2 -2
  44. package/dist/index8.vue.d.ts +2 -2
  45. package/dist/index9.vue.d.ts +2 -2
  46. package/dist/useCollapsePanel.d.ts +5 -5
  47. package/dist/useCropperCore.d.ts +7 -7
  48. package/dist/useDraggableLayout.d.ts +5 -5
  49. package/dist/useDynamicFormState.d.ts +111 -37
  50. package/dist/useEdgeInteraction.d.ts +2 -2
  51. package/dist/useInfiniteScroll.d.ts +1 -1
  52. package/dist/useModalEdit.d.ts +5 -5
  53. package/dist/useQRCode.d.ts +1 -1
  54. package/dist/useSearchState.d.ts +2 -2
  55. package/dist/useSignatureHistory.d.ts +4 -4
  56. package/dist/useSplitResize.d.ts +7 -7
  57. package/dist/useTimeSelection.d.ts +1 -1
  58. package/dist/useTreeOperations.d.ts +2 -2
  59. package/dist/useWorkflowValidation.d.ts +3 -3
  60. package/package.json +1 -1
@@ -1,12 +1,18 @@
1
1
  import * as naive_ui0 from "naive-ui";
2
2
  import * as vue from "vue";
3
3
  import { CSSProperties, Component, ComputedRef, Ref, VNode } from "vue";
4
+ import * as _robot_admin_form_validate0 from "@robot-admin/form-validate";
4
5
  import { FieldRule } from "@robot-admin/form-validate";
5
6
  import { FormInst } from "naive-ui/es";
6
7
  import * as naive_ui_es_form_src_interface0 from "naive-ui/es/form/src/interface";
7
8
  import { FormInst as FormInst$1, FormRules } from "naive-ui/es/form";
8
9
 
9
10
  //#region src/components/C_Form/types.d.ts
11
+ /**
12
+ * 表单模式
13
+ * @description create = 新建(空白表单),edit = 编辑(回填已有数据 + 脏检查)
14
+ */
15
+ type FormMode = "create" | "edit";
10
16
  /**
11
17
  * 支持的布局类型
12
18
  * @description 定义表单支持的所有布局模式
@@ -230,6 +236,18 @@ interface FormOption {
230
236
  required?: boolean;
231
237
  dependsOn?: string | string[];
232
238
  showWhen?: (formModel: Record<string, any>) => boolean;
239
+ /** 字段级禁用(优先级高于全局 config.disabled) */
240
+ disabled?: boolean | ((formModel: Record<string, any>) => boolean);
241
+ /** 字段级只读(优先级高于全局 config.readonly) */
242
+ readonly?: boolean | ((formModel: Record<string, any>) => boolean);
243
+ /** 联动赋值:其他字段变化时自动计算本字段的值 */
244
+ valueWhen?: (formModel: Record<string, any>) => any;
245
+ /** 异步数据源:select / cascader / checkbox / radio 的远程选项加载 */
246
+ asyncOptions?: (formModel: Record<string, any>) => Promise<OptionItem[]>;
247
+ /** 联动校验规则:根据表单数据动态返回校验规则 */
248
+ rulesWhen?: (formModel: Record<string, any>) => FieldRule[];
249
+ /** 跨字段校验:需要引用多个字段值的验证函数,返回错误消息或 null */
250
+ crossFieldValidator?: (formModel: Record<string, any>) => string | null;
233
251
  }
234
252
  /**
235
253
  * 表单提交事件参数
@@ -261,6 +279,16 @@ interface FormInstance {
261
279
  initialize(): void;
262
280
  layoutType: ComputedRef<LayoutType>;
263
281
  shouldShowDefaultActions: ComputedRef<boolean>;
282
+ /** 表单是否被修改过 */
283
+ isDirty: Ref<boolean>;
284
+ /** 获取被修改的字段列表 */
285
+ getChangedFields(): string[];
286
+ /** 检查某字段是否被修改 */
287
+ isFieldDirty(field: string): boolean;
288
+ /** 将当前值设为初始快照(常用于编辑模式加载数据后) */
289
+ markAsClean(): void;
290
+ /** 字段异步选项的 loading 状态 */
291
+ asyncLoadingMap: Ref<Record<string, boolean>>;
264
292
  }
265
293
  /**
266
294
  * 表单数据模型类型(泛型)
@@ -322,7 +350,7 @@ interface FormConfig extends LayoutCallbacks {
322
350
  /** 标签宽度,默认 'auto' */
323
351
  labelWidth?: string | number;
324
352
  /** 尺寸,默认 'medium' */
325
- size?: "small" | "medium" | "large";
353
+ size?: 'small' | 'medium' | 'large';
326
354
  /** 禁用整个表单,默认 false */
327
355
  disabled?: boolean;
328
356
  /** 只读,默认 false */
@@ -331,6 +359,10 @@ interface FormConfig extends LayoutCallbacks {
331
359
  showActions?: boolean;
332
360
  /** 值变化时自动校验,默认 false */
333
361
  validateOnChange?: boolean;
362
+ /** 表单模式:create = 新建(默认),edit = 编辑(配合 initialValues 实现回填 + 脏检查) */
363
+ mode?: FormMode;
364
+ /** 编辑模式初始值:设置后自动作为脏检查基准 */
365
+ initialValues?: Record<string, any>;
334
366
  grid?: GridLayoutConfig;
335
367
  inline?: InlineLayoutConfig;
336
368
  card?: CardLayoutConfig;
@@ -340,7 +372,7 @@ interface FormConfig extends LayoutCallbacks {
340
372
  custom?: CustomLayoutConfig;
341
373
  }
342
374
  /** 解析后的配置(所有必填字段均已设置默认值) */
343
- interface ResolvedFormConfig extends Required<Omit<FormConfig, keyof LayoutCallbacks | "grid" | "inline" | "card" | "tabs" | "steps" | "dynamic" | "custom">> {
375
+ interface ResolvedFormConfig extends Required<Omit<FormConfig, keyof LayoutCallbacks | 'grid' | 'inline' | 'card' | 'tabs' | 'steps' | 'dynamic' | 'custom' | 'initialValues'>> {
344
376
  grid?: GridLayoutConfig;
345
377
  inline?: InlineLayoutConfig;
346
378
  card?: CardLayoutConfig;
@@ -348,19 +380,20 @@ interface ResolvedFormConfig extends Required<Omit<FormConfig, keyof LayoutCallb
348
380
  steps?: StepsLayoutConfig;
349
381
  dynamic?: DynamicLayoutConfig;
350
382
  custom?: CustomLayoutConfig;
351
- onTabChange?: LayoutCallbacks["onTabChange"];
352
- onTabValidate?: LayoutCallbacks["onTabValidate"];
353
- onStepChange?: LayoutCallbacks["onStepChange"];
354
- onStepBeforeChange?: LayoutCallbacks["onStepBeforeChange"];
355
- onStepValidate?: LayoutCallbacks["onStepValidate"];
356
- onFieldAdd?: LayoutCallbacks["onFieldAdd"];
357
- onFieldRemove?: LayoutCallbacks["onFieldRemove"];
358
- onFieldToggle?: LayoutCallbacks["onFieldToggle"];
359
- onFieldsClear?: LayoutCallbacks["onFieldsClear"];
360
- onRenderModeChange?: LayoutCallbacks["onRenderModeChange"];
361
- onGroupToggle?: LayoutCallbacks["onGroupToggle"];
362
- onGroupReset?: LayoutCallbacks["onGroupReset"];
363
- onFieldsChange?: LayoutCallbacks["onFieldsChange"];
383
+ onTabChange?: LayoutCallbacks['onTabChange'];
384
+ onTabValidate?: LayoutCallbacks['onTabValidate'];
385
+ onStepChange?: LayoutCallbacks['onStepChange'];
386
+ onStepBeforeChange?: LayoutCallbacks['onStepBeforeChange'];
387
+ onStepValidate?: LayoutCallbacks['onStepValidate'];
388
+ onFieldAdd?: LayoutCallbacks['onFieldAdd'];
389
+ onFieldRemove?: LayoutCallbacks['onFieldRemove'];
390
+ onFieldToggle?: LayoutCallbacks['onFieldToggle'];
391
+ onFieldsClear?: LayoutCallbacks['onFieldsClear'];
392
+ onRenderModeChange?: LayoutCallbacks['onRenderModeChange'];
393
+ onGroupToggle?: LayoutCallbacks['onGroupToggle'];
394
+ onGroupReset?: LayoutCallbacks['onGroupReset'];
395
+ onFieldsChange?: LayoutCallbacks['onFieldsChange'];
396
+ initialValues?: Record<string, any>;
364
397
  }
365
398
  declare const FORM_DEFAULTS: ResolvedFormConfig;
366
399
  /** 拥有自身控制按钮的布局(不显示默认操作按钮) */
@@ -427,6 +460,11 @@ declare const __VLS_base: vue.DefineComponent<CFormProps, {
427
460
  initialize: () => void;
428
461
  layoutType: vue.ComputedRef<LayoutType>;
429
462
  shouldShowDefaultActions: vue.ComputedRef<boolean>;
463
+ isDirty: vue.Ref<boolean, boolean>;
464
+ getChangedFields: () => string[];
465
+ isFieldDirty: (field: string) => boolean;
466
+ markAsClean: () => void;
467
+ asyncLoadingMap: vue.Ref<Record<string, boolean>, Record<string, boolean>>;
430
468
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
431
469
  "update:modelValue": (model: Record<string, any>) => any;
432
470
  submit: (payload: SubmitEventPayload) => any;
@@ -450,11 +488,7 @@ type __VLS_WithSlots<T, S> = T & {
450
488
  //#endregion
451
489
  //#region src/components/C_Form/composables/useFormState.d.ts
452
490
  /**
453
- * C_Form 状态引擎 — 管理表单数据模型、校验规则、验证 API、字段操作
454
- * @param options - 表单配置项(响应式)
455
- * @param config - 解析后的表单配置(响应式)
456
- * @param formRef - NForm 实例引用
457
- * @param emit - 组件事件发射器
491
+ * C_Form 状态引擎 — 管理表单数据模型、校验规则、验证 API、字段操作、脏检查、联动
458
492
  */
459
493
  declare function useFormState(options: ComputedRef<FormOption[]>, config: ComputedRef<ResolvedFormConfig>, formRef: Ref<FormInst$1 | null>, emit: {
460
494
  (e: 'update:modelValue', model: FormModel): void;
@@ -482,27 +516,44 @@ declare function useFormState(options: ComputedRef<FormOption[]>, config: Comput
482
516
  setFieldsValue: (fields: FormModel, shouldValidate?: boolean) => Promise<void>;
483
517
  handleSubmit: () => Promise<void>;
484
518
  handleReset: () => void;
519
+ isDirty: Ref<boolean, boolean>;
520
+ getChangedFields: () => string[];
521
+ isFieldDirty: (field: string) => boolean;
522
+ markAsClean: () => void;
523
+ asyncOptionsCache: Ref<Record<string, OptionItem[]>, Record<string, OptionItem[]>>;
524
+ asyncLoadingMap: Ref<Record<string, boolean>, Record<string, boolean>>;
485
525
  };
486
526
  //#endregion
487
527
  //#region src/components/C_Form/composables/useFormRenderer.d.ts
488
- /** 组件映射表 — 由调用方(C_Form)注入已解析的组件引用 */
489
528
  type ComponentMap = Record<string, Component>;
490
- /** 单个控件的渲染函数签名 */
491
529
  type FormRenderer = (baseProps: Record<string, any>, item: FormOption, config: ResolvedFormConfig, ctx?: {
492
530
  slots?: Record<string, any>;
493
531
  components?: ComponentMap;
494
532
  }) => VNode | null;
533
+ interface UseFormRendererOptions {
534
+ formModel: FormModel;
535
+ visibleOptions: ComputedRef<FormOption[]>;
536
+ config: ComputedRef<ResolvedFormConfig>;
537
+ handleFieldChange: (field: string) => void;
538
+ componentMap: ComponentMap;
539
+ instanceSlots?: Record<string, any>;
540
+ asyncOptionsCache: Ref<Record<string, OptionItem[]>>;
541
+ asyncLoadingMap: Ref<Record<string, boolean>>;
542
+ }
495
543
  /**
496
544
  * 运行时注册自定义渲染器 — 开闭原则
497
- * @param type - 控件类型名
498
- * @param renderer - 渲染函数
499
545
  */
500
546
  declare function registerRenderer(type: string, renderer: FormRenderer): void;
501
547
  /**
502
548
  * 渲染引擎 Composable — 生成 formItems VNode 数组
503
- * @param componentMap - 已解析的组件映射表(由 C_Form 的 <script setup> 提供)
549
+ *
550
+ * v0.8.0 增强:
551
+ * - 字段级 disabled / readonly
552
+ * - help / tooltip label 渲染
553
+ * - asyncOptions 远程选项合并
554
+ * - loading 占位
504
555
  */
505
- declare function useFormRenderer(formModel: FormModel, visibleOptions: ComputedRef<FormOption[]>, config: ComputedRef<ResolvedFormConfig>, handleFieldChange: (field: string) => void, componentMap: ComponentMap, instanceSlots?: Record<string, any>): {
556
+ declare function useFormRenderer(opts: UseFormRendererOptions): {
506
557
  renderFormItem: (item: FormOption) => VNode | null;
507
558
  formItems: ComputedRef<VNode<vue.RendererNode, vue.RendererElement, {
508
559
  [key: string]: any;
@@ -510,6 +561,23 @@ declare function useFormRenderer(formModel: FormModel, visibleOptions: ComputedR
510
561
  getBaseProps: (item: FormOption) => Record<string, unknown>;
511
562
  };
512
563
  //#endregion
564
+ //#region src/components/C_Form/composables/useFormDirty.d.ts
565
+ interface UseFormDirtyReturn {
566
+ /** 表单是否已修改 */
567
+ isDirty: Ref<boolean>;
568
+ /** 获取发生变化的字段名列表 */
569
+ getChangedFields: () => string[];
570
+ /** 检查指定字段是否脏 */
571
+ isFieldDirty: (field: string) => boolean;
572
+ /** 保存当前值为干净快照 */
573
+ markAsClean: () => void;
574
+ }
575
+ /**
576
+ * 脏检查 Composable — 追踪 formModel 相对于初始快照的变化
577
+ * @param formModel 响应式表单数据对象(reactive)
578
+ */
579
+ declare function useFormDirty(formModel: FormModel): UseFormDirtyReturn;
580
+ //#endregion
513
581
  //#region node_modules/async-validator/dist-types/interface.d.ts
514
582
  declare type RuleType = 'string' | 'number' | 'boolean' | 'method' | 'regexp' | 'integer' | 'float' | 'array' | 'object' | 'enum' | 'date' | 'url' | 'hex' | 'email' | 'pattern' | 'any';
515
583
  interface ValidateOption {
@@ -1294,9 +1362,11 @@ declare const useDynamicFormState: () => {
1294
1362
  readonly value?: any;
1295
1363
  readonly placeholder?: string | undefined;
1296
1364
  readonly rules?: readonly {
1297
- readonly max?: number | undefined;
1298
1365
  readonly type?: RuleType | undefined;
1299
1366
  readonly required?: boolean | undefined;
1367
+ readonly max?: number | undefined;
1368
+ readonly level?: "warning" | "error" | undefined;
1369
+ readonly key?: string | undefined;
1300
1370
  readonly options?: {
1301
1371
  readonly suppressWarning?: boolean | undefined;
1302
1372
  readonly suppressValidatorError?: boolean | undefined;
@@ -1352,9 +1422,8 @@ declare const useDynamicFormState: () => {
1352
1422
  readonly keys?: readonly string[] | undefined;
1353
1423
  readonly error?: ((rule: InternalRuleItem, message: string) => ValidateError) | undefined;
1354
1424
  } | undefined;
1355
- readonly trigger?: string | readonly string[] | undefined;
1356
- readonly pattern?: (RegExp | string) | undefined;
1357
1425
  readonly asyncValidator?: naive_ui_es_form_src_interface0.FormItemRuleAsyncValidator | undefined;
1426
+ readonly pattern?: (RegExp | string) | undefined;
1358
1427
  readonly min?: number | undefined;
1359
1428
  readonly len?: number | undefined;
1360
1429
  readonly enum?: readonly (string | number | boolean | null | undefined)[] | undefined;
@@ -1929,9 +1998,8 @@ declare const useDynamicFormState: () => {
1929
1998
  }[] | undefined;
1930
1999
  readonly transform?: ((value: Value) => Value) | undefined;
1931
2000
  readonly message?: string | ((a?: string) => string) | undefined;
1932
- readonly key?: string | undefined;
2001
+ readonly trigger?: string | readonly string[] | undefined;
1933
2002
  readonly renderMessage?: (() => vue.VNodeChild) | undefined;
1934
- readonly level?: "warning" | "error" | undefined;
1935
2003
  readonly validator: NonNullable<naive_ui0.FormItemRule["validator"]>;
1936
2004
  }[] | undefined;
1937
2005
  readonly attrs?: {
@@ -3557,6 +3625,12 @@ declare const useDynamicFormState: () => {
3557
3625
  readonly required?: boolean | undefined;
3558
3626
  readonly dependsOn?: string | readonly string[] | undefined;
3559
3627
  readonly showWhen?: ((formModel: Record<string, any>) => boolean) | undefined;
3628
+ readonly disabled?: boolean | ((formModel: Record<string, any>) => boolean) | undefined;
3629
+ readonly readonly?: boolean | ((formModel: Record<string, any>) => boolean) | undefined;
3630
+ readonly valueWhen?: ((formModel: Record<string, any>) => any) | undefined;
3631
+ readonly asyncOptions?: ((formModel: Record<string, any>) => Promise<OptionItem[]>) | undefined;
3632
+ readonly rulesWhen?: ((formModel: Record<string, any>) => _robot_admin_form_validate0.FieldRule[]) | undefined;
3633
+ readonly crossFieldValidator?: ((formModel: Record<string, any>) => string | null) | undefined;
3560
3634
  }[];
3561
3635
  readonly dynamicFields: readonly {
3562
3636
  readonly id: string;
@@ -3571,9 +3645,11 @@ declare const useDynamicFormState: () => {
3571
3645
  readonly span?: number | undefined;
3572
3646
  } | undefined;
3573
3647
  readonly rules?: readonly {
3574
- readonly max?: number | undefined;
3575
3648
  readonly type?: RuleType | undefined;
3576
3649
  readonly required?: boolean | undefined;
3650
+ readonly max?: number | undefined;
3651
+ readonly level?: "warning" | "error" | undefined;
3652
+ readonly key?: string | undefined;
3577
3653
  readonly options?: {
3578
3654
  readonly suppressWarning?: boolean | undefined;
3579
3655
  readonly suppressValidatorError?: boolean | undefined;
@@ -3629,9 +3705,8 @@ declare const useDynamicFormState: () => {
3629
3705
  readonly keys?: readonly string[] | undefined;
3630
3706
  readonly error?: ((rule: InternalRuleItem, message: string) => ValidateError) | undefined;
3631
3707
  } | undefined;
3632
- readonly trigger?: string | readonly string[] | undefined;
3633
- readonly pattern?: (RegExp | string) | undefined;
3634
3708
  readonly asyncValidator?: naive_ui_es_form_src_interface0.FormItemRuleAsyncValidator | undefined;
3709
+ readonly pattern?: (RegExp | string) | undefined;
3635
3710
  readonly min?: number | undefined;
3636
3711
  readonly len?: number | undefined;
3637
3712
  readonly enum?: readonly (string | number | boolean | null | undefined)[] | undefined;
@@ -4206,9 +4281,8 @@ declare const useDynamicFormState: () => {
4206
4281
  }[] | undefined;
4207
4282
  readonly transform?: ((value: Value) => Value) | undefined;
4208
4283
  readonly message?: string | ((a?: string) => string) | undefined;
4209
- readonly key?: string | undefined;
4284
+ readonly trigger?: string | readonly string[] | undefined;
4210
4285
  readonly renderMessage?: (() => vue.VNodeChild) | undefined;
4211
- readonly level?: "warning" | "error" | undefined;
4212
4286
  readonly validator: NonNullable<naive_ui0.FormItemRule["validator"]>;
4213
4287
  }[] | undefined;
4214
4288
  }[];
@@ -4244,5 +4318,5 @@ type DynamicFormStateType = ReturnType<typeof useDynamicFormState>;
4244
4318
  */
4245
4319
  declare const DYNAMIC_FORM_STATE_KEY: unique symbol;
4246
4320
  //#endregion
4247
- export { LayoutConfig as A, DynamicFormState as C, GridLayoutConfig as D, FormOption as E, StepsLayoutConfig as M, SubmitEventPayload as N, InlineLayoutConfig as O, TabsLayoutConfig as P, DynamicFormConfig as S, FormModel as T, shouldShowActions as _, ComponentMap as a, CustomLayoutConfig as b, useFormRenderer as c, FORM_DEFAULTS as d, FormConfig as f, resolveFormConfig as g, ResolvedFormConfig as h, useDynamicFormState as i, LayoutType as j, LabelPlacement as k, useFormState as l, LayoutCallbacks as m, DynamicFormStateType as n, FormRenderer as o, LAYOUTS_WITH_OWN_CONTROLS as p, FIELD_TYPE_OPTIONS as r, registerRenderer as s, DYNAMIC_FORM_STATE_KEY as t, _default as u, CardLayoutConfig as v, FormInstance as w, DynamicFieldConfig as x, ComponentType as y };
4321
+ export { FormOption as A, CustomLayoutConfig as C, FormInstance as D, DynamicFormState as E, LayoutType as F, StepsLayoutConfig as I, SubmitEventPayload as L, InlineLayoutConfig as M, LabelPlacement as N, FormMode as O, LayoutConfig as P, TabsLayoutConfig as R, ComponentType as S, DynamicFormConfig as T, LayoutCallbacks as _, UseFormDirtyReturn as a, shouldShowActions as b, FormRenderer as c, useFormRenderer as d, useFormState as f, LAYOUTS_WITH_OWN_CONTROLS as g, FormConfig as h, useDynamicFormState as i, GridLayoutConfig as j, FormModel as k, UseFormRendererOptions as l, FORM_DEFAULTS as m, DynamicFormStateType as n, useFormDirty as o, _default as p, FIELD_TYPE_OPTIONS as r, ComponentMap as s, DYNAMIC_FORM_STATE_KEY as t, registerRenderer as u, ResolvedFormConfig as v, DynamicFieldConfig as w, CardLayoutConfig as x, resolveFormConfig as y };
4248
4322
  //# sourceMappingURL=useDynamicFormState.d.ts.map
@@ -259,10 +259,10 @@ declare const __VLS_export: vue.DefineComponent<Props, {
259
259
  onReady?: ((graph: any) => any) | undefined;
260
260
  "onData-change"?: ((data: DiagramData) => any) | undefined;
261
261
  }>, {
262
+ readonly: boolean;
263
+ height: string | number;
262
264
  theme: "light" | "dark";
263
265
  width: string | number;
264
- height: string | number;
265
- readonly: boolean;
266
266
  showToolbar: boolean;
267
267
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
268
268
  declare const _default: typeof __VLS_export;
@@ -89,9 +89,9 @@ declare const __VLS_base: vue.DefineComponent<WaterFallProps, WaterFallExpose, {
89
89
  "onImage-loaded"?: ((item: WaterFallItem) => any) | undefined;
90
90
  "onImage-error"?: ((item: WaterFallItem) => any) | undefined;
91
91
  }>, {
92
+ columns: number;
92
93
  loading: boolean;
93
94
  animationDuration: number;
94
- columns: number;
95
95
  gap: number;
96
96
  infinite: boolean;
97
97
  lazy: boolean;
@@ -827,7 +827,7 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
827
827
  clearRowSelection: () => void;
828
828
  resetToFirstPage: () => void;
829
829
  getSelectedRows: () => DataRecord[];
830
- getEditingData: () => vue.Ref<Record<string, any>, Record<string, any>> | DataRecord | null;
830
+ getEditingData: () => DataRecord | vue.Ref<Record<string, any>, Record<string, any>> | null;
831
831
  isEditing: (rowKey: DataTableRowKey$1, columnKey?: string) => boolean;
832
832
  isExpanded: (rowKey: DataTableRowKey$1) => boolean;
833
833
  getManager: () => {
@@ -836,7 +836,7 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
836
836
  cancel(): void;
837
837
  save(): Promise<void>;
838
838
  isEditing(rowKey: DataTableRowKey$1, columnKey?: string): boolean;
839
- getEditingData(): vue.Ref<Record<string, any>, Record<string, any>> | DataRecord | null;
839
+ getEditingData(): DataRecord | vue.Ref<Record<string, any>, Record<string, any>> | null;
840
840
  };
841
841
  expand: {
842
842
  row(rowKey: DataTableRowKey$1): Promise<void>;
@@ -885,7 +885,6 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
885
885
  } | undefined;
886
886
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
887
887
  cancel: (rowData: DataRecord, rowIndex: number) => any;
888
- save: (rowData: DataRecord, rowIndex: number, columnKey?: string | undefined) => any;
889
888
  "pagination-change": (...args: unknown[]) => any;
890
889
  "row-delete": (...args: unknown[]) => any;
891
890
  "expand-change": (expandedKeys: DataTableRowKey$1[], row?: DataRecord | undefined, expanded?: boolean | undefined) => any;
@@ -893,6 +892,7 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
893
892
  "child-selection-change": (parentKey: DataTableRowKey$1, childKeys: DataTableRowKey$1[], childRows: any[]) => any;
894
893
  "parent-child-link-change": (parentKey: DataTableRowKey$1, shouldSelect: boolean) => any;
895
894
  "update:data": (data: DataRecord[]) => any;
895
+ save: (rowData: DataRecord, rowIndex: number, columnKey?: string | undefined) => any;
896
896
  "row-add": (newRow: DataRecord) => any;
897
897
  "row-copy": (originalRow: DataRecord, newRow: DataRecord) => any;
898
898
  "row-move": (row: DataRecord, fromIndex: number, toIndex: number) => any;
@@ -901,7 +901,6 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
901
901
  "column-change": (columns: TableColumn[]) => any;
902
902
  }, string, vue.PublicProps, Readonly<__VLS_Props> & Readonly<{
903
903
  onCancel?: ((rowData: DataRecord, rowIndex: number) => any) | undefined;
904
- onSave?: ((rowData: DataRecord, rowIndex: number, columnKey?: string | undefined) => any) | undefined;
905
904
  "onPagination-change"?: ((...args: unknown[]) => any) | undefined;
906
905
  "onRow-delete"?: ((...args: unknown[]) => any) | undefined;
907
906
  "onExpand-change"?: ((expandedKeys: DataTableRowKey$1[], row?: DataRecord | undefined, expanded?: boolean | undefined) => any) | undefined;
@@ -909,6 +908,7 @@ declare const __VLS_base: vue.DefineComponent<__VLS_Props, {
909
908
  "onChild-selection-change"?: ((parentKey: DataTableRowKey$1, childKeys: DataTableRowKey$1[], childRows: any[]) => any) | undefined;
910
909
  "onParent-child-link-change"?: ((parentKey: DataTableRowKey$1, shouldSelect: boolean) => any) | undefined;
911
910
  "onUpdate:data"?: ((data: DataRecord[]) => any) | undefined;
911
+ onSave?: ((rowData: DataRecord, rowIndex: number, columnKey?: string | undefined) => any) | undefined;
912
912
  "onRow-add"?: ((newRow: DataRecord) => any) | undefined;
913
913
  "onRow-copy"?: ((originalRow: DataRecord, newRow: DataRecord) => any) | undefined;
914
914
  "onRow-move"?: ((row: DataRecord, fromIndex: number, toIndex: number) => any) | undefined;
@@ -1158,7 +1158,7 @@ declare function useTableManager(params: TableManagerParams): {
1158
1158
  cancel(): void; /** 保存编辑 */
1159
1159
  save(): Promise<void>; /** 是否正在编辑 */
1160
1160
  isEditing(rowKey: DataTableRowKey$1, columnKey?: string): boolean; /** 获取当前编辑数据 */
1161
- getEditingData(): vue.Ref<Record<string, any>, Record<string, any>> | DataRecord | null;
1161
+ getEditingData(): DataRecord | vue.Ref<Record<string, any>, Record<string, any>> | null;
1162
1162
  };
1163
1163
  expand: {
1164
1164
  /** 展开行 */row(rowKey: DataTableRowKey$1): Promise<void>; /** 折叠行 */
@@ -54,8 +54,8 @@ declare const __VLS_export: vue.DefineComponent<Props, QRCodeExpose, {}, {}, {},
54
54
  mode: RenderMode;
55
55
  label: string;
56
56
  color: string;
57
- margin: number;
58
57
  showBorder: boolean;
58
+ margin: number;
59
59
  showLabel: boolean;
60
60
  bgColor: string;
61
61
  errorCorrectionLevel: ErrorCorrectionLevel;
@@ -55,12 +55,12 @@ declare const __VLS_export: vue.DefineComponent<Props, {
55
55
  cleanFn: () => void;
56
56
  changeFoldState: () => void;
57
57
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
58
- reset: () => any;
59
58
  search: (params: SearchFormParams) => any;
59
+ reset: () => any;
60
60
  "change-params": (params: SearchFormParams) => any;
61
61
  }, string, vue.PublicProps, Readonly<Props> & Readonly<{
62
- onReset?: (() => any) | undefined;
63
62
  onSearch?: ((params: SearchFormParams) => any) | undefined;
63
+ onReset?: (() => any) | undefined;
64
64
  "onChange-params"?: ((params: SearchFormParams) => any) | undefined;
65
65
  }>, {
66
66
  size: "small" | "medium" | "large";
@@ -91,16 +91,16 @@ interface SignatureEmits {
91
91
  //#endregion
92
92
  //#region src/components/C_Signature/index.vue.d.ts
93
93
  declare const __VLS_export: vue.DefineComponent<SignatureProps, SignatureExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
94
- change: (data: SignatureStroke[]) => any;
95
94
  clear: () => any;
95
+ change: (data: SignatureStroke[]) => any;
96
96
  "start-draw": () => any;
97
97
  drawing: (point: SignaturePoint) => any;
98
98
  "end-draw": (stroke: SignatureStroke) => any;
99
99
  undo: () => any;
100
100
  redo: () => any;
101
101
  }, string, vue.PublicProps, Readonly<SignatureProps> & Readonly<{
102
- onChange?: ((data: SignatureStroke[]) => any) | undefined;
103
102
  onClear?: (() => any) | undefined;
103
+ onChange?: ((data: SignatureStroke[]) => any) | undefined;
104
104
  "onStart-draw"?: (() => any) | undefined;
105
105
  onDrawing?: ((point: SignaturePoint) => any) | undefined;
106
106
  "onEnd-draw"?: ((stroke: SignatureStroke) => any) | undefined;
@@ -108,9 +108,9 @@ declare const __VLS_export: vue.DefineComponent<SignatureProps, SignatureExpose,
108
108
  onRedo?: (() => any) | undefined;
109
109
  }>, {
110
110
  disabled: boolean;
111
- width: number | string;
112
- height: number | string;
113
111
  readonly: boolean;
112
+ height: number | string;
113
+ width: number | string;
114
114
  showToolbar: boolean;
115
115
  maxHistory: number;
116
116
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
@@ -66,25 +66,25 @@ type __VLS_Slots = {} & {
66
66
  second?: (props: typeof __VLS_13) => any;
67
67
  };
68
68
  declare const __VLS_base: vue.DefineComponent<Props, SplitPaneExpose, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
69
- expand: (target: CollapseTarget) => any;
70
- collapse: (target: CollapseTarget) => any;
71
69
  resize: (firstSize: number, secondSize: number) => any;
70
+ collapse: (target: CollapseTarget) => any;
71
+ expand: (target: CollapseTarget) => any;
72
72
  "drag-start": (size: number) => any;
73
73
  "drag-end": (size: number) => any;
74
74
  }, string, vue.PublicProps, Readonly<Props> & Readonly<{
75
- onExpand?: ((target: CollapseTarget) => any) | undefined;
76
- onCollapse?: ((target: CollapseTarget) => any) | undefined;
77
75
  onResize?: ((firstSize: number, secondSize: number) => any) | undefined;
76
+ onCollapse?: ((target: CollapseTarget) => any) | undefined;
77
+ onExpand?: ((target: CollapseTarget) => any) | undefined;
78
78
  "onDrag-start"?: ((size: number) => any) | undefined;
79
79
  "onDrag-end"?: ((size: number) => any) | undefined;
80
80
  }>, {
81
- direction: SplitDirection;
82
81
  disabled: boolean;
82
+ direction: SplitDirection;
83
83
  step: number;
84
- maxSize: number;
85
- collapsible: boolean;
86
84
  defaultSize: number;
87
85
  minSize: number;
86
+ maxSize: number;
87
+ collapsible: boolean;
88
88
  showCollapseButton: boolean;
89
89
  gutterSize: number;
90
90
  }, {}, {}, {}, string, vue.ComponentProvideOptions, false, {}, any>;
@@ -48,8 +48,8 @@ declare const __VLS_export: vue.DefineComponent<TimeProps, TimeExpose, {}, {}, {
48
48
  "onChange-start"?: ((time: number | null) => any) | undefined;
49
49
  "onChange-end"?: ((time: number | null) => any) | undefined;
50
50
  }>, {
51
- mode: TimeMode;
52
51
  placeholder: string;
52
+ mode: TimeMode;
53
53
  startPlaceholder: string;
54
54
  endPlaceholder: string;
55
55
  attrs: Record<string, any>;
@@ -104,11 +104,11 @@ declare const __VLS_base: vue.DefineComponent<TreeProps, TreeExpose, {}, {}, {},
104
104
  }>, {
105
105
  mode: TreeMode;
106
106
  actions: ActionConfig[];
107
- showToolbar: boolean;
108
107
  labelField: string;
108
+ keyField: string;
109
109
  childrenField: string;
110
+ showToolbar: boolean;
110
111
  draggable: boolean;
111
- keyField: string;
112
112
  searchPattern: string;
113
113
  searchable: boolean;
114
114
  searchPlaceholder: string;
@@ -237,22 +237,22 @@ declare const __VLS_export: vue.DefineComponent<WorkflowProps, {
237
237
  conditionNodes: number;
238
238
  }>;
239
239
  }, {}, {}, {}, vue.ComponentOptionsMixin, vue.ComponentOptionsMixin, {
240
- change: (value: WorkflowData) => any;
241
240
  "update:modelValue": (value: WorkflowData) => any;
241
+ change: (value: WorkflowData) => any;
242
242
  "validate-error": (errors: ValidationError[]) => any;
243
243
  save: (data: WorkflowData) => any;
244
244
  "node-click": (node: WorkflowNode) => any;
245
245
  "edge-click": (edge: WorkflowEdge) => any;
246
246
  }, string, vue.PublicProps, Readonly<WorkflowProps> & Readonly<{
247
- onChange?: ((value: WorkflowData) => any) | undefined;
248
247
  "onUpdate:modelValue"?: ((value: WorkflowData) => any) | undefined;
248
+ onChange?: ((value: WorkflowData) => any) | undefined;
249
249
  "onValidate-error"?: ((errors: ValidationError[]) => any) | undefined;
250
250
  onSave?: ((data: WorkflowData) => any) | undefined;
251
251
  "onNode-click"?: ((node: WorkflowNode) => any) | undefined;
252
252
  "onEdge-click"?: ((edge: WorkflowEdge) => any) | undefined;
253
253
  }>, {
254
- theme: "light" | "dark";
255
254
  readonly: boolean;
255
+ theme: "light" | "dark";
256
256
  users: User[];
257
257
  roles: Role[];
258
258
  departments: Department[];
package/package.json CHANGED
@@ -3,7 +3,7 @@
3
3
  "publishConfig": {
4
4
  "access": "public"
5
5
  },
6
- "version": "0.7.2",
6
+ "version": "0.8.0",
7
7
  "description": "基于 Naive UI 的 Vue 3 组件库",
8
8
  "type": "module",
9
9
  "main": "dist/index.cjs",