@dazhicheng/ui 1.5.121 → 1.5.123

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.
@@ -1,6 +1,7 @@
1
1
  import { PropType } from 'vue';
2
2
  import { FieldEntry } from '../types/forms';
3
3
  import { FormSchema } from '../types';
4
+ import { Recordable } from '../../../../../../utils/src';
4
5
  declare const FormArrayRegister: import('vue').DefineComponent<import('vue').ExtractPropTypes<{
5
6
  fieldName: {
6
7
  type: PropType<string>;
@@ -206,6 +206,24 @@ export declare class FormApi {
206
206
  * @param indexB 第二个索引位置
207
207
  */
208
208
  swap: (name: string, indexA: number, indexB: number) => void | undefined;
209
+ /**
210
+ * @description 获取嵌套数组路径下的操作器
211
+ * @param parentPath 父数组路径(如 actions.data)
212
+ * @param index 父数组索引
213
+ * @param childField 子数组字段名(如 skills)
214
+ */
215
+ at: <TValue = unknown>(parentPath: string, index: number, childField: string) => {
216
+ path: string;
217
+ get: () => Readonly<FieldArrayContext<TValue>> | undefined;
218
+ push: (value: TValue) => void | undefined;
219
+ remove: (idx: number) => void | undefined;
220
+ replace: (values: TValue[]) => void | undefined;
221
+ update: (idx: number, value: TValue) => void | undefined;
222
+ insert: (idx: number, value: TValue) => void | undefined;
223
+ prepend: (value: TValue) => void | undefined;
224
+ move: (oldIdx: number, newIdx: number) => void | undefined;
225
+ swap: (indexA: number, indexB: number) => void | undefined;
226
+ };
209
227
  };
210
228
  private _getArrayFieldActions;
211
229
  }
@@ -280,6 +280,25 @@ export declare class GroupFormApi extends FormApi {
280
280
  prepend: <TValue = unknown>(name: string, value: TValue) => void;
281
281
  move: (name: string, oldIdx: number, newIdx: number) => void;
282
282
  swap: (name: string, indexA: number, indexB: number) => void;
283
+ /**
284
+ * @description 获取嵌套数组路径下的操作器
285
+ * @param parentPath 父数组路径
286
+ * @param index 父数组索引
287
+ * @param childField 子数组字段名
288
+ * @returns 嵌套数组操作器
289
+ */
290
+ at: <TValue = unknown>(parentPath: string, index: number, childField: string) => {
291
+ path: string;
292
+ get: () => Readonly<import('../types').FieldArrayContext<TValue>> | undefined;
293
+ push: (value: TValue) => void;
294
+ remove: (idx: number) => void;
295
+ replace: (values: TValue[]) => void;
296
+ update: (idx: number, value: TValue) => void;
297
+ insert: (idx: number, value: TValue) => void;
298
+ prepend: (value: TValue) => void;
299
+ move: (oldIdx: number, newIdx: number) => void;
300
+ swap: (indexA: number, indexB: number) => void;
301
+ };
283
302
  };
284
303
  unmount(): void;
285
304
  }
@@ -1,12 +1,10 @@
1
- import { MaybeRef, Ref, ShallowRef, ComputedRef, Component } from 'vue';
1
+ import { MaybeRef, ShallowRef, ComputedRef, Component } from 'vue';
2
2
  import { BaseFormComponentMap } from '../types';
3
- import { TtApiComponent } from '../../../tt-api-component';
4
- import { ElSelect, ElSelectV2 } from 'element-plus';
5
3
  type CollapseOptions = {
6
4
  componentProps: MaybeRef<any>;
7
5
  component: keyof BaseFormComponentMap | Component;
8
6
  selectWrapRef: Readonly<ShallowRef<HTMLElement | null>>;
9
- selectRef: Ref<InstanceType<typeof ElSelect> | InstanceType<typeof ElSelectV2> | InstanceType<typeof TtApiComponent>>;
7
+ selectRef: any;
10
8
  };
11
9
  export declare function useSelectCollapseOptions(data: ComputedRef<CollapseOptions>): {
12
10
  selectComponentProps: ComputedRef<any>;
@@ -6,6 +6,7 @@ import { TtTextProps } from '../../tt-text';
6
6
  import { TtSelectProp } from '../../tt-select';
7
7
  import { TtUploadProps } from '../../tt-upload';
8
8
  import { Props as TtApiComponentProps } from '../../tt-api-component';
9
+ import { Recordable } from '../../../../../utils/src';
9
10
  import { FieldEntry, FieldArrayContext } from './types/forms';
10
11
  import { PanelContainerProps } from '../../tt-panel-select';
11
12
  import { FormApi } from './formApi';
@@ -245,7 +246,7 @@ export interface FormSchema<T extends BaseFormComponentType = BaseFormComponentT
245
246
  * @example arraySchema: []
246
247
  * @example arraySchema: (entry, index) => []
247
248
  */
248
- arraySchema?: FormSchema[] | ((entry: FieldEntry, currentIndex: number) => FormSchema[]);
249
+ arraySchema?: FormSchema[] | ((entry: FieldEntry<Recordable>, currentIndex: number) => FormSchema[]);
249
250
  }
250
251
  /** 插槽 scope 参数,传递给渲染函数或具名插槽 */
251
252
  export interface FormSlotScope {
@@ -0,0 +1,8 @@
1
+ /**
2
+ * 拼接数组子路径
3
+ * @param parentPath 父数组路径
4
+ * @param index 父数组索引
5
+ * @param childField 子数组字段名
6
+ * @returns 嵌套数组完整路径
7
+ */
8
+ export declare function childArrayPath(parentPath: string, index: number, childField: string): string;
@@ -1,4 +1,4 @@
1
- import { PanelSelectValue } from '../props';
1
+ import { PanelSelectValue } from '../types';
2
2
  import { PanelTreeNode } from '../hooks/usePanelData';
3
3
  type __VLS_Props = {
4
4
  prefixCls: string;
@@ -1,5 +1,5 @@
1
1
  import { nextTick } from 'vue';
2
- import { PanelSelectValue, PanelMiddleProps } from '../props';
2
+ import { PanelSelectValue, PanelMiddleProps } from '../types';
3
3
  declare function scrollToGroup(groupValue: PanelSelectValue): Promise<void>;
4
4
  declare const _default: import('vue').DefineComponent<PanelMiddleProps, {
5
5
  scrollToGroup: typeof scrollToGroup;
@@ -1,6 +1,6 @@
1
1
  import { nextTick } from 'vue';
2
2
  import { PanelTreeNode } from '../hooks/usePanelData';
3
- import { PanelSelectValue } from '../props';
3
+ import { PanelSelectValue } from '../types';
4
4
  type __VLS_Props = {
5
5
  prefixCls: string;
6
6
  multiple: boolean;
@@ -1,4 +1,4 @@
1
- import { PanelContainerProps, PanelSelectOption, PanelSelectValue } from '../props';
1
+ import { PanelContainerProps, PanelSelectOption, PanelSelectValue } from '../types';
2
2
  /**
3
3
  * 面板内部统一使用的树节点结构。
4
4
  */
@@ -1,5 +1,5 @@
1
1
  import { Ref, WritableComputedRef } from 'vue';
2
- import { PanelSelectModelValue, PanelSelectValue } from '../props';
2
+ import { PanelSelectModelValue, PanelSelectValue } from '../types';
3
3
  import { OptionGroup, PanelTreeNode } from './usePanelData';
4
4
  type UsePanelSelectSelectionParams = {
5
5
  multiple: Readonly<Ref<boolean>>;