@coolon/angular-ui-powerups 0.0.123 → 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 +66 -82
- 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/route/parameter-decorators.js +67 -83
- 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/route/parameter-decorators.js +67 -83
- package/esm5/lib/place/route/parameter-decorators.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +66 -82
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/fesm5/coolon-angular-ui-powerups.js +66 -82
- package/fesm5/coolon-angular-ui-powerups.js.map +1 -1
- package/package.json +1 -1
|
@@ -8432,6 +8432,57 @@ if (false) {
|
|
|
8432
8432
|
/** @type {?|undefined} */
|
|
8433
8433
|
RouteListParameterOptions.prototype.storeInUrl;
|
|
8434
8434
|
}
|
|
8435
|
+
/**
|
|
8436
|
+
* @template M
|
|
8437
|
+
* @param {?} prototype
|
|
8438
|
+
* @param {?} propertyKey
|
|
8439
|
+
* @param {?} backingModel
|
|
8440
|
+
* @param {?} tagPrefix
|
|
8441
|
+
* @param {?} isEmpty
|
|
8442
|
+
* @return {?}
|
|
8443
|
+
*/
|
|
8444
|
+
function installMechanics(prototype, propertyKey, backingModel, tagPrefix, isEmpty) {
|
|
8445
|
+
/** @type {?} */
|
|
8446
|
+
var mechanics = {
|
|
8447
|
+
backingModel: backingModel,
|
|
8448
|
+
binding: (/** @type {?} */ (null))
|
|
8449
|
+
};
|
|
8450
|
+
/** @type {?} */
|
|
8451
|
+
var tag = tagPrefix + "(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
|
|
8452
|
+
DebugContext.get(mechanics.backingModel).tag(tag);
|
|
8453
|
+
Logger.get(mechanics.backingModel).tag(tag);
|
|
8454
|
+
Object.defineProperty(prototype, propertyKey, {
|
|
8455
|
+
get: (/**
|
|
8456
|
+
* @return {?}
|
|
8457
|
+
*/
|
|
8458
|
+
function () {
|
|
8459
|
+
return mechanics.backingModel;
|
|
8460
|
+
}),
|
|
8461
|
+
set: (/**
|
|
8462
|
+
* @param {?} userModel
|
|
8463
|
+
* @return {?}
|
|
8464
|
+
*/
|
|
8465
|
+
function (userModel) {
|
|
8466
|
+
// This handles the scenario where we want to push an existing value model (such as a form model)
|
|
8467
|
+
// to and from the route.
|
|
8468
|
+
if (mechanics.binding) {
|
|
8469
|
+
mechanics.binding.dispose();
|
|
8470
|
+
}
|
|
8471
|
+
if (userModel) {
|
|
8472
|
+
mechanics.binding = new Binding(mechanics.backingModel, userModel);
|
|
8473
|
+
if (isEmpty(userModel)) {
|
|
8474
|
+
mechanics.binding.writeRight(); // push the visit into the user model;
|
|
8475
|
+
}
|
|
8476
|
+
else {
|
|
8477
|
+
if (!isEmpty(mechanics.backingModel)) {
|
|
8478
|
+
console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
|
|
8479
|
+
}
|
|
8480
|
+
mechanics.binding.writeLeft(); // push the user model into the visit
|
|
8481
|
+
}
|
|
8482
|
+
}
|
|
8483
|
+
})
|
|
8484
|
+
});
|
|
8485
|
+
}
|
|
8435
8486
|
/**
|
|
8436
8487
|
* @template T
|
|
8437
8488
|
* @param {?} type
|
|
@@ -8448,8 +8499,11 @@ function RouteId(type, options) {
|
|
|
8448
8499
|
/** @type {?} */
|
|
8449
8500
|
var param = new ParameterDefinition.RouteId(propertyKey.toString(), options, type);
|
|
8450
8501
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
8451
|
-
|
|
8452
|
-
|
|
8502
|
+
installMechanics(prototype, propertyKey, new MutableValueModel(), "@RouteId", (/**
|
|
8503
|
+
* @param {?} m
|
|
8504
|
+
* @return {?}
|
|
8505
|
+
*/
|
|
8506
|
+
function (m) { return m.query().isNil(); }));
|
|
8453
8507
|
});
|
|
8454
8508
|
}
|
|
8455
8509
|
/**
|
|
@@ -8469,46 +8523,11 @@ function VisitParameter(options) {
|
|
|
8469
8523
|
/** @type {?} */
|
|
8470
8524
|
var param = new ParameterDefinition.ValueParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
|
|
8471
8525
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
8472
|
-
|
|
8473
|
-
|
|
8474
|
-
|
|
8475
|
-
|
|
8476
|
-
};
|
|
8477
|
-
/** @type {?} */
|
|
8478
|
-
var tag = "@VisitParameter(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
|
|
8479
|
-
DebugContext.get(mechanics.backingModel).tag(tag);
|
|
8480
|
-
Logger.get(mechanics.backingModel).tag(tag);
|
|
8481
|
-
Object.defineProperty(prototype, propertyKey, {
|
|
8482
|
-
get: (/**
|
|
8483
|
-
* @return {?}
|
|
8484
|
-
*/
|
|
8485
|
-
function () {
|
|
8486
|
-
return mechanics.backingModel;
|
|
8487
|
-
}),
|
|
8488
|
-
set: (/**
|
|
8489
|
-
* @param {?} userModel
|
|
8490
|
-
* @return {?}
|
|
8491
|
-
*/
|
|
8492
|
-
function (userModel) {
|
|
8493
|
-
// This handles the scenario where we want to push an existing value model (such as a form model)
|
|
8494
|
-
// to and from the route.
|
|
8495
|
-
if (mechanics.binding) {
|
|
8496
|
-
mechanics.binding.dispose();
|
|
8497
|
-
}
|
|
8498
|
-
if (userModel) {
|
|
8499
|
-
mechanics.binding = new Binding(mechanics.backingModel, userModel);
|
|
8500
|
-
if (userModel.query().isNil()) {
|
|
8501
|
-
mechanics.binding.writeRight(); // push the visit into the user model;
|
|
8502
|
-
}
|
|
8503
|
-
else {
|
|
8504
|
-
if (!mechanics.backingModel.query().isNil()) {
|
|
8505
|
-
console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
|
|
8506
|
-
}
|
|
8507
|
-
mechanics.binding.writeLeft(); // push the user model into the visit
|
|
8508
|
-
}
|
|
8509
|
-
}
|
|
8510
|
-
})
|
|
8511
|
-
});
|
|
8526
|
+
installMechanics(prototype, propertyKey, new MutableValueModel(), "@VisitParameter", (/**
|
|
8527
|
+
* @param {?} m
|
|
8528
|
+
* @return {?}
|
|
8529
|
+
*/
|
|
8530
|
+
function (m) { return m.query().isNil(); }));
|
|
8512
8531
|
});
|
|
8513
8532
|
}
|
|
8514
8533
|
/**
|
|
@@ -8528,46 +8547,11 @@ function VisitParameterList(options) {
|
|
|
8528
8547
|
/** @type {?} */
|
|
8529
8548
|
var param = new ParameterDefinition.ArrayParameter(propertyKey.toString(), options, opts.getOptional('storeInUrl', null));
|
|
8530
8549
|
Klass.get(prototype).addToOwnMetadataList(ROUTE_PARAMETER_LIST_KEY, param);
|
|
8531
|
-
|
|
8532
|
-
|
|
8533
|
-
|
|
8534
|
-
|
|
8535
|
-
};
|
|
8536
|
-
/** @type {?} */
|
|
8537
|
-
var tag = "@VisitParameterList(" + prototype.constructor.name + "." + propertyKey.toString() + ")";
|
|
8538
|
-
DebugContext.get(mechanics.backingModel).tag(tag);
|
|
8539
|
-
Logger.get(mechanics.backingModel).tag(tag);
|
|
8540
|
-
Object.defineProperty(prototype, propertyKey, {
|
|
8541
|
-
get: (/**
|
|
8542
|
-
* @return {?}
|
|
8543
|
-
*/
|
|
8544
|
-
function () {
|
|
8545
|
-
return mechanics.backingModel;
|
|
8546
|
-
}),
|
|
8547
|
-
set: (/**
|
|
8548
|
-
* @param {?} userModel
|
|
8549
|
-
* @return {?}
|
|
8550
|
-
*/
|
|
8551
|
-
function (userModel) {
|
|
8552
|
-
// This handles the scenario where we want to push an existing value model (such as a form model)
|
|
8553
|
-
// to and from the route.
|
|
8554
|
-
if (mechanics.binding) {
|
|
8555
|
-
mechanics.binding.dispose();
|
|
8556
|
-
}
|
|
8557
|
-
if (userModel) {
|
|
8558
|
-
mechanics.binding = new Binding(mechanics.backingModel, userModel);
|
|
8559
|
-
if (userModel.query().isEmpty()) {
|
|
8560
|
-
mechanics.binding.writeRight(); // push the visit into the user model;
|
|
8561
|
-
}
|
|
8562
|
-
else {
|
|
8563
|
-
if (!mechanics.backingModel.query().isEmpty()) {
|
|
8564
|
-
console.warn('Assigning a visit model with an existing value to a visit parameter with an existing value. Visit parameter will be overridden');
|
|
8565
|
-
}
|
|
8566
|
-
mechanics.binding.writeLeft(); // push the user model into the visit
|
|
8567
|
-
}
|
|
8568
|
-
}
|
|
8569
|
-
})
|
|
8570
|
-
});
|
|
8550
|
+
installMechanics(prototype, propertyKey, new MutableListModel(), "@VisitParameterList", (/**
|
|
8551
|
+
* @param {?} m
|
|
8552
|
+
* @return {?}
|
|
8553
|
+
*/
|
|
8554
|
+
function (m) { return m.query().isEmpty(); }));
|
|
8571
8555
|
});
|
|
8572
8556
|
}
|
|
8573
8557
|
|