@cocojs/mvc 0.1.0-beta.12 → 0.1.0-beta.13
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/dist/index.cjs.js +15 -15
- package/dist/index.d.ts +2 -2
- package/dist/index.esm.js +14 -14
- package/package.json +1 -1
package/dist/index.cjs.js
CHANGED
|
@@ -843,22 +843,22 @@ let _initClass$u;
|
|
|
843
843
|
/**
|
|
844
844
|
* @public
|
|
845
845
|
*/
|
|
846
|
-
let
|
|
846
|
+
let _ConstructorInject;
|
|
847
847
|
new class extends _identity {
|
|
848
|
-
static [class
|
|
848
|
+
static [class ConstructorInject extends Metadata {
|
|
849
849
|
static {
|
|
850
|
-
[
|
|
850
|
+
[_ConstructorInject, _initClass$u] = _applyDecs2311(this, [target([Target.Type.Class])], [], 0, void 0, Metadata).c;
|
|
851
851
|
}
|
|
852
852
|
value;
|
|
853
853
|
}];
|
|
854
|
-
$$id = "
|
|
854
|
+
$$id = "ConstructorInject";
|
|
855
855
|
constructor() {
|
|
856
|
-
super(
|
|
856
|
+
super(_ConstructorInject), _initClass$u();
|
|
857
857
|
}
|
|
858
858
|
}();
|
|
859
|
-
var
|
|
859
|
+
var ConstructorInject = _ConstructorInject;
|
|
860
860
|
|
|
861
|
-
var
|
|
861
|
+
var constructorInject = createDecoratorExp(ConstructorInject);
|
|
862
862
|
|
|
863
863
|
let _initClass$t;
|
|
864
864
|
/**
|
|
@@ -1448,7 +1448,7 @@ class ComponentMetadataClass {
|
|
|
1448
1448
|
* 2. 不能和其他component复合装饰器同时使用
|
|
1449
1449
|
*/
|
|
1450
1450
|
/**
|
|
1451
|
-
* constructor-
|
|
1451
|
+
* constructor-inject
|
|
1452
1452
|
* 1. 只能用在class上,且只能装饰一次
|
|
1453
1453
|
*/
|
|
1454
1454
|
/**
|
|
@@ -2163,11 +2163,11 @@ class IocComponentFactory {
|
|
|
2163
2163
|
}
|
|
2164
2164
|
instantiatingStage.add(targetDefinition.cls);
|
|
2165
2165
|
const constructorArgs = [];
|
|
2166
|
-
const
|
|
2167
|
-
if (
|
|
2166
|
+
const constructorInject = application.metadataRepository.listClassKindMetadata(instantiateDefinition.cls, ConstructorInject);
|
|
2167
|
+
if (constructorInject.length > 0) {
|
|
2168
2168
|
// 因为元数据不能重复,所以只有一个
|
|
2169
|
-
const
|
|
2170
|
-
for (const dependency of
|
|
2169
|
+
const constructorInjectParams = constructorInject[0].value;
|
|
2170
|
+
for (const dependency of constructorInjectParams) {
|
|
2171
2171
|
if (dependency === undefined) {
|
|
2172
2172
|
constructorArgs.push(undefined);
|
|
2173
2173
|
} else {
|
|
@@ -7923,7 +7923,7 @@ let _HistoryRouter;
|
|
|
7923
7923
|
new class extends _identity {
|
|
7924
7924
|
static [class HistoryRouter extends Router {
|
|
7925
7925
|
static {
|
|
7926
|
-
[_HistoryRouter, _initClass$5] = _applyDecs2311(this, [router(),
|
|
7926
|
+
[_HistoryRouter, _initClass$5] = _applyDecs2311(this, [router(), constructorInject([Render])], [], 0, void 0, Router).c;
|
|
7927
7927
|
}
|
|
7928
7928
|
constructor(render) {
|
|
7929
7929
|
super();
|
|
@@ -8075,7 +8075,7 @@ exports.Bind = Bind;
|
|
|
8075
8075
|
exports.Children = Children;
|
|
8076
8076
|
exports.Component = Component;
|
|
8077
8077
|
exports.Configuration = Configuration;
|
|
8078
|
-
exports.
|
|
8078
|
+
exports.ConstructorInject = ConstructorInject;
|
|
8079
8079
|
exports.Cookie = Cookie;
|
|
8080
8080
|
exports.Flow = Flow;
|
|
8081
8081
|
exports.GlobalData = GlobalData;
|
|
@@ -8116,7 +8116,7 @@ exports.autowired = autowired;
|
|
|
8116
8116
|
exports.bind = bind;
|
|
8117
8117
|
exports.component = component;
|
|
8118
8118
|
exports.configuration = configuration;
|
|
8119
|
-
exports.
|
|
8119
|
+
exports.constructorInject = constructorInject;
|
|
8120
8120
|
exports.cookie = cookie;
|
|
8121
8121
|
exports.createDecoratorExp = createDecoratorExp;
|
|
8122
8122
|
exports.createPlaceholderDecoratorExp = createPlaceholderDecoratorExp;
|
package/dist/index.d.ts
CHANGED
|
@@ -314,11 +314,11 @@ declare type ConstructOption_3 = {
|
|
|
314
314
|
/**
|
|
315
315
|
* @public
|
|
316
316
|
*/
|
|
317
|
-
export declare class
|
|
317
|
+
export declare class ConstructorInject extends Metadata {
|
|
318
318
|
value: Class<any>[];
|
|
319
319
|
}
|
|
320
320
|
|
|
321
|
-
export declare const
|
|
321
|
+
export declare const constructorInject: () => Decorator<ClassDecoratorContext>;
|
|
322
322
|
|
|
323
323
|
/**
|
|
324
324
|
* @public
|
package/dist/index.esm.js
CHANGED
|
@@ -841,22 +841,22 @@ let _initClass$u;
|
|
|
841
841
|
/**
|
|
842
842
|
* @public
|
|
843
843
|
*/
|
|
844
|
-
let
|
|
844
|
+
let _ConstructorInject;
|
|
845
845
|
new class extends _identity {
|
|
846
|
-
static [class
|
|
846
|
+
static [class ConstructorInject extends Metadata {
|
|
847
847
|
static {
|
|
848
|
-
[
|
|
848
|
+
[_ConstructorInject, _initClass$u] = _applyDecs2311(this, [target([Target.Type.Class])], [], 0, void 0, Metadata).c;
|
|
849
849
|
}
|
|
850
850
|
value;
|
|
851
851
|
}];
|
|
852
|
-
$$id = "
|
|
852
|
+
$$id = "ConstructorInject";
|
|
853
853
|
constructor() {
|
|
854
|
-
super(
|
|
854
|
+
super(_ConstructorInject), _initClass$u();
|
|
855
855
|
}
|
|
856
856
|
}();
|
|
857
|
-
var
|
|
857
|
+
var ConstructorInject = _ConstructorInject;
|
|
858
858
|
|
|
859
|
-
var
|
|
859
|
+
var constructorInject = createDecoratorExp(ConstructorInject);
|
|
860
860
|
|
|
861
861
|
let _initClass$t;
|
|
862
862
|
/**
|
|
@@ -1446,7 +1446,7 @@ class ComponentMetadataClass {
|
|
|
1446
1446
|
* 2. 不能和其他component复合装饰器同时使用
|
|
1447
1447
|
*/
|
|
1448
1448
|
/**
|
|
1449
|
-
* constructor-
|
|
1449
|
+
* constructor-inject
|
|
1450
1450
|
* 1. 只能用在class上,且只能装饰一次
|
|
1451
1451
|
*/
|
|
1452
1452
|
/**
|
|
@@ -2161,11 +2161,11 @@ class IocComponentFactory {
|
|
|
2161
2161
|
}
|
|
2162
2162
|
instantiatingStage.add(targetDefinition.cls);
|
|
2163
2163
|
const constructorArgs = [];
|
|
2164
|
-
const
|
|
2165
|
-
if (
|
|
2164
|
+
const constructorInject = application.metadataRepository.listClassKindMetadata(instantiateDefinition.cls, ConstructorInject);
|
|
2165
|
+
if (constructorInject.length > 0) {
|
|
2166
2166
|
// 因为元数据不能重复,所以只有一个
|
|
2167
|
-
const
|
|
2168
|
-
for (const dependency of
|
|
2167
|
+
const constructorInjectParams = constructorInject[0].value;
|
|
2168
|
+
for (const dependency of constructorInjectParams) {
|
|
2169
2169
|
if (dependency === undefined) {
|
|
2170
2170
|
constructorArgs.push(undefined);
|
|
2171
2171
|
} else {
|
|
@@ -7921,7 +7921,7 @@ let _HistoryRouter;
|
|
|
7921
7921
|
new class extends _identity {
|
|
7922
7922
|
static [class HistoryRouter extends Router {
|
|
7923
7923
|
static {
|
|
7924
|
-
[_HistoryRouter, _initClass$5] = _applyDecs2311(this, [router(),
|
|
7924
|
+
[_HistoryRouter, _initClass$5] = _applyDecs2311(this, [router(), constructorInject([Render])], [], 0, void 0, Router).c;
|
|
7925
7925
|
}
|
|
7926
7926
|
constructor(render) {
|
|
7927
7927
|
super();
|
|
@@ -8066,4 +8066,4 @@ var WebApplication = _WebApplication;
|
|
|
8066
8066
|
|
|
8067
8067
|
var webApplication = createDecoratorExp(WebApplication);
|
|
8068
8068
|
|
|
8069
|
-
export { Api, Application, Autowired, Bind, Children, Component, Configuration,
|
|
8069
|
+
export { Api, Application, Autowired, Bind, Children, Component, Configuration, ConstructorInject, Cookie, Flow, GlobalData, _HistoryRouter_default as HistoryRouter, Id, KindClass, KindField, KindMethod, Layout, _LocalStorage_default as LocalStorage, LocalStorage as LocalStorageMeta, Memoized, Metadata, Page, PropertiesConfig, Qualifier, ReactNoopUpdateQueue, Reactive, Ref$1 as Ref, Refs, Render, Route, RouteMeta, Router, Router$1 as RouterMeta, SCOPE, Scope, _SessionStorage_default as SessionStorage, SessionStorage as SessionStorageMeta, Store, Target, Util, Value, View, WebApplication, _WebRender_default as WebRender, api, autowired, bind, component, configuration, constructorInject, cookie, createDecoratorExp, createPlaceholderDecoratorExp, definePublisher, flow, globalData, id, jsx, jsx as jsxs, layout, localStorageDecorator as localStorage, memoized, page, qualifier, reactive, ref, refs, route, scope, sessionStorageDecorator as sessionStorage, store, target, util, value, view, webApplication };
|