@zcomponent/core 1.29.0 → 2.0.0-alpha.2
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 +1 -0
- package/css/zcomponent.css +121 -122
- package/index.js +0 -3
- package/lib/actionbehavior.d.ts +3 -3
- package/lib/actionbehavior.js +20 -19
- package/lib/animation/animation.d.ts +13 -6
- package/lib/animation/animation.js +56 -43
- package/lib/animation/bezier.d.ts +6 -0
- package/lib/animation/bezier.js +8 -2
- package/lib/animation/clips/clip.d.ts +13 -1
- package/lib/animation/clips/clip.js +34 -14
- package/lib/animation/index.d.ts +4 -4
- package/lib/animation/index.js +4 -4
- package/lib/animation/layer.d.ts +9 -0
- package/lib/animation/layer.js +28 -12
- package/lib/animation/layerclip.d.ts +21 -0
- package/lib/animation/layerclip.js +82 -45
- package/lib/animation/tracks/cliptrack.d.ts +18 -0
- package/lib/animation/tracks/cliptrack.js +27 -6
- package/lib/animation/tracks/functiontrack.d.ts +9 -0
- package/lib/animation/tracks/functiontrack.js +16 -3
- package/lib/animation/tracks/propertytrack.d.ts +20 -1
- package/lib/animation/tracks/propertytrack.js +48 -11
- package/lib/animation/tracks/streamtrack.d.ts +18 -0
- package/lib/animation/tracks/streamtrack.js +32 -6
- package/lib/animation/tracks/track.d.ts +8 -2
- package/lib/animation/tracks/track.js +3 -2
- package/lib/behavior.js +13 -10
- package/lib/behaviors/ActivateState.d.ts +22 -24
- package/lib/behaviors/ActivateState.js +145 -35
- package/lib/behaviors/CallFunction.d.ts +2 -4
- package/lib/behaviors/CallFunction.js +69 -11
- package/lib/behaviors/ChangeRootScene.d.ts +35 -0
- package/lib/behaviors/ChangeRootScene.js +123 -0
- package/lib/behaviors/ConsoleLog.d.ts +6 -5
- package/lib/behaviors/ConsoleLog.js +95 -12
- package/lib/behaviors/DownloadSnapshot.d.ts +7 -12
- package/lib/behaviors/DownloadSnapshot.js +70 -19
- package/lib/behaviors/EmitComponentPropEvent.d.ts +1 -3
- package/lib/behaviors/EmitComponentPropEvent.js +80 -12
- package/lib/behaviors/LaunchURL.d.ts +5 -5
- package/lib/behaviors/LaunchURL.js +92 -10
- package/lib/behaviors/LogAnalyticsEvent.d.ts +10 -4
- package/lib/behaviors/LogAnalyticsEvent.js +88 -7
- package/lib/behaviors/PauseLayerClip.d.ts +7 -9
- package/lib/behaviors/PauseLayerClip.js +89 -21
- package/lib/behaviors/PlayLayerClip.d.ts +35 -32
- package/lib/behaviors/PlayLayerClip.js +202 -48
- package/lib/behaviors/PlaySound.d.ts +19 -25
- package/lib/behaviors/PlaySound.js +122 -28
- package/lib/behaviors/SetLayerOff.d.ts +7 -9
- package/lib/behaviors/SetLayerOff.js +88 -21
- package/lib/behaviors/ShareSnapshot.d.ts +5 -9
- package/lib/behaviors/ShareSnapshot.js +70 -17
- package/lib/behaviors/ShowTextAlert.d.ts +16 -29
- package/lib/behaviors/ShowTextAlert.js +116 -48
- package/lib/behaviors/TakeSnapshot.d.ts +22 -26
- package/lib/behaviors/TakeSnapshot.js +131 -56
- package/lib/behaviors/ToggleLayerClips.d.ts +45 -62
- package/lib/behaviors/ToggleLayerClips.js +233 -64
- package/lib/behaviors/stream/PauseStream.d.ts +5 -16
- package/lib/behaviors/stream/PauseStream.js +94 -34
- package/lib/behaviors/stream/PlayStream.d.ts +14 -27
- package/lib/behaviors/stream/PlayStream.js +123 -34
- package/lib/behaviors/stream/SeekStream.d.ts +8 -18
- package/lib/behaviors/stream/SeekStream.js +97 -31
- package/lib/behaviors/stream/StopStream.d.ts +6 -15
- package/lib/behaviors/stream/StopStream.js +89 -27
- package/lib/component.d.ts +36 -13
- package/lib/component.js +237 -151
- package/lib/components/AnimatedLoader.d.ts +51 -0
- package/lib/components/AnimatedLoader.js +159 -0
- package/lib/components/Audio.d.ts +35 -37
- package/lib/components/Audio.js +264 -151
- package/lib/components/AudioLayerSettings.d.ts +13 -11
- package/lib/components/AudioLayerSettings.js +76 -18
- package/lib/components/Children.d.ts +2 -1
- package/lib/components/Children.js +66 -13
- package/lib/components/ConditionalConstruct.d.ts +44 -0
- package/lib/components/ConditionalConstruct.js +142 -0
- package/lib/components/DefaultCookieConsent.d.ts +53 -73
- package/lib/components/DefaultCookieConsent.js +382 -264
- package/lib/components/DefaultLoader.d.ts +40 -28
- package/lib/components/DefaultLoader.js +198 -46
- package/lib/components/Gamepad.d.ts +5 -26
- package/lib/components/Gamepad.js +201 -65
- package/lib/components/LoaderScope.d.ts +15 -0
- package/lib/components/LoaderScope.js +71 -0
- package/lib/components/LongLoad.d.ts +11 -15
- package/lib/components/LongLoad.js +89 -34
- package/lib/components/SnapshotUI.d.ts +19 -24
- package/lib/components/SnapshotUI.js +202 -105
- package/lib/context.d.ts +23 -5
- package/lib/context.js +12 -6
- package/lib/contexts/analyticscontext.d.ts +12 -2
- package/lib/contexts/analyticscontext.js +68 -10
- package/lib/contexts/audiocontextcontext.d.ts +1 -1
- package/lib/contexts/audiocontextcontext.js +9 -8
- package/lib/contexts/canvascontext.d.ts +32 -18
- package/lib/contexts/canvascontext.js +195 -120
- package/lib/contexts/cookieconsentcontext.d.ts +38 -28
- package/lib/contexts/cookieconsentcontext.js +35 -32
- package/lib/contexts/documentflagmanager.js +15 -11
- package/lib/contexts/environmentcontext.d.ts +22 -6
- package/lib/contexts/environmentcontext.js +135 -21
- package/lib/contexts/gamepadcontext.d.ts +29 -26
- package/lib/contexts/gamepadcontext.js +46 -46
- package/lib/contexts/gesturecontext.d.ts +31 -6
- package/lib/contexts/gesturecontext.js +110 -85
- package/lib/contexts/globaltagcontext.d.ts +1 -1
- package/lib/contexts/globaltagcontext.js +8 -11
- package/lib/contexts/loadcontext.d.ts +45 -8
- package/lib/contexts/loadcontext.js +232 -82
- package/lib/contexts/orientationcontext.d.ts +13 -15
- package/lib/contexts/orientationcontext.js +150 -67
- package/lib/contexts/rootcomponentscontext.d.ts +16 -0
- package/lib/contexts/rootcomponentscontext.js +65 -0
- package/lib/contexts/snapshotContext.d.ts +0 -3
- package/lib/contexts/snapshotContext.js +78 -23
- package/lib/contexts/tagcontext.d.ts +5 -5
- package/lib/contexts/tagcontext.js +16 -16
- package/lib/contexts/textalertcontext.d.ts +1 -5
- package/lib/contexts/textalertcontext.js +1 -5
- package/lib/contexts/usereventcontext.d.ts +1 -1
- package/lib/contexts/usereventcontext.js +12 -12
- package/lib/data/animation.d.ts +10 -2
- package/lib/data/change.d.ts +1 -1
- package/lib/data/change.js +7 -0
- package/lib/data/core.d.ts +9 -1
- package/lib/data/index.d.ts +1 -1
- package/lib/data/index.js +1 -1
- package/lib/decorators.d.ts +348 -0
- package/lib/decorators.js +239 -0
- package/lib/decoratorutils.d.ts +3 -0
- package/lib/decoratorutils.js +8 -0
- package/lib/emitter.d.ts +15 -2
- package/lib/emitter.js +15 -6
- package/lib/entity.d.ts +43 -25
- package/lib/entity.js +104 -71
- package/lib/event.d.ts +2 -1
- package/lib/event.js +1 -4
- package/lib/groups.d.ts +18 -0
- package/lib/groups.js +19 -0
- package/lib/icons.d.ts +3372 -0
- package/lib/icons.js +1 -0
- package/lib/index.d.ts +18 -13
- package/lib/index.js +17 -13
- package/lib/inflate.d.ts +7 -7
- package/lib/inflate.js +5 -5
- package/lib/observable.d.ts +9 -2
- package/lib/observable.js +5 -4
- package/lib/observe.d.ts +18 -0
- package/lib/observe.js +177 -0
- package/lib/profile.d.ts +9 -5
- package/lib/profile.js +27 -17
- package/lib/selectors.d.ts +1 -1
- package/lib/selectors.js +5 -4
- package/lib/types.d.ts +161 -19
- package/lib/types.js +22 -1
- package/lib/values/values.d.ts +7 -8
- package/lib/values/values.js +1 -2
- package/lib/values/valuesmutator.d.ts +4 -1
- package/lib/values/valuesmutator.js +10 -8
- package/lib/zcomponent.d.ts +21 -10
- package/lib/zcomponent.js +717 -540
- package/package.json +22 -5
- package/lib/behaviors/ChangeCursor.d.ts +0 -39
- package/lib/behaviors/ChangeCursor.js +0 -44
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ActionBehavior } from '../actionbehavior';
|
|
2
2
|
/**
|
|
3
3
|
* Outputs a message to the console log.
|
|
4
|
-
*
|
|
5
4
|
* @zbehavior
|
|
6
5
|
* @zicon terminal
|
|
7
6
|
* @zgroup Actions
|
|
@@ -9,15 +8,17 @@ import { ActionBehavior } from '../actionbehavior';
|
|
|
9
8
|
export declare class ConsoleLog extends ActionBehavior {
|
|
10
9
|
/**
|
|
11
10
|
* The text to log
|
|
12
|
-
* @
|
|
11
|
+
* @default ""
|
|
13
12
|
*/
|
|
14
13
|
text: string;
|
|
15
14
|
/**
|
|
16
15
|
* If true, the event name will be logged in addition to the text
|
|
17
|
-
* @
|
|
18
|
-
* @zdefault true
|
|
16
|
+
* @default true
|
|
19
17
|
*/
|
|
20
18
|
includeEventName: boolean;
|
|
21
|
-
/** @zprop */
|
|
22
19
|
perform(): void;
|
|
20
|
+
/**
|
|
21
|
+
* @zui
|
|
22
|
+
*/
|
|
23
|
+
preview(): void;
|
|
23
24
|
}
|
|
@@ -1,19 +1,102 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
1
35
|
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
-
import {
|
|
36
|
+
import { zBehavior, zUI } from '../decorators';
|
|
37
|
+
import { BehaviorGroups } from '../groups';
|
|
3
38
|
/**
|
|
4
39
|
* Outputs a message to the console log.
|
|
5
|
-
*
|
|
6
40
|
* @zbehavior
|
|
7
41
|
* @zicon terminal
|
|
8
42
|
* @zgroup Actions
|
|
9
43
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
44
|
+
let ConsoleLog = (() => {
|
|
45
|
+
let _classDecorators = [zBehavior({ icon: 'terminal', group: BehaviorGroups.Actions, runAtDesignTime: true })];
|
|
46
|
+
let _classDescriptor;
|
|
47
|
+
let _classExtraInitializers = [];
|
|
48
|
+
let _classThis;
|
|
49
|
+
let _classSuper = ActionBehavior;
|
|
50
|
+
let _instanceExtraInitializers = [];
|
|
51
|
+
let _text_decorators;
|
|
52
|
+
let _text_initializers = [];
|
|
53
|
+
let _text_extraInitializers = [];
|
|
54
|
+
let _includeEventName_decorators;
|
|
55
|
+
let _includeEventName_initializers = [];
|
|
56
|
+
let _includeEventName_extraInitializers = [];
|
|
57
|
+
let _preview_decorators;
|
|
58
|
+
var ConsoleLog = class extends _classSuper {
|
|
59
|
+
static { _classThis = this; }
|
|
60
|
+
static {
|
|
61
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
62
|
+
_text_decorators = [zUI()];
|
|
63
|
+
_includeEventName_decorators = [zUI()];
|
|
64
|
+
_preview_decorators = [zUI()];
|
|
65
|
+
__esDecorate(this, null, _preview_decorators, { kind: "method", name: "preview", static: false, private: false, access: { has: obj => "preview" in obj, get: obj => obj.preview }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
66
|
+
__esDecorate(null, null, _text_decorators, { kind: "field", name: "text", static: false, private: false, access: { has: obj => "text" in obj, get: obj => obj.text, set: (obj, value) => { obj.text = value; } }, metadata: _metadata }, _text_initializers, _text_extraInitializers);
|
|
67
|
+
__esDecorate(null, null, _includeEventName_decorators, { kind: "field", name: "includeEventName", static: false, private: false, access: { has: obj => "includeEventName" in obj, get: obj => obj.includeEventName, set: (obj, value) => { obj.includeEventName = value; } }, metadata: _metadata }, _includeEventName_initializers, _includeEventName_extraInitializers);
|
|
68
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
69
|
+
ConsoleLog = _classThis = _classDescriptor.value;
|
|
70
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
71
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* The text to log
|
|
75
|
+
* @default ""
|
|
76
|
+
*/
|
|
77
|
+
text = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _text_initializers, ''));
|
|
78
|
+
/**
|
|
79
|
+
* If true, the event name will be logged in addition to the text
|
|
80
|
+
* @default true
|
|
81
|
+
*/
|
|
82
|
+
includeEventName = (__runInitializers(this, _text_extraInitializers), __runInitializers(this, _includeEventName_initializers, true));
|
|
83
|
+
perform() {
|
|
84
|
+
if (this.includeEventName)
|
|
85
|
+
console.log(this.constructorProps.event, this.text);
|
|
86
|
+
else
|
|
87
|
+
console.log(this.text);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* @zui
|
|
91
|
+
*/
|
|
92
|
+
preview() {
|
|
93
|
+
this.perform();
|
|
94
|
+
}
|
|
95
|
+
constructor() {
|
|
96
|
+
super(...arguments);
|
|
97
|
+
__runInitializers(this, _includeEventName_extraInitializers);
|
|
98
|
+
}
|
|
99
|
+
};
|
|
100
|
+
return ConsoleLog = _classThis;
|
|
101
|
+
})();
|
|
102
|
+
export { ConsoleLog };
|
|
@@ -1,25 +1,20 @@
|
|
|
1
|
-
import { ActionBehavior
|
|
2
|
-
import { Component } from '../component';
|
|
3
|
-
import { ContextManager } from '../context';
|
|
1
|
+
import { ActionBehavior } from '../actionbehavior';
|
|
4
2
|
import { Event } from '../event';
|
|
5
|
-
export type DownloadSnapshotProps = ActionBehaviorConstructorProps;
|
|
6
3
|
/**
|
|
7
4
|
* Behavior for downloading a captured canvas snapshot as an image.
|
|
8
|
-
*
|
|
9
5
|
* @zbehavior
|
|
10
6
|
* @zicon download
|
|
11
7
|
* @zgroup Actions
|
|
12
8
|
*/
|
|
13
|
-
export declare class DownloadSnapshot extends ActionBehavior
|
|
9
|
+
export declare class DownloadSnapshot extends ActionBehavior {
|
|
14
10
|
/**
|
|
15
11
|
* Event triggered when a snapshot is saved.
|
|
16
|
-
* @zui
|
|
17
12
|
*/
|
|
18
|
-
onSave: Event<[]>;
|
|
19
|
-
constructor(contextManager: ContextManager, instance: Component, props: DownloadSnapshotProps);
|
|
20
|
-
/** @zprop */
|
|
13
|
+
readonly onSave: Event<[]>;
|
|
21
14
|
perform(): void;
|
|
22
|
-
private
|
|
23
|
-
/**
|
|
15
|
+
private _download;
|
|
16
|
+
/**
|
|
17
|
+
* @zui
|
|
18
|
+
*/
|
|
24
19
|
preview(): void;
|
|
25
20
|
}
|
|
@@ -1,23 +1,75 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
1
35
|
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
-
import { registerBehaviorRunAtDesignTime } from '../behavior';
|
|
3
36
|
import { SnapshotContext } from '../contexts/snapshotContext';
|
|
37
|
+
import { zBehavior, zUI } from '../decorators';
|
|
4
38
|
import { Event } from '../event';
|
|
39
|
+
import { BehaviorGroups } from '../groups';
|
|
5
40
|
/**
|
|
6
41
|
* Behavior for downloading a captured canvas snapshot as an image.
|
|
7
|
-
*
|
|
8
42
|
* @zbehavior
|
|
9
43
|
* @zicon download
|
|
10
44
|
* @zgroup Actions
|
|
11
45
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
46
|
+
let DownloadSnapshot = (() => {
|
|
47
|
+
let _classDecorators = [zBehavior({ icon: 'download', group: BehaviorGroups.Actions, runAtDesignTime: true })];
|
|
48
|
+
let _classDescriptor;
|
|
49
|
+
let _classExtraInitializers = [];
|
|
50
|
+
let _classThis;
|
|
51
|
+
let _classSuper = ActionBehavior;
|
|
52
|
+
let _instanceExtraInitializers = [];
|
|
53
|
+
let _preview_decorators;
|
|
54
|
+
var DownloadSnapshot = class extends _classSuper {
|
|
55
|
+
static { _classThis = this; }
|
|
56
|
+
static {
|
|
57
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
58
|
+
_preview_decorators = [zUI()];
|
|
59
|
+
__esDecorate(this, null, _preview_decorators, { kind: "method", name: "preview", static: false, private: false, access: { has: obj => "preview" in obj, get: obj => obj.preview }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
60
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
61
|
+
DownloadSnapshot = _classThis = _classDescriptor.value;
|
|
62
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
63
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
64
|
+
}
|
|
15
65
|
/**
|
|
16
66
|
* Event triggered when a snapshot is saved.
|
|
17
|
-
* @zui
|
|
18
67
|
*/
|
|
19
|
-
|
|
20
|
-
|
|
68
|
+
onSave = (__runInitializers(this, _instanceExtraInitializers), new Event());
|
|
69
|
+
perform() {
|
|
70
|
+
this._download();
|
|
71
|
+
}
|
|
72
|
+
_download = () => {
|
|
21
73
|
const snapshotContext = this.contextManager.get(SnapshotContext);
|
|
22
74
|
const dataUrl = snapshotContext.canvasImage.value;
|
|
23
75
|
const link = document.createElement('a');
|
|
@@ -37,14 +89,13 @@ export class DownloadSnapshot extends ActionBehavior {
|
|
|
37
89
|
document.body.removeChild(link);
|
|
38
90
|
this.onSave.emit();
|
|
39
91
|
};
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
50
|
-
registerBehaviorRunAtDesignTime(DownloadSnapshot);
|
|
92
|
+
/**
|
|
93
|
+
* @zui
|
|
94
|
+
*/
|
|
95
|
+
preview() {
|
|
96
|
+
this.perform();
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
return DownloadSnapshot = _classThis;
|
|
100
|
+
})();
|
|
101
|
+
export { DownloadSnapshot };
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { ActionBehavior } from '../actionbehavior';
|
|
2
2
|
/**
|
|
3
3
|
* Calls emit on an event that's a prop of this ZComponent
|
|
4
|
-
*
|
|
5
4
|
* @zbehavior
|
|
6
5
|
* @zicon function
|
|
7
6
|
* @zgroup Actions
|
|
@@ -9,13 +8,12 @@ import { ActionBehavior } from '../actionbehavior';
|
|
|
9
8
|
export declare class EmitComponentPropEvent extends ActionBehavior {
|
|
10
9
|
/**
|
|
11
10
|
* The event to emit
|
|
12
|
-
* @
|
|
11
|
+
* @zui
|
|
13
12
|
* @ztype function-emit-component-prop-event
|
|
14
13
|
*/
|
|
15
14
|
eventToEmit: () => any;
|
|
16
15
|
/**
|
|
17
16
|
* @zui
|
|
18
|
-
* @zprop
|
|
19
17
|
*/
|
|
20
18
|
perform(): void;
|
|
21
19
|
}
|
|
@@ -1,19 +1,87 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
1
35
|
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
-
import {
|
|
36
|
+
import { zBehavior, zUI } from '../decorators';
|
|
37
|
+
import { BehaviorGroups } from '../groups';
|
|
3
38
|
/**
|
|
4
39
|
* Calls emit on an event that's a prop of this ZComponent
|
|
5
|
-
*
|
|
6
40
|
* @zbehavior
|
|
7
41
|
* @zicon function
|
|
8
42
|
* @zgroup Actions
|
|
9
43
|
*/
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
44
|
+
let EmitComponentPropEvent = (() => {
|
|
45
|
+
let _classDecorators = [zBehavior({ icon: 'function', group: BehaviorGroups.Actions, runAtDesignTime: true })];
|
|
46
|
+
let _classDescriptor;
|
|
47
|
+
let _classExtraInitializers = [];
|
|
48
|
+
let _classThis;
|
|
49
|
+
let _classSuper = ActionBehavior;
|
|
50
|
+
let _instanceExtraInitializers = [];
|
|
51
|
+
let _eventToEmit_decorators;
|
|
52
|
+
let _eventToEmit_initializers = [];
|
|
53
|
+
let _eventToEmit_extraInitializers = [];
|
|
54
|
+
let _perform_decorators;
|
|
55
|
+
var EmitComponentPropEvent = class extends _classSuper {
|
|
56
|
+
static { _classThis = this; }
|
|
57
|
+
static {
|
|
58
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
59
|
+
_eventToEmit_decorators = [zUI({ type: 'function-emit-component-prop-event' })];
|
|
60
|
+
_perform_decorators = [zUI()];
|
|
61
|
+
__esDecorate(this, null, _perform_decorators, { kind: "method", name: "perform", static: false, private: false, access: { has: obj => "perform" in obj, get: obj => obj.perform }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
62
|
+
__esDecorate(null, null, _eventToEmit_decorators, { kind: "field", name: "eventToEmit", static: false, private: false, access: { has: obj => "eventToEmit" in obj, get: obj => obj.eventToEmit, set: (obj, value) => { obj.eventToEmit = value; } }, metadata: _metadata }, _eventToEmit_initializers, _eventToEmit_extraInitializers);
|
|
63
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
64
|
+
EmitComponentPropEvent = _classThis = _classDescriptor.value;
|
|
65
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
66
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The event to emit
|
|
70
|
+
* @zui
|
|
71
|
+
* @ztype function-emit-component-prop-event
|
|
72
|
+
*/
|
|
73
|
+
eventToEmit = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _eventToEmit_initializers, void 0));
|
|
74
|
+
/**
|
|
75
|
+
* @zui
|
|
76
|
+
*/
|
|
77
|
+
perform() {
|
|
78
|
+
this.eventToEmit();
|
|
79
|
+
}
|
|
80
|
+
constructor() {
|
|
81
|
+
super(...arguments);
|
|
82
|
+
__runInitializers(this, _eventToEmit_extraInitializers);
|
|
83
|
+
}
|
|
84
|
+
};
|
|
85
|
+
return EmitComponentPropEvent = _classThis;
|
|
86
|
+
})();
|
|
87
|
+
export { EmitComponentPropEvent };
|
|
@@ -3,7 +3,6 @@ import { ActionBehavior } from '../actionbehavior';
|
|
|
3
3
|
* Navigates the user to the provided URL.
|
|
4
4
|
*
|
|
5
5
|
* **Important Note**: Safari on iOS will not open URLs in new tabs for pointer events except `onPointerUp`.
|
|
6
|
-
*
|
|
7
6
|
* @zbehavior
|
|
8
7
|
* @zicon open_in_new
|
|
9
8
|
* @zgroup Actions
|
|
@@ -11,15 +10,16 @@ import { ActionBehavior } from '../actionbehavior';
|
|
|
11
10
|
export declare class LaunchURL extends ActionBehavior {
|
|
12
11
|
/**
|
|
13
12
|
* The URL to open
|
|
14
|
-
* @
|
|
13
|
+
* @default "https://www.example.com/"
|
|
15
14
|
*/
|
|
16
15
|
url: string;
|
|
17
16
|
/**
|
|
18
17
|
* If true, the URL will be opened in a new tab (using target '_blank')
|
|
19
|
-
* @
|
|
20
|
-
* @zdefault true
|
|
18
|
+
* @default true
|
|
21
19
|
*/
|
|
22
20
|
openInNew: boolean;
|
|
23
|
-
/**
|
|
21
|
+
/**
|
|
22
|
+
* @zui
|
|
23
|
+
*/
|
|
24
24
|
perform(): void;
|
|
25
25
|
}
|
|
@@ -1,19 +1,101 @@
|
|
|
1
|
+
var __runInitializers = (this && this.__runInitializers) || function (thisArg, initializers, value) {
|
|
2
|
+
var useValue = arguments.length > 2;
|
|
3
|
+
for (var i = 0; i < initializers.length; i++) {
|
|
4
|
+
value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);
|
|
5
|
+
}
|
|
6
|
+
return useValue ? value : void 0;
|
|
7
|
+
};
|
|
8
|
+
var __esDecorate = (this && this.__esDecorate) || function (ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {
|
|
9
|
+
function accept(f) { if (f !== void 0 && typeof f !== "function") throw new TypeError("Function expected"); return f; }
|
|
10
|
+
var kind = contextIn.kind, key = kind === "getter" ? "get" : kind === "setter" ? "set" : "value";
|
|
11
|
+
var target = !descriptorIn && ctor ? contextIn["static"] ? ctor : ctor.prototype : null;
|
|
12
|
+
var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});
|
|
13
|
+
var _, done = false;
|
|
14
|
+
for (var i = decorators.length - 1; i >= 0; i--) {
|
|
15
|
+
var context = {};
|
|
16
|
+
for (var p in contextIn) context[p] = p === "access" ? {} : contextIn[p];
|
|
17
|
+
for (var p in contextIn.access) context.access[p] = contextIn.access[p];
|
|
18
|
+
context.addInitializer = function (f) { if (done) throw new TypeError("Cannot add initializers after decoration has completed"); extraInitializers.push(accept(f || null)); };
|
|
19
|
+
var result = (0, decorators[i])(kind === "accessor" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);
|
|
20
|
+
if (kind === "accessor") {
|
|
21
|
+
if (result === void 0) continue;
|
|
22
|
+
if (result === null || typeof result !== "object") throw new TypeError("Object expected");
|
|
23
|
+
if (_ = accept(result.get)) descriptor.get = _;
|
|
24
|
+
if (_ = accept(result.set)) descriptor.set = _;
|
|
25
|
+
if (_ = accept(result.init)) initializers.unshift(_);
|
|
26
|
+
}
|
|
27
|
+
else if (_ = accept(result)) {
|
|
28
|
+
if (kind === "field") initializers.unshift(_);
|
|
29
|
+
else descriptor[key] = _;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
if (target) Object.defineProperty(target, contextIn.name, descriptor);
|
|
33
|
+
done = true;
|
|
34
|
+
};
|
|
1
35
|
import { ActionBehavior } from '../actionbehavior';
|
|
36
|
+
import { zBehavior, zUI } from '../decorators';
|
|
37
|
+
import { BehaviorGroups } from '../groups';
|
|
2
38
|
/**
|
|
3
39
|
* Navigates the user to the provided URL.
|
|
4
40
|
*
|
|
5
41
|
* **Important Note**: Safari on iOS will not open URLs in new tabs for pointer events except `onPointerUp`.
|
|
6
|
-
*
|
|
7
42
|
* @zbehavior
|
|
8
43
|
* @zicon open_in_new
|
|
9
44
|
* @zgroup Actions
|
|
10
45
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
46
|
+
let LaunchURL = (() => {
|
|
47
|
+
let _classDecorators = [zBehavior({ icon: 'open_in_new', group: BehaviorGroups.Actions, runAtDesignTime: true })];
|
|
48
|
+
let _classDescriptor;
|
|
49
|
+
let _classExtraInitializers = [];
|
|
50
|
+
let _classThis;
|
|
51
|
+
let _classSuper = ActionBehavior;
|
|
52
|
+
let _instanceExtraInitializers = [];
|
|
53
|
+
let _url_decorators;
|
|
54
|
+
let _url_initializers = [];
|
|
55
|
+
let _url_extraInitializers = [];
|
|
56
|
+
let _openInNew_decorators;
|
|
57
|
+
let _openInNew_initializers = [];
|
|
58
|
+
let _openInNew_extraInitializers = [];
|
|
59
|
+
let _perform_decorators;
|
|
60
|
+
var LaunchURL = class extends _classSuper {
|
|
61
|
+
static { _classThis = this; }
|
|
62
|
+
static {
|
|
63
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
64
|
+
_url_decorators = [zUI()];
|
|
65
|
+
_openInNew_decorators = [zUI()];
|
|
66
|
+
_perform_decorators = [zUI()];
|
|
67
|
+
__esDecorate(this, null, _perform_decorators, { kind: "method", name: "perform", static: false, private: false, access: { has: obj => "perform" in obj, get: obj => obj.perform }, metadata: _metadata }, null, _instanceExtraInitializers);
|
|
68
|
+
__esDecorate(null, null, _url_decorators, { kind: "field", name: "url", static: false, private: false, access: { has: obj => "url" in obj, get: obj => obj.url, set: (obj, value) => { obj.url = value; } }, metadata: _metadata }, _url_initializers, _url_extraInitializers);
|
|
69
|
+
__esDecorate(null, null, _openInNew_decorators, { kind: "field", name: "openInNew", static: false, private: false, access: { has: obj => "openInNew" in obj, get: obj => obj.openInNew, set: (obj, value) => { obj.openInNew = value; } }, metadata: _metadata }, _openInNew_initializers, _openInNew_extraInitializers);
|
|
70
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
71
|
+
LaunchURL = _classThis = _classDescriptor.value;
|
|
72
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
73
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* The URL to open
|
|
77
|
+
* @default "https://www.example.com/"
|
|
78
|
+
*/
|
|
79
|
+
url = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _url_initializers, 'https://www.example.com/'));
|
|
80
|
+
/**
|
|
81
|
+
* If true, the URL will be opened in a new tab (using target '_blank')
|
|
82
|
+
* @default true
|
|
83
|
+
*/
|
|
84
|
+
openInNew = (__runInitializers(this, _url_extraInitializers), __runInitializers(this, _openInNew_initializers, true));
|
|
85
|
+
/**
|
|
86
|
+
* @zui
|
|
87
|
+
*/
|
|
88
|
+
perform() {
|
|
89
|
+
if (this.openInNew ?? true)
|
|
90
|
+
window.open(this.url, '_blank', 'noopener noreferrer');
|
|
91
|
+
else
|
|
92
|
+
window.location.href = this.url;
|
|
93
|
+
}
|
|
94
|
+
constructor() {
|
|
95
|
+
super(...arguments);
|
|
96
|
+
__runInitializers(this, _openInNew_extraInitializers);
|
|
97
|
+
}
|
|
98
|
+
};
|
|
99
|
+
return LaunchURL = _classThis;
|
|
100
|
+
})();
|
|
101
|
+
export { LaunchURL };
|
|
@@ -3,16 +3,22 @@ import { ActionBehavior } from '../actionbehavior';
|
|
|
3
3
|
* Logs an event through the currently configured analytics provider(s).
|
|
4
4
|
*
|
|
5
5
|
* Note: you must have added an analytics provider to the Hierarchy in one of your components for this behavior to have any effect.
|
|
6
|
-
*
|
|
7
6
|
* @zbehavior
|
|
8
7
|
* @zicon analytics
|
|
9
8
|
* @zgroup Actions
|
|
10
9
|
*/
|
|
11
10
|
export declare class LogAnalyticsEvent extends ActionBehavior {
|
|
12
|
-
/**
|
|
11
|
+
/**
|
|
12
|
+
* The name of the event to log
|
|
13
|
+
* @default ""
|
|
14
|
+
*/
|
|
13
15
|
name: string;
|
|
14
|
-
/**
|
|
16
|
+
/**
|
|
17
|
+
* The parameters to log with the event
|
|
18
|
+
*/
|
|
15
19
|
params: any;
|
|
16
|
-
/**
|
|
20
|
+
/**
|
|
21
|
+
* @zui
|
|
22
|
+
*/
|
|
17
23
|
perform(): void;
|
|
18
24
|
}
|