@odoo/owl 3.0.0-alpha.25 → 3.0.0-alpha.28
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/dist/owl.cjs.js +6648 -6618
- package/dist/owl.es.js +6628 -6577
- package/dist/owl.iife.js +6818 -6790
- package/dist/owl.iife.min.js +27 -1
- package/dist/types/owl.d.ts +679 -624
- package/package.json +9 -95
- package/LICENSE +0 -856
- package/README.md +0 -139
- package/dist/compile_templates.mjs +0 -2458
- package/dist/owl-devtools.zip +0 -0
- package/dist/types/common/owl_error.d.ts +0 -3
- package/dist/types/common/utils.d.ts +0 -8
- package/dist/types/compiler/code_generator.d.ts +0 -133
- package/dist/types/compiler/index.d.ts +0 -13
- package/dist/types/compiler/inline_expressions.d.ts +0 -41
- package/dist/types/compiler/parser.d.ts +0 -170
- 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 -54
- package/dist/types/runtime/blockdom/attributes.d.ts +0 -8
- 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 -25
- 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/component.d.ts +0 -17
- package/dist/types/runtime/component_node.d.ts +0 -59
- package/dist/types/runtime/context.d.ts +0 -36
- package/dist/types/runtime/event_handling.d.ts +0 -1
- package/dist/types/runtime/hooks.d.ts +0 -32
- package/dist/types/runtime/index.d.ts +0 -46
- package/dist/types/runtime/lifecycle_hooks.d.ts +0 -10
- package/dist/types/runtime/plugin_hooks.d.ts +0 -6
- package/dist/types/runtime/plugin_manager.d.ts +0 -36
- package/dist/types/runtime/props.d.ts +0 -21
- package/dist/types/runtime/reactivity/computations.d.ts +0 -34
- package/dist/types/runtime/reactivity/computed.d.ts +0 -6
- package/dist/types/runtime/reactivity/effect.d.ts +0 -1
- package/dist/types/runtime/reactivity/proxy.d.ts +0 -47
- package/dist/types/runtime/reactivity/signal.d.ts +0 -31
- package/dist/types/runtime/registry.d.ts +0 -24
- package/dist/types/runtime/rendering/error_handling.d.ts +0 -13
- package/dist/types/runtime/rendering/fibers.d.ts +0 -36
- package/dist/types/runtime/rendering/scheduler.d.ts +0 -20
- package/dist/types/runtime/rendering/template_helpers.d.ts +0 -51
- package/dist/types/runtime/resource.d.ts +0 -18
- package/dist/types/runtime/status.d.ts +0 -11
- package/dist/types/runtime/template_set.d.ts +0 -36
- package/dist/types/runtime/types.d.ts +0 -77
- package/dist/types/runtime/utils.d.ts +0 -24
- package/dist/types/runtime/validation.d.ts +0 -19
- package/dist/types/version.d.ts +0 -1
- package/tools/compile_owl_templates.mjs +0 -31
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
import { Component } from "./component";
|
|
2
|
-
import { ReactiveValue } from "./reactivity/computations";
|
|
3
|
-
type Constructor<T = any> = {
|
|
4
|
-
new (...args: any[]): T;
|
|
5
|
-
};
|
|
6
|
-
export type GetOptionalEntries<T> = {
|
|
7
|
-
[K in keyof T as K extends `${infer P}?` ? P : never]?: T[K];
|
|
8
|
-
};
|
|
9
|
-
export type GetRequiredEntries<T> = {
|
|
10
|
-
[K in keyof T as K extends `${string}?` ? never : K]: T[K];
|
|
11
|
-
};
|
|
12
|
-
export type PrettifyShape<T> = T extends Function ? T : {
|
|
13
|
-
[K in keyof T]: T[K];
|
|
14
|
-
};
|
|
15
|
-
type ResolveOptionalEntries<T> = PrettifyShape<GetRequiredEntries<T> & GetOptionalEntries<T>>;
|
|
16
|
-
export type KeyedObject<K extends string[]> = {
|
|
17
|
-
[P in K[number]]: any;
|
|
18
|
-
};
|
|
19
|
-
type ResolveShapedObject<T extends {}> = PrettifyShape<ResolveOptionalEntries<T>>;
|
|
20
|
-
export type ResolveObjectType<T extends {}> = ResolveShapedObject<T extends string[] ? KeyedObject<T> : T>;
|
|
21
|
-
type UnionToIntersection<U> = (U extends any ? (_: U) => any : never) extends (_: infer I) => void ? I : never;
|
|
22
|
-
declare function anyType(): any;
|
|
23
|
-
declare function booleanType(): boolean;
|
|
24
|
-
declare function numberType(): number;
|
|
25
|
-
declare function stringType(): string;
|
|
26
|
-
declare function arrayType(): any[];
|
|
27
|
-
declare function arrayType<T>(elementType: T): T[];
|
|
28
|
-
declare function constructorType<T extends Constructor>(constructor: T): T;
|
|
29
|
-
declare function customValidator<T>(type: T, validator: (value: T) => boolean, errorMessage?: string): T;
|
|
30
|
-
declare function functionType(): (...parameters: any[]) => any;
|
|
31
|
-
declare function functionType<const P extends any[]>(parameters: P): (...parameters: P) => void;
|
|
32
|
-
declare function functionType<const P extends any[], R>(parameters: P, result: R): (...parameters: P) => R;
|
|
33
|
-
declare function instanceType<T extends Constructor>(constructor: T): InstanceType<T>;
|
|
34
|
-
declare function intersection<T extends any[]>(types: T): UnionToIntersection<T[number]>;
|
|
35
|
-
type LiteralTypes = number | string | boolean | null | undefined;
|
|
36
|
-
declare function literalType<const T extends LiteralTypes>(literal: T): T;
|
|
37
|
-
declare function literalSelection<const T extends LiteralTypes>(literals: T[]): T;
|
|
38
|
-
declare function objectType(): Record<string, any>;
|
|
39
|
-
declare function objectType<const Keys extends string[]>(keys: Keys): ResolveOptionalEntries<KeyedObject<Keys>>;
|
|
40
|
-
declare function objectType<Shape extends {}>(shape: Shape): ResolveOptionalEntries<Shape>;
|
|
41
|
-
declare function strictObjectType<const Keys extends string[]>(keys: Keys): ResolveOptionalEntries<KeyedObject<Keys>>;
|
|
42
|
-
declare function strictObjectType<Shape extends {}>(shape: Shape): ResolveOptionalEntries<Shape>;
|
|
43
|
-
declare function promiseType(): Promise<void>;
|
|
44
|
-
declare function promiseType<T>(type: T): Promise<T>;
|
|
45
|
-
declare function recordType(): Record<PropertyKey, any>;
|
|
46
|
-
declare function recordType<V>(valueType: V): Record<PropertyKey, V>;
|
|
47
|
-
declare function tuple<const T extends any[]>(types: T): T;
|
|
48
|
-
declare function union<T extends any[]>(types: T): T[number];
|
|
49
|
-
declare function reactiveValueType(): ReactiveValue<any>;
|
|
50
|
-
declare function reactiveValueType<T>(type: T): ReactiveValue<T>;
|
|
51
|
-
declare function componentType(): typeof Component;
|
|
52
|
-
declare function ref(): HTMLElement | null;
|
|
53
|
-
declare function ref<T extends Constructor<HTMLElement>>(type: T): InstanceType<T> | null;
|
|
54
|
-
export declare const types: {
|
|
55
|
-
and: typeof intersection;
|
|
56
|
-
any: typeof anyType;
|
|
57
|
-
array: typeof arrayType;
|
|
58
|
-
boolean: typeof booleanType;
|
|
59
|
-
component: typeof componentType;
|
|
60
|
-
constructor: typeof constructorType;
|
|
61
|
-
customValidator: typeof customValidator;
|
|
62
|
-
function: typeof functionType;
|
|
63
|
-
instanceOf: typeof instanceType;
|
|
64
|
-
literal: typeof literalType;
|
|
65
|
-
number: typeof numberType;
|
|
66
|
-
object: typeof objectType;
|
|
67
|
-
or: typeof union;
|
|
68
|
-
promise: typeof promiseType;
|
|
69
|
-
record: typeof recordType;
|
|
70
|
-
ref: typeof ref;
|
|
71
|
-
selection: typeof literalSelection;
|
|
72
|
-
signal: typeof reactiveValueType;
|
|
73
|
-
strictObject: typeof strictObjectType;
|
|
74
|
-
string: typeof stringType;
|
|
75
|
-
tuple: typeof tuple;
|
|
76
|
-
};
|
|
77
|
-
export {};
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
export type Callback = (...args: any[]) => 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 class Markup extends String {
|
|
21
|
-
}
|
|
22
|
-
export declare function htmlEscape(str: any): Markup;
|
|
23
|
-
export declare function markup(strings: TemplateStringsArray, ...placeholders: unknown[]): Markup;
|
|
24
|
-
export declare function markup(value: string): Markup;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
export interface ValidationIssue {
|
|
2
|
-
message: string;
|
|
3
|
-
path?: PropertyKey[];
|
|
4
|
-
received?: any;
|
|
5
|
-
[K: string]: any;
|
|
6
|
-
}
|
|
7
|
-
export interface ValidationContext {
|
|
8
|
-
addIssue(issue: ValidationIssue): void;
|
|
9
|
-
isValid: boolean;
|
|
10
|
-
issueDepth: number;
|
|
11
|
-
mergeIssues(issues: ValidationIssue[]): void;
|
|
12
|
-
path: PropertyKey[];
|
|
13
|
-
validate(type: any): void;
|
|
14
|
-
value: any;
|
|
15
|
-
withIssues(issues: ValidationIssue[]): ValidationContext;
|
|
16
|
-
withKey(key: PropertyKey): ValidationContext;
|
|
17
|
-
}
|
|
18
|
-
export declare function assertType(value: any, validation: any, errorMessage?: string): void;
|
|
19
|
-
export declare function validateType(value: any, validation: any): ValidationIssue[];
|
package/dist/types/version.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare const version = "3.0.0-alpha.25";
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
|
|
3
|
-
// this is the "compile_owl_templates" command that owl makes available when
|
|
4
|
-
// installed as a node_module.
|
|
5
|
-
import { existsSync, mkdirSync, writeFileSync } from "fs";
|
|
6
|
-
import { dirname } from "path";
|
|
7
|
-
import { compileTemplates } from "../dist/compile_templates.mjs";
|
|
8
|
-
import { parseArgs } from "util";
|
|
9
|
-
|
|
10
|
-
const { values, positionals } = parseArgs({
|
|
11
|
-
allowPositionals: true,
|
|
12
|
-
options: {
|
|
13
|
-
output: {
|
|
14
|
-
type: "string",
|
|
15
|
-
short: "o",
|
|
16
|
-
default: "templates.js",
|
|
17
|
-
},
|
|
18
|
-
},
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
if (positionals.length) {
|
|
22
|
-
const result = await compileTemplates(positionals);
|
|
23
|
-
const outputPath = values.output;
|
|
24
|
-
const dir = dirname(outputPath);
|
|
25
|
-
if (!existsSync(dir)) {
|
|
26
|
-
mkdirSync(dir, { recursive: true });
|
|
27
|
-
}
|
|
28
|
-
writeFileSync(outputPath, result);
|
|
29
|
-
} else {
|
|
30
|
-
console.log("Please provide a path");
|
|
31
|
-
}
|