Comparing version 0.5.53 to 0.5.54
{ | ||
"name": "aurumjs", | ||
"version": "0.5.53", | ||
"version": "0.5.54", | ||
"description": "Stream based declarative DOM rendering library for javascript", | ||
@@ -5,0 +5,0 @@ "main": "prebuilt/cjs/aurumjs.js", |
@@ -78,4 +78,5 @@ import { HTMLNodeProps } from '../builtin_compoents/dom_adapter'; | ||
export interface MetaProps extends HTMLNodeProps<HTMLMetaElement> { | ||
['http-equiv']?: string; | ||
content?: string; | ||
['http-equiv']?: AttributeValue; | ||
['charset']?: AttributeValue; | ||
content?: AttributeValue; | ||
} | ||
@@ -188,2 +189,3 @@ /** | ||
noModule?: AttributeValue; | ||
crossorigin?: AttributeValue; | ||
type?: AttributeValue; | ||
@@ -190,0 +192,0 @@ } |
@@ -168,3 +168,3 @@ "use strict"; | ||
*/ | ||
exports.Meta = dom_adapter_1.DomNodeCreator('meta'); | ||
exports.Meta = dom_adapter_1.DomNodeCreator('meta', ['http-equiv', 'charset']); | ||
/** | ||
@@ -271,3 +271,3 @@ * @internal | ||
*/ | ||
exports.Script = dom_adapter_1.DomNodeCreator('script', ['src', 'async', 'defer', 'integrity', 'noModule', 'type']); | ||
exports.Script = dom_adapter_1.DomNodeCreator('script', ['src', 'async', 'defer', 'integrity', 'noModule', 'type', 'crossorigin']); | ||
/** | ||
@@ -274,0 +274,0 @@ * @internal |
@@ -255,2 +255,7 @@ import { AurumServerInfo } from '../aurum_server/aurum_server_client'; | ||
forEach(callbackfn: (value: T, index: number, array: T[]) => void): void; | ||
reverse(cancellationToken?: CancellationToken): ReversedArrayView<T>; | ||
sort(comparator: (a: T, b: T) => number, dependencies: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): SortedArrayView<T>; | ||
map<D>(mapper: (data: T) => D, dependencies: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): MappedArrayView<T, D>; | ||
unique(cancellationToken?: CancellationToken): UniqueArrayView<T>; | ||
filter(callback: Predicate<T>, dependencies: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): FilteredArrayView<T>; | ||
} | ||
@@ -311,2 +316,3 @@ export declare class ArrayDataSource<T> implements ReadOnlyArrayDataSource<T> { | ||
sort(comparator: (a: T, b: T) => number, dependencies?: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): SortedArrayView<T>; | ||
slice(start: number | DataSource<number>, end?: number | DataSource<number>, cancellationToken?: CancellationToken): SlicedArrayView<T>; | ||
map<D>(mapper: (data: T) => D, dependencies?: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): MappedArrayView<T, D>; | ||
@@ -329,2 +335,5 @@ unique(cancellationToken?: CancellationToken): UniqueArrayView<T>; | ||
} | ||
export declare class SlicedArrayView<T> extends ArrayDataSource<T> { | ||
constructor(parent: ArrayDataSource<T>, start: DataSource<number>, end: DataSource<number>, cancellationToken?: CancellationToken, name?: string); | ||
} | ||
export declare class UniqueArrayView<T> extends ArrayDataSource<T> { | ||
@@ -331,0 +340,0 @@ constructor(parent: ArrayDataSource<T>, cancellationToken?: CancellationToken, name?: string); |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.processTransform = exports.FilteredArrayView = exports.SortedArrayView = exports.UniqueArrayView = exports.ReversedArrayView = exports.MappedArrayView = exports.ArrayDataSource = exports.DataSource = void 0; | ||
exports.processTransform = exports.FilteredArrayView = exports.SortedArrayView = exports.UniqueArrayView = exports.SlicedArrayView = exports.ReversedArrayView = exports.MappedArrayView = exports.ArrayDataSource = exports.DataSource = void 0; | ||
const aurum_server_client_1 = require("../aurum_server/aurum_server_client"); | ||
@@ -585,2 +585,14 @@ const debug_mode_1 = require("../debug_mode"); | ||
} | ||
slice(start, end, cancellationToken) { | ||
if (typeof start === 'number') { | ||
start = new DataSource(start); | ||
} | ||
if (typeof end === 'number') { | ||
end = new DataSource(end); | ||
} | ||
if (end === undefined) { | ||
end = this.length; | ||
} | ||
return new SlicedArrayView(this, start, end, cancellationToken, this.name + '.slice()'); | ||
} | ||
map(mapper, dependencies = [], cancellationToken) { | ||
@@ -747,2 +759,29 @@ const view = new MappedArrayView(this, mapper, cancellationToken, this.name + '.map()'); | ||
exports.ReversedArrayView = ReversedArrayView; | ||
class SlicedArrayView extends ArrayDataSource { | ||
constructor(parent, start, end, cancellationToken = new cancellation_token_1.CancellationToken(), name) { | ||
const initial = parent.getData().slice(start.value, end.value); | ||
super(initial, name); | ||
start.listen(() => this.merge(parent.getData().slice(start.value, end.value)), cancellationToken); | ||
end.listen(() => this.merge(parent.getData().slice(start.value, end.value)), cancellationToken); | ||
parent.listen((change) => { | ||
switch (change.operationDetailed) { | ||
case 'removeLeft': | ||
case 'removeRight': | ||
case 'remove': | ||
case 'append': | ||
case 'prepend': | ||
case 'insert': | ||
case 'swap': | ||
case 'replace': | ||
case 'merge': | ||
this.merge(parent.getData().slice(start.value, end.value)); | ||
break; | ||
case 'clear': | ||
this.clear(); | ||
break; | ||
} | ||
}, cancellationToken); | ||
} | ||
} | ||
exports.SlicedArrayView = SlicedArrayView; | ||
class UniqueArrayView extends ArrayDataSource { | ||
@@ -749,0 +788,0 @@ constructor(parent, cancellationToken = new cancellation_token_1.CancellationToken(), name) { |
@@ -78,4 +78,5 @@ import { HTMLNodeProps } from '../builtin_compoents/dom_adapter'; | ||
export interface MetaProps extends HTMLNodeProps<HTMLMetaElement> { | ||
['http-equiv']?: string; | ||
content?: string; | ||
['http-equiv']?: AttributeValue; | ||
['charset']?: AttributeValue; | ||
content?: AttributeValue; | ||
} | ||
@@ -188,2 +189,3 @@ /** | ||
noModule?: AttributeValue; | ||
crossorigin?: AttributeValue; | ||
type?: AttributeValue; | ||
@@ -190,0 +192,0 @@ } |
@@ -165,3 +165,3 @@ import { DomNodeCreator } from '../builtin_compoents/dom_adapter'; | ||
*/ | ||
export const Meta = DomNodeCreator('meta'); | ||
export const Meta = DomNodeCreator('meta', ['http-equiv', 'charset']); | ||
/** | ||
@@ -268,3 +268,3 @@ * @internal | ||
*/ | ||
export const Script = DomNodeCreator('script', ['src', 'async', 'defer', 'integrity', 'noModule', 'type']); | ||
export const Script = DomNodeCreator('script', ['src', 'async', 'defer', 'integrity', 'noModule', 'type', 'crossorigin']); | ||
/** | ||
@@ -271,0 +271,0 @@ * @internal |
@@ -255,2 +255,7 @@ import { AurumServerInfo } from '../aurum_server/aurum_server_client'; | ||
forEach(callbackfn: (value: T, index: number, array: T[]) => void): void; | ||
reverse(cancellationToken?: CancellationToken): ReversedArrayView<T>; | ||
sort(comparator: (a: T, b: T) => number, dependencies: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): SortedArrayView<T>; | ||
map<D>(mapper: (data: T) => D, dependencies: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): MappedArrayView<T, D>; | ||
unique(cancellationToken?: CancellationToken): UniqueArrayView<T>; | ||
filter(callback: Predicate<T>, dependencies: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): FilteredArrayView<T>; | ||
} | ||
@@ -311,2 +316,3 @@ export declare class ArrayDataSource<T> implements ReadOnlyArrayDataSource<T> { | ||
sort(comparator: (a: T, b: T) => number, dependencies?: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): SortedArrayView<T>; | ||
slice(start: number | DataSource<number>, end?: number | DataSource<number>, cancellationToken?: CancellationToken): SlicedArrayView<T>; | ||
map<D>(mapper: (data: T) => D, dependencies?: ReadOnlyDataSource<any>[], cancellationToken?: CancellationToken): MappedArrayView<T, D>; | ||
@@ -329,2 +335,5 @@ unique(cancellationToken?: CancellationToken): UniqueArrayView<T>; | ||
} | ||
export declare class SlicedArrayView<T> extends ArrayDataSource<T> { | ||
constructor(parent: ArrayDataSource<T>, start: DataSource<number>, end: DataSource<number>, cancellationToken?: CancellationToken, name?: string); | ||
} | ||
export declare class UniqueArrayView<T> extends ArrayDataSource<T> { | ||
@@ -331,0 +340,0 @@ constructor(parent: ArrayDataSource<T>, cancellationToken?: CancellationToken, name?: string); |
@@ -580,2 +580,14 @@ import { syncArrayDataSource, syncDataSource } from '../aurum_server/aurum_server_client'; | ||
} | ||
slice(start, end, cancellationToken) { | ||
if (typeof start === 'number') { | ||
start = new DataSource(start); | ||
} | ||
if (typeof end === 'number') { | ||
end = new DataSource(end); | ||
} | ||
if (end === undefined) { | ||
end = this.length; | ||
} | ||
return new SlicedArrayView(this, start, end, cancellationToken, this.name + '.slice()'); | ||
} | ||
map(mapper, dependencies = [], cancellationToken) { | ||
@@ -739,2 +751,28 @@ const view = new MappedArrayView(this, mapper, cancellationToken, this.name + '.map()'); | ||
} | ||
export class SlicedArrayView extends ArrayDataSource { | ||
constructor(parent, start, end, cancellationToken = new CancellationToken(), name) { | ||
const initial = parent.getData().slice(start.value, end.value); | ||
super(initial, name); | ||
start.listen(() => this.merge(parent.getData().slice(start.value, end.value)), cancellationToken); | ||
end.listen(() => this.merge(parent.getData().slice(start.value, end.value)), cancellationToken); | ||
parent.listen((change) => { | ||
switch (change.operationDetailed) { | ||
case 'removeLeft': | ||
case 'removeRight': | ||
case 'remove': | ||
case 'append': | ||
case 'prepend': | ||
case 'insert': | ||
case 'swap': | ||
case 'replace': | ||
case 'merge': | ||
this.merge(parent.getData().slice(start.value, end.value)); | ||
break; | ||
case 'clear': | ||
this.clear(); | ||
break; | ||
} | ||
}, cancellationToken); | ||
} | ||
} | ||
export class UniqueArrayView extends ArrayDataSource { | ||
@@ -741,0 +779,0 @@ constructor(parent, cancellationToken = new CancellationToken(), name) { |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
5501430
137225