@cleanweb/oore 2.0.0-alpha.16 → 2.0.0-alpha.18
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/build/_cjs/base/index.d.ts +3 -0
- package/build/_cjs/base/index.js +19 -0
- package/build/_cjs/base/merged-state.d.ts +20 -0
- package/build/_cjs/base/merged-state.js +61 -0
- package/build/_cjs/base/methods.d.ts +58 -0
- package/build/_cjs/base/methods.js +95 -0
- package/build/_cjs/base/state/class-types.d.ts +20 -0
- package/build/_cjs/base/state/class-types.js +2 -0
- package/build/_cjs/base/state/class.d.ts +69 -0
- package/build/_cjs/base/state/class.js +129 -0
- package/build/_cjs/base/state/hook-types.d.ts +32 -0
- package/build/_cjs/base/state/hook-types.js +2 -0
- package/build/_cjs/base/state/hooks.d.ts +12 -0
- package/build/_cjs/base/state/hooks.js +41 -0
- package/build/_cjs/base/state/index.d.ts +9 -0
- package/build/_cjs/base/state/index.js +35 -0
- package/build/_cjs/classy/class/index.d.ts +128 -0
- package/build/_cjs/classy/class/index.js +174 -0
- package/build/_cjs/classy/class/types/extractor.d.ts +5 -0
- package/build/_cjs/classy/class/types/extractor.js +2 -0
- package/build/_cjs/classy/class/utils/function-name.d.ts +2 -0
- package/build/_cjs/classy/class/utils/function-name.js +17 -0
- package/build/_cjs/classy/index.d.ts +3 -0
- package/build/_cjs/classy/index.js +19 -0
- package/build/_cjs/classy/instance/index.d.ts +144 -0
- package/build/_cjs/classy/instance/index.js +177 -0
- package/build/_cjs/classy/instance/mount-callbacks.d.ts +5 -0
- package/build/_cjs/classy/instance/mount-callbacks.js +30 -0
- package/build/_cjs/classy/instance/types/hook.d.ts +13 -0
- package/build/_cjs/classy/instance/types/hook.js +2 -0
- package/build/_cjs/classy/logic/index.d.ts +116 -0
- package/build/_cjs/classy/logic/index.js +123 -0
- package/build/_cjs/classy/logic/types/hook.d.ts +16 -0
- package/build/_cjs/classy/logic/types/hook.js +2 -0
- package/build/_cjs/docs-src/api/base-classes.d.ts +3 -0
- package/build/_cjs/docs-src/api/base-classes.js +9 -0
- package/build/_cjs/docs-src/api/index.d.ts +13 -0
- package/build/_cjs/docs-src/api/index.js +44 -0
- package/build/_cjs/docs-src/api/references.d.ts +5 -0
- package/build/_cjs/docs-src/api/references.js +31 -0
- package/build/_cjs/helpers/errors.d.ts +10 -0
- package/build/_cjs/helpers/errors.js +21 -0
- package/build/_cjs/helpers/index.d.ts +13 -0
- package/build/_cjs/helpers/index.js +31 -0
- package/build/_cjs/helpers/mount-state.d.ts +5 -0
- package/build/_cjs/helpers/mount-state.js +25 -0
- package/build/_cjs/helpers/rerender.d.ts +24 -0
- package/build/_cjs/helpers/rerender.js +42 -0
- package/build/_cjs/helpers/type-guards.d.ts +1 -0
- package/build/_cjs/helpers/type-guards.js +8 -0
- package/build/_cjs/helpers/use-component/index.d.ts +6 -0
- package/build/_cjs/helpers/use-component/index.js +17 -0
- package/build/_cjs/helpers/use-component/types.d.ts +22 -0
- package/build/_cjs/helpers/use-component/types.js +2 -0
- package/build/_cjs/index.d.ts +3 -0
- package/build/_cjs/index.js +19 -0
- package/build/_cjs/slots/hook.d.ts +20 -0
- package/build/_cjs/slots/hook.js +143 -0
- package/build/_cjs/slots/index.d.ts +1 -0
- package/build/_cjs/slots/index.js +17 -0
- package/build/_cjs/slots/types.d.ts +131 -0
- package/build/_cjs/slots/types.js +2 -0
- package/build/base/index.js +19 -3
- package/build/base/merged-state.js +35 -54
- package/build/base/methods.js +23 -25
- package/build/base/state/class-types.js +2 -1
- package/build/base/state/class.js +49 -69
- package/build/base/state/hook-types.js +2 -1
- package/build/base/state/hooks.js +12 -12
- package/build/base/state/index.js +32 -4
- package/build/classy/class/index.js +89 -109
- package/build/classy/class/types/extractor.js +2 -1
- package/build/classy/class/utils/function-name.js +5 -1
- package/build/classy/index.js +19 -3
- package/build/classy/instance/index.js +62 -84
- package/build/classy/instance/mount-callbacks.js +12 -8
- package/build/classy/instance/types/hook.js +2 -1
- package/build/classy/logic/index.js +27 -28
- package/build/classy/logic/types/hook.js +2 -1
- package/build/docs-src/api/base-classes.js +9 -3
- package/build/docs-src/api/index.js +39 -8
- package/build/docs-src/api/references.js +31 -5
- package/build/globals.d.ts +130 -83
- package/build/helpers/errors.js +5 -1
- package/build/helpers/index.js +23 -5
- package/build/helpers/mount-state.js +10 -6
- package/build/helpers/rerender.js +16 -12
- package/build/helpers/type-guards.js +6 -2
- package/build/helpers/use-component/index.js +9 -5
- package/build/helpers/use-component/types.js +2 -1
- package/build/index.d.ts +0 -1
- package/build/index.js +19 -3
- package/build/slots/hook.js +58 -36
- package/build/slots/index.js +17 -1
- package/build/slots/types.js +2 -1
- package/build/tsconfig.json +5 -6
- package/package.json +31 -12
- package/build/globals.js +0 -3
|
@@ -1,22 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
})();
|
|
16
|
-
import { useEffect } from 'react';
|
|
17
|
-
import { ComponentLogic, useLogic } from '../../classy/logic';
|
|
18
|
-
import { useMountCallbacks } from './mount-callbacks';
|
|
19
|
-
import { noOp } from '../../helpers';
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useInstance = exports.ComponentInstance = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const logic_1 = require("../../classy/logic");
|
|
6
|
+
const mount_callbacks_1 = require("./mount-callbacks");
|
|
7
|
+
const helpers_1 = require("../../helpers");
|
|
20
8
|
/**
|
|
21
9
|
* A superset of {@link ComponentLogic} that adds support for lifecycle methods.
|
|
22
10
|
* This provides a declarative API for working with your React function component's lifecycle,
|
|
@@ -24,10 +12,9 @@ import { noOp } from '../../helpers';
|
|
|
24
12
|
*
|
|
25
13
|
* @see https://github.com/cleanjsweb/neat-react#lifecycle-useinstance
|
|
26
14
|
*/
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
15
|
+
class ComponentInstance extends logic_1.ComponentLogic {
|
|
16
|
+
constructor() {
|
|
17
|
+
super(...arguments);
|
|
31
18
|
/**
|
|
32
19
|
* Runs only _before_ the first render,
|
|
33
20
|
* i.e before the component instance is mounted.
|
|
@@ -38,7 +25,7 @@ var ComponentInstance = /** @class */ (function (_super) {
|
|
|
38
25
|
* PS: You can conditionally update state from here, but with certain caveats.
|
|
39
26
|
* {@link https://react.dev/reference/react/useState#storing-information-from-previous-renders | See the React docs for details}.
|
|
40
27
|
*/
|
|
41
|
-
|
|
28
|
+
this.beforeMount = () => { };
|
|
42
29
|
/**
|
|
43
30
|
* Runs only **_after_** the first render, i.e after the component instance is mounted.
|
|
44
31
|
* It is ignored on subsequent rerenders.
|
|
@@ -50,7 +37,7 @@ var ComponentInstance = /** @class */ (function (_super) {
|
|
|
50
37
|
*
|
|
51
38
|
* Uses `useEffect()` under the hood.
|
|
52
39
|
*/
|
|
53
|
-
|
|
40
|
+
this.onMount = () => helpers_1.noOp;
|
|
54
41
|
/**
|
|
55
42
|
* Runs _before_ every render cycle, including the first.
|
|
56
43
|
* Useful for logic that is involved in determining what to render.
|
|
@@ -66,7 +53,7 @@ var ComponentInstance = /** @class */ (function (_super) {
|
|
|
66
53
|
* PS: You can conditionally update state from here, but with certain caveats.
|
|
67
54
|
* {@link https://react.dev/reference/react/useState#storing-information-from-previous-renders | See the React docs for details}.
|
|
68
55
|
*/
|
|
69
|
-
|
|
56
|
+
this.beforeRender = () => ({});
|
|
70
57
|
/**
|
|
71
58
|
* Runs **_after_** every render cycle, including the first.
|
|
72
59
|
*
|
|
@@ -77,56 +64,50 @@ var ComponentInstance = /** @class */ (function (_super) {
|
|
|
77
64
|
*
|
|
78
65
|
* @returns A cleanup function.
|
|
79
66
|
*/
|
|
80
|
-
|
|
67
|
+
this.onRender = () => helpers_1.noOp;
|
|
81
68
|
/**
|
|
82
69
|
* Runs when the component is unmounted.
|
|
83
70
|
* It is called _after_ the cleanup function returned by onMount.
|
|
84
71
|
*/
|
|
85
|
-
|
|
86
|
-
return _this;
|
|
72
|
+
this.cleanUp = () => { };
|
|
87
73
|
}
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
configurable: true
|
|
126
|
-
});
|
|
127
|
-
return ComponentInstance;
|
|
128
|
-
}(ComponentLogic));
|
|
129
|
-
export { ComponentInstance };
|
|
74
|
+
/**
|
|
75
|
+
* Exposes the object returned by {@link beforeRender}.
|
|
76
|
+
*
|
|
77
|
+
* This is useful when you need to render some state or props
|
|
78
|
+
* in a transformed format. Put the transformation logic
|
|
79
|
+
* in {@link beforeRender} to the keep the main
|
|
80
|
+
* function component body clean.
|
|
81
|
+
*
|
|
82
|
+
* ******
|
|
83
|
+
*
|
|
84
|
+
* @example <caption>Using `templateContext`.</caption>
|
|
85
|
+
*
|
|
86
|
+
* ```tsx
|
|
87
|
+
* class MyComponentLogic extends ComponentInstance {
|
|
88
|
+
* beforeRender = () => {
|
|
89
|
+
* const title = `My Site | ${this.props.title}`;
|
|
90
|
+
* return { title };
|
|
91
|
+
* }
|
|
92
|
+
* }
|
|
93
|
+
* const MyComponent = (props) => {
|
|
94
|
+
* const self = useInstance(MyComponentLogic, props);
|
|
95
|
+
* const { templateContext: ctx, state } = self;
|
|
96
|
+
*
|
|
97
|
+
* return (
|
|
98
|
+
* <h1>
|
|
99
|
+
* {ctx.title}
|
|
100
|
+
* </h1>
|
|
101
|
+
* <p>{props.description}</p>
|
|
102
|
+
* );
|
|
103
|
+
* }
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
106
|
+
get templateContext() {
|
|
107
|
+
return this._templateContext;
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
exports.ComponentInstance = ComponentInstance;
|
|
130
111
|
;
|
|
131
112
|
/**
|
|
132
113
|
* Enables full separation of concerns between a React component's template
|
|
@@ -141,39 +122,36 @@ export { ComponentInstance };
|
|
|
141
122
|
*
|
|
142
123
|
* The provided class should be a subclass of {@link ComponentInstance}.
|
|
143
124
|
*/
|
|
144
|
-
|
|
125
|
+
const useInstance = (...args) => {
|
|
145
126
|
var _a;
|
|
146
|
-
|
|
147
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
148
|
-
args[_i] = arguments[_i];
|
|
149
|
-
}
|
|
150
|
-
var Component = args[0], _b = args[1], props = _b === void 0 ? {} : _b;
|
|
127
|
+
const [Component, props = {}] = args;
|
|
151
128
|
// useHooks.
|
|
152
|
-
|
|
129
|
+
const instance = (0, logic_1.useLogic)(Component, props);
|
|
153
130
|
// beforeMount, onMount, cleanUp.
|
|
154
|
-
useMountCallbacks(instance);
|
|
131
|
+
(0, mount_callbacks_1.useMountCallbacks)(instance);
|
|
155
132
|
// beforeRender.
|
|
156
133
|
/**
|
|
157
134
|
* A proxy variable to allow typechecking of the assignment
|
|
158
135
|
* to `self.templateContext` despite the need for "readonly" error suppression.
|
|
159
136
|
*/
|
|
160
|
-
|
|
137
|
+
let _templateContextProxy_;
|
|
161
138
|
// @ts-expect-error Assigning to a readonly property.
|
|
162
139
|
instance._templateContext = (_templateContextProxy_ = (_a = instance.beforeRender) === null || _a === void 0 ? void 0 : _a.call(instance));
|
|
163
140
|
// onRender.
|
|
164
|
-
|
|
141
|
+
(0, react_1.useEffect)(() => {
|
|
165
142
|
var _a;
|
|
166
|
-
|
|
167
|
-
return
|
|
143
|
+
const cleanupAfterRerender = (_a = instance.onRender) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
144
|
+
return () => {
|
|
168
145
|
if (typeof cleanupAfterRerender === 'function')
|
|
169
146
|
cleanupAfterRerender();
|
|
170
147
|
else
|
|
171
|
-
cleanupAfterRerender === null || cleanupAfterRerender === void 0 ? void 0 : cleanupAfterRerender.then(
|
|
148
|
+
cleanupAfterRerender === null || cleanupAfterRerender === void 0 ? void 0 : cleanupAfterRerender.then((cleanUp) => cleanUp === null || cleanUp === void 0 ? void 0 : cleanUp());
|
|
172
149
|
};
|
|
173
150
|
});
|
|
174
151
|
// class FormValues<TValues> extends BrowserMemStore<TValues> {}
|
|
175
152
|
return instance;
|
|
176
153
|
};
|
|
154
|
+
exports.useInstance = useInstance;
|
|
177
155
|
/** /
|
|
178
156
|
testing: {
|
|
179
157
|
class A extends ComponentInstance<EmptyObject> {
|
|
@@ -1,16 +1,19 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useMountCallbacks = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const mount_state_1 = require("../../helpers/mount-state");
|
|
3
6
|
/** @internal */
|
|
4
|
-
|
|
7
|
+
const useMountCallbacks = (instance) => {
|
|
5
8
|
var _a;
|
|
6
|
-
|
|
9
|
+
const isMounted = (0, mount_state_1.useMountState)();
|
|
7
10
|
if (!isMounted())
|
|
8
11
|
(_a = instance.beforeMount) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
9
|
-
|
|
12
|
+
(0, react_1.useEffect)(() => {
|
|
10
13
|
var _a;
|
|
11
|
-
|
|
12
|
-
return
|
|
13
|
-
|
|
14
|
+
const mountHandlerCleanUp = (_a = instance.onMount) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
15
|
+
return () => {
|
|
16
|
+
const doCleanUp = (runMountCleaners) => {
|
|
14
17
|
var _a;
|
|
15
18
|
runMountCleaners === null || runMountCleaners === void 0 ? void 0 : runMountCleaners();
|
|
16
19
|
(_a = instance.cleanUp) === null || _a === void 0 ? void 0 : _a.call(instance);
|
|
@@ -24,3 +27,4 @@ export var useMountCallbacks = function (instance) {
|
|
|
24
27
|
};
|
|
25
28
|
}, []);
|
|
26
29
|
};
|
|
30
|
+
exports.useMountCallbacks = useMountCallbacks;
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.useLogic = exports.ComponentLogic = void 0;
|
|
4
|
+
const react_1 = require("react");
|
|
5
|
+
const state_1 = require("../../base/state");
|
|
3
6
|
/**
|
|
4
7
|
* Base class for a class that holds methods to be used in a function component.
|
|
5
8
|
*
|
|
@@ -13,14 +16,14 @@ import { useCleanState } from '../../base/state';
|
|
|
13
16
|
*
|
|
14
17
|
* @typeParam TProps - {@include ./types/tprops.md}
|
|
15
18
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
19
|
+
class ComponentLogic {
|
|
20
|
+
constructor() {
|
|
18
21
|
/**
|
|
19
22
|
* Called before each instance of your component is mounted.
|
|
20
23
|
* It receives the initial `props` object and should return
|
|
21
24
|
* an object with the initial values for your component's state.
|
|
22
25
|
*/
|
|
23
|
-
this.getInitialState =
|
|
26
|
+
this.getInitialState = (props) => ({});
|
|
24
27
|
/**
|
|
25
28
|
* Call React hooks from here. If your component needs
|
|
26
29
|
* access to values return from the hooks you call,
|
|
@@ -29,7 +32,7 @@ var ComponentLogic = /** @class */ (function () {
|
|
|
29
32
|
* The returned object will be accessible as {@link hooks | `this.hooks`} within
|
|
30
33
|
* your component class.
|
|
31
34
|
*/
|
|
32
|
-
this.useHooks =
|
|
35
|
+
this.useHooks = () => { };
|
|
33
36
|
/**
|
|
34
37
|
* Persist class members during HMR. {@include ./hrm-preserve-keys.md}
|
|
35
38
|
* @privateRemarks
|
|
@@ -37,9 +40,8 @@ var ComponentLogic = /** @class */ (function () {
|
|
|
37
40
|
*/
|
|
38
41
|
this._hmrPreserveKeys = [];
|
|
39
42
|
}
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
export { ComponentLogic };
|
|
43
|
+
}
|
|
44
|
+
exports.ComponentLogic = ComponentLogic;
|
|
43
45
|
;
|
|
44
46
|
/**
|
|
45
47
|
* Returns an instance of the provided class, which holds methods for your component and
|
|
@@ -49,49 +51,46 @@ export { ComponentLogic };
|
|
|
49
51
|
*
|
|
50
52
|
* @see https://cleanjsweb.github.io/neat-react/functions/API.useLogic.html
|
|
51
53
|
*/
|
|
52
|
-
|
|
54
|
+
const useLogic = (...args) => {
|
|
53
55
|
var _a;
|
|
54
|
-
|
|
55
|
-
for (var _i = 0; _i < arguments.length; _i++) {
|
|
56
|
-
args[_i] = arguments[_i];
|
|
57
|
-
}
|
|
58
|
-
var Logic = args[0], _b = args[1], props = _b === void 0 ? {} : _b;
|
|
56
|
+
const [Logic, props = {}] = args;
|
|
59
57
|
// In production, we only use the latestInstance the first time, and it's ignored every other time.
|
|
60
58
|
// This means changing the class at runtime will have no effect in production.
|
|
61
59
|
// latestInstance is only extracted into a separate variable for use in dev mode during HMR.
|
|
62
|
-
|
|
60
|
+
const latestInstance = (0, react_1.useMemo)(() => new Logic(), [Logic]);
|
|
63
61
|
// const latestInstance = useMemo(() => new Logic(), []);
|
|
64
|
-
|
|
65
|
-
|
|
62
|
+
const instanceRef = (0, react_1.useRef)(latestInstance);
|
|
63
|
+
const refreshState = () => {
|
|
66
64
|
var _a;
|
|
67
65
|
// @ts-expect-error
|
|
68
66
|
instanceRef.current.props = props;
|
|
69
67
|
// @ts-expect-error
|
|
70
|
-
instanceRef.current.state = useCleanState(instanceRef.current.getInitialState, props);
|
|
68
|
+
instanceRef.current.state = (0, state_1.useCleanState)(instanceRef.current.getInitialState, props);
|
|
71
69
|
// @ts-expect-error
|
|
72
70
|
instanceRef.current.hooks = (_a = instanceRef.current.useHooks()) !== null && _a !== void 0 ? _a : {};
|
|
73
71
|
};
|
|
74
72
|
if (process.env.NODE_ENV === 'development' && instanceRef.current !== latestInstance) {
|
|
75
|
-
|
|
76
|
-
latestInstance._hmrPreserveKeys.forEach(
|
|
77
|
-
|
|
73
|
+
const oldInstance = instanceRef.current;
|
|
74
|
+
latestInstance._hmrPreserveKeys.forEach((_key) => {
|
|
75
|
+
const key = _key;
|
|
78
76
|
// @ts-expect-error We're assigning to readonly properties. Also, Typescript doesn't know that the type of the left and right side will always match, due to the dynamic access.
|
|
79
|
-
latestInstance[key] =
|
|
77
|
+
latestInstance[key] = oldInstance[key];
|
|
80
78
|
});
|
|
81
|
-
Reflect.ownKeys(
|
|
82
|
-
|
|
83
|
-
delete
|
|
79
|
+
Reflect.ownKeys(oldInstance).forEach((_key) => {
|
|
80
|
+
const key = _key;
|
|
81
|
+
delete oldInstance[key];
|
|
84
82
|
});
|
|
85
|
-
Object.setPrototypeOf(
|
|
83
|
+
Object.setPrototypeOf(oldInstance, latestInstance);
|
|
86
84
|
instanceRef.current = latestInstance;
|
|
87
85
|
refreshState();
|
|
88
|
-
(_a = latestInstance._onHmrUpdate) === null || _a === void 0 ? void 0 : _a.call(latestInstance,
|
|
86
|
+
(_a = latestInstance._onHmrUpdate) === null || _a === void 0 ? void 0 : _a.call(latestInstance, oldInstance);
|
|
89
87
|
}
|
|
90
88
|
else
|
|
91
89
|
refreshState();
|
|
92
90
|
return instanceRef.current;
|
|
93
91
|
;
|
|
94
92
|
};
|
|
93
|
+
exports.useLogic = useLogic;
|
|
95
94
|
/** /
|
|
96
95
|
testing: {
|
|
97
96
|
const a: object = {b: ''};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1,3 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ComponentInstance = exports.ComponentLogic = exports.ComponentMethods = void 0;
|
|
4
|
+
var methods_1 = require("../../base/methods");
|
|
5
|
+
Object.defineProperty(exports, "ComponentMethods", { enumerable: true, get: function () { return methods_1.ComponentMethods; } });
|
|
6
|
+
var logic_1 = require("../../classy/logic");
|
|
7
|
+
Object.defineProperty(exports, "ComponentLogic", { enumerable: true, get: function () { return logic_1.ComponentLogic; } });
|
|
8
|
+
var instance_1 = require("../../classy/instance");
|
|
9
|
+
Object.defineProperty(exports, "ComponentInstance", { enumerable: true, get: function () { return instance_1.ComponentInstance; } });
|
|
@@ -1,13 +1,44 @@
|
|
|
1
|
+
"use strict";
|
|
1
2
|
/**
|
|
2
3
|
* API Reference
|
|
3
4
|
* @module API
|
|
4
5
|
*/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
7
|
+
if (k2 === undefined) k2 = k;
|
|
8
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
9
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
10
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
11
|
+
}
|
|
12
|
+
Object.defineProperty(o, k2, desc);
|
|
13
|
+
}) : (function(o, m, k, k2) {
|
|
14
|
+
if (k2 === undefined) k2 = k;
|
|
15
|
+
o[k2] = m[k];
|
|
16
|
+
}));
|
|
17
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
18
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
19
|
+
}) : function(o, v) {
|
|
20
|
+
o["default"] = v;
|
|
21
|
+
});
|
|
22
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
23
|
+
if (mod && mod.__esModule) return mod;
|
|
24
|
+
var result = {};
|
|
25
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
26
|
+
__setModuleDefault(result, mod);
|
|
27
|
+
return result;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.References = exports.Helpers = exports.BaseClasses = exports.ClassComponent = exports.useInstance = exports.useLogic = exports.useMethods = exports.useCleanState = void 0;
|
|
31
|
+
var state_1 = require("../../base/state");
|
|
32
|
+
Object.defineProperty(exports, "useCleanState", { enumerable: true, get: function () { return state_1.useCleanState; } });
|
|
33
|
+
var methods_1 = require("../../base/methods");
|
|
34
|
+
Object.defineProperty(exports, "useMethods", { enumerable: true, get: function () { return methods_1.useMethods; } });
|
|
35
|
+
var logic_1 = require("../../classy/logic");
|
|
36
|
+
Object.defineProperty(exports, "useLogic", { enumerable: true, get: function () { return logic_1.useLogic; } });
|
|
37
|
+
var instance_1 = require("../../classy/instance");
|
|
38
|
+
Object.defineProperty(exports, "useInstance", { enumerable: true, get: function () { return instance_1.useInstance; } });
|
|
39
|
+
var class_1 = require("../../classy/class");
|
|
40
|
+
Object.defineProperty(exports, "ClassComponent", { enumerable: true, get: function () { return class_1.ClassComponent; } });
|
|
10
41
|
/** @namespace */
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
42
|
+
exports.BaseClasses = __importStar(require("./base-classes"));
|
|
43
|
+
exports.Helpers = __importStar(require("../../helpers"));
|
|
44
|
+
exports.References = __importStar(require("./references"));
|
|
@@ -1,5 +1,31 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.ClassComponent = exports.ComponentInstance = exports.ComponentLogic = exports.$ComponentMethods = exports.$CleanState = void 0;
|
|
27
|
+
exports.$CleanState = __importStar(require("../../base/state"));
|
|
28
|
+
exports.$ComponentMethods = __importStar(require("../../base/methods"));
|
|
29
|
+
exports.ComponentLogic = __importStar(require("../../classy/logic"));
|
|
30
|
+
exports.ComponentInstance = __importStar(require("../../classy/instance"));
|
|
31
|
+
exports.ClassComponent = __importStar(require("../../classy/class"));
|