vevet 3.0.0-beta.0 → 3.0.0-beta.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/lib/cjs/Application/events/Viewport/index.js +1 -1
- package/lib/cjs/Application/events/Viewport/index.js.map +1 -1
- package/lib/cjs/Application/index.js +5 -2
- package/lib/cjs/Application/index.js.map +1 -1
- package/lib/cjs/components/Preloader/index.js +4 -1
- package/lib/cjs/components/Preloader/index.js.map +1 -1
- package/lib/cjs/components/ProgressPreloader/index.js +4 -1
- package/lib/cjs/components/ProgressPreloader/index.js.map +1 -1
- package/lib/cjs/components/ScrollBar/index.js +4 -1
- package/lib/cjs/components/ScrollBar/index.js.map +1 -1
- package/lib/cjs/utils/common/mergeWithoutArrays.js +4 -1
- package/lib/cjs/utils/common/mergeWithoutArrays.js.map +1 -1
- package/lib/cjs/utils/image/load.js +4 -1
- package/lib/cjs/utils/image/load.js.map +1 -1
- package/lib/cjs/utils/internal/fetchWebpSupport.js +4 -1
- package/lib/cjs/utils/internal/fetchWebpSupport.js.map +1 -1
- package/lib/cjs/utils/internal/getDeviceInfo.js +4 -1
- package/lib/cjs/utils/internal/getDeviceInfo.js.map +1 -1
- package/lib/cjs/utils/math/easing.js +4 -1
- package/lib/cjs/utils/math/easing.js.map +1 -1
- package/lib/cjs/utils/scroll/normalizeWheel.js +4 -1
- package/lib/cjs/utils/scroll/normalizeWheel.js.map +1 -1
- package/lib/cjs/version.js +1 -1
- package/lib/esm/Application/events/PageLoad/index.js +54 -28
- package/lib/esm/Application/events/PageLoad/index.js.map +1 -1
- package/lib/esm/Application/events/Viewport/index.js +180 -107
- package/lib/esm/Application/events/Viewport/index.js.map +1 -1
- package/lib/esm/Application/index.js +178 -96
- package/lib/esm/Application/index.js.map +1 -1
- package/lib/esm/base/Callbacks/index.js +78 -45
- package/lib/esm/base/Callbacks/index.js.map +1 -1
- package/lib/esm/base/Component/index.js +31 -10
- package/lib/esm/base/Component/index.js.map +1 -1
- package/lib/esm/base/Module/index.js +132 -77
- package/lib/esm/base/Module/index.js.map +1 -1
- package/lib/esm/base/MutableProps/index.js +49 -30
- package/lib/esm/base/MutableProps/index.js.map +1 -1
- package/lib/esm/base/Plugin/index.js +35 -13
- package/lib/esm/base/Plugin/index.js.map +1 -1
- package/lib/esm/components/AnimationFrame/index.js +98 -55
- package/lib/esm/components/AnimationFrame/index.js.map +1 -1
- package/lib/esm/components/BaseTimeline/index.js +88 -41
- package/lib/esm/components/BaseTimeline/index.js.map +1 -1
- package/lib/esm/components/Ctx2D/index.js +150 -82
- package/lib/esm/components/Ctx2D/index.js.map +1 -1
- package/lib/esm/components/Ctx2DPrerender/index.js +54 -20
- package/lib/esm/components/Ctx2DPrerender/index.js.map +1 -1
- package/lib/esm/components/CustomCursor/index.js +216 -149
- package/lib/esm/components/CustomCursor/index.js.map +1 -1
- package/lib/esm/components/DraggerBase/index.js +164 -98
- package/lib/esm/components/DraggerBase/index.js.map +1 -1
- package/lib/esm/components/DraggerDirection/index.js +42 -10
- package/lib/esm/components/DraggerDirection/index.js.map +1 -1
- package/lib/esm/components/DraggerMove/index.js +83 -42
- package/lib/esm/components/DraggerMove/index.js.map +1 -1
- package/lib/esm/components/Preloader/index.js +135 -77
- package/lib/esm/components/Preloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/index.js +190 -112
- package/lib/esm/components/ProgressPreloader/index.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js +10 -9
- package/lib/esm/components/ProgressPreloader/utils/preloadCustomElement.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadImage.js +3 -3
- package/lib/esm/components/ProgressPreloader/utils/preloadImage.js.map +1 -1
- package/lib/esm/components/ProgressPreloader/utils/preloadVideo.js +2 -2
- package/lib/esm/components/ProgressPreloader/utils/preloadVideo.js.map +1 -1
- package/lib/esm/components/ScrollBar/Bar/index.js +136 -90
- package/lib/esm/components/ScrollBar/Bar/index.js.map +1 -1
- package/lib/esm/components/ScrollBar/index.js +118 -70
- package/lib/esm/components/ScrollBar/index.js.map +1 -1
- package/lib/esm/components/ScrollView/index.js +154 -103
- package/lib/esm/components/ScrollView/index.js.map +1 -1
- package/lib/esm/components/SectionScrollProgress/index.js +170 -95
- package/lib/esm/components/SectionScrollProgress/index.js.map +1 -1
- package/lib/esm/components/SmoothScroll/AnimatonFrame.js +37 -20
- package/lib/esm/components/SmoothScroll/AnimatonFrame.js.map +1 -1
- package/lib/esm/components/SmoothScroll/Elements.js +59 -42
- package/lib/esm/components/SmoothScroll/Elements.js.map +1 -1
- package/lib/esm/components/SmoothScroll/index.js +304 -205
- package/lib/esm/components/SmoothScroll/index.js.map +1 -1
- package/lib/esm/components/SmoothScrollDragPlugin/index.js +86 -48
- package/lib/esm/components/SmoothScrollDragPlugin/index.js.map +1 -1
- package/lib/esm/components/SmoothScrollKeyboardPlugin/index.js +70 -34
- package/lib/esm/components/SmoothScrollKeyboardPlugin/index.js.map +1 -1
- package/lib/esm/components/SplitText/index.js +177 -117
- package/lib/esm/components/SplitText/index.js.map +1 -1
- package/lib/esm/components/Timeline/index.js +88 -45
- package/lib/esm/components/Timeline/index.js.map +1 -1
- package/lib/esm/utils/common/mergeWithoutArrays.js +1 -1
- package/lib/esm/utils/common/mergeWithoutArrays.js.map +1 -1
- package/lib/esm/utils/common/normalizedTimeoutCallback.js +3 -3
- package/lib/esm/utils/common/normalizedTimeoutCallback.js.map +1 -1
- package/lib/esm/utils/common/pickObjectProps.js +2 -2
- package/lib/esm/utils/common/pickObjectProps.js.map +1 -1
- package/lib/esm/utils/common/times.js +2 -2
- package/lib/esm/utils/common/times.js.map +1 -1
- package/lib/esm/utils/common/uid.js +4 -3
- package/lib/esm/utils/common/uid.js.map +1 -1
- package/lib/esm/utils/image/load.js +26 -15
- package/lib/esm/utils/image/load.js.map +1 -1
- package/lib/esm/utils/image/pathsToProps.js +5 -5
- package/lib/esm/utils/image/pathsToProps.js.map +1 -1
- package/lib/esm/utils/image/sizesToSrcSet.js +5 -5
- package/lib/esm/utils/image/sizesToSrcSet.js.map +1 -1
- package/lib/esm/utils/internal/fetchWebpSupport.js +3 -3
- package/lib/esm/utils/internal/fetchWebpSupport.js.map +1 -1
- package/lib/esm/utils/internal/getDeviceInfo.js +7 -7
- package/lib/esm/utils/internal/getDeviceInfo.js.map +1 -1
- package/lib/esm/utils/internal/onResize.js +16 -13
- package/lib/esm/utils/internal/onResize.js.map +1 -1
- package/lib/esm/utils/math/clamp.js +2 -1
- package/lib/esm/utils/math/clamp.js.map +1 -1
- package/lib/esm/utils/math/clampScope.js +3 -1
- package/lib/esm/utils/math/clampScope.js.map +1 -1
- package/lib/esm/utils/math/easing.js +5 -1
- package/lib/esm/utils/math/easing.js.map +1 -1
- package/lib/esm/utils/math/inScope.js +2 -1
- package/lib/esm/utils/math/inScope.js.map +1 -1
- package/lib/esm/utils/math/lerp.js +4 -3
- package/lib/esm/utils/math/lerp.js.map +1 -1
- package/lib/esm/utils/math/normalizeNestedScope.js +1 -1
- package/lib/esm/utils/math/normalizeNestedScope.js.map +1 -1
- package/lib/esm/utils/math/scoped.js +3 -2
- package/lib/esm/utils/math/scoped.js.map +1 -1
- package/lib/esm/utils/math/spreadScope.js +5 -5
- package/lib/esm/utils/math/spreadScope.js.map +1 -1
- package/lib/esm/utils/math/wrap.js +2 -2
- package/lib/esm/utils/math/wrap.js.map +1 -1
- package/lib/esm/utils/scroll/getScrollValues.js +6 -5
- package/lib/esm/utils/scroll/getScrollValues.js.map +1 -1
- package/lib/esm/utils/scroll/onScroll.js +23 -20
- package/lib/esm/utils/scroll/onScroll.js.map +1 -1
- package/lib/esm/utils/scroll/scrollTo.js +12 -10
- package/lib/esm/utils/scroll/scrollTo.js.map +1 -1
- package/lib/esm/utils/scroll/scrollToElement.js +19 -8
- package/lib/esm/utils/scroll/scrollToElement.js.map +1 -1
- package/lib/esm/version.js +1 -1
- package/lib/esm/version.js.map +1 -1
- package/lib/esm/vevet.js +1 -1
- package/lib/esm/vevet.js.map +1 -1
- package/lib/types/Application/events/Viewport/index.d.ts +1 -1
- package/lib/types/Application/events/Viewport/index.d.ts.map +1 -1
- package/lib/types/version.d.ts +1 -1
- package/package.json +1 -1
- package/src/Application/events/Viewport/index.ts +1 -1
- package/src/Application/events/Viewport/stories/index.tsx +1 -1
- package/src/version.ts +1 -1
|
@@ -1,3 +1,14 @@
|
|
|
1
|
+
var __assign = (this && this.__assign) || function () {
|
|
2
|
+
__assign = Object.assign || function(t) {
|
|
3
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
4
|
+
s = arguments[i];
|
|
5
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
6
|
+
t[p] = s[p];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
};
|
|
10
|
+
return __assign.apply(this, arguments);
|
|
11
|
+
};
|
|
1
12
|
import { addEventListener, } from 'vevet-dom';
|
|
2
13
|
import { MutableProps } from '../MutableProps';
|
|
3
14
|
import { Callbacks } from '../Callbacks';
|
|
@@ -5,41 +16,7 @@ import { mergeWithoutArrays } from '../../utils/common';
|
|
|
5
16
|
/**
|
|
6
17
|
* Module base
|
|
7
18
|
*/
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Get Default properties (should be extended)
|
|
11
|
-
*/
|
|
12
|
-
_getDefaultProps() {
|
|
13
|
-
return { parent: null };
|
|
14
|
-
}
|
|
15
|
-
/** Current properties */
|
|
16
|
-
get props() {
|
|
17
|
-
return this._mutableProps.props;
|
|
18
|
-
}
|
|
19
|
-
/** Module Callbacks */
|
|
20
|
-
get callbacks() {
|
|
21
|
-
return this._callbacks;
|
|
22
|
-
}
|
|
23
|
-
/** Vevet Application */
|
|
24
|
-
get app() {
|
|
25
|
-
return this._app;
|
|
26
|
-
}
|
|
27
|
-
/** Module name */
|
|
28
|
-
get name() {
|
|
29
|
-
return this.constructor.name;
|
|
30
|
-
}
|
|
31
|
-
/** Module prefix */
|
|
32
|
-
get prefix() {
|
|
33
|
-
return '';
|
|
34
|
-
}
|
|
35
|
-
/** The module is initialized */
|
|
36
|
-
get isInitialized() {
|
|
37
|
-
return this._isInitialized;
|
|
38
|
-
}
|
|
39
|
-
/** The module is destroyed */
|
|
40
|
-
get isDestroyed() {
|
|
41
|
-
return this._isDestroyed;
|
|
42
|
-
}
|
|
19
|
+
var Module = /** @class */ (function () {
|
|
43
20
|
/**
|
|
44
21
|
* @example
|
|
45
22
|
*
|
|
@@ -76,14 +53,16 @@ export class Module {
|
|
|
76
53
|
|
|
77
54
|
* module.addCallback('destroy', () => console.log('destroy'));
|
|
78
55
|
*/
|
|
79
|
-
|
|
56
|
+
function Module(
|
|
80
57
|
/** Initial properties */
|
|
81
58
|
initialProps,
|
|
82
59
|
/**
|
|
83
60
|
* Defines if you need to call {@linkcode Module.init} at the constructor's end.
|
|
84
61
|
* If you want to add responsive properties, set this parameter to `false`.
|
|
85
62
|
*/
|
|
86
|
-
canInit
|
|
63
|
+
canInit) {
|
|
64
|
+
if (canInit === void 0) { canInit = true; }
|
|
65
|
+
var _this = this;
|
|
87
66
|
/** The module is initialized */
|
|
88
67
|
this._isInitialized = false;
|
|
89
68
|
/** The module is destroyed */
|
|
@@ -98,37 +77,100 @@ export class Module {
|
|
|
98
77
|
this._listeners = [];
|
|
99
78
|
this._destroyableActions = [];
|
|
100
79
|
this._classNamesToRemove = [];
|
|
101
|
-
|
|
102
|
-
this._mutableProps = new MutableProps(props, ()
|
|
80
|
+
var props = mergeWithoutArrays(this._getDefaultProps(), initialProps || {});
|
|
81
|
+
this._mutableProps = new MutableProps(props, function () { return _this._onPropsMutate(); }, this.name);
|
|
103
82
|
if (canInit) {
|
|
104
83
|
this.init();
|
|
105
84
|
}
|
|
106
85
|
}
|
|
86
|
+
/**
|
|
87
|
+
* Get Default properties (should be extended)
|
|
88
|
+
*/
|
|
89
|
+
Module.prototype._getDefaultProps = function () {
|
|
90
|
+
return { parent: null };
|
|
91
|
+
};
|
|
92
|
+
Object.defineProperty(Module.prototype, "props", {
|
|
93
|
+
/** Current properties */
|
|
94
|
+
get: function () {
|
|
95
|
+
return this._mutableProps.props;
|
|
96
|
+
},
|
|
97
|
+
enumerable: false,
|
|
98
|
+
configurable: true
|
|
99
|
+
});
|
|
100
|
+
Object.defineProperty(Module.prototype, "callbacks", {
|
|
101
|
+
/** Module Callbacks */
|
|
102
|
+
get: function () {
|
|
103
|
+
return this._callbacks;
|
|
104
|
+
},
|
|
105
|
+
enumerable: false,
|
|
106
|
+
configurable: true
|
|
107
|
+
});
|
|
108
|
+
Object.defineProperty(Module.prototype, "app", {
|
|
109
|
+
/** Vevet Application */
|
|
110
|
+
get: function () {
|
|
111
|
+
return this._app;
|
|
112
|
+
},
|
|
113
|
+
enumerable: false,
|
|
114
|
+
configurable: true
|
|
115
|
+
});
|
|
116
|
+
Object.defineProperty(Module.prototype, "name", {
|
|
117
|
+
/** Module name */
|
|
118
|
+
get: function () {
|
|
119
|
+
return this.constructor.name;
|
|
120
|
+
},
|
|
121
|
+
enumerable: false,
|
|
122
|
+
configurable: true
|
|
123
|
+
});
|
|
124
|
+
Object.defineProperty(Module.prototype, "prefix", {
|
|
125
|
+
/** Module prefix */
|
|
126
|
+
get: function () {
|
|
127
|
+
return '';
|
|
128
|
+
},
|
|
129
|
+
enumerable: false,
|
|
130
|
+
configurable: true
|
|
131
|
+
});
|
|
132
|
+
Object.defineProperty(Module.prototype, "isInitialized", {
|
|
133
|
+
/** The module is initialized */
|
|
134
|
+
get: function () {
|
|
135
|
+
return this._isInitialized;
|
|
136
|
+
},
|
|
137
|
+
enumerable: false,
|
|
138
|
+
configurable: true
|
|
139
|
+
});
|
|
140
|
+
Object.defineProperty(Module.prototype, "isDestroyed", {
|
|
141
|
+
/** The module is destroyed */
|
|
142
|
+
get: function () {
|
|
143
|
+
return this._isDestroyed;
|
|
144
|
+
},
|
|
145
|
+
enumerable: false,
|
|
146
|
+
configurable: true
|
|
147
|
+
});
|
|
107
148
|
/** Add responsive rules */
|
|
108
|
-
addResponsiveProps(rules) {
|
|
149
|
+
Module.prototype.addResponsiveProps = function (rules) {
|
|
109
150
|
if (this.isInitialized) {
|
|
110
151
|
throw new Error('Responsive properties cannot be added after `init` is called');
|
|
111
152
|
}
|
|
112
153
|
else {
|
|
113
154
|
this._mutableProps.addResponsiveProps(rules);
|
|
114
155
|
}
|
|
115
|
-
}
|
|
156
|
+
};
|
|
116
157
|
/** Change module properties */
|
|
117
|
-
changeProps(props) {
|
|
158
|
+
Module.prototype.changeProps = function (props) {
|
|
118
159
|
if (this.isDestroyed) {
|
|
119
160
|
return;
|
|
120
161
|
}
|
|
121
162
|
this._mutableProps.changeProps(props);
|
|
122
163
|
this._callbacks.tbt('propsChange', undefined);
|
|
123
|
-
}
|
|
164
|
+
};
|
|
124
165
|
/**
|
|
125
166
|
* This method is called on properties change
|
|
126
167
|
*/
|
|
127
|
-
_onPropsMutate() {
|
|
168
|
+
Module.prototype._onPropsMutate = function () {
|
|
128
169
|
this._callbacks.tbt('propsMutate', undefined);
|
|
129
|
-
}
|
|
170
|
+
};
|
|
130
171
|
/** Initializes the class */
|
|
131
|
-
init() {
|
|
172
|
+
Module.prototype.init = function () {
|
|
173
|
+
var _this = this;
|
|
132
174
|
if (this.isInitialized) {
|
|
133
175
|
return;
|
|
134
176
|
}
|
|
@@ -136,65 +178,78 @@ export class Module {
|
|
|
136
178
|
this._init();
|
|
137
179
|
// destroy the current module on parent destroy
|
|
138
180
|
if (this.props.parent) {
|
|
139
|
-
this.props.parent.addCallback('destroy', ()
|
|
181
|
+
this.props.parent.addCallback('destroy', function () { return _this.destroy(); }, {
|
|
140
182
|
isProtected: true,
|
|
141
183
|
name: this.name,
|
|
142
184
|
});
|
|
143
185
|
}
|
|
144
|
-
}
|
|
186
|
+
};
|
|
145
187
|
/** Inner extra initialization */
|
|
146
|
-
_init() { }
|
|
188
|
+
Module.prototype._init = function () { };
|
|
147
189
|
/** Add destroyable actions */
|
|
148
|
-
addDestroyableAction(action) {
|
|
190
|
+
Module.prototype.addDestroyableAction = function (action) {
|
|
149
191
|
this._destroyableActions.push(action);
|
|
150
|
-
}
|
|
192
|
+
};
|
|
151
193
|
/**
|
|
152
194
|
* Add a viewport callback that will be removed on class destroy
|
|
153
195
|
*/
|
|
154
|
-
addViewportCallback(target, action, data
|
|
155
|
-
|
|
156
|
-
this.
|
|
157
|
-
|
|
196
|
+
Module.prototype.addViewportCallback = function (target, action, data) {
|
|
197
|
+
if (data === void 0) { data = {}; }
|
|
198
|
+
var callback = this._app.viewport.add(target, action, __assign(__assign({}, data), { name: this.constructor.name }));
|
|
199
|
+
this.addDestroyableAction(function () { return callback.remove(); });
|
|
200
|
+
};
|
|
158
201
|
/** Add a module callback */
|
|
159
|
-
addCallback(target, action, settings
|
|
202
|
+
Module.prototype.addCallback = function (target, action, settings) {
|
|
203
|
+
if (settings === void 0) { settings = {}; }
|
|
160
204
|
return this.callbacks.add(target, action, settings);
|
|
161
|
-
}
|
|
205
|
+
};
|
|
162
206
|
/** Add a DOM event listener */
|
|
163
|
-
addEventListener(el, target, callback, options) {
|
|
164
|
-
|
|
207
|
+
Module.prototype.addEventListener = function (el, target, callback, options) {
|
|
208
|
+
var _this = this;
|
|
209
|
+
var listener = addEventListener(el, target, callback, options);
|
|
165
210
|
this._listeners.push(listener);
|
|
166
|
-
return
|
|
167
|
-
|
|
211
|
+
return __assign(__assign({}, listener), { remove: function () {
|
|
212
|
+
_this._listeners = _this._listeners.filter(function (item) { return item.id !== listener.id; });
|
|
168
213
|
return listener.remove();
|
|
169
214
|
} });
|
|
170
|
-
}
|
|
171
|
-
className(
|
|
172
|
-
|
|
173
|
-
|
|
215
|
+
};
|
|
216
|
+
Module.prototype.className = function () {
|
|
217
|
+
var _this = this;
|
|
218
|
+
var classNames = [];
|
|
219
|
+
for (var _i = 0; _i < arguments.length; _i++) {
|
|
220
|
+
classNames[_i] = arguments[_i];
|
|
221
|
+
}
|
|
222
|
+
return classNames.map(function (value) { return "".concat(_this.prefix).concat(value); }).join(' ');
|
|
223
|
+
};
|
|
174
224
|
/** Toggle classList */
|
|
175
|
-
toggleClassName(element, className, isActive) {
|
|
176
|
-
|
|
225
|
+
Module.prototype.toggleClassName = function (element, className, isActive) {
|
|
226
|
+
var isAlreadyExists = element.classList.contains(className);
|
|
177
227
|
element.classList.toggle(className, isActive);
|
|
178
228
|
if (!isAlreadyExists) {
|
|
179
|
-
this._classNamesToRemove.push({ element, className });
|
|
229
|
+
this._classNamesToRemove.push({ element: element, className: className });
|
|
180
230
|
}
|
|
181
|
-
}
|
|
231
|
+
};
|
|
182
232
|
/** Destroy the module */
|
|
183
|
-
destroy() {
|
|
233
|
+
Module.prototype.destroy = function () {
|
|
184
234
|
if (this.isDestroyed) {
|
|
185
235
|
return;
|
|
186
236
|
}
|
|
187
237
|
this._destroy();
|
|
188
|
-
}
|
|
238
|
+
};
|
|
189
239
|
/** Destroy the module */
|
|
190
|
-
_destroy() {
|
|
240
|
+
Module.prototype._destroy = function () {
|
|
191
241
|
this._callbacks.tbt('destroy', undefined);
|
|
192
242
|
this._callbacks.destroy();
|
|
193
243
|
this._mutableProps.destroy();
|
|
194
|
-
this._destroyableActions.forEach((action)
|
|
195
|
-
this._listeners.forEach((listener)
|
|
196
|
-
this._classNamesToRemove.forEach((
|
|
244
|
+
this._destroyableActions.forEach(function (action) { return action(); });
|
|
245
|
+
this._listeners.forEach(function (listener) { return listener.remove(); });
|
|
246
|
+
this._classNamesToRemove.forEach(function (_a) {
|
|
247
|
+
var element = _a.element, className = _a.className;
|
|
248
|
+
return element.classList.remove(className);
|
|
249
|
+
});
|
|
197
250
|
this._isDestroyed = true;
|
|
198
|
-
}
|
|
199
|
-
|
|
251
|
+
};
|
|
252
|
+
return Module;
|
|
253
|
+
}());
|
|
254
|
+
export { Module };
|
|
200
255
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Module/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,gBAAgB,GAIjB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,YAAY,EAAiB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAQpD;;GAEG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Module/index.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EACL,gBAAgB,GAIjB,MAAM,WAAW,CAAC;AAGnB,OAAO,EAAE,YAAY,EAAiB,MAAM,iBAAiB,CAAC;AAC9D,OAAO,EAAE,SAAS,EAAc,MAAM,cAAc,CAAC;AACrD,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAQpD;;GAEG;AACH;IA6EE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OAmCG;IACH;IACE,yBAAyB;IACzB,YAA4C;IAC5C;;;OAGG;IACH,OAAc;QAAd,wBAAA,EAAA,cAAc;QAPhB,iBAoCC;QAxFD,gCAAgC;QACxB,mBAAc,GAAG,KAAK,CAAC;QAO/B,8BAA8B;QACtB,iBAAY,GAAG,KAAK,CAAC;QAoD3B,IAAI,MAAM,CAAC,QAAQ,EAAE;YACnB,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,QAAQ,CAAC;SAC7B;aAAM;YACL,MAAM,IAAI,KAAK,CACb,iGAAiG,CAClG,CAAC;SACH;QAED,IAAI,CAAC,UAAU,GAAG,IAAI,SAAS,EAAkB,CAAC;QAClD,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;QAC9B,IAAI,CAAC,mBAAmB,GAAG,EAAE,CAAC;QAE9B,IAAM,KAAK,GAAG,kBAAkB,CAC9B,IAAI,CAAC,gBAAgB,EAAE,EACvB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|
|
2
|
+
if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
|
|
3
|
+
if (ar || !(i in from)) {
|
|
4
|
+
if (!ar) ar = Array.prototype.slice.call(from, 0, i);
|
|
5
|
+
ar[i] = from[i];
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
return to.concat(ar || Array.prototype.slice.call(from));
|
|
9
|
+
};
|
|
1
10
|
import { mergeWithoutArrays } from '../../utils/common';
|
|
2
11
|
/**
|
|
3
12
|
* A class for creating mutable properties that can change on window resize. <br><br>
|
|
@@ -34,13 +43,7 @@ import { mergeWithoutArrays } from '../../utils/common';
|
|
|
34
43
|
|
|
35
44
|
* props.changeProps({ changeable: 'changed' });
|
|
36
45
|
*/
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* Get current properties
|
|
40
|
-
*/
|
|
41
|
-
get props() {
|
|
42
|
-
return this._props;
|
|
43
|
-
}
|
|
46
|
+
var MutableProps = /** @class */ (function () {
|
|
44
47
|
/**
|
|
45
48
|
* @example
|
|
46
49
|
*
|
|
@@ -59,7 +62,7 @@ export class MutableProps {
|
|
|
59
62
|
*
|
|
60
63
|
* const props = new MutableProps(static, responsive);
|
|
61
64
|
*/
|
|
62
|
-
|
|
65
|
+
function MutableProps(
|
|
63
66
|
/**
|
|
64
67
|
* The properties that were set while initialization.
|
|
65
68
|
* These properties will nevet change.
|
|
@@ -68,11 +71,13 @@ export class MutableProps {
|
|
|
68
71
|
/**
|
|
69
72
|
* A callback that is launched when properties are changed
|
|
70
73
|
*/
|
|
71
|
-
_onMutate
|
|
74
|
+
_onMutate,
|
|
72
75
|
/**
|
|
73
76
|
* Name of the responsive properties.
|
|
74
77
|
*/
|
|
75
|
-
_name
|
|
78
|
+
_name) {
|
|
79
|
+
if (_onMutate === void 0) { _onMutate = function () { }; }
|
|
80
|
+
if (_name === void 0) { _name = 'Responsive Props'; }
|
|
76
81
|
this._initProps = _initProps;
|
|
77
82
|
this._onMutate = _onMutate;
|
|
78
83
|
this._name = _name;
|
|
@@ -85,33 +90,45 @@ export class MutableProps {
|
|
|
85
90
|
this._props = mergeWithoutArrays({}, _initProps);
|
|
86
91
|
this._activeBreakpoints = [];
|
|
87
92
|
}
|
|
93
|
+
Object.defineProperty(MutableProps.prototype, "props", {
|
|
94
|
+
/**
|
|
95
|
+
* Get current properties
|
|
96
|
+
*/
|
|
97
|
+
get: function () {
|
|
98
|
+
return this._props;
|
|
99
|
+
},
|
|
100
|
+
enumerable: false,
|
|
101
|
+
configurable: true
|
|
102
|
+
});
|
|
88
103
|
/**
|
|
89
104
|
* Add responsive rules
|
|
90
105
|
*/
|
|
91
|
-
addResponsiveProps(rules) {
|
|
106
|
+
MutableProps.prototype.addResponsiveProps = function (rules) {
|
|
92
107
|
this._responsiveRules.push(rules);
|
|
93
108
|
this._responseProps();
|
|
94
109
|
if (typeof this._viewportCallback !== 'undefined') {
|
|
95
110
|
return;
|
|
96
111
|
}
|
|
97
112
|
this._viewportCallback = this._app.viewport.add('width', this._responseProps.bind(this), { name: this._name });
|
|
98
|
-
}
|
|
113
|
+
};
|
|
99
114
|
/**
|
|
100
115
|
* Change properties according to the "responsive" settings
|
|
101
116
|
*/
|
|
102
|
-
_responseProps() {
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
117
|
+
MutableProps.prototype._responseProps = function () {
|
|
118
|
+
var _this = this;
|
|
119
|
+
var app = this._app;
|
|
120
|
+
var viewport = app.viewport;
|
|
121
|
+
var newProps = false;
|
|
122
|
+
var statProp = mergeWithoutArrays({}, this._refProps);
|
|
123
|
+
var prevActiveBreakpointsString = __spreadArray([], this._activeBreakpoints, true).join('_');
|
|
108
124
|
this._activeBreakpoints = [];
|
|
109
125
|
// go through all breakpoints
|
|
110
126
|
// and check if a proper breakpoint exists
|
|
111
|
-
this._responsiveRules.forEach((
|
|
127
|
+
this._responsiveRules.forEach(function (_a) {
|
|
128
|
+
var settings = _a.settings, breakpoint = _a.breakpoint;
|
|
112
129
|
if (typeof breakpoint === 'number') {
|
|
113
130
|
if (viewport.width <= breakpoint) {
|
|
114
|
-
|
|
131
|
+
_this._activeBreakpoints.push(breakpoint);
|
|
115
132
|
newProps = mergeWithoutArrays(statProp, settings);
|
|
116
133
|
}
|
|
117
134
|
}
|
|
@@ -120,21 +137,21 @@ export class MutableProps {
|
|
|
120
137
|
if ((breakpoint === 'viewport_desktop' && viewport.isDesktop) ||
|
|
121
138
|
(breakpoint === 'viewport_tablet' && viewport.isTablet) ||
|
|
122
139
|
(breakpoint === 'viewport_phone' && viewport.isPhone)) {
|
|
123
|
-
|
|
140
|
+
_this._activeBreakpoints.push(breakpoint);
|
|
124
141
|
newProps = mergeWithoutArrays(statProp, settings);
|
|
125
142
|
}
|
|
126
143
|
// device type
|
|
127
144
|
if ((breakpoint === 'device_phone' && app.isPhone) ||
|
|
128
145
|
(breakpoint === 'device_tablet' && app.isTablet) ||
|
|
129
146
|
(breakpoint === 'device_mobile' && app.isMobile)) {
|
|
130
|
-
|
|
147
|
+
_this._activeBreakpoints.push(breakpoint);
|
|
131
148
|
newProps = mergeWithoutArrays(statProp, settings);
|
|
132
149
|
}
|
|
133
150
|
}
|
|
134
151
|
});
|
|
135
152
|
// check if properties really changed
|
|
136
|
-
|
|
137
|
-
|
|
153
|
+
var activeBreakpointsString = this._activeBreakpoints.join('_');
|
|
154
|
+
var isPropsChanged = activeBreakpointsString !== prevActiveBreakpointsString;
|
|
138
155
|
// if there's no breakpoint, restore the props
|
|
139
156
|
if (!newProps) {
|
|
140
157
|
this._props = mergeWithoutArrays(this._props, this._refProps);
|
|
@@ -147,22 +164,24 @@ export class MutableProps {
|
|
|
147
164
|
if (isPropsChanged) {
|
|
148
165
|
this._onMutate();
|
|
149
166
|
}
|
|
150
|
-
}
|
|
167
|
+
};
|
|
151
168
|
/**
|
|
152
169
|
* This method allows you to change the properties manually.
|
|
153
170
|
*/
|
|
154
|
-
changeProps(props) {
|
|
171
|
+
MutableProps.prototype.changeProps = function (props) {
|
|
155
172
|
this._props = mergeWithoutArrays(this._props, props);
|
|
156
173
|
this._refProps = mergeWithoutArrays(this._refProps, props);
|
|
157
174
|
this._onMutate();
|
|
158
|
-
}
|
|
175
|
+
};
|
|
159
176
|
/**
|
|
160
177
|
* Destroy the responsive properties.
|
|
161
178
|
*/
|
|
162
|
-
destroy() {
|
|
179
|
+
MutableProps.prototype.destroy = function () {
|
|
163
180
|
if (this._viewportCallback) {
|
|
164
181
|
this._viewportCallback.remove();
|
|
165
182
|
}
|
|
166
|
-
}
|
|
167
|
-
|
|
183
|
+
};
|
|
184
|
+
return MutableProps;
|
|
185
|
+
}());
|
|
186
|
+
export { MutableProps };
|
|
168
187
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/MutableProps/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAMpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/MutableProps/index.ts"],"names":[],"mappings":";;;;;;;;;AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAMpD;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AACH;IAkDE;;;;;;;;;;;;;;;;;OAiBG;IACH;IACE;;;OAGG;IACK,UAAyC;IACjD;;OAEG;IACK,SAAgC;IACxC;;OAEG;IACK,KAA0B;QAJ1B,0BAAA,EAAA,0BAA+B,CAAC;QAIhC,sBAAA,EAAA,0BAA0B;QAR1B,eAAU,GAAV,UAAU,CAA+B;QAIzC,cAAS,GAAT,SAAS,CAAuB;QAIhC,UAAK,GAAL,KAAK,CAAqB;QArDpC;;WAEG;QACK,qBAAgB,GAAiD,EAAE,CAAC;QAoD1E,IAAI,CAAC,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CAAC;QAE1D,8CAA8C;QAC9C,IAAI,CAAC,QAAQ,EAAE;YACb,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,IAAI,CAAC,SAAS,CAAC,CAAC;SAC/D;aAAM;YACL,mCAAmC;YACnC,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC;SACzD;QAED,WAAW;QACX,IAAI,cAAc,EAAE;YAClB,IAAI,CAAC,SAAS,EAAE,CAAC;SAClB;IACH,CAAC;IAED;;OAEG;IACI,kCAAW,GAAlB,UAAmB,KAA+B;QAChD,IAAI,CAAC,MAAM,GAAG,kBAAkB,CAAC,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC;QACrD,IAAI,CAAC,SAAS,GAAG,kBAAkB,CAAC,IAAI,CAAC,SAAS,EAAE,KAAK,CAAC,CAAC;QAE3D,IAAI,CAAC,SAAS,EAAE,CAAC;IACnB,CAAC;IAED;;OAEG;IACI,8BAAO,GAAd;QACE,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC1B,IAAI,CAAC,iBAAiB,CAAC,MAAM,EAAE,CAAC;SACjC;IACH,CAAC;IACH,mBAAC;AAAD,CAAC,AA9LD,IA8LC"}
|
|
@@ -1,22 +1,44 @@
|
|
|
1
|
+
var __extends = (this && this.__extends) || (function () {
|
|
2
|
+
var extendStatics = function (d, b) {
|
|
3
|
+
extendStatics = Object.setPrototypeOf ||
|
|
4
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
5
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
6
|
+
return extendStatics(d, b);
|
|
7
|
+
};
|
|
8
|
+
return function (d, b) {
|
|
9
|
+
if (typeof b !== "function" && b !== null)
|
|
10
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
11
|
+
extendStatics(d, b);
|
|
12
|
+
function __() { this.constructor = d; }
|
|
13
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
14
|
+
};
|
|
15
|
+
})();
|
|
1
16
|
import { Module } from '../Module';
|
|
2
17
|
/**
|
|
3
18
|
* A class for Plugins.
|
|
4
19
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
20
|
+
var Plugin = /** @class */ (function (_super) {
|
|
21
|
+
__extends(Plugin, _super);
|
|
22
|
+
function Plugin(initialProps) {
|
|
23
|
+
return _super.call(this, initialProps, false) || this;
|
|
8
24
|
}
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
25
|
+
Object.defineProperty(Plugin.prototype, "component", {
|
|
26
|
+
get: function () {
|
|
27
|
+
return this._component;
|
|
28
|
+
},
|
|
29
|
+
set: function (value) {
|
|
30
|
+
this._component = value;
|
|
31
|
+
},
|
|
32
|
+
enumerable: false,
|
|
33
|
+
configurable: true
|
|
34
|
+
});
|
|
35
|
+
Plugin.prototype.init = function () {
|
|
16
36
|
if (!this.component) {
|
|
17
37
|
throw new Error('Component is unknown. Be sure that `plugin.component` is non-nullable.');
|
|
18
38
|
}
|
|
19
|
-
|
|
20
|
-
}
|
|
21
|
-
|
|
39
|
+
_super.prototype.init.call(this);
|
|
40
|
+
};
|
|
41
|
+
return Plugin;
|
|
42
|
+
}(Module));
|
|
43
|
+
export { Plugin };
|
|
22
44
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Plugin/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAKnC;;GAEG;AACH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/base/Plugin/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAKnC;;GAEG;AACH;IAKU,0BAAoD;IAC5D,gBAAY,YAA4C;eACtD,kBAAM,YAAY,EAAE,KAAK,CAAC;IAC5B,CAAC;IAID,sBAAI,6BAAS;aAAb;YACE,OAAO,IAAI,CAAC,UAAU,CAAC;QACzB,CAAC;aAED,UAAc,KAAK;YACjB,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QAC1B,CAAC;;;OAJA;IAMM,qBAAI,GAAX;QACE,IAAI,CAAC,IAAI,CAAC,SAAS,EAAE;YACnB,MAAM,IAAI,KAAK,CACb,wEAAwE,CACzE,CAAC;SACH;QAED,iBAAM,IAAI,WAAE,CAAC;IACf,CAAC;IACH,aAAC;AAAD,CAAC,AA7BD,CAKU,MAAM,GAwBf"}
|