sprof 0.3.3 → 0.4.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 (27) hide show
  1. package/dist/auto-import.d.ts +70 -0
  2. package/dist/auto-import.js +20 -0
  3. package/dist/auto-import.test.d.ts +1 -0
  4. package/dist/core/components/atoms/PDialog/PDialog.stories.d.ts +72 -24
  5. package/dist/core/components/atoms/PDialog/PDialog.vue.d.ts +17 -7
  6. package/dist/core/components/atoms/PInput/PInput.stories.d.ts +30 -0
  7. package/dist/core/components/atoms/PInput/PInput.vue.d.ts +12 -0
  8. package/dist/core/components/atoms/PInputNumber/PInputNumber.stories.d.ts +1 -1
  9. package/dist/core/components/atoms/PInputNumber/PInputNumber.vue.d.ts +1 -1
  10. package/dist/core/components/atoms/PSelect/PSelect.stories.d.ts +54 -8
  11. package/dist/core/components/atoms/PSelect/PSelect.vue.d.ts +20 -3
  12. package/dist/core/components/organisms/PAuthForm/PAuthForm.stories.d.ts +22 -2
  13. package/dist/core/components/organisms/PAuthForm/PAuthForm.vue.d.ts +11 -1
  14. package/dist/core/composables/index.d.ts +16 -0
  15. package/dist/core/composables/useCrud.d.ts +47 -0
  16. package/dist/core/composables/useCrud.test.d.ts +1 -0
  17. package/dist/core/composables/useFilters.d.ts +33 -0
  18. package/dist/core/composables/useFilters.test.d.ts +1 -0
  19. package/dist/core/composables/usePagination.d.ts +45 -0
  20. package/dist/core/composables/usePagination.test.d.ts +1 -0
  21. package/dist/index.d.ts +4 -0
  22. package/dist/modules/table/cells/PTableNumber.vue.d.ts +3 -3
  23. package/dist/modules/table/cells/PTableString.vue.d.ts +1 -1
  24. package/dist/sprof.js +2996 -2868
  25. package/dist/sprof.umd.cjs +11 -11
  26. package/dist/style.css +1 -1
  27. package/package.json +8 -3
@@ -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';
@@ -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: ({