@coolon/angular-ui-powerups 12.4.0-alpha.77 → 12.4.0-alpha.78
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 +12 -7
- package/bundles/coolon-angular-ui-powerups.umd.js.map +1 -1
- package/coolon-angular-ui-powerups.metadata.json +1 -1
- package/esm2015/lib/components/text/markdown/markdown.component.js +12 -7
- package/esm2015/lib/components/text/markdown/markdown.component.js.map +1 -1
- package/esm2015/lib/components/text/markdown/markdown.component.metadata.json +1 -1
- package/fesm2015/coolon-angular-ui-powerups.js +12 -7
- package/fesm2015/coolon-angular-ui-powerups.js.map +1 -1
- package/lib/components/text/markdown/markdown.component.d.ts +1 -0
- package/package.json +1 -1
|
@@ -13,18 +13,23 @@ export class MarkdownComponent extends DisposableComponent {
|
|
|
13
13
|
const { chain } = Dsl.disposeWith(this);
|
|
14
14
|
}
|
|
15
15
|
ngOnInit() {
|
|
16
|
-
const {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
const { when } = Dsl.disposeWith(this);
|
|
17
|
+
when(this.content$).changes(content => this.renderContent(content), { initialValue: 'triggerChangeUnlessNil' });
|
|
18
|
+
if (_.isNil(this.content) && !_.isEmpty(this.element.nativeElement.innerHTML)) {
|
|
19
|
+
this.renderContent(this.element.nativeElement.innerHTML);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
renderContent(content) {
|
|
23
|
+
if (!_.isNil(content)) {
|
|
24
|
+
this.element.nativeElement.innerHTML = this.inline ? this.markdownService.renderInline(content) :
|
|
25
|
+
this.markdownService.render(content);
|
|
26
|
+
}
|
|
22
27
|
}
|
|
23
28
|
}
|
|
24
29
|
MarkdownComponent.decorators = [
|
|
25
30
|
{ type: Component, args: [{
|
|
26
31
|
selector: 'aup-markdown',
|
|
27
|
-
template: "<
|
|
32
|
+
template: "<ng-content></ng-content>\n",
|
|
28
33
|
styles: [":host{display:inline-block}\n"]
|
|
29
34
|
},] }
|
|
30
35
|
];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"markdown.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/text/markdown/markdown.component.ts"],"names":[],"mappings":";AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"markdown.component.js","sourceRoot":"","sources":["../../../../../../../../libs/angular-ui-powerups/src/lib/components/text/markdown/markdown.component.ts"],"names":[],"mappings":";AAAA,OAAO,EAAiB,SAAS,EAAE,UAAU,EAAE,KAAK,EAAqB,MAAM,eAAe,CAAC;AAC/F,OAAO,EAAE,GAAG,EAAE,iBAAiB,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,gBAAgB,CAAC;AACnF,OAAO,KAAK,CAAC,MAAM,QAAQ,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,MAAM,6CAA6C,CAAC;AAC9E,OAAO,EAAE,mBAAmB,EAAE,MAAM,4BAA4B,CAAC;AAOjE,MAAM,OAAO,iBAAkB,SAAQ,mBAAmB;IAaxD,YAA6B,OAAmB,EAAmB,eAAgC;QACjG,KAAK,EAAE,CAAC;QADmB,YAAO,GAAP,OAAO,CAAY;QAAmB,oBAAe,GAAf,eAAe,CAAiB;QAFnG,WAAM,GAAG,KAAK,CAAC;QAIb,MAAM,EAAE,KAAK,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC;IAED,QAAQ;QACN,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;QACvC,IAAI,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,OAAO,CAAC,EAAE,EAAE,YAAY,EAAE,wBAAwB,EAAE,CAAC,CAAC;QAChH,IAAI,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,EAAE;YAC7E,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,CAAC,CAAC;SAC1D;IACH,CAAC;IAEO,aAAa,CAAC,OAAe;QACnC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,EAAE;YACrB,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,SAAS,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,CAAC,eAAe,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC,CAAC;gBAC/F,IAAI,CAAC,eAAe,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;SACxC;IACH,CAAC;;;YApCF,SAAS,SAAC;gBACT,QAAQ,EAAE,cAAc;gBACxB,uCAAwC;;aAEzC;;;YAVkC,UAAU;YAGpC,eAAe;;;uBAUrB,KAAK;sBAIL,KAAK;qBAIL,KAAK;;AANN;IADC,aAAa,EAAE;8BACN,UAAU;mDAAS;AAI7B;IADC,iBAAiB,CAAC,UAAU,CAAC;;kDACd","sourcesContent":["import { AfterViewInit, Component, ElementRef, Input, OnChanges, OnInit } from '@angular/core';\nimport { Dsl, StoreInValueModel, TrackExternal, ValueModel } from '@coolon/pectin';\nimport * as _ from 'lodash';\nimport { MarkdownService } from '../../../services/markdown/markdown.service';\nimport { DisposableComponent } from '../../disposable-component';\n\n@Component({\n selector: 'aup-markdown',\n templateUrl: './markdown.component.html',\n styleUrls: ['./markdown.component.scss']\n})\nexport class MarkdownComponent extends DisposableComponent implements OnInit {\n\n @Input()\n @TrackExternal()\n content$: ValueModel<string>;\n\n @Input()\n @StoreInValueModel('content$')\n content: string;\n\n @Input()\n inline = false;\n\n constructor(private readonly element: ElementRef, private readonly markdownService: MarkdownService) {\n super();\n const { chain } = Dsl.disposeWith(this);\n }\n\n ngOnInit() {\n const { when } = Dsl.disposeWith(this);\n when(this.content$).changes(content => this.renderContent(content), { initialValue: 'triggerChangeUnlessNil' });\n if (_.isNil(this.content) && !_.isEmpty(this.element.nativeElement.innerHTML)) {\n this.renderContent(this.element.nativeElement.innerHTML);\n }\n }\n\n private renderContent(content: string) {\n if (!_.isNil(content)) {\n this.element.nativeElement.innerHTML = this.inline ? this.markdownService.renderInline(content) :\n this.markdownService.render(content);\n }\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
[{"__symbolic":"module","version":4,"metadata":{"MarkdownComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../disposable-component","name":"DisposableComponent","line":11,"character":39},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"aup-markdown","template":"<
|
|
1
|
+
[{"__symbolic":"module","version":4,"metadata":{"MarkdownComponent":{"__symbolic":"class","extends":{"__symbolic":"reference","module":"../../disposable-component","name":"DisposableComponent","line":11,"character":39},"decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Component","line":6,"character":1},"arguments":[{"selector":"aup-markdown","template":"<ng-content></ng-content>\n","styles":[":host{display:inline-block}\n"]}]}],"members":{"content$":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":13,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"TrackExternal","line":14,"character":3}}]}],"content":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":17,"character":3}},{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@coolon/pectin","name":"StoreInValueModel","line":18,"character":3},"arguments":["content$"]}]}],"inline":[{"__symbolic":"property","decorators":[{"__symbolic":"call","expression":{"__symbolic":"reference","module":"@angular/core","name":"Input","line":21,"character":3}}]}],"__ctor__":[{"__symbolic":"constructor","parameters":[{"__symbolic":"reference","module":"@angular/core","name":"ElementRef","line":24,"character":40},{"__symbolic":"reference","module":"../../../services/markdown/markdown.service","name":"MarkdownService","line":24,"character":86}]}],"ngOnInit":[{"__symbolic":"method"}],"renderContent":[{"__symbolic":"method"}]}}}}]
|
|
@@ -4271,18 +4271,23 @@ class MarkdownComponent extends DisposableComponent {
|
|
|
4271
4271
|
const { chain } = Dsl.disposeWith(this);
|
|
4272
4272
|
}
|
|
4273
4273
|
ngOnInit() {
|
|
4274
|
-
const {
|
|
4275
|
-
|
|
4276
|
-
|
|
4277
|
-
|
|
4278
|
-
|
|
4279
|
-
|
|
4274
|
+
const { when } = Dsl.disposeWith(this);
|
|
4275
|
+
when(this.content$).changes(content => this.renderContent(content), { initialValue: 'triggerChangeUnlessNil' });
|
|
4276
|
+
if (_.isNil(this.content) && !_.isEmpty(this.element.nativeElement.innerHTML)) {
|
|
4277
|
+
this.renderContent(this.element.nativeElement.innerHTML);
|
|
4278
|
+
}
|
|
4279
|
+
}
|
|
4280
|
+
renderContent(content) {
|
|
4281
|
+
if (!_.isNil(content)) {
|
|
4282
|
+
this.element.nativeElement.innerHTML = this.inline ? this.markdownService.renderInline(content) :
|
|
4283
|
+
this.markdownService.render(content);
|
|
4284
|
+
}
|
|
4280
4285
|
}
|
|
4281
4286
|
}
|
|
4282
4287
|
MarkdownComponent.decorators = [
|
|
4283
4288
|
{ type: Component, args: [{
|
|
4284
4289
|
selector: 'aup-markdown',
|
|
4285
|
-
template: "<
|
|
4290
|
+
template: "<ng-content></ng-content>\n",
|
|
4286
4291
|
styles: [":host{display:inline-block}\n"]
|
|
4287
4292
|
},] }
|
|
4288
4293
|
];
|