@odoo/owl 3.0.0-alpha.2 → 3.0.0-alpha.21
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 +100 -110
- package/dist/compile_templates.mjs +2434 -2532
- package/dist/compiler.js +2371 -0
- package/dist/owl-devtools.zip +0 -0
- package/dist/owl.cjs.js +6709 -6616
- package/dist/owl.cjs.runtime.js +4480 -0
- package/dist/owl.es.js +6697 -6600
- package/dist/owl.es.runtime.js +4436 -0
- package/dist/owl.iife.js +6710 -6617
- package/dist/owl.iife.min.js +1 -1
- package/dist/owl.iife.runtime.js +4484 -0
- package/dist/owl.iife.runtime.min.js +1 -0
- package/dist/types/common/owl_error.d.ts +3 -3
- package/dist/types/common/types.d.ts +1 -29
- package/dist/types/common/utils.d.ts +8 -8
- package/dist/types/compiler/code_generator.d.ts +133 -152
- package/dist/types/compiler/index.d.ts +13 -13
- package/dist/types/compiler/inline_expressions.d.ts +41 -59
- package/dist/types/compiler/parser.d.ts +170 -178
- package/dist/types/compiler/standalone/index.d.ts +2 -2
- package/dist/types/compiler/standalone/setup_jsdom.d.ts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/owl.d.ts +709 -665
- package/dist/types/runtime/app.d.ts +55 -62
- package/dist/types/runtime/blockdom/attributes.d.ts +8 -6
- package/dist/types/runtime/blockdom/block_compiler.d.ts +21 -21
- package/dist/types/runtime/blockdom/config.d.ts +8 -8
- package/dist/types/runtime/blockdom/event_catcher.d.ts +7 -7
- package/dist/types/runtime/blockdom/events.d.ts +8 -8
- package/dist/types/runtime/blockdom/html.d.ts +17 -17
- package/dist/types/runtime/blockdom/index.d.ts +25 -26
- package/dist/types/runtime/blockdom/list.d.ts +18 -18
- package/dist/types/runtime/blockdom/multi.d.ts +17 -17
- package/dist/types/runtime/blockdom/text.d.ts +26 -26
- package/dist/types/runtime/blockdom/toggler.d.ts +17 -17
- package/dist/types/runtime/component.d.ts +17 -28
- package/dist/types/runtime/component_node.d.ts +59 -83
- package/dist/types/runtime/context.d.ts +36 -0
- package/dist/types/runtime/error_handling.d.ts +13 -13
- package/dist/types/runtime/event_handling.d.ts +1 -1
- package/dist/types/runtime/fibers.d.ts +37 -37
- package/dist/types/runtime/hooks.d.ts +32 -57
- package/dist/types/runtime/index.d.ts +46 -35
- package/dist/types/runtime/lifecycle_hooks.d.ts +10 -12
- package/dist/types/runtime/plugin_hooks.d.ts +6 -0
- package/dist/types/runtime/plugin_manager.d.ts +36 -0
- package/dist/types/runtime/props.d.ts +21 -0
- package/dist/types/runtime/reactivity/computations.d.ts +34 -0
- package/dist/types/runtime/reactivity/computed.d.ts +6 -0
- package/dist/types/runtime/reactivity/effect.d.ts +1 -0
- package/dist/types/runtime/reactivity/proxy.d.ts +47 -0
- package/dist/types/runtime/reactivity/signal.d.ts +31 -0
- package/dist/types/runtime/reactivity.d.ts +57 -46
- package/dist/types/runtime/registry.d.ts +24 -15
- package/dist/types/runtime/rendering/error_handling.d.ts +13 -0
- package/dist/types/runtime/rendering/fibers.d.ts +37 -0
- package/dist/types/runtime/rendering/scheduler.d.ts +21 -0
- package/dist/types/runtime/rendering/template_helpers.d.ts +51 -0
- package/dist/types/runtime/resource.d.ts +18 -0
- package/dist/types/runtime/scheduler.d.ts +21 -21
- package/dist/types/runtime/status.d.ts +11 -10
- package/dist/types/runtime/template_set.d.ts +36 -40
- package/dist/types/runtime/types.d.ts +70 -0
- package/dist/types/runtime/utils.d.ts +24 -25
- package/dist/types/runtime/validation.d.ts +19 -36
- package/dist/types/version.d.ts +1 -1
- package/package.json +45 -19
- package/dist/types/runtime/cancellableContext.d.ts +0 -15
- package/dist/types/runtime/cancellablePromise.d.ts +0 -15
- package/dist/types/runtime/executionContext.d.ts +0 -0
- package/dist/types/runtime/listOperation.d.ts +0 -1
- package/dist/types/runtime/plugins.d.ts +0 -39
- package/dist/types/runtime/relationalModel/discussModel.d.ts +0 -19
- package/dist/types/runtime/relationalModel/discussModelTypes.d.ts +0 -22
- package/dist/types/runtime/relationalModel/field.d.ts +0 -20
- package/dist/types/runtime/relationalModel/model.d.ts +0 -59
- package/dist/types/runtime/relationalModel/modelData.d.ts +0 -18
- package/dist/types/runtime/relationalModel/modelRegistry.d.ts +0 -3
- package/dist/types/runtime/relationalModel/modelUtils.d.ts +0 -4
- package/dist/types/runtime/relationalModel/store.d.ts +0 -16
- package/dist/types/runtime/relationalModel/types.d.ts +0 -83
- package/dist/types/runtime/relationalModel/util.d.ts +0 -1
- package/dist/types/runtime/relationalModel/web/WebDataPoint.d.ts +0 -25
- package/dist/types/runtime/relationalModel/web/WebRecord.d.ts +0 -131
- package/dist/types/runtime/relationalModel/web/WebStaticList.d.ts +0 -63
- package/dist/types/runtime/relationalModel/web/webModel.d.ts +0 -5
- package/dist/types/runtime/relationalModel/web/webModelTypes.d.ts +0 -139
- package/dist/types/runtime/signals.d.ts +0 -17
- package/dist/types/runtime/task.d.ts +0 -12
- package/dist/types/utils/registry.d.ts +0 -15
|
@@ -1,63 +0,0 @@
|
|
|
1
|
-
import { Model } from "../model";
|
|
2
|
-
import { DraftContext, InstanceId, ManyFn } from "../types";
|
|
3
|
-
import { DataPoint } from "./WebDataPoint";
|
|
4
|
-
import { MakeWebRecord, WebRecord } from "./WebRecord";
|
|
5
|
-
export declare type StaticListConfig = {
|
|
6
|
-
parentRecord: any;
|
|
7
|
-
orecord: Model;
|
|
8
|
-
fieldName: string;
|
|
9
|
-
makeWebRecord: MakeWebRecord;
|
|
10
|
-
};
|
|
11
|
-
export declare type MakeNewRecordParams = {
|
|
12
|
-
activeFields: Object;
|
|
13
|
-
fields: Object;
|
|
14
|
-
context?: Object;
|
|
15
|
-
withoutParent?: boolean;
|
|
16
|
-
mode?: string;
|
|
17
|
-
};
|
|
18
|
-
export declare class StaticList extends DataPoint {
|
|
19
|
-
sconfig: StaticListConfig;
|
|
20
|
-
_records: () => WebRecord[];
|
|
21
|
-
orecordList: ManyFn<Model>;
|
|
22
|
-
_webRecords: Record<InstanceId, WebRecord>;
|
|
23
|
-
_draftRecord: Map<InstanceId, WebRecord>;
|
|
24
|
-
draftContext: DraftContext;
|
|
25
|
-
draftORecord: Model;
|
|
26
|
-
constructor(sconfig: StaticListConfig);
|
|
27
|
-
_constructor(sconfig: StaticListConfig): void;
|
|
28
|
-
_defineRecords(): void;
|
|
29
|
-
_getRecord(record: Model): WebRecord;
|
|
30
|
-
get count(): number;
|
|
31
|
-
get records(): WebRecord[];
|
|
32
|
-
get resIds(): InstanceId[];
|
|
33
|
-
get currentIds(): string;
|
|
34
|
-
get limit(): number;
|
|
35
|
-
get offset(): number;
|
|
36
|
-
get orderBy(): never[];
|
|
37
|
-
get evalContext(): any;
|
|
38
|
-
extendRecord(params: MakeNewRecordParams, record: WebRecord): Promise<any>;
|
|
39
|
-
_getDraftRecord(params: MakeNewRecordParams, webrecord: WebRecord, activeFields: Record<string, any>): Promise<WebRecord>;
|
|
40
|
-
validateExtendedRecord(record: WebRecord): void;
|
|
41
|
-
_getActiveFields(params: MakeNewRecordParams): Record<string, any>;
|
|
42
|
-
_makeNewRecord(params: any): Promise<WebRecord>;
|
|
43
|
-
_createRecordDatapoint(data: any, params?: any): WebRecord;
|
|
44
|
-
get editedRecord(): null;
|
|
45
|
-
enterEditMode(): void;
|
|
46
|
-
leaveEditMode(): void;
|
|
47
|
-
get selection(): never[];
|
|
48
|
-
canResequence(): void;
|
|
49
|
-
resequence(): void;
|
|
50
|
-
load(): void;
|
|
51
|
-
sortBy(): void;
|
|
52
|
-
addNewRecord(): void;
|
|
53
|
-
addNewRecordAtIndex(): void;
|
|
54
|
-
applyCommands(): void;
|
|
55
|
-
linkTo(): void;
|
|
56
|
-
unlinkFrom(): void;
|
|
57
|
-
forget(): void;
|
|
58
|
-
moveRecord(): void;
|
|
59
|
-
addAndRemove(): void;
|
|
60
|
-
duplicateRecords(): void;
|
|
61
|
-
delete(): void;
|
|
62
|
-
}
|
|
63
|
-
export declare function completeActiveFields(activeFields: Record<string, any>, extraActiveFields: Record<string, any>): void;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { Model } from "../model";
|
|
2
|
-
import { ModelId } from "../types";
|
|
3
|
-
import { WebModelConfig } from "./webModelTypes";
|
|
4
|
-
export declare function getOrMakeModel(modelId: ModelId): typeof Model;
|
|
5
|
-
export declare function makeModelFromWeb(config: WebModelConfig, processedModel?: Set<string>): typeof Model;
|
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
export interface WebModelConfig {
|
|
2
|
-
isMonoRecord: boolean;
|
|
3
|
-
context: Record<string, any>;
|
|
4
|
-
fieldsToAggregate: string[];
|
|
5
|
-
activeFields?: {
|
|
6
|
-
[key: string]: ActiveFieldInfo;
|
|
7
|
-
};
|
|
8
|
-
fields: {
|
|
9
|
-
[key: string]: FieldInfo;
|
|
10
|
-
};
|
|
11
|
-
isRoot: boolean;
|
|
12
|
-
resModel: string;
|
|
13
|
-
groupBy: string[];
|
|
14
|
-
resId?: number | false;
|
|
15
|
-
resIds?: number[];
|
|
16
|
-
mode?: "edit" | "readonly";
|
|
17
|
-
domain: any[];
|
|
18
|
-
orderBy: OrderBy[];
|
|
19
|
-
groups?: Record<string, any>;
|
|
20
|
-
offset: number;
|
|
21
|
-
limit: number;
|
|
22
|
-
countLimit: number;
|
|
23
|
-
currentGroups?: {
|
|
24
|
-
params: string;
|
|
25
|
-
groups: any[];
|
|
26
|
-
};
|
|
27
|
-
loadId?: string;
|
|
28
|
-
openGroupsByDefault?: boolean;
|
|
29
|
-
[key: string]: any;
|
|
30
|
-
}
|
|
31
|
-
export interface FieldInfo {
|
|
32
|
-
change_default?: boolean;
|
|
33
|
-
groupable?: boolean;
|
|
34
|
-
name?: string;
|
|
35
|
-
readonly?: boolean;
|
|
36
|
-
required?: boolean;
|
|
37
|
-
searchable?: boolean;
|
|
38
|
-
sortable?: boolean;
|
|
39
|
-
store?: boolean;
|
|
40
|
-
string?: string;
|
|
41
|
-
type?: string;
|
|
42
|
-
help?: string;
|
|
43
|
-
translate?: boolean;
|
|
44
|
-
trim?: boolean;
|
|
45
|
-
context?: {};
|
|
46
|
-
domain?: any[];
|
|
47
|
-
relation?: string;
|
|
48
|
-
related?: string;
|
|
49
|
-
selection?: Array<[string, string]>;
|
|
50
|
-
groups?: string;
|
|
51
|
-
relation_field?: string;
|
|
52
|
-
aggregator?: string;
|
|
53
|
-
digits?: [number, number];
|
|
54
|
-
size?: number;
|
|
55
|
-
currency_field?: string;
|
|
56
|
-
sanitize?: boolean;
|
|
57
|
-
sanitize_tags?: boolean;
|
|
58
|
-
definition_record?: string;
|
|
59
|
-
definition_record_field?: string;
|
|
60
|
-
}
|
|
61
|
-
export interface ActiveFieldInfo {
|
|
62
|
-
context: {};
|
|
63
|
-
invisible: string | boolean;
|
|
64
|
-
readonly: string | boolean;
|
|
65
|
-
required: string | boolean;
|
|
66
|
-
onChange: boolean;
|
|
67
|
-
forceSave: boolean;
|
|
68
|
-
isHandle: boolean;
|
|
69
|
-
related?: {
|
|
70
|
-
activeFields: {
|
|
71
|
-
[key: string]: ActiveFieldInfo;
|
|
72
|
-
};
|
|
73
|
-
fields: {
|
|
74
|
-
[key: string]: FieldInfo;
|
|
75
|
-
};
|
|
76
|
-
};
|
|
77
|
-
}
|
|
78
|
-
export interface WebModelConfigContext {
|
|
79
|
-
default_is_company: boolean;
|
|
80
|
-
lang: string;
|
|
81
|
-
tz: string;
|
|
82
|
-
uid: number;
|
|
83
|
-
allowed_company_ids: number[];
|
|
84
|
-
}
|
|
85
|
-
export interface RelationalModelParams {
|
|
86
|
-
config: {
|
|
87
|
-
activeFields: {
|
|
88
|
-
[key: string]: ActiveFieldInfo;
|
|
89
|
-
};
|
|
90
|
-
[key: string]: any;
|
|
91
|
-
};
|
|
92
|
-
limit?: number;
|
|
93
|
-
groupsLimit?: number;
|
|
94
|
-
countLimit?: number;
|
|
95
|
-
defaultOrderBy?: OrderBy[];
|
|
96
|
-
maxGroupByDepth?: number;
|
|
97
|
-
groupByInfo?: Record<string, any>;
|
|
98
|
-
multiEdit?: boolean;
|
|
99
|
-
activeIdsLimit?: number;
|
|
100
|
-
state?: {
|
|
101
|
-
specialDataCaches?: Record<string, any>;
|
|
102
|
-
};
|
|
103
|
-
useSendBeaconToSaveUrgently?: boolean;
|
|
104
|
-
hooks?: Partial<RelationalModelHooks>;
|
|
105
|
-
[key: string]: any;
|
|
106
|
-
}
|
|
107
|
-
export interface OrderBy {
|
|
108
|
-
name: string;
|
|
109
|
-
asc?: boolean;
|
|
110
|
-
}
|
|
111
|
-
export interface SearchParams {
|
|
112
|
-
context?: Record<string, any>;
|
|
113
|
-
resId?: number | false;
|
|
114
|
-
resIds?: number[];
|
|
115
|
-
domain?: any[];
|
|
116
|
-
groupBy?: string[];
|
|
117
|
-
orderBy?: OrderBy[];
|
|
118
|
-
limit?: number;
|
|
119
|
-
offset?: number;
|
|
120
|
-
countLimit?: number;
|
|
121
|
-
}
|
|
122
|
-
export interface Services {
|
|
123
|
-
action: any;
|
|
124
|
-
dialog: any;
|
|
125
|
-
notification: any;
|
|
126
|
-
orm: any;
|
|
127
|
-
}
|
|
128
|
-
export interface OnChangeParams {
|
|
129
|
-
changes?: Record<string, any>;
|
|
130
|
-
fieldNames?: string[];
|
|
131
|
-
evalContext?: Record<string, any>;
|
|
132
|
-
onError?: (error: any) => void;
|
|
133
|
-
cache?: any;
|
|
134
|
-
}
|
|
135
|
-
export interface RelationalModelHooks {
|
|
136
|
-
onWillLoadRoot: (config: WebModelConfig) => Promise<void>;
|
|
137
|
-
onRootLoaded: (root: any) => Promise<void>;
|
|
138
|
-
onWillDisplayOnchangeWarning: (warning: any) => Promise<void>;
|
|
139
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Atom, Computation, Derived, Opts } from "../common/types";
|
|
2
|
-
export declare function signal<T>(value: T, opts?: Opts): {
|
|
3
|
-
readonly get: () => T;
|
|
4
|
-
readonly set: (newValue: T | ((prevValue: T) => T)) => void;
|
|
5
|
-
};
|
|
6
|
-
export declare function effect<T>(fn: () => T, opts?: Opts): () => void;
|
|
7
|
-
export declare function derived<T>(fn: () => T, opts?: Opts): () => T;
|
|
8
|
-
export declare function onReadAtom(atom: Atom): void;
|
|
9
|
-
export declare function onWriteAtom(atom: Atom): void;
|
|
10
|
-
export declare function withoutReactivity<T extends (...args: any[]) => any>(fn: T): ReturnType<T>;
|
|
11
|
-
export declare function getCurrentComputation(): Computation<any> | undefined;
|
|
12
|
-
export declare function setComputation(computation: Computation | undefined): void;
|
|
13
|
-
export declare function runWithComputation<T>(computation: Computation, fn: () => T): T;
|
|
14
|
-
export declare function setSignalHooks(hooks: {
|
|
15
|
-
onDerived: (derived: Derived<any, any>) => void;
|
|
16
|
-
}): void;
|
|
17
|
-
export declare function resetSignalHooks(): void;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { TaskContext } from "./cancellableContext";
|
|
2
|
-
export declare class Task<T = any> {
|
|
3
|
-
_onCancelled?: Function | undefined;
|
|
4
|
-
_promise: Promise<T>;
|
|
5
|
-
_ctx?: TaskContext;
|
|
6
|
-
constructor(executor: (resolve: (value: T | PromiseLike<T>) => void, reject: (reason: any) => void) => void, _onCancelled?: Function | undefined);
|
|
7
|
-
then(onFulfilled: (value: any) => any, onRejected: (error: any) => any): Promise<any>;
|
|
8
|
-
catch(onRejected: (error: any) => any): Promise<any>;
|
|
9
|
-
finally(onFinally: () => any): Promise<T>;
|
|
10
|
-
cancel(): void;
|
|
11
|
-
get [Symbol.toStringTag](): string;
|
|
12
|
-
}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { Schema } from "../runtime/validation";
|
|
2
|
-
declare type Fn<T> = () => T;
|
|
3
|
-
export declare class Registry<T> {
|
|
4
|
-
_map: {
|
|
5
|
-
[key: string]: [number, T];
|
|
6
|
-
};
|
|
7
|
-
_name: string;
|
|
8
|
-
_schema?: Schema;
|
|
9
|
-
items: Fn<T[]>;
|
|
10
|
-
entries: Fn<[string, T][]>;
|
|
11
|
-
constructor(name?: string, schema?: Schema);
|
|
12
|
-
set(key: string, value: T, sequence?: number): void;
|
|
13
|
-
get(key: string, defaultValue?: T): T;
|
|
14
|
-
}
|
|
15
|
-
export {};
|