@angular/cdk
Version:
Angular Material Component Development Kit
1 lines • 3.71 kB
Source Map (JSON)
{"version":3,"file":"platform.mjs","sources":["../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/platform/platform-module.ts","../../../../../k8-fastbuild-ST-199a4f3c4e20/bin/src/cdk/platform/features/input-types.ts"],"sourcesContent":["/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.dev/license\n */\n\nimport {NgModule} from '@angular/core';\n\n@NgModule({})\nexport class PlatformModule {}\n","/**\n * @license\n * Copyright Google LLC All Rights Reserved.\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://angular.dev/license\n */\n\n/** Cached result Set of input types support by the current browser. */\nlet supportedInputTypes: Set<string>;\n\n/** Types of `<input>` that *might* be supported. */\nconst candidateInputTypes = [\n // `color` must come first. Chrome 56 shows a warning if we change the type to `color` after\n // first changing it to something else:\n // The specified value \"\" does not conform to the required format.\n // The format is \"#rrggbb\" where rr, gg, bb are two-digit hexadecimal numbers.\n 'color',\n 'button',\n 'checkbox',\n 'date',\n 'datetime-local',\n 'email',\n 'file',\n 'hidden',\n 'image',\n 'month',\n 'number',\n 'password',\n 'radio',\n 'range',\n 'reset',\n 'search',\n 'submit',\n 'tel',\n 'text',\n 'time',\n 'url',\n 'week',\n];\n\n/** @returns The input types supported by this browser. */\nexport function getSupportedInputTypes(): Set<string> {\n // Result is cached.\n if (supportedInputTypes) {\n return supportedInputTypes;\n }\n\n // We can't check if an input type is not supported until we're on the browser, so say that\n // everything is supported when not on the browser. We don't use `Platform` here since it's\n // just a helper function and can't inject it.\n if (typeof document !== 'object' || !document) {\n supportedInputTypes = new Set(candidateInputTypes);\n return supportedInputTypes;\n }\n\n let featureTestInput = document.createElement('input');\n supportedInputTypes = new Set(\n candidateInputTypes.filter(value => {\n featureTestInput.setAttribute('type', value);\n return featureTestInput.type === value;\n }),\n );\n\n return supportedInputTypes;\n}\n"],"names":["PlatformModule","deps","target","i0","ɵɵFactoryTarget","NgModule","decorators","supportedInputTypes","candidateInputTypes","getSupportedInputTypes","document","Set","featureTestInput","createElement","filter","value","setAttribute","type"],"mappings":";;;;;;;;;MAWaA,cAAc,CAAA;;;;;UAAdA,cAAc;AAAAC,IAAAA,IAAA,EAAA,EAAA;AAAAC,IAAAA,MAAA,EAAAC,EAAA,CAAAC,eAAA,CAAAC;AAAA,GAAA,CAAA;;;;;UAAdL;AAAc,GAAA,CAAA;;;;;UAAdA;AAAc,GAAA,CAAA;;;;;;QAAdA,cAAc;AAAAM,EAAAA,UAAA,EAAA,CAAA;UAD1BD,QAAQ;WAAC,EAAE;;;;ACDZ,IAAIE,mBAAgC;AAGpC,MAAMC,mBAAmB,GAAG,CAK1B,OAAO,EACP,QAAQ,EACR,UAAU,EACV,MAAM,EACN,gBAAgB,EAChB,OAAO,EACP,MAAM,EACN,QAAQ,EACR,OAAO,EACP,OAAO,EACP,QAAQ,EACR,UAAU,EACV,OAAO,EACP,OAAO,EACP,OAAO,EACP,QAAQ,EACR,QAAQ,EACR,KAAK,EACL,MAAM,EACN,MAAM,EACN,KAAK,EACL,MAAM,CACP;SAGeC,sBAAsBA,GAAA;AAEpC,EAAA,IAAIF,mBAAmB,EAAE;AACvB,IAAA,OAAOA,mBAAmB;AAC5B;AAKA,EAAA,IAAI,OAAOG,QAAQ,KAAK,QAAQ,IAAI,CAACA,QAAQ,EAAE;AAC7CH,IAAAA,mBAAmB,GAAG,IAAII,GAAG,CAACH,mBAAmB,CAAC;AAClD,IAAA,OAAOD,mBAAmB;AAC5B;AAEA,EAAA,IAAIK,gBAAgB,GAAGF,QAAQ,CAACG,aAAa,CAAC,OAAO,CAAC;EACtDN,mBAAmB,GAAG,IAAII,GAAG,CAC3BH,mBAAmB,CAACM,MAAM,CAACC,KAAK,IAAG;AACjCH,IAAAA,gBAAgB,CAACI,YAAY,CAAC,MAAM,EAAED,KAAK,CAAC;AAC5C,IAAA,OAAOH,gBAAgB,CAACK,IAAI,KAAKF,KAAK;AACxC,GAAC,CAAC,CACH;AAED,EAAA,OAAOR,mBAAmB;AAC5B;;;;"}