sprof 0.3.3 → 0.4.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/README.md +16 -13
- package/dist/auto-import.d.ts +70 -0
- package/dist/auto-import.js +20 -0
- package/dist/auto-import.test.d.ts +1 -0
- package/dist/core/components/atoms/PDialog/PDialog.stories.d.ts +72 -24
- package/dist/core/components/atoms/PDialog/PDialog.vue.d.ts +17 -7
- package/dist/core/components/atoms/PInput/PInput.stories.d.ts +30 -0
- package/dist/core/components/atoms/PInput/PInput.vue.d.ts +12 -0
- package/dist/core/components/atoms/PInputNumber/PInputNumber.stories.d.ts +1 -1
- package/dist/core/components/atoms/PInputNumber/PInputNumber.vue.d.ts +1 -1
- package/dist/core/components/atoms/PSelect/PSelect.stories.d.ts +54 -8
- package/dist/core/components/atoms/PSelect/PSelect.vue.d.ts +20 -3
- package/dist/core/components/organisms/PAuthForm/PAuthForm.stories.d.ts +22 -2
- package/dist/core/components/organisms/PAuthForm/PAuthForm.vue.d.ts +11 -1
- package/dist/core/composables/index.d.ts +16 -0
- package/dist/core/composables/useCrud.d.ts +47 -0
- package/dist/core/composables/useCrud.test.d.ts +1 -0
- package/dist/core/composables/useFilters.d.ts +33 -0
- package/dist/core/composables/useFilters.test.d.ts +1 -0
- package/dist/core/composables/usePagination.d.ts +45 -0
- package/dist/core/composables/usePagination.test.d.ts +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/modules/schedule/components/ScheduleGridEditor.vue.d.ts +16 -0
- package/dist/modules/table/cells/PTableNumber.vue.d.ts +3 -3
- package/dist/modules/table/cells/PTableString.vue.d.ts +1 -1
- package/dist/sprof.js +4894 -4757
- package/dist/sprof.umd.cjs +14 -14
- package/dist/style.css +1 -1
- package/package.json +9 -3
|
@@ -80,7 +80,14 @@ declare const _default: {
|
|
|
80
80
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
81
81
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
82
82
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
83
|
-
}>, {
|
|
83
|
+
}>, {
|
|
84
|
+
focus: () => void;
|
|
85
|
+
blur: () => void;
|
|
86
|
+
showPopup: () => void;
|
|
87
|
+
hidePopup: () => void;
|
|
88
|
+
validate: () => Promise<boolean>;
|
|
89
|
+
resetValidation: () => void;
|
|
90
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
84
91
|
clear: (...args: any[]) => void;
|
|
85
92
|
change: (...args: any[]) => void;
|
|
86
93
|
"update:modelValue": (value: any) => void;
|
|
@@ -99,7 +106,9 @@ declare const _default: {
|
|
|
99
106
|
rules: import('quasar').ValidationRule[];
|
|
100
107
|
clearable: boolean;
|
|
101
108
|
inPadding: string;
|
|
102
|
-
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
109
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
110
|
+
selectRef: import('quasar').QSelect | null;
|
|
111
|
+
}, any, import('vue').ComponentProvideOptions, {
|
|
103
112
|
P: {};
|
|
104
113
|
B: {};
|
|
105
114
|
D: {};
|
|
@@ -184,7 +193,14 @@ declare const _default: {
|
|
|
184
193
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
185
194
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
186
195
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
187
|
-
}>, {
|
|
196
|
+
}>, {
|
|
197
|
+
focus: () => void;
|
|
198
|
+
blur: () => void;
|
|
199
|
+
showPopup: () => void;
|
|
200
|
+
hidePopup: () => void;
|
|
201
|
+
validate: () => Promise<boolean>;
|
|
202
|
+
resetValidation: () => void;
|
|
203
|
+
}, {}, {}, {}, {
|
|
188
204
|
color: string;
|
|
189
205
|
label: string;
|
|
190
206
|
padding: string;
|
|
@@ -281,7 +297,14 @@ declare const _default: {
|
|
|
281
297
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
282
298
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
283
299
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
284
|
-
}>, {
|
|
300
|
+
}>, {
|
|
301
|
+
focus: () => void;
|
|
302
|
+
blur: () => void;
|
|
303
|
+
showPopup: () => void;
|
|
304
|
+
hidePopup: () => void;
|
|
305
|
+
validate: () => Promise<boolean>;
|
|
306
|
+
resetValidation: () => void;
|
|
307
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
285
308
|
clear: (...args: any[]) => void;
|
|
286
309
|
change: (...args: any[]) => void;
|
|
287
310
|
"update:modelValue": (value: any) => void;
|
|
@@ -441,7 +464,14 @@ export declare const Default: StoryFn<{
|
|
|
441
464
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
442
465
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
443
466
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
444
|
-
}>, {
|
|
467
|
+
}>, {
|
|
468
|
+
focus: () => void;
|
|
469
|
+
blur: () => void;
|
|
470
|
+
showPopup: () => void;
|
|
471
|
+
hidePopup: () => void;
|
|
472
|
+
validate: () => Promise<boolean>;
|
|
473
|
+
resetValidation: () => void;
|
|
474
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
445
475
|
clear: (...args: any[]) => void;
|
|
446
476
|
change: (...args: any[]) => void;
|
|
447
477
|
"update:modelValue": (value: any) => void;
|
|
@@ -460,7 +490,9 @@ export declare const Default: StoryFn<{
|
|
|
460
490
|
rules: import('quasar').ValidationRule[];
|
|
461
491
|
clearable: boolean;
|
|
462
492
|
inPadding: string;
|
|
463
|
-
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
493
|
+
}, true, {}, {}, import('vue').GlobalComponents, import('vue').GlobalDirectives, string, {
|
|
494
|
+
selectRef: import('quasar').QSelect | null;
|
|
495
|
+
}, any, import('vue').ComponentProvideOptions, {
|
|
464
496
|
P: {};
|
|
465
497
|
B: {};
|
|
466
498
|
D: {};
|
|
@@ -545,7 +577,14 @@ export declare const Default: StoryFn<{
|
|
|
545
577
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
546
578
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
547
579
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
548
|
-
}>, {
|
|
580
|
+
}>, {
|
|
581
|
+
focus: () => void;
|
|
582
|
+
blur: () => void;
|
|
583
|
+
showPopup: () => void;
|
|
584
|
+
hidePopup: () => void;
|
|
585
|
+
validate: () => Promise<boolean>;
|
|
586
|
+
resetValidation: () => void;
|
|
587
|
+
}, {}, {}, {}, {
|
|
549
588
|
color: string;
|
|
550
589
|
label: string;
|
|
551
590
|
padding: string;
|
|
@@ -642,7 +681,14 @@ export declare const Default: StoryFn<{
|
|
|
642
681
|
onClear?: ((...args: any[]) => any) | undefined;
|
|
643
682
|
onChange?: ((...args: any[]) => any) | undefined;
|
|
644
683
|
"onUpdate:modelValue"?: ((value: any) => any) | undefined;
|
|
645
|
-
}>, {
|
|
684
|
+
}>, {
|
|
685
|
+
focus: () => void;
|
|
686
|
+
blur: () => void;
|
|
687
|
+
showPopup: () => void;
|
|
688
|
+
hidePopup: () => void;
|
|
689
|
+
validate: () => Promise<boolean>;
|
|
690
|
+
resetValidation: () => void;
|
|
691
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
646
692
|
clear: (...args: any[]) => void;
|
|
647
693
|
change: (...args: any[]) => void;
|
|
648
694
|
"update:modelValue": (value: any) => void;
|
|
@@ -1,4 +1,12 @@
|
|
|
1
|
-
import { ValidationRule } from 'quasar';
|
|
1
|
+
import { ValidationRule, QSelect } from 'quasar';
|
|
2
|
+
declare function focus(): void;
|
|
3
|
+
declare function blur(): void;
|
|
4
|
+
declare function showPopup(): void;
|
|
5
|
+
declare function hidePopup(): void;
|
|
6
|
+
/** Прогнать правила поля (defineExpose-API, 0.4.0); true — валидно */
|
|
7
|
+
declare function validate(): Promise<boolean>;
|
|
8
|
+
/** Сбросить состояние валидации поля */
|
|
9
|
+
declare function resetValidation(): void;
|
|
2
10
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<globalThis.ExtractPropTypes<{
|
|
3
11
|
label: {
|
|
4
12
|
type: StringConstructor;
|
|
@@ -73,7 +81,14 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<gl
|
|
|
73
81
|
modelValue: {
|
|
74
82
|
type: globalThis.PropType<any>;
|
|
75
83
|
};
|
|
76
|
-
}>, {
|
|
84
|
+
}>, {
|
|
85
|
+
focus: typeof focus;
|
|
86
|
+
blur: typeof blur;
|
|
87
|
+
showPopup: typeof showPopup;
|
|
88
|
+
hidePopup: typeof hidePopup;
|
|
89
|
+
validate: typeof validate;
|
|
90
|
+
resetValidation: typeof resetValidation;
|
|
91
|
+
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
77
92
|
clear: (...args: any[]) => void;
|
|
78
93
|
change: (...args: any[]) => void;
|
|
79
94
|
"update:modelValue": (value: any) => void;
|
|
@@ -170,7 +185,9 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<gl
|
|
|
170
185
|
rules: ValidationRule[];
|
|
171
186
|
clearable: boolean;
|
|
172
187
|
inPadding: string;
|
|
173
|
-
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
188
|
+
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, true, {
|
|
189
|
+
selectRef: QSelect | null;
|
|
190
|
+
}, any>, {
|
|
174
191
|
prepend?(_: {}): any;
|
|
175
192
|
before?(_: {}): any;
|
|
176
193
|
left?(_: {}): any;
|
|
@@ -145,6 +145,11 @@ declare const _default: {
|
|
|
145
145
|
"onUpdate:modelValue"?: ((value: string | number | null | undefined) => any) | undefined;
|
|
146
146
|
}>, {
|
|
147
147
|
focus: () => void;
|
|
148
|
+
blur: () => void;
|
|
149
|
+
select: () => void;
|
|
150
|
+
getNativeElement: () => HTMLInputElement | undefined;
|
|
151
|
+
validate: () => Promise<boolean>;
|
|
152
|
+
resetValidation: () => void;
|
|
148
153
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
149
154
|
clear: (...args: any[]) => void;
|
|
150
155
|
input: (...args: any[]) => void;
|
|
@@ -246,8 +251,13 @@ declare const _default: {
|
|
|
246
251
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
247
252
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
248
253
|
"onUpdate:modelValue"?: ((value: string | number | null | undefined) => any) | undefined;
|
|
249
|
-
}>, "focus" | ("color" | "label" | "padding" | "mask" | "margin" | "width" | "disabled" | "borderColor" | "rules")> & {
|
|
254
|
+
}>, "validate" | "select" | "blur" | "focus" | "getNativeElement" | "resetValidation" | ("color" | "label" | "padding" | "mask" | "margin" | "width" | "disabled" | "borderColor" | "rules")> & {
|
|
250
255
|
focus: () => void;
|
|
256
|
+
blur: () => void;
|
|
257
|
+
select: () => void;
|
|
258
|
+
getNativeElement: () => HTMLInputElement | undefined;
|
|
259
|
+
validate: () => Promise<boolean>;
|
|
260
|
+
resetValidation: () => void;
|
|
251
261
|
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
252
262
|
$slots: {
|
|
253
263
|
prepend?(_: {}): any;
|
|
@@ -421,6 +431,11 @@ export declare const Default: () => {
|
|
|
421
431
|
"onUpdate:modelValue"?: ((value: string | number | null | undefined) => any) | undefined;
|
|
422
432
|
}>, {
|
|
423
433
|
focus: () => void;
|
|
434
|
+
blur: () => void;
|
|
435
|
+
select: () => void;
|
|
436
|
+
getNativeElement: () => HTMLInputElement | undefined;
|
|
437
|
+
validate: () => Promise<boolean>;
|
|
438
|
+
resetValidation: () => void;
|
|
424
439
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
425
440
|
clear: (...args: any[]) => void;
|
|
426
441
|
input: (...args: any[]) => void;
|
|
@@ -522,8 +537,13 @@ export declare const Default: () => {
|
|
|
522
537
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
523
538
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
524
539
|
"onUpdate:modelValue"?: ((value: string | number | null | undefined) => any) | undefined;
|
|
525
|
-
}>, "focus" | ("color" | "label" | "padding" | "mask" | "margin" | "width" | "disabled" | "borderColor" | "rules")> & {
|
|
540
|
+
}>, "validate" | "select" | "blur" | "focus" | "getNativeElement" | "resetValidation" | ("color" | "label" | "padding" | "mask" | "margin" | "width" | "disabled" | "borderColor" | "rules")> & {
|
|
526
541
|
focus: () => void;
|
|
542
|
+
blur: () => void;
|
|
543
|
+
select: () => void;
|
|
544
|
+
getNativeElement: () => HTMLInputElement | undefined;
|
|
545
|
+
validate: () => Promise<boolean>;
|
|
546
|
+
resetValidation: () => void;
|
|
527
547
|
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
528
548
|
$slots: {
|
|
529
549
|
prepend?(_: {}): any;
|
|
@@ -143,6 +143,11 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
143
143
|
"onUpdate:modelValue"?: ((value: string | number | null | undefined) => any) | undefined;
|
|
144
144
|
}>, {
|
|
145
145
|
focus: () => void;
|
|
146
|
+
blur: () => void;
|
|
147
|
+
select: () => void;
|
|
148
|
+
getNativeElement: () => HTMLInputElement | undefined;
|
|
149
|
+
validate: () => Promise<boolean>;
|
|
150
|
+
resetValidation: () => void;
|
|
146
151
|
}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {
|
|
147
152
|
clear: (...args: any[]) => void;
|
|
148
153
|
input: (...args: any[]) => void;
|
|
@@ -244,8 +249,13 @@ declare const _default: import('vue').DefineComponent<globalThis.ExtractPropType
|
|
|
244
249
|
onBlur?: ((...args: any[]) => any) | undefined;
|
|
245
250
|
onFocus?: ((...args: any[]) => any) | undefined;
|
|
246
251
|
"onUpdate:modelValue"?: ((value: string | number | null | undefined) => any) | undefined;
|
|
247
|
-
}>, "focus" | ("color" | "label" | "padding" | "mask" | "margin" | "width" | "disabled" | "borderColor" | "rules")> & {
|
|
252
|
+
}>, "validate" | "select" | "blur" | "focus" | "getNativeElement" | "resetValidation" | ("color" | "label" | "padding" | "mask" | "margin" | "width" | "disabled" | "borderColor" | "rules")> & {
|
|
248
253
|
focus: () => void;
|
|
254
|
+
blur: () => void;
|
|
255
|
+
select: () => void;
|
|
256
|
+
getNativeElement: () => HTMLInputElement | undefined;
|
|
257
|
+
validate: () => Promise<boolean>;
|
|
258
|
+
resetValidation: () => void;
|
|
249
259
|
} & {} & import('vue').ComponentCustomProperties & {} & {
|
|
250
260
|
$slots: {
|
|
251
261
|
prepend?(_: {}): any;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Композаблы (бэклог 0.4.0): BaseStore + FTSP в хуки для страниц-списков.
|
|
3
|
+
*
|
|
4
|
+
* - useCrud — CRUD-страница: store + loading/items/count/item/searchStr/load/remove/reset;
|
|
5
|
+
* - useFilters — фильтры FTSP: add/replace/remove/has/clear;
|
|
6
|
+
* - usePagination — пагинация FTSP: page (1-based)/rowsPerPage/next/prev/reset.
|
|
7
|
+
*
|
|
8
|
+
* По умолчанию работают с глобальным синглтоном FTSP.Get(); во всех трёх можно
|
|
9
|
+
* передать свой экземпляр FTSP (страница/компонент) — см. T1 в TECH_DEBT.md.
|
|
10
|
+
*/
|
|
11
|
+
export type { UseCrudOptions, UseCrudReturn } from './useCrud';
|
|
12
|
+
export { useCrud } from './useCrud';
|
|
13
|
+
export type { UseFiltersReturn } from './useFilters';
|
|
14
|
+
export { useFilters } from './useFilters';
|
|
15
|
+
export type { UsePaginationReturn } from './usePagination';
|
|
16
|
+
export { usePagination } from './usePagination';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { ComputedRef, Ref } from 'vue';
|
|
2
|
+
import { default as FTSP } from '../ftsp/FTSP';
|
|
3
|
+
import { default as BaseStore } from '../helpers/BaseStore';
|
|
4
|
+
import { default as IFileInfosGetter } from '../interfaces/IFileInfosGetter';
|
|
5
|
+
import { default as IWithId } from '../interfaces/IWithId';
|
|
6
|
+
export interface UseCrudOptions {
|
|
7
|
+
/** Свой экземпляр FTSP (по умолчанию — глобальный синглтон FTSP.Get()) */
|
|
8
|
+
ftsp?: FTSP;
|
|
9
|
+
}
|
|
10
|
+
export interface UseCrudReturn<T extends IWithId & IFileInfosGetter> {
|
|
11
|
+
/** Идёт ли загрузка списка (store.FTSP) */
|
|
12
|
+
loading: Ref<boolean>;
|
|
13
|
+
/** Живой список записей (store.Items) */
|
|
14
|
+
items: ComputedRef<T[]>;
|
|
15
|
+
/** Количество записей (store.Count) */
|
|
16
|
+
count: ComputedRef<number>;
|
|
17
|
+
/** Текущая выбранная запись (store.Item) */
|
|
18
|
+
item: ComputedRef<T>;
|
|
19
|
+
/** Строка поиска (store.searchStr) — v-model-совместимая */
|
|
20
|
+
searchStr: Ref<string>;
|
|
21
|
+
/** Экземпляр FTSP, с которым работает композабл */
|
|
22
|
+
ftsp: FTSP;
|
|
23
|
+
/** Загрузить список через store.FTSP (с FTSP-фильтрами/сортировкой/пагинацией) */
|
|
24
|
+
load(): Promise<void>;
|
|
25
|
+
/** Загрузить одну запись (store.Get: id или из route) */
|
|
26
|
+
get(id?: string): Promise<void>;
|
|
27
|
+
/** Создать запись (store.Create) */
|
|
28
|
+
create(item?: T): Promise<T | void>;
|
|
29
|
+
/** Обновить запись (store.Update) */
|
|
30
|
+
update(item?: T): Promise<T | void>;
|
|
31
|
+
/** Удалить запись (store.Remove — локально убирает из items) */
|
|
32
|
+
remove(id?: string): Promise<void>;
|
|
33
|
+
/** Сброс: FTSP + состояние стора (store.ResetState) */
|
|
34
|
+
reset(): void;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Композабл CRUD-страницы (бэклог 0.4.0): BaseStore + FTSP в одном хуке.
|
|
38
|
+
* Типичный список-страница: фильтры/сортировка/пагинация мутируют ftsp,
|
|
39
|
+
* load() перечитывает список с сервера.
|
|
40
|
+
*
|
|
41
|
+
* ```ts
|
|
42
|
+
* const store = new PF.H.BaseStore(C.Worker, 'workers');
|
|
43
|
+
* const { items, count, loading, load, remove, reset } = useCrud(store);
|
|
44
|
+
* onMounted(load);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export declare function useCrud<T extends IWithId & IFileInfosGetter>(store: BaseStore<T>, options?: UseCrudOptions): UseCrudReturn<T>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { default as FilterModelV2 } from '../ftsp/f/FilterModelV2';
|
|
3
|
+
import { default as FilterModel } from '../ftsp/FilterModel';
|
|
4
|
+
import { default as FTSP } from '../ftsp/FTSP';
|
|
5
|
+
export interface UseFiltersReturn {
|
|
6
|
+
/** Живой список фильтров (реактивный — ссылка на ftsp.f) */
|
|
7
|
+
filters: ComputedRef<FilterModel[]>;
|
|
8
|
+
/** Количество активных фильтров */
|
|
9
|
+
count: ComputedRef<number>;
|
|
10
|
+
/** Добавить фильтр (ftsp.setF) */
|
|
11
|
+
add(model: FilterModel): void;
|
|
12
|
+
/** Добавить фильтр v2 (ftsp.setF2) */
|
|
13
|
+
addV2(model: FilterModelV2): void;
|
|
14
|
+
/** Заменить фильтр: убрать prev, добавить cur (ftsp.replaceF) */
|
|
15
|
+
replace(current?: FilterModel, previous?: FilterModel): void;
|
|
16
|
+
/** Удалить фильтр по eq (ftsp.removeF) */
|
|
17
|
+
remove(model?: FilterModel): void;
|
|
18
|
+
/** Есть ли фильтр, эквивалентный model */
|
|
19
|
+
has(model: FilterModel): boolean;
|
|
20
|
+
/** Сбросить все фильтры (ftsp.resetF) */
|
|
21
|
+
clear(): void;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Композабл фильтрации (бэклог 0.4.0): удобная обёртка над фильтрами FTSP
|
|
25
|
+
* для страниц-списков. По умолчанию работает с глобальным синглтоном
|
|
26
|
+
* (FTSP.Get()), на страницу/компонент можно передать свой экземпляр:
|
|
27
|
+
*
|
|
28
|
+
* ```ts
|
|
29
|
+
* const { filters, add, replace, remove, clear, has } = useFilters();
|
|
30
|
+
* const { filters } = useFilters(myFtsp); // свой экземпляр (T1 из TECH_DEBT)
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
export declare function useFilters(ftsp?: FTSP): UseFiltersReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { ComputedRef } from 'vue';
|
|
2
|
+
import { default as FTSP } from '../ftsp/FTSP';
|
|
3
|
+
export interface UsePaginationReturn {
|
|
4
|
+
/** Текущая страница (1-based, для v-model пагинаторов/таблиц) */
|
|
5
|
+
page: ComputedRef<number>;
|
|
6
|
+
/** Строк на странице; смена сбрасывает на первую страницу */
|
|
7
|
+
rowsPerPage: ComputedRef<number>;
|
|
8
|
+
/** Общее количество записей (ftsp.p.rowsNumber) */
|
|
9
|
+
rowsNumber: ComputedRef<number>;
|
|
10
|
+
/** Перейти на страницу (1-based) */
|
|
11
|
+
goTo(pageNum: number): void;
|
|
12
|
+
/** Следующая страница */
|
|
13
|
+
next(): void;
|
|
14
|
+
/** Предыдущая страница (не меньше первой) */
|
|
15
|
+
prev(): void;
|
|
16
|
+
/** Сброс на первую страницу с сохранением rowsPerPage */
|
|
17
|
+
reset(): void;
|
|
18
|
+
/** Полный сброс пагинации к дефолтам (page 0, rowsPerPage 25, cursorMode off) */
|
|
19
|
+
drop(): void;
|
|
20
|
+
/** Курсорный режим: загрузить «ещё» после lastCursor (ftsp.p.setLoadMore) */
|
|
21
|
+
setLoadMore(lastCursor: string, column: string, table: string): void;
|
|
22
|
+
/** Курсорный режим v2 (модель вместо таблицы) */
|
|
23
|
+
setLoadMoreV2(lastCursor: string, column: string, model: string): void;
|
|
24
|
+
/** Пометить «всё загружено» по длине загруженных записей */
|
|
25
|
+
setAllLoaded(loadedItemsLength: number): void;
|
|
26
|
+
/** Пагинация из ftsp (для таблиц/пагинаторов, которым нужен объект) */
|
|
27
|
+
pagination: ComputedRef<{
|
|
28
|
+
page: number;
|
|
29
|
+
rowsPerPage: number;
|
|
30
|
+
rowsNumber: number;
|
|
31
|
+
}>;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Композабл пагинации (бэклог 0.4.0): удобная обёртка над FTSP.p.
|
|
35
|
+
*
|
|
36
|
+
* Важно: у FTSP.p.page — это СМЕЩЕНИЕ (offset), а page из композабла —
|
|
37
|
+
* 1-based номер страницы (как в UI). Смена rowsPerPage сбрасывает на 1-ю.
|
|
38
|
+
*
|
|
39
|
+
* ```ts
|
|
40
|
+
* const { page, rowsPerPage, next, prev, reset } = usePagination();
|
|
41
|
+
* // QTable-совместимый объект:
|
|
42
|
+
* const { pagination } = usePagination(ftsp);
|
|
43
|
+
* ```
|
|
44
|
+
*/
|
|
45
|
+
export declare function usePagination(ftsp?: FTSP): UsePaginationReturn;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
package/dist/index.d.ts
CHANGED
|
@@ -43,3 +43,7 @@ export type { default as Btn } from './core/ui/Btn';
|
|
|
43
43
|
export type { default as AnswerVariant } from './modules/forms/classes/AnswerVariant';
|
|
44
44
|
/** @internal Used by unplugin-auto-import configuration */
|
|
45
45
|
export declare const pfName: readonly ["PF", "PFM"];
|
|
46
|
+
export { useCrud, useFilters, usePagination } from './core/composables/index';
|
|
47
|
+
export type { UseCrudOptions, UseCrudReturn } from './core/composables/useCrud';
|
|
48
|
+
export type { UseFiltersReturn } from './core/composables/useFilters';
|
|
49
|
+
export type { UsePaginationReturn } from './core/composables/usePagination';
|
|
@@ -25,6 +25,20 @@ type __VLS_Props = {
|
|
|
25
25
|
* и селект «Секция» у слотов.
|
|
26
26
|
*/
|
|
27
27
|
sessionsEnabled?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Управление днями (по умолчанию — true): вкладки дней, поле даты,
|
|
30
|
+
* кнопки «добавить/удалить день». Для бесдатовых однодневных расписаний
|
|
31
|
+
* («распорядок дня» отделения) — false: редактор работает с days[0],
|
|
32
|
+
* день создаётся и удаляется страницей-владельцем.
|
|
33
|
+
*/
|
|
34
|
+
daysEnabled?: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* Управление местами/залами (по умолчанию — true): «добавить зал»,
|
|
37
|
+
* выбор/создание места, удаление расписания-места. Для одноколоночных
|
|
38
|
+
* расписаний — false: место привязывается адаптером проекта,
|
|
39
|
+
* кнопки управления местами скрыты.
|
|
40
|
+
*/
|
|
41
|
+
placesEnabled?: boolean;
|
|
28
42
|
};
|
|
29
43
|
declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__VLS_Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<__VLS_Props> & Readonly<{}>, {
|
|
30
44
|
labels: Partial<ScheduleLabels>;
|
|
@@ -37,6 +51,8 @@ declare const _default: __VLS_WithTemplateSlots<import('vue').DefineComponent<__
|
|
|
37
51
|
slotListOf: (schedule: any) => any[];
|
|
38
52
|
nestedSlotListOf: (session: any) => any[];
|
|
39
53
|
sessionsEnabled: boolean;
|
|
54
|
+
daysEnabled: boolean;
|
|
55
|
+
placesEnabled: boolean;
|
|
40
56
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
41
57
|
gridScrollRef: HTMLDivElement;
|
|
42
58
|
}, HTMLDivElement>, {
|
|
@@ -21,11 +21,11 @@ interface Props {
|
|
|
21
21
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
22
22
|
label: string;
|
|
23
23
|
readonly: boolean;
|
|
24
|
-
prop: string;
|
|
25
|
-
decimals: number;
|
|
26
|
-
min: number;
|
|
27
24
|
max: number;
|
|
25
|
+
min: number;
|
|
28
26
|
step: number;
|
|
27
|
+
prop: string;
|
|
28
|
+
decimals: number;
|
|
29
29
|
emptyPlaceholder: string;
|
|
30
30
|
tooltipThreshold: number;
|
|
31
31
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
@@ -11,8 +11,8 @@ interface Props {
|
|
|
11
11
|
declare const _default: import('vue').DefineComponent<Props, {}, {}, {}, {}, import('vue').ComponentOptionsMixin, import('vue').ComponentOptionsMixin, {}, string, import('vue').PublicProps, Readonly<Props> & Readonly<{}>, {
|
|
12
12
|
label: string;
|
|
13
13
|
readonly: boolean;
|
|
14
|
-
prop: string;
|
|
15
14
|
maxLength: number;
|
|
15
|
+
prop: string;
|
|
16
16
|
truncateLength: number;
|
|
17
17
|
}, {}, {}, {}, string, import('vue').ComponentProvideOptions, false, {
|
|
18
18
|
edit: ({
|