@studiometa/js-toolkit 2.0.0-alpha.1 → 2.0.0-alpha.10
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/Base/index.d.ts +29 -47
- package/Base/index.js +144 -171
- package/Base/managers/ChildrenManager.d.ts +6 -6
- package/Base/managers/ChildrenManager.js +95 -119
- package/Base/managers/EventsManager.d.ts +9 -9
- package/Base/managers/EventsManager.js +128 -161
- package/Base/managers/OptionsManager.d.ts +50 -5
- package/Base/managers/OptionsManager.js +115 -116
- package/Base/managers/RefsManager.js +62 -73
- package/Base/managers/ServicesManager.d.ts +14 -3
- package/Base/managers/ServicesManager.js +78 -77
- package/Base/utils.js +5 -8
- package/README.md +12 -70
- package/decorators/index.js +1 -2
- package/decorators/withBreakpointManager.d.ts +4 -4
- package/decorators/withBreakpointManager.js +37 -75
- package/decorators/withBreakpointObserver.d.ts +2 -2
- package/decorators/withBreakpointObserver.js +54 -77
- package/decorators/withDrag.d.ts +3 -3
- package/decorators/withDrag.js +17 -41
- package/decorators/withExtraConfig.d.ts +3 -3
- package/decorators/withExtraConfig.js +2 -24
- package/decorators/withIntersectionObserver.d.ts +2 -2
- package/decorators/withIntersectionObserver.js +17 -56
- package/decorators/withMountWhenInView.d.ts +3 -3
- package/decorators/withMountWhenInView.js +23 -51
- package/helpers/createApp.d.ts +3 -3
- package/helpers/createApp.js +10 -12
- package/helpers/importOnInteraction.d.ts +3 -3
- package/helpers/importOnInteraction.js +7 -8
- package/helpers/importWhenIdle.d.ts +3 -3
- package/helpers/importWhenIdle.js +7 -8
- package/helpers/importWhenVisible.d.ts +3 -3
- package/helpers/importWhenVisible.js +9 -16
- package/helpers/index.d.ts +1 -3
- package/helpers/index.js +1 -4
- package/helpers/utils.js +1 -2
- package/index.d.ts +14 -4
- package/index.js +4 -4
- package/index.modern.js +1 -2
- package/index.umd.js +1 -2
- package/package.json +4 -6
- package/services/Service.js +48 -67
- package/services/drag.js +143 -179
- package/services/index.js +1 -2
- package/services/key.js +55 -97
- package/services/load.d.ts +1 -1
- package/services/load.js +21 -50
- package/services/pointer.js +117 -156
- package/services/raf.js +36 -64
- package/services/resize.js +47 -86
- package/services/scroll.js +81 -120
- package/utils/collide/boundingRectToCircle.js +7 -6
- package/utils/collide/collideCircleCircle.js +1 -2
- package/utils/collide/collideCircleRect.js +1 -2
- package/utils/collide/collidePointCircle.js +1 -2
- package/utils/collide/collidePointRect.js +1 -2
- package/utils/collide/collideRectRect.js +1 -2
- package/utils/collide/index.js +1 -2
- package/utils/css/classes.js +2 -3
- package/utils/css/index.js +1 -2
- package/utils/css/matrix.js +1 -2
- package/utils/css/styles.js +3 -8
- package/utils/css/transition.js +67 -140
- package/utils/debounce.js +3 -4
- package/utils/focusTrap.js +4 -5
- package/utils/history.js +13 -20
- package/utils/index.d.ts +2 -1
- package/utils/index.js +2 -2
- package/utils/keyCodes.js +1 -2
- package/utils/math/clamp.js +1 -2
- package/utils/math/clamp01.js +1 -2
- package/utils/math/damp.js +1 -2
- package/utils/math/index.js +1 -2
- package/utils/math/inertiaFinalValue.js +1 -2
- package/utils/math/lerp.js +1 -2
- package/utils/math/map.js +1 -2
- package/utils/math/round.js +1 -2
- package/utils/memoize.d.ts +30 -0
- package/utils/memoize.js +30 -0
- package/utils/nextFrame.js +4 -9
- package/utils/object/autoBind.js +11 -19
- package/utils/object/getAllProperties.js +3 -11
- package/utils/object/index.js +1 -2
- package/utils/object/isObject.js +2 -4
- package/utils/string/index.js +1 -2
- package/utils/string/withLeadingCharacters.js +1 -2
- package/utils/string/withLeadingSlash.js +1 -2
- package/utils/string/withTrailingCharacters.js +1 -2
- package/utils/string/withTrailingSlash.js +1 -2
- package/utils/string/withoutLeadingCharacters.js +1 -2
- package/utils/string/withoutLeadingCharactersRecursive.js +1 -2
- package/utils/string/withoutLeadingSlash.js +1 -2
- package/utils/string/withoutTrailingCharacters.js +1 -2
- package/utils/string/withoutTrailingCharactersRecursive.js +1 -2
- package/utils/string/withoutTrailingSlash.js +1 -2
- package/utils/throttle.js +2 -3
- package/Base/index.js.map +0 -1
- package/Base/managers/ChildrenManager.js.map +0 -1
- package/Base/managers/EventsManager.js.map +0 -1
- package/Base/managers/OptionsManager.js.map +0 -1
- package/Base/managers/RefsManager.js.map +0 -1
- package/Base/managers/ServicesManager.js.map +0 -1
- package/Base/utils.js.map +0 -1
- package/components/Accordion/Accordion.d.ts +0 -83
- package/components/Accordion/Accordion.js +0 -121
- package/components/Accordion/Accordion.js.map +0 -1
- package/components/Accordion/AccordionItem.d.ts +0 -122
- package/components/Accordion/AccordionItem.js +0 -327
- package/components/Accordion/AccordionItem.js.map +0 -1
- package/components/Accordion/index.d.ts +0 -27
- package/components/Accordion/index.js +0 -39
- package/components/Accordion/index.js.map +0 -1
- package/components/Cursor.d.ts +0 -138
- package/components/Cursor.js +0 -167
- package/components/Cursor.js.map +0 -1
- package/components/Draggable.d.ts +0 -49
- package/components/Draggable.js +0 -77
- package/components/Draggable.js.map +0 -1
- package/components/Modal.d.ts +0 -158
- package/components/Modal.js +0 -270
- package/components/Modal.js.map +0 -1
- package/components/Tabs.d.ts +0 -108
- package/components/Tabs.js +0 -195
- package/components/Tabs.js.map +0 -1
- package/components/index.d.ts +0 -6
- package/components/index.js +0 -7
- package/components/index.js.map +0 -1
- package/decorators/index.js.map +0 -1
- package/decorators/withBreakpointManager.js.map +0 -1
- package/decorators/withBreakpointObserver.js.map +0 -1
- package/decorators/withDrag.js.map +0 -1
- package/decorators/withExtraConfig.js.map +0 -1
- package/decorators/withIntersectionObserver.js.map +0 -1
- package/decorators/withMountWhenInView.js.map +0 -1
- package/helpers/createApp.js.map +0 -1
- package/helpers/createBase.d.ts +0 -7
- package/helpers/createBase.js +0 -7
- package/helpers/createBase.js.map +0 -1
- package/helpers/defineComponent.d.ts +0 -11
- package/helpers/defineComponent.js +0 -68
- package/helpers/defineComponent.js.map +0 -1
- package/helpers/importOnInteraction.js.map +0 -1
- package/helpers/importWhenIdle.js.map +0 -1
- package/helpers/importWhenVisible.js.map +0 -1
- package/helpers/index.js.map +0 -1
- package/helpers/utils.js.map +0 -1
- package/index.js.map +0 -1
- package/index.modern.js.map +0 -1
- package/index.umd.js.map +0 -1
- package/services/Service.js.map +0 -1
- package/services/drag.js.map +0 -1
- package/services/index.js.map +0 -1
- package/services/key.js.map +0 -1
- package/services/load.js.map +0 -1
- package/services/pointer.js.map +0 -1
- package/services/raf.js.map +0 -1
- package/services/resize.js.map +0 -1
- package/services/scroll.js.map +0 -1
- package/utils/collide/boundingRectToCircle.js.map +0 -1
- package/utils/collide/collideCircleCircle.js.map +0 -1
- package/utils/collide/collideCircleRect.js.map +0 -1
- package/utils/collide/collidePointCircle.js.map +0 -1
- package/utils/collide/collidePointRect.js.map +0 -1
- package/utils/collide/collideRectRect.js.map +0 -1
- package/utils/collide/index.js.map +0 -1
- package/utils/css/classes.js.map +0 -1
- package/utils/css/index.js.map +0 -1
- package/utils/css/matrix.js.map +0 -1
- package/utils/css/styles.js.map +0 -1
- package/utils/css/transition.js.map +0 -1
- package/utils/debounce.js.map +0 -1
- package/utils/focusTrap.js.map +0 -1
- package/utils/history.js.map +0 -1
- package/utils/index.js.map +0 -1
- package/utils/keyCodes.js.map +0 -1
- package/utils/math/clamp.js.map +0 -1
- package/utils/math/clamp01.js.map +0 -1
- package/utils/math/damp.js.map +0 -1
- package/utils/math/index.js.map +0 -1
- package/utils/math/inertiaFinalValue.js.map +0 -1
- package/utils/math/lerp.js.map +0 -1
- package/utils/math/map.js.map +0 -1
- package/utils/math/round.js.map +0 -1
- package/utils/nextFrame.js.map +0 -1
- package/utils/object/autoBind.js.map +0 -1
- package/utils/object/getAllProperties.js.map +0 -1
- package/utils/object/index.js.map +0 -1
- package/utils/object/isObject.js.map +0 -1
- package/utils/string/index.js.map +0 -1
- package/utils/string/withLeadingCharacters.js.map +0 -1
- package/utils/string/withLeadingSlash.js.map +0 -1
- package/utils/string/withTrailingCharacters.js.map +0 -1
- package/utils/string/withTrailingSlash.js.map +0 -1
- package/utils/string/withoutLeadingCharacters.js.map +0 -1
- package/utils/string/withoutLeadingCharactersRecursive.js.map +0 -1
- package/utils/string/withoutLeadingSlash.js.map +0 -1
- package/utils/string/withoutTrailingCharacters.js.map +0 -1
- package/utils/string/withoutTrailingCharactersRecursive.js.map +0 -1
- package/utils/string/withoutTrailingSlash.js.map +0 -1
- package/utils/throttle.js.map +0 -1
|
@@ -1,28 +1,17 @@
|
|
|
1
|
-
import _slicedToArray from "@babel/runtime/helpers/slicedToArray";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
4
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
5
|
-
import _get from "@babel/runtime/helpers/get";
|
|
6
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
7
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
8
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
9
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
10
2
|
|
|
11
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
4
|
|
|
13
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
6
|
|
|
15
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
|
-
|
|
17
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
-
|
|
19
7
|
import useResize from '../services/resize.js';
|
|
20
8
|
|
|
21
9
|
function testBreakpoints(instance) {
|
|
22
10
|
var breakpoint = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : useResize().props().breakpoint;
|
|
23
|
-
var
|
|
24
|
-
|
|
25
|
-
|
|
11
|
+
var {
|
|
12
|
+
activeBreakpoints,
|
|
13
|
+
inactiveBreakpoints
|
|
14
|
+
} = instance.$options;
|
|
26
15
|
var isInActiveBreakpoint = activeBreakpoints && activeBreakpoints.split(' ').includes(breakpoint);
|
|
27
16
|
var isInInactiveBreakpoint = inactiveBreakpoints && inactiveBreakpoints.split(' ').includes(breakpoint);
|
|
28
17
|
|
|
@@ -34,17 +23,19 @@ function testBreakpoints(instance) {
|
|
|
34
23
|
}
|
|
35
24
|
|
|
36
25
|
function hasBreakpointConfiguration(instance) {
|
|
37
|
-
var
|
|
38
|
-
|
|
39
|
-
|
|
26
|
+
var {
|
|
27
|
+
activeBreakpoints,
|
|
28
|
+
inactiveBreakpoints
|
|
29
|
+
} = instance.$options;
|
|
40
30
|
return Boolean(activeBreakpoints || inactiveBreakpoints);
|
|
41
31
|
}
|
|
42
32
|
|
|
43
33
|
function testConflictingBreakpointConfiguration(instance) {
|
|
44
|
-
var
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
34
|
+
var {
|
|
35
|
+
activeBreakpoints,
|
|
36
|
+
inactiveBreakpoints,
|
|
37
|
+
name
|
|
38
|
+
} = instance.$options;
|
|
48
39
|
|
|
49
40
|
if (activeBreakpoints && inactiveBreakpoints) {
|
|
50
41
|
throw new Error("[".concat(name, "] Incorrect configuration: the `activeBreakpoints` and `inactiveBreakpoints` are not compatible."));
|
|
@@ -53,22 +44,22 @@ function testConflictingBreakpointConfiguration(instance) {
|
|
|
53
44
|
|
|
54
45
|
function addToResize(key, instance) {
|
|
55
46
|
testConflictingBreakpointConfiguration(instance);
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
47
|
+
var {
|
|
48
|
+
add,
|
|
49
|
+
has
|
|
50
|
+
} = useResize();
|
|
60
51
|
|
|
61
52
|
if (!has(key)) {
|
|
62
53
|
add(key, function onResize(_ref) {
|
|
63
|
-
var
|
|
54
|
+
var {
|
|
55
|
+
breakpoint
|
|
56
|
+
} = _ref;
|
|
64
57
|
var action = testBreakpoints(instance, breakpoint);
|
|
65
58
|
|
|
66
59
|
if (action === '$destroy' && instance.$isMounted) {
|
|
67
60
|
instance[action]();
|
|
68
61
|
} else if (action === '$mount' && !instance.$isMounted) {
|
|
69
|
-
setTimeout(
|
|
70
|
-
return instance[action]();
|
|
71
|
-
}, 0);
|
|
62
|
+
setTimeout(() => instance[action](), 0);
|
|
72
63
|
}
|
|
73
64
|
});
|
|
74
65
|
}
|
|
@@ -77,80 +68,66 @@ function addToResize(key, instance) {
|
|
|
77
68
|
export default function withBreakpointObserver(BaseClass) {
|
|
78
69
|
var _class, _temp, _BaseClass$config$nam, _BaseClass$config, _BaseClass$config2;
|
|
79
70
|
|
|
80
|
-
return _temp = _class =
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
_this = _super.call(this, element);
|
|
91
|
-
|
|
92
|
-
var _useResize2 = useResize(),
|
|
93
|
-
remove = _useResize2.remove,
|
|
94
|
-
props = _useResize2.props;
|
|
95
|
-
|
|
96
|
-
var name = _this.$options.name;
|
|
71
|
+
return _temp = _class = class extends BaseClass {
|
|
72
|
+
constructor(element) {
|
|
73
|
+
super(element);
|
|
74
|
+
var {
|
|
75
|
+
remove,
|
|
76
|
+
props
|
|
77
|
+
} = useResize();
|
|
78
|
+
var {
|
|
79
|
+
name
|
|
80
|
+
} = this.$options;
|
|
97
81
|
|
|
98
82
|
if (!props().breakpoint) {
|
|
99
83
|
throw new Error("[".concat(name, "] The `BreakpointObserver` class requires breakpoints to be defined."));
|
|
100
84
|
}
|
|
101
85
|
|
|
102
|
-
var key = "BreakpointObserver-".concat(
|
|
103
|
-
var mutationObserver = new MutationObserver(
|
|
104
|
-
var
|
|
105
|
-
mutation = _ref3[0];
|
|
86
|
+
var key = "BreakpointObserver-".concat(this.$id);
|
|
87
|
+
var mutationObserver = new MutationObserver(_ref2 => {
|
|
88
|
+
var [mutation] = _ref2;
|
|
106
89
|
|
|
107
90
|
if (mutation.type === 'attributes' && (mutation.attributeName === 'data-options' || mutation.attributeName.startsWith('data-option-'))) {
|
|
108
|
-
if (!hasBreakpointConfiguration(
|
|
109
|
-
|
|
110
|
-
|
|
91
|
+
if (!hasBreakpointConfiguration(this)) {
|
|
92
|
+
this.$mount();
|
|
111
93
|
remove(key);
|
|
112
94
|
return;
|
|
113
95
|
}
|
|
114
96
|
|
|
115
|
-
addToResize(key,
|
|
97
|
+
addToResize(key, this);
|
|
116
98
|
}
|
|
117
99
|
});
|
|
118
|
-
mutationObserver.observe(
|
|
100
|
+
mutationObserver.observe(this.$el, {
|
|
119
101
|
attributes: true
|
|
120
102
|
});
|
|
121
103
|
|
|
122
|
-
if (!hasBreakpointConfiguration(
|
|
123
|
-
return
|
|
104
|
+
if (!hasBreakpointConfiguration(this)) {
|
|
105
|
+
return this;
|
|
124
106
|
}
|
|
125
107
|
|
|
126
|
-
addToResize(key,
|
|
127
|
-
return
|
|
108
|
+
addToResize(key, this);
|
|
109
|
+
return this;
|
|
128
110
|
}
|
|
129
111
|
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
return _get(_getPrototypeOf(_class.prototype), "$mount", this).call(this);
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
var action = testBreakpoints(this);
|
|
112
|
+
$mount() {
|
|
113
|
+
if (!hasBreakpointConfiguration(this)) {
|
|
114
|
+
return super.$mount();
|
|
115
|
+
}
|
|
138
116
|
|
|
139
|
-
|
|
140
|
-
return _get(_getPrototypeOf(_class.prototype), "$mount", this).call(this);
|
|
141
|
-
}
|
|
117
|
+
var action = testBreakpoints(this);
|
|
142
118
|
|
|
143
|
-
|
|
119
|
+
if (action === '$mount') {
|
|
120
|
+
return super.$mount();
|
|
144
121
|
}
|
|
145
|
-
}]);
|
|
146
122
|
|
|
147
|
-
|
|
148
|
-
|
|
123
|
+
return this;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
}, _defineProperty(_class, "config", _objectSpread(_objectSpread({}, BaseClass.config || {}), {}, {
|
|
149
127
|
name: "".concat((_BaseClass$config$nam = BaseClass === null || BaseClass === void 0 ? void 0 : (_BaseClass$config = BaseClass.config) === null || _BaseClass$config === void 0 ? void 0 : _BaseClass$config.name) !== null && _BaseClass$config$nam !== void 0 ? _BaseClass$config$nam : '', "WithBreakpointObserver"),
|
|
150
128
|
options: _objectSpread(_objectSpread({}, (BaseClass === null || BaseClass === void 0 ? void 0 : (_BaseClass$config2 = BaseClass.config) === null || _BaseClass$config2 === void 0 ? void 0 : _BaseClass$config2.options) || {}), {}, {
|
|
151
129
|
activeBreakpoints: String,
|
|
152
130
|
inactiveBreakpoints: String
|
|
153
131
|
})
|
|
154
132
|
})), _temp;
|
|
155
|
-
}
|
|
156
|
-
//# sourceMappingURL=withBreakpointObserver.js.map
|
|
133
|
+
}
|
package/decorators/withDrag.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('../Base').default} Base
|
|
3
|
-
* @typedef {import('../Base').
|
|
3
|
+
* @typedef {import('../Base').BaseConstructor} BaseConstructor
|
|
4
4
|
* @typedef {import('../services/drag').DragServiceOptions} DragServiceOptions
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
@@ -9,14 +9,14 @@
|
|
|
9
9
|
/**
|
|
10
10
|
* Add dragging capabilities to a component.
|
|
11
11
|
*
|
|
12
|
-
* @template {
|
|
12
|
+
* @template {BaseConstructor} T
|
|
13
13
|
* @param {T} BaseClass
|
|
14
14
|
* @param {DragDecoratorOptions} options
|
|
15
15
|
* @return {T}
|
|
16
16
|
*/
|
|
17
17
|
export default function withDrag<T extends typeof import("../Base").default>(BaseClass: T, options?: DragDecoratorOptions): T;
|
|
18
18
|
export type Base = import('../Base').default;
|
|
19
|
-
export type
|
|
19
|
+
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
20
20
|
export type DragServiceOptions = import('../services/drag').DragServiceOptions;
|
|
21
21
|
export type DragDecoratorOptions = import("../services/drag.js").DragServiceOptions & {
|
|
22
22
|
target: (this: Base) => HTMLElement;
|
package/decorators/withDrag.js
CHANGED
|
@@ -1,55 +1,31 @@
|
|
|
1
1
|
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
|
|
2
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
7
2
|
var _excluded = ["target"];
|
|
8
|
-
|
|
9
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
10
|
-
|
|
11
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
12
|
-
|
|
13
3
|
import useDrag from '../services/drag.js';
|
|
14
4
|
export default function withDrag(BaseClass) {
|
|
15
5
|
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
16
|
-
target
|
|
6
|
+
target() {
|
|
17
7
|
return this.$el;
|
|
18
8
|
}
|
|
19
|
-
};
|
|
20
|
-
return function (_BaseClass) {
|
|
21
|
-
_inherits(_class, _BaseClass);
|
|
22
|
-
|
|
23
|
-
var _super = _createSuper(_class);
|
|
24
|
-
|
|
25
|
-
function _class(el) {
|
|
26
|
-
var _this;
|
|
27
|
-
|
|
28
|
-
_classCallCheck(this, _class);
|
|
29
|
-
|
|
30
|
-
_this = _super.call(this, el);
|
|
31
9
|
|
|
32
|
-
|
|
33
|
-
|
|
10
|
+
};
|
|
11
|
+
return class extends BaseClass {
|
|
12
|
+
constructor(el) {
|
|
13
|
+
super(el);
|
|
14
|
+
this.$on('mounted', () => {
|
|
15
|
+
var {
|
|
16
|
+
target
|
|
17
|
+
} = options,
|
|
34
18
|
otherOptions = _objectWithoutProperties(options, _excluded);
|
|
35
19
|
|
|
36
|
-
var boundUseDrag = useDrag.bind(undefined, target.call(
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
_this.$services.enable('dragged');
|
|
20
|
+
var boundUseDrag = useDrag.bind(undefined, target.call(this), otherOptions);
|
|
21
|
+
this.$services.register('dragged', boundUseDrag);
|
|
22
|
+
this.$services.enable('dragged');
|
|
41
23
|
});
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
_this.$services.unregister('dragged');
|
|
24
|
+
this.$on('destroyed', () => {
|
|
25
|
+
this.$services.disable('dragged');
|
|
26
|
+
this.$services.unregister('dragged');
|
|
47
27
|
});
|
|
48
|
-
|
|
49
|
-
return _this;
|
|
50
28
|
}
|
|
51
29
|
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
55
|
-
//# sourceMappingURL=withDrag.js.map
|
|
30
|
+
};
|
|
31
|
+
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('deepmerge').Options} DeepmergeOptions
|
|
3
3
|
* @typedef {import('../Base').BaseConfig} BaseConfig
|
|
4
|
-
* @typedef {import('../Base').
|
|
4
|
+
* @typedef {import('../Base').BaseConstructor} BaseConstructor
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* Extends the configuration of an existing class.
|
|
8
8
|
*
|
|
9
|
-
* @template {
|
|
9
|
+
* @template {BaseConstructor} T
|
|
10
10
|
* @param {T} BaseClass The Base class to extend.
|
|
11
11
|
* @param {Partial<BaseConfig>} config Extra configuration to merge.
|
|
12
12
|
* @param {DeepmergeOptions} options Options for the `deepmerge` function. {@link https://github.com/TehShrike/deepmerge#options}
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
export default function withExtraConfig<T extends typeof import("../Base").default>(BaseClass: T, config: Partial<BaseConfig>, options?: DeepmergeOptions): T;
|
|
16
16
|
export type DeepmergeOptions = import('deepmerge').Options;
|
|
17
17
|
export type BaseConfig = import('../Base').BaseConfig;
|
|
18
|
-
export type
|
|
18
|
+
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
@@ -1,13 +1,4 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
3
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
4
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
5
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
6
|
-
|
|
7
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
8
|
-
|
|
9
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
10
|
-
|
|
11
2
|
import merge from 'deepmerge';
|
|
12
3
|
export default function withExtraConfig(BaseClass, config) {
|
|
13
4
|
var _class, _temp;
|
|
@@ -19,18 +10,5 @@ export default function withExtraConfig(BaseClass, config) {
|
|
|
19
10
|
newConfig.name = "".concat(BaseClass.config.name, "WithExtraConfig");
|
|
20
11
|
}
|
|
21
12
|
|
|
22
|
-
return _temp = _class =
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
var _super = _createSuper(_class);
|
|
26
|
-
|
|
27
|
-
function _class() {
|
|
28
|
-
_classCallCheck(this, _class);
|
|
29
|
-
|
|
30
|
-
return _super.apply(this, arguments);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
return _class;
|
|
34
|
-
}(BaseClass), _defineProperty(_class, "config", newConfig), _temp;
|
|
35
|
-
}
|
|
36
|
-
//# sourceMappingURL=withExtraConfig.js.map
|
|
13
|
+
return _temp = _class = class extends BaseClass {}, _defineProperty(_class, "config", newConfig), _temp;
|
|
14
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* IntersectionObserver decoration.
|
|
3
3
|
*
|
|
4
|
-
* @template {
|
|
4
|
+
* @template {BaseConstructor} T
|
|
5
5
|
* @param {T} BaseClass The Base class to extend.
|
|
6
6
|
* @param {Object} [defaultOptions] The options for the IntersectionObserver instance.
|
|
7
7
|
* @return {T & { new: (element:HTMLElement) => { $observer: IntersectionObserver }}}
|
|
@@ -12,7 +12,7 @@ export default function withIntersectionObserver<T extends typeof import("../Bas
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
export type Base = import('../Base').default;
|
|
15
|
-
export type
|
|
15
|
+
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
16
16
|
export type WithIntersectionObserverOptions = {
|
|
17
17
|
intersectionObserver: any;
|
|
18
18
|
};
|
|
@@ -1,25 +1,11 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
5
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
6
|
-
import _get from "@babel/runtime/helpers/get";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
|
-
import _toConsumableArray from "@babel/runtime/helpers/toConsumableArray";
|
|
10
2
|
|
|
11
3
|
function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) { symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); } keys.push.apply(keys, symbols); } return keys; }
|
|
12
4
|
|
|
13
5
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
14
6
|
|
|
15
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
16
|
-
|
|
17
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
18
|
-
|
|
19
7
|
function createArrayOfNumber(length) {
|
|
20
|
-
return
|
|
21
|
-
return index / length;
|
|
22
|
-
});
|
|
8
|
+
return [...new Array(length + 1)].map((val, index) => index / length);
|
|
23
9
|
}
|
|
24
10
|
|
|
25
11
|
export default function withIntersectionObserver(BaseClass) {
|
|
@@ -28,58 +14,33 @@ export default function withIntersectionObserver(BaseClass) {
|
|
|
28
14
|
var defaultOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
29
15
|
threshold: createArrayOfNumber(100)
|
|
30
16
|
};
|
|
31
|
-
return _temp = _class =
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
var _super = _createSuper(_class);
|
|
35
|
-
|
|
36
|
-
function _class(element) {
|
|
37
|
-
var _this;
|
|
17
|
+
return _temp = _class = class extends BaseClass {
|
|
18
|
+
constructor(element) {
|
|
19
|
+
super(element);
|
|
38
20
|
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
_this = _super.call(this, element);
|
|
42
|
-
|
|
43
|
-
if (!_this.intersected || typeof _this.intersected !== 'function') {
|
|
21
|
+
if (!this.intersected || typeof this.intersected !== 'function') {
|
|
44
22
|
throw new Error('[withIntersectionObserver] The `intersected` method must be defined.');
|
|
45
23
|
}
|
|
46
24
|
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
_this.$emit('intersected', entries);
|
|
51
|
-
|
|
52
|
-
_this.intersected(entries);
|
|
53
|
-
}, _objectSpread(_objectSpread({}, defaultOptions), _this.$options.intersectionObserver || {}));
|
|
25
|
+
this.$observer = new IntersectionObserver(entries => {
|
|
26
|
+
this.__debug('intersected', entries);
|
|
54
27
|
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
_this.$observer.observe(_this.$el);
|
|
28
|
+
this.$emit('intersected', entries);
|
|
29
|
+
this.intersected(entries);
|
|
30
|
+
}, _objectSpread(_objectSpread({}, defaultOptions), this.$options.intersectionObserver || {}));
|
|
31
|
+
this.$on('mounted', () => {
|
|
32
|
+
this.$observer.observe(this.$el);
|
|
61
33
|
});
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
_this.$observer.unobserve(_this.$el);
|
|
34
|
+
this.$on('destroyed', () => {
|
|
35
|
+
this.$observer.unobserve(this.$el);
|
|
65
36
|
});
|
|
66
|
-
|
|
67
|
-
return _possibleConstructorReturn(_this, _assertThisInitialized(_this));
|
|
37
|
+
return this;
|
|
68
38
|
}
|
|
69
39
|
|
|
70
|
-
|
|
71
|
-
key: "__excludeFromAutoBind",
|
|
72
|
-
get: function get() {
|
|
73
|
-
return [].concat(_toConsumableArray(_get(_getPrototypeOf(_class.prototype), "__excludeFromAutoBind", this) || []), ['intersected']);
|
|
74
|
-
}
|
|
75
|
-
}]);
|
|
76
|
-
|
|
77
|
-
return _class;
|
|
78
|
-
}(BaseClass), _defineProperty(_class, "config", _objectSpread(_objectSpread({}, BaseClass.config || {}), {}, {
|
|
40
|
+
}, _defineProperty(_class, "config", _objectSpread(_objectSpread({}, BaseClass.config || {}), {}, {
|
|
79
41
|
name: "".concat((_BaseClass$config$nam = BaseClass === null || BaseClass === void 0 ? void 0 : (_BaseClass$config = BaseClass.config) === null || _BaseClass$config === void 0 ? void 0 : _BaseClass$config.name) !== null && _BaseClass$config$nam !== void 0 ? _BaseClass$config$nam : '', "WithIntersectionObserver"),
|
|
80
42
|
options: _objectSpread(_objectSpread({}, (BaseClass === null || BaseClass === void 0 ? void 0 : (_BaseClass$config2 = BaseClass.config) === null || _BaseClass$config2 === void 0 ? void 0 : _BaseClass$config2.options) || {}), {}, {
|
|
81
43
|
intersectionObserver: Object
|
|
82
44
|
})
|
|
83
45
|
})), _temp;
|
|
84
|
-
}
|
|
85
|
-
//# sourceMappingURL=withIntersectionObserver.js.map
|
|
46
|
+
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @typedef {import('../Base').default} Base
|
|
3
3
|
* @typedef {import('../Base').BaseOptions} BaseOptions
|
|
4
|
-
* @typedef {import('../Base').
|
|
4
|
+
* @typedef {import('../Base').BaseConstructor} BaseConstructor
|
|
5
5
|
*/
|
|
6
6
|
/**
|
|
7
7
|
* @typedef {Object} WithMountWhenInViewOptions
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
/**
|
|
16
16
|
* IntersectionObserver decoration.
|
|
17
17
|
*
|
|
18
|
-
* @template {
|
|
18
|
+
* @template {BaseConstructor} T
|
|
19
19
|
* @param {T} BaseClass The Base class to extend.
|
|
20
20
|
* @param {Object} [defaultOptions] The options for the IntersectionObserver instance.
|
|
21
21
|
* @return {T}
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
export default function withMountWhenInView<T extends typeof import("../Base").default>(BaseClass: T, defaultOptions?: any): T;
|
|
24
24
|
export type Base = import('../Base').default;
|
|
25
25
|
export type BaseOptions = import('../Base').BaseOptions;
|
|
26
|
-
export type
|
|
26
|
+
export type BaseConstructor = import('../Base').BaseConstructor;
|
|
27
27
|
export type WithMountWhenInViewOptions = {
|
|
28
28
|
intersectionObserver: any;
|
|
29
29
|
};
|
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
import _classCallCheck from "@babel/runtime/helpers/classCallCheck";
|
|
2
|
-
import _createClass from "@babel/runtime/helpers/createClass";
|
|
3
|
-
import _assertThisInitialized from "@babel/runtime/helpers/assertThisInitialized";
|
|
4
|
-
import _get from "@babel/runtime/helpers/get";
|
|
5
|
-
import _inherits from "@babel/runtime/helpers/inherits";
|
|
6
|
-
import _possibleConstructorReturn from "@babel/runtime/helpers/possibleConstructorReturn";
|
|
7
|
-
import _getPrototypeOf from "@babel/runtime/helpers/getPrototypeOf";
|
|
8
1
|
import _defineProperty from "@babel/runtime/helpers/defineProperty";
|
|
9
2
|
import _classPrivateFieldGet from "@babel/runtime/helpers/classPrivateFieldGet";
|
|
10
3
|
import _classPrivateFieldSet from "@babel/runtime/helpers/classPrivateFieldSet";
|
|
@@ -13,78 +6,57 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
|
|
|
13
6
|
|
|
14
7
|
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
15
8
|
|
|
16
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
17
|
-
|
|
18
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }
|
|
19
|
-
|
|
20
9
|
export default function withMountWhenInView(BaseClass) {
|
|
21
10
|
var _class, _isVisible, _observer, _temp, _BaseClass$config$nam, _BaseClass$config, _BaseClass$config2;
|
|
22
11
|
|
|
23
12
|
var defaultOptions = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {
|
|
24
13
|
threshold: [0, 1]
|
|
25
14
|
};
|
|
26
|
-
return _temp = (_isVisible = new WeakMap(), _observer = new WeakMap(), _class =
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
var _super = _createSuper(_class);
|
|
30
|
-
|
|
31
|
-
function _class(element) {
|
|
32
|
-
var _this;
|
|
33
|
-
|
|
34
|
-
_classCallCheck(this, _class);
|
|
35
|
-
|
|
36
|
-
_this = _super.call(this, element);
|
|
15
|
+
return _temp = (_isVisible = new WeakMap(), _observer = new WeakMap(), _class = class extends BaseClass {
|
|
16
|
+
constructor(element) {
|
|
17
|
+
super(element);
|
|
37
18
|
|
|
38
|
-
_isVisible.set(
|
|
19
|
+
_isVisible.set(this, {
|
|
39
20
|
writable: true,
|
|
40
21
|
value: false
|
|
41
22
|
});
|
|
42
23
|
|
|
43
|
-
_observer.set(
|
|
24
|
+
_observer.set(this, {
|
|
44
25
|
writable: true,
|
|
45
26
|
value: void 0
|
|
46
27
|
});
|
|
47
28
|
|
|
48
|
-
_classPrivateFieldSet(
|
|
49
|
-
var isVisible = entries.reduce(
|
|
50
|
-
return acc || entry.isIntersecting;
|
|
51
|
-
}, false);
|
|
29
|
+
_classPrivateFieldSet(this, _observer, new IntersectionObserver(entries => {
|
|
30
|
+
var isVisible = entries.reduce((acc, entry) => acc || entry.isIntersecting, false);
|
|
52
31
|
|
|
53
|
-
if (_classPrivateFieldGet(
|
|
54
|
-
_classPrivateFieldSet(
|
|
32
|
+
if (_classPrivateFieldGet(this, _isVisible) !== isVisible) {
|
|
33
|
+
_classPrivateFieldSet(this, _isVisible, isVisible);
|
|
55
34
|
|
|
56
35
|
var method = isVisible ? '$mount' : '$destroy';
|
|
57
|
-
|
|
58
|
-
_this[method]();
|
|
36
|
+
this[method]();
|
|
59
37
|
}
|
|
60
|
-
}, _objectSpread(_objectSpread({}, defaultOptions),
|
|
38
|
+
}, _objectSpread(_objectSpread({}, defaultOptions), this.$options.intersectionObserver)));
|
|
61
39
|
|
|
62
|
-
_classPrivateFieldGet(
|
|
40
|
+
_classPrivateFieldGet(this, _observer).observe(this.$el);
|
|
63
41
|
|
|
64
|
-
|
|
65
|
-
_classPrivateFieldGet(
|
|
42
|
+
this.$on('terminated', () => {
|
|
43
|
+
_classPrivateFieldGet(this, _observer).disconnect();
|
|
66
44
|
});
|
|
67
|
-
|
|
68
|
-
return _possibleConstructorReturn(_this, _assertThisInitialized(_this));
|
|
45
|
+
return this;
|
|
69
46
|
}
|
|
70
47
|
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
if (_classPrivateFieldGet(this, _isVisible)) {
|
|
75
|
-
_get(_getPrototypeOf(_class.prototype), "$mount", this).call(this);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
return this;
|
|
48
|
+
$mount() {
|
|
49
|
+
if (_classPrivateFieldGet(this, _isVisible)) {
|
|
50
|
+
super.$mount();
|
|
79
51
|
}
|
|
80
|
-
}]);
|
|
81
52
|
|
|
82
|
-
|
|
83
|
-
|
|
53
|
+
return this;
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
}), _defineProperty(_class, "config", _objectSpread(_objectSpread({}, BaseClass.config || {}), {}, {
|
|
84
57
|
name: "".concat((_BaseClass$config$nam = BaseClass === null || BaseClass === void 0 ? void 0 : (_BaseClass$config = BaseClass.config) === null || _BaseClass$config === void 0 ? void 0 : _BaseClass$config.name) !== null && _BaseClass$config$nam !== void 0 ? _BaseClass$config$nam : '', "WithMountWhenInView"),
|
|
85
58
|
options: _objectSpread(_objectSpread({}, (BaseClass === null || BaseClass === void 0 ? void 0 : (_BaseClass$config2 = BaseClass.config) === null || _BaseClass$config2 === void 0 ? void 0 : _BaseClass$config2.options) || {}), {}, {
|
|
86
59
|
intersectionObserver: Object
|
|
87
60
|
})
|
|
88
61
|
})), _temp;
|
|
89
|
-
}
|
|
90
|
-
//# sourceMappingURL=withMountWhenInView.js.map
|
|
62
|
+
}
|
package/helpers/createApp.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @typedef {import('../Base/index.js').
|
|
2
|
+
* @typedef {import('../Base/index.js').BaseConstructor} BaseConstructor
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* Instantiate and mount the given component on the given root element when the page has been loaded
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
* console.log(app.$options.name); // 'App'
|
|
27
27
|
* ```
|
|
28
28
|
*
|
|
29
|
-
* @template {
|
|
29
|
+
* @template {BaseConstructor} T
|
|
30
30
|
* @param {T} App
|
|
31
31
|
* @param {HTMLElement} rootElement
|
|
32
32
|
*
|
|
@@ -34,4 +34,4 @@
|
|
|
34
34
|
*
|
|
35
35
|
*/
|
|
36
36
|
export default function createApp<T extends typeof import("../Base/index.js").default>(App: T, rootElement: HTMLElement): () => Promise<InstanceType<T>>;
|
|
37
|
-
export type
|
|
37
|
+
export type BaseConstructor = import('../Base/index.js').BaseConstructor;
|