@odoo/owl 3.0.0-alpha.3 → 3.0.0-alpha.30
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 +74 -117
- package/dist/owl.cjs.js +6522 -6686
- package/dist/owl.es.js +6501 -6640
- package/dist/owl.iife.js +6525 -6691
- package/dist/owl.iife.min.js +27 -1
- package/dist/types/owl.d.ts +763 -668
- package/package.json +22 -79
- package/dist/compile_templates.mjs +0 -2553
- package/dist/owl-devtools.zip +0 -0
- package/dist/types/common/owl_error.d.ts +0 -3
- package/dist/types/common/types.d.ts +0 -29
- package/dist/types/common/utils.d.ts +0 -8
- package/dist/types/compiler/code_generator.d.ts +0 -152
- package/dist/types/compiler/index.d.ts +0 -13
- package/dist/types/compiler/inline_expressions.d.ts +0 -59
- package/dist/types/compiler/parser.d.ts +0 -178
- package/dist/types/compiler/standalone/index.d.ts +0 -2
- package/dist/types/compiler/standalone/setup_jsdom.d.ts +0 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/runtime/app.d.ts +0 -62
- package/dist/types/runtime/blockdom/attributes.d.ts +0 -6
- package/dist/types/runtime/blockdom/block_compiler.d.ts +0 -21
- package/dist/types/runtime/blockdom/config.d.ts +0 -8
- package/dist/types/runtime/blockdom/event_catcher.d.ts +0 -7
- package/dist/types/runtime/blockdom/events.d.ts +0 -8
- package/dist/types/runtime/blockdom/html.d.ts +0 -17
- package/dist/types/runtime/blockdom/index.d.ts +0 -26
- package/dist/types/runtime/blockdom/list.d.ts +0 -18
- package/dist/types/runtime/blockdom/multi.d.ts +0 -17
- package/dist/types/runtime/blockdom/text.d.ts +0 -26
- package/dist/types/runtime/blockdom/toggler.d.ts +0 -17
- package/dist/types/runtime/cancellableContext.d.ts +0 -15
- package/dist/types/runtime/cancellablePromise.d.ts +0 -15
- package/dist/types/runtime/component.d.ts +0 -28
- package/dist/types/runtime/component_node.d.ts +0 -83
- package/dist/types/runtime/error_handling.d.ts +0 -13
- package/dist/types/runtime/event_handling.d.ts +0 -1
- package/dist/types/runtime/executionContext.d.ts +0 -0
- package/dist/types/runtime/fibers.d.ts +0 -37
- package/dist/types/runtime/hooks.d.ts +0 -57
- package/dist/types/runtime/index.d.ts +0 -35
- package/dist/types/runtime/lifecycle_hooks.d.ts +0 -12
- package/dist/types/runtime/listOperation.d.ts +0 -1
- package/dist/types/runtime/plugins.d.ts +0 -39
- package/dist/types/runtime/portal.d.ts +0 -15
- package/dist/types/runtime/reactivity.d.ts +0 -46
- package/dist/types/runtime/registry.d.ts +0 -15
- 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/scheduler.d.ts +0 -21
- package/dist/types/runtime/signals.d.ts +0 -17
- package/dist/types/runtime/status.d.ts +0 -10
- package/dist/types/runtime/task.d.ts +0 -12
- package/dist/types/runtime/template_helpers.d.ts +0 -58
- package/dist/types/runtime/template_set.d.ts +0 -40
- package/dist/types/runtime/utils.d.ts +0 -25
- package/dist/types/runtime/validation.d.ts +0 -36
- package/dist/types/utils/registry.d.ts +0 -15
- package/dist/types/version.d.ts +0 -1
- package/tools/compile_owl_templates.mjs +0 -31
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Model } from "./model";
|
|
2
|
-
export declare type FieldTypes = FieldDefinition["type"];
|
|
3
|
-
export declare type ModelId = string;
|
|
4
|
-
export declare type NormalizedDomain = string;
|
|
5
|
-
export declare type InstanceId = number | string;
|
|
6
|
-
export declare type FieldName = string;
|
|
7
|
-
export declare type ItemData = Record<string, any>;
|
|
8
|
-
export declare type RecordItem = {
|
|
9
|
-
data: ItemData;
|
|
10
|
-
reactiveData: ItemData;
|
|
11
|
-
instance: Model;
|
|
12
|
-
dataToLoad?: ItemData;
|
|
13
|
-
};
|
|
14
|
-
export declare type RelationChanges = Record<FieldName, null | InstanceId | [InstanceId[], InstanceId[]]>;
|
|
15
|
-
export declare type FieldDefinitionBase = {
|
|
16
|
-
fieldName: string;
|
|
17
|
-
};
|
|
18
|
-
export declare type FieldDefinitionAny = FieldDefinitionBase & {
|
|
19
|
-
type: "any";
|
|
20
|
-
};
|
|
21
|
-
export declare type FieldDefinitionString = FieldDefinitionBase & {
|
|
22
|
-
type: "string";
|
|
23
|
-
};
|
|
24
|
-
export declare type FieldDefinitionChar = FieldDefinitionBase & {
|
|
25
|
-
type: "char";
|
|
26
|
-
};
|
|
27
|
-
export declare type FieldDefinitionText = FieldDefinitionBase & {
|
|
28
|
-
type: "text";
|
|
29
|
-
};
|
|
30
|
-
export declare type FieldDefinitionHtml = FieldDefinitionBase & {
|
|
31
|
-
type: "html";
|
|
32
|
-
};
|
|
33
|
-
export declare type FieldDefinitionDate = FieldDefinitionBase & {
|
|
34
|
-
type: "date";
|
|
35
|
-
};
|
|
36
|
-
export declare type FieldDefinitionDatetime = FieldDefinitionBase & {
|
|
37
|
-
type: "datetime";
|
|
38
|
-
};
|
|
39
|
-
export declare type FieldDefinitionSelection = FieldDefinitionBase & {
|
|
40
|
-
type: "selection";
|
|
41
|
-
selection: any;
|
|
42
|
-
};
|
|
43
|
-
export declare type FieldDefinitionReference = FieldDefinitionBase & {
|
|
44
|
-
type: "reference";
|
|
45
|
-
};
|
|
46
|
-
export declare type FieldDefinitionMany2OneReference = FieldDefinitionBase & {
|
|
47
|
-
type: "many2one_reference";
|
|
48
|
-
};
|
|
49
|
-
export declare type FieldDefinitionProperties = FieldDefinitionBase & {
|
|
50
|
-
type: "properties";
|
|
51
|
-
};
|
|
52
|
-
export declare type FieldDefinitionNumber = FieldDefinitionBase & {
|
|
53
|
-
type: "number";
|
|
54
|
-
};
|
|
55
|
-
export declare type FieldDefinitionX2Many = FieldDefinitionBase & {
|
|
56
|
-
modelId: ModelId;
|
|
57
|
-
};
|
|
58
|
-
export declare type FieldDefinitionOne2Many = FieldDefinitionX2Many & {
|
|
59
|
-
type: "one2many";
|
|
60
|
-
relatedField?: string;
|
|
61
|
-
};
|
|
62
|
-
export declare type FieldDefinitionMany2One = FieldDefinitionX2Many & {
|
|
63
|
-
type: "many2one";
|
|
64
|
-
};
|
|
65
|
-
export declare type FieldDefinitionMany2Many = FieldDefinitionX2Many & {
|
|
66
|
-
type: "many2many";
|
|
67
|
-
relationTableName?: string;
|
|
68
|
-
};
|
|
69
|
-
export declare type X2ManyFieldDefinition = FieldDefinitionOne2Many | FieldDefinitionMany2One | FieldDefinitionMany2Many;
|
|
70
|
-
export declare type FieldDefinition = FieldDefinitionAny | FieldDefinitionString | FieldDefinitionChar | FieldDefinitionText | FieldDefinitionHtml | FieldDefinitionDate | FieldDefinitionDatetime | FieldDefinitionSelection | FieldDefinitionReference | FieldDefinitionMany2OneReference | FieldDefinitionProperties | FieldDefinitionNumber | X2ManyFieldDefinition;
|
|
71
|
-
export declare type ManyFn<T extends Model> = (() => T[]) & {
|
|
72
|
-
add: (m: T) => void;
|
|
73
|
-
delete: (m: T) => void;
|
|
74
|
-
ids: () => InstanceId[];
|
|
75
|
-
};
|
|
76
|
-
export declare type SearchEntry = {
|
|
77
|
-
ids: InstanceId[];
|
|
78
|
-
};
|
|
79
|
-
export declare type DraftContextStore = Record<ModelId, Record<InstanceId, Model>>;
|
|
80
|
-
export declare type DraftContext = {
|
|
81
|
-
parent?: DraftContext;
|
|
82
|
-
store: DraftContextStore;
|
|
83
|
-
} | undefined;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function mapEntries<T, U>(obj: Record<string, T>, fn: (entry: [string, T]) => [string, U]): Record<string, U>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare class DataPoint {
|
|
2
|
-
/**
|
|
3
|
-
* @param {RelationalModel} model
|
|
4
|
-
* @param {RelationalModelConfig} config
|
|
5
|
-
* @param {Record<string, unknown>} data
|
|
6
|
-
* @param {unknown} [options]
|
|
7
|
-
*/
|
|
8
|
-
model: any;
|
|
9
|
-
_config: any;
|
|
10
|
-
_constructor(model: any, config: any, data: any, options: any): void;
|
|
11
|
-
/**
|
|
12
|
-
* @abstract
|
|
13
|
-
* @template [O={}]
|
|
14
|
-
* @param {RelationalModelConfig} _config
|
|
15
|
-
* @param {Record<string, unknown>} _data
|
|
16
|
-
* @param {O | undefined} _options
|
|
17
|
-
*/
|
|
18
|
-
setup(_config: any, _data: any, _options: any): void;
|
|
19
|
-
get activeFields(): any;
|
|
20
|
-
get fields(): any;
|
|
21
|
-
get fieldNames(): string[];
|
|
22
|
-
get resModel(): any;
|
|
23
|
-
get config(): any;
|
|
24
|
-
get context(): any;
|
|
25
|
-
}
|
|
@@ -1,131 +0,0 @@
|
|
|
1
|
-
import { Model } from "../model";
|
|
2
|
-
import { DataPoint } from "./WebDataPoint";
|
|
3
|
-
export declare type MakeWebRecord = (model: any, config: any, data: any, options: any) => WebRecord;
|
|
4
|
-
export declare class WebRecord extends DataPoint {
|
|
5
|
-
static type: string;
|
|
6
|
-
orecord: Model;
|
|
7
|
-
data: Record<string, any>;
|
|
8
|
-
evalContext: Record<string, any>;
|
|
9
|
-
evalContextWithVirtualIds: Record<string, any>;
|
|
10
|
-
_isEvalContextReady: boolean;
|
|
11
|
-
canSaveOnUpdate: boolean;
|
|
12
|
-
selected: boolean | undefined;
|
|
13
|
-
constructor(...args: Parameters<MakeWebRecord>);
|
|
14
|
-
setup(_config: any, data: any, options?: any): void;
|
|
15
|
-
get id(): import("../types").InstanceId | undefined;
|
|
16
|
-
get resId(): false | import("../types").InstanceId | undefined;
|
|
17
|
-
get isNew(): boolean;
|
|
18
|
-
get dirty(): boolean;
|
|
19
|
-
get isValid(): boolean;
|
|
20
|
-
_isRequired(fieldName: string): any;
|
|
21
|
-
get isActive(): any;
|
|
22
|
-
_isInvisible(fieldName: string): any;
|
|
23
|
-
_isReadonly(fieldName: string): any;
|
|
24
|
-
update(changes: any, { save }?: any): any;
|
|
25
|
-
_updateORecord(orecord: any, changes: any): Promise<void>;
|
|
26
|
-
_update(changes: any, { withoutOnchange, withoutParentUpdate }?: any): Promise<void>;
|
|
27
|
-
_setEvalContext(): void;
|
|
28
|
-
_computeDataContext(): {
|
|
29
|
-
withVirtualIds: any;
|
|
30
|
-
withoutVirtualIds: any;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* @param {Parameters<Record["_save"]>[0]} options
|
|
34
|
-
*/
|
|
35
|
-
save(options: any): Promise<any>;
|
|
36
|
-
_save({ reload, onError, nextId }?: any): Promise<any>;
|
|
37
|
-
_getChanges(): Record<string, any>;
|
|
38
|
-
urgentSave(): Promise<any>;
|
|
39
|
-
load(): any;
|
|
40
|
-
_load(nextConfig?: {}): Promise<void>;
|
|
41
|
-
get resIds(): any;
|
|
42
|
-
get hasData(): boolean;
|
|
43
|
-
get isInEdition(): boolean;
|
|
44
|
-
/**
|
|
45
|
-
* @param {Mode} mode
|
|
46
|
-
*/
|
|
47
|
-
switchMode(mode: any): any;
|
|
48
|
-
/**
|
|
49
|
-
* @param {Mode} mode
|
|
50
|
-
*/
|
|
51
|
-
_switchMode(mode: any): void;
|
|
52
|
-
get canBeAbandoned(): boolean;
|
|
53
|
-
isDirty(): Promise<boolean>;
|
|
54
|
-
toggleSelection(selected: any): any;
|
|
55
|
-
_toggleSelection(selected: any): void;
|
|
56
|
-
getChanges({ withReadonly }?: any): Promise<any>;
|
|
57
|
-
_getOnchangeValues(changes: any): Promise<void>;
|
|
58
|
-
/**
|
|
59
|
-
* @param {RecordType<string, unknown>} serverValues
|
|
60
|
-
* @param {FieldSpecifications} [params]
|
|
61
|
-
*/
|
|
62
|
-
_parseServerValues(serverValues: any, { currentValues, orderBys }?: any): void;
|
|
63
|
-
_formatServerValue(fieldType: string, value: any): void;
|
|
64
|
-
checkValidity({ displayNotification }?: any): Promise<boolean>;
|
|
65
|
-
_checkValidity({ silent, displayNotification, removeInvalidOnly }?: any): void;
|
|
66
|
-
/**
|
|
67
|
-
* @param {string} fieldName
|
|
68
|
-
*/
|
|
69
|
-
isFieldInvalid(fieldName: string): boolean;
|
|
70
|
-
/**
|
|
71
|
-
* @param {string} fieldName
|
|
72
|
-
*/
|
|
73
|
-
setInvalidField(fieldName: string): Promise<void>;
|
|
74
|
-
_setInvalidField(fieldName: string): Promise<void>;
|
|
75
|
-
/**
|
|
76
|
-
* @param {string} fieldName
|
|
77
|
-
*/
|
|
78
|
-
resetFieldValidity(fieldName: string): Promise<void>;
|
|
79
|
-
_resetFieldValidity(fieldName: string): void;
|
|
80
|
-
_removeInvalidFields(...fieldNames: string[]): void;
|
|
81
|
-
_displayInvalidFieldNotification(): void;
|
|
82
|
-
_setData(data: Record<string, any>, { orderBys, keepChanges }?: any): void;
|
|
83
|
-
_applyValues(values: Record<string, any>): void;
|
|
84
|
-
_applyChanges(changes: Record<string, any>, serverChanges?: {}): void;
|
|
85
|
-
_applyDefaultValues(): void;
|
|
86
|
-
_getDefaultValues(fieldNames?: string[]): void;
|
|
87
|
-
/**
|
|
88
|
-
* This function extracts all properties and adds them to fields and activeFields.
|
|
89
|
-
*
|
|
90
|
-
* @param {Object[]} properties the list of properties to be extracted
|
|
91
|
-
* @param {string} fieldName name of the field containing the properties
|
|
92
|
-
* @param {Array} parent Array with ['id, 'display_name'], representing the record to which the definition of properties is linked
|
|
93
|
-
* @param {Object} currentValues current values of the record
|
|
94
|
-
* @returns An object containing as key `${fieldName}.${property.name}` and as value the value of the property
|
|
95
|
-
*/
|
|
96
|
-
_processProperties(properties: Array<any>, fieldName: string, parent: Array<any>, currentValues?: Object): void;
|
|
97
|
-
_preprocessMany2oneChanges(changes: any): Promise<void>;
|
|
98
|
-
_preprocessMany2OneReferenceChanges(changes: any): Promise<void>;
|
|
99
|
-
_preprocessReferenceChanges(changes: any): Promise<void>;
|
|
100
|
-
_preprocessX2manyChanges(changes: any): Promise<void>;
|
|
101
|
-
_preprocessPropertiesChanges(changes: any): void;
|
|
102
|
-
_preprocessHtmlChanges(changes: any): void;
|
|
103
|
-
/**
|
|
104
|
-
* Given a possibily incomplete value for a many2one field (i.e. a object { id, display_name } but
|
|
105
|
-
* with id and/or display_name being undefined), return the complete value as follows:
|
|
106
|
-
* - if a display_name is given but no id, perform a name_create to get an id
|
|
107
|
-
* - if an id is given but display_name is undefined, call web_read to get the display_name
|
|
108
|
-
* - if both id and display_name are given, return the value as is
|
|
109
|
-
* - in any other cases, return false
|
|
110
|
-
*
|
|
111
|
-
* @param {{ id?: number; display_name?: string }} value
|
|
112
|
-
* @param {string} fieldName
|
|
113
|
-
* @param {string} resModel
|
|
114
|
-
* @returns {Promise<false | { id: number; display_name: string; }>} the completed record { id, display_name } or false
|
|
115
|
-
*/
|
|
116
|
-
_completeMany2OneValue(value: {
|
|
117
|
-
id?: number;
|
|
118
|
-
display_name?: string;
|
|
119
|
-
}, fieldName: string, resModel: string): Promise<void>;
|
|
120
|
-
discard(): Promise<void>;
|
|
121
|
-
_discard(): void;
|
|
122
|
-
duplicate(): void;
|
|
123
|
-
delete(): void;
|
|
124
|
-
archive(): void;
|
|
125
|
-
unarchive(): void;
|
|
126
|
-
_toggleArchive(state: boolean): Promise<void>;
|
|
127
|
-
_getTextValues(values: any): void;
|
|
128
|
-
_addSavePoint(): void;
|
|
129
|
-
_createStaticListDatapoint(data: any, fieldName: string, { orderBys }?: any): void;
|
|
130
|
-
}
|
|
131
|
-
export declare function makeFieldObject(record: any, orecord: Model): any;
|
|
@@ -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,21 +0,0 @@
|
|
|
1
|
-
import type { ComponentNode } from "./component_node";
|
|
2
|
-
import { Fiber, RootFiber } from "./fibers";
|
|
3
|
-
export declare class Scheduler {
|
|
4
|
-
static requestAnimationFrame: ((callback: FrameRequestCallback) => number) & typeof requestAnimationFrame;
|
|
5
|
-
tasks: Set<RootFiber>;
|
|
6
|
-
requestAnimationFrame: Window["requestAnimationFrame"];
|
|
7
|
-
frame: number;
|
|
8
|
-
delayedRenders: Fiber[];
|
|
9
|
-
cancelledNodes: Set<ComponentNode>;
|
|
10
|
-
processing: boolean;
|
|
11
|
-
constructor();
|
|
12
|
-
addFiber(fiber: Fiber): void;
|
|
13
|
-
scheduleDestroy(node: ComponentNode): void;
|
|
14
|
-
/**
|
|
15
|
-
* Process all current tasks. This only applies to the fibers that are ready.
|
|
16
|
-
* Other tasks are left unchanged.
|
|
17
|
-
*/
|
|
18
|
-
flush(): void;
|
|
19
|
-
processTasks(): void;
|
|
20
|
-
processFiber(fiber: RootFiber): void;
|
|
21
|
-
}
|
|
@@ -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,10 +0,0 @@
|
|
|
1
|
-
import type { Component } from "./component";
|
|
2
|
-
export declare const enum STATUS {
|
|
3
|
-
NEW = 0,
|
|
4
|
-
MOUNTED = 1,
|
|
5
|
-
CANCELLED = 2,
|
|
6
|
-
DESTROYED = 3
|
|
7
|
-
}
|
|
8
|
-
declare type STATUS_DESCR = "new" | "mounted" | "cancelled" | "destroyed";
|
|
9
|
-
export declare function status(component: Component): STATUS_DESCR;
|
|
10
|
-
export {};
|
|
@@ -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,58 +0,0 @@
|
|
|
1
|
-
import { BDom, toggler, createCatcher } from "./blockdom";
|
|
2
|
-
import type { ComponentConstructor } from "./component";
|
|
3
|
-
import { markRaw } from "./reactivity";
|
|
4
|
-
import { OwlError } from "../common/owl_error";
|
|
5
|
-
import type { ComponentNode } from "./component_node";
|
|
6
|
-
/**
|
|
7
|
-
* This file contains utility functions that will be injected in each template,
|
|
8
|
-
* to perform various useful tasks in the compiled code.
|
|
9
|
-
*/
|
|
10
|
-
declare function withDefault(value: any, defaultValue: any): any;
|
|
11
|
-
declare function callSlot(ctx: any, parent: any, key: string, name: string, dynamic: boolean, extra: any, defaultContent?: (ctx: any, node: any, key: string) => BDom): BDom;
|
|
12
|
-
declare function capture(ctx: any): any;
|
|
13
|
-
declare function withKey(elem: any, k: string): any;
|
|
14
|
-
declare function prepareList(collection: unknown): [unknown[], unknown[], number, undefined[]];
|
|
15
|
-
declare function setContextValue(ctx: {
|
|
16
|
-
[key: string]: any;
|
|
17
|
-
}, key: string, value: any): void;
|
|
18
|
-
declare function toNumber(val: string): number | string;
|
|
19
|
-
declare function shallowEqual(l1: any[], l2: any[]): boolean;
|
|
20
|
-
declare class LazyValue {
|
|
21
|
-
fn: any;
|
|
22
|
-
ctx: any;
|
|
23
|
-
component: any;
|
|
24
|
-
node: any;
|
|
25
|
-
key: any;
|
|
26
|
-
constructor(fn: any, ctx: any, component: any, node: any, key: any);
|
|
27
|
-
evaluate(): any;
|
|
28
|
-
toString(): any;
|
|
29
|
-
}
|
|
30
|
-
export declare function safeOutput(value: any, defaultValue?: any): ReturnType<typeof toggler>;
|
|
31
|
-
/**
|
|
32
|
-
* Validate the component props (or next props) against the (static) props
|
|
33
|
-
* description. This is potentially an expensive operation: it may needs to
|
|
34
|
-
* visit recursively the props and all the children to check if they are valid.
|
|
35
|
-
* This is why it is only done in 'dev' mode.
|
|
36
|
-
*/
|
|
37
|
-
export declare function validateProps<P>(name: string | ComponentConstructor<P>, props: P, comp?: any): void;
|
|
38
|
-
declare function makeRefWrapper(node: ComponentNode): (name: string, fn: Function) => Function;
|
|
39
|
-
export declare const helpers: {
|
|
40
|
-
withDefault: typeof withDefault;
|
|
41
|
-
zero: symbol;
|
|
42
|
-
isBoundary: symbol;
|
|
43
|
-
callSlot: typeof callSlot;
|
|
44
|
-
capture: typeof capture;
|
|
45
|
-
withKey: typeof withKey;
|
|
46
|
-
prepareList: typeof prepareList;
|
|
47
|
-
setContextValue: typeof setContextValue;
|
|
48
|
-
shallowEqual: typeof shallowEqual;
|
|
49
|
-
toNumber: typeof toNumber;
|
|
50
|
-
validateProps: typeof validateProps;
|
|
51
|
-
LazyValue: typeof LazyValue;
|
|
52
|
-
safeOutput: typeof safeOutput;
|
|
53
|
-
createCatcher: typeof createCatcher;
|
|
54
|
-
markRaw: typeof markRaw;
|
|
55
|
-
OwlError: typeof OwlError;
|
|
56
|
-
makeRefWrapper: typeof makeRefWrapper;
|
|
57
|
-
};
|
|
58
|
-
export {};
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { compile, Template, TemplateFunction } from "../compiler";
|
|
2
|
-
import { Portal } from "./portal";
|
|
3
|
-
import type { customDirectives } from "../common/types";
|
|
4
|
-
export interface TemplateSetConfig {
|
|
5
|
-
dev?: boolean;
|
|
6
|
-
translatableAttributes?: string[];
|
|
7
|
-
translateFn?: (s: string, translationCtx: string) => string;
|
|
8
|
-
templates?: string | Document | Record<string, string>;
|
|
9
|
-
getTemplate?: (s: string) => Element | Function | string | void;
|
|
10
|
-
customDirectives?: customDirectives;
|
|
11
|
-
globalValues?: object;
|
|
12
|
-
}
|
|
13
|
-
export declare class TemplateSet {
|
|
14
|
-
static registerTemplate(name: string, fn: TemplateFunction): void;
|
|
15
|
-
dev: boolean;
|
|
16
|
-
rawTemplates: typeof globalTemplates;
|
|
17
|
-
templates: {
|
|
18
|
-
[name: string]: Template;
|
|
19
|
-
};
|
|
20
|
-
getRawTemplate?: (s: string) => Element | Function | string | void;
|
|
21
|
-
translateFn?: (s: string, translationCtx: string) => string;
|
|
22
|
-
translatableAttributes?: string[];
|
|
23
|
-
Portal: typeof Portal;
|
|
24
|
-
customDirectives: customDirectives;
|
|
25
|
-
runtimeUtils: object;
|
|
26
|
-
hasGlobalValues: boolean;
|
|
27
|
-
constructor(config?: TemplateSetConfig);
|
|
28
|
-
addTemplate(name: string, template: string | Element): void;
|
|
29
|
-
addTemplates(xml: string | Document): void;
|
|
30
|
-
getTemplate(name: string): Template;
|
|
31
|
-
_compileTemplate(name: string, template: string | Element): ReturnType<typeof compile>;
|
|
32
|
-
callTemplate(owner: any, subTemplate: string, ctx: any, parent: any, key: any): any;
|
|
33
|
-
}
|
|
34
|
-
export declare const globalTemplates: {
|
|
35
|
-
[key: string]: string | Element | TemplateFunction;
|
|
36
|
-
};
|
|
37
|
-
export declare function xml(...args: Parameters<typeof String.raw>): string;
|
|
38
|
-
export declare namespace xml {
|
|
39
|
-
var nextId: number;
|
|
40
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
export declare type Callback = () => void;
|
|
2
|
-
/**
|
|
3
|
-
* Creates a batched version of a callback so that all calls to it in the same
|
|
4
|
-
* microtick will only call the original callback once.
|
|
5
|
-
*
|
|
6
|
-
* @param callback the callback to batch
|
|
7
|
-
* @returns a batched version of the original callback
|
|
8
|
-
*/
|
|
9
|
-
export declare function batched(callback: Callback): Callback;
|
|
10
|
-
/**
|
|
11
|
-
* Determine whether the given element is contained in its ownerDocument:
|
|
12
|
-
* either directly or with a shadow root in between.
|
|
13
|
-
*/
|
|
14
|
-
export declare function inOwnerDocument(el?: HTMLElement): boolean;
|
|
15
|
-
export declare function validateTarget(target: HTMLElement | ShadowRoot): void;
|
|
16
|
-
export declare class EventBus extends EventTarget {
|
|
17
|
-
trigger(name: string, payload?: any): void;
|
|
18
|
-
}
|
|
19
|
-
export declare function whenReady(fn?: any): Promise<void>;
|
|
20
|
-
export declare function loadFile(url: string): Promise<string>;
|
|
21
|
-
export declare class Markup extends String {
|
|
22
|
-
}
|
|
23
|
-
export declare function htmlEscape(str: any): Markup;
|
|
24
|
-
export declare function markup(strings: TemplateStringsArray, ...placeholders: unknown[]): Markup;
|
|
25
|
-
export declare function markup(value: string): Markup;
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
declare type BaseType = {
|
|
2
|
-
new (...args: any[]): any;
|
|
3
|
-
} | true | "*";
|
|
4
|
-
interface TypeInfo {
|
|
5
|
-
type?: TypeDescription;
|
|
6
|
-
optional?: boolean;
|
|
7
|
-
validate?: Function;
|
|
8
|
-
shape?: Schema;
|
|
9
|
-
element?: TypeDescription;
|
|
10
|
-
values?: TypeDescription;
|
|
11
|
-
}
|
|
12
|
-
declare type ValueType = {
|
|
13
|
-
value: any;
|
|
14
|
-
};
|
|
15
|
-
export declare type TypeDescription = BaseType | TypeInfo | ValueType | TypeDescription[];
|
|
16
|
-
declare type SimplifiedSchema = string[];
|
|
17
|
-
declare type NormalizedSchema = {
|
|
18
|
-
[key: string]: TypeDescription;
|
|
19
|
-
};
|
|
20
|
-
export declare type Schema = SimplifiedSchema | NormalizedSchema;
|
|
21
|
-
export declare function isOptional(t: TypeDescription): Boolean;
|
|
22
|
-
/**
|
|
23
|
-
* Main validate function
|
|
24
|
-
*/
|
|
25
|
-
export declare function validate(obj: {
|
|
26
|
-
[key: string]: any;
|
|
27
|
-
}, spec: Schema): void;
|
|
28
|
-
/**
|
|
29
|
-
* Helper validate function, to get the list of errors. useful if one want to
|
|
30
|
-
* manipulate the errors without parsing an error object
|
|
31
|
-
*/
|
|
32
|
-
export declare function validateSchema(obj: {
|
|
33
|
-
[key: string]: any;
|
|
34
|
-
}, schema: Schema): string[];
|
|
35
|
-
export declare function validateType(key: string, value: any, descr: TypeDescription): string | null;
|
|
36
|
-
export {};
|