r3ui-lib 1.3.11 → 1.3.13
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/CHANGELOG.md +129 -0
- package/dist/r3ui-lib.css +1 -1
- package/dist/r3ui-lib.es.js +14166 -11829
- package/dist/r3ui-lib.umd.js +31 -31
- package/dist/types/components/tables/EditTableColumns.vue.d.ts +2 -2
- package/dist/types/components/tables/ManagedRemoteTable.vue.d.ts +23 -0
- package/dist/types/components/tables/ManagedRemoteTable.vue.d.ts.map +1 -0
- package/dist/types/components/tables/Table.vue.d.ts +21 -3
- package/dist/types/components/tables/Table.vue.d.ts.map +1 -1
- package/dist/types/composables/table/createTableCommandScheduler.d.ts +29 -0
- package/dist/types/composables/table/createTableCommandScheduler.d.ts.map +1 -0
- package/dist/types/composables/table/createTableLifecycle.d.ts +126 -0
- package/dist/types/composables/table/createTableLifecycle.d.ts.map +1 -0
- package/dist/types/composables/table/createTableRebuildTransaction.d.ts +33 -0
- package/dist/types/composables/table/createTableRebuildTransaction.d.ts.map +1 -0
- package/dist/types/composables/table/createTableSession.d.ts +18 -0
- package/dist/types/composables/table/createTableSession.d.ts.map +1 -0
- package/dist/types/composables/table/createTableState.d.ts +544 -0
- package/dist/types/composables/table/createTableState.d.ts.map +1 -0
- package/dist/types/composables/table/createTabulatorAdapter.d.ts +42 -0
- package/dist/types/composables/table/createTabulatorAdapter.d.ts.map +1 -0
- package/dist/types/composables/table/tableQueryTransitions.d.ts +59 -0
- package/dist/types/composables/table/tableQueryTransitions.d.ts.map +1 -0
- package/dist/types/composables/table/useManagedRemoteTable.d.ts +140 -0
- package/dist/types/composables/table/useManagedRemoteTable.d.ts.map +1 -0
- package/dist/types/composables/table/useRemoteTable.d.ts +9 -3
- package/dist/types/composables/table/useRemoteTable.d.ts.map +1 -1
- package/dist/types/composables/table/useTableColumnApply.d.ts.map +1 -1
- package/dist/types/composables/table/useTableDefault.d.ts +6 -1
- package/dist/types/composables/table/useTableDefault.d.ts.map +1 -1
- package/dist/types/main.d.ts +12 -1
- package/dist/types/main.d.ts.map +1 -1
- package/dist/types/types/managedRemoteTable.d.ts +29 -0
- package/dist/types/types/managedRemoteTable.d.ts.map +1 -0
- package/dist/types/types/table.d.ts +10 -8
- package/dist/types/types/table.d.ts.map +1 -1
- package/dist/types/types/tableInstance.d.ts +2 -1
- package/dist/types/types/tableInstance.d.ts.map +1 -1
- package/dist/types/utils/auth/sessionController.d.ts +20 -0
- package/dist/types/utils/auth/sessionController.d.ts.map +1 -0
- package/dist/types/utils/tableAdapter.d.ts +8 -0
- package/dist/types/utils/tableAdapter.d.ts.map +1 -1
- package/dist/types/utils/tableCancellation.d.ts.map +1 -1
- package/dist/types/utils/tableData.d.ts +64 -0
- package/dist/types/utils/tableData.d.ts.map +1 -0
- package/dist/types/utils/tableLoad.d.ts +15 -2
- package/dist/types/utils/tableLoad.d.ts.map +1 -1
- package/dist/types/utils/tableOperation.d.ts +43 -0
- package/dist/types/utils/tableOperation.d.ts.map +1 -0
- package/dist/types/utils/tableProjection.d.ts +35 -0
- package/dist/types/utils/tableProjection.d.ts.map +1 -0
- package/dist/types/utils/tableQueryParameters.d.ts +11 -0
- package/dist/types/utils/tableQueryParameters.d.ts.map +1 -0
- package/dist/types/utils/tableSnapshotValue.d.ts +5 -0
- package/dist/types/utils/tableSnapshotValue.d.ts.map +1 -0
- package/dist/types/utils/tabulatorQueryAdapter.d.ts +4 -0
- package/dist/types/utils/tabulatorQueryAdapter.d.ts.map +1 -0
- package/dist/types/utils/tabulatorRuntime.d.ts +143 -0
- package/dist/types/utils/tabulatorRuntime.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -16,14 +16,14 @@ interface Props {
|
|
|
16
16
|
declare const _default: import("vue").DefineComponent<Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
17
17
|
emitModalVisibility: (value: boolean) => any;
|
|
18
18
|
selectAll: () => any;
|
|
19
|
-
columnVisibilityChange: (event: Event, field: string) => any;
|
|
20
19
|
apply: (columns: Column[]) => any;
|
|
20
|
+
columnVisibilityChange: (event: Event, field: string) => any;
|
|
21
21
|
unselectAll: () => any;
|
|
22
22
|
}, string, import("vue").PublicProps, Readonly<Props> & Readonly<{
|
|
23
23
|
onEmitModalVisibility?: ((value: boolean) => any) | undefined;
|
|
24
24
|
onSelectAll?: (() => any) | undefined;
|
|
25
|
-
onColumnVisibilityChange?: ((event: Event, field: string) => any) | undefined;
|
|
26
25
|
onApply?: ((columns: Column[]) => any) | undefined;
|
|
26
|
+
onColumnVisibilityChange?: ((event: Event, field: string) => any) | undefined;
|
|
27
27
|
onUnselectAll?: (() => any) | undefined;
|
|
28
28
|
}>, {
|
|
29
29
|
title: string;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import type { ManagedRemoteTableView } from "../../types/managedRemoteTable";
|
|
2
|
+
type __VLS_Props = {
|
|
3
|
+
view: ManagedRemoteTableView;
|
|
4
|
+
};
|
|
5
|
+
declare var __VLS_13: string | number, __VLS_14: any;
|
|
6
|
+
type __VLS_Slots = {} & {
|
|
7
|
+
[K in NonNullable<typeof __VLS_13>]?: (props: typeof __VLS_14) => any;
|
|
8
|
+
};
|
|
9
|
+
declare const __VLS_component: import("vue").DefineComponent<__VLS_Props, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
10
|
+
retryError: (error: unknown) => any;
|
|
11
|
+
readyError: (error: unknown) => any;
|
|
12
|
+
}, string, import("vue").PublicProps, Readonly<__VLS_Props> & Readonly<{
|
|
13
|
+
onRetryError?: ((error: unknown) => any) | undefined;
|
|
14
|
+
onReadyError?: ((error: unknown) => any) | undefined;
|
|
15
|
+
}>, {}, {}, {}, {}, string, import("vue").ComponentProvideOptions, false, {}, any>;
|
|
16
|
+
declare const _default: __VLS_WithSlots<typeof __VLS_component, __VLS_Slots>;
|
|
17
|
+
export default _default;
|
|
18
|
+
type __VLS_WithSlots<T, S> = T & {
|
|
19
|
+
new (): {
|
|
20
|
+
$slots: S;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
//# sourceMappingURL=ManagedRemoteTable.vue.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ManagedRemoteTable.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/tables/ManagedRemoteTable.vue"],"names":[],"mappings":"AAiEA,OAAO,KAAK,EAAE,sBAAsB,EAAE,MAAM,gCAAgC,CAAC;AAG7E,KAAK,WAAW,GAAG;IAAE,IAAI,EAAE,sBAAsB,CAAA;CAAE,CAAC;AA0IpD,QAAA,IAAI,QAAQ,iBAAW,EAAE,QAAQ,KAAY,CAAE;AAC/C,KAAK,WAAW,GAAG,EAAE,GACnB;KAAG,CAAC,IAAI,WAAW,CAAC,OAAO,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,QAAQ,KAAK,GAAG;CAAE,CAAC;AAoB5E,QAAA,MAAM,eAAe;;;;;;kFAGnB,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -8,6 +8,14 @@ type __VLS_Slots = {} & {
|
|
|
8
8
|
'table-footer-left'?: (props: typeof __VLS_1) => any;
|
|
9
9
|
};
|
|
10
10
|
declare const __VLS_component: import("vue").DefineComponent<import("vue").ExtractPropTypes<{
|
|
11
|
+
managedLoading: {
|
|
12
|
+
type: BooleanConstructor;
|
|
13
|
+
default: undefined;
|
|
14
|
+
};
|
|
15
|
+
managedFailed: {
|
|
16
|
+
type: BooleanConstructor;
|
|
17
|
+
default: boolean;
|
|
18
|
+
};
|
|
11
19
|
langs: {
|
|
12
20
|
type: PropType<Options["langs"]>;
|
|
13
21
|
default: () => {};
|
|
@@ -74,6 +82,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
74
82
|
default: string;
|
|
75
83
|
};
|
|
76
84
|
}>, {}, {}, {}, {}, import("vue").ComponentOptionsMixin, import("vue").ComponentOptionsMixin, {
|
|
85
|
+
pageLoaded: (...args: any[]) => void;
|
|
77
86
|
selectedRow: (...args: any[]) => void;
|
|
78
87
|
unselectedRow: (...args: any[]) => void;
|
|
79
88
|
updateSelectedRows: (...args: any[]) => void;
|
|
@@ -84,11 +93,18 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
84
93
|
onTableRowClick: (...args: any[]) => void;
|
|
85
94
|
onCellClick: (...args: any[]) => void;
|
|
86
95
|
onTableRowMoved: (...args: any[]) => void;
|
|
87
|
-
pageLoaded: (...args: any[]) => void;
|
|
88
96
|
savePaginationPage: (...args: any[]) => void;
|
|
89
97
|
updateIsVisibleColumnSubFilter: (...args: any[]) => void;
|
|
90
98
|
loadError: (...args: any[]) => void;
|
|
91
99
|
}, string, import("vue").PublicProps, Readonly<import("vue").ExtractPropTypes<{
|
|
100
|
+
managedLoading: {
|
|
101
|
+
type: BooleanConstructor;
|
|
102
|
+
default: undefined;
|
|
103
|
+
};
|
|
104
|
+
managedFailed: {
|
|
105
|
+
type: BooleanConstructor;
|
|
106
|
+
default: boolean;
|
|
107
|
+
};
|
|
92
108
|
langs: {
|
|
93
109
|
type: PropType<Options["langs"]>;
|
|
94
110
|
default: () => {};
|
|
@@ -155,6 +171,7 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
155
171
|
default: string;
|
|
156
172
|
};
|
|
157
173
|
}>> & Readonly<{
|
|
174
|
+
onPageLoaded?: ((...args: any[]) => any) | undefined;
|
|
158
175
|
onSelectedRow?: ((...args: any[]) => any) | undefined;
|
|
159
176
|
onUnselectedRow?: ((...args: any[]) => any) | undefined;
|
|
160
177
|
onUpdateSelectedRows?: ((...args: any[]) => any) | undefined;
|
|
@@ -165,7 +182,6 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
165
182
|
onOnTableRowClick?: ((...args: any[]) => any) | undefined;
|
|
166
183
|
onOnCellClick?: ((...args: any[]) => any) | undefined;
|
|
167
184
|
onOnTableRowMoved?: ((...args: any[]) => any) | undefined;
|
|
168
|
-
onPageLoaded?: ((...args: any[]) => any) | undefined;
|
|
169
185
|
onSavePaginationPage?: ((...args: any[]) => any) | undefined;
|
|
170
186
|
onUpdateIsVisibleColumnSubFilter?: ((...args: any[]) => any) | undefined;
|
|
171
187
|
onLoadError?: ((...args: any[]) => any) | undefined;
|
|
@@ -174,10 +190,12 @@ declare const __VLS_component: import("vue").DefineComponent<import("vue").Extra
|
|
|
174
190
|
rtl: boolean;
|
|
175
191
|
filters: import("tabulator-tables").Filter[] | undefined;
|
|
176
192
|
langs: any;
|
|
193
|
+
options: Options;
|
|
194
|
+
managedLoading: boolean;
|
|
195
|
+
managedFailed: boolean;
|
|
177
196
|
paginationPage: number;
|
|
178
197
|
columnHide: string;
|
|
179
198
|
columnShow: string;
|
|
180
|
-
options: Options;
|
|
181
199
|
tableData: TableRowData[];
|
|
182
200
|
showAllColumnsIfAllHidden: boolean;
|
|
183
201
|
parentComponent: Record<string, any>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Table.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/tables/Table.vue"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Table.vue.d.ts","sourceRoot":"","sources":["../../../../src/components/tables/Table.vue"],"names":[],"mappings":"AAugCA,OAAO,EAIL,KAAK,OAAO,EAEb,MAAM,kBAAkB,CAAC;AAC1B,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,KAAK,CAAC;AAGpC,UAAU,YAAY;IACpB,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;CACpB;AAynCD,QAAA,IAAI,OAAO,IAAW,CAAE;AACxB,KAAK,WAAW,GAAG,EAAE,GACnB;IAAE,mBAAmB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,OAAO,KAAK,GAAG,CAAA;CAAE,CAAC;AA+D3D,QAAA,MAAM,eAAe;;;;;;;;;;cAKM,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;cAOjC,QAAQ,CAAC,OAAO,CAAC;;;;;cAKE,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;;;;cAG3C,QAAQ,CAAC,YAAY,EAAE,CAAC;;;;;;;;;;;;cAGd,QAAQ,CAAC,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;cAlB5B,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;;;;;;;;;;;;;;;;;;;;;;;;cAOjC,QAAQ,CAAC,OAAO,CAAC;;;;;cAKE,QAAQ,CAAC,OAAO,CAAC,eAAe,CAAC,CAAC;;;;cAG3C,QAAQ,CAAC,YAAY,EAAE,CAAC;;;;;;;;;;;;cAGd,QAAQ,CAAC,GAAG,EAAE,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4EASrD,CAAC;wBACkB,eAAe,CAAC,OAAO,eAAe,EAAE,WAAW,CAAC;AAAzE,wBAA0E;AAE1E,KAAK,eAAe,CAAC,CAAC,EAAE,CAAC,IAAI,CAAC,GAAG;IAChC,QAAO;QACN,MAAM,EAAE,CAAC,CAAC;KAEV,CAAA;CACD,CAAC"}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { type TableOperation, type TableOperationGuard, type TableOperationKind, type TableOperationResult } from "../../utils/tableOperation";
|
|
2
|
+
type CommandPhase = "queued" | "running" | "settled";
|
|
3
|
+
export interface TableCommand<Context> {
|
|
4
|
+
readonly operation: TableOperation<Context>;
|
|
5
|
+
readonly result: Promise<TableOperationResult>;
|
|
6
|
+
readonly phase: CommandPhase;
|
|
7
|
+
start(): boolean;
|
|
8
|
+
finish(result: TableOperationResult): void;
|
|
9
|
+
fail(error: unknown): void;
|
|
10
|
+
}
|
|
11
|
+
/** Одна текущая команда; результат и подписки завершаются ровно один раз независимо от исполнителя. */
|
|
12
|
+
export declare function createTableCommandScheduler<Context>(): {
|
|
13
|
+
schedule: (options: {
|
|
14
|
+
kind: TableOperationKind;
|
|
15
|
+
generation: number;
|
|
16
|
+
revision: number;
|
|
17
|
+
context?: Context;
|
|
18
|
+
external?: TableOperationGuard;
|
|
19
|
+
signal?: AbortSignal;
|
|
20
|
+
signals?: readonly AbortSignal[];
|
|
21
|
+
isCurrent(): boolean;
|
|
22
|
+
}) => TableCommand<Context>;
|
|
23
|
+
invalidate: (reason?: "cancelled" | "superseded") => void;
|
|
24
|
+
pause(): void;
|
|
25
|
+
resume(): void;
|
|
26
|
+
dispose(): void;
|
|
27
|
+
};
|
|
28
|
+
export {};
|
|
29
|
+
//# sourceMappingURL=createTableCommandScheduler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTableCommandScheduler.d.ts","sourceRoot":"","sources":["../../../../src/composables/table/createTableCommandScheduler.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,cAAc,EACnB,KAAK,mBAAmB,EACxB,KAAK,kBAAkB,EACvB,KAAK,oBAAoB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,KAAK,YAAY,GAAG,QAAQ,GAAG,SAAS,GAAG,SAAS,CAAC;AACrD,MAAM,WAAW,YAAY,CAAC,OAAO;IACnC,QAAQ,CAAC,SAAS,EAAE,cAAc,CAAC,OAAO,CAAC,CAAC;IAC5C,QAAQ,CAAC,MAAM,EAAE,OAAO,CAAC,oBAAoB,CAAC,CAAC;IAC/C,QAAQ,CAAC,KAAK,EAAE,YAAY,CAAC;IAC7B,KAAK,IAAI,OAAO,CAAC;IACjB,MAAM,CAAC,MAAM,EAAE,oBAAoB,GAAG,IAAI,CAAC;IAC3C,IAAI,CAAC,KAAK,EAAE,OAAO,GAAG,IAAI,CAAC;CAC5B;AAED,uGAAuG;AACvG,wBAAgB,2BAA2B,CAAC,OAAO;wBAQtB;QACzB,IAAI,EAAE,kBAAkB,CAAC;QACzB,UAAU,EAAE,MAAM,CAAC;QACnB,QAAQ,EAAE,MAAM,CAAC;QACjB,OAAO,CAAC,EAAE,OAAO,CAAC;QAClB,QAAQ,CAAC,EAAE,mBAAmB,CAAC;QAC/B,MAAM,CAAC,EAAE,WAAW,CAAC;QACrB,OAAO,CAAC,EAAE,SAAS,WAAW,EAAE,CAAC;QACjC,SAAS,IAAI,OAAO,CAAC;KACtB,KAAG,YAAY,CAAC,OAAO,CAAC;0BAZG,WAAW,GAAG,YAAY;;;;EA4FvD"}
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import { type TableDataQuery, type TablePreparedData, type TableAppliedData } from "../../utils/tableData";
|
|
2
|
+
import type { TableLoadBoundary } from "../../utils/tableLoad";
|
|
3
|
+
import { type TableFailure } from "./createTableState";
|
|
4
|
+
import { type Ref } from "vue";
|
|
5
|
+
import { type R3uiTableInstance } from "../../types/tableInstance";
|
|
6
|
+
import type { TableColumnDefinition, TableColumnOptions, TableFilterApplyOperation, TableColumnApplyOperation } from "../../types/table";
|
|
7
|
+
import { type TableSnapshot } from "../../utils/tableAdapter";
|
|
8
|
+
import type { createTableAjaxRequestFunc } from "../../utils/tableAjaxRequest";
|
|
9
|
+
import { type TableOperation, type TableOperationResult } from "../../utils/tableOperation";
|
|
10
|
+
type TableRequest = (...args: [
|
|
11
|
+
...Parameters<ReturnType<typeof createTableAjaxRequestFunc>>,
|
|
12
|
+
operation?: TableOperation
|
|
13
|
+
]) => Promise<unknown>;
|
|
14
|
+
export type TableLifecycleSnapshot<Context = undefined> = Omit<TableSnapshot, "selected"> & {
|
|
15
|
+
selected?: TableSnapshot["selected"];
|
|
16
|
+
url?: string;
|
|
17
|
+
context?: Context;
|
|
18
|
+
query?: TableDataQuery;
|
|
19
|
+
};
|
|
20
|
+
export interface TableLifecycleRemote {
|
|
21
|
+
table: Ref<R3uiTableInstance | null>;
|
|
22
|
+
tableKey: Ref<number>;
|
|
23
|
+
isInitDone: Ref<boolean>;
|
|
24
|
+
tableOptions: Ref<TableColumnOptions>;
|
|
25
|
+
tableDefault: {
|
|
26
|
+
fetchData(operation?: {
|
|
27
|
+
isCurrent(): boolean;
|
|
28
|
+
}): Promise<void>;
|
|
29
|
+
applyFilters(instance?: unknown, operation?: TableFilterApplyOperation): Promise<void>;
|
|
30
|
+
applyFiltersOperation?(instance?: unknown, operation?: TableFilterApplyOperation): Promise<TableOperationResult>;
|
|
31
|
+
captureFilterDialogClose?(): () => void;
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
export interface TableLifecycleOptions<Context> {
|
|
35
|
+
remote: TableLifecycleRemote;
|
|
36
|
+
getColumns(): TableColumnDefinition[];
|
|
37
|
+
getAjaxUrl(): string;
|
|
38
|
+
createRequest(version: number): TableRequest;
|
|
39
|
+
presentError(error: unknown): void;
|
|
40
|
+
resetErrors?(): void;
|
|
41
|
+
refreshLabels?(isCurrent: () => boolean): Promise<void>;
|
|
42
|
+
captureContext?(): Context;
|
|
43
|
+
initialContext?: Context;
|
|
44
|
+
onContextApplied?(context: Context): void;
|
|
45
|
+
onDataApplied?(data: TableAppliedData<Context>): void;
|
|
46
|
+
/** Первоначальная загрузка через очередь фильтров либо непосредственно после подготовки. */
|
|
47
|
+
initialLoad?: "apply" | "replace";
|
|
48
|
+
applyOnReady?: boolean;
|
|
49
|
+
includeSelection?: boolean;
|
|
50
|
+
columns?: {
|
|
51
|
+
commit(columns: TableColumnDefinition[]): void;
|
|
52
|
+
changed(): void;
|
|
53
|
+
titledOnly?: boolean;
|
|
54
|
+
};
|
|
55
|
+
initializationFailure?(): {
|
|
56
|
+
error: unknown;
|
|
57
|
+
} | undefined;
|
|
58
|
+
}
|
|
59
|
+
/** Восстановление уступает новому пользовательскому запросу; один запрос каждой фазы принадлежит владельцу. */
|
|
60
|
+
export declare function createTableRestoreOperation(isSameContext: () => boolean, getRequestSequence: () => number, { deferUntilRequest, owner, }?: {
|
|
61
|
+
deferUntilRequest?: boolean;
|
|
62
|
+
owner?: TableOperation;
|
|
63
|
+
}): {
|
|
64
|
+
signal: AbortSignal | undefined;
|
|
65
|
+
owner: TableOperation<unknown> | undefined;
|
|
66
|
+
isSupersededByRequest: () => boolean;
|
|
67
|
+
isCurrent: () => boolean;
|
|
68
|
+
beforeRequest(): void;
|
|
69
|
+
};
|
|
70
|
+
/** Отмена освобождает ожидание; поздний reject исходного Promise остаётся обработанным. */
|
|
71
|
+
export declare function waitForTablePreparation(loading: Promise<void> | undefined, signal: AbortSignal): Promise<"ready" | "superseded">;
|
|
72
|
+
/** Общий владелец контекста, запросов, очереди применений и снимка. Привязка к Vue lifecycle остаётся у адаптера. */
|
|
73
|
+
export declare function createTableLifecycle<Context = undefined>(options: TableLifecycleOptions<Context>): {
|
|
74
|
+
status: import("vue").ComputedRef<"ready" | "loading" | "columns" | "failed" | "building" | "disposed" | "idle" | "preparing" | "awaiting-instance" | "restoring">;
|
|
75
|
+
error: import("vue").ComputedRef<TableFailure | undefined>;
|
|
76
|
+
canRetry: import("vue").ComputedRef<boolean>;
|
|
77
|
+
retry: () => Promise<TableOperationResult>;
|
|
78
|
+
canApplyColumns: import("vue").ComputedRef<boolean>;
|
|
79
|
+
columnsApplying: Readonly<Ref<boolean, boolean>>;
|
|
80
|
+
applyColumns: (draft: readonly {
|
|
81
|
+
field: string;
|
|
82
|
+
visible: boolean;
|
|
83
|
+
}[], external?: TableColumnApplyOperation, saved?: () => void) => Promise<TableOperationResult>;
|
|
84
|
+
active: Readonly<Ref<boolean, boolean>>;
|
|
85
|
+
disposed: Readonly<Ref<boolean, boolean>>;
|
|
86
|
+
phase: Readonly<Ref<"building" | "disposed" | "idle" | "restoring", "building" | "disposed" | "idle" | "restoring">>;
|
|
87
|
+
preparing: Readonly<Ref<boolean, boolean>>;
|
|
88
|
+
rebuilding: import("vue").ComputedRef<boolean>;
|
|
89
|
+
pending: import("vue").WritableComputedRef<TableLifecycleSnapshot<Context> | undefined, TableLifecycleSnapshot<Context> | undefined>;
|
|
90
|
+
superseded: symbol;
|
|
91
|
+
readonly generation: number;
|
|
92
|
+
readonly revision: number;
|
|
93
|
+
readonly requestSequence: number;
|
|
94
|
+
readonly acceptedUrl: string | undefined;
|
|
95
|
+
requestedData: import("vue").ComputedRef<import("../../utils/tableData").TableRequestedData<Context> | undefined>;
|
|
96
|
+
appliedData: import("vue").ComputedRef<TableAppliedData<Context> | undefined>;
|
|
97
|
+
beginRequest: (version: number, parent?: TableOperation<Context>, signal?: AbortSignal | null, boundary?: TableLoadBoundary, request?: {
|
|
98
|
+
url: string;
|
|
99
|
+
params: Record<string, unknown>;
|
|
100
|
+
}) => TableOperation<Context> | undefined;
|
|
101
|
+
requestFailed: (ticket: TableOperation<Context>, cause: unknown) => void;
|
|
102
|
+
requestStopped: (ticket: TableOperation<Context>) => void;
|
|
103
|
+
acceptResponse: (response: unknown, ticket: TableOperation<Context>) => unknown;
|
|
104
|
+
isResponseCurrent: (response: unknown) => boolean;
|
|
105
|
+
responseApplied: (response: unknown) => void;
|
|
106
|
+
responseTransformed: (response: unknown, cancelled?: boolean, prepared?: TablePreparedData) => void;
|
|
107
|
+
responseFailed(response: unknown, cause: unknown): void;
|
|
108
|
+
isTrackedResponse: (response: unknown) => boolean;
|
|
109
|
+
rebuild: () => Promise<void>;
|
|
110
|
+
localeChanged: () => Promise<void> | undefined;
|
|
111
|
+
quickFilterChanged: () => Promise<void> | undefined;
|
|
112
|
+
tableKeyChanged: () => void;
|
|
113
|
+
startReady: () => Promise<void>;
|
|
114
|
+
tableReady: (instance: unknown) => Promise<void>;
|
|
115
|
+
apply: (instance: unknown, acceptedUrl?: string) => Promise<void>;
|
|
116
|
+
executeFilters: (instance: unknown, external?: TableFilterApplyOperation) => Promise<TableOperationResult>;
|
|
117
|
+
deactivate: () => void;
|
|
118
|
+
activate: () => Promise<void>;
|
|
119
|
+
dispose: () => void;
|
|
120
|
+
trackRestore: (state: TableLifecycleSnapshot<Context>, isSameContext: () => boolean, operation: {
|
|
121
|
+
isSupersededByRequest: () => boolean;
|
|
122
|
+
}) => () => void;
|
|
123
|
+
invalidateRequests(): void;
|
|
124
|
+
};
|
|
125
|
+
export {};
|
|
126
|
+
//# sourceMappingURL=createTableLifecycle.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTableLifecycle.d.ts","sourceRoot":"","sources":["../../../../src/composables/table/createTableLifecycle.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,KAAK,cAAc,EACnB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,EACtB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,KAAK,EACV,iBAAiB,EAElB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAUzE,OAAO,EAA8C,KAAK,GAAG,EAAE,MAAM,KAAK,CAAC;AAC3E,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,KAAK,EACV,qBAAqB,EACrB,kBAAkB,EAClB,yBAAyB,EACzB,yBAAyB,EAC1B,MAAM,mBAAmB,CAAC;AAC3B,OAAO,EAKL,KAAK,aAAa,EACnB,MAAM,0BAA0B,CAAC;AAClC,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,8BAA8B,CAAC;AAC/E,OAAO,EAIL,KAAK,cAAc,EACnB,KAAK,oBAAoB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,KAAK,YAAY,GAAG,CAClB,GAAG,IAAI,EAAE;IACP,GAAG,UAAU,CAAC,UAAU,CAAC,OAAO,0BAA0B,CAAC,CAAC;IAC5D,SAAS,CAAC,EAAE,cAAc;CAC3B,KACE,OAAO,CAAC,OAAO,CAAC,C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0BArItC,SAAS;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,OAAO,EAAE,OAAO,CAAA;KAAE,EAAE,aAC1C,yBAAyB,UAC5B,MAAM,IAAI,KACjB,OAAO,CAAC,oBAAoB,CAAC;;;;;;;;;;;;;;4BAj3BrB,MAAM,WACN,cAAc,CAAC,OAAO,CAAC,WACvB,WAAW,GAAG,IAAI,aAChB,iBAAiB,YAClB;QAAE,GAAG,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;KAAE,KACzD,0BAAS,SAAS;4DAgMyB,OAAO;;+BAInB,OAAO;kCAMJ,OAAO;gCAyBT,OAAO;oCAb9B,OAAO,kCAEN,iBAAiB;6BAw4BH,OAAO,SAAS,OAAO;kCAOlB,OAAO;;;;;sBA/fV,OAAO,CAAC,IAAI,CAAC;2BA4MN,OAAO,KAAG,OAAO,CAAC,IAAI,CAAC;sBAjTlC,OAAO,gBAAgB,MAAM,KAAG,OAAO,CAAC,IAAI,CAAC;+BAa1D,OAAO,aACN,yBAAyB,KACnC,OAAO,CAAC,oBAAoB,CAAC;;;;;;;;EAumBjC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { TableSession } from "./createTableSession";
|
|
2
|
+
import { type TableOperationResult } from "../../utils/tableOperation";
|
|
3
|
+
/** Один владелец подготовки, снимка и передачи между сессиями; ожидающие операции используют тот же сигнал. */
|
|
4
|
+
export declare function createTableRebuildTransaction<State>(options: {
|
|
5
|
+
source: TableSession;
|
|
6
|
+
generation: number;
|
|
7
|
+
revision: number;
|
|
8
|
+
isCurrent(): boolean;
|
|
9
|
+
}): {
|
|
10
|
+
operation: {
|
|
11
|
+
signal: AbortSignal;
|
|
12
|
+
isCurrent: () => boolean;
|
|
13
|
+
};
|
|
14
|
+
generation: number;
|
|
15
|
+
revision: number;
|
|
16
|
+
source: TableSession;
|
|
17
|
+
readonly stage: "failed" | "settled" | "preparing" | "awaiting-instance" | "restoring";
|
|
18
|
+
readonly snapshot: State | undefined;
|
|
19
|
+
readonly result: TableOperationResult | undefined;
|
|
20
|
+
wait<T>(action: () => T | PromiseLike<T>): Promise<{
|
|
21
|
+
status: "cancelled" | "superseded";
|
|
22
|
+
} | {
|
|
23
|
+
status: "applied";
|
|
24
|
+
value: T;
|
|
25
|
+
}>;
|
|
26
|
+
transfer(state: State): boolean;
|
|
27
|
+
restore(target: TableSession): boolean;
|
|
28
|
+
release(): void;
|
|
29
|
+
finish: (value: TableOperationResult) => void;
|
|
30
|
+
fail(): void;
|
|
31
|
+
cancel: (reason?: "cancelled" | "superseded") => void;
|
|
32
|
+
};
|
|
33
|
+
//# sourceMappingURL=createTableRebuildTransaction.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTableRebuildTransaction.d.ts","sourceRoot":"","sources":["../../../../src/composables/table/createTableRebuildTransaction.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAGL,KAAK,oBAAoB,EAC1B,MAAM,4BAA4B,CAAC;AAEpC,+GAA+G;AAC/G,wBAAgB,6BAA6B,CAAC,KAAK,EAAE,OAAO,EAAE;IAC5D,MAAM,EAAE,YAAY,CAAC;IACrB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,IAAI,OAAO,CAAC;CACtB;;;;;;;;;;;SA2DQ,CAAC,UAAU,MAAM,CAAC,GAAG,WAAW,CAAC,CAAC,CAAC;;;;;;oBAGxB,KAAK;oBAOL,YAAY;;oBAlDP,oBAAoB;;sBAMnB,WAAW,GAAG,YAAY;EA0EnD"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { TableProjection } from "../../utils/tableProjection";
|
|
2
|
+
import { type R3uiTableInstance } from "../../types/tableInstance";
|
|
3
|
+
import { createTabulatorAdapter } from "./createTabulatorAdapter";
|
|
4
|
+
export interface TableSession {
|
|
5
|
+
readonly id: number;
|
|
6
|
+
readonly instance: R3uiTableInstance;
|
|
7
|
+
readonly signal: AbortSignal;
|
|
8
|
+
readonly engine: ReturnType<typeof createTabulatorAdapter>;
|
|
9
|
+
isCurrent(): boolean;
|
|
10
|
+
}
|
|
11
|
+
/** Владение экземпляром независимо от поколения локализации и revision данных. */
|
|
12
|
+
export declare function createTableSessionOwner(isActive: () => boolean, projection?: TableProjection): {
|
|
13
|
+
readonly current: TableSession | undefined;
|
|
14
|
+
matches(instance: unknown): boolean;
|
|
15
|
+
attach(value: unknown): TableSession;
|
|
16
|
+
detach: (reason?: "cancelled" | "superseded") => void;
|
|
17
|
+
};
|
|
18
|
+
//# sourceMappingURL=createTableSession.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createTableSession.d.ts","sourceRoot":"","sources":["../../../../src/composables/table/createTableSession.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AAEnE,OAAO,EAEL,KAAK,iBAAiB,EACvB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,sBAAsB,EAAE,MAAM,0BAA0B,CAAC;AAClE,MAAM,WAAW,YAAY;IAC3B,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,QAAQ,EAAE,iBAAiB,CAAC;IACrC,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,QAAQ,CAAC,MAAM,EAAE,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;IAC3D,SAAS,IAAI,OAAO,CAAC;CACtB;AAED,kFAAkF;AAClF,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,OAAO,EACvB,UAAU,CAAC,EAAE,eAAe;;sBAeR,OAAO;kBAGX,OAAO,GAAG,YAAY;sBAbd,WAAW,GAAG,YAAY;EAmCnD"}
|