UNPKG

@angular/cdk

Version:

Angular Material Component Development Kit

75 lines (70 loc) 2.8 kB
export { _CdkPrivateStyleLoader } from './_style-loader-chunk.mjs'; import * as i0 from '@angular/core'; import { ChangeDetectionStrategy, ViewEncapsulation, Component, SecurityContext } from '@angular/core'; class _VisuallyHiddenLoader { static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.0.0-next.5", ngImport: i0, type: _VisuallyHiddenLoader, deps: [], target: i0.ɵɵFactoryTarget.Component }); static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "22.0.0-next.5", type: _VisuallyHiddenLoader, isStandalone: true, selector: "ng-component", exportAs: ["cdkVisuallyHidden"], ngImport: i0, template: '', isInline: true, styles: [".cdk-visually-hidden {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n white-space: nowrap;\n outline: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n left: 0;\n}\n[dir=rtl] .cdk-visually-hidden {\n left: auto;\n right: 0;\n}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush, encapsulation: i0.ViewEncapsulation.None }); } i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0-next.5", ngImport: i0, type: _VisuallyHiddenLoader, decorators: [{ type: Component, args: [{ exportAs: 'cdkVisuallyHidden', encapsulation: ViewEncapsulation.None, template: '', changeDetection: ChangeDetectionStrategy.OnPush, styles: [".cdk-visually-hidden {\n border: 0;\n clip: rect(0 0 0 0);\n height: 1px;\n margin: -1px;\n overflow: hidden;\n padding: 0;\n position: absolute;\n width: 1px;\n white-space: nowrap;\n outline: 0;\n -webkit-appearance: none;\n -moz-appearance: none;\n left: 0;\n}\n[dir=rtl] .cdk-visually-hidden {\n left: auto;\n right: 0;\n}\n"] }] }] }); let policy; function getPolicy() { if (policy === undefined) { policy = null; if (typeof window !== 'undefined') { const ttWindow = window; if (ttWindow.trustedTypes !== undefined) { policy = ttWindow.trustedTypes.createPolicy('angular#components', { createHTML: s => s }); } } } return policy; } function trustedHTMLFromString(html) { return getPolicy()?.createHTML(html) || html; } function _setInnerHtml(element, html, sanitizer) { const cleanHtml = sanitizer.sanitize(SecurityContext.HTML, html); if (cleanHtml === null && (typeof ngDevMode === 'undefined' || ngDevMode)) { throw new Error(`Could not sanitize HTML: ${html}`); } element.innerHTML = trustedHTMLFromString(cleanHtml || ''); } export { _VisuallyHiddenLoader, _setInnerHtml, trustedHTMLFromString }; //# sourceMappingURL=private.mjs.map