piral-ng-common 11.0.0 → 12.0.0
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "piral-ng-common",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "12.0.0",
|
|
4
4
|
"description": "Common module for piral-ng.",
|
|
5
5
|
"keywords": [],
|
|
6
6
|
"author": "smapiot",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"peerDependencies": {},
|
|
18
18
|
"dependencies": {
|
|
19
|
-
"tslib": "^2.
|
|
19
|
+
"tslib": "^2.2.0"
|
|
20
20
|
},
|
|
21
21
|
"module": "fesm2015/piral-ng-common.js",
|
|
22
22
|
"es2015": "fesm2015/piral-ng-common.js",
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports,require("@angular/common"),require("@angular/core")):"function"==typeof define&&define.amd?define("piral-ng-common",["exports","@angular/common","@angular/core"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self)["piral-ng-common"]={},e.ng.common,e.ng.core)}(this,(function(e,t,n){"use strict";var r=function(){function e(e,t){this.elRef=e,this.piral=t}return e.prototype.ngOnChanges=function(){this.elRef.nativeElement.dispatchEvent(new CustomEvent("extension-props-changed",{detail:{name:this.name,params:this.params}}))},e.prototype.ngAfterContentInit=function(){this.piral.renderHtmlExtension(this.elRef.nativeElement,{name:this.name,params:this.params})},e}();r.decorators=[{type:n.Component,args:[{selector:"extension-component",template:""}]}],r.ctorParameters=function(){return[{type:n.ElementRef},{type:void 0,decorators:[{type:n.Inject,args:["piral"]}]}]},r.propDecorators={name:[{type:n.Input,args:["name"]}],params:[{type:n.Input,args:["params"]}]};var o=function(){function e(e){this.piral=e}return e.prototype.transform=function(e){var t=this.piral.meta.basePath;return(void 0===t?"/":t)+e},e}();o.decorators=[{type:n.Pipe,args:[{name:"resourceUrl"}]}],o.ctorParameters=function(){return[{type:void 0,decorators:[{type:n.Inject,args:["piral"]}]}]};var a=[r,o],i=[r,o],s=[t.CommonModule],p=function(){};p.props={},p.decorators=[{type:n.NgModule,args:[{declarations:a,providers:[],imports:s,exports:i}]}],e.NgExtension=r,e.ResourceUrlPipe=o,e.SharedModule=p,Object.defineProperty(e,"__esModule",{value:!0})}));
|
|
2
|
-
//# sourceMappingURL=piral-ng-common.umd.min.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"names":["NgExtension","elRef","piral","this","prototype","ngOnChanges","nativeElement","dispatchEvent","CustomEvent","detail","name","params","ngAfterContentInit","renderHtmlExtension","type","Component","args","selector","template","ElementRef","undefined","decorators","Inject","Input","ResourceUrlPipe","transform","value","_a","meta","basePath","Pipe","declarationsDef","exportsDef","importsDef","CommonModule","SharedModule","props","NgModule","declarations","providers","imports","exports"],"sources":["../../src/NgExtension.ts","../../src/ResourceUrlPipe.ts","../../src/SharedModule.ts"],"sourcesContent":["import type { PiletApi } from 'piral-core';\nimport { Component, ElementRef, Input, Inject, OnChanges } from '@angular/core';\n\nconst selector = 'extension-component';\n\n@Component({\n selector,\n template: '',\n})\nexport class NgExtension implements OnChanges {\n @Input('name') public name: string | undefined;\n @Input('params') public params: object | undefined;\n\n constructor(private elRef: ElementRef<HTMLElement>, @Inject('piral') private piral: PiletApi) {}\n\n ngOnChanges() {\n this.elRef.nativeElement.dispatchEvent(\n new CustomEvent('extension-props-changed', {\n detail: {\n name: this.name,\n params: this.params,\n },\n }),\n );\n }\n\n ngAfterContentInit() {\n this.piral.renderHtmlExtension(this.elRef.nativeElement, {\n name: this.name,\n params: this.params,\n });\n }\n}\n","import type { PiletApi } from 'piral-core';\nimport { Inject, Pipe, PipeTransform } from '@angular/core';\n\n@Pipe({ name: 'resourceUrl' })\nexport class ResourceUrlPipe implements PipeTransform {\n constructor(@Inject('piral') private piral: PiletApi) {}\n\n transform(value: string): string {\n const { basePath = '/' } = this.piral.meta;\n return basePath + value;\n }\n}\n","import { CommonModule } from '@angular/common';\nimport { NgModule } from '@angular/core';\nimport { NgExtension } from './NgExtension';\nimport { ResourceUrlPipe } from './ResourceUrlPipe';\n\nconst declarationsDef = [NgExtension, ResourceUrlPipe];\nconst exportsDef = [NgExtension, ResourceUrlPipe];\nconst importsDef = [CommonModule];\n\n@NgModule({\n declarations: declarationsDef,\n providers: [],\n imports: importsDef,\n exports: exportsDef,\n})\nexport class SharedModule {\n static props = {};\n}\n"],"mappings":"4XAGA,IAMAA,EAAA,WAIE,SAAoBA,EAAAC,EAAyDC,GAAzDC,KAAKF,MAALA,EAAyDE,KAAKD,MAALA,C,QAE7EF,EAAAI,UAAAC,YAAA,WACEF,KAAKF,MAAMK,cAAcC,cACvB,IAAIC,YAAY,0BAA2B,CACzCC,OAAQ,CACNC,KAAMP,KAAKO,KACXC,OAAQR,KAAKQ,U,EAMrBX,EAAAI,UAAAQ,mBAAA,WACET,KAAKD,MAAMW,oBAAoBV,KAAKF,MAAMK,cAAe,CACvDI,KAAMP,KAAKO,KACXC,OAAQR,KAAKQ,Q,IApBnB,G,cAJC,CAAAG,KAAAC,YAAUC,KAAA,EACTC,SAHe,sBAIfC,SAAU,O,yCANQC,cAYmC,CAAAL,UAAAM,EAAAC,WAAA,EAAAP,KAAAQ,SAAMN,KAAA,CAAC,Y,oBAH3DN,KAAA,EAAAI,KAAAS,QAAKP,KAAA,CAAC,UACNL,OAAA,EAAAG,KAAAS,QAAKP,KAAA,CAAC,aCPT,IAAAQ,EAAA,WACE,SAAAA,EAAqCtB,GAAAC,KAAKD,MAALA,C,QAErCsB,EAASpB,UAAAqB,UAAT,SAAUC,GACA,IAAAC,EAAmBxB,KAAKD,MAAM0B,KAAhBC,SACtB,YADgB,IAAAF,EAAG,IAAGA,GACJD,C,IALtB,G,cADC,CAAAZ,KAAAgB,OAAKd,KAAA,EAAEN,KAAM,kB,mCAEC,CAAAI,UAAAM,EAAAC,WAAA,EAAAP,KAAAQ,SAAMN,KAAA,CAAC,Y,ECAtB,IAAMe,EAAkB,CAAC/B,EAAawB,GAChCQ,EAAa,CAAChC,EAAawB,GAC3BS,EAAa,CAACC,gBAQpBC,EAAA,W,EACSA,EAAKC,MAAG,G,cAPhB,CAAAtB,KAAAuB,WAASrB,KAAA,EACRsB,aAAcP,EACdQ,UAAW,GACXC,QAASP,EACTQ,QAAST,M"}
|