@coolon/angular-ui-powerups 0.0.122 → 0.0.125
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/bundles/coolon-angular-ui-powerups.umd.js +69 -20
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js +1 -1
- package/bundles/coolon-angular-ui-powerups.umd.min.js.map +1 -1
- package/esm2015/lib/place/place-component.js +0 -8
- package/esm2015/lib/place/place-component.js.map +1 -1
- package/esm2015/lib/place/place-component.metadata.json +1 -1
- package/esm2015/lib/place/route/parameter-decorators.js +69 -9
- package/esm2015/lib/place/route/parameter-decorators.js.map +1 -1
- package/esm2015/lib/place/route/parameter-decorators.metadata.json +1 -1
- package/esm5/lib/place/place-component.js +1 -12
- package/esm5/lib/place/place-component.js.map +1 -1
- package/esm5/lib/place/route/parameter-decorators.js +69 -9
- package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +68 -16
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +69 -20
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/place-component.d.ts +1 -3
- package/package.json +1 -1
|
@@ -28,14 +28,6 @@ export class PlaceComponent extends DisposableComponent {
|
|
|
28
28
|
assert.isNil(this.visit);
|
|
29
29
|
this.visit = visit;
|
|
30
30
|
DebugContext.get(this.visit).tag(`${this.placeDefinition.component.name}.visit`);
|
|
31
|
-
// this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => {
|
|
32
|
-
// this.installBinding(parameterDef);
|
|
33
|
-
// });
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* @return {?}
|
|
37
|
-
*/
|
|
38
|
-
ngAfterViewInit() {
|
|
39
31
|
this.placeDefinition.getVisitParameterDefs().forEach((/**
|
|
40
32
|
* @param {?} parameterDef
|
|
41
33
|
* @return {?}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-component.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EACL,MAAM,EACN,OAAO,EAEP,YAAY,EAEZ,IAAI,EAAE,KAAK,EAGZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;;;AAIzE,MAAM,OAAO,wBAAwB,GAAG,0BAA0B;;;AAElE,MAAM,OAAO,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAExE,MAAM,OAAO,cAAe,SAAQ,mBAAmB;IASrD;QACE,KAAK,EAAE,CAAC;IACV,CAAC;;;;;IAEM,eAAe,CAAC,KAAwB;QAC7C,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACzB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,YAAY,CAAC,GAAG,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC,eAAe,CAAC,SAAS,CAAC,IAAI,QAAQ,CAAC,CAAC;QACjF,
|
|
1
|
+
{"version":3,"file":"place-component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-component.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EACL,MAAM,EACN,OAAO,EAEP,YAAY,EAEZ,IAAI,EAAE,KAAK,EAGZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;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CAAA;;;;;IAED,SAAgB,kBAAkB,CAAC,KAAoC;QACrE,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;IACpE,CAAC;IAFe,iCAAkB,qBAEjC,CAAA;;;;;IAED,SAAgB,aAAa,CAAC,KAAoC;QAChE,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;IAFe,4BAAa,gBAE5B,CAAA;;;;;;IAED,SAAgB,gBAAgB,CAAC,KAAoC,EAAE,UAA2B;QAChG,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAFe,+BAAgB,mBAE/B,CAAA;AAEH,CAAC,EAlBgB,cAAc,KAAd,cAAc,QAkB9B","sourcesContent":["import { AfterViewInit } from '@angular/core';\nimport {\n assert,\n Binding,\n Constructable,\n DebugContext,\n IMutableHasValue,\n lang, Trace,\n TransactionObserver,\n ValueModel\n} from '@coolon/pectin';\nimport { Klass } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator';\nimport 'reflect-metadata';\nimport { DisposableComponent } from '../components/disposable-component';\nimport { InteractionContext } from '../interaction/interaction-context';\nimport { PlaceDefinition } from './place-definition';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\n// RAKE: making this Symbol(...) broke things.\nexport const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';\n// this one seems ok.\nexport const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');\n\nexport class PlaceComponent extends DisposableComponent {\n\n private visit: ValueModel<Visit>;\n // private _inDeactivationGuard = new MutableValueModel<boolean>(false);\n\n interactionContext?: InteractionContext;\n\n canDeactivate?(interactionContext: InteractionContext): boolean | Promise<boolean>;\n\n constructor() {\n super();\n }\n\n public initialiseVisit(visit: ValueModel<Visit>) {\n assert.isNil(this.visit);\n this.visit = visit;\n DebugContext.get(this.visit).tag(`${this.placeDefinition.component.name}.visit`);\n this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => {\n this.installBinding(parameterDef);\n });\n }\n\n @Trace()\n private installBinding<T, S>(parameterDef: ParameterDefinition<T, S>) {\n const model = this[parameterDef.propertyName] as IMutableHasValue<S>;\n DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);\n const binding = this.registerDisposable(new Binding(this.visit, model, {\n toRight(visit: Visit): S {\n const value = visit.getParameter(parameterDef.name);\n console.log('push to component', {name:parameterDef.name, value, visit});\n return value;\n },\n toLeft(value: S, currentVisit?: Visit): Visit {\n console.log('push to route', { name: parameterDef.name, value, currentVisit });\n return currentVisit.replace(parameterDef, value);\n }\n }));\n setTimeout(() => {\n binding.writeRight();\n })\n }\n\n @Memoize()\n get placeDefinition(): PlaceDefinition {\n return PlaceComponent.getDefinition(this.constructor as any as Constructable<PlaceComponent>);\n }\n\n get childPlaces(): Constructable<PlaceComponent>[] {\n return this.placeDefinition.children.map(d => d.component);\n }\n\n onPlaceReady() {\n }\n\n}\n\nexport namespace PlaceComponent {\n\n export function isPlaceComponentConstructor(target: any): target is Constructable<PlaceComponent> {\n return lang.constructorChain(target as Constructable<any>).includes(PlaceComponent);\n }\n\n export function getRouteParameters(klass: Constructable<PlaceComponent>): ParameterDefinition<any>[] {\n return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);\n }\n\n export function getDefinition(klass: Constructable<PlaceComponent>): PlaceDefinition {\n return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);\n }\n\n export function injectDefinition(klass: Constructable<PlaceComponent>, definition: PlaceDefinition) {\n Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);\n }\n\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"DEFINITION_META_DATA_KEY":"PLACE_DEFINITION_OPTIONS","ROUTE_PARAMETER_LIST_KEY":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["place:route:parameters"]},"PlaceComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":25,"character":36},"members":{"canDeactivate":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}],"initialiseVisit":[{"__symbolic":"method"}],"
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"DEFINITION_META_DATA_KEY":"PLACE_DEFINITION_OPTIONS","ROUTE_PARAMETER_LIST_KEY":{"__symbolic":"call","expression":{"__symbolic":"reference","name":"Symbol"},"arguments":["place:route:parameters"]},"PlaceComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../components/disposable-component","name":"DisposableComponent","line":25,"character":36},"members":{"canDeactivate":[{"__symbolic":"method"}],"__ctor__":[{"__symbolic":"constructor"}],"initialiseVisit":[{"__symbolic":"method"}],"installBinding":[{"__symbolic":"method","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"Trace","line":47,"character":3}}]}],"placeDefinition":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@typescript-plus/fast-memoize-decorator","name":"Memoize","line":67,"character":3}}]}],"onPlaceReady":[{"__symbolic":"method"}]}}}}]
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview added by tsickle
|
|
3
3
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { Binding, DebugContext, Logger, MutableListModel, MutableValueModel } from '@coolon/pectin';
|
|
6
6
|
import { Klass, Opts } from '@coolon/typescript-utilities';
|
|
7
7
|
import { ROUTE_PARAMETER_LIST_KEY } from '../place-component';
|
|
8
8
|
import { ParameterDefinition } from './parameter-definition.class';
|
|
@@ -55,6 +55,57 @@ if (false) {
|
|
|
55
55
|
/** @type {?|undefined} */
|
|
56
56
|
RouteListParameterOptions.prototype.storeInUrl;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @template M
|
|
60
|
+
* @param {?} prototype
|
|
61
|
+
* @param {?} propertyKey
|
|
62
|
+
* @param {?} backingModel
|
|
63
|
+
* @param {?} tagPrefix
|
|
64
|
+
* @param {?} isEmpty
|
|
65
|
+
* @return {?}
|
|
66
|
+
*/
|
|
67
|
+
function installMechanics(prototype, propertyKey, backingModel, tagPrefix, isEmpty) {
|
|
68
|
+
/** @type {?} */
|
|
69
|
+
const mechanics = {
|
|
70
|
+
backingModel: backingModel,
|
|
71
|
+
binding: (/** @type {?} */ (null))
|
|
72
|
+
};
|
|
73
|
+
/** @type {?} */
|
|
74
|
+
const tag = `${tagPrefix}(${prototype.constructor.name}.${propertyKey.toString()})`;
|
|
75
|
+
DebugContext.get(mechanics.backingModel).tag(tag);
|
|
76
|
+
Logger.get(mechanics.backingModel).tag(tag);
|
|
77
|
+
Object.defineProperty(prototype, propertyKey, {
|
|
78
|
+
get: (/**
|
|
79
|
+
* @return {?}
|
|
80
|
+
*/
|
|
81
|
+
function () {
|
|
82
|
+
return mechanics.backingModel;
|
|
83
|
+
}),
|
|
84
|
+
set: (/**
|
|
85
|
+
* @param {?} userModel
|
|
86
|
+
* @return {?}
|
|
87
|
+
*/
|
|
88
|
+
function (userModel) {
|
|
89
|
+
// This handles the scenario where we want to push an existing value model (such as a form model)
|
|
90
|
+
// to and from the route.
|
|
91
|
+
if (mechanics.binding) {
|
|
92
|
+
mechanics.binding.dispose();
|
|
93
|
+
}
|
|
94
|
+
if (userModel) {
|
|
95
|
+
mechanics.binding = new Binding(mechanics.backingModel, userModel);
|
|
96
|
+
if (isEmpty(userModel)) {
|
|
97
|
+
mechanics.binding.writeRight(); // push the visit into the user model;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
if (!isEmpty(mechanics.backingModel)) {
|
|
101
|
+
console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
|
|
102
|
+
}
|
|
103
|
+
mechanics.binding.writeLeft(); // push the user model into the visit
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
58
109
|
/**
|
|
59
110
|
* @template T
|
|
60
111
|
* @param {?} type
|
|
@@ -71,8 +122,11 @@ export function RouteId(type, options) {
|
|
|
71
122
|
/** @type {?} */
|
|
72
123
|
const param = new ParameterDefinition.RouteId(propertyKey.toString(), options, type);
|
|
73
124
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
74
|
-
|
|
75
|
-
|
|
125
|
+
installMechanics(prototype, propertyKey, new MutableValueModel(), "@RouteId", (/**
|
|
126
|
+
* @param {?} m
|
|
127
|
+
* @return {?}
|
|
128
|
+
*/
|
|
129
|
+
m => m.query().isNil()));
|
|
76
130
|
});
|
|
77
131
|
}
|
|
78
132
|
/**
|
|
@@ -90,10 +144,13 @@ export function VisitParameter(options) {
|
|
|
90
144
|
*/
|
|
91
145
|
(prototype, propertyKey) => {
|
|
92
146
|
/** @type {?} */
|
|
93
|
-
const param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional(
|
|
147
|
+
const param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
|
|
94
148
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
95
|
-
|
|
96
|
-
|
|
149
|
+
installMechanics(prototype, propertyKey, new MutableValueModel(), "@VisitParameter", (/**
|
|
150
|
+
* @param {?} m
|
|
151
|
+
* @return {?}
|
|
152
|
+
*/
|
|
153
|
+
m => m.query().isNil()));
|
|
97
154
|
});
|
|
98
155
|
}
|
|
99
156
|
/**
|
|
@@ -111,10 +168,13 @@ export function VisitParameterList(options) {
|
|
|
111
168
|
*/
|
|
112
169
|
(prototype, propertyKey) => {
|
|
113
170
|
/** @type {?} */
|
|
114
|
-
const param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional(
|
|
115
|
-
UseDelegate({ tag: `@VisitParameterList(${prototype.constructor.name}.${propertyKey.toString()})` })(prototype, propertyKey);
|
|
116
|
-
// UseDelegate()(prototype, propertyKey);
|
|
171
|
+
const param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
|
|
117
172
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
173
|
+
installMechanics(prototype, propertyKey, new MutableListModel(), "@VisitParameterList", (/**
|
|
174
|
+
* @param {?} m
|
|
175
|
+
* @return {?}
|
|
176
|
+
*/
|
|
177
|
+
m => m.query().isEmpty()));
|
|
118
178
|
});
|
|
119
179
|
}
|
|
120
180
|
//# sourceMappingURL=parameter-decorators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameter-decorators.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/route/parameter-decorators.ts"],"names":[],"mappings":";;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"parameter-decorators.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/route/parameter-decorators.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EACL,OAAO,EACP,YAAY,EAEZ,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM,8BAA8B,CAAC;AAC3D,OAAO,EAAE,wBAAwB,EAAE,MAAM,oBAAoB,CAAC;AAE9D,OAAO,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAC;;;;;AAGnE,oCAMC;;;IALC,4BAAY;;IACZ,kCAAmB;;IACnB,kCAAmB;;IACnB,sCAAiB;;;;;;AAInB,2CAOC;;;IANC,mCAAY;;IACZ,yCAAmB;;IACnB,yCAAmB;;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,CAAC;;;;;;AAED,MAAM,UAAU,kBAAkB,CAAI,OAAsC;;UACpE,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;IAC9B;;;;;IAAO,CAAC,SAAiB,EAAE,WAA4B,EAAE,EAAE;;cACnD,KAAK,GAAG,IAAI,mBAAmB,CAAC,cAAc,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAC3H,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QAC3E,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,gBAAgB,EAAK,EAAE,qBAAqB;;;;QAAE,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,EAAC,CAAC;IACvH,CAAC,EAAC;AACJ,CAAC","sourcesContent":["import {\n Binding,\n DebugContext,\n HasValue,\n Logger,\n MutableListModel,\n MutableValueModel,\n UseDelegate\n} from '@coolon/pectin';\nimport { Klass, Opts } from '@coolon/typescript-utilities';\nimport { ROUTE_PARAMETER_LIST_KEY } from '../place-component';\nimport { Formatter } from './formatter';\nimport { ParameterDefinition } from './parameter-definition.class';\n\n\nexport interface RouteIdOptions<T> {\n as?: string;\n optional?: boolean;\n remember?: boolean;\n defaultValue?: T;\n // sanitiser?: Constructable<ParameterSanitiser<T>> | ParameterSanitiser<T>;\n}\n\nexport interface RouteParameterOptions<T> {\n as?: string;\n optional?: boolean;\n remember?: boolean;\n defaultValue?: T;\n storeInUrl?: Formatter<T>\n // sanitiser?: Constructable<ParameterSanitiser<T>> | ParameterSanitiser<T>;\n}\n\nexport interface RouteListParameterOptions<T> {\n as?: string;\n optional?: boolean;\n remember?: boolean;\n defaultValue?: T[];\n storeInUrl?: Formatter<T>\n // sanitiser?: Constructable<ParameterSanitiser<T[]>> | ParameterSanitiser<T[]>;\n}\n\n\nfunction installMechanics<M extends HasValue<any>>(prototype: Object, propertyKey: string | symbol, backingModel: M, tagPrefix: string, isEmpty: (mode: M) => boolean) {\n const mechanics = {\n backingModel: backingModel,\n binding: null as Binding<any, any>\n };\n const tag = `${tagPrefix}(${prototype.constructor.name}.${propertyKey.toString()})`;\n DebugContext.get(mechanics.backingModel).tag(tag);\n Logger.get(mechanics.backingModel).tag(tag);\n Object.defineProperty(prototype, propertyKey, {\n get: function() {\n return mechanics.backingModel;\n },\n set: function(userModel: M) {\n // This handles the scenario where we want to push an existing value model (such as a form model)\n // to and from the route.\n if (mechanics.binding) {\n mechanics.binding.dispose();\n }\n if (userModel) {\n mechanics.binding = new Binding(mechanics.backingModel, userModel);\n if (isEmpty(userModel)) {\n mechanics.binding.writeRight(); // push the visit into the user model;\n } else {\n if (!isEmpty(mechanics.backingModel)) {\n console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');\n }\n mechanics.binding.writeLeft(); // push the user model into the visit\n }\n }\n }\n });\n}\n\nexport function RouteId<T extends string | number>(type: Formatter<T>, options?: RouteIdOptions<T>): PropertyDecorator {\n return (prototype: Object, propertyKey: string | symbol) => {\n const param = new ParameterDefinition.RouteId(propertyKey.toString(), options, type);\n Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);\n installMechanics(prototype, propertyKey, new MutableValueModel<T>(), \"@RouteId\", m => m.query().isNil());\n };\n}\n\nexport function VisitParameter<T>(options?: RouteParameterOptions<T>): PropertyDecorator {\n const opts = Opts.get(options);\n return (prototype: Object, propertyKey: string | symbol) => {\n const param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));\n Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);\n installMechanics(prototype, propertyKey, new MutableValueModel<T>(), \"@VisitParameter\", m => m.query().isNil());\n };\n}\n\nexport function VisitParameterList<E>(options?: RouteListParameterOptions<E>): PropertyDecorator {\n const opts = Opts.get(options);\n return (prototype: Object, propertyKey: string | symbol) => {\n const param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));\n Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);\n installMechanics(prototype, propertyKey, new MutableListModel<E>(), \"@VisitParameterList\", m => m.query().isEmpty());\n };\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"RouteIdOptions":{"__symbolic":"interface"},"RouteParameterOptions":{"__symbolic":"interface"},"RouteListParameterOptions":{"__symbolic":"interface"},"RouteId":{"__symbolic":"function","parameters":["type","options"],"value":{"__symbolic":"error","message":"Lambda not supported","line":
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"RouteIdOptions":{"__symbolic":"interface"},"RouteParameterOptions":{"__symbolic":"interface"},"RouteListParameterOptions":{"__symbolic":"interface"},"RouteId":{"__symbolic":"function","parameters":["type","options"],"value":{"__symbolic":"error","message":"Lambda not supported","line":76,"character":9}},"VisitParameter":{"__symbolic":"function"},"VisitParameterList":{"__symbolic":"function"}}}]
|
|
@@ -30,21 +30,10 @@ var PlaceComponent = /** @class */ (function (_super) {
|
|
|
30
30
|
* @return {?}
|
|
31
31
|
*/
|
|
32
32
|
function (visit) {
|
|
33
|
+
var _this = this;
|
|
33
34
|
assert.isNil(this.visit);
|
|
34
35
|
this.visit = visit;
|
|
35
36
|
DebugContext.get(this.visit).tag(this.placeDefinition.component.name + ".visit");
|
|
36
|
-
// this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => {
|
|
37
|
-
// this.installBinding(parameterDef);
|
|
38
|
-
// });
|
|
39
|
-
};
|
|
40
|
-
/**
|
|
41
|
-
* @return {?}
|
|
42
|
-
*/
|
|
43
|
-
PlaceComponent.prototype.ngAfterViewInit = /**
|
|
44
|
-
* @return {?}
|
|
45
|
-
*/
|
|
46
|
-
function () {
|
|
47
|
-
var _this = this;
|
|
48
37
|
this.placeDefinition.getVisitParameterDefs().forEach((/**
|
|
49
38
|
* @param {?} parameterDef
|
|
50
39
|
* @return {?}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place-component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-component.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EACL,MAAM,EACN,OAAO,EAEP,YAAY,EAEZ,IAAI,EAAE,KAAK,EAGZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;;;AAIzE,MAAM,KAAO,wBAAwB,GAAG,0BAA0B;;;AAElE,MAAM,KAAO,wBAAwB,GAAG,MAAM,CAAC,wBAAwB,CAAC;AAExE;IAAoC,0CAAmB;IASrD;eACE,iBAAO;IACT,CAAC;;;;;IAEM,wCAAe;;;;IAAtB,UAAuB,KAAwB;
|
|
1
|
+
{"version":3,"file":"place-component.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/place-component.ts"],"names":[],"mappings":";;;;;AACA,OAAO,EACL,MAAM,EACN,OAAO,EAEP,YAAY,EAEZ,IAAI,EAAE,KAAK,EAGZ,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,MAAM,8BAA8B,CAAC;AACrD,OAAO,EAAE,OAAO,EAAE,MAAM,yCAAyC,CAAC;AAClE,OAAO,kBAAkB,CAAC;AAC1B,OAAO,EAAE,mBAAmB,EAAE,MAAM,oCAAoC,CAAC;AAEzE,OAAO,EAAE,eAAe,EAAE,MAAM,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QACrE,OAAO,KAAK,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,eAAe,CAAC,wBAAwB,CAAC,CAAC;IACpE,CAAC;IAFe,iCAAkB,qBAEjC,CAAA;;;;;IAED,SAAgB,aAAa,CAAC,KAAoC;QAChE,OAAO,OAAO,CAAC,WAAW,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;IAC9D,CAAC;IAFe,4BAAa,gBAE5B,CAAA;;;;;;IAED,SAAgB,gBAAgB,CAAC,KAAoC,EAAE,UAA2B;QAChG,OAAO,CAAC,cAAc,CAAC,wBAAwB,EAAE,UAAU,EAAE,KAAK,CAAC,CAAC;IACtE,CAAC;IAFe,+BAAgB,mBAE/B,CAAA;AAEH,CAAC,EAlBgB,cAAc,KAAd,cAAc,QAkB9B","sourcesContent":["import { AfterViewInit } from '@angular/core';\nimport {\n assert,\n Binding,\n Constructable,\n DebugContext,\n IMutableHasValue,\n lang, Trace,\n TransactionObserver,\n ValueModel\n} from '@coolon/pectin';\nimport { Klass } from '@coolon/typescript-utilities';\nimport { Memoize } from '@typescript-plus/fast-memoize-decorator';\nimport 'reflect-metadata';\nimport { DisposableComponent } from '../components/disposable-component';\nimport { InteractionContext } from '../interaction/interaction-context';\nimport { PlaceDefinition } from './place-definition';\nimport { ParameterDefinition } from './route/parameter-definition.class';\nimport { Visit } from './visit';\n\n// RAKE: making this Symbol(...) broke things.\nexport const DEFINITION_META_DATA_KEY = 'PLACE_DEFINITION_OPTIONS';\n// this one seems ok.\nexport const ROUTE_PARAMETER_LIST_KEY = Symbol('place:route:parameters');\n\nexport class PlaceComponent extends DisposableComponent {\n\n private visit: ValueModel<Visit>;\n // private _inDeactivationGuard = new MutableValueModel<boolean>(false);\n\n interactionContext?: InteractionContext;\n\n canDeactivate?(interactionContext: InteractionContext): boolean | Promise<boolean>;\n\n constructor() {\n super();\n }\n\n public initialiseVisit(visit: ValueModel<Visit>) {\n assert.isNil(this.visit);\n this.visit = visit;\n DebugContext.get(this.visit).tag(`${this.placeDefinition.component.name}.visit`);\n this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => {\n this.installBinding(parameterDef);\n });\n }\n\n @Trace()\n private installBinding<T, S>(parameterDef: ParameterDefinition<T, S>) {\n const model = this[parameterDef.propertyName] as IMutableHasValue<S>;\n DebugContext.tag(model, `${this.placeDefinition.component.name}.${parameterDef.propertyName}`);\n const binding = this.registerDisposable(new Binding(this.visit, model, {\n toRight(visit: Visit): S {\n const value = visit.getParameter(parameterDef.name);\n console.log('push to component', {name:parameterDef.name, value, visit});\n return value;\n },\n toLeft(value: S, currentVisit?: Visit): Visit {\n console.log('push to route', { name: parameterDef.name, value, currentVisit });\n return currentVisit.replace(parameterDef, value);\n }\n }));\n setTimeout(() => {\n binding.writeRight();\n })\n }\n\n @Memoize()\n get placeDefinition(): PlaceDefinition {\n return PlaceComponent.getDefinition(this.constructor as any as Constructable<PlaceComponent>);\n }\n\n get childPlaces(): Constructable<PlaceComponent>[] {\n return this.placeDefinition.children.map(d => d.component);\n }\n\n onPlaceReady() {\n }\n\n}\n\nexport namespace PlaceComponent {\n\n export function isPlaceComponentConstructor(target: any): target is Constructable<PlaceComponent> {\n return lang.constructorChain(target as Constructable<any>).includes(PlaceComponent);\n }\n\n export function getRouteParameters(klass: Constructable<PlaceComponent>): ParameterDefinition<any>[] {\n return Klass.get(klass).getMetadataList(ROUTE_PARAMETER_LIST_KEY);\n }\n\n export function getDefinition(klass: Constructable<PlaceComponent>): PlaceDefinition {\n return Reflect.getMetadata(DEFINITION_META_DATA_KEY, klass);\n }\n\n export function injectDefinition(klass: Constructable<PlaceComponent>, definition: PlaceDefinition) {\n Reflect.defineMetadata(DEFINITION_META_DATA_KEY, definition, klass);\n }\n\n}\n"]}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* @fileoverview added by tsickle
|
|
3
3
|
* @suppress {checkTypes,extraRequire,missingOverride,missingReturn,unusedPrivateMembers,uselessCode} checked by tsc
|
|
4
4
|
*/
|
|
5
|
-
import {
|
|
5
|
+
import { Binding, DebugContext, Logger, MutableListModel, MutableValueModel } from '@coolon/pectin';
|
|
6
6
|
import { Klass, Opts } from '@coolon/typescript-utilities';
|
|
7
7
|
import { ROUTE_PARAMETER_LIST_KEY } from '../place-component';
|
|
8
8
|
import { ParameterDefinition } from './parameter-definition.class';
|
|
@@ -55,6 +55,57 @@ if (false) {
|
|
|
55
55
|
/** @type {?|undefined} */
|
|
56
56
|
RouteListParameterOptions.prototype.storeInUrl;
|
|
57
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* @template M
|
|
60
|
+
* @param {?} prototype
|
|
61
|
+
* @param {?} propertyKey
|
|
62
|
+
* @param {?} backingModel
|
|
63
|
+
* @param {?} tagPrefix
|
|
64
|
+
* @param {?} isEmpty
|
|
65
|
+
* @return {?}
|
|
66
|
+
*/
|
|
67
|
+
function installMechanics(prototype, propertyKey, backingModel, tagPrefix, isEmpty) {
|
|
68
|
+
/** @type {?} */
|
|
69
|
+
var mechanics = {
|
|
70
|
+
backingModel: backingModel,
|
|
71
|
+
binding: (/** @type {?} */ (null))
|
|
72
|
+
};
|
|
73
|
+
/** @type {?} */
|
|
74
|
+
var tag = tagPrefix + "(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
|
|
75
|
+
DebugContext.get(mechanics.backingModel).tag(tag);
|
|
76
|
+
Logger.get(mechanics.backingModel).tag(tag);
|
|
77
|
+
Object.defineProperty(prototype, propertyKey, {
|
|
78
|
+
get: (/**
|
|
79
|
+
* @return {?}
|
|
80
|
+
*/
|
|
81
|
+
function () {
|
|
82
|
+
return mechanics.backingModel;
|
|
83
|
+
}),
|
|
84
|
+
set: (/**
|
|
85
|
+
* @param {?} userModel
|
|
86
|
+
* @return {?}
|
|
87
|
+
*/
|
|
88
|
+
function (userModel) {
|
|
89
|
+
// This handles the scenario where we want to push an existing value model (such as a form model)
|
|
90
|
+
// to and from the route.
|
|
91
|
+
if (mechanics.binding) {
|
|
92
|
+
mechanics.binding.dispose();
|
|
93
|
+
}
|
|
94
|
+
if (userModel) {
|
|
95
|
+
mechanics.binding = new Binding(mechanics.backingModel, userModel);
|
|
96
|
+
if (isEmpty(userModel)) {
|
|
97
|
+
mechanics.binding.writeRight(); // push the visit into the user model;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
if (!isEmpty(mechanics.backingModel)) {
|
|
101
|
+
console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
|
|
102
|
+
}
|
|
103
|
+
mechanics.binding.writeLeft(); // push the user model into the visit
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
})
|
|
107
|
+
});
|
|
108
|
+
}
|
|
58
109
|
/**
|
|
59
110
|
* @template T
|
|
60
111
|
* @param {?} type
|
|
@@ -71,8 +122,11 @@ export function RouteId(type, options) {
|
|
|
71
122
|
/** @type {?} */
|
|
72
123
|
var param = new ParameterDefinition.RouteId(propertyKey.toString(), options, type);
|
|
73
124
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
74
|
-
|
|
75
|
-
|
|
125
|
+
installMechanics(prototype, propertyKey, new MutableValueModel(), "@RouteId", (/**
|
|
126
|
+
* @param {?} m
|
|
127
|
+
* @return {?}
|
|
128
|
+
*/
|
|
129
|
+
function (m) { return m.query().isNil(); }));
|
|
76
130
|
});
|
|
77
131
|
}
|
|
78
132
|
/**
|
|
@@ -90,10 +144,13 @@ export function VisitParameter(options) {
|
|
|
90
144
|
*/
|
|
91
145
|
function (prototype, propertyKey) {
|
|
92
146
|
/** @type {?} */
|
|
93
|
-
var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional(
|
|
147
|
+
var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
|
|
94
148
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
95
|
-
|
|
96
|
-
|
|
149
|
+
installMechanics(prototype, propertyKey, new MutableValueModel(), "@VisitParameter", (/**
|
|
150
|
+
* @param {?} m
|
|
151
|
+
* @return {?}
|
|
152
|
+
*/
|
|
153
|
+
function (m) { return m.query().isNil(); }));
|
|
97
154
|
});
|
|
98
155
|
}
|
|
99
156
|
/**
|
|
@@ -111,10 +168,13 @@ export function VisitParameterList(options) {
|
|
|
111
168
|
*/
|
|
112
169
|
function (prototype, propertyKey) {
|
|
113
170
|
/** @type {?} */
|
|
114
|
-
var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional(
|
|
115
|
-
UseDelegate({ tag: "@VisitParameterList(" + prototype.constructor.name + "." + propertyKey.toString() + ")" })(prototype, propertyKey);
|
|
116
|
-
// UseDelegate()(prototype, propertyKey);
|
|
171
|
+
var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
|
|
117
172
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
173
|
+
installMechanics(prototype, propertyKey, new MutableListModel(), "@VisitParameterList", (/**
|
|
174
|
+
* @param {?} m
|
|
175
|
+
* @return {?}
|
|
176
|
+
*/
|
|
177
|
+
function (m) { return m.query().isEmpty(); }));
|
|
118
178
|
});
|
|
119
179
|
}
|
|
120
180
|
//# sourceMappingURL=parameter-decorators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parameter-decorators.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/route/parameter-decorators.ts"],"names":[],"mappings":";;;;AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"parameter-decorators.js","sourceRoot":"ng://@coolon/angular-ui-powerups/","sources":["lib/place/route/parameter-decorators.ts"],"names":[],"mappings":";;;;AAAA,OAAO,EACL,OAAO,EACP,YAAY,EAEZ,MAAM,EACN,gBAAgB,EAChB,iBAAiB,EAElB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,MAAM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,SAAS,CAAC,CAAC,oBAAoB,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QAC3E,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,iBAAiB,EAAK,EAAE,iBAAiB;;;;QAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,KAAK,EAAE,CAAC,KAAK,EAAE,EAAjB,CAAiB,EAAC,CAAC;IAClH,CAAC,EAAC;AACJ,CAAC;;;;;;AAED,MAAM,UAAU,kBAAkB,CAAI,OAAsC;;QACpE,IAAI,GAAG,IAAI,CAAC,GAAG,CAAC,OAAO,CAAC;IAC9B;;;;;IAAO,UAAC,SAAiB,EAAE,WAA4B;;YAC/C,KAAK,GAAG,IAAI,mBAAmB,CAAC,cAAc,CAAC,WAAW,CAAC,QAAQ,EAAE,EAAE,OAAO,EAAE,IAAI,CAAC,WAAW,CAAC,YAAY,EAAE,IAAI,CAAC,CAAC;QAC3H,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,CAAC,oBAAoB,CAAC,wBAAwB,EAAE,KAAK,CAAC,CAAC;QAC3E,gBAAgB,CAAC,SAAS,EAAE,WAAW,EAAE,IAAI,gBAAgB,EAAK,EAAE,qBAAqB;;;;QAAE,UAAA,CAAC,IAAI,OAAA,CAAC,CAAC,KAAK,EAAE,CAAC,OAAO,EAAE,EAAnB,CAAmB,EAAC,CAAC;IACvH,CAAC,EAAC;AACJ,CAAC","sourcesContent":["import {\n Binding,\n DebugContext,\n HasValue,\n Logger,\n MutableListModel,\n MutableValueModel,\n UseDelegate\n} from '@coolon/pectin';\nimport { Klass, Opts } from '@coolon/typescript-utilities';\nimport { ROUTE_PARAMETER_LIST_KEY } from '../place-component';\nimport { Formatter } from './formatter';\nimport { ParameterDefinition } from './parameter-definition.class';\n\n\nexport interface RouteIdOptions<T> {\n as?: string;\n optional?: boolean;\n remember?: boolean;\n defaultValue?: T;\n // sanitiser?: Constructable<ParameterSanitiser<T>> | ParameterSanitiser<T>;\n}\n\nexport interface RouteParameterOptions<T> {\n as?: string;\n optional?: boolean;\n remember?: boolean;\n defaultValue?: T;\n storeInUrl?: Formatter<T>\n // sanitiser?: Constructable<ParameterSanitiser<T>> | ParameterSanitiser<T>;\n}\n\nexport interface RouteListParameterOptions<T> {\n as?: string;\n optional?: boolean;\n remember?: boolean;\n defaultValue?: T[];\n storeInUrl?: Formatter<T>\n // sanitiser?: Constructable<ParameterSanitiser<T[]>> | ParameterSanitiser<T[]>;\n}\n\n\nfunction installMechanics<M extends HasValue<any>>(prototype: Object, propertyKey: string | symbol, backingModel: M, tagPrefix: string, isEmpty: (mode: M) => boolean) {\n const mechanics = {\n backingModel: backingModel,\n binding: null as Binding<any, any>\n };\n const tag = `${tagPrefix}(${prototype.constructor.name}.${propertyKey.toString()})`;\n DebugContext.get(mechanics.backingModel).tag(tag);\n Logger.get(mechanics.backingModel).tag(tag);\n Object.defineProperty(prototype, propertyKey, {\n get: function() {\n return mechanics.backingModel;\n },\n set: function(userModel: M) {\n // This handles the scenario where we want to push an existing value model (such as a form model)\n // to and from the route.\n if (mechanics.binding) {\n mechanics.binding.dispose();\n }\n if (userModel) {\n mechanics.binding = new Binding(mechanics.backingModel, userModel);\n if (isEmpty(userModel)) {\n mechanics.binding.writeRight(); // push the visit into the user model;\n } else {\n if (!isEmpty(mechanics.backingModel)) {\n console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');\n }\n mechanics.binding.writeLeft(); // push the user model into the visit\n }\n }\n }\n });\n}\n\nexport function RouteId<T extends string | number>(type: Formatter<T>, options?: RouteIdOptions<T>): PropertyDecorator {\n return (prototype: Object, propertyKey: string | symbol) => {\n const param = new ParameterDefinition.RouteId(propertyKey.toString(), options, type);\n Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);\n installMechanics(prototype, propertyKey, new MutableValueModel<T>(), \"@RouteId\", m => m.query().isNil());\n };\n}\n\nexport function VisitParameter<T>(options?: RouteParameterOptions<T>): PropertyDecorator {\n const opts = Opts.get(options);\n return (prototype: Object, propertyKey: string | symbol) => {\n const param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));\n Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);\n installMechanics(prototype, propertyKey, new MutableValueModel<T>(), \"@VisitParameter\", m => m.query().isNil());\n };\n}\n\nexport function VisitParameterList<E>(options?: RouteListParameterOptions<E>): PropertyDecorator {\n const opts = Opts.get(options);\n return (prototype: Object, propertyKey: string | symbol) => {\n const param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));\n Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);\n installMechanics(prototype, propertyKey, new MutableListModel<E>(), \"@VisitParameterList\", m => m.query().isEmpty());\n };\n}\n"]}
|
|
@@ -2683,14 +2683,6 @@ class PlaceComponent extends DisposableComponent {
|
|
|
2683
2683
|
assert.isNil(this.visit);
|
|
2684
2684
|
this.visit = visit;
|
|
2685
2685
|
DebugContext.get(this.visit).tag(`${this.placeDefinition.component.name}.visit`);
|
|
2686
|
-
// this.placeDefinition.getVisitParameterDefs().forEach(parameterDef => {
|
|
2687
|
-
// this.installBinding(parameterDef);
|
|
2688
|
-
// });
|
|
2689
|
-
}
|
|
2690
|
-
/**
|
|
2691
|
-
* @return {?}
|
|
2692
|
-
*/
|
|
2693
|
-
ngAfterViewInit() {
|
|
2694
2686
|
this.placeDefinition.getVisitParameterDefs().forEach((/**
|
|
2695
2687
|
* @param {?} parameterDef
|
|
2696
2688
|
* @return {?}
|
|
@@ -6831,6 +6823,57 @@ if (false) {
|
|
|
6831
6823
|
/** @type {?|undefined} */
|
|
6832
6824
|
RouteListParameterOptions.prototype.storeInUrl;
|
|
6833
6825
|
}
|
|
6826
|
+
/**
|
|
6827
|
+
* @template M
|
|
6828
|
+
* @param {?} prototype
|
|
6829
|
+
* @param {?} propertyKey
|
|
6830
|
+
* @param {?} backingModel
|
|
6831
|
+
* @param {?} tagPrefix
|
|
6832
|
+
* @param {?} isEmpty
|
|
6833
|
+
* @return {?}
|
|
6834
|
+
*/
|
|
6835
|
+
function installMechanics(prototype, propertyKey, backingModel, tagPrefix, isEmpty) {
|
|
6836
|
+
/** @type {?} */
|
|
6837
|
+
const mechanics = {
|
|
6838
|
+
backingModel: backingModel,
|
|
6839
|
+
binding: (/** @type {?} */ (null))
|
|
6840
|
+
};
|
|
6841
|
+
/** @type {?} */
|
|
6842
|
+
const tag = `${tagPrefix}(${prototype.constructor.name}.${propertyKey.toString()})`;
|
|
6843
|
+
DebugContext.get(mechanics.backingModel).tag(tag);
|
|
6844
|
+
Logger.get(mechanics.backingModel).tag(tag);
|
|
6845
|
+
Object.defineProperty(prototype, propertyKey, {
|
|
6846
|
+
get: (/**
|
|
6847
|
+
* @return {?}
|
|
6848
|
+
*/
|
|
6849
|
+
function () {
|
|
6850
|
+
return mechanics.backingModel;
|
|
6851
|
+
}),
|
|
6852
|
+
set: (/**
|
|
6853
|
+
* @param {?} userModel
|
|
6854
|
+
* @return {?}
|
|
6855
|
+
*/
|
|
6856
|
+
function (userModel) {
|
|
6857
|
+
// This handles the scenario where we want to push an existing value model (such as a form model)
|
|
6858
|
+
// to and from the route.
|
|
6859
|
+
if (mechanics.binding) {
|
|
6860
|
+
mechanics.binding.dispose();
|
|
6861
|
+
}
|
|
6862
|
+
if (userModel) {
|
|
6863
|
+
mechanics.binding = new Binding(mechanics.backingModel, userModel);
|
|
6864
|
+
if (isEmpty(userModel)) {
|
|
6865
|
+
mechanics.binding.writeRight(); // push the visit into the user model;
|
|
6866
|
+
}
|
|
6867
|
+
else {
|
|
6868
|
+
if (!isEmpty(mechanics.backingModel)) {
|
|
6869
|
+
console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
|
|
6870
|
+
}
|
|
6871
|
+
mechanics.binding.writeLeft(); // push the user model into the visit
|
|
6872
|
+
}
|
|
6873
|
+
}
|
|
6874
|
+
})
|
|
6875
|
+
});
|
|
6876
|
+
}
|
|
6834
6877
|
/**
|
|
6835
6878
|
* @template T
|
|
6836
6879
|
* @param {?} type
|
|
@@ -6847,8 +6890,11 @@ function RouteId(type, options) {
|
|
|
6847
6890
|
/** @type {?} */
|
|
6848
6891
|
const param = new ParameterDefinition.RouteId(propertyKey.toString(), options, type);
|
|
6849
6892
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
6850
|
-
|
|
6851
|
-
|
|
6893
|
+
installMechanics(prototype, propertyKey, new MutableValueModel(), "@RouteId", (/**
|
|
6894
|
+
* @param {?} m
|
|
6895
|
+
* @return {?}
|
|
6896
|
+
*/
|
|
6897
|
+
m => m.query().isNil()));
|
|
6852
6898
|
});
|
|
6853
6899
|
}
|
|
6854
6900
|
/**
|
|
@@ -6866,10 +6912,13 @@ function VisitParameter(options) {
|
|
|
6866
6912
|
*/
|
|
6867
6913
|
(prototype, propertyKey) => {
|
|
6868
6914
|
/** @type {?} */
|
|
6869
|
-
const param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional(
|
|
6915
|
+
const param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
|
|
6870
6916
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
6871
|
-
|
|
6872
|
-
|
|
6917
|
+
installMechanics(prototype, propertyKey, new MutableValueModel(), "@VisitParameter", (/**
|
|
6918
|
+
* @param {?} m
|
|
6919
|
+
* @return {?}
|
|
6920
|
+
*/
|
|
6921
|
+
m => m.query().isNil()));
|
|
6873
6922
|
});
|
|
6874
6923
|
}
|
|
6875
6924
|
/**
|
|
@@ -6887,10 +6936,13 @@ function VisitParameterList(options) {
|
|
|
6887
6936
|
*/
|
|
6888
6937
|
(prototype, propertyKey) => {
|
|
6889
6938
|
/** @type {?} */
|
|
6890
|
-
const param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional(
|
|
6891
|
-
UseDelegate({ tag: `@VisitParameterList(${prototype.constructor.name}.${propertyKey.toString()})` })(prototype, propertyKey);
|
|
6892
|
-
// UseDelegate()(prototype, propertyKey);
|
|
6939
|
+
const param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
|
|
6893
6940
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
6941
|
+
installMechanics(prototype, propertyKey, new MutableListModel(), "@VisitParameterList", (/**
|
|
6942
|
+
* @param {?} m
|
|
6943
|
+
* @return {?}
|
|
6944
|
+
*/
|
|
6945
|
+
m => m.query().isEmpty()));
|
|
6894
6946
|
});
|
|
6895
6947
|
}
|
|
6896
6948
|
|