ed80ac9ce125f1b7fd056c367621758aa0770c753ae096ade988c4b329ae5569.json 17 KB

1
  1. {"ast":null,"code":"var _NzStringTemplateOutletDirective, _NzOutletModule;\nimport * as i0 from '@angular/core';\nimport { TemplateRef, Directive, Input, NgModule } from '@angular/core';\n\n/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\nclass NzStringTemplateOutletDirective {\n static ngTemplateContextGuard(_dir, _ctx) {\n return true;\n }\n recreateView() {\n this.viewContainer.clear();\n const isTemplateRef = this.nzStringTemplateOutlet instanceof TemplateRef;\n const templateRef = isTemplateRef ? this.nzStringTemplateOutlet : this.templateRef;\n this.embeddedViewRef = this.viewContainer.createEmbeddedView(templateRef, isTemplateRef ? this.nzStringTemplateOutletContext : this.context);\n }\n updateContext() {\n const isTemplateRef = this.nzStringTemplateOutlet instanceof TemplateRef;\n const newCtx = isTemplateRef ? this.nzStringTemplateOutletContext : this.context;\n const oldCtx = this.embeddedViewRef.context;\n if (newCtx) {\n for (const propName of Object.keys(newCtx)) {\n oldCtx[propName] = newCtx[propName];\n }\n }\n }\n constructor(viewContainer, templateRef) {\n this.viewContainer = viewContainer;\n this.templateRef = templateRef;\n this.embeddedViewRef = null;\n this.context = new NzStringTemplateOutletContext();\n this.nzStringTemplateOutletContext = null;\n this.nzStringTemplateOutlet = null;\n }\n ngOnChanges(changes) {\n const {\n nzStringTemplateOutletContext,\n nzStringTemplateOutlet\n } = changes;\n const shouldRecreateView = () => {\n let shouldOutletRecreate = false;\n if (nzStringTemplateOutlet) {\n if (nzStringTemplateOutlet.firstChange) {\n shouldOutletRecreate = true;\n } else {\n const isPreviousOutletTemplate = nzStringTemplateOutlet.previousValue instanceof TemplateRef;\n const isCurrentOutletTemplate = nzStringTemplateOutlet.currentValue instanceof TemplateRef;\n shouldOutletRecreate = isPreviousOutletTemplate || isCurrentOutletTemplate;\n }\n }\n const hasContextShapeChanged = ctxChange => {\n const prevCtxKeys = Object.keys(ctxChange.previousValue || {});\n const currCtxKeys = Object.keys(ctxChange.currentValue || {});\n if (prevCtxKeys.length === currCtxKeys.length) {\n for (const propName of currCtxKeys) {\n if (prevCtxKeys.indexOf(propName) === -1) {\n return true;\n }\n }\n return false;\n } else {\n return true;\n }\n };\n const shouldContextRecreate = nzStringTemplateOutletContext && hasContextShapeChanged(nzStringTemplateOutletContext);\n return shouldContextRecreate || shouldOutletRecreate;\n };\n if (nzStringTemplateOutlet) {\n this.context.$implicit = nzStringTemplateOutlet.currentValue;\n }\n const recreateView = shouldRecreateView();\n if (recreateView) {\n /** recreate view when context shape or outlet change **/\n this.recreateView();\n } else {\n /** update context **/\n this.updateContext();\n }\n }\n}\n_NzStringTemplateOutletDirective = NzStringTemplateOutletDirective;\n_NzStringTemplateOutletDirective.ɵfac = function _NzStringTemplateOutletDirective_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || _NzStringTemplateOutletDirective)(i0.ɵɵdirectiveInject(i0.ViewContainerRef), i0.ɵɵdirectiveInject(i0.TemplateRef));\n};\n_NzStringTemplateOutletDirective.ɵdir = /* @__PURE__ */i0.ɵɵdefineDirective({\n type: _NzStringTemplateOutletDirective,\n selectors: [[\"\", \"nzStringTemplateOutlet\", \"\"]],\n inputs: {\n nzStringTemplateOutletContext: \"nzStringTemplateOutletContext\",\n nzStringTemplateOutlet: \"nzStringTemplateOutlet\"\n },\n exportAs: [\"nzStringTemplateOutlet\"],\n standalone: true,\n features: [i0.ɵɵNgOnChangesFeature]\n});\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NzStringTemplateOutletDirective, [{\n type: Directive,\n args: [{\n selector: '[nzStringTemplateOutlet]',\n exportAs: 'nzStringTemplateOutlet',\n standalone: true\n }]\n }], () => [{\n type: i0.ViewContainerRef\n }, {\n type: i0.TemplateRef\n }], {\n nzStringTemplateOutletContext: [{\n type: Input\n }],\n nzStringTemplateOutlet: [{\n type: Input\n }]\n });\n})();\nclass NzStringTemplateOutletContext {}\n\n/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\nclass NzOutletModule {}\n_NzOutletModule = NzOutletModule;\n_NzOutletModule.ɵfac = function _NzOutletModule_Factory(__ngFactoryType__) {\n return new (__ngFactoryType__ || _NzOutletModule)();\n};\n_NzOutletModule.ɵmod = /* @__PURE__ */i0.ɵɵdefineNgModule({\n type: _NzOutletModule\n});\n_NzOutletModule.ɵinj = /* @__PURE__ */i0.ɵɵdefineInjector({});\n(() => {\n (typeof ngDevMode === \"undefined\" || ngDevMode) && i0.ɵsetClassMetadata(NzOutletModule, [{\n type: NgModule,\n args: [{\n imports: [NzStringTemplateOutletDirective],\n exports: [NzStringTemplateOutletDirective]\n }]\n }], null, null);\n})();\n\n/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { NzOutletModule, NzStringTemplateOutletDirective };","map":{"version":3,"names":["i0","TemplateRef","Directive","Input","NgModule","NzStringTemplateOutletDirective","ngTemplateContextGuard","_dir","_ctx","recreateView","viewContainer","clear","isTemplateRef","nzStringTemplateOutlet","templateRef","embeddedViewRef","createEmbeddedView","nzStringTemplateOutletContext","context","updateContext","newCtx","oldCtx","propName","Object","keys","constructor","NzStringTemplateOutletContext","ngOnChanges","changes","shouldRecreateView","shouldOutletRecreate","firstChange","isPreviousOutletTemplate","previousValue","isCurrentOutletTemplate","currentValue","hasContextShapeChanged","ctxChange","prevCtxKeys","currCtxKeys","length","indexOf","shouldContextRecreate","$implicit","_NzStringTemplateOutletDirective","ɵfac","_NzStringTemplateOutletDirective_Factory","__ngFactoryType__","ɵɵdirectiveInject","ViewContainerRef","ɵdir","ɵɵdefineDirective","type","selectors","inputs","exportAs","standalone","features","ɵɵNgOnChangesFeature","ngDevMode","ɵsetClassMetadata","args","selector","NzOutletModule","_NzOutletModule","_NzOutletModule_Factory","ɵmod","ɵɵdefineNgModule","ɵinj","ɵɵdefineInjector","imports","exports"],"sources":["F:/workspace/202226701027/huinongbao-app/node_modules/ng-zorro-antd/fesm2022/ng-zorro-antd-core-outlet.mjs"],"sourcesContent":["import * as i0 from '@angular/core';\nimport { TemplateRef, Directive, Input, NgModule } from '@angular/core';\n\n/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\nclass NzStringTemplateOutletDirective {\n static ngTemplateContextGuard(_dir, _ctx) {\n return true;\n }\n recreateView() {\n this.viewContainer.clear();\n const isTemplateRef = this.nzStringTemplateOutlet instanceof TemplateRef;\n const templateRef = (isTemplateRef ? this.nzStringTemplateOutlet : this.templateRef);\n this.embeddedViewRef = this.viewContainer.createEmbeddedView(templateRef, isTemplateRef ? this.nzStringTemplateOutletContext : this.context);\n }\n updateContext() {\n const isTemplateRef = this.nzStringTemplateOutlet instanceof TemplateRef;\n const newCtx = isTemplateRef ? this.nzStringTemplateOutletContext : this.context;\n const oldCtx = this.embeddedViewRef.context;\n if (newCtx) {\n for (const propName of Object.keys(newCtx)) {\n oldCtx[propName] = newCtx[propName];\n }\n }\n }\n constructor(viewContainer, templateRef) {\n this.viewContainer = viewContainer;\n this.templateRef = templateRef;\n this.embeddedViewRef = null;\n this.context = new NzStringTemplateOutletContext();\n this.nzStringTemplateOutletContext = null;\n this.nzStringTemplateOutlet = null;\n }\n ngOnChanges(changes) {\n const { nzStringTemplateOutletContext, nzStringTemplateOutlet } = changes;\n const shouldRecreateView = () => {\n let shouldOutletRecreate = false;\n if (nzStringTemplateOutlet) {\n if (nzStringTemplateOutlet.firstChange) {\n shouldOutletRecreate = true;\n }\n else {\n const isPreviousOutletTemplate = nzStringTemplateOutlet.previousValue instanceof TemplateRef;\n const isCurrentOutletTemplate = nzStringTemplateOutlet.currentValue instanceof TemplateRef;\n shouldOutletRecreate = isPreviousOutletTemplate || isCurrentOutletTemplate;\n }\n }\n const hasContextShapeChanged = (ctxChange) => {\n const prevCtxKeys = Object.keys(ctxChange.previousValue || {});\n const currCtxKeys = Object.keys(ctxChange.currentValue || {});\n if (prevCtxKeys.length === currCtxKeys.length) {\n for (const propName of currCtxKeys) {\n if (prevCtxKeys.indexOf(propName) === -1) {\n return true;\n }\n }\n return false;\n }\n else {\n return true;\n }\n };\n const shouldContextRecreate = nzStringTemplateOutletContext && hasContextShapeChanged(nzStringTemplateOutletContext);\n return shouldContextRecreate || shouldOutletRecreate;\n };\n if (nzStringTemplateOutlet) {\n this.context.$implicit = nzStringTemplateOutlet.currentValue;\n }\n const recreateView = shouldRecreateView();\n if (recreateView) {\n /** recreate view when context shape or outlet change **/\n this.recreateView();\n }\n else {\n /** update context **/\n this.updateContext();\n }\n }\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.1\", ngImport: i0, type: NzStringTemplateOutletDirective, deps: [{ token: i0.ViewContainerRef }, { token: i0.TemplateRef }], target: i0.ɵɵFactoryTarget.Directive }); }\n static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: \"14.0.0\", version: \"18.2.1\", type: NzStringTemplateOutletDirective, isStandalone: true, selector: \"[nzStringTemplateOutlet]\", inputs: { nzStringTemplateOutletContext: \"nzStringTemplateOutletContext\", nzStringTemplateOutlet: \"nzStringTemplateOutlet\" }, exportAs: [\"nzStringTemplateOutlet\"], usesOnChanges: true, ngImport: i0 }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.1\", ngImport: i0, type: NzStringTemplateOutletDirective, decorators: [{\n type: Directive,\n args: [{\n selector: '[nzStringTemplateOutlet]',\n exportAs: 'nzStringTemplateOutlet',\n standalone: true\n }]\n }], ctorParameters: () => [{ type: i0.ViewContainerRef }, { type: i0.TemplateRef }], propDecorators: { nzStringTemplateOutletContext: [{\n type: Input\n }], nzStringTemplateOutlet: [{\n type: Input\n }] } });\nclass NzStringTemplateOutletContext {\n}\n\n/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\nclass NzOutletModule {\n static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: \"12.0.0\", version: \"18.2.1\", ngImport: i0, type: NzOutletModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }\n static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: \"14.0.0\", version: \"18.2.1\", ngImport: i0, type: NzOutletModule, imports: [NzStringTemplateOutletDirective], exports: [NzStringTemplateOutletDirective] }); }\n static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: \"12.0.0\", version: \"18.2.1\", ngImport: i0, type: NzOutletModule }); }\n}\ni0.ɵɵngDeclareClassMetadata({ minVersion: \"12.0.0\", version: \"18.2.1\", ngImport: i0, type: NzOutletModule, decorators: [{\n type: NgModule,\n args: [{\n imports: [NzStringTemplateOutletDirective],\n exports: [NzStringTemplateOutletDirective]\n }]\n }] });\n\n/**\n * Use of this source code is governed by an MIT-style license that can be\n * found in the LICENSE file at https://github.com/NG-ZORRO/ng-zorro-antd/blob/master/LICENSE\n */\n\n/**\n * Generated bundle index. Do not edit.\n */\n\nexport { NzOutletModule, NzStringTemplateOutletDirective };\n"],"mappings":";AAAA,OAAO,KAAKA,EAAE,MAAM,eAAe;AACnC,SAASC,WAAW,EAAEC,SAAS,EAAEC,KAAK,EAAEC,QAAQ,QAAQ,eAAe;;AAEvE;AACA;AACA;AACA;AACA,MAAMC,+BAA+B,CAAC;EAClC,OAAOC,sBAAsBA,CAACC,IAAI,EAAEC,IAAI,EAAE;IACtC,OAAO,IAAI;EACf;EACAC,YAAYA,CAAA,EAAG;IACX,IAAI,CAACC,aAAa,CAACC,KAAK,CAAC,CAAC;IAC1B,MAAMC,aAAa,GAAG,IAAI,CAAC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