@zcomponent/core 2.0.0-alpha.1 → 2.0.0-alpha.3
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/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 +33 -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 +44 -7
- 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 +84 -67
- package/lib/behaviors/ChangeCursor.d.ts +0 -39
- package/lib/behaviors/ChangeCursor.js +0 -44
|
@@ -1,22 +1,18 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Component } from '../component';
|
|
3
|
-
import { ContextManager } from '../context';
|
|
1
|
+
import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
|
|
4
2
|
import { Event } from '../event';
|
|
5
3
|
export type ShareCanvasProps = ActionBehaviorConstructorProps;
|
|
6
4
|
/**
|
|
7
5
|
* Shares the captured canvas using the Web Share API.
|
|
8
|
-
*
|
|
9
6
|
* @zbehavior
|
|
10
7
|
* @zicon share
|
|
11
8
|
* @zgroup Actions
|
|
12
9
|
*/
|
|
13
10
|
export declare class ShareSnapshot extends ActionBehavior<ShareCanvasProps> {
|
|
14
|
-
|
|
15
|
-
onShare: Event<[]>;
|
|
16
|
-
constructor(contextManager: ContextManager, instance: Component, props: ShareCanvasProps);
|
|
17
|
-
/** @zprop */
|
|
11
|
+
readonly onShare: Event<[]>;
|
|
18
12
|
perform(): void;
|
|
19
13
|
private share;
|
|
20
|
-
/**
|
|
14
|
+
/**
|
|
15
|
+
* @zui
|
|
16
|
+
*/
|
|
21
17
|
preview(): void;
|
|
22
18
|
}
|
|
@@ -1,19 +1,72 @@
|
|
|
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
36
|
import { SnapshotContext } from '../contexts/snapshotContext';
|
|
37
|
+
import { zBehavior, zUI } from '../decorators';
|
|
3
38
|
import { Event } from '../event';
|
|
39
|
+
import { BehaviorGroups } from '../groups';
|
|
4
40
|
/**
|
|
5
41
|
* Shares the captured canvas using the Web Share API.
|
|
6
|
-
*
|
|
7
42
|
* @zbehavior
|
|
8
43
|
* @zicon share
|
|
9
44
|
* @zgroup Actions
|
|
10
45
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
46
|
+
let ShareSnapshot = (() => {
|
|
47
|
+
let _classDecorators = [zBehavior({ icon: 'share', group: BehaviorGroups.Actions })];
|
|
48
|
+
let _classDescriptor;
|
|
49
|
+
let _classExtraInitializers = [];
|
|
50
|
+
let _classThis;
|
|
51
|
+
let _classSuper = ActionBehavior;
|
|
52
|
+
let _instanceExtraInitializers = [];
|
|
53
|
+
let _preview_decorators;
|
|
54
|
+
var ShareSnapshot = 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
|
+
ShareSnapshot = _classThis = _classDescriptor.value;
|
|
62
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
63
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
64
|
+
}
|
|
65
|
+
onShare = (__runInitializers(this, _instanceExtraInitializers), new Event());
|
|
66
|
+
perform() {
|
|
67
|
+
this.share();
|
|
68
|
+
}
|
|
69
|
+
share = async () => {
|
|
17
70
|
const sctx = this.contextManager.get(SnapshotContext);
|
|
18
71
|
const snapshotContext = this.contextManager.get(SnapshotContext);
|
|
19
72
|
if (sctx.shareAPISupported.value === false) {
|
|
@@ -32,13 +85,13 @@ export class ShareSnapshot extends ActionBehavior {
|
|
|
32
85
|
console.error('Error - Sharing', err);
|
|
33
86
|
}
|
|
34
87
|
};
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
}
|
|
88
|
+
/**
|
|
89
|
+
* @zui
|
|
90
|
+
*/
|
|
91
|
+
preview() {
|
|
92
|
+
this.perform();
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
return ShareSnapshot = _classThis;
|
|
96
|
+
})();
|
|
97
|
+
export { ShareSnapshot };
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
import { ActionBehavior } from '../actionbehavior';
|
|
2
|
-
import { Observable } from '../observable';
|
|
3
2
|
/**
|
|
4
3
|
* Displays a pop-up text alert on screen.
|
|
5
|
-
*
|
|
6
4
|
* @zbehavior
|
|
7
5
|
* @zicon sms
|
|
8
6
|
* @zgroup Actions
|
|
@@ -10,56 +8,45 @@ import { Observable } from '../observable';
|
|
|
10
8
|
export declare class ShowTextAlert extends ActionBehavior {
|
|
11
9
|
/**
|
|
12
10
|
* The text to show in the alert
|
|
13
|
-
* @
|
|
14
|
-
* @zgroup ShowTextAlert
|
|
15
|
-
* @zgrouppriority 20
|
|
11
|
+
* @default ""
|
|
16
12
|
*/
|
|
17
|
-
text:
|
|
13
|
+
text: string;
|
|
18
14
|
/**
|
|
19
15
|
* The time (in milliseconds) that the text alert should remain on screen
|
|
20
|
-
*
|
|
21
|
-
* @
|
|
22
|
-
* @zgroup Appearance
|
|
23
|
-
* @zgrouppriority 10
|
|
24
|
-
* @zdefault 3000
|
|
16
|
+
* @default 3000
|
|
17
|
+
* @zui
|
|
25
18
|
* @ztype time-milliseconds
|
|
26
19
|
*/
|
|
27
|
-
timeout:
|
|
20
|
+
timeout: number;
|
|
28
21
|
/**
|
|
29
22
|
* The color of the background of the text alert
|
|
30
|
-
*
|
|
31
|
-
* @
|
|
23
|
+
* @default "#000000"
|
|
24
|
+
* @zui
|
|
32
25
|
* @zgroup Appearance
|
|
33
26
|
* @zgrouppriority 10
|
|
34
|
-
* @zdefault black
|
|
35
27
|
* @ztype color-hex
|
|
36
28
|
*/
|
|
37
|
-
backgroundColor:
|
|
29
|
+
backgroundColor: string;
|
|
38
30
|
/**
|
|
39
31
|
* The color of the text of the text alert
|
|
40
|
-
*
|
|
41
|
-
* @
|
|
32
|
+
* @default "#ffffff"
|
|
33
|
+
* @zui
|
|
42
34
|
* @zgroup Appearance
|
|
43
35
|
* @zgrouppriority 10
|
|
44
|
-
* @zdefault #ffffff
|
|
45
36
|
* @ztype color-hex
|
|
46
37
|
*/
|
|
47
|
-
textColor:
|
|
38
|
+
textColor: string;
|
|
48
39
|
/**
|
|
49
40
|
* Additional CSS class names to add to the alert DOM element
|
|
50
|
-
*
|
|
51
|
-
* @
|
|
41
|
+
* @default []
|
|
42
|
+
* @zui
|
|
52
43
|
* @zgroup Appearance
|
|
53
44
|
* @zgrouppriority 10
|
|
54
|
-
* @zdefault []
|
|
55
45
|
*/
|
|
56
|
-
classNames:
|
|
46
|
+
classNames: string[];
|
|
47
|
+
perform(): void;
|
|
57
48
|
/**
|
|
58
|
-
*
|
|
59
|
-
*
|
|
60
|
-
* @zprop
|
|
49
|
+
* @zui
|
|
61
50
|
*/
|
|
62
|
-
perform(): void;
|
|
63
|
-
/** @zui */
|
|
64
51
|
preview(): void;
|
|
65
52
|
}
|
|
@@ -1,80 +1,148 @@
|
|
|
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 { showTextAlert } from '../contexts/textalertcontext';
|
|
4
|
-
import {
|
|
37
|
+
import { zBehavior, zUI } from '../decorators';
|
|
38
|
+
import { BehaviorGroups, PropGroups } from '../groups';
|
|
5
39
|
/**
|
|
6
40
|
* Displays a pop-up text alert on screen.
|
|
7
|
-
*
|
|
8
41
|
* @zbehavior
|
|
9
42
|
* @zicon sms
|
|
10
43
|
* @zgroup Actions
|
|
11
44
|
*/
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
45
|
+
let ShowTextAlert = (() => {
|
|
46
|
+
let _classDecorators = [zBehavior({ icon: 'sms', group: BehaviorGroups.Actions, runAtDesignTime: true })];
|
|
47
|
+
let _classDescriptor;
|
|
48
|
+
let _classExtraInitializers = [];
|
|
49
|
+
let _classThis;
|
|
50
|
+
let _classSuper = ActionBehavior;
|
|
51
|
+
let _instanceExtraInitializers = [];
|
|
52
|
+
let _text_decorators;
|
|
53
|
+
let _text_initializers = [];
|
|
54
|
+
let _text_extraInitializers = [];
|
|
55
|
+
let _timeout_decorators;
|
|
56
|
+
let _timeout_initializers = [];
|
|
57
|
+
let _timeout_extraInitializers = [];
|
|
58
|
+
let _backgroundColor_decorators;
|
|
59
|
+
let _backgroundColor_initializers = [];
|
|
60
|
+
let _backgroundColor_extraInitializers = [];
|
|
61
|
+
let _textColor_decorators;
|
|
62
|
+
let _textColor_initializers = [];
|
|
63
|
+
let _textColor_extraInitializers = [];
|
|
64
|
+
let _classNames_decorators;
|
|
65
|
+
let _classNames_initializers = [];
|
|
66
|
+
let _classNames_extraInitializers = [];
|
|
67
|
+
let _preview_decorators;
|
|
68
|
+
var ShowTextAlert = class extends _classSuper {
|
|
69
|
+
static { _classThis = this; }
|
|
70
|
+
static {
|
|
71
|
+
const _metadata = typeof Symbol === "function" && Symbol.metadata ? Object.create(_classSuper[Symbol.metadata] ?? null) : void 0;
|
|
72
|
+
_text_decorators = [zUI()];
|
|
73
|
+
_timeout_decorators = [zUI({ type: 'time-milliseconds' })];
|
|
74
|
+
_backgroundColor_decorators = [zUI({ group: PropGroups.Appearance, type: 'color-hex' })];
|
|
75
|
+
_textColor_decorators = [zUI({ group: PropGroups.Appearance, type: 'color-hex' })];
|
|
76
|
+
_classNames_decorators = [zUI({ group: PropGroups.Appearance })];
|
|
77
|
+
_preview_decorators = [zUI()];
|
|
78
|
+
__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);
|
|
79
|
+
__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);
|
|
80
|
+
__esDecorate(null, null, _timeout_decorators, { kind: "field", name: "timeout", static: false, private: false, access: { has: obj => "timeout" in obj, get: obj => obj.timeout, set: (obj, value) => { obj.timeout = value; } }, metadata: _metadata }, _timeout_initializers, _timeout_extraInitializers);
|
|
81
|
+
__esDecorate(null, null, _backgroundColor_decorators, { kind: "field", name: "backgroundColor", static: false, private: false, access: { has: obj => "backgroundColor" in obj, get: obj => obj.backgroundColor, set: (obj, value) => { obj.backgroundColor = value; } }, metadata: _metadata }, _backgroundColor_initializers, _backgroundColor_extraInitializers);
|
|
82
|
+
__esDecorate(null, null, _textColor_decorators, { kind: "field", name: "textColor", static: false, private: false, access: { has: obj => "textColor" in obj, get: obj => obj.textColor, set: (obj, value) => { obj.textColor = value; } }, metadata: _metadata }, _textColor_initializers, _textColor_extraInitializers);
|
|
83
|
+
__esDecorate(null, null, _classNames_decorators, { kind: "field", name: "classNames", static: false, private: false, access: { has: obj => "classNames" in obj, get: obj => obj.classNames, set: (obj, value) => { obj.classNames = value; } }, metadata: _metadata }, _classNames_initializers, _classNames_extraInitializers);
|
|
84
|
+
__esDecorate(null, _classDescriptor = { value: _classThis }, _classDecorators, { kind: "class", name: _classThis.name, metadata: _metadata }, null, _classExtraInitializers);
|
|
85
|
+
ShowTextAlert = _classThis = _classDescriptor.value;
|
|
86
|
+
if (_metadata) Object.defineProperty(_classThis, Symbol.metadata, { enumerable: true, configurable: true, writable: true, value: _metadata });
|
|
87
|
+
__runInitializers(_classThis, _classExtraInitializers);
|
|
88
|
+
}
|
|
15
89
|
/**
|
|
16
90
|
* The text to show in the alert
|
|
17
|
-
* @
|
|
18
|
-
* @zgroup ShowTextAlert
|
|
19
|
-
* @zgrouppriority 20
|
|
91
|
+
* @default ""
|
|
20
92
|
*/
|
|
21
|
-
|
|
93
|
+
text = (__runInitializers(this, _instanceExtraInitializers), __runInitializers(this, _text_initializers, ''));
|
|
22
94
|
/**
|
|
23
95
|
* The time (in milliseconds) that the text alert should remain on screen
|
|
24
|
-
*
|
|
25
|
-
* @
|
|
26
|
-
* @zgroup Appearance
|
|
27
|
-
* @zgrouppriority 10
|
|
28
|
-
* @zdefault 3000
|
|
96
|
+
* @default 3000
|
|
97
|
+
* @zui
|
|
29
98
|
* @ztype time-milliseconds
|
|
30
99
|
*/
|
|
31
|
-
|
|
100
|
+
timeout = (__runInitializers(this, _text_extraInitializers), __runInitializers(this, _timeout_initializers, 3000));
|
|
32
101
|
/**
|
|
33
102
|
* The color of the background of the text alert
|
|
34
|
-
*
|
|
35
|
-
* @
|
|
103
|
+
* @default "#000000"
|
|
104
|
+
* @zui
|
|
36
105
|
* @zgroup Appearance
|
|
37
106
|
* @zgrouppriority 10
|
|
38
|
-
* @zdefault black
|
|
39
107
|
* @ztype color-hex
|
|
40
108
|
*/
|
|
41
|
-
|
|
109
|
+
backgroundColor = (__runInitializers(this, _timeout_extraInitializers), __runInitializers(this, _backgroundColor_initializers, '#000000'));
|
|
42
110
|
/**
|
|
43
111
|
* The color of the text of the text alert
|
|
44
|
-
*
|
|
45
|
-
* @
|
|
112
|
+
* @default "#ffffff"
|
|
113
|
+
* @zui
|
|
46
114
|
* @zgroup Appearance
|
|
47
115
|
* @zgrouppriority 10
|
|
48
|
-
* @zdefault #ffffff
|
|
49
116
|
* @ztype color-hex
|
|
50
117
|
*/
|
|
51
|
-
|
|
118
|
+
textColor = (__runInitializers(this, _backgroundColor_extraInitializers), __runInitializers(this, _textColor_initializers, '#ffffff'));
|
|
52
119
|
/**
|
|
53
120
|
* Additional CSS class names to add to the alert DOM element
|
|
54
|
-
*
|
|
55
|
-
* @
|
|
121
|
+
* @default []
|
|
122
|
+
* @zui
|
|
56
123
|
* @zgroup Appearance
|
|
57
124
|
* @zgrouppriority 10
|
|
58
|
-
* @zdefault []
|
|
59
125
|
*/
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
}
|
|
80
|
-
|
|
126
|
+
classNames = (__runInitializers(this, _textColor_extraInitializers), __runInitializers(this, _classNames_initializers, []));
|
|
127
|
+
perform() {
|
|
128
|
+
showTextAlert(this.contextManager, this.text, {
|
|
129
|
+
backgroundColor: this.backgroundColor,
|
|
130
|
+
textColor: this.textColor,
|
|
131
|
+
classNames: this.classNames,
|
|
132
|
+
timeout: this.timeout,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* @zui
|
|
137
|
+
*/
|
|
138
|
+
preview() {
|
|
139
|
+
this.perform();
|
|
140
|
+
}
|
|
141
|
+
constructor() {
|
|
142
|
+
super(...arguments);
|
|
143
|
+
__runInitializers(this, _classNames_extraInitializers);
|
|
144
|
+
}
|
|
145
|
+
};
|
|
146
|
+
return ShowTextAlert = _classThis;
|
|
147
|
+
})();
|
|
148
|
+
export { ShowTextAlert };
|
|
@@ -1,54 +1,50 @@
|
|
|
1
1
|
import { ActionBehavior, ActionBehaviorConstructorProps } from '../actionbehavior';
|
|
2
|
-
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
JPEG = "jpeg"
|
|
8
|
-
}
|
|
2
|
+
import { ValueOf } from '../types';
|
|
3
|
+
export declare const ImageFormat: {
|
|
4
|
+
readonly PNG: "png";
|
|
5
|
+
readonly JPEG: "jpeg";
|
|
6
|
+
};
|
|
9
7
|
/**
|
|
10
8
|
* Captures the canvas as an image.
|
|
11
9
|
* This image can then be shared or downloaded using other behaviors.
|
|
12
|
-
*
|
|
13
10
|
* @zbehavior
|
|
14
11
|
* @zicon photo_camera
|
|
15
12
|
* @zgroup Actions
|
|
16
13
|
*/
|
|
17
14
|
export declare class TakeSnapshot extends ActionBehavior<ActionBehaviorConstructorProps> {
|
|
18
|
-
|
|
15
|
+
/**
|
|
16
|
+
* @default ""
|
|
17
|
+
*/
|
|
18
|
+
private _dataUrl;
|
|
19
19
|
/**
|
|
20
20
|
* The format of the image to capture.
|
|
21
|
-
* @
|
|
22
|
-
* @zdefault jpeg
|
|
21
|
+
* @default "jpeg"
|
|
23
22
|
*/
|
|
24
|
-
format:
|
|
23
|
+
format: ValueOf<typeof ImageFormat>;
|
|
25
24
|
/**
|
|
26
25
|
* The quality of the image to capture.
|
|
27
|
-
* @
|
|
28
|
-
* @zdefault 0.92
|
|
26
|
+
* @default 0.92
|
|
29
27
|
*/
|
|
30
|
-
quality:
|
|
28
|
+
quality: number;
|
|
31
29
|
/**
|
|
32
30
|
* The name of the file to download.
|
|
33
|
-
* @
|
|
34
|
-
* @zdefault canvas
|
|
31
|
+
* @default "canvas"
|
|
35
32
|
*/
|
|
36
|
-
fileName:
|
|
33
|
+
fileName: string;
|
|
37
34
|
/**
|
|
38
35
|
* The text to share.
|
|
39
|
-
* @
|
|
40
|
-
* @zdefault ''
|
|
36
|
+
* @default ""
|
|
41
37
|
*/
|
|
42
|
-
text:
|
|
38
|
+
text: string;
|
|
43
39
|
/**
|
|
44
40
|
* The title to share.
|
|
45
|
-
* @
|
|
46
|
-
* @zdefault ''
|
|
41
|
+
* @default ""
|
|
47
42
|
*/
|
|
48
|
-
title:
|
|
49
|
-
private dataUrl;
|
|
50
|
-
/** @zprop */
|
|
43
|
+
title: string;
|
|
51
44
|
perform(): void;
|
|
52
45
|
private capture;
|
|
46
|
+
/**
|
|
47
|
+
* @zui
|
|
48
|
+
*/
|
|
53
49
|
preview(): void;
|
|
54
50
|
}
|