ng-zorro-antd
Version:
An enterprise-class UI components based on Ant Design and Angular
1 lines • 3.68 kB
Source Map (JSON)
{"version":3,"file":"ng-zorro-antd-core-highlight.mjs","sources":["../../components/core/highlight/highlight.pipe.ts","../../components/core/highlight/highlight.module.ts","../../components/core/highlight/public-api.ts","../../components/core/highlight/ng-zorro-antd-core-highlight.ts"],"sourcesContent":["/**\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\nimport { Pipe, PipeTransform } from '@angular/core';\n\nimport { encodeEntities } from 'ng-zorro-antd/core/util';\n\n@Pipe({\n name: 'nzHighlight'\n})\nexport class NzHighlightPipe implements PipeTransform {\n private UNIQUE_WRAPPERS: [string, string] = ['##==-open_tag-==##', '##==-close_tag-==##'];\n\n transform(value: string, highlightValue: string, flags?: string, klass?: string): string | null {\n if (!highlightValue) {\n return value;\n }\n\n // Escapes regex keyword to interpret these characters literally\n const searchValue = new RegExp(highlightValue.replace(/([.*+?^=!:${}()|[\\]/\\\\])/g, '\\\\$&'), flags);\n const wrapValue = value.replace(searchValue, `${this.UNIQUE_WRAPPERS[0]}$&${this.UNIQUE_WRAPPERS[1]}`);\n return encodeEntities(wrapValue)\n .replace(new RegExp(this.UNIQUE_WRAPPERS[0], 'g'), klass ? `<span class=\"${klass}\">` : '<span>')\n .replace(new RegExp(this.UNIQUE_WRAPPERS[1], 'g'), '</span>');\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\nimport { NgModule } from '@angular/core';\n\nimport { NzHighlightPipe } from './highlight.pipe';\n\n/**\n * @deprecated Will be removed in v21, use `NzHighlightPipe` directly instead.\n */\n@NgModule({\n imports: [NzHighlightPipe],\n exports: [NzHighlightPipe]\n})\nexport class NzHighlightModule {}\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\nexport * from './highlight.pipe';\nexport * from './highlight.module';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":[],"mappings":";;;;AAAA;;;AAGG;MASU,eAAe,CAAA;AAClB,IAAA,eAAe,GAAqB,CAAC,oBAAoB,EAAE,qBAAqB,CAAC;AAEzF,IAAA,SAAS,CAAC,KAAa,EAAE,cAAsB,EAAE,KAAc,EAAE,KAAc,EAAA;QAC7E,IAAI,CAAC,cAAc,EAAE;AACnB,YAAA,OAAO,KAAK;;;AAId,QAAA,MAAM,WAAW,GAAG,IAAI,MAAM,CAAC,cAAc,CAAC,OAAO,CAAC,2BAA2B,EAAE,MAAM,CAAC,EAAE,KAAK,CAAC;QAClG,MAAM,SAAS,GAAG,KAAK,CAAC,OAAO,CAAC,WAAW,EAAE,CAAG,EAAA,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAK,EAAA,EAAA,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,CAAE,CAAA,CAAC;QACtG,OAAO,cAAc,CAAC,SAAS;aAC5B,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,KAAK,GAAG,CAAA,aAAA,EAAgB,KAAK,CAAA,EAAA,CAAI,GAAG,QAAQ;AAC9F,aAAA,OAAO,CAAC,IAAI,MAAM,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,SAAS,CAAC;;uGAbtD,eAAe,EAAA,IAAA,EAAA,EAAA,EAAA,MAAA,EAAA,EAAA,CAAA,eAAA,CAAA,IAAA,EAAA,CAAA;qGAAf,eAAe,EAAA,YAAA,EAAA,IAAA,EAAA,IAAA,EAAA,aAAA,EAAA,CAAA;;2FAAf,eAAe,EAAA,UAAA,EAAA,CAAA;kBAH3B,IAAI;AAAC,YAAA,IAAA,EAAA,CAAA;A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