rtcpts 0.0.13 → 0.0.15

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.
@@ -12,12 +12,44 @@ interface TransformConfig {
12
12
  optionValue?: string;
13
13
  optionChildren?: string;
14
14
  }
15
- /**
16
- * 把通用数组转成 label/value/children 格式的数组。
17
- *
18
- * @param array 待转换的原始数组。
19
- * @param config 包含自定义键名的配置对象。
20
- * @returns 转换后的 TargetOption 数组。
21
- */
22
15
  export declare function transformTreeUseLabelAndValue(array: RawItem[], config?: TransformConfig): TargetOption[];
16
+ interface BuildTreeConfig {
17
+ data: any[];
18
+ key?: string;
19
+ idKey?: string;
20
+ rootId?: string | number;
21
+ isMapOption?: boolean;
22
+ labelValue?: {
23
+ label: string;
24
+ value: string;
25
+ };
26
+ }
27
+ export declare function buildTree(config: BuildTreeConfig): {
28
+ data: any[];
29
+ flatData: any[];
30
+ };
31
+ interface ArrayToTreeConfig {
32
+ data: any[];
33
+ parentKey?: string;
34
+ idKey?: string;
35
+ rootId: string | number;
36
+ childrenKey?: string;
37
+ }
38
+ export declare function arrayToTree(config: ArrayToTreeConfig): any[];
39
+ interface FindParentIdsConfig {
40
+ targetIds: (string | number)[];
41
+ allData: any[];
42
+ parentKey?: string;
43
+ idKey?: string;
44
+ excludeRootParent?: boolean;
45
+ rootParentValue?: string | number | null;
46
+ }
47
+ export declare function findParentIds(config: FindParentIdsConfig): (string | number)[];
48
+ interface FilterLeafIdsConfig {
49
+ treeData: any[];
50
+ idList: (string | number)[];
51
+ idKey?: string;
52
+ childrenKey?: string;
53
+ }
54
+ export declare function filterLeafIds(config: FilterLeafIdsConfig): (string | number)[];
23
55
  export {};
@@ -92,14 +92,6 @@ declare const _default: DefineComponent<ExtractPropTypes<{
92
92
  type: PropType<"none" | "strict" | "leaf" | "leaf-filtered" | undefined>;
93
93
  default: string;
94
94
  };
95
- readonly: {
96
- type: BooleanConstructor;
97
- default: boolean;
98
- };
99
- disable: {
100
- type: BooleanConstructor;
101
- default: boolean;
102
- };
103
95
  }>> & Readonly<{
104
96
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
105
97
  }>, {
@@ -107,8 +99,6 @@ declare const _default: DefineComponent<ExtractPropTypes<{
107
99
  mainRef: Ref< QTree | null, QTree | null>;
108
100
  computedValue: WritableComputedRef<(string | number)[], (string | number)[]>;
109
101
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "update:modelValue"[], PublicProps, {
110
- disable: boolean;
111
- readonly: boolean;
112
102
  multiple: boolean;
113
103
  options: any[];
114
104
  optionLabel: string;
@@ -188,14 +178,6 @@ declare const _default: DefineComponent<ExtractPropTypes<{
188
178
  type: PropType<"none" | "strict" | "leaf" | "leaf-filtered" | undefined>;
189
179
  default: string;
190
180
  };
191
- readonly: {
192
- type: BooleanConstructor;
193
- default: boolean;
194
- };
195
- disable: {
196
- type: BooleanConstructor;
197
- default: boolean;
198
- };
199
181
  }>> & Readonly<{
200
182
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
201
183
  }>, {
@@ -203,8 +185,6 @@ declare const _default: DefineComponent<ExtractPropTypes<{
203
185
  mainRef: Ref< QTree | null, QTree | null>;
204
186
  computedValue: WritableComputedRef<(string | number)[], (string | number)[]>;
205
187
  }, {}, {}, {}, {
206
- disable: boolean;
207
- readonly: boolean;
208
188
  multiple: boolean;
209
189
  options: any[];
210
190
  optionLabel: string;
@@ -234,14 +214,6 @@ declare const _default: DefineComponent<ExtractPropTypes<{
234
214
  type: PropType<"none" | "strict" | "leaf" | "leaf-filtered" | undefined>;
235
215
  default: string;
236
216
  };
237
- readonly: {
238
- type: BooleanConstructor;
239
- default: boolean;
240
- };
241
- disable: {
242
- type: BooleanConstructor;
243
- default: boolean;
244
- };
245
217
  }>> & Readonly<{
246
218
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
247
219
  }>, {
@@ -249,8 +221,6 @@ declare const _default: DefineComponent<ExtractPropTypes<{
249
221
  mainRef: Ref< QTree | null, QTree | null>;
250
222
  computedValue: WritableComputedRef<(string | number)[], (string | number)[]>;
251
223
  }, {}, {}, {}, ComponentOptionsMixin, ComponentOptionsMixin, "update:modelValue"[], PublicProps, {
252
- disable: boolean;
253
- readonly: boolean;
254
224
  multiple: boolean;
255
225
  options: any[];
256
226
  optionLabel: string;
@@ -330,14 +300,6 @@ declare const _default: DefineComponent<ExtractPropTypes<{
330
300
  type: PropType<"none" | "strict" | "leaf" | "leaf-filtered" | undefined>;
331
301
  default: string;
332
302
  };
333
- readonly: {
334
- type: BooleanConstructor;
335
- default: boolean;
336
- };
337
- disable: {
338
- type: BooleanConstructor;
339
- default: boolean;
340
- };
341
303
  }>> & Readonly<{
342
304
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
343
305
  }>, {
@@ -345,8 +307,6 @@ declare const _default: DefineComponent<ExtractPropTypes<{
345
307
  mainRef: Ref< QTree | null, QTree | null>;
346
308
  computedValue: WritableComputedRef<(string | number)[], (string | number)[]>;
347
309
  }, {}, {}, {}, {
348
- disable: boolean;
349
- readonly: boolean;
350
310
  multiple: boolean;
351
311
  options: any[];
352
312
  optionLabel: string;
@@ -650,14 +610,6 @@ declare const _default: DefineComponent<ExtractPropTypes<{
650
610
  type: PropType<"none" | "strict" | "leaf" | "leaf-filtered" | undefined>;
651
611
  default: string;
652
612
  };
653
- readonly: {
654
- type: BooleanConstructor;
655
- default: boolean;
656
- };
657
- disable: {
658
- type: BooleanConstructor;
659
- default: boolean;
660
- };
661
613
  }>, {
662
614
  t: t;
663
615
  mainRef: Ref< QTree | null, QTree | null>;
@@ -686,19 +638,9 @@ declare const _default: DefineComponent<ExtractPropTypes<{
686
638
  type: PropType<"none" | "strict" | "leaf" | "leaf-filtered" | undefined>;
687
639
  default: string;
688
640
  };
689
- readonly: {
690
- type: BooleanConstructor;
691
- default: boolean;
692
- };
693
- disable: {
694
- type: BooleanConstructor;
695
- default: boolean;
696
- };
697
641
  }>> & Readonly<{
698
642
  "onUpdate:modelValue"?: ((...args: any[]) => any) | undefined;
699
643
  }>, {
700
- disable: boolean;
701
- readonly: boolean;
702
644
  multiple: boolean;
703
645
  options: any[];
704
646
  optionLabel: string;
@@ -1,3 +1,4 @@
1
+ import { Ref } from 'vue';
1
2
  /**
2
3
  * 表单验证规则
3
4
  * @param t - 可选的国际化翻译函数,如果不传则使用全局的 t 函数
@@ -20,6 +21,8 @@ interface DialogProviderOptions {
20
21
  i18n?: any;
21
22
  plugins?: any[];
22
23
  iconMapFn?: (iconName: string) => any;
24
+ pagePermissionIds?: Ref<string[]>;
25
+ pageActionPermissionIds?: Ref<string[]>;
23
26
  }
24
27
  export type DialogPosition = 'standard' | 'right' | 'top' | 'bottom' | 'left';
25
28
  export type DialogType = 'dialog' | 'text' | 'textarea' | 'select';
@@ -101,12 +104,11 @@ export interface JQDialogExposed {
101
104
  value: boolean;
102
105
  }) => void;
103
106
  }
104
- export declare const DialogProvider: {
105
- /**
106
- * 配置 DialogProvider 选项
107
- */
107
+ export interface DialogProviderType {
108
108
  configure(options: DialogProviderOptions): void;
109
109
  register(props: JQDialogRegisterProps): Promise<any>;
110
110
  destroy(dialogId: string): void;
111
- };
111
+ destroyAll(): void;
112
+ }
113
+ export declare const DialogProvider: DialogProviderType;
112
114
  export {};
@@ -1,27 +1,26 @@
1
- import { QInput, QPagination, QSelect, ComponentConstructor } from 'quasar';
2
- import { DefineComponent, ExtractPropTypes, ComputedRef, ComponentOptionsMixin, PublicProps, ComponentProvideOptions } from 'vue';
3
- import { t } from '../../composables/useI18n.ts';
4
- export interface PaginationInfo {
1
+ export type PaginationParameter = Pick<Paginator, 'page' | 'rowsPerPage'>;
2
+ export interface Paginator {
5
3
  page: number;
6
4
  rowsPerPage: number;
7
5
  rowsNumber: number;
8
6
  }
9
- declare const _default: DefineComponent<ExtractPropTypes<{
10
- paginationInfo: {
11
- type: () => PaginationInfo;
12
- default: () => {
13
- page: number;
14
- rowsPerPage: number;
15
- rowsNumber: number;
16
- };
17
- };
18
- }>, {
19
- t: t;
20
- internalInfo: {
21
- totalPage: number;
22
- currentPage: string | number;
23
- page: number;
24
- rowsPerPage: number;
7
+ export type UsePaginationOptions = {
8
+ page?: number;
9
+ rowsPerPage?: number;
10
+ rowsNumber?: number;
11
+ };
12
+ export type UsePaginationReturn = {
13
+ paginationInfo: Paginator;
14
+ getNum: () => number;
15
+ getPaginationParam: () => PaginationParameter;
16
+ setNum: (value?: number) => void;
17
+ setSize: (value?: number) => void;
18
+ setTotal: (value?: number) => void;
19
+ };
20
+ export declare const DEFAULT_ROWS_PER_PAGE = 15;
21
+ export declare const ROWS_PER_PAGE_OPTIONS: number[];
22
+ export declare function usePagination(options?: UsePaginationOptions): UsePaginationReturn;
23
+ rowsPerPage: number;
25
24
  rowsNumber: number;
26
25
  };
27
26
  rowNumbersArr: number[];
package/dist/index.d.ts CHANGED
@@ -37,6 +37,7 @@ import { default as JQButton } from './components/j-q-button/index';
37
37
  import { default as JQPagination } from './components/j-q-pagination/index';
38
38
  import { JQToolType } from './types';
39
39
  export { JChBar, JChBarLine, JChBubble, JChLine, JChPieDoughnut, JChRadar } from './charts';
40
+ import * as treeUtils from './components/j-c-tree';
40
41
  import * as formUtils from './components/j-q-dialog/form';
41
42
  export { DialogProvider } from './components/j-q-dialog/index';
42
43
  export type { JQDialogRegisterProps, TextInputConfig, TextareaInputConfig, SelectInputConfig, DialogType, DialogPosition } from './components/j-q-dialog/index';
@@ -46,6 +47,7 @@ export { rtcptIconMapFn, composeIconMapFn } from './utils/icon-map';
46
47
  export type { IconMapFn } from './utils/icon-map';
47
48
  export { PAGE_PERMISSION_KEY, PAGE_ACTION_PERMISSION_KEY } from './components/j-c-permission/index';
48
49
  export { formUtils };
50
+ export { treeUtils };
49
51
  export type { JQToolType };
50
52
  export declare const jqTool: JQToolType;
51
53
  export { useI18n, setLocale, getLocale } from './composables/useI18n';