@coolon/angular-ui-powerups 11.2.1 → 11.2.3
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 +5 -1
- 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.decorator.js +5 -1
- package/esm2015/lib/place/place.decorator.js.map +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +5 -1
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/place/place.decorator.d.ts +4 -0
- package/package.json +1 -1
|
@@ -4,8 +4,12 @@ import { PlaceComponent } from './place-component';
|
|
|
4
4
|
import { PlaceDefinition } from './place-definition';
|
|
5
5
|
export function Place(options) {
|
|
6
6
|
return (target) => {
|
|
7
|
+
var _a;
|
|
7
8
|
if (PlaceComponent.isPlaceComponentConstructor(target)) {
|
|
8
|
-
PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, _.isNil(options.authenticate) ? true : options.authenticate,
|
|
9
|
+
PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, _.isNil(options.authenticate) ? true : options.authenticate, (_a = options.role) !== null && _a !== void 0 ? _a : options.roles, options.data, PlaceComponent.getRouteParameters(target), (options.children || []).map(c => PlaceComponent.getDefinition(c))));
|
|
10
|
+
if (options.roles) {
|
|
11
|
+
console.warn(`${target.name} @Place({roles: string[]}) is deprecated. Use @Place({role:any}) instead`);
|
|
12
|
+
}
|
|
9
13
|
}
|
|
10
14
|
else {
|
|
11
15
|
lang.illegalState(`${target} must extend PlaceComponent to use the @Place decorator`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"place.decorator.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,IAAI,
|
|
1
|
+
{"version":3,"file":"place.decorator.js","sourceRoot":"","sources":["../../../../../../libs/angular-ui-powerups/src/lib/place/place.decorator.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,IAAI,EAAU,MAAM,gBAAgB,CAAC;AAC7D,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AACnD,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD,MAAM,UAAU,KAAK,CAAC,OAAsB;IAC1C,OAAO,CAAC,MAAgB,EAAE,EAAE;;QAC1B,IAAI,cAAc,CAAC,2BAA2B,CAAC,MAAM,CAAC,EAAE;YACtD,cAAc,CAAC,gBAAgB,CAAC,MAAM,EAAE,IAAI,eAAe,CACzD,MAAM,EACN,OAAO,CAAC,IAAI,EACZ,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,YAAY,QAC3D,OAAO,CAAC,IAAI,mCAAI,OAAO,CAAC,KAAK,EAC7B,OAAO,CAAC,IAAI,EACZ,cAAc,CAAC,kBAAkB,CAAC,MAAM,CAAC,EACzC,CAAC,OAAO,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,cAAc,CAAC,aAAa,CAAC,CAAC,CAAC,CAAC,CACnE,CAAC,CAAC;YAEH,IAAI,OAAO,CAAC,KAAK,EAAE;gBACjB,OAAO,CAAC,IAAI,CAAC,GAAG,MAAM,CAAC,IAAI,2EAA2E,CAAC,CAAA;aACxG;SAEF;aAAM;YACL,IAAI,CAAC,YAAY,CAAC,GAAG,MAAM,yDAAyD,CAAC,CAAC;SACvF;IACH,CAAC,CAAC;AACJ,CAAC","sourcesContent":["import { Constructable, lang, Logger } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { PlaceComponent } from './place-component';\nimport { PlaceDefinition } from './place-definition';\n\nexport function Place(options: Place.Options) {\n return (target: Function) => {\n if (PlaceComponent.isPlaceComponentConstructor(target)) {\n PlaceComponent.injectDefinition(target, new PlaceDefinition(\n target,\n options.path,\n _.isNil(options.authenticate) ? true : options.authenticate,\n options.role ?? options.roles,\n options.data,\n PlaceComponent.getRouteParameters(target),\n (options.children || []).map(c => PlaceComponent.getDefinition(c))\n ));\n\n if (options.roles) {\n console.warn(`${target.name} @Place({roles: string[]}) is deprecated. Use @Place({role:any}) instead`)\n }\n\n } else {\n lang.illegalState(`${target} must extend PlaceComponent to use the @Place decorator`);\n }\n };\n}\n\nexport namespace Place {\n\n export interface Options {\n path: string;\n data?: { [key: string]: any }; // defaults to true\n authenticate?: boolean; // defaults to true\n role?: any; // defaults to empty array\n\n /**\n * @deprecated use #role instead\n */\n roles?: string[]; // defaults to empty array\n\n children?: Constructable<PlaceComponent>[];\n defaultChild?: Constructable<PlaceComponent>;\n }\n\n}\n\n"]}
|
|
@@ -7715,8 +7715,12 @@ DialogInteractionContextFactory.ctorParameters = () => [
|
|
|
7715
7715
|
|
|
7716
7716
|
function Place(options) {
|
|
7717
7717
|
return (target) => {
|
|
7718
|
+
var _a;
|
|
7718
7719
|
if (PlaceComponent.isPlaceComponentConstructor(target)) {
|
|
7719
|
-
PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, isNil(options.authenticate) ? true : options.authenticate,
|
|
7720
|
+
PlaceComponent.injectDefinition(target, new PlaceDefinition(target, options.path, isNil(options.authenticate) ? true : options.authenticate, (_a = options.role) !== null && _a !== void 0 ? _a : options.roles, options.data, PlaceComponent.getRouteParameters(target), (options.children || []).map(c => PlaceComponent.getDefinition(c))));
|
|
7721
|
+
if (options.roles) {
|
|
7722
|
+
console.warn(`${target.name} @Place({roles: string[]}) is deprecated. Use @Place({role:any}) instead`);
|
|
7723
|
+
}
|
|
7720
7724
|
}
|
|
7721
7725
|
else {
|
|
7722
7726
|
lang.illegalState(`${target} must extend PlaceComponent to use the @Place decorator`);
|