\n\n \n\n"],"names":["TuiLink","example","InjectSampleComponent","constructor","selectors","standalone","features","i0","ɵɵStandaloneFeature","decls","vars","consts","template","InjectSampleComponent_Template","rf","ctx","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","ɵɵelement","ɵɵadvance","ɵɵproperty","encapsulation","changeDetection"],"sourceRoot":"webpack:///","x_google_ignoreList":[]}
\ No newline at end of file
diff --git a/666.js b/666.js
index 59c5d3cb..94ce33fc 100644
--- a/666.js
+++ b/666.js
@@ -11,12 +11,11 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
-/* harmony import */ var _taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/addon-doc */ 73);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
+/* harmony import */ var _taiga_ui_addon_doc_components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/addon-doc/components */ 4841);
var _SourceFilesComponent;
-
const code = `import {
createSourceFile,
getSourceFiles,
@@ -67,7 +66,7 @@ _SourceFilesComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MODUL
_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("code", ctx.code);
}
},
- dependencies: [_taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_1__.TuiDocCodeModule, _taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_1__.TuiDocCodeComponent, _taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_1__.TuiDocPageModule, _taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_1__.TuiDocPageComponent],
+ dependencies: [_taiga_ui_addon_doc_components__WEBPACK_IMPORTED_MODULE_1__.TuiDocCode, _taiga_ui_addon_doc_components__WEBPACK_IMPORTED_MODULE_1__.TuiDocPage],
encapsulation: 2,
changeDetection: 0
});
diff --git a/666.js.map b/666.js.map
index c3f5cf70..de130d31 100644
--- a/666.js.map
+++ b/666.js.map
@@ -1 +1 @@
-{"version":3,"file":"666.js","mappings":";;;;;;;;;;;;;;;;AACuE;;;AAEvE,MAAME,IAAI,GAAG;;;;;;;;;;;;;;;;;;;CAmBZ;AAED,MAMqBC,oBAAoB;EANzCC,YAAA;IAOuB,KAAAF,IAAI,GAAGA,IAAI;;;wBADbC,oBAAoB;;mBAApBA,qBAAoB;AAAA;;QAApBA,qBAAoB;EAAAE,SAAA;EAAAC,UAAA;EAAAC,QAAA,GAAAC,iEAAA;EAAAE,KAAA;EAAAC,IAAA;EAAAC,MAAA;EAAAC,QAAA,WAAAC,8BAAAC,EAAA,EAAAC,GAAA;IAAA,IAAAD,EAAA;MC9BzCP,4DAAA,sBAAoC;MAC7BA,oDAAA,iFAA0E;MAAAA,0DAAA,EAAI;MAEjFA,uDAAA,sBAGE;MACNA,0DAAA,EAAe;;;MAFPA,uDAAA,GAAa;MAAbA,wDAAA,SAAAQ,GAAA,CAAAd,IAAA,CAAa;;;iBDqBPF,iEAAgB,EAAAuB,oEAAA,EAAEtB,iEAAgB,EAAAsB,oEAAA;EAAAG,aAAA;EAAAC,eAAA;AAAA;iEAI3BxB,oBAAoB","sources":["./apps/demo/src/app/pages/source-files/index.ts","./apps/demo/src/app/pages/source-files/index.html"],"sourcesContent":["import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {TuiDocCodeModule, TuiDocPageModule} from '@taiga-ui/addon-doc';\n\nconst code = `import {\n createSourceFile,\n getSourceFiles,\n moveSourceFilePaths,\n setActiveProject,\n saveActiveProject,\n} from 'ng-morph';\nimport { dasherize } from '@angular-devkit/core/src/utils/strings';\n\nsetActiveProject(createProject(new NgMorphTree(), '/', ['**/*.ts'));\n\ncreateSourceFile('some/path/file.ts', 'const a = \"hello\";');\n\nconst sourceFiles = getSourceFiles('some/**/*.ts');\n\n// It gets a function that process every file\nmoveSourceFilePaths(sourceFiles, dasherize);\n\nsaveActiveProject();\n`;\n\n@Component({\n standalone: true,\n imports: [TuiDocCodeModule, TuiDocPageModule],\n templateUrl: './index.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class SourceFilesComponent {\n protected readonly code = code;\n}\n","\n
You can create, get and move sources files of the project and their paths.
\n\n \n\n"],"names":["TuiDocCodeModule","TuiDocPageModule","code","SourceFilesComponent","constructor","selectors","standalone","features","i0","ɵɵStandaloneFeature","decls","vars","consts","template","SourceFilesComponent_Template","rf","ctx","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","ɵɵelement","ɵɵadvance","ɵɵproperty","i1","TuiDocCodeComponent","TuiDocPageComponent","encapsulation","changeDetection"],"sourceRoot":"webpack:///","x_google_ignoreList":[]}
\ No newline at end of file
+{"version":3,"file":"666.js","mappings":";;;;;;;;;;;;;;;;;;AAGA,MAAMA,IAAI,GAAG;;;;;;;;;;;;;;;;;;;CAmBZ;AAED,MAMqBC,oBAAoB;EANzCC,YAAA;IAOuB,KAAAF,IAAI,GAAGA,IAAI;;;wBADbC,oBAAoB;;mBAApBA,qBAAoB;AAAA;;QAApBA,qBAAoB;EAAAE,SAAA;EAAAC,UAAA;EAAAC,QAAA,GAAAC,iEAAA;EAAAE,KAAA;EAAAC,IAAA;EAAAC,MAAA;EAAAC,QAAA,WAAAC,8BAAAC,EAAA,EAAAC,GAAA;IAAA,IAAAD,EAAA;MC9BzCP,4DAAA,sBAAoC;MAC7BA,oDAAA,iFAA0E;MAAAA,0DAAA,EAAI;MAEjFA,uDAAA,sBAGE;MACNA,0DAAA,EAAe;;;MAFPA,uDAAA,GAAa;MAAbA,wDAAA,SAAAQ,GAAA,CAAAd,IAAA,CAAa;;;;;;;iEDyBAC,oBAAoB","sources":["./apps/demo/src/app/pages/source-files/index.ts","./apps/demo/src/app/pages/source-files/index.html"],"sourcesContent":["import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {TuiAddonDoc} from '@taiga-ui/addon-doc';\n\nconst code = `import {\n createSourceFile,\n getSourceFiles,\n moveSourceFilePaths,\n setActiveProject,\n saveActiveProject,\n} from 'ng-morph';\nimport { dasherize } from '@angular-devkit/core/src/utils/strings';\n\nsetActiveProject(createProject(new NgMorphTree(), '/', ['**/*.ts'));\n\ncreateSourceFile('some/path/file.ts', 'const a = \"hello\";');\n\nconst sourceFiles = getSourceFiles('some/**/*.ts');\n\n// It gets a function that process every file\nmoveSourceFilePaths(sourceFiles, dasherize);\n\nsaveActiveProject();\n`;\n\n@Component({\n standalone: true,\n imports: [TuiAddonDoc],\n templateUrl: './index.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class SourceFilesComponent {\n protected readonly code = code;\n}\n","\n
You can create, get and move sources files of the project and their paths.
You can create, get, edit and remove variables in your files with declarative descriptions and conditions.
\n\n \n\n"],"names":["TuiAddonDocModule","code","VariablesComponent","constructor","selectors","standalone","features","i0","ɵɵStandaloneFeature","decls","vars","consts","template","VariablesComponent_Template","rf","ctx","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","ɵɵelement","ɵɵadvance","ɵɵproperty","i1","TuiDocCodeComponent","TuiDocPageComponent","encapsulation","changeDetection"],"sourceRoot":"webpack:///","x_google_ignoreList":[]}
\ No newline at end of file
+{"version":3,"file":"90.js","mappings":";;;;;;;;;;;;;;;;;;AAGA,MAAMA,IAAI,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8BZ;AAED,MAOqBC,kBAAkB;EAPvCC,YAAA;IAQuB,KAAAF,IAAI,GAAGA,IAAI;;;sBADbC,kBAAkB;;mBAAlBA,mBAAkB;AAAA;;QAAlBA,mBAAkB;EAAAE,SAAA;EAAAC,UAAA;EAAAC,QAAA,GAAAC,iEAAA;EAAAE,KAAA;EAAAC,IAAA;EAAAC,MAAA;EAAAC,QAAA,WAAAC,4BAAAC,EAAA,EAAAC,GAAA;IAAA,IAAAD,EAAA;MC1CvCP,4DAAA,sBAAiC;MAC1BA,oDAAA,iHAA0G;MAAAA,0DAAA,EAAI;MAEjHA,uDAAA,sBAGE;MACNA,0DAAA,EAAe;;;MAFPA,uDAAA,GAAa;MAAbA,wDAAA,SAAAQ,GAAA,CAAAd,IAAA,CAAa;;;;;;;iEDqCAC,kBAAkB","sources":["./apps/demo/src/app/pages/variables/index.ts","./apps/demo/src/app/pages/variables/index.html"],"sourcesContent":["import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {TuiAddonDoc} from '@taiga-ui/addon-doc';\n\nconst code = `import {\n addVariables,\n editVariables,\n getVariables,\n removeVariables,\n setActiveProject,\n saveActiveProject,\n} from 'ng-morph';\n\nsetActiveProject(createProject(new NgMorphTree(), '/', ['**/*.ts'));\n\naddVariables('some/path/file.ts', {\n declarationKind: VariableDeclarationKind.Const,\n declarations: [\n {\n name: 'name',\n initializer: \"'value'\",\n },\n ],\n});\n\nconst declarations = getVariables('some/path/**.ts');\n\neditVariables(declarations, () => ({\n name: 'B',\n}));\n\nremoveVariables(declarations);\n\nsaveActiveProject();\n`;\n\n@Component({\n standalone: true,\n selector: 'variables',\n imports: [TuiAddonDoc],\n templateUrl: './index.html',\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class VariablesComponent {\n protected readonly code = code;\n}\n","\n
You can create, get, edit and remove variables in your files with declarative descriptions and conditions.
\n\n \n\n"],"names":["code","VariablesComponent","constructor","selectors","standalone","features","i0","ɵɵStandaloneFeature","decls","vars","consts","template","VariablesComponent_Template","rf","ctx","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","ɵɵelement","ɵɵadvance","ɵɵproperty"],"sourceRoot":"webpack:///","x_google_ignoreList":[]}
\ No newline at end of file
diff --git a/956.js b/956.js
index e66a8089..4d6921c3 100644
--- a/956.js
+++ b/956.js
@@ -12,16 +12,14 @@ __webpack_require__.r(__webpack_exports__);
/* harmony export */ "default": () => (__WEBPACK_DEFAULT_EXPORT__)
/* harmony export */ });
/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/router */ 1099);
-/* harmony import */ var _taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/addon-doc */ 73);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core */ 578);
+/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core */ 1534);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
+/* harmony import */ var _taiga_ui_addon_doc_components__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/addon-doc/components */ 4841);
var _GettingStartedComponent;
-
-
const script = `import {
setActiveProject,
createProject,
@@ -283,7 +281,7 @@ _GettingStartedComponent.ɵcmp = /*@__PURE__*/_angular_core__WEBPACK_IMPORTED_MO
_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("code", ctx.creatingSpec);
}
},
- dependencies: [_angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterLink, _taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_2__.TuiDocCodeModule, _taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_2__.TuiDocCodeComponent, _taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_2__.TuiDocPageModule, _taiga_ui_addon_doc__WEBPACK_IMPORTED_MODULE_2__.TuiDocPageComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__.TuiLinkModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__.TuiLinkComponent],
+ dependencies: [_angular_router__WEBPACK_IMPORTED_MODULE_1__.RouterLink, _taiga_ui_addon_doc_components__WEBPACK_IMPORTED_MODULE_2__.TuiDocCode, _taiga_ui_addon_doc_components__WEBPACK_IMPORTED_MODULE_2__.TuiDocPage, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__.TuiLink],
styles: ["[_nghost-%COMP%] {max-width: 1200px}\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbImluZGV4LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiJBQUFBLE9BQU8saUJBQWlCIiwiZmlsZSI6ImluZGV4LnRzIiwic291cmNlc0NvbnRlbnQiOlsiOmhvc3Qge21heC13aWR0aDogMTIwMHB4fSJdfQ== */\n/*# sourceMappingURL=data:application/json;charset=utf-8;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbIndlYnBhY2s6Ly8uL2FwcHMvZGVtby9zcmMvYXBwL2dldHRpbmctc3RhcnRlZC9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSxPQUFPLGlCQUFpQjtBQUN4QixvUEFBb1AiLCJzb3VyY2VzQ29udGVudCI6WyI6aG9zdCB7bWF4LXdpZHRoOiAxMjAwcHh9Il0sInNvdXJjZVJvb3QiOiIifQ== */"],
changeDetection: 0
});
diff --git a/956.js.map b/956.js.map
index 3ce2dc00..aa210a81 100644
--- a/956.js.map
+++ b/956.js.map
@@ -1 +1 @@
-{"version":3,"file":"956.js","mappings":";;;;;;;;;;;;;;;;;;AAC2C;AAC4B;AAC1B;;;;AAE7C,MAAMI,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCd;AAED,MAAMC,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkClB;AAEH,MAAMC,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDpB;AAED,MAQqBC,uBAAuB;EAR5CC,YAAA;IASuB,KAAAJ,MAAM,GAAGA,MAAM;IACf,KAAAC,YAAY,GAAGA,YAAY;IAC3B,KAAAC,YAAY,GAAGA,YAAY;;;2BAH7BC,uBAAuB;;mBAAvBA,wBAAuB;AAAA;;QAAvBA,wBAAuB;EAAAE,SAAA;EAAAC,UAAA;EAAAC,QAAA,GAAAC,iEAAA;EAAAE,KAAA;EAAAC,IAAA;EAAAC,MAAA;EAAAC,QAAA,WAAAC,iCAAAC,EAAA,EAAAC,GAAA;IAAA,IAAAD,EAAA;MC1I5CP,4DAAA,sBAAuC;MAEvBA,oDAAA,sBAAoB;MAAAA,0DAAA,EAAS;MACrCA,oDAAA,0IAEA;MAAAA,4DAAA,WAGC;MACGA,oDAAA,iBACJ;MAAAA,0DAAA,EAAI;MACJA,oDAAA,8EACJ;MAAAA,0DAAA,EAAI;MAEJA,4DAAA,cAAS;MACDA,oDAAA,iDAAyC;MAAAA,0DAAA,EAAK;MAElDA,4DAAA,UAAI;MACIA,oDAAA,wGAAsF;MAAAA,0DAAA,EAAK;MAE/FA,4DAAA,UAAI;MACAA,oDAAA,iIAEJ;MAAAA,0DAAA,EAAK;MAELA,4DAAA,UAAI;MACAA,oDAAA,8LAEJ;MAAAA,0DAAA,EAAK;MAIbA,4DAAA,UAAI;MAAAA,oDAAA,sBAAc;MAAAA,0DAAA,EAAK;MAEvBA,uDAAA,uBAAiD;MAEjDA,4DAAA,SAAG;MACCA,oDAAA,uBACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,4BAAwB;MAAAA,0DAAA,EAAO;MACrCA,oDAAA,aACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,kCAA8B;MAAAA,0DAAA,EAAO;MAC3CA,oDAAA,0BACJ;MAAAA,0DAAA,EAAI;MAEJA,4DAAA,SAAG;MAAAA,oDAAA,cAAM;MAAAA,0DAAA,EAAI;MAEbA,4DAAA,eAAS;MACDA,oDAAA,kCAA+B;MAAAA,0DAAA,EAAK;MAExCA,4DAAA,UAAI;MAAAA,oDAAA,+CAAuC;MAAAA,0DAAA,EAAK;MAEhDA,4DAAA,SAAG;MACCA,oDAAA,8MAEJ;MAAAA,0DAAA,EAAI;MAEJA,uDAAA,uBAGE;MAEFA,4DAAA,SAAG;MACCA,oDAAA,4EACA;MAAAA,4DAAA,YAKC;MACGA,oDAAA,iBACJ;MAAAA,0DAAA,EAAI;MACJA,oDAAA,oEACJ;MAAAA,0DAAA,EAAI;MAEJA,4DAAA,UAAI;MAAAA,oDAAA,yDAAiD;MAAAA,0DAAA,EAAK;MAE1DA,oDAAA,2JAGA;MAAAA,4DAAA,SAAG;MACCA,oDAAA,0BACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,cAAM;MAAAA,0DAAA,EAAO;MACnBA,oDAAA,YACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,iBAAS;MAAAA,0DAAA,EAAO;MACtBA,oDAAA,kCACA;MAAAA,4DAAA,YAKC;MACGA,oDAAA,cACJ;MAAAA,0DAAA,EAAI;MACJA,oDAAA,yCACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,YAAI;MAAAA,0DAAA,EAAO;MACjBA,oDAAA,2DACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,wBAAgB;MAAAA,0DAAA,EAAO;MAC7BA,oDAAA,mDACJ;MAAAA,0DAAA,EAAI;MAEJA,uDAAA,uBAGE;MACNA,0DAAA,EAAU;MAEVA,4DAAA,eAAS;MACDA,oDAAA,mCAA2B;MAAAA,0DAAA,EAAK;MAEpCA,4DAAA,SAAG;MAAAA,oDAAA,8FAAsF;MAAAA,0DAAA,EAAI;MAE7FA,4DAAA,SAAG;MAAAA,oDAAA,8CAAsC;MAAAA,0DAAA,EAAI;MAE7CA,uDAAA,uBAGE;MACNA,0DAAA,EAAU;MAEVA,4DAAA,eAAS;MACDA,oDAAA,qBAAa;MAAAA,0DAAA,EAAK;MAEtBA,4DAAA,SAAG;MACCA,oDAAA,2DACA;MAAAA,4DAAA,YAKC;MACGA,oDAAA,+BACJ;MAAAA,0DAAA,EAAI;MACJA,oDAAA,iHACA;MAAAA,4DAAA,YAGC;MACGA,oDAAA,iBACJ;MAAAA,0DAAA,EAAI;;;MAhFJA,uDAAA,IAAe;MAAfA,wDAAA,SAAAQ,GAAA,CAAAhB,MAAA,CAAe;MA4CfQ,uDAAA,IAAqB;MAArBA,wDAAA,SAAAQ,GAAA,CAAAf,YAAA,CAAqB;MAarBO,uDAAA,GAAqB;MAArBA,wDAAA,SAAAQ,GAAA,CAAAd,YAAA,CAAqB;;;iBDkBnBN,uDAAU,EAAEC,iEAAgB,EAAA0B,oEAAA,EAAEzB,iEAAgB,EAAAyB,oEAAA,EAAExB,yDAAa,EAAA2B,4DAAA;EAAAE,MAAA;EAAAC,eAAA;AAAA;iEAKtD1B,uBAAuB","sources":["./apps/demo/src/app/getting-started/index.ts","./apps/demo/src/app/getting-started/index.html"],"sourcesContent":["import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {RouterLink} from '@angular/router';\nimport {TuiDocCodeModule, TuiDocPageModule} from '@taiga-ui/addon-doc';\nimport {TuiLinkModule} from '@taiga-ui/core';\n\nconst script = `import {\n setActiveProject,\n createProject,\n getImports,\n NgMorphTree,\n} from 'ng-morph';\n\n/**\n * set all ng-morph functions to work with the all TS and JSON files\n * of the current project\n * */\nsetActiveProject(\n createProject(new NgMorphTree(), '/', ['**/*.ts', '**/*.json'])\n);\n\n/**\n * This simple migration gets all imports from the project TS files and\n * replaces 'old' substring with 'new'\n * */\nconst imports = getImports('some/path/**.ts', {\n moduleSpecifier: '@morph-old*',\n});\n\neditImports(imports, importEntity => ({\n moduleSpecifier: importEntity.moduleSpecifier.replace('old', 'new')\n}));\n\n/**\n * All changes are made in a virtual project.\n * You can save them when it is time\n * */\nsaveActiveProject();\n`;\n\nconst creatingRule = `import {\n setActiveProject,\n saveActiveProject,\n createProject,\n getImports,\n editImports,\n} from 'ng-morph';\n\nexport default (): Rule => {\n return tree => {\n /**\n * set all ng-morph functions to work with the all TS and JSON files\n * of the current project\n * */\n setActiveProject(createProject(tree, '/', ['**/*.ts', '**/*.json']));\n\n /**\n * This function gets all imports from the project TS files and\n * replaces 'old' substring with 'new'\n * */\n const imports = getImports('some/path/**.ts', {\n moduleSpecifier: '@morph-old*',\n });\n\n editImports(imports, importEntity => ({\n moduleSpecifier: importEntity.moduleSpecifier.replace('old', 'new')\n }));\n\n /**\n * All changes are made in a virtual project.\n * You can save them when it is time\n * */\n saveActiveProject();\n };\n};`;\n\nconst creatingSpec = `\n// We use schematics devkit to emulate virtual Tree\nimport {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';\nimport {HostTree} from '@angular-devkit/schematics';\n\n// We can emulate filesystem with ng-morph\nimport {\n createProject,\n resetActiveProject,\n setActiveProject,\n createSourceFile,\n saveActiveProject,\n} from 'ng-morph';\n\nconst collectionPath = join(__dirname, '../collection.json');\n\ndescribe('ng-add', () => {\n describe('removes old postfix', () => {\n let host: UnitTestTree;\n let runner: SchematicTestRunner;\n\n beforeEach(() => {\n host = new UnitTestTree(new HostTree());\n runner = new SchematicTestRunner('schematics', collectionPath);\n\n // preparing virtual file tree with one file\n setActiveProject(createProject(host));\n\n createSourceFile(\n 'src/module.ts',\n \"import {a} from '@morph-old/core';\",\n );\n\n saveActiveProject();\n });\n\n it('should replace old with new in TS imports', async () => {\n expect.assertions(1);\n\n // Our migration returns Tree\n const tree = await runner.runSchematicAsync('ng-add', {}, host).toPromise();\n\n expect(tree.readContent('src/module.ts')).toEqual(\n \"import {a} from '@morph-new/core';\",\n );\n });\n\n afterEach(() => {\n // clear it up\n resetActiveProject();\n });\n });\n});\n`;\n\n@Component({\n standalone: true,\n selector: 'getting-started',\n imports: [RouterLink, TuiDocCodeModule, TuiDocPageModule, TuiLinkModule],\n templateUrl: './index.html',\n styles: [':host {max-width: 1200px}'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class GettingStartedComponent {\n protected readonly script = script;\n protected readonly creatingRule = creatingRule;\n protected readonly creatingSpec = creatingSpec;\n}\n","\n
\n @taiga-ui/morph\n is a large set of tools for both global code base updates in your project and speeding up your work on Angular\n schematics. It has\n \n ts-morph\n \n under the hood and allows you to manipulate with safe TypeScript AST.\n
\n\n \n
Why is it better than default schematics?
\n\n
\n
🦅 You can quickly write migrations for your own project and run it as a simple script
\n\n
\n 🛠 There are many tools made for working with Angular. You can easily find and manipulate TS and Ng\n entities.\n
\n\n
\n ✅ You work with an abstract tree and it can be replaced, for example, with virtual tree for testing\n instead of real file system. So, you can test your schematics rapidly fast.\n
\n
\n \n\n
How to install
\n\n \n\n
\n You also need\n @angular-devkit/core\n and\n @angular-devkit/schematics\n to be installed.\n
\n\n
Enjoy!
\n\n \n
How to run @taiga-ui/morph
\n\n
Running in your own project as a script
\n\n
\n You can use @taiga-ui/morph for global updates of your porject code base, big refactiorings,\n dependencies migrations and much more. Just describe everything you want in a simple script and run it.\n
\n\n \n\n
\n Now you can compile and run this script or just use something like\n \n ts-node\n \n that allows you to start TS script as soon as it is ready.\n
\n\n
Creating schematics for publishing with libraries
\n\n You can write schematics scripts to simplify your library installation or make fully automated migrations\n between releases with breaking changes.\n\n
\n Creating Angular\n ng-add\n or\n ng-update\n schematics you work with\n \n Rule\n \n functions. Rule function gets a\n Tree\n as a first argument and you can pass this tree to\n setActiveProject\n function from ng-morph the following way:\n
\n\n \n \n\n \n
How to test your schematics
\n\n
You can use any test runner you like to check that your schematics work as you expect.
\n\n
Let's try to test the migration above:
\n\n \n \n\n \n
What is next?
\n\n
\n So, now you know how to set it up. Give a star to\n \n our project on Github\n \n and start exploring utils in the left menu to find all the tools you need. We suggest you to start with\n \n Classes\n \n
\n \n\n"],"names":["RouterLink","TuiDocCodeModule","TuiDocPageModule","TuiLinkModule","script","creatingRule","creatingSpec","GettingStartedComponent","constructor","selectors","standalone","features","i0","ɵɵStandaloneFeature","decls","vars","consts","template","GettingStartedComponent_Template","rf","ctx","ɵɵelementStart","ɵɵtext","ɵɵelementEnd","ɵɵelement","ɵɵadvance","ɵɵproperty","i1","TuiDocCodeComponent","TuiDocPageComponent","i2","TuiLinkComponent","styles","changeDetection"],"sourceRoot":"webpack:///","x_google_ignoreList":[]}
\ No newline at end of file
+{"version":3,"file":"956.js","mappings":";;;;;;;;;;;;;;;;;;AAC2C;AAEJ;;;AAEvC,MAAME,MAAM,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAgCd;AAED,MAAMC,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkClB;AAEH,MAAMC,YAAY,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqDpB;AAED,MAQqBC,uBAAuB;EAR5CC,YAAA;IASuB,KAAAJ,MAAM,GAAGA,MAAM;IACf,KAAAC,YAAY,GAAGA,YAAY;IAC3B,KAAAC,YAAY,GAAGA,YAAY;;;2BAH7BC,uBAAuB;;mBAAvBA,wBAAuB;AAAA;;QAAvBA,wBAAuB;EAAAE,SAAA;EAAAC,UAAA;EAAAC,QAAA,GAAAC,iEAAA;EAAAE,KAAA;EAAAC,IAAA;EAAAC,MAAA;EAAAC,QAAA,WAAAC,iCAAAC,EAAA,EAAAC,GAAA;IAAA,IAAAD,EAAA;MC1I5CP,4DAAA,sBAAuC;MAEvBA,oDAAA,sBAAoB;MAAAA,0DAAA,EAAS;MACrCA,oDAAA,0IAEA;MAAAA,4DAAA,WAGC;MACGA,oDAAA,iBACJ;MAAAA,0DAAA,EAAI;MACJA,oDAAA,8EACJ;MAAAA,0DAAA,EAAI;MAEJA,4DAAA,cAAS;MACDA,oDAAA,iDAAyC;MAAAA,0DAAA,EAAK;MAElDA,4DAAA,UAAI;MACIA,oDAAA,wGAAsF;MAAAA,0DAAA,EAAK;MAE/FA,4DAAA,UAAI;MACAA,oDAAA,iIAEJ;MAAAA,0DAAA,EAAK;MAELA,4DAAA,UAAI;MACAA,oDAAA,8LAEJ;MAAAA,0DAAA,EAAK;MAIbA,4DAAA,UAAI;MAAAA,oDAAA,sBAAc;MAAAA,0DAAA,EAAK;MAEvBA,uDAAA,uBAAiD;MAEjDA,4DAAA,SAAG;MACCA,oDAAA,uBACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,4BAAwB;MAAAA,0DAAA,EAAO;MACrCA,oDAAA,aACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,kCAA8B;MAAAA,0DAAA,EAAO;MAC3CA,oDAAA,0BACJ;MAAAA,0DAAA,EAAI;MAEJA,4DAAA,SAAG;MAAAA,oDAAA,cAAM;MAAAA,0DAAA,EAAI;MAEbA,4DAAA,eAAS;MACDA,oDAAA,kCAA+B;MAAAA,0DAAA,EAAK;MAExCA,4DAAA,UAAI;MAAAA,oDAAA,+CAAuC;MAAAA,0DAAA,EAAK;MAEhDA,4DAAA,SAAG;MACCA,oDAAA,8MAEJ;MAAAA,0DAAA,EAAI;MAEJA,uDAAA,uBAGE;MAEFA,4DAAA,SAAG;MACCA,oDAAA,4EACA;MAAAA,4DAAA,YAKC;MACGA,oDAAA,iBACJ;MAAAA,0DAAA,EAAI;MACJA,oDAAA,oEACJ;MAAAA,0DAAA,EAAI;MAEJA,4DAAA,UAAI;MAAAA,oDAAA,yDAAiD;MAAAA,0DAAA,EAAK;MAE1DA,oDAAA,2JAGA;MAAAA,4DAAA,SAAG;MACCA,oDAAA,0BACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,cAAM;MAAAA,0DAAA,EAAO;MACnBA,oDAAA,YACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,iBAAS;MAAAA,0DAAA,EAAO;MACtBA,oDAAA,kCACA;MAAAA,4DAAA,YAKC;MACGA,oDAAA,cACJ;MAAAA,0DAAA,EAAI;MACJA,oDAAA,yCACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,YAAI;MAAAA,0DAAA,EAAO;MACjBA,oDAAA,2DACA;MAAAA,4DAAA,YAAM;MAAAA,oDAAA,wBAAgB;MAAAA,0DAAA,EAAO;MAC7BA,oDAAA,mDACJ;MAAAA,0DAAA,EAAI;MAEJA,uDAAA,uBAGE;MACNA,0DAAA,EAAU;MAEVA,4DAAA,eAAS;MACDA,oDAAA,mCAA2B;MAAAA,0DAAA,EAAK;MAEpCA,4DAAA,SAAG;MAAAA,oDAAA,8FAAsF;MAAAA,0DAAA,EAAI;MAE7FA,4DAAA,SAAG;MAAAA,oDAAA,8CAAsC;MAAAA,0DAAA,EAAI;MAE7CA,uDAAA,uBAGE;MACNA,0DAAA,EAAU;MAEVA,4DAAA,eAAS;MACDA,oDAAA,qBAAa;MAAAA,0DAAA,EAAK;MAEtBA,4DAAA,SAAG;MACCA,oDAAA,2DACA;MAAAA,4DAAA,YAKC;MACGA,oDAAA,+BACJ;MAAAA,0DAAA,EAAI;MACJA,oDAAA,iHACA;MAAAA,4DAAA,YAGC;MACGA,oDAAA,iBACJ;MAAAA,0DAAA,EAAI;;;MAhFJA,uDAAA,IAAe;MAAfA,wDAAA,SAAAQ,GAAA,CAAAhB,MAAA,CAAe;MA4CfQ,uDAAA,IAAqB;MAArBA,wDAAA,SAAAQ,GAAA,CAAAf,YAAA,CAAqB;MAarBO,uDAAA,GAAqB;MAArBA,wDAAA,SAAAQ,GAAA,CAAAd,YAAA,CAAqB;;;iBDkBnBJ,uDAAU,EAAAyB,sEAAA,EAAAA,sEAAA,EAAexB,mDAAO;EAAA2B,MAAA;EAAAC,eAAA;AAAA;iEAKzBxB,uBAAuB","sources":["./apps/demo/src/app/getting-started/index.ts","./apps/demo/src/app/getting-started/index.html"],"sourcesContent":["import {ChangeDetectionStrategy, Component} from '@angular/core';\nimport {RouterLink} from '@angular/router';\nimport {TuiAddonDoc} from '@taiga-ui/addon-doc';\nimport {TuiLink} from '@taiga-ui/core';\n\nconst script = `import {\n setActiveProject,\n createProject,\n getImports,\n NgMorphTree,\n} from 'ng-morph';\n\n/**\n * set all ng-morph functions to work with the all TS and JSON files\n * of the current project\n * */\nsetActiveProject(\n createProject(new NgMorphTree(), '/', ['**/*.ts', '**/*.json'])\n);\n\n/**\n * This simple migration gets all imports from the project TS files and\n * replaces 'old' substring with 'new'\n * */\nconst imports = getImports('some/path/**.ts', {\n moduleSpecifier: '@morph-old*',\n});\n\neditImports(imports, importEntity => ({\n moduleSpecifier: importEntity.moduleSpecifier.replace('old', 'new')\n}));\n\n/**\n * All changes are made in a virtual project.\n * You can save them when it is time\n * */\nsaveActiveProject();\n`;\n\nconst creatingRule = `import {\n setActiveProject,\n saveActiveProject,\n createProject,\n getImports,\n editImports,\n} from 'ng-morph';\n\nexport default (): Rule => {\n return tree => {\n /**\n * set all ng-morph functions to work with the all TS and JSON files\n * of the current project\n * */\n setActiveProject(createProject(tree, '/', ['**/*.ts', '**/*.json']));\n\n /**\n * This function gets all imports from the project TS files and\n * replaces 'old' substring with 'new'\n * */\n const imports = getImports('some/path/**.ts', {\n moduleSpecifier: '@morph-old*',\n });\n\n editImports(imports, importEntity => ({\n moduleSpecifier: importEntity.moduleSpecifier.replace('old', 'new')\n }));\n\n /**\n * All changes are made in a virtual project.\n * You can save them when it is time\n * */\n saveActiveProject();\n };\n};`;\n\nconst creatingSpec = `\n// We use schematics devkit to emulate virtual Tree\nimport {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';\nimport {HostTree} from '@angular-devkit/schematics';\n\n// We can emulate filesystem with ng-morph\nimport {\n createProject,\n resetActiveProject,\n setActiveProject,\n createSourceFile,\n saveActiveProject,\n} from 'ng-morph';\n\nconst collectionPath = join(__dirname, '../collection.json');\n\ndescribe('ng-add', () => {\n describe('removes old postfix', () => {\n let host: UnitTestTree;\n let runner: SchematicTestRunner;\n\n beforeEach(() => {\n host = new UnitTestTree(new HostTree());\n runner = new SchematicTestRunner('schematics', collectionPath);\n\n // preparing virtual file tree with one file\n setActiveProject(createProject(host));\n\n createSourceFile(\n 'src/module.ts',\n \"import {a} from '@morph-old/core';\",\n );\n\n saveActiveProject();\n });\n\n it('should replace old with new in TS imports', async () => {\n expect.assertions(1);\n\n // Our migration returns Tree\n const tree = await runner.runSchematicAsync('ng-add', {}, host).toPromise();\n\n expect(tree.readContent('src/module.ts')).toEqual(\n \"import {a} from '@morph-new/core';\",\n );\n });\n\n afterEach(() => {\n // clear it up\n resetActiveProject();\n });\n });\n});\n`;\n\n@Component({\n standalone: true,\n selector: 'getting-started',\n imports: [RouterLink, TuiAddonDoc, TuiLink],\n templateUrl: './index.html',\n styles: [':host {max-width: 1200px}'],\n changeDetection: ChangeDetectionStrategy.OnPush,\n})\nexport default class GettingStartedComponent {\n protected readonly script = script;\n protected readonly creatingRule = creatingRule;\n protected readonly creatingSpec = creatingSpec;\n}\n","\n
\n @taiga-ui/morph\n is a large set of tools for both global code base updates in your project and speeding up your work on Angular\n schematics. It has\n \n ts-morph\n \n under the hood and allows you to manipulate with safe TypeScript AST.\n
\n\n \n
Why is it better than default schematics?
\n\n
\n
🦅 You can quickly write migrations for your own project and run it as a simple script
\n\n
\n 🛠 There are many tools made for working with Angular. You can easily find and manipulate TS and Ng\n entities.\n
\n\n
\n ✅ You work with an abstract tree and it can be replaced, for example, with virtual tree for testing\n instead of real file system. So, you can test your schematics rapidly fast.\n
\n
\n \n\n
How to install
\n\n \n\n
\n You also need\n @angular-devkit/core\n and\n @angular-devkit/schematics\n to be installed.\n
\n\n
Enjoy!
\n\n \n
How to run @taiga-ui/morph
\n\n
Running in your own project as a script
\n\n
\n You can use @taiga-ui/morph for global updates of your porject code base, big refactiorings,\n dependencies migrations and much more. Just describe everything you want in a simple script and run it.\n
\n\n \n\n
\n Now you can compile and run this script or just use something like\n \n ts-node\n \n that allows you to start TS script as soon as it is ready.\n
\n\n
Creating schematics for publishing with libraries
\n\n You can write schematics scripts to simplify your library installation or make fully automated migrations\n between releases with breaking changes.\n\n
\n Creating Angular\n ng-add\n or\n ng-update\n schematics you work with\n \n Rule\n \n functions. Rule function gets a\n Tree\n as a first argument and you can pass this tree to\n setActiveProject\n function from ng-morph the following way:\n
\n\n \n \n\n \n
How to test your schematics
\n\n
You can use any test runner you like to check that your schematics work as you expect.
\n\n
Let's try to test the migration above:
\n\n \n \n\n \n
What is next?
\n\n
\n So, now you know how to set it up. Give a star to\n \n our project on Github\n \n and start exploring utils in the left menu to find all the tools you need. We suggest you to start with\n \n Classes\n \n
+ * ```
+ *
+ * ### Using an inline function
+ * The `transition` animation method also supports reading an inline function which can decide
+ * if its associated animation should be run.
+ *
+ * ```typescript
+ * // this method is run each time the `myAnimationTrigger` trigger value changes.
+ * function myInlineMatcherFn(fromState: string, toState: string, element: any, params: {[key:
+ string]: any}): boolean {
+ * // notice that `element` and `params` are also available here
+ * return toState == 'yes-please-animate';
+ * }
+ *
+ * @Component({
+ * selector: 'my-component',
+ * templateUrl: 'my-component-tpl.html',
+ * animations: [
+ * trigger('myAnimationTrigger', [
+ * transition(myInlineMatcherFn, [
+ * // the animation sequence code
+ * ]),
+ * ])
+ * ]
+ * })
+ * class MyComponent {
+ * myStatusExp = "yes-please-animate";
+ * }
+ * ```
+ *
+ * ### Disabling Animations
+ * When true, the special animation control binding `@.disabled` binding prevents
+ * all animations from rendering.
+ * Place the `@.disabled` binding on an element to disable
+ * animations on the element itself, as well as any inner animation triggers
+ * within the element.
+ *
+ * The following example shows how to use this feature:
+ *
+ * ```typescript
+ * @Component({
+ * selector: 'my-component',
+ * template: `
+ *
+ *
+ *
+ * `,
+ * animations: [
+ * trigger("childAnimation", [
+ * // ...
+ * ])
+ * ]
+ * })
+ * class MyComponent {
+ * isDisabled = true;
+ * exp = '...';
+ * }
+ * ```
+ *
+ * When `@.disabled` is true, it prevents the `@childAnimation` trigger from animating,
+ * along with any inner animations.
+ *
+ * ### Disable animations application-wide
+ * When an area of the template is set to have animations disabled,
+ * **all** inner components have their animations disabled as well.
+ * This means that you can disable all animations for an app
+ * by placing a host binding set on `@.disabled` on the topmost Angular component.
+ *
+ * ```typescript
+ * import {Component, HostBinding} from '@angular/core';
+ *
+ * @Component({
+ * selector: 'app-component',
+ * templateUrl: 'app.component.html',
+ * })
+ * class AppComponent {
+ * @HostBinding('@.disabled')
+ * public animationsDisabled = true;
+ * }
+ * ```
+ *
+ * ### Overriding disablement of inner animations
+ * Despite inner animations being disabled, a parent animation can `query()`
+ * for inner elements located in disabled areas of the template and still animate
+ * them if needed. This is also the case for when a sub animation is
+ * queried by a parent and then later animated using `animateChild()`.
+ *
+ * ### Detecting when an animation is disabled
+ * If a region of the DOM (or the entire application) has its animations disabled, the animation
+ * trigger callbacks still fire, but for zero seconds. When the callback fires, it provides
+ * an instance of an `AnimationEvent`. If animations are disabled,
+ * the `.disabled` flag on the event is true.
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 6729:
-/*!**********************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-coercion.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiCoerceBooleanProperty: () => (/* binding */ tuiCoerceBooleanProperty)
-/* harmony export */ });
+function trigger(name, definitions) {
+ return {
+ type: 7 /* AnimationMetadataType.Trigger */,
+ name,
+ definitions,
+ options: {}
+ };
+}
/**
- * Coerces a data-bound value (typically a string) to a boolean.
- * @example {@link https://material.angular.io/cdk/coercion/api#functions}
+ * Defines an animation step that combines styling information with timing information.
+ *
+ * @param timings Sets `AnimateTimings` for the parent animation.
+ * A string in the format "duration [delay] [easing]".
+ * - Duration and delay are expressed as a number and optional time unit,
+ * such as "1s" or "10ms" for one second and 10 milliseconds, respectively.
+ * The default unit is milliseconds.
+ * - The easing value controls how the animation accelerates and decelerates
+ * during its runtime. Value is one of `ease`, `ease-in`, `ease-out`,
+ * `ease-in-out`, or a `cubic-bezier()` function call.
+ * If not supplied, no easing is applied.
+ *
+ * For example, the string "1s 100ms ease-out" specifies a duration of
+ * 1000 milliseconds, and delay of 100 ms, and the "ease-out" easing style,
+ * which decelerates near the end of the duration.
+ * @param styles Sets AnimationStyles for the parent animation.
+ * A function call to either `style()` or `keyframes()`
+ * that returns a collection of CSS style entries to be applied to the parent animation.
+ * When null, uses the styles from the destination state.
+ * This is useful when describing an animation step that will complete an animation;
+ * see "Animating to the final state" in `transitions()`.
+ * @returns An object that encapsulates the animation step.
+ *
+ * @usageNotes
+ * Call within an animation `sequence()`, `{@link animations/group group()}`, or
+ * `transition()` call to specify an animation step
+ * that applies given style data to the parent animation for a given amount of time.
+ *
+ * ### Syntax Examples
+ * **Timing examples**
+ *
+ * The following examples show various `timings` specifications.
+ * - `animate(500)` : Duration is 500 milliseconds.
+ * - `animate("1s")` : Duration is 1000 milliseconds.
+ * - `animate("100ms 0.5s")` : Duration is 100 milliseconds, delay is 500 milliseconds.
+ * - `animate("5s ease-in")` : Duration is 5000 milliseconds, easing in.
+ * - `animate("5s 10ms cubic-bezier(.17,.67,.88,.1)")` : Duration is 5000 milliseconds, delay is 10
+ * milliseconds, easing according to a bezier curve.
+ *
+ * **Style examples**
+ *
+ * The following example calls `style()` to set a single CSS style.
+ * ```typescript
+ * animate(500, style({ background: "red" }))
+ * ```
+ * The following example calls `keyframes()` to set a CSS style
+ * to different values for successive keyframes.
+ * ```typescript
+ * animate(500, keyframes(
+ * [
+ * style({ background: "blue" }),
+ * style({ background: "red" })
+ * ])
+ * ```
+ *
+ * @publicApi
*/
-function tuiCoerceBooleanProperty(value) {
- return value !== null && typeof value !== 'undefined' && `${value}` !== 'false';
+function animate(timings, styles = null) {
+ return {
+ type: 4 /* AnimationMetadataType.Animate */,
+ styles,
+ timings
+ };
}
-
/**
- * Generated bundle index. Do not edit.
+ * @description Defines a list of animation steps to be run in parallel.
+ *
+ * @param steps An array of animation step objects.
+ * - When steps are defined by `style()` or `animate()`
+ * function calls, each call within the group is executed instantly.
+ * - To specify offset styles to be applied at a later time, define steps with
+ * `keyframes()`, or use `animate()` calls with a delay value.
+ * For example:
+ *
+ * ```typescript
+ * group([
+ * animate("1s", style({ background: "black" })),
+ * animate("2s", style({ color: "white" }))
+ * ])
+ * ```
+ *
+ * @param options An options object containing a delay and
+ * developer-defined parameters that provide styling defaults and
+ * can be overridden on invocation.
+ *
+ * @return An object that encapsulates the group data.
+ *
+ * @usageNotes
+ * Grouped animations are useful when a series of styles must be
+ * animated at different starting times and closed off at different ending times.
+ *
+ * When called within a `sequence()` or a
+ * `transition()` call, does not continue to the next
+ * instruction until all of the inner animation steps have completed.
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 749:
-/*!***********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-components-alert-host.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiAlertHostComponent: () => (/* binding */ TuiAlertHostComponent),
-/* harmony export */ TuiAlertHostModule: () => (/* binding */ TuiAlertHostModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/cdk/constants */ 5968);
-/* harmony import */ var _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk/services */ 7609);
-/* harmony import */ var _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk/tokens */ 1355);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 1640);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _taiga_ui_cdk_pipes__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk/pipes */ 2700);
-
-
-
-
-
-
-
-
-
-
-
-
-
-function TuiAlertHostComponent_div_0_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainer"](0, 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](1, "tuiMapper");
- }
- if (rf & 2) {
- const item_r3 = ctx.$implicit;
- const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngComponentOutlet", item_r3.component.component)("ngComponentOutletInjector", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind2"](1, 2, item_r3, ctx_r2.mapper));
- }
-}
-function TuiAlertHostComponent_div_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiAlertHostComponent_div_0_ng_container_1_Template, 2, 5, "ng-container", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const alert_r1 = ctx.$implicit;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("@tuiParentAnimation", undefined);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", alert_r1);
- }
-}
-class TuiAlertHostComponent {
- constructor(allAlerts, injector, destroy$, cdr) {
- this.allAlerts = allAlerts;
- this.injector = injector;
- this.destroy$ = destroy$;
- this.cdr = cdr;
- this.alerts = [];
- this.trackBy = index => index;
- this.mapper = useValue => _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector.create({
- providers: [{
- provide: _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_1__.POLYMORPHEUS_CONTEXT,
- useValue
- }],
- parent: this.injector
- });
- }
- ngOnInit() {
- // Due to this view being parallel to app content, `markForCheck` from `async` pipe
- // can happen after view was checked, so calling `detectChanges` instead
- (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.combineLatest)(this.allAlerts).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.takeUntil)(this.destroy$)).subscribe(alerts => {
- this.alerts = alerts;
- this.cdr.detectChanges();
- });
- }
+function group(steps, options = null) {
+ return {
+ type: 3 /* AnimationMetadataType.Group */,
+ steps,
+ options
+ };
}
-TuiAlertHostComponent.ɵfac = function TuiAlertHostComponent_Factory(t) {
- return new (t || TuiAlertHostComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_4__.TUI_ALERTS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.INJECTOR), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef));
-};
-TuiAlertHostComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiAlertHostComponent,
- selectors: [["tui-alert-host"]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiDestroyService])],
- decls: 1,
- vars: 2,
- consts: [["class", "t-wrapper", 4, "ngFor", "ngForOf", "ngForTrackBy"], [1, "t-wrapper"], [3, "ngComponentOutlet", "ngComponentOutletInjector", 4, "ngFor", "ngForOf"], [3, "ngComponentOutlet", "ngComponentOutletInjector"]],
- template: function TuiAlertHostComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiAlertHostComponent_div_0_Template, 2, 2, "div", 0);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.alerts)("ngForTrackBy", ctx.trackBy);
- }
- },
- dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_6__.NgForOf, _angular_common__WEBPACK_IMPORTED_MODULE_6__.NgComponentOutlet, _taiga_ui_cdk_pipes__WEBPACK_IMPORTED_MODULE_7__.TuiMapperPipe],
- styles: ["tui-alert-host>.t-wrapper{position:fixed;top:0;left:0;display:flex;width:100%;height:100%;flex-direction:column;pointer-events:none}tui-alert-host>.t-wrapper>*{pointer-events:auto}\n"],
- encapsulation: 2,
- data: {
- animation: [_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_8__.TUI_PARENT_ANIMATION]
- }
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAlertHostComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-alert-host',
- templateUrl: './alert-host.template.html',
- styleUrls: ['./alert-host.style.less'],
- encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewEncapsulation.None,
- // So that we do not force OnPush on custom alerts
- // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.Default,
- providers: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiDestroyService],
- animations: [_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_8__.TUI_PARENT_ANIMATION]
- }]
- }], function () {
- return [{
- type: Array,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_4__.TUI_ALERTS]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.INJECTOR]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_9__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiDestroyService]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef]
- }]
- }];
- }, null);
-})();
-class TuiAlertHostModule {}
-TuiAlertHostModule.ɵfac = function TuiAlertHostModule_Factory(t) {
- return new (t || TuiAlertHostModule)();
-};
-TuiAlertHostModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiAlertHostModule
-});
-TuiAlertHostModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_6__.CommonModule, _taiga_ui_cdk_pipes__WEBPACK_IMPORTED_MODULE_7__.TuiMapperPipeModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAlertHostModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_6__.CommonModule, _taiga_ui_cdk_pipes__WEBPACK_IMPORTED_MODULE_7__.TuiMapperPipeModule],
- declarations: [TuiAlertHostComponent],
- exports: [TuiAlertHostComponent]
- }]
- }], null, null);
-})();
-
/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 9853:
-/*!************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-components-dialog-host.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_DIALOG_CLOSES_ON_BACK: () => (/* binding */ TUI_DIALOG_CLOSES_ON_BACK),
-/* harmony export */ TuiDialogHostComponent: () => (/* binding */ TuiDialogHostComponent),
-/* harmony export */ TuiDialogHostModule: () => (/* binding */ TuiDialogHostModule)
-/* harmony export */ });
-/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @angular/animations */ 2015);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/platform-browser */ 4199);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/cdk/services */ 7609);
-/* harmony import */ var _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/cdk/tokens */ 1355);
-/* harmony import */ var _taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 6049);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 1640);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _taiga_ui_cdk_components_scroll_controls__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk/components/scroll-controls */ 1498);
-/* harmony import */ var _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @taiga-ui/cdk/directives */ 7848);
-/* harmony import */ var _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/cdk/directives */ 3535);
-/* harmony import */ var _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/cdk/directives */ 9163);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-function TuiDialogHostComponent_section_0_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainer"](0);
- }
-}
-function TuiDialogHostComponent_section_0_tui_scroll_controls_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-scroll-controls", 5);
- }
-}
-function TuiDialogHostComponent_section_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "section", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiDialogHostComponent_section_0_ng_container_1_Template, 1, 0, "ng-container", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiDialogHostComponent_section_0_tui_scroll_controls_2_Template, 1, 0, "tui-scroll-controls", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const item_r2 = ctx.$implicit;
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("@host", undefined);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("aria-labelledby", item_r2.id);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", item_r2.component)("polymorpheusOutletContext", item_r2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", !ctx_r0.isMobile);
- }
-}
-function TuiDialogHostComponent_div_1_Template(rf, ctx) {
- if (rf & 1) {
- const _r7 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("transitionend", function TuiDialogHostComponent_div_1_Template_div_transitionend_0_listener($event) {
- const restoredCtx = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r7);
- const isDialogClosesOnBack_r5 = restoredCtx.tuiLet;
- const ctx_r6 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r6.onDialog($event, !!ctx_r6.dialogs.length, !!isDialogClosesOnBack_r5));
- })("popstate", function TuiDialogHostComponent_div_1_Template_div_popstate_0_listener() {
- const restoredCtx = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r7);
- const isDialogClosesOnBack_r5 = restoredCtx.tuiLet;
- const ctx_r8 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r8.closeLast(ctx_r8.dialogs, !!isDialogClosesOnBack_r5));
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresolveWindow"]);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-overlay_visible", ctx_r1.dialogs.length);
- }
+ * Defines a list of animation steps to be run sequentially, one by one.
+ *
+ * @param steps An array of animation step objects.
+ * - Steps defined by `style()` calls apply the styling data immediately.
+ * - Steps defined by `animate()` calls apply the styling data over time
+ * as specified by the timing data.
+ *
+ * ```typescript
+ * sequence([
+ * style({ opacity: 0 }),
+ * animate("1s", style({ opacity: 1 }))
+ * ])
+ * ```
+ *
+ * @param options An options object containing a delay and
+ * developer-defined parameters that provide styling defaults and
+ * can be overridden on invocation.
+ *
+ * @return An object that encapsulates the sequence data.
+ *
+ * @usageNotes
+ * When you pass an array of steps to a
+ * `transition()` call, the steps run sequentially by default.
+ * Compare this to the `{@link animations/group group()}` call, which runs animation steps in
+ *parallel.
+ *
+ * When a sequence is used within a `{@link animations/group group()}` or a `transition()` call,
+ * execution continues to the next instruction only after each of the inner animation
+ * steps have completed.
+ *
+ * @publicApi
+ **/
+function sequence(steps, options = null) {
+ return {
+ type: 2 /* AnimationMetadataType.Sequence */,
+ steps,
+ options
+ };
}
-const FAKE_HISTORY_STATE = {
- label: 'ignoreMe'
-};
-const isFakeHistoryState = historyState => (historyState === null || historyState === void 0 ? void 0 : historyState.label) === FAKE_HISTORY_STATE.label;
/**
- * Is closing dialog on browser backward navigation enabled
- */
-const TUI_DIALOG_CLOSES_ON_BACK = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.of)(false));
-class TuiDialogHostComponent {
- constructor(isMobile, isDialogClosesOnBack$, dialogsByType, historyRef, titleService, destroy$, cdr, doc) {
- this.isMobile = isMobile;
- this.isDialogClosesOnBack$ = isDialogClosesOnBack$;
- this.dialogsByType = dialogsByType;
- this.historyRef = historyRef;
- this.titleService = titleService;
- this.destroy$ = destroy$;
- this.cdr = cdr;
- this.doc = doc;
- this.dialogs = [];
- }
- ngOnInit() {
- // Due to this view being parallel to app content, `markForCheck` from `async` pipe
- // can happen after view was checked, so calling `detectChanges` instead
- (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.combineLatest)(this.dialogsByType).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(arr => [].concat(...arr).sort((a, b) => a.createdAt - b.createdAt)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.takeUntil)(this.destroy$)).subscribe(dialogs => {
- var _a;
- this.dialogs = dialogs;
- this.cdr.markForCheck();
- (_a = this.doc.defaultView) === null || _a === void 0 ? void 0 : _a.document.documentElement.classList.toggle('t-overscroll-none', !!dialogs.length);
- });
- }
- closeLast(dialogs, isDialogClosesOnBack) {
- if (!isDialogClosesOnBack) {
- return;
- }
- const [last] = dialogs.slice(-1);
- if (!last) {
- return;
- }
- if (dialogs.length > 1) {
- this.historyRef.pushState(FAKE_HISTORY_STATE, this.titleService.getTitle());
- }
- last.$implicit.complete();
- }
- onDialog({
- propertyName
- }, popupOpened, isDialogClosesOnBack) {
- if (!isDialogClosesOnBack || propertyName !== 'letter-spacing') {
- return;
- }
- if (popupOpened) {
- this.historyRef.pushState(FAKE_HISTORY_STATE, this.titleService.getTitle());
- } else if (isFakeHistoryState(this.historyRef.state)) {
- this.historyRef.back();
- }
- }
+ * Declares a key/value object containing CSS properties/styles that
+ * can then be used for an animation [`state`](api/animations/state), within an animation
+ *`sequence`, or as styling data for calls to `animate()` and `keyframes()`.
+ *
+ * @param tokens A set of CSS styles or HTML styles associated with an animation state.
+ * The value can be any of the following:
+ * - A key-value style pair associating a CSS property with a value.
+ * - An array of key-value style pairs.
+ * - An asterisk (*), to use auto-styling, where styles are derived from the element
+ * being animated and applied to the animation when it starts.
+ *
+ * Auto-styling can be used to define a state that depends on layout or other
+ * environmental factors.
+ *
+ * @return An object that encapsulates the style data.
+ *
+ * @usageNotes
+ * The following examples create animation styles that collect a set of
+ * CSS property values:
+ *
+ * ```typescript
+ * // string values for CSS properties
+ * style({ background: "red", color: "blue" })
+ *
+ * // numerical pixel values
+ * style({ width: 100, height: 0 })
+ * ```
+ *
+ * The following example uses auto-styling to allow an element to animate from
+ * a height of 0 up to its full height:
+ *
+ * ```
+ * style({ height: 0 }),
+ * animate("1s", style({ height: "*" }))
+ * ```
+ *
+ * @publicApi
+ **/
+function style(tokens) {
+ return {
+ type: 6 /* AnimationMetadataType.Style */,
+ styles: tokens,
+ offset: null
+ };
}
-TuiDialogHostComponent.ɵfac = function TuiDialogHostComponent_Factory(t) {
- return new (t || TuiDialogHostComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_MOBILE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_DIALOG_CLOSES_ON_BACK), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_DIALOGS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.HISTORY), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_platform_browser__WEBPACK_IMPORTED_MODULE_8__.Title), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_9__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_10__.DOCUMENT));
-};
-TuiDialogHostComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiDialogHostComponent,
- selectors: [["tui-dialog-host"]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_9__.TuiDestroyService])],
- decls: 3,
- vars: 4,
- consts: [["aria-modal", "true", "role", "dialog", "tuiFocusTrap", "", "tuiOverscroll", "all", "tuiScrollRef", "", "class", "t-dialog", 4, "ngFor", "ngForOf"], ["class", "t-overlay", 3, "t-overlay_visible", "transitionend", "popstate", 4, "tuiLet"], ["aria-modal", "true", "role", "dialog", "tuiFocusTrap", "", "tuiOverscroll", "all", "tuiScrollRef", "", 1, "t-dialog"], [4, "polymorpheusOutlet", "polymorpheusOutletContext"], ["class", "t-scrollbars", 4, "ngIf"], [1, "t-scrollbars"], [1, "t-overlay", 3, "transitionend", "popstate"]],
- template: function TuiDialogHostComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiDialogHostComponent_section_0_Template, 3, 5, "section", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiDialogHostComponent_div_1_Template, 1, 2, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](2, "async");
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.dialogs);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("tuiLet", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](2, 2, ctx.isDialogClosesOnBack$));
- }
- },
- dependencies: [_taiga_ui_cdk_components_scroll_controls__WEBPACK_IMPORTED_MODULE_11__.TuiScrollControlsComponent, _angular_common__WEBPACK_IMPORTED_MODULE_10__.NgForOf, _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_12__.TuiFocusTrapDirective, _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_13__.TuiOverscrollDirective, _taiga_ui_cdk_components_scroll_controls__WEBPACK_IMPORTED_MODULE_11__.TuiScrollRefDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_14__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_10__.NgIf, _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_15__.TuiLetDirective, _angular_common__WEBPACK_IMPORTED_MODULE_10__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{position:fixed;left:0;bottom:0;width:100%;height:0}.t-overlay[_ngcontent-%COMP%], .t-dialog[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;bottom:0;display:flex;align-items:flex-start;outline:none;overflow:auto;scrollbar-width:none;-ms-overflow-style:none}.t-overlay.ng-animating[_ngcontent-%COMP%], .t-dialog.ng-animating[_ngcontent-%COMP%]{overflow:clip}.t-overlay[_ngcontent-%COMP%]::-webkit-scrollbar, .t-dialog[_ngcontent-%COMP%]::-webkit-scrollbar, .t-overlay[_ngcontent-%COMP%]::-webkit-scrollbar-thumb, .t-dialog[_ngcontent-%COMP%]::-webkit-scrollbar-thumb{display:none}.t-dialog[_ngcontent-%COMP%]{bottom:auto;height:100%}.t-overlay[_ngcontent-%COMP%]{height:100%;pointer-events:none;touch-action:none;opacity:0;letter-spacing:normal;transition:opacity var(--tui-duration, .3s),letter-spacing .01s;background:rgba(0,0,0,.75);-webkit-backdrop-filter:var(--tui-backdrop, none);backdrop-filter:var(--tui-backdrop, none)}.t-overlay_visible[_ngcontent-%COMP%]{opacity:1;letter-spacing:1px}.t-dialog[_ngcontent-%COMP%]:last-of-type{z-index:1}.t-scrollbars[_ngcontent-%COMP%]{position:fixed;top:0;left:0;right:0;bottom:0;margin:0;color:#747474}"],
- data: {
- animation: [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.trigger)('host', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.style)({
- overflow: 'clip'
- }), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.query)(':scope > *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.animateChild)()], {
- optional: true
- })]), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.query)(':scope > *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.animateChild)()], {
- optional: true
- })])])]
- }
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDialogHostComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-dialog-host',
- templateUrl: './dialog-host.template.html',
- styleUrls: ['./dialog-host.style.less'],
- // So that we do not force OnPush on custom dialogs
- // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.Default,
- providers: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_9__.TuiDestroyService],
- animations: [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.trigger)('host', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.style)({
- overflow: 'clip'
- }), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.query)(':scope > *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.animateChild)()], {
- optional: true
- })]), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.query)(':scope > *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_16__.animateChild)()], {
- optional: true
- })])])]
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_MOBILE]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_17__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_DIALOG_CLOSES_ON_BACK]
- }]
- }, {
- type: Array,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_DIALOGS]
- }]
- }, {
- type: History,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.HISTORY]
- }]
- }, {
- type: _angular_platform_browser__WEBPACK_IMPORTED_MODULE_8__.Title,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_8__.Title]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_17__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_9__.TuiDestroyService]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef]
- }]
- }, {
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_10__.DOCUMENT]
- }]
- }];
- }, null);
-})();
-class TuiDialogHostModule {}
-TuiDialogHostModule.ɵfac = function TuiDialogHostModule_Factory(t) {
- return new (t || TuiDialogHostModule)();
-};
-TuiDialogHostModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiDialogHostModule
-});
-TuiDialogHostModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_10__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_14__.PolymorpheusModule, _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_13__.TuiOverscrollModule, _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_12__.TuiFocusTrapModule, _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_15__.TuiLetModule, _taiga_ui_cdk_components_scroll_controls__WEBPACK_IMPORTED_MODULE_11__.TuiScrollControlsModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDialogHostModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_10__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_14__.PolymorpheusModule, _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_13__.TuiOverscrollModule, _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_12__.TuiFocusTrapModule, _taiga_ui_cdk_directives__WEBPACK_IMPORTED_MODULE_15__.TuiLetModule, _taiga_ui_cdk_components_scroll_controls__WEBPACK_IMPORTED_MODULE_11__.TuiScrollControlsModule],
- declarations: [TuiDialogHostComponent],
- exports: [TuiDialogHostComponent]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3190:
-/*!**************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-components-dropdown-host.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiDropdownHostComponent: () => (/* binding */ TuiDropdownHostComponent),
-/* harmony export */ TuiDropdownHostModule: () => (/* binding */ TuiDropdownHostModule),
-/* harmony export */ TuiDropdownPortalService: () => (/* binding */ TuiDropdownPortalService)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_abstract__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/abstract */ 5071);
-
-
-
-
/**
- * Service for displaying dropdown portals
- */
-const _c0 = ["*"];
-class TuiDropdownPortalService extends _taiga_ui_cdk_abstract__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiPortalService {}
-TuiDropdownPortalService.ɵfac = /* @__PURE__ */function () {
- let ɵTuiDropdownPortalService_BaseFactory;
- return function TuiDropdownPortalService_Factory(t) {
- return (ɵTuiDropdownPortalService_BaseFactory || (ɵTuiDropdownPortalService_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetInheritedFactory"](TuiDropdownPortalService)))(t || TuiDropdownPortalService);
+ * Declares an animation state within a trigger attached to an element.
+ *
+ * @param name One or more names for the defined state in a comma-separated string.
+ * The following reserved state names can be supplied to define a style for specific use
+ * cases:
+ *
+ * - `void` You can associate styles with this name to be used when
+ * the element is detached from the application. For example, when an `ngIf` evaluates
+ * to false, the state of the associated element is void.
+ * - `*` (asterisk) Indicates the default state. You can associate styles with this name
+ * to be used as the fallback when the state that is being animated is not declared
+ * within the trigger.
+ *
+ * @param styles A set of CSS styles associated with this state, created using the
+ * `style()` function.
+ * This set of styles persists on the element once the state has been reached.
+ * @param options Parameters that can be passed to the state when it is invoked.
+ * 0 or more key-value pairs.
+ * @return An object that encapsulates the new state data.
+ *
+ * @usageNotes
+ * Use the `trigger()` function to register states to an animation trigger.
+ * Use the `transition()` function to animate between states.
+ * When a state is active within a component, its associated styles persist on the element,
+ * even when the animation ends.
+ *
+ * @publicApi
+ **/
+function state(name, styles, options) {
+ return {
+ type: 0 /* AnimationMetadataType.State */,
+ name,
+ styles,
+ options
};
-}();
-TuiDropdownPortalService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiDropdownPortalService,
- factory: TuiDropdownPortalService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiDropdownPortalService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], null, null);
-})();
-
+}
/**
- * Host element for dynamically created portals, for example using {@link TuiDropdownDirective}.
- */
-class TuiDropdownHostComponent extends _taiga_ui_cdk_abstract__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiPortalHostComponent {}
-TuiDropdownHostComponent.ɵfac = /* @__PURE__ */function () {
- let ɵTuiDropdownHostComponent_BaseFactory;
- return function TuiDropdownHostComponent_Factory(t) {
- return (ɵTuiDropdownHostComponent_BaseFactory || (ɵTuiDropdownHostComponent_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetInheritedFactory"](TuiDropdownHostComponent)))(t || TuiDropdownHostComponent);
- };
-}();
-TuiDropdownHostComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({
- type: TuiDropdownHostComponent,
- selectors: [["tui-dropdown-host"]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([{
- provide: _taiga_ui_cdk_abstract__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiPortalService,
- useExisting: TuiDropdownPortalService
- },
- // TODO: Remove in 4.0
- {
- provide: _taiga_ui_cdk_abstract__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiPortalHostComponent,
- useExisting: TuiDropdownHostComponent
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]],
- ngContentSelectors: _c0,
- decls: 3,
- vars: 0,
- consts: [["viewContainer", ""]],
- template: function TuiDropdownHostComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojection"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementContainer"](1, null, 0);
- }
- },
- styles: ["[_nghost-%COMP%]{position:relative;z-index:0;display:block;height:100%}[_nghost-%COMP%]:before{content:\"\";display:block;overflow:hidden}.t-position-fixed-offset[_ngcontent-%COMP%]{position:fixed;left:0;top:0;pointer-events:none;visibility:hidden;width:100%;height:100%}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiDropdownHostComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Component,
- args: [{
- selector: 'tui-dropdown-host',
- templateUrl: './dropdown-host.template.html',
- styleUrls: ['./dropdown-host.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectionStrategy.OnPush,
- providers: [{
- provide: _taiga_ui_cdk_abstract__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiPortalService,
- useExisting: TuiDropdownPortalService
- },
- // TODO: Remove in 4.0
- {
- provide: _taiga_ui_cdk_abstract__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiPortalHostComponent,
- useExisting: TuiDropdownHostComponent
- }]
- }]
- }], null, null);
-})();
-class TuiDropdownHostModule {}
-TuiDropdownHostModule.ɵfac = function TuiDropdownHostModule_Factory(t) {
- return new (t || TuiDropdownHostModule)();
-};
-TuiDropdownHostModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
- type: TuiDropdownHostModule
-});
-TuiDropdownHostModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiDropdownHostModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule,
- args: [{
- declarations: [TuiDropdownHostComponent],
- exports: [TuiDropdownHostComponent]
- }]
- }], null, null);
-})();
+ * Defines a set of animation styles, associating each style with an optional `offset` value.
+ *
+ * @param steps A set of animation styles with optional offset data.
+ * The optional `offset` value for a style specifies a percentage of the total animation
+ * time at which that style is applied.
+ * @returns An object that encapsulates the keyframes data.
+ *
+ * @usageNotes
+ * Use with the `animate()` call. Instead of applying animations
+ * from the current state
+ * to the destination state, keyframes describe how each style entry is applied and at what point
+ * within the animation arc.
+ * Compare [CSS Keyframe Animations](https://www.w3schools.com/css/css3_animations.asp).
+ *
+ * ### Usage
+ *
+ * In the following example, the offset values describe
+ * when each `backgroundColor` value is applied. The color is red at the start, and changes to
+ * blue when 20% of the total time has elapsed.
+ *
+ * ```typescript
+ * // the provided offset values
+ * animate("5s", keyframes([
+ * style({ backgroundColor: "red", offset: 0 }),
+ * style({ backgroundColor: "blue", offset: 0.2 }),
+ * style({ backgroundColor: "orange", offset: 0.3 }),
+ * style({ backgroundColor: "black", offset: 1 })
+ * ]))
+ * ```
+ *
+ * If there are no `offset` values specified in the style entries, the offsets
+ * are calculated automatically.
+ *
+ * ```typescript
+ * animate("5s", keyframes([
+ * style({ backgroundColor: "red" }) // offset = 0
+ * style({ backgroundColor: "blue" }) // offset = 0.33
+ * style({ backgroundColor: "orange" }) // offset = 0.66
+ * style({ backgroundColor: "black" }) // offset = 1
+ * ]))
+ *```
-/**
- * Generated bundle index. Do not edit.
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 1498:
-/*!****************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-components-scroll-controls.js ***!
- \****************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ SCROLL_REF_SELECTOR: () => (/* binding */ SCROLL_REF_SELECTOR),
-/* harmony export */ TuiScrollControlsComponent: () => (/* binding */ TuiScrollControlsComponent),
-/* harmony export */ TuiScrollControlsModule: () => (/* binding */ TuiScrollControlsModule),
-/* harmony export */ TuiScrollRefDirective: () => (/* binding */ TuiScrollRefDirective),
-/* harmony export */ TuiScrollbarDirective: () => (/* binding */ TuiScrollbarDirective)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/observables */ 2143);
-/* harmony import */ var _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk/tokens */ 1355);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 3919);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk/constants */ 5968);
-/* harmony import */ var _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/cdk/services */ 7609);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 870);
-
-
-
-
-
-
-
-
-
-
-
-
-function TuiScrollControlsComponent_ng_container_0_ng_container_1_div_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("mousedown.capture.prevent", function TuiScrollControlsComponent_ng_container_0_ng_container_1_div_1_Template_div_mousedown_capture_prevent_0_listener() {
- return 0;
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "div", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const bars_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]().ngIf;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-bar_has-horizontal", bars_r2[1]);
- }
-}
-function TuiScrollControlsComponent_ng_container_0_ng_container_1_div_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("mousedown.capture.prevent", function TuiScrollControlsComponent_ng_container_0_ng_container_1_div_2_Template_div_mousedown_capture_prevent_0_listener() {
- return 0;
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "div", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const bars_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]().ngIf;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-bar_has-vertical", bars_r2[0]);
- }
-}
-function TuiScrollControlsComponent_ng_container_0_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiScrollControlsComponent_ng_container_0_ng_container_1_div_1_Template, 2, 2, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiScrollControlsComponent_ng_container_0_ng_container_1_div_2_Template, 2, 2, "div", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const bars_r2 = ctx.ngIf;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", bars_r2[0]);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", bars_r2[1]);
- }
-}
-function TuiScrollControlsComponent_ng_container_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiScrollControlsComponent_ng_container_0_ng_container_1_Template, 3, 2, "ng-container", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](2, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](2, 1, ctx_r0.refresh$));
- }
+function keyframes(steps) {
+ return {
+ type: 5 /* AnimationMetadataType.Keyframes */,
+ steps
+ };
}
-const MIN_WIDTH = 24;
-function getOffsetVertical({
- clientY
-}, {
- top,
- height
-}) {
- return (clientY - top) / height;
-}
-function getOffsetHorizontal({
- clientX
-}, {
- left,
- width
-}) {
- return (clientX - left) / width;
-}
-class TuiScrollbarDirective {
- constructor(zone, destroy$, animationFrame$, container, doc, el) {
- this.container = container;
- this.doc = doc;
- this.el = el;
- this.tuiScrollbar = 'vertical';
- const {
- nativeElement
- } = this.el;
- const mousedown$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiTypedFromEvent)(nativeElement, 'mousedown');
- const mousemove$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiTypedFromEvent)(this.doc, 'mousemove');
- const mouseup$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiTypedFromEvent)(this.doc, 'mouseup');
- const mousedownWrapper$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiTypedFromEvent)(this.wrapper, 'mousedown');
- (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.merge)(mousedownWrapper$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(event => this.getScrolled(event, 0.5, 0.5))), mousedown$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.switchMap)(event => {
- const rect = nativeElement.getBoundingClientRect();
- const vertical = getOffsetVertical(event, rect);
- const horizontal = getOffsetHorizontal(event, rect);
- return mousemove$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(event => this.getScrolled(event, vertical, horizontal)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.takeUntil)(mouseup$));
- }))).pipe((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiZonefree)(zone), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.takeUntil)(destroy$)).subscribe(([scrollTop, scrollLeft]) => {
- this.element.style.scrollBehavior = 'auto';
- if (this.tuiScrollbar === 'vertical') {
- this.element.scrollTop = scrollTop;
- } else {
- this.element.scrollLeft = scrollLeft;
- }
- this.element.style.scrollBehavior = '';
- });
- (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.merge)(animationFrame$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.throttleTime)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_7__.POLLING_TIME)), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiScrollFrom)(this.element)).pipe((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiZonefree)(zone), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.takeUntil)(destroy$)).subscribe(() => {
- if (this.tuiScrollbar === 'vertical') {
- nativeElement.style.top = `${this.thumb * 100}%`;
- nativeElement.style.height = `${this.view * 100}%`;
- } else {
- nativeElement.style.left = `${this.thumb * 100}%`;
- nativeElement.style.width = `${this.view * 100}%`;
- }
- });
- }
- get wrapper() {
- return this.el.nativeElement.parentElement;
- }
- get scrolled() {
- const {
- scrollTop,
- scrollHeight,
- clientHeight,
- scrollLeft,
- scrollWidth,
- clientWidth
- } = this.element;
- return this.tuiScrollbar === 'vertical' ? scrollTop / (scrollHeight - clientHeight) : scrollLeft / (scrollWidth - clientWidth);
- }
- get compensation() {
- const {
- clientHeight,
- scrollHeight,
- clientWidth,
- scrollWidth
- } = this.element;
- if (clientHeight * clientHeight / scrollHeight > MIN_WIDTH && this.tuiScrollbar === 'vertical' || clientWidth * clientWidth / scrollWidth > MIN_WIDTH && this.tuiScrollbar === 'horizontal') {
- return 0;
- }
- return this.tuiScrollbar === 'vertical' ? MIN_WIDTH / clientHeight : MIN_WIDTH / clientWidth;
- }
- get thumb() {
- const compensation = this.compensation || this.view;
- return this.scrolled * (1 - compensation);
- }
- get view() {
- const {
- clientHeight,
- scrollHeight,
- clientWidth,
- scrollWidth
- } = this.element;
- return this.tuiScrollbar === 'vertical' ? Math.ceil(clientHeight / scrollHeight * 100) / 100 : Math.ceil(clientWidth / scrollWidth * 100) / 100;
- }
- get element() {
- return this.container.nativeElement;
- }
- getScrolled({
- clientY,
- clientX
- }, offsetVertical, offsetHorizontal) {
- const {
- offsetHeight,
- offsetWidth
- } = this.el.nativeElement;
- const {
- top,
- left,
- width,
- height
- } = this.wrapper.getBoundingClientRect();
- const maxTop = this.element.scrollHeight - height;
- const maxLeft = this.element.scrollWidth - width;
- const scrolledTop = (clientY - top - offsetHeight * offsetVertical) / (height - offsetHeight);
- const scrolledLeft = (clientX - left - offsetWidth * offsetHorizontal) / (width - offsetWidth);
- return [maxTop * scrolledTop, maxLeft * scrolledLeft];
- }
-}
-TuiScrollbarDirective.ɵfac = function TuiScrollbarDirective_Factory(t) {
- return new (t || TuiScrollbarDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_8__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.ANIMATION_FRAME), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_10__.TUI_SCROLL_REF), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_11__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef));
-};
-TuiScrollbarDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiScrollbarDirective,
- selectors: [["", "tuiScrollbar", ""]],
- inputs: {
- tuiScrollbar: "tuiScrollbar"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_8__.TuiDestroyService])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiScrollbarDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiScrollbar]',
- providers: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_8__.TuiDestroyService]
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_8__.TuiDestroyService]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.ANIMATION_FRAME]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_10__.TUI_SCROLL_REF]
- }]
- }, {
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_11__.DOCUMENT]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }];
- }, {
- tuiScrollbar: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiScrollControlsComponent {
- constructor(isIOS, zone, scrollRef, animationFrame$) {
- this.isIOS = isIOS;
- this.zone = zone;
- this.scrollRef = scrollRef;
- this.animationFrame$ = animationFrame$;
- this.refresh$ = this.animationFrame$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.throttleTime)(300), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(() => {
- const {
- clientHeight,
- scrollHeight,
- clientWidth,
- scrollWidth
- } = this.scrollRef.nativeElement;
- return [Math.ceil(clientHeight / scrollHeight * 100) < 100, Math.ceil(clientWidth / scrollWidth * 100) < 100];
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.startWith)([false, false]), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.distinctUntilChanged)((a, b) => a[0] === b[0] && a[1] === b[1]), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiZoneOptimized)(this.zone));
- }
-}
-TuiScrollControlsComponent.ɵfac = function TuiScrollControlsComponent_Factory(t) {
- return new (t || TuiScrollControlsComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_10__.TUI_IS_IOS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_10__.TUI_SCROLL_REF), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.ANIMATION_FRAME));
-};
-TuiScrollControlsComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiScrollControlsComponent,
- selectors: [["tui-scroll-controls"]],
- decls: 1,
- vars: 1,
- consts: [[4, "ngIf"], ["class", "t-bar t-bar_vertical", 3, "t-bar_has-horizontal", "mousedown.capture.prevent", 4, "ngIf"], ["class", "t-bar t-bar_horizontal", 3, "t-bar_has-vertical", "mousedown.capture.prevent", 4, "ngIf"], [1, "t-bar", "t-bar_vertical", 3, "mousedown.capture.prevent"], ["tuiScrollbar", "vertical", 1, "t-thumb"], [1, "t-bar", "t-bar_horizontal", 3, "mousedown.capture.prevent"], ["tuiScrollbar", "horizontal", 1, "t-thumb"]],
- template: function TuiScrollControlsComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiScrollControlsComponent_ng_container_0_Template, 3, 3, "ng-container", 0);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", !ctx.isIOS);
- }
- },
- dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_11__.NgIf, TuiScrollbarDirective, _angular_common__WEBPACK_IMPORTED_MODULE_11__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{position:-webkit-sticky;position:sticky;top:0;left:0;z-index:1;min-width:calc(100% - 1px);min-height:calc(100% - 1px);max-width:calc(100% - 1px);max-height:calc(100% - 1px);float:left;-webkit-margin-end:calc(-100% + 1px);margin-inline-end:calc(-100% + 1px);pointer-events:none}.t-bar[_ngcontent-%COMP%]{position:absolute;right:0;bottom:0;pointer-events:auto;animation:tuiFadeIn var(--tui-duration, .3s) ease-in-out}.t-bar_vertical[_ngcontent-%COMP%]{top:0;width:.875rem}.t-bar_horizontal[_ngcontent-%COMP%]{left:0;height:.875rem}.t-bar_has-horizontal[_ngcontent-%COMP%]{bottom:.5rem}.t-bar_has-vertical[_ngcontent-%COMP%]{right:.5rem}.t-thumb[_ngcontent-%COMP%]{position:absolute;border-radius:6.25rem;border:.25rem solid transparent;cursor:pointer;pointer-events:auto;-webkit-user-select:none;-moz-user-select:none;user-select:none;background:currentColor;background-clip:content-box;box-sizing:border-box;transition:all var(--tui-duration, .3s) ease-in-out;transition-property:width,height,opacity;opacity:.2}.t-thumb[_ngcontent-%COMP%]:hover{opacity:.24}.t-thumb[_ngcontent-%COMP%]:active{opacity:.48}.t-bar_vertical[_ngcontent-%COMP%] .t-thumb[_ngcontent-%COMP%]{right:0;width:.75rem;min-height:1.25rem}.t-bar_vertical[_ngcontent-%COMP%]:hover .t-thumb[_ngcontent-%COMP%], .t-bar_vertical[_ngcontent-%COMP%] .t-thumb[_ngcontent-%COMP%]:active{width:.875rem}.t-bar_horizontal[_ngcontent-%COMP%] .t-thumb[_ngcontent-%COMP%]{bottom:0;height:.75rem;min-width:1.25rem}.t-bar_horizontal[_ngcontent-%COMP%]:hover .t-thumb[_ngcontent-%COMP%], .t-bar_horizontal[_ngcontent-%COMP%] .t-thumb[_ngcontent-%COMP%]:active{height:.875rem}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiScrollControlsComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-scroll-controls',
- templateUrl: './scroll-controls.template.html',
- styleUrls: ['./scroll-controls.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_10__.TUI_IS_IOS]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_10__.TUI_SCROLL_REF]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.ANIMATION_FRAME]
- }]
- }];
- }, null);
-})();
-const SCROLL_REF_SELECTOR = '[tuiScrollRef]';
-class TuiScrollRefDirective {}
-TuiScrollRefDirective.ɵfac = function TuiScrollRefDirective_Factory(t) {
- return new (t || TuiScrollRefDirective)();
-};
-TuiScrollRefDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiScrollRefDirective,
- selectors: [["", "tuiScrollRef", ""]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_10__.TUI_SCROLL_REF,
- useExisting: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef
- }])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiScrollRefDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: SCROLL_REF_SELECTOR,
- providers: [{
- provide: _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_10__.TUI_SCROLL_REF,
- useExisting: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef
- }]
- }]
- }], null, null);
-})();
-class TuiScrollControlsModule {}
-TuiScrollControlsModule.ɵfac = function TuiScrollControlsModule_Factory(t) {
- return new (t || TuiScrollControlsModule)();
-};
-TuiScrollControlsModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiScrollControlsModule
-});
-TuiScrollControlsModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_11__.CommonModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiScrollControlsModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_11__.CommonModule],
- declarations: [TuiScrollbarDirective, TuiScrollControlsComponent, TuiScrollRefDirective],
- exports: [TuiScrollControlsComponent, TuiScrollRefDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 5968:
-/*!***********************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-constants.js ***!
- \***********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ ALWAYS_FALSE_HANDLER: () => (/* binding */ ALWAYS_FALSE_HANDLER),
-/* harmony export */ ALWAYS_TRUE_HANDLER: () => (/* binding */ ALWAYS_TRUE_HANDLER),
-/* harmony export */ CHAR_BULLET: () => (/* binding */ CHAR_BULLET),
-/* harmony export */ CHAR_CURRENCY_SIGN: () => (/* binding */ CHAR_CURRENCY_SIGN),
-/* harmony export */ CHAR_ELLIPSIS: () => (/* binding */ CHAR_ELLIPSIS),
-/* harmony export */ CHAR_EM_DASH: () => (/* binding */ CHAR_EM_DASH),
-/* harmony export */ CHAR_EN_DASH: () => (/* binding */ CHAR_EN_DASH),
-/* harmony export */ CHAR_HYPHEN: () => (/* binding */ CHAR_HYPHEN),
-/* harmony export */ CHAR_LAQUO: () => (/* binding */ CHAR_LAQUO),
-/* harmony export */ CHAR_MINUS: () => (/* binding */ CHAR_MINUS),
-/* harmony export */ CHAR_NO_BREAK_SPACE: () => (/* binding */ CHAR_NO_BREAK_SPACE),
-/* harmony export */ CHAR_PLUS: () => (/* binding */ CHAR_PLUS),
-/* harmony export */ CHAR_RAQUO: () => (/* binding */ CHAR_RAQUO),
-/* harmony export */ CHAR_ZERO_WIDTH_SPACE: () => (/* binding */ CHAR_ZERO_WIDTH_SPACE),
-/* harmony export */ CHROMIUM_EDGE_START_VERSION: () => (/* binding */ CHROMIUM_EDGE_START_VERSION),
-/* harmony export */ EMPTY_ARRAY: () => (/* binding */ EMPTY_ARRAY),
-/* harmony export */ EMPTY_CLIENT_RECT: () => (/* binding */ EMPTY_CLIENT_RECT),
-/* harmony export */ EMPTY_FUNCTION: () => (/* binding */ EMPTY_FUNCTION),
-/* harmony export */ EMPTY_QUERY: () => (/* binding */ EMPTY_QUERY),
-/* harmony export */ POLLING_TIME: () => (/* binding */ POLLING_TIME),
-/* harmony export */ TUI_DEFAULT_IDENTITY_MATCHER: () => (/* binding */ TUI_DEFAULT_IDENTITY_MATCHER),
-/* harmony export */ TUI_DEFAULT_MATCHER: () => (/* binding */ TUI_DEFAULT_MATCHER),
-/* harmony export */ TUI_DEFAULT_STRINGIFY: () => (/* binding */ TUI_DEFAULT_STRINGIFY),
-/* harmony export */ TUI_PARENT_ANIMATION: () => (/* binding */ TUI_PARENT_ANIMATION),
-/* harmony export */ TUI_PARENT_STOP: () => (/* binding */ TUI_PARENT_STOP),
-/* harmony export */ TUI_STRICT_MATCHER: () => (/* binding */ TUI_STRICT_MATCHER),
-/* harmony export */ TUI_USED_ICONS: () => (/* binding */ TUI_USED_ICONS),
-/* harmony export */ TUI_VERSION: () => (/* binding */ TUI_VERSION),
-/* harmony export */ svgNodeFilter: () => (/* binding */ svgNodeFilter)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/animations */ 2015);
-
-
-
-/**
- * Handler that always returns `false`.
- */
-// eslint-disable-next-line no-restricted-syntax
-const ALWAYS_FALSE_HANDLER = () => false;
-
-/**
- * Handler that always returns `true`.
- */
-// eslint-disable-next-line no-restricted-syntax
-const ALWAYS_TRUE_HANDLER = () => true;
-
-/**
- * @deprecated
- * TODO: drop support of legacy Edge (EdgeHTML) in v4.x
- */
-const CHROMIUM_EDGE_START_VERSION = 79;
-const rect = {
- bottom: 0,
- height: 0,
- left: 0,
- right: 0,
- top: 0,
- width: 0,
- x: 0,
- y: 0
-};
/**
- * For type safety when using @ContentChildren and @ViewChildren
+ * Declares an animation transition which is played when a certain specified condition is met.
*
- * NOTE: Be careful subscribing to 'changes'
- */
-const EMPTY_QUERY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.QueryList();
-const EMPTY_ARRAY = [];
-const EMPTY_FUNCTION = () => {};
-const EMPTY_CLIENT_RECT = Object.assign(Object.assign({}, rect), {
- toJSON() {
- return rect;
- }
-});
-
-/**
- * Default method to turn arbitrary object into string
- */
-const TUI_DEFAULT_STRINGIFY = item => String(item);
-function bothEmpty(item1, item2) {
- return Array.isArray(item1) && Array.isArray(item2) && !item1.length && !item2.length;
+ * @param stateChangeExpr A string with a specific format or a function that specifies when the
+ * animation transition should occur (see [State Change Expression](#state-change-expression)).
+ *
+ * @param steps One or more animation objects that represent the animation's instructions.
+ *
+ * @param options An options object that can be used to specify a delay for the animation or provide
+ * custom parameters for it.
+ *
+ * @returns An object that encapsulates the transition data.
+ *
+ * @usageNotes
+ *
+ * ### State Change Expression
+ *
+ * The State Change Expression instructs Angular when to run the transition's animations, it can
+ *either be
+ * - a string with a specific syntax
+ * - or a function that compares the previous and current state (value of the expression bound to
+ * the element's trigger) and returns `true` if the transition should occur or `false` otherwise
+ *
+ * The string format can be:
+ * - `fromState => toState`, which indicates that the transition's animations should occur then the
+ * expression bound to the trigger's element goes from `fromState` to `toState`
+ *
+ * _Example:_
+ * ```typescript
+ * transition('open => closed', animate('.5s ease-out', style({ height: 0 }) ))
+ * ```
+ *
+ * - `fromState <=> toState`, which indicates that the transition's animations should occur then
+ * the expression bound to the trigger's element goes from `fromState` to `toState` or vice versa
+ *
+ * _Example:_
+ * ```typescript
+ * transition('enabled <=> disabled', animate('1s cubic-bezier(0.8,0.3,0,1)'))
+ * ```
+ *
+ * - `:enter`/`:leave`, which indicates that the transition's animations should occur when the
+ * element enters or exists the DOM
+ *
+ * _Example:_
+ * ```typescript
+ * transition(':enter', [
+ * style({ opacity: 0 }),
+ * animate('500ms', style({ opacity: 1 }))
+ * ])
+ * ```
+ *
+ * - `:increment`/`:decrement`, which indicates that the transition's animations should occur when
+ * the numerical expression bound to the trigger's element has increased in value or decreased
+ *
+ * _Example:_
+ * ```typescript
+ * transition(':increment', query('@counter', animateChild()))
+ * ```
+ *
+ * - a sequence of any of the above divided by commas, which indicates that transition's animations
+ * should occur whenever one of the state change expressions matches
+ *
+ * _Example:_
+ * ```typescript
+ * transition(':increment, * => enabled, :enter', animate('1s ease', keyframes([
+ * style({ transform: 'scale(1)', offset: 0}),
+ * style({ transform: 'scale(1.1)', offset: 0.7}),
+ * style({ transform: 'scale(1)', offset: 1})
+ * ]))),
+ * ```
+ *
+ * Also note that in such context:
+ * - `void` can be used to indicate the absence of the element
+ * - asterisks can be used as wildcards that match any state
+ * - (as a consequence of the above, `void => *` is equivalent to `:enter` and `* => void` is
+ * equivalent to `:leave`)
+ * - `true` and `false` also match expression values of `1` and `0` respectively (but do not match
+ * _truthy_ and _falsy_ values)
+ *
+ *
+ *
+ * Be careful about entering end leaving elements as their transitions present a common
+ * pitfall for developers.
+ *
+ * Note that when an element with a trigger enters the DOM its `:enter` transition always
+ * gets executed, but its `:leave` transition will not be executed if the element is removed
+ * alongside its parent (as it will be removed "without warning" before its transition has
+ * a chance to be executed, the only way that such transition can occur is if the element
+ * is exiting the DOM on its own).
+ *
+ *
+ *
+ *
+ * ### Animating to a Final State
+ *
+ * If the final step in a transition is a call to `animate()` that uses a timing value
+ * with no `style` data, that step is automatically considered the final animation arc,
+ * for the element to reach the final state, in such case Angular automatically adds or removes
+ * CSS styles to ensure that the element is in the correct final state.
+ *
+ *
+ * ### Usage Examples
+ *
+ * - Transition animations applied based on
+ * the trigger's expression value
+ *
+ * ```HTML
+ *
+ * ...
+ *
+ * ```
+ *
+ * ```typescript
+ * trigger("myAnimationTrigger", [
+ * ..., // states
+ * transition("on => off, open => closed", animate(500)),
+ * transition("* <=> error", query('.indicator', animateChild()))
+ * ])
+ * ```
+ *
+ * - Transition animations applied based on custom logic dependent
+ * on the trigger's expression value and provided parameters
+ *
+ * ```HTML
+ *
+ * ...
+ *
+ * ```
+ *
+ * ```typescript
+ * trigger("myAnimationTrigger", [
+ * ..., // states
+ * transition(
+ * (fromState, toState, _element, params) =>
+ * ['firststep', 'laststep'].includes(fromState.toLowerCase())
+ * && toState === params?.['target'],
+ * animate('1s')
+ * )
+ * ])
+ * ```
+ *
+ * @publicApi
+ **/
+function transition(stateChangeExpr, steps, options = null) {
+ return {
+ type: 1 /* AnimationMetadataType.Transition */,
+ expr: stateChangeExpr,
+ animation: steps,
+ options
+ };
}
/**
- * Default handler for matching stringified version of an item and a search query
- * @param item arbitrary element to match with a string
- * @param search search query
- * @param stringify handler to turn item into a string
+ * Produces a reusable animation that can be invoked in another animation or sequence,
+ * by calling the `useAnimation()` function.
+ *
+ * @param steps One or more animation objects, as returned by the `animate()`
+ * or `sequence()` function, that form a transformation from one state to another.
+ * A sequence is used by default when you pass an array.
+ * @param options An options object that can contain a delay value for the start of the
+ * animation, and additional developer-defined parameters.
+ * Provided values for additional parameters are used as defaults,
+ * and override values can be passed to the caller on invocation.
+ * @returns An object that encapsulates the animation data.
+ *
+ * @usageNotes
+ * The following example defines a reusable animation, providing some default parameter
+ * values.
+ *
+ * ```typescript
+ * var fadeAnimation = animation([
+ * style({ opacity: '{{ start }}' }),
+ * animate('{{ time }}',
+ * style({ opacity: '{{ end }}'}))
+ * ],
+ * { params: { time: '1000ms', start: 0, end: 1 }});
+ * ```
+ *
+ * The following invokes the defined animation with a call to `useAnimation()`,
+ * passing in override parameter values.
+ *
+ * ```js
+ * useAnimation(fadeAnimation, {
+ * params: {
+ * time: '2s',
+ * start: 1,
+ * end: 0
+ * }
+ * })
+ * ```
+ *
+ * If any of the passed-in parameter values are missing from this call,
+ * the default values are used. If one or more parameter values are missing before a step is
+ * animated, `useAnimation()` throws an error.
+ *
+ * @publicApi
*/
-const TUI_DEFAULT_MATCHER = (item, search, stringify = TUI_DEFAULT_STRINGIFY) => stringify(item).toLowerCase().includes(search.toLowerCase());
+function animation(steps, options = null) {
+ return {
+ type: 8 /* AnimationMetadataType.Reference */,
+ animation: steps,
+ options
+ };
+}
/**
- * Default handler for strict matching stringified version of an item and a search query
- * @param item arbitrary element to match with a string
- * @param search search query
- * @param stringify handler to turn item into a string
+ * Executes a queried inner animation element within an animation sequence.
+ *
+ * @param options An options object that can contain a delay value for the start of the
+ * animation, and additional override values for developer-defined parameters.
+ * @return An object that encapsulates the child animation data.
+ *
+ * @usageNotes
+ * Each time an animation is triggered in Angular, the parent animation
+ * has priority and any child animations are blocked. In order
+ * for a child animation to run, the parent animation must query each of the elements
+ * containing child animations, and run them using this function.
+ *
+ * Note that this feature is designed to be used with `query()` and it will only work
+ * with animations that are assigned using the Angular animation library. CSS keyframes
+ * and transitions are not handled by this API.
+ *
+ * @publicApi
*/
-const TUI_STRICT_MATCHER = (item, search, stringify = TUI_DEFAULT_STRINGIFY) => stringify(item).toLowerCase() === search.toLowerCase();
+function animateChild(options = null) {
+ return {
+ type: 9 /* AnimationMetadataType.AnimateChild */,
+ options
+ };
+}
/**
- * Default handler to match equality of two elements
- * ATTENTION: considers two empty arrays equal
+ * Starts a reusable animation that is created using the `animation()` function.
*
- * @param item1 first element
- * @param item2 second element
+ * @param animation The reusable animation to start.
+ * @param options An options object that can contain a delay value for the start of
+ * the animation, and additional override values for developer-defined parameters.
+ * @return An object that contains the animation parameters.
+ *
+ * @publicApi
*/
-const TUI_DEFAULT_IDENTITY_MATCHER = (item1, item2) => item1 === item2 || bothEmpty(item1, item2);
-
-/**
- * Add to enable child :leave animation (fixes https://github.com/angular/angular/issues/15753)
- */
-const TUI_PARENT_ANIMATION = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_1__.trigger)('tuiParentAnimation', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_1__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_1__.query)(':scope > *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_1__.animateChild)()], {
- optional: true
-})])]);
-/**
- * Add on parent to stop initial :enter animation for children
- */
-const TUI_PARENT_STOP = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_1__.trigger)('tuiParentStop', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_1__.transition)(':enter', [])]);
-const POLLING_TIME = 1000 / 15;
-
-// Filtering SVGElements for TreeWalker
-// Filter must be a function in IE, other modern browsers are compliant to this format
-const svgNodeFilter = node => 'ownerSVGElement' in node ? NodeFilter.FILTER_REJECT : NodeFilter.FILTER_ACCEPT;
-
-/**
- * {@link https://unicode-table.com/en/00A0/ Non-breaking space}.
- */
-const CHAR_NO_BREAK_SPACE = '\u00A0';
-/**
- * {@link https://unicode-table.com/en/2013/ EN dash}
- * is used to indicate a range of numbers or a span of time.
- * @example 2006–2022
- * ___
- * Don't confuse with {@link CHAR_EM_DASH} or {@link CHAR_HYPHEN}!
- */
-const CHAR_EN_DASH = '\u2013';
-/**
- * {@link https://unicode-table.com/en/2014/ EM dash}
- * is used to mark a break in a sentence.
- * @example Taiga UI — powerful set of open source components for Angular
- * ___
- * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_HYPHEN}!
- */
-const CHAR_EM_DASH = '\u2014';
-/**
- * {@link https://unicode-table.com/en/00AB/ Left-Pointing Double Angle Quotation Mark}
- */
-const CHAR_LAQUO = '\u00AB';
-/**
- * {@link https://unicode-table.com/en/00BB/ Right-Pointing Double Angle Quotation Mark}
- */
-const CHAR_RAQUO = '\u00BB';
-/**
- * {@link https://unicode-table.com/en/002D/ Hyphen (minus sign)}
- * is used to combine words.
- * @example well-behaved
- * ___
- * Don't confuse with {@link CHAR_EN_DASH} or {@link CHAR_EM_DASH}!
- */
-const CHAR_HYPHEN = '\u002D';
-/**
- * {@link https://unicode-table.com/en/2212/ Minus}
- * is used as math operator symbol or before negative digits.
- * ---
- * Can be used as `−`. Don't confuse with {@link CHAR_HYPHEN}
- */
-const CHAR_MINUS = '\u2212';
-/**
- * {@link https://unicode-table.com/en/002B/ Plus}
- */
-const CHAR_PLUS = '\u002B';
-/**
- * {@link https://unicode-table.com/en/2022/ Bullet}.
- */
-const CHAR_BULLET = '\u2022';
-/**
- * {@link https://unicode-table.com/en/2026/ Suspension points}.
- */
-const CHAR_ELLIPSIS = '\u2026';
-/**
- * {@link https://unicode-table.com/en/00A4/ Suspension points}.
- */
-const CHAR_CURRENCY_SIGN = '\u00A4';
-/**
- * {@link https://unicode-table.com/en/200b/ Suspension points}.
- */
-const CHAR_ZERO_WIDTH_SPACE = '\u200B';
-
+function useAnimation(animation, options = null) {
+ return {
+ type: 10 /* AnimationMetadataType.AnimateRef */,
+ animation,
+ options
+ };
+}
/**
- * @description:
- * AUTOGENERATED
+ * Finds one or more inner elements within the current element that is
+ * being animated within a sequence. Use with `animate()`.
*
- * Array of icons used in taiga-ui components
- */
-const TUI_USED_ICONS = ['tuiIconMirMono', 'tuiIconVisaMono', 'tuiIconElectronMono', 'tuiIconMastercard', 'tuiIconMaestro', 'tuiIconAmex', 'tuiIconDinersClub', 'tuiIconDiscover', 'tuiIconHumo', 'tuiIconJCB', 'tuiIconRuPay', 'tuiIconUnionPay', 'tuiIconUzcard', 'tuiIconVerve', 'tuiIconCopyLarge', 'tuiIconCheckLarge', 'tuiIconLink', 'tuiIconSearch', 'tuiIconSun', 'tuiIconMoon', 'tuiIconCode', 'tuiIconMenuLarge', 'tuiIconRotate', 'tuiIconArrowLeft', 'tuiIconArrowRight', 'tuiIconPlus', 'tuiIconMinus', 'tuiIconMinimize', 'tuiIconEye', 'tuiIconEyeOff', 'tuiIconDrag', 'tuiIconSortAscending', 'tuiIconSortDescending', 'tuiIconSortOff', 'tuiIconCheck', 'tuiIconMinusLarge', 'tuiIconChevronUp', 'tuiIconHelpCircle', 'tuiIconClose', 'tuiIconAlertCircle', 'tuiIconChevronRight', 'tuiIconInfo', 'tuiIconCheckCircle', 'tuiIconXCircle', 'tuiIconChevronLeft', 'tuiIconStarLarge', 'tuiIconChevronDown', 'tuiIconChevronDownLarge', 'tuiIconFileLarge', 'tuiIconCheckCircleLarge', 'tuiIconAlertCircleLarge', 'tuiIconTrashLarge', 'tuiIconCopy', 'tuiIconEyeOffLarge', 'tuiIconEyeLarge', 'tuiIconClock', 'tuiIconClockLarge', 'tuiIconToggleOff', 'tuiIconToggleOffLarge', 'tuiIconToggleOn', 'tuiIconToggleOnLarge', 'tuiIconCalendar', 'tuiIconCalendarLarge'];
-const TUI_VERSION = '3.96.0';
-
-/**
- * Generated bundle index. Do not edit.
+ * @param selector The element to query, or a set of elements that contain Angular-specific
+ * characteristics, specified with one or more of the following tokens.
+ * - `query(":enter")` or `query(":leave")` : Query for newly inserted/removed elements (not
+ * all elements can be queried via these tokens, see
+ * [Entering and Leaving Elements](#entering-and-leaving-elements))
+ * - `query(":animating")` : Query all currently animating elements.
+ * - `query("@triggerName")` : Query elements that contain an animation trigger.
+ * - `query("@*")` : Query all elements that contain an animation triggers.
+ * - `query(":self")` : Include the current element into the animation sequence.
+ *
+ * @param animation One or more animation steps to apply to the queried element or elements.
+ * An array is treated as an animation sequence.
+ * @param options An options object. Use the 'limit' field to limit the total number of
+ * items to collect.
+ * @return An object that encapsulates the query data.
+ *
+ * @usageNotes
+ *
+ * ### Multiple Tokens
+ *
+ * Tokens can be merged into a combined query selector string. For example:
+ *
+ * ```typescript
+ * query(':self, .record:enter, .record:leave, @subTrigger', [...])
+ * ```
+ *
+ * The `query()` function collects multiple elements and works internally by using
+ * `element.querySelectorAll`. Use the `limit` field of an options object to limit
+ * the total number of items to be collected. For example:
+ *
+ * ```js
+ * query('div', [
+ * animate(...),
+ * animate(...)
+ * ], { limit: 1 })
+ * ```
+ *
+ * By default, throws an error when zero items are found. Set the
+ * `optional` flag to ignore this error. For example:
+ *
+ * ```js
+ * query('.some-element-that-may-not-be-there', [
+ * animate(...),
+ * animate(...)
+ * ], { optional: true })
+ * ```
+ *
+ * ### Entering and Leaving Elements
+ *
+ * Not all elements can be queried via the `:enter` and `:leave` tokens, the only ones
+ * that can are those that Angular assumes can enter/leave based on their own logic
+ * (if their insertion/removal is simply a consequence of that of their parent they
+ * should be queried via a different token in their parent's `:enter`/`:leave` transitions).
+ *
+ * The only elements Angular assumes can enter/leave based on their own logic (thus the only
+ * ones that can be queried via the `:enter` and `:leave` tokens) are:
+ * - Those inserted dynamically (via `ViewContainerRef`)
+ * - Those that have a structural directive (which, under the hood, are a subset of the above ones)
+ *
+ *
+ *
+ * Note that elements will be successfully queried via `:enter`/`:leave` even if their
+ * insertion/removal is not done manually via `ViewContainerRef`or caused by their structural
+ * directive (e.g. they enter/exit alongside their parent).
+ *
+ *
+ *
+ *
+ *
+ * There is an exception to what previously mentioned, besides elements entering/leaving based on
+ * their own logic, elements with an animation trigger can always be queried via `:leave` when
+ * their parent is also leaving.
+ *
+ *
+ *
+ * ### Usage Example
+ *
+ * The following example queries for inner elements and animates them
+ * individually using `animate()`.
+ *
+ * ```typescript
+ * @Component({
+ * selector: 'inner',
+ * template: `
+ *
+ * ```
+ *
+ * Here is the component code:
+ *
+ * ```typescript
+ * import {trigger, transition, style, animate, query, stagger} from '@angular/animations';
+ * @Component({
+ * templateUrl: 'list.component.html',
+ * animations: [
+ * trigger('listAnimation', [
+ * ...
+ * ])
+ * ]
+ * })
+ * class ListComponent {
+ * items = [];
+ *
+ * showItems() {
+ * this.items = [0,1,2,3,4];
+ * }
+ *
+ * hideItems() {
+ * this.items = [];
+ * }
+ *
+ * toggle() {
+ * this.items.length ? this.hideItems() : this.showItems();
+ * }
+ * }
+ * ```
+ *
+ * Here is the animation trigger code:
+ *
+ * ```typescript
+ * trigger('listAnimation', [
+ * transition('* => *', [ // each time the binding value changes
+ * query(':leave', [
+ * stagger(100, [
+ * animate('0.5s', style({ opacity: 0 }))
+ * ])
+ * ]),
+ * query(':enter', [
+ * style({ opacity: 0 }),
+ * stagger(100, [
+ * animate('0.5s', style({ opacity: 1 }))
+ * ])
+ * ])
+ * ])
+ * ])
+ * ```
+ *
+ * @publicApi
*/
-const TUI_DATE_SEPARATOR = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)('.');
-const changeDateSeparator = (dateString, newDateSeparator) => dateString.replace(/[^0-9A-Za-zА-Яа-я]/gi, newDateSeparator);
+function stagger(timings, animation) {
+ return {
+ type: 12 /* AnimationMetadataType.Stagger */,
+ timings,
+ animation
+ };
+}
/**
- * Immutable year object
- * @nosideeffects
+ * An empty programmatic controller for reusable animations.
+ * Used internally when animations are disabled, to avoid
+ * checking for the null case when an animation player is expected.
+ *
+ * @see {@link animate}
+ * @see {@link AnimationPlayer}
+ * @see {@link ɵAnimationGroupPlayer AnimationGroupPlayer}
+ *
+ * @publicApi
*/
-class TuiYear {
- constructor(year) {
- this.year = year;
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(TuiYear.isValidYear(year));
+class NoopAnimationPlayer {
+ constructor(duration = 0, delay = 0) {
+ this._onDoneFns = [];
+ this._onStartFns = [];
+ this._onDestroyFns = [];
+ this._originalOnDoneFns = [];
+ this._originalOnStartFns = [];
+ this._started = false;
+ this._destroyed = false;
+ this._finished = false;
+ this._position = 0;
+ this.parentPlayer = null;
+ this.totalTime = duration + delay;
}
- /**
- * Checks year for validity
- */
- static isValidYear(year) {
- return Number.isInteger(year) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(year, MIN_YEAR, MAX_YEAR + 1);
+ _onFinish() {
+ if (!this._finished) {
+ this._finished = true;
+ this._onDoneFns.forEach(fn => fn());
+ this._onDoneFns = [];
+ }
}
- /**
- * Check if passed year is a leap year
- */
- static isLeapYear(year) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(TuiYear.isValidYear(year));
- return year % 400 === 0 || year % 4 === 0 && year % 100 !== 0;
+ onStart(fn) {
+ this._originalOnStartFns.push(fn);
+ this._onStartFns.push(fn);
}
- /**
- * Returns amount of leap years from year 0 to the passed one
- */
- static getAbsoluteLeapYears(year) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(TuiYear.isValidYear(year));
- return Math.ceil(year / 400) + (Math.ceil(year / 4) - Math.ceil(year / 100));
+ onDone(fn) {
+ this._originalOnDoneFns.push(fn);
+ this._onDoneFns.push(fn);
}
- static lengthBetween(from, to) {
- return to.year - from.year;
+ onDestroy(fn) {
+ this._onDestroyFns.push(fn);
}
- /**
- * Normalizes year by clamping it between min and max years
- */
- static normalizeYearPart(year) {
- return (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiNormalizeToIntNumber)(year, MIN_YEAR, MAX_YEAR);
+ hasStarted() {
+ return this._started;
}
- get formattedYear() {
- return String(this.year).padStart(4, '0');
+ init() {}
+ play() {
+ if (!this.hasStarted()) {
+ this._onStart();
+ this.triggerMicrotask();
+ }
+ this._started = true;
}
- get isLeapYear() {
- return TuiYear.isLeapYear(this.year);
+ /** @internal */
+ triggerMicrotask() {
+ queueMicrotask(() => this._onFinish());
}
- /**
- * Returns amount of leap years from year 0 to current
- */
- get absoluteLeapYears() {
- return TuiYear.getAbsoluteLeapYears(this.year);
+ _onStart() {
+ this._onStartFns.forEach(fn => fn());
+ this._onStartFns = [];
}
- /**
- * Passed year is after current
- */
- yearBefore({
- year
- }) {
- return this.year < year;
+ pause() {}
+ restart() {}
+ finish() {
+ this._onFinish();
}
- /**
- * Passed year is the same or after current
- */
- yearSameOrBefore({
- year
- }) {
- return this.year <= year;
+ destroy() {
+ if (!this._destroyed) {
+ this._destroyed = true;
+ if (!this.hasStarted()) {
+ this._onStart();
+ }
+ this.finish();
+ this._onDestroyFns.forEach(fn => fn());
+ this._onDestroyFns = [];
+ }
}
- /**
- * Passed year is the same as current
- */
- yearSame({
- year
- }) {
- return this.year === year;
+ reset() {
+ this._started = false;
+ this._finished = false;
+ this._onStartFns = this._originalOnStartFns;
+ this._onDoneFns = this._originalOnDoneFns;
}
- /**
- * Passed year is either the same of before the current
- */
- yearSameOrAfter({
- year
- }) {
- return this.year >= year;
- }
- /**
- * Passed year is before current
- */
- yearAfter({
- year
- }) {
- return this.year > year;
- }
- /**
- * Immutably offsets year
- */
- append({
- year = 0
- }) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(Number.isInteger(year));
- const resultYear = this.year + year;
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(TuiYear.isValidYear(resultYear));
- return new TuiYear(resultYear);
- }
- toString() {
- return this.formattedYear;
- }
- valueOf() {
- return this.year;
+ setPosition(position) {
+ this._position = this.totalTime ? position * this.totalTime : 1;
}
- /**
- * Returns the primitive value of the given Date object.
- * Depending on the argument, the method can return either a string or a number.
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/@@toPrimitive
- */
- [Symbol.toPrimitive](hint) {
- return Date.prototype[Symbol.toPrimitive].call(this, hint);
+ getPosition() {
+ return this.totalTime ? this._position / this.totalTime : 1;
}
- toJSON() {
- return this.formattedYear;
+ /** @internal */
+ triggerCallback(phaseName) {
+ const methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;
+ methods.forEach(fn => fn());
+ methods.length = 0;
}
}
/**
- * Immutable object consisting of year and month
+ * A programmatic controller for a group of reusable animations.
+ * Used internally to control animations.
+ *
+ * @see {@link AnimationPlayer}
+ * @see {@link animations/group group}
+ *
*/
-class TuiMonth extends TuiYear {
- /**
- * @param year
- * @param month (starting with 0)
- */
- constructor(year, month) {
- super(year);
- this.month = month;
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(TuiMonth.isValidMonth(year, month));
- }
- /**
- * Tests month and year for validity
- */
- static isValidMonth(year, month) {
- return TuiYear.isValidYear(year) && TuiMonth.isValidMonthPart(month);
- }
- /**
- * Returns number of days in a month
- */
- static getMonthDaysCount(month, isLeapYear) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(TuiMonth.isValidMonthPart(month));
- switch (month) {
- case _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiMonthNumber.February:
- return isLeapYear ? 29 : 28;
- case _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiMonthNumber.April:
- case _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiMonthNumber.June:
- case _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiMonthNumber.September:
- case _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiMonthNumber.November:
- return 30;
- default:
- return 31;
+class AnimationGroupPlayer {
+ constructor(_players) {
+ this._onDoneFns = [];
+ this._onStartFns = [];
+ this._finished = false;
+ this._started = false;
+ this._destroyed = false;
+ this._onDestroyFns = [];
+ this.parentPlayer = null;
+ this.totalTime = 0;
+ this.players = _players;
+ let doneCount = 0;
+ let destroyCount = 0;
+ let startCount = 0;
+ const total = this.players.length;
+ if (total == 0) {
+ queueMicrotask(() => this._onFinish());
+ } else {
+ this.players.forEach(player => {
+ player.onDone(() => {
+ if (++doneCount == total) {
+ this._onFinish();
+ }
+ });
+ player.onDestroy(() => {
+ if (++destroyCount == total) {
+ this._onDestroy();
+ }
+ });
+ player.onStart(() => {
+ if (++startCount == total) {
+ this._onStart();
+ }
+ });
+ });
}
+ this.totalTime = this.players.reduce((time, player) => Math.max(time, player.totalTime), 0);
}
- /**
- * Returns current month and year based on local time zone
- * @nosideeffects
- */
- static currentLocal() {
- const nativeDate = new Date();
- return new TuiMonth(nativeDate.getFullYear(), nativeDate.getMonth());
+ _onFinish() {
+ if (!this._finished) {
+ this._finished = true;
+ this._onDoneFns.forEach(fn => fn());
+ this._onDoneFns = [];
+ }
}
- /**
- * Returns current month and year based on UTC
- */
- static currentUtc() {
- const nativeDate = new Date();
- return new TuiMonth(nativeDate.getUTCFullYear(), nativeDate.getUTCMonth());
+ init() {
+ this.players.forEach(player => player.init());
}
- static lengthBetween(from, to) {
- const absoluteFrom = from.month + from.year * 12;
- const absoluteTo = to.month + to.year * 12;
- return absoluteTo - absoluteFrom;
+ onStart(fn) {
+ this._onStartFns.push(fn);
}
- /**
- * Normalizes number by clamping it between min and max month
- */
- static normalizeMonthPart(month) {
- return (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiNormalizeToIntNumber)(month, MIN_MONTH, MAX_MONTH);
+ _onStart() {
+ if (!this.hasStarted()) {
+ this._started = true;
+ this._onStartFns.forEach(fn => fn());
+ this._onStartFns = [];
+ }
}
- /**
- * Tests month for validity
- */
- static isValidMonthPart(month) {
- return Number.isInteger(month) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(month, MIN_MONTH, MAX_MONTH + 1);
+ onDone(fn) {
+ this._onDoneFns.push(fn);
}
- get formattedMonthPart() {
- return String(this.month + 1).padStart(2, '0');
+ onDestroy(fn) {
+ this._onDestroyFns.push(fn);
}
- /**
- * Returns days in a month
- */
- get daysCount() {
- return TuiMonth.getMonthDaysCount(this.month, this.isLeapYear);
+ hasStarted() {
+ return this._started;
}
- /**
- * Passed month and year are after current
- */
- monthBefore(another) {
- return this.yearBefore(another) || this.yearSame(another) && this.month < another.month;
+ play() {
+ if (!this.parentPlayer) {
+ this.init();
+ }
+ this._onStart();
+ this.players.forEach(player => player.play());
}
- /**
- * Passed month and year are after or the same as current
- */
- monthSameOrBefore(another) {
- return this.yearBefore(another) || this.yearSame(another) && this.month <= another.month;
+ pause() {
+ this.players.forEach(player => player.pause());
}
- /**
- * Passed month and year are the same as current
- */
- monthSame(another) {
- return this.yearSame(another) && this.month === another.month;
+ restart() {
+ this.players.forEach(player => player.restart());
}
- /**
- * Passed month and year are either before or equal to current
- */
- monthSameOrAfter(another) {
- return this.yearAfter(another) || this.yearSame(another) && this.month >= another.month;
+ finish() {
+ this._onFinish();
+ this.players.forEach(player => player.finish());
}
- /**
- * Passed month and year are before current
- */
- monthAfter(another) {
- return this.yearAfter(another) || this.yearSame(another) && this.month > another.month;
+ destroy() {
+ this._onDestroy();
}
- /**
- * Immutably alters current month and year by passed offset
- *
- * @param offset
- * @return new month and year object as a result of offsetting current
- */
- append({
- year = 0,
- month = 0
- }) {
- const totalMonths = (this.year + year) * MONTHS_IN_YEAR + this.month + month;
- return new TuiMonth(Math.floor(totalMonths / MONTHS_IN_YEAR), totalMonths % MONTHS_IN_YEAR);
+ _onDestroy() {
+ if (!this._destroyed) {
+ this._destroyed = true;
+ this._onFinish();
+ this.players.forEach(player => player.destroy());
+ this._onDestroyFns.forEach(fn => fn());
+ this._onDestroyFns = [];
+ }
}
- toString() {
- return `${this.formattedMonthPart}.${this.formattedYear}`;
+ reset() {
+ this.players.forEach(player => player.reset());
+ this._destroyed = false;
+ this._finished = false;
+ this._started = false;
}
- valueOf() {
- return this.toLocalNativeDate().valueOf();
+ setPosition(p) {
+ const timeAtPosition = p * this.totalTime;
+ this.players.forEach(player => {
+ const position = player.totalTime ? Math.min(1, timeAtPosition / player.totalTime) : 1;
+ player.setPosition(position);
+ });
}
- toJSON() {
- return `${super.toJSON()}-${this.formattedMonthPart}`;
+ getPosition() {
+ const longestPlayer = this.players.reduce((longestSoFar, player) => {
+ const newPlayerIsLongest = longestSoFar === null || player.totalTime > longestSoFar.totalTime;
+ return newPlayerIsLongest ? player : longestSoFar;
+ }, null);
+ return longestPlayer != null ? longestPlayer.getPosition() : 0;
}
- /**
- * Returns native {@link Date} based on local time zone
- */
- toLocalNativeDate() {
- return new Date(this.year, this.month);
+ beforeDestroy() {
+ this.players.forEach(player => {
+ if (player.beforeDestroy) {
+ player.beforeDestroy();
+ }
+ });
}
- /**
- * Returns native {@link Date} based on UTC
- */
- toUtcNativeDate() {
- return new Date(Date.UTC(this.year, this.month));
+ /** @internal */
+ triggerCallback(phaseName) {
+ const methods = phaseName == 'start' ? this._onStartFns : this._onDoneFns;
+ methods.forEach(fn => fn());
+ methods.length = 0;
}
}
+const ɵPRE_STYLE = '!';
-// TODO: Localized formatting
/**
- * Immutable date object, consisting of day, month and year
+ * @module
+ * @description
+ * Entry point for all animation APIs of the animation package.
*/
-class TuiDay extends TuiMonth {
- constructor(year, month, day) {
- super(year, month);
- this.day = day;
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(TuiDay.isValidDay(year, month, day));
- }
- /**
- * Creates {@link TuiDay} from native {@link Date} based on local time zone
- */
- static fromLocalNativeDate(date) {
- return new TuiDay(date.getFullYear(), date.getMonth(), date.getDate());
+
+/**
+ * @module
+ * @description
+ * Entry point for all public APIs of this package.
+ */
+
+// This file is not used to build this module. It is only used during editing
+
+/**
+ * Generated bundle index. Do not edit.
+ */
+
+
+
+/***/ }),
+
+/***/ 9306:
+/*!***************************************************************!*\
+ !*** ./node_modules/@angular/animations/fesm2022/browser.mjs ***!
+ \***************************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ AnimationDriver: () => (/* binding */ AnimationDriver),
+/* harmony export */ "ɵAnimation": () => (/* binding */ Animation),
+/* harmony export */ "ɵAnimationEngine": () => (/* binding */ AnimationEngine),
+/* harmony export */ "ɵAnimationStyleNormalizer": () => (/* binding */ AnimationStyleNormalizer),
+/* harmony export */ "ɵNoopAnimationDriver": () => (/* binding */ NoopAnimationDriver),
+/* harmony export */ "ɵNoopAnimationStyleNormalizer": () => (/* binding */ NoopAnimationStyleNormalizer),
+/* harmony export */ "ɵWebAnimationsDriver": () => (/* binding */ WebAnimationsDriver),
+/* harmony export */ "ɵWebAnimationsPlayer": () => (/* binding */ WebAnimationsPlayer),
+/* harmony export */ "ɵWebAnimationsStyleNormalizer": () => (/* binding */ WebAnimationsStyleNormalizer),
+/* harmony export */ "ɵallowPreviousPlayerStylesMerge": () => (/* binding */ allowPreviousPlayerStylesMerge),
+/* harmony export */ "ɵcontainsElement": () => (/* binding */ containsElement),
+/* harmony export */ "ɵgetParentElement": () => (/* binding */ getParentElement),
+/* harmony export */ "ɵinvokeQuery": () => (/* binding */ invokeQuery),
+/* harmony export */ "ɵnormalizeKeyframes": () => (/* binding */ normalizeKeyframes),
+/* harmony export */ "ɵvalidateStyleProperty": () => (/* binding */ validateStyleProperty)
+/* harmony export */ });
+/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/animations */ 2015);
+/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
+var _NoopAnimationDriver, _AnimationDriver, _SpecialCasedStyles;
+/**
+ * @license Angular v16.2.12
+ * (c) 2010-2022 Google LLC. https://angular.io/
+ * License: MIT
+ */
+
+
+
+
+const LINE_START = '\n - ';
+function invalidTimingValue(exp) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3000 /* RuntimeErrorCode.INVALID_TIMING_VALUE */, ngDevMode && `The provided timing value "${exp}" is invalid.`);
+}
+function negativeStepValue() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3100 /* RuntimeErrorCode.NEGATIVE_STEP_VALUE */, ngDevMode && 'Duration values below 0 are not allowed for this animation step.');
+}
+function negativeDelayValue() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3101 /* RuntimeErrorCode.NEGATIVE_DELAY_VALUE */, ngDevMode && 'Delay values below 0 are not allowed for this animation step.');
+}
+function invalidStyleParams(varName) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3001 /* RuntimeErrorCode.INVALID_STYLE_PARAMS */, ngDevMode && `Unable to resolve the local animation param ${varName} in the given list of values`);
+}
+function invalidParamValue(varName) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3003 /* RuntimeErrorCode.INVALID_PARAM_VALUE */, ngDevMode && `Please provide a value for the animation param ${varName}`);
+}
+function invalidNodeType(nodeType) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3004 /* RuntimeErrorCode.INVALID_NODE_TYPE */, ngDevMode && `Unable to resolve animation metadata node #${nodeType}`);
+}
+function invalidCssUnitValue(userProvidedProperty, value) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3005 /* RuntimeErrorCode.INVALID_CSS_UNIT_VALUE */, ngDevMode && `Please provide a CSS unit value for ${userProvidedProperty}:${value}`);
+}
+function invalidTrigger() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3006 /* RuntimeErrorCode.INVALID_TRIGGER */, ngDevMode && 'animation triggers cannot be prefixed with an `@` sign (e.g. trigger(\'@foo\', [...]))');
+}
+function invalidDefinition() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3007 /* RuntimeErrorCode.INVALID_DEFINITION */, ngDevMode && 'only state() and transition() definitions can sit inside of a trigger()');
+}
+function invalidState(metadataName, missingSubs) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3008 /* RuntimeErrorCode.INVALID_STATE */, ngDevMode && `state("${metadataName}", ...) must define default values for all the following style substitutions: ${missingSubs.join(', ')}`);
+}
+function invalidStyleValue(value) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3002 /* RuntimeErrorCode.INVALID_STYLE_VALUE */, ngDevMode && `The provided style string value ${value} is not allowed.`);
+}
+function invalidProperty(prop) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3009 /* RuntimeErrorCode.INVALID_PROPERTY */, ngDevMode && `The provided animation property "${prop}" is not a supported CSS property for animations`);
+}
+function invalidParallelAnimation(prop, firstStart, firstEnd, secondStart, secondEnd) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3010 /* RuntimeErrorCode.INVALID_PARALLEL_ANIMATION */, ngDevMode && `The CSS property "${prop}" that exists between the times of "${firstStart}ms" and "${firstEnd}ms" is also being animated in a parallel animation between the times of "${secondStart}ms" and "${secondEnd}ms"`);
+}
+function invalidKeyframes() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3011 /* RuntimeErrorCode.INVALID_KEYFRAMES */, ngDevMode && `keyframes() must be placed inside of a call to animate()`);
+}
+function invalidOffset() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3012 /* RuntimeErrorCode.INVALID_OFFSET */, ngDevMode && `Please ensure that all keyframe offsets are between 0 and 1`);
+}
+function keyframeOffsetsOutOfOrder() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3200 /* RuntimeErrorCode.KEYFRAME_OFFSETS_OUT_OF_ORDER */, ngDevMode && `Please ensure that all keyframe offsets are in order`);
+}
+function keyframesMissingOffsets() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3202 /* RuntimeErrorCode.KEYFRAMES_MISSING_OFFSETS */, ngDevMode && `Not all style() steps within the declared keyframes() contain offsets`);
+}
+function invalidStagger() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3013 /* RuntimeErrorCode.INVALID_STAGGER */, ngDevMode && `stagger() can only be used inside of query()`);
+}
+function invalidQuery(selector) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3014 /* RuntimeErrorCode.INVALID_QUERY */, ngDevMode && `\`query("${selector}")\` returned zero elements. (Use \`query("${selector}", { optional: true })\` if you wish to allow this.)`);
+}
+function invalidExpression(expr) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3015 /* RuntimeErrorCode.INVALID_EXPRESSION */, ngDevMode && `The provided transition expression "${expr}" is not supported`);
+}
+function invalidTransitionAlias(alias) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3016 /* RuntimeErrorCode.INVALID_TRANSITION_ALIAS */, ngDevMode && `The transition alias value "${alias}" is not supported`);
+}
+function validationFailed(errors) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3500 /* RuntimeErrorCode.VALIDATION_FAILED */, ngDevMode && `animation validation failed:\n${errors.map(err => err.message).join('\n')}`);
+}
+function buildingFailed(errors) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3501 /* RuntimeErrorCode.BUILDING_FAILED */, ngDevMode && `animation building failed:\n${errors.map(err => err.message).join('\n')}`);
+}
+function triggerBuildFailed(name, errors) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3404 /* RuntimeErrorCode.TRIGGER_BUILD_FAILED */, ngDevMode && `The animation trigger "${name}" has failed to build due to the following errors:\n - ${errors.map(err => err.message).join('\n - ')}`);
+}
+function animationFailed(errors) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3502 /* RuntimeErrorCode.ANIMATION_FAILED */, ngDevMode && `Unable to animate due to the following errors:${LINE_START}${errors.map(err => err.message).join(LINE_START)}`);
+}
+function registerFailed(errors) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3503 /* RuntimeErrorCode.REGISTRATION_FAILED */, ngDevMode && `Unable to build the animation due to the following errors: ${errors.map(err => err.message).join('\n')}`);
+}
+function missingOrDestroyedAnimation() {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3300 /* RuntimeErrorCode.MISSING_OR_DESTROYED_ANIMATION */, ngDevMode && 'The requested animation doesn\'t exist or has already been destroyed');
+}
+function createAnimationFailed(errors) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3504 /* RuntimeErrorCode.CREATE_ANIMATION_FAILED */, ngDevMode && `Unable to create the animation due to the following errors:${errors.map(err => err.message).join('\n')}`);
+}
+function missingPlayer(id) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3301 /* RuntimeErrorCode.MISSING_PLAYER */, ngDevMode && `Unable to find the timeline player referenced by ${id}`);
+}
+function missingTrigger(phase, name) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3302 /* RuntimeErrorCode.MISSING_TRIGGER */, ngDevMode && `Unable to listen on the animation trigger event "${phase}" because the animation trigger "${name}" doesn\'t exist!`);
+}
+function missingEvent(name) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3303 /* RuntimeErrorCode.MISSING_EVENT */, ngDevMode && `Unable to listen on the animation trigger "${name}" because the provided event is undefined!`);
+}
+function unsupportedTriggerEvent(phase, name) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3400 /* RuntimeErrorCode.UNSUPPORTED_TRIGGER_EVENT */, ngDevMode && `The provided animation trigger event "${phase}" for the animation trigger "${name}" is not supported!`);
+}
+function unregisteredTrigger(name) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3401 /* RuntimeErrorCode.UNREGISTERED_TRIGGER */, ngDevMode && `The provided animation trigger "${name}" has not been registered!`);
+}
+function triggerTransitionsFailed(errors) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3402 /* RuntimeErrorCode.TRIGGER_TRANSITIONS_FAILED */, ngDevMode && `Unable to process animations due to the following failed trigger transitions\n ${errors.map(err => err.message).join('\n')}`);
+}
+function triggerParsingFailed(name, errors) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3403 /* RuntimeErrorCode.TRIGGER_PARSING_FAILED */, ngDevMode && `Animation parsing for the ${name} trigger have failed:${LINE_START}${errors.map(err => err.message).join(LINE_START)}`);
+}
+function transitionFailed(name, errors) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](3505 /* RuntimeErrorCode.TRANSITION_FAILED */, ngDevMode && `@${name} has failed due to:\n ${errors.map(err => err.message).join('\n- ')}`);
+}
+
+/**
+ * Set of all animatable CSS properties
+ *
+ * @see https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties
+ */
+const ANIMATABLE_PROP_SET = new Set(['-moz-outline-radius', '-moz-outline-radius-bottomleft', '-moz-outline-radius-bottomright', '-moz-outline-radius-topleft', '-moz-outline-radius-topright', '-ms-grid-columns', '-ms-grid-rows', '-webkit-line-clamp', '-webkit-text-fill-color', '-webkit-text-stroke', '-webkit-text-stroke-color', 'accent-color', 'all', 'backdrop-filter', 'background', 'background-color', 'background-position', 'background-size', 'block-size', 'border', 'border-block-end', 'border-block-end-color', 'border-block-end-width', 'border-block-start', 'border-block-start-color', 'border-block-start-width', 'border-bottom', 'border-bottom-color', 'border-bottom-left-radius', 'border-bottom-right-radius', 'border-bottom-width', 'border-color', 'border-end-end-radius', 'border-end-start-radius', 'border-image-outset', 'border-image-slice', 'border-image-width', 'border-inline-end', 'border-inline-end-color', 'border-inline-end-width', 'border-inline-start', 'border-inline-start-color', 'border-inline-start-width', 'border-left', 'border-left-color', 'border-left-width', 'border-radius', 'border-right', 'border-right-color', 'border-right-width', 'border-start-end-radius', 'border-start-start-radius', 'border-top', 'border-top-color', 'border-top-left-radius', 'border-top-right-radius', 'border-top-width', 'border-width', 'bottom', 'box-shadow', 'caret-color', 'clip', 'clip-path', 'color', 'column-count', 'column-gap', 'column-rule', 'column-rule-color', 'column-rule-width', 'column-width', 'columns', 'filter', 'flex', 'flex-basis', 'flex-grow', 'flex-shrink', 'font', 'font-size', 'font-size-adjust', 'font-stretch', 'font-variation-settings', 'font-weight', 'gap', 'grid-column-gap', 'grid-gap', 'grid-row-gap', 'grid-template-columns', 'grid-template-rows', 'height', 'inline-size', 'input-security', 'inset', 'inset-block', 'inset-block-end', 'inset-block-start', 'inset-inline', 'inset-inline-end', 'inset-inline-start', 'left', 'letter-spacing', 'line-clamp', 'line-height', 'margin', 'margin-block-end', 'margin-block-start', 'margin-bottom', 'margin-inline-end', 'margin-inline-start', 'margin-left', 'margin-right', 'margin-top', 'mask', 'mask-border', 'mask-position', 'mask-size', 'max-block-size', 'max-height', 'max-inline-size', 'max-lines', 'max-width', 'min-block-size', 'min-height', 'min-inline-size', 'min-width', 'object-position', 'offset', 'offset-anchor', 'offset-distance', 'offset-path', 'offset-position', 'offset-rotate', 'opacity', 'order', 'outline', 'outline-color', 'outline-offset', 'outline-width', 'padding', 'padding-block-end', 'padding-block-start', 'padding-bottom', 'padding-inline-end', 'padding-inline-start', 'padding-left', 'padding-right', 'padding-top', 'perspective', 'perspective-origin', 'right', 'rotate', 'row-gap', 'scale', 'scroll-margin', 'scroll-margin-block', 'scroll-margin-block-end', 'scroll-margin-block-start', 'scroll-margin-bottom', 'scroll-margin-inline', 'scroll-margin-inline-end', 'scroll-margin-inline-start', 'scroll-margin-left', 'scroll-margin-right', 'scroll-margin-top', 'scroll-padding', 'scroll-padding-block', 'scroll-padding-block-end', 'scroll-padding-block-start', 'scroll-padding-bottom', 'scroll-padding-inline', 'scroll-padding-inline-end', 'scroll-padding-inline-start', 'scroll-padding-left', 'scroll-padding-right', 'scroll-padding-top', 'scroll-snap-coordinate', 'scroll-snap-destination', 'scrollbar-color', 'shape-image-threshold', 'shape-margin', 'shape-outside', 'tab-size', 'text-decoration', 'text-decoration-color', 'text-decoration-thickness', 'text-emphasis', 'text-emphasis-color', 'text-indent', 'text-shadow', 'text-underline-offset', 'top', 'transform', 'transform-origin', 'translate', 'vertical-align', 'visibility', 'width', 'word-spacing', 'z-index', 'zoom']);
+function optimizeGroupPlayer(players) {
+ switch (players.length) {
+ case 0:
+ return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__.NoopAnimationPlayer();
+ case 1:
+ return players[0];
+ default:
+ return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵAnimationGroupPlayer"](players);
}
- /**
- * Creates {@link TuiDay} from native {@link Date} using UTC
- */
- static fromUtcNativeDate(date) {
- return new TuiDay(date.getUTCFullYear(), date.getUTCMonth(), date.getUTCDate());
+}
+function normalizeKeyframes$1(normalizer, keyframes, preStyles = new Map(), postStyles = new Map()) {
+ const errors = [];
+ const normalizedKeyframes = [];
+ let previousOffset = -1;
+ let previousKeyframe = null;
+ keyframes.forEach(kf => {
+ const offset = kf.get('offset');
+ const isSameOffset = offset == previousOffset;
+ const normalizedKeyframe = isSameOffset && previousKeyframe || new Map();
+ kf.forEach((val, prop) => {
+ let normalizedProp = prop;
+ let normalizedValue = val;
+ if (prop !== 'offset') {
+ normalizedProp = normalizer.normalizePropertyName(normalizedProp, errors);
+ switch (normalizedValue) {
+ case _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵPRE_STYLE"]:
+ normalizedValue = preStyles.get(prop);
+ break;
+ case _angular_animations__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE:
+ normalizedValue = postStyles.get(prop);
+ break;
+ default:
+ normalizedValue = normalizer.normalizeStyleValue(prop, normalizedProp, normalizedValue, errors);
+ break;
+ }
+ }
+ normalizedKeyframe.set(normalizedProp, normalizedValue);
+ });
+ if (!isSameOffset) {
+ normalizedKeyframes.push(normalizedKeyframe);
+ }
+ previousKeyframe = normalizedKeyframe;
+ previousOffset = offset;
+ });
+ if (errors.length) {
+ throw animationFailed(errors);
}
- /**
- * Check validity of year, month and day
- *
- * @param year
- * @param month
- * @param day
- * @return boolean validity
- */
- static isValidDay(year, month, day) {
- return TuiMonth.isValidMonth(year, month) && Number.isInteger(day) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(day, MIN_DAY, TuiMonth.getMonthDaysCount(month, TuiYear.isLeapYear(year)) + 1);
+ return normalizedKeyframes;
+}
+function listenOnPlayer(player, eventName, event, callback) {
+ switch (eventName) {
+ case 'start':
+ player.onStart(() => callback(event && copyAnimationEvent(event, 'start', player)));
+ break;
+ case 'done':
+ player.onDone(() => callback(event && copyAnimationEvent(event, 'done', player)));
+ break;
+ case 'destroy':
+ player.onDestroy(() => callback(event && copyAnimationEvent(event, 'destroy', player)));
+ break;
}
- /**
- * Current day based on local time zone
- */
- static currentLocal() {
- const nativeDate = new Date();
- const year = nativeDate.getFullYear();
- const month = nativeDate.getMonth();
- const day = nativeDate.getDate();
- return new TuiDay(year, month, day);
+}
+function copyAnimationEvent(e, phaseName, player) {
+ const totalTime = player.totalTime;
+ const disabled = player.disabled ? true : false;
+ const event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime, disabled);
+ const data = e['_data'];
+ if (data != null) {
+ event['_data'] = data;
}
- /**
- * Returns current day based on UTC
- */
- static currentUtc() {
- const nativeDate = new Date();
- const year = nativeDate.getUTCFullYear();
- const month = nativeDate.getUTCMonth();
- const day = nativeDate.getUTCDate();
- return new TuiDay(year, month, day);
+ return event;
+}
+function makeAnimationEvent(element, triggerName, fromState, toState, phaseName = '', totalTime = 0, disabled) {
+ return {
+ element,
+ triggerName,
+ fromState,
+ toState,
+ phaseName,
+ totalTime,
+ disabled: !!disabled
+ };
+}
+function getOrSetDefaultValue(map, key, defaultValue) {
+ let value = map.get(key);
+ if (!value) {
+ map.set(key, value = defaultValue);
}
- /**
- * Calculates {@link TuiDay} normalizing year, month and day. {@link NaN} is turned into minimal value.
- *
- * @param year any year value, including invalid
- * @param month any month value, including invalid (months start with 0)
- * @param day any day value, including invalid
- * @return normalized date
- */
- static normalizeOf(year, month, day) {
- const normalizedYear = TuiYear.normalizeYearPart(year);
- const normalizedMonth = TuiMonth.normalizeMonthPart(month);
- const normalizedDay = TuiDay.normalizeDayPart(day, normalizedMonth, normalizedYear);
- return new TuiDay(normalizedYear, normalizedMonth, normalizedDay);
+ return value;
+}
+function parseTimelineCommand(command) {
+ const separatorPos = command.indexOf(':');
+ const id = command.substring(1, separatorPos);
+ const action = command.slice(separatorPos + 1);
+ return [id, action];
+}
+const documentElement = /* @__PURE__ */(() => typeof document === 'undefined' ? null : document.documentElement)();
+function getParentElement(element) {
+ const parent = element.parentNode || element.host || null; // consider host to support shadow DOM
+ if (parent === documentElement) {
+ return null;
}
- static lengthBetween(from, to) {
- return Math.round((to.toLocalNativeDate().getTime() - from.toLocalNativeDate().getTime()) / (1000 * 60 * 60 * 24));
+ return parent;
+}
+function containsVendorPrefix(prop) {
+ // Webkit is the only real popular vendor prefix nowadays
+ // cc: http://shouldiprefix.com/
+ return prop.substring(1, 6) == 'ebkit'; // webkit or Webkit
+}
+let _CACHED_BODY = null;
+let _IS_WEBKIT = false;
+function validateStyleProperty(prop) {
+ if (!_CACHED_BODY) {
+ _CACHED_BODY = getBodyNode() || {};
+ _IS_WEBKIT = _CACHED_BODY.style ? 'WebkitAppearance' in _CACHED_BODY.style : false;
}
- static parseRawDateString(date, dateMode = 'DMY') {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(date.length === DATE_FILLER_LENGTH, '[parseRawDateString]: wrong date string length');
- switch (dateMode) {
- case 'YMD':
- return {
- day: parseInt(date.slice(8, 10), 10),
- month: parseInt(date.slice(5, 7), 10) - 1,
- year: parseInt(date.slice(0, 4), 10)
- };
- case 'MDY':
- return {
- day: parseInt(date.slice(3, 5), 10),
- month: parseInt(date.slice(0, 2), 10) - 1,
- year: parseInt(date.slice(6, 10), 10)
- };
- case 'DMY':
- default:
- return {
- day: parseInt(date.slice(0, 2), 10),
- month: parseInt(date.slice(3, 5), 10) - 1,
- year: parseInt(date.slice(6, 10), 10)
- };
+ let result = true;
+ if (_CACHED_BODY.style && !containsVendorPrefix(prop)) {
+ result = prop in _CACHED_BODY.style;
+ if (!result && _IS_WEBKIT) {
+ const camelProp = 'Webkit' + prop.charAt(0).toUpperCase() + prop.slice(1);
+ result = camelProp in _CACHED_BODY.style;
}
}
- // TODO: Move month and year related code corresponding classes
- /**
- * Parsing a string with date with normalization
- *
- * @param rawDate date string
- * @param dateMode date format of the date string (DMY | MDY | YMD)
- * @return normalized date
- */
- static normalizeParse(rawDate, dateMode = 'DMY') {
- const {
- day,
- month,
- year
- } = this.parseRawDateString(rawDate, dateMode);
- return TuiDay.normalizeOf(year, month, day);
+ return result;
+}
+function validateWebAnimatableStyleProperty(prop) {
+ return ANIMATABLE_PROP_SET.has(prop);
+}
+function getBodyNode() {
+ if (typeof document != 'undefined') {
+ return document.body;
}
- /**
- * Parsing a date stringified in a toJSON format
- * @param yearMonthDayString date string in format of YYYY-MM-DD
- * @return date
- * @throws exceptions if any part of the date is invalid
- */
- static jsonParse(yearMonthDayString) {
- const {
- day,
- month,
- year
- } = this.parseRawDateString(yearMonthDayString, 'YMD');
- if (!TuiYear.isValidYear(year)) {
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_5__.TuiInvalidYearException(year);
- }
- if (!TuiMonth.isValidMonth(year, month)) {
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_5__.TuiInvalidMonthException(month);
- }
- if (!Number.isInteger(day) || !(0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(day, MIN_DAY, TuiMonth.getMonthDaysCount(month, TuiYear.isLeapYear(year)) + 1)) {
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_5__.TuiInvalidDayException(day);
+ return null;
+}
+function containsElement(elm1, elm2) {
+ while (elm2) {
+ if (elm2 === elm1) {
+ return true;
}
- return new TuiDay(year, month, day);
+ elm2 = getParentElement(elm2);
}
- static normalizeDayPart(day, month, year) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(TuiMonth.isValidMonth(year, month));
- const monthDaysCount = TuiMonth.getMonthDaysCount(month, TuiYear.isLeapYear(year));
- return (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiNormalizeToIntNumber)(day, 1, monthDaysCount);
+ return false;
+}
+function invokeQuery(element, selector, multi) {
+ if (multi) {
+ return Array.from(element.querySelectorAll(selector));
}
- get formattedDayPart() {
- return String(this.day).padStart(2, '0');
+ const elem = element.querySelector(selector);
+ return elem ? [elem] : [];
+}
+function hypenatePropsKeys(original) {
+ const newMap = new Map();
+ original.forEach((val, prop) => {
+ const newProp = prop.replace(/([a-z])([A-Z])/g, '$1-$2');
+ newMap.set(newProp, val);
+ });
+ return newMap;
+}
+
+/**
+ * @publicApi
+ */
+class NoopAnimationDriver {
+ validateStyleProperty(prop) {
+ return validateStyleProperty(prop);
}
- get isWeekend() {
- const dayOfWeek = this.dayOfWeek(false);
- return dayOfWeek === _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiDayOfWeek.Saturday || dayOfWeek === _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiDayOfWeek.Sunday;
+ matchesElement(_element, _selector) {
+ // This method is deprecated and no longer in use so we return false.
+ return false;
}
- /**
- * Returns day of week
- *
- * @param startFromMonday whether week starts from Monday and not from Sunday
- * @return day of week (from 0 to 6)
- */
- dayOfWeek(startFromMonday = true) {
- const dayOfWeek = startFromMonday ? this.toLocalNativeDate().getDay() - 1 : this.toLocalNativeDate().getDay();
- return dayOfWeek < 0 ? 6 : dayOfWeek;
+ containsElement(elm1, elm2) {
+ return containsElement(elm1, elm2);
}
- /**
- * Passed date is after current
- */
- dayBefore(another) {
- return this.monthBefore(another) || this.monthSame(another) && this.day < another.day;
+ getParentElement(element) {
+ return getParentElement(element);
}
- /**
- * Passed date is after or equals to current
- */
- daySameOrBefore(another) {
- return this.monthBefore(another) || this.monthSame(another) && this.day <= another.day;
+ query(element, selector, multi) {
+ return invokeQuery(element, selector, multi);
}
- /**
- * Passed date is the same as current
- */
- daySame(another) {
- return this.monthSame(another) && this.day === another.day;
+ computeStyle(element, prop, defaultValue) {
+ return defaultValue || '';
}
- /**
- * Passed date is either before or the same as current
- */
- daySameOrAfter(another) {
- return this.monthAfter(another) || this.monthSame(another) && this.day >= another.day;
+ animate(element, keyframes, duration, delay, easing, previousPlayers = [], scrubberAccessRequested) {
+ return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__.NoopAnimationPlayer(duration, delay);
}
- /**
- * Passed date is before current
- */
- dayAfter(another) {
- return this.monthAfter(another) || this.monthSame(another) && this.day > another.day;
+}
+_NoopAnimationDriver = NoopAnimationDriver;
+_NoopAnimationDriver.ɵfac = function _NoopAnimationDriver_Factory(t) {
+ return new (t || _NoopAnimationDriver)();
+};
+_NoopAnimationDriver.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _NoopAnimationDriver,
+ factory: _NoopAnimationDriver.ɵfac
+});
+(function () {
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NoopAnimationDriver, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable
+ }], null, null);
+})();
+/**
+ * @publicApi
+ */
+class AnimationDriver {}
+_AnimationDriver = AnimationDriver;
+_AnimationDriver.NOOP = /* @__PURE__ */new NoopAnimationDriver();
+const ONE_SECOND = 1000;
+const SUBSTITUTION_EXPR_START = '{{';
+const SUBSTITUTION_EXPR_END = '}}';
+const ENTER_CLASSNAME = 'ng-enter';
+const LEAVE_CLASSNAME = 'ng-leave';
+const NG_TRIGGER_CLASSNAME = 'ng-trigger';
+const NG_TRIGGER_SELECTOR = '.ng-trigger';
+const NG_ANIMATING_CLASSNAME = 'ng-animating';
+const NG_ANIMATING_SELECTOR = '.ng-animating';
+function resolveTimingValue(value) {
+ if (typeof value == 'number') return value;
+ const matches = value.match(/^(-?[\.\d]+)(m?s)/);
+ if (!matches || matches.length < 2) return 0;
+ return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
+}
+function _convertTimeValueToMS(value, unit) {
+ switch (unit) {
+ case 's':
+ return value * ONE_SECOND;
+ default:
+ // ms or something else
+ return value;
}
- /**
- * Clamping date between two limits
- *
- * @param min
- * @param max
- * @return clamped date
- */
- dayLimit(min, max) {
- if (min !== null && this.dayBefore(min)) {
- return min;
+}
+function resolveTiming(timings, errors, allowNegativeValues) {
+ return timings.hasOwnProperty('duration') ? timings : parseTimeExpression(timings, errors, allowNegativeValues);
+}
+function parseTimeExpression(exp, errors, allowNegativeValues) {
+ const regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i;
+ let duration;
+ let delay = 0;
+ let easing = '';
+ if (typeof exp === 'string') {
+ const matches = exp.match(regex);
+ if (matches === null) {
+ errors.push(invalidTimingValue(exp));
+ return {
+ duration: 0,
+ delay: 0,
+ easing: ''
+ };
}
- if (max !== null && this.dayAfter(max)) {
- return max;
+ duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]);
+ const delayMatch = matches[3];
+ if (delayMatch != null) {
+ delay = _convertTimeValueToMS(parseFloat(delayMatch), matches[4]);
}
- return this;
+ const easingVal = matches[5];
+ if (easingVal) {
+ easing = easingVal;
+ }
+ } else {
+ duration = exp;
}
- /**
- * Immutably alters current day by passed offset
- *
- * If resulting month has more days than original one, date is rounded to the maximum day
- * in the resulting month. Offset of days will be calculated based on the resulted year and month
- * to not interfere with parent classes methods
- *
- * @param offset
- * @return new date object as a result of offsetting current
- */
- append({
- year = 0,
- month = 0,
- day = 0
- }) {
- const totalMonths = (this.year + year) * MONTHS_IN_YEAR + this.month + month;
- let years = Math.floor(totalMonths / MONTHS_IN_YEAR);
- let months = totalMonths % MONTHS_IN_YEAR;
- let days = Math.min(this.day, TuiMonth.getMonthDaysCount(months, TuiYear.isLeapYear(years))) + day;
- while (days > TuiMonth.getMonthDaysCount(months, TuiYear.isLeapYear(years))) {
- days -= TuiMonth.getMonthDaysCount(months, TuiYear.isLeapYear(years));
- if (months === _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiMonthNumber.December) {
- years++;
- months = _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiMonthNumber.January;
- } else {
- months++;
- }
+ if (!allowNegativeValues) {
+ let containsErrors = false;
+ let startIndex = errors.length;
+ if (duration < 0) {
+ errors.push(negativeStepValue());
+ containsErrors = true;
}
- while (days < MIN_DAY) {
- if (months === _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiMonthNumber.January) {
- years--;
- months = _taiga_ui_cdk_enums__WEBPACK_IMPORTED_MODULE_4__.TuiMonthNumber.December;
- } else {
- months--;
- }
- days += TuiMonth.getMonthDaysCount(months, TuiYear.isLeapYear(years));
+ if (delay < 0) {
+ errors.push(negativeDelayValue());
+ containsErrors = true;
}
- return new TuiDay(years, months, days);
- }
- /**
- * Returns formatted whole date
- */
- getFormattedDay(dateFormat, separator) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(separator.length === 1, 'Separator should consist of only 1 symbol');
- const dd = this.formattedDayPart;
- const mm = this.formattedMonthPart;
- const yyyy = this.formattedYear;
- switch (dateFormat) {
- case 'YMD':
- return `${yyyy}${separator}${mm}${separator}${dd}`;
- case 'MDY':
- return `${mm}${separator}${dd}${separator}${yyyy}`;
- case 'DMY':
- default:
- return `${dd}${separator}${mm}${separator}${yyyy}`;
+ if (containsErrors) {
+ errors.splice(startIndex, 0, invalidTimingValue(exp));
}
}
- toString(dateFormat = 'DMY', separator = '.') {
- return this.getFormattedDay(dateFormat, separator);
- }
- toJSON() {
- return `${super.toJSON()}-${this.formattedDayPart}`;
+ return {
+ duration,
+ delay,
+ easing
+ };
+}
+function copyObj(obj, destination = {}) {
+ Object.keys(obj).forEach(prop => {
+ destination[prop] = obj[prop];
+ });
+ return destination;
+}
+function convertToMap(obj) {
+ const styleMap = new Map();
+ Object.keys(obj).forEach(prop => {
+ const val = obj[prop];
+ styleMap.set(prop, val);
+ });
+ return styleMap;
+}
+function normalizeKeyframes(keyframes) {
+ if (!keyframes.length) {
+ return [];
}
- /**
- * Returns native {@link Date} based on local time zone
- */
- toLocalNativeDate() {
- return new Date(this.year, this.month, this.day);
+ if (keyframes[0] instanceof Map) {
+ return keyframes;
}
- /**
- * Returns native {@link Date} based on UTC
- */
- toUtcNativeDate() {
- return new Date(Date.UTC(this.year, this.month, this.day));
+ return keyframes.map(kf => convertToMap(kf));
+}
+function normalizeStyles(styles) {
+ const normalizedStyles = new Map();
+ if (Array.isArray(styles)) {
+ styles.forEach(data => copyStyles(data, normalizedStyles));
+ } else {
+ copyStyles(styles, normalizedStyles);
}
+ return normalizedStyles;
}
-
-/**
- * An immutable range of two {@link TuiMonth} objects
- */
-class TuiMonthRange {
- constructor(from, to) {
- this.from = from;
- this.to = to;
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(from.monthSameOrBefore(to));
+function copyStyles(styles, destination = new Map(), backfill) {
+ if (backfill) {
+ for (let [prop, val] of backfill) {
+ destination.set(prop, val);
+ }
}
- static sort(month1, month2) {
- return month1.monthSameOrBefore(month2) ? new TuiMonthRange(month1, month2) : new TuiMonthRange(month2, month1);
+ for (let [prop, val] of styles) {
+ destination.set(prop, val);
}
- get isSingleMonth() {
- return this.from.monthSame(this.to);
+ return destination;
+}
+function setStyles(element, styles, formerStyles) {
+ styles.forEach((val, prop) => {
+ const camelProp = dashCaseToCamelCase(prop);
+ if (formerStyles && !formerStyles.has(prop)) {
+ formerStyles.set(prop, element.style[camelProp]);
+ }
+ element.style[camelProp] = val;
+ });
+}
+function eraseStyles(element, styles) {
+ styles.forEach((_, prop) => {
+ const camelProp = dashCaseToCamelCase(prop);
+ element.style[camelProp] = '';
+ });
+}
+function normalizeAnimationEntry(steps) {
+ if (Array.isArray(steps)) {
+ if (steps.length == 1) return steps[0];
+ return (0,_angular_animations__WEBPACK_IMPORTED_MODULE_1__.sequence)(steps);
}
- monthSame(another) {
- return this.from.monthSame(another.from) && this.to.monthSame(another.to);
+ return steps;
+}
+function validateStyleParams(value, options, errors) {
+ const params = options.params || {};
+ const matches = extractStyleParams(value);
+ if (matches.length) {
+ matches.forEach(varName => {
+ if (!params.hasOwnProperty(varName)) {
+ errors.push(invalidStyleParams(varName));
+ }
+ });
}
- toString() {
- return `${this.from}${RANGE_SEPARATOR_CHAR}${this.to}`;
+}
+const PARAM_REGEX = new RegExp(`${SUBSTITUTION_EXPR_START}\\s*(.+?)\\s*${SUBSTITUTION_EXPR_END}`, 'g');
+function extractStyleParams(value) {
+ let params = [];
+ if (typeof value === 'string') {
+ let match;
+ while (match = PARAM_REGEX.exec(value)) {
+ params.push(match[1]);
+ }
+ PARAM_REGEX.lastIndex = 0;
}
+ return params;
}
-
-/**
- * An immutable range of two {@link TuiDay} objects
- */
-class TuiDayRange extends TuiMonthRange {
- constructor(from, to) {
- super(from, to);
- this.from = from;
- this.to = to;
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(from.daySameOrBefore(to));
- }
- /**
- * Creates range from two days after sorting them
- *
- * @param day1
- * @param day2
- * @return new range with sorted days
- */
- static sort(day1, day2) {
- return day1.daySameOrBefore(day2) ? new TuiDayRange(day1, day2) : new TuiDayRange(day2, day1);
- }
- /**
- * Parse and correct a day range in string format
- *
- * @param rangeString a string of dates in a format dd.mm.yyyy - dd.mm.yyyy
- * @param dateMode {@link TuiDateMode}
- * @return normalized day range object
- */
- static normalizeParse(rangeString, dateMode = 'DMY') {
- const leftDay = TuiDay.normalizeParse(rangeString.slice(0, DATE_FILLER_LENGTH), dateMode);
- if (rangeString.length < DATE_RANGE_FILLER_LENGTH) {
- return new TuiDayRange(leftDay, leftDay);
+function interpolateParams(value, params, errors) {
+ const original = value.toString();
+ const str = original.replace(PARAM_REGEX, (_, varName) => {
+ let localVal = params[varName];
+ // this means that the value was never overridden by the data passed in by the user
+ if (localVal == null) {
+ errors.push(invalidParamValue(varName));
+ localVal = '';
}
- return TuiDayRange.sort(leftDay, TuiDay.normalizeParse(rangeString.slice(DATE_FILLER_LENGTH + RANGE_SEPARATOR_CHAR.length), dateMode));
- }
- get isSingleDay() {
- return this.from.daySame(this.to);
- }
- /**
- * Tests ranges for identity
- *
- * @param another second range to test against current
- * @return `true` if days are identical
- */
- daySame(another) {
- return this.from.daySame(another.from) && this.to.daySame(another.to);
- }
- /**
- * Locks range between two days included, or limits from one side if the other is null
- *
- * @param min
- * @param max
- * @return range — clamped range
- */
- dayLimit(min, max) {
- return new TuiDayRange(this.from.dayLimit(min, max), this.to.dayLimit(min, max));
- }
- /**
- * Human readable format.
- */
- getFormattedDayRange(dateFormat, dateSeparator) {
- const from = this.from.getFormattedDay(dateFormat, dateSeparator);
- const to = this.to.getFormattedDay(dateFormat, dateSeparator);
- return `${from}${RANGE_SEPARATOR_CHAR}${to}`;
- }
- toString(dateFormat = 'DMY', dateSeparator = '.') {
- return this.getFormattedDayRange(dateFormat, dateSeparator);
- }
+ return localVal.toString();
+ });
+ // we do this to assert that numeric values stay as they are
+ return str == original ? value : str;
}
-const TUI_FIRST_DAY = new TuiDay(MIN_YEAR, MIN_MONTH, MIN_DAY);
-const TUI_LAST_DAY = new TuiDay(MAX_YEAR, MAX_MONTH, 31);
-
-/**
- * Immutable time object with hours, minutes, seconds and ms
- */
-class TuiTime {
- constructor(hours, minutes, seconds = 0, ms = 0) {
- this.hours = hours;
- this.minutes = minutes;
- this.seconds = seconds;
- this.ms = ms;
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(
- // Currently `TuiTime` could have hours more than 23
- // in order to not break current behaviour of `isValidTime` the logic is duplicated
- Number.isInteger(hours) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(hours, 0, Infinity) && Number.isInteger(minutes) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(minutes, 0, MINUTES_IN_HOUR) && Number.isInteger(seconds) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(seconds, 0, SECONDS_IN_MINUTE) && Number.isInteger(ms) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(ms, 0, 1000), 'Time must be real, but got:', hours, minutes, seconds, ms);
- }
- /**
- * Checks if time is valid
- */
- static isValidTime(hours, minutes, seconds = 0, ms = 0) {
- return Number.isInteger(hours) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(hours, 0, HOURS_IN_DAY) && Number.isInteger(minutes) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(minutes, 0, MINUTES_IN_HOUR) && Number.isInteger(seconds) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(seconds, 0, SECONDS_IN_MINUTE) && Number.isInteger(ms) && (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(ms, 0, 1000);
- }
- /**
- * Current UTC time.
- */
- static current() {
- return TuiTime.fromAbsoluteMilliseconds(Date.now() % MILLISECONDS_IN_DAY);
- }
- /**
- * Current time in local timezone
- */
- static currentLocal() {
- const date = new Date();
- return TuiTime.fromAbsoluteMilliseconds((Date.now() - date.getTimezoneOffset() * MILLISECONDS_IN_MINUTE) % MILLISECONDS_IN_DAY);
- }
- /**
- * Calculates TuiTime from milliseconds
- */
- static fromAbsoluteMilliseconds(milliseconds) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(Number.isInteger(milliseconds));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert((0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_3__.tuiInRange)(milliseconds, 0, MILLISECONDS_IN_DAY), `Milliseconds must be below ${MILLISECONDS_IN_DAY} (milliseconds in a day).`);
- const hours = Math.floor(milliseconds / MILLISECONDS_IN_HOUR);
- const minutes = Math.floor(milliseconds % MILLISECONDS_IN_HOUR / MILLISECONDS_IN_MINUTE);
- const seconds = Math.floor(milliseconds % MILLISECONDS_IN_HOUR % MILLISECONDS_IN_MINUTE / 1000) || 0;
- const ms = Math.floor(milliseconds % MILLISECONDS_IN_HOUR % MILLISECONDS_IN_MINUTE % 1000) || 0;
- return new TuiTime(hours, minutes, seconds, ms);
- }
- /**
- * Parses string into TuiTime object
- */
- static fromString(time) {
- const hours = Number(time.slice(0, 2));
- const minutes = Number(time.slice(3, 5));
- const seconds = Number(time.slice(6, 8)) || 0;
- const ms = Number(time.slice(9, 12)) || 0;
- return new TuiTime(hours, minutes, seconds, ms);
- }
- /**
- * Converts Date object into TuiTime
- * @param date
- */
- static fromLocalNativeDate(date) {
- return new TuiTime(date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds());
- }
- /**
- * Shifts time by hours and minutes
- */
- shift({
- hours = 0,
- minutes = 0,
- seconds = 0,
- ms = 0
- }) {
- const newMs = (1000 + this.ms + ms % 1000) % 1000;
- const secondsInMs = ms < 0 ? Math.ceil(ms / 1000) : Math.floor(ms / 1000);
- const secondsToAdd = secondsInMs + seconds;
- const newSeconds = (60 + this.seconds + secondsToAdd % 60) % 60;
- const minutesInSeconds = secondsToAdd < 0 ? Math.ceil(secondsToAdd / 60) : Math.floor(secondsToAdd / 60);
- const minutesToAdd = minutesInSeconds + minutes;
- const newMinutes = (60 + this.minutes + minutesToAdd % 60) % 60;
- const hoursInMinutes = minutesToAdd < 0 ? Math.ceil(minutesToAdd / 60) : Math.floor(minutesToAdd / 60);
- const hoursToAdd = hoursInMinutes + hours;
- const newHours = (24 + this.hours + hoursToAdd % 24) % 24;
- return new TuiTime(newHours, newMinutes, newSeconds, newMs);
- }
- /**
- * Converts TuiTime to string
- */
- toString(mode) {
- const needAddMs = mode === 'HH:MM:SS.MSS' || !mode && this.ms > 0;
- const needAddSeconds = needAddMs || mode === 'HH:MM:SS' || !mode && this.seconds > 0;
- return `${this.formatTime(this.hours)}:${this.formatTime(this.minutes)}` + `${needAddSeconds ? `:${this.formatTime(this.seconds)}` : ''}` + `${needAddMs ? `.${this.formatTime(this.ms, 3)}` : ''}`;
- }
- valueOf() {
- return this.toAbsoluteMilliseconds();
- }
- /**
- * Returns the primitive value of the given Date object.
- * Depending on the argument, the method can return either a string or a number.
- * @see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/@@toPrimitive
- */
- [Symbol.toPrimitive](hint) {
- return Date.prototype[Symbol.toPrimitive].call(this, hint);
- }
- /**
- * Converts TuiTime to milliseconds
- */
- toAbsoluteMilliseconds() {
- return this.hours * MILLISECONDS_IN_HOUR + this.minutes * MILLISECONDS_IN_MINUTE + this.seconds * 1000 + this.ms;
- }
- formatTime(time, digits = 2) {
- return String(time).padStart(digits, '0');
+function iteratorToArray(iterator) {
+ const arr = [];
+ let item = iterator.next();
+ while (!item.done) {
+ arr.push(item.value);
+ item = iterator.next();
}
+ return arr;
}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 2515:
-/*!************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-decorators.js ***!
- \************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiDebounce: () => (/* binding */ tuiDebounce),
-/* harmony export */ tuiDefaultProp: () => (/* binding */ tuiDefaultProp),
-/* harmony export */ tuiPure: () => (/* binding */ tuiPure),
-/* harmony export */ tuiRequiredSetter: () => (/* binding */ tuiRequiredSetter)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/classes */ 7589);
-/* harmony import */ var _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/exceptions */ 3447);
-
-
-
-/**
- * @deprecated:
- * not compatible with TypeScript 5
- */
-function tuiDebounce(timeout) {
- let timeoutRef;
- return function (_target, _key, descriptor) {
- const {
- value
- } = descriptor;
- descriptor.value = function (...args) {
- clearTimeout(timeoutRef);
- timeoutRef = setTimeout(() => value.apply(this, args), timeout);
- };
- return descriptor;
- };
-}
-function errorGetDefault(key, component) {
- return `Default value for ${String(key)} was not provided in ${component}, error in Taiga UI Angular Kit`;
+const DASH_CASE_REGEXP = /-+([a-z0-9])/g;
+function dashCaseToCamelCase(input) {
+ return input.replace(DASH_CASE_REGEXP, (...m) => m[1].toUpperCase());
}
-function errorSetDefault(key, component) {
- return `Undefined was passed as ${String(key)} to ${component}, which is invalid input, using default value:`;
+function camelCaseToDashCase(input) {
+ return input.replace(/([a-z])([A-Z])/g, '$1-$2').toLowerCase();
}
-function errorSetDefaultInitial(key, component) {
- return `Undefined was passed as default value for ${String(key)} to ${component}, error in Taiga UI Angular Kit`;
+function allowPreviousPlayerStylesMerge(duration, delay) {
+ return duration === 0 || delay === 0;
}
-/**
- * @deprecated:
- * not compatible with TypeScript 5
- *
- * Decorator for checking input values for undefined. You can also pass
- * optional assertion to check input against.
- *
- * CAUTION: This decorator overwrites other getters and setters.
- */
-function tuiDefaultProp(assertion, ...args) {
- return (target, key) => {
- const {
- name
- } = target.constructor;
- const errorGetDefaultMessage = ngDevMode && errorGetDefault(key, name);
- const errorSetDefaultMessage = ngDevMode && errorSetDefault(key, name);
- Object.defineProperty(target, key, {
- configurable: true,
- get() {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(false, errorGetDefaultMessage);
- return undefined;
- },
- set(initialValue) {
- const isValid = initialValue !== undefined;
- const errorMessage = ngDevMode && errorSetDefaultInitial(key, name);
- let currentValue = initialValue;
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(isValid, errorMessage);
- if (ngDevMode && isValid && assertion && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert) {
- _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(assertion.call(this, initialValue), `${String(key)} in ${name} received:`, initialValue, ...args);
- }
- Object.defineProperty(this, key, {
- configurable: true,
- get() {
- return currentValue;
- },
- set(value) {
- const isValid = value !== undefined;
- const backupValue = initialValue;
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(isValid, errorSetDefaultMessage, String(backupValue));
- if (ngDevMode && isValid && assertion && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert) {
- _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(assertion.call(this, value), `${String(key)} in ${name} received:`, value, ...args);
- }
- currentValue = isValid ? value : backupValue;
- }
- });
+function balancePreviousStylesIntoKeyframes(element, keyframes, previousStyles) {
+ if (previousStyles.size && keyframes.length) {
+ let startingKeyframe = keyframes[0];
+ let missingStyleProps = [];
+ previousStyles.forEach((val, prop) => {
+ if (!startingKeyframe.has(prop)) {
+ missingStyleProps.push(prop);
}
+ startingKeyframe.set(prop, val);
});
- };
-}
-function decorateMethod(originalMethod) {
- let previousArgs = [];
- let originalFnWasCalledLeastAtOnce = false;
- let pureValue;
- return function tuiPureMethodPatched(...args) {
- const isPure = originalFnWasCalledLeastAtOnce && previousArgs.length === args.length && args.every((arg, index) => arg === previousArgs[index]);
- if (isPure) {
- return pureValue;
- }
- previousArgs = args;
- pureValue = originalMethod.apply(this, args);
- originalFnWasCalledLeastAtOnce = true;
- return pureValue;
- };
-}
-function decorateGetter(originalGetter, propertyKey, enumerable = true) {
- return function tuiPureGetterPatched() {
- const value = originalGetter.call(this);
- Object.defineProperty(this, propertyKey, {
- enumerable,
- value
- });
- return value;
- };
-}
-function tuiPure(target, propertyKeyOrContext, descriptor) {
- if (typeof target === 'function') {
- const context = propertyKeyOrContext;
- if (context.kind === 'getter') {
- return decorateGetter(target, context.name);
- }
- if (context.kind === 'method') {
- return decorateMethod(target);
+ if (missingStyleProps.length) {
+ for (let i = 1; i < keyframes.length; i++) {
+ let kf = keyframes[i];
+ missingStyleProps.forEach(prop => kf.set(prop, computeStyle(element, prop)));
+ }
}
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_1__.TuiPureException();
- }
- const {
- get,
- enumerable,
- value
- } = descriptor;
- const propertyKey = propertyKeyOrContext;
- if (get) {
- return {
- configurable: true,
- enumerable,
- get: decorateGetter(get, propertyKey, enumerable)
- };
}
- if (typeof value !== 'function') {
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_1__.TuiPureException();
+ return keyframes;
+}
+function visitDslNode(visitor, node, context) {
+ switch (node.type) {
+ case 7 /* AnimationMetadataType.Trigger */:
+ return visitor.visitTrigger(node, context);
+ case 0 /* AnimationMetadataType.State */:
+ return visitor.visitState(node, context);
+ case 1 /* AnimationMetadataType.Transition */:
+ return visitor.visitTransition(node, context);
+ case 2 /* AnimationMetadataType.Sequence */:
+ return visitor.visitSequence(node, context);
+ case 3 /* AnimationMetadataType.Group */:
+ return visitor.visitGroup(node, context);
+ case 4 /* AnimationMetadataType.Animate */:
+ return visitor.visitAnimate(node, context);
+ case 5 /* AnimationMetadataType.Keyframes */:
+ return visitor.visitKeyframes(node, context);
+ case 6 /* AnimationMetadataType.Style */:
+ return visitor.visitStyle(node, context);
+ case 8 /* AnimationMetadataType.Reference */:
+ return visitor.visitReference(node, context);
+ case 9 /* AnimationMetadataType.AnimateChild */:
+ return visitor.visitAnimateChild(node, context);
+ case 10 /* AnimationMetadataType.AnimateRef */:
+ return visitor.visitAnimateRef(node, context);
+ case 11 /* AnimationMetadataType.Query */:
+ return visitor.visitQuery(node, context);
+ case 12 /* AnimationMetadataType.Stagger */:
+ return visitor.visitStagger(node, context);
+ default:
+ throw invalidNodeType(node.type);
}
- const original = value;
- return {
- configurable: true,
- enumerable,
- get() {
- let previousArgs = [];
- let originalFnWasCalledLeastAtOnce = false;
- let pureValue;
- const patched = (...args) => {
- const isPure = originalFnWasCalledLeastAtOnce && previousArgs.length === args.length && args.every((arg, index) => arg === previousArgs[index]);
- if (isPure) {
- return pureValue;
- }
- previousArgs = args;
- pureValue = original.apply(this, args);
- originalFnWasCalledLeastAtOnce = true;
- return pureValue;
- };
- Object.defineProperty(this, propertyKey, {
- configurable: true,
- value: patched
- });
- return patched;
- }
- };
}
-function errorSet(key, component) {
- return `Undefined was passed as ${String(key)} to ${component}, setter will not be called`;
+function computeStyle(element, prop) {
+ return window.getComputedStyle(element)[prop];
}
-/**
- * @deprecated:
- * not compatible with TypeScript 5
- *
- * Decorator for checking input setter values against a custom assertion which
- * takes value passed to input setter and component instance as arguments.
- * It specifically checks for undefined values and prevents calls to the
- * original setter in this case.
- */
-function tuiRequiredSetter(assertion, ...args) {
- return (target, key, {
- configurable,
- enumerable,
- get,
- set
- }) => {
- const {
- name
- } = target.constructor;
- return {
- configurable,
- enumerable,
- get,
- set(value) {
- if (ngDevMode && value !== undefined && assertion && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert) {
- _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(assertion.call(this, value), `${String(key)} in ${name} received:`, value, ...args);
- }
- if (!set || value === undefined) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(value !== undefined, errorSet(key, name));
- return;
- }
- set.call(this, value);
- }
- };
- };
+function createListOfWarnings(warnings) {
+ const LINE_START = '\n - ';
+ return `${LINE_START}${warnings.filter(Boolean).map(warning => warning).join(LINE_START)}`;
}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 625:
-/*!************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-active-zone.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiActiveZoneDirective: () => (/* binding */ TuiActiveZoneDirective),
-/* harmony export */ TuiActiveZoneModule: () => (/* binding */ TuiActiveZoneModule)
-/* harmony export */ });
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_decorators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/cdk/decorators */ 2515);
-/* harmony import */ var _taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk/observables */ 2143);
-/* harmony import */ var _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk/tokens */ 1355);
-/* harmony import */ var _taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 6049);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 9473);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ 4517);
-
-
-
-
-
-
-
-
-
-class TuiActiveZoneDirective {
- constructor(active$, zone, el, directParentActiveZone) {
- var _a;
- this.active$ = active$;
- this.zone = zone;
- this.el = el;
- this.directParentActiveZone = directParentActiveZone;
- this.subActiveZones = [];
- this.tuiActiveZoneParent = null;
- this.tuiActiveZoneChange = this.active$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_0__.map)(element => !!element && this.contains(element)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.startWith)(false), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.distinctUntilChanged)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.skip)(1), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_4__.tuiZoneOptimized)(this.zone));
- (_a = this.directParentActiveZone) === null || _a === void 0 ? void 0 : _a.addSubActiveZone(this);
- }
- set tuiActiveZoneParentSetter(zone) {
- this.setZone(zone);
+function warnValidation(warnings) {
+ (typeof ngDevMode === 'undefined' || ngDevMode) && console.warn(`animation validation warnings:${createListOfWarnings(warnings)}`);
+}
+function warnTriggerBuild(name, warnings) {
+ (typeof ngDevMode === 'undefined' || ngDevMode) && console.warn(`The animation trigger "${name}" has built with the following warnings:${createListOfWarnings(warnings)}`);
+}
+function warnRegister(warnings) {
+ (typeof ngDevMode === 'undefined' || ngDevMode) && console.warn(`Animation built with the following warnings:${createListOfWarnings(warnings)}`);
+}
+function triggerParsingWarnings(name, warnings) {
+ (typeof ngDevMode === 'undefined' || ngDevMode) && console.warn(`Animation parsing for the ${name} trigger presents the following warnings:${createListOfWarnings(warnings)}`);
+}
+function pushUnrecognizedPropertiesWarning(warnings, props) {
+ if (props.length) {
+ warnings.push(`The following provided properties are not recognized: ${props.join(', ')}`);
}
- ngOnDestroy() {
- var _a, _b;
- (_a = this.directParentActiveZone) === null || _a === void 0 ? void 0 : _a.removeSubActiveZone(this);
- (_b = this.tuiActiveZoneParent) === null || _b === void 0 ? void 0 : _b.removeSubActiveZone(this);
+}
+const ANY_STATE = '*';
+function parseTransitionExpr(transitionValue, errors) {
+ const expressions = [];
+ if (typeof transitionValue == 'string') {
+ transitionValue.split(/\s*,\s*/).forEach(str => parseInnerTransitionStr(str, expressions, errors));
+ } else {
+ expressions.push(transitionValue);
}
- contains(node) {
- return this.el.nativeElement.contains(node) || this.subActiveZones.some((item, index, array) => array.indexOf(item) === index && item.contains(node));
+ return expressions;
+}
+function parseInnerTransitionStr(eventStr, expressions, errors) {
+ if (eventStr[0] == ':') {
+ const result = parseAnimationAlias(eventStr, errors);
+ if (typeof result == 'function') {
+ expressions.push(result);
+ return;
+ }
+ eventStr = result;
}
- setZone(zone) {
- var _a;
- (_a = this.tuiActiveZoneParent) === null || _a === void 0 ? void 0 : _a.removeSubActiveZone(this);
- zone === null || zone === void 0 ? void 0 : zone.addSubActiveZone(this);
- this.tuiActiveZoneParent = zone;
+ const match = eventStr.match(/^(\*|[-\w]+)\s*([=-]>)\s*(\*|[-\w]+)$/);
+ if (match == null || match.length < 4) {
+ errors.push(invalidExpression(eventStr));
+ return expressions;
}
- addSubActiveZone(activeZone) {
- this.subActiveZones = [...this.subActiveZones, activeZone];
+ const fromState = match[1];
+ const separator = match[2];
+ const toState = match[3];
+ expressions.push(makeLambdaFromStates(fromState, toState));
+ const isFullAnyStateExpr = fromState == ANY_STATE && toState == ANY_STATE;
+ if (separator[0] == '<' && !isFullAnyStateExpr) {
+ expressions.push(makeLambdaFromStates(toState, fromState));
}
- removeSubActiveZone(activeZone) {
- this.subActiveZones = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_5__.tuiArrayRemove)(this.subActiveZones, this.subActiveZones.indexOf(activeZone));
+}
+function parseAnimationAlias(alias, errors) {
+ switch (alias) {
+ case ':enter':
+ return 'void => *';
+ case ':leave':
+ return '* => void';
+ case ':increment':
+ return (fromState, toState) => parseFloat(toState) > parseFloat(fromState);
+ case ':decrement':
+ return (fromState, toState) => parseFloat(toState) < parseFloat(fromState);
+ default:
+ errors.push(invalidTransitionAlias(alias));
+ return '* => *';
}
}
-TuiActiveZoneDirective.ɵfac = function TuiActiveZoneDirective_Factory(t) {
- return new (t || TuiActiveZoneDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_7__.TUI_ACTIVE_ELEMENT), _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_6__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_6__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](TuiActiveZoneDirective, 12));
-};
-TuiActiveZoneDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdefineDirective"]({
- type: TuiActiveZoneDirective,
- selectors: [["", "tuiActiveZone", "", 5, "ng-container"], ["", "tuiActiveZoneChange", "", 5, "ng-container"], ["", "tuiActiveZoneParent", "", 5, "ng-container"]],
- hostBindings: function TuiActiveZoneDirective_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵlistener"]("mousedown.silent", function TuiActiveZoneDirective_mousedown_silent_HostBindingHandler() {
- return 0;
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵresolveDocument"]);
+// DO NOT REFACTOR ... keep the follow set instantiations
+// with the values intact (closure compiler for some reason
+// removes follow-up lines that add the values outside of
+// the constructor...
+const TRUE_BOOLEAN_VALUES = new Set(['true', '1']);
+const FALSE_BOOLEAN_VALUES = new Set(['false', '0']);
+function makeLambdaFromStates(lhs, rhs) {
+ const LHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(lhs) || FALSE_BOOLEAN_VALUES.has(lhs);
+ const RHS_MATCH_BOOLEAN = TRUE_BOOLEAN_VALUES.has(rhs) || FALSE_BOOLEAN_VALUES.has(rhs);
+ return (fromState, toState) => {
+ let lhsMatch = lhs == ANY_STATE || lhs == fromState;
+ let rhsMatch = rhs == ANY_STATE || rhs == toState;
+ if (!lhsMatch && LHS_MATCH_BOOLEAN && typeof fromState === 'boolean') {
+ lhsMatch = fromState ? TRUE_BOOLEAN_VALUES.has(lhs) : FALSE_BOOLEAN_VALUES.has(lhs);
}
- },
- inputs: {
- tuiActiveZoneParentSetter: ["tuiActiveZoneParent", "tuiActiveZoneParentSetter"]
- },
- outputs: {
- tuiActiveZoneChange: "tuiActiveZoneChange"
- },
- exportAs: ["tuiActiveZone"]
-});
-(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__decorate)([_taiga_ui_cdk_decorators__WEBPACK_IMPORTED_MODULE_9__.tuiPure], TuiActiveZoneDirective.prototype, "setZone", null);
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵsetClassMetadata"](TuiActiveZoneDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Directive,
- args: [{
- selector: '[tuiActiveZone]:not(ng-container), [tuiActiveZoneChange]:not(ng-container), [tuiActiveZoneParent]:not(ng-container)',
- exportAs: 'tuiActiveZone',
- host: {
- '(document:mousedown.silent)': '(0)'
- }
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_10__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_7__.TUI_ACTIVE_ELEMENT]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_6__.NgZone]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_6__.ElementRef]
- }]
- }, {
- type: TuiActiveZoneDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.SkipSelf
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Inject,
- args: [TuiActiveZoneDirective]
- }]
- }];
- }, {
- tuiActiveZoneParentSetter: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Input,
- args: ['tuiActiveZoneParent']
- }],
- tuiActiveZoneChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Output
- }],
- setZone: []
- });
-})();
-class TuiActiveZoneModule {}
-TuiActiveZoneModule.ɵfac = function TuiActiveZoneModule_Factory(t) {
- return new (t || TuiActiveZoneModule)();
-};
-TuiActiveZoneModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdefineNgModule"]({
- type: TuiActiveZoneModule
-});
-TuiActiveZoneModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵsetClassMetadata"](TuiActiveZoneModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.NgModule,
- args: [{
- declarations: [TuiActiveZoneDirective],
- exports: [TuiActiveZoneDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
+ if (!rhsMatch && RHS_MATCH_BOOLEAN && typeof toState === 'boolean') {
+ rhsMatch = toState ? TRUE_BOOLEAN_VALUES.has(rhs) : FALSE_BOOLEAN_VALUES.has(rhs);
+ }
+ return lhsMatch && rhsMatch;
+ };
+}
+const SELF_TOKEN = ':self';
+const SELF_TOKEN_REGEX = new RegExp(`s*${SELF_TOKEN}s*,?`, 'g');
+/*
+ * [Validation]
+ * The visitor code below will traverse the animation AST generated by the animation verb functions
+ * (the output is a tree of objects) and attempt to perform a series of validations on the data. The
+ * following corner-cases will be validated:
+ *
+ * 1. Overlap of animations
+ * Given that a CSS property cannot be animated in more than one place at the same time, it's
+ * important that this behavior is detected and validated. The way in which this occurs is that
+ * each time a style property is examined, a string-map containing the property will be updated with
+ * the start and end times for when the property is used within an animation step.
+ *
+ * If there are two or more parallel animations that are currently running (these are invoked by the
+ * group()) on the same element then the validator will throw an error. Since the start/end timing
+ * values are collected for each property then if the current animation step is animating the same
+ * property and its timing values fall anywhere into the window of time that the property is
+ * currently being animated within then this is what causes an error.
+ *
+ * 2. Timing values
+ * The validator will validate to see if a timing value of `duration delay easing` or
+ * `durationNumber` is valid or not.
+ *
+ * (note that upon validation the code below will replace the timing data with an object containing
+ * {duration,delay,easing}.
+ *
+ * 3. Offset Validation
+ * Each of the style() calls are allowed to have an offset value when placed inside of keyframes().
+ * Offsets within keyframes() are considered valid when:
+ *
+ * - No offsets are used at all
+ * - Each style() entry contains an offset value
+ * - Each offset is between 0 and 1
+ * - Each offset is greater to or equal than the previous one
+ *
+ * Otherwise an error will be thrown.
*/
-
-
-
-/***/ }),
-
-/***/ 7474:
-/*!***********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-auto-focus.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ AbstractTuiAutofocusHandler: () => (/* binding */ AbstractTuiAutofocusHandler),
-/* harmony export */ TUI_AUTOFOCUS_DEFAULT_OPTIONS: () => (/* binding */ TUI_AUTOFOCUS_DEFAULT_OPTIONS),
-/* harmony export */ TUI_AUTOFOCUS_HANDLER: () => (/* binding */ TUI_AUTOFOCUS_HANDLER),
-/* harmony export */ TUI_AUTOFOCUS_OPTIONS: () => (/* binding */ TUI_AUTOFOCUS_OPTIONS),
-/* harmony export */ TUI_AUTOFOCUS_PROVIDERS: () => (/* binding */ TUI_AUTOFOCUS_PROVIDERS),
-/* harmony export */ TuiAutoFocusDirective: () => (/* binding */ TuiAutoFocusDirective),
-/* harmony export */ TuiAutoFocusModule: () => (/* binding */ TuiAutoFocusModule),
-/* harmony export */ TuiDefaultAutofocusHandler: () => (/* binding */ TuiDefaultAutofocusHandler),
-/* harmony export */ TuiIosAutofocusHandler: () => (/* binding */ TuiIosAutofocusHandler),
-/* harmony export */ TuiSynchronousAutofocusHandler: () => (/* binding */ TuiSynchronousAutofocusHandler),
-/* harmony export */ tuiAutoFocusOptionsProvider: () => (/* binding */ tuiAutoFocusOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_coercion__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @taiga-ui/cdk/coercion */ 6729);
-/* harmony import */ var _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/cdk/services */ 7609);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 2805);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 5219);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 3919);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 5600);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 5117);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/cdk/tokens */ 1355);
-/* harmony import */ var _taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 6049);
-/* harmony import */ var _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk/constants */ 5968);
-/* harmony import */ var _taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 3406);
-
-
-
-
-
-
-
-
-
-
-
-
-
-class AbstractTuiAutofocusHandler {
- constructor(focusable, el) {
- this.focusable = focusable;
- this.el = el;
- }
- get element() {
- var _a;
- return ((_a = this.focusable) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) || this.el.nativeElement;
- }
- get isTextFieldElement() {
- return this.element.matches('input, textarea, [contenteditable]');
- }
+function buildAnimationAst(driver, metadata, errors, warnings) {
+ return new AnimationAstBuilderVisitor(driver).build(metadata, errors, warnings);
}
-AbstractTuiAutofocusHandler.ɵfac = function AbstractTuiAutofocusHandler_Factory(t) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinvalidFactory"]();
-};
-AbstractTuiAutofocusHandler.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: AbstractTuiAutofocusHandler
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AbstractTuiAutofocusHandler, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive
- }], function () {
- return [{
- type: undefined
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef
- }];
- }, null);
-})();
-const TIMEOUT = 1000;
-const NG_ANIMATION_SELECTOR = '.ng-animating';
-class TuiDefaultAutofocusHandler extends AbstractTuiAutofocusHandler {
- constructor(focusable, el, animationFrame$) {
- super(focusable, el);
- this.animationFrame$ = animationFrame$;
+const ROOT_SELECTOR = '';
+class AnimationAstBuilderVisitor {
+ constructor(_driver) {
+ this._driver = _driver;
}
- setFocus() {
- if (this.isTextFieldElement) {
- (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.race)((0,rxjs__WEBPACK_IMPORTED_MODULE_2__.timer)(TIMEOUT), this.animationFrame$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.throttleTime)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_4__.POLLING_TIME), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(() => this.element.closest(NG_ANIMATION_SELECTOR)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.skipWhile)(Boolean), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.take)(1))).subscribe(() => this.element.focus({
- preventScroll: true
- }));
- } else {
- this.element.focus({
- preventScroll: true
- });
+ build(metadata, errors, warnings) {
+ const context = new AnimationAstBuilderContext(errors);
+ this._resetContextStyleTimingState(context);
+ const ast = visitDslNode(this, normalizeAnimationEntry(metadata), context);
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
+ if (context.unsupportedCSSPropertiesFound.size) {
+ pushUnrecognizedPropertiesWarning(warnings, [...context.unsupportedCSSPropertiesFound.keys()]);
+ }
}
+ return ast;
}
-}
-TuiDefaultAutofocusHandler.ɵfac = function TuiDefaultAutofocusHandler_Factory(t) {
- return new (t || TuiDefaultAutofocusHandler)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_FOCUSABLE_ITEM_ACCESSOR, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.ANIMATION_FRAME));
-};
-TuiDefaultAutofocusHandler.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDefaultAutofocusHandler,
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDefaultAutofocusHandler, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_FOCUSABLE_ITEM_ACCESSOR]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_10__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.ANIMATION_FRAME]
- }]
- }];
- }, null);
-})();
-const TEXTFIELD_ATTRS = ['type', 'inputMode', 'autocomplete', 'accept', 'min', 'max', 'step', 'pattern', 'size', 'maxlength'];
-class TuiIosAutofocusHandler extends AbstractTuiAutofocusHandler {
- constructor(focusable, el, renderer, zone, win) {
- super(focusable, el);
- this.renderer = renderer;
- this.zone = zone;
- this.win = win;
- this.patchCssStyles();
+ _resetContextStyleTimingState(context) {
+ context.currentQuerySelector = ROOT_SELECTOR;
+ context.collectedStyles = new Map();
+ context.collectedStyles.set(ROOT_SELECTOR, new Map());
+ context.currentTime = 0;
}
- setFocus() {
- if (this.isTextFieldElement) {
- this.zone.runOutsideAngular(() => this.iosWebkitAutofocus());
- } else {
- this.element.focus({
- preventScroll: true
- });
+ visitTrigger(metadata, context) {
+ let queryCount = context.queryCount = 0;
+ let depCount = context.depCount = 0;
+ const states = [];
+ const transitions = [];
+ if (metadata.name.charAt(0) == '@') {
+ context.errors.push(invalidTrigger());
}
- }
- iosWebkitAutofocus() {
- var _a;
- const fakeInput = this.makeFakeInput();
- const duration = this.getDurationTimeBeforeFocus();
- let fakeFocusTimeoutId = 0;
- let elementFocusTimeoutId = 0;
- const blurHandler = () => fakeInput.focus({
- preventScroll: true
+ metadata.definitions.forEach(def => {
+ this._resetContextStyleTimingState(context);
+ if (def.type == 0 /* AnimationMetadataType.State */) {
+ const stateDef = def;
+ const name = stateDef.name;
+ name.toString().split(/\s*,\s*/).forEach(n => {
+ stateDef.name = n;
+ states.push(this.visitState(stateDef, context));
+ });
+ stateDef.name = name;
+ } else if (def.type == 1 /* AnimationMetadataType.Transition */) {
+ const transition = this.visitTransition(def, context);
+ queryCount += transition.queryCount;
+ depCount += transition.depCount;
+ transitions.push(transition);
+ } else {
+ context.errors.push(invalidDefinition());
+ }
});
- const focusHandler = () => {
- clearTimeout(fakeFocusTimeoutId);
- fakeFocusTimeoutId = this.win.setTimeout(() => {
- clearTimeout(elementFocusTimeoutId);
- fakeInput.removeEventListener('blur', blurHandler);
- fakeInput.removeEventListener('focus', focusHandler);
- elementFocusTimeoutId = this.win.setTimeout(() => {
- this.element.focus({
- preventScroll: false
+ return {
+ type: 7 /* AnimationMetadataType.Trigger */,
+ name: metadata.name,
+ states,
+ transitions,
+ queryCount,
+ depCount,
+ options: null
+ };
+ }
+ visitState(metadata, context) {
+ const styleAst = this.visitStyle(metadata.styles, context);
+ const astParams = metadata.options && metadata.options.params || null;
+ if (styleAst.containsDynamicStyles) {
+ const missingSubs = new Set();
+ const params = astParams || {};
+ styleAst.styles.forEach(style => {
+ if (style instanceof Map) {
+ style.forEach(value => {
+ extractStyleParams(value).forEach(sub => {
+ if (!params.hasOwnProperty(sub)) {
+ missingSubs.add(sub);
+ }
+ });
});
- fakeInput.remove();
- }, duration);
+ }
});
- };
- fakeInput.addEventListener('blur', blurHandler, {
- once: true
- });
- fakeInput.addEventListener('focus', focusHandler);
- if (this.insideDialog()) {
- this.win.document.body.appendChild(fakeInput);
- } else {
- (_a = this.element.parentElement) === null || _a === void 0 ? void 0 : _a.appendChild(fakeInput);
+ if (missingSubs.size) {
+ const missingSubsArr = iteratorToArray(missingSubs.values());
+ context.errors.push(invalidState(metadata.name, missingSubsArr));
+ }
}
- fakeInput.focus({
- preventScroll: true
- });
- }
- /**
- * @note:
- * emulate textfield position in layout with cursor
- * before focus to real textfield element
- *
- * required note:
- * [fakeInput.readOnly = true] ~
- * don't use {readOnly: true} value, it's doesn't work for emulate autofill
- *
- * [fakeInput.style.opacity = 0] ~
- * don't use {opacity: 0}, sometimes it's doesn't work for emulate real input
- *
- * [fakeInput.style.fontSize = 16px] ~
- * disable possible auto zoom
- *
- * [fakeInput.style.top/left] ~
- * emulate position cursor before focus to real textfield element
- */
- makeFakeInput() {
- const fakeInput = this.renderer.createElement('input');
- const rect = this.element.getBoundingClientRect();
- this.patchFakeInputFromFocusableElement(fakeInput);
- fakeInput.style.height = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_11__.tuiPx)(rect.height);
- fakeInput.style.width = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_11__.tuiPx)(rect.width / 2);
- fakeInput.style.position = 'fixed';
- fakeInput.style.zIndex = '-99999999';
- fakeInput.style.caretColor = 'transparent';
- fakeInput.style.border = 'none';
- fakeInput.style.outline = 'none';
- fakeInput.style.color = 'transparent';
- fakeInput.style.background = 'transparent';
- fakeInput.style.cursor = 'none';
- fakeInput.style.fontSize = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_11__.tuiPx)(16);
- fakeInput.style.top = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_11__.tuiPx)(rect.top);
- fakeInput.style.left = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_11__.tuiPx)(rect.left);
- return fakeInput;
+ return {
+ type: 0 /* AnimationMetadataType.State */,
+ name: metadata.name,
+ style: styleAst,
+ options: astParams ? {
+ params: astParams
+ } : null
+ };
}
- getDurationTimeBeforeFocus() {
- return parseFloat(this.win.getComputedStyle(this.element).getPropertyValue('--tui-duration')) || 0;
+ visitTransition(metadata, context) {
+ context.queryCount = 0;
+ context.depCount = 0;
+ const animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);
+ const matchers = parseTransitionExpr(metadata.expr, context.errors);
+ return {
+ type: 1 /* AnimationMetadataType.Transition */,
+ matchers,
+ animation,
+ queryCount: context.queryCount,
+ depCount: context.depCount,
+ options: normalizeAnimationOptions(metadata.options)
+ };
}
- /**
- * @note:
- * unfortunately, in older versions of iOS
- * there is a bug that the fake input cursor
- * will move along with the dialog animation
- * and then that dialog will be shaking
- */
- insideDialog() {
- return !!this.element.closest('tui-dialog');
+ visitSequence(metadata, context) {
+ return {
+ type: 2 /* AnimationMetadataType.Sequence */,
+ steps: metadata.steps.map(s => visitDslNode(this, s, context)),
+ options: normalizeAnimationOptions(metadata.options)
+ };
}
- /**
- * @note:
- * This is necessary so that the viewport isn't recalculated
- * and then the dialogs don't shake.
- *
- * Also, we need to fixed height viewport,
- * so that when focusing the dialogs don't shake
- */
- patchCssStyles() {
- [this.win.document.documentElement, this.win.document.body].forEach(element => {
- element.style.setProperty('overflow', 'auto');
- element.style.setProperty('height', '100%');
+ visitGroup(metadata, context) {
+ const currentTime = context.currentTime;
+ let furthestTime = 0;
+ const steps = metadata.steps.map(step => {
+ context.currentTime = currentTime;
+ const innerAst = visitDslNode(this, step, context);
+ furthestTime = Math.max(furthestTime, context.currentTime);
+ return innerAst;
});
+ context.currentTime = furthestTime;
+ return {
+ type: 3 /* AnimationMetadataType.Group */,
+ steps,
+ options: normalizeAnimationOptions(metadata.options)
+ };
}
- /**
- * @note:
- * inherit basic attributes values from real input
- * for help iOS detect what do you want see on keyboard,
- * for example [inputMode=numeric, autocomplete=cc-number]
- */
- patchFakeInputFromFocusableElement(fakeInput) {
- TEXTFIELD_ATTRS.forEach(attr => {
- const value = this.element.getAttribute(attr);
- if ((0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_12__.tuiIsPresent)(value)) {
- fakeInput.setAttribute(attr, value);
+ visitAnimate(metadata, context) {
+ const timingAst = constructTimingAst(metadata.timings, context.errors);
+ context.currentAnimateTimings = timingAst;
+ let styleAst;
+ let styleMetadata = metadata.styles ? metadata.styles : (0,_angular_animations__WEBPACK_IMPORTED_MODULE_1__.style)({});
+ if (styleMetadata.type == 5 /* AnimationMetadataType.Keyframes */) {
+ styleAst = this.visitKeyframes(styleMetadata, context);
+ } else {
+ let styleMetadata = metadata.styles;
+ let isEmpty = false;
+ if (!styleMetadata) {
+ isEmpty = true;
+ const newStyleData = {};
+ if (timingAst.easing) {
+ newStyleData['easing'] = timingAst.easing;
+ }
+ styleMetadata = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_1__.style)(newStyleData);
}
- });
+ context.currentTime += timingAst.duration + timingAst.delay;
+ const _styleAst = this.visitStyle(styleMetadata, context);
+ _styleAst.isEmptyStep = isEmpty;
+ styleAst = _styleAst;
+ }
+ context.currentAnimateTimings = null;
+ return {
+ type: 4 /* AnimationMetadataType.Animate */,
+ timings: timingAst,
+ style: styleAst,
+ options: null
+ };
}
-}
-TuiIosAutofocusHandler.ɵfac = function TuiIosAutofocusHandler_Factory(t) {
- return new (t || TuiIosAutofocusHandler)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_FOCUSABLE_ITEM_ACCESSOR, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.WINDOW));
-};
-TuiIosAutofocusHandler.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiIosAutofocusHandler,
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiIosAutofocusHandler, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_FOCUSABLE_ITEM_ACCESSOR]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone]
- }]
- }, {
- type: Window,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.WINDOW]
- }]
- }];
- }, null);
-})();
-const TUI_AUTOFOCUS_DEFAULT_OPTIONS = {
- delay: NaN // NaN = no delay/sync
-};
-const TUI_AUTOFOCUS_OPTIONS = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_12__.tuiCreateToken)(TUI_AUTOFOCUS_DEFAULT_OPTIONS);
-function tuiAutoFocusOptionsProvider(options) {
- return (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_12__.tuiProvideOptions)(TUI_AUTOFOCUS_OPTIONS, options, TUI_AUTOFOCUS_DEFAULT_OPTIONS);
-}
-const TUI_AUTOFOCUS_HANDLER = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('[TUI_AUTOFOCUS_HANDLER]');
-const TUI_AUTOFOCUS_PROVIDERS = [{
- provide: TUI_AUTOFOCUS_HANDLER,
- useFactory: (focusable, el, animationFrame$, renderer, zone, win, isIos) => isIos ? new TuiIosAutofocusHandler(focusable, el, renderer, zone, win) : new TuiDefaultAutofocusHandler(focusable, el, animationFrame$),
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self(), _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_FOCUSABLE_ITEM_ACCESSOR], _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef, _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.ANIMATION_FRAME, _angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2, _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone, _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_9__.WINDOW, _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_IS_IOS]
-}, _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_13__.TuiDestroyService];
-class TuiAutoFocusDirective {
- constructor(handler, options, destroy$) {
- this.handler = handler;
- this.options = options;
- this.destroy$ = destroy$;
- this.autoFocus = true;
+ visitStyle(metadata, context) {
+ const ast = this._makeStyleAst(metadata, context);
+ this._validateStyleAst(ast, context);
+ return ast;
}
- ngAfterViewInit() {
- if ((0,_taiga_ui_cdk_coercion__WEBPACK_IMPORTED_MODULE_14__.tuiCoerceBooleanProperty)(this.autoFocus)) {
- this.focus();
+ _makeStyleAst(metadata, context) {
+ const styles = [];
+ const metadataStyles = Array.isArray(metadata.styles) ? metadata.styles : [metadata.styles];
+ for (let styleTuple of metadataStyles) {
+ if (typeof styleTuple === 'string') {
+ if (styleTuple === _angular_animations__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE) {
+ styles.push(styleTuple);
+ } else {
+ context.errors.push(invalidStyleValue(styleTuple));
+ }
+ } else {
+ styles.push(convertToMap(styleTuple));
+ }
}
+ let containsDynamicStyles = false;
+ let collectedEasing = null;
+ styles.forEach(styleData => {
+ if (styleData instanceof Map) {
+ if (styleData.has('easing')) {
+ collectedEasing = styleData.get('easing');
+ styleData.delete('easing');
+ }
+ if (!containsDynamicStyles) {
+ for (let value of styleData.values()) {
+ if (value.toString().indexOf(SUBSTITUTION_EXPR_START) >= 0) {
+ containsDynamicStyles = true;
+ break;
+ }
+ }
+ }
+ }
+ });
+ return {
+ type: 6 /* AnimationMetadataType.Style */,
+ styles,
+ easing: collectedEasing,
+ offset: metadata.offset,
+ containsDynamicStyles,
+ options: null
+ };
}
- focus() {
- if (Number.isNaN(this.options.delay)) {
- void Promise.resolve().then(() => this.handler.setFocus());
- } else {
- (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.timer)(this.options.delay).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.takeUntil)(this.destroy$)).subscribe(() => this.handler.setFocus());
+ _validateStyleAst(ast, context) {
+ const timings = context.currentAnimateTimings;
+ let endTime = context.currentTime;
+ let startTime = context.currentTime;
+ if (timings && startTime > 0) {
+ startTime -= timings.duration + timings.delay;
}
- }
-}
-TuiAutoFocusDirective.ɵfac = function TuiAutoFocusDirective_Factory(t) {
- return new (t || TuiAutoFocusDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_AUTOFOCUS_HANDLER), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_AUTOFOCUS_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_13__.TuiDestroyService, 2));
-};
-TuiAutoFocusDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiAutoFocusDirective,
- selectors: [["", "tuiAutoFocus", ""]],
- inputs: {
- autoFocus: ["tuiAutoFocus", "autoFocus"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"](TUI_AUTOFOCUS_PROVIDERS)]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAutoFocusDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiAutoFocus]',
- providers: TUI_AUTOFOCUS_PROVIDERS
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_AUTOFOCUS_HANDLER]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_AUTOFOCUS_OPTIONS]
- }]
- }, {
- type: _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_13__.TuiDestroyService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_13__.TuiDestroyService]
- }]
- }];
- }, {
- autoFocus: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiAutoFocus']
- }]
- });
-})();
-class TuiAutoFocusModule {}
-TuiAutoFocusModule.ɵfac = function TuiAutoFocusModule_Factory(t) {
- return new (t || TuiAutoFocusModule)();
-};
-TuiAutoFocusModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiAutoFocusModule
-});
-TuiAutoFocusModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAutoFocusModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiAutoFocusDirective],
- exports: [TuiAutoFocusDirective]
- }]
- }], null, null);
-})();
-class TuiSynchronousAutofocusHandler extends AbstractTuiAutofocusHandler {
- constructor(focusable, el) {
- super(focusable, el);
- }
- setFocus() {
- this.element.focus({
- preventScroll: true
+ ast.styles.forEach(tuple => {
+ if (typeof tuple === 'string') return;
+ tuple.forEach((value, prop) => {
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
+ if (!this._driver.validateStyleProperty(prop)) {
+ tuple.delete(prop);
+ context.unsupportedCSSPropertiesFound.add(prop);
+ return;
+ }
+ }
+ // This is guaranteed to have a defined Map at this querySelector location making it
+ // safe to add the assertion here. It is set as a default empty map in prior methods.
+ const collectedStyles = context.collectedStyles.get(context.currentQuerySelector);
+ const collectedEntry = collectedStyles.get(prop);
+ let updateCollectedStyle = true;
+ if (collectedEntry) {
+ if (startTime != endTime && startTime >= collectedEntry.startTime && endTime <= collectedEntry.endTime) {
+ context.errors.push(invalidParallelAnimation(prop, collectedEntry.startTime, collectedEntry.endTime, startTime, endTime));
+ updateCollectedStyle = false;
+ }
+ // we always choose the smaller start time value since we
+ // want to have a record of the entire animation window where
+ // the style property is being animated in between
+ startTime = collectedEntry.startTime;
+ }
+ if (updateCollectedStyle) {
+ collectedStyles.set(prop, {
+ startTime,
+ endTime
+ });
+ }
+ if (context.options) {
+ validateStyleParams(value, context.options, context.errors);
+ }
+ });
});
}
-}
-TuiSynchronousAutofocusHandler.ɵfac = function TuiSynchronousAutofocusHandler_Factory(t) {
- return new (t || TuiSynchronousAutofocusHandler)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_FOCUSABLE_ITEM_ACCESSOR, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef));
-};
-TuiSynchronousAutofocusHandler.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiSynchronousAutofocusHandler,
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiSynchronousAutofocusHandler, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_FOCUSABLE_ITEM_ACCESSOR]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }];
- }, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 9311:
-/*!***********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-autofilled.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiAutofilledDirective: () => (/* binding */ TuiAutofilledDirective),
-/* harmony export */ TuiAutofilledModule: () => (/* binding */ TuiAutofilledModule),
-/* harmony export */ TuiAutofilledStyleComponent: () => (/* binding */ TuiAutofilledStyleComponent)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/services */ 7609);
-
-
-
-
-class TuiAutofilledStyleComponent {}
-TuiAutofilledStyleComponent.ɵfac = function TuiAutofilledStyleComponent_Factory(t) {
- return new (t || TuiAutofilledStyleComponent)();
-};
-TuiAutofilledStyleComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiAutofilledStyleComponent,
- selectors: [["ng-component"]],
- hostAttrs: [1, "tui-autofilled-styles"],
- decls: 0,
- vars: 0,
- template: function TuiAutofilledStyleComponent_Template(rf, ctx) {},
- styles: [".tui-autofill input,input.tui-autofill{transition:box-shadow .01s}\n"],
- encapsulation: 2,
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAutofilledStyleComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- host: {
- class: 'tui-autofilled-styles'
- },
- template: '',
- styleUrls: ['./autofilled.style.less'],
- encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewEncapsulation.None,
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush
- }]
- }], null, null);
-})();
-class TuiAutofilledDirective {
- constructor(directiveStyles) {
- this.autofilled = false;
- this.tuiAutofilledChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
- directiveStyles.addComponent(TuiAutofilledStyleComponent);
- }
- transitionStartHandler({
- propertyName,
- target
- }) {
- var _a;
- const matchedAutofill = propertyName.includes('box-shadow') && ((_a = target) === null || _a === void 0 ? void 0 : _a.matches('input'));
- if (matchedAutofill) {
- this.autofilled = !this.autofilled;
- this.tuiAutofilledChange.emit(this.autofilled);
+ visitKeyframes(metadata, context) {
+ const ast = {
+ type: 5 /* AnimationMetadataType.Keyframes */,
+ styles: [],
+ options: null
+ };
+ if (!context.currentAnimateTimings) {
+ context.errors.push(invalidKeyframes());
+ return ast;
}
- }
-}
-TuiAutofilledDirective.ɵfac = function TuiAutofilledDirective_Factory(t) {
- return new (t || TuiAutofilledDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__.TuiDirectiveStylesService));
-};
-TuiAutofilledDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiAutofilledDirective,
- selectors: [["", "tuiAutofilledChange", ""]],
- hostAttrs: [1, "tui-autofill"],
- hostVars: 2,
- hostBindings: function TuiAutofilledDirective_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("transitionstart", function TuiAutofilledDirective_transitionstart_HostBindingHandler($event) {
- return ctx.transitionStartHandler($event);
- });
+ const MAX_KEYFRAME_OFFSET = 1;
+ let totalKeyframesWithOffsets = 0;
+ const offsets = [];
+ let offsetsOutOfOrder = false;
+ let keyframesOutOfRange = false;
+ let previousOffset = 0;
+ const keyframes = metadata.steps.map(styles => {
+ const style = this._makeStyleAst(styles, context);
+ let offsetVal = style.offset != null ? style.offset : consumeOffset(style.styles);
+ let offset = 0;
+ if (offsetVal != null) {
+ totalKeyframesWithOffsets++;
+ offset = style.offset = offsetVal;
+ }
+ keyframesOutOfRange = keyframesOutOfRange || offset < 0 || offset > 1;
+ offsetsOutOfOrder = offsetsOutOfOrder || offset < previousOffset;
+ previousOffset = offset;
+ offsets.push(offset);
+ return style;
+ });
+ if (keyframesOutOfRange) {
+ context.errors.push(invalidOffset());
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_autofilled", ctx.autofilled);
+ if (offsetsOutOfOrder) {
+ context.errors.push(keyframeOffsetsOutOfOrder());
}
- },
- outputs: {
- tuiAutofilledChange: "tuiAutofilledChange"
- }
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAutofilledDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiAutofilledChange]',
- host: {
- class: 'tui-autofill'
- }
- }]
- }], function () {
- return [{
- type: _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__.TuiDirectiveStylesService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__.TuiDirectiveStylesService]
- }]
- }];
- }, {
- autofilled: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._autofilled']
- }],
- tuiAutofilledChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output
- }],
- transitionStartHandler: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['transitionstart', ['$event']]
- }]
- });
-})();
-class TuiAutofilledModule {}
-TuiAutofilledModule.ɵfac = function TuiAutofilledModule_Factory(t) {
- return new (t || TuiAutofilledModule)();
-};
-TuiAutofilledModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiAutofilledModule
-});
-TuiAutofilledModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAutofilledModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiAutofilledDirective, TuiAutofilledStyleComponent],
- exports: [TuiAutofilledDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 5235:
-/*!********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-checked.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiCheckedDirective: () => (/* binding */ TuiCheckedDirective),
-/* harmony export */ TuiCheckedModule: () => (/* binding */ TuiCheckedModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-
-
-class TuiCheckedDirective {
- constructor() {
- this.indeterminate = false;
- this.checked = false;
- this.tuiCheckedChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
+ const length = metadata.steps.length;
+ let generatedOffset = 0;
+ if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) {
+ context.errors.push(keyframesMissingOffsets());
+ } else if (totalKeyframesWithOffsets == 0) {
+ generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1);
+ }
+ const limit = length - 1;
+ const currentTime = context.currentTime;
+ const currentAnimateTimings = context.currentAnimateTimings;
+ const animateDuration = currentAnimateTimings.duration;
+ keyframes.forEach((kf, i) => {
+ const offset = generatedOffset > 0 ? i == limit ? 1 : generatedOffset * i : offsets[i];
+ const durationUpToThisFrame = offset * animateDuration;
+ context.currentTime = currentTime + currentAnimateTimings.delay + durationUpToThisFrame;
+ currentAnimateTimings.duration = durationUpToThisFrame;
+ this._validateStyleAst(kf, context);
+ kf.offset = offset;
+ ast.styles.push(kf);
+ });
+ return ast;
}
- get isChecked() {
- return this.checked;
+ visitReference(metadata, context) {
+ return {
+ type: 8 /* AnimationMetadataType.Reference */,
+ animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),
+ options: normalizeAnimationOptions(metadata.options)
+ };
}
- get isIndeterminate() {
- return this.indeterminate;
+ visitAnimateChild(metadata, context) {
+ context.depCount++;
+ return {
+ type: 9 /* AnimationMetadataType.AnimateChild */,
+ options: normalizeAnimationOptions(metadata.options)
+ };
}
- set tuiChecked(checked) {
- this.checked = checked || false;
- this.indeterminate = checked === null;
+ visitAnimateRef(metadata, context) {
+ return {
+ type: 10 /* AnimationMetadataType.AnimateRef */,
+ animation: this.visitReference(metadata.animation, context),
+ options: normalizeAnimationOptions(metadata.options)
+ };
}
- onChange({
- checked
- }) {
- this.checked = checked;
- this.indeterminate = false;
- this.tuiCheckedChange.emit(checked);
+ visitQuery(metadata, context) {
+ const parentSelector = context.currentQuerySelector;
+ const options = metadata.options || {};
+ context.queryCount++;
+ context.currentQuery = metadata;
+ const [selector, includeSelf] = normalizeSelector(metadata.selector);
+ context.currentQuerySelector = parentSelector.length ? parentSelector + ' ' + selector : selector;
+ getOrSetDefaultValue(context.collectedStyles, context.currentQuerySelector, new Map());
+ const animation = visitDslNode(this, normalizeAnimationEntry(metadata.animation), context);
+ context.currentQuery = null;
+ context.currentQuerySelector = parentSelector;
+ return {
+ type: 11 /* AnimationMetadataType.Query */,
+ selector,
+ limit: options.limit || 0,
+ optional: !!options.optional,
+ includeSelf,
+ animation,
+ originalSelector: metadata.selector,
+ options: normalizeAnimationOptions(metadata.options)
+ };
}
-}
-TuiCheckedDirective.ɵfac = function TuiCheckedDirective_Factory(t) {
- return new (t || TuiCheckedDirective)();
-};
-TuiCheckedDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiCheckedDirective,
- selectors: [["input", "tuiChecked", ""], ["input", "tuiCheckedChange", ""]],
- hostVars: 2,
- hostBindings: function TuiCheckedDirective_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("change", function TuiCheckedDirective_change_HostBindingHandler($event) {
- return ctx.onChange($event.target);
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵhostProperty"]("checked", ctx.isChecked)("indeterminate", ctx.isIndeterminate);
+ visitStagger(metadata, context) {
+ if (!context.currentQuery) {
+ context.errors.push(invalidStagger());
}
- },
- inputs: {
- tuiChecked: "tuiChecked"
- },
- outputs: {
- tuiCheckedChange: "tuiCheckedChange"
- }
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiCheckedDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: 'input[tuiChecked], input[tuiCheckedChange]'
- }]
- }], null, {
- isChecked: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['checked']
- }],
- isIndeterminate: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['indeterminate']
- }],
- tuiChecked: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- tuiCheckedChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output
- }],
- onChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['change', ['$event.target']]
- }]
- });
-})();
-class TuiCheckedModule {}
-TuiCheckedModule.ɵfac = function TuiCheckedModule_Factory(t) {
- return new (t || TuiCheckedModule)();
-};
-TuiCheckedModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiCheckedModule
-});
-TuiCheckedModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiCheckedModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiCheckedDirective],
- exports: [TuiCheckedDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 5558:
-/*!********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-element.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiElementDirective: () => (/* binding */ TuiElementDirective),
-/* harmony export */ TuiElementModule: () => (/* binding */ TuiElementModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-
-
-class TuiElementDirective {
- constructor({
- nativeElement
- }) {
- /**
- * @note:
- * Typically, when your constructor is invoked with new,
- * an object is created, its constructor is assigned to
- * the invoked constructor and the object is then assigned
- * to this before executing any operations specified
- * in your constructor method.
- *
- * ERROR TypeError: Class constructor ElementRef cannot be invoked without 'new'
- * https://github.com/taiga-family/taiga-ui/issues/3072
- *
- * This way we can instantiate object creation
- * without additional prototype chain for possible fix bug.
- */
- return new _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef(nativeElement);
+ const timings = metadata.timings === 'full' ? {
+ duration: 0,
+ delay: 0,
+ easing: 'full'
+ } : resolveTiming(metadata.timings, context.errors, true);
+ return {
+ type: 12 /* AnimationMetadataType.Stagger */,
+ animation: visitDslNode(this, normalizeAnimationEntry(metadata.animation), context),
+ timings,
+ options: null
+ };
}
}
-TuiElementDirective.ɵfac = function TuiElementDirective_Factory(t) {
- return new (t || TuiElementDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef));
-};
-TuiElementDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiElementDirective,
- selectors: [["", "tuiElement", ""]],
- exportAs: ["elementRef"]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiElementDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiElement]',
- exportAs: 'elementRef'
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }];
- }, null);
-})();
-class TuiElementModule {}
-TuiElementModule.ɵfac = function TuiElementModule_Factory(t) {
- return new (t || TuiElementModule)();
-};
-TuiElementModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiElementModule
-});
-TuiElementModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiElementModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiElementDirective],
- exports: [TuiElementDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 7848:
-/*!***********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-focus-trap.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiFocusTrapDirective: () => (/* binding */ TuiFocusTrapDirective),
-/* harmony export */ TuiFocusTrapModule: () => (/* binding */ TuiFocusTrapModule)
-/* harmony export */ });
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/utils/dom */ 4333);
-/* harmony import */ var _taiga_ui_cdk_utils_focus__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/utils/focus */ 3573);
-
-
-
-
-
-class TuiFocusTrapDirective {
- constructor(doc, el, renderer) {
- this.doc = doc;
- this.el = el;
- this.renderer = renderer;
- this.activeElement = (0,_taiga_ui_cdk_utils_focus__WEBPACK_IMPORTED_MODULE_0__.tuiGetNativeFocused)(this.doc);
- /**
- * This would cause currently focused element to lose focus,
- * but it might cause ExpressionChanged error due to potential HostBinding.
- * Microtask keeps it in the same frame but allows change detection to run
- */
- void Promise.resolve().then(() => this.el.nativeElement.focus());
- }
- onBlur() {
- this.renderer.removeAttribute(this.el.nativeElement, 'tabIndex');
+function normalizeSelector(selector) {
+ const hasAmpersand = selector.split(/\s*,\s*/).find(token => token == SELF_TOKEN) ? true : false;
+ if (hasAmpersand) {
+ selector = selector.replace(SELF_TOKEN_REGEX, '');
}
- onFocusIn(node) {
- const {
- nativeElement
- } = this.el;
- if ((0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_1__.tuiContainsOrAfter)(nativeElement, node)) {
- return;
- }
- const focusable = (0,_taiga_ui_cdk_utils_focus__WEBPACK_IMPORTED_MODULE_0__.tuiGetClosestFocusable)({
- initial: nativeElement,
- root: nativeElement
- });
- if (focusable) {
- focusable.focus();
- }
+ // Note: the :enter and :leave aren't normalized here since those
+ // selectors are filled in at runtime during timeline building
+ selector = selector.replace(/@\*/g, NG_TRIGGER_SELECTOR).replace(/@\w+/g, match => NG_TRIGGER_SELECTOR + '-' + match.slice(1)).replace(/:animating/g, NG_ANIMATING_SELECTOR);
+ return [selector, hasAmpersand];
+}
+function normalizeParams(obj) {
+ return obj ? copyObj(obj) : null;
+}
+class AnimationAstBuilderContext {
+ constructor(errors) {
+ this.errors = errors;
+ this.queryCount = 0;
+ this.depCount = 0;
+ this.currentTransition = null;
+ this.currentQuery = null;
+ this.currentQuerySelector = null;
+ this.currentAnimateTimings = null;
+ this.currentTime = 0;
+ this.collectedStyles = new Map();
+ this.options = null;
+ this.unsupportedCSSPropertiesFound = new Set();
}
- ngOnDestroy() {
- (0,_taiga_ui_cdk_utils_focus__WEBPACK_IMPORTED_MODULE_0__.tuiBlurNativeFocused)(this.doc);
- /**
- * HostListeners are triggered even after ngOnDestroy
- * {@link https://github.com/angular/angular/issues/38100}
- * so we need to delay it but stay in the same sync cycle,
- * therefore using Promise instead of setTimeout
- */
- // eslint-disable-next-line
- Promise.resolve().then(() => {
- if ((0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_1__.tuiIsHTMLElement)(this.activeElement)) {
- this.activeElement.focus();
+}
+function consumeOffset(styles) {
+ if (typeof styles == 'string') return null;
+ let offset = null;
+ if (Array.isArray(styles)) {
+ styles.forEach(styleTuple => {
+ if (styleTuple instanceof Map && styleTuple.has('offset')) {
+ const obj = styleTuple;
+ offset = parseFloat(obj.get('offset'));
+ obj.delete('offset');
}
});
+ } else if (styles instanceof Map && styles.has('offset')) {
+ const obj = styles;
+ offset = parseFloat(obj.get('offset'));
+ obj.delete('offset');
}
+ return offset;
}
-TuiFocusTrapDirective.ɵfac = function TuiFocusTrapDirective_Factory(t) {
- return new (t || TuiFocusTrapDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_3__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.Renderer2));
-};
-TuiFocusTrapDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiFocusTrapDirective,
- selectors: [["", "tuiFocusTrap", ""]],
- hostAttrs: ["tabIndex", "0"],
- hostBindings: function TuiFocusTrapDirective_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("blur", function TuiFocusTrapDirective_blur_HostBindingHandler() {
- return ctx.onBlur();
- })("focusin.silent", function TuiFocusTrapDirective_focusin_silent_HostBindingHandler($event) {
- return ctx.onFocusIn($event.target);
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵresolveWindow"]);
- }
+function constructTimingAst(value, errors) {
+ if (value.hasOwnProperty('duration')) {
+ return value;
}
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiFocusTrapDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
- args: [{
- selector: '[tuiFocusTrap]',
- host: {
- tabIndex: '0'
- }
- }]
- }], function () {
- return [{
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_3__.DOCUMENT]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Renderer2,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.Renderer2]
- }]
- }];
- }, {
- onBlur: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.HostListener,
- args: ['blur']
- }],
- onFocusIn: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.HostListener,
- args: ['window:focusin.silent', ['$event.target']]
- }]
- });
-})();
-class TuiFocusTrapModule {}
-TuiFocusTrapModule.ɵfac = function TuiFocusTrapModule_Factory(t) {
- return new (t || TuiFocusTrapModule)();
-};
-TuiFocusTrapModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({
- type: TuiFocusTrapModule
-});
-TuiFocusTrapModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiFocusTrapModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule,
- args: [{
- declarations: [TuiFocusTrapDirective],
- exports: [TuiFocusTrapDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 6493:
-/*!**************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-focus-visible.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiFocusVisibleDirective: () => (/* binding */ TuiFocusVisibleDirective),
-/* harmony export */ TuiFocusVisibleModule: () => (/* binding */ TuiFocusVisibleModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/services */ 7609);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 4517);
-
-
-
-
-
-/**
- * Directive to imitate :focus-visible
- * (https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible)
- * in browsers that do not support it
- */
-class TuiFocusVisibleDirective {
- constructor(tuiFocusVisibleChange) {
- this.tuiFocusVisibleChange = tuiFocusVisibleChange;
- }
-}
-TuiFocusVisibleDirective.ɵfac = function TuiFocusVisibleDirective_Factory(t) {
- return new (t || TuiFocusVisibleDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__.TuiFocusVisibleService));
-};
-TuiFocusVisibleDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiFocusVisibleDirective,
- selectors: [["", "tuiFocusVisibleChange", ""]],
- outputs: {
- tuiFocusVisibleChange: "tuiFocusVisibleChange"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__.TuiDestroyService, _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__.TuiFocusVisibleService])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiFocusVisibleDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiFocusVisibleChange]',
- outputs: ['tuiFocusVisibleChange'],
- providers: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__.TuiDestroyService, _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__.TuiFocusVisibleService]
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_1__.TuiFocusVisibleService]
- }]
- }];
- }, null);
-})();
-class TuiFocusVisibleModule {}
-TuiFocusVisibleModule.ɵfac = function TuiFocusVisibleModule_Factory(t) {
- return new (t || TuiFocusVisibleModule)();
-};
-TuiFocusVisibleModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiFocusVisibleModule
-});
-TuiFocusVisibleModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiFocusVisibleModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiFocusVisibleDirective],
- exports: [TuiFocusVisibleDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 8502:
-/*!**********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-focusable.js ***!
- \**********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiFocusableDirective: () => (/* binding */ TuiFocusableDirective),
-/* harmony export */ TuiFocusableModule: () => (/* binding */ TuiFocusableModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-
-
-
-/**
- * Abstraction over `tabindex`
- */
-class TuiFocusableDirective {
- constructor() {
- /**
- * Element can be focused with keyboard
- */
- this.focusable = true;
+ if (typeof value == 'number') {
+ const duration = resolveTiming(value, errors).duration;
+ return makeTimingAst(duration, 0, '');
}
- get tabIndex() {
- return this.focusable ? 0 : -1;
+ const strValue = value;
+ const isDynamic = strValue.split(/\s+/).some(v => v.charAt(0) == '{' && v.charAt(1) == '{');
+ if (isDynamic) {
+ const ast = makeTimingAst(0, 0, '');
+ ast.dynamic = true;
+ ast.strValue = strValue;
+ return ast;
}
+ const timings = resolveTiming(strValue, errors);
+ return makeTimingAst(timings.duration, timings.delay, timings.easing);
}
-TuiFocusableDirective.ɵfac = function TuiFocusableDirective_Factory(t) {
- return new (t || TuiFocusableDirective)();
-};
-TuiFocusableDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiFocusableDirective,
- selectors: [["", "tuiFocusable", ""]],
- hostVars: 1,
- hostBindings: function TuiFocusableDirective_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵhostProperty"]("tabIndex", ctx.tabIndex);
+function normalizeAnimationOptions(options) {
+ if (options) {
+ options = copyObj(options);
+ if (options['params']) {
+ options['params'] = normalizeParams(options['params']);
}
- },
- inputs: {
- focusable: ["tuiFocusable", "focusable"]
- }
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiFocusableDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiFocusable]'
- }]
- }], null, {
- focusable: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiFocusable']
- }],
- tabIndex: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['tabIndex']
- }]
- });
-})();
-class TuiFocusableModule {}
-TuiFocusableModule.ɵfac = function TuiFocusableModule_Factory(t) {
- return new (t || TuiFocusableModule)();
-};
-TuiFocusableModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiFocusableModule
-});
-TuiFocusableModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiFocusableModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiFocusableDirective],
- exports: [TuiFocusableDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 7507:
-/*!********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-focused.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiFocusedDirective: () => (/* binding */ TuiFocusedDirective),
-/* harmony export */ TuiFocusedModule: () => (/* binding */ TuiFocusedModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/observables */ 2143);
-/* harmony import */ var _taiga_ui_cdk_utils_focus__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk/utils/focus */ 3573);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 9473);
-
-
-
-
-
-
-
-/**
- * Directive to monitor focus/blur status, works with focusIn/focus-out
- * instead of focus/blur to sync events order with Internet Explorer and
- * other focus related directives that require bubbling
- */
-class TuiFocusedDirective {
- constructor({
- nativeElement
- }, zone) {
- this.tuiFocusedChange = (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.merge)((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiTypedFromEvent)(nativeElement, 'focusin'), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiTypedFromEvent)(nativeElement, 'focusout')).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.map)(() => (0,_taiga_ui_cdk_utils_focus__WEBPACK_IMPORTED_MODULE_3__.tuiIsNativeFocused)(nativeElement)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.startWith)(false), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.distinctUntilChanged)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.skip)(1), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_1__.tuiZoneOptimized)(zone));
+ } else {
+ options = {};
}
+ return options;
}
-TuiFocusedDirective.ɵfac = function TuiFocusedDirective_Factory(t) {
- return new (t || TuiFocusedDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_7__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_7__.NgZone));
-};
-TuiFocusedDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵdefineDirective"]({
- type: TuiFocusedDirective,
- selectors: [["", "tuiFocusedChange", ""]],
- outputs: {
- tuiFocusedChange: "tuiFocusedChange"
- }
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵsetClassMetadata"](TuiFocusedDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_7__.Directive,
- args: [{
- selector: '[tuiFocusedChange]'
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_7__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_7__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_7__.ElementRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_7__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_7__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_7__.NgZone]
- }]
- }];
- }, {
- tuiFocusedChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_7__.Output
- }]
- });
-})();
-class TuiFocusedModule {}
-TuiFocusedModule.ɵfac = function TuiFocusedModule_Factory(t) {
- return new (t || TuiFocusedModule)();
-};
-TuiFocusedModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵdefineNgModule"]({
- type: TuiFocusedModule
-});
-TuiFocusedModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_7__["ɵsetClassMetadata"](TuiFocusedModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_7__.NgModule,
- args: [{
- declarations: [TuiFocusedDirective],
- exports: [TuiFocusedDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 293:
-/*!********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-hovered.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiHoveredDirective: () => (/* binding */ TuiHoveredDirective),
-/* harmony export */ TuiHoveredModule: () => (/* binding */ TuiHoveredModule),
-/* harmony export */ TuiHoveredService: () => (/* binding */ TuiHoveredService)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk/constants */ 5968);
-/* harmony import */ var _taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk/observables */ 2143);
-/* harmony import */ var _taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 4333);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 1856);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 9746);
-
-
-
-
-
-
-
-
-function movedOut({
- currentTarget,
- relatedTarget
-}) {
- return !(0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiIsElement)(relatedTarget) || !(0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiIsElement)(currentTarget) || !currentTarget.contains(relatedTarget);
+function makeTimingAst(duration, delay, easing) {
+ return {
+ duration,
+ delay,
+ easing
+ };
}
-class TuiHoveredService extends rxjs__WEBPACK_IMPORTED_MODULE_1__.Observable {
- constructor(el, zone) {
- super(subscriber => this.stream$.subscribe(subscriber));
- this.el = el;
- this.zone = zone;
- this.stream$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.merge)((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(this.el.nativeElement, 'mouseenter').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_5__.ALWAYS_TRUE_HANDLER)), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(this.el.nativeElement, 'mouseleave').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_5__.ALWAYS_FALSE_HANDLER)),
- // Hello, Safari
- (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(this.el.nativeElement, 'mouseout').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.filter)(movedOut), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_5__.ALWAYS_FALSE_HANDLER))).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.distinctUntilChanged)(), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiZoneOptimized)(this.zone));
- }
+function createTimelineInstruction(element, keyframes, preStyleProps, postStyleProps, duration, delay, easing = null, subTimeline = false) {
+ return {
+ type: 1 /* AnimationTransitionInstructionType.TimelineAnimation */,
+ element,
+ keyframes,
+ preStyleProps,
+ postStyleProps,
+ duration,
+ delay,
+ totalTime: duration + delay,
+ easing,
+ subTimeline
+ };
}
-TuiHoveredService.ɵfac = function TuiHoveredService_Factory(t) {
- return new (t || TuiHoveredService)(_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_8__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_8__.NgZone));
-};
-TuiHoveredService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineInjectable"]({
- token: TuiHoveredService,
- factory: TuiHoveredService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵsetClassMetadata"](TuiHoveredService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_8__.Injectable
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_8__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_8__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_8__.ElementRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_8__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_8__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_8__.NgZone]
- }]
- }];
- }, null);
-})();
-class TuiHoveredDirective {
- constructor(tuiHoveredChange) {
- this.tuiHoveredChange = tuiHoveredChange;
+class ElementInstructionMap {
+ constructor() {
+ this._map = new Map();
}
-}
-TuiHoveredDirective.ɵfac = function TuiHoveredDirective_Factory(t) {
- return new (t || TuiHoveredDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdirectiveInject"](TuiHoveredService));
-};
-TuiHoveredDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineDirective"]({
- type: TuiHoveredDirective,
- selectors: [["", "tuiHoveredChange", ""]],
- outputs: {
- tuiHoveredChange: "tuiHoveredChange"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵProvidersFeature"]([TuiHoveredService])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵsetClassMetadata"](TuiHoveredDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_8__.Directive,
- args: [{
- selector: '[tuiHoveredChange]',
- outputs: ['tuiHoveredChange'],
- providers: [TuiHoveredService]
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_1__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_8__.Inject,
- args: [TuiHoveredService]
- }]
- }];
- }, null);
-})();
-class TuiHoveredModule {}
-TuiHoveredModule.ɵfac = function TuiHoveredModule_Factory(t) {
- return new (t || TuiHoveredModule)();
-};
-TuiHoveredModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineNgModule"]({
- type: TuiHoveredModule
-});
-TuiHoveredModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_8__["ɵsetClassMetadata"](TuiHoveredModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_8__.NgModule,
- args: [{
- declarations: [TuiHoveredDirective],
- exports: [TuiHoveredDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 1520:
-/*!*****************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-item.js ***!
- \*****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiItemDirective: () => (/* binding */ TuiItemDirective),
-/* harmony export */ TuiItemModule: () => (/* binding */ TuiItemModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-
-
-
-/**
- * Blank directive for queries via `@ContentChildren` / `@ViewChildren` / `querySelector`
- */
-class TuiItemDirective {}
-TuiItemDirective.ɵfac = function TuiItemDirective_Factory(t) {
- return new (t || TuiItemDirective)();
-};
-TuiItemDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiItemDirective,
- selectors: [["", "tuiItem", ""]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiItemDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiItem]'
- }]
- }], null, null);
-})();
-class TuiItemModule {}
-TuiItemModule.ɵfac = function TuiItemModule_Factory(t) {
- return new (t || TuiItemModule)();
-};
-TuiItemModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiItemModule
-});
-TuiItemModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiItemModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiItemDirective],
- exports: [TuiItemDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 9163:
-/*!****************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-let.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiLetContext: () => (/* binding */ TuiLetContext),
-/* harmony export */ TuiLetDirective: () => (/* binding */ TuiLetDirective),
-/* harmony export */ TuiLetModule: () => (/* binding */ TuiLetModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-
-
-
-/**
- * @internal
- */
-class TuiLetContext {
- constructor(internalDirectiveInstance) {
- this.internalDirectiveInstance = internalDirectiveInstance;
+ get(element) {
+ return this._map.get(element) || [];
}
- get $implicit() {
- return this.internalDirectiveInstance.tuiLet;
+ append(element, instructions) {
+ let existingInstructions = this._map.get(element);
+ if (!existingInstructions) {
+ this._map.set(element, existingInstructions = []);
+ }
+ existingInstructions.push(...instructions);
}
- get tuiLet() {
- return this.internalDirectiveInstance.tuiLet;
+ has(element) {
+ return this._map.has(element);
+ }
+ clear() {
+ this._map.clear();
}
}
-
-/**
- * Works like *ngIf but does not have a condition — use it to declare
- * the result of pipes calculation (i.e. async pipe)
+const ONE_FRAME_IN_MILLISECONDS = 1;
+const ENTER_TOKEN = ':enter';
+const ENTER_TOKEN_REGEX = new RegExp(ENTER_TOKEN, 'g');
+const LEAVE_TOKEN = ':leave';
+const LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g');
+/*
+ * The code within this file aims to generate web-animations-compatible keyframes from Angular's
+ * animation DSL code.
+ *
+ * The code below will be converted from:
+ *
+ * ```
+ * sequence([
+ * style({ opacity: 0 }),
+ * animate(1000, style({ opacity: 0 }))
+ * ])
+ * ```
+ *
+ * To:
+ * ```
+ * keyframes = [{ opacity: 0, offset: 0 }, { opacity: 1, offset: 1 }]
+ * duration = 1000
+ * delay = 0
+ * easing = ''
+ * ```
+ *
+ * For this operation to cover the combination of animation verbs (style, animate, group, etc...) a
+ * combination of AST traversal and merge-sort-like algorithms are used.
+ *
+ * [AST Traversal]
+ * Each of the animation verbs, when executed, will return an string-map object representing what
+ * type of action it is (style, animate, group, etc...) and the data associated with it. This means
+ * that when functional composition mix of these functions is evaluated (like in the example above)
+ * then it will end up producing a tree of objects representing the animation itself.
+ *
+ * When this animation object tree is processed by the visitor code below it will visit each of the
+ * verb statements within the visitor. And during each visit it will build the context of the
+ * animation keyframes by interacting with the `TimelineBuilder`.
+ *
+ * [TimelineBuilder]
+ * This class is responsible for tracking the styles and building a series of keyframe objects for a
+ * timeline between a start and end time. The builder starts off with an initial timeline and each
+ * time the AST comes across a `group()`, `keyframes()` or a combination of the two within a
+ * `sequence()` then it will generate a sub timeline for each step as well as a new one after
+ * they are complete.
+ *
+ * As the AST is traversed, the timing state on each of the timelines will be incremented. If a sub
+ * timeline was created (based on one of the cases above) then the parent timeline will attempt to
+ * merge the styles used within the sub timelines into itself (only with group() this will happen).
+ * This happens with a merge operation (much like how the merge works in mergeSort) and it will only
+ * copy the most recently used styles from the sub timelines into the parent timeline. This ensures
+ * that if the styles are used later on in another phase of the animation then they will be the most
+ * up-to-date values.
+ *
+ * [How Missing Styles Are Updated]
+ * Each timeline has a `backFill` property which is responsible for filling in new styles into
+ * already processed keyframes if a new style shows up later within the animation sequence.
+ *
+ * ```
+ * sequence([
+ * style({ width: 0 }),
+ * animate(1000, style({ width: 100 })),
+ * animate(1000, style({ width: 200 })),
+ * animate(1000, style({ width: 300 }))
+ * animate(1000, style({ width: 400, height: 400 })) // notice how `height` doesn't exist anywhere
+ * else
+ * ])
+ * ```
+ *
+ * What is happening here is that the `height` value is added later in the sequence, but is missing
+ * from all previous animation steps. Therefore when a keyframe is created it would also be missing
+ * from all previous keyframes up until where it is first used. For the timeline keyframe generation
+ * to properly fill in the style it will place the previous value (the value from the parent
+ * timeline) or a default value of `*` into the backFill map. The `copyStyles` method in util.ts
+ * handles propagating that backfill map to the styles object.
+ *
+ * When a sub-timeline is created it will have its own backFill property. This is done so that
+ * styles present within the sub-timeline do not accidentally seep into the previous/future timeline
+ * keyframes
+ *
+ * [Validation]
+ * The code in this file is not responsible for validation. That functionality happens with within
+ * the `AnimationValidatorVisitor` code.
*/
-class TuiLetDirective {
- constructor(viewContainer, templateRef) {
- viewContainer.createEmbeddedView(templateRef, new TuiLetContext(this));
- }
- /**
- * Asserts the correct type of the context for the template that `TuiLet` will render.
- *
- * The presence of this method is a signal to the Ivy template type-check compiler that the
- * `TuiLet` structural directive renders its template with a specific context type.
- */
- static ngTemplateContextGuard(_dir, _ctx) {
- return true;
- }
+function buildAnimationTimelines(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles = new Map(), finalStyles = new Map(), options, subInstructions, errors = []) {
+ return new AnimationTimelineBuilderVisitor().buildKeyframes(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors);
}
-TuiLetDirective.ɵfac = function TuiLetDirective_Factory(t) {
- return new (t || TuiLetDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef));
-};
-TuiLetDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiLetDirective,
- selectors: [["", "tuiLet", ""]],
- inputs: {
- tuiLet: "tuiLet"
- }
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiLetDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiLet]'
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef]
- }]
- }];
- }, {
- tuiLet: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiLetModule {}
-TuiLetModule.ɵfac = function TuiLetModule_Factory(t) {
- return new (t || TuiLetModule)();
-};
-TuiLetModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiLetModule
-});
-TuiLetModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiLetModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiLetDirective],
- exports: [TuiLetDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 9297:
-/*!*********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-obscured.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiObscuredDirective: () => (/* binding */ TuiObscuredDirective),
-/* harmony export */ TuiObscuredModule: () => (/* binding */ TuiObscuredModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_directives_active_zone__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk/directives/active-zone */ 625);
-/* harmony import */ var _taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk/observables */ 2143);
-/* harmony import */ var _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk/services */ 7609);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 3150);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ 4406);
-
-
-
-
-
-
-
-
-
-
-/**
- * Directive that monitors element visibility
- */
-class TuiObscuredDirective {
- constructor(activeZone, obscured$) {
- this.enabled$ = new rxjs__WEBPACK_IMPORTED_MODULE_0__.Subject();
- const mapped$ = obscured$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.map)(obscuredBy => !!obscuredBy && (!activeZone || !obscuredBy.length || obscuredBy.every(element => !activeZone.contains(element)))));
- this.tuiObscured = this.enabled$.pipe((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_2__.tuiIfMap)(() => mapped$));
- }
- set tuiObscuredEnabled(enabled) {
- this.enabled$.next(enabled);
- }
-}
-TuiObscuredDirective.ɵfac = function TuiObscuredDirective_Factory(t) {
- return new (t || TuiObscuredDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_taiga_ui_cdk_directives_active_zone__WEBPACK_IMPORTED_MODULE_4__.TuiActiveZoneDirective, 8), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiObscuredService, 2));
-};
-TuiObscuredDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineDirective"]({
- type: TuiObscuredDirective,
- selectors: [["", "tuiObscured", ""]],
- inputs: {
- tuiObscuredEnabled: "tuiObscuredEnabled"
- },
- outputs: {
- tuiObscured: "tuiObscured"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵProvidersFeature"]([_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiObscuredService, _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiParentsScrollService, _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiDestroyService])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵsetClassMetadata"](TuiObscuredDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Directive,
- args: [{
- selector: '[tuiObscured]',
- providers: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiObscuredService, _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiParentsScrollService, _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiDestroyService]
- }]
- }], function () {
- return [{
- type: _taiga_ui_cdk_directives_active_zone__WEBPACK_IMPORTED_MODULE_4__.TuiActiveZoneDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Inject,
- args: [_taiga_ui_cdk_directives_active_zone__WEBPACK_IMPORTED_MODULE_4__.TuiActiveZoneDirective]
- }]
- }, {
- type: _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiObscuredService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Inject,
- args: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_5__.TuiObscuredService]
- }]
- }];
- }, {
- tuiObscuredEnabled: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input
- }],
- tuiObscured: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Output
- }]
- });
-})();
-class TuiObscuredModule {}
-TuiObscuredModule.ɵfac = function TuiObscuredModule_Factory(t) {
- return new (t || TuiObscuredModule)();
-};
-TuiObscuredModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineNgModule"]({
- type: TuiObscuredModule
-});
-TuiObscuredModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵsetClassMetadata"](TuiObscuredModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.NgModule,
- args: [{
- declarations: [TuiObscuredDirective],
- exports: [TuiObscuredDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3535:
-/*!***********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-overscroll.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiOverscrollDirective: () => (/* binding */ TuiOverscrollDirective),
-/* harmony export */ TuiOverscrollModule: () => (/* binding */ TuiOverscrollModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/observables */ 2143);
-/* harmony import */ var _taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk/services */ 7609);
-/* harmony import */ var _taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk/utils/dom */ 4333);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ 1856);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 1969);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 4517);
-
-
-
-
-
-
-
-
-/**
- * Directive to isolate scrolling, i.e. prevent body scroll behind modal dialog
- */
-class TuiOverscrollDirective {
- constructor({
- nativeElement
- }, zone, destroy$) {
- this.mode = 'scroll';
- (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_0__.tuiTypedFromEvent)(nativeElement, 'wheel', {
- passive: false
- }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.filter)(() => this.enabled), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_0__.tuiZonefree)(zone), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.takeUntil)(destroy$)).subscribe(event => {
- this.processEvent(event, !!event.deltaY, event.deltaY ? event.deltaY < 0 : event.deltaX < 0);
- });
- (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_0__.tuiTypedFromEvent)(nativeElement, 'touchstart', {
- passive: true
- }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.switchMap)(({
- touches
- }) => {
- let {
- clientX,
- clientY
- } = touches[0];
- let deltaX = 0;
- let deltaY = 0;
- let vertical;
- return (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_0__.tuiTypedFromEvent)(nativeElement, 'touchmove', {
- passive: false
- }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.filter)(() => this.enabled), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.tap)(event => {
- // We have to have it in tap instead of subscribe due to variables in closure
- const changedTouch = event.changedTouches[0];
- deltaX = clientX - changedTouch.clientX;
- deltaY = clientY - changedTouch.clientY;
- clientX = changedTouch.clientX;
- clientY = changedTouch.clientY;
- if (vertical === undefined) {
- vertical = Math.abs(deltaY) > Math.abs(deltaX);
+class AnimationTimelineBuilderVisitor {
+ buildKeyframes(driver, rootElement, ast, enterClassName, leaveClassName, startingStyles, finalStyles, options, subInstructions, errors = []) {
+ subInstructions = subInstructions || new ElementInstructionMap();
+ const context = new AnimationTimelineContext(driver, rootElement, subInstructions, enterClassName, leaveClassName, errors, []);
+ context.options = options;
+ const delay = options.delay ? resolveTimingValue(options.delay) : 0;
+ context.currentTimeline.delayNextStep(delay);
+ context.currentTimeline.setStyles([startingStyles], null, context.errors, options);
+ visitDslNode(this, ast, context);
+ // this checks to see if an actual animation happened
+ const timelines = context.timelines.filter(timeline => timeline.containsAnimation());
+ // note: we just want to apply the final styles for the rootElement, so we do not
+ // just apply the styles to the last timeline but the last timeline which
+ // element is the root one (basically `*`-styles are replaced with the actual
+ // state style values only for the root element)
+ if (timelines.length && finalStyles.size) {
+ let lastRootTimeline;
+ for (let i = timelines.length - 1; i >= 0; i--) {
+ const timeline = timelines[i];
+ if (timeline.element === rootElement) {
+ lastRootTimeline = timeline;
+ break;
}
- this.processEvent(event, vertical, vertical ? deltaY < 0 : deltaX < 0);
- }));
- }), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_0__.tuiZonefree)(zone), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.takeUntil)(destroy$)).subscribe();
+ }
+ if (lastRootTimeline && !lastRootTimeline.allowOnlyTimelineStyles()) {
+ lastRootTimeline.setStyles([finalStyles], null, context.errors, options);
+ }
+ }
+ return timelines.length ? timelines.map(timeline => timeline.buildKeyframes()) : [createTimelineInstruction(rootElement, [], [], [], 0, delay, '', false)];
}
- get enabled() {
- return this.mode !== 'none';
+ visitTrigger(ast, context) {
+ // these values are not visited in this AST
}
- get overscrollBehavior() {
- return this.enabled ? 'contain' : null;
+ visitState(ast, context) {
+ // these values are not visited in this AST
}
- processEvent(event, vertical, negative) {
- var _a;
- const {
- target,
- currentTarget,
- cancelable
- } = event;
- if (!cancelable || !(0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_5__.tuiIsElement)(target) || ((_a = target) === null || _a === void 0 ? void 0 : _a.type) === 'range') {
- return;
- }
- // This is all what's needed in Chrome/Firefox thanks to CSS overscroll-behavior
- if (this.mode === 'all' && (vertical && !currentTarget.contains((0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_5__.tuiGetScrollParent)(target)) || !vertical && !currentTarget.contains((0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_5__.tuiGetScrollParent)(target, false)))) {
- event.preventDefault();
- return;
- }
- // This is Safari/IE/Edge fallback
- if (vertical && (negative && !(0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_5__.tuiCanScroll)(target, currentTarget, true, false) || !negative && !(0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_5__.tuiCanScroll)(target, currentTarget, true, true))) {
- event.preventDefault();
- return;
- }
- if (!vertical && (negative && !(0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_5__.tuiCanScroll)(target, currentTarget, false, false) || !negative && !(0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_5__.tuiCanScroll)(target, currentTarget, false, true))) {
- event.preventDefault();
- }
+ visitTransition(ast, context) {
+ // these values are not visited in this AST
}
-}
-TuiOverscrollDirective.ɵfac = function TuiOverscrollDirective_Factory(t) {
- return new (t || TuiOverscrollDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_6__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_6__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdirectiveInject"](_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, 2));
-};
-TuiOverscrollDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdefineDirective"]({
- type: TuiOverscrollDirective,
- selectors: [["", "tuiOverscroll", ""]],
- hostVars: 2,
- hostBindings: function TuiOverscrollDirective_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵstyleProp"]("overscroll-behavior", ctx.overscrollBehavior);
+ visitAnimateChild(ast, context) {
+ const elementInstructions = context.subInstructions.get(context.element);
+ if (elementInstructions) {
+ const innerContext = context.createSubContext(ast.options);
+ const startTime = context.currentTimeline.currentTime;
+ const endTime = this._visitSubInstructions(elementInstructions, innerContext, innerContext.options);
+ if (startTime != endTime) {
+ // we do this on the upper context because we created a sub context for
+ // the sub child animations
+ context.transformIntoNewTimeline(endTime);
+ }
}
- },
- inputs: {
- mode: ["tuiOverscroll", "mode"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵProvidersFeature"]([_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵsetClassMetadata"](TuiOverscrollDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Directive,
- args: [{
- selector: '[tuiOverscroll]',
- providers: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService]
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_6__.ElementRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_6__.NgZone]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Inject,
- args: [_taiga_ui_cdk_services__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService]
- }]
- }];
- }, {
- mode: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.Input,
- args: ['tuiOverscroll']
- }],
- overscrollBehavior: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.HostBinding,
- args: ['style.overscrollBehavior']
- }]
- });
-})();
-class TuiOverscrollModule {}
-TuiOverscrollModule.ɵfac = function TuiOverscrollModule_Factory(t) {
- return new (t || TuiOverscrollModule)();
-};
-TuiOverscrollModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdefineNgModule"]({
- type: TuiOverscrollModule
-});
-TuiOverscrollModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_6__["ɵsetClassMetadata"](TuiOverscrollModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_6__.NgModule,
- args: [{
- declarations: [TuiOverscrollDirective],
- exports: [TuiOverscrollDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3152:
-/*!********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-pressed.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiPressedDirective: () => (/* binding */ TuiPressedDirective),
-/* harmony export */ TuiPressedModule: () => (/* binding */ TuiPressedModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/observables */ 2143);
-/* harmony import */ var _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk/tokens */ 1355);
-
-
-
-
-class TuiPressedDirective {
- constructor(el, takeOnlyTrustedEvents) {
- this.el = el;
- this.takeOnlyTrustedEvents = takeOnlyTrustedEvents;
- this.tuiPressedChange = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_0__.tuiPressedObservable)(this.el.nativeElement, {
- onlyTrusted: this.takeOnlyTrustedEvents
- });
+ context.previousNode = ast;
}
-}
-TuiPressedDirective.ɵfac = function TuiPressedDirective_Factory(t) {
- return new (t || TuiPressedDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_TAKE_ONLY_TRUSTED_EVENTS));
-};
-TuiPressedDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({
- type: TuiPressedDirective,
- selectors: [["", "tuiPressedChange", ""]],
- outputs: {
- tuiPressedChange: "tuiPressedChange"
+ visitAnimateRef(ast, context) {
+ const innerContext = context.createSubContext(ast.options);
+ innerContext.transformIntoNewTimeline();
+ this._applyAnimationRefDelays([ast.options, ast.animation.options], context, innerContext);
+ this.visitReference(ast.animation, innerContext);
+ context.transformIntoNewTimeline(innerContext.currentTimeline.currentTime);
+ context.previousNode = ast;
}
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiPressedDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive,
- args: [{
- selector: '[tuiPressedChange]'
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_TAKE_ONLY_TRUSTED_EVENTS]
- }]
- }];
- }, {
- tuiPressedChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output
- }]
- });
-})();
-class TuiPressedModule {}
-TuiPressedModule.ɵfac = function TuiPressedModule_Factory(t) {
- return new (t || TuiPressedModule)();
-};
-TuiPressedModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
- type: TuiPressedModule
-});
-TuiPressedModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiPressedModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule,
- args: [{
- declarations: [TuiPressedDirective],
- exports: [TuiPressedDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 9368:
-/*!********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-directives-resizer.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiResizeableDirective: () => (/* binding */ TuiResizeableDirective),
-/* harmony export */ TuiResizerDirective: () => (/* binding */ TuiResizerDirective),
-/* harmony export */ TuiResizerModule: () => (/* binding */ TuiResizerModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_directives_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/directives/element */ 5558);
-/* harmony import */ var _taiga_ui_cdk_utils_format__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk/utils/format */ 3406);
-
-
-
-
-class TuiResizeableDirective extends _taiga_ui_cdk_directives_element__WEBPACK_IMPORTED_MODULE_0__.TuiElementDirective {}
-TuiResizeableDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiResizeableDirective_BaseFactory;
- return function TuiResizeableDirective_Factory(t) {
- return (ɵTuiResizeableDirective_BaseFactory || (ɵTuiResizeableDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetInheritedFactory"](TuiResizeableDirective)))(t || TuiResizeableDirective);
- };
-}();
-TuiResizeableDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({
- type: TuiResizeableDirective,
- selectors: [["", "tuiResizeable", ""]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiResizeableDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive,
- args: [{
- selector: '[tuiResizeable]'
- }]
- }], null, null);
-})();
-
-// TODO: Migrate to PointerEvent in 4.0
-class TuiResizerDirective {
- constructor(resizeable) {
- this.resizeable = resizeable;
- this.tuiResizer = [0, 0];
- this.tuiSizeChange = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.EventEmitter();
- this.x = NaN;
- this.y = NaN;
- this.width = 0;
- this.height = 0;
+ _applyAnimationRefDelays(animationsRefsOptions, context, innerContext) {
+ for (const animationRefOptions of animationsRefsOptions) {
+ const animationDelay = animationRefOptions?.delay;
+ if (animationDelay) {
+ const animationDelayValue = typeof animationDelay === 'number' ? animationDelay : resolveTimingValue(interpolateParams(animationDelay, animationRefOptions?.params ?? {}, context.errors));
+ innerContext.delayNextStep(animationDelayValue);
+ }
+ }
}
- get cursor() {
- if (!this.tuiResizer[0]) {
- return 'ns-resize';
+ _visitSubInstructions(instructions, context, options) {
+ const startTime = context.currentTimeline.currentTime;
+ let furthestTime = startTime;
+ // this is a special-case for when a user wants to skip a sub
+ // animation from being fired entirely.
+ const duration = options.duration != null ? resolveTimingValue(options.duration) : null;
+ const delay = options.delay != null ? resolveTimingValue(options.delay) : null;
+ if (duration !== 0) {
+ instructions.forEach(instruction => {
+ const instructionTimings = context.appendInstructionToTimeline(instruction, duration, delay);
+ furthestTime = Math.max(furthestTime, instructionTimings.duration + instructionTimings.delay);
+ });
}
- if (!this.tuiResizer[1]) {
- return 'ew-resize';
+ return furthestTime;
+ }
+ visitReference(ast, context) {
+ context.updateOptions(ast.options, true);
+ visitDslNode(this, ast.animation, context);
+ context.previousNode = ast;
+ }
+ visitSequence(ast, context) {
+ const subContextCount = context.subContextCount;
+ let ctx = context;
+ const options = ast.options;
+ if (options && (options.params || options.delay)) {
+ ctx = context.createSubContext(options);
+ ctx.transformIntoNewTimeline();
+ if (options.delay != null) {
+ if (ctx.previousNode.type == 6 /* AnimationMetadataType.Style */) {
+ ctx.currentTimeline.snapshotCurrentStyles();
+ ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
+ }
+ const delay = resolveTimingValue(options.delay);
+ ctx.delayNextStep(delay);
+ }
}
- if (this.tuiResizer[0] * this.tuiResizer[1] > 0) {
- return 'nwse-resize';
+ if (ast.steps.length) {
+ ast.steps.forEach(s => visitDslNode(this, s, ctx));
+ // this is here just in case the inner steps only contain or end with a style() call
+ ctx.currentTimeline.applyStylesToKeyframe();
+ // this means that some animation function within the sequence
+ // ended up creating a sub timeline (which means the current
+ // timeline cannot overlap with the contents of the sequence)
+ if (ctx.subContextCount > subContextCount) {
+ ctx.transformIntoNewTimeline();
+ }
}
- return 'nesw-resize';
- }
- onTouchStart({
- touches
- }) {
- this.onMouseDown(touches[0].clientX, touches[0].clientY);
+ context.previousNode = ast;
}
- onMouseDown(x, y) {
- this.x = x;
- this.y = y;
- this.width = this.resizeable.nativeElement.clientWidth;
- this.height = this.resizeable.nativeElement.clientHeight;
+ visitGroup(ast, context) {
+ const innerTimelines = [];
+ let furthestTime = context.currentTimeline.currentTime;
+ const delay = ast.options && ast.options.delay ? resolveTimingValue(ast.options.delay) : 0;
+ ast.steps.forEach(s => {
+ const innerContext = context.createSubContext(ast.options);
+ if (delay) {
+ innerContext.delayNextStep(delay);
+ }
+ visitDslNode(this, s, innerContext);
+ furthestTime = Math.max(furthestTime, innerContext.currentTimeline.currentTime);
+ innerTimelines.push(innerContext.currentTimeline);
+ });
+ // this operation is run after the AST loop because otherwise
+ // if the parent timeline's collected styles were updated then
+ // it would pass in invalid data into the new-to-be forked items
+ innerTimelines.forEach(timeline => context.currentTimeline.mergeTimelineCollectedStyles(timeline));
+ context.transformIntoNewTimeline(furthestTime);
+ context.previousNode = ast;
}
- onMouseMove({
- x,
- y,
- buttons
- }) {
- if (!buttons) {
- this.onMouseUp();
+ _visitTiming(ast, context) {
+ if (ast.dynamic) {
+ const strValue = ast.strValue;
+ const timingValue = context.params ? interpolateParams(strValue, context.params, context.errors) : strValue;
+ return resolveTiming(timingValue, context.errors);
} else {
- this.onMove(x, y);
+ return {
+ duration: ast.duration,
+ delay: ast.delay,
+ easing: ast.easing
+ };
}
}
- onTouchMove({
- touches
- }) {
- this.onMove(touches[0].clientX, touches[0].clientY);
- }
- onMouseUp() {
- this.x = NaN;
- }
- onMove(x, y) {
- if (Number.isNaN(this.x)) {
- return;
- }
- const {
- style
- } = this.resizeable.nativeElement;
- const size = [this.width + this.tuiResizer[0] * (x - this.x), this.height + this.tuiResizer[1] * (y - this.y)];
- if (this.tuiResizer[0]) {
- style.width = (0,_taiga_ui_cdk_utils_format__WEBPACK_IMPORTED_MODULE_2__.tuiPx)(size[0]);
+ visitAnimate(ast, context) {
+ const timings = context.currentAnimateTimings = this._visitTiming(ast.timings, context);
+ const timeline = context.currentTimeline;
+ if (timings.delay) {
+ context.incrementTime(timings.delay);
+ timeline.snapshotCurrentStyles();
}
- if (this.tuiResizer[1]) {
- style.height = (0,_taiga_ui_cdk_utils_format__WEBPACK_IMPORTED_MODULE_2__.tuiPx)(size[1]);
+ const style = ast.style;
+ if (style.type == 5 /* AnimationMetadataType.Keyframes */) {
+ this.visitKeyframes(style, context);
+ } else {
+ context.incrementTime(timings.duration);
+ this.visitStyle(style, context);
+ timeline.applyStylesToKeyframe();
}
- this.tuiSizeChange.emit(size);
+ context.currentAnimateTimings = null;
+ context.previousNode = ast;
}
-}
-TuiResizerDirective.ɵfac = function TuiResizerDirective_Factory(t) {
- return new (t || TuiResizerDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](TuiResizeableDirective));
-};
-TuiResizerDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({
- type: TuiResizerDirective,
- selectors: [["", "tuiResizer", ""]],
- hostVars: 4,
- hostBindings: function TuiResizerDirective_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("touchstart.silent.passive", function TuiResizerDirective_touchstart_silent_passive_HostBindingHandler($event) {
- return ctx.onTouchStart($event);
- })("mousedown.silent.prevent", function TuiResizerDirective_mousedown_silent_prevent_HostBindingHandler($event) {
- return ctx.onMouseDown($event.x, $event.y);
- })("mousemove.silent", function TuiResizerDirective_mousemove_silent_HostBindingHandler($event) {
- return ctx.onMouseMove($event);
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresolveDocument"])("touchmove.silent", function TuiResizerDirective_touchmove_silent_HostBindingHandler($event) {
- return ctx.onTouchMove($event);
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresolveDocument"])("mouseup.silent", function TuiResizerDirective_mouseup_silent_HostBindingHandler() {
- return ctx.onMouseUp();
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresolveDocument"])("touchend.silent", function TuiResizerDirective_touchend_silent_HostBindingHandler() {
- return ctx.onMouseUp();
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresolveDocument"]);
+ visitStyle(ast, context) {
+ const timeline = context.currentTimeline;
+ const timings = context.currentAnimateTimings;
+ // this is a special case for when a style() call
+ // directly follows an animate() call (but not inside of an animate() call)
+ if (!timings && timeline.hasCurrentStyleProperties()) {
+ timeline.forwardFrame();
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵstyleProp"]("touch-action", "none")("cursor", ctx.cursor);
+ const easing = timings && timings.easing || ast.easing;
+ if (ast.isEmptyStep) {
+ timeline.applyEmptyStep(easing);
+ } else {
+ timeline.setStyles(ast.styles, easing, context.errors, context.options);
}
- },
- inputs: {
- tuiResizer: "tuiResizer"
- },
- outputs: {
- tuiSizeChange: "tuiSizeChange"
+ context.previousNode = ast;
}
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiResizerDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive,
- args: [{
- selector: '[tuiResizer]',
- host: {
- '[style.touchAction]': '"none"'
- }
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [TuiResizeableDirective]
- }]
- }];
- }, {
- tuiResizer: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- tuiSizeChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Output
- }],
- cursor: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['style.cursor']
- }],
- onTouchStart: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostListener,
- args: ['touchstart.silent.passive', ['$event']]
- }],
- onMouseDown: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostListener,
- args: ['mousedown.silent.prevent', ['$event.x', '$event.y']]
- }],
- onMouseMove: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostListener,
- args: ['document:mousemove.silent', ['$event']]
- }],
- onTouchMove: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostListener,
- args: ['document:touchmove.silent', ['$event']]
- }],
- onMouseUp: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostListener,
- args: ['document:mouseup.silent']
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostListener,
- args: ['document:touchend.silent']
- }]
- });
-})();
-class TuiResizerModule {}
-TuiResizerModule.ɵfac = function TuiResizerModule_Factory(t) {
- return new (t || TuiResizerModule)();
-};
-TuiResizerModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
- type: TuiResizerModule
-});
-TuiResizerModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiResizerModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule,
- args: [{
- declarations: [TuiResizeableDirective, TuiResizerDirective],
- exports: [TuiResizeableDirective, TuiResizerDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 396:
-/*!*******************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-enums.js ***!
- \*******************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiDayOfWeek: () => (/* binding */ TuiDayOfWeek),
-/* harmony export */ TuiMonthNumber: () => (/* binding */ TuiMonthNumber)
-/* harmony export */ });
-// TODO: change type in v4.0
-// eslint-disable-next-line no-restricted-syntax
-var TuiDayOfWeek;
-(function (TuiDayOfWeek) {
- TuiDayOfWeek[TuiDayOfWeek["Sunday"] = 0] = "Sunday";
- TuiDayOfWeek[TuiDayOfWeek["Monday"] = 1] = "Monday";
- TuiDayOfWeek[TuiDayOfWeek["Tuesday"] = 2] = "Tuesday";
- TuiDayOfWeek[TuiDayOfWeek["Wednesday"] = 3] = "Wednesday";
- TuiDayOfWeek[TuiDayOfWeek["Thursday"] = 4] = "Thursday";
- TuiDayOfWeek[TuiDayOfWeek["Friday"] = 5] = "Friday";
- TuiDayOfWeek[TuiDayOfWeek["Saturday"] = 6] = "Saturday";
-})(TuiDayOfWeek || (TuiDayOfWeek = {}));
-
-// TODO: change type in v4.0
-// eslint-disable-next-line no-restricted-syntax
-var TuiMonthNumber;
-(function (TuiMonthNumber) {
- TuiMonthNumber[TuiMonthNumber["January"] = 0] = "January";
- TuiMonthNumber[TuiMonthNumber["February"] = 1] = "February";
- TuiMonthNumber[TuiMonthNumber["March"] = 2] = "March";
- TuiMonthNumber[TuiMonthNumber["April"] = 3] = "April";
- TuiMonthNumber[TuiMonthNumber["May"] = 4] = "May";
- TuiMonthNumber[TuiMonthNumber["June"] = 5] = "June";
- TuiMonthNumber[TuiMonthNumber["July"] = 6] = "July";
- TuiMonthNumber[TuiMonthNumber["August"] = 7] = "August";
- TuiMonthNumber[TuiMonthNumber["September"] = 8] = "September";
- TuiMonthNumber[TuiMonthNumber["October"] = 9] = "October";
- TuiMonthNumber[TuiMonthNumber["November"] = 10] = "November";
- TuiMonthNumber[TuiMonthNumber["December"] = 11] = "December";
-})(TuiMonthNumber || (TuiMonthNumber = {}));
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3447:
-/*!************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-exceptions.js ***!
- \************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiComputedDocumentException: () => (/* binding */ TuiComputedDocumentException),
-/* harmony export */ TuiDocumentSelectionException: () => (/* binding */ TuiDocumentSelectionException),
-/* harmony export */ TuiInvalidDayException: () => (/* binding */ TuiInvalidDayException),
-/* harmony export */ TuiInvalidMonthException: () => (/* binding */ TuiInvalidMonthException),
-/* harmony export */ TuiInvalidYearException: () => (/* binding */ TuiInvalidYearException),
-/* harmony export */ TuiNoHostException: () => (/* binding */ TuiNoHostException),
-/* harmony export */ TuiOwnerDocumentException: () => (/* binding */ TuiOwnerDocumentException),
-/* harmony export */ TuiPureException: () => (/* binding */ TuiPureException),
-/* harmony export */ TuiTableSortKeyException: () => (/* binding */ TuiTableSortKeyException),
-/* harmony export */ TuiTsParserException: () => (/* binding */ TuiTsParserException),
-/* harmony export */ TuiValueChangesException: () => (/* binding */ TuiValueChangesException),
-/* harmony export */ TuiValuePresentException: () => (/* binding */ TuiValuePresentException),
-/* harmony export */ TuiXmlParsingException: () => (/* binding */ TuiXmlParsingException)
-/* harmony export */ });
-class TuiComputedDocumentException extends Error {
- constructor() {
- super(ngDevMode ? 'Only use computedDocument after load event' : '');
+ visitKeyframes(ast, context) {
+ const currentAnimateTimings = context.currentAnimateTimings;
+ const startTime = context.currentTimeline.duration;
+ const duration = currentAnimateTimings.duration;
+ const innerContext = context.createSubContext();
+ const innerTimeline = innerContext.currentTimeline;
+ innerTimeline.easing = currentAnimateTimings.easing;
+ ast.styles.forEach(step => {
+ const offset = step.offset || 0;
+ innerTimeline.forwardTime(offset * duration);
+ innerTimeline.setStyles(step.styles, step.easing, context.errors, context.options);
+ innerTimeline.applyStylesToKeyframe();
+ });
+ // this will ensure that the parent timeline gets all the styles from
+ // the child even if the new timeline below is not used
+ context.currentTimeline.mergeTimelineCollectedStyles(innerTimeline);
+ // we do this because the window between this timeline and the sub timeline
+ // should ensure that the styles within are exactly the same as they were before
+ context.transformIntoNewTimeline(startTime + duration);
+ context.previousNode = ast;
}
-}
-class TuiDocumentSelectionException extends Error {
- constructor() {
- super(ngDevMode ? 'Failed to get document selection' : '');
+ visitQuery(ast, context) {
+ // in the event that the first step before this is a style step we need
+ // to ensure the styles are applied before the children are animated
+ const startTime = context.currentTimeline.currentTime;
+ const options = ast.options || {};
+ const delay = options.delay ? resolveTimingValue(options.delay) : 0;
+ if (delay && (context.previousNode.type === 6 /* AnimationMetadataType.Style */ || startTime == 0 && context.currentTimeline.hasCurrentStyleProperties())) {
+ context.currentTimeline.snapshotCurrentStyles();
+ context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
+ }
+ let furthestTime = startTime;
+ const elms = context.invokeQuery(ast.selector, ast.originalSelector, ast.limit, ast.includeSelf, options.optional ? true : false, context.errors);
+ context.currentQueryTotal = elms.length;
+ let sameElementTimeline = null;
+ elms.forEach((element, i) => {
+ context.currentQueryIndex = i;
+ const innerContext = context.createSubContext(ast.options, element);
+ if (delay) {
+ innerContext.delayNextStep(delay);
+ }
+ if (element === context.element) {
+ sameElementTimeline = innerContext.currentTimeline;
+ }
+ visitDslNode(this, ast.animation, innerContext);
+ // this is here just incase the inner steps only contain or end
+ // with a style() call (which is here to signal that this is a preparatory
+ // call to style an element before it is animated again)
+ innerContext.currentTimeline.applyStylesToKeyframe();
+ const endTime = innerContext.currentTimeline.currentTime;
+ furthestTime = Math.max(furthestTime, endTime);
+ });
+ context.currentQueryIndex = 0;
+ context.currentQueryTotal = 0;
+ context.transformIntoNewTimeline(furthestTime);
+ if (sameElementTimeline) {
+ context.currentTimeline.mergeTimelineCollectedStyles(sameElementTimeline);
+ context.currentTimeline.snapshotCurrentStyles();
+ }
+ context.previousNode = ast;
}
-}
-class TuiInvalidDayException extends Error {
- constructor(day) {
- super(ngDevMode ? `Invalid day: ${day}` : '');
+ visitStagger(ast, context) {
+ const parentContext = context.parentContext;
+ const tl = context.currentTimeline;
+ const timings = ast.timings;
+ const duration = Math.abs(timings.duration);
+ const maxTime = duration * (context.currentQueryTotal - 1);
+ let delay = duration * context.currentQueryIndex;
+ let staggerTransformer = timings.duration < 0 ? 'reverse' : timings.easing;
+ switch (staggerTransformer) {
+ case 'reverse':
+ delay = maxTime - delay;
+ break;
+ case 'full':
+ delay = parentContext.currentStaggerTime;
+ break;
+ }
+ const timeline = context.currentTimeline;
+ if (delay) {
+ timeline.delayNextStep(delay);
+ }
+ const startingTime = timeline.currentTime;
+ visitDslNode(this, ast.animation, context);
+ context.previousNode = ast;
+ // time = duration + delay
+ // the reason why this computation is so complex is because
+ // the inner timeline may either have a delay value or a stretched
+ // keyframe depending on if a subtimeline is not used or is used.
+ parentContext.currentStaggerTime = tl.currentTime - startingTime + (tl.startTime - parentContext.currentTimeline.startTime);
}
}
-class TuiInvalidMonthException extends Error {
- constructor(month) {
- super(ngDevMode ? `Invalid month: ${month}` : '');
+const DEFAULT_NOOP_PREVIOUS_NODE = {};
+class AnimationTimelineContext {
+ constructor(_driver, element, subInstructions, _enterClassName, _leaveClassName, errors, timelines, initialTimeline) {
+ this._driver = _driver;
+ this.element = element;
+ this.subInstructions = subInstructions;
+ this._enterClassName = _enterClassName;
+ this._leaveClassName = _leaveClassName;
+ this.errors = errors;
+ this.timelines = timelines;
+ this.parentContext = null;
+ this.currentAnimateTimings = null;
+ this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
+ this.subContextCount = 0;
+ this.options = {};
+ this.currentQueryIndex = 0;
+ this.currentQueryTotal = 0;
+ this.currentStaggerTime = 0;
+ this.currentTimeline = initialTimeline || new TimelineBuilder(this._driver, element, 0);
+ timelines.push(this.currentTimeline);
}
-}
-class TuiInvalidYearException extends Error {
- constructor(year) {
- super(ngDevMode ? `Invalid year: ${year}` : '');
+ get params() {
+ return this.options.params;
}
-}
-class TuiNoHostException extends Error {
- constructor() {
- super(ngDevMode ? 'Portals cannot be used without TuiPortalHostComponent' : '');
+ updateOptions(options, skipIfExists) {
+ if (!options) return;
+ const newOptions = options;
+ let optionsToUpdate = this.options;
+ // NOTE: this will get patched up when other animation methods support duration overrides
+ if (newOptions.duration != null) {
+ optionsToUpdate.duration = resolveTimingValue(newOptions.duration);
+ }
+ if (newOptions.delay != null) {
+ optionsToUpdate.delay = resolveTimingValue(newOptions.delay);
+ }
+ const newParams = newOptions.params;
+ if (newParams) {
+ let paramsToUpdate = optionsToUpdate.params;
+ if (!paramsToUpdate) {
+ paramsToUpdate = this.options.params = {};
+ }
+ Object.keys(newParams).forEach(name => {
+ if (!skipIfExists || !paramsToUpdate.hasOwnProperty(name)) {
+ paramsToUpdate[name] = interpolateParams(newParams[name], paramsToUpdate, this.errors);
+ }
+ });
+ }
}
-}
-class TuiOwnerDocumentException extends Error {
- constructor() {
- super(ngDevMode ? 'Element does not have ownerDocument' : '');
+ _copyOptions() {
+ const options = {};
+ if (this.options) {
+ const oldParams = this.options.params;
+ if (oldParams) {
+ const params = options['params'] = {};
+ Object.keys(oldParams).forEach(name => {
+ params[name] = oldParams[name];
+ });
+ }
+ }
+ return options;
}
-}
-class TuiPureException extends Error {
- constructor() {
- super(ngDevMode ? 'tuiPure can only be used with functions or getters' : '');
+ createSubContext(options = null, element, newTime) {
+ const target = element || this.element;
+ const context = new AnimationTimelineContext(this._driver, target, this.subInstructions, this._enterClassName, this._leaveClassName, this.errors, this.timelines, this.currentTimeline.fork(target, newTime || 0));
+ context.previousNode = this.previousNode;
+ context.currentAnimateTimings = this.currentAnimateTimings;
+ context.options = this._copyOptions();
+ context.updateOptions(options);
+ context.currentQueryIndex = this.currentQueryIndex;
+ context.currentQueryTotal = this.currentQueryTotal;
+ context.parentContext = this;
+ this.subContextCount++;
+ return context;
}
-}
-class TuiTableSortKeyException extends Error {
- constructor() {
- super(ngDevMode ? 'Trying to sort with no key' : '');
+ transformIntoNewTimeline(newTime) {
+ this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE;
+ this.currentTimeline = this.currentTimeline.fork(this.element, newTime);
+ this.timelines.push(this.currentTimeline);
+ return this.currentTimeline;
}
-}
-class TuiTsParserException extends Error {
- constructor() {
- super(ngDevMode ? 'TsFileParser: 1 component/module per ts-file' : '');
+ appendInstructionToTimeline(instruction, duration, delay) {
+ const updatedTimings = {
+ duration: duration != null ? duration : instruction.duration,
+ delay: this.currentTimeline.currentTime + (delay != null ? delay : 0) + instruction.delay,
+ easing: ''
+ };
+ const builder = new SubTimelineBuilder(this._driver, instruction.element, instruction.keyframes, instruction.preStyleProps, instruction.postStyleProps, updatedTimings, instruction.stretchStartingKeyframe);
+ this.timelines.push(builder);
+ return updatedTimings;
}
-}
-class TuiValueChangesException extends Error {
- constructor() {
- super(ngDevMode ? 'Control does not have valueChanges' : '');
+ incrementTime(time) {
+ this.currentTimeline.forwardTime(this.currentTimeline.duration + time);
}
-}
-class TuiValuePresentException extends Error {
- constructor() {
- super(ngDevMode ? 'Value must present' : '');
+ delayNextStep(delay) {
+ // negative delays are not yet supported
+ if (delay > 0) {
+ this.currentTimeline.delayNextStep(delay);
+ }
}
-}
-class TuiXmlParsingException extends Error {
- constructor() {
- super(ngDevMode ? 'Error parsing XML string' : '');
+ invokeQuery(selector, originalSelector, limit, includeSelf, optional, errors) {
+ let results = [];
+ if (includeSelf) {
+ results.push(this.element);
+ }
+ if (selector.length > 0) {
+ // only if :self is used then the selector can be empty
+ selector = selector.replace(ENTER_TOKEN_REGEX, '.' + this._enterClassName);
+ selector = selector.replace(LEAVE_TOKEN_REGEX, '.' + this._leaveClassName);
+ const multi = limit != 1;
+ let elements = this._driver.query(this.element, selector, multi);
+ if (limit !== 0) {
+ elements = limit < 0 ? elements.slice(elements.length + limit, elements.length) : elements.slice(0, limit);
+ }
+ results.push(...elements);
+ }
+ if (!optional && results.length == 0) {
+ errors.push(invalidQuery(originalSelector));
+ }
+ return results;
}
}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 2143:
-/*!*************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-observables.js ***!
- \*************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiDragStage: () => (/* binding */ TuiDragStage),
-/* harmony export */ TuiDragState: () => (/* binding */ TuiDragState),
-/* harmony export */ tuiControlValue: () => (/* binding */ tuiControlValue),
-/* harmony export */ tuiDragAndDropFrom: () => (/* binding */ tuiDragAndDropFrom),
-/* harmony export */ tuiFocusVisibleObservable: () => (/* binding */ tuiFocusVisibleObservable),
-/* harmony export */ tuiIfMap: () => (/* binding */ tuiIfMap),
-/* harmony export */ tuiIsAlive: () => (/* binding */ tuiIsAlive),
-/* harmony export */ tuiIsObserved: () => (/* binding */ tuiIsObserved),
-/* harmony export */ tuiItemsQueryListObservable: () => (/* binding */ tuiItemsQueryListObservable),
-/* harmony export */ tuiMouseDragFinishFrom: () => (/* binding */ tuiMouseDragFinishFrom),
-/* harmony export */ tuiMustBePresent: () => (/* binding */ tuiMustBePresent),
-/* harmony export */ tuiPressedObservable: () => (/* binding */ tuiPressedObservable),
-/* harmony export */ tuiPreventDefault: () => (/* binding */ tuiPreventDefault),
-/* harmony export */ tuiQueryListChanges: () => (/* binding */ tuiQueryListChanges),
-/* harmony export */ tuiScrollFrom: () => (/* binding */ tuiScrollFrom),
-/* harmony export */ tuiStopPropagation: () => (/* binding */ tuiStopPropagation),
-/* harmony export */ tuiTypedFromEvent: () => (/* binding */ tuiTypedFromEvent),
-/* harmony export */ tuiWatch: () => (/* binding */ tuiWatch),
-/* harmony export */ tuiZoneOptimized: () => (/* binding */ tuiZoneOptimized),
-/* harmony export */ tuiZonefree: () => (/* binding */ tuiZonefree),
-/* harmony export */ tuiZonefull: () => (/* binding */ tuiZonefull)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/exceptions */ 3447);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 7066);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 6812);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ 2652);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ 5219);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! rxjs */ 523);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 5117);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ 7693);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 2348);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ 2393);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 5840);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 1856);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! rxjs/operators */ 6833);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! rxjs/operators */ 5733);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! rxjs/operators */ 1969);
-/* harmony import */ var _taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 6049);
-/* harmony import */ var _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/cdk/constants */ 5968);
-/* harmony import */ var _taiga_ui_cdk_utils_focus__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @taiga-ui/cdk/utils/focus */ 3573);
-
-
-
-
-
-
-
-
-/**
- * Turns AbstractControl/Abstract-control-directive valueChanges into ReplaySubject(1)
- */
-function tuiControlValue(control) {
- return new rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => {
- if (!control.valueChanges) {
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_1__.TuiValueChangesException();
+class TimelineBuilder {
+ constructor(_driver, element, startTime, _elementTimelineStylesLookup) {
+ this._driver = _driver;
+ this.element = element;
+ this.startTime = startTime;
+ this._elementTimelineStylesLookup = _elementTimelineStylesLookup;
+ this.duration = 0;
+ this.easing = null;
+ this._previousKeyframe = new Map();
+ this._currentKeyframe = new Map();
+ this._keyframes = new Map();
+ this._styleSummary = new Map();
+ this._localTimelineStyles = new Map();
+ this._pendingStyles = new Map();
+ this._backFill = new Map();
+ this._currentEmptyStepKeyframe = null;
+ if (!this._elementTimelineStylesLookup) {
+ this._elementTimelineStylesLookup = new Map();
}
- return control.valueChanges.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.startWith)(control.value)).subscribe(subscriber);
- });
-}
-function tuiTypedFromEvent(target, event, options = {}) {
- /**
- * @note:
- * in RxJS 7 type signature `TuiTypedEventTarget` !== `HasEventTargetAddRemove`
- */
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.fromEvent)(target, event, options);
-}
-
-/**
- * Letting go of the mouse after it was pressed
- * @param target
- */
-function tuiMouseDragFinishFrom(target) {
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.merge)(tuiTypedFromEvent(target, 'mouseup'), tuiTypedFromEvent(target, 'dragend'));
-}
-
-// TODO: change type in v4.0
-// eslint-disable-next-line no-restricted-syntax
-var TuiDragStage;
-(function (TuiDragStage) {
- TuiDragStage[TuiDragStage["Start"] = 0] = "Start";
- TuiDragStage[TuiDragStage["Continues"] = 1] = "Continues";
- TuiDragStage[TuiDragStage["End"] = 2] = "End";
-})(TuiDragStage || (TuiDragStage = {}));
-class TuiDragState {
- constructor(stage, event) {
- this.stage = stage;
- this.event = event;
+ this._globalTimelineStyles = this._elementTimelineStylesLookup.get(element);
+ if (!this._globalTimelineStyles) {
+ this._globalTimelineStyles = this._localTimelineStyles;
+ this._elementTimelineStylesLookup.set(element, this._localTimelineStyles);
+ }
+ this._loadKeyframe();
}
-}
-function tuiDragAndDropFrom(element) {
- const {
- ownerDocument
- } = element;
- if (!ownerDocument) {
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_1__.TuiOwnerDocumentException();
+ containsAnimation() {
+ switch (this._keyframes.size) {
+ case 0:
+ return false;
+ case 1:
+ return this.hasCurrentStyleProperties();
+ default:
+ return true;
+ }
}
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.concat)(tuiTypedFromEvent(element, 'mousedown').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.take)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.map)(event => new TuiDragState(TuiDragStage.Start, event))), (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.merge)(tuiTypedFromEvent(ownerDocument, 'mousemove').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.map)(event => new TuiDragState(TuiDragStage.Continues, event))), tuiMouseDragFinishFrom(ownerDocument).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.take)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.map)(event => new TuiDragState(TuiDragStage.End, event)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.endWith)(null))).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.takeWhile)(_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_10__.tuiIsPresent))).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.repeat)());
-}
-
-/**
- * Operator to set lifespan after which current value is considered obsolete
- */
-function tuiIsAlive(lifespan = 0) {
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_12__.pipe)((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.switchMap)(() => (0,rxjs__WEBPACK_IMPORTED_MODULE_14__.timer)(lifespan).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.map)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_15__.ALWAYS_FALSE_HANDLER), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.startWith)(true))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.distinctUntilChanged)());
-}
-let documentMouseUpIsAlive$;
-let documentMouseDownIsAlive$;
-function tuiFocusVisibleObservable(element) {
- const elementBlur$ = tuiTypedFromEvent(element, 'blur');
- const {
- ownerDocument
- } = element;
- if (!ownerDocument) {
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_1__.TuiOwnerDocumentException();
+ hasCurrentStyleProperties() {
+ return this._currentKeyframe.size > 0;
}
- if (!documentMouseDownIsAlive$ || !documentMouseUpIsAlive$) {
- documentMouseUpIsAlive$ = tuiTypedFromEvent(ownerDocument, 'mouseup', {
- capture: true
- }).pipe(tuiIsAlive(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.startWith)(false), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.shareReplay)({
- bufferSize: 1,
- refCount: true
- }));
- documentMouseDownIsAlive$ = tuiTypedFromEvent(ownerDocument, 'mousedown', {
- capture: true
- }).pipe(tuiIsAlive(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.startWith)(false), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.shareReplay)({
- bufferSize: 1,
- refCount: true
- }));
+ get currentTime() {
+ return this.startTime + this.duration;
}
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.merge)(
- // focus events excluding ones that came right after mouse action
- (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.concat)(tuiTypedFromEvent(element, 'focus').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.take)(1)),
- // filtering out blur events when element remains focused so that we ignore browser tab focus loss
- elementBlur$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.filter)(() => !(0,_taiga_ui_cdk_utils_focus__WEBPACK_IMPORTED_MODULE_19__.tuiIsNativeFocused)(element)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.take)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.ignoreElements)())).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.repeat)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_21__.withLatestFrom)(documentMouseDownIsAlive$, documentMouseUpIsAlive$, (_event, elementActual, documentActual) => elementActual || documentActual), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.filter)(_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_10__.tuiIsFalsy))).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.switchMap)(() => elementBlur$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.map)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_15__.ALWAYS_FALSE_HANDLER), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.take)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.startWith)(true))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.distinctUntilChanged)());
-}
-function tuiIfMap(project, predicate = Boolean) {
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_12__.pipe)((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.switchMap)(value => predicate(value) ? project(value) : rxjs__WEBPACK_IMPORTED_MODULE_22__.EMPTY));
-}
-function tuiIsObserved(observable) {
- var _a, _b;
- return 'observed' in observable ? observable.observed : !!((_b = (_a = observable) === null || _a === void 0 ? void 0 : _a.observers) === null || _b === void 0 ? void 0 : _b.length);
-}
-
-/**
- * Converts changes observable of a QueryList to an Observable of arrays
- */
-function tuiQueryListChanges(queryList) {
- return queryList.changes.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.startWith)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.map)(() => (0,_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_10__.tuiGetOriginalArrayFromQueryList)(queryList)));
-}
-/**
- * @deprecated An alias, use {@link tuiQueryListChanges} instead
- */
-const tuiItemsQueryListObservable = tuiQueryListChanges;
-function tuiMustBePresent() {
- return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.map)(value => {
- if (!(0,_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_10__.tuiIsPresent)(value)) {
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_1__.TuiValuePresentException();
+ delayNextStep(delay) {
+ // in the event that a style() step is placed right before a stagger()
+ // and that style() step is the very first style() value in the animation
+ // then we need to make a copy of the keyframe [0, copy, 1] so that the delay
+ // properly applies the style() values to work with the stagger...
+ const hasPreStyleStep = this._keyframes.size === 1 && this._pendingStyles.size;
+ if (this.duration || hasPreStyleStep) {
+ this.forwardTime(this.currentTime + delay);
+ if (hasPreStyleStep) {
+ this.snapshotCurrentStyles();
+ }
+ } else {
+ this.startTime += delay;
}
- return value;
- });
-}
-function tuiPressedObservable(element, {
- onlyTrusted
-} = {
- onlyTrusted: true
-}) {
- const {
- ownerDocument
- } = element;
- if (!ownerDocument) {
- throw new _taiga_ui_cdk_exceptions__WEBPACK_IMPORTED_MODULE_1__.TuiOwnerDocumentException();
}
- return tuiTypedFromEvent(element, 'mousedown').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.filter)(({
- isTrusted
- }) => isTrusted || !onlyTrusted), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.switchMap)(() => tuiMouseDragFinishFrom(ownerDocument).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.map)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_15__.ALWAYS_FALSE_HANDLER), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.take)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.startWith)(true))));
-}
-function tuiPreventDefault() {
- return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_23__.tap)(event => event.preventDefault());
-}
-
-/**
- * Normalizes scroll event in case element is `html` (document.documentElement)
- */
-function tuiScrollFrom(element) {
- return tuiTypedFromEvent(element === element.ownerDocument.documentElement ? element.ownerDocument : element, 'scroll');
-}
-function tuiStopPropagation() {
- return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_23__.tap)(e => {
- e.stopPropagation();
- });
-}
-function tuiWatch(cdr) {
- return (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_23__.tap)(() => {
- cdr.markForCheck();
- });
-}
-function tuiZonefull(zone) {
- return source => new rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => source.subscribe({
- next: value => zone.run(() => subscriber.next(value)),
- error: error => zone.run(() => subscriber.error(error)),
- complete: () => zone.run(() => subscriber.complete())
- }));
-}
-function tuiZonefree(zone) {
- return source => new rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable(subscriber => zone.runOutsideAngular(() => source.subscribe(subscriber)));
-}
-function tuiZoneOptimized(zone) {
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_12__.pipe)(tuiZonefree(zone), tuiZonefull(zone));
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 4455:
-/*!**************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-pipes-filter.js ***!
- \**************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiFilterPipe: () => (/* binding */ TuiFilterPipe),
-/* harmony export */ TuiFilterPipeModule: () => (/* binding */ TuiFilterPipeModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-
-
-class TuiFilterPipe {
- transform(items, matcher, ...args) {
- return items.filter(item => matcher(item, ...args));
+ fork(element, currentTime) {
+ this.applyStylesToKeyframe();
+ return new TimelineBuilder(this._driver, element, currentTime || this.currentTime, this._elementTimelineStylesLookup);
}
-}
-TuiFilterPipe.ɵfac = function TuiFilterPipe_Factory(t) {
- return new (t || TuiFilterPipe)();
-};
-TuiFilterPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
- name: "tuiFilter",
- type: TuiFilterPipe,
- pure: true
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiFilterPipe, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
- args: [{
- name: 'tuiFilter'
- }]
- }], null, null);
-})();
-class TuiFilterPipeModule {}
-TuiFilterPipeModule.ɵfac = function TuiFilterPipeModule_Factory(t) {
- return new (t || TuiFilterPipeModule)();
-};
-TuiFilterPipeModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiFilterPipeModule
-});
-TuiFilterPipeModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiFilterPipeModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiFilterPipe],
- exports: [TuiFilterPipe]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 2700:
-/*!**************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-pipes-mapper.js ***!
- \**************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiMapperPipe: () => (/* binding */ TuiMapperPipe),
-/* harmony export */ TuiMapperPipeModule: () => (/* binding */ TuiMapperPipeModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-
-
-class TuiMapperPipe {
- transform(value, mapper, ...args) {
- return mapper(value, ...args);
+ _loadKeyframe() {
+ if (this._currentKeyframe) {
+ this._previousKeyframe = this._currentKeyframe;
+ }
+ this._currentKeyframe = this._keyframes.get(this.duration);
+ if (!this._currentKeyframe) {
+ this._currentKeyframe = new Map();
+ this._keyframes.set(this.duration, this._currentKeyframe);
+ }
}
-}
-TuiMapperPipe.ɵfac = function TuiMapperPipe_Factory(t) {
- return new (t || TuiMapperPipe)();
-};
-TuiMapperPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
- name: "tuiMapper",
- type: TuiMapperPipe,
- pure: true
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiMapperPipe, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
- args: [{
- name: 'tuiMapper'
- }]
- }], null, null);
-})();
-class TuiMapperPipeModule {}
-TuiMapperPipeModule.ɵfac = function TuiMapperPipeModule_Factory(t) {
- return new (t || TuiMapperPipeModule)();
-};
-TuiMapperPipeModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiMapperPipeModule
-});
-TuiMapperPipeModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiMapperPipeModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiMapperPipe],
- exports: [TuiMapperPipe]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3197:
-/*!***************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-pipes-replace.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiReplacePipe: () => (/* binding */ TuiReplacePipe),
-/* harmony export */ TuiReplacePipeModule: () => (/* binding */ TuiReplacePipeModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-
-
-class TuiReplacePipe {
- transform(value, search, replaceValue) {
- var _a;
- return (_a = value === null || value === void 0 ? void 0 : value.replace(search,
- // TS bug: https://github.com/microsoft/TypeScript/issues/22378
- replaceValue)) !== null && _a !== void 0 ? _a : '';
+ forwardFrame() {
+ this.duration += ONE_FRAME_IN_MILLISECONDS;
+ this._loadKeyframe();
}
-}
-TuiReplacePipe.ɵfac = function TuiReplacePipe_Factory(t) {
- return new (t || TuiReplacePipe)();
-};
-TuiReplacePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
- name: "tuiReplace",
- type: TuiReplacePipe,
- pure: true
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiReplacePipe, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
- args: [{
- name: 'tuiReplace'
- }]
- }], null, null);
-})();
-class TuiReplacePipeModule {}
-TuiReplacePipeModule.ɵfac = function TuiReplacePipeModule_Factory(t) {
- return new (t || TuiReplacePipeModule)();
-};
-TuiReplacePipeModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiReplacePipeModule
-});
-TuiReplacePipeModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiReplacePipeModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- declarations: [TuiReplacePipe],
- exports: [TuiReplacePipe]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 7609:
-/*!**********************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-services.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiDestroyService: () => (/* binding */ TuiDestroyService),
-/* harmony export */ TuiDirectiveStylesService: () => (/* binding */ TuiDirectiveStylesService),
-/* harmony export */ TuiFocusVisibleService: () => (/* binding */ TuiFocusVisibleService),
-/* harmony export */ TuiIdService: () => (/* binding */ TuiIdService),
-/* harmony export */ TuiObscuredService: () => (/* binding */ TuiObscuredService),
-/* harmony export */ TuiPanService: () => (/* binding */ TuiPanService),
-/* harmony export */ TuiParentsScrollService: () => (/* binding */ TuiParentsScrollService),
-/* harmony export */ TuiResizeService: () => (/* binding */ TuiResizeService),
-/* harmony export */ TuiScrollService: () => (/* binding */ TuiScrollService),
-/* harmony export */ TuiStaticRequestService: () => (/* binding */ TuiStaticRequestService),
-/* harmony export */ TuiSwipeService: () => (/* binding */ TuiSwipeService),
-/* harmony export */ TuiZoomService: () => (/* binding */ TuiZoomService)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 1151);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 8210);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 7066);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! rxjs */ 5219);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! rxjs */ 3496);
-/* harmony import */ var _taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk/observables */ 2143);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 5171);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ 3919);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 1856);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 3246);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! rxjs/operators */ 2393);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! rxjs/operators */ 8713);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! rxjs/operators */ 3396);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! rxjs/operators */ 5603);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! rxjs/operators */ 7693);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! rxjs/operators */ 1969);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! rxjs/operators */ 5840);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! rxjs/operators */ 9155);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk/constants */ 5968);
-/* harmony import */ var _taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/cdk/utils/dom */ 4333);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _ng_web_apis_resize_observer__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @ng-web-apis/resize-observer */ 4138);
-/* harmony import */ var _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @taiga-ui/cdk/classes */ 7589);
-/* harmony import */ var _taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @taiga-ui/cdk/utils/math */ 9291);
-/* harmony import */ var _taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 6049);
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var rxjs_fetch__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! rxjs/fetch */ 1466);
-/* harmony import */ var _taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! @taiga-ui/cdk/tokens */ 1355);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/**
- * @note:
- * Observable abstraction over ngOnDestroy to use with takeUntil
- *
- * Why we use `ReplaySubject` instead of `Subject`?
- * Well, we’ll use ReplaySubject to emit the last message in case
- * the subscription is ended after the component is destroyed.
- */
-class TuiDestroyService extends rxjs__WEBPACK_IMPORTED_MODULE_0__.ReplaySubject {
- constructor() {
- super(1);
+ forwardTime(time) {
+ this.applyStylesToKeyframe();
+ this.duration = time;
+ this._loadKeyframe();
}
- ngOnDestroy() {
- this.next();
+ _updateStyle(prop, value) {
+ this._localTimelineStyles.set(prop, value);
+ this._globalTimelineStyles.set(prop, value);
+ this._styleSummary.set(prop, {
+ time: this.currentTime,
+ value
+ });
}
-}
-TuiDestroyService.ɵfac = function TuiDestroyService_Factory(t) {
- return new (t || TuiDestroyService)();
-};
-TuiDestroyService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiDestroyService,
- factory: TuiDestroyService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiDestroyService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable
- }], function () {
- return [];
- }, null);
-})();
-
-/**
- * Service to use styles with directives
- */
-class TuiDirectiveStylesService {
- constructor(resolver, injector) {
- this.resolver = resolver;
- this.injector = injector;
- this.map = new Map();
+ allowOnlyTimelineStyles() {
+ return this._currentEmptyStepKeyframe !== this._currentKeyframe;
+ }
+ applyEmptyStep(easing) {
+ if (easing) {
+ this._previousKeyframe.set('easing', easing);
+ }
+ // special case for animate(duration):
+ // all missing styles are filled with a `*` value then
+ // if any destination styles are filled in later on the same
+ // keyframe then they will override the overridden styles
+ // We use `_globalTimelineStyles` here because there may be
+ // styles in previous keyframes that are not present in this timeline
+ for (let [prop, value] of this._globalTimelineStyles) {
+ this._backFill.set(prop, value || _angular_animations__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE);
+ this._currentKeyframe.set(prop, _angular_animations__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE);
+ }
+ this._currentEmptyStepKeyframe = this._currentKeyframe;
}
- addComponent(component) {
- if (!this.map.has(component)) {
- this.map.set(component, this.resolver.resolveComponentFactory(component).create(this.injector));
+ setStyles(input, easing, errors, options) {
+ if (easing) {
+ this._previousKeyframe.set('easing', easing);
+ }
+ const params = options && options.params || {};
+ const styles = flattenStyles(input, this._globalTimelineStyles);
+ for (let [prop, value] of styles) {
+ const val = interpolateParams(value, params, errors);
+ this._pendingStyles.set(prop, val);
+ if (!this._localTimelineStyles.has(prop)) {
+ this._backFill.set(prop, this._globalTimelineStyles.get(prop) ?? _angular_animations__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE);
+ }
+ this._updateStyle(prop, val);
}
}
- ngOnDestroy() {
- this.map.forEach(value => value.destroy());
+ applyStylesToKeyframe() {
+ if (this._pendingStyles.size == 0) return;
+ this._pendingStyles.forEach((val, prop) => {
+ this._currentKeyframe.set(prop, val);
+ });
+ this._pendingStyles.clear();
+ this._localTimelineStyles.forEach((val, prop) => {
+ if (!this._currentKeyframe.has(prop)) {
+ this._currentKeyframe.set(prop, val);
+ }
+ });
+ }
+ snapshotCurrentStyles() {
+ for (let [prop, val] of this._localTimelineStyles) {
+ this._pendingStyles.set(prop, val);
+ this._updateStyle(prop, val);
+ }
+ }
+ getFinalKeyframe() {
+ return this._keyframes.get(this.duration);
+ }
+ get properties() {
+ const properties = [];
+ for (let prop in this._currentKeyframe) {
+ properties.push(prop);
+ }
+ return properties;
+ }
+ mergeTimelineCollectedStyles(timeline) {
+ timeline._styleSummary.forEach((details1, prop) => {
+ const details0 = this._styleSummary.get(prop);
+ if (!details0 || details1.time > details0.time) {
+ this._updateStyle(prop, details1.value);
+ }
+ });
+ }
+ buildKeyframes() {
+ this.applyStylesToKeyframe();
+ const preStyleProps = new Set();
+ const postStyleProps = new Set();
+ const isEmpty = this._keyframes.size === 1 && this.duration === 0;
+ let finalKeyframes = [];
+ this._keyframes.forEach((keyframe, time) => {
+ const finalKeyframe = copyStyles(keyframe, new Map(), this._backFill);
+ finalKeyframe.forEach((value, prop) => {
+ if (value === _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵPRE_STYLE"]) {
+ preStyleProps.add(prop);
+ } else if (value === _angular_animations__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE) {
+ postStyleProps.add(prop);
+ }
+ });
+ if (!isEmpty) {
+ finalKeyframe.set('offset', time / this.duration);
+ }
+ finalKeyframes.push(finalKeyframe);
+ });
+ const preProps = preStyleProps.size ? iteratorToArray(preStyleProps.values()) : [];
+ const postProps = postStyleProps.size ? iteratorToArray(postStyleProps.values()) : [];
+ // special case for a 0-second animation (which is designed just to place styles onscreen)
+ if (isEmpty) {
+ const kf0 = finalKeyframes[0];
+ const kf1 = new Map(kf0);
+ kf0.set('offset', 0);
+ kf1.set('offset', 1);
+ finalKeyframes = [kf0, kf1];
+ }
+ return createTimelineInstruction(this.element, finalKeyframes, preProps, postProps, this.duration, this.startTime, this.easing, false);
}
}
-TuiDirectiveStylesService.ɵfac = function TuiDirectiveStylesService_Factory(t) {
- return new (t || TuiDirectiveStylesService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ComponentFactoryResolver), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.INJECTOR));
-};
-TuiDirectiveStylesService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiDirectiveStylesService,
- factory: TuiDirectiveStylesService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiDirectiveStylesService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ComponentFactoryResolver,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ComponentFactoryResolver]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injector,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.INJECTOR]
- }]
- }];
- }, null);
-})();
-
-/**
- * Service to imitate :focus-visible
- * (https://developer.mozilla.org/en-US/docs/Web/CSS/:focus-visible)
- * in browsers that do not support it
- */
-class TuiFocusVisibleService extends rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable {
- constructor({
- nativeElement
- }, cdr, destroy$) {
- super(subscriber => this.focusVisible$.subscribe(subscriber));
- this.focusVisible$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiFocusVisibleObservable)(nativeElement).pipe((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiWatch)(cdr), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.takeUntil)(destroy$));
+class SubTimelineBuilder extends TimelineBuilder {
+ constructor(driver, element, keyframes, preStyleProps, postStyleProps, timings, _stretchStartingKeyframe = false) {
+ super(driver, element, timings.delay);
+ this.keyframes = keyframes;
+ this.preStyleProps = preStyleProps;
+ this.postStyleProps = postStyleProps;
+ this._stretchStartingKeyframe = _stretchStartingKeyframe;
+ this.timings = {
+ duration: timings.duration,
+ delay: timings.delay,
+ easing: timings.easing
+ };
+ }
+ containsAnimation() {
+ return this.keyframes.length > 1;
+ }
+ buildKeyframes() {
+ let keyframes = this.keyframes;
+ let {
+ delay,
+ duration,
+ easing
+ } = this.timings;
+ if (this._stretchStartingKeyframe && delay) {
+ const newKeyframes = [];
+ const totalTime = duration + delay;
+ const startingGap = delay / totalTime;
+ // the original starting keyframe now starts once the delay is done
+ const newFirstKeyframe = copyStyles(keyframes[0]);
+ newFirstKeyframe.set('offset', 0);
+ newKeyframes.push(newFirstKeyframe);
+ const oldFirstKeyframe = copyStyles(keyframes[0]);
+ oldFirstKeyframe.set('offset', roundOffset(startingGap));
+ newKeyframes.push(oldFirstKeyframe);
+ /*
+ When the keyframe is stretched then it means that the delay before the animation
+ starts is gone. Instead the first keyframe is placed at the start of the animation
+ and it is then copied to where it starts when the original delay is over. This basically
+ means nothing animates during that delay, but the styles are still rendered. For this
+ to work the original offset values that exist in the original keyframes must be "warped"
+ so that they can take the new keyframe + delay into account.
+ delay=1000, duration=1000, keyframes = 0 .5 1
+ turns into
+ delay=0, duration=2000, keyframes = 0 .33 .66 1
+ */
+ // offsets between 1 ... n -1 are all warped by the keyframe stretch
+ const limit = keyframes.length - 1;
+ for (let i = 1; i <= limit; i++) {
+ let kf = copyStyles(keyframes[i]);
+ const oldOffset = kf.get('offset');
+ const timeAtKeyframe = delay + oldOffset * duration;
+ kf.set('offset', roundOffset(timeAtKeyframe / totalTime));
+ newKeyframes.push(kf);
+ }
+ // the new starting keyframe should be added at the start
+ duration = totalTime;
+ delay = 0;
+ easing = '';
+ keyframes = newKeyframes;
+ }
+ return createTimelineInstruction(this.element, keyframes, this.preStyleProps, this.postStyleProps, duration, delay, easing, true);
}
}
-TuiFocusVisibleService.ɵfac = function TuiFocusVisibleService_Factory(t) {
- return new (t || TuiFocusVisibleService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](TuiDestroyService, 2));
-};
-TuiFocusVisibleService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiFocusVisibleService,
- factory: TuiFocusVisibleService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiFocusVisibleService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectorRef]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [TuiDestroyService]
- }]
- }];
- }, null);
-})();
-const TUI = 'tui_';
-/**
- * Generates unique ids
- */
-class TuiIdService {
- generate() {
- return `${TUI}${TuiIdService.autoId++}${Date.now()}`;
+function roundOffset(offset, decimalPoints = 3) {
+ const mult = Math.pow(10, decimalPoints - 1);
+ return Math.round(offset * mult) / mult;
+}
+function flattenStyles(input, allStyles) {
+ const styles = new Map();
+ let allProperties;
+ input.forEach(token => {
+ if (token === '*') {
+ allProperties = allProperties || allStyles.keys();
+ for (let prop of allProperties) {
+ styles.set(prop, _angular_animations__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE);
+ }
+ } else {
+ copyStyles(token, styles);
+ }
+ });
+ return styles;
+}
+class Animation {
+ constructor(_driver, input) {
+ this._driver = _driver;
+ const errors = [];
+ const warnings = [];
+ const ast = buildAnimationAst(_driver, input, errors, warnings);
+ if (errors.length) {
+ throw validationFailed(errors);
+ }
+ if (warnings.length) {
+ warnValidation(warnings);
+ }
+ this._animationAst = ast;
+ }
+ buildTimelines(element, startingStyles, destinationStyles, options, subInstructions) {
+ const start = Array.isArray(startingStyles) ? normalizeStyles(startingStyles) : startingStyles;
+ const dest = Array.isArray(destinationStyles) ? normalizeStyles(destinationStyles) : destinationStyles;
+ const errors = [];
+ subInstructions = subInstructions || new ElementInstructionMap();
+ const result = buildAnimationTimelines(this._driver, element, this._animationAst, ENTER_CLASSNAME, LEAVE_CLASSNAME, start, dest, options, subInstructions, errors);
+ if (errors.length) {
+ throw buildingFailed(errors);
+ }
+ return result;
}
}
-TuiIdService.autoId = 0;
-TuiIdService.ɵfac = function TuiIdService_Factory(t) {
- return new (t || TuiIdService)();
-};
-TuiIdService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiIdService,
- factory: TuiIdService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiIdService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], null, null);
-})();
/**
- * Service that subscribes to scroll events of all parent elements
+ * @publicApi
*/
-class TuiParentsScrollService extends rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable {
- constructor(
- // Destructuring here causes memory leak
- el, win) {
- super(subscriber => this.callback$.subscribe(subscriber));
- this.callback$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.defer)(() => {
- let {
- nativeElement
- } = el;
- const eventTargets = [win, nativeElement];
- while (nativeElement.parentElement) {
- nativeElement = nativeElement.parentElement;
- eventTargets.push(nativeElement);
- }
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_6__.merge)(...eventTargets.map(element => (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(element, 'scroll')));
- });
- }
-}
-TuiParentsScrollService.ɵfac = function TuiParentsScrollService_Factory(t) {
- return new (t || TuiParentsScrollService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.WINDOW));
-};
-TuiParentsScrollService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiParentsScrollService,
- factory: TuiParentsScrollService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiParentsScrollService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef]
- }]
- }, {
- type: Window,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.WINDOW]
- }]
- }];
- }, null);
-})();
-
-// @bad TODO: Consider Intersection Observer with fallback to current implementation
+class AnimationStyleNormalizer {}
/**
- * Service that monitors element visibility by subscribing to scrolls
- * and polling with set interval, returns either null or an array
- * of elements that overlap given element edges
+ * @publicApi
*/
-class TuiObscuredService extends rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable {
- constructor(parentsScroll$, {
- nativeElement
- }, zone, win, destroy$, animationFrame$) {
- super(subscriber => this.obscured$.subscribe(subscriber));
- this.obscured$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_6__.merge)(
- // delay is added so it will not interfere with other listeners
- (0,rxjs__WEBPACK_IMPORTED_MODULE_6__.merge)(parentsScroll$, (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.fromEvent)(win, 'resize')).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.delay)(0)), animationFrame$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.throttleTime)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_11__.POLLING_TIME))).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(() => (0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_13__.tuiGetElementObscures)(nativeElement)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.startWith)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.distinctUntilChanged)(), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiZoneOptimized)(zone), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.takeUntil)(destroy$));
+class NoopAnimationStyleNormalizer {
+ normalizePropertyName(propertyName, errors) {
+ return propertyName;
+ }
+ normalizeStyleValue(userProvidedProperty, normalizedProperty, value, errors) {
+ return value;
}
}
-TuiObscuredService.ɵfac = function TuiObscuredService_Factory(t) {
- return new (t || TuiObscuredService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](TuiParentsScrollService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.WINDOW), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.ANIMATION_FRAME));
-};
-TuiObscuredService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiObscuredService,
- factory: TuiObscuredService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiObscuredService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable
- }], function () {
- return [{
- type: TuiParentsScrollService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [TuiParentsScrollService]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Self
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone]
- }]
- }, {
- type: Window,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.WINDOW]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [TuiDestroyService]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.ANIMATION_FRAME]
- }]
- }];
- }, null);
-})();
-class TuiPanService extends rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable {
- constructor({
- nativeElement
- }, doc) {
- super(subscriber => {
- (0,rxjs__WEBPACK_IMPORTED_MODULE_6__.merge)((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(nativeElement, 'touchstart', {
- passive: true
- }), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(nativeElement, 'mousedown')).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.switchMap)(() => (0,rxjs__WEBPACK_IMPORTED_MODULE_6__.merge)((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(doc, 'touchmove', {
- passive: true
- }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.filter)(({
- touches
- }) => touches.length < 2), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(({
- touches
- }) => touches[0])), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(doc, 'mousemove'))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.pairwise)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(([first, second]) => {
- const deltaX = second.clientX - first.clientX;
- const deltaY = second.clientY - first.clientY;
- return [deltaX, deltaY];
- }),
- // eslint-disable-next-line rxjs/no-unsafe-takeuntil
- (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.takeUntil)((0,rxjs__WEBPACK_IMPORTED_MODULE_6__.merge)((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(doc, 'touchend'), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(doc, 'mouseup'))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_19__.repeat)()).subscribe(subscriber);
- });
+const DIMENSIONAL_PROP_SET = new Set(['width', 'height', 'minWidth', 'minHeight', 'maxWidth', 'maxHeight', 'left', 'top', 'bottom', 'right', 'fontSize', 'outlineWidth', 'outlineOffset', 'paddingTop', 'paddingLeft', 'paddingBottom', 'paddingRight', 'marginTop', 'marginLeft', 'marginBottom', 'marginRight', 'borderRadius', 'borderWidth', 'borderTopWidth', 'borderLeftWidth', 'borderRightWidth', 'borderBottomWidth', 'textIndent', 'perspective']);
+class WebAnimationsStyleNormalizer extends AnimationStyleNormalizer {
+ normalizePropertyName(propertyName, errors) {
+ return dashCaseToCamelCase(propertyName);
+ }
+ normalizeStyleValue(userProvidedProperty, normalizedProperty, value, errors) {
+ let unit = '';
+ const strVal = value.toString().trim();
+ if (DIMENSIONAL_PROP_SET.has(normalizedProperty) && value !== 0 && value !== '0') {
+ if (typeof value === 'number') {
+ unit = 'px';
+ } else {
+ const valAndSuffixMatch = value.match(/^[+-]?[\d\.]+([a-z]*)$/);
+ if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) {
+ errors.push(invalidCssUnitValue(userProvidedProperty, value));
+ }
+ }
+ }
+ return strVal + unit;
}
}
-TuiPanService.ɵfac = function TuiPanService_Factory(t) {
- return new (t || TuiPanService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_20__.DOCUMENT));
-};
-TuiPanService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiPanService,
- factory: TuiPanService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiPanService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef]
- }]
- }, {
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_20__.DOCUMENT]
- }]
- }];
- }, null);
-})();
-
-// TODO: Remove in 4.0 when Safari is bumped to 13
-class TuiResizeService extends _ng_web_apis_resize_observer__WEBPACK_IMPORTED_MODULE_21__.ResizeObserverService {
- constructor(el, zone, destroy$, support, box, animationFrame$) {
- super(el, zone, support, box);
- return this.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_22__.catchError)(() =>
- /**
- * @note: if not supported ResizeObserver
- * remove `catchError` after supports modern browsers
- */
- animationFrame$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.throttleTime)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_11__.POLLING_TIME), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(() => `${el.nativeElement.clientWidth} ${el.nativeElement.clientHeight}`), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.distinctUntilChanged)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(() => _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_11__.EMPTY_ARRAY))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_23__.debounceTime)(0), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiZonefree)(zone), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_24__.share)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.takeUntil)(destroy$));
- }
-}
-TuiResizeService.ɵfac = function TuiResizeService_Factory(t) {
- return new (t || TuiResizeService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_ng_web_apis_resize_observer__WEBPACK_IMPORTED_MODULE_21__.RESIZE_OBSERVER_SUPPORT), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_ng_web_apis_resize_observer__WEBPACK_IMPORTED_MODULE_21__.RESIZE_OPTION_BOX), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.ANIMATION_FRAME));
-};
-TuiResizeService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiResizeService,
- factory: TuiResizeService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiResizeService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [TuiDestroyService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_ng_web_apis_resize_observer__WEBPACK_IMPORTED_MODULE_21__.RESIZE_OBSERVER_SUPPORT]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_ng_web_apis_resize_observer__WEBPACK_IMPORTED_MODULE_21__.RESIZE_OPTION_BOX]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.ANIMATION_FRAME]
- }]
- }];
- }, null);
-})();
-const SCROLL_TIME = 300;
-function getX(elementOrWindow) {
- return 'scrollX' in elementOrWindow ? elementOrWindow.scrollX : elementOrWindow.scrollLeft;
-}
-function getY(elementOrWindow) {
- return 'scrollY' in elementOrWindow ? elementOrWindow.scrollY : elementOrWindow.scrollTop;
+function createTransitionInstruction(element, triggerName, fromState, toState, isRemovalTransition, fromStyles, toStyles, timelines, queriedElements, preStyleProps, postStyleProps, totalTime, errors) {
+ return {
+ type: 0 /* AnimationTransitionInstructionType.TransitionAnimation */,
+ element,
+ triggerName,
+ isRemovalTransition,
+ fromState,
+ fromStyles,
+ toState,
+ toStyles,
+ timelines,
+ queriedElements,
+ preStyleProps,
+ postStyleProps,
+ totalTime,
+ errors
+ };
}
-class TuiScrollService {
- constructor(performanceRef, animationFrame$) {
- this.performanceRef = performanceRef;
- this.animationFrame$ = animationFrame$;
+const EMPTY_OBJECT = {};
+class AnimationTransitionFactory {
+ constructor(_triggerName, ast, _stateStyles) {
+ this._triggerName = _triggerName;
+ this.ast = ast;
+ this._stateStyles = _stateStyles;
}
- scroll$(elementOrWindow, scrollTop, scrollLeft = getX(elementOrWindow), duration = SCROLL_TIME) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_25__.tuiAssert.assert(duration >= 0, 'Duration cannot be negative');
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_25__.tuiAssert.assert(scrollTop >= 0, 'scrollTop cannot be negative');
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_25__.tuiAssert.assert(scrollLeft >= 0, 'scrollLeft cannot be negative');
- const initialTop = getY(elementOrWindow);
- const initialLeft = getX(elementOrWindow);
- const deltaTop = scrollTop - initialTop;
- const deltaLeft = scrollLeft - initialLeft;
- const observable = !duration ? (0,rxjs__WEBPACK_IMPORTED_MODULE_26__.of)([scrollTop, scrollLeft]) : (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.defer)(() => (0,rxjs__WEBPACK_IMPORTED_MODULE_26__.of)(this.performanceRef.now())).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.switchMap)(start => this.animationFrame$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(now => now - start))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(elapsed => (0,_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_27__.tuiEaseInOutQuad)((0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_28__.tuiClamp)(elapsed / duration, 0, 1))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(percent => [initialTop + deltaTop * percent, initialLeft + deltaLeft * percent]), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.takeUntil)((0,rxjs__WEBPACK_IMPORTED_MODULE_29__.timer)(duration)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_30__.endWith)([scrollTop, scrollLeft]));
- return observable.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_31__.tap)(([scrollTop, scrollLeft]) => {
- var _a;
- (_a = elementOrWindow.scrollTo) === null || _a === void 0 ? void 0 : _a.call(elementOrWindow, scrollLeft, scrollTop);
- }));
+ match(currentState, nextState, element, params) {
+ return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState, element, params);
}
-}
-TuiScrollService.ɵfac = function TuiScrollService_Factory(t) {
- return new (t || TuiScrollService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.PERFORMANCE), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.ANIMATION_FRAME));
-};
-TuiScrollService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiScrollService,
- factory: TuiScrollService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiScrollService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: Performance,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.PERFORMANCE]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.ANIMATION_FRAME]
- }]
- }];
- }, null);
-})();
-class TuiStaticRequestService {
- constructor(win, platformId) {
- this.win = win;
- this.platformId = platformId;
- this.cache = new Map();
+ buildStyles(stateName, params, errors) {
+ let styler = this._stateStyles.get('*');
+ if (stateName !== undefined) {
+ styler = this._stateStyles.get(stateName?.toString()) || styler;
+ }
+ return styler ? styler.buildStyles(params, errors) : new Map();
}
- request(url) {
- const cache = this.cache.get(url);
- if (cache) {
- return cache;
+ build(driver, element, currentState, nextState, enterClassName, leaveClassName, currentOptions, nextOptions, subInstructions, skipAstBuild) {
+ const errors = [];
+ const transitionAnimationParams = this.ast.options && this.ast.options.params || EMPTY_OBJECT;
+ const currentAnimationParams = currentOptions && currentOptions.params || EMPTY_OBJECT;
+ const currentStateStyles = this.buildStyles(currentState, currentAnimationParams, errors);
+ const nextAnimationParams = nextOptions && nextOptions.params || EMPTY_OBJECT;
+ const nextStateStyles = this.buildStyles(nextState, nextAnimationParams, errors);
+ const queriedElements = new Set();
+ const preStyleMap = new Map();
+ const postStyleMap = new Map();
+ const isRemoval = nextState === 'void';
+ const animationOptions = {
+ params: applyParamDefaults(nextAnimationParams, transitionAnimationParams),
+ delay: this.ast.options?.delay
+ };
+ const timelines = skipAstBuild ? [] : buildAnimationTimelines(driver, element, this.ast.animation, enterClassName, leaveClassName, currentStateStyles, nextStateStyles, animationOptions, subInstructions, errors);
+ let totalTime = 0;
+ timelines.forEach(tl => {
+ totalTime = Math.max(tl.duration + tl.delay, totalTime);
+ });
+ if (errors.length) {
+ return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, [], [], preStyleMap, postStyleMap, totalTime, errors);
}
- const response$ = 'AbortController' in this.win || (0,_angular_common__WEBPACK_IMPORTED_MODULE_20__.isPlatformServer)(this.platformId) ? (0,rxjs_fetch__WEBPACK_IMPORTED_MODULE_32__.fromFetch)(url) :
- /**
- * Fallback for Firefox 55 and 56
- * TODO: drop after browser support bump
- */
- (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.defer)(() => (0,rxjs__WEBPACK_IMPORTED_MODULE_33__.from)(fetch(url)));
- const piped = response$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.switchMap)(response => (0,tslib__WEBPACK_IMPORTED_MODULE_34__.__awaiter)(this, void 0, void 0, function* () {
- if (response.ok) {
- return response.text();
+ timelines.forEach(tl => {
+ const elm = tl.element;
+ const preProps = getOrSetDefaultValue(preStyleMap, elm, new Set());
+ tl.preStyleProps.forEach(prop => preProps.add(prop));
+ const postProps = getOrSetDefaultValue(postStyleMap, elm, new Set());
+ tl.postStyleProps.forEach(prop => postProps.add(prop));
+ if (elm !== element) {
+ queriedElements.add(elm);
}
- throw new Error(`Failed to load ${url} (${response.statusText})`);
- })), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_35__.shareReplay)({
- bufferSize: 1,
- refCount: false
- }));
- this.cache.set(url, piped);
- return piped;
+ });
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
+ checkNonAnimatableInTimelines(timelines, this._triggerName, driver);
+ }
+ const queriedElementsList = iteratorToArray(queriedElements.values());
+ return createTransitionInstruction(element, this._triggerName, currentState, nextState, isRemoval, currentStateStyles, nextStateStyles, timelines, queriedElementsList, preStyleMap, postStyleMap, totalTime);
}
}
-TuiStaticRequestService.ɵfac = function TuiStaticRequestService_Factory(t) {
- return new (t || TuiStaticRequestService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.WINDOW), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.PLATFORM_ID));
-};
-TuiStaticRequestService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiStaticRequestService,
- factory: TuiStaticRequestService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiStaticRequestService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: Window,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.WINDOW]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.PLATFORM_ID]
- }]
- }];
- }, null);
-})();
-class TuiSwipeService extends rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable {
- constructor({
- nativeElement
- }, {
- timeout,
- threshold
- }, doc) {
- super(subscriber => {
- (0,rxjs__WEBPACK_IMPORTED_MODULE_6__.merge)((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(nativeElement, 'touchstart', {
- passive: true
- }), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(doc, 'touchend')).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.pairwise)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.filter)(([first, second]) => !!first.touches.length && first.touches[0].identifier === second.changedTouches[0].identifier), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(([start, end]) => {
- const startX = start.touches[0].clientX;
- const startY = start.touches[0].clientY;
- const endX = end.changedTouches[0].clientX;
- const endY = end.changedTouches[0].clientY;
- const distanceX = startX - endX;
- const distanceY = startY - endY;
- const duration = end.timeStamp - start.timeStamp;
- if ((Math.abs(distanceX) > threshold || Math.abs(distanceY) > threshold) && duration < timeout) {
- return {
- direction: (0,_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_27__.tuiGetSwipeDirection)(distanceX, distanceY),
- events: [start, end]
- };
+/**
+ * Checks inside a set of timelines if they try to animate a css property which is not considered
+ * animatable, in that case it prints a warning on the console.
+ * Besides that the function doesn't have any other effect.
+ *
+ * Note: this check is done here after the timelines are built instead of doing on a lower level so
+ * that we can make sure that the warning appears only once per instruction (we can aggregate here
+ * all the issues instead of finding them separately).
+ *
+ * @param timelines The built timelines for the current instruction.
+ * @param triggerName The name of the trigger for the current instruction.
+ * @param driver Animation driver used to perform the check.
+ *
+ */
+function checkNonAnimatableInTimelines(timelines, triggerName, driver) {
+ if (!driver.validateAnimatableStyleProperty) {
+ return;
+ }
+ const allowedNonAnimatableProps = new Set([
+ // 'easing' is a utility/synthetic prop we use to represent
+ // easing functions, it represents a property of the animation
+ // which is not animatable but different values can be used
+ // in different steps
+ 'easing']);
+ const invalidNonAnimatableProps = new Set();
+ timelines.forEach(({
+ keyframes
+ }) => {
+ const nonAnimatablePropsInitialValues = new Map();
+ keyframes.forEach(keyframe => {
+ const entriesToCheck = Array.from(keyframe.entries()).filter(([prop]) => !allowedNonAnimatableProps.has(prop));
+ for (const [prop, value] of entriesToCheck) {
+ if (!driver.validateAnimatableStyleProperty(prop)) {
+ if (nonAnimatablePropsInitialValues.has(prop) && !invalidNonAnimatableProps.has(prop)) {
+ const propInitialValue = nonAnimatablePropsInitialValues.get(prop);
+ if (propInitialValue !== value) {
+ invalidNonAnimatableProps.add(prop);
+ }
+ } else {
+ nonAnimatablePropsInitialValues.set(prop, value);
+ }
}
- return null;
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.filter)(_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_27__.tuiIsPresent)).subscribe(subscriber);
+ }
});
+ });
+ if (invalidNonAnimatableProps.size > 0) {
+ console.warn(`Warning: The animation trigger "${triggerName}" is attempting to animate the following` + ' not animatable properties: ' + Array.from(invalidNonAnimatableProps).join(', ') + '\n' + '(to check the list of all animatable properties visit https://developer.mozilla.org/en-US/docs/Web/CSS/CSS_animated_properties)');
}
}
-TuiSwipeService.ɵfac = function TuiSwipeService_Factory(t) {
- return new (t || TuiSwipeService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_36__.TUI_SWIPE_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_20__.DOCUMENT));
-};
-TuiSwipeService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiSwipeService,
- factory: TuiSwipeService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiSwipeService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_36__.TUI_SWIPE_OPTIONS]
- }]
- }, {
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_20__.DOCUMENT]
- }]
- }];
- }, null);
-})();
-const TOUCH_SENSITIVITY = 0.01;
-class TuiZoomService extends rxjs__WEBPACK_IMPORTED_MODULE_2__.Observable {
- constructor({
- nativeElement
- }, {
- wheelSensitivity
- }) {
- super(subscriber => {
- (0,rxjs__WEBPACK_IMPORTED_MODULE_6__.merge)((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(nativeElement, 'touchstart', {
- passive: true
- }).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.filter)(({
- touches
- }) => touches.length > 1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.switchMap)(startEvent => (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(nativeElement, 'touchmove', {
- passive: true
- }).pipe((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiPreventDefault)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_37__.scan)((prev, event) => {
- const distance = (0,_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_27__.tuiDistanceBetweenTouches)(event);
- return {
- event,
- distance,
- delta: (distance - prev.distance) * TOUCH_SENSITIVITY
- };
- }, {
- event: startEvent,
- distance: (0,_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_27__.tuiDistanceBetweenTouches)(startEvent),
- delta: 0
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(({
- event,
- delta
- }) => {
- const clientX = (event.touches[0].clientX + event.touches[1].clientX) / 2;
- const clientY = (event.touches[0].clientY + event.touches[1].clientY) / 2;
- return {
- clientX,
- clientY,
- delta,
- event
- };
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.takeUntil)((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(nativeElement, 'touchend'))))), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiTypedFromEvent)(nativeElement, 'wheel', {
- passive: false
- }).pipe((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_3__.tuiPreventDefault)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(wheel => ({
- clientX: wheel.clientX,
- clientY: wheel.clientY,
- delta: -wheel.deltaY * wheelSensitivity,
- event: wheel
- })))).subscribe(subscriber);
+function oneOrMoreTransitionsMatch(matchFns, currentState, nextState, element, params) {
+ return matchFns.some(fn => fn(currentState, nextState, element, params));
+}
+function applyParamDefaults(userParams, defaults) {
+ const result = copyObj(defaults);
+ for (const key in userParams) {
+ if (userParams.hasOwnProperty(key) && userParams[key] != null) {
+ result[key] = userParams[key];
+ }
+ }
+ return result;
+}
+class AnimationStateStyles {
+ constructor(styles, defaultParams, normalizer) {
+ this.styles = styles;
+ this.defaultParams = defaultParams;
+ this.normalizer = normalizer;
+ }
+ buildStyles(params, errors) {
+ const finalStyles = new Map();
+ const combinedParams = copyObj(this.defaultParams);
+ Object.keys(params).forEach(key => {
+ const value = params[key];
+ if (value !== null) {
+ combinedParams[key] = value;
+ }
+ });
+ this.styles.styles.forEach(value => {
+ if (typeof value !== 'string') {
+ value.forEach((val, prop) => {
+ if (val) {
+ val = interpolateParams(val, combinedParams, errors);
+ }
+ const normalizedProp = this.normalizer.normalizePropertyName(prop, errors);
+ val = this.normalizer.normalizeStyleValue(prop, normalizedProp, val, errors);
+ finalStyles.set(prop, val);
+ });
+ }
});
+ return finalStyles;
}
}
-TuiZoomService.ɵfac = function TuiZoomService_Factory(t) {
- return new (t || TuiZoomService)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵinject"](_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_36__.TUI_ZOOM_OPTIONS));
-};
-TuiZoomService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjectable"]({
- token: TuiZoomService,
- factory: TuiZoomService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiZoomService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Injectable
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_cdk_tokens__WEBPACK_IMPORTED_MODULE_36__.TUI_ZOOM_OPTIONS]
- }]
- }];
- }, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 1355:
-/*!********************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-tokens.js ***!
- \********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_ACTIVE_ELEMENT: () => (/* binding */ TUI_ACTIVE_ELEMENT),
-/* harmony export */ TUI_ALERTS: () => (/* binding */ TUI_ALERTS),
-/* harmony export */ TUI_BASE_HREF: () => (/* binding */ TUI_BASE_HREF),
-/* harmony export */ TUI_DEFAULT_RENDERER: () => (/* binding */ TUI_DEFAULT_RENDERER),
-/* harmony export */ TUI_DIALOGS: () => (/* binding */ TUI_DIALOGS),
-/* harmony export */ TUI_ENSURE_BASE_HREF: () => (/* binding */ TUI_ENSURE_BASE_HREF),
-/* harmony export */ TUI_FOCUSABLE_ITEM_ACCESSOR: () => (/* binding */ TUI_FOCUSABLE_ITEM_ACCESSOR),
-/* harmony export */ TUI_FONTS_READY: () => (/* binding */ TUI_FONTS_READY),
-/* harmony export */ TUI_IS_ANDROID: () => (/* binding */ TUI_IS_ANDROID),
-/* harmony export */ TUI_IS_APPLE: () => (/* binding */ TUI_IS_APPLE),
-/* harmony export */ TUI_IS_CHROMIUM: () => (/* binding */ TUI_IS_CHROMIUM),
-/* harmony export */ TUI_IS_CYPRESS: () => (/* binding */ TUI_IS_CYPRESS),
-/* harmony export */ TUI_IS_E2E: () => (/* binding */ TUI_IS_E2E),
-/* harmony export */ TUI_IS_FIREFOX: () => (/* binding */ TUI_IS_FIREFOX),
-/* harmony export */ TUI_IS_IOS: () => (/* binding */ TUI_IS_IOS),
-/* harmony export */ TUI_IS_MOBILE: () => (/* binding */ TUI_IS_MOBILE),
-/* harmony export */ TUI_IS_PLAYWRIGHT: () => (/* binding */ TUI_IS_PLAYWRIGHT),
-/* harmony export */ TUI_IS_STACKBLITZ: () => (/* binding */ TUI_IS_STACKBLITZ),
-/* harmony export */ TUI_IS_TOUCH: () => (/* binding */ TUI_IS_TOUCH),
-/* harmony export */ TUI_IS_WEBKIT: () => (/* binding */ TUI_IS_WEBKIT),
-/* harmony export */ TUI_PLATFORM: () => (/* binding */ TUI_PLATFORM),
-/* harmony export */ TUI_RANGE: () => (/* binding */ TUI_RANGE),
-/* harmony export */ TUI_REMOVED_ELEMENT: () => (/* binding */ TUI_REMOVED_ELEMENT),
-/* harmony export */ TUI_SCROLL_REF: () => (/* binding */ TUI_SCROLL_REF),
-/* harmony export */ TUI_SWIPE_OPTIONS: () => (/* binding */ TUI_SWIPE_OPTIONS),
-/* harmony export */ TUI_TAKE_ONLY_TRUSTED_EVENTS: () => (/* binding */ TUI_TAKE_ONLY_TRUSTED_EVENTS),
-/* harmony export */ TUI_TOUCH_SUPPORTED: () => (/* binding */ TUI_TOUCH_SUPPORTED),
-/* harmony export */ TUI_WINDOW_HEIGHT: () => (/* binding */ TUI_WINDOW_HEIGHT),
-/* harmony export */ TUI_WINDOW_SIZE: () => (/* binding */ TUI_WINDOW_SIZE),
-/* harmony export */ TUI_ZOOM_OPTIONS: () => (/* binding */ TUI_ZOOM_OPTIONS),
-/* harmony export */ tuiAsAlerts: () => (/* binding */ tuiAsAlerts),
-/* harmony export */ tuiAsDialog: () => (/* binding */ tuiAsDialog),
-/* harmony export */ tuiAsFocusableItemAccessor: () => (/* binding */ tuiAsFocusableItemAccessor),
-/* harmony export */ tuiPlatformFactory: () => (/* binding */ tuiPlatformFactory)
-/* harmony export */ });
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @taiga-ui/cdk/observables */ 2143);
-/* harmony import */ var _taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/utils/miscellaneous */ 6049);
-/* harmony import */ var _taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 4333);
-/* harmony import */ var _taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 3573);
-/* harmony import */ var _taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @taiga-ui/cdk/utils */ 6343);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 5536);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 5219);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! rxjs */ 3496);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! rxjs */ 523);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ 5603);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ 1856);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 6689);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 5733);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! rxjs/operators */ 5117);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! rxjs/operators */ 5840);
-/* harmony import */ var _angular_animations_browser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/animations/browser */ 9306);
-/* harmony import */ var _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @taiga-ui/cdk/constants */ 5968);
-
-
-
-
-
-
-
-
-
-
-
-/**
- * Element currently being removed by AnimationEngine
- */
-const TUI_REMOVED_ELEMENT = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- const stub = {
- onRemovalComplete: () => {}
- };
- const element$ = new rxjs__WEBPACK_IMPORTED_MODULE_1__.BehaviorSubject(null);
- const engine = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_animations_browser__WEBPACK_IMPORTED_MODULE_3__["ɵAnimationEngine"], _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectFlags.Optional) || stub;
- const {
- onRemovalComplete = stub.onRemovalComplete
- } = engine;
- engine.onRemovalComplete = (element, context) => {
- element$.next(element);
- onRemovalComplete.call(engine, element, context);
- };
- return element$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.switchMap)(element => (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.timer)(0).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(() => null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.startWith)(element))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.share)());
-});
-
-// Checks if focusout event should be considered leaving active zone
-function isValidFocusout(target, removedElement = null) {
- return (
- // Not due to switching tabs/going to DevTools
- (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_9__.tuiGetDocumentOrShadowRoot)(target).activeElement !== target &&
- // Not due to button/input becoming disabled or under disabled fieldset
- !target.matches(':disabled') &&
- // Not due to element being removed from DOM
- !(removedElement === null || removedElement === void 0 ? void 0 : removedElement.contains(target)) &&
- // Not due to scrollable element became non-scrollable
- (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_10__.tuiIsNativeMouseFocusable)(target)
- );
+function buildTrigger(name, ast, normalizer) {
+ return new AnimationTrigger(name, ast, normalizer);
}
-function shadowRootActiveElement(root) {
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.merge)((0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_12__.tuiTypedFromEvent)(root, 'focusin').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(({
- target
- }) => target)), (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_12__.tuiTypedFromEvent)(root, 'focusout').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.filter)(({
- target,
- relatedTarget
- }) => !!relatedTarget && isValidFocusout(target)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(({
- relatedTarget
- }) => relatedTarget)));
+class AnimationTrigger {
+ constructor(name, ast, _normalizer) {
+ this.name = name;
+ this.ast = ast;
+ this._normalizer = _normalizer;
+ this.transitionFactories = [];
+ this.states = new Map();
+ ast.states.forEach(ast => {
+ const defaultParams = ast.options && ast.options.params || {};
+ this.states.set(ast.name, new AnimationStateStyles(ast.style, defaultParams, _normalizer));
+ });
+ balanceProperties(this.states, 'true', '1');
+ balanceProperties(this.states, 'false', '0');
+ ast.transitions.forEach(ast => {
+ this.transitionFactories.push(new AnimationTransitionFactory(name, ast, this.states));
+ });
+ this.fallbackTransition = createFallbackTransition(name, this.states, this._normalizer);
+ }
+ get containsQueries() {
+ return this.ast.queryCount > 0;
+ }
+ matchTransition(currentState, nextState, element, params) {
+ const entry = this.transitionFactories.find(f => f.match(currentState, nextState, element, params));
+ return entry || null;
+ }
+ matchStyles(currentState, params, errors) {
+ return this.fallbackTransition.buildStyles(currentState, params, errors);
+ }
}
-/**
- * Active element on the document for ActiveZone
- */
-const TUI_ACTIVE_ELEMENT = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- const removedElement$ = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(TUI_REMOVED_ELEMENT);
- const win = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.WINDOW);
- const doc = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_15__.DOCUMENT);
- const focusout$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_12__.tuiTypedFromEvent)(win, 'focusout');
- const focusin$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_12__.tuiTypedFromEvent)(win, 'focusin');
- const blur$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_12__.tuiTypedFromEvent)(win, 'blur');
- const mousedown$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_12__.tuiTypedFromEvent)(win, 'mousedown');
- const mouseup$ = (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_12__.tuiTypedFromEvent)(win, 'mouseup');
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.merge)(focusout$.pipe(
- // eslint-disable-next-line rxjs/no-unsafe-takeuntil
- (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.takeUntil)(mousedown$),
- /**
- * TODO: replace to
- * repeat({delay: () => mouseup$})
- * in RxJS 7
- */
- // eslint-disable-next-line rxjs/no-ignored-notifier
- (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.repeatWhen)(() => mouseup$), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.withLatestFrom)(removedElement$), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.filter)(([event, removedElement]) => isValidFocusout((0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_9__.tuiGetActualTarget)(event), removedElement)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(([{
- relatedTarget
- }]) => relatedTarget)), blur$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(() => doc.activeElement), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.filter)(element => !!(element === null || element === void 0 ? void 0 : element.matches('iframe')))), focusin$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.switchMap)(event => {
- const target = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_9__.tuiGetActualTarget)(event);
- const root = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_9__.tuiGetDocumentOrShadowRoot)(target);
- return root === doc ? (0,rxjs__WEBPACK_IMPORTED_MODULE_19__.of)(target) : shadowRootActiveElement(root).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.startWith)(target));
- })), mousedown$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.switchMap)(event => {
- const actualTargetInCurrentTime = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_9__.tuiGetActualTarget)(event);
- return !doc.activeElement || doc.activeElement === doc.body ? (0,rxjs__WEBPACK_IMPORTED_MODULE_19__.of)(actualTargetInCurrentTime) : focusout$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_20__.take)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(
- /**
- * Do not use `map(() => tuiGetActualTarget(event))`
- * because we have different result in runtime
- */
- () => actualTargetInCurrentTime), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.takeUntil)((0,rxjs__WEBPACK_IMPORTED_MODULE_5__.timer)(0)));
- }))).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_21__.distinctUntilChanged)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.share)());
-});
-
-/**
- * A stream of alerts
- */
-const TUI_ALERTS = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)([]);
-function tuiAsAlerts(useExisting) {
- return {
- provide: TUI_ALERTS,
- multi: true,
- useExisting
+function createFallbackTransition(triggerName, states, normalizer) {
+ const matchers = [(fromState, toState) => true];
+ const animation = {
+ type: 2 /* AnimationMetadataType.Sequence */,
+ steps: [],
+ options: null
};
-}
-const TUI_BASE_HREF = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- var _a, _b;
- return (_b = (_a = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_15__.DOCUMENT).querySelector('base')) === null || _a === void 0 ? void 0 : _a.href) !== null && _b !== void 0 ? _b : '';
-});
-
-/**
- * A Renderer2 for global services
- * https://github.com/angular/angular/issues/17824#issuecomment-353239017
- * @deprecated unnecessary
- * TODO: remove in 4.0
- */
-const TUI_DEFAULT_RENDERER = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(
-// @ts-ignore
-() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.RendererFactory2).createRenderer(null, null));
-
-/**
- * A stream of dialogs
- */
-const TUI_DIALOGS = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)([]);
-// TODO: Refactor dialogs in 4.0 so there is no need for module imports
-function tuiAsDialog(useExisting) {
- return {
- provide: TUI_DIALOGS,
- multi: true,
- useExisting
+ const transition = {
+ type: 1 /* AnimationMetadataType.Transition */,
+ animation,
+ matchers,
+ options: null,
+ queryCount: 0,
+ depCount: 0
};
+ return new AnimationTransitionFactory(triggerName, transition, states);
}
-
-/**
- * @deprecated: use {@link TUI_BASE_HREF}
- */
-const TUI_ENSURE_BASE_HREF = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- var _a;
- const baseHref = (_a = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_15__.DOCUMENT).querySelector('base')) === null || _a === void 0 ? void 0 : _a.href;
- if (baseHref) {
- return baseHref;
+function balanceProperties(stateMap, key1, key2) {
+ if (stateMap.has(key1)) {
+ if (!stateMap.has(key2)) {
+ stateMap.set(key2, stateMap.get(key1));
+ }
+ } else if (stateMap.has(key2)) {
+ stateMap.set(key1, stateMap.get(key2));
}
- const link = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_15__.DOCUMENT).createElement('a');
- link.href = '';
- return link.pathname;
-});
-
-/**
- * A component that can be focused
- */
-const TUI_FOCUSABLE_ITEM_ACCESSOR = new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken('[TUI_FOCUSABLE_ITEM_ACCESSOR]');
-function tuiAsFocusableItemAccessor(useExisting) {
- return {
- provide: TUI_FOCUSABLE_ITEM_ACCESSOR,
- useExisting
- };
}
-const TUI_FONTS_READY = new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken('[TUI_FONTS_READY]', {
- factory: () => {
- var _a;
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_22__.from)(((_a = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_15__.DOCUMENT).fonts) === null || _a === void 0 ? void 0 : _a.ready) || rxjs__WEBPACK_IMPORTED_MODULE_23__.EMPTY).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_24__.shareReplay)({
- bufferSize: 1,
- refCount: false
- }));
+const EMPTY_INSTRUCTION_MAP = new ElementInstructionMap();
+class TimelineAnimationEngine {
+ constructor(bodyNode, _driver, _normalizer) {
+ this.bodyNode = bodyNode;
+ this._driver = _driver;
+ this._normalizer = _normalizer;
+ this._animations = new Map();
+ this._playersById = new Map();
+ this.players = [];
}
-});
-
-/**
- * iOS browser detection
- */
-const TUI_IS_IOS = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_25__.tuiIsIos)((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.NAVIGATOR)));
-
-// https://stackoverflow.com/a/11381730/2706426 http://detectmobilebrowsers.com/
-const firstRegex = /(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino/;
-const secondRegex = /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/;
-/**
- * Mobile browser detection
- */
-const TUI_IS_MOBILE = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => firstRegex.test((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.USER_AGENT).toLowerCase()) || secondRegex.test((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.USER_AGENT).slice(0, 4).toLowerCase()));
-
-/**
- * Mobile browser that is not iOS (technically includes Windows Phone, Blackberry etc.)
- */
-const TUI_IS_ANDROID = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(TUI_IS_MOBILE) && !(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(TUI_IS_IOS));
-
-/**
- * Apple(safari/webkit) detection
- */
-const TUI_IS_APPLE = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_25__.tuiIsApple)((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.NAVIGATOR)));
-
-/**
- * Chromium browser engine detection
- */
-const TUI_IS_CHROMIUM = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => !!(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.WINDOW).chrome);
-
-/**
- * Detect if app is running under Cypress
- * {@link https://docs.cypress.io/faq/questions/using-cypress-faq#Is-there-any-way-to-detect-if-my-app-is-running-under-Cypress Cypress docs}
- */
-const TUI_IS_CYPRESS = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => !!(0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.WINDOW).Cypress);
-
-/**
- * Detect if app is running under Playwright
- */
-const TUI_IS_PLAYWRIGHT = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_26__.ALWAYS_FALSE_HANDLER);
-
-/**
- * Detect if app is running under any of test frameworks
- */
-const TUI_IS_E2E = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(TUI_IS_CYPRESS) || (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(TUI_IS_PLAYWRIGHT));
-
-/**
- * Firefox browser engine detection
- */
-const TUI_IS_FIREFOX = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- var _a;
- return typeof ((_a = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.WINDOW)) === null || _a === void 0 ? void 0 : _a.mozCancelFullScreen) !== 'undefined';
-});
-const TUI_IS_STACKBLITZ = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.WINDOW).location.host.endsWith('stackblitz.io'));
-const TUI_IS_TOUCH = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.WINDOW).matchMedia('(pointer: coarse)').matches);
-
-/**
- * Webkit browser engine detection
- */
-const TUI_IS_WEBKIT = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- var _a;
- return !!((_a = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.WINDOW)) === null || _a === void 0 ? void 0 : _a.webkitConvertPointFromNodeToPage);
-});
-
-// TODO: Switch to factory in 4.0
-const TUI_PLATFORM = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)('web');
-function tuiPlatformFactory() {
- if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(TUI_IS_IOS)) {
- return 'ios';
+ register(id, metadata) {
+ const errors = [];
+ const warnings = [];
+ const ast = buildAnimationAst(this._driver, metadata, errors, warnings);
+ if (errors.length) {
+ throw registerFailed(errors);
+ } else {
+ if (warnings.length) {
+ warnRegister(warnings);
+ }
+ this._animations.set(id, ast);
+ }
}
- if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(TUI_IS_ANDROID)) {
- return 'android';
+ _buildPlayer(i, preStyles, postStyles) {
+ const element = i.element;
+ const keyframes = normalizeKeyframes$1(this._normalizer, i.keyframes, preStyles, postStyles);
+ return this._driver.animate(element, keyframes, i.duration, i.delay, i.easing, [], true);
}
- return 'web';
-}
-
-/**
- * SSR safe default empty Range
- */
-const TUI_RANGE = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_angular_common__WEBPACK_IMPORTED_MODULE_15__.isPlatformBrowser)((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_2__.PLATFORM_ID)) ? new Range() : {});
-
-/**
- * Scrollable container
- */
-const TUI_SCROLL_REF = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new _angular_core__WEBPACK_IMPORTED_MODULE_2__.ElementRef((0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_15__.DOCUMENT).documentElement));
-
-/**
- * Swipe options
- */
-const TUI_SWIPE_OPTIONS = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)({
- timeout: 500,
- threshold: 30
-});
-
-/**
- * @description:
- * The isTrusted read-only property of the Event interface is a boolean value that is true
- * when the event was generated by a user action, and false when the event was created or
- * modified by a script or dispatched via EventTarget.dispatchEvent().
- */
-const TUI_TAKE_ONLY_TRUSTED_EVENTS = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(_taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_26__.ALWAYS_TRUE_HANDLER);
-const TUI_TOUCH_SUPPORTED = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.WINDOW).matchMedia('(any-pointer: coarse)').matches);
-const TUI_WINDOW_SIZE = new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken('[TUI_WINDOW_SIZE]', {
- factory: () => {
- const w = (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_14__.WINDOW);
- return (0,_taiga_ui_cdk_observables__WEBPACK_IMPORTED_MODULE_12__.tuiTypedFromEvent)(w, 'resize').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.startWith)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(() => {
- var _a, _b;
- const width = Math.max(w.document.documentElement.clientWidth || 0, w.innerWidth || 0, ((_a = w.visualViewport) === null || _a === void 0 ? void 0 : _a.width) || 0);
- const height = Math.max(w.document.documentElement.clientHeight || 0, w.innerHeight || 0, ((_b = w.visualViewport) === null || _b === void 0 ? void 0 : _b.height) || 0);
- return {
- width,
- height,
- top: 0,
- left: 0,
- right: width,
- bottom: height
- };
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_24__.shareReplay)({
- bufferSize: 1,
- refCount: true
- }));
+ create(id, element, options = {}) {
+ const errors = [];
+ const ast = this._animations.get(id);
+ let instructions;
+ const autoStylesMap = new Map();
+ if (ast) {
+ instructions = buildAnimationTimelines(this._driver, element, ast, ENTER_CLASSNAME, LEAVE_CLASSNAME, new Map(), new Map(), options, EMPTY_INSTRUCTION_MAP, errors);
+ instructions.forEach(inst => {
+ const styles = getOrSetDefaultValue(autoStylesMap, inst.element, new Map());
+ inst.postStyleProps.forEach(prop => styles.set(prop, null));
+ });
+ } else {
+ errors.push(missingOrDestroyedAnimation());
+ instructions = [];
+ }
+ if (errors.length) {
+ throw createAnimationFailed(errors);
+ }
+ autoStylesMap.forEach((styles, element) => {
+ styles.forEach((_, prop) => {
+ styles.set(prop, this._driver.computeStyle(element, prop, _angular_animations__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE));
+ });
+ });
+ const players = instructions.map(i => {
+ const styles = autoStylesMap.get(i.element);
+ return this._buildPlayer(i, new Map(), styles);
+ });
+ const player = optimizeGroupPlayer(players);
+ this._playersById.set(id, player);
+ player.onDestroy(() => this.destroy(id));
+ this.players.push(player);
+ return player;
}
-});
-
-/**
- * @deprecated Use {@link TUI_WINDOW_SIZE} instead
- */
-const TUI_WINDOW_HEIGHT = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.inject)(TUI_WINDOW_SIZE).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(({
- height
-}) => height)));
-
-/**
- * Zoom options
- */
-const TUI_ZOOM_OPTIONS = (0,_taiga_ui_cdk_utils__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)({
- wheelSensitivity: 0.01
-});
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 8645:
-/*!***************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-utils-browser.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiIsEdge: () => (/* binding */ tuiIsEdge),
-/* harmony export */ tuiIsEdgeOlderThan: () => (/* binding */ tuiIsEdgeOlderThan),
-/* harmony export */ tuiIsFirefox: () => (/* binding */ tuiIsFirefox),
-/* harmony export */ tuiIsSafari: () => (/* binding */ tuiIsSafari)
-/* harmony export */ });
-function tuiIsEdge(userAgent) {
- return userAgent.toLowerCase().includes('edge');
-}
-const EDGE = 'edge/';
-function tuiIsEdgeOlderThan(version, userAgent) {
- const currentVersion = parseInt(userAgent.slice(userAgent.toLowerCase().indexOf(EDGE) + EDGE.length), 10);
- return currentVersion < version;
-}
-function tuiIsFirefox(userAgent) {
- return userAgent.toLowerCase().includes('firefox');
-}
-function tuiIsSafari({
- ownerDocument: doc
-}) {
- var _a, _b, _c, _d, _e, _f, _g, _h;
- const win = doc === null || doc === void 0 ? void 0 : doc.defaultView;
- const isMacOsSafari = typeof win.safari !== 'undefined' && ((_b = (_a = win.safari) === null || _a === void 0 ? void 0 : _a.pushNotification) === null || _b === void 0 ? void 0 : _b.toString()) === '[object SafariRemoteNotification]';
- const isIosSafari = !!((_d = (_c = win.navigator) === null || _c === void 0 ? void 0 : _c.vendor) === null || _d === void 0 ? void 0 : _d.includes('Apple')) && !((_f = (_e = win.navigator) === null || _e === void 0 ? void 0 : _e.userAgent) === null || _f === void 0 ? void 0 : _f.includes('CriOS')) && !((_h = (_g = win.navigator) === null || _g === void 0 ? void 0 : _g.userAgent) === null || _h === void 0 ? void 0 : _h.includes('FxiOS'));
- return isMacOsSafari || isIosSafari;
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 9226:
-/*!*************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-utils-color.js ***!
- \*************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiHexToRGBA: () => (/* binding */ tuiHexToRGBA),
-/* harmony export */ tuiHexToRgb: () => (/* binding */ tuiHexToRgb),
-/* harmony export */ tuiHsvToRgb: () => (/* binding */ tuiHsvToRgb),
-/* harmony export */ tuiIsValidHex: () => (/* binding */ tuiIsValidHex),
-/* harmony export */ tuiIsValidRgba: () => (/* binding */ tuiIsValidRgba),
-/* harmony export */ tuiParseColor: () => (/* binding */ tuiParseColor),
-/* harmony export */ tuiParseHex: () => (/* binding */ tuiParseHex),
-/* harmony export */ tuiRgbToHex: () => (/* binding */ tuiRgbToHex),
-/* harmony export */ tuiRgbToHsv: () => (/* binding */ tuiRgbToHsv),
-/* harmony export */ tuiRgbaToHex: () => (/* binding */ tuiRgbaToHex)
-/* harmony export */ });
-function tuiHexToRgb(hex) {
- const matches = hex.replace('#', '').split('').map((char, _, array) => array.length === 3 ? char + char : char).join('').match(/.{2}/g);
- return matches ? matches.map(x => Number.parseInt(x, 16)) : [0, 0, 0];
-}
-const getChunksFromString = (hex, chunkSize) => hex.match(new RegExp(`.{${chunkSize}}`, 'g'));
-const convertHexUnitTo256 = hexStr => parseInt(hexStr.repeat(2 / hexStr.length), 16);
-const getAlphaFloat = (a, alpha) => {
- if (typeof a !== 'undefined') {
- return Number((a / 255).toFixed(2));
+ destroy(id) {
+ const player = this._getPlayer(id);
+ player.destroy();
+ this._playersById.delete(id);
+ const index = this.players.indexOf(player);
+ if (index >= 0) {
+ this.players.splice(index, 1);
+ }
}
- if (typeof alpha !== 'number' || alpha < 0 || alpha > 1) {
- return 1;
+ _getPlayer(id) {
+ const player = this._playersById.get(id);
+ if (!player) {
+ throw missingPlayer(id);
+ }
+ return player;
}
- return alpha;
-};
-function tuiHexToRGBA(hex, alpha) {
- const [r, g, b, a] = tuiParseHex(hex, alpha);
- return a < 1 ? `rgba(${r}, ${g}, ${b}, ${a})` : `rgb(${r}, ${g}, ${b})`;
-}
-function tuiIsValidHex(hex) {
- // eslint-disable-next-line unicorn/no-unsafe-regex
- return /^#([A-Fa-f0-9]{3,4}){1,2}$/.test(hex);
-}
-function tuiParseHex(hex, alpha) {
- var _a;
- if (!tuiIsValidHex(hex)) {
- throw new Error('Invalid HEX');
+ listen(id, element, eventName, callback) {
+ // triggerName, fromState, toState are all ignored for timeline animations
+ const baseEvent = makeAnimationEvent(element, '', '', '');
+ listenOnPlayer(this._getPlayer(id), eventName, baseEvent, callback);
+ return () => {};
+ }
+ command(id, element, command, args) {
+ if (command == 'register') {
+ this.register(id, args[0]);
+ return;
+ }
+ if (command == 'create') {
+ const options = args[0] || {};
+ this.create(id, element, options);
+ return;
+ }
+ const player = this._getPlayer(id);
+ switch (command) {
+ case 'play':
+ player.play();
+ break;
+ case 'pause':
+ player.pause();
+ break;
+ case 'reset':
+ player.reset();
+ break;
+ case 'restart':
+ player.restart();
+ break;
+ case 'finish':
+ player.finish();
+ break;
+ case 'init':
+ player.init();
+ break;
+ case 'setPosition':
+ player.setPosition(parseFloat(args[0]));
+ break;
+ case 'destroy':
+ this.destroy(id);
+ break;
+ }
}
- const chunkSize = Math.floor((hex.length - 1) / 3);
- const hexArr = getChunksFromString(hex.slice(1), chunkSize);
- const [r, g, b, a] = (_a = hexArr === null || hexArr === void 0 ? void 0 : hexArr.map(convertHexUnitTo256)) !== null && _a !== void 0 ? _a : [];
- const floatAlpha = getAlphaFloat(a, alpha);
- return [r, g, b, floatAlpha];
-}
-function hsvToColor(h, s, v, n) {
- const k = (n + h / 60) % 6;
- return Math.round(v - v * s * Math.max(Math.min(k, 4 - k, 1), 0));
-}
-/**
- * https://stackoverflow.com/a/54024653/2706426
- */
-function tuiHsvToRgb(h, s, v) {
- return [hsvToColor(h, s, v, 5), hsvToColor(h, s, v, 3), hsvToColor(h, s, v, 1)];
}
-const DEFAULT = [0, 0, 0, 1];
-function tuiParseColor(color) {
- const stripped = color.replace('#', '').replace('rgba(', '').replace('rgb(', '').replace(')', '');
- const array = stripped.split(',').map(item => parseFloat(item));
- if (array.length === 4) {
- return array;
+const QUEUED_CLASSNAME = 'ng-animate-queued';
+const QUEUED_SELECTOR = '.ng-animate-queued';
+const DISABLED_CLASSNAME = 'ng-animate-disabled';
+const DISABLED_SELECTOR = '.ng-animate-disabled';
+const STAR_CLASSNAME = 'ng-star-inserted';
+const STAR_SELECTOR = '.ng-star-inserted';
+const EMPTY_PLAYER_ARRAY = [];
+const NULL_REMOVAL_STATE = {
+ namespaceId: '',
+ setForRemoval: false,
+ setForMove: false,
+ hasAnimation: false,
+ removedBeforeQueried: false
+};
+const NULL_REMOVED_QUERIED_STATE = {
+ namespaceId: '',
+ setForMove: false,
+ setForRemoval: false,
+ hasAnimation: false,
+ removedBeforeQueried: true
+};
+const REMOVAL_FLAG = '__ng_removed';
+class StateValue {
+ get params() {
+ return this.options.params;
}
- if (array.length === 3) {
- return array.concat(1);
+ constructor(input, namespaceId = '') {
+ this.namespaceId = namespaceId;
+ const isObj = input && input.hasOwnProperty('value');
+ const value = isObj ? input['value'] : input;
+ this.value = normalizeTriggerValue(value);
+ if (isObj) {
+ const options = copyObj(input);
+ delete options['value'];
+ this.options = options;
+ } else {
+ this.options = {};
+ }
+ if (!this.options.params) {
+ this.options.params = {};
+ }
}
- const matches = stripped.match(new RegExp(`(.{${stripped.length / 3}})`, 'g'));
- if (!matches) {
- return DEFAULT;
+ absorbOptions(options) {
+ const newParams = options.params;
+ if (newParams) {
+ const oldParams = this.options.params;
+ Object.keys(newParams).forEach(prop => {
+ if (oldParams[prop] == null) {
+ oldParams[prop] = newParams[prop];
+ }
+ });
+ }
}
- const parsed = matches.map(char => parseInt(stripped.length % 2 ? char + char : char, 16));
- return [parsed[0] || DEFAULT[0], parsed[1] || DEFAULT[1], parsed[2] || DEFAULT[2], parsed[3] === undefined ? DEFAULT[3] : parsed[3]];
-}
-function tuiRgbToHex(r, g, b) {
- return `#${[r, g, b].map(x => x.toString(16).padStart(2, '0')).join('')}`;
-}
-function tuiRgbToHsv(r, g, b) {
- const v = Math.max(r, g, b);
- const n = v - Math.min(r, g, b);
- // eslint-disable-next-line no-nested-ternary
- const h = n && (v === r ? (g - b) / n : v === g ? 2 + (b - r) / n : 4 + (r - g) / n);
- return [60 * (h < 0 ? h + 6 : h), v && n / v, v];
}
-function tuiRgbaToHex(color) {
- var _a, _b;
- if (!tuiIsValidRgba(color)) {
- throw new Error('Invalid RGBa');
+const VOID_VALUE = 'void';
+const DEFAULT_STATE_VALUE = new StateValue(VOID_VALUE);
+class AnimationTransitionNamespace {
+ constructor(id, hostElement, _engine) {
+ this.id = id;
+ this.hostElement = hostElement;
+ this._engine = _engine;
+ this.players = [];
+ this._triggers = new Map();
+ this._queue = [];
+ this._elementListeners = new Map();
+ this._hostClassName = 'ng-tns-' + id;
+ addClass(hostElement, this._hostClassName);
}
- const rgb = (_a = color.replace(/\s/g, '')
- // eslint-disable-next-line unicorn/no-unsafe-regex
- .match(/^rgba?\((\d+),(\d+),(\d+),?([^,\s)]+)?/i)) !== null && _a !== void 0 ? _a : [];
- let alpha = ((_b = rgb === null || rgb === void 0 ? void 0 : rgb[4]) !== null && _b !== void 0 ? _b : '').toString().trim();
- let hex = rgb ? (rgb[1] | 1 << 8).toString(16).slice(1) + (rgb[2] | 1 << 8).toString(16).slice(1) + (rgb[3] | 1 << 8).toString(16).slice(1) : color;
- alpha = alpha !== '' ? alpha : 0o1;
- alpha = (Number(alpha) * 255 | 1 << 8).toString(16).slice(1);
- hex += alpha;
- return `#${hex.toUpperCase()}`;
-}
-function tuiIsValidRgba(rgba) {
- const range = '(\\d|[1-9]\\d|1\\d{2}|2[0-4]\\d|2[0-5]{2})';
- const alpha = '([01]|0?\\.\\d+)';
- return new RegExp(`^(?:rgb\\(\\s*${range}\\s*,\\s*${range}\\s*,\\s*${range}\\s*\\)|rgba\\(\\s*${range}\\s*,\\s*${range}\\s*,\\s*${range}\\s*,\\s*${alpha}\\s*\\))$`).test(rgba);
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 4333:
-/*!***********************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-utils-dom.js ***!
- \***********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiCanScroll: () => (/* binding */ tuiCanScroll),
-/* harmony export */ tuiContainsOrAfter: () => (/* binding */ tuiContainsOrAfter),
-/* harmony export */ tuiGetActualTarget: () => (/* binding */ tuiGetActualTarget),
-/* harmony export */ tuiGetClipboardDataText: () => (/* binding */ tuiGetClipboardDataText),
-/* harmony export */ tuiGetDocumentOrShadowRoot: () => (/* binding */ tuiGetDocumentOrShadowRoot),
-/* harmony export */ tuiGetElementObscures: () => (/* binding */ tuiGetElementObscures),
-/* harmony export */ tuiGetElementOffset: () => (/* binding */ tuiGetElementOffset),
-/* harmony export */ tuiGetScrollParent: () => (/* binding */ tuiGetScrollParent),
-/* harmony export */ tuiGetSelectedText: () => (/* binding */ tuiGetSelectedText),
-/* harmony export */ tuiIsCurrentTarget: () => (/* binding */ tuiIsCurrentTarget),
-/* harmony export */ tuiIsElement: () => (/* binding */ tuiIsElement),
-/* harmony export */ tuiIsElementEditable: () => (/* binding */ tuiIsElementEditable),
-/* harmony export */ tuiIsHTMLElement: () => (/* binding */ tuiIsHTMLElement),
-/* harmony export */ tuiIsInput: () => (/* binding */ tuiIsInput),
-/* harmony export */ tuiIsInsideIframe: () => (/* binding */ tuiIsInsideIframe),
-/* harmony export */ tuiIsNodeIn: () => (/* binding */ tuiIsNodeIn),
-/* harmony export */ tuiIsTextNode: () => (/* binding */ tuiIsTextNode),
-/* harmony export */ tuiIsTextarea: () => (/* binding */ tuiIsTextarea),
-/* harmony export */ tuiIsTextfield: () => (/* binding */ tuiIsTextfield),
-/* harmony export */ tuiPointToClientRect: () => (/* binding */ tuiPointToClientRect),
-/* harmony export */ tuiRetargetedBoundaryCrossing: () => (/* binding */ tuiRetargetedBoundaryCrossing)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/utils/math */ 9291);
-/* harmony import */ var _taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/utils/miscellaneous */ 6049);
-/* harmony import */ var _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk/classes */ 7589);
-
-
-
-function canScrollVertical(element, rootElement, scrollEnd) {
- let currentElement = element;
- while (currentElement !== rootElement.parentElement) {
- if (Math.floor(currentElement.scrollTop) > 0 && !scrollEnd || Math.ceil(currentElement.scrollTop + currentElement.clientHeight) < currentElement.scrollHeight && scrollEnd) {
- return true;
+ listen(element, name, phase, callback) {
+ if (!this._triggers.has(name)) {
+ throw missingTrigger(phase, name);
}
- if (currentElement.parentElement) {
- currentElement = currentElement.parentElement;
- } else {
- return false;
+ if (phase == null || phase.length == 0) {
+ throw missingEvent(name);
}
- }
- return false;
-}
-function canScrollHorizontal(element, rootElement, scrollEnd) {
- let currentElement = element;
- while (currentElement !== rootElement.parentElement) {
- if (Math.floor(currentElement.scrollLeft) > 0 && !scrollEnd || Math.ceil(currentElement.scrollLeft + currentElement.clientWidth) < currentElement.scrollWidth && scrollEnd) {
- return true;
+ if (!isTriggerEventValid(phase)) {
+ throw unsupportedTriggerEvent(phase, name);
}
- if (currentElement.parentElement) {
- currentElement = currentElement.parentElement;
- } else {
+ const listeners = getOrSetDefaultValue(this._elementListeners, element, []);
+ const data = {
+ name,
+ phase,
+ callback
+ };
+ listeners.push(data);
+ const triggersWithStates = getOrSetDefaultValue(this._engine.statesByElement, element, new Map());
+ if (!triggersWithStates.has(name)) {
+ addClass(element, NG_TRIGGER_CLASSNAME);
+ addClass(element, NG_TRIGGER_CLASSNAME + '-' + name);
+ triggersWithStates.set(name, DEFAULT_STATE_VALUE);
+ }
+ return () => {
+ // the event listener is removed AFTER the flush has occurred such
+ // that leave animations callbacks can fire (otherwise if the node
+ // is removed in between then the listeners would be deregistered)
+ this._engine.afterFlush(() => {
+ const index = listeners.indexOf(data);
+ if (index >= 0) {
+ listeners.splice(index, 1);
+ }
+ if (!this._triggers.has(name)) {
+ triggersWithStates.delete(name);
+ }
+ });
+ };
+ }
+ register(name, ast) {
+ if (this._triggers.has(name)) {
+ // throw
return false;
+ } else {
+ this._triggers.set(name, ast);
+ return true;
}
}
- return false;
-}
-function tuiCanScroll(element, rootElement, vertical, scrollEnd) {
- return vertical ? canScrollVertical(element, rootElement, scrollEnd) : canScrollHorizontal(element, rootElement, scrollEnd);
-}
-function tuiContainsOrAfter(current, node) {
- try {
- return current.contains(node) || !!(node.compareDocumentPosition(current) & Node.DOCUMENT_POSITION_PRECEDING);
- } catch (_a) {
- return false;
+ _getTrigger(name) {
+ const trigger = this._triggers.get(name);
+ if (!trigger) {
+ throw unregisteredTrigger(name);
+ }
+ return trigger;
}
-}
-function tuiIsInput(element) {
- return element.matches('input');
-}
-function tuiIsTextarea(element) {
- return element.matches('textarea');
-}
-function tuiIsTextfield(element) {
- return tuiIsInput(element) || tuiIsTextarea(element);
-}
-function tuiIsElement(node) {
- return !!node && 'nodeType' in node && node.nodeType === Node.ELEMENT_NODE;
-}
-function tuiIsHTMLElement(node) {
- return !!node && node instanceof node.ownerDocument.defaultView.HTMLElement;
-}
-function tuiIsTextNode(node) {
- return node.nodeType === Node.TEXT_NODE;
-}
-
-/**
- * Gets actual target from open Shadow DOM if event happened within it
- */
-function tuiGetActualTarget(event) {
- return event.composedPath()[0];
-}
-const DEFAULT_FORMAT = 'text/plain';
-/**
- * Gets text from data of clipboardEvent, it also works in IE and Edge browsers
- */
-function tuiGetClipboardDataText(event, format = DEFAULT_FORMAT) {
- return 'clipboardData' in event && event.clipboardData !== null ? event.clipboardData.getData(format) || event.clipboardData.getData(DEFAULT_FORMAT) : event.target.ownerDocument.defaultView.clipboardData.getData('text');
-}
-function tuiGetDocumentOrShadowRoot(node) {
- return 'getRootNode' in node && node.isConnected ? node.getRootNode() : node.ownerDocument;
-}
-
-/**
- * Returns array of Elements covering edges of given element or null if at least one edge middle point is visible
- *
- * CAUTION: Empty array means element if offscreen i.e. covered by no elements, rather than not covered
- * TODO: v4.0 change function signature to
- * ```ts
- * function tuiGetElementObscures(element: Element): readonly [Element, Element, Element, Element] | [] | null
- * ```
- */
-function tuiGetElementObscures(element) {
- const {
- ownerDocument
- } = element;
- if (!(ownerDocument === null || ownerDocument === void 0 ? void 0 : ownerDocument.defaultView) || !element.getBoundingClientRect) {
- return null;
- }
- const {
- innerWidth,
- innerHeight
- } = ownerDocument.defaultView;
- const doc = tuiGetDocumentOrShadowRoot(element);
- const rect = element.getBoundingClientRect();
- if (rect.width === 0 && rect.height === 0) {
- return null;
- }
- const left = (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_0__.tuiClamp)(Math.round(rect.left) + 2, 0, innerWidth);
- const top = (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_0__.tuiClamp)(Math.round(rect.top) + 2, 0, innerHeight);
- const right = (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_0__.tuiClamp)(Math.round(rect.right) - 2, 0, innerWidth);
- const bottom = (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_0__.tuiClamp)(Math.round(rect.bottom) - 2, 0, innerHeight);
- const horizontalMiddle = (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_0__.tuiClamp)(Math.round(rect.left + rect.width / 2), 0, innerWidth);
- const verticalMiddle = (0,_taiga_ui_cdk_utils_math__WEBPACK_IMPORTED_MODULE_0__.tuiClamp)(Math.round(rect.top + rect.height / 2), 0, innerHeight);
- const elements = [doc.elementFromPoint(horizontalMiddle, top), doc.elementFromPoint(horizontalMiddle, bottom), doc.elementFromPoint(left, verticalMiddle), doc.elementFromPoint(right, verticalMiddle)];
- const nonNull = elements.filter(_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_1__.tuiIsPresent);
- if (!nonNull.length) {
- return nonNull;
- }
- const filtered = nonNull.filter(el => !element.contains(el) && !el.contains(element));
- return filtered.length === 4 ? filtered : null;
-}
-
-/**
- * Calculates offset for an element relative to it's parent several levels above
- *
- * @param host parent element
- * @param element
- * @return object with offsetTop and offsetLeft number properties
- */
-function tuiGetElementOffset(host, element) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_2__.tuiAssert.assert(host.contains(element), 'Host must contain element');
- let {
- offsetTop,
- offsetLeft,
- offsetParent
- } = element;
- while (tuiIsHTMLElement(offsetParent) && offsetParent !== host) {
- offsetTop += offsetParent.offsetTop;
- offsetLeft += offsetParent.offsetLeft;
- offsetParent = offsetParent.offsetParent;
+ trigger(element, triggerName, value, defaultToFallback = true) {
+ const trigger = this._getTrigger(triggerName);
+ const player = new TransitionAnimationPlayer(this.id, triggerName, element);
+ let triggersWithStates = this._engine.statesByElement.get(element);
+ if (!triggersWithStates) {
+ addClass(element, NG_TRIGGER_CLASSNAME);
+ addClass(element, NG_TRIGGER_CLASSNAME + '-' + triggerName);
+ this._engine.statesByElement.set(element, triggersWithStates = new Map());
+ }
+ let fromState = triggersWithStates.get(triggerName);
+ const toState = new StateValue(value, this.id);
+ const isObj = value && value.hasOwnProperty('value');
+ if (!isObj && fromState) {
+ toState.absorbOptions(fromState.options);
+ }
+ triggersWithStates.set(triggerName, toState);
+ if (!fromState) {
+ fromState = DEFAULT_STATE_VALUE;
+ }
+ const isRemoval = toState.value === VOID_VALUE;
+ // normally this isn't reached by here, however, if an object expression
+ // is passed in then it may be a new object each time. Comparing the value
+ // is important since that will stay the same despite there being a new object.
+ // The removal arc here is special cased because the same element is triggered
+ // twice in the event that it contains animations on the outer/inner portions
+ // of the host container
+ if (!isRemoval && fromState.value === toState.value) {
+ // this means that despite the value not changing, some inner params
+ // have changed which means that the animation final styles need to be applied
+ if (!objEquals(fromState.params, toState.params)) {
+ const errors = [];
+ const fromStyles = trigger.matchStyles(fromState.value, fromState.params, errors);
+ const toStyles = trigger.matchStyles(toState.value, toState.params, errors);
+ if (errors.length) {
+ this._engine.reportError(errors);
+ } else {
+ this._engine.afterFlush(() => {
+ eraseStyles(element, fromStyles);
+ setStyles(element, toStyles);
+ });
+ }
+ }
+ return;
+ }
+ const playersOnElement = getOrSetDefaultValue(this._engine.playersByElement, element, []);
+ playersOnElement.forEach(player => {
+ // only remove the player if it is queued on the EXACT same trigger/namespace
+ // we only also deal with queued players here because if the animation has
+ // started then we want to keep the player alive until the flush happens
+ // (which is where the previousPlayers are passed into the new player)
+ if (player.namespaceId == this.id && player.triggerName == triggerName && player.queued) {
+ player.destroy();
+ }
+ });
+ let transition = trigger.matchTransition(fromState.value, toState.value, element, toState.params);
+ let isFallbackTransition = false;
+ if (!transition) {
+ if (!defaultToFallback) return;
+ transition = trigger.fallbackTransition;
+ isFallbackTransition = true;
+ }
+ this._engine.totalQueuedPlayers++;
+ this._queue.push({
+ element,
+ triggerName,
+ transition,
+ fromState,
+ toState,
+ player,
+ isFallbackTransition
+ });
+ if (!isFallbackTransition) {
+ addClass(element, QUEUED_CLASSNAME);
+ player.onStart(() => {
+ removeClass(element, QUEUED_CLASSNAME);
+ });
+ }
+ player.onDone(() => {
+ let index = this.players.indexOf(player);
+ if (index >= 0) {
+ this.players.splice(index, 1);
+ }
+ const players = this._engine.playersByElement.get(element);
+ if (players) {
+ let index = players.indexOf(player);
+ if (index >= 0) {
+ players.splice(index, 1);
+ }
+ }
+ });
+ this.players.push(player);
+ playersOnElement.push(player);
+ return player;
}
- return {
- offsetTop,
- offsetLeft
- };
-}
-
-/**
- * Finds the nearest parent with scroll in it
- *
- * @param element initial element
- * @param vertical flag for orientation of scroll
- */
-function tuiGetScrollParent(element, vertical = true) {
- if (element === null) {
- return null;
+ deregister(name) {
+ this._triggers.delete(name);
+ this._engine.statesByElement.forEach(stateMap => stateMap.delete(name));
+ this._elementListeners.forEach((listeners, element) => {
+ this._elementListeners.set(element, listeners.filter(entry => {
+ return entry.name != name;
+ }));
+ });
}
- if (vertical && element.scrollHeight > element.clientHeight) {
- return element;
+ clearElementCache(element) {
+ this._engine.statesByElement.delete(element);
+ this._elementListeners.delete(element);
+ const elementPlayers = this._engine.playersByElement.get(element);
+ if (elementPlayers) {
+ elementPlayers.forEach(player => player.destroy());
+ this._engine.playersByElement.delete(element);
+ }
}
- if (!vertical && element.scrollWidth > element.clientWidth) {
- return element;
+ _signalRemovalForInnerTriggers(rootElement, context) {
+ const elements = this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true);
+ // emulate a leave animation for all inner nodes within this node.
+ // If there are no animations found for any of the nodes then clear the cache
+ // for the element.
+ elements.forEach(elm => {
+ // this means that an inner remove() operation has already kicked off
+ // the animation on this element...
+ if (elm[REMOVAL_FLAG]) return;
+ const namespaces = this._engine.fetchNamespacesByElement(elm);
+ if (namespaces.size) {
+ namespaces.forEach(ns => ns.triggerLeaveAnimation(elm, context, false, true));
+ } else {
+ this.clearElementCache(elm);
+ }
+ });
+ // If the child elements were removed along with the parent, their animations might not
+ // have completed. Clear all the elements from the cache so we don't end up with a memory leak.
+ this._engine.afterFlushAnimationsDone(() => elements.forEach(elm => this.clearElementCache(elm)));
}
- return tuiGetScrollParent(element.parentElement, vertical);
-}
-
-/**
- * @description:
- * cross browser way to get selected text
- *
- * History:
- * BUG - window.getSelection() fails when text selected in a form field
- * https://bugzilla.mozilla.org/show_bug.cgi?id=85686
- */
-function tuiGetSelectedText({
- getSelection,
- document
-}) {
- var _a;
- return document.activeElement && tuiIsTextfield(document.activeElement) ? document.activeElement.value.slice(document.activeElement.selectionStart || 0, document.activeElement.selectionEnd || 0) : ((_a = getSelection()) === null || _a === void 0 ? void 0 : _a.toString()) || null;
-}
-function tuiIsCurrentTarget({
- target,
- currentTarget
-}) {
- return target === currentTarget;
-}
-function tuiIsElementEditable(element) {
- return tuiIsTextfield(element) && !element.readOnly || !!element.isContentEditable;
-}
-
-/**
- * Checks if an app is running inside tag
- */
-function tuiIsInsideIframe(win) {
- return win.parent !== win;
-}
-
-/**
- * Checks if node is inside a specific selector
- *
- * @param node
- * @param selector
- * @return true if node is inside a particular selector
- */
-function tuiIsNodeIn(node, selector) {
- var _a;
- return tuiIsTextNode(node) ? !!((_a = node.parentElement) === null || _a === void 0 ? void 0 : _a.closest(selector)) : tuiIsElement(node) && !!node.closest(selector);
-}
-function tuiPointToClientRect(x = 0, y = 0) {
- const rect = {
- x,
- y,
- left: x,
- right: x,
- top: y,
- bottom: y,
- width: 0,
- height: 0
- };
- return Object.assign(Object.assign({}, rect), {
- toJSON() {
- return rect;
+ triggerLeaveAnimation(element, context, destroyAfterComplete, defaultToFallback) {
+ const triggerStates = this._engine.statesByElement.get(element);
+ const previousTriggersValues = new Map();
+ if (triggerStates) {
+ const players = [];
+ triggerStates.forEach((state, triggerName) => {
+ previousTriggersValues.set(triggerName, state.value);
+ // this check is here in the event that an element is removed
+ // twice (both on the host level and the component level)
+ if (this._triggers.has(triggerName)) {
+ const player = this.trigger(element, triggerName, VOID_VALUE, defaultToFallback);
+ if (player) {
+ players.push(player);
+ }
+ }
+ });
+ if (players.length) {
+ this._engine.markElementAsRemoved(this.id, element, true, context, previousTriggersValues);
+ if (destroyAfterComplete) {
+ optimizeGroupPlayer(players).onDone(() => this._engine.processLeaveNode(element));
+ }
+ return true;
+ }
}
- });
-}
-function tuiRetargetedBoundaryCrossing(event) {
- // firefox
- if ('explicitOriginalTarget' in event) {
- return (event === null || event === void 0 ? void 0 : event.explicitOriginalTarget) !== event.target;
+ return false;
}
- // chrome
- if ('pointerId' in event) {
- return event.pointerId === -1;
+ prepareLeaveAnimationListeners(element) {
+ const listeners = this._elementListeners.get(element);
+ const elementStates = this._engine.statesByElement.get(element);
+ // if this statement fails then it means that the element was picked up
+ // by an earlier flush (or there are no listeners at all to track the leave).
+ if (listeners && elementStates) {
+ const visitedTriggers = new Set();
+ listeners.forEach(listener => {
+ const triggerName = listener.name;
+ if (visitedTriggers.has(triggerName)) return;
+ visitedTriggers.add(triggerName);
+ const trigger = this._triggers.get(triggerName);
+ const transition = trigger.fallbackTransition;
+ const fromState = elementStates.get(triggerName) || DEFAULT_STATE_VALUE;
+ const toState = new StateValue(VOID_VALUE);
+ const player = new TransitionAnimationPlayer(this.id, triggerName, element);
+ this._engine.totalQueuedPlayers++;
+ this._queue.push({
+ element,
+ triggerName,
+ transition,
+ fromState,
+ toState,
+ player,
+ isFallbackTransition: true
+ });
+ });
+ }
}
- // safari
- if ('detail' in event && 'webkitForce' in event) {
- return (event === null || event === void 0 ? void 0 : event.detail) === 0;
+ removeNode(element, context) {
+ const engine = this._engine;
+ if (element.childElementCount) {
+ this._signalRemovalForInnerTriggers(element, context);
+ }
+ // this means that a * => VOID animation was detected and kicked off
+ if (this.triggerLeaveAnimation(element, context, true)) return;
+ // find the player that is animating and make sure that the
+ // removal is delayed until that player has completed
+ let containsPotentialParentTransition = false;
+ if (engine.totalAnimations) {
+ const currentPlayers = engine.players.length ? engine.playersByQueriedElement.get(element) : [];
+ // when this `if statement` does not continue forward it means that
+ // a previous animation query has selected the current element and
+ // is animating it. In this situation want to continue forwards and
+ // allow the element to be queued up for animation later.
+ if (currentPlayers && currentPlayers.length) {
+ containsPotentialParentTransition = true;
+ } else {
+ let parent = element;
+ while (parent = parent.parentNode) {
+ const triggers = engine.statesByElement.get(parent);
+ if (triggers) {
+ containsPotentialParentTransition = true;
+ break;
+ }
+ }
+ }
+ }
+ // at this stage we know that the element will either get removed
+ // during flush or will be picked up by a parent query. Either way
+ // we need to fire the listeners for this element when it DOES get
+ // removed (once the query parent animation is done or after flush)
+ this.prepareLeaveAnimationListeners(element);
+ // whether or not a parent has an animation we need to delay the deferral of the leave
+ // operation until we have more information (which we do after flush() has been called)
+ if (containsPotentialParentTransition) {
+ engine.markElementAsRemoved(this.id, element, false, context);
+ } else {
+ const removalFlag = element[REMOVAL_FLAG];
+ if (!removalFlag || removalFlag === NULL_REMOVAL_STATE) {
+ // we do this after the flush has occurred such
+ // that the callbacks can be fired
+ engine.afterFlush(() => this.clearElementCache(element));
+ engine.destroyInnerAnimations(element);
+ engine._onRemovalComplete(element, context);
+ }
+ }
}
- return false;
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3573:
-/*!*************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-utils-focus.js ***!
- \*************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiBlurNativeFocused: () => (/* binding */ tuiBlurNativeFocused),
-/* harmony export */ tuiGetClosestFocusable: () => (/* binding */ tuiGetClosestFocusable),
-/* harmony export */ tuiGetNativeFocused: () => (/* binding */ tuiGetNativeFocused),
-/* harmony export */ tuiIsNativeFocused: () => (/* binding */ tuiIsNativeFocused),
-/* harmony export */ tuiIsNativeFocusedIn: () => (/* binding */ tuiIsNativeFocusedIn),
-/* harmony export */ tuiIsNativeKeyboardFocusable: () => (/* binding */ tuiIsNativeKeyboardFocusable),
-/* harmony export */ tuiIsNativeMouseFocusable: () => (/* binding */ tuiIsNativeMouseFocusable),
-/* harmony export */ tuiMoveFocus: () => (/* binding */ tuiMoveFocus),
-/* harmony export */ tuiSetNativeMouseFocused: () => (/* binding */ tuiSetNativeMouseFocused)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/utils/dom */ 4333);
-/* harmony import */ var _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/constants */ 5968);
-
-
-
-/**
- * Returns current active element, including shadow dom
- *
- * @return element or null
- */
-function tuiGetNativeFocused({
- activeElement
-}) {
- if (!(activeElement === null || activeElement === void 0 ? void 0 : activeElement.shadowRoot)) {
- return activeElement;
+ insertNode(element, parent) {
+ addClass(element, this._hostClassName);
}
- let element = activeElement.shadowRoot.activeElement;
- while (element === null || element === void 0 ? void 0 : element.shadowRoot) {
- element = element.shadowRoot.activeElement;
+ drainQueuedTransitions(microtaskId) {
+ const instructions = [];
+ this._queue.forEach(entry => {
+ const player = entry.player;
+ if (player.destroyed) return;
+ const element = entry.element;
+ const listeners = this._elementListeners.get(element);
+ if (listeners) {
+ listeners.forEach(listener => {
+ if (listener.name == entry.triggerName) {
+ const baseEvent = makeAnimationEvent(element, entry.triggerName, entry.fromState.value, entry.toState.value);
+ baseEvent['_data'] = microtaskId;
+ listenOnPlayer(entry.player, listener.phase, baseEvent, listener.callback);
+ }
+ });
+ }
+ if (player.markedForDestroy) {
+ this._engine.afterFlush(() => {
+ // now we can destroy the element properly since the event listeners have
+ // been bound to the player
+ player.destroy();
+ });
+ } else {
+ instructions.push(entry);
+ }
+ });
+ this._queue = [];
+ return instructions.sort((a, b) => {
+ // if depCount == 0 them move to front
+ // otherwise if a contains b then move back
+ const d0 = a.transition.ast.depCount;
+ const d1 = b.transition.ast.depCount;
+ if (d0 == 0 || d1 == 0) {
+ return d0 - d1;
+ }
+ return this._engine.driver.containsElement(a.element, b.element) ? 1 : -1;
+ });
}
- return element;
-}
-
-/**
- * Finds and blurs current active element, including shadow DOM
- */
-function tuiBlurNativeFocused(doc) {
- const activeElement = tuiGetNativeFocused(doc);
- if ((0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_0__.tuiIsHTMLElement)(activeElement)) {
- activeElement.blur();
+ destroy(context) {
+ this.players.forEach(p => p.destroy());
+ this._signalRemovalForInnerTriggers(this.hostElement, context);
}
}
-
-/**
- * Checks for signs that element can be focused with keyboard. tabIndex above 0 is ignored to
- * only target natural focus order. Not checking the possibility of an element to
- * be focused, for example element can have display: none applied to it or any other
- * circumstances could prevent actual focus.
- */
-function tuiIsNativeKeyboardFocusable(element) {
- if (element.hasAttribute('disabled') || element.getAttribute('tabIndex') === '-1') {
- return false;
+class TransitionAnimationEngine {
+ /** @internal */
+ _onRemovalComplete(element, context) {
+ this.onRemovalComplete(element, context);
}
- if ((0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_0__.tuiIsHTMLElement)(element) && element.isContentEditable || element.getAttribute('tabIndex') === '0') {
- return true;
+ constructor(bodyNode, driver, _normalizer) {
+ this.bodyNode = bodyNode;
+ this.driver = driver;
+ this._normalizer = _normalizer;
+ this.players = [];
+ this.newHostElements = new Map();
+ this.playersByElement = new Map();
+ this.playersByQueriedElement = new Map();
+ this.statesByElement = new Map();
+ this.disabledNodes = new Set();
+ this.totalAnimations = 0;
+ this.totalQueuedPlayers = 0;
+ this._namespaceLookup = {};
+ this._namespaceList = [];
+ this._flushFns = [];
+ this._whenQuietFns = [];
+ this.namespacesByHostElement = new Map();
+ this.collectedEnterElements = [];
+ this.collectedLeaveElements = [];
+ // this method is designed to be overridden by the code that uses this engine
+ this.onRemovalComplete = (element, context) => {};
}
- switch (element.tagName) {
- case 'BUTTON':
- case 'SELECT':
- case 'TEXTAREA':
- return true;
- case 'VIDEO':
- case 'AUDIO':
- return element.hasAttribute('controls');
- case 'INPUT':
- return element.getAttribute('type') !== 'hidden';
- case 'A':
- case 'LINK':
- return element.hasAttribute('href');
- default:
- return false;
+ get queuedPlayers() {
+ const players = [];
+ this._namespaceList.forEach(ns => {
+ ns.players.forEach(player => {
+ if (player.queued) {
+ players.push(player);
+ }
+ });
+ });
+ return players;
}
-}
-function tuiIsNativeMouseFocusable(element) {
- return !element.hasAttribute('disabled') && (element.getAttribute('tabIndex') === '-1' || tuiIsNativeKeyboardFocusable(element));
-}
-
-/**
- * @description:
- * Finds the closest element that can be focused with a keyboard or mouse in theory
- */
-function tuiGetClosestFocusable({
- initial,
- root,
- previous = false,
- keyboard = true
-}) {
- if (!root.ownerDocument) {
- return null;
+ createNamespace(namespaceId, hostElement) {
+ const ns = new AnimationTransitionNamespace(namespaceId, hostElement, this);
+ if (this.bodyNode && this.driver.containsElement(this.bodyNode, hostElement)) {
+ this._balanceNamespaceList(ns, hostElement);
+ } else {
+ // defer this later until flush during when the host element has
+ // been inserted so that we know exactly where to place it in
+ // the namespace list
+ this.newHostElements.set(hostElement, ns);
+ // given that this host element is a part of the animation code, it
+ // may or may not be inserted by a parent node that is of an
+ // animation renderer type. If this happens then we can still have
+ // access to this item when we query for :enter nodes. If the parent
+ // is a renderer then the set data-structure will normalize the entry
+ this.collectEnterElement(hostElement);
+ }
+ return this._namespaceLookup[namespaceId] = ns;
}
- const check = keyboard ? tuiIsNativeKeyboardFocusable : tuiIsNativeMouseFocusable;
- const treeWalker = root.ownerDocument.createTreeWalker(root, NodeFilter.SHOW_ELEMENT, _taiga_ui_cdk_constants__WEBPACK_IMPORTED_MODULE_1__.svgNodeFilter);
- treeWalker.currentNode = initial;
- while (previous ? treeWalker.previousNode() : treeWalker.nextNode()) {
- if ((0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_0__.tuiIsHTMLElement)(treeWalker.currentNode)) {
- initial = treeWalker.currentNode;
+ _balanceNamespaceList(ns, hostElement) {
+ const namespaceList = this._namespaceList;
+ const namespacesByHostElement = this.namespacesByHostElement;
+ const limit = namespaceList.length - 1;
+ if (limit >= 0) {
+ let found = false;
+ // Find the closest ancestor with an existing namespace so we can then insert `ns` after it,
+ // establishing a top-down ordering of namespaces in `this._namespaceList`.
+ let ancestor = this.driver.getParentElement(hostElement);
+ while (ancestor) {
+ const ancestorNs = namespacesByHostElement.get(ancestor);
+ if (ancestorNs) {
+ // An animation namespace has been registered for this ancestor, so we insert `ns`
+ // right after it to establish top-down ordering of animation namespaces.
+ const index = namespaceList.indexOf(ancestorNs);
+ namespaceList.splice(index + 1, 0, ns);
+ found = true;
+ break;
+ }
+ ancestor = this.driver.getParentElement(ancestor);
+ }
+ if (!found) {
+ // No namespace exists that is an ancestor of `ns`, so `ns` is inserted at the front to
+ // ensure that any existing descendants are ordered after `ns`, retaining the desired
+ // top-down ordering.
+ namespaceList.unshift(ns);
+ }
+ } else {
+ namespaceList.push(ns);
}
- if ((0,_taiga_ui_cdk_utils_dom__WEBPACK_IMPORTED_MODULE_0__.tuiIsHTMLElement)(initial) && check(initial)) {
- return initial;
+ namespacesByHostElement.set(hostElement, ns);
+ return ns;
+ }
+ register(namespaceId, hostElement) {
+ let ns = this._namespaceLookup[namespaceId];
+ if (!ns) {
+ ns = this.createNamespace(namespaceId, hostElement);
}
+ return ns;
}
- return null;
-}
-
-/**
- * Checks if element is focused.
- *
- * Could return true even after blur since element remains focused if you switch away from a browser tab.
- *
- * @param node or null (as a common return value of DOM nodes walking)
- * @return true if focused
- */
-function tuiIsNativeFocused(node) {
- return !!(node === null || node === void 0 ? void 0 : node.ownerDocument) && tuiGetNativeFocused(node.ownerDocument) === node && node.ownerDocument.hasFocus();
-}
-
-/**
- * Checks if focused element is within given element.
- *
- * @param node
- * @return true if focused node is contained within element
- */
-function tuiIsNativeFocusedIn(node) {
- // !node.contains - check for IE11
- if (!node.ownerDocument || !node.contains) {
- return false;
+ registerTrigger(namespaceId, name, trigger) {
+ let ns = this._namespaceLookup[namespaceId];
+ if (ns && ns.register(name, trigger)) {
+ this.totalAnimations++;
+ }
}
- const nativeFocused = tuiGetNativeFocused(node.ownerDocument);
- return nativeFocused !== null && node.contains(nativeFocused) && node.ownerDocument.hasFocus();
-}
-
-/**
- * Utility method for moving focus in a list of elements
- *
- * @param currentIndex currently focused index
- * @param elements array of focusable elements
- * @param step a step to move focus by, typically -1 or 1
- */
-function tuiMoveFocus(currentIndex, elements, step) {
- currentIndex += step;
- while (currentIndex >= 0 && currentIndex < elements.length) {
- elements[currentIndex].focus();
- if (tuiIsNativeFocused(elements[currentIndex])) {
- return;
+ destroy(namespaceId, context) {
+ if (!namespaceId) return;
+ this.afterFlush(() => {});
+ this.afterFlushAnimationsDone(() => {
+ const ns = this._fetchNamespace(namespaceId);
+ this.namespacesByHostElement.delete(ns.hostElement);
+ const index = this._namespaceList.indexOf(ns);
+ if (index >= 0) {
+ this._namespaceList.splice(index, 1);
+ }
+ ns.destroy(context);
+ delete this._namespaceLookup[namespaceId];
+ });
+ }
+ _fetchNamespace(id) {
+ return this._namespaceLookup[id];
+ }
+ fetchNamespacesByElement(element) {
+ // normally there should only be one namespace per element, however
+ // if @triggers are placed on both the component element and then
+ // its host element (within the component code) then there will be
+ // two namespaces returned. We use a set here to simply deduplicate
+ // the namespaces in case (for the reason described above) there are multiple triggers
+ const namespaces = new Set();
+ const elementStates = this.statesByElement.get(element);
+ if (elementStates) {
+ for (let stateValue of elementStates.values()) {
+ if (stateValue.namespaceId) {
+ const ns = this._fetchNamespace(stateValue.namespaceId);
+ if (ns) {
+ namespaces.add(ns);
+ }
+ }
+ }
}
- currentIndex += step;
+ return namespaces;
}
-}
-
-/**
- * Focuses or blurs element with mouse action imitation (to spoof {@link TuiFocusVisibleService})
- *
- * @param element
- * @param focused desired focused state
- * @param preventScroll optionally prevent native browser scroll after focus
- */
-function tuiSetNativeMouseFocused(element, focused = true, preventScroll = false) {
- if (!element.ownerDocument) {
- return;
+ trigger(namespaceId, element, name, value) {
+ if (isElementNode(element)) {
+ const ns = this._fetchNamespace(namespaceId);
+ if (ns) {
+ ns.trigger(element, name, value);
+ return true;
+ }
+ }
+ return false;
}
- if (typeof Event === 'function') {
- element.dispatchEvent(new MouseEvent('mousedown', {
- bubbles: true,
- cancelable: true
- }));
- } else {
- const event = element.ownerDocument.createEvent('Event');
- event.initEvent('mousedown', true, true);
- element.dispatchEvent(event);
+ insertNode(namespaceId, element, parent, insertBefore) {
+ if (!isElementNode(element)) return;
+ // special case for when an element is removed and reinserted (move operation)
+ // when this occurs we do not want to use the element for deletion later
+ const details = element[REMOVAL_FLAG];
+ if (details && details.setForRemoval) {
+ details.setForRemoval = false;
+ details.setForMove = true;
+ const index = this.collectedLeaveElements.indexOf(element);
+ if (index >= 0) {
+ this.collectedLeaveElements.splice(index, 1);
+ }
+ }
+ // in the event that the namespaceId is blank then the caller
+ // code does not contain any animation code in it, but it is
+ // just being called so that the node is marked as being inserted
+ if (namespaceId) {
+ const ns = this._fetchNamespace(namespaceId);
+ // This if-statement is a workaround for router issue #21947.
+ // The router sometimes hits a race condition where while a route
+ // is being instantiated a new navigation arrives, triggering leave
+ // animation of DOM that has not been fully initialized, until this
+ // is resolved, we need to handle the scenario when DOM is not in a
+ // consistent state during the animation.
+ if (ns) {
+ ns.insertNode(element, parent);
+ }
+ }
+ // only *directives and host elements are inserted before
+ if (insertBefore) {
+ this.collectEnterElement(element);
+ }
}
- if (focused) {
- element.focus({
- preventScroll
- });
- } else {
- element.blur();
+ collectEnterElement(element) {
+ this.collectedEnterElements.push(element);
}
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3406:
-/*!**************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-utils-format.js ***!
- \**************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiPx: () => (/* binding */ tuiPx)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/classes */ 7589);
-
-
-/**
- * Adds 'px' to the number and turns it into a string
- */
-function tuiPx(value) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(Number.isFinite(value), 'Value must be finite number');
- return `${value}px`;
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 9291:
-/*!************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-utils-math.js ***!
- \************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiCeil: () => (/* binding */ tuiCeil),
-/* harmony export */ tuiClamp: () => (/* binding */ tuiClamp),
-/* harmony export */ tuiFloor: () => (/* binding */ tuiFloor),
-/* harmony export */ tuiInRange: () => (/* binding */ tuiInRange),
-/* harmony export */ tuiNormalizeToIntNumber: () => (/* binding */ tuiNormalizeToIntNumber),
-/* harmony export */ tuiQuantize: () => (/* binding */ tuiQuantize),
-/* harmony export */ tuiRound: () => (/* binding */ tuiRound),
-/* harmony export */ tuiRoundWith: () => (/* binding */ tuiRoundWith),
-/* harmony export */ tuiSum: () => (/* binding */ tuiSum),
-/* harmony export */ tuiToInt: () => (/* binding */ tuiToInt),
-/* harmony export */ tuiToInteger: () => (/* binding */ tuiToInteger),
-/* harmony export */ tuiToRadians: () => (/* binding */ tuiToRadians),
-/* harmony export */ tuiTrunc: () => (/* binding */ tuiTrunc)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/classes */ 7589);
-
-
-/**
- * Clamps a value between two inclusive limits
- *
- * @param value
- * @param min lower limit
- * @param max upper limit
- */
-function tuiClamp(value, min, max) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(!Number.isNaN(value));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(!Number.isNaN(min));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(!Number.isNaN(max));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(max >= min);
- return Math.min(max, Math.max(min, value));
-}
-function tuiInRange(value, fromInclude, toExclude) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(!Number.isNaN(value));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(!Number.isNaN(fromInclude));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(!Number.isNaN(toExclude));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(fromInclude < toExclude);
- return value >= fromInclude && value < toExclude;
-}
-
-/**
- * Normalizes any number to an integer within inclusive range
- *
- * @param value
- * @param min lower inclusive integer
- * @param max upper inclusive integer
- * @return an integer between min and max inclusive
- */
-function tuiNormalizeToIntNumber(value, min, max) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(Number.isInteger(min));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(Number.isInteger(max));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(min <= max);
- if (Number.isNaN(value) || value <= min) {
- return min;
+ markElementAsDisabled(element, value) {
+ if (value) {
+ if (!this.disabledNodes.has(element)) {
+ this.disabledNodes.add(element);
+ addClass(element, DISABLED_CLASSNAME);
+ }
+ } else if (this.disabledNodes.has(element)) {
+ this.disabledNodes.delete(element);
+ removeClass(element, DISABLED_CLASSNAME);
+ }
}
- if (value >= max) {
- return max;
+ removeNode(namespaceId, element, context) {
+ if (isElementNode(element)) {
+ const ns = namespaceId ? this._fetchNamespace(namespaceId) : null;
+ if (ns) {
+ ns.removeNode(element, context);
+ } else {
+ this.markElementAsRemoved(namespaceId, element, false, context);
+ }
+ const hostNS = this.namespacesByHostElement.get(element);
+ if (hostNS && hostNS.id !== namespaceId) {
+ hostNS.removeNode(element, context);
+ }
+ } else {
+ this._onRemovalComplete(element, context);
+ }
}
- return Math.round(value);
-}
-
-/**
- * Rounds a number to the closest value in a fixed discrete series
- *
- * @param value
- * @param quantum series step
- */
-function tuiQuantize(value, quantum) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(Number.isFinite(value));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(Number.isFinite(quantum));
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(quantum > 0);
- const remainder = value % quantum;
- return remainder < quantum / 2 ? value - remainder : value + quantum - remainder;
-}
-const MAX_PRECISION = 292;
-/**
- * Rounding number to the set precision
- *
- * @param value
- * @param precision number of digits in a float part
- * @param func rounding function (round, floor, ceil)
- */
-function calculate(value, precision, func) {
- if (value === Infinity) {
- return value;
+ markElementAsRemoved(namespaceId, element, hasAnimation, context, previousTriggersValues) {
+ this.collectedLeaveElements.push(element);
+ element[REMOVAL_FLAG] = {
+ namespaceId,
+ setForRemoval: context,
+ hasAnimation,
+ removedBeforeQueried: false,
+ previousTriggersValues
+ };
}
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(!Number.isNaN(value), 'Value must be number');
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_0__.tuiAssert.assert(Number.isInteger(precision), 'Precision must be integer');
- precision = Math.min(precision, MAX_PRECISION);
- const pair = `${value}e`.split('e');
- const tempValue = func(Number(`${pair[0]}e${Number(pair[1]) + precision}`));
- const processedPair = `${tempValue}e`.split('e');
- return Number(`${processedPair[0]}e${Number(processedPair[1]) - precision}`);
-}
-function tuiRound(value, precision = 0) {
- return calculate(value, precision, Math.round);
-}
-function tuiCeil(value, precision = 0) {
- return calculate(value, precision, Math.ceil);
-}
-function tuiFloor(value, precision = 0) {
- return calculate(value, precision, Math.floor);
-}
-function tuiTrunc(value, precision = 0) {
- return calculate(value, precision, Math.trunc);
-}
-function tuiRoundWith({
- value,
- precision,
- method
-}) {
- switch (method) {
- case 'round':
- return tuiRound(value, precision);
- case 'ceil':
- return tuiCeil(value, precision);
- case 'floor':
- return tuiFloor(value, precision);
- default:
- return tuiTrunc(value, precision);
+ listen(namespaceId, element, name, phase, callback) {
+ if (isElementNode(element)) {
+ return this._fetchNamespace(namespaceId).listen(element, name, phase, callback);
+ }
+ return () => {};
}
-}
-
-/**
- * Calculates sum of any number of passed arguments
- */
-function tuiSum(...args) {
- return args.reduce((a, b) => a + b, 0);
-}
-function tuiToInt(bool) {
- return bool ? 1 : 0;
-}
-function tuiToInteger(value) {
- return parseInt(value, 10);
-}
-
-/**
- * Converts angle in degrees to radians
- */
-function tuiToRadians(deg) {
- return deg * Math.PI / 180;
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 6049:
-/*!*********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-utils-miscellaneous.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiArrayRemove: () => (/* binding */ tuiArrayRemove),
-/* harmony export */ tuiArrayShallowEquals: () => (/* binding */ tuiArrayShallowEquals),
-/* harmony export */ tuiArrayToggle: () => (/* binding */ tuiArrayToggle),
-/* harmony export */ tuiCleanObject: () => (/* binding */ tuiCleanObject),
-/* harmony export */ tuiCreateOptions: () => (/* binding */ tuiCreateOptions),
-/* harmony export */ tuiCreateToken: () => (/* binding */ tuiCreateToken),
-/* harmony export */ tuiCreateTokenFromFactory: () => (/* binding */ tuiCreateTokenFromFactory),
-/* harmony export */ tuiDefaultSort: () => (/* binding */ tuiDefaultSort),
-/* harmony export */ tuiDistanceBetweenTouches: () => (/* binding */ tuiDistanceBetweenTouches),
-/* harmony export */ tuiEaseInOutQuad: () => (/* binding */ tuiEaseInOutQuad),
-/* harmony export */ tuiFlatLength: () => (/* binding */ tuiFlatLength),
-/* harmony export */ tuiGetOriginalArrayFromQueryList: () => (/* binding */ tuiGetOriginalArrayFromQueryList),
-/* harmony export */ tuiGetSwipeDirection: () => (/* binding */ tuiGetSwipeDirection),
-/* harmony export */ tuiIsFalsy: () => (/* binding */ tuiIsFalsy),
-/* harmony export */ tuiIsNumber: () => (/* binding */ tuiIsNumber),
-/* harmony export */ tuiIsObject: () => (/* binding */ tuiIsObject),
-/* harmony export */ tuiIsPresent: () => (/* binding */ tuiIsPresent),
-/* harmony export */ tuiIsString: () => (/* binding */ tuiIsString),
-/* harmony export */ tuiIsValidUrl: () => (/* binding */ tuiIsValidUrl),
-/* harmony export */ tuiMarkControlAsTouchedAndValidate: () => (/* binding */ tuiMarkControlAsTouchedAndValidate),
-/* harmony export */ tuiNullableSame: () => (/* binding */ tuiNullableSame),
-/* harmony export */ tuiObjectFromEntries: () => (/* binding */ tuiObjectFromEntries),
-/* harmony export */ tuiProvideOptions: () => (/* binding */ tuiProvideOptions),
-/* harmony export */ tuiUniqBy: () => (/* binding */ tuiUniqBy)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk/classes */ 7589);
-/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/forms */ 8015);
-
-
-
-function tuiArrayRemove(array, index) {
- return array.slice(0, Math.max(index, 0)).concat(array.slice(Math.max(index + 1, 0)));
-}
-function tuiArrayShallowEquals(a, b) {
- return a.length === b.length && a.every((item, index) => item === b[index]);
-}
-function tuiArrayToggle(array, item) {
- const index = array.indexOf(item);
- return index === -1 ? [...array, item] : tuiArrayRemove(array, index);
-}
-function tuiIsString(value) {
- return typeof value === 'string';
-}
-function checkValueIsEmpty(value) {
- const nextValue = tuiIsString(value) ? value.trim() : value;
- return [undefined, null, NaN, ''].includes(nextValue);
-}
-function tuiCleanObject(object) {
- return JSON.parse(JSON.stringify(object, (_key, value) => checkValueIsEmpty(value) ? undefined : value));
-}
-function tuiCreateToken(defaults) {
- return tuiCreateTokenFromFactory(() => defaults);
-}
-function tuiCreateTokenFromFactory(factory) {
- return new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('', {
- factory
- });
-}
-
-/** @deprecated use {@link tuiCreateToken} instead */
-function tuiCreateOptions(defaults) {
- return tuiCreateTokenFromFactory(() => defaults);
-}
-function tuiDefaultSort(x, y) {
- if (x === y) {
- return 0;
+ _buildInstruction(entry, subTimelines, enterClassName, leaveClassName, skipBuildAst) {
+ return entry.transition.build(this.driver, entry.element, entry.fromState.value, entry.toState.value, enterClassName, leaveClassName, entry.fromState.options, entry.toState.options, subTimelines, skipBuildAst);
}
- if (tuiIsString(x) && tuiIsString(y)) {
- return x.localeCompare(y);
+ destroyInnerAnimations(containerElement) {
+ let elements = this.driver.query(containerElement, NG_TRIGGER_SELECTOR, true);
+ elements.forEach(element => this.destroyActiveAnimationsForElement(element));
+ if (this.playersByQueriedElement.size == 0) return;
+ elements = this.driver.query(containerElement, NG_ANIMATING_SELECTOR, true);
+ elements.forEach(element => this.finishActiveQueriedAnimationOnElement(element));
}
- return x > y ? 1 : -1;
-}
-function tuiDistanceBetweenTouches({
- touches
-}) {
- return Math.hypot(touches[0].clientX - touches[1].clientX, touches[0].clientY - touches[1].clientY);
-}
-function tuiEaseInOutQuad(t) {
- ngDevMode && _taiga_ui_cdk_classes__WEBPACK_IMPORTED_MODULE_1__.tuiAssert.assert(t >= 0 && t <= 1, 'Input must be between 0 and 1 inclusive but received ', t);
- return t < 0.5 ? 2 * t * t : -1 + (4 - 2 * t) * t;
-}
-
-/**
- * Flattens two-dimensional array and calculates resulting length
- *
- * @param array twi dimensional array
- */
-function tuiFlatLength(array) {
- return array.reduce((count, section) => count + section.length, 0);
-}
-
-/**
- * Extracts original array from {@link QueryList} rather than
- * creating a copy like {@link QueryList.toArray} does.
- * @param queryList
- * @returns original array from {@link QueryList}.
- */
-function tuiGetOriginalArrayFromQueryList(queryList) {
- let array = [];
- queryList.find((_item, _index, originalArray) => {
- array = originalArray;
- return true;
- });
- return array;
-}
-function tuiGetSwipeDirection(deltaX, deltaY) {
- if (Math.abs(deltaY) > Math.abs(deltaX)) {
- return deltaY > 0 ? 'top' : 'bottom';
+ destroyActiveAnimationsForElement(element) {
+ const players = this.playersByElement.get(element);
+ if (players) {
+ players.forEach(player => {
+ // special case for when an element is set for destruction, but hasn't started.
+ // in this situation we want to delay the destruction until the flush occurs
+ // so that any event listeners attached to the player are triggered.
+ if (player.queued) {
+ player.markedForDestroy = true;
+ } else {
+ player.destroy();
+ }
+ });
+ }
}
- return deltaX > 0 ? 'left' : 'right';
-}
-function tuiIsFalsy(value) {
- return !value;
-}
-function tuiIsNumber(value) {
- return typeof value === 'number';
-}
-function tuiIsObject(value) {
- return typeof value === 'object' && !!value;
-}
-function tuiIsPresent(value) {
- return value !== null && value !== undefined;
-}
-function tuiIsValidUrl(url) {
- const pattern = new RegExp('^([a-zA-Z]+:\\/\\/)?' +
- // protocol
- '((([a-z\\d]([a-z\\d-]*[a-z\\d])*)\\.)+[a-z]{2,}|localhost|' +
- // domain name
- '((\\d{1,3}\\.){3}\\d{1,3}))' +
- // OR IP (v4) address
- '(\\:\\d+)?(\\/[-a-z\\d%_.~+]*)*' +
- // port and path
- '(\\?[;&a-z\\d%_.~+=-]*)?' +
- // query string
- '(\\#[-a-z\\d_]*)?$',
- // fragment locator
- 'i');
- return pattern.test(url);
-}
-function tuiMarkControlAsTouchedAndValidate(control) {
- if (control instanceof _angular_forms__WEBPACK_IMPORTED_MODULE_2__.FormArray) {
- control.controls.forEach(nestedControl => {
- tuiMarkControlAsTouchedAndValidate(nestedControl);
- });
+ finishActiveQueriedAnimationOnElement(element) {
+ const players = this.playersByQueriedElement.get(element);
+ if (players) {
+ players.forEach(player => player.finish());
+ }
}
- if (control instanceof _angular_forms__WEBPACK_IMPORTED_MODULE_2__.FormGroup) {
- Object.values(control.controls).forEach(nestedControl => {
- tuiMarkControlAsTouchedAndValidate(nestedControl);
+ whenRenderingDone() {
+ return new Promise(resolve => {
+ if (this.players.length) {
+ return optimizeGroupPlayer(this.players).onDone(() => resolve());
+ } else {
+ resolve();
+ }
});
}
- control.markAsTouched();
- control.updateValueAndValidity();
-}
-
-/**
- * Checks identity for nullable elements.
- *
- * @param a element a
- * @param b element b
- * @param handler called if both elements are not null
- * @return true if either both are null or they pass identity handler
- */
-function tuiNullableSame(a, b, handler) {
- if (a === null) {
- return b === null;
- }
- if (b === null) {
- return false;
- }
- return handler(a, b);
-}
-
-/**
- * @deprecated use `Object.fromEntries` instead
- * (check browser support first https://caniuse.com/mdn-javascript_builtins_object_fromentries)
- * ___
- * TODO: after we bump Firefox to 63+ replace this function with `Object.fromEntries`.
- * TODO: Add `es2019.object` to `tsconfig.json` => `compilerOptions.lib`.
- *
- */
-function tuiObjectFromEntries(keyValuePairs) {
- return keyValuePairs.reduce((obj, [key, val]) => Object.assign(Object.assign({}, obj), {
- [key]: val
- }), {});
-}
-function tuiProvideOptions(provide, options, fallback) {
- return {
- provide,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf(), provide]],
- useFactory: parent => Object.assign(Object.assign({}, parent || fallback), options)
- };
-}
-function tuiUniqBy(array, key) {
- return Array.from(array.reduce((map, item) => map.has(item[key]) ? map : map.set(item[key], item), new Map()).values());
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 6343:
-/*!**********************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-utils-os.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiIsApple: () => (/* binding */ tuiIsApple),
-/* harmony export */ tuiIsApplePlatform: () => (/* binding */ tuiIsApplePlatform),
-/* harmony export */ tuiIsIos: () => (/* binding */ tuiIsIos)
-/* harmony export */ });
-/**
- * @description:
- * All Chrome / Chromium-based browsers will return MacIntel on macOS,
- * no matter what the hardware architecture is. See the source code here:
- * https://source.chromium.org/chromium/chromium/src/+/master:third_party/blink/renderer/core/frame/navigator_id.cc;l=64;drc=703d3c472cf27470dad21a3f2c8972aca3732cd6
- * But maybe in future years, it will be changed to MacM1
- *
- * Documentation:
- * https://developer.mozilla.org/en-US/docs/Web/API/Navigator/platform
- */
-function tuiIsApplePlatform(navigator) {
- return navigator.platform.startsWith('Mac') || navigator.platform === 'iPhone';
-}
-const IOS_REG_EXP = /ipad|iphone|ipod/;
-function tuiIsIos(navigator) {
- return IOS_REG_EXP.test(navigator.userAgent.toLowerCase()) || tuiIsApplePlatform(navigator) && navigator.maxTouchPoints > 1;
-}
-const SAFARI_REG_EXP = /^((?!chrome|android).)*safari/i;
-function tuiIsApple(navigator) {
- return tuiIsIos(navigator) || SAFARI_REG_EXP.test(navigator.userAgent.toLowerCase());
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3915:
-/*!***********************************************************************!*\
- !*** ./node_modules/@taiga-ui/cdk/fesm2015/taiga-ui-cdk-utils-svg.js ***!
- \***********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiSvgLinearGradientProcessor: () => (/* binding */ tuiSvgLinearGradientProcessor)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk/utils/miscellaneous */ 6049);
-
-function makeRandomSalt() {
- return Math.floor(Math.random() * Date.now());
-}
-function escapeRegExp(search) {
- return search.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, '\\$&');
-}
-function extractLinearGradientIdsFromSvg(svg) {
- var _a;
- const ids = ((_a = svg.match(/url\(("?)('*)#(.*?)('*)\)/g)) !== null && _a !== void 0 ? _a : []).map(url => url.slice(4, url.length - 1).replace(/['"#]+/g, ''));
- return Array.from(new Set(ids));
-}
-/**
- * @description:
- * Any ‘linearGradient’ attributes which are defined on the referenced
- * element which are not defined on this element are inherited by this element.
- * If this element has no defined gradient stops, and the referenced element does
- * (possibly due to its own ‘xlink:href’ attribute), then this element inherits
- * the gradient stop from the referenced element. Inheritance can be indirect
- * to an arbitrary level; thus, if the referenced element inherits attribute
- * or gradient stops due to its own ‘xlink:href’ attribute, then the current
- * element can inherit those attributes or gradient stops.
- *
- * Documentation: https://www.w3.org/TR/SVG11/pservers.html
- *
- */
-function tuiSvgLinearGradientProcessor(svg, salt = makeRandomSalt()) {
- if ((0,_taiga_ui_cdk_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_0__.tuiIsString)(svg)) {
- const uniqueIds = extractLinearGradientIdsFromSvg(svg);
- return uniqueIds.reduce((newSvg, previousId) => {
- const escapedId = escapeRegExp(previousId);
- const newId = `id_${salt}_${previousId}`;
- return newSvg.replace(new RegExp(`"${escapedId}"`, 'g'), `"${newId}"`).replace(new RegExp(`'${escapedId}'`, 'g'), `'${newId}'`).replace(new RegExp(`url\\('#${escapedId}'\\)`, 'g'), `url('#${newId}')`).replace(new RegExp(`url\\("#${escapedId}"\\)`, 'g'), `url("#${newId}")`).replace(new RegExp(`url\\(#${escapedId}\\)`, 'g'), `url(#${newId})`);
- }, svg);
- }
- return svg;
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 9139:
-/*!************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-abstract.js ***!
- \************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ AbstractTuiDriverDirective: () => (/* binding */ AbstractTuiDriverDirective),
-/* harmony export */ AbstractTuiTextfieldHost: () => (/* binding */ AbstractTuiTextfieldHost),
-/* harmony export */ TuiDriver: () => (/* binding */ TuiDriver),
-/* harmony export */ TuiPositionAccessor: () => (/* binding */ TuiPositionAccessor),
-/* harmony export */ TuiRectAccessor: () => (/* binding */ TuiRectAccessor),
-/* harmony export */ TuiVehicle: () => (/* binding */ TuiVehicle),
-/* harmony export */ tuiAsDriver: () => (/* binding */ tuiAsDriver),
-/* harmony export */ tuiAsPositionAccessor: () => (/* binding */ tuiAsPositionAccessor),
-/* harmony export */ tuiAsRectAccessor: () => (/* binding */ tuiAsRectAccessor),
-/* harmony export */ tuiAsVehicle: () => (/* binding */ tuiAsVehicle),
-/* harmony export */ tuiFallbackAccessor: () => (/* binding */ tuiFallbackAccessor),
-/* harmony export */ tuiFallbackRectAccessor: () => (/* binding */ tuiFallbackRectAccessor),
-/* harmony export */ tuiPositionAccessorFor: () => (/* binding */ tuiPositionAccessorFor),
-/* harmony export */ tuiRectAccessorFor: () => (/* binding */ tuiRectAccessorFor)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 5213);
-
-
-
-
-
-
-
-// eslint-disable-next-line @typescript-eslint/naming-convention
-class TuiDriver extends rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable {}
-function tuiAsDriver(useExisting) {
- return {
- provide: TuiDriver,
- multi: true,
- useExisting
- };
-}
-
-// eslint-disable-next-line @typescript-eslint/naming-convention
-class TuiVehicle {}
-function tuiAsVehicle(useExisting) {
- return {
- provide: TuiVehicle,
- multi: true,
- useExisting
- };
-}
-class AbstractTuiDriverDirective {
- constructor(destroy$, drivers, vehicles) {
- this.destroy$ = destroy$;
- this.drivers = drivers;
- this.vehicles = vehicles;
- }
- ngOnInit() {
- const vehicle = this.vehicles.find(({
- type
- }) => type === this.type);
- (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.merge)(...this.drivers.filter(({
- type
- }) => type === this.type)).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.distinctUntilChanged)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.takeUntil)(this.destroy$)).subscribe(value => {
- vehicle === null || vehicle === void 0 ? void 0 : vehicle.toggle(value);
+ processLeaveNode(element) {
+ const details = element[REMOVAL_FLAG];
+ if (details && details.setForRemoval) {
+ // this will prevent it from removing it twice
+ element[REMOVAL_FLAG] = NULL_REMOVAL_STATE;
+ if (details.namespaceId) {
+ this.destroyInnerAnimations(element);
+ const ns = this._fetchNamespace(details.namespaceId);
+ if (ns) {
+ ns.clearElementCache(element);
+ }
+ }
+ this._onRemovalComplete(element, details.setForRemoval);
+ }
+ if (element.classList?.contains(DISABLED_CLASSNAME)) {
+ this.markElementAsDisabled(element, false);
+ }
+ this.driver.query(element, DISABLED_SELECTOR, true).forEach(node => {
+ this.markElementAsDisabled(node, false);
});
}
-}
-AbstractTuiDriverDirective.ɵfac = function AbstractTuiDriverDirective_Factory(t) {
- return new (t || AbstractTuiDriverDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdirectiveInject"](TuiDriver), _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdirectiveInject"](TuiVehicle));
-};
-AbstractTuiDriverDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineDirective"]({
- type: AbstractTuiDriverDirective
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵsetClassMetadata"](AbstractTuiDriverDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Directive
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.TuiDestroyService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Inject,
- args: [TuiDriver]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Inject,
- args: [TuiVehicle]
- }]
- }];
- }, null);
-})();
-class AbstractTuiTextfieldHost {
- constructor(host) {
- this.host = host;
- }
- get readOnly() {
- return this.host.readOnly;
- }
- get disabled() {
- return this.host.computedDisabled;
- }
- get invalid() {
- return this.host.computedInvalid;
- }
- get focusable() {
- return this.host.computedFocusable;
- }
- get inputMode() {
- return 'text';
- }
- get value() {
- var _a;
- return ((_a = this.host.value) === null || _a === void 0 ? void 0 : _a.toString()) || '';
+ flush(microtaskId = -1) {
+ let players = [];
+ if (this.newHostElements.size) {
+ this.newHostElements.forEach((ns, element) => this._balanceNamespaceList(ns, element));
+ this.newHostElements.clear();
+ }
+ if (this.totalAnimations && this.collectedEnterElements.length) {
+ for (let i = 0; i < this.collectedEnterElements.length; i++) {
+ const elm = this.collectedEnterElements[i];
+ addClass(elm, STAR_CLASSNAME);
+ }
+ }
+ if (this._namespaceList.length && (this.totalQueuedPlayers || this.collectedLeaveElements.length)) {
+ const cleanupFns = [];
+ try {
+ players = this._flushAnimations(cleanupFns, microtaskId);
+ } finally {
+ for (let i = 0; i < cleanupFns.length; i++) {
+ cleanupFns[i]();
+ }
+ }
+ } else {
+ for (let i = 0; i < this.collectedLeaveElements.length; i++) {
+ const element = this.collectedLeaveElements[i];
+ this.processLeaveNode(element);
+ }
+ }
+ this.totalQueuedPlayers = 0;
+ this.collectedEnterElements.length = 0;
+ this.collectedLeaveElements.length = 0;
+ this._flushFns.forEach(fn => fn());
+ this._flushFns = [];
+ if (this._whenQuietFns.length) {
+ // we move these over to a variable so that
+ // if any new callbacks are registered in another
+ // flush they do not populate the existing set
+ const quietFns = this._whenQuietFns;
+ this._whenQuietFns = [];
+ if (players.length) {
+ optimizeGroupPlayer(players).onDone(() => {
+ quietFns.forEach(fn => fn());
+ });
+ } else {
+ quietFns.forEach(fn => fn());
+ }
+ }
}
- process(_input) {}
-}
-AbstractTuiTextfieldHost.ɵfac = function AbstractTuiTextfieldHost_Factory(t) {
- return new (t || AbstractTuiTextfieldHost)(_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.AbstractTuiControl));
-};
-AbstractTuiTextfieldHost.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵɵdefineDirective"]({
- type: AbstractTuiTextfieldHost
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_4__["ɵsetClassMetadata"](AbstractTuiTextfieldHost, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Directive
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_4__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.AbstractTuiControl]
- }]
- }];
- }, null);
-})();
-
-// TODO: Drop any
-function tuiFallbackAccessor(type) {
- return (accessors, fallback) => (accessors === null || accessors === void 0 ? void 0 : accessors.find(accessor => accessor !== fallback && accessor.type === type)) || fallback;
-}
-
-// eslint-disable-next-line @typescript-eslint/naming-convention
-class TuiPositionAccessor {}
-// TODO: Make fallback required
-function tuiPositionAccessorFor(type, fallback) {
- return {
- provide: TuiPositionAccessor,
- deps: fallback ? [[new _angular_core__WEBPACK_IMPORTED_MODULE_4__.SkipSelf(), new _angular_core__WEBPACK_IMPORTED_MODULE_4__.Optional(), TuiPositionAccessor], fallback] : [[new _angular_core__WEBPACK_IMPORTED_MODULE_4__.SkipSelf(), new _angular_core__WEBPACK_IMPORTED_MODULE_4__.Optional(), TuiPositionAccessor]],
- useFactory: tuiFallbackAccessor(type)
- };
-}
-function tuiAsPositionAccessor(useExisting) {
- return {
- provide: TuiPositionAccessor,
- multi: true,
- useExisting
- };
-}
-
-// TODO: Rename to getBoundingClientRect to match the DOM API
-// eslint-disable-next-line @typescript-eslint/naming-convention
-class TuiRectAccessor {}
-function tuiRectAccessorFor(type, fallback) {
- return {
- provide: TuiRectAccessor,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_4__.SkipSelf(), new _angular_core__WEBPACK_IMPORTED_MODULE_4__.Optional(), TuiRectAccessor], fallback],
- useFactory: tuiFallbackAccessor(type)
- };
-}
-const tuiFallbackRectAccessor = tuiFallbackAccessor;
-function tuiAsRectAccessor(useExisting) {
- return {
- provide: TuiRectAccessor,
- multi: true,
- useExisting
- };
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 6270:
-/*!**************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-animations.js ***!
- \**************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiDropdownAnimation: () => (/* binding */ tuiDropdownAnimation),
-/* harmony export */ tuiFadeIn: () => (/* binding */ tuiFadeIn),
-/* harmony export */ tuiFadeInBottom: () => (/* binding */ tuiFadeInBottom),
-/* harmony export */ tuiFadeInList: () => (/* binding */ tuiFadeInList),
-/* harmony export */ tuiFadeInTop: () => (/* binding */ tuiFadeInTop),
-/* harmony export */ tuiHeightCollapse: () => (/* binding */ tuiHeightCollapse),
-/* harmony export */ tuiHeightCollapseList: () => (/* binding */ tuiHeightCollapseList),
-/* harmony export */ tuiPop: () => (/* binding */ tuiPop),
-/* harmony export */ tuiScaleIn: () => (/* binding */ tuiScaleIn),
-/* harmony export */ tuiScaleInList: () => (/* binding */ tuiScaleInList),
-/* harmony export */ tuiSlideIn: () => (/* binding */ tuiSlideIn),
-/* harmony export */ tuiSlideInBottom: () => (/* binding */ tuiSlideInBottom),
-/* harmony export */ tuiSlideInBottomList: () => (/* binding */ tuiSlideInBottomList),
-/* harmony export */ tuiSlideInLeft: () => (/* binding */ tuiSlideInLeft),
-/* harmony export */ tuiSlideInLeftList: () => (/* binding */ tuiSlideInLeftList),
-/* harmony export */ tuiSlideInRight: () => (/* binding */ tuiSlideInRight),
-/* harmony export */ tuiSlideInRightList: () => (/* binding */ tuiSlideInRightList),
-/* harmony export */ tuiSlideInTop: () => (/* binding */ tuiSlideInTop),
-/* harmony export */ tuiSlideInTopList: () => (/* binding */ tuiSlideInTopList),
-/* harmony export */ tuiWidthCollapse: () => (/* binding */ tuiWidthCollapse),
-/* harmony export */ tuiWidthCollapseList: () => (/* binding */ tuiWidthCollapseList)
-/* harmony export */ });
-/* harmony import */ var _angular_animations__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/animations */ 2015);
-
-const TRANSITION = '{{duration}}ms ease-in-out';
-const DURATION = {
- params: {
- duration: 300
+ reportError(errors) {
+ throw triggerTransitionsFailed(errors);
}
-};
-const STAGGER = 300;
-const tuiHeightCollapse = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiHeightCollapse', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- height: 0
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- height: '*'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- height: '*'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- height: 0
-}))], DURATION)]);
-const tuiHeightCollapseList = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiHeightCollapseList', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- height: 0
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- height: '*'
-}))])], {
- optional: true
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- height: '*'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- height: 0
-}))])], {
- optional: true
-})], DURATION)]);
-const tuiWidthCollapse = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiWidthCollapse', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- width: 0
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- width: '*'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- width: '*'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- width: 0
-}))], DURATION)]);
-const tuiWidthCollapseList = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiWidthCollapseList', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- width: 0
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- width: '*'
-}))])], {
- optional: true
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- width: '*'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- width: 0
-}))])], {
- optional: true
-})], DURATION)]);
-const tuiFadeIn = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiFadeIn', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- opacity: 0
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- opacity: 1
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- opacity: 1
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- opacity: 0
-}))], DURATION)]);
-const tuiFadeInList = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiFadeInList', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- opacity: 0
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- opacity: 1
-}))])], {
- optional: true
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- opacity: 1
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- opacity: 0
-}))])], {
- optional: true
-})], DURATION)]);
-const tuiFadeInTop = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiFadeInTop', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(-10px)',
- opacity: 0
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)',
- opacity: 1
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)',
- opacity: 1
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(-10px)',
- opacity: 0
-}))], DURATION)]);
-const tuiFadeInBottom = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiFadeInBottom', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(10px)',
- opacity: 0
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)',
- opacity: 1
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)',
- opacity: 1
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(10px)',
- opacity: 0
-}))], DURATION)]);
-const tuiDropdownAnimation = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiDropdownAnimation', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(-10px)',
- opacity: 0
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)',
- opacity: 1
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)',
- opacity: 1
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(-10px)',
- opacity: 0
-}))], DURATION)]);
-const tuiScaleIn = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiScaleIn', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(1)'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(1)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(0)'
-}))], DURATION)]);
-const tuiPop = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiPop', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(1.1)'
-})), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(1)'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(1)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(1.1)'
-})), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(0)'
-}))], DURATION)]);
-const tuiScaleInList = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiScaleInList', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(1)'
-}))])], {
- optional: true
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(1)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'scale(0)'
-}))])], {
- optional: true
-})], DURATION)]);
-const tuiSlideIn = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiSlideIn', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => left', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(-100%)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('left => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(-100%)'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => right', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(100%)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('right => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(100%)'
-}))], DURATION)]);
-const tuiSlideInLeft = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiSlideInLeft', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(-100%)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(-100%)'
-}))], DURATION)]);
-const tuiSlideInLeftList = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiSlideInLeftList', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(-100%)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}))])], {
- optional: true
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(-100%)'
-}))])], {
- optional: true
-})], DURATION)]);
-const tuiSlideInRight = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiSlideInRight', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(100%)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(100%)'
-}))], DURATION)]);
-const tuiSlideInRightList = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiSlideInRightList', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(100%)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}))])], {
- optional: true
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateX(100%)'
-}))])], {
- optional: true
-})], DURATION)]);
-const tuiSlideInTop = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiSlideInTop', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translate3d(0,{{start}},0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translate3d(0,{{end}},0)'
-}))], {
- params: {
- end: 0,
- start: '100%',
- duration: 300
- }
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translate3d(0,{{end}},0)',
- pointerEvents: 'none'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translate3d(0,{{start}},0)'
-}))], {
- params: {
- end: 0,
- start: '100%',
- duration: 300
- }
-})]);
-const tuiSlideInTopList = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiSlideInTopList', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(100%)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)'
-}))])], {
- optional: true
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(100%)'
-}))])], {
- optional: true
-})], DURATION)]);
-const tuiSlideInBottom = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiSlideInBottom', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(-100%)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)'
-}))], DURATION), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(-100%)'
-}))], DURATION)]);
-const tuiSlideInBottomList = (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.trigger)('tuiSlideInBottomList', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.transition)('* => *', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':enter', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(-100%)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)'
-}))])], {
- optional: true
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.query)(':leave', [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(0)'
-}), (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.stagger)(STAGGER, [(0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.animate)(TRANSITION, (0,_angular_animations__WEBPACK_IMPORTED_MODULE_0__.style)({
- transform: 'translateY(-100%)'
-}))])], {
- optional: true
-})], DURATION)]);
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3330:
-/*!********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-alert.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_ALERT_POSITION: () => (/* binding */ TUI_ALERT_POSITION),
-/* harmony export */ TuiAlertComponent: () => (/* binding */ TuiAlertComponent),
-/* harmony export */ TuiAlertDirective: () => (/* binding */ TuiAlertDirective),
-/* harmony export */ TuiAlertModule: () => (/* binding */ TuiAlertModule),
-/* harmony export */ TuiAlertService: () => (/* binding */ TuiAlertService)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @taiga-ui/core/animations */ 6270);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 5219);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 7066);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 6689);
-/* harmony import */ var _taiga_ui_core_components_notification__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/core/components/notification */ 1273);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-function TuiAlertComponent_label_1_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const text_r3 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r3, " ");
- }
-}
-function TuiAlertComponent_label_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "label", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiAlertComponent_label_1_ng_container_1_Template, 2, 1, "ng-container", 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r0.item.label)("polymorpheusOutletContext", ctx_r0.item);
- }
-}
-function TuiAlertComponent_div_3_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "div", 6);
- }
- if (rf & 2) {
- const text_r4 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("innerHTML", text_r4, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]);
- }
-}
-const TUI_ALERT_POSITION = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateTokenFromFactory)(() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.TUI_IS_MOBILE) ? '1rem 1rem 0 auto' : '2rem 3rem 0 auto');
-
-// TODO: get rid of $any in template
-class TuiAlertComponent {
- constructor(el, destroy$, position, options, item) {
- this.el = el;
- this.destroy$ = destroy$;
- this.position = position;
- this.options = options;
- this.item = item;
- this.autoClose = typeof this.item.autoClose === 'function' ? this.item.autoClose(this.item.status) : this.item.autoClose;
- this.animation = this.position.endsWith('auto') ? Object.assign(Object.assign({}, this.options), {
- value: 'right'
- }) : Object.assign(Object.assign({}, this.options), {
- value: 'left'
+ _flushAnimations(cleanupFns, microtaskId) {
+ const subTimelines = new ElementInstructionMap();
+ const skippedPlayers = [];
+ const skippedPlayersMap = new Map();
+ const queuedInstructions = [];
+ const queriedElements = new Map();
+ const allPreStyleElements = new Map();
+ const allPostStyleElements = new Map();
+ const disabledElementsSet = new Set();
+ this.disabledNodes.forEach(node => {
+ disabledElementsSet.add(node);
+ const nodesThatAreDisabled = this.driver.query(node, QUEUED_SELECTOR, true);
+ for (let i = 0; i < nodesThatAreDisabled.length; i++) {
+ disabledElementsSet.add(nodesThatAreDisabled[i]);
+ }
});
- }
- ngOnInit() {
- this.initAutoClose();
- }
- close() {
- this.item.$implicit.complete();
- }
- initAutoClose() {
- if (!this.autoClose) {
- return;
- }
- (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.timer)((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiIsNumber)(this.autoClose) ? this.autoClose : 3000).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.takeUntil)((0,rxjs__WEBPACK_IMPORTED_MODULE_5__.fromEvent)(this.el.nativeElement, 'mouseenter')),
- /**
- * TODO: replace to
- * repeat({
- * delay: () => fromEvent(this.el.nativeElement, 'mouseleave'),
- * })
- *
- * in RxJS 7
- */
- // eslint-disable-next-line rxjs/no-ignored-notifier
- (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.repeatWhen)(() => (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.fromEvent)(this.el.nativeElement, 'mouseleave')), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.takeUntil)(this.destroy$)).subscribe(() => this.close());
- }
-}
-TuiAlertComponent.ɵfac = function TuiAlertComponent_Factory(t) {
- return new (t || TuiAlertComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_ALERT_POSITION), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_ANIMATION_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__.POLYMORPHEUS_CONTEXT));
-};
-TuiAlertComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiAlertComponent,
- selectors: [["tui-alert"]],
- hostAttrs: ["role", "alert"],
- hostVars: 5,
- hostBindings: function TuiAlertComponent_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsyntheticHostProperty"]("@tuiFadeIn", ctx.options)("@tuiSlideIn", ctx.animation)("@tuiHeightCollapse", ctx.animation);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("margin", ctx.position);
+ const bodyNode = this.bodyNode;
+ const allTriggerElements = Array.from(this.statesByElement.keys());
+ const enterNodeMap = buildRootMap(allTriggerElements, this.collectedEnterElements);
+ // this must occur before the instructions are built below such that
+ // the :enter queries match the elements (since the timeline queries
+ // are fired during instruction building).
+ const enterNodeMapIds = new Map();
+ let i = 0;
+ enterNodeMap.forEach((nodes, root) => {
+ const className = ENTER_CLASSNAME + i++;
+ enterNodeMapIds.set(root, className);
+ nodes.forEach(node => addClass(node, className));
+ });
+ const allLeaveNodes = [];
+ const mergedLeaveNodes = new Set();
+ const leaveNodesWithoutAnimations = new Set();
+ for (let i = 0; i < this.collectedLeaveElements.length; i++) {
+ const element = this.collectedLeaveElements[i];
+ const details = element[REMOVAL_FLAG];
+ if (details && details.setForRemoval) {
+ allLeaveNodes.push(element);
+ mergedLeaveNodes.add(element);
+ if (details.hasAnimation) {
+ this.driver.query(element, STAR_SELECTOR, true).forEach(elm => mergedLeaveNodes.add(elm));
+ } else {
+ leaveNodesWithoutAnimations.add(element);
+ }
+ }
}
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService])],
- decls: 4,
- vars: 7,
- consts: [[3, "hasIcon", "hideClose", "icon", "status", "close"], ["automation-id", "tui-notification-alert__heading", "class", "t-heading", 4, "ngIf"], ["automation-id", "tui-notification-alert__content", 1, "t-content"], [3, "innerHTML", 4, "polymorpheusOutlet", "polymorpheusOutletContext"], ["automation-id", "tui-notification-alert__heading", 1, "t-heading"], [4, "polymorpheusOutlet", "polymorpheusOutletContext"], [3, "innerHTML"]],
- template: function TuiAlertComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "tui-notification", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("close", function TuiAlertComponent_Template_tui_notification_close_0_listener() {
- return ctx.close();
+ const leaveNodeMapIds = new Map();
+ const leaveNodeMap = buildRootMap(allTriggerElements, Array.from(mergedLeaveNodes));
+ leaveNodeMap.forEach((nodes, root) => {
+ const className = LEAVE_CLASSNAME + i++;
+ leaveNodeMapIds.set(root, className);
+ nodes.forEach(node => addClass(node, className));
+ });
+ cleanupFns.push(() => {
+ enterNodeMap.forEach((nodes, root) => {
+ const className = enterNodeMapIds.get(root);
+ nodes.forEach(node => removeClass(node, className));
+ });
+ leaveNodeMap.forEach((nodes, root) => {
+ const className = leaveNodeMapIds.get(root);
+ nodes.forEach(node => removeClass(node, className));
+ });
+ allLeaveNodes.forEach(element => {
+ this.processLeaveNode(element);
+ });
+ });
+ const allPlayers = [];
+ const erroneousTransitions = [];
+ for (let i = this._namespaceList.length - 1; i >= 0; i--) {
+ const ns = this._namespaceList[i];
+ ns.drainQueuedTransitions(microtaskId).forEach(entry => {
+ const player = entry.player;
+ const element = entry.element;
+ allPlayers.push(player);
+ if (this.collectedEnterElements.length) {
+ const details = element[REMOVAL_FLAG];
+ // animations for move operations (elements being removed and reinserted,
+ // e.g. when the order of an *ngFor list changes) are currently not supported
+ if (details && details.setForMove) {
+ if (details.previousTriggersValues && details.previousTriggersValues.has(entry.triggerName)) {
+ const previousValue = details.previousTriggersValues.get(entry.triggerName);
+ // we need to restore the previous trigger value since the element has
+ // only been moved and hasn't actually left the DOM
+ const triggersWithStates = this.statesByElement.get(entry.element);
+ if (triggersWithStates && triggersWithStates.has(entry.triggerName)) {
+ const state = triggersWithStates.get(entry.triggerName);
+ state.value = previousValue;
+ triggersWithStates.set(entry.triggerName, state);
+ }
+ }
+ player.destroy();
+ return;
+ }
+ }
+ const nodeIsOrphaned = !bodyNode || !this.driver.containsElement(bodyNode, element);
+ const leaveClassName = leaveNodeMapIds.get(element);
+ const enterClassName = enterNodeMapIds.get(element);
+ const instruction = this._buildInstruction(entry, subTimelines, enterClassName, leaveClassName, nodeIsOrphaned);
+ if (instruction.errors && instruction.errors.length) {
+ erroneousTransitions.push(instruction);
+ return;
+ }
+ // even though the element may not be in the DOM, it may still
+ // be added at a later point (due to the mechanics of content
+ // projection and/or dynamic component insertion) therefore it's
+ // important to still style the element.
+ if (nodeIsOrphaned) {
+ player.onStart(() => eraseStyles(element, instruction.fromStyles));
+ player.onDestroy(() => setStyles(element, instruction.toStyles));
+ skippedPlayers.push(player);
+ return;
+ }
+ // if an unmatched transition is queued and ready to go
+ // then it SHOULD NOT render an animation and cancel the
+ // previously running animations.
+ if (entry.isFallbackTransition) {
+ player.onStart(() => eraseStyles(element, instruction.fromStyles));
+ player.onDestroy(() => setStyles(element, instruction.toStyles));
+ skippedPlayers.push(player);
+ return;
+ }
+ // this means that if a parent animation uses this animation as a sub-trigger
+ // then it will instruct the timeline builder not to add a player delay, but
+ // instead stretch the first keyframe gap until the animation starts. This is
+ // important in order to prevent extra initialization styles from being
+ // required by the user for the animation.
+ const timelines = [];
+ instruction.timelines.forEach(tl => {
+ tl.stretchStartingKeyframe = true;
+ if (!this.disabledNodes.has(tl.element)) {
+ timelines.push(tl);
+ }
+ });
+ instruction.timelines = timelines;
+ subTimelines.append(element, instruction.timelines);
+ const tuple = {
+ instruction,
+ player,
+ element
+ };
+ queuedInstructions.push(tuple);
+ instruction.queriedElements.forEach(element => getOrSetDefaultValue(queriedElements, element, []).push(player));
+ instruction.preStyleProps.forEach((stringMap, element) => {
+ if (stringMap.size) {
+ let setVal = allPreStyleElements.get(element);
+ if (!setVal) {
+ allPreStyleElements.set(element, setVal = new Set());
+ }
+ stringMap.forEach((_, prop) => setVal.add(prop));
+ }
+ });
+ instruction.postStyleProps.forEach((stringMap, element) => {
+ let setVal = allPostStyleElements.get(element);
+ if (!setVal) {
+ allPostStyleElements.set(element, setVal = new Set());
+ }
+ stringMap.forEach((_, prop) => setVal.add(prop));
+ });
});
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiAlertComponent_label_1_Template, 2, 2, "label", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](3, TuiAlertComponent_div_3_Template, 1, 1, "div", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("hasIcon", ctx.item.hasIcon)("hideClose", !ctx.item.hasCloseButton)("icon", ctx.item.icon)("status", ctx.item.status);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.item.label);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx.item.content)("polymorpheusOutletContext", ctx.item);
+ if (erroneousTransitions.length) {
+ const errors = [];
+ erroneousTransitions.forEach(instruction => {
+ errors.push(transitionFailed(instruction.triggerName, instruction.errors));
+ });
+ allPlayers.forEach(player => player.destroy());
+ this.reportError(errors);
}
- },
- dependencies: [_taiga_ui_core_components_notification__WEBPACK_IMPORTED_MODULE_10__.TuiNotificationComponent, _angular_common__WEBPACK_IMPORTED_MODULE_11__.NgIf, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__.PolymorpheusOutletDirective],
- styles: ["[_nghost-%COMP%]{display:block;box-shadow:var(--tui-shadow-dropdown);border-radius:var(--tui-radius-l);width:18rem}[_nghost-%COMP%]:not(:first-child){margin-top:.75rem!important}[_nghost-%COMP%]:not(:last-child){margin-bottom:0!important}.t-heading[_ngcontent-%COMP%]{margin:0}[data-size=s][_ngcontent-%COMP%] .t-heading[_ngcontent-%COMP%]{font:var(--tui-font-text-s);font-weight:bold}[data-size=m][_ngcontent-%COMP%] .t-heading[_ngcontent-%COMP%]{font:var(--tui-font-text-m);line-height:1.25rem;font-weight:bold}[data-size=l][_ngcontent-%COMP%] .t-heading[_ngcontent-%COMP%]{font:var(--tui-font-text-l);line-height:1.5rem;font-weight:bold}.t-content[_ngcontent-%COMP%]{color:var(--tui-text-01);word-wrap:break-word;word-break:break-word}.t-content[_ngcontent-%COMP%]:empty{display:none}"],
- data: {
- animation: [_taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_12__.tuiFadeIn, _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_12__.tuiSlideIn, _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_12__.tuiHeightCollapse]
- },
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAlertComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-alert',
- templateUrl: './alert.template.html',
- styleUrls: ['./alert.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService],
- animations: [_taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_12__.tuiFadeIn, _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_12__.tuiSlideIn, _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_12__.tuiHeightCollapse],
- host: {
- role: 'alert',
- '[style.margin]': 'position',
- '[@tuiFadeIn]': 'options',
- '[@tuiSlideIn]': 'animation',
- '[@tuiHeightCollapse]': 'animation'
+ const allPreviousPlayersMap = new Map();
+ // this map tells us which element in the DOM tree is contained by
+ // which animation. Further down this map will get populated once
+ // the players are built and in doing so we can use it to efficiently
+ // figure out if a sub player is skipped due to a parent player having priority.
+ const animationElementMap = new Map();
+ queuedInstructions.forEach(entry => {
+ const element = entry.element;
+ if (subTimelines.has(element)) {
+ animationElementMap.set(element, element);
+ this._beforeAnimationBuild(entry.player.namespaceId, entry.instruction, allPreviousPlayersMap);
}
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_ALERT_POSITION]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_ANIMATION_OPTIONS]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__.POLYMORPHEUS_CONTEXT]
- }]
- }];
- }, null);
-})();
-class TuiAlertService extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__.AbstractTuiDialogService {
- constructor(defaultOptions, idService) {
- super(idService);
- this.defaultOptions = defaultOptions;
- this.component = new _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__.PolymorpheusComponent(TuiAlertComponent);
- }
-}
-TuiAlertService.ɵfac = function TuiAlertService_Factory(t) {
- return new (t || TuiAlertService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_NOTIFICATION_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiIdService));
-};
-TuiAlertService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
- token: TuiAlertService,
- factory: TuiAlertService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAlertService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_8__.TUI_NOTIFICATION_OPTIONS]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiIdService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiIdService]
- }]
- }];
- }, null);
-})();
-class TuiAlertDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__.AbstractTuiDialogDirective {}
-TuiAlertDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiAlertDirective_BaseFactory;
- return function TuiAlertDirective_Factory(t) {
- return (ɵTuiAlertDirective_BaseFactory || (ɵTuiAlertDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](TuiAlertDirective)))(t || TuiAlertDirective);
- };
-}();
-TuiAlertDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiAlertDirective,
- selectors: [["ng-template", "tuiAlert", ""]],
- inputs: {
- options: ["tuiAlertOptions", "options"],
- open: ["tuiAlert", "open"]
- },
- outputs: {
- openChange: "tuiAlertChange"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__.AbstractTuiDialogService,
- useExisting: TuiAlertService
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAlertDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: 'ng-template[tuiAlert]',
- inputs: ['options: tuiAlertOptions', 'open: tuiAlert'],
- outputs: ['openChange: tuiAlertChange'],
- providers: [{
- provide: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__.AbstractTuiDialogService,
- useExisting: TuiAlertService
- }]
- }]
- }], null, null);
-})();
-class TuiAlertModule {}
-TuiAlertModule.ɵfac = function TuiAlertModule_Factory(t) {
- return new (t || TuiAlertModule)();
-};
-TuiAlertModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiAlertModule
-});
-TuiAlertModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiAsAlerts)(TuiAlertService)],
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_11__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__.PolymorpheusModule, _taiga_ui_core_components_notification__WEBPACK_IMPORTED_MODULE_10__.TuiNotificationModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAlertModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_11__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__.PolymorpheusModule, _taiga_ui_core_components_notification__WEBPACK_IMPORTED_MODULE_10__.TuiNotificationModule],
- declarations: [TuiAlertComponent, TuiAlertDirective],
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiAsAlerts)(TuiAlertService)],
- exports: [TuiAlertComponent, TuiAlertDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3474:
-/*!*********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-button.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_BUTTON_DEFAULT_OPTIONS: () => (/* binding */ TUI_BUTTON_DEFAULT_OPTIONS),
-/* harmony export */ TUI_BUTTON_OPTIONS: () => (/* binding */ TUI_BUTTON_OPTIONS),
-/* harmony export */ TuiButtonComponent: () => (/* binding */ TuiButtonComponent),
-/* harmony export */ TuiButtonModule: () => (/* binding */ TuiButtonModule),
-/* harmony export */ tuiButtonOptionsProvider: () => (/* binding */ tuiButtonOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/core/directives */ 7279);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 523);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/core/enums */ 4715);
-/* harmony import */ var _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @taiga-ui/core/components/svg */ 3442);
-/* harmony import */ var _taiga_ui_core_components_loader__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/core/components/loader */ 6645);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/core/directives/wrapper */ 8001);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-const _c0 = ["tuiButton", ""];
-function TuiButtonComponent_ng_container_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainer"](0);
- }
-}
-function TuiButtonComponent_span_4_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 8);
+ });
+ skippedPlayers.forEach(player => {
+ const element = player.element;
+ const previousPlayers = this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null);
+ previousPlayers.forEach(prevPlayer => {
+ getOrSetDefaultValue(allPreviousPlayersMap, element, []).push(prevPlayer);
+ prevPlayer.destroy();
+ });
+ });
+ // this is a special case for nodes that will be removed either by
+ // having their own leave animations or by being queried in a container
+ // that will be removed once a parent animation is complete. The idea
+ // here is that * styles must be identical to ! styles because of
+ // backwards compatibility (* is also filled in by default in many places).
+ // Otherwise * styles will return an empty value or "auto" since the element
+ // passed to getComputedStyle will not be visible (since * === destination)
+ const replaceNodes = allLeaveNodes.filter(node => {
+ return replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements);
+ });
+ // POST STAGE: fill the * styles
+ const postStylesMap = new Map();
+ const allLeaveQueriedNodes = cloakAndComputeStyles(postStylesMap, this.driver, leaveNodesWithoutAnimations, allPostStyleElements, _angular_animations__WEBPACK_IMPORTED_MODULE_1__.AUTO_STYLE);
+ allLeaveQueriedNodes.forEach(node => {
+ if (replacePostStylesAsPre(node, allPreStyleElements, allPostStyleElements)) {
+ replaceNodes.push(node);
+ }
+ });
+ // PRE STAGE: fill the ! styles
+ const preStylesMap = new Map();
+ enterNodeMap.forEach((nodes, root) => {
+ cloakAndComputeStyles(preStylesMap, this.driver, new Set(nodes), allPreStyleElements, _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵPRE_STYLE"]);
+ });
+ replaceNodes.forEach(node => {
+ const post = postStylesMap.get(node);
+ const pre = preStylesMap.get(node);
+ postStylesMap.set(node, new Map([...(post?.entries() ?? []), ...(pre?.entries() ?? [])]));
+ });
+ const rootPlayers = [];
+ const subPlayers = [];
+ const NO_PARENT_ANIMATION_ELEMENT_DETECTED = {};
+ queuedInstructions.forEach(entry => {
+ const {
+ element,
+ player,
+ instruction
+ } = entry;
+ // this means that it was never consumed by a parent animation which
+ // means that it is independent and therefore should be set for animation
+ if (subTimelines.has(element)) {
+ if (disabledElementsSet.has(element)) {
+ player.onDestroy(() => setStyles(element, instruction.toStyles));
+ player.disabled = true;
+ player.overrideTotalTime(instruction.totalTime);
+ skippedPlayers.push(player);
+ return;
+ }
+ // this will flow up the DOM and query the map to figure out
+ // if a parent animation has priority over it. In the situation
+ // that a parent is detected then it will cancel the loop. If
+ // nothing is detected, or it takes a few hops to find a parent,
+ // then it will fill in the missing nodes and signal them as having
+ // a detected parent (or a NO_PARENT value via a special constant).
+ let parentWithAnimation = NO_PARENT_ANIMATION_ELEMENT_DETECTED;
+ if (animationElementMap.size > 1) {
+ let elm = element;
+ const parentsToAdd = [];
+ while (elm = elm.parentNode) {
+ const detectedParent = animationElementMap.get(elm);
+ if (detectedParent) {
+ parentWithAnimation = detectedParent;
+ break;
+ }
+ parentsToAdd.push(elm);
+ }
+ parentsToAdd.forEach(parent => animationElementMap.set(parent, parentWithAnimation));
+ }
+ const innerPlayer = this._buildAnimation(player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap);
+ player.setRealPlayer(innerPlayer);
+ if (parentWithAnimation === NO_PARENT_ANIMATION_ELEMENT_DETECTED) {
+ rootPlayers.push(player);
+ } else {
+ const parentPlayers = this.playersByElement.get(parentWithAnimation);
+ if (parentPlayers && parentPlayers.length) {
+ player.parentPlayer = optimizeGroupPlayer(parentPlayers);
+ }
+ skippedPlayers.push(player);
+ }
+ } else {
+ eraseStyles(element, instruction.fromStyles);
+ player.onDestroy(() => setStyles(element, instruction.toStyles));
+ // there still might be a ancestor player animating this
+ // element therefore we will still add it as a sub player
+ // even if its animation may be disabled
+ subPlayers.push(player);
+ if (disabledElementsSet.has(element)) {
+ skippedPlayers.push(player);
+ }
+ }
+ });
+ // find all of the sub players' corresponding inner animation players
+ subPlayers.forEach(player => {
+ // even if no players are found for a sub animation it
+ // will still complete itself after the next tick since it's Noop
+ const playersForElement = skippedPlayersMap.get(player.element);
+ if (playersForElement && playersForElement.length) {
+ const innerPlayer = optimizeGroupPlayer(playersForElement);
+ player.setRealPlayer(innerPlayer);
+ }
+ });
+ // the reason why we don't actually play the animation is
+ // because all that a skipped player is designed to do is to
+ // fire the start/done transition callback events
+ skippedPlayers.forEach(player => {
+ if (player.parentPlayer) {
+ player.syncPlayerEvents(player.parentPlayer);
+ } else {
+ player.destroy();
+ }
+ });
+ // run through all of the queued removals and see if they
+ // were picked up by a query. If not then perform the removal
+ // operation right away unless a parent animation is ongoing.
+ for (let i = 0; i < allLeaveNodes.length; i++) {
+ const element = allLeaveNodes[i];
+ const details = element[REMOVAL_FLAG];
+ removeClass(element, LEAVE_CLASSNAME);
+ // this means the element has a removal animation that is being
+ // taken care of and therefore the inner elements will hang around
+ // until that animation is over (or the parent queried animation)
+ if (details && details.hasAnimation) continue;
+ let players = [];
+ // if this element is queried or if it contains queried children
+ // then we want for the element not to be removed from the page
+ // until the queried animations have finished
+ if (queriedElements.size) {
+ let queriedPlayerResults = queriedElements.get(element);
+ if (queriedPlayerResults && queriedPlayerResults.length) {
+ players.push(...queriedPlayerResults);
+ }
+ let queriedInnerElements = this.driver.query(element, NG_ANIMATING_SELECTOR, true);
+ for (let j = 0; j < queriedInnerElements.length; j++) {
+ let queriedPlayers = queriedElements.get(queriedInnerElements[j]);
+ if (queriedPlayers && queriedPlayers.length) {
+ players.push(...queriedPlayers);
+ }
+ }
+ }
+ const activePlayers = players.filter(p => !p.destroyed);
+ if (activePlayers.length) {
+ removeNodesAfterAnimationDone(this, element, activePlayers);
+ } else {
+ this.processLeaveNode(element);
+ }
+ }
+ // this is required so the cleanup method doesn't remove them
+ allLeaveNodes.length = 0;
+ rootPlayers.forEach(player => {
+ this.players.push(player);
+ player.onDone(() => {
+ player.destroy();
+ const index = this.players.indexOf(player);
+ this.players.splice(index, 1);
+ });
+ player.play();
+ });
+ return rootPlayers;
}
- if (rf & 2) {
- const text_r5 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", text_r5);
+ afterFlush(callback) {
+ this._flushFns.push(callback);
}
-}
-function TuiButtonComponent_span_4_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "span", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiButtonComponent_span_4_tui_svg_1_Template, 1, 1, "tui-svg", 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+ afterFlushAnimationsDone(callback) {
+ this._whenQuietFns.push(callback);
}
- if (rf & 2) {
- const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r1.icon);
+ _getPreviousPlayers(element, isQueriedElement, namespaceId, triggerName, toStateValue) {
+ let players = [];
+ if (isQueriedElement) {
+ const queriedElementPlayers = this.playersByQueriedElement.get(element);
+ if (queriedElementPlayers) {
+ players = queriedElementPlayers;
+ }
+ } else {
+ const elementPlayers = this.playersByElement.get(element);
+ if (elementPlayers) {
+ const isRemovalAnimation = !toStateValue || toStateValue == VOID_VALUE;
+ elementPlayers.forEach(player => {
+ if (player.queued) return;
+ if (!isRemovalAnimation && player.triggerName != triggerName) return;
+ players.push(player);
+ });
+ }
+ }
+ if (namespaceId || triggerName) {
+ players = players.filter(player => {
+ if (namespaceId && namespaceId != player.namespaceId) return false;
+ if (triggerName && triggerName != player.triggerName) return false;
+ return true;
+ });
+ }
+ return players;
}
-}
-function TuiButtonComponent_span_6_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 8);
+ _beforeAnimationBuild(namespaceId, instruction, allPreviousPlayersMap) {
+ const triggerName = instruction.triggerName;
+ const rootElement = instruction.element;
+ // when a removal animation occurs, ALL previous players are collected
+ // and destroyed (even if they are outside of the current namespace)
+ const targetNameSpaceId = instruction.isRemovalTransition ? undefined : namespaceId;
+ const targetTriggerName = instruction.isRemovalTransition ? undefined : triggerName;
+ for (const timelineInstruction of instruction.timelines) {
+ const element = timelineInstruction.element;
+ const isQueriedElement = element !== rootElement;
+ const players = getOrSetDefaultValue(allPreviousPlayersMap, element, []);
+ const previousPlayers = this._getPreviousPlayers(element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState);
+ previousPlayers.forEach(player => {
+ const realPlayer = player.getRealPlayer();
+ if (realPlayer.beforeDestroy) {
+ realPlayer.beforeDestroy();
+ }
+ player.destroy();
+ players.push(player);
+ });
+ }
+ // this needs to be done so that the PRE/POST styles can be
+ // computed properly without interfering with the previous animation
+ eraseStyles(rootElement, instruction.fromStyles);
}
- if (rf & 2) {
- const text_r7 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", text_r7);
+ _buildAnimation(namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap) {
+ const triggerName = instruction.triggerName;
+ const rootElement = instruction.element;
+ // we first run this so that the previous animation player
+ // data can be passed into the successive animation players
+ const allQueriedPlayers = [];
+ const allConsumedElements = new Set();
+ const allSubElements = new Set();
+ const allNewPlayers = instruction.timelines.map(timelineInstruction => {
+ const element = timelineInstruction.element;
+ allConsumedElements.add(element);
+ // FIXME (matsko): make sure to-be-removed animations are removed properly
+ const details = element[REMOVAL_FLAG];
+ if (details && details.removedBeforeQueried) return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__.NoopAnimationPlayer(timelineInstruction.duration, timelineInstruction.delay);
+ const isQueriedElement = element !== rootElement;
+ const previousPlayers = flattenGroupPlayers((allPreviousPlayersMap.get(element) || EMPTY_PLAYER_ARRAY).map(p => p.getRealPlayer())).filter(p => {
+ // the `element` is not apart of the AnimationPlayer definition, but
+ // Mock/WebAnimations
+ // use the element within their implementation. This will be added in Angular5 to
+ // AnimationPlayer
+ const pp = p;
+ return pp.element ? pp.element === element : false;
+ });
+ const preStyles = preStylesMap.get(element);
+ const postStyles = postStylesMap.get(element);
+ const keyframes = normalizeKeyframes$1(this._normalizer, timelineInstruction.keyframes, preStyles, postStyles);
+ const player = this._buildPlayer(timelineInstruction, keyframes, previousPlayers);
+ // this means that this particular player belongs to a sub trigger. It is
+ // important that we match this player up with the corresponding (@trigger.listener)
+ if (timelineInstruction.subTimeline && skippedPlayersMap) {
+ allSubElements.add(element);
+ }
+ if (isQueriedElement) {
+ const wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element);
+ wrappedPlayer.setRealPlayer(player);
+ allQueriedPlayers.push(wrappedPlayer);
+ }
+ return player;
+ });
+ allQueriedPlayers.forEach(player => {
+ getOrSetDefaultValue(this.playersByQueriedElement, player.element, []).push(player);
+ player.onDone(() => deleteOrUnsetInMap(this.playersByQueriedElement, player.element, player));
+ });
+ allConsumedElements.forEach(element => addClass(element, NG_ANIMATING_CLASSNAME));
+ const player = optimizeGroupPlayer(allNewPlayers);
+ player.onDestroy(() => {
+ allConsumedElements.forEach(element => removeClass(element, NG_ANIMATING_CLASSNAME));
+ setStyles(rootElement, instruction.toStyles);
+ });
+ // this basically makes all of the callbacks for sub element animations
+ // be dependent on the upper players for when they finish
+ allSubElements.forEach(element => {
+ getOrSetDefaultValue(skippedPlayersMap, element, []).push(player);
+ });
+ return player;
+ }
+ _buildPlayer(instruction, keyframes, previousPlayers) {
+ if (keyframes.length > 0) {
+ return this.driver.animate(instruction.element, keyframes, instruction.duration, instruction.delay, instruction.easing, previousPlayers);
+ }
+ // special case for when an empty transition|definition is provided
+ // ... there is no point in rendering an empty animation
+ return new _angular_animations__WEBPACK_IMPORTED_MODULE_1__.NoopAnimationPlayer(instruction.duration, instruction.delay);
}
}
-function TuiButtonComponent_span_6_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "span", 9);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiButtonComponent_span_6_tui_svg_1_Template, 1, 1, "tui-svg", 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+class TransitionAnimationPlayer {
+ constructor(namespaceId, triggerName, element) {
+ this.namespaceId = namespaceId;
+ this.triggerName = triggerName;
+ this.element = element;
+ this._player = new _angular_animations__WEBPACK_IMPORTED_MODULE_1__.NoopAnimationPlayer();
+ this._containsRealPlayer = false;
+ this._queuedCallbacks = new Map();
+ this.destroyed = false;
+ this.parentPlayer = null;
+ this.markedForDestroy = false;
+ this.disabled = false;
+ this.queued = true;
+ this.totalTime = 0;
}
- if (rf & 2) {
- const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r2.iconRight);
+ setRealPlayer(player) {
+ if (this._containsRealPlayer) return;
+ this._player = player;
+ this._queuedCallbacks.forEach((callbacks, phase) => {
+ callbacks.forEach(callback => listenOnPlayer(player, phase, undefined, callback));
+ });
+ this._queuedCallbacks.clear();
+ this._containsRealPlayer = true;
+ this.overrideTotalTime(player.totalTime);
+ this.queued = false;
}
-}
-function TuiButtonComponent_tui_loader_7_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-loader", 10);
+ getRealPlayer() {
+ return this._player;
}
- if (rf & 2) {
- const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("inheritColor", true)("size", ctx_r3.loaderSize);
+ overrideTotalTime(totalTime) {
+ this.totalTime = totalTime;
}
-}
-const _c1 = ["*"];
-const TUI_BUTTON_DEFAULT_OPTIONS = {
- size: 'l',
- shape: null,
- appearance: _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_1__.TuiAppearance.Primary
-};
-/**
- * Default parameters for button component
- */
-const TUI_BUTTON_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiCreateToken)(TUI_BUTTON_DEFAULT_OPTIONS);
-function tuiButtonOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiProvideOptions)(TUI_BUTTON_OPTIONS, options, TUI_BUTTON_DEFAULT_OPTIONS);
-}
-class TuiButtonComponent extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.AbstractTuiInteractive {
- constructor(mode, el, options) {
- var _a;
- super();
- this.mode = mode;
- this.el = el;
- this.options = options;
- this.mode$ = ((_a = this.mode) === null || _a === void 0 ? void 0 : _a.change$) || rxjs__WEBPACK_IMPORTED_MODULE_4__.EMPTY;
- this.appearance = null;
- this.disabled = false;
- this.shape = this.options.shape;
- this.showLoader = false;
- this.size = this.options.size;
- this.appearance$ = this.mode$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.startWith)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.map)(() => this.computedAppearance), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.distinctUntilChanged)());
+ syncPlayerEvents(player) {
+ const p = this._player;
+ if (p.triggerCallback) {
+ player.onStart(() => p.triggerCallback('start'));
+ }
+ player.onDone(() => this.finish());
+ player.onDestroy(() => this.destroy());
}
- get nativeFocusableElement() {
- return this.nativeDisabled ? null : this.el.nativeElement;
+ _queueEvent(name, callback) {
+ getOrSetDefaultValue(this._queuedCallbacks, name, []).push(callback);
}
- get focused() {
- return !this.showLoader && (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.tuiIsNativeFocused)(this.el.nativeElement);
+ onDone(fn) {
+ if (this.queued) {
+ this._queueEvent('done', fn);
+ }
+ this._player.onDone(fn);
}
- get loaderSize() {
- return this.size === 'l' || this.size === 'xl' ? 'm' : 's';
+ onStart(fn) {
+ if (this.queued) {
+ this._queueEvent('start', fn);
+ }
+ this._player.onStart(fn);
}
- get computedAppearance() {
- var _a;
- return (_a = this.appearance) !== null && _a !== void 0 ? _a : this.options.appearance || '';
+ onDestroy(fn) {
+ if (this.queued) {
+ this._queueEvent('destroy', fn);
+ }
+ this._player.onDestroy(fn);
}
- get nativeDisabled() {
- return this.computedDisabled || this.showLoader ? '' : null;
+ init() {
+ this._player.init();
}
- get tabIndex() {
- return this.focusable ? 0 : -1;
+ hasStarted() {
+ return this.queued ? false : this._player.hasStarted();
}
- onFocused(focused) {
- this.updateFocused(focused);
+ play() {
+ !this.queued && this._player.play();
}
-}
-TuiButtonComponent.ɵfac = function TuiButtonComponent_Factory(t) {
- return new (t || TuiButtonComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_9__.TuiModeDirective, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_BUTTON_OPTIONS));
-};
-TuiButtonComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiButtonComponent,
- selectors: [["button", "tuiButton", ""], ["button", "tuiIconButton", ""], ["a", "tuiButton", ""], ["a", "tuiIconButton", ""]],
- hostVars: 7,
- hostBindings: function TuiButtonComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("focusin", function TuiButtonComponent_focusin_HostBindingHandler() {
- return ctx.onFocused(true);
- })("focusout", function TuiButtonComponent_focusout_HostBindingHandler() {
- return ctx.onFocused(false);
- });
+ pause() {
+ !this.queued && this._player.pause();
+ }
+ restart() {
+ !this.queued && this._player.restart();
+ }
+ finish() {
+ this._player.finish();
+ }
+ destroy() {
+ this.destroyed = true;
+ this._player.destroy();
+ }
+ reset() {
+ !this.queued && this._player.reset();
+ }
+ setPosition(p) {
+ if (!this.queued) {
+ this._player.setPosition(p);
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵhostProperty"]("tabIndex", ctx.tabIndex);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-shape", ctx.shape)("data-size", ctx.size)("data-appearance", ctx.computedAppearance)("disabled", ctx.nativeDisabled);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_loading", ctx.showLoader);
+ }
+ getPosition() {
+ return this.queued ? 0 : this._player.getPosition();
+ }
+ /** @internal */
+ triggerCallback(phaseName) {
+ const p = this._player;
+ if (p.triggerCallback) {
+ p.triggerCallback(phaseName);
}
- },
- inputs: {
- appearance: "appearance",
- disabled: "disabled",
- icon: "icon",
- iconRight: "iconRight",
- shape: "shape",
- showLoader: "showLoader",
- size: "size"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiAsFocusableItemAccessor)(TuiButtonComponent), _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiDestroyService]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]],
- attrs: _c0,
- ngContentSelectors: _c1,
- decls: 8,
- vars: 10,
- consts: [[4, "ngIf"], ["tuiWrapper", "", 1, "t-wrapper", 3, "active", "appearance", "disabled", "hover"], [1, "t-content"], ["class", "t-left", 4, "ngIf"], ["class", "t-right", 4, "ngIf"], ["class", "t-loader", 3, "inheritColor", "size", 4, "ngIf"], [1, "t-left"], ["class", "t-icon", 3, "src", 4, "polymorpheusOutlet"], [1, "t-icon", 3, "src"], [1, "t-right"], [1, "t-loader", 3, "inheritColor", "size"]],
- template: function TuiButtonComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiButtonComponent_ng_container_0_Template, 1, 0, "ng-container", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](1, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 1)(3, "span", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](4, TuiButtonComponent_span_4_Template, 2, 1, "span", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](6, TuiButtonComponent_span_6_Template, 2, 1, "span", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](7, TuiButtonComponent_tui_loader_7_Template, 1, 2, "tui-loader", 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+ }
+}
+function deleteOrUnsetInMap(map, key, value) {
+ let currentValues = map.get(key);
+ if (currentValues) {
+ if (currentValues.length) {
+ const index = currentValues.indexOf(value);
+ currentValues.splice(index, 1);
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](1, 8, ctx.appearance$));
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("active", ctx.pseudoActive)("appearance", ctx.computedAppearance)("disabled", ctx.computedDisabled)("hover", ctx.pseudoHover);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.icon);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.iconRight);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.showLoader);
+ if (currentValues.length == 0) {
+ map.delete(key);
}
- },
- dependencies: [_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_12__.TuiSvgComponent, _taiga_ui_core_components_loader__WEBPACK_IMPORTED_MODULE_13__.TuiLoaderComponent, _angular_common__WEBPACK_IMPORTED_MODULE_14__.NgIf, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_15__.TuiWrapperDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_14__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:none;font-size:inherit;line-height:inherit;text-decoration:none;font:var(--tui-font-text-s);color:var(--tui-text-01);position:relative;display:inline-block;flex-shrink:0;vertical-align:top;border-radius:var(--tui-radius-m);-webkit-user-select:none;-moz-user-select:none;user-select:none;outline:none;color:inherit}[_nghost-%COMP%]:disabled{pointer-events:none}[data-shape=rounded][_nghost-%COMP%]{border-radius:6.25rem}[data-size=xs][_nghost-%COMP%]{height:var(--tui-height-xs);font-weight:normal}[data-size=xs][data-shape=square][_nghost-%COMP%], [data-size=xs][tuiIconButton][_nghost-%COMP%]{width:var(--tui-height-xs)}[data-size=s][_nghost-%COMP%]{height:var(--tui-height-s);font-weight:normal}[data-size=s][data-shape=square][_nghost-%COMP%], [data-size=s][tuiIconButton][_nghost-%COMP%]{width:var(--tui-height-s)}[data-size=m][_nghost-%COMP%]{height:var(--tui-height-m);font:var(--tui-font-text-m);font-weight:bold}[data-size=m][data-shape=square][_nghost-%COMP%], [data-size=m][tuiIconButton][_nghost-%COMP%]{width:var(--tui-height-m)}[data-size=l][_nghost-%COMP%]{height:var(--tui-height-l);font:var(--tui-font-text-m);font-weight:bold}[data-size=l][data-shape=square][_nghost-%COMP%], [data-size=l][tuiIconButton][_nghost-%COMP%]{width:var(--tui-height-l)}[data-size=xl][_nghost-%COMP%]{height:3.75rem;font:var(--tui-font-text-m);font-weight:bold}[data-size=xl][data-shape=square][_nghost-%COMP%], [data-size=xl][tuiIconButton][_nghost-%COMP%]{width:3.75rem}[tuiIconButton][_nghost-%COMP%]{font-size:0!important}[tuiIconButton][_nghost-%COMP%] .t-left[_ngcontent-%COMP%], [tuiIconButton][_nghost-%COMP%] .t-right[_ngcontent-%COMP%]{margin:0!important}.t-loader[_ngcontent-%COMP%]{position:absolute;top:0;left:0;width:100%;height:100%;cursor:default}.t-left[_ngcontent-%COMP%]{margin-right:.5rem}[data-size=s][_nghost-%COMP%] .t-left[_ngcontent-%COMP%]{margin-right:.375rem}[data-size=xs][_nghost-%COMP%] .t-left[_ngcontent-%COMP%]{margin-right:.25rem}.t-right[_ngcontent-%COMP%]{margin:0 -.25rem 0 .25rem}[data-size=s][_nghost-%COMP%] .t-right[_ngcontent-%COMP%]{margin:0 -.25rem 0 .375rem}[data-size=xs][_nghost-%COMP%] .t-right[_ngcontent-%COMP%]{margin:0 -.125rem 0 .25rem}.t-icon[_ngcontent-%COMP%]{display:flex;max-width:100%;max-height:100%;align-items:center;justify-content:center}.t-left[_ngcontent-%COMP%], .t-right[_ngcontent-%COMP%]{display:flex;align-items:center;justify-content:center;width:1.5rem;height:1.5rem}[data-size=s][_nghost-%COMP%] .t-left[_ngcontent-%COMP%], [data-size=s][_nghost-%COMP%] .t-right[_ngcontent-%COMP%], [data-size=xs][_nghost-%COMP%] .t-left[_ngcontent-%COMP%], [data-size=xs][_nghost-%COMP%] .t-right[_ngcontent-%COMP%]{width:1rem;height:1rem}[tuiIconButton][data-appearance=icon][data-size=s][_nghost-%COMP%] .t-left[_ngcontent-%COMP%], [tuiIconButton][data-appearance=icon][data-size=s][_nghost-%COMP%] .t-right[_ngcontent-%COMP%], [tuiIconButton][data-appearance=link][data-size=s][_nghost-%COMP%] .t-left[_ngcontent-%COMP%], [tuiIconButton][data-appearance=link][data-size=s][_nghost-%COMP%] .t-right[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem}.t-wrapper[_ngcontent-%COMP%]{box-sizing:border-box;cursor:pointer;isolation:isolate}[data-size=xs][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]{padding:0 var(--tui-padding, .375rem)}[data-size=xs][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]:after{border-width:1px}[data-size=s][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]{padding:0 var(--tui-padding, .75rem)}[data-size=m][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]{padding:0 var(--tui-padding, 1.5rem)}[data-size=l][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]{padding:0 var(--tui-padding, 2.25rem)}[data-size=xl][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]{padding:0 var(--tui-padding, 2.5rem)}[data-shape=square][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%], [tuiIconButton][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]{padding:0}.t-content[_ngcontent-%COMP%]{display:flex;height:100%;align-items:center;justify-content:center;text-align:center}._loading[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{opacity:0}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiButtonComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'button[tuiButton], button[tuiIconButton], a[tuiButton], a[tuiIconButton]',
- templateUrl: './button.template.html',
- styleUrls: ['./button.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiAsFocusableItemAccessor)(TuiButtonComponent), _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiDestroyService]
- }]
- }], function () {
- return [{
- type: _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_9__.TuiModeDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_9__.TuiModeDirective]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_BUTTON_OPTIONS]
- }]
- }];
- }, {
- appearance: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- disabled: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- icon: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- iconRight: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- shape: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-shape']
- }],
- showLoader: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._loading']
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-size']
- }],
- computedAppearance: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-appearance']
- }],
- nativeDisabled: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.disabled']
- }],
- tabIndex: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['tabIndex']
- }],
- onFocused: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['focusin', ['true']]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['focusout', ['false']]
- }]
- });
-})();
-class TuiButtonModule {}
-TuiButtonModule.ɵfac = function TuiButtonModule_Factory(t) {
- return new (t || TuiButtonModule)();
-};
-TuiButtonModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiButtonModule
-});
-TuiButtonModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_14__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__.PolymorpheusModule, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_15__.TuiWrapperModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_12__.TuiSvgModule, _taiga_ui_core_components_loader__WEBPACK_IMPORTED_MODULE_13__.TuiLoaderModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiButtonModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_14__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__.PolymorpheusModule, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_15__.TuiWrapperModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_12__.TuiSvgModule, _taiga_ui_core_components_loader__WEBPACK_IMPORTED_MODULE_13__.TuiLoaderModule],
- declarations: [TuiButtonComponent],
- exports: [TuiButtonComponent]
- }]
- }], null, null);
-})();
+ }
+ return currentValues;
+}
+function normalizeTriggerValue(value) {
+ // we use `!= null` here because it's the most simple
+ // way to test against a "falsy" value without mixing
+ // in empty strings or a zero value. DO NOT OPTIMIZE.
+ return value != null ? value : null;
+}
+function isElementNode(node) {
+ return node && node['nodeType'] === 1;
+}
+function isTriggerEventValid(eventName) {
+ return eventName == 'start' || eventName == 'done';
+}
+function cloakElement(element, value) {
+ const oldValue = element.style.display;
+ element.style.display = value != null ? value : 'none';
+ return oldValue;
+}
+function cloakAndComputeStyles(valuesMap, driver, elements, elementPropsMap, defaultStyle) {
+ const cloakVals = [];
+ elements.forEach(element => cloakVals.push(cloakElement(element)));
+ const failedElements = [];
+ elementPropsMap.forEach((props, element) => {
+ const styles = new Map();
+ props.forEach(prop => {
+ const value = driver.computeStyle(element, prop, defaultStyle);
+ styles.set(prop, value);
+ // there is no easy way to detect this because a sub element could be removed
+ // by a parent animation element being detached.
+ if (!value || value.length == 0) {
+ element[REMOVAL_FLAG] = NULL_REMOVED_QUERIED_STATE;
+ failedElements.push(element);
+ }
+ });
+ valuesMap.set(element, styles);
+ });
+ // we use a index variable here since Set.forEach(a, i) does not return
+ // an index value for the closure (but instead just the value)
+ let i = 0;
+ elements.forEach(element => cloakElement(element, cloakVals[i++]));
+ return failedElements;
+}
+/*
+Since the Angular renderer code will return a collection of inserted
+nodes in all areas of a DOM tree, it's up to this algorithm to figure
+out which nodes are roots for each animation @trigger.
-/**
- * Generated bundle index. Do not edit.
+By placing each inserted node into a Set and traversing upwards, it
+is possible to find the @trigger elements and well any direct *star
+insertion nodes, if a @trigger root is found then the enter element
+is placed into the Map[@trigger] spot.
*/
-
-
-
-/***/ }),
-
-/***/ 8623:
-/*!************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-data-list.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiDataListComponent: () => (/* binding */ TuiDataListComponent),
-/* harmony export */ TuiDataListDirective: () => (/* binding */ TuiDataListDirective),
-/* harmony export */ TuiDataListModule: () => (/* binding */ TuiDataListModule),
-/* harmony export */ TuiOptGroupDirective: () => (/* binding */ TuiOptGroupDirective),
-/* harmony export */ TuiOptionComponent: () => (/* binding */ TuiOptionComponent),
-/* harmony export */ tuiAsDataList: () => (/* binding */ tuiAsDataList)
-/* harmony export */ });
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @taiga-ui/cdk */ 4333);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @taiga-ui/cdk */ 2515);
-/* harmony import */ var _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/core/directives */ 1460);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var _taiga_ui_core_directives_dropdown__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core/directives/dropdown */ 2577);
-/* harmony import */ var _tinkoff_ng_event_plugins__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tinkoff/ng-event-plugins */ 652);
-/* harmony import */ var _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/core/components/svg */ 3442);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs */ 4517);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-const _c0 = ["tuiOption", ""];
-function TuiOptionComponent_ng_container_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
+function buildRootMap(roots, nodes) {
+ const rootMap = new Map();
+ roots.forEach(root => rootMap.set(root, []));
+ if (nodes.length == 0) return rootMap;
+ const NULL_NODE = 1;
+ const nodeSet = new Set(nodes);
+ const localRootMap = new Map();
+ function getRoot(node) {
+ if (!node) return NULL_NODE;
+ let root = localRootMap.get(node);
+ if (root) return root;
+ const parent = node.parentNode;
+ if (rootMap.has(parent)) {
+ // ngIf inside @trigger
+ root = parent;
+ } else if (nodeSet.has(parent)) {
+ // ngIf inside ngIf
+ root = NULL_NODE;
+ } else {
+ // recurse upwards
+ root = getRoot(parent);
+ }
+ localRootMap.set(node, root);
+ return root;
}
- if (rf & 2) {
- const text_r3 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r3, "\n");
+ nodes.forEach(node => {
+ const root = getRoot(node);
+ if (root !== NULL_NODE) {
+ rootMap.get(root).push(node);
+ }
+ });
+ return rootMap;
+}
+function addClass(element, className) {
+ element.classList?.add(className);
+}
+function removeClass(element, className) {
+ element.classList?.remove(className);
+}
+function removeNodesAfterAnimationDone(engine, element, players) {
+ optimizeGroupPlayer(players).onDone(() => engine.processLeaveNode(element));
+}
+function flattenGroupPlayers(players) {
+ const finalPlayers = [];
+ _flattenGroupPlayersRecur(players, finalPlayers);
+ return finalPlayers;
+}
+function _flattenGroupPlayersRecur(players, finalPlayers) {
+ for (let i = 0; i < players.length; i++) {
+ const player = players[i];
+ if (player instanceof _angular_animations__WEBPACK_IMPORTED_MODULE_1__["ɵAnimationGroupPlayer"]) {
+ _flattenGroupPlayersRecur(player.players, finalPlayers);
+ } else {
+ finalPlayers.push(player);
+ }
}
}
-function TuiOptionComponent_ng_template_1_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 3);
+function objEquals(a, b) {
+ const k1 = Object.keys(a);
+ const k2 = Object.keys(b);
+ if (k1.length != k2.length) return false;
+ for (let i = 0; i < k1.length; i++) {
+ const prop = k1[i];
+ if (!b.hasOwnProperty(prop) || a[prop] !== b[prop]) return false;
}
- if (rf & 2) {
- const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", ctx_r4.icons.more);
+ return true;
+}
+function replacePostStylesAsPre(element, allPreStyleElements, allPostStyleElements) {
+ const postEntry = allPostStyleElements.get(element);
+ if (!postEntry) return false;
+ let preEntry = allPreStyleElements.get(element);
+ if (preEntry) {
+ postEntry.forEach(data => preEntry.add(data));
+ } else {
+ allPreStyleElements.set(element, postEntry);
}
+ allPostStyleElements.delete(element);
+ return true;
}
-function TuiOptionComponent_ng_template_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiOptionComponent_ng_template_1_tui_svg_1_Template, 1, 1, "tui-svg", 2);
+class AnimationEngine {
+ constructor(bodyNode, _driver, _normalizer) {
+ this.bodyNode = bodyNode;
+ this._driver = _driver;
+ this._normalizer = _normalizer;
+ this._triggerCache = {};
+ // this method is designed to be overridden by the code that uses this engine
+ this.onRemovalComplete = (element, context) => {};
+ this._transitionEngine = new TransitionAnimationEngine(bodyNode, _driver, _normalizer);
+ this._timelineEngine = new TimelineAnimationEngine(bodyNode, _driver, _normalizer);
+ this._transitionEngine.onRemovalComplete = (element, context) => this.onRemovalComplete(element, context);
}
- if (rf & 2) {
- const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx_r2.dropdown);
+ registerTrigger(componentId, namespaceId, hostElement, name, metadata) {
+ const cacheKey = componentId + '-' + name;
+ let trigger = this._triggerCache[cacheKey];
+ if (!trigger) {
+ const errors = [];
+ const warnings = [];
+ const ast = buildAnimationAst(this._driver, metadata, errors, warnings);
+ if (errors.length) {
+ throw triggerBuildFailed(name, errors);
+ }
+ if (warnings.length) {
+ warnTriggerBuild(name, warnings);
+ }
+ trigger = buildTrigger(name, ast, this._normalizer);
+ this._triggerCache[cacheKey] = trigger;
+ }
+ this._transitionEngine.registerTrigger(namespaceId, name, trigger);
}
-}
-const _c1 = function (a0) {
- return {
- $implicit: a0
- };
-};
-const _c2 = ["*"];
-function TuiDataListComponent_div_2_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
+ register(namespaceId, hostElement) {
+ this._transitionEngine.register(namespaceId, hostElement);
}
- if (rf & 2) {
- const text_r2 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r2, " ");
+ destroy(namespaceId, context) {
+ this._transitionEngine.destroy(namespaceId, context);
}
-}
-function TuiDataListComponent_div_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiDataListComponent_div_2_ng_container_1_Template, 2, 1, "ng-container", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](2, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+ onInsert(namespaceId, element, parent, insertBefore) {
+ this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore);
}
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r0.emptyContent || _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](2, 1, ctx_r0.defaultEmptyContent$));
+ onRemove(namespaceId, element, context) {
+ this._transitionEngine.removeNode(namespaceId, element, context);
}
-}
-function shouldFocus({
- currentTarget
-}) {
- return !this.isMobile && !(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiIsNativeFocused)(currentTarget);
-}
-// TODO: Consider all use cases for aria roles
-class TuiOptionComponent {
- constructor(isMobile, content, dataList, el, host, dropdown, icons) {
- this.isMobile = isMobile;
- this.content = content;
- this.dataList = dataList;
- this.el = el;
- this.host = host;
- this.dropdown = dropdown;
- this.icons = icons;
- /** @deprecated use size on {@link TuiDataListComponent} instead */
- this.size = null;
- this.role = 'option';
- this.disabled = false;
+ disableAnimations(element, disable) {
+ this._transitionEngine.markElementAsDisabled(element, disable);
}
- get active() {
- return !!this.dropdown && !!this.dropdown.dropdownBoxRef;
+ process(namespaceId, element, property, value) {
+ if (property.charAt(0) == '@') {
+ const [id, action] = parseTimelineCommand(property);
+ const args = value;
+ this._timelineEngine.command(id, element, action, args);
+ } else {
+ this._transitionEngine.trigger(namespaceId, element, property, value);
+ }
}
- onClick() {
- if (this.host && this.value !== undefined) {
- this.host.handleOption(this.value);
+ listen(namespaceId, element, eventName, eventPhase, callback) {
+ // @@listen
+ if (eventName.charAt(0) == '@') {
+ const [id, action] = parseTimelineCommand(eventName);
+ return this._timelineEngine.listen(id, element, action, callback);
}
+ return this._transitionEngine.listen(namespaceId, element, eventName, eventPhase, callback);
}
- // @bad TODO: Consider aria-activedescendant for proper accessibility implementation
- onMouseMove({
- currentTarget
- }) {
- currentTarget.focus({
- preventScroll: true
- });
+ flush(microtaskId = -1) {
+ this._transitionEngine.flush(microtaskId);
}
- // Preventing focus loss upon focused option removal
- ngOnDestroy() {
- var _a;
- (_a = this.dataList) === null || _a === void 0 ? void 0 : _a.handleFocusLossIfNecessary(this.el.nativeElement);
+ get players() {
+ return [...this._transitionEngine.players, ...this._timelineEngine.players];
}
-}
-TuiOptionComponent.ɵfac = function TuiOptionComponent_Factory(t) {
- return new (t || TuiOptionComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.TUI_IS_MOBILE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.TUI_OPTION_CONTENT, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"]((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => TuiDataListComponent), 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.TUI_DATA_LIST_HOST, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives_dropdown__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDirective, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.TUI_COMMON_ICONS));
-};
-TuiOptionComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiOptionComponent,
- selectors: [["button", "tuiOption", ""], ["a", "tuiOption", ""]],
- hostAttrs: ["tabIndex", "-1", "type", "button"],
- hostVars: 5,
- hostBindings: function TuiOptionComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function TuiOptionComponent_click_HostBindingHandler() {
- return ctx.onClick();
- })("mousemove.silent", function TuiOptionComponent_mousemove_silent_HostBindingHandler($event) {
- return ctx.onMouseMove($event);
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("disabled", ctx.disabled || null)("data-size", ctx.size)("role", ctx.role);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_with-dropdown", ctx.active);
- }
- },
- inputs: {
- size: "size",
- role: "role",
- disabled: "disabled",
- value: "value"
- },
- attrs: _c0,
- ngContentSelectors: _c2,
- decls: 3,
- vars: 4,
- consts: [[4, "polymorpheusOutlet", "polymorpheusOutletContext"], ["base", ""], ["class", "t-arrow", 3, "src", 4, "ngIf"], [1, "t-arrow", 3, "src"]],
- template: function TuiOptionComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiOptionComponent_ng_container_0_Template, 2, 1, "ng-container", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiOptionComponent_ng_template_1_Template, 2, 1, "ng-template", null, 1, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplateRefExtractor"]);
- }
- if (rf & 2) {
- const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx.content || _r1)("polymorpheusOutletContext", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](2, _c1, _r1));
- }
- },
- dependencies: [_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_5__.TuiSvgComponent, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_7__.NgIf],
- styles: ["[_nghost-%COMP%]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:none;font-size:inherit;line-height:inherit;text-decoration:none;transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;justify-content:space-between;text-align:left;color:var(--tui-text-01);border-radius:var(--tui-radius-s);outline:none;cursor:pointer;background-clip:padding-box}[_nghost-%COMP%]:disabled{opacity:var(--tui-disabled-opacity);cursor:default}[_nghost-%COMP%]:focus, ._with-dropdown[_nghost-%COMP%]{background-color:var(--tui-clear)}[_nghost-%COMP%] [data-list-size=\"s\"][_nghost-%COMP%], [data-list-size=\"s\"] [_nghost-%COMP%], [_nghost-%COMP%] [data-list-size=\"xs\"][_nghost-%COMP%], [data-list-size=\"xs\"] [_nghost-%COMP%], [data-size=s][data-size=s][_nghost-%COMP%], [data-size=xs][data-size=xs][_nghost-%COMP%]{display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;font:var(--tui-font-text-s);min-height:2rem;padding:.3125rem .5rem}[_nghost-%COMP%] [data-list-size=\"m\"][_nghost-%COMP%], [data-list-size=\"m\"] [_nghost-%COMP%], [data-size=m][data-size=m][_nghost-%COMP%]{display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;font:var(--tui-font-text-s);min-height:2.5rem;padding:.375rem .5rem}[_nghost-%COMP%] [data-list-size=\"l\"][_nghost-%COMP%], [data-list-size=\"l\"] [_nghost-%COMP%], [data-size=l][data-size=l][_nghost-%COMP%]{display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;font:var(--tui-font-text-m);min-height:2.75rem;padding:.375rem .625rem}.t-arrow[_ngcontent-%COMP%]{margin:0 -.5rem 0 .75rem}"],
- changeDetection: 0
-});
-(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__decorate)([(0,_tinkoff_ng_event_plugins__WEBPACK_IMPORTED_MODULE_9__.shouldCall)(shouldFocus)], TuiOptionComponent.prototype, "onMouseMove", null);
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiOptionComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'button[tuiOption], a[tuiOption]',
- templateUrl: './option.template.html',
- styleUrls: ['./option.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- host: {
- tabIndex: '-1',
- type: 'button',
- '[attr.disabled]': 'disabled || null'
- }
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.TUI_IS_MOBILE]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.TUI_OPTION_CONTENT]
- }]
- }, {
- type: TuiDataListComponent,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => TuiDataListComponent)]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.TUI_DATA_LIST_HOST]
- }]
- }, {
- type: _taiga_ui_core_directives_dropdown__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives_dropdown__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDirective]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.TUI_COMMON_ICONS]
- }]
- }];
- }, {
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-size']
- }],
- role: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.role']
- }],
- disabled: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- value: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- active: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._with-dropdown']
- }],
- onClick: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['click']
- }],
- onMouseMove: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['mousemove.silent', ['$event']]
- }]
- });
-})();
-
-// TODO: Consider aria-activedescendant for proper accessibility implementation
-class TuiDataListComponent {
- constructor(controller, el, defaultEmptyContent$) {
- var _a;
- this.controller = controller;
- this.el = el;
- this.defaultEmptyContent$ = defaultEmptyContent$;
- this.options = _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.EMPTY_QUERY;
- this.role = 'listbox';
- this.size = ((_a = this.controller) === null || _a === void 0 ? void 0 : _a.size) || 'm';
+ whenRenderingDone() {
+ return this._transitionEngine.whenRenderingDone();
}
- get empty$() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.tuiQueryListChanges)(this.options).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.map)(({
- length
- }) => !length));
+ afterFlushAnimationsDone(cb) {
+ this._transitionEngine.afterFlushAnimationsDone(cb);
}
- onFocusIn(relatedTarget, currentTarget) {
- if (!currentTarget.contains(relatedTarget) && !this.origin) {
- this.origin = relatedTarget;
+}
+
+/**
+ * Returns an instance of `SpecialCasedStyles` if and when any special (non animateable) styles are
+ * detected.
+ *
+ * In CSS there exist properties that cannot be animated within a keyframe animation
+ * (whether it be via CSS keyframes or web-animations) and the animation implementation
+ * will ignore them. This function is designed to detect those special cased styles and
+ * return a container that will be executed at the start and end of the animation.
+ *
+ * @returns an instance of `SpecialCasedStyles` if any special styles are detected otherwise `null`
+ */
+function packageNonAnimatableStyles(element, styles) {
+ let startStyles = null;
+ let endStyles = null;
+ if (Array.isArray(styles) && styles.length) {
+ startStyles = filterNonAnimatableStyles(styles[0]);
+ if (styles.length > 1) {
+ endStyles = filterNonAnimatableStyles(styles[styles.length - 1]);
}
+ } else if (styles instanceof Map) {
+ startStyles = filterNonAnimatableStyles(styles);
}
- noop() {}
- onKeyDownArrow(current, step) {
- const {
- elements
- } = this;
- (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiMoveFocus)(elements.indexOf(current), elements, step);
- }
- // TODO: Consider aria-activedescendant for proper accessibility implementation
- handleFocusLossIfNecessary(element = this.el.nativeElement) {
- if (this.origin && (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiIsNativeFocusedIn)(element)) {
- (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiSetNativeMouseFocused)(this.origin, true, true);
+ return startStyles || endStyles ? new SpecialCasedStyles(element, startStyles, endStyles) : null;
+}
+/**
+ * Designed to be executed during a keyframe-based animation to apply any special-cased styles.
+ *
+ * When started (when the `start()` method is run) then the provided `startStyles`
+ * will be applied. When finished (when the `finish()` method is called) the
+ * `endStyles` will be applied as well any any starting styles. Finally when
+ * `destroy()` is called then all styles will be removed.
+ */
+class SpecialCasedStyles {
+ constructor(_element, _startStyles, _endStyles) {
+ this._element = _element;
+ this._startStyles = _startStyles;
+ this._endStyles = _endStyles;
+ this._state = 0 /* SpecialCasedStylesState.Pending */;
+ let initialStyles = SpecialCasedStyles.initialStylesByElement.get(_element);
+ if (!initialStyles) {
+ SpecialCasedStyles.initialStylesByElement.set(_element, initialStyles = new Map());
}
+ this._initialStyles = initialStyles;
}
- getOptions(includeDisabled = false) {
- return this.options.filter(({
- disabled
- }) => includeDisabled || !disabled).map(({
- value
- }) => value).filter(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__.tuiIsPresent);
+ start() {
+ if (this._state < 1 /* SpecialCasedStylesState.Started */) {
+ if (this._startStyles) {
+ setStyles(this._element, this._startStyles, this._initialStyles);
+ }
+ this._state = 1 /* SpecialCasedStylesState.Started */;
+ }
}
- onFocus({
- target
- }, top) {
- if (!(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_14__.tuiIsElement)(target)) {
- return;
+ finish() {
+ this.start();
+ if (this._state < 2 /* SpecialCasedStylesState.Finished */) {
+ setStyles(this._element, this._initialStyles);
+ if (this._endStyles) {
+ setStyles(this._element, this._endStyles);
+ this._endStyles = null;
+ }
+ this._state = 1 /* SpecialCasedStylesState.Started */;
}
- const {
- elements
- } = this;
- (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiMoveFocus)(top ? -1 : elements.length, elements, top ? 1 : -1);
- this.handleFocusLossIfNecessary(target);
}
- get elements() {
- return Array.from(this.el.nativeElement.querySelectorAll('[tuiOption]'));
+ destroy() {
+ this.finish();
+ if (this._state < 3 /* SpecialCasedStylesState.Destroyed */) {
+ SpecialCasedStyles.initialStylesByElement.delete(this._element);
+ if (this._startStyles) {
+ eraseStyles(this._element, this._startStyles);
+ this._endStyles = null;
+ }
+ if (this._endStyles) {
+ eraseStyles(this._element, this._endStyles);
+ this._endStyles = null;
+ }
+ setStyles(this._element, this._initialStyles);
+ this._state = 3 /* SpecialCasedStylesState.Destroyed */;
+ }
}
}
-TuiDataListComponent.ɵfac = function TuiDataListComponent_Factory(t) {
- return new (t || TuiDataListComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_15__.TUI_TEXTFIELD_WATCHED_CONTROLLER, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.TUI_NOTHING_FOUND_MESSAGE));
-};
-TuiDataListComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiDataListComponent,
- selectors: [["tui-data-list"]],
- contentQueries: function TuiDataListComponent_ContentQueries(rf, ctx, dirIndex) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵcontentQuery"](dirIndex, TuiOptionComponent, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.options = _t);
- }
- },
- hostVars: 2,
- hostBindings: function TuiDataListComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("focusin", function TuiDataListComponent_focusin_HostBindingHandler($event) {
- return ctx.onFocusIn($event.relatedTarget, $event.currentTarget);
- })("mousedown.prevent", function TuiDataListComponent_mousedown_prevent_HostBindingHandler() {
- return ctx.noop();
- })("keydown.arrowDown.prevent", function TuiDataListComponent_keydown_arrowDown_prevent_HostBindingHandler($event) {
- return ctx.onKeyDownArrow($event.target, 1);
- })("keydown.arrowUp.prevent", function TuiDataListComponent_keydown_arrowUp_prevent_HostBindingHandler($event) {
- return ctx.onKeyDownArrow($event.target, -1);
- })("wheel.silent.passive", function TuiDataListComponent_wheel_silent_passive_HostBindingHandler() {
- return ctx.handleFocusLossIfNecessary();
- })("mouseleave", function TuiDataListComponent_mouseleave_HostBindingHandler($event) {
- return ctx.handleFocusLossIfNecessary($event.target);
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("role", ctx.role)("data-list-size", ctx.size);
+_SpecialCasedStyles = SpecialCasedStyles;
+_SpecialCasedStyles.initialStylesByElement = /* @__PURE__ */new WeakMap();
+function filterNonAnimatableStyles(styles) {
+ let result = null;
+ styles.forEach((val, prop) => {
+ if (isNonAnimatableStyle(prop)) {
+ result = result || new Map();
+ result.set(prop, val);
}
- },
- inputs: {
- role: "role",
- emptyContent: "emptyContent",
- size: "size"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.tuiAsDataListAccessor)(TuiDataListComponent), _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_15__.TEXTFIELD_CONTROLLER_PROVIDER])],
- ngContentSelectors: _c2,
- decls: 5,
- vars: 3,
- consts: [["tabindex", "0", 1, "t-trap", 3, "focusin"], ["class", "t-empty", 4, "ngIf"], [1, "t-empty"], [4, "polymorpheusOutlet"]],
- template: function TuiDataListComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("focusin", function TuiDataListComponent_Template_div_focusin_0_listener($event) {
- return ctx.onFocus($event, true);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiDataListComponent_div_2_Template, 3, 3, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](3, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "div", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("focusin", function TuiDataListComponent_Template_div_focusin_4_listener($event) {
- return ctx.onFocus($event, false);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](3, 1, ctx.empty$));
- }
- },
- dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_7__.NgIf, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_7__.AsyncPipe],
- styles: ["tui-data-list{--tui-data-list-padding: .25rem;--tui-data-list-margin: .0625rem;display:flex;font:var(--tui-font-text-m);flex-direction:column;padding:calc(var(--tui-data-list-padding) - var(--tui-data-list-margin)) var(--tui-data-list-padding);color:var(--tui-text-03)}tui-data-list:focus-within .t-trap{display:none}tui-data-list:focus-within [tuiOption]._with-dropdown:not(:focus){background-color:transparent}tui-data-list[data-list-size=s]{--tui-data-list-margin: 0rem}tui-data-list[data-list-size=s]>.t-empty{display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;font:var(--tui-font-text-s);min-height:2rem;padding:.3125rem .5rem}tui-data-list[data-list-size=m]>.t-empty{display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;font:var(--tui-font-text-s);min-height:2.5rem;padding:.375rem .5rem}tui-data-list[data-list-size=l]{--tui-data-list-padding: .375rem;--tui-data-list-margin: .125rem}tui-data-list[data-list-size=l]>.t-empty{display:flex;align-items:center;box-sizing:border-box;margin:var(--tui-data-list-margin) 0;font:var(--tui-font-text-m);min-height:2.75rem;padding:.375rem .625rem}tui-opt-group{position:relative;display:flex;font:var(--tui-font-text-xs);color:var(--tui-text-02);flex-direction:column;line-height:1rem}tui-data-list[data-list-size=l] tui-opt-group{font:var(--tui-font-text-s);line-height:1.25rem}tui-data-list[data-list-size=l] tui-opt-group:before{padding-left:.625rem;padding-right:.625rem}tui-data-list[data-list-size=l] tui-opt-group:after{left:.625rem;right:.625rem}tui-opt-group:empty:before,tui-opt-group:empty:after{display:none}tui-opt-group:before{content:attr(data-label);padding:var(--tui-data-list-padding) .5rem var(--tui-data-list-padding);margin:var(--tui-data-list-margin) 0;white-space:normal;word-break:break-word}tui-opt-group:after{position:absolute;left:.5rem;right:.5rem;top:var(--tui-data-list-padding);height:1px;background:var(--tui-base-03)}tui-opt-group:not(:empty)~tui-opt-group:before{padding-top:calc(.75rem + var(--tui-data-list-padding))}tui-opt-group:not(:empty)~tui-opt-group[data-label=\"\"]:before,tui-opt-group:not(:empty)~tui-opt-group:not([data-label]):before{padding:var(--tui-data-list-padding) 0}tui-opt-group:not(:empty)~tui-opt-group:after{content:\"\"}tui-opt-group[data-label=\"\"]:before,tui-opt-group:not([data-label]):before{padding:0;margin:0}\n"],
- encapsulation: 2,
- changeDetection: 0
-});
-(0,tslib__WEBPACK_IMPORTED_MODULE_8__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_16__.tuiPure], TuiDataListComponent.prototype, "empty$", null);
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDataListComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-data-list',
- templateUrl: './data-list.template.html',
- styleUrls: ['./data-list.style.less'],
- encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewEncapsulation.None,
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.tuiAsDataListAccessor)(TuiDataListComponent), _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_15__.TEXTFIELD_CONTROLLER_PROVIDER]
- }]
- }], function () {
- return [{
- type: _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_15__.TuiTextfieldController,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_15__.TUI_TEXTFIELD_WATCHED_CONTROLLER]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_17__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_3__.TUI_NOTHING_FOUND_MESSAGE]
- }]
- }];
- }, {
- options: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ContentChildren,
- args: [(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => TuiOptionComponent), {
- descendants: true
- }]
- }],
- role: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.role']
- }],
- emptyContent: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-list-size']
- }],
- empty$: [],
- onFocusIn: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['focusin', ['$event.relatedTarget', '$event.currentTarget']]
- }],
- noop: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['mousedown.prevent']
- }],
- onKeyDownArrow: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['keydown.arrowDown.prevent', ['$event.target', '1']]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['keydown.arrowUp.prevent', ['$event.target', '-1']]
- }],
- handleFocusLossIfNecessary: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['wheel.silent.passive']
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['mouseleave', ['$event.target']]
- }]
});
-})();
-class TuiDataListDirective {}
-TuiDataListDirective.ɵfac = function TuiDataListDirective_Factory(t) {
- return new (t || TuiDataListDirective)();
-};
-TuiDataListDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDataListDirective,
- selectors: [["ng-template", "tuiDataList", ""]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDataListDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: 'ng-template[tuiDataList]'
- }]
- }], null, null);
-})();
-function tuiAsDataList(useExisting) {
- return {
- provide: TuiDataListDirective,
- useExisting
- };
+ return result;
}
-class TuiOptGroupDirective {}
-TuiOptGroupDirective.ɵfac = function TuiOptGroupDirective_Factory(t) {
- return new (t || TuiOptGroupDirective)();
-};
-TuiOptGroupDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiOptGroupDirective,
- selectors: [["tui-opt-group"]],
- hostAttrs: ["role", "group"],
- hostVars: 1,
- hostBindings: function TuiOptGroupDirective_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-label", ctx.label);
+function isNonAnimatableStyle(prop) {
+ return prop === 'display' || prop === 'position';
+}
+class WebAnimationsPlayer {
+ constructor(element, keyframes, options, _specialStyles) {
+ this.element = element;
+ this.keyframes = keyframes;
+ this.options = options;
+ this._specialStyles = _specialStyles;
+ this._onDoneFns = [];
+ this._onStartFns = [];
+ this._onDestroyFns = [];
+ this._initialized = false;
+ this._finished = false;
+ this._started = false;
+ this._destroyed = false;
+ // the following original fns are persistent copies of the _onStartFns and _onDoneFns
+ // and are used to reset the fns to their original values upon reset()
+ // (since the _onStartFns and _onDoneFns get deleted after they are called)
+ this._originalOnDoneFns = [];
+ this._originalOnStartFns = [];
+ this.time = 0;
+ this.parentPlayer = null;
+ this.currentSnapshot = new Map();
+ this._duration = options['duration'];
+ this._delay = options['delay'] || 0;
+ this.time = this._duration + this._delay;
+ }
+ _onFinish() {
+ if (!this._finished) {
+ this._finished = true;
+ this._onDoneFns.forEach(fn => fn());
+ this._onDoneFns = [];
}
- },
- inputs: {
- label: "label"
}
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiOptGroupDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: 'tui-opt-group',
- host: {
- role: 'group'
+ init() {
+ this._buildPlayer();
+ this._preparePlayerBeforeStart();
+ }
+ _buildPlayer() {
+ if (this._initialized) return;
+ this._initialized = true;
+ const keyframes = this.keyframes;
+ // @ts-expect-error overwriting a readonly property
+ this.domPlayer = this._triggerWebAnimation(this.element, keyframes, this.options);
+ this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : new Map();
+ const onFinish = () => this._onFinish();
+ this.domPlayer.addEventListener('finish', onFinish);
+ this.onDestroy(() => {
+ // We must remove the `finish` event listener once an animation has completed all its
+ // iterations. This action is necessary to prevent a memory leak since the listener captures
+ // `this`, creating a closure that prevents `this` from being garbage collected.
+ this.domPlayer.removeEventListener('finish', onFinish);
+ });
+ }
+ _preparePlayerBeforeStart() {
+ // this is required so that the player doesn't start to animate right away
+ if (this._delay) {
+ this._resetDomPlayerState();
+ } else {
+ this.domPlayer.pause();
+ }
+ }
+ _convertKeyframesToObject(keyframes) {
+ const kfs = [];
+ keyframes.forEach(frame => {
+ kfs.push(Object.fromEntries(frame));
+ });
+ return kfs;
+ }
+ /** @internal */
+ _triggerWebAnimation(element, keyframes, options) {
+ return element.animate(this._convertKeyframesToObject(keyframes), options);
+ }
+ onStart(fn) {
+ this._originalOnStartFns.push(fn);
+ this._onStartFns.push(fn);
+ }
+ onDone(fn) {
+ this._originalOnDoneFns.push(fn);
+ this._onDoneFns.push(fn);
+ }
+ onDestroy(fn) {
+ this._onDestroyFns.push(fn);
+ }
+ play() {
+ this._buildPlayer();
+ if (!this.hasStarted()) {
+ this._onStartFns.forEach(fn => fn());
+ this._onStartFns = [];
+ this._started = true;
+ if (this._specialStyles) {
+ this._specialStyles.start();
}
- }]
- }], null, {
- label: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-label']
- }]
- });
-})();
-class TuiDataListModule {}
-TuiDataListModule.ɵfac = function TuiDataListModule_Factory(t) {
- return new (t || TuiDataListModule)();
-};
-TuiDataListModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiDataListModule
-});
-TuiDataListModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_7__.CommonModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_5__.TuiSvgModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDataListModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_7__.CommonModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_5__.TuiSvgModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusModule],
- declarations: [TuiDataListComponent, TuiOptionComponent, TuiOptGroupDirective, TuiDataListDirective],
- exports: [TuiDataListComponent, TuiOptionComponent, TuiOptGroupDirective, TuiDataListDirective]
- }]
- }], null, null);
-})();
+ }
+ this.domPlayer.play();
+ }
+ pause() {
+ this.init();
+ this.domPlayer.pause();
+ }
+ finish() {
+ this.init();
+ if (this._specialStyles) {
+ this._specialStyles.finish();
+ }
+ this._onFinish();
+ this.domPlayer.finish();
+ }
+ reset() {
+ this._resetDomPlayerState();
+ this._destroyed = false;
+ this._finished = false;
+ this._started = false;
+ this._onStartFns = this._originalOnStartFns;
+ this._onDoneFns = this._originalOnDoneFns;
+ }
+ _resetDomPlayerState() {
+ if (this.domPlayer) {
+ this.domPlayer.cancel();
+ }
+ }
+ restart() {
+ this.reset();
+ this.play();
+ }
+ hasStarted() {
+ return this._started;
+ }
+ destroy() {
+ if (!this._destroyed) {
+ this._destroyed = true;
+ this._resetDomPlayerState();
+ this._onFinish();
+ if (this._specialStyles) {
+ this._specialStyles.destroy();
+ }
+ this._onDestroyFns.forEach(fn => fn());
+ this._onDestroyFns = [];
+ }
+ }
+ setPosition(p) {
+ if (this.domPlayer === undefined) {
+ this.init();
+ }
+ this.domPlayer.currentTime = p * this.time;
+ }
+ getPosition() {
+ // tsc is complaining with TS2362 without the conversion to number
+ return +(this.domPlayer.currentTime ?? 0) / this.time;
+ }
+ get totalTime() {
+ return this._delay + this._duration;
+ }
+ beforeDestroy() {
+ const styles = new Map();
+ if (this.hasStarted()) {
+ // note: this code is invoked only when the `play` function was called prior to this
+ // (thus `hasStarted` returns true), this implies that the code that initializes
+ // `_finalKeyframe` has also been executed and the non-null assertion can be safely used here
+ const finalKeyframe = this._finalKeyframe;
+ finalKeyframe.forEach((val, prop) => {
+ if (prop !== 'offset') {
+ styles.set(prop, this._finished ? val : computeStyle(this.element, prop));
+ }
+ });
+ }
+ this.currentSnapshot = styles;
+ }
+ /** @internal */
+ triggerCallback(phaseName) {
+ const methods = phaseName === 'start' ? this._onStartFns : this._onDoneFns;
+ methods.forEach(fn => fn());
+ methods.length = 0;
+ }
+}
+class WebAnimationsDriver {
+ validateStyleProperty(prop) {
+ // Perform actual validation in dev mode only, in prod mode this check is a noop.
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
+ return validateStyleProperty(prop);
+ }
+ return true;
+ }
+ validateAnimatableStyleProperty(prop) {
+ // Perform actual validation in dev mode only, in prod mode this check is a noop.
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
+ const cssProp = camelCaseToDashCase(prop);
+ return validateWebAnimatableStyleProperty(cssProp);
+ }
+ return true;
+ }
+ matchesElement(_element, _selector) {
+ // This method is deprecated and no longer in use so we return false.
+ return false;
+ }
+ containsElement(elm1, elm2) {
+ return containsElement(elm1, elm2);
+ }
+ getParentElement(element) {
+ return getParentElement(element);
+ }
+ query(element, selector, multi) {
+ return invokeQuery(element, selector, multi);
+ }
+ computeStyle(element, prop, defaultValue) {
+ return window.getComputedStyle(element)[prop];
+ }
+ animate(element, keyframes, duration, delay, easing, previousPlayers = []) {
+ const fill = delay == 0 ? 'both' : 'forwards';
+ const playerOptions = {
+ duration,
+ delay,
+ fill
+ };
+ // we check for this to avoid having a null|undefined value be present
+ // for the easing (which results in an error for certain browsers #9752)
+ if (easing) {
+ playerOptions['easing'] = easing;
+ }
+ const previousStyles = new Map();
+ const previousWebAnimationPlayers = previousPlayers.filter(player => player instanceof WebAnimationsPlayer);
+ if (allowPreviousPlayerStylesMerge(duration, delay)) {
+ previousWebAnimationPlayers.forEach(player => {
+ player.currentSnapshot.forEach((val, prop) => previousStyles.set(prop, val));
+ });
+ }
+ let _keyframes = normalizeKeyframes(keyframes).map(styles => copyStyles(styles));
+ _keyframes = balancePreviousStylesIntoKeyframes(element, _keyframes, previousStyles);
+ const specialStyles = packageNonAnimatableStyles(element, _keyframes);
+ return new WebAnimationsPlayer(element, _keyframes, playerOptions, specialStyles);
+ }
+}
+
+/**
+ * @module
+ * @description
+ * Entry point for all animation APIs of the animation browser package.
+ */
+
+/**
+ * @module
+ * @description
+ * Entry point for all public APIs of this package.
+ */
+
+// This file is not used to build this module. It is only used during editing
/**
* Generated bundle index. Do not edit.
@@ -18895,473 +14065,283 @@ TuiDataListModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_
/***/ }),
-/***/ 7090:
-/*!*********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-dialog.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+/***/ 39:
+/*!**********************************************************!*\
+ !*** ./node_modules/@angular/cdk/fesm2022/clipboard.mjs ***!
+ \**********************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_DIALOGS_CLOSE: () => (/* binding */ TUI_DIALOGS_CLOSE),
-/* harmony export */ TUI_DIALOG_DEFAULT_OPTIONS: () => (/* binding */ TUI_DIALOG_DEFAULT_OPTIONS),
-/* harmony export */ TUI_DIALOG_OPTIONS: () => (/* binding */ TUI_DIALOG_OPTIONS),
-/* harmony export */ TuiDialogCloseService: () => (/* binding */ TuiDialogCloseService),
-/* harmony export */ TuiDialogComponent: () => (/* binding */ TuiDialogComponent),
-/* harmony export */ TuiDialogDirective: () => (/* binding */ TuiDialogDirective),
-/* harmony export */ TuiDialogModule: () => (/* binding */ TuiDialogModule),
-/* harmony export */ TuiDialogService: () => (/* binding */ TuiDialogService),
-/* harmony export */ tuiDialogOptionsProvider: () => (/* binding */ tuiDialogOptionsProvider)
+/* harmony export */ CDK_COPY_TO_CLIPBOARD_CONFIG: () => (/* binding */ CDK_COPY_TO_CLIPBOARD_CONFIG),
+/* harmony export */ CdkCopyToClipboard: () => (/* binding */ CdkCopyToClipboard),
+/* harmony export */ Clipboard: () => (/* binding */ Clipboard),
+/* harmony export */ ClipboardModule: () => (/* binding */ ClipboardModule),
+/* harmony export */ PendingCopy: () => (/* binding */ PendingCopy)
/* harmony export */ });
+/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ 9191);
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @taiga-ui/cdk */ 7474);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 4333);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @taiga-ui/core/animations */ 6270);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 523);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ 9918);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs */ 3150);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 1856);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ 5117);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/core/utils */ 6721);
-/* harmony import */ var _taiga_ui_core_components_button__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @taiga-ui/core/components/button */ 3474);
-
-
-
-
-
-
-
-
-
-
-
-
-
+var _Clipboard, _CdkCopyToClipboard, _ClipboardModule;
-function TuiDialogComponent_header_0_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const text_r4 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r4, " ");
- }
-}
-function TuiDialogComponent_header_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "header", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiDialogComponent_header_0_ng_container_1_Template, 2, 1, "ng-container", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r0.header)("polymorpheusOutletContext", ctx_r0.context);
- }
-}
-function TuiDialogComponent_ng_container_4_Template(rf, ctx) {
- if (rf & 1) {
- const _r7 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "div", 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 8)(3, "button", 9);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function TuiDialogComponent_ng_container_4_Template_button_click_3_listener() {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r7);
- const ctx_r6 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r6.context.$implicit.complete());
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const text_r5 = ctx.polymorpheusOutlet;
- const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- let tmp_1_0;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("innerHTML", text_r5, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", ((tmp_1_0 = ctx_r1.context.data) == null ? null : tmp_1_0.button) || "OK", " ");
+/**
+ * A pending copy-to-clipboard operation.
+ *
+ * The implementation of copying text to the clipboard modifies the DOM and
+ * forces a re-layout. This re-layout can take too long if the string is large,
+ * causing the execCommand('copy') to happen too long after the user clicked.
+ * This results in the browser refusing to copy. This object lets the
+ * re-layout happen in a separate tick from copying by providing a copy function
+ * that can be called later.
+ *
+ * Destroy must be called when no longer in use, regardless of whether `copy` is
+ * called.
+ */
+class PendingCopy {
+ constructor(text, _document) {
+ this._document = _document;
+ const textarea = this._textarea = this._document.createElement('textarea');
+ const styles = textarea.style;
+ // Hide the element for display and accessibility. Set a fixed position so the page layout
+ // isn't affected. We use `fixed` with `top: 0`, because focus is moved into the textarea
+ // for a split second and if it's off-screen, some browsers will attempt to scroll it into view.
+ styles.position = 'fixed';
+ styles.top = styles.opacity = '0';
+ styles.left = '-999em';
+ textarea.setAttribute('aria-hidden', 'true');
+ textarea.value = text;
+ // Making the textarea `readonly` prevents the screen from jumping on iOS Safari (see #25169).
+ textarea.readOnly = true;
+ // The element needs to be inserted into the fullscreen container, if the page
+ // is in fullscreen mode, otherwise the browser won't execute the copy command.
+ (this._document.fullscreenElement || this._document.body).appendChild(textarea);
}
-}
-function TuiDialogComponent_div_6_Template(rf, ctx) {
- if (rf & 1) {
- const _r9 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 10)(1, "button", 11);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function TuiDialogComponent_div_6_Template_button_click_1_listener() {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r9);
- const ctx_r8 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r8.close$.next());
- })("mousedown.prevent.silent", function TuiDialogComponent_div_6_Template_button_mousedown_prevent_silent_1_listener() {
- return 0;
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](2, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
+ /** Finishes copying the text. */
+ copy() {
+ const textarea = this._textarea;
+ let successful = false;
+ try {
+ // Older browsers could throw if copy is not supported.
+ if (textarea) {
+ const currentFocus = this._document.activeElement;
+ textarea.select();
+ textarea.setSelectionRange(0, textarea.value.length);
+ successful = this._document.execCommand('copy');
+ if (currentFocus) {
+ currentFocus.focus();
+ }
+ }
+ } catch {
+ // Discard error.
+ // Initial setting of {@code successful} will represent failure here.
+ }
+ return successful;
}
- if (rf & 2) {
- const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("appearance", ctx_r2.fullscreen ? "secondary" : "")("icon", ctx_r2.icons.close)("title", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](2, 3, ctx_r2.closeWord$));
+ /** Cleans up DOM changes used to perform the copy operation. */
+ destroy() {
+ const textarea = this._textarea;
+ if (textarea) {
+ textarea.remove();
+ this._textarea = undefined;
+ }
}
}
-const TUI_DIALOG_DEFAULT_OPTIONS = {
- size: 'm',
- required: false,
- closeable: true,
- dismissible: true,
- label: '',
- header: ''
-};
+
/**
- * A stream to close dialogs
+ * A service for copying text to the clipboard.
*/
-const TUI_DIALOGS_CLOSE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)(rxjs__WEBPACK_IMPORTED_MODULE_2__.EMPTY);
-/**
- * Default parameters for dialog component
- */
-const TUI_DIALOG_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)(TUI_DIALOG_DEFAULT_OPTIONS);
-function tuiDialogOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiProvideOptions)(TUI_DIALOG_OPTIONS, options, TUI_DIALOG_DEFAULT_OPTIONS);
-}
-const SCROLLBAR_PLACEHOLDER = 17;
-class TuiDialogCloseService extends rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable {
- constructor(win, doc, el) {
- super(subscriber => (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.merge)(this.esc$, this.mousedown$).subscribe(subscriber));
- this.win = win;
- this.doc = doc;
- this.el = el;
- this.esc$ = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiTypedFromEvent)(this.doc, 'keydown').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.filter)(event => {
- const target = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiGetActualTarget)(event);
- return event.key === 'Escape' && !event.defaultPrevented && (this.element.contains(target) || this.isOutside(target));
- }));
- this.mousedown$ = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiTypedFromEvent)(this.doc, 'mousedown').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.filter)(event => (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_8__.tuiGetViewportWidth)(this.win) - event.clientX > SCROLLBAR_PLACEHOLDER && this.isOutside((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiGetActualTarget)(event))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.switchMap)(() => (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiTypedFromEvent)(this.doc, 'mouseup').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.take)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.map)(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiGetActualTarget), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.filter)(target => this.isOutside(target)))));
+class Clipboard {
+ constructor(document) {
+ this._document = document;
}
- get element() {
- return this.el.nativeElement;
+ /**
+ * Copies the provided text into the user's clipboard.
+ *
+ * @param text The string to copy.
+ * @returns Whether the operation was successful.
+ */
+ copy(text) {
+ const pendingCopy = this.beginCopy(text);
+ const successful = pendingCopy.copy();
+ pendingCopy.destroy();
+ return successful;
}
- isOutside(target) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiIsElement)(target) && (!(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiContainsOrAfter)(this.element, target) || target === this.element);
+ /**
+ * Prepares a string to be copied later. This is useful for large strings
+ * which take too long to successfully render and be copied in the same tick.
+ *
+ * The caller must call `destroy` on the returned `PendingCopy`.
+ *
+ * @param text The string to copy.
+ * @returns the pending copy operation.
+ */
+ beginCopy(text) {
+ return new PendingCopy(text, this._document);
}
}
-TuiDialogCloseService.ɵfac = function TuiDialogCloseService_Factory(t) {
- return new (t || TuiDialogCloseService)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_12__.WINDOW), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_13__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef));
+_Clipboard = Clipboard;
+_Clipboard.ɵfac = function _Clipboard_Factory(t) {
+ return new (t || _Clipboard)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT));
};
-TuiDialogCloseService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
- token: TuiDialogCloseService,
- factory: TuiDialogCloseService.ɵfac
+_Clipboard.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _Clipboard,
+ factory: _Clipboard.ɵfac,
+ providedIn: 'root'
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDialogCloseService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](Clipboard, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
+ args: [{
+ providedIn: 'root'
+ }]
}], function () {
return [{
- type: Window,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_12__.WINDOW]
- }]
- }, {
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_13__.DOCUMENT]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
+ type: undefined,
decorators: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
+ args: [_angular_common__WEBPACK_IMPORTED_MODULE_1__.DOCUMENT]
}]
}];
}, null);
})();
-const REQUIRED_ERROR = new Error('Required dialog was dismissed');
-function toObservable(valueOrStream) {
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_14__.isObservable)(valueOrStream) ? valueOrStream : (0,rxjs__WEBPACK_IMPORTED_MODULE_15__.of)(valueOrStream);
-}
-class TuiDialogComponent {
- constructor(duration, isMobile, context, destroy$, dialogClose$, close$, closeWord$, icons) {
- this.duration = duration;
- this.isMobile = isMobile;
- this.context = context;
- this.closeWord$ = closeWord$;
- this.icons = icons;
- this.animation = {
- value: '',
- params: {
- start: '40px',
- duration: this.duration
- }
- };
- this.fullscreenAnimation = {
- value: '',
- params: {
- start: '100vh',
- duration: this.duration
- }
- };
- this.close$ = new rxjs__WEBPACK_IMPORTED_MODULE_16__.Subject();
- (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.merge)(this.close$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.switchMap)(() => toObservable(context.closeable))), dialogClose$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.switchMap)(() => toObservable(context.dismissible))), close$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.map)(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_17__.ALWAYS_TRUE_HANDLER))).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.filter)(Boolean), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.takeUntil)(destroy$)).subscribe(() => {
- this.close();
- });
- }
- get size() {
- return this.context.size;
- }
- get header() {
- return this.context.header;
- }
- get slideInTop() {
- return this.fullscreen || this.isMobile ? this.fullscreenAnimation : this.animation;
- }
- get fullscreen() {
- return !this.isMobile && (this.size === 'fullscreen' || this.size === 'page');
+
+/** Injection token that can be used to provide the default options to `CdkCopyToClipboard`. */
+const CDK_COPY_TO_CLIPBOARD_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('CDK_COPY_TO_CLIPBOARD_CONFIG');
+/**
+ * Provides behavior for a button that when clicked copies content into user's
+ * clipboard.
+ */
+class CdkCopyToClipboard {
+ constructor(_clipboard, _ngZone, config) {
+ this._clipboard = _clipboard;
+ this._ngZone = _ngZone;
+ /** Content to be copied. */
+ this.text = '';
+ /**
+ * How many times to attempt to copy the text. This may be necessary for longer text, because
+ * the browser needs time to fill an intermediate textarea element and copy the content.
+ */
+ this.attempts = 1;
+ /**
+ * Emits when some text is copied to the clipboard. The
+ * emitted value indicates whether copying was successful.
+ */
+ this.copied = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
+ /** Copies that are currently being attempted. */
+ this._pending = new Set();
+ if (config && config.attempts != null) {
+ this.attempts = config.attempts;
+ }
}
- close() {
- if (this.context.required) {
- this.context.$implicit.error(REQUIRED_ERROR);
+ /** Copies the current text to the clipboard. */
+ copy(attempts = this.attempts) {
+ if (attempts > 1) {
+ let remainingAttempts = attempts;
+ const pending = this._clipboard.beginCopy(this.text);
+ this._pending.add(pending);
+ const attempt = () => {
+ const successful = pending.copy();
+ if (!successful && --remainingAttempts && !this._destroyed) {
+ // We use 1 for the timeout since it's more predictable when flushing in unit tests.
+ this._currentTimeout = this._ngZone.runOutsideAngular(() => setTimeout(attempt, 1));
+ } else {
+ this._currentTimeout = null;
+ this._pending.delete(pending);
+ pending.destroy();
+ this.copied.emit(successful);
+ }
+ };
+ attempt();
} else {
- this.context.$implicit.complete();
+ this.copied.emit(this._clipboard.copy(this.text));
+ }
+ }
+ ngOnDestroy() {
+ if (this._currentTimeout) {
+ clearTimeout(this._currentTimeout);
}
+ this._pending.forEach(copy => copy.destroy());
+ this._pending.clear();
+ this._destroyed = true;
}
}
-TuiDialogComponent.ɵfac = function TuiDialogComponent_Factory(t) {
- return new (t || TuiDialogComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_19__.TUI_ANIMATIONS_DURATION), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.TUI_IS_MOBILE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_21__.POLYMORPHEUS_CONTEXT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiDialogCloseService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_DIALOGS_CLOSE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_19__.TUI_CLOSE_WORD), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_19__.TUI_COMMON_ICONS));
+_CdkCopyToClipboard = CdkCopyToClipboard;
+_CdkCopyToClipboard.ɵfac = function _CdkCopyToClipboard_Factory(t) {
+ return new (t || _CdkCopyToClipboard)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](Clipboard), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](CDK_COPY_TO_CLIPBOARD_CONFIG, 8));
};
-TuiDialogComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiDialogComponent,
- selectors: [["tui-dialog"]],
- hostVars: 6,
- hostBindings: function TuiDialogComponent_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-appearance", ctx.context.appearance)("data-size", ctx.size);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsyntheticHostProperty"]("@tuiSlideInTop", ctx.slideInTop)("@tuiFadeIn", ctx.slideInTop);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_centered", ctx.header);
- }
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__.TuiDestroyService, TuiDialogCloseService])],
- decls: 7,
- vars: 6,
- consts: [["class", "t-header", 4, "ngIf"], [1, "t-content"], [1, "t-heading", 3, "id", "textContent"], [4, "polymorpheusOutlet", "polymorpheusOutletContext"], [1, "t-filler"], ["class", "t-wrapper", 4, "ngIf"], [1, "t-header"], [3, "innerHTML"], [1, "t-buttons"], ["size", "m", "tuiAutoFocus", "", "tuiButton", "", "type", "button", 3, "click"], [1, "t-wrapper"], ["automation-id", "tui-dialog__close", "shape", "rounded", "size", "s", "tuiIconButton", "", "type", "button", 1, "t-close", 3, "appearance", "icon", "title", "click", "mousedown.prevent.silent"]],
- template: function TuiDialogComponent_Template(rf, ctx) {
+_CdkCopyToClipboard.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _CdkCopyToClipboard,
+ selectors: [["", "cdkCopyToClipboard", ""]],
+ hostBindings: function _CdkCopyToClipboard_HostBindings(rf, ctx) {
if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiDialogComponent_header_0_Template, 2, 2, "header", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](2, "h2", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "section");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](4, TuiDialogComponent_ng_container_4_Template, 5, 2, "ng-container", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](5, "div", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](6, TuiDialogComponent_div_6_Template, 3, 5, "div", 5);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.header);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("id", ctx.context.id)("textContent", ctx.context.label);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx.context.content)("polymorpheusOutletContext", ctx.context);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.context.closeable);
+ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function _CdkCopyToClipboard_click_HostBindingHandler() {
+ return ctx.copy();
+ });
}
},
- dependencies: [_taiga_ui_core_components_button__WEBPACK_IMPORTED_MODULE_23__.TuiButtonComponent, _angular_common__WEBPACK_IMPORTED_MODULE_13__.NgIf, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_21__.PolymorpheusOutletDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiAutoFocusDirective, _angular_common__WEBPACK_IMPORTED_MODULE_13__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{position:relative;display:flex;font:var(--tui-font-text-m);flex-direction:column;box-sizing:border-box;margin:auto;border-radius:1rem;border:2.5rem solid transparent}[_nghost-%COMP%]:after{position:absolute;top:0;left:0;width:100%;height:100%;content:\"\";border-radius:inherit;pointer-events:none;box-shadow:var(--tui-shadow-modal)}[data-size=auto][_nghost-%COMP%]{width:auto}[data-size=s][_nghost-%COMP%]{width:30rem}[data-size=s][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{padding:1.5rem}[data-size=s][_nghost-%COMP%] .t-heading[_ngcontent-%COMP%]{margin-bottom:.5rem;font:var(--tui-font-heading-5)}[data-size=m][_nghost-%COMP%]{width:42.5rem}[data-size=m][_nghost-%COMP%] .t-heading[_ngcontent-%COMP%]{margin-bottom:.75rem;font:var(--tui-font-heading-4)}[data-size=l][_nghost-%COMP%]{width:55rem}[data-size=l][_nghost-%COMP%] .t-heading[_ngcontent-%COMP%]{margin-bottom:1rem}[data-size=fullscreen][_nghost-%COMP%], [data-size=page][_nghost-%COMP%]{min-width:100vw;min-height:100%;border-radius:0;border:none;background:var(--tui-elevation-01);box-shadow:0 4rem var(--tui-elevation-01)}[data-size=fullscreen][_nghost-%COMP%] .t-content[_ngcontent-%COMP%], [data-size=page][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{padding:3rem calc(50vw - (45rem / 2))}[data-size=fullscreen][_nghost-%COMP%] .t-heading[_ngcontent-%COMP%], [data-size=page][_nghost-%COMP%] .t-heading[_ngcontent-%COMP%]{margin-bottom:1rem}[data-size=page][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{padding:0}._centered[_nghost-%COMP%]{text-align:center}[_nghost-%COMP%] tui-root._mobile[data-size][_nghost-%COMP%], tui-root._mobile [data-size][_nghost-%COMP%]{min-width:100%;width:100%;max-width:100%;border-radius:0;border:none;margin:auto 0 0}[_nghost-%COMP%] tui-root._mobile[data-size][_nghost-%COMP%] .t-content[_ngcontent-%COMP%], tui-root._mobile [data-size][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{padding:1.5rem}[_nghost-%COMP%] tui-root._mobile[data-size][_nghost-%COMP%] .t-heading[_ngcontent-%COMP%], tui-root._mobile [data-size][_nghost-%COMP%] .t-heading[_ngcontent-%COMP%]{margin-bottom:.5rem;font:var(--tui-font-heading-5)}.t-heading[_ngcontent-%COMP%]{margin:0;word-wrap:break-word;font:var(--tui-font-heading-3)}.t-heading[_ngcontent-%COMP%]:empty{display:none}.t-header[_ngcontent-%COMP%]{display:flex;border-top-left-radius:inherit;border-top-right-radius:inherit;overflow:hidden}[data-size=fullscreen][_nghost-%COMP%] tui-root._mobile[_nghost-%COMP%] .t-header[_ngcontent-%COMP%], tui-root._mobile [_nghost-%COMP%] .t-header[_ngcontent-%COMP%]{flex:1}.t-content[_ngcontent-%COMP%]{border-radius:inherit;padding:2rem;background:var(--tui-elevation-01)}.t-content[_ngcontent-%COMP%]:not(:first-child){border-top-left-radius:0;border-top-right-radius:0}.t-wrapper[_ngcontent-%COMP%]{position:-webkit-sticky;position:sticky;top:0;z-index:1;order:-1}.t-filler[_ngcontent-%COMP%]{flex-grow:1}.t-close[_ngcontent-%COMP%]{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:fixed;top:1.5rem;right:1.5rem;display:none;color:var(--tui-base-01)}.t-dialog:last-of-type[_nghost-%COMP%] .t-close[_ngcontent-%COMP%], .t-dialog:last-of-type [_nghost-%COMP%] .t-close[_ngcontent-%COMP%]{display:block}[_nghost-%COMP%]:not([data-size=\"fullscreen\"]):not([data-size=\"page\"]) .t-close[_ngcontent-%COMP%]{animation:tuiFadeIn var(--tui-duration);background:rgba(104,104,104,.96)}[_nghost-%COMP%]:not([data-size=\"fullscreen\"]):not([data-size=\"page\"]) .t-close[_ngcontent-%COMP%]:hover{background:rgba(159,159,159,.86)}[_nghost-%COMP%]:not([data-size=\"fullscreen\"]).ng-animating .t-close[_ngcontent-%COMP%]{display:none}tui-root._mobile[_nghost-%COMP%] .t-close[_ngcontent-%COMP%], tui-root._mobile [_nghost-%COMP%] .t-close[_ngcontent-%COMP%]{position:absolute;top:0;right:0;background:transparent!important;color:var(--tui-text-01);opacity:.5}.t-buttons[_ngcontent-%COMP%]{margin-top:1.25rem;text-align:right}"],
- data: {
- animation: [_taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_25__.tuiSlideInTop, _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_25__.tuiFadeIn]
+ inputs: {
+ text: ["cdkCopyToClipboard", "text"],
+ attempts: ["cdkCopyToClipboardAttempts", "attempts"]
+ },
+ outputs: {
+ copied: "cdkCopyToClipboardCopied"
}
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDialogComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CdkCopyToClipboard, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: 'tui-dialog',
- templateUrl: './dialog.template.html',
- styleUrls: ['./dialog.style.less'],
- // So we don't force OnPush on dialog content
- // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.Default,
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__.TuiDestroyService, TuiDialogCloseService],
- animations: [_taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_25__.tuiSlideInTop, _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_25__.tuiFadeIn],
+ selector: '[cdkCopyToClipboard]',
host: {
- '[attr.data-appearance]': 'context.appearance'
+ '(click)': 'copy()'
}
}]
}], function () {
return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_19__.TUI_ANIMATIONS_DURATION]
- }]
+ type: Clipboard
}, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.TUI_IS_MOBILE]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone
}, {
type: undefined,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_21__.POLYMORPHEUS_CONTEXT]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__.TuiDestroyService]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
}, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiDialogCloseService]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_DIALOGS_CLOSE]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable,
- decorators: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_19__.TUI_CLOSE_WORD]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_19__.TUI_COMMON_ICONS]
+ args: [CDK_COPY_TO_CLIPBOARD_CONFIG]
}]
}];
}, {
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-size']
+ text: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: ['cdkCopyToClipboard']
}],
- header: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._centered']
+ attempts: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: ['cdkCopyToClipboardAttempts']
}],
- slideInTop: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['@tuiSlideInTop']
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['@tuiFadeIn']
+ copied: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output,
+ args: ['cdkCopyToClipboardCopied']
}]
});
})();
-const DIALOG = new _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_21__.PolymorpheusComponent(TuiDialogComponent);
-class TuiDialogService extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.AbstractTuiDialogService {
- constructor() {
- super(...arguments);
- this.component = DIALOG;
- this.defaultOptions = Object.assign(Object.assign({}, (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(TUI_DIALOG_OPTIONS)), {
- data: undefined
- });
- }
-}
-TuiDialogService.ɵfac = /* @__PURE__ */function () {
- let ɵTuiDialogService_BaseFactory;
- return function TuiDialogService_Factory(t) {
- return (ɵTuiDialogService_BaseFactory || (ɵTuiDialogService_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](TuiDialogService)))(t || TuiDialogService);
- };
-}();
-TuiDialogService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
- token: TuiDialogService,
- factory: TuiDialogService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDialogService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], null, null);
-})();
-class TuiDialogDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.AbstractTuiDialogDirective {}
-TuiDialogDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiDialogDirective_BaseFactory;
- return function TuiDialogDirective_Factory(t) {
- return (ɵTuiDialogDirective_BaseFactory || (ɵTuiDialogDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](TuiDialogDirective)))(t || TuiDialogDirective);
- };
-}();
-TuiDialogDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDialogDirective,
- selectors: [["ng-template", "tuiDialog", ""]],
- inputs: {
- options: ["tuiDialogOptions", "options"],
- open: ["tuiDialog", "open"]
- },
- outputs: {
- openChange: "tuiDialogChange"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.AbstractTuiDialogService,
- useExisting: TuiDialogService
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDialogDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: 'ng-template[tuiDialog]',
- inputs: ['options: tuiDialogOptions', 'open: tuiDialog'],
- outputs: ['openChange: tuiDialogChange'],
- providers: [{
- provide: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.AbstractTuiDialogService,
- useExisting: TuiDialogService
- }]
- }]
- }], null, null);
-})();
-class TuiDialogModule {}
-TuiDialogModule.ɵfac = function TuiDialogModule_Factory(t) {
- return new (t || TuiDialogModule)();
+class ClipboardModule {}
+_ClipboardModule = ClipboardModule;
+_ClipboardModule.ɵfac = function _ClipboardModule_Factory(t) {
+ return new (t || _ClipboardModule)();
};
-TuiDialogModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiDialogModule
-});
-TuiDialogModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.tuiAsDialog)(TuiDialogService)],
- imports: [[_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_21__.PolymorpheusModule, _taiga_ui_core_components_button__WEBPACK_IMPORTED_MODULE_23__.TuiButtonModule, _angular_common__WEBPACK_IMPORTED_MODULE_13__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiAutoFocusModule]]
+_ClipboardModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
+ type: _ClipboardModule
});
+_ClipboardModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDialogModule, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](ClipboardModule, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
args: [{
- imports: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_21__.PolymorpheusModule, _taiga_ui_core_components_button__WEBPACK_IMPORTED_MODULE_23__.TuiButtonModule, _angular_common__WEBPACK_IMPORTED_MODULE_13__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiAutoFocusModule],
- declarations: [TuiDialogComponent, TuiDialogDirective],
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.tuiAsDialog)(TuiDialogService)],
- exports: [TuiDialogComponent, TuiDialogDirective]
+ declarations: [CdkCopyToClipboard],
+ exports: [CdkCopyToClipboard]
}]
}], null, null);
})();
@@ -19374,11483 +14354,7458 @@ TuiDialogModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0_
/***/ }),
-/***/ 6434:
-/*!*********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-expand.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+/***/ 9663:
+/*!*********************************************************!*\
+ !*** ./node_modules/@angular/cdk/fesm2022/coercion.mjs ***!
+ \*********************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiExpandComponent: () => (/* binding */ TuiExpandComponent),
-/* harmony export */ TuiExpandContentDirective: () => (/* binding */ TuiExpandContentDirective),
-/* harmony export */ TuiExpandModule: () => (/* binding */ TuiExpandModule)
+/* harmony export */ _isNumberValue: () => (/* binding */ _isNumberValue),
+/* harmony export */ coerceArray: () => (/* binding */ coerceArray),
+/* harmony export */ coerceBooleanProperty: () => (/* binding */ coerceBooleanProperty),
+/* harmony export */ coerceCssPixelValue: () => (/* binding */ coerceCssPixelValue),
+/* harmony export */ coerceElement: () => (/* binding */ coerceElement),
+/* harmony export */ coerceNumberProperty: () => (/* binding */ coerceNumberProperty),
+/* harmony export */ coerceStringArray: () => (/* binding */ coerceStringArray)
/* harmony export */ });
/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/core/constants */ 6628);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 5219);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _taiga_ui_core_components_loader__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core/components/loader */ 6645);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 9191);
+/** Coerces a data-bound value (typically a string) to a boolean. */
+function coerceBooleanProperty(value) {
+ return value != null && `${value}` !== 'false';
+}
+function coerceNumberProperty(value, fallbackValue = 0) {
+ return _isNumberValue(value) ? Number(value) : fallbackValue;
+}
+/**
+ * Whether the provided value is considered a number.
+ * @docs-private
+ */
+function _isNumberValue(value) {
+ // parseFloat(value) handles most of the cases we're interested in (it treats null, empty string,
+ // and other non-number values as NaN, where Number just uses 0) but it considers the string
+ // '123hello' to be a valid number. Therefore we also check if Number(value) is NaN.
+ return !isNaN(parseFloat(value)) && !isNaN(Number(value));
+}
+function coerceArray(value) {
+ return Array.isArray(value) ? value : [value];
+}
+
+/** Coerces a value to a CSS pixel value. */
+function coerceCssPixelValue(value) {
+ if (value == null) {
+ return '';
+ }
+ return typeof value === 'string' ? value : `${value}px`;
+}
+/**
+ * Coerces an ElementRef or an Element into an element.
+ * Useful for APIs that can accept either a ref or the native element itself.
+ */
+function coerceElement(elementOrRef) {
+ return elementOrRef instanceof _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef ? elementOrRef.nativeElement : elementOrRef;
+}
+/**
+ * Coerces a value to an array of trimmed non-empty strings.
+ * Any input that is not an array, `null` or `undefined` will be turned into a string
+ * via `toString()` and subsequently split with the given separator.
+ * `null` and `undefined` will result in an empty array.
+ * This results in the following outcomes:
+ * - `null` -> `[]`
+ * - `[null]` -> `["null"]`
+ * - `["a", "b ", " "]` -> `["a", "b"]`
+ * - `[1, [2, 3]]` -> `["1", "2,3"]`
+ * - `[{ a: 0 }]` -> `["[object Object]"]`
+ * - `{ a: 0 }` -> `["[object", "Object]"]`
+ *
+ * Useful for defining CSS classes or table columns.
+ * @param value the value to coerce into an array of strings
+ * @param separator split-separator if value isn't an array
+ */
+function coerceStringArray(value, separator = /\s+/) {
+ const result = [];
+ if (value != null) {
+ const sourceValues = Array.isArray(value) ? value : `${value}`.split(separator);
+ for (const sourceValue of sourceValues) {
+ const trimmedString = `${sourceValue}`.trim();
+ if (trimmedString) {
+ result.push(trimmedString);
+ }
+ }
+ }
+ return result;
+}
+/***/ }),
+/***/ 9191:
+/*!**********************************************************!*\
+ !*** ./node_modules/@angular/common/fesm2022/common.mjs ***!
+ \**********************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
+__webpack_require__.r(__webpack_exports__);
+/* harmony export */ __webpack_require__.d(__webpack_exports__, {
+/* harmony export */ APP_BASE_HREF: () => (/* binding */ APP_BASE_HREF),
+/* harmony export */ AsyncPipe: () => (/* binding */ AsyncPipe),
+/* harmony export */ BrowserPlatformLocation: () => (/* binding */ BrowserPlatformLocation),
+/* harmony export */ CommonModule: () => (/* binding */ CommonModule),
+/* harmony export */ CurrencyPipe: () => (/* binding */ CurrencyPipe),
+/* harmony export */ DATE_PIPE_DEFAULT_OPTIONS: () => (/* binding */ DATE_PIPE_DEFAULT_OPTIONS),
+/* harmony export */ DATE_PIPE_DEFAULT_TIMEZONE: () => (/* binding */ DATE_PIPE_DEFAULT_TIMEZONE),
+/* harmony export */ DOCUMENT: () => (/* binding */ DOCUMENT),
+/* harmony export */ DatePipe: () => (/* binding */ DatePipe),
+/* harmony export */ DecimalPipe: () => (/* binding */ DecimalPipe),
+/* harmony export */ FormStyle: () => (/* binding */ FormStyle),
+/* harmony export */ FormatWidth: () => (/* binding */ FormatWidth),
+/* harmony export */ HashLocationStrategy: () => (/* binding */ HashLocationStrategy),
+/* harmony export */ I18nPluralPipe: () => (/* binding */ I18nPluralPipe),
+/* harmony export */ I18nSelectPipe: () => (/* binding */ I18nSelectPipe),
+/* harmony export */ IMAGE_CONFIG: () => (/* binding */ IMAGE_CONFIG),
+/* harmony export */ IMAGE_LOADER: () => (/* binding */ IMAGE_LOADER),
+/* harmony export */ JsonPipe: () => (/* binding */ JsonPipe),
+/* harmony export */ KeyValuePipe: () => (/* binding */ KeyValuePipe),
+/* harmony export */ LOCATION_INITIALIZED: () => (/* binding */ LOCATION_INITIALIZED),
+/* harmony export */ Location: () => (/* binding */ Location),
+/* harmony export */ LocationStrategy: () => (/* binding */ LocationStrategy),
+/* harmony export */ LowerCasePipe: () => (/* binding */ LowerCasePipe),
+/* harmony export */ NgClass: () => (/* binding */ NgClass),
+/* harmony export */ NgComponentOutlet: () => (/* binding */ NgComponentOutlet),
+/* harmony export */ NgFor: () => (/* binding */ NgForOf),
+/* harmony export */ NgForOf: () => (/* binding */ NgForOf),
+/* harmony export */ NgForOfContext: () => (/* binding */ NgForOfContext),
+/* harmony export */ NgIf: () => (/* binding */ NgIf),
+/* harmony export */ NgIfContext: () => (/* binding */ NgIfContext),
+/* harmony export */ NgLocaleLocalization: () => (/* binding */ NgLocaleLocalization),
+/* harmony export */ NgLocalization: () => (/* binding */ NgLocalization),
+/* harmony export */ NgOptimizedImage: () => (/* binding */ NgOptimizedImage),
+/* harmony export */ NgPlural: () => (/* binding */ NgPlural),
+/* harmony export */ NgPluralCase: () => (/* binding */ NgPluralCase),
+/* harmony export */ NgStyle: () => (/* binding */ NgStyle),
+/* harmony export */ NgSwitch: () => (/* binding */ NgSwitch),
+/* harmony export */ NgSwitchCase: () => (/* binding */ NgSwitchCase),
+/* harmony export */ NgSwitchDefault: () => (/* binding */ NgSwitchDefault),
+/* harmony export */ NgTemplateOutlet: () => (/* binding */ NgTemplateOutlet),
+/* harmony export */ NumberFormatStyle: () => (/* binding */ NumberFormatStyle),
+/* harmony export */ NumberSymbol: () => (/* binding */ NumberSymbol),
+/* harmony export */ PRECONNECT_CHECK_BLOCKLIST: () => (/* binding */ PRECONNECT_CHECK_BLOCKLIST),
+/* harmony export */ PathLocationStrategy: () => (/* binding */ PathLocationStrategy),
+/* harmony export */ PercentPipe: () => (/* binding */ PercentPipe),
+/* harmony export */ PlatformLocation: () => (/* binding */ PlatformLocation),
+/* harmony export */ Plural: () => (/* binding */ Plural),
+/* harmony export */ SlicePipe: () => (/* binding */ SlicePipe),
+/* harmony export */ TitleCasePipe: () => (/* binding */ TitleCasePipe),
+/* harmony export */ TranslationWidth: () => (/* binding */ TranslationWidth),
+/* harmony export */ UpperCasePipe: () => (/* binding */ UpperCasePipe),
+/* harmony export */ VERSION: () => (/* binding */ VERSION),
+/* harmony export */ ViewportScroller: () => (/* binding */ ViewportScroller),
+/* harmony export */ WeekDay: () => (/* binding */ WeekDay),
+/* harmony export */ XhrFactory: () => (/* binding */ XhrFactory),
+/* harmony export */ formatCurrency: () => (/* binding */ formatCurrency),
+/* harmony export */ formatDate: () => (/* binding */ formatDate),
+/* harmony export */ formatNumber: () => (/* binding */ formatNumber),
+/* harmony export */ formatPercent: () => (/* binding */ formatPercent),
+/* harmony export */ getCurrencySymbol: () => (/* binding */ getCurrencySymbol),
+/* harmony export */ getLocaleCurrencyCode: () => (/* binding */ getLocaleCurrencyCode),
+/* harmony export */ getLocaleCurrencyName: () => (/* binding */ getLocaleCurrencyName),
+/* harmony export */ getLocaleCurrencySymbol: () => (/* binding */ getLocaleCurrencySymbol),
+/* harmony export */ getLocaleDateFormat: () => (/* binding */ getLocaleDateFormat),
+/* harmony export */ getLocaleDateTimeFormat: () => (/* binding */ getLocaleDateTimeFormat),
+/* harmony export */ getLocaleDayNames: () => (/* binding */ getLocaleDayNames),
+/* harmony export */ getLocaleDayPeriods: () => (/* binding */ getLocaleDayPeriods),
+/* harmony export */ getLocaleDirection: () => (/* binding */ getLocaleDirection),
+/* harmony export */ getLocaleEraNames: () => (/* binding */ getLocaleEraNames),
+/* harmony export */ getLocaleExtraDayPeriodRules: () => (/* binding */ getLocaleExtraDayPeriodRules),
+/* harmony export */ getLocaleExtraDayPeriods: () => (/* binding */ getLocaleExtraDayPeriods),
+/* harmony export */ getLocaleFirstDayOfWeek: () => (/* binding */ getLocaleFirstDayOfWeek),
+/* harmony export */ getLocaleId: () => (/* binding */ getLocaleId),
+/* harmony export */ getLocaleMonthNames: () => (/* binding */ getLocaleMonthNames),
+/* harmony export */ getLocaleNumberFormat: () => (/* binding */ getLocaleNumberFormat),
+/* harmony export */ getLocaleNumberSymbol: () => (/* binding */ getLocaleNumberSymbol),
+/* harmony export */ getLocalePluralCase: () => (/* binding */ getLocalePluralCase),
+/* harmony export */ getLocaleTimeFormat: () => (/* binding */ getLocaleTimeFormat),
+/* harmony export */ getLocaleWeekEndRange: () => (/* binding */ getLocaleWeekEndRange),
+/* harmony export */ getNumberOfCurrencyDigits: () => (/* binding */ getNumberOfCurrencyDigits),
+/* harmony export */ isPlatformBrowser: () => (/* binding */ isPlatformBrowser),
+/* harmony export */ isPlatformServer: () => (/* binding */ isPlatformServer),
+/* harmony export */ isPlatformWorkerApp: () => (/* binding */ isPlatformWorkerApp),
+/* harmony export */ isPlatformWorkerUi: () => (/* binding */ isPlatformWorkerUi),
+/* harmony export */ provideCloudflareLoader: () => (/* binding */ provideCloudflareLoader),
+/* harmony export */ provideCloudinaryLoader: () => (/* binding */ provideCloudinaryLoader),
+/* harmony export */ provideImageKitLoader: () => (/* binding */ provideImageKitLoader),
+/* harmony export */ provideImgixLoader: () => (/* binding */ provideImgixLoader),
+/* harmony export */ registerLocaleData: () => (/* binding */ registerLocaleData),
+/* harmony export */ "ɵDomAdapter": () => (/* binding */ DomAdapter),
+/* harmony export */ "ɵNullViewportScroller": () => (/* binding */ NullViewportScroller),
+/* harmony export */ "ɵPLATFORM_BROWSER_ID": () => (/* binding */ PLATFORM_BROWSER_ID),
+/* harmony export */ "ɵPLATFORM_SERVER_ID": () => (/* binding */ PLATFORM_SERVER_ID),
+/* harmony export */ "ɵPLATFORM_WORKER_APP_ID": () => (/* binding */ PLATFORM_WORKER_APP_ID),
+/* harmony export */ "ɵPLATFORM_WORKER_UI_ID": () => (/* binding */ PLATFORM_WORKER_UI_ID),
+/* harmony export */ "ɵgetDOM": () => (/* binding */ getDOM),
+/* harmony export */ "ɵparseCookieValue": () => (/* binding */ parseCookieValue),
+/* harmony export */ "ɵsetRootDomAdapter": () => (/* binding */ setRootDomAdapter)
+/* harmony export */ });
+/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
+var _PlatformLocation, _BrowserPlatformLocation, _LocationStrategy, _PathLocationStrategy, _HashLocationStrategy, _Location, _NgLocalization, _NgLocaleLocalization, _NgClass, _NgComponentOutlet, _NgForOf, _NgIf, _NgSwitch, _NgSwitchCase, _NgSwitchDefault, _NgPlural, _NgPluralCase, _NgStyle, _NgTemplateOutlet, _AsyncPipe, _LowerCasePipe, _TitleCasePipe, _UpperCasePipe, _DatePipe, _I18nPluralPipe, _I18nSelectPipe, _JsonPipe, _KeyValuePipe, _DecimalPipe, _PercentPipe, _CurrencyPipe, _SlicePipe, _CommonModule, _ViewportScroller, _LCPImageObserver, _PreconnectLinkChecker, _PreloadLinkCreator, _NgOptimizedImage;
+/**
+ * @license Angular v16.2.12
+ * (c) 2010-2022 Google LLC. https://angular.io/
+ * License: MIT
+ */
-const _c0 = ["wrapper"];
-function TuiExpandComponent_ng_container_2_tui_loader_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "tui-loader", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainer"](1, 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("overlay", true)("showLoader", ctx_r2.loading);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngTemplateOutlet", ctx_r2.content);
- }
+let _DOM = null;
+function getDOM() {
+ return _DOM;
}
-function TuiExpandComponent_ng_container_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiExpandComponent_ng_container_2_tui_loader_2_Template, 2, 3, "tui-loader", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
+function setRootDomAdapter(adapter) {
+ if (!_DOM) {
+ _DOM = adapter;
}
- if (rf & 2) {
- const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx_r1.async)("ngIfElse", ctx_r1.content);
+}
+/* tslint:disable:requireParameterType */
+/**
+ * Provides DOM operations in an environment-agnostic way.
+ *
+ * @security Tread carefully! Interacting with the DOM directly is dangerous and
+ * can introduce XSS risks.
+ */
+class DomAdapter {}
+
+/**
+ * A DI Token representing the main rendering context.
+ * In a browser and SSR this is the DOM Document.
+ * When using SSR, that document is created by [Domino](https://github.com/angular/domino).
+ *
+ * @publicApi
+ */
+const DOCUMENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('DocumentToken');
+
+/**
+ * This class should not be used directly by an application developer. Instead, use
+ * {@link Location}.
+ *
+ * `PlatformLocation` encapsulates all calls to DOM APIs, which allows the Router to be
+ * platform-agnostic.
+ * This means that we can have different implementation of `PlatformLocation` for the different
+ * platforms that Angular supports. For example, `@angular/platform-browser` provides an
+ * implementation specific to the browser environment, while `@angular/platform-server` provides
+ * one suitable for use with server-side rendering.
+ *
+ * The `PlatformLocation` class is used directly by all implementations of {@link LocationStrategy}
+ * when they need to interact with the DOM APIs like pushState, popState, etc.
+ *
+ * {@link LocationStrategy} in turn is used by the {@link Location} service which is used directly
+ * by the {@link Router} in order to navigate between routes. Since all interactions between {@link
+ * Router} /
+ * {@link Location} / {@link LocationStrategy} and DOM APIs flow through the `PlatformLocation`
+ * class, they are all platform-agnostic.
+ *
+ * @publicApi
+ */
+class PlatformLocation {
+ historyGo(relativePosition) {
+ throw new Error('Not implemented');
}
}
-const _c1 = ["*"];
-class TuiExpandContentDirective {}
-TuiExpandContentDirective.ɵfac = function TuiExpandContentDirective_Factory(t) {
- return new (t || TuiExpandContentDirective)();
+_PlatformLocation = PlatformLocation;
+_PlatformLocation.ɵfac = function _PlatformLocation_Factory(t) {
+ return new (t || _PlatformLocation)();
};
-TuiExpandContentDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiExpandContentDirective,
- selectors: [["", "tuiExpandContent", ""]]
+_PlatformLocation.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _PlatformLocation,
+ factory: function () {
+ return (() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(BrowserPlatformLocation))();
+ },
+ providedIn: 'platform'
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiExpandContentDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PlatformLocation, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
args: [{
- selector: '[tuiExpandContent]'
+ providedIn: 'platform',
+ useFactory: () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(BrowserPlatformLocation)
}]
}], null, null);
})();
-const State = {
- Idle: 0,
- Loading: 1,
- Prepared: 2,
- Animated: 3
-};
-const LOADER_HEIGHT = 48;
-class TuiExpandComponent {
- constructor(cdr, destroy$) {
- this.cdr = cdr;
- this.destroy$ = destroy$;
- this.state = State.Idle;
- this.async = false;
- this.content = null;
- this.expanded = null;
+/**
+ * @description
+ * Indicates when a location is initialized.
+ *
+ * @publicApi
+ */
+const LOCATION_INITIALIZED = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('Location Initialized');
+/**
+ * `PlatformLocation` encapsulates all of the direct calls to platform APIs.
+ * This class should not be used directly by an application developer. Instead, use
+ * {@link Location}.
+ *
+ * @publicApi
+ */
+class BrowserPlatformLocation extends PlatformLocation {
+ constructor() {
+ super();
+ this._doc = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT);
+ this._location = window.location;
+ this._history = window.history;
}
- set expandedSetter(expanded) {
- if (this.expanded === null) {
- this.expanded = expanded;
- return;
- }
- if (this.state !== State.Idle) {
- this.expanded = expanded;
- this.state = State.Animated;
- return;
- }
- this.expanded = expanded;
- this.retrigger(this.async && expanded ? State.Loading : State.Animated);
+ getBaseHrefFromDOM() {
+ return getDOM().getBaseHref(this._doc);
}
- get overflow() {
- return this.state !== State.Idle;
+ onPopState(fn) {
+ const window = getDOM().getGlobalEventTarget(this._doc, 'window');
+ window.addEventListener('popstate', fn, false);
+ return () => window.removeEventListener('popstate', fn);
}
- get loading() {
- return !!this.expanded && this.async && this.state === State.Loading;
+ onHashChange(fn) {
+ const window = getDOM().getGlobalEventTarget(this._doc, 'window');
+ window.addEventListener('hashchange', fn, false);
+ return () => window.removeEventListener('hashchange', fn);
}
- get height() {
- const {
- expanded,
- state,
- contentWrapper
- } = this;
- if (expanded && state === State.Prepared || !expanded && state === State.Animated) {
- return 0;
- }
- if (contentWrapper && (!expanded && state === State.Prepared || expanded && state === State.Animated)) {
- return contentWrapper.nativeElement.offsetHeight;
- }
- if (contentWrapper && expanded && state === State.Loading) {
- return Math.max(contentWrapper.nativeElement.offsetHeight, LOADER_HEIGHT);
- }
- return null;
+ get href() {
+ return this._location.href;
}
- get contentVisible() {
- return this.expanded || this.state !== State.Idle;
+ get protocol() {
+ return this._location.protocol;
}
- onTransitionEnd({
- propertyName,
- pseudoElement
- }) {
- if (propertyName === 'opacity' && !pseudoElement && this.state === State.Animated) {
- this.state = State.Idle;
- }
+ get hostname() {
+ return this._location.hostname;
}
- onExpandLoaded(event) {
- event.stopPropagation();
- if (this.state === State.Loading) {
- this.retrigger(State.Animated);
- }
+ get port() {
+ return this._location.port;
}
- retrigger(state) {
- this.state = State.Prepared;
- (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.timer)(0).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.takeUntil)(this.destroy$)).subscribe(() => {
- // We need delay to re-trigger CSS height transition from the correct number
- if (this.state !== State.Prepared) {
- return;
- }
- this.state = state;
- this.cdr.markForCheck();
- });
+ get pathname() {
+ return this._location.pathname;
+ }
+ get search() {
+ return this._location.search;
+ }
+ get hash() {
+ return this._location.hash;
+ }
+ set pathname(newPath) {
+ this._location.pathname = newPath;
+ }
+ pushState(state, title, url) {
+ this._history.pushState(state, title, url);
+ }
+ replaceState(state, title, url) {
+ this._history.replaceState(state, title, url);
+ }
+ forward() {
+ this._history.forward();
+ }
+ back() {
+ this._history.back();
+ }
+ historyGo(relativePosition = 0) {
+ this._history.go(relativePosition);
+ }
+ getState() {
+ return this._history.state;
}
}
-TuiExpandComponent.ɵfac = function TuiExpandComponent_Factory(t) {
- return new (t || TuiExpandComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService, 2));
+_BrowserPlatformLocation = BrowserPlatformLocation;
+_BrowserPlatformLocation.ɵfac = function _BrowserPlatformLocation_Factory(t) {
+ return new (t || _BrowserPlatformLocation)();
};
-TuiExpandComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiExpandComponent,
- selectors: [["tui-expand"]],
- contentQueries: function TuiExpandComponent_ContentQueries(rf, ctx, dirIndex) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵcontentQuery"](dirIndex, TuiExpandContentDirective, 5, _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.content = _t.first);
- }
- },
- viewQuery: function TuiExpandComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_c0, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.contentWrapper = _t.first);
- }
- },
- hostVars: 9,
- hostBindings: function TuiExpandComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("transitionend.self", function TuiExpandComponent_transitionend_self_HostBindingHandler($event) {
- return ctx.onTransitionEnd($event);
- })("tui-expand-loaded", function TuiExpandComponent_tui_expand_loaded_HostBindingHandler($event) {
- return ctx.onExpandLoaded($event);
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("aria-expanded", ctx.expanded);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("height", ctx.height, "px");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_expanded", ctx.expanded)("_overflow", ctx.overflow)("_loading", ctx.loading);
- }
- },
- inputs: {
- async: "async",
- expandedSetter: ["expanded", "expandedSetter"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService])],
- ngContentSelectors: _c1,
- decls: 3,
- vars: 3,
- consts: [[1, "t-wrapper"], ["wrapper", ""], [4, "ngIf"], ["size", "l", 3, "overlay", "showLoader", 4, "ngIf", "ngIfElse"], ["size", "l", 3, "overlay", "showLoader"], [3, "ngTemplateOutlet"]],
- template: function TuiExpandComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0, 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiExpandComponent_ng_container_2_Template, 3, 2, "ng-container", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("@tuiParentAnimation", undefined)("@.disabled", ctx.overflow);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.contentVisible);
- }
- },
- dependencies: [_taiga_ui_core_components_loader__WEBPACK_IMPORTED_MODULE_4__.TuiLoaderComponent, _angular_common__WEBPACK_IMPORTED_MODULE_5__.NgIf, _angular_common__WEBPACK_IMPORTED_MODULE_5__.NgTemplateOutlet],
- styles: ["[_nghost-%COMP%]{transition-property:opacity,height,visibility;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:block;opacity:0;transition-delay:1ms}._overflow[_nghost-%COMP%]{overflow:hidden}._expanded[_nghost-%COMP%]{opacity:1;transform:translate(0)}._loading[_nghost-%COMP%]{opacity:.99}.t-wrapper[_ngcontent-%COMP%]:before, .t-wrapper[_ngcontent-%COMP%]:after{content:\"\";display:table}"],
- data: {
- animation: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_PARENT_ANIMATION]
+_BrowserPlatformLocation.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _BrowserPlatformLocation,
+ factory: function () {
+ return (() => new _BrowserPlatformLocation())();
},
- changeDetection: 0
+ providedIn: 'platform'
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiExpandComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](BrowserPlatformLocation, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
args: [{
- selector: 'tui-expand',
- templateUrl: './expand.template.html',
- styleUrls: ['./expand.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService],
- animations: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_PARENT_ANIMATION]
+ providedIn: 'platform',
+ useFactory: () => new BrowserPlatformLocation()
}]
}], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_7__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService]
- }]
- }];
- }, {
- contentWrapper: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChild,
- args: ['wrapper']
- }],
- async: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- expandedSetter: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['expanded']
- }],
- content: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ContentChild,
- args: [TuiExpandContentDirective, {
- read: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef
- }]
- }],
- expanded: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._expanded']
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.aria-expanded']
- }],
- overflow: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._overflow']
- }],
- loading: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._loading']
- }],
- height: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['style.height.px']
- }],
- onTransitionEnd: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['transitionend.self', ['$event']]
- }],
- onExpandLoaded: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: [_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_8__.TUI_EXPAND_LOADED, ['$event']]
- }]
- });
-})();
-class TuiExpandModule {}
-TuiExpandModule.ɵfac = function TuiExpandModule_Factory(t) {
- return new (t || TuiExpandModule)();
-};
-TuiExpandModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiExpandModule
-});
-TuiExpandModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _taiga_ui_core_components_loader__WEBPACK_IMPORTED_MODULE_4__.TuiLoaderModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiExpandModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _taiga_ui_core_components_loader__WEBPACK_IMPORTED_MODULE_4__.TuiLoaderModule],
- declarations: [TuiExpandComponent, TuiExpandContentDirective],
- exports: [TuiExpandComponent, TuiExpandContentDirective]
- }]
- }], null, null);
+ return [];
+ }, null);
})();
/**
- * Generated bundle index. Do not edit.
+ * Joins two parts of a URL with a slash if needed.
+ *
+ * @param start URL string
+ * @param end URL string
+ *
+ *
+ * @returns The joined URL string.
*/
+function joinWithSlash(start, end) {
+ if (start.length == 0) {
+ return end;
+ }
+ if (end.length == 0) {
+ return start;
+ }
+ let slashes = 0;
+ if (start.endsWith('/')) {
+ slashes++;
+ }
+ if (end.startsWith('/')) {
+ slashes++;
+ }
+ if (slashes == 2) {
+ return start + end.substring(1);
+ }
+ if (slashes == 1) {
+ return start + end;
+ }
+ return start + '/' + end;
+}
+/**
+ * Removes a trailing slash from a URL string if needed.
+ * Looks for the first occurrence of either `#`, `?`, or the end of the
+ * line as `/` characters and removes the trailing slash if one exists.
+ *
+ * @param url URL string.
+ *
+ * @returns The URL string, modified if needed.
+ */
+function stripTrailingSlash(url) {
+ const match = url.match(/#|\?|$/);
+ const pathEndIdx = match && match.index || url.length;
+ const droppedSlashIdx = pathEndIdx - (url[pathEndIdx - 1] === '/' ? 1 : 0);
+ return url.slice(0, droppedSlashIdx) + url.slice(pathEndIdx);
+}
+/**
+ * Normalizes URL parameters by prepending with `?` if needed.
+ *
+ * @param params String of URL parameters.
+ *
+ * @returns The normalized URL parameters string.
+ */
+function normalizeQueryParams(params) {
+ return params && params[0] !== '?' ? '?' + params : params;
+}
-
-
-/***/ }),
-
-/***/ 5571:
-/*!********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-group.js ***!
- \********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiGroupDirective: () => (/* binding */ TuiGroupDirective),
-/* harmony export */ TuiGroupModule: () => (/* binding */ TuiGroupModule),
-/* harmony export */ TuiGroupStylesComponent: () => (/* binding */ TuiGroupStylesComponent)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-class TuiGroupStylesComponent {}
-TuiGroupStylesComponent.ɵfac = function TuiGroupStylesComponent_Factory(t) {
- return new (t || TuiGroupStylesComponent)();
+/**
+ * Enables the `Location` service to read route state from the browser's URL.
+ * Angular provides two strategies:
+ * `HashLocationStrategy` and `PathLocationStrategy`.
+ *
+ * Applications should use the `Router` or `Location` services to
+ * interact with application route state.
+ *
+ * For instance, `HashLocationStrategy` produces URLs like
+ * http://example.com#/foo,
+ * and `PathLocationStrategy` produces
+ * http://example.com/foo as an equivalent URL.
+ *
+ * See these two classes for more.
+ *
+ * @publicApi
+ */
+class LocationStrategy {
+ historyGo(relativePosition) {
+ throw new Error('Not implemented');
+ }
+}
+_LocationStrategy = LocationStrategy;
+_LocationStrategy.ɵfac = function _LocationStrategy_Factory(t) {
+ return new (t || _LocationStrategy)();
};
-TuiGroupStylesComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiGroupStylesComponent,
- selectors: [["ng-component"]],
- hostAttrs: [1, "tui-group-styles"],
- decls: 0,
- vars: 0,
- template: function TuiGroupStylesComponent_Template(rf, ctx) {},
- styles: [".tui-group{position:relative;display:flex;isolation:isolate}.tui-group>*{flex:1 1 0;min-width:0}.tui-group>*:not(:last-child){margin-right:.125rem}.tui-group.tui-group>*:nth-child(n){border-radius:0}.tui-group_collapsed>*{z-index:1}.tui-group_collapsed>*:not(:last-child){margin-right:-1px}.tui-group_collapsed>*._readonly,.tui-group_collapsed>*._disabled,.tui-group_collapsed>*._readonly:hover,.tui-group_collapsed>*._disabled:hover{z-index:0}.tui-group_collapsed>*:hover,.tui-group_collapsed>*._hovered,.tui-group_collapsed>*._pressed{z-index:3}.tui-group_collapsed>*._invalid{z-index:2}.tui-group_collapsed>*._invalid:hover,.tui-group_collapsed>*._invalid._hovered,.tui-group_collapsed>*._invalid._pressed{z-index:4}.tui-group_collapsed>*._hosted_dropdown_focused,.tui-group_collapsed>*._focus-visible,.tui-group_collapsed>*._focused.ng-touched,.tui-group_collapsed>*._focused.ng-untouched{z-index:5}.tui-group_collapsed>*._active,.tui-group_collapsed>*[data-appearance=whiteblock-active]{z-index:6}.tui-group_collapsed>*._focus-visible._focused,.tui-group_collapsed>*._focus-visible._active,.tui-group_collapsed>*._focus-visible[data-appearance=whiteblock-active]{z-index:7}.tui-group_orientation_vertical{display:inline-flex;flex-direction:column}.tui-group_orientation_vertical>*{min-height:auto;flex:0 0 auto}.tui-group_orientation_vertical>*:not(:last-child){margin-right:0;margin-bottom:.125rem}.tui-group_orientation_vertical.tui-group_collapsed>*:not(:last-child){margin-right:0;margin-bottom:-1px}.tui-group_rounded.tui-group_orientation_horizontal>*:first-child{border-top-left-radius:var(--tui-radius-m);border-bottom-left-radius:var(--tui-radius-m)}.tui-group_rounded.tui-group_orientation_horizontal>*:last-child{border-top-right-radius:var(--tui-radius-m);border-bottom-right-radius:var(--tui-radius-m)}.tui-group_rounded.tui-group_orientation_horizontal.tui-group_radius_large>*:first-child{border-top-left-radius:var(--tui-radius-l);border-bottom-left-radius:var(--tui-radius-l)}.tui-group_rounded.tui-group_orientation_horizontal.tui-group_radius_large>*:last-child{border-top-right-radius:var(--tui-radius-l);border-bottom-right-radius:var(--tui-radius-l)}.tui-group_rounded.tui-group_orientation_vertical>*:first-child{border-top-left-radius:var(--tui-radius-m);border-top-right-radius:var(--tui-radius-m)}.tui-group_rounded.tui-group_orientation_vertical>*:last-child{border-bottom-left-radius:var(--tui-radius-m);border-bottom-right-radius:var(--tui-radius-m)}.tui-group_rounded.tui-group_orientation_vertical.tui-group_radius_large>*:first-child{border-top-left-radius:var(--tui-radius-l);border-top-right-radius:var(--tui-radius-l)}.tui-group_rounded.tui-group_orientation_vertical.tui-group_radius_large>*:last-child{border-bottom-left-radius:var(--tui-radius-l);border-bottom-right-radius:var(--tui-radius-l)}@media screen and (max-width: 47.9625em){.tui-group_rounded.tui-group_adaptive.tui-group_orientation_vertical:not(.tui-group_collapsed)>*:first-child:not(:last-child),.tui-group_rounded.tui-group_adaptive.tui-group_orientation_horizontal>*:first-child:not(:last-child),.tui-group_rounded.tui-group_adaptive.tui-group_orientation_vertical:not(.tui-group_collapsed)>*:last-child:not(:first-child),.tui-group_rounded.tui-group_adaptive.tui-group_orientation_horizontal>*:last-child:not(:first-child){border-radius:var(--tui-radius-m)}}@media screen and (max-width: 47.9625em){.tui-group_rounded.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_vertical:not(.tui-group_collapsed)>*:first-child:not(:last-child),.tui-group_rounded.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_horizontal>*:first-child:not(:last-child),.tui-group_rounded.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_vertical:not(.tui-group_collapsed)>*:last-child:not(:first-child),.tui-group_rounded.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_horizontal>*:last-child:not(:first-child){border-radius:var(--tui-radius-l)}}@media screen and (max-width: 47.9625em){.tui-group_adaptive.tui-group_orientation_vertical{width:100%}.tui-group_adaptive.tui-group_orientation_vertical>*:nth-child(n):not(:only-child){border-radius:var(--tui-radius-m)}.tui-group_adaptive.tui-group_orientation_vertical>*:not(:last-child){margin-bottom:1rem}.tui-group_adaptive.tui-group_orientation_vertical.tui-group_collapsed>*:nth-child(n):not(:only-child){border-radius:0}.tui-group_adaptive.tui-group_orientation_vertical.tui-group_collapsed>*:first-child:not(:last-child){border-radius:var(--tui-radius-m) var(--tui-radius-m) 0 0}.tui-group_adaptive.tui-group_orientation_vertical.tui-group_collapsed>*:last-child:not(:first-child){border-radius:0 0 var(--tui-radius-m) var(--tui-radius-m)}.tui-group_adaptive.tui-group_orientation_vertical.tui-group_collapsed>*:not(:last-child){margin-bottom:-1px}}@media screen and (max-width: 47.9625em){.tui-group_adaptive.tui-group_orientation_horizontal{flex-direction:column;width:100%}.tui-group_adaptive.tui-group_orientation_horizontal>*:nth-child(n):not(:only-child){border-radius:var(--tui-radius-m)}.tui-group_adaptive.tui-group_orientation_horizontal>*:not(:last-child){margin-right:0;margin-bottom:1rem}.tui-group_adaptive.tui-group_orientation_horizontal.tui-group_collapsed>*:nth-child(n):not(:only-child){border-radius:0}.tui-group_adaptive.tui-group_orientation_horizontal.tui-group_collapsed>*:first-child:not(:last-child){border-radius:var(--tui-radius-m) var(--tui-radius-m) 0 0}.tui-group_adaptive.tui-group_orientation_horizontal.tui-group_collapsed>*:last-child:not(:first-child){border-radius:0 0 var(--tui-radius-m) var(--tui-radius-m)}.tui-group_adaptive.tui-group_orientation_horizontal.tui-group_collapsed>*:not(:last-child){margin-right:0;margin-bottom:-1px}}@media screen and (max-width: 47.9625em){.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_vertical>*:nth-child(n):not(:only-child){border-radius:var(--tui-radius-l)}.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_vertical.tui-group_collapsed>*:nth-child(n):not(:only-child){border-radius:0}.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_vertical.tui-group_collapsed>*:first-child:not(:last-child){border-radius:var(--tui-radius-l) var(--tui-radius-l) 0 0}.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_vertical.tui-group_collapsed>*:last-child:not(:first-child){border-radius:0 0 var(--tui-radius-l) var(--tui-radius-l)}}@media screen and (max-width: 47.9625em){.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_horizontal>*:nth-child(n):not(:only-child){border-radius:var(--tui-radius-l)}.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_horizontal.tui-group_collapsed>*:nth-child(n):not(:only-child){border-radius:0}.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_horizontal.tui-group_collapsed>*:first-child:not(:last-child){border-radius:var(--tui-radius-l) var(--tui-radius-l) 0 0}.tui-group_adaptive.tui-group_radius_large.tui-group_orientation_horizontal.tui-group_collapsed>*:last-child:not(:first-child){border-radius:0 0 var(--tui-radius-l) var(--tui-radius-l)}}.tui-group__auto-width-item{min-width:auto;flex:0 0 auto}.tui-group .tui-group__inherit-item{border-radius:inherit}\n"],
- encapsulation: 2,
- changeDetection: 0
+_LocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _LocationStrategy,
+ factory: function () {
+ return (() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PathLocationStrategy))();
+ },
+ providedIn: 'root'
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiGroupStylesComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LocationStrategy, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
args: [{
- host: {
- class: 'tui-group-styles'
- },
- template: '',
- styleUrls: ['./group.style.less'],
- encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewEncapsulation.None,
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush
+ providedIn: 'root',
+ useFactory: () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PathLocationStrategy)
}]
}], null, null);
})();
-class TuiGroupDirective {
- constructor(directiveStyles) {
- this.orientation = 'horizontal';
- this.adaptive = false;
- this.collapsed = false;
- this.rounded = true;
- this.size = 'm';
- directiveStyles.addComponent(TuiGroupStylesComponent);
+/**
+ * A predefined [DI token](guide/glossary#di-token) for the base href
+ * to be used with the `PathLocationStrategy`.
+ * The base href is the URL prefix that should be preserved when generating
+ * and recognizing URLs.
+ *
+ * @usageNotes
+ *
+ * The following example shows how to use this token to configure the root app injector
+ * with a base href value, so that the DI framework can supply the dependency anywhere in the app.
+ *
+ * ```typescript
+ * import {NgModule} from '@angular/core';
+ * import {APP_BASE_HREF} from '@angular/common';
+ *
+ * @NgModule({
+ * providers: [{provide: APP_BASE_HREF, useValue: '/my/app'}]
+ * })
+ * class AppModule {}
+ * ```
+ *
+ * @publicApi
+ */
+const APP_BASE_HREF = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('appBaseHref');
+/**
+ * @description
+ * A {@link LocationStrategy} used to configure the {@link Location} service to
+ * represent its state in the
+ * [path](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax) of the
+ * browser's URL.
+ *
+ * If you're using `PathLocationStrategy`, you may provide a {@link APP_BASE_HREF}
+ * or add a `` element to the document to override the default.
+ *
+ * For instance, if you provide an `APP_BASE_HREF` of `'/my/app/'` and call
+ * `location.go('/foo')`, the browser's URL will become
+ * `example.com/my/app/foo`. To ensure all relative URIs resolve correctly,
+ * the `` and/or `APP_BASE_HREF` should end with a `/`.
+ *
+ * Similarly, if you add `` to the document and call
+ * `location.go('/foo')`, the browser's URL will become
+ * `example.com/my/app/foo`.
+ *
+ * Note that when using `PathLocationStrategy`, neither the query nor
+ * the fragment in the `` will be preserved, as outlined
+ * by the [RFC](https://tools.ietf.org/html/rfc3986#section-5.2.2).
+ *
+ * @usageNotes
+ *
+ * ### Example
+ *
+ * {@example common/location/ts/path_location_component.ts region='LocationComponent'}
+ *
+ * @publicApi
+ */
+class PathLocationStrategy extends LocationStrategy {
+ constructor(_platformLocation, href) {
+ super();
+ this._platformLocation = _platformLocation;
+ this._removeListenerFns = [];
+ this._baseHref = href ?? this._platformLocation.getBaseHrefFromDOM() ?? (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT).location?.origin ?? '';
+ }
+ /** @nodoc */
+ ngOnDestroy() {
+ while (this._removeListenerFns.length) {
+ this._removeListenerFns.pop()();
+ }
+ }
+ onPopState(fn) {
+ this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
+ }
+ getBaseHref() {
+ return this._baseHref;
+ }
+ prepareExternalUrl(internal) {
+ return joinWithSlash(this._baseHref, internal);
+ }
+ path(includeHash = false) {
+ const pathname = this._platformLocation.pathname + normalizeQueryParams(this._platformLocation.search);
+ const hash = this._platformLocation.hash;
+ return hash && includeHash ? `${pathname}${hash}` : pathname;
+ }
+ pushState(state, title, url, queryParams) {
+ const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
+ this._platformLocation.pushState(state, title, externalUrl);
+ }
+ replaceState(state, title, url, queryParams) {
+ const externalUrl = this.prepareExternalUrl(url + normalizeQueryParams(queryParams));
+ this._platformLocation.replaceState(state, title, externalUrl);
+ }
+ forward() {
+ this._platformLocation.forward();
}
- get orientationHorizontal() {
- return this.orientation === 'horizontal';
+ back() {
+ this._platformLocation.back();
}
- get orientationVertical() {
- return this.orientation === 'vertical';
+ getState() {
+ return this._platformLocation.getState();
}
- get sizeLarge() {
- return this.size === 'l';
+ historyGo(relativePosition = 0) {
+ this._platformLocation.historyGo?.(relativePosition);
}
}
-TuiGroupDirective.ɵfac = function TuiGroupDirective_Factory(t) {
- return new (t || TuiGroupDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.TuiDirectiveStylesService));
+_PathLocationStrategy = PathLocationStrategy;
+_PathLocationStrategy.ɵfac = function _PathLocationStrategy_Factory(t) {
+ return new (t || _PathLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](APP_BASE_HREF, 8));
};
-TuiGroupDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiGroupDirective,
- selectors: [["", "tuiGroup", "", 5, "ng-container"]],
- hostAttrs: ["role", "group", 1, "tui-group"],
- hostVars: 12,
- hostBindings: function TuiGroupDirective_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("tui-group_adaptive", ctx.adaptive)("tui-group_collapsed", ctx.collapsed)("tui-group_rounded", ctx.rounded)("tui-group_orientation_horizontal", ctx.orientationHorizontal)("tui-group_orientation_vertical", ctx.orientationVertical)("tui-group_radius_large", ctx.sizeLarge);
- }
- },
- inputs: {
- orientation: "orientation",
- adaptive: "adaptive",
- collapsed: "collapsed",
- rounded: "rounded",
- size: "size"
- }
+_PathLocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _PathLocationStrategy,
+ factory: _PathLocationStrategy.ɵfac,
+ providedIn: 'root'
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiGroupDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PathLocationStrategy, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
args: [{
- selector: '[tuiGroup]:not(ng-container)',
- host: {
- class: 'tui-group',
- role: 'group'
- }
+ providedIn: 'root'
}]
}], function () {
return [{
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.TuiDirectiveStylesService,
+ type: PlatformLocation
+ }, {
+ type: undefined,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.TuiDirectiveStylesService]
- }]
- }];
- }, {
- orientation: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- adaptive: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class.tui-group_adaptive']
- }],
- collapsed: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class.tui-group_collapsed']
- }],
- rounded: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class.tui-group_rounded']
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- orientationHorizontal: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class.tui-group_orientation_horizontal']
- }],
- orientationVertical: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class.tui-group_orientation_vertical']
- }],
- sizeLarge: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class.tui-group_radius_large']
- }]
- });
-})();
-class TuiGroupModule {}
-TuiGroupModule.ɵfac = function TuiGroupModule_Factory(t) {
- return new (t || TuiGroupModule)();
-};
-TuiGroupModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiGroupModule
-});
-TuiGroupModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_2__.CommonModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiGroupModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_2__.CommonModule],
- declarations: [TuiGroupDirective, TuiGroupStylesComponent],
- exports: [TuiGroupDirective, TuiGroupStylesComponent]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 8009:
-/*!*************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-hints-host.js ***!
- \*************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiHintsHostComponent: () => (/* binding */ TuiHintsHostComponent),
-/* harmony export */ TuiHintsHostModule: () => (/* binding */ TuiHintsHostModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 625);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/services */ 1717);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 4517);
-
-
-
-
-
-
-
-
-
-
-
-function TuiHintsHostComponent_div_0_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainer"](0);
- }
-}
-const _c0 = function (a0) {
- return {
- $implicit: a0
- };
-};
-function TuiHintsHostComponent_div_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiHintsHostComponent_div_0_ng_container_1_Template, 1, 0, "ng-container", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const hint_r1 = ctx.$implicit;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("@tuiParentAnimation", undefined)("tuiActiveZoneParent", hint_r1.activeZone || null);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", hint_r1.component)("polymorpheusOutletContext", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](4, _c0, hint_r1));
- }
-}
-class TuiHintsHostComponent {
- constructor(hints$, destroy$, cdr) {
- this.hints$ = hints$;
- this.destroy$ = destroy$;
- this.cdr = cdr;
- this.hints = [];
- }
- ngOnInit() {
- // Due to this view being parallel to app content, `markForCheck` from `async` pipe
- // can happen after view was checked, so calling `detectChanges` instead
- this.hints$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.takeUntil)(this.destroy$)).subscribe(hints => {
- this.hints = hints;
- this.cdr.detectChanges();
- });
- }
-}
-TuiHintsHostComponent.ɵfac = function TuiHintsHostComponent_Factory(t) {
- return new (t || TuiHintsHostComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_2__.TuiHintService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef));
-};
-TuiHintsHostComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiHintsHostComponent,
- selectors: [["tui-hints-host"]],
- hostAttrs: ["aria-live", "polite"],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService])],
- decls: 1,
- vars: 1,
- consts: [["role", "tooltip", 3, "tuiActiveZoneParent", 4, "ngFor", "ngForOf"], ["role", "tooltip", 3, "tuiActiveZoneParent"], [4, "polymorpheusOutlet", "polymorpheusOutletContext"]],
- template: function TuiHintsHostComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiHintsHostComponent_div_0_Template, 2, 6, "div", 0);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx.hints);
- }
- },
- dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_4__.NgForOf, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.TuiActiveZoneDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusOutletDirective],
- styles: ["[_nghost-%COMP%]{position:fixed;top:0;left:0;width:100%;height:0}"],
- data: {
- animation: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TUI_PARENT_ANIMATION]
- }
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintsHostComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-hints-host',
- templateUrl: './hints-host.template.html',
- styleUrls: ['./hints-host.style.less'],
- // So that we do not force OnPush on custom hints
- // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.Default,
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService],
- animations: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TUI_PARENT_ANIMATION],
- host: {
- 'aria-live': 'polite'
- }
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_2__.TuiHintService]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_8__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
}, {
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef]
+ args: [APP_BASE_HREF]
}]
}];
}, null);
})();
-class TuiHintsHostModule {}
-TuiHintsHostModule.ɵfac = function TuiHintsHostModule_Factory(t) {
- return new (t || TuiHintsHostModule)();
-};
-TuiHintsHostModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiHintsHostModule
-});
-TuiHintsHostModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_4__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.TuiActiveZoneModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintsHostModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_4__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.TuiActiveZoneModule],
- declarations: [TuiHintsHostComponent],
- exports: [TuiHintsHostComponent]
- }]
- }], null, null);
-})();
/**
- * Generated bundle index. Do not edit.
+ * @description
+ * A {@link LocationStrategy} used to configure the {@link Location} service to
+ * represent its state in the
+ * [hash fragment](https://en.wikipedia.org/wiki/Uniform_Resource_Locator#Syntax)
+ * of the browser's URL.
+ *
+ * For instance, if you call `location.go('/foo')`, the browser's URL will become
+ * `example.com#/foo`.
+ *
+ * @usageNotes
+ *
+ * ### Example
+ *
+ * {@example common/location/ts/hash_location_component.ts region='LocationComponent'}
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 1443:
-/*!******************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-hosted-dropdown.js ***!
- \******************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiAccessorProxyDirective: () => (/* binding */ TuiAccessorProxyDirective),
-/* harmony export */ TuiDropdownOpenMonitorDirective: () => (/* binding */ TuiDropdownOpenMonitorDirective),
-/* harmony export */ TuiHostedDropdownComponent: () => (/* binding */ TuiHostedDropdownComponent),
-/* harmony export */ TuiHostedDropdownConnectorDirective: () => (/* binding */ TuiHostedDropdownConnectorDirective),
-/* harmony export */ TuiHostedDropdownModule: () => (/* binding */ TuiHostedDropdownModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/core/abstract */ 9139);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @taiga-ui/cdk */ 9163);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @taiga-ui/cdk */ 625);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @taiga-ui/cdk */ 9297);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk */ 4333);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core/directives/dropdown */ 2577);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ 5171);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 9473);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 5603);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 5536);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ 1640);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ 523);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var _taiga_ui_core_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @taiga-ui/core/utils/miscellaneous */ 2189);
-/* harmony import */ var _tinkoff_ng_event_plugins__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @tinkoff/ng-event-plugins */ 652);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-const _c0 = ["wrapper"];
-function TuiHostedDropdownComponent_div_0_ng_template_3_div_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 8);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const text_r7 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r7, " ");
+class HashLocationStrategy extends LocationStrategy {
+ constructor(_platformLocation, _baseHref) {
+ super();
+ this._platformLocation = _platformLocation;
+ this._baseHref = '';
+ this._removeListenerFns = [];
+ if (_baseHref != null) {
+ this._baseHref = _baseHref;
+ }
}
-}
-const _c1 = function (a0, a1) {
- return {
- $implicit: a0,
- close: a1
- };
-};
-function TuiHostedDropdownComponent_div_0_ng_template_3_Template(rf, ctx) {
- if (rf & 1) {
- const _r9 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 5, 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("keydown", function TuiHostedDropdownComponent_div_0_ng_template_3_Template_div_keydown_0_listener($event) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r9);
- const ctx_r8 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r8.onKeydown($event));
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiHostedDropdownComponent_div_0_ng_template_3_div_2_Template, 2, 1, "div", 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](3, "div");
+ /** @nodoc */
+ ngOnDestroy() {
+ while (this._removeListenerFns.length) {
+ this._removeListenerFns.pop()();
+ }
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- const _r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](1);
- const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r4.content)("polymorpheusOutletContext", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction2"](2, _c1, _r2, ctx_r4.close));
+ onPopState(fn) {
+ this._removeListenerFns.push(this._platformLocation.onPopState(fn), this._platformLocation.onHashChange(fn));
}
-}
-function TuiHostedDropdownComponent_div_0_Template(rf, ctx) {
- if (rf & 1) {
- const _r11 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 1, 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("tuiActiveZoneChange", function TuiHostedDropdownComponent_div_0_Template_div_tuiActiveZoneChange_0_listener($event) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r11);
- const ctx_r10 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r10.onActiveZone($event));
- })("tuiObscured", function TuiHostedDropdownComponent_div_0_Template_div_tuiObscured_0_listener($event) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r11);
- const ctx_r12 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r12.onHostObscured($event));
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](3, TuiHostedDropdownComponent_div_0_ng_template_3_Template, 4, 5, "ng-template", 3, 4, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplateRefExtractor"]);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+ getBaseHref() {
+ return this._baseHref;
}
- if (rf & 2) {
- const isOpen_r1 = ctx.tuiLet;
- const _r3 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](4);
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("tuiDropdown", _r3)("tuiDropdownManual", isOpen_r1 && ctx_r0.canOpen)("tuiDropdownOpenMonitor", isOpen_r1 && ctx_r0.canOpen)("tuiDropdownSided", ctx_r0.sided)("tuiObscuredEnabled", isOpen_r1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheus", ctx_r0.context);
+ path(includeHash = false) {
+ // the hash value is always prefixed with a `#`
+ // and if it is empty then it will stay empty
+ let path = this._platformLocation.hash;
+ if (path == null) path = '#';
+ return path.length > 0 ? path.substring(1) : path;
}
-}
-const _c2 = ["*"];
-class TuiAccessorProxyDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_1__.TuiPositionAccessor {
- constructor() {
- super(...arguments);
- this.type = 'dummy';
+ prepareExternalUrl(internal) {
+ const url = joinWithSlash(this._baseHref, internal);
+ return url.length > 0 ? '#' + url : url;
}
- getPosition() {
- return [0, 0];
+ pushState(state, title, path, queryParams) {
+ let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));
+ if (url.length == 0) {
+ url = this._platformLocation.pathname;
+ }
+ this._platformLocation.pushState(state, title, url);
}
-}
-TuiAccessorProxyDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiAccessorProxyDirective_BaseFactory;
- return function TuiAccessorProxyDirective_Factory(t) {
- return (ɵTuiAccessorProxyDirective_BaseFactory || (ɵTuiAccessorProxyDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](TuiAccessorProxyDirective)))(t || TuiAccessorProxyDirective);
- };
-}();
-TuiAccessorProxyDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiAccessorProxyDirective,
- selectors: [["", "tuiAccessorProxy", ""]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_1__.TuiPositionAccessor,
- multi: true,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf(), TuiAccessorProxyDirective], TuiAccessorProxyDirective],
- useFactory: (accessor, fallback) => accessor || fallback
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAccessorProxyDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiAccessorProxy]',
- providers: [{
- provide: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_1__.TuiPositionAccessor,
- multi: true,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf(), TuiAccessorProxyDirective], TuiAccessorProxyDirective],
- useFactory: (accessor, fallback) => accessor || fallback
- }]
- }]
- }], null, null);
-})();
-const TUI_HOSTED_DROPDOWN_COMPONENT = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('[TUI_HOSTED_DROPDOWN_COMPONENT]');
-class TuiDropdownOpenMonitorDirective {
- constructor(destroy$, hosted, dropdown, open) {
- this.hosted = hosted;
- this.open = open;
- if ((open === null || open === void 0 ? void 0 : open.dropdown) === dropdown) {
- open.tuiDropdownOpenChange.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.takeUntil)(destroy$)).subscribe(value => {
- var _a;
- if (value) {
- (_a = hosted.nativeFocusableElement) === null || _a === void 0 ? void 0 : _a.focus();
- }
- hosted.updateOpen(value);
- });
+ replaceState(state, title, path, queryParams) {
+ let url = this.prepareExternalUrl(path + normalizeQueryParams(queryParams));
+ if (url.length == 0) {
+ url = this._platformLocation.pathname;
}
+ this._platformLocation.replaceState(state, title, url);
}
- set tuiDropdownOpenMonitor(open) {
- var _a;
- (_a = this.open) === null || _a === void 0 ? void 0 : _a.update(open);
- this.hosted.updateOpen(open);
+ forward() {
+ this._platformLocation.forward();
+ }
+ back() {
+ this._platformLocation.back();
+ }
+ getState() {
+ return this._platformLocation.getState();
+ }
+ historyGo(relativePosition = 0) {
+ this._platformLocation.historyGo?.(relativePosition);
}
}
-TuiDropdownOpenMonitorDirective.ɵfac = function TuiDropdownOpenMonitorDirective_Factory(t) {
- return new (t || TuiDropdownOpenMonitorDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_HOSTED_DROPDOWN_COMPONENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDirective, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownOpenDirective, 8));
+_HashLocationStrategy = HashLocationStrategy;
+_HashLocationStrategy.ɵfac = function _HashLocationStrategy_Factory(t) {
+ return new (t || _HashLocationStrategy)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](PlatformLocation), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](APP_BASE_HREF, 8));
};
-TuiDropdownOpenMonitorDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownOpenMonitorDirective,
- selectors: [["", "tuiDropdownOpenMonitor", ""]],
- inputs: {
- tuiDropdownOpenMonitor: "tuiDropdownOpenMonitor"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService])]
+_HashLocationStrategy.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _HashLocationStrategy,
+ factory: _HashLocationStrategy.ɵfac
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownOpenMonitorDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiDropdownOpenMonitor]',
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService]
- }]
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](HashLocationStrategy, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable
}], function () {
return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_5__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService]
- }]
+ type: PlatformLocation
}, {
type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_HOSTED_DROPDOWN_COMPONENT]
- }]
- }, {
- type: _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDirective]
- }]
- }, {
- type: _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownOpenDirective,
decorators: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
}, {
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownOpenDirective]
+ args: [APP_BASE_HREF]
}]
}];
- }, {
- tuiDropdownOpenMonitor: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiHostedDropdownConnectorDirective {}
-TuiHostedDropdownConnectorDirective.ɵfac = function TuiHostedDropdownConnectorDirective_Factory(t) {
- return new (t || TuiHostedDropdownConnectorDirective)();
-};
-TuiHostedDropdownConnectorDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHostedDropdownConnectorDirective,
- selectors: [["", "tuiHostedDropdownHost", ""]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHostedDropdownConnectorDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiHostedDropdownHost]'
- }]
- }], null, null);
+ }, null);
})();
-function shouldClose(event) {
- var _a;
- return 'key' in event && event.key.toLowerCase() === 'escape' && this.canOpen && this.open && !((_a = this.dropdown) === null || _a === void 0 ? void 0 : _a.nextElementSibling);
-}
-class TuiHostedDropdownComponent {
- constructor(hover$, el) {
- this.hover$ = hover$;
- this.el = el;
- this.openChange$ = new rxjs__WEBPACK_IMPORTED_MODULE_6__.BehaviorSubject(false);
- this.hostHover$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_7__.combineLatest)([(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.tuiTypedFromEvent)(this.el.nativeElement, 'mouseover').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.map)(e => this.computedHost.contains((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiGetActualTarget)(e))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.switchMap)(visible => {
- var _a, _b;
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_12__.of)(visible).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.delay)((visible ? (_a = this.hover$) === null || _a === void 0 ? void 0 : _a.showDelay : (_b = this.hover$) === null || _b === void 0 ? void 0 : _b.hideDelay) || 0));
- })), this.hover$ || rxjs__WEBPACK_IMPORTED_MODULE_14__.EMPTY]).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.map)(([visible, hovered]) => visible && hovered));
- this.sided = false;
- this.canOpen = true;
- this.open$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_15__.merge)(this.openChange$, this.hostHover$).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.skip)(1), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.distinctUntilChanged)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.share)());
- this.focusedChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
- /** TODO: rename in 4.0 */
- this.openChange = this.openChange$;
- this.close = () => this.updateOpen(false);
- }
- set open(open) {
- this.openChange.next(open);
- }
- get open() {
- return this.openChange.value;
- }
- get host() {
- var _a;
- return ((_a = this.dropdownHost) === null || _a === void 0 ? void 0 : _a.nativeElement) || this.el.nativeElement;
+
+/**
+ * @description
+ *
+ * A service that applications can use to interact with a browser's URL.
+ *
+ * Depending on the `LocationStrategy` used, `Location` persists
+ * to the URL's path or the URL's hash segment.
+ *
+ * @usageNotes
+ *
+ * It's better to use the `Router.navigate()` service to trigger route changes. Use
+ * `Location` only if you need to interact with or create normalized URLs outside of
+ * routing.
+ *
+ * `Location` is responsible for normalizing the URL against the application's base href.
+ * A normalized URL is absolute from the URL host, includes the application's base href, and has no
+ * trailing slash:
+ * - `/my/app/user/123` is normalized
+ * - `my/app/user/123` **is not** normalized
+ * - `/my/app/user/123/` **is not** normalized
+ *
+ * ### Example
+ *
+ *
+ *
+ * @publicApi
+ */
+class Location {
+ constructor(locationStrategy) {
+ /** @internal */
+ this._subject = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
+ /** @internal */
+ this._urlChangeListeners = [];
+ /** @internal */
+ this._urlChangeSubscription = null;
+ this._locationStrategy = locationStrategy;
+ const baseHref = this._locationStrategy.getBaseHref();
+ // Note: This class's interaction with base HREF does not fully follow the rules
+ // outlined in the spec https://www.freesoft.org/CIE/RFC/1808/18.htm.
+ // Instead of trying to fix individual bugs with more and more code, we should
+ // investigate using the URL constructor and providing the base as a second
+ // argument.
+ // https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#parameters
+ this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref)));
+ this._locationStrategy.onPopState(ev => {
+ this._subject.emit({
+ 'url': this.path(true),
+ 'pop': true,
+ 'state': ev.state,
+ 'type': ev.type
+ });
+ });
}
- get computedHost() {
- var _a;
- return ((_a = this.dropdownHost) === null || _a === void 0 ? void 0 : _a.nativeElement) || this.nativeFocusableElement || this.el.nativeElement;
+ /** @nodoc */
+ ngOnDestroy() {
+ this._urlChangeSubscription?.unsubscribe();
+ this._urlChangeListeners = [];
}
- get dropdown() {
- var _a, _b;
- return (_b = (_a = this.dropdownDirective) === null || _a === void 0 ? void 0 : _a.dropdownBoxRef) === null || _b === void 0 ? void 0 : _b.location.nativeElement;
+ /**
+ * Normalizes the URL path for this location.
+ *
+ * @param includeHash True to include an anchor fragment in the path.
+ *
+ * @returns The normalized URL path.
+ */
+ // TODO: vsavkin. Remove the boolean flag and always include hash once the deprecated router is
+ // removed.
+ path(includeHash = false) {
+ return this.normalize(this._locationStrategy.path(includeHash));
}
- get nativeFocusableElement() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.tuiIsNativeKeyboardFocusable)(this.host) ? this.host : (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.tuiGetClosestFocusable)({
- initial: this.host,
- root: this.el.nativeElement
- });
+ /**
+ * Reports the current state of the location history.
+ * @returns The current value of the `history.state` object.
+ */
+ getState() {
+ return this._locationStrategy.getState();
}
- get focused() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.tuiIsNativeFocusedIn)(this.host) || this.open && !!this.wrapper && (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.tuiIsNativeFocusedIn)(this.wrapper.nativeElement);
+ /**
+ * Normalizes the given path and compares to the current normalized path.
+ *
+ * @param path The given URL path.
+ * @param query Query parameters.
+ *
+ * @returns True if the given URL path is equal to the current normalized path, false
+ * otherwise.
+ */
+ isCurrentPathEqualTo(path, query = '') {
+ return this.path() == this.normalize(path + normalizeQueryParams(query));
}
- onFocusInOut() {
- this.el.nativeElement.classList.toggle('_hosted_dropdown_focused', this.focused);
+ /**
+ * Normalizes a URL path by stripping any trailing slashes.
+ *
+ * @param url String representing a URL.
+ *
+ * @returns The normalized URL string.
+ */
+ normalize(url) {
+ return Location.stripTrailingSlash(_stripBasePath(this._basePath, _stripIndexHtml(url)));
}
- onFocusIn(target) {
- if (!this.computedHost.contains(target)) {
- this.updateOpen(false);
+ /**
+ * Normalizes an external URL path.
+ * If the given URL doesn't begin with a leading slash (`'/'`), adds one
+ * before normalizing. Adds a hash if `HashLocationStrategy` is
+ * in use, or the `APP_BASE_HREF` if the `PathLocationStrategy` is in use.
+ *
+ * @param url String representing a URL.
+ *
+ * @returns A normalized platform-specific URL.
+ */
+ prepareExternalUrl(url) {
+ if (url && url[0] !== '/') {
+ url = '/' + url;
}
+ return this._locationStrategy.prepareExternalUrl(url);
}
- onClick(target) {
- var _a;
- if (!this.hostEditable && this.computedHost.contains(target) && !((_a = this.hover$) === null || _a === void 0 ? void 0 : _a.hovered)) {
- this.updateOpen(!this.open);
- }
+ // TODO: rename this method to pushState
+ /**
+ * Changes the browser's URL to a normalized version of a given URL, and pushes a
+ * new item onto the platform's history.
+ *
+ * @param path URL path to normalize.
+ * @param query Query parameters.
+ * @param state Location history state.
+ *
+ */
+ go(path, query = '', state = null) {
+ this._locationStrategy.pushState(state, '', path, query);
+ this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
}
- onKeyDownEsc(event) {
- event.preventDefault();
- this.closeDropdown();
+ /**
+ * Changes the browser's URL to a normalized version of the given URL, and replaces
+ * the top item on the platform's history stack.
+ *
+ * @param path URL path to normalize.
+ * @param query Query parameters.
+ * @param state Location history state.
+ */
+ replaceState(path, query = '', state = null) {
+ this._locationStrategy.replaceState(state, '', path, query);
+ this._notifyUrlChangeListeners(this.prepareExternalUrl(path + normalizeQueryParams(query)), state);
}
- onArrow(event, down) {
- this.focusDropdown(event, down);
+ /**
+ * Navigates forward in the platform's history.
+ */
+ forward() {
+ this._locationStrategy.forward();
}
- onKeydown({
- key,
- target,
- defaultPrevented
- }) {
- if (!defaultPrevented && (0,_taiga_ui_core_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_20__.tuiIsEditingKey)(key) && this.hostEditable && (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiIsHTMLElement)(target) && !(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiIsElementEditable)(target)) {
- this.focusHost();
- }
+ /**
+ * Navigates back in the platform's history.
+ */
+ back() {
+ this._locationStrategy.back();
}
- onActiveZone(active) {
- this.updateFocused(active);
- if (!active) {
- this.updateOpen(false);
- }
- }
- onHostObscured(obscured) {
- if (obscured) {
- this.closeDropdown();
- }
- }
- updateOpen(open) {
- if (!open || this.canOpen) {
- this.open = open;
- }
- }
- get hostEditable() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiIsElementEditable)(this.computedHost);
+ /**
+ * Navigate to a specific page from session history, identified by its relative position to the
+ * current page.
+ *
+ * @param relativePosition Position of the target page in the history relative to the current
+ * page.
+ * A negative value moves backwards, a positive value moves forwards, e.g. `location.historyGo(2)`
+ * moves forward two pages and `location.historyGo(-2)` moves back two pages. When we try to go
+ * beyond what's stored in the history session, we stay in the current page. Same behaviour occurs
+ * when `relativePosition` equals 0.
+ * @see https://developer.mozilla.org/en-US/docs/Web/API/History_API#Moving_to_a_specific_point_in_history
+ */
+ historyGo(relativePosition = 0) {
+ this._locationStrategy.historyGo?.(relativePosition);
}
- focusDropdown(event, first) {
- const host = this.nativeFocusableElement;
- if (!host || !(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiIsHTMLElement)(host) || !(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiIsElement)(event.target) || !host.contains(event.target)) {
- return;
+ /**
+ * Registers a URL change listener. Use to catch updates performed by the Angular
+ * framework that are not detectible through "popstate" or "hashchange" events.
+ *
+ * @param fn The change handler function, which take a URL and a location history state.
+ * @returns A function that, when executed, unregisters a URL change listener.
+ */
+ onUrlChange(fn) {
+ this._urlChangeListeners.push(fn);
+ if (!this._urlChangeSubscription) {
+ this._urlChangeSubscription = this.subscribe(v => {
+ this._notifyUrlChangeListeners(v.url, v.state);
+ });
}
- if (!this.wrapper || !this.open || !this.dropdown || !(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiIsHTMLElement)(this.wrapper.nativeElement.nextElementSibling)) {
- this.updateOpen(true);
- if (!(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiIsElementEditable)(host)) {
- event.preventDefault();
+ return () => {
+ const fnIndex = this._urlChangeListeners.indexOf(fn);
+ this._urlChangeListeners.splice(fnIndex, 1);
+ if (this._urlChangeListeners.length === 0) {
+ this._urlChangeSubscription?.unsubscribe();
+ this._urlChangeSubscription = null;
}
- return;
- }
- const initial = first ? this.wrapper.nativeElement : this.wrapper.nativeElement.nextElementSibling;
- const focusable = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.tuiGetClosestFocusable)({
- initial,
- root: this.wrapper.nativeElement,
- previous: !first
- });
- if (!focusable) {
- return;
- }
- focusable.focus();
- event.preventDefault();
- }
- closeDropdown() {
- if (this.focused) {
- this.focusHost();
- }
- this.updateOpen(false);
+ };
}
- focusHost() {
- const host = this.nativeFocusableElement;
- if (host) {
- host.focus({
- preventScroll: true
- });
- }
+ /** @internal */
+ _notifyUrlChangeListeners(url = '', state) {
+ this._urlChangeListeners.forEach(fn => fn(url, state));
}
- updateFocused(focused) {
- this.focusedChange.emit(focused);
+ /**
+ * Subscribes to the platform's `popState` events.
+ *
+ * Note: `Location.go()` does not trigger the `popState` event in the browser. Use
+ * `Location.onUrlChange()` to subscribe to URL changes instead.
+ *
+ * @param value Event that is triggered when the state history changes.
+ * @param exception The exception to throw.
+ *
+ * @see [onpopstate](https://developer.mozilla.org/en-US/docs/Web/API/WindowEventHandlers/onpopstate)
+ *
+ * @returns Subscribed events.
+ */
+ subscribe(onNext, onThrow, onReturn) {
+ return this._subject.subscribe({
+ next: onNext,
+ error: onThrow,
+ complete: onReturn
+ });
}
+ /**
+ * Normalizes URL parameters by prepending with `?` if needed.
+ *
+ * @param params String of URL parameters.
+ *
+ * @returns The normalized URL parameters string.
+ */
}
-TuiHostedDropdownComponent.ɵfac = function TuiHostedDropdownComponent_Factory(t) {
- return new (t || TuiHostedDropdownComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownHoverDirective, 10), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef));
-};
-TuiHostedDropdownComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiHostedDropdownComponent,
- selectors: [["tui-hosted-dropdown"]],
- contentQueries: function TuiHostedDropdownComponent_ContentQueries(rf, ctx, dirIndex) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵcontentQuery"](dirIndex, TuiHostedDropdownConnectorDirective, 5, _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.dropdownHost = _t.first);
- }
- },
- viewQuery: function TuiHostedDropdownComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_c0, 5, _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDirective, 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiActiveZoneDirective, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.wrapper = _t.first);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.dropdownDirective = _t.first);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.activeZone = _t.first);
- }
- },
- hostBindings: function TuiHostedDropdownComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("focusin.capture.silent", function TuiHostedDropdownComponent_focusin_capture_silent_HostBindingHandler() {
- return ctx.onFocusInOut();
- })("focusout.capture.silent", function TuiHostedDropdownComponent_focusout_capture_silent_HostBindingHandler() {
- return ctx.onFocusInOut();
- })("focusin", function TuiHostedDropdownComponent_focusin_HostBindingHandler($event) {
- return ctx.onFocusIn($event.target);
- })("click", function TuiHostedDropdownComponent_click_HostBindingHandler($event) {
- return ctx.onClick($event.target);
- })("keydown.silent.capture", function TuiHostedDropdownComponent_keydown_silent_capture_HostBindingHandler($event) {
- return ctx.onKeyDownEsc($event);
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresolveDocument"])("keydown.arrowDown", function TuiHostedDropdownComponent_keydown_arrowDown_HostBindingHandler($event) {
- return ctx.onArrow($event, true);
- })("keydown.arrowUp", function TuiHostedDropdownComponent_keydown_arrowUp_HostBindingHandler($event) {
- return ctx.onArrow($event, false);
- });
- }
- },
- inputs: {
- content: "content",
- sided: "sided",
- canOpen: "canOpen",
- open: "open"
- },
- outputs: {
- open$: "openChange",
- focusedChange: "focusedChange"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__.tuiAsFocusableItemAccessor)(TuiHostedDropdownComponent), {
- provide: TuiAccessorProxyDirective,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self(), _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_1__.TuiPositionAccessor]],
- useFactory: position => position === null || position === void 0 ? void 0 : position[0]
- }, {
- provide: TUI_HOSTED_DROPDOWN_COMPONENT,
- useExisting: TuiHostedDropdownComponent
- }])],
- ngContentSelectors: _c2,
- decls: 2,
- vars: 3,
- consts: [["tuiAccessorProxy", "", "class", "t-wrapper", 3, "tuiDropdown", "tuiDropdownManual", "tuiDropdownOpenMonitor", "tuiDropdownSided", "tuiObscuredEnabled", "tuiActiveZoneChange", "tuiObscured", 4, "tuiLet"], ["tuiAccessorProxy", "", 1, "t-wrapper", 3, "tuiDropdown", "tuiDropdownManual", "tuiDropdownOpenMonitor", "tuiDropdownSided", "tuiObscuredEnabled", "tuiActiveZoneChange", "tuiObscured"], ["activeZone", "tuiActiveZone"], [3, "polymorpheus"], ["dropdown", "polymorpheus"], [1, "t-dropdown", 3, "keydown"], ["wrapper", ""], ["class", "t-primitive", 4, "polymorpheusOutlet", "polymorpheusOutletContext"], [1, "t-primitive"]],
- template: function TuiHostedDropdownComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiHostedDropdownComponent_div_0_Template, 5, 6, "div", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](1, "async");
- }
- if (rf & 2) {
- let tmp_0_0;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("tuiLet", (tmp_0_0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](1, 1, ctx.open$)) !== null && tmp_0_0 !== undefined ? tmp_0_0 : ctx.openChange.value);
- }
- },
- dependencies: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_23__.TuiLetDirective, TuiAccessorProxyDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDriverDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownPositionDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownManualDirective, TuiDropdownOpenMonitorDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownPositionSidedDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiActiveZoneDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiObscuredDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_25__.PolymorpheusTemplate, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_25__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_26__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{display:inline-flex}.t-wrapper[_ngcontent-%COMP%]{border-radius:inherit;height:inherit;flex:1 1 auto;width:100%}.t-dropdown[_ngcontent-%COMP%]{height:100%}.t-primitive[_ngcontent-%COMP%]{padding:1rem}"],
- changeDetection: 0
-});
-(0,tslib__WEBPACK_IMPORTED_MODULE_27__.__decorate)([(0,_tinkoff_ng_event_plugins__WEBPACK_IMPORTED_MODULE_28__.shouldCall)(shouldClose)], TuiHostedDropdownComponent.prototype, "onKeyDownEsc", null);
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHostedDropdownComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-hosted-dropdown',
- templateUrl: './hosted-dropdown.template.html',
- styleUrls: ['./hosted-dropdown.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__.tuiAsFocusableItemAccessor)(TuiHostedDropdownComponent), {
- provide: TuiAccessorProxyDirective,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self(), _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_1__.TuiPositionAccessor]],
- useFactory: position => position === null || position === void 0 ? void 0 : position[0]
- }, {
- provide: TUI_HOSTED_DROPDOWN_COMPONENT,
- useExisting: TuiHostedDropdownComponent
- }]
- }]
- }], function () {
- return [{
- type: _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownHoverDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownHoverDirective]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }];
- }, {
- dropdownHost: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ContentChild,
- args: [TuiHostedDropdownConnectorDirective, {
- read: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef
- }]
- }],
- wrapper: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChild,
- args: ['wrapper', {
- read: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef
- }]
- }],
- dropdownDirective: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChild,
- args: [_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownDirective]
- }],
- activeZone: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChild,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiActiveZoneDirective]
- }],
- content: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- sided: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- canOpen: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- open$: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output,
- args: ['openChange']
- }],
- focusedChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output
- }],
- open: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- onFocusInOut: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['focusin.capture.silent']
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['focusout.capture.silent']
- }],
- onFocusIn: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['focusin', ['$event.target']]
- }],
- onClick: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['click', ['$event.target']]
- }],
- onKeyDownEsc: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['document:keydown.silent.capture', ['$event']]
- }],
- onArrow: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['keydown.arrowDown', ['$event', 'true']]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['keydown.arrowUp', ['$event', 'false']]
- }]
- });
-})();
-class TuiHostedDropdownModule {}
-TuiHostedDropdownModule.ɵfac = function TuiHostedDropdownModule_Factory(t) {
- return new (t || TuiHostedDropdownModule)();
-};
-TuiHostedDropdownModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiHostedDropdownModule
-});
-TuiHostedDropdownModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_26__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_25__.PolymorpheusModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_23__.TuiLetModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiObscuredModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiActiveZoneModule, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHostedDropdownModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_26__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_25__.PolymorpheusModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_23__.TuiLetModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiObscuredModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiActiveZoneModule, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownModule],
- declarations: [TuiAccessorProxyDirective, TuiDropdownOpenMonitorDirective, TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective],
- exports: [TuiHostedDropdownComponent, TuiHostedDropdownConnectorDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_4__.TuiDropdownOptionsDirective]
- }]
- }], null, null);
-})();
-
+_Location = Location;
+_Location.normalizeQueryParams = normalizeQueryParams;
/**
- * Generated bundle index. Do not edit.
+ * Joins two parts of a URL with a slash if needed.
+ *
+ * @param start URL string
+ * @param end URL string
+ *
+ *
+ * @returns The joined URL string.
*/
-
-
-
-/***/ }),
-
-/***/ 578:
-/*!*******************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-link.js ***!
- \*******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiLinkComponent: () => (/* binding */ TuiLinkComponent),
-/* harmony export */ TuiLinkModule: () => (/* binding */ TuiLinkModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/core/providers */ 2871);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/core/components/svg */ 3442);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-// @bad TODO: Think about extending Interactive
-const _c0 = ["tuiLink", ""];
-function TuiLinkComponent_tui_svg_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 3);
- }
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", ctx_r0.icon || "");
- }
-}
-function TuiLinkComponent_tui_svg_3_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 4);
- }
- if (rf & 2) {
- const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", ctx_r1.icon || "");
- }
-}
-const _c1 = ["*"];
-class TuiLinkComponent {
- constructor(el, mode$, focusVisible$) {
- this.el = el;
- this.mode$ = mode$;
- this.pseudo = false;
- this.icon = '';
- this.iconAlign = 'right';
- this.iconRotated = false;
- this.mode = null;
- this.focusVisible = false;
- this.focusedChange = (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.merge)((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiTypedFromEvent)(this.el.nativeElement, 'focusin').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.ALWAYS_TRUE_HANDLER)), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiTypedFromEvent)(this.el.nativeElement, 'focusout').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.map)(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.ALWAYS_FALSE_HANDLER)));
- focusVisible$.subscribe(visible => {
- this.focusVisible = visible;
- });
- }
- get nativeFocusableElement() {
- return this.el.nativeElement;
- }
- get focused() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiIsNativeFocused)(this.nativeFocusableElement);
- }
- get hasIcon() {
- return !!this.icon;
- }
- get iconAlignLeft() {
- return this.hasIcon && this.iconAlign === 'left';
- }
- get iconAlignRight() {
- return this.hasIcon && this.iconAlign === 'right';
- }
-}
-TuiLinkComponent.ɵfac = function TuiLinkComponent_Factory(t) {
- return new (t || TuiLinkComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_MODE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiFocusVisibleService));
+_Location.joinWithSlash = joinWithSlash;
+/**
+ * Removes a trailing slash from a URL string if needed.
+ * Looks for the first occurrence of either `#`, `?`, or the end of the
+ * line as `/` characters and removes the trailing slash if one exists.
+ *
+ * @param url URL string.
+ *
+ * @returns The URL string, modified if needed.
+ */
+_Location.stripTrailingSlash = stripTrailingSlash;
+_Location.ɵfac = function _Location_Factory(t) {
+ return new (t || _Location)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](LocationStrategy));
};
-TuiLinkComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiLinkComponent,
- selectors: [["a", "tuiLink", ""], ["button", "tuiLink", ""]],
- hostVars: 7,
- hostBindings: function TuiLinkComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("$.data-mode.attr", function TuiLinkComponent___data_mode_attr_HostBindingHandler() {
- return ctx.mode$;
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-host-mode", ctx.mode);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_pseudo", ctx.pseudo)("_icon-rotated", ctx.iconRotated)("_focus-visible", ctx.focusVisible);
- }
- },
- inputs: {
- pseudo: "pseudo",
- icon: "icon",
- iconAlign: "iconAlign",
- iconRotated: "iconRotated",
- mode: "mode"
- },
- exportAs: ["tuiLink"],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.tuiAsFocusableItemAccessor)(TuiLinkComponent), _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiFocusVisibleService, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_9__.MODE_PROVIDER])],
- attrs: _c0,
- ngContentSelectors: _c1,
- decls: 4,
- vars: 2,
- consts: [["class", "t-icon t-icon_left", 3, "src", 4, "ngIf"], [1, "t-content"], ["class", "t-icon t-icon_right", 3, "src", 4, "ngIf"], [1, "t-icon", "t-icon_left", 3, "src"], [1, "t-icon", "t-icon_right", 3, "src"]],
- template: function TuiLinkComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiLinkComponent_tui_svg_0_Template, 1, 1, "tui-svg", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "span", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](3, TuiLinkComponent_tui_svg_3_Template, 1, 1, "tui-svg", 2);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.iconAlignLeft);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.iconAlignRight);
- }
+_Location.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _Location,
+ factory: function () {
+ return createLocation();
},
- dependencies: [_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_10__.TuiSvgComponent, _angular_common__WEBPACK_IMPORTED_MODULE_11__.NgIf],
- styles: ["[_nghost-%COMP%]{-webkit-appearance:none;-moz-appearance:none;appearance:none;padding:0;border:0;background:none;font-size:inherit;line-height:inherit;text-decoration:none;transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;color:var(--tui-link);text-align:left;text-transform:inherit;font-weight:inherit;cursor:pointer;outline:none}[_nghost-%COMP%]:hover{color:var(--tui-link-hover)}[_nghost-%COMP%]:disabled{opacity:var(--tui-disabled-opacity);cursor:default}[data-mode=onLight][_nghost-%COMP%]{color:var(--tui-text-02)}[data-mode=onLight][_nghost-%COMP%]:hover, [data-mode=onLight]._active[_nghost-%COMP%]{color:var(--tui-text-01)}[data-mode=onLight]._pseudo[_nghost-%COMP%]{color:var(--tui-text-01)}[data-mode=onLight]._pseudo[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{-webkit-text-decoration-color:rgba(0,0,0,.48);text-decoration-color:#0000007a}[data-mode=onLight]._pseudo[_nghost-%COMP%]:hover, [data-mode=onLight]._pseudo._active[_nghost-%COMP%]{color:var(--tui-text-03)}[data-mode=onLight][data-host-mode=negative][_nghost-%COMP%]{color:var(--tui-negative-night)}[data-mode=onLight][data-host-mode=negative][_nghost-%COMP%]:hover, [data-mode=onLight][data-host-mode=negative][_nghost-%COMP%]:active, [data-mode=onLight][data-host-mode=negative]._active[_nghost-%COMP%]{color:var(--tui-negative-night-hover)}[data-mode=onDark][_nghost-%COMP%]{color:var(--tui-text-03-night)}[data-mode=onDark][_nghost-%COMP%]:hover, [data-mode=onDark][_nghost-%COMP%]:active, [data-mode=onDark]._active[_nghost-%COMP%]{color:var(--tui-text-01-night)}[data-mode=onDark]._pseudo[_nghost-%COMP%]{color:var(--tui-text-01-night)}[data-mode=onDark]._pseudo[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{-webkit-text-decoration-color:rgba(255,255,255,.48);text-decoration-color:#ffffff7a}[data-mode=onDark]._pseudo[_nghost-%COMP%]:hover, [data-mode=onDark]._pseudo[_nghost-%COMP%]:active, [data-mode=onDark]._pseudo._active[_nghost-%COMP%]{color:var(--tui-text-03-night)}[data-mode=onDark][data-host-mode=positive][_nghost-%COMP%]{color:var(--tui-positive-night)}[data-mode=onDark][data-host-mode=positive][_nghost-%COMP%]:hover, [data-mode=onDark][data-host-mode=positive][_nghost-%COMP%]:active, [data-mode=onDark][data-host-mode=positive]._active[_nghost-%COMP%]{color:var(--tui-positive-night-hover)}[data-host-mode=negative][_nghost-%COMP%]{color:var(--tui-negative)}[data-host-mode=negative][_nghost-%COMP%]:hover{color:var(--tui-negative-hover)}[data-host-mode=negative]._pseudo[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{-webkit-text-decoration-color:rgba(222,76,30,.48);text-decoration-color:#de4c1e7a}[data-host-mode=positive][_nghost-%COMP%]{color:var(--tui-positive)}[data-host-mode=positive][_nghost-%COMP%]:hover{color:var(--tui-positive-hover)}[data-host-mode=positive]._pseudo[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{-webkit-text-decoration-color:rgba(58,169,129,.48);text-decoration-color:#3aa9817a}._focus-visible[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{background:var(--tui-selection)}[data-mode=onLight]._focus-visible[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{background:var(--tui-clear);color:var(--tui-text-01)}[data-mode=onDark]._focus-visible[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{background:var(--tui-clear-inverse);color:var(--tui-text-01-night)}[data-host-mode=positive]._focus-visible[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{background:var(--tui-success-bg)}[data-host-mode=negative]._focus-visible[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{background:var(--tui-error-bg)}._pseudo[_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{padding-bottom:.15em;-webkit-text-decoration:underline dashed rgba(51,111,238,.48);text-decoration:underline dashed rgba(51,111,238,.48);text-underline-offset:.2em;text-decoration-thickness:.7px}.t-icon[_ngcontent-%COMP%]{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;width:var(--tui-link-icon-size, 1.5rem);height:var(--tui-link-icon-size, 1.5rem);margin-top:-.125rem}.t-icon_left[_ngcontent-%COMP%]{margin-right:.25rem}.t-icon_right[_ngcontent-%COMP%]{margin-left:.25rem}._icon-rotated[_nghost-%COMP%] .t-icon[_ngcontent-%COMP%]{transform:rotate(180deg)}"],
- changeDetection: 0
+ providedIn: 'root'
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiLinkComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](Location, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
args: [{
- selector: 'a[tuiLink], button[tuiLink]',
- templateUrl: './link.template.html',
- styleUrls: ['./link.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.tuiAsFocusableItemAccessor)(TuiLinkComponent), _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiFocusVisibleService, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_9__.MODE_PROVIDER],
- host: {
- '($.data-mode.attr)': 'mode$'
- },
- exportAs: 'tuiLink'
+ providedIn: 'root',
+ // See #23917
+ useFactory: createLocation
}]
}], function () {
return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_MODE]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiFocusVisibleService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiFocusVisibleService]
- }]
+ type: LocationStrategy
}];
- }, {
- pseudo: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._pseudo']
- }],
- icon: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- iconAlign: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- iconRotated: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._icon-rotated']
- }],
- mode: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-host-mode']
- }],
- focusVisible: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._focus-visible']
- }]
- });
-})();
-class TuiLinkModule {}
-TuiLinkModule.ɵfac = function TuiLinkModule_Factory(t) {
- return new (t || TuiLinkModule)();
-};
-TuiLinkModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiLinkModule
-});
-TuiLinkModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_11__.CommonModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_10__.TuiSvgModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiLinkModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_11__.CommonModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_10__.TuiSvgModule],
- declarations: [TuiLinkComponent],
- exports: [TuiLinkComponent]
- }]
- }], null, null);
+ }, null);
})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 6645:
-/*!*********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-loader.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_LOADER_DEFAULT_OPTIONS: () => (/* binding */ TUI_LOADER_DEFAULT_OPTIONS),
-/* harmony export */ TUI_LOADER_OPTIONS: () => (/* binding */ TUI_LOADER_OPTIONS),
-/* harmony export */ TuiLoaderComponent: () => (/* binding */ TuiLoaderComponent),
-/* harmony export */ TuiLoaderModule: () => (/* binding */ TuiLoaderModule),
-/* harmony export */ tuiLoaderOptionsProvider: () => (/* binding */ tuiLoaderOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 8645);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_core_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core/utils/miscellaneous */ 2189);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-
-
-
-
-
-
-
-
-
-/** Default values for the loader options. */
-function TuiLoaderComponent_div_2_div_3_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const text_r3 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r3, " ");
- }
-}
-function TuiLoaderComponent_div_2_div_3_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnamespaceSVG"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnamespaceHTML"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiLoaderComponent_div_2_div_3_ng_container_1_Template, 2, 1, "ng-container", 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-text_horizontal", ctx_r1.isHorizontal);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r1.textContent);
- }
+function createLocation() {
+ return new Location((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(LocationStrategy));
}
-function TuiLoaderComponent_div_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnamespaceSVG"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "svg", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](2, "circle", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](3, TuiLoaderComponent_div_2_div_3_Template, 2, 3, "div", 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+function _stripBasePath(basePath, url) {
+ if (!basePath || !url.startsWith(basePath)) {
+ return url;
}
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-loader_horizontal", ctx_r0.isHorizontal)("t-loader_inherit-color", ctx_r0.inheritColor);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-size", ctx_r0.size);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx_r0.hasText);
+ const strippedUrl = url.substring(basePath.length);
+ if (strippedUrl === '' || ['/', ';', '?', '#'].includes(strippedUrl[0])) {
+ return strippedUrl;
}
+ return url;
}
-const _c0 = ["*"];
-const TUI_LOADER_DEFAULT_OPTIONS = {
- size: 'm',
- inheritColor: false,
- overlay: false
-};
-/**
- * Default parameters for loader component
- */
-const TUI_LOADER_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)(TUI_LOADER_DEFAULT_OPTIONS);
-function tuiLoaderOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiProvideOptions)(TUI_LOADER_OPTIONS, options, TUI_LOADER_DEFAULT_OPTIONS);
+function _stripIndexHtml(url) {
+ return url.replace(/\/index.html$/, '');
}
-class TuiLoaderComponent {
- constructor(doc, el, isIos, options) {
- this.doc = doc;
- this.el = el;
- this.isIos = isIos;
- this.options = options;
- this.size = this.options.size;
- this.inheritColor = this.options.inheritColor;
- this.overlay = this.options.overlay;
- this.loading = true;
- this.isApple = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiIsSafari)(this.el.nativeElement) || this.isIos;
- }
- set showLoader(value) {
- // @bad TODO: https://github.com/angular/angular/issues/32083 think of a better way
- if (value && this.focused) {
- (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiBlurNativeFocused)(this.doc);
- }
- this.loading = value;
- }
- get hasOverlay() {
- return this.overlay && this.loading;
- }
- get hasText() {
- return !!this.textContent;
- }
- get isHorizontal() {
- return !(0,_taiga_ui_core_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_4__.tuiSizeBigger)(this.size);
- }
- get focused() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiIsNativeFocusedIn)(this.el.nativeElement);
+function _stripOrigin(baseHref) {
+ // DO NOT REFACTOR! Previously, this check looked like this:
+ // `/^(https?:)?\/\//.test(baseHref)`, but that resulted in
+ // syntactically incorrect code after Closure Compiler minification.
+ // This was likely caused by a bug in Closure Compiler, but
+ // for now, the check is rewritten to use `new RegExp` instead.
+ const isAbsoluteUrl = new RegExp('^(https?:)?//').test(baseHref);
+ if (isAbsoluteUrl) {
+ const [, pathname] = baseHref.split(/\/\/[^\/]+/);
+ return pathname;
}
+ return baseHref;
}
-TuiLoaderComponent.ɵfac = function TuiLoaderComponent_Factory(t) {
- return new (t || TuiLoaderComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_5__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_IOS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_LOADER_OPTIONS));
-};
-TuiLoaderComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiLoaderComponent,
- selectors: [["tui-loader"]],
- hostVars: 2,
- hostBindings: function TuiLoaderComponent_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_loading", ctx.loading);
- }
- },
- inputs: {
- size: "size",
- inheritColor: "inheritColor",
- overlay: "overlay",
- textContent: "textContent",
- showLoader: "showLoader"
- },
- ngContentSelectors: _c0,
- decls: 3,
- vars: 7,
- consts: [[1, "t-content", 3, "disabled"], ["class", "t-loader", 3, "t-loader_horizontal", "t-loader_inherit-color", 4, "ngIf"], [1, "t-loader"], ["automation-id", "tui-loader__loader", "focusable", "false", "viewBox", "0 0 100 100", "xmlns", "http://www.w3.org/2000/svg", 1, "t-icon"], ["cx", "50", "cy", "50", "r", "50", "stroke-dasharray", "314", 1, "t-circle"], ["automation-id", "tui-loader__text", "class", "t-text", 3, "t-text_horizontal", 4, "ngIf"], ["automation-id", "tui-loader__text", 1, "t-text"], [4, "polymorpheusOutlet"]],
- template: function TuiLoaderComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "fieldset", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiLoaderComponent_div_2_Template, 4, 6, "div", 1);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-content_has-overlay", ctx.hasOverlay)("t-content_loading", ctx.loading);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("disabled", ctx.loading && !ctx.isApple);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("inert", ctx.loading || null);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.loading);
- }
- },
- dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.NgIf, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_7__.PolymorpheusOutletDirective],
- styles: ["@keyframes _ngcontent-%COMP%_tuiLoaderDashOffset{0%{stroke-dashoffset:-66}50%{stroke-dashoffset:-314}to{stroke-dashoffset:-66}}@keyframes _ngcontent-%COMP%_tuiLoaderRotate{0%{transform:rotate(0)}50%{transform:rotate(1turn)}to{transform:rotate(3turn)}}[_nghost-%COMP%]{position:relative;display:flex;min-width:1.5rem}._loading[_nghost-%COMP%]{overflow:hidden}.t-content[_ngcontent-%COMP%]{z-index:0;min-width:100%;height:100%;padding:0;margin:0;border:none}.t-content_has-overlay[_ngcontent-%COMP%]{opacity:.3}.t-content_loading[_ngcontent-%COMP%]{pointer-events:none}.t-loader[_ngcontent-%COMP%]{position:relative;left:-100%;display:flex;flex-direction:column;align-items:center;justify-content:center;min-width:100%;flex-shrink:0;align-self:center;color:var(--tui-text-01);stroke:var(--tui-primary);animation:tuiFadeIn var(--tui-duration)}.t-loader.t-loader_horizontal[_ngcontent-%COMP%]{flex-direction:row}.t-loader.t-loader_inherit-color[_ngcontent-%COMP%]{color:inherit;stroke:currentColor}.t-loader[data-size=xs][_ngcontent-%COMP%]{font-size:.75rem;stroke-width:38}.t-loader[data-size=s][_ngcontent-%COMP%]{font-size:1rem;stroke-width:25}.t-loader[data-size=m][_ngcontent-%COMP%]{font-size:1.5rem;stroke-width:17}.t-loader[data-size=l][_ngcontent-%COMP%]{font-size:2.5rem;stroke-width:15}.t-loader[data-size=xl][_ngcontent-%COMP%]{font-size:3.5rem;stroke-width:14}.t-loader[data-size=xxl][_ngcontent-%COMP%]{font-size:5rem;stroke-width:10}.t-text[_ngcontent-%COMP%]{font:var(--tui-font-text-s);color:var(--tui-text-01);white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-top:1rem;color:inherit;max-width:100%;text-align:center;stroke-width:0}.t-text_horizontal[_ngcontent-%COMP%]{margin:0 0 0 1rem}.t-icon[_ngcontent-%COMP%]{display:block;min-width:1em;max-width:1em;min-height:1em;max-height:1em;margin:.25rem -.5em;border-radius:100%;overflow:hidden;transform:scaleY(-1);animation:_ngcontent-%COMP%_tuiLoaderRotate 3s linear infinite}@supports (-webkit-hyphens: none){.t-icon[_ngcontent-%COMP%]{overflow:visible}}.t-circle[_ngcontent-%COMP%]{fill:none;stroke:inherit;stroke-width:inherit;animation:_ngcontent-%COMP%_tuiLoaderDashOffset 3s linear infinite}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiLoaderComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-loader',
- templateUrl: './loader.template.html',
- styleUrls: ['./loader.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush
- }]
- }], function () {
- return [{
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.DOCUMENT]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_IOS]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_LOADER_OPTIONS]
- }]
- }];
- }, {
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- inheritColor: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- overlay: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- textContent: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- showLoader: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- loading: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._loading']
- }]
- });
-})();
-class TuiLoaderModule {}
-TuiLoaderModule.ɵfac = function TuiLoaderModule_Factory(t) {
- return new (t || TuiLoaderModule)();
+
+/** @internal */
+const CURRENCIES_EN = {
+ "ADP": [undefined, undefined, 0],
+ "AFN": [undefined, "؋", 0],
+ "ALL": [undefined, undefined, 0],
+ "AMD": [undefined, "֏", 2],
+ "AOA": [undefined, "Kz"],
+ "ARS": [undefined, "$"],
+ "AUD": ["A$", "$"],
+ "AZN": [undefined, "₼"],
+ "BAM": [undefined, "KM"],
+ "BBD": [undefined, "$"],
+ "BDT": [undefined, "৳"],
+ "BHD": [undefined, undefined, 3],
+ "BIF": [undefined, undefined, 0],
+ "BMD": [undefined, "$"],
+ "BND": [undefined, "$"],
+ "BOB": [undefined, "Bs"],
+ "BRL": ["R$"],
+ "BSD": [undefined, "$"],
+ "BWP": [undefined, "P"],
+ "BYN": [undefined, undefined, 2],
+ "BYR": [undefined, undefined, 0],
+ "BZD": [undefined, "$"],
+ "CAD": ["CA$", "$", 2],
+ "CHF": [undefined, undefined, 2],
+ "CLF": [undefined, undefined, 4],
+ "CLP": [undefined, "$", 0],
+ "CNY": ["CN¥", "¥"],
+ "COP": [undefined, "$", 2],
+ "CRC": [undefined, "₡", 2],
+ "CUC": [undefined, "$"],
+ "CUP": [undefined, "$"],
+ "CZK": [undefined, "Kč", 2],
+ "DJF": [undefined, undefined, 0],
+ "DKK": [undefined, "kr", 2],
+ "DOP": [undefined, "$"],
+ "EGP": [undefined, "E£"],
+ "ESP": [undefined, "₧", 0],
+ "EUR": ["€"],
+ "FJD": [undefined, "$"],
+ "FKP": [undefined, "£"],
+ "GBP": ["£"],
+ "GEL": [undefined, "₾"],
+ "GHS": [undefined, "GH₵"],
+ "GIP": [undefined, "£"],
+ "GNF": [undefined, "FG", 0],
+ "GTQ": [undefined, "Q"],
+ "GYD": [undefined, "$", 2],
+ "HKD": ["HK$", "$"],
+ "HNL": [undefined, "L"],
+ "HRK": [undefined, "kn"],
+ "HUF": [undefined, "Ft", 2],
+ "IDR": [undefined, "Rp", 2],
+ "ILS": ["₪"],
+ "INR": ["₹"],
+ "IQD": [undefined, undefined, 0],
+ "IRR": [undefined, undefined, 0],
+ "ISK": [undefined, "kr", 0],
+ "ITL": [undefined, undefined, 0],
+ "JMD": [undefined, "$"],
+ "JOD": [undefined, undefined, 3],
+ "JPY": ["¥", undefined, 0],
+ "KHR": [undefined, "៛"],
+ "KMF": [undefined, "CF", 0],
+ "KPW": [undefined, "₩", 0],
+ "KRW": ["₩", undefined, 0],
+ "KWD": [undefined, undefined, 3],
+ "KYD": [undefined, "$"],
+ "KZT": [undefined, "₸"],
+ "LAK": [undefined, "₭", 0],
+ "LBP": [undefined, "L£", 0],
+ "LKR": [undefined, "Rs"],
+ "LRD": [undefined, "$"],
+ "LTL": [undefined, "Lt"],
+ "LUF": [undefined, undefined, 0],
+ "LVL": [undefined, "Ls"],
+ "LYD": [undefined, undefined, 3],
+ "MGA": [undefined, "Ar", 0],
+ "MGF": [undefined, undefined, 0],
+ "MMK": [undefined, "K", 0],
+ "MNT": [undefined, "₮", 2],
+ "MRO": [undefined, undefined, 0],
+ "MUR": [undefined, "Rs", 2],
+ "MXN": ["MX$", "$"],
+ "MYR": [undefined, "RM"],
+ "NAD": [undefined, "$"],
+ "NGN": [undefined, "₦"],
+ "NIO": [undefined, "C$"],
+ "NOK": [undefined, "kr", 2],
+ "NPR": [undefined, "Rs"],
+ "NZD": ["NZ$", "$"],
+ "OMR": [undefined, undefined, 3],
+ "PHP": ["₱"],
+ "PKR": [undefined, "Rs", 2],
+ "PLN": [undefined, "zł"],
+ "PYG": [undefined, "₲", 0],
+ "RON": [undefined, "lei"],
+ "RSD": [undefined, undefined, 0],
+ "RUB": [undefined, "₽"],
+ "RWF": [undefined, "RF", 0],
+ "SBD": [undefined, "$"],
+ "SEK": [undefined, "kr", 2],
+ "SGD": [undefined, "$"],
+ "SHP": [undefined, "£"],
+ "SLE": [undefined, undefined, 2],
+ "SLL": [undefined, undefined, 0],
+ "SOS": [undefined, undefined, 0],
+ "SRD": [undefined, "$"],
+ "SSP": [undefined, "£"],
+ "STD": [undefined, undefined, 0],
+ "STN": [undefined, "Db"],
+ "SYP": [undefined, "£", 0],
+ "THB": [undefined, "฿"],
+ "TMM": [undefined, undefined, 0],
+ "TND": [undefined, undefined, 3],
+ "TOP": [undefined, "T$"],
+ "TRL": [undefined, undefined, 0],
+ "TRY": [undefined, "₺"],
+ "TTD": [undefined, "$"],
+ "TWD": ["NT$", "$", 2],
+ "TZS": [undefined, undefined, 2],
+ "UAH": [undefined, "₴"],
+ "UGX": [undefined, undefined, 0],
+ "USD": ["$"],
+ "UYI": [undefined, undefined, 0],
+ "UYU": [undefined, "$"],
+ "UYW": [undefined, undefined, 4],
+ "UZS": [undefined, undefined, 2],
+ "VEF": [undefined, "Bs", 2],
+ "VND": ["₫", undefined, 0],
+ "VUV": [undefined, undefined, 0],
+ "XAF": ["FCFA", undefined, 0],
+ "XCD": ["EC$", "$"],
+ "XOF": ["F CFA", undefined, 0],
+ "XPF": ["CFPF", undefined, 0],
+ "XXX": ["¤"],
+ "YER": [undefined, undefined, 0],
+ "ZAR": [undefined, "R"],
+ "ZMK": [undefined, undefined, 0],
+ "ZMW": [undefined, "ZK"],
+ "ZWD": [undefined, undefined, 0]
};
-TuiLoaderModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiLoaderModule
-});
-TuiLoaderModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_7__.PolymorpheusModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiLoaderModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_7__.PolymorpheusModule],
- declarations: [TuiLoaderComponent],
- exports: [TuiLoaderComponent]
- }]
- }], null, null);
-})();
/**
- * Generated bundle index. Do not edit.
+ * Format styles that can be used to represent numbers.
+ * @see {@link getLocaleNumberFormat}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 1273:
-/*!***************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-notification.js ***!
- \***************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiNotificationComponent: () => (/* binding */ TuiNotificationComponent),
-/* harmony export */ TuiNotificationModule: () => (/* binding */ TuiNotificationModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core/components/svg */ 3442);
-/* harmony import */ var _taiga_ui_core_components_button__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core/components/button */ 3474);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs */ 4517);
-
-
-
-
-
-
-
-
-
-
-
-
-
-function TuiNotificationComponent_ng_container_0_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 5);
- }
- if (rf & 2) {
- const iconName_r3 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", iconName_r3);
- }
-}
-const _c0 = function (a0) {
- return {
- $implicit: a0
- };
-};
-function TuiNotificationComponent_ng_container_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiNotificationComponent_ng_container_0_tui_svg_1_Template, 1, 1, "tui-svg", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r0.icon)("polymorpheusOutletContext", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](2, _c0, ctx_r0.status));
- }
-}
-function TuiNotificationComponent_button_3_Template(rf, ctx) {
- if (rf & 1) {
- const _r5 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "button", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function TuiNotificationComponent_button_3_Template_button_click_0_listener() {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r5);
- const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r4.close.emit());
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](1, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("icon", ctx_r1.icons.close)("title", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](1, 2, ctx_r1.closeWord$));
- }
-}
-const _c1 = ["*"];
-class TuiNotificationComponent {
- constructor(closeWord$, icons, options) {
- this.closeWord$ = closeWord$;
- this.icons = icons;
- this.options = options;
- /**
- * @deprecated Use {@link TuiNotificationComponent.icon} input or TUI_NOTIFICATION_OPTIONS instead
- */
- this.hasIcon = this.options.hasIcon;
- this.icon = this.options.icon;
- this.status = this.options.status;
- this.size = this.options.size;
- this.hideClose = false;
- this.close = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
- }
- get hasClose() {
- return !this.hideClose && (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiIsObserved)(this.close);
- }
-}
-TuiNotificationComponent.ɵfac = function TuiNotificationComponent_Factory(t) {
- return new (t || TuiNotificationComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_CLOSE_WORD), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_COMMON_ICONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_NOTIFICATION_OPTIONS));
-};
-TuiNotificationComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiNotificationComponent,
- selectors: [["tui-notification"], ["a", "tuiNotification", ""], ["button", "tuiNotification", ""]],
- hostVars: 2,
- hostBindings: function TuiNotificationComponent_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-status", ctx.status)("data-size", ctx.size);
- }
- },
- inputs: {
- hasIcon: "hasIcon",
- icon: "icon",
- status: "status",
- size: "size",
- hideClose: "hideClose"
- },
- outputs: {
- close: "close"
- },
- ngContentSelectors: _c1,
- decls: 5,
- vars: 3,
- consts: [[4, "ngIf"], [1, "t-content"], ["appearance", "icon", "automation-id", "tui-notification__close", "size", "xs", "tuiIconButton", "", "type", "button", "class", "t-close", 3, "icon", "title", "click", 4, "ngIf"], ["automation-id", "tui-notification__more", 1, "t-more", 3, "src"], ["automation-id", "tui-notification__icon", "class", "t-icon", 3, "src", 4, "polymorpheusOutlet", "polymorpheusOutletContext"], ["automation-id", "tui-notification__icon", 1, "t-icon", 3, "src"], ["appearance", "icon", "automation-id", "tui-notification__close", "size", "xs", "tuiIconButton", "", "type", "button", 1, "t-close", 3, "icon", "title", "click"]],
- template: function TuiNotificationComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiNotificationComponent_ng_container_0_Template, 2, 4, "ng-container", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](3, TuiNotificationComponent_button_3_Template, 2, 4, "button", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](4, "tui-svg", 3);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.icon && ctx.hasIcon);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.hasClose);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", ctx.icons.more);
- }
- },
- dependencies: [_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__.TuiSvgComponent, _taiga_ui_core_components_button__WEBPACK_IMPORTED_MODULE_4__.TuiButtonComponent, _angular_common__WEBPACK_IMPORTED_MODULE_5__.NgIf, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_5__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{font:var(--tui-font-text-s);color:var(--tui-text-01);position:relative;display:flex;padding:.75rem 1rem;border-radius:var(--tui-radius-m);background:#fff;background:var(--tui-base-01);box-sizing:border-box;overflow:hidden;text-align:left}[_nghost-%COMP%] .t-more[_ngcontent-%COMP%]{display:none}button[_nghost-%COMP%], a[_nghost-%COMP%]{border:none;cursor:pointer}button[_nghost-%COMP%] .t-more[_ngcontent-%COMP%], a[_nghost-%COMP%] .t-more[_ngcontent-%COMP%]{display:inline-flex;color:var(--tui-text-01);opacity:.5}[data-size=s][_nghost-%COMP%]{padding:.375rem .625rem}[data-size=s][_nghost-%COMP%] .t-icon[_ngcontent-%COMP%]{width:1rem;height:1.25rem;margin:0 .375rem 0 -.125rem}[data-size=s][_nghost-%COMP%] .t-close[_ngcontent-%COMP%]{margin:-.125rem -.375rem -.125rem .75rem}[data-size=s][_nghost-%COMP%] .t-more[_ngcontent-%COMP%]{margin:-.125rem -.375rem -.125rem 0}[data-size=m][_nghost-%COMP%]{padding:.75rem}[data-size=m][_nghost-%COMP%] .t-icon[_ngcontent-%COMP%]{width:1.25rem;height:1.25rem;margin-right:.5rem}[data-size=m][_nghost-%COMP%] .t-close[_ngcontent-%COMP%]{margin:-.125rem -.125rem -.125rem 1rem}[data-size=m][_nghost-%COMP%] .t-more[_ngcontent-%COMP%]{margin:-.125rem -.375rem -.125rem 0}[data-size=l][_nghost-%COMP%]{padding:1rem;font:var(--tui-font-text-m);border-radius:var(--tui-radius-l)}[data-size=l][_nghost-%COMP%] .t-icon[_ngcontent-%COMP%]{width:1.5rem;height:1.5rem;margin-right:.5rem}[data-size=l][_nghost-%COMP%] .t-more[_ngcontent-%COMP%]{margin-right:-.5rem}[data-status=info][_nghost-%COMP%]{color:var(--tui-info-fill);background:linear-gradient(var(--tui-info-bg),var(--tui-info-bg)),var(--tui-base-01)}[data-status=success][_nghost-%COMP%]{color:var(--tui-success-fill);background:linear-gradient(var(--tui-success-bg),var(--tui-success-bg)),var(--tui-base-01)}[data-status=error][_nghost-%COMP%]{color:var(--tui-error-fill);background:linear-gradient(var(--tui-error-bg),var(--tui-error-bg)),var(--tui-base-01)}[data-status=warning][_nghost-%COMP%]{color:var(--tui-warning-fill);background:linear-gradient(var(--tui-warning-bg),var(--tui-warning-bg)),var(--tui-base-01)}[data-status=neutral][_nghost-%COMP%]{color:var(--tui-neutral-fill);background:linear-gradient(var(--tui-neutral-bg),var(--tui-neutral-bg)),var(--tui-base-01)}.t-content[_ngcontent-%COMP%]{flex:1;word-break:break-word;color:var(--tui-text-01);text-align:inherit;align-self:center}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiNotificationComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-notification,a[tuiNotification],button[tuiNotification]',
- templateUrl: './notification.template.html',
- styleUrls: ['./notification.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_7__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_CLOSE_WORD]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_COMMON_ICONS]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_NOTIFICATION_OPTIONS]
- }]
- }];
- }, {
- hasIcon: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- icon: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- status: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-status']
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-size']
- }],
- hideClose: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- close: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output
- }]
- });
-})();
-class TuiNotificationModule {}
-TuiNotificationModule.ɵfac = function TuiNotificationModule_Factory(t) {
- return new (t || TuiNotificationModule)();
-};
-TuiNotificationModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiNotificationModule
-});
-TuiNotificationModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__.TuiSvgModule, _taiga_ui_core_components_button__WEBPACK_IMPORTED_MODULE_4__.TuiButtonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiNotificationModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__.TuiSvgModule, _taiga_ui_core_components_button__WEBPACK_IMPORTED_MODULE_4__.TuiButtonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusModule],
- declarations: [TuiNotificationComponent],
- exports: [TuiNotificationComponent]
- }]
- }], null, null);
-})();
-
+var NumberFormatStyle;
+(function (NumberFormatStyle) {
+ NumberFormatStyle[NumberFormatStyle["Decimal"] = 0] = "Decimal";
+ NumberFormatStyle[NumberFormatStyle["Percent"] = 1] = "Percent";
+ NumberFormatStyle[NumberFormatStyle["Currency"] = 2] = "Currency";
+ NumberFormatStyle[NumberFormatStyle["Scientific"] = 3] = "Scientific";
+})(NumberFormatStyle || (NumberFormatStyle = {}));
/**
- * Generated bundle index. Do not edit.
+ * Plurality cases used for translating plurals to different languages.
+ *
+ * @see {@link NgPlural}
+ * @see {@link NgPluralCase}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 2499:
-/*!*********************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-primitive-checkbox.js ***!
- \*********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_CHECKBOX_DEFAULT_OPTIONS: () => (/* binding */ TUI_CHECKBOX_DEFAULT_OPTIONS),
-/* harmony export */ TUI_CHECKBOX_OPTIONS: () => (/* binding */ TUI_CHECKBOX_OPTIONS),
-/* harmony export */ TuiPrimitiveCheckboxComponent: () => (/* binding */ TuiPrimitiveCheckboxComponent),
-/* harmony export */ TuiPrimitiveCheckboxModule: () => (/* binding */ TuiPrimitiveCheckboxModule),
-/* harmony export */ tuiCheckboxOptionsProvider: () => (/* binding */ tuiCheckboxOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/core/enums */ 4715);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core/components/svg */ 3442);
-/* harmony import */ var _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core/directives/wrapper */ 8001);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-
-
-
-
-
-
-
-
-
-
-
-/** Default values for the checkbox options. */
-function TuiPrimitiveCheckboxComponent_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 2);
- }
- if (rf & 2) {
- const src_r1 = ctx.polymorpheusOutlet;
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-mark_on", !ctx_r0.empty);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", src_r1);
- }
-}
-const _c0 = function (a0) {
- return {
- $implicit: a0
- };
-};
-const _c1 = ["*"];
-const TUI_CHECKBOX_DEFAULT_OPTIONS = {
- size: 'm',
- appearances: {
- unchecked: _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_1__.TuiAppearance.Outline,
- checked: _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_1__.TuiAppearance.Primary,
- indeterminate: _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_1__.TuiAppearance.Primary
- },
- icons: {
- checked: ({
- $implicit
- }) => $implicit === 'm' ? 'tuiIconCheck' : 'tuiIconCheckLarge',
- indeterminate: ({
- $implicit
- }) => $implicit === 'm' ? 'tuiIconMinus' : 'tuiIconMinusLarge'
- }
-};
+var Plural;
+(function (Plural) {
+ Plural[Plural["Zero"] = 0] = "Zero";
+ Plural[Plural["One"] = 1] = "One";
+ Plural[Plural["Two"] = 2] = "Two";
+ Plural[Plural["Few"] = 3] = "Few";
+ Plural[Plural["Many"] = 4] = "Many";
+ Plural[Plural["Other"] = 5] = "Other";
+})(Plural || (Plural = {}));
/**
- * Default parameters for checkbox component
+ * Context-dependant translation forms for strings.
+ * Typically the standalone version is for the nominative form of the word,
+ * and the format version is used for the genitive case.
+ * @see [CLDR website](http://cldr.unicode.org/translation/date-time-1/date-time#TOC-Standalone-vs.-Format-Styles)
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
*/
-const TUI_CHECKBOX_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiCreateToken)(TUI_CHECKBOX_DEFAULT_OPTIONS);
-function tuiCheckboxOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiProvideOptions)(TUI_CHECKBOX_OPTIONS, options, TUI_CHECKBOX_DEFAULT_OPTIONS);
-}
-class TuiPrimitiveCheckboxComponent {
- constructor(options) {
- this.options = options;
- this.size = this.options.size;
- this.disabled = false;
- this.focused = false;
- this.hovered = false;
- this.pressed = false;
- this.invalid = false;
- this.icon = this.options.icons.checked;
- this.value = false;
- }
- set valueSetter(value) {
- if (value !== false) {
- this.setCurrentIcon(value);
- }
- this.value = value;
- }
- get appearance() {
- switch (this.value) {
- case false:
- return this.options.appearances.unchecked;
- case true:
- return this.options.appearances.checked;
- default:
- return this.options.appearances.indeterminate;
- }
- }
- get empty() {
- return this.value === false;
- }
- setCurrentIcon(value) {
- this.icon = value === null ? this.options.icons.indeterminate : this.options.icons.checked;
- }
-}
-TuiPrimitiveCheckboxComponent.ɵfac = function TuiPrimitiveCheckboxComponent_Factory(t) {
- return new (t || TuiPrimitiveCheckboxComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_CHECKBOX_OPTIONS));
-};
-TuiPrimitiveCheckboxComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiPrimitiveCheckboxComponent,
- selectors: [["tui-primitive-checkbox"]],
- hostVars: 1,
- hostBindings: function TuiPrimitiveCheckboxComponent_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-size", ctx.size);
- }
- },
- inputs: {
- size: "size",
- disabled: "disabled",
- focused: "focused",
- hovered: "hovered",
- pressed: "pressed",
- invalid: "invalid",
- valueSetter: ["value", "valueSetter"]
- },
- ngContentSelectors: _c1,
- decls: 3,
- vars: 10,
- consts: [["tuiWrapper", "", 3, "active", "appearance", "disabled", "focus", "hover", "invalid"], ["class", "t-mark", 3, "t-mark_on", "src", 4, "polymorpheusOutlet", "polymorpheusOutletContext"], [1, "t-mark", 3, "src"]],
- template: function TuiPrimitiveCheckboxComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiPrimitiveCheckboxComponent_tui_svg_1_Template, 1, 3, "tui-svg", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("active", ctx.pressed)("appearance", ctx.appearance)("disabled", ctx.disabled)("focus", ctx.focused)("hover", ctx.hovered)("invalid", ctx.invalid);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx.icon)("polymorpheusOutletContext", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](8, _c0, ctx.size));
- }
- },
- dependencies: [_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__.TuiSvgComponent, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_4__.TuiWrapperDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_5__.PolymorpheusOutletDirective],
- styles: ["[_nghost-%COMP%]{display:block;font-size:0;flex-shrink:0}[data-size=m][_nghost-%COMP%]{width:1rem;height:1rem;border-radius:var(--tui-radius-xs)}[data-size=l][_nghost-%COMP%]{width:1.5rem;height:1.5rem;border-radius:var(--tui-radius-s)}.t-mark[_ngcontent-%COMP%]{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:block;width:100%;height:100%;transform:scale(0)}.t-mark_on[_ngcontent-%COMP%]{transform:scale(1)}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiPrimitiveCheckboxComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-primitive-checkbox',
- templateUrl: './primitive-checkbox.template.html',
- styleUrls: ['./primitive-checkbox.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_CHECKBOX_OPTIONS]
- }]
- }];
- }, {
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-size']
- }],
- disabled: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- focused: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- hovered: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- pressed: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- invalid: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- valueSetter: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['value']
- }]
- });
-})();
-class TuiPrimitiveCheckboxModule {}
-TuiPrimitiveCheckboxModule.ɵfac = function TuiPrimitiveCheckboxModule_Factory(t) {
- return new (t || TuiPrimitiveCheckboxModule)();
-};
-TuiPrimitiveCheckboxModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiPrimitiveCheckboxModule
-});
-TuiPrimitiveCheckboxModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__.TuiSvgModule, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_4__.TuiWrapperModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_5__.PolymorpheusModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiPrimitiveCheckboxModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__.TuiSvgModule, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_4__.TuiWrapperModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_5__.PolymorpheusModule],
- declarations: [TuiPrimitiveCheckboxComponent],
- exports: [TuiPrimitiveCheckboxComponent]
- }]
- }], null, null);
-})();
-
+var FormStyle;
+(function (FormStyle) {
+ FormStyle[FormStyle["Format"] = 0] = "Format";
+ FormStyle[FormStyle["Standalone"] = 1] = "Standalone";
+})(FormStyle || (FormStyle = {}));
/**
- * Generated bundle index. Do not edit.
+ * String widths available for translations.
+ * The specific character widths are locale-specific.
+ * Examples are given for the word "Sunday" in English.
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 6345:
-/*!**********************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-primitive-textfield.js ***!
- \**********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_ICON_PADDINGS: () => (/* binding */ TUI_ICON_PADDINGS),
-/* harmony export */ TUI_PRIMITIVE_TEXTFIELD_DEFAULT_OPTIONS: () => (/* binding */ TUI_PRIMITIVE_TEXTFIELD_DEFAULT_OPTIONS),
-/* harmony export */ TUI_PRIMITIVE_TEXTFIELD_OPTIONS: () => (/* binding */ TUI_PRIMITIVE_TEXTFIELD_OPTIONS),
-/* harmony export */ TuiPrimitiveTextfieldComponent: () => (/* binding */ TuiPrimitiveTextfieldComponent),
-/* harmony export */ TuiPrimitiveTextfieldDirective: () => (/* binding */ TuiPrimitiveTextfieldDirective),
-/* harmony export */ TuiPrimitiveTextfieldModule: () => (/* binding */ TuiPrimitiveTextfieldModule),
-/* harmony export */ TuiTextfieldComponent: () => (/* binding */ TuiTextfieldComponent),
-/* harmony export */ TuiValueDecorationComponent: () => (/* binding */ TuiValueDecorationComponent),
-/* harmony export */ tuiPrimitiveTextfieldOptionsProvider: () => (/* binding */ tuiPrimitiveTextfieldOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @taiga-ui/cdk */ 9311);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @taiga-ui/cdk */ 8502);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/cdk */ 4333);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @taiga-ui/cdk */ 2515);
-/* harmony import */ var _taiga_ui_core_directives_hint__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/core/directives/hint */ 7169);
-/* harmony import */ var _taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @taiga-ui/core/directives */ 1460);
-/* harmony import */ var _taiga_ui_core_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/core/utils/miscellaneous */ 2189);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 5536);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ 7066);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 5171);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 1856);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @taiga-ui/core/components/svg */ 3442);
-/* harmony import */ var _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/core/enums */ 4715);
-/* harmony import */ var _taiga_ui_core_components_tooltip__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @taiga-ui/core/components/tooltip */ 351);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @taiga-ui/core/directives/wrapper */ 8001);
-/* harmony import */ var _taiga_ui_core_directives_mask_accessor__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @taiga-ui/core/directives/mask-accessor */ 7794);
-/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @angular/forms */ 8015);
-/* harmony import */ var _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @taiga-ui/core/abstract */ 9139);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-const _c0 = ["pre"];
-const _c1 = ["focusableElement"];
-function TuiPrimitiveTextfieldComponent_ng_container_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainer"](0);
- }
+var TranslationWidth;
+(function (TranslationWidth) {
+ /** 1 character for `en-US`. For example: 'S' */
+ TranslationWidth[TranslationWidth["Narrow"] = 0] = "Narrow";
+ /** 3 characters for `en-US`. For example: 'Sun' */
+ TranslationWidth[TranslationWidth["Abbreviated"] = 1] = "Abbreviated";
+ /** Full length for `en-US`. For example: "Sunday" */
+ TranslationWidth[TranslationWidth["Wide"] = 2] = "Wide";
+ /** 2 characters for `en-US`, For example: "Su" */
+ TranslationWidth[TranslationWidth["Short"] = 3] = "Short";
+})(TranslationWidth || (TranslationWidth = {}));
+/**
+ * String widths available for date-time formats.
+ * The specific character widths are locale-specific.
+ * Examples are given for `en-US`.
+ *
+ * @see {@link getLocaleDateFormat}
+ * @see {@link getLocaleTimeFormat}
+ * @see {@link getLocaleDateTimeFormat}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ * @publicApi
+ */
+var FormatWidth;
+(function (FormatWidth) {
+ /**
+ * For `en-US`, 'M/d/yy, h:mm a'`
+ * (Example: `6/15/15, 9:03 AM`)
+ */
+ FormatWidth[FormatWidth["Short"] = 0] = "Short";
+ /**
+ * For `en-US`, `'MMM d, y, h:mm:ss a'`
+ * (Example: `Jun 15, 2015, 9:03:01 AM`)
+ */
+ FormatWidth[FormatWidth["Medium"] = 1] = "Medium";
+ /**
+ * For `en-US`, `'MMMM d, y, h:mm:ss a z'`
+ * (Example: `June 15, 2015 at 9:03:01 AM GMT+1`)
+ */
+ FormatWidth[FormatWidth["Long"] = 2] = "Long";
+ /**
+ * For `en-US`, `'EEEE, MMMM d, y, h:mm:ss a zzzz'`
+ * (Example: `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00`)
+ */
+ FormatWidth[FormatWidth["Full"] = 3] = "Full";
+})(FormatWidth || (FormatWidth = {}));
+/**
+ * Symbols that can be used to replace placeholders in number patterns.
+ * Examples are based on `en-US` values.
+ *
+ * @see {@link getLocaleNumberSymbol}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+var NumberSymbol;
+(function (NumberSymbol) {
+ /**
+ * Decimal separator.
+ * For `en-US`, the dot character.
+ * Example: 2,345`.`67
+ */
+ NumberSymbol[NumberSymbol["Decimal"] = 0] = "Decimal";
+ /**
+ * Grouping separator, typically for thousands.
+ * For `en-US`, the comma character.
+ * Example: 2`,`345.67
+ */
+ NumberSymbol[NumberSymbol["Group"] = 1] = "Group";
+ /**
+ * List-item separator.
+ * Example: "one, two, and three"
+ */
+ NumberSymbol[NumberSymbol["List"] = 2] = "List";
+ /**
+ * Sign for percentage (out of 100).
+ * Example: 23.4%
+ */
+ NumberSymbol[NumberSymbol["PercentSign"] = 3] = "PercentSign";
+ /**
+ * Sign for positive numbers.
+ * Example: +23
+ */
+ NumberSymbol[NumberSymbol["PlusSign"] = 4] = "PlusSign";
+ /**
+ * Sign for negative numbers.
+ * Example: -23
+ */
+ NumberSymbol[NumberSymbol["MinusSign"] = 5] = "MinusSign";
+ /**
+ * Computer notation for exponential value (n times a power of 10).
+ * Example: 1.2E3
+ */
+ NumberSymbol[NumberSymbol["Exponential"] = 6] = "Exponential";
+ /**
+ * Human-readable format of exponential.
+ * Example: 1.2x103
+ */
+ NumberSymbol[NumberSymbol["SuperscriptingExponent"] = 7] = "SuperscriptingExponent";
+ /**
+ * Sign for permille (out of 1000).
+ * Example: 23.4‰
+ */
+ NumberSymbol[NumberSymbol["PerMille"] = 8] = "PerMille";
+ /**
+ * Infinity, can be used with plus and minus.
+ * Example: ∞, +∞, -∞
+ */
+ NumberSymbol[NumberSymbol["Infinity"] = 9] = "Infinity";
+ /**
+ * Not a number.
+ * Example: NaN
+ */
+ NumberSymbol[NumberSymbol["NaN"] = 10] = "NaN";
+ /**
+ * Symbol used between time units.
+ * Example: 10:52
+ */
+ NumberSymbol[NumberSymbol["TimeSeparator"] = 11] = "TimeSeparator";
+ /**
+ * Decimal separator for currency values (fallback to `Decimal`).
+ * Example: $2,345.67
+ */
+ NumberSymbol[NumberSymbol["CurrencyDecimal"] = 12] = "CurrencyDecimal";
+ /**
+ * Group separator for currency values (fallback to `Group`).
+ * Example: $2,345.67
+ */
+ NumberSymbol[NumberSymbol["CurrencyGroup"] = 13] = "CurrencyGroup";
+})(NumberSymbol || (NumberSymbol = {}));
+/**
+ * The value for each day of the week, based on the `en-US` locale
+ *
+ * @publicApi
+ */
+var WeekDay;
+(function (WeekDay) {
+ WeekDay[WeekDay["Sunday"] = 0] = "Sunday";
+ WeekDay[WeekDay["Monday"] = 1] = "Monday";
+ WeekDay[WeekDay["Tuesday"] = 2] = "Tuesday";
+ WeekDay[WeekDay["Wednesday"] = 3] = "Wednesday";
+ WeekDay[WeekDay["Thursday"] = 4] = "Thursday";
+ WeekDay[WeekDay["Friday"] = 5] = "Friday";
+ WeekDay[WeekDay["Saturday"] = 6] = "Saturday";
+})(WeekDay || (WeekDay = {}));
+/**
+ * Retrieves the locale ID from the currently loaded locale.
+ * The loaded locale could be, for example, a global one rather than a regional one.
+ * @param locale A locale code, such as `fr-FR`.
+ * @returns The locale code. For example, `fr`.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleId(locale) {
+ return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale)[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].LocaleId];
}
-function TuiPrimitiveTextfieldComponent_ng_container_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainer"](0);
- }
+/**
+ * Retrieves day period strings for the given locale.
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @param formStyle The required grammatical form.
+ * @param width The required character width.
+ * @returns An array of localized period strings. For example, `[AM, PM]` for `en-US`.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleDayPeriods(locale, formStyle, width) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ const amPmData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DayPeriodsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DayPeriodsStandalone]];
+ const amPm = getLastDefinedValue(amPmData, formStyle);
+ return getLastDefinedValue(amPm, width);
}
-function TuiPrimitiveTextfieldComponent_div_10_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 17);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](1, 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
+/**
+ * Retrieves days of the week for the given locale, using the Gregorian calendar.
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @param formStyle The required grammatical form.
+ * @param width The required character width.
+ * @returns An array of localized name strings.
+ * For example,`[Sunday, Monday, ... Saturday]` for `en-US`.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleDayNames(locale, formStyle, width) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ const daysData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DaysFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DaysStandalone]];
+ const days = getLastDefinedValue(daysData, formStyle);
+ return getLastDefinedValue(days, width);
}
-function TuiPrimitiveTextfieldComponent_div_12_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 20);
- }
- if (rf & 2) {
- const src_r12 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", src_r12);
- }
+/**
+ * Retrieves months of the year for the given locale, using the Gregorian calendar.
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @param formStyle The required grammatical form.
+ * @param width The required character width.
+ * @returns An array of localized name strings.
+ * For example, `[January, February, ...]` for `en-US`.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleMonthNames(locale, formStyle, width) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ const monthsData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].MonthsFormat], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].MonthsStandalone]];
+ const months = getLastDefinedValue(monthsData, formStyle);
+ return getLastDefinedValue(months, width);
}
-const _c2 = function (a0) {
- return {
- $implicit: a0
- };
-};
-function TuiPrimitiveTextfieldComponent_div_12_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 18);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiPrimitiveTextfieldComponent_div_12_tui_svg_1_Template, 1, 1, "tui-svg", 19);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r4.iconLeftContent)("polymorpheusOutletContext", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](2, _c2, ctx_r4.size));
- }
+/**
+ * Retrieves Gregorian-calendar eras for the given locale.
+ * @param locale A locale code for the locale format rules to use.
+ * @param width The required character width.
+
+ * @returns An array of localized era strings.
+ * For example, `[AD, BC]` for `en-US`.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleEraNames(locale, width) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ const erasData = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Eras];
+ return getLastDefinedValue(erasData, width);
}
-function TuiPrimitiveTextfieldComponent_label_14_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "label", 21);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](1, 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r5 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-placeholder_raised", ctx_r5.placeholderRaised);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("for", ctx_r5.computedId);
- }
+/**
+ * Retrieves the first day of the week for the given locale.
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @returns A day index number, using the 0-based week-day index for `en-US`
+ * (Sunday = 0, Monday = 1, ...).
+ * For example, for `fr-FR`, returns 1 to indicate that the first day is Monday.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleFirstDayOfWeek(locale) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].FirstDayOfWeek];
}
-function TuiPrimitiveTextfieldComponent_div_20_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 24);
- }
- if (rf & 2) {
- const src_r14 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", src_r14);
- }
+/**
+ * Range of week days that are considered the week-end for the given locale.
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @returns The range of day values, `[startDay, endDay]`.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleWeekEndRange(locale) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].WeekendRange];
}
-function TuiPrimitiveTextfieldComponent_div_20_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 22);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiPrimitiveTextfieldComponent_div_20_tui_svg_1_Template, 1, 1, "tui-svg", 23);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r7 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r7.controller.customContent);
- }
+/**
+ * Retrieves a localized date-value formatting string.
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @param width The format type.
+ * @returns The localized formatting string.
+ * @see {@link FormatWidth}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleDateFormat(locale, width) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DateFormat], width);
}
-function TuiPrimitiveTextfieldComponent_span_21_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 27);
- }
- if (rf & 2) {
- const src_r16 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", src_r16);
- }
+/**
+ * Retrieves a localized time-value formatting string.
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @param width The format type.
+ * @returns The localized formatting string.
+ * @see {@link FormatWidth}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+
+ * @publicApi
+ */
+function getLocaleTimeFormat(locale, width) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ return getLastDefinedValue(data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].TimeFormat], width);
}
-function TuiPrimitiveTextfieldComponent_span_21_Template(rf, ctx) {
- if (rf & 1) {
- const _r18 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "span", 25);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click.stop", function TuiPrimitiveTextfieldComponent_span_21_Template_span_click_stop_0_listener() {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r18);
- const ctx_r17 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r17.clear());
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiPrimitiveTextfieldComponent_span_21_tui_svg_1_Template, 1, 1, "tui-svg", 26);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r8 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r8.iconCleaner || ctx_r8.controller.options.iconCleaner)("polymorpheusOutletContext", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](2, _c2, ctx_r8.size));
- }
+/**
+ * Retrieves a localized date-time formatting string.
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @param width The format type.
+ * @returns The localized formatting string.
+ * @see {@link FormatWidth}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleDateTimeFormat(locale, width) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ const dateTimeFormatData = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].DateTimeFormat];
+ return getLastDefinedValue(dateTimeFormatData, width);
}
-function TuiPrimitiveTextfieldComponent_tui_tooltip_22_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-tooltip", 28);
- }
- if (rf & 2) {
- const ctx_r9 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("content", ctx_r9.hintOptions == null ? null : ctx_r9.hintOptions.content)("describeId", ctx_r9.computedId);
+/**
+ * Retrieves a localized number symbol that can be used to replace placeholders in number formats.
+ * @param locale The locale code.
+ * @param symbol The symbol to localize.
+ * @returns The character for the localized symbol.
+ * @see {@link NumberSymbol}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleNumberSymbol(locale, symbol) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ const res = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][symbol];
+ if (typeof res === 'undefined') {
+ if (symbol === NumberSymbol.CurrencyDecimal) {
+ return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][NumberSymbol.Decimal];
+ } else if (symbol === NumberSymbol.CurrencyGroup) {
+ return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberSymbols][NumberSymbol.Group];
+ }
}
+ return res;
}
-function TuiPrimitiveTextfieldComponent_div_23_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 20);
- }
- if (rf & 2) {
- const src_r20 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", src_r20);
- }
+/**
+ * Retrieves a number format for a given locale.
+ *
+ * Numbers are formatted using patterns, like `#,###.00`. For example, the pattern `#,###.00`
+ * when used to format the number 12345.678 could result in "12'345,678". That would happen if the
+ * grouping separator for your language is an apostrophe, and the decimal separator is a comma.
+ *
+ * Important: The characters `.` `,` `0` `#` (and others below) are special placeholders
+ * that stand for the decimal separator, and so on, and are NOT real characters.
+ * You must NOT "translate" the placeholders. For example, don't change `.` to `,` even though in
+ * your language the decimal point is written with a comma. The symbols should be replaced by the
+ * local equivalents, using the appropriate `NumberSymbol` for your language.
+ *
+ * Here are the special characters used in number patterns:
+ *
+ * | Symbol | Meaning |
+ * |--------|---------|
+ * | . | Replaced automatically by the character used for the decimal point. |
+ * | , | Replaced by the "grouping" (thousands) separator. |
+ * | 0 | Replaced by a digit (or zero if there aren't enough digits). |
+ * | # | Replaced by a digit (or nothing if there aren't enough). |
+ * | ¤ | Replaced by a currency symbol, such as $ or USD. |
+ * | % | Marks a percent format. The % symbol may change position, but must be retained. |
+ * | E | Marks a scientific format. The E symbol may change position, but must be retained. |
+ * | ' | Special characters used as literal characters are quoted with ASCII single quotes. |
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @param type The type of numeric value to be formatted (such as `Decimal` or `Currency`.)
+ * @returns The localized format string.
+ * @see {@link NumberFormatStyle}
+ * @see [CLDR website](http://cldr.unicode.org/translation/number-patterns)
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleNumberFormat(locale, type) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].NumberFormats][type];
}
-function TuiPrimitiveTextfieldComponent_div_23_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 29);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiPrimitiveTextfieldComponent_div_23_tui_svg_1_Template, 1, 1, "tui-svg", 19);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r10 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r10.iconContent)("polymorpheusOutletContext", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](2, _c2, ctx_r10.size));
- }
+/**
+ * Retrieves the symbol used to represent the currency for the main country
+ * corresponding to a given locale. For example, '$' for `en-US`.
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @returns The localized symbol character,
+ * or `null` if the main country cannot be determined.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleCurrencySymbol(locale) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].CurrencySymbol] || null;
}
-const _c3 = [[["input"]], [["select"]], [["tuiContent"]], "*"];
-const _c4 = ["input", "select", "tuiContent", "*"];
-const _c5 = ["tuiTextfield", ""];
-class TuiValueDecorationComponent {
- constructor(textfield, fontsReady$) {
- this.textfield = textfield;
- this.fontsReady$ = fontsReady$;
- this.prefix$ = new rxjs__WEBPACK_IMPORTED_MODULE_1__.BehaviorSubject('');
- this.pre$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.merge)(this.fontsReady$, this.prefix$).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.delay)(0), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.filter)(() => {
- var _a;
- return !!((_a = this.pre) === null || _a === void 0 ? void 0 : _a.nativeElement.isConnected);
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(() => {
- var _a;
- return ((_a = this.pre) === null || _a === void 0 ? void 0 : _a.nativeElement.offsetWidth) || 0;
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_6__.distinctUntilChanged)());
- }
- get isContextTable() {
- return this.textfield.appearance === _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_7__.TuiAppearance.Table;
- }
- get value() {
- return this.textfield.value;
- }
- get filler() {
- const {
- focused,
- placeholder,
- exampleText,
- value,
- textfield
- } = this;
- if (placeholder && exampleText) {
- return '';
- }
- return focused ? exampleText || textfield.filler.slice(value.length) : '';
- }
- get prefix() {
- return this.decorationsVisible ? this.textfield.prefix : '';
- }
- get postfix() {
- return this.decorationsVisible ? this.computedPostfix : '';
- }
- ngDoCheck() {
- this.prefix$.next(this.prefix);
- }
- get placeholder() {
- var _a;
- return ((_a = this.textfield.nativeFocusableElement) === null || _a === void 0 ? void 0 : _a.placeholder) || '';
- }
- get exampleText() {
- return !this.value && this.focused ? this.placeholder : '';
- }
- get decorationsVisible() {
- return !!this.value || this.focused && !this.placeholder;
- }
- get focused() {
- return this.textfield.computedFocused && !this.textfield.readOnly;
- }
- get computedPostfix() {
- return this.textfield.postfix && (this.filler || this.value) ? ` ${this.textfield.postfix}` : this.textfield.postfix;
+/**
+ * Retrieves the name of the currency for the main country corresponding
+ * to a given locale. For example, 'US Dollar' for `en-US`.
+ * @param locale A locale code for the locale format rules to use.
+ * @returns The currency name,
+ * or `null` if the main country cannot be determined.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleCurrencyName(locale) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].CurrencyName] || null;
+}
+/**
+ * Retrieves the default currency code for the given locale.
+ *
+ * The default is defined as the first currency which is still in use.
+ *
+ * @param locale The code of the locale whose currency code we want.
+ * @returns The code of the default currency for the given locale.
+ *
+ * @publicApi
+ */
+function getLocaleCurrencyCode(locale) {
+ return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵgetLocaleCurrencyCode"])(locale);
+}
+/**
+ * Retrieves the currency values for a given locale.
+ * @param locale A locale code for the locale format rules to use.
+ * @returns The currency values.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ */
+function getLocaleCurrencies(locale) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Currencies];
+}
+/**
+ * @alias core/ɵgetLocalePluralCase
+ * @publicApi
+ */
+const getLocalePluralCase = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵgetLocalePluralCase"];
+function checkFullData(data) {
+ if (!data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData]) {
+ throw new Error(`Missing extra locale data for the locale "${data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].LocaleId]}". Use "registerLocaleData" to load new data. See the "I18n guide" on angular.io to know more.`);
}
}
-TuiValueDecorationComponent.ɵfac = function TuiValueDecorationComponent_Factory(t) {
- return new (t || TuiValueDecorationComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TUI_FOCUSABLE_ITEM_ACCESSOR), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TUI_FONTS_READY));
-};
-TuiValueDecorationComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiValueDecorationComponent,
- selectors: [["tui-value-decoration"]],
- viewQuery: function TuiValueDecorationComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_c0, 7, _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.pre = _t.first);
- }
- },
- hostVars: 4,
- hostBindings: function TuiValueDecorationComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("animationstart", function TuiValueDecorationComponent_animationstart_HostBindingHandler() {
- return ctx.ngDoCheck();
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_table", ctx.isContextTable)("_filler", ctx.filler);
- }
- },
- decls: 5,
- vars: 4,
- consts: [[1, "t-prefix", 3, "textContent"], ["pre", ""], [1, "t-ghost", 3, "textContent"], [1, "t-filler", 3, "textContent"], [1, "t-postfix", 3, "textContent"]],
- template: function TuiValueDecorationComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "span", 0, 1)(2, "span", 2)(3, "span", 3)(4, "span", 4);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("textContent", ctx.prefix);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("textContent", ctx.value);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("textContent", ctx.filler);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("textContent", ctx.postfix);
+/**
+ * Retrieves locale-specific rules used to determine which day period to use
+ * when more than one period is defined for a locale.
+ *
+ * There is a rule for each defined day period. The
+ * first rule is applied to the first day period and so on.
+ * Fall back to AM/PM when no rules are available.
+ *
+ * A rule can specify a period as time range, or as a single time value.
+ *
+ * This functionality is only available when you have loaded the full locale data.
+ * See the ["I18n guide"](guide/i18n-common-format-data-locale).
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @returns The rules for the locale, a single time value or array of *from-time, to-time*,
+ * or null if no periods are available.
+ *
+ * @see {@link getLocaleExtraDayPeriods}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleExtraDayPeriodRules(locale) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ checkFullData(data);
+ const rules = data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][2 /* ɵExtraLocaleDataIndex.ExtraDayPeriodsRules */] || [];
+ return rules.map(rule => {
+ if (typeof rule === 'string') {
+ return extractTime(rule);
}
- },
- styles: ["[_nghost-%COMP%]{position:absolute;display:block;width:100%;line-height:var(--tui-height);margin-top:calc(var(--tui-height) / -2);box-sizing:content-box;color:var(--tui-text-03);animation:tuiPresent 1s;white-space:nowrap}._table[_nghost-%COMP%]{position:static;margin-top:0}._filler[_nghost-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}tui-primitive-textfield [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%]{color:var(--tui-text-03-night)}tui-primitive-textfield[data-size=\"m\"]:not(._label-outside) [_nghost-%COMP%]{line-height:calc(var(--tui-height) - .25rem)}.t-ghost[_ngcontent-%COMP%]{visibility:hidden;white-space:pre;text-overflow:clip}.t-prefix[_ngcontent-%COMP%], .t-postfix[_ngcontent-%COMP%]{white-space:pre;color:var(--tui-text-01)}tui-primitive-textfield [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%] .t-prefix[_ngcontent-%COMP%], tui-primitive-textfield [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%] .t-prefix[_ngcontent-%COMP%], tui-primitive-textfield [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%] .t-postfix[_ngcontent-%COMP%], tui-primitive-textfield [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%] .t-postfix[_ngcontent-%COMP%]{color:var(--tui-text-01-night)}.t-filler[_ngcontent-%COMP%]{max-width:100%;white-space:nowrap}"]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiValueDecorationComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-value-decoration',
- templateUrl: './value-decoration.template.html',
- styleUrls: ['./value-decoration.style.less'],
- // It follows Change Detection of PrimitiveTextfield
- // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.Default
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TUI_FOCUSABLE_ITEM_ACCESSOR]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TUI_FONTS_READY]
- }]
- }];
- }, {
- pre: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChild,
- args: ['pre', {
- read: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- static: true
- }]
- }],
- isContextTable: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._table']
- }],
- filler: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._filler']
- }],
- ngDoCheck: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['animationstart']
- }]
+ return [extractTime(rule[0]), extractTime(rule[1])];
});
-})();
-const TUI_ICON_PADDINGS = {
- s: 1.25,
- m: 1.75,
- l: 2.25
-};
-class TuiPrimitiveTextfieldComponent extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__.AbstractTuiInteractive {
- constructor(controller, hintOptions, options, el) {
- super();
- this.controller = controller;
- this.hintOptions = hintOptions;
- this.options = options;
- this.el = el;
- this.editable = true;
- /** @deprecated use `tuiTextfieldFiller` from {@link TuiTextfieldControllerModule} instead */
- this.textfieldFiller = '';
- /**
- * @deprecated:
- * use `tuiTextfieldOptionsProvider({iconCleaner: `tuiIconChevronUp`})`
- */
- this.iconCleaner = this.options.iconCleaner;
- this.readOnly = false;
- this.invalid = false;
- this.disabled = false;
- /** @deprecated use `tuiTextfieldPrefix` from {@link TuiTextfieldControllerModule} instead */
- this.textfieldPrefix = '';
- /** @deprecated use `tuiTextfieldPostfix` from {@link TuiTextfieldControllerModule} instead */
- this.textfieldPostfix = '';
- this.value = '';
- this.valueChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
- this.autofilled = false;
- }
- get prefix() {
- return this.textfieldPrefix || this.controller.prefix;
- }
- get postfix() {
- return this.textfieldPostfix || this.controller.postfix;
- }
- get filler() {
- return this.textfieldFiller || this.controller.filler;
- }
- get nativeFocusableElement() {
- if (this.computedDisabled || !this.focusableElement) {
- return null;
+}
+/**
+ * Retrieves locale-specific day periods, which indicate roughly how a day is broken up
+ * in different languages.
+ * For example, for `en-US`, periods are morning, noon, afternoon, evening, and midnight.
+ *
+ * This functionality is only available when you have loaded the full locale data.
+ * See the ["I18n guide"](guide/i18n-common-format-data-locale).
+ *
+ * @param locale A locale code for the locale format rules to use.
+ * @param formStyle The required grammatical form.
+ * @param width The required character width.
+ * @returns The translated day-period strings.
+ * @see {@link getLocaleExtraDayPeriodRules}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLocaleExtraDayPeriods(locale, formStyle, width) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ checkFullData(data);
+ const dayPeriodsData = [data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][0 /* ɵExtraLocaleDataIndex.ExtraDayPeriodFormats */], data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].ExtraData][1 /* ɵExtraLocaleDataIndex.ExtraDayPeriodStandalone */]];
+ const dayPeriods = getLastDefinedValue(dayPeriodsData, formStyle) || [];
+ return getLastDefinedValue(dayPeriods, width) || [];
+}
+/**
+ * Retrieves the writing direction of a specified locale
+ * @param locale A locale code for the locale format rules to use.
+ * @publicApi
+ * @returns 'rtl' or 'ltr'
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ */
+function getLocaleDirection(locale) {
+ const data = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵfindLocaleData"])(locale);
+ return data[_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵLocaleDataIndex"].Directionality];
+}
+/**
+ * Retrieves the first value that is defined in an array, going backwards from an index position.
+ *
+ * To avoid repeating the same data (as when the "format" and "standalone" forms are the same)
+ * add the first value to the locale data arrays, and add other values only if they are different.
+ *
+ * @param data The data array to retrieve from.
+ * @param index A 0-based index into the array to start from.
+ * @returns The value immediately before the given index position.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getLastDefinedValue(data, index) {
+ for (let i = index; i > -1; i--) {
+ if (typeof data[i] !== 'undefined') {
+ return data[i];
}
- const {
- nativeElement
- } = this.focusableElement;
- return nativeElement.previousElementSibling || nativeElement;
}
- get focused() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiIsNativeFocusedIn)(this.el.nativeElement);
- }
- get appearance() {
- return this.controller.appearance;
- }
- get size() {
- return this.controller.size;
- }
- get computedInvalid() {
- return !this.readOnly && !this.disabled && this.invalid;
- }
- get inputHidden() {
- var _a;
- return !!((_a = this.content) === null || _a === void 0 ? void 0 : _a.length);
- }
- get hasValue() {
- return !!this.value;
+ throw new Error('Locale data API: locale data undefined');
+}
+/**
+ * Extracts the hours and minutes from a string like "15:45"
+ */
+function extractTime(time) {
+ const [h, m] = time.split(':');
+ return {
+ hours: +h,
+ minutes: +m
+ };
+}
+/**
+ * Retrieves the currency symbol for a given currency code.
+ *
+ * For example, for the default `en-US` locale, the code `USD` can
+ * be represented by the narrow symbol `$` or the wide symbol `US$`.
+ *
+ * @param code The currency code.
+ * @param format The format, `wide` or `narrow`.
+ * @param locale A locale code for the locale format rules to use.
+ *
+ * @returns The symbol, or the currency code if no symbol is available.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getCurrencySymbol(code, format, locale = 'en') {
+ const currency = getLocaleCurrencies(locale)[code] || CURRENCIES_EN[code] || [];
+ const symbolNarrow = currency[1 /* ɵCurrencyIndex.SymbolNarrow */];
+ if (format === 'narrow' && typeof symbolNarrow === 'string') {
+ return symbolNarrow;
}
- get hasCleaner() {
- return this.controller.cleaner && this.hasValue && !this.computedDisabled && !this.readOnly;
+ return currency[0 /* ɵCurrencyIndex.Symbol */] || code;
+}
+// Most currencies have cents, that's why the default is 2
+const DEFAULT_NB_OF_CURRENCY_DIGITS = 2;
+/**
+ * Reports the number of decimal digits for a given currency.
+ * The value depends upon the presence of cents in that particular currency.
+ *
+ * @param code The currency code.
+ * @returns The number of decimal digits, typically 0 or 2.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function getNumberOfCurrencyDigits(code) {
+ let digits;
+ const currency = CURRENCIES_EN[code];
+ if (currency) {
+ digits = currency[2 /* ɵCurrencyIndex.NbOfDigits */];
}
- get hasTooltip() {
- var _a;
- return !!((_a = this.hintOptions) === null || _a === void 0 ? void 0 : _a.content) && !this.computedDisabled;
+ return typeof digits === 'number' ? digits : DEFAULT_NB_OF_CURRENCY_DIGITS;
+}
+const ISO8601_DATE_REGEX = /^(\d{4,})-?(\d\d)-?(\d\d)(?:T(\d\d)(?::?(\d\d)(?::?(\d\d)(?:\.(\d+))?)?)?(Z|([+-])(\d\d):?(\d\d))?)?$/;
+// 1 2 3 4 5 6 7 8 9 10 11
+const NAMED_FORMATS = {};
+const DATE_FORMATS_SPLIT = /((?:[^BEGHLMOSWYZabcdhmswyz']+)|(?:'(?:[^']|'')*')|(?:G{1,5}|y{1,4}|Y{1,4}|M{1,5}|L{1,5}|w{1,2}|W{1}|d{1,2}|E{1,6}|c{1,6}|a{1,5}|b{1,5}|B{1,5}|h{1,2}|H{1,2}|m{1,2}|s{1,2}|S{1,3}|z{1,4}|Z{1,5}|O{1,4}))([\s\S]*)/;
+var ZoneWidth;
+(function (ZoneWidth) {
+ ZoneWidth[ZoneWidth["Short"] = 0] = "Short";
+ ZoneWidth[ZoneWidth["ShortGMT"] = 1] = "ShortGMT";
+ ZoneWidth[ZoneWidth["Long"] = 2] = "Long";
+ ZoneWidth[ZoneWidth["Extended"] = 3] = "Extended";
+})(ZoneWidth || (ZoneWidth = {}));
+var DateType;
+(function (DateType) {
+ DateType[DateType["FullYear"] = 0] = "FullYear";
+ DateType[DateType["Month"] = 1] = "Month";
+ DateType[DateType["Date"] = 2] = "Date";
+ DateType[DateType["Hours"] = 3] = "Hours";
+ DateType[DateType["Minutes"] = 4] = "Minutes";
+ DateType[DateType["Seconds"] = 5] = "Seconds";
+ DateType[DateType["FractionalSeconds"] = 6] = "FractionalSeconds";
+ DateType[DateType["Day"] = 7] = "Day";
+})(DateType || (DateType = {}));
+var TranslationType;
+(function (TranslationType) {
+ TranslationType[TranslationType["DayPeriods"] = 0] = "DayPeriods";
+ TranslationType[TranslationType["Days"] = 1] = "Days";
+ TranslationType[TranslationType["Months"] = 2] = "Months";
+ TranslationType[TranslationType["Eras"] = 3] = "Eras";
+})(TranslationType || (TranslationType = {}));
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Formats a date according to locale rules.
+ *
+ * @param value The date to format, as a Date, or a number (milliseconds since UTC epoch)
+ * or an [ISO date-time string](https://www.w3.org/TR/NOTE-datetime).
+ * @param format The date-time components to include. See `DatePipe` for details.
+ * @param locale A locale code for the locale format rules to use.
+ * @param timezone The time zone. A time zone offset from GMT (such as `'+0430'`),
+ * or a standard UTC/GMT or continental US time zone abbreviation.
+ * If not specified, uses host system settings.
+ *
+ * @returns The formatted date string.
+ *
+ * @see {@link DatePipe}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function formatDate(value, format, locale, timezone) {
+ let date = toDate(value);
+ const namedFormat = getNamedFormat(locale, format);
+ format = namedFormat || format;
+ let parts = [];
+ let match;
+ while (format) {
+ match = DATE_FORMATS_SPLIT.exec(format);
+ if (match) {
+ parts = parts.concat(match.slice(1));
+ const part = parts.pop();
+ if (!part) {
+ break;
+ }
+ format = part;
+ } else {
+ parts.push(format);
+ break;
+ }
}
- get hasCustomContent() {
- return !!this.controller.customContent;
+ let dateTimezoneOffset = date.getTimezoneOffset();
+ if (timezone) {
+ dateTimezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
+ date = convertTimezoneToLocal(date, timezone, true);
}
- get placeholderVisible() {
- var _a;
- const hasDecor = ((_a = this.nativeFocusableElement) === null || _a === void 0 ? void 0 : _a.placeholder) || this.prefix || this.postfix || this.filler;
- const showDecor = hasDecor && !this.readOnly && this.computedFocused;
- return !this.hasValue && !showDecor;
+ let text = '';
+ parts.forEach(value => {
+ const dateFormatter = getDateFormatter(value);
+ text += dateFormatter ? dateFormatter(date, locale, dateTimezoneOffset) : value === '\'\'' ? '\'' : value.replace(/(^'|'$)/g, '').replace(/''/g, '\'');
+ });
+ return text;
+}
+/**
+ * Create a new Date object with the given date value, and the time set to midnight.
+ *
+ * We cannot use `new Date(year, month, date)` because it maps years between 0 and 99 to 1900-1999.
+ * See: https://github.com/angular/angular/issues/40377
+ *
+ * Note that this function returns a Date object whose time is midnight in the current locale's
+ * timezone. In the future we might want to change this to be midnight in UTC, but this would be a
+ * considerable breaking change.
+ */
+function createDate(year, month, date) {
+ // The `newDate` is set to midnight (UTC) on January 1st 1970.
+ // - In PST this will be December 31st 1969 at 4pm.
+ // - In GMT this will be January 1st 1970 at 1am.
+ // Note that they even have different years, dates and months!
+ const newDate = new Date(0);
+ // `setFullYear()` allows years like 0001 to be set correctly. This function does not
+ // change the internal time of the date.
+ // Consider calling `setFullYear(2019, 8, 20)` (September 20, 2019).
+ // - In PST this will now be September 20, 2019 at 4pm
+ // - In GMT this will now be September 20, 2019 at 1am
+ newDate.setFullYear(year, month, date);
+ // We want the final date to be at local midnight, so we reset the time.
+ // - In PST this will now be September 20, 2019 at 12am
+ // - In GMT this will now be September 20, 2019 at 12am
+ newDate.setHours(0, 0, 0);
+ return newDate;
+}
+function getNamedFormat(locale, format) {
+ const localeId = getLocaleId(locale);
+ NAMED_FORMATS[localeId] = NAMED_FORMATS[localeId] || {};
+ if (NAMED_FORMATS[localeId][format]) {
+ return NAMED_FORMATS[localeId][format];
}
- get hasPlaceholder() {
- return this.placeholderRaisable || this.placeholderVisible;
+ let formatValue = '';
+ switch (format) {
+ case 'shortDate':
+ formatValue = getLocaleDateFormat(locale, FormatWidth.Short);
+ break;
+ case 'mediumDate':
+ formatValue = getLocaleDateFormat(locale, FormatWidth.Medium);
+ break;
+ case 'longDate':
+ formatValue = getLocaleDateFormat(locale, FormatWidth.Long);
+ break;
+ case 'fullDate':
+ formatValue = getLocaleDateFormat(locale, FormatWidth.Full);
+ break;
+ case 'shortTime':
+ formatValue = getLocaleTimeFormat(locale, FormatWidth.Short);
+ break;
+ case 'mediumTime':
+ formatValue = getLocaleTimeFormat(locale, FormatWidth.Medium);
+ break;
+ case 'longTime':
+ formatValue = getLocaleTimeFormat(locale, FormatWidth.Long);
+ break;
+ case 'fullTime':
+ formatValue = getLocaleTimeFormat(locale, FormatWidth.Full);
+ break;
+ case 'short':
+ const shortTime = getNamedFormat(locale, 'shortTime');
+ const shortDate = getNamedFormat(locale, 'shortDate');
+ formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Short), [shortTime, shortDate]);
+ break;
+ case 'medium':
+ const mediumTime = getNamedFormat(locale, 'mediumTime');
+ const mediumDate = getNamedFormat(locale, 'mediumDate');
+ formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Medium), [mediumTime, mediumDate]);
+ break;
+ case 'long':
+ const longTime = getNamedFormat(locale, 'longTime');
+ const longDate = getNamedFormat(locale, 'longDate');
+ formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Long), [longTime, longDate]);
+ break;
+ case 'full':
+ const fullTime = getNamedFormat(locale, 'fullTime');
+ const fullDate = getNamedFormat(locale, 'fullDate');
+ formatValue = formatDateTime(getLocaleDateTimeFormat(locale, FormatWidth.Full), [fullTime, fullDate]);
+ break;
}
- get placeholderRaised() {
- return this.placeholderRaisable && (this.computedFocused && !this.readOnly || this.hasValue || this.autofilled);
+ if (formatValue) {
+ NAMED_FORMATS[localeId][format] = formatValue;
}
- get borderStart() {
- return this.iconLeftContent ? this.iconPaddingLeft : 0;
+ return formatValue;
+}
+function formatDateTime(str, opt_values) {
+ if (opt_values) {
+ str = str.replace(/\{([^}]+)}/g, function (match, key) {
+ return opt_values != null && key in opt_values ? opt_values[key] : match;
+ });
}
- get borderEnd() {
- return (0,_taiga_ui_core_utils_miscellaneous__WEBPACK_IMPORTED_MODULE_11__.tuiGetBorder)(!!this.iconContent, this.hasCleaner, this.hasTooltip, this.hasCustomContent, this.size);
+ return str;
+}
+function padNumber(num, digits, minusSign = '-', trim, negWrap) {
+ let neg = '';
+ if (num < 0 || negWrap && num <= 0) {
+ if (negWrap) {
+ num = -num + 1;
+ } else {
+ num = -num;
+ neg = minusSign;
+ }
}
- get iconContent() {
- return this.controller.icon;
+ let strNum = String(num);
+ while (strNum.length < digits) {
+ strNum = '0' + strNum;
}
- get iconLeftContent() {
- return this.controller.iconLeft;
- }
- get showHint() {
- var _a;
- return !!((_a = this.hintOptions) === null || _a === void 0 ? void 0 : _a.content) && (this.options.hintOnDisabled || !this.computedDisabled);
- }
- // Safari expiration date autofill workaround
- get name() {
- var _a;
- return ((_a = this.nativeFocusableElement) === null || _a === void 0 ? void 0 : _a.autocomplete) === 'cc-exp' ? 'ccexpiryyear' : null;
- }
- get computedId() {
- var _a;
- return ((_a = this.nativeFocusableElement) === null || _a === void 0 ? void 0 : _a.id) || '';
- }
- onFocused(focused) {
- this.updateFocused(focused);
- }
- getIndent$(element) {
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_12__.fromEvent)(element, 'scroll').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(() => -1 * Math.max(element.scrollLeft, 0)));
- }
- clear() {
- if (this.nativeFocusableElement) {
- this.nativeFocusableElement.value = '';
- }
- this.updateValue('');
- }
- onMouseDown(event) {
- const {
- nativeFocusableElement
- } = this;
- if (!nativeFocusableElement || event.target === nativeFocusableElement) {
- return;
- }
- event.preventDefault();
- nativeFocusableElement.focus();
- }
- onModelChange(value) {
- this.updateValue(value);
- }
- onAutofilled(autofilled) {
- this.updateAutofilled(autofilled);
- }
- detectRetargetFromLabel(event) {
- if ((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__.tuiRetargetedBoundaryCrossing)(event)) {
- event.stopImmediatePropagation();
- }
- }
- get iconPaddingLeft() {
- return TUI_ICON_PADDINGS[this.size];
- }
- get placeholderRaisable() {
- return this.size !== 's' && !this.controller.labelOutside;
- }
- updateAutofilled(autofilled) {
- if (this.autofilled === autofilled) {
- return;
- }
- this.autofilled = autofilled;
- }
- updateValue(value) {
- this.value = value;
- this.valueChange.emit(value);
+ if (trim) {
+ strNum = strNum.slice(strNum.length - digits);
}
+ return neg + strNum;
}
-TuiPrimitiveTextfieldComponent.ɵfac = function TuiPrimitiveTextfieldComponent_Factory(t) {
- return new (t || TuiPrimitiveTextfieldComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TUI_TEXTFIELD_WATCHED_CONTROLLER), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives_hint__WEBPACK_IMPORTED_MODULE_15__.TuiHintOptionsDirective, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TUI_TEXTFIELD_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef));
-};
-TuiPrimitiveTextfieldComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiPrimitiveTextfieldComponent,
- selectors: [["tui-primitive-textfield"]],
- contentQueries: function TuiPrimitiveTextfieldComponent_ContentQueries(rf, ctx, dirIndex) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵcontentQuery"](dirIndex, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__.PolymorpheusOutletDirective, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.content = _t);
- }
- },
- viewQuery: function TuiPrimitiveTextfieldComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_c1, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.focusableElement = _t.first);
- }
- },
- hostVars: 15,
- hostBindings: function TuiPrimitiveTextfieldComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("focusin", function TuiPrimitiveTextfieldComponent_focusin_HostBindingHandler() {
- return ctx.onFocused(true);
- })("focusout", function TuiPrimitiveTextfieldComponent_focusout_HostBindingHandler() {
- return ctx.onFocused(false);
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-size", ctx.size);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("--border-start", ctx.borderStart, "rem")("--border-end", ctx.borderEnd, "rem");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_autofilled", ctx.autofilled)("_label-outside", ctx.controller.labelOutside)("_readonly", ctx.readOnly)("_invalid", ctx.computedInvalid)("_hidden", ctx.inputHidden);
- }
- },
- inputs: {
- editable: "editable",
- textfieldFiller: ["filler", "textfieldFiller"],
- iconCleaner: "iconCleaner",
- readOnly: "readOnly",
- invalid: "invalid",
- disabled: "disabled",
- textfieldPrefix: ["prefix", "textfieldPrefix"],
- textfieldPostfix: ["postfix", "textfieldPostfix"],
- value: "value"
- },
- outputs: {
- valueChange: "valueChange"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.tuiAsFocusableItemAccessor)(TuiPrimitiveTextfieldComponent), _taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TEXTFIELD_CONTROLLER_PROVIDER]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]],
- ngContentSelectors: _c4,
- decls: 24,
- vars: 37,
- consts: [[4, "ngIf"], ["automation-id", "tui-primitive-textfield__wrapper", "tuiWrapper", "", 3, "active", "appearance", "disabled", "focus", "hover", "invalid", "readOnly", "click.prevent.silent", "mousedown", "tuiAutofilledChange"], ["automation-id", "tui-primitive-textfield__native-input", "tuiMaskAccessor", "", 1, "t-input", 3, "disabled", "id", "ngModel", "readOnly", "tuiFocusable", "ngModelChange"], ["focusableElement", ""], ["automation-id", "tui-primitive-textfield__value", "class", "t-input t-input_template", 4, "ngIf"], [1, "t-content"], ["class", "t-icon t-icon_left t-textfield-icon", 4, "ngIf"], [1, "t-wrapper"], ["automation-id", "tui-primitive-textfield__placeholder", "class", "t-placeholder", 3, "t-placeholder_raised", "for", 4, "ngIf"], [1, "t-wrapper-value-decoration"], ["aria-hidden", "true", "automation-id", "tui-primitive-textfield__value-decoration", 1, "t-value-decoration"], ["decor", ""], [1, "t-icons"], ["automation-id", "tui-primitive-textfield__custom-content", "class", "t-custom-content", 4, "ngIf"], ["appearance", "icon", "automation-id", "tui-primitive-textfield__cleaner", "tuiWrapper", "", "class", "t-cleaner", 3, "click.stop", 4, "ngIf"], ["automation-id", "tui-primitive-textfield__tooltip", "class", "t-tooltip", 3, "content", "describeId", 4, "ngIf"], ["class", "t-icon t-textfield-icon", 4, "ngIf"], ["automation-id", "tui-primitive-textfield__value", 1, "t-input", "t-input_template"], [1, "t-icon", "t-icon_left", "t-textfield-icon"], ["appearance", "icon", "tuiWrapper", "", 3, "src", 4, "polymorpheusOutlet", "polymorpheusOutletContext"], ["appearance", "icon", "tuiWrapper", "", 3, "src"], ["automation-id", "tui-primitive-textfield__placeholder", 1, "t-placeholder", 3, "for"], ["automation-id", "tui-primitive-textfield__custom-content", 1, "t-custom-content"], ["class", "t-custom-icon", 3, "src", 4, "polymorpheusOutlet"], [1, "t-custom-icon", 3, "src"], ["appearance", "icon", "automation-id", "tui-primitive-textfield__cleaner", "tuiWrapper", "", 1, "t-cleaner", 3, "click.stop"], [3, "src", 4, "polymorpheusOutlet", "polymorpheusOutletContext"], [3, "src"], ["automation-id", "tui-primitive-textfield__tooltip", 1, "t-tooltip", 3, "content", "describeId"], [1, "t-icon", "t-textfield-icon"]],
- template: function TuiPrimitiveTextfieldComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"](_c3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiPrimitiveTextfieldComponent_ng_container_0_Template, 1, 0, "ng-container", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](1, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiPrimitiveTextfieldComponent_ng_container_2_Template, 1, 0, "ng-container", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](3, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click.prevent.silent", function TuiPrimitiveTextfieldComponent_Template_div_click_prevent_silent_4_listener($event) {
- return ctx.detectRetargetFromLabel($event);
- })("mousedown", function TuiPrimitiveTextfieldComponent_Template_div_mousedown_4_listener($event) {
- return ctx.onMouseDown($event);
- })("tuiAutofilledChange", function TuiPrimitiveTextfieldComponent_Template_div_tuiAutofilledChange_4_listener($event) {
- return ctx.onAutofilled($event);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](5, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](7, 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](8, "input", 2, 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("ngModelChange", function TuiPrimitiveTextfieldComponent_Template_input_ngModelChange_8_listener($event) {
- return ctx.onModelChange($event);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](10, TuiPrimitiveTextfieldComponent_div_10_Template, 2, 0, "div", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](11, "div", 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](12, TuiPrimitiveTextfieldComponent_div_12_Template, 2, 4, "div", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](13, "div", 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](14, TuiPrimitiveTextfieldComponent_label_14_Template, 2, 3, "label", 8);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](15, "div", 9)(16, "tui-value-decoration", 10, 11);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](18, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()()();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](19, "div", 12);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](20, TuiPrimitiveTextfieldComponent_div_20_Template, 2, 1, "div", 13);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](21, TuiPrimitiveTextfieldComponent_span_21_Template, 2, 4, "span", 14);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](22, TuiPrimitiveTextfieldComponent_tui_tooltip_22_Template, 1, 2, "tui-tooltip", 15);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](23, TuiPrimitiveTextfieldComponent_div_23_Template, 2, 4, "div", 16);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()()();
- }
- if (rf & 2) {
- const _r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](9);
- const _r6 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](17);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](1, 29, ctx.content == null ? null : ctx.content.changes));
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](3, 31, ctx.hintOptions == null ? null : ctx.hintOptions.change$));
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("--text-indent", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](5, 33, _r6.pre$), "px");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("active", ctx.pseudoActive)("appearance", ctx.appearance)("disabled", ctx.disabled)("focus", ctx.computedFocused)("hover", ctx.pseudoHover)("invalid", ctx.computedInvalid)("readOnly", ctx.readOnly);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("disabled", ctx.computedDisabled)("id", ctx.id)("ngModel", ctx.value)("readOnly", ctx.readOnly || !ctx.editable)("tuiFocusable", ctx.computedFocusable);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("aria-invalid", ctx.computedInvalid)("name", ctx.name);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.inputHidden);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.iconLeftContent);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.hasPlaceholder);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("text-indent", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](18, 35, ctx.getIndent$(_r2)), "px");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-has-value", ctx.value);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.hasCustomContent);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.hasCleaner);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.showHint);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.iconContent);
+function formatFractionalSeconds(milliseconds, digits) {
+ const strMs = padNumber(milliseconds, 3);
+ return strMs.substring(0, digits);
+}
+/**
+ * Returns a date formatter that transforms a date into its locale digit representation
+ */
+function dateGetter(name, size, offset = 0, trim = false, negWrap = false) {
+ return function (date, locale) {
+ let part = getDatePart(name, date);
+ if (offset > 0 || part > -offset) {
+ part += offset;
}
- },
- dependencies: [_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_17__.TuiSvgComponent, TuiValueDecorationComponent, _taiga_ui_core_components_tooltip__WEBPACK_IMPORTED_MODULE_18__.TuiTooltipComponent, _angular_common__WEBPACK_IMPORTED_MODULE_19__.NgIf, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_20__.TuiWrapperDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiAutofilledDirective, _taiga_ui_core_directives_mask_accessor__WEBPACK_IMPORTED_MODULE_22__.TuiMaskAccessorDirective, _angular_forms__WEBPACK_IMPORTED_MODULE_23__.DefaultValueAccessor, _angular_forms__WEBPACK_IMPORTED_MODULE_23__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_23__.NgModel, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiFocusableDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_19__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{font:var(--tui-font-text-s);color:var(--tui-text-01);position:relative;display:block;text-align:left;border-radius:var(--tui-radius-m);height:var(--tui-height);min-height:var(--tui-height);max-height:var(--tui-height)}[data-size=s][_nghost-%COMP%]{--tui-height: var(--tui-height-s)}[data-size=m][_nghost-%COMP%]{--tui-height: var(--tui-height-m)}[data-size=l][_nghost-%COMP%]{--tui-height: var(--tui-height-l);font:var(--tui-font-text-m);line-height:1.25rem}.t-input[_ngcontent-%COMP%]{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0;margin:0;border-width:0;border-radius:inherit;background:none;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;border-style:solid;border-color:transparent;border-inline-start-width:var(--border-start, 0);border-inline-end-width:var(--border-end, 0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none}.t-input[_ngcontent-%COMP%]:-webkit-autofill, .t-input[_ngcontent-%COMP%]:-webkit-autofill:hover, .t-input[_ngcontent-%COMP%]:-webkit-autofill:focus{caret-color:var(--tui-base-09);border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill) inset!important}.t-input[inputMode=none][_ngcontent-%COMP%]{caret-color:transparent}.t-input[_ngcontent-%COMP%]:-webkit-autofill, .t-input[_ngcontent-%COMP%]:-webkit-autofill:first-line{font-size:inherit;line-height:inherit}.t-input[_ngcontent-%COMP%]::-webkit-caps-lock-indicator, .t-input[_ngcontent-%COMP%]::-webkit-contacts-auto-fill-button, .t-input[_ngcontent-%COMP%]::-webkit-credit-card-auto-fill-button, .t-input[_ngcontent-%COMP%]::-webkit-credentials-auto-fill-button, .t-input[_ngcontent-%COMP%]::-webkit-strong-password-auto-fill-button{content:none!important;position:absolute;left:-62.4375rem;top:-62.4375rem;z-index:-999;display:none!important;background:transparent!important;pointer-events:none!important}.t-input[_ngcontent-%COMP%]::placeholder{color:var(--tui-text-03);opacity:0}._focused[_nghost-%COMP%]:not(._readonly) .t-input[_ngcontent-%COMP%]::placeholder, tui-primitive-textfield._focused:not(._readonly)[_nghost-%COMP%] .t-input[_ngcontent-%COMP%]::placeholder, tui-primitive-textfield._focused:not(._readonly) [_nghost-%COMP%] .t-input[_ngcontent-%COMP%]::placeholder, tui-textarea._focused:not(._readonly)[_nghost-%COMP%] .t-input[_ngcontent-%COMP%]::placeholder, tui-textarea._focused:not(._readonly) [_nghost-%COMP%] .t-input[_ngcontent-%COMP%]::placeholder, tui-text-area._focused:not(._readonly)[_nghost-%COMP%] .t-input[_ngcontent-%COMP%]::placeholder, tui-text-area._focused:not(._readonly) [_nghost-%COMP%] .t-input[_ngcontent-%COMP%]::placeholder{opacity:1}[tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-input[_ngcontent-%COMP%]:-webkit-autofill, .t-input [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%]:-webkit-autofill, [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%]:-webkit-autofill, [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-input[_ngcontent-%COMP%]:-webkit-autofill:hover, .t-input [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%]:-webkit-autofill:hover, [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%]:-webkit-autofill:hover, [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-input[_ngcontent-%COMP%]:-webkit-autofill:focus, .t-input [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%]:-webkit-autofill:focus, [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%]:-webkit-autofill:focus{caret-color:var(--tui-base-09);border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill-night) inset!important}[tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-input[_ngcontent-%COMP%]::placeholder, .t-input [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%]::placeholder, [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%]::placeholder{color:var(--tui-text-03-night)}[data-size=s][_nghost-%COMP%] .t-input[_ngcontent-%COMP%], .t-input tui-primitive-textfield[data-size=\"s\"][_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"s\"] [_nghost-%COMP%]:not(tui-primitive-textfield), .t-input tui-textarea[data-size=\"s\"][_nghost-%COMP%]:not(tui-textarea), tui-textarea[data-size=\"s\"] [_nghost-%COMP%]:not(tui-textarea), .t-input tui-text-area[data-size=\"s\"][_nghost-%COMP%]:not(tui-text-area), tui-text-area[data-size=\"s\"] [_nghost-%COMP%]:not(tui-text-area){padding:0 var(--tui-padding-s)}[data-size=m][_nghost-%COMP%] .t-input[_ngcontent-%COMP%], .t-input tui-primitive-textfield[data-size=\"m\"][_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"m\"] [_nghost-%COMP%]:not(tui-primitive-textfield), .t-input tui-textarea[data-size=\"m\"][_nghost-%COMP%]:not(tui-textarea), tui-textarea[data-size=\"m\"] [_nghost-%COMP%]:not(tui-textarea), .t-input tui-text-area[data-size=\"m\"][_nghost-%COMP%]:not(tui-text-area), tui-text-area[data-size=\"m\"] [_nghost-%COMP%]:not(tui-text-area){padding:0 var(--tui-padding-m)}[data-size=l][_nghost-%COMP%] .t-input[_ngcontent-%COMP%], .t-input tui-primitive-textfield[data-size=\"l\"][_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"l\"] [_nghost-%COMP%]:not(tui-primitive-textfield), .t-input tui-textarea[data-size=\"l\"][_nghost-%COMP%]:not(tui-textarea), tui-textarea[data-size=\"l\"] [_nghost-%COMP%]:not(tui-textarea), .t-input tui-text-area[data-size=\"l\"][_nghost-%COMP%]:not(tui-text-area), tui-text-area[data-size=\"l\"] [_nghost-%COMP%]:not(tui-text-area){padding:0 var(--tui-padding-l)}._disabled[_nghost-%COMP%] .t-input[_ngcontent-%COMP%], .t-input tui-primitive-textfield._disabled[_nghost-%COMP%], tui-primitive-textfield._disabled [_nghost-%COMP%], .t-input tui-textarea._disabled[_nghost-%COMP%], tui-textarea._disabled [_nghost-%COMP%], .t-input tui-text-area._disabled[_nghost-%COMP%], tui-text-area._disabled [_nghost-%COMP%]{pointer-events:none}[data-size=l][_nghost-%COMP%]:not(._label-outside) .t-input[_ngcontent-%COMP%], .t-input tui-primitive-textfield[data-size=\"l\"]:not(._label-outside)[_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"l\"]:not(._label-outside) [_nghost-%COMP%]:not(tui-primitive-textfield){padding-top:1.25rem}[data-size=m][_nghost-%COMP%]:not(._label-outside) .t-input[_ngcontent-%COMP%], .t-input tui-primitive-textfield[data-size=\"m\"]:not(._label-outside)[_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"m\"]:not(._label-outside) [_nghost-%COMP%]:not(tui-primitive-textfield){padding-top:1rem}[data-size=l][_nghost-%COMP%]:not(._label-outside) .t-input[_ngcontent-%COMP%]{padding-top:1.25rem}[data-size=l][_nghost-%COMP%]:not(._label-outside) .t-input[_ngcontent-%COMP%]:-webkit-autofill + .t-content[_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{font-size:.8156rem;transform:translateY(-.625rem)}[data-size=m][_nghost-%COMP%]:not(._label-outside) .t-input[_ngcontent-%COMP%]:-webkit-autofill + .t-content[_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{font-size:.69rem;transform:translateY(-.5rem)}._hidden[_nghost-%COMP%] input.t-input[_ngcontent-%COMP%], .t-input tui-primitive-textfield._hidden[_nghost-%COMP%], tui-primitive-textfield._hidden [_nghost-%COMP%]{opacity:0;text-indent:-10em}.t-content[_ngcontent-%COMP%]{display:flex;height:100%;width:100%;box-sizing:border-box;align-items:center;overflow:hidden}[data-size=s][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{padding:0 var(--tui-padding-s)}[data-size=m][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{padding:0 var(--tui-padding-m)}[data-size=l][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{padding:0 var(--tui-padding-l)}.t-wrapper[_ngcontent-%COMP%]{flex:1;min-width:0;-webkit-padding-end:.25rem;padding-inline-end:.25rem}.t-placeholder[_ngcontent-%COMP%]{transition-property:transform,font-size,color,letter-spacing;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;display:block;width:100%;-webkit-user-select:none;-moz-user-select:none;user-select:none;font:var(--tui-font-text-s);color:var(--tui-text-02);pointer-events:none;will-change:transform;transform:translateY(0)}@supports (-webkit-hyphens: none){.t-placeholder[_ngcontent-%COMP%]{will-change:unset;transition-property:transform,color,letter-spacing}}.t-placeholder_raised[_ngcontent-%COMP%]{transform:translateY(-.625rem)}[data-size=m][_nghost-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%]{font:var(--tui-font-text-xs);line-height:1.25rem;transform:translateY(-.5rem);letter-spacing:.025rem}._invalid[_nghost-%COMP%]:not(._focused) .t-placeholder_raised[_ngcontent-%COMP%], ._invalid[_nghost-%COMP%]:not(._focused):hover .t-placeholder_raised[_ngcontent-%COMP%]{color:var(--tui-error-fill)}._invalid[_nghost-%COMP%]:not(._focused) [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%], ._invalid[_nghost-%COMP%]:not(._focused):hover [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%]{color:var(--tui-error-fill-night)}._focused[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=m]._focused._label-outside[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused._label-outside[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-03)}[data-size=l][_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%]{font:var(--tui-font-text-m);line-height:1.25rem}[data-size=l][_nghost-%COMP%] .t-placeholder_raised[_ngcontent-%COMP%]{font-size:.8156rem}[data-size=m]._focused[_nghost-%COMP%]:not(._label-outside) .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused[_nghost-%COMP%]:not(._label-outside) .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-01)}[tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-02-night)}[data-size=m]._focused[_nghost-%COMP%]:not(._label-outside) [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused[_nghost-%COMP%]:not(._label-outside) [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-01-night)}._focused[_nghost-%COMP%] [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=m]._focused._label-outside[_nghost-%COMP%] [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%], [data-size=l]._focused._label-outside[_nghost-%COMP%] [tuiWrapper][data-mode=onDark][_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{color:var(--tui-text-02-night)}.t-cleaner[_ngcontent-%COMP%]{position:relative;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;box-sizing:border-box;cursor:pointer;pointer-events:none;pointer-events:auto}._readonly[_nghost-%COMP%] .t-cleaner[_ngcontent-%COMP%], ._disabled[_nghost-%COMP%] .t-cleaner[_ngcontent-%COMP%]{pointer-events:none}.t-icon[_ngcontent-%COMP%]{position:relative;display:flex;width:1.5rem;height:1.5rem;align-items:center;justify-content:center;box-sizing:border-box;cursor:pointer;pointer-events:none}[data-size=s][_nghost-%COMP%] .t-icon_left[_ngcontent-%COMP%]{-webkit-margin-start:-.375rem;margin-inline-start:-.375rem}[data-size=m][_nghost-%COMP%] .t-icon_left[_ngcontent-%COMP%]{-webkit-margin-start:-.125rem;margin-inline-start:-.125rem;-webkit-margin-end:.375rem;margin-inline-end:.375rem}[data-size=l][_nghost-%COMP%] .t-icon_left[_ngcontent-%COMP%]{-webkit-margin-end:.75rem;margin-inline-end:.75rem}.t-icons[_ngcontent-%COMP%]{display:flex;align-items:center}[data-size=m][_nghost-%COMP%] .t-icons[_ngcontent-%COMP%]{-webkit-margin-end:-.125rem;margin-inline-end:-.125rem}[data-size=s][_nghost-%COMP%] .t-icons[_ngcontent-%COMP%]{-webkit-margin-end:-.375rem;margin-inline-end:-.375rem}[_nghost-%COMP%]:not([data-size=\"s\"]) .t-icons[_ngcontent-%COMP%] > [_ngcontent-%COMP%]:not(:first-child){-webkit-margin-start:.25rem;margin-inline-start:.25rem}._autofilled[data-size=s][_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%], ._autofilled._label-outside[_nghost-%COMP%] .t-placeholder[_ngcontent-%COMP%], ._autofilled[_nghost-%COMP%] .t-value-decoration[_ngcontent-%COMP%]:not(.t-has-value){visibility:hidden}.t-custom-content[_ngcontent-%COMP%]{position:relative;display:flex;align-items:center;justify-content:center;min-width:2rem;height:2rem;pointer-events:none}.t-custom-icon[_ngcontent-%COMP%]{width:2rem;height:100%}.t-input[_ngcontent-%COMP%]:not(:first-child){display:none}[data-size][_nghost-%COMP%] .t-input_template[_ngcontent-%COMP%]{display:flex;width:calc(100% - 1rem);max-width:calc(100% - 1rem);align-items:center;pointer-events:none;-webkit-padding-end:0;padding-inline-end:0}.t-text-template[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.t-wrapper-value-decoration[_ngcontent-%COMP%]{position:relative;pointer-events:none}"],
- changeDetection: 0
-});
-(0,tslib__WEBPACK_IMPORTED_MODULE_25__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.tuiPure], TuiPrimitiveTextfieldComponent.prototype, "getIndent$", null);
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiPrimitiveTextfieldComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-primitive-textfield',
- templateUrl: './primitive-textfield.template.html',
- styleUrls: ['./primitive-textfield.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.tuiAsFocusableItemAccessor)(TuiPrimitiveTextfieldComponent), _taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TEXTFIELD_CONTROLLER_PROVIDER],
- host: {
- '[class._autofilled]': 'autofilled',
- '[class._label-outside]': 'controller.labelOutside'
+ if (name === DateType.Hours) {
+ if (part === 0 && offset === -12) {
+ part = 12;
}
- }]
- }], function () {
- return [{
- type: _taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TuiTextfieldController,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TUI_TEXTFIELD_WATCHED_CONTROLLER]
- }]
- }, {
- type: _taiga_ui_core_directives_hint__WEBPACK_IMPORTED_MODULE_15__.TuiHintOptionsDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives_hint__WEBPACK_IMPORTED_MODULE_15__.TuiHintOptionsDirective]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TUI_TEXTFIELD_OPTIONS]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }];
- }, {
- focusableElement: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChild,
- args: ['focusableElement']
- }],
- editable: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- textfieldFiller: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['filler']
- }],
- iconCleaner: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- readOnly: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._readonly']
- }],
- invalid: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- disabled: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- textfieldPrefix: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['prefix']
- }],
- textfieldPostfix: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['postfix']
- }],
- value: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- valueChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output
- }],
- content: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ContentChildren,
- args: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__.PolymorpheusOutletDirective, {
- descendants: true
- }]
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-size']
- }],
- computedInvalid: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._invalid']
- }],
- inputHidden: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._hidden']
- }],
- borderStart: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['style.--border-start.rem']
- }],
- borderEnd: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['style.--border-end.rem']
- }],
- onFocused: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['focusin', ['true']]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['focusout', ['false']]
- }],
- getIndent$: []
- });
-})();
-class TuiPrimitiveTextfieldDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_27__.AbstractTuiTextfieldHost {
- constructor(textfield) {
- /**
- * TuiPrimitiveTextfieldComponent satisfies all required parts of
- * AbstractTuiControl interface. A new interface is not introduced
- * so AbstractTuiControl is automatically injected for all other controls.
- */
- super(textfield);
- this.textfield = textfield;
- }
- get readOnly() {
- return this.textfield.readOnly || !this.textfield.editable;
- }
- onValueChange(value) {
- this.textfield.onModelChange(value);
- }
+ } else if (name === DateType.FractionalSeconds) {
+ return formatFractionalSeconds(part, size);
+ }
+ const localeMinus = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
+ return padNumber(part, size, localeMinus, trim, negWrap);
+ };
}
-TuiPrimitiveTextfieldDirective.ɵfac = function TuiPrimitiveTextfieldDirective_Factory(t) {
- return new (t || TuiPrimitiveTextfieldDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiPrimitiveTextfieldComponent));
-};
-TuiPrimitiveTextfieldDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiPrimitiveTextfieldDirective,
- selectors: [["tui-primitive-textfield"]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_28__.tuiAsTextfieldHost)(TuiPrimitiveTextfieldDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiPrimitiveTextfieldDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: 'tui-primitive-textfield',
- providers: [(0,_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_28__.tuiAsTextfieldHost)(TuiPrimitiveTextfieldDirective)]
- }]
- }], function () {
- return [{
- type: TuiPrimitiveTextfieldComponent,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiPrimitiveTextfieldComponent]
- }]
- }];
- }, null);
-})();
-class TuiTextfieldComponent {
- constructor(host, controller, el, idService, legacyMask) {
- this.host = host;
- this.controller = controller;
- this.el = el;
- this.idService = idService;
- this.legacyMask = legacyMask;
- this.host.process(this.el.nativeElement);
- }
- get id() {
- return this.el.nativeElement.id || this.idService.generate();
- }
- get inputMode() {
- const mode = this.el.nativeElement.inputMode || this.host.inputMode;
- return mode === 'text' ? null : mode;
+function getDatePart(part, date) {
+ switch (part) {
+ case DateType.FullYear:
+ return date.getFullYear();
+ case DateType.Month:
+ return date.getMonth();
+ case DateType.Date:
+ return date.getDate();
+ case DateType.Hours:
+ return date.getHours();
+ case DateType.Minutes:
+ return date.getMinutes();
+ case DateType.Seconds:
+ return date.getSeconds();
+ case DateType.FractionalSeconds:
+ return date.getMilliseconds();
+ case DateType.Day:
+ return date.getDay();
+ default:
+ throw new Error(`Unknown DateType value "${part}".`);
}
}
-TuiTextfieldComponent.ɵfac = function TuiTextfieldComponent_Factory(t) {
- return new (t || TuiTextfieldComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_28__.TUI_TEXTFIELD_HOST), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TUI_TEXTFIELD_WATCHED_CONTROLLER), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_29__.TuiIdService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_28__.TUI_LEGACY_MASK, 8));
-};
-TuiTextfieldComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiTextfieldComponent,
- selectors: [["input", "tuiTextfield", ""], ["textarea", "tuiTextfield", ""]],
- hostAttrs: ["type", "text"],
- hostVars: 7,
- hostBindings: function TuiTextfieldComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("input", function TuiTextfieldComponent_input_HostBindingHandler($event) {
- return !ctx.legacyMask && ctx.host.onValueChange($event.target.value);
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵhostProperty"]("tabIndex", ctx.host.focusable ? 0 : -1)("readOnly", ctx.host.readOnly)("value", ctx.host.value);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("id", ctx.id)("inputMode", ctx.inputMode)("aria-invalid", ctx.host.invalid)("disabled", ctx.host.disabled || null);
- }
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TEXTFIELD_CONTROLLER_PROVIDER])],
- attrs: _c5,
- decls: 0,
- vars: 0,
- template: function TuiTextfieldComponent_Template(rf, ctx) {},
- styles: ["[_nghost-%COMP%]{font:var(--tui-font-text-s);color:var(--tui-text-01);padding:0;margin:0;border-width:0;border-radius:inherit;background:none;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;border-style:solid;border-color:transparent;border-inline-start-width:var(--border-start, 0);border-inline-end-width:var(--border-end, 0);text-indent:var(--text-indent);text-align:inherit;box-sizing:border-box;white-space:nowrap;overflow:hidden;text-transform:inherit;resize:none}[_nghost-%COMP%]:-webkit-autofill, [_nghost-%COMP%]:-webkit-autofill:hover, [_nghost-%COMP%]:-webkit-autofill:focus{caret-color:var(--tui-base-09);border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill) inset!important}[inputMode=none][_nghost-%COMP%]{caret-color:transparent}[_nghost-%COMP%]:-webkit-autofill, [_nghost-%COMP%]:-webkit-autofill:first-line{font-size:inherit;line-height:inherit}[_nghost-%COMP%]::-webkit-caps-lock-indicator, [_nghost-%COMP%]::-webkit-contacts-auto-fill-button, [_nghost-%COMP%]::-webkit-credit-card-auto-fill-button, [_nghost-%COMP%]::-webkit-credentials-auto-fill-button, [_nghost-%COMP%]::-webkit-strong-password-auto-fill-button{content:none!important;position:absolute;left:-62.4375rem;top:-62.4375rem;z-index:-999;display:none!important;background:transparent!important;pointer-events:none!important}[_nghost-%COMP%]::placeholder{color:var(--tui-text-03);opacity:0}._focused[_nghost-%COMP%]:not(._readonly) [_ngcontent-%COMP%]::placeholder, tui-primitive-textfield._focused:not(._readonly) [_nghost-%COMP%]::placeholder, tui-textarea._focused:not(._readonly) [_nghost-%COMP%]::placeholder, tui-text-area._focused:not(._readonly) [_nghost-%COMP%]::placeholder{opacity:1}[tuiWrapper][data-mode=onDark] [_nghost-%COMP%]:-webkit-autofill, [_nghost-%COMP%] [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%]:-webkit-autofill, [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%]:-webkit-autofill, [tuiWrapper][data-mode=onDark] [_nghost-%COMP%]:-webkit-autofill:hover, [_nghost-%COMP%] [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%]:-webkit-autofill:hover, [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%]:-webkit-autofill:hover, [tuiWrapper][data-mode=onDark] [_nghost-%COMP%]:-webkit-autofill:focus, [_nghost-%COMP%] [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%]:-webkit-autofill:focus, [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%]:-webkit-autofill:focus{caret-color:var(--tui-base-09);border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01-night)!important;border-color:var(--tui-autofill-night);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill-night) inset!important}[tuiWrapper][data-mode=onDark] [_nghost-%COMP%]::placeholder, [_nghost-%COMP%] [tuiWrapper][data-mode=\"onDark\"][_nghost-%COMP%]::placeholder, [tuiWrapper][data-mode=\"onDark\"] [_nghost-%COMP%]::placeholder{color:var(--tui-text-03-night)}[data-size=s][_nghost-%COMP%] -shadowcsshost, [_nghost-%COMP%] tui-primitive-textfield[data-size=\"s\"][_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"s\"] [_nghost-%COMP%]:not(tui-primitive-textfield), [_nghost-%COMP%] tui-textarea[data-size=\"s\"][_nghost-%COMP%]:not(tui-textarea), tui-textarea[data-size=\"s\"] [_nghost-%COMP%]:not(tui-textarea), [_nghost-%COMP%] tui-text-area[data-size=\"s\"][_nghost-%COMP%]:not(tui-text-area), tui-text-area[data-size=\"s\"] [_nghost-%COMP%]:not(tui-text-area){padding:0 var(--tui-padding-s)}[data-size=m][_nghost-%COMP%] -shadowcsshost, [_nghost-%COMP%] tui-primitive-textfield[data-size=\"m\"][_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"m\"] [_nghost-%COMP%]:not(tui-primitive-textfield), [_nghost-%COMP%] tui-textarea[data-size=\"m\"][_nghost-%COMP%]:not(tui-textarea), tui-textarea[data-size=\"m\"] [_nghost-%COMP%]:not(tui-textarea), [_nghost-%COMP%] tui-text-area[data-size=\"m\"][_nghost-%COMP%]:not(tui-text-area), tui-text-area[data-size=\"m\"] [_nghost-%COMP%]:not(tui-text-area){padding:0 var(--tui-padding-m)}[data-size=l][_nghost-%COMP%] -shadowcsshost, [_nghost-%COMP%] tui-primitive-textfield[data-size=\"l\"][_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"l\"] [_nghost-%COMP%]:not(tui-primitive-textfield), [_nghost-%COMP%] tui-textarea[data-size=\"l\"][_nghost-%COMP%]:not(tui-textarea), tui-textarea[data-size=\"l\"] [_nghost-%COMP%]:not(tui-textarea), [_nghost-%COMP%] tui-text-area[data-size=\"l\"][_nghost-%COMP%]:not(tui-text-area), tui-text-area[data-size=\"l\"] [_nghost-%COMP%]:not(tui-text-area){padding:0 var(--tui-padding-l)}._disabled[_nghost-%COMP%] -shadowcsshost, [_nghost-%COMP%] tui-primitive-textfield._disabled[_nghost-%COMP%], tui-primitive-textfield._disabled [_nghost-%COMP%], [_nghost-%COMP%] tui-textarea._disabled[_nghost-%COMP%], tui-textarea._disabled [_nghost-%COMP%], [_nghost-%COMP%] tui-text-area._disabled[_nghost-%COMP%], tui-text-area._disabled [_nghost-%COMP%]{pointer-events:none}[data-size=l][_nghost-%COMP%]:not(._label-outside) -shadowcsshost, [_nghost-%COMP%] tui-primitive-textfield[data-size=\"l\"]:not(._label-outside)[_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"l\"]:not(._label-outside) [_nghost-%COMP%]:not(tui-primitive-textfield){padding-top:1.25rem}[data-size=m][_nghost-%COMP%]:not(._label-outside) -shadowcsshost, [_nghost-%COMP%] tui-primitive-textfield[data-size=\"m\"]:not(._label-outside)[_nghost-%COMP%]:not(tui-primitive-textfield), tui-primitive-textfield[data-size=\"m\"]:not(._label-outside) [_nghost-%COMP%]:not(tui-primitive-textfield){padding-top:1rem}[data-size=l][_nghost-%COMP%]:not(._label-outside) -shadowcsshost{padding-top:1.25rem}[data-size=l][_nghost-%COMP%]:not(._label-outside) [_ngcontent-%COMP%]:-webkit-autofill + .t-content[_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{font-size:.8156rem;transform:translateY(-.625rem)}[data-size=m][_nghost-%COMP%]:not(._label-outside) [_ngcontent-%COMP%]:-webkit-autofill + .t-content[_ngcontent-%COMP%] .t-placeholder[_ngcontent-%COMP%]{font-size:.69rem;transform:translateY(-.5rem)}._hidden[_nghost-%COMP%] input[_ngcontent-%COMP%], [_nghost-%COMP%] tui-primitive-textfield._hidden[_nghost-%COMP%], tui-primitive-textfield._hidden [_nghost-%COMP%]{opacity:0;text-indent:-10em}textarea[_nghost-%COMP%]{white-space:pre-wrap}textarea[_nghost-%COMP%] tui-textarea._ios[_nghost-%COMP%], tui-textarea._ios [_nghost-%COMP%], textarea[_nghost-%COMP%] tui-text-area._ios[_nghost-%COMP%], tui-text-area._ios [_nghost-%COMP%]{padding-left:.8125rem}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiTextfieldComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'input[tuiTextfield], textarea[tuiTextfield]',
- template: '',
- styleUrls: ['./textfield.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [_taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TEXTFIELD_CONTROLLER_PROVIDER],
- host: {
- type: 'text',
- '[attr.id]': 'id',
- '[attr.inputMode]': 'inputMode',
- '[attr.aria-invalid]': 'host.invalid',
- '[attr.disabled]': 'host.disabled || null',
- '[tabIndex]': 'host.focusable ? 0 : -1',
- '[readOnly]': 'host.readOnly',
- '[value]': 'host.value',
- '(input)': '!legacyMask && host.onValueChange($event.target.value)'
- }
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_28__.TUI_TEXTFIELD_HOST]
- }]
- }, {
- type: _taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TuiTextfieldController,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TUI_TEXTFIELD_WATCHED_CONTROLLER]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_29__.TuiIdService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_29__.TuiIdService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_28__.TUI_LEGACY_MASK]
- }]
- }];
- }, null);
-})();
-class TuiPrimitiveTextfieldModule {}
-TuiPrimitiveTextfieldModule.ɵfac = function TuiPrimitiveTextfieldModule_Factory(t) {
- return new (t || TuiPrimitiveTextfieldModule)();
-};
-TuiPrimitiveTextfieldModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiPrimitiveTextfieldModule
-});
-TuiPrimitiveTextfieldModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_19__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_23__.FormsModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__.PolymorpheusModule, _taiga_ui_core_directives_mask_accessor__WEBPACK_IMPORTED_MODULE_22__.TuiMaskAccessorModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiFocusableModule, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_20__.TuiWrapperModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_17__.TuiSvgModule, _taiga_ui_core_components_tooltip__WEBPACK_IMPORTED_MODULE_18__.TuiTooltipModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiAutofilledModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiPrimitiveTextfieldModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_19__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_23__.FormsModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_16__.PolymorpheusModule, _taiga_ui_core_directives_mask_accessor__WEBPACK_IMPORTED_MODULE_22__.TuiMaskAccessorModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiFocusableModule, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_20__.TuiWrapperModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_17__.TuiSvgModule, _taiga_ui_core_components_tooltip__WEBPACK_IMPORTED_MODULE_18__.TuiTooltipModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiAutofilledModule],
- declarations: [TuiPrimitiveTextfieldComponent, TuiPrimitiveTextfieldDirective, TuiTextfieldComponent, TuiValueDecorationComponent],
- exports: [TuiPrimitiveTextfieldComponent, TuiPrimitiveTextfieldDirective, TuiTextfieldComponent]
- }]
- }], null, null);
-})();
-
-/**
- * @deprecated:
- * use {@link TUI_TEXTFIELD_DEFAULT_OPTIONS}
- */
-const TUI_PRIMITIVE_TEXTFIELD_DEFAULT_OPTIONS = _taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TUI_TEXTFIELD_DEFAULT_OPTIONS;
/**
- * @deprecated:
- * use {@link TUI_TEXTFIELD_OPTIONS}
+ * Returns a date formatter that transforms a date into its locale string representation
*/
-const TUI_PRIMITIVE_TEXTFIELD_OPTIONS = _taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.TUI_TEXTFIELD_OPTIONS;
+function dateStrGetter(name, width, form = FormStyle.Format, extended = false) {
+ return function (date, locale) {
+ return getDateTranslation(date, locale, name, width, form, extended);
+ };
+}
/**
- * @deprecated:
- * use {@link tuiTextfieldOptionsProvider}
+ * Returns the locale translation of a date for a given form, type and width
*/
-const tuiPrimitiveTextfieldOptionsProvider = _taiga_ui_core_directives_textfield_controller__WEBPACK_IMPORTED_MODULE_14__.tuiTextfieldOptionsProvider;
-
+function getDateTranslation(date, locale, name, width, form, extended) {
+ switch (name) {
+ case TranslationType.Months:
+ return getLocaleMonthNames(locale, form, width)[date.getMonth()];
+ case TranslationType.Days:
+ return getLocaleDayNames(locale, form, width)[date.getDay()];
+ case TranslationType.DayPeriods:
+ const currentHours = date.getHours();
+ const currentMinutes = date.getMinutes();
+ if (extended) {
+ const rules = getLocaleExtraDayPeriodRules(locale);
+ const dayPeriods = getLocaleExtraDayPeriods(locale, form, width);
+ const index = rules.findIndex(rule => {
+ if (Array.isArray(rule)) {
+ // morning, afternoon, evening, night
+ const [from, to] = rule;
+ const afterFrom = currentHours >= from.hours && currentMinutes >= from.minutes;
+ const beforeTo = currentHours < to.hours || currentHours === to.hours && currentMinutes < to.minutes;
+ // We must account for normal rules that span a period during the day (e.g. 6am-9am)
+ // where `from` is less (earlier) than `to`. But also rules that span midnight (e.g.
+ // 10pm - 5am) where `from` is greater (later!) than `to`.
+ //
+ // In the first case the current time must be BOTH after `from` AND before `to`
+ // (e.g. 8am is after 6am AND before 10am).
+ //
+ // In the second case the current time must be EITHER after `from` OR before `to`
+ // (e.g. 4am is before 5am but not after 10pm; and 11pm is not before 5am but it is
+ // after 10pm).
+ if (from.hours < to.hours) {
+ if (afterFrom && beforeTo) {
+ return true;
+ }
+ } else if (afterFrom || beforeTo) {
+ return true;
+ }
+ } else {
+ // noon or midnight
+ if (rule.hours === currentHours && rule.minutes === currentMinutes) {
+ return true;
+ }
+ }
+ return false;
+ });
+ if (index !== -1) {
+ return dayPeriods[index];
+ }
+ }
+ // if no rules for the day periods, we use am/pm by default
+ return getLocaleDayPeriods(locale, form, width)[currentHours < 12 ? 0 : 1];
+ case TranslationType.Eras:
+ return getLocaleEraNames(locale, width)[date.getFullYear() <= 0 ? 0 : 1];
+ default:
+ // This default case is not needed by TypeScript compiler, as the switch is exhaustive.
+ // However Closure Compiler does not understand that and reports an error in typed mode.
+ // The `throw new Error` below works around the problem, and the unexpected: never variable
+ // makes sure tsc still checks this code is unreachable.
+ const unexpected = name;
+ throw new Error(`unexpected translation type ${unexpected}`);
+ }
+}
/**
- * Generated bundle index. Do not edit.
+ * Returns a date formatter that transforms a date and an offset into a timezone with ISO8601 or
+ * GMT format depending on the width (eg: short = +0430, short:GMT = GMT+4, long = GMT+04:30,
+ * extended = +04:30)
*/
-
-
-
-/***/ }),
-
-/***/ 8686:
-/*!*******************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-root.js ***!
- \*******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiRootComponent: () => (/* binding */ TuiRootComponent),
-/* harmony export */ TuiRootModule: () => (/* binding */ TuiRootModule)
-/* harmony export */ });
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/cdk */ 1498);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk */ 3190);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @taiga-ui/cdk */ 9853);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/cdk */ 749);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/core/services */ 1717);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 1640);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 3396);
-/* harmony import */ var _taiga_ui_core_internal_svg_defs_host__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/core/internal/svg-defs-host */ 7007);
-/* harmony import */ var _taiga_ui_core_components_hints_host__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @taiga-ui/core/components/hints-host */ 8009);
-/* harmony import */ var _tinkoff_ng_event_plugins__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @tinkoff/ng-event-plugins */ 652);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-function TuiRootComponent_tui_scroll_controls_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-scroll-controls", 2);
- }
+function timeZoneGetter(width) {
+ return function (date, locale, offset) {
+ const zone = -1 * offset;
+ const minusSign = getLocaleNumberSymbol(locale, NumberSymbol.MinusSign);
+ const hours = zone > 0 ? Math.floor(zone / 60) : Math.ceil(zone / 60);
+ switch (width) {
+ case ZoneWidth.Short:
+ return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + padNumber(Math.abs(zone % 60), 2, minusSign);
+ case ZoneWidth.ShortGMT:
+ return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 1, minusSign);
+ case ZoneWidth.Long:
+ return 'GMT' + (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);
+ case ZoneWidth.Extended:
+ if (offset === 0) {
+ return 'Z';
+ } else {
+ return (zone >= 0 ? '+' : '') + padNumber(hours, 2, minusSign) + ':' + padNumber(Math.abs(zone % 60), 2, minusSign);
+ }
+ default:
+ throw new Error(`Unknown zone width "${width}"`);
+ }
+ };
}
-const _c0 = ["*", [["tuiOverContent"]], [["tuiOverDialogs"]], [["tuiOverAlerts"]], [["tuiOverPortals"]], [["tuiOverHints"]]];
-const _c1 = ["*", "tuiOverContent", "tuiOverDialogs", "tuiOverAlerts", "tuiOverPortals", "tuiOverHints"];
-class TuiRootComponent {
- constructor(reducedMotion, duration, dialogs, isMobile, breakpoint, isIOS, isAndroid, document, theme) {
- var _a;
- this.reducedMotion = reducedMotion;
- this.duration = duration;
- this.dialogs = dialogs;
- this.isMobile = isMobile;
- this.breakpoint = breakpoint;
- this.isIOS = isIOS;
- this.isAndroid = isAndroid;
- this.isMobileRes$ = this.breakpoint.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.map)(breakpoint => breakpoint === 'mobile'));
- this.scrollbars$ = this.dialogs.length && !this.isMobile ? (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.combineLatest)([...this.dialogs]).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.map)(dialogs => !dialogs.some(({
- length
- }) => length)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.debounceTime)(0)) : (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.of)(!this.isMobile);
- (_a = document.defaultView) === null || _a === void 0 ? void 0 : _a.document.body.setAttribute('data-tui-theme', theme.toLowerCase());
- }
+const JANUARY = 0;
+const THURSDAY = 4;
+function getFirstThursdayOfYear(year) {
+ const firstDayOfYear = createDate(year, JANUARY, 1).getDay();
+ return createDate(year, 0, 1 + (firstDayOfYear <= THURSDAY ? THURSDAY : THURSDAY + 7) - firstDayOfYear);
}
-TuiRootComponent.ɵfac = function TuiRootComponent_Factory(t) {
- return new (t || TuiRootComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_REDUCED_MOTION), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_ANIMATIONS_DURATION), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_DIALOGS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_MOBILE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_7__.TuiBreakpointService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_IOS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_ANDROID), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_8__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_THEME));
-};
-TuiRootComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiRootComponent,
- selectors: [["tui-root"]],
- hostAttrs: ["data-tui-version", "3.96.0"],
- hostVars: 9,
- hostBindings: function TuiRootComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("touchstart.passive.silent", function TuiRootComponent_touchstart_passive_silent_HostBindingHandler() {
- return 0;
- })("$.class._mobile", function TuiRootComponent___class__mobile_HostBindingHandler() {
- return ctx.isMobileRes$;
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵhostProperty"]("$.class._mobile", ctx.isMobileRes$);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("--tui-duration", ctx.duration, "ms");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_ios", ctx.isIOS)("_android", ctx.isAndroid)("_reduced-motion", ctx.reducedMotion);
- }
- },
- ngContentSelectors: _c1,
- decls: 14,
- vars: 3,
- consts: [["class", "t-root-scrollbar", 4, "ngIf"], [1, "t-root-content"], [1, "t-root-scrollbar"]],
- template: function TuiRootComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"](_c0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiRootComponent_tui_scroll_controls_0_Template, 1, 0, "tui-scroll-controls", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](1, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](2, "tui-svg-defs-host");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "tui-dropdown-host")(4, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](6, 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](7, "tui-dialog-host");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](8, 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](9, "tui-alert-host");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](10, 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](11, 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](12, "tui-hints-host");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](13, 5);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](1, 1, ctx.scrollbars$));
+function getThursdayThisWeek(datetime) {
+ return createDate(datetime.getFullYear(), datetime.getMonth(), datetime.getDate() + (THURSDAY - datetime.getDay()));
+}
+function weekGetter(size, monthBased = false) {
+ return function (date, locale) {
+ let result;
+ if (monthBased) {
+ const nbDaysBefore1stDayOfMonth = new Date(date.getFullYear(), date.getMonth(), 1).getDay() - 1;
+ const today = date.getDate();
+ result = 1 + Math.floor((today + nbDaysBefore1stDayOfMonth) / 7);
+ } else {
+ const thisThurs = getThursdayThisWeek(date);
+ // Some days of a year are part of next year according to ISO 8601.
+ // Compute the firstThurs from the year of this week's Thursday
+ const firstThurs = getFirstThursdayOfYear(thisThurs.getFullYear());
+ const diff = thisThurs.getTime() - firstThurs.getTime();
+ result = 1 + Math.round(diff / 6.048e8); // 6.048e8 ms per week
}
- },
- dependencies: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__.TuiScrollControlsComponent, _taiga_ui_core_internal_svg_defs_host__WEBPACK_IMPORTED_MODULE_10__.TuiSvgDefsHostComponent, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiDropdownHostComponent, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_12__.TuiDialogHostComponent, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__.TuiAlertHostComponent, _taiga_ui_core_components_hints_host__WEBPACK_IMPORTED_MODULE_14__.TuiHintsHostComponent, _angular_common__WEBPACK_IMPORTED_MODULE_8__.NgIf, _angular_common__WEBPACK_IMPORTED_MODULE_8__.AsyncPipe],
- styles: ["@keyframes tuiPresent{to{content:\"1\"}}@keyframes tuiSkeletonVibe{to{opacity:.5}}html,.tui-zero-scrollbar{scrollbar-width:none;-ms-overflow-style:none}html::-webkit-scrollbar,.tui-zero-scrollbar::-webkit-scrollbar,html::-webkit-scrollbar-thumb,.tui-zero-scrollbar::-webkit-scrollbar-thumb{display:none}body[data-tui-theme]{font:var(--tui-font-text-s);color:var(--tui-text-01);background:var(--tui-base-01);margin:0}tui-root{position:relative;display:block;flex:1;-webkit-tap-highlight-color:transparent}tui-root>.t-root-scrollbar{position:fixed;top:0;left:0;bottom:0;right:0;display:none;margin:0}[data-tui-theme] tui-root>.t-root-scrollbar{display:block}.t-root-content{position:relative;top:var(--t-root-top);height:100%;isolation:isolate}.t-root-content>*{--t-root-top: 0}[tuiDropdownButton][tuiDropdownButton]{display:none}.t-overscroll-none{overscroll-behavior:none}\n"],
- encapsulation: 2
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiRootComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-root',
- templateUrl: './root.template.html',
- styleUrls: ['./root.style.less'],
- encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewEncapsulation.None,
- // So that we do not force OnPush on custom dialogs
- // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.Default,
- host: {
- 'data-tui-version': _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_15__.TUI_VERSION,
- '[style.--tui-duration.ms]': 'duration',
- '[class._ios]': 'isIOS',
- '[class._android]': 'isAndroid',
- '[class._reduced-motion]': 'reducedMotion',
- // Required for the :active state to work in Safari. https://stackoverflow.com/a/33681490
- '(touchstart.passive.silent)': '0',
- '[$.class._mobile]': 'isMobileRes$',
- '($.class._mobile)': 'isMobileRes$'
- }
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_REDUCED_MOTION]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_ANIMATIONS_DURATION]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_DIALOGS]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_MOBILE]
- }]
- }, {
- type: _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_7__.TuiBreakpointService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_7__.TuiBreakpointService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_IOS]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TUI_IS_ANDROID]
- }]
- }, {
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_8__.DOCUMENT]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_THEME]
- }]
- }];
- }, null);
-})();
-class TuiRootModule {}
-TuiRootModule.ɵfac = function TuiRootModule_Factory(t) {
- return new (t || TuiRootModule)();
-};
-TuiRootModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiRootModule
-});
-TuiRootModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_8__.CommonModule, _tinkoff_ng_event_plugins__WEBPACK_IMPORTED_MODULE_16__.EventPluginsModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiDropdownHostModule, _taiga_ui_core_internal_svg_defs_host__WEBPACK_IMPORTED_MODULE_10__.TuiSvgDefsHostModule, _taiga_ui_core_components_hints_host__WEBPACK_IMPORTED_MODULE_14__.TuiHintsHostModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_12__.TuiDialogHostModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__.TuiAlertHostModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__.TuiScrollControlsModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiRootModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_8__.CommonModule, _tinkoff_ng_event_plugins__WEBPACK_IMPORTED_MODULE_16__.EventPluginsModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiDropdownHostModule, _taiga_ui_core_internal_svg_defs_host__WEBPACK_IMPORTED_MODULE_10__.TuiSvgDefsHostModule, _taiga_ui_core_components_hints_host__WEBPACK_IMPORTED_MODULE_14__.TuiHintsHostModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_12__.TuiDialogHostModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_13__.TuiAlertHostModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__.TuiScrollControlsModule],
- declarations: [TuiRootComponent],
- exports: [TuiRootComponent]
- }]
- }], null, null);
-})();
-
+ return padNumber(result, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
+ };
+}
/**
- * Generated bundle index. Do not edit.
+ * Returns a date formatter that provides the week-numbering year for the input date.
*/
-
-
-
-/***/ }),
-
-/***/ 1938:
-/*!************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-scrollbar.js ***!
- \************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ SCROLL_REF_SELECTOR: () => (/* binding */ SCROLL_REF_SELECTOR),
-/* harmony export */ TUI_DEFAULT_SCROLLBAR_OPTIONS: () => (/* binding */ TUI_DEFAULT_SCROLLBAR_OPTIONS),
-/* harmony export */ TUI_SCROLLBAR_OPTIONS: () => (/* binding */ TUI_SCROLLBAR_OPTIONS),
-/* harmony export */ TuiScrollRefDirective: () => (/* binding */ TuiScrollRefDirective),
-/* harmony export */ TuiScrollableDirective: () => (/* binding */ TuiScrollableDirective),
-/* harmony export */ TuiScrollbarComponent: () => (/* binding */ TuiScrollbarComponent),
-/* harmony export */ TuiScrollbarModule: () => (/* binding */ TuiScrollbarModule),
-/* harmony export */ tuiScrollbarOptionsProvider: () => (/* binding */ tuiScrollbarOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 1498);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk */ 8645);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 4333);
-/* harmony import */ var _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/constants */ 6628);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-/** @deprecated import from `@taiga-ui/cdk` instead */
-function TuiScrollbarComponent_tui_scroll_controls_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-scroll-controls", 2);
- }
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-hover-mode", ctx_r0.options.mode === "hover");
- }
+function weekNumberingYearGetter(size, trim = false) {
+ return function (date, locale) {
+ const thisThurs = getThursdayThisWeek(date);
+ const weekNumberingYear = thisThurs.getFullYear();
+ return padNumber(weekNumberingYear, size, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign), trim);
+ };
}
-const _c0 = ["*"];
-const SCROLL_REF_SELECTOR = '[tuiScrollRef]';
-/** @deprecated import from `@taiga-ui/cdk` instead */
-class TuiScrollRefDirective {}
-TuiScrollRefDirective.ɵfac = function TuiScrollRefDirective_Factory(t) {
- return new (t || TuiScrollRefDirective)();
-};
-TuiScrollRefDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiScrollRefDirective,
- selectors: [["", "tuiScrollRef", ""]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.TUI_SCROLL_REF,
- useExisting: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef
- }])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiScrollRefDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: SCROLL_REF_SELECTOR,
- providers: [{
- provide: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.TUI_SCROLL_REF,
- useExisting: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef
- }]
- }]
- }], null, null);
-})();
-class TuiScrollableDirective {
- constructor(el) {
- this.el = el;
+const DATE_FORMATS = {};
+// Based on CLDR formats:
+// See complete list: http://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
+// See also explanations: http://cldr.unicode.org/translation/date-time
+// TODO(ocombe): support all missing cldr formats: U, Q, D, F, e, j, J, C, A, v, V, X, x
+function getDateFormatter(format) {
+ if (DATE_FORMATS[format]) {
+ return DATE_FORMATS[format];
}
- ngOnInit() {
- this.el.nativeElement.dispatchEvent(new CustomEvent(_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_2__.TUI_SCROLLABLE, {
- bubbles: true,
- detail: this.el.nativeElement
- }));
+ let formatter;
+ switch (format) {
+ // Era name (AD/BC)
+ case 'G':
+ case 'GG':
+ case 'GGG':
+ formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Abbreviated);
+ break;
+ case 'GGGG':
+ formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Wide);
+ break;
+ case 'GGGGG':
+ formatter = dateStrGetter(TranslationType.Eras, TranslationWidth.Narrow);
+ break;
+ // 1 digit representation of the year, e.g. (AD 1 => 1, AD 199 => 199)
+ case 'y':
+ formatter = dateGetter(DateType.FullYear, 1, 0, false, true);
+ break;
+ // 2 digit representation of the year, padded (00-99). (e.g. AD 2001 => 01, AD 2010 => 10)
+ case 'yy':
+ formatter = dateGetter(DateType.FullYear, 2, 0, true, true);
+ break;
+ // 3 digit representation of the year, padded (000-999). (e.g. AD 2001 => 01, AD 2010 => 10)
+ case 'yyy':
+ formatter = dateGetter(DateType.FullYear, 3, 0, false, true);
+ break;
+ // 4 digit representation of the year (e.g. AD 1 => 0001, AD 2010 => 2010)
+ case 'yyyy':
+ formatter = dateGetter(DateType.FullYear, 4, 0, false, true);
+ break;
+ // 1 digit representation of the week-numbering year, e.g. (AD 1 => 1, AD 199 => 199)
+ case 'Y':
+ formatter = weekNumberingYearGetter(1);
+ break;
+ // 2 digit representation of the week-numbering year, padded (00-99). (e.g. AD 2001 => 01, AD
+ // 2010 => 10)
+ case 'YY':
+ formatter = weekNumberingYearGetter(2, true);
+ break;
+ // 3 digit representation of the week-numbering year, padded (000-999). (e.g. AD 1 => 001, AD
+ // 2010 => 2010)
+ case 'YYY':
+ formatter = weekNumberingYearGetter(3);
+ break;
+ // 4 digit representation of the week-numbering year (e.g. AD 1 => 0001, AD 2010 => 2010)
+ case 'YYYY':
+ formatter = weekNumberingYearGetter(4);
+ break;
+ // Month of the year (1-12), numeric
+ case 'M':
+ case 'L':
+ formatter = dateGetter(DateType.Month, 1, 1);
+ break;
+ case 'MM':
+ case 'LL':
+ formatter = dateGetter(DateType.Month, 2, 1);
+ break;
+ // Month of the year (January, ...), string, format
+ case 'MMM':
+ formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated);
+ break;
+ case 'MMMM':
+ formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide);
+ break;
+ case 'MMMMM':
+ formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow);
+ break;
+ // Month of the year (January, ...), string, standalone
+ case 'LLL':
+ formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Abbreviated, FormStyle.Standalone);
+ break;
+ case 'LLLL':
+ formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Wide, FormStyle.Standalone);
+ break;
+ case 'LLLLL':
+ formatter = dateStrGetter(TranslationType.Months, TranslationWidth.Narrow, FormStyle.Standalone);
+ break;
+ // Week of the year (1, ... 52)
+ case 'w':
+ formatter = weekGetter(1);
+ break;
+ case 'ww':
+ formatter = weekGetter(2);
+ break;
+ // Week of the month (1, ...)
+ case 'W':
+ formatter = weekGetter(1, true);
+ break;
+ // Day of the month (1-31)
+ case 'd':
+ formatter = dateGetter(DateType.Date, 1);
+ break;
+ case 'dd':
+ formatter = dateGetter(DateType.Date, 2);
+ break;
+ // Day of the Week StandAlone (1, 1, Mon, Monday, M, Mo)
+ case 'c':
+ case 'cc':
+ formatter = dateGetter(DateType.Day, 1);
+ break;
+ case 'ccc':
+ formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated, FormStyle.Standalone);
+ break;
+ case 'cccc':
+ formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide, FormStyle.Standalone);
+ break;
+ case 'ccccc':
+ formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow, FormStyle.Standalone);
+ break;
+ case 'cccccc':
+ formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short, FormStyle.Standalone);
+ break;
+ // Day of the Week
+ case 'E':
+ case 'EE':
+ case 'EEE':
+ formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Abbreviated);
+ break;
+ case 'EEEE':
+ formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Wide);
+ break;
+ case 'EEEEE':
+ formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Narrow);
+ break;
+ case 'EEEEEE':
+ formatter = dateStrGetter(TranslationType.Days, TranslationWidth.Short);
+ break;
+ // Generic period of the day (am-pm)
+ case 'a':
+ case 'aa':
+ case 'aaa':
+ formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated);
+ break;
+ case 'aaaa':
+ formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide);
+ break;
+ case 'aaaaa':
+ formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow);
+ break;
+ // Extended period of the day (midnight, at night, ...), standalone
+ case 'b':
+ case 'bb':
+ case 'bbb':
+ formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Standalone, true);
+ break;
+ case 'bbbb':
+ formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Standalone, true);
+ break;
+ case 'bbbbb':
+ formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Standalone, true);
+ break;
+ // Extended period of the day (midnight, night, ...), standalone
+ case 'B':
+ case 'BB':
+ case 'BBB':
+ formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Abbreviated, FormStyle.Format, true);
+ break;
+ case 'BBBB':
+ formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Wide, FormStyle.Format, true);
+ break;
+ case 'BBBBB':
+ formatter = dateStrGetter(TranslationType.DayPeriods, TranslationWidth.Narrow, FormStyle.Format, true);
+ break;
+ // Hour in AM/PM, (1-12)
+ case 'h':
+ formatter = dateGetter(DateType.Hours, 1, -12);
+ break;
+ case 'hh':
+ formatter = dateGetter(DateType.Hours, 2, -12);
+ break;
+ // Hour of the day (0-23)
+ case 'H':
+ formatter = dateGetter(DateType.Hours, 1);
+ break;
+ // Hour in day, padded (00-23)
+ case 'HH':
+ formatter = dateGetter(DateType.Hours, 2);
+ break;
+ // Minute of the hour (0-59)
+ case 'm':
+ formatter = dateGetter(DateType.Minutes, 1);
+ break;
+ case 'mm':
+ formatter = dateGetter(DateType.Minutes, 2);
+ break;
+ // Second of the minute (0-59)
+ case 's':
+ formatter = dateGetter(DateType.Seconds, 1);
+ break;
+ case 'ss':
+ formatter = dateGetter(DateType.Seconds, 2);
+ break;
+ // Fractional second
+ case 'S':
+ formatter = dateGetter(DateType.FractionalSeconds, 1);
+ break;
+ case 'SS':
+ formatter = dateGetter(DateType.FractionalSeconds, 2);
+ break;
+ case 'SSS':
+ formatter = dateGetter(DateType.FractionalSeconds, 3);
+ break;
+ // Timezone ISO8601 short format (-0430)
+ case 'Z':
+ case 'ZZ':
+ case 'ZZZ':
+ formatter = timeZoneGetter(ZoneWidth.Short);
+ break;
+ // Timezone ISO8601 extended format (-04:30)
+ case 'ZZZZZ':
+ formatter = timeZoneGetter(ZoneWidth.Extended);
+ break;
+ // Timezone GMT short format (GMT+4)
+ case 'O':
+ case 'OO':
+ case 'OOO':
+ // Should be location, but fallback to format O instead because we don't have the data yet
+ case 'z':
+ case 'zz':
+ case 'zzz':
+ formatter = timeZoneGetter(ZoneWidth.ShortGMT);
+ break;
+ // Timezone GMT long format (GMT+0430)
+ case 'OOOO':
+ case 'ZZZZ':
+ // Should be location, but fallback to format O instead because we don't have the data yet
+ case 'zzzz':
+ formatter = timeZoneGetter(ZoneWidth.Long);
+ break;
+ default:
+ return null;
}
+ DATE_FORMATS[format] = formatter;
+ return formatter;
}
-TuiScrollableDirective.ɵfac = function TuiScrollableDirective_Factory(t) {
- return new (t || TuiScrollableDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef));
-};
-TuiScrollableDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiScrollableDirective,
- selectors: [["", "tuiScrollable", ""]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiScrollableDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiScrollable]'
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }];
- }, null);
-})();
-const TUI_DEFAULT_SCROLLBAR_OPTIONS = {
- mode: 'always'
-};
-const TUI_SCROLLBAR_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiCreateToken)(TUI_DEFAULT_SCROLLBAR_OPTIONS);
-function tuiScrollbarOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiProvideOptions)(TUI_SCROLLBAR_OPTIONS, options, TUI_DEFAULT_SCROLLBAR_OPTIONS);
+function timezoneToOffset(timezone, fallback) {
+ // Support: IE 11 only, Edge 13-15+
+ // IE/Edge do not "understand" colon (`:`) in timezone
+ timezone = timezone.replace(/:/g, '');
+ const requestedTimezoneOffset = Date.parse('Jan 01, 1970 00:00:00 ' + timezone) / 60000;
+ return isNaN(requestedTimezoneOffset) ? fallback : requestedTimezoneOffset;
}
-
-// TODO: Remove all legacy code in 4.0
-class TuiScrollbarComponent {
- constructor(cssRef, el, userAgent, isIos, options) {
- this.cssRef = cssRef;
- this.el = el;
- this.userAgent = userAgent;
- this.isIos = isIos;
- this.options = options;
- this.isLegacy = !this.cssRef.supports('position', 'sticky') || (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.tuiIsFirefox)(this.userAgent) && !this.cssRef.supports('scrollbar-width', 'none');
- this.hidden = false;
- this.browserScrollRef = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef(this.el.nativeElement);
- }
- get delegated() {
- return this.browserScrollRef.nativeElement !== this.el.nativeElement;
- }
- get showScrollbars() {
- return !this.hidden && !this.isIos && (!this.isLegacy || this.delegated);
- }
- get showNative() {
- return this.isLegacy && !this.hidden && !this.delegated;
+function addDateMinutes(date, minutes) {
+ date = new Date(date.getTime());
+ date.setMinutes(date.getMinutes() + minutes);
+ return date;
+}
+function convertTimezoneToLocal(date, timezone, reverse) {
+ const reverseValue = reverse ? -1 : 1;
+ const dateTimezoneOffset = date.getTimezoneOffset();
+ const timezoneOffset = timezoneToOffset(timezone, dateTimezoneOffset);
+ return addDateMinutes(date, reverseValue * (timezoneOffset - dateTimezoneOffset));
+}
+/**
+ * Converts a value to date.
+ *
+ * Supported input formats:
+ * - `Date`
+ * - number: timestamp
+ * - string: numeric (e.g. "1234"), ISO and date strings in a format supported by
+ * [Date.parse()](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Date/parse).
+ * Note: ISO strings without time return a date without timeoffset.
+ *
+ * Throws if unable to convert to a date.
+ */
+function toDate(value) {
+ if (isDate(value)) {
+ return value;
}
- onScrollable(element) {
- this.browserScrollRef.nativeElement = element;
+ if (typeof value === 'number' && !isNaN(value)) {
+ return new Date(value);
}
- scrollIntoView(detail) {
- var _a;
- if (this.delegated) {
- return;
+ if (typeof value === 'string') {
+ value = value.trim();
+ if (/^(\d{4}(-\d{1,2}(-\d{1,2})?)?)$/.test(value)) {
+ /* For ISO Strings without time the day, month and year must be extracted from the ISO String
+ before Date creation to avoid time offset and errors in the new Date.
+ If we only replace '-' with ',' in the ISO String ("2015,01,01"), and try to create a new
+ date, some browsers (e.g. IE 9) will throw an invalid Date error.
+ If we leave the '-' ("2015-01-01") and try to create a new Date("2015-01-01") the timeoffset
+ is applied.
+ Note: ISO months are 0 for January, 1 for February, ... */
+ const [y, m = 1, d = 1] = value.split('-').map(val => +val);
+ return createDate(y, m - 1, d);
+ }
+ const parsedNb = parseFloat(value);
+ // any string that only contains numbers, like "1234" but not like "1234hello"
+ if (!isNaN(value - parsedNb)) {
+ return new Date(parsedNb);
+ }
+ let match;
+ if (match = value.match(ISO8601_DATE_REGEX)) {
+ return isoStringToDate(match);
}
- const {
- nativeElement
- } = this.browserScrollRef;
- const {
- offsetTop,
- offsetLeft
- } = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiGetElementOffset)(nativeElement, detail);
- const {
- clientHeight,
- clientWidth
- } = nativeElement;
- const {
- offsetHeight,
- offsetWidth
- } = detail;
- const scrollTop = offsetTop + offsetHeight / 2 - clientHeight / 2;
- const scrollLeft = offsetLeft + offsetWidth / 2 - clientWidth / 2;
- // ?. for our clients on Windows XP and Chrome 49
- (_a = nativeElement.scrollTo) === null || _a === void 0 ? void 0 : _a.call(nativeElement, scrollLeft, scrollTop);
}
-}
-TuiScrollbarComponent.ɵfac = function TuiScrollbarComponent_Factory(t) {
- return new (t || TuiScrollbarComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_6__.CSS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_6__.USER_AGENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.TUI_IS_IOS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_SCROLLBAR_OPTIONS));
-};
-TuiScrollbarComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiScrollbarComponent,
- selectors: [["tui-scrollbar"]],
- hostVars: 2,
- hostBindings: function TuiScrollbarComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("tui-scrollable.stop", function TuiScrollbarComponent_tui_scrollable_stop_HostBindingHandler($event) {
- return ctx.onScrollable($event.detail);
- })("tui-scroll-into-view.stop", function TuiScrollbarComponent_tui_scroll_into_view_stop_HostBindingHandler($event) {
- return ctx.scrollIntoView($event.detail);
- });
+ const date = new Date(value);
+ if (!isDate(date)) {
+ throw new Error(`Unable to convert "${value}" into a date`);
+ }
+ return date;
+}
+/**
+ * Converts a date in ISO8601 to a Date.
+ * Used instead of `Date.parse` because of browser discrepancies.
+ */
+function isoStringToDate(match) {
+ const date = new Date(0);
+ let tzHour = 0;
+ let tzMin = 0;
+ // match[8] means that the string contains "Z" (UTC) or a timezone like "+01:00" or "+0100"
+ const dateSetter = match[8] ? date.setUTCFullYear : date.setFullYear;
+ const timeSetter = match[8] ? date.setUTCHours : date.setHours;
+ // if there is a timezone defined like "+01:00" or "+0100"
+ if (match[9]) {
+ tzHour = Number(match[9] + match[10]);
+ tzMin = Number(match[9] + match[11]);
+ }
+ dateSetter.call(date, Number(match[1]), Number(match[2]) - 1, Number(match[3]));
+ const h = Number(match[4] || 0) - tzHour;
+ const m = Number(match[5] || 0) - tzMin;
+ const s = Number(match[6] || 0);
+ // The ECMAScript specification (https://www.ecma-international.org/ecma-262/5.1/#sec-15.9.1.11)
+ // defines that `DateTime` milliseconds should always be rounded down, so that `999.9ms`
+ // becomes `999ms`.
+ const ms = Math.floor(parseFloat('0.' + (match[7] || 0)) * 1000);
+ timeSetter.call(date, h, m, s, ms);
+ return date;
+}
+function isDate(value) {
+ return value instanceof Date && !isNaN(value.valueOf());
+}
+const NUMBER_FORMAT_REGEXP = /^(\d+)?\.((\d+)(-(\d+))?)?$/;
+const MAX_DIGITS = 22;
+const DECIMAL_SEP = '.';
+const ZERO_CHAR = '0';
+const PATTERN_SEP = ';';
+const GROUP_SEP = ',';
+const DIGIT_CHAR = '#';
+const CURRENCY_CHAR = '¤';
+const PERCENT_CHAR = '%';
+/**
+ * Transforms a number to a locale string based on a style and a format.
+ */
+function formatNumberToLocaleString(value, pattern, locale, groupSymbol, decimalSymbol, digitsInfo, isPercent = false) {
+ let formattedText = '';
+ let isZero = false;
+ if (!isFinite(value)) {
+ formattedText = getLocaleNumberSymbol(locale, NumberSymbol.Infinity);
+ } else {
+ let parsedNumber = parseNumber(value);
+ if (isPercent) {
+ parsedNumber = toPercent(parsedNumber);
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_legacy", ctx.showNative);
+ let minInt = pattern.minInt;
+ let minFraction = pattern.minFrac;
+ let maxFraction = pattern.maxFrac;
+ if (digitsInfo) {
+ const parts = digitsInfo.match(NUMBER_FORMAT_REGEXP);
+ if (parts === null) {
+ throw new Error(`${digitsInfo} is not a valid digit info`);
+ }
+ const minIntPart = parts[1];
+ const minFractionPart = parts[3];
+ const maxFractionPart = parts[5];
+ if (minIntPart != null) {
+ minInt = parseIntAutoRadix(minIntPart);
+ }
+ if (minFractionPart != null) {
+ minFraction = parseIntAutoRadix(minFractionPart);
+ }
+ if (maxFractionPart != null) {
+ maxFraction = parseIntAutoRadix(maxFractionPart);
+ } else if (minFractionPart != null && minFraction > maxFraction) {
+ maxFraction = minFraction;
+ }
}
- },
- inputs: {
- hidden: "hidden"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.TUI_SCROLL_REF,
- deps: [TuiScrollbarComponent],
- useFactory: ({
- browserScrollRef
- }) => browserScrollRef
- }])],
- ngContentSelectors: _c0,
- decls: 3,
- vars: 3,
- consts: [["class", "t-bars", 3, "t-hover-mode", 4, "ngIf"], [1, "t-content"], [1, "t-bars"]],
- template: function TuiScrollbarComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiScrollbarComponent_tui_scroll_controls_0_Template, 1, 2, "tui-scroll-controls", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](1, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+ roundNumber(parsedNumber, minFraction, maxFraction);
+ let digits = parsedNumber.digits;
+ let integerLen = parsedNumber.integerLen;
+ const exponent = parsedNumber.exponent;
+ let decimals = [];
+ isZero = digits.every(d => !d);
+ // pad zeros for small numbers
+ for (; integerLen < minInt; integerLen++) {
+ digits.unshift(0);
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.showScrollbars);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-content_delegated", ctx.delegated);
+ // pad zeros for small numbers
+ for (; integerLen < 0; integerLen++) {
+ digits.unshift(0);
+ }
+ // extract decimals digits
+ if (integerLen > 0) {
+ decimals = digits.splice(integerLen, digits.length);
+ } else {
+ decimals = digits;
+ digits = [0];
+ }
+ // format the integer digits with grouping separators
+ const groups = [];
+ if (digits.length >= pattern.lgSize) {
+ groups.unshift(digits.splice(-pattern.lgSize, digits.length).join(''));
+ }
+ while (digits.length > pattern.gSize) {
+ groups.unshift(digits.splice(-pattern.gSize, digits.length).join(''));
+ }
+ if (digits.length) {
+ groups.unshift(digits.join(''));
+ }
+ formattedText = groups.join(getLocaleNumberSymbol(locale, groupSymbol));
+ // append the decimal digits
+ if (decimals.length) {
+ formattedText += getLocaleNumberSymbol(locale, decimalSymbol) + decimals.join('');
+ }
+ if (exponent) {
+ formattedText += getLocaleNumberSymbol(locale, NumberSymbol.Exponential) + '+' + exponent;
}
- },
- dependencies: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiScrollControlsComponent, _angular_common__WEBPACK_IMPORTED_MODULE_8__.NgIf],
- styles: ["[_nghost-%COMP%]{position:relative;display:flex;isolation:isolate;overflow:auto}[_nghost-%COMP%]:not(._legacy){scrollbar-width:none;-ms-overflow-style:none}[_nghost-%COMP%]:not(._legacy)::-webkit-scrollbar, [_nghost-%COMP%]:not(._legacy)::-webkit-scrollbar-thumb{background:transparent;width:0;height:0}._legacy[_nghost-%COMP%]{overflow:overlay}@media all and (-webkit-min-device-pixel-ratio: 0) and (min-resolution: .001dpcm){._legacy[_nghost-%COMP%]::-webkit-scrollbar, ._legacy[_nghost-%COMP%]::-webkit-scrollbar-thumb{width:1rem;height:1rem;border-radius:6.25rem;background-clip:padding-box;border:.375rem solid transparent}._legacy[_nghost-%COMP%]::-webkit-scrollbar{background-color:transparent}._legacy[_nghost-%COMP%]::-webkit-scrollbar-thumb{background-color:var(--tui-clear-hover)}._legacy[_nghost-%COMP%]::-webkit-scrollbar-thumb:hover{background-color:var(--tui-clear-active)}._legacy[_nghost-%COMP%]::-webkit-scrollbar-thumb:active{background-color:var(--tui-text-03)}}[_nghost-%COMP%] .t-hover-mode[_ngcontent-%COMP%]:not(:active){transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:0}[_nghost-%COMP%]:hover .t-hover-mode[_ngcontent-%COMP%]{transition-property:opacity;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;opacity:1}.t-content[_ngcontent-%COMP%]{isolation:isolate;flex:1;flex-basis:auto;width:100%;height:-webkit-max-content;height:max-content}.t-content_delegated[_ngcontent-%COMP%]{height:100%}.t-bars[_ngcontent-%COMP%]{color:var(--tui-text-01)}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiScrollbarComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-scrollbar',
- templateUrl: './scrollbar.template.html',
- styleUrls: ['./scrollbar.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [{
- provide: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.TUI_SCROLL_REF,
- deps: [TuiScrollbarComponent],
- useFactory: ({
- browserScrollRef
- }) => browserScrollRef
- }]
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_6__.CSS]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_6__.USER_AGENT]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.TUI_IS_IOS]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_SCROLLBAR_OPTIONS]
- }]
- }];
- }, {
- hidden: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- showNative: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._legacy']
- }],
- onScrollable: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: [`${_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_2__.TUI_SCROLLABLE}.stop`, ['$event.detail']]
- }],
- scrollIntoView: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: [`${_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_2__.TUI_SCROLL_INTO_VIEW}.stop`, ['$event.detail']]
- }]
- });
-})();
-class TuiScrollbarModule {}
-TuiScrollbarModule.ɵfac = function TuiScrollbarModule_Factory(t) {
- return new (t || TuiScrollbarModule)();
-};
-TuiScrollbarModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiScrollbarModule
-});
-TuiScrollbarModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_8__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiScrollControlsModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiScrollbarModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_8__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiScrollControlsModule],
- declarations: [TuiScrollbarComponent, TuiScrollRefDirective, TuiScrollableDirective],
- exports: [TuiScrollbarComponent, TuiScrollRefDirective, TuiScrollableDirective]
- }]
- }], null, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3442:
-/*!******************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-svg.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_DEPRECATED_ICONS: () => (/* binding */ TUI_DEPRECATED_ICONS),
-/* harmony export */ TUI_SVG_DEFAULT_OPTIONS: () => (/* binding */ TUI_SVG_DEFAULT_OPTIONS),
-/* harmony export */ TUI_SVG_OPTIONS: () => (/* binding */ TUI_SVG_OPTIONS),
-/* harmony export */ TUI_SVG_SRC_INTERCEPTORS: () => (/* binding */ TUI_SVG_SRC_INTERCEPTORS),
-/* harmony export */ TuiSvgComponent: () => (/* binding */ TuiSvgComponent),
-/* harmony export */ TuiSvgModule: () => (/* binding */ TuiSvgModule),
-/* harmony export */ tuiSvgOptionsProvider: () => (/* binding */ tuiSvgOptionsProvider),
-/* harmony export */ tuiSvgSrcInterceptors: () => (/* binding */ tuiSvgSrcInterceptors)
-/* harmony export */ });
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @angular/platform-browser */ 4199);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @taiga-ui/cdk */ 9163);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk */ 3915);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk */ 7589);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk */ 4333);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @taiga-ui/cdk */ 2515);
-/* harmony import */ var _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @taiga-ui/core/constants */ 6628);
-/* harmony import */ var _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @taiga-ui/core/services */ 1717);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var _taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/utils */ 2189);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 2337);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 1151);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ 8713);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs/operators */ 4406);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-function TuiSvgComponent_ng_container_0_div_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "div", 3);
}
- if (rf & 2) {
- const innerHTML_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]().tuiLet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("innerHTML", innerHTML_r1, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]);
+ if (value < 0 && !isZero) {
+ formattedText = pattern.negPre + formattedText + pattern.negSuf;
+ } else {
+ formattedText = pattern.posPre + formattedText + pattern.posSuf;
}
+ return formattedText;
}
-function TuiSvgComponent_ng_container_0_ng_template_2_Template(rf, ctx) {
- if (rf & 1) {
- const _r7 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnamespaceSVG"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "svg", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("error", function TuiSvgComponent_ng_container_0_ng_template_2_Template__svg_svg_error_0_listener() {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r7);
- const ctx_r6 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r6.onError());
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "use");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("href", ctx_r4.use, null, "xlink");
- }
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Formats a number as currency using locale rules.
+ *
+ * @param value The number to format.
+ * @param locale A locale code for the locale format rules to use.
+ * @param currency A string containing the currency symbol or its name,
+ * such as "$" or "Canadian Dollar". Used in output string, but does not affect the operation
+ * of the function.
+ * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217)
+ * currency code, such as `USD` for the US dollar and `EUR` for the euro.
+ * Used to determine the number of digits in the decimal part.
+ * @param digitsInfo Decimal representation options, specified by a string in the following format:
+ * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.
+ *
+ * @returns The formatted currency value.
+ *
+ * @see {@link formatNumber}
+ * @see {@link DecimalPipe}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function formatCurrency(value, locale, currency, currencyCode, digitsInfo) {
+ const format = getLocaleNumberFormat(locale, NumberFormatStyle.Currency);
+ const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
+ pattern.minFrac = getNumberOfCurrencyDigits(currencyCode);
+ pattern.maxFrac = pattern.minFrac;
+ const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.CurrencyGroup, NumberSymbol.CurrencyDecimal, digitsInfo);
+ return res.replace(CURRENCY_CHAR, currency)
+ // if we have 2 time the currency character, the second one is ignored
+ .replace(CURRENCY_CHAR, '')
+ // If there is a spacing between currency character and the value and
+ // the currency character is suppressed by passing an empty string, the
+ // spacing character would remain as part of the string. Then we
+ // should remove it.
+ .trim();
}
-function TuiSvgComponent_ng_container_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiSvgComponent_ng_container_0_div_1_Template, 1, 1, "div", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiSvgComponent_ng_container_0_ng_template_2_Template, 2, 1, "ng-template", null, 2, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplateRefExtractor"]);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const _r3 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](3);
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx_r0.isInnerHTML)("ngIfElse", _r3);
- }
-}
-const TUI_DEPRECATED_ICONS = {
- tuiIconAttach: 'tuiIconPaperclip',
- tuiIconAttention: 'tuiIconAlertCircle',
- tuiIconBackCircle: 'tuiIconArrowLeftCircle',
- tuiIconCall: 'tuiIconPhone',
- tuiIconCallIn: 'tuiIconPhoneIncoming',
- tuiIconCallOut: 'tuiIconPhoneOutgoing',
- tuiIconCallTransfer: 'tuiIconPhoneForwarded',
- tuiIconCancel: 'tuiIconXCircle',
- tuiIconCancelCircle: 'tuiIconSlash',
- tuiIconCard: 'tuiIconCreditCard',
- tuiIconCards: 'tuiIconCreditCard',
- tuiIconChartBar: 'tuiIconBarChart',
- tuiIconChart: 'tuiIconBarChart',
- tuiIconCheckList: 'tuiIconClipboard',
- tuiIconCloseCircle: 'tuiIconXCircle',
- tuiIconCollapse: 'tuiIconMinimize',
- tuiIconComment: 'tuiIconMessageSquare',
- tuiIconCommentFw: 'tuiIconMessageForward',
- tuiIconCompany: 'tuiIconBriefcase',
- tuiIconDefaultDoc: 'tuiIconFile',
- tuiIconDesktop: 'tuiIconMonitor',
- tuiIconDesktopOff: 'tuiIconMonitorOff',
- tuiIconDislike: 'tuiIconThumbsDown',
- tuiIconDone: 'tuiIconCheckCircle',
- tuiIconDraft: 'tuiIconEdit2',
- tuiIconEyeOpen: 'tuiIconEye',
- tuiIconEyeClosed: 'tuiIconEyeOff',
- tuiIconExpand: 'tuiIconMaximize',
- tuiIconExternal: 'tuiIconExternalLink',
- tuiIconFrame: 'tuiIconLayout',
- tuiIconGeo: 'tuiIconMapPin',
- tuiIconHeartFilled: 'tuiIconHeart',
- tuiIconHide: 'tuiIconEyeOff',
- tuiIconImg: 'tuiIconImage',
- tuiIconInfoCircle: 'tuiIconInfo',
- tuiIconLike: 'tuiIconThumbsUp',
- tuiIconLockOpen: 'tuiIconUnlock',
- tuiIconMobile: 'tuiIconSmartphone',
- tuiIconMoreHor: 'tuiIconMoreHorizontal',
- tuiIconMoreVer: 'tuiIconMoreVertical',
- tuiIconMoreVert: 'tuiIconMoreVertical',
- tuiIconPicture: 'tuiIconImage',
- tuiIconPin: 'tuiIconMapPin',
- tuiIconPrint: 'tuiIconPrinter',
- tuiIconRefresh: 'tuiIconRefreshCw',
- tuiIconRemove: 'tuiIconX',
- tuiIconShow: 'tuiIconEye',
- tuiIconSound: 'tuiIconVolume',
- tuiIconSoundOff: 'tuiIconVolumeX',
- tuiIconStarFilled: 'tuiIconStar',
- tuiIconStop: 'tuiIconSquare',
- tuiIconStructure: 'tuiIconGrid',
- tuiIconTime: 'tuiIconClock',
- tuiIconTooltip: 'tuiIconHelpCircle',
- tuiIconViewList: 'tuiIconList',
- tuiIconWifiOn: 'tuiIconWifi'
-};
-const TUI_SVG_DEFAULT_OPTIONS = {
- iconsPlace: _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_DEFAULT_ICONS_PLACE,
- path: (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_2__.tuiIconsPathFactory)(_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_DEFAULT_ICONS_PLACE),
- srcProcessor: rxjs__WEBPACK_IMPORTED_MODULE_3__.identity,
- contentProcessor: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.tuiSvgLinearGradientProcessor,
- deprecated: src => {
- const oldIcon = src.replace('Large', '').replace('Outline', '');
- const newIcon = TUI_DEPRECATED_ICONS[oldIcon];
- return newIcon ? `${oldIcon}/(Large|Outline) is deprecated, use ${newIcon}/(Large|Outline) instead` : '';
- }
-};
-/**
- * SVG component options
- */
-const TUI_SVG_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiCreateTokenFromFactory)(() => ({
- iconsPlace: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_ICONS_PLACE),
- path: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_ICONS_PATH),
- deprecated: TUI_SVG_DEFAULT_OPTIONS.deprecated,
- srcProcessor: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_SVG_SRC_PROCESSOR),
- contentProcessor: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_SVG_CONTENT_PROCESSOR)
-}));
-const TUI_SVG_SRC_INTERCEPTORS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('[TUI_SVG_SRC_INTERCEPTORS]');
-function tuiSvgSrcInterceptors(interceptor) {
- return {
- provide: TUI_SVG_SRC_INTERCEPTORS,
- useValue: interceptor,
- multi: true
- };
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Formats a number as a percentage according to locale rules.
+ *
+ * @param value The number to format.
+ * @param locale A locale code for the locale format rules to use.
+ * @param digitsInfo Decimal representation options, specified by a string in the following format:
+ * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.
+ *
+ * @returns The formatted percentage value.
+ *
+ * @see {@link formatNumber}
+ * @see {@link DecimalPipe}
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ * @publicApi
+ *
+ */
+function formatPercent(value, locale, digitsInfo) {
+ const format = getLocaleNumberFormat(locale, NumberFormatStyle.Percent);
+ const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
+ const res = formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo, true);
+ return res.replace(new RegExp(PERCENT_CHAR, 'g'), getLocaleNumberSymbol(locale, NumberSymbol.PercentSign));
}
-const tuiSvgOptionsProvider = options => ({
- provide: TUI_SVG_OPTIONS,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), TUI_SVG_OPTIONS], [new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_ICONS_PLACE], [new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_ICONS_PATH], [new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_SVG_SRC_PROCESSOR], [new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_SVG_CONTENT_PROCESSOR]],
- useFactory: (fallback, iconsPlace, path, srcProcessor, contentProcessor) => {
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
- return {
- iconsPlace: (_c = (_b = (_a = options.iconsPlace) !== null && _a !== void 0 ? _a : fallback === null || fallback === void 0 ? void 0 : fallback.iconsPlace) !== null && _b !== void 0 ? _b : iconsPlace) !== null && _c !== void 0 ? _c : TUI_SVG_DEFAULT_OPTIONS.iconsPlace,
- path: (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiIsString)(options.path) ? (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_2__.tuiIconsPathFactory)(options.path) : (_f = (_e = (_d = options.path) !== null && _d !== void 0 ? _d : fallback === null || fallback === void 0 ? void 0 : fallback.path) !== null && _e !== void 0 ? _e : path) !== null && _f !== void 0 ? _f : TUI_SVG_DEFAULT_OPTIONS.path,
- deprecated: (_h = (_g = options.deprecated) !== null && _g !== void 0 ? _g : fallback === null || fallback === void 0 ? void 0 : fallback.deprecated) !== null && _h !== void 0 ? _h : TUI_SVG_DEFAULT_OPTIONS.deprecated,
- srcProcessor: (_l = (_k = (_j = options.srcProcessor) !== null && _j !== void 0 ? _j : fallback === null || fallback === void 0 ? void 0 : fallback.srcProcessor) !== null && _k !== void 0 ? _k : srcProcessor) !== null && _l !== void 0 ? _l : TUI_SVG_DEFAULT_OPTIONS.srcProcessor,
- contentProcessor: (_p = (_o = (_m = options.contentProcessor) !== null && _m !== void 0 ? _m : fallback === null || fallback === void 0 ? void 0 : fallback.contentProcessor) !== null && _o !== void 0 ? _o : contentProcessor) !== null && _p !== void 0 ? _p : TUI_SVG_DEFAULT_OPTIONS.contentProcessor
- };
- }
-});
-const UNDEFINED_NAMED_ICON = 'Attempted to use undefined named icon';
-const MISSING_EXTERNAL_ICON = 'External icon is missing on the given URL';
-const FAILED_EXTERNAL_ICON = 'Failed to load external SVG';
-// TODO: Consider moving to CDK along with SvgService and SvgDefsHostComponent
-class TuiSvgComponent {
- constructor(doc, win, options, srcInterceptors, tuiSanitizer, svgService, staticRequestService, sanitizer, el, baseHref) {
- this.doc = doc;
- this.win = win;
- this.options = options;
- this.srcInterceptors = srcInterceptors;
- this.tuiSanitizer = tuiSanitizer;
- this.svgService = svgService;
- this.staticRequestService = staticRequestService;
- this.sanitizer = sanitizer;
- this.el = el;
- this.baseHref = baseHref;
- this.src$ = new rxjs__WEBPACK_IMPORTED_MODULE_6__.ReplaySubject(1);
- this.icon = '';
- this.innerHTML$ = this.src$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.switchMap)(() => {
- if ((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiIsString)(this.icon)) {
- return this.isExternal ? this.getExternalIcon(this.icon) : (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.of)(this.getSafeHtml(this.icon));
- }
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.of)(this.icon);
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.startWith)(''));
- }
- set src(src) {
- var _a;
- const deprecated = this.options.deprecated(String(src));
- ngDevMode && _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiAssert.assert(!deprecated, deprecated);
- this.icon = ((_a = this.srcInterceptors) !== null && _a !== void 0 ? _a : []).reduce((newSrc, interceptor) => interceptor(newSrc, this.options), this.options.srcProcessor(src || ''));
- this.src$.next();
- }
- get src() {
- return this.icon;
- }
- get use() {
- if ((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiIsString)(this.icon)) {
- return this.icon.includes('.svg#') ? this.icon : this.resolveName(this.icon, this.options.path);
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Formats a number as text, with group sizing, separator, and other
+ * parameters based on the locale.
+ *
+ * @param value The number to format.
+ * @param locale A locale code for the locale format rules to use.
+ * @param digitsInfo Decimal representation options, specified by a string in the following format:
+ * `{minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}`. See `DecimalPipe` for more details.
+ *
+ * @returns The formatted text string.
+ * @see [Internationalization (i18n) Guide](/guide/i18n-overview)
+ *
+ * @publicApi
+ */
+function formatNumber(value, locale, digitsInfo) {
+ const format = getLocaleNumberFormat(locale, NumberFormatStyle.Decimal);
+ const pattern = parseNumberFormat(format, getLocaleNumberSymbol(locale, NumberSymbol.MinusSign));
+ return formatNumberToLocaleString(value, pattern, locale, NumberSymbol.Group, NumberSymbol.Decimal, digitsInfo);
+}
+function parseNumberFormat(format, minusSign = '-') {
+ const p = {
+ minInt: 1,
+ minFrac: 0,
+ maxFrac: 0,
+ posPre: '',
+ posSuf: '',
+ negPre: '',
+ negSuf: '',
+ gSize: 0,
+ lgSize: 0
+ };
+ const patternParts = format.split(PATTERN_SEP);
+ const positive = patternParts[0];
+ const negative = patternParts[1];
+ const positiveParts = positive.indexOf(DECIMAL_SEP) !== -1 ? positive.split(DECIMAL_SEP) : [positive.substring(0, positive.lastIndexOf(ZERO_CHAR) + 1), positive.substring(positive.lastIndexOf(ZERO_CHAR) + 1)],
+ integer = positiveParts[0],
+ fraction = positiveParts[1] || '';
+ p.posPre = integer.substring(0, integer.indexOf(DIGIT_CHAR));
+ for (let i = 0; i < fraction.length; i++) {
+ const ch = fraction.charAt(i);
+ if (ch === ZERO_CHAR) {
+ p.minFrac = p.maxFrac = i + 1;
+ } else if (ch === DIGIT_CHAR) {
+ p.maxFrac = i + 1;
+ } else {
+ p.posSuf += ch;
}
- return '';
- }
- get isInnerHTML() {
- return !(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiIsString)(this.icon) || this.isSrc || this.isExternal || this.isName && this.isShadowDOM;
- }
- get isShadowDOM() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.tuiGetDocumentOrShadowRoot)(this.el.nativeElement) !== this.doc;
}
- get isUse() {
- return this.use.replace(_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_12__.TUI_CACHE_BUSTING_PAYLOAD, '').includes('.svg#');
- }
- get isExternal() {
- return this.isUrl || this.isCrossDomain;
- }
- get isUrl() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiIsString)(this.icon) && this.icon.replace(_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_12__.TUI_CACHE_BUSTING_PAYLOAD, '').endsWith('.svg');
- }
- get isSrc() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiIsString)(this.icon) && (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_2__.tuiIsPresumedHTMLString)(this.icon);
+ const groups = integer.split(GROUP_SEP);
+ p.gSize = groups[1] ? groups[1].length : 0;
+ p.lgSize = groups[2] || groups[1] ? (groups[2] || groups[1]).length : 0;
+ if (negative) {
+ const trunkLen = positive.length - p.posPre.length - p.posSuf.length,
+ pos = negative.indexOf(DIGIT_CHAR);
+ p.negPre = negative.substring(0, pos).replace(/'/g, '');
+ p.negSuf = negative.slice(pos + trunkLen).replace(/'/g, '');
+ } else {
+ p.negPre = minusSign + p.posPre;
+ p.negSuf = p.posSuf;
}
- get isName() {
- return !this.isUrl && !this.isUse && !this.isSrc;
+ return p;
+}
+// Transforms a parsed number into a percentage by multiplying it by 100
+function toPercent(parsedNumber) {
+ // if the number is 0, don't do anything
+ if (parsedNumber.digits[0] === 0) {
+ return parsedNumber;
}
- get isCrossDomain() {
- const {
- use,
- isUse,
- win
- } = this;
- return isUse && use.startsWith('http') && !!win.origin && !use.startsWith(win.origin);
+ // Getting the current number of decimals
+ const fractionLen = parsedNumber.digits.length - parsedNumber.integerLen;
+ if (parsedNumber.exponent) {
+ parsedNumber.exponent += 2;
+ } else {
+ if (fractionLen === 0) {
+ parsedNumber.digits.push(0, 0);
+ } else if (fractionLen === 1) {
+ parsedNumber.digits.push(0);
+ }
+ parsedNumber.integerLen += 2;
}
- onError(message = MISSING_EXTERNAL_ICON) {
- const {
- icon
- } = this;
- const event = new CustomEvent(_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_12__.TUI_ICON_ERROR, {
- bubbles: true,
- detail: {
- message,
- icon: icon
- }
- });
- ngDevMode && _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiAssert.assert(false, message, icon);
- this.el.nativeElement.dispatchEvent(event);
+ return parsedNumber;
+}
+/**
+ * Parses a number.
+ * Significant bits of this parse algorithm came from https://github.com/MikeMcl/big.js/
+ */
+function parseNumber(num) {
+ let numStr = Math.abs(num) + '';
+ let exponent = 0,
+ digits,
+ integerLen;
+ let i, j, zeros;
+ // Decimal point?
+ if ((integerLen = numStr.indexOf(DECIMAL_SEP)) > -1) {
+ numStr = numStr.replace(DECIMAL_SEP, '');
}
- resolveName(name, iconsPath) {
- return iconsPath(name, this.baseHref);
+ // Exponential form?
+ if ((i = numStr.search(/e/i)) > 0) {
+ // Work out the exponent.
+ if (integerLen < 0) integerLen = i;
+ integerLen += +numStr.slice(i + 1);
+ numStr = numStr.substring(0, i);
+ } else if (integerLen < 0) {
+ // There was no decimal point or exponent so it is an integer.
+ integerLen = numStr.length;
}
- getSafeHtml(src) {
- return this.isSrc ? this.sanitize(src) : this.process(src);
+ // Count the number of leading zeros.
+ for (i = 0; numStr.charAt(i) === ZERO_CHAR; i++) {/* empty */
}
- process(src) {
- const icon = this.svgService.getOriginal(src);
- if (this.isName && !icon && !!src) {
- this.onError(UNDEFINED_NAMED_ICON);
+ if (i === (zeros = numStr.length)) {
+ // The digits are all zero.
+ digits = [0];
+ integerLen = 1;
+ } else {
+ // Count the number of trailing zeros
+ zeros--;
+ while (numStr.charAt(zeros) === ZERO_CHAR) zeros--;
+ // Trailing zeros are insignificant so ignore them
+ integerLen -= i;
+ digits = [];
+ // Convert string to array of digits without leading/trailing zeros.
+ for (j = 0; i <= zeros; i++, j++) {
+ digits[j] = Number(numStr.charAt(i));
}
- // Empty line for innerHTML when icon is shown through USE tag
- return !this.isShadowDOM || !this.isName ? '' : this.sanitize(icon || '');
}
- sanitize(src) {
- src = this.options.contentProcessor(src);
- return this.tuiSanitizer && (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiIsString)(src) ? this.sanitizer.bypassSecurityTrustHtml(this.tuiSanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_0__.SecurityContext.HTML, src) || '') : src;
- }
- getExternalIcon(src) {
- const url = src.includes('.svg') ? src : this.use;
- return this.staticRequestService.request(url).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.catchError)(() => {
- this.onError(FAILED_EXTERNAL_ICON);
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.of)('');
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.map)(response => this.sanitize(response.replace(' MAX_DIGITS) {
+ digits = digits.splice(0, MAX_DIGITS - 1);
+ exponent = integerLen - 1;
+ integerLen = 1;
}
+ return {
+ digits,
+ exponent,
+ integerLen
+ };
}
-TuiSvgComponent.ɵfac = function TuiSvgComponent_Factory(t) {
- return new (t || TuiSvgComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_15__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_16__.WINDOW), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_SVG_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_SVG_SRC_INTERCEPTORS, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_SANITIZER, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_17__.TuiSvgService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiStaticRequestService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_platform_browser__WEBPACK_IMPORTED_MODULE_19__.DomSanitizer), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.TUI_BASE_HREF));
-};
-TuiSvgComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiSvgComponent,
- selectors: [["tui-svg"]],
- inputs: {
- src: "src"
- },
- decls: 2,
- vars: 3,
- consts: [[4, "tuiLet"], ["class", "t-src", 3, "innerHTML", 4, "ngIf", "ngIfElse"], ["useTemplate", ""], [1, "t-src", 3, "innerHTML"], ["focusable", "false", "height", "100%", "version", "1.1", "width", "100%", 0, "xmlns", "xlink", "http://www.w3.org/1999/xlink", "xmlns", "http://www.w3.org/2000/svg", 1, "t-svg", 3, "error"]],
- template: function TuiSvgComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiSvgComponent_ng_container_0_Template, 4, 2, "ng-container", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](1, "async");
+/**
+ * Round the parsed number to the specified number of decimal places
+ * This function changes the parsedNumber in-place
+ */
+function roundNumber(parsedNumber, minFrac, maxFrac) {
+ if (minFrac > maxFrac) {
+ throw new Error(`The minimum number of digits after fraction (${minFrac}) is higher than the maximum (${maxFrac}).`);
+ }
+ let digits = parsedNumber.digits;
+ let fractionLen = digits.length - parsedNumber.integerLen;
+ const fractionSize = Math.min(Math.max(minFrac, fractionLen), maxFrac);
+ // The index of the digit to where rounding is to occur
+ let roundAt = fractionSize + parsedNumber.integerLen;
+ let digit = digits[roundAt];
+ if (roundAt > 0) {
+ // Drop fractional digits beyond `roundAt`
+ digits.splice(Math.max(parsedNumber.integerLen, roundAt));
+ // Set non-fractional digits beyond `roundAt` to 0
+ for (let j = roundAt; j < digits.length; j++) {
+ digits[j] = 0;
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("tuiLet", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](1, 1, ctx.innerHTML$));
+ } else {
+ // We rounded to zero so reset the parsedNumber
+ fractionLen = Math.max(0, fractionLen);
+ parsedNumber.integerLen = 1;
+ digits.length = Math.max(1, roundAt = fractionSize + 1);
+ digits[0] = 0;
+ for (let i = 1; i < roundAt; i++) digits[i] = 0;
+ }
+ if (digit >= 5) {
+ if (roundAt - 1 < 0) {
+ for (let k = 0; k > roundAt; k--) {
+ digits.unshift(0);
+ parsedNumber.integerLen++;
+ }
+ digits.unshift(1);
+ parsedNumber.integerLen++;
+ } else {
+ digits[roundAt - 1]++;
+ }
+ }
+ // Pad out with zeros to get the required fraction length
+ for (; fractionLen < Math.max(0, fractionSize); fractionLen++) digits.push(0);
+ let dropTrailingZeros = fractionSize !== 0;
+ // Minimal length = nb of decimals required + current nb of integers
+ // Any number besides that is optional and can be removed if it's a trailing 0
+ const minLen = minFrac + parsedNumber.integerLen;
+ // Do any carrying, e.g. a digit was rounded up to 10
+ const carry = digits.reduceRight(function (carry, d, i, digits) {
+ d = d + carry;
+ digits[i] = d < 10 ? d : d - 10; // d % 10
+ if (dropTrailingZeros) {
+ // Do not keep meaningless fractional trailing zeros (e.g. 15.52000 --> 15.52)
+ if (digits[i] === 0 && i >= minLen) {
+ digits.pop();
+ } else {
+ dropTrailingZeros = false;
+ }
+ }
+ return d >= 10 ? 1 : 0; // Math.floor(d / 10);
+ }, 0);
+ if (carry) {
+ digits.unshift(carry);
+ parsedNumber.integerLen++;
+ }
+}
+function parseIntAutoRadix(text) {
+ const result = parseInt(text);
+ if (isNaN(result)) {
+ throw new Error('Invalid integer literal when parsing ' + text);
+ }
+ return result;
+}
+
+/**
+ * @publicApi
+ */
+class NgLocalization {}
+_NgLocalization = NgLocalization;
+_NgLocalization.ɵfac = function _NgLocalization_Factory(t) {
+ return new (t || _NgLocalization)();
+};
+_NgLocalization.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _NgLocalization,
+ factory: function _NgLocalization_Factory(t) {
+ let r = null;
+ if (t) {
+ r = new t();
+ } else {
+ r = (locale => new NgLocaleLocalization(locale))(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID));
}
+ return r;
},
- dependencies: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiLetDirective, _angular_common__WEBPACK_IMPORTED_MODULE_15__.NgIf, _angular_common__WEBPACK_IMPORTED_MODULE_15__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{display:inline-flex;vertical-align:middle;flex-shrink:0;align-items:center;justify-content:center;line-height:0;height:1.5rem;width:1.5rem;fill:transparent;stroke:transparent;font-size:1rem}.t-src[_ngcontent-%COMP%]{display:flex;width:100%;height:100%;align-items:center;justify-content:center}.t-svg[_ngcontent-%COMP%]{overflow:visible}"],
- changeDetection: 0
+ providedIn: 'root'
});
-(0,tslib__WEBPACK_IMPORTED_MODULE_22__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_23__.tuiPure], TuiSvgComponent.prototype, "resolveName", null);
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiSvgComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgLocalization, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
args: [{
- selector: 'tui-svg',
- templateUrl: './svg.template.html',
- styleUrls: ['./svg.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush
+ providedIn: 'root',
+ useFactory: locale => new NgLocaleLocalization(locale),
+ deps: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID]
}]
+ }], null, null);
+})();
+/**
+ * Returns the plural category for a given value.
+ * - "=value" when the case exists,
+ * - the plural category otherwise
+ */
+function getPluralCategory(value, cases, ngLocalization, locale) {
+ let key = `=${value}`;
+ if (cases.indexOf(key) > -1) {
+ return key;
+ }
+ key = ngLocalization.getPluralCategory(value, locale);
+ if (cases.indexOf(key) > -1) {
+ return key;
+ }
+ if (cases.indexOf('other') > -1) {
+ return 'other';
+ }
+ throw new Error(`No plural message found for value "${value}"`);
+}
+/**
+ * Returns the plural case based on the locale
+ *
+ * @publicApi
+ */
+class NgLocaleLocalization extends NgLocalization {
+ constructor(locale) {
+ super();
+ this.locale = locale;
+ }
+ getPluralCategory(value, locale) {
+ const plural = getLocalePluralCase(locale || this.locale)(value);
+ switch (plural) {
+ case Plural.Zero:
+ return 'zero';
+ case Plural.One:
+ return 'one';
+ case Plural.Two:
+ return 'two';
+ case Plural.Few:
+ return 'few';
+ case Plural.Many:
+ return 'many';
+ default:
+ return 'other';
+ }
+ }
+}
+_NgLocaleLocalization = NgLocaleLocalization;
+_NgLocaleLocalization.ɵfac = function _NgLocaleLocalization_Factory(t) {
+ return new (t || _NgLocaleLocalization)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID));
+};
+_NgLocaleLocalization.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _NgLocaleLocalization,
+ factory: _NgLocaleLocalization.ɵfac
+});
+(function () {
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgLocaleLocalization, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable
}], function () {
return [{
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_15__.DOCUMENT]
- }]
- }, {
- type: Window,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_16__.WINDOW]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_SVG_OPTIONS]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_SVG_SRC_INTERCEPTORS]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Sanitizer,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_SANITIZER]
- }]
- }, {
- type: _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_17__.TuiSvgService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_17__.TuiSvgService]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiStaticRequestService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiStaticRequestService]
- }]
- }, {
- type: _angular_platform_browser__WEBPACK_IMPORTED_MODULE_19__.DomSanitizer,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_19__.DomSanitizer]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
type: undefined,
decorators: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.TUI_BASE_HREF]
+ args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID]
}]
}];
- }, {
- src: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- resolveName: []
- });
-})();
-class TuiSvgModule {}
-TuiSvgModule.ɵfac = function TuiSvgModule_Factory(t) {
- return new (t || TuiSvgModule)();
-};
-TuiSvgModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiSvgModule
-});
-TuiSvgModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_15__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiLetModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiSvgModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_15__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.TuiLetModule],
- declarations: [TuiSvgComponent],
- exports: [TuiSvgComponent]
- }]
- }], null, null);
+ }, null);
})();
/**
- * Generated bundle index. Do not edit.
+ * Register global data to be used internally by Angular. See the
+ * ["I18n guide"](guide/i18n-common-format-data-locale) to know how to import additional locale
+ * data.
+ *
+ * The signature registerLocaleData(data: any, extraData?: any) is deprecated since v5.1
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 9626:
-/*!**************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-theme-night.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiThemeNightComponent: () => (/* binding */ TuiThemeNightComponent),
-/* harmony export */ TuiThemeNightModule: () => (/* binding */ TuiThemeNightModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-
-
-
-class TuiThemeNightComponent extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiThemeSwitcher {}
-TuiThemeNightComponent.ɵfac = /* @__PURE__ */function () {
- let ɵTuiThemeNightComponent_BaseFactory;
- return function TuiThemeNightComponent_Factory(t) {
- return (ɵTuiThemeNightComponent_BaseFactory || (ɵTuiThemeNightComponent_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetInheritedFactory"](TuiThemeNightComponent)))(t || TuiThemeNightComponent);
- };
-}();
-TuiThemeNightComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({
- type: TuiThemeNightComponent,
- selectors: [["tui-theme-night"]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]],
- decls: 0,
- vars: 0,
- template: function TuiThemeNightComponent_Template(rf, ctx) {},
- styles: [":root{--tui-base-01: #222;--tui-base-02: #333;--tui-base-03: #808080;--tui-base-04: #959595;--tui-base-05: #b0b0b0;--tui-base-06: #d7d7d7;--tui-base-07: #ededed;--tui-base-08: #f6f6f6;--tui-base-09: #fff;--tui-focus: rgba(51, 51, 51, .64);--tui-secondary: rgba(255, 255, 255, .16);--tui-secondary-hover: rgba(255, 255, 255, .24);--tui-secondary-active: rgba(255, 255, 255, .4);--tui-clear: rgba(255, 255, 255, .16);--tui-clear-disabled: rgba(255, 255, 255, .08);--tui-clear-hover: rgba(255, 255, 255, .24);--tui-clear-active: rgba(255, 255, 255, .4);--tui-error-fill: #ff8c67;--tui-error-bg: rgba(244, 87, 37, .32);--tui-error-bg-hover: rgba(244, 87, 37, .4);--tui-success-fill: #4ac99b;--tui-success-bg: rgba(74, 201, 155, .32);--tui-success-bg-hover: rgba(74, 201, 155, .4);--tui-warning-fill: #ffc700;--tui-warning-bg: rgba(255, 199, 0, .32);--tui-warning-bg-hover: rgba(255, 199, 0, .4);--tui-info-fill: #70b6f6;--tui-info-bg: rgba(112, 182, 246, .32);--tui-info-bg-hover: rgba(112, 182, 246, .4);--tui-neutral-fill: #959ba4;--tui-neutral-bg: rgba(149, 155, 164, .32);--tui-neutral-bg-hover: rgba(149, 155, 164, .48);--tui-text-01: #ffffff;--tui-text-02: rgba(255, 255, 255, .72);--tui-text-03: rgba(255, 255, 255, .6);--tui-link: #6788ff;--tui-link-hover: #526ed3;--tui-positive: #44c596;--tui-positive-hover: #3aa981;--tui-negative: #ff8c67;--tui-negative-hover: #bb593a;--tui-autofill: var(--tui-autofill-night);--tui-elevation-01: #222;--tui-elevation-02: #222;--tui-shadow: 0 .25rem 1.5rem rgba(0, 0, 0, .12);--tui-shadow-hover: 0 .75rem 2.25rem rgba(0, 0, 0, .2);--tui-shadow-dropdown: 0 1.5rem 1rem rgba(0, 0, 0, .03), 0 .75rem .75rem rgba(0, 0, 0, .04), 0 .25rem .375rem rgba(0, 0, 0, .05);--tui-shadow-modal: 0 1.125rem 1.875rem rgba(0, 0, 0, .48);--tui-shadow-sidebar: .25rem 0 1.5rem rgba(0, 0, 0, .12);--tui-shadow-navigation: 0 .125rem 1rem rgba(0, 0, 0, .08);--tui-shadow-sheet: 0 -1rem 1.75rem rgba(0, 0, 0, .24)}tui-notification{--tui-base-01: #000}\n"],
- encapsulation: 2,
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiThemeNightComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Component,
- args: [{
- selector: 'tui-theme-night',
- template: '',
- styleUrls: ['./theme-night.style.less'],
- encapsulation: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewEncapsulation.None,
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectionStrategy.OnPush
- }]
- }], null, null);
-})();
-class TuiThemeNightModule {}
-TuiThemeNightModule.ɵfac = function TuiThemeNightModule_Factory(t) {
- return new (t || TuiThemeNightModule)();
-};
-TuiThemeNightModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
- type: TuiThemeNightModule
-});
-TuiThemeNightModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiThemeNightModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule,
- args: [{
- declarations: [TuiThemeNightComponent],
- exports: [TuiThemeNightComponent]
- }]
- }], null, null);
-})();
-
+function registerLocaleData(data, localeId, extraData) {
+ return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵregisterLocaleData"])(data, localeId, extraData);
+}
+function parseCookieValue(cookieStr, name) {
+ name = encodeURIComponent(name);
+ for (const cookie of cookieStr.split(';')) {
+ const eqIndex = cookie.indexOf('=');
+ const [cookieName, cookieValue] = eqIndex == -1 ? [cookie, ''] : [cookie.slice(0, eqIndex), cookie.slice(eqIndex + 1)];
+ if (cookieName.trim() === name) {
+ return decodeURIComponent(cookieValue);
+ }
+ }
+ return null;
+}
+const WS_REGEXP = /\s+/;
+const EMPTY_ARRAY = [];
/**
- * Generated bundle index. Do not edit.
+ * @ngModule CommonModule
+ *
+ * @usageNotes
+ * ```
+ * ...
+ *
+ * ...
+ *
+ * ...
+ *
+ * ...
+ *
+ * ...
+ * ```
+ *
+ * @description
+ *
+ * Adds and removes CSS classes on an HTML element.
+ *
+ * The CSS classes are updated as follows, depending on the type of the expression evaluation:
+ * - `string` - the CSS classes listed in the string (space delimited) are added,
+ * - `Array` - the CSS classes declared as Array elements are added,
+ * - `Object` - keys are CSS classes that get added when the expression given in the value
+ * evaluates to a truthy value, otherwise they are removed.
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 351:
-/*!**********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-components-tooltip.js ***!
- \**********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiTooltipComponent: () => (/* binding */ TuiTooltipComponent),
-/* harmony export */ TuiTooltipModule: () => (/* binding */ TuiTooltipModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/core/directives/hint */ 7169);
-/* harmony import */ var _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/core/providers */ 2871);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/core/components/svg */ 3442);
-/* harmony import */ var _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/core/directives/wrapper */ 8001);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ 4517);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-function TuiTooltipComponent_tui_svg_3_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 3);
+class NgClass {
+ constructor(
+ // leaving references to differs in place since flex layout is extending NgClass...
+ _iterableDiffers, _keyValueDiffers, _ngEl, _renderer) {
+ this._iterableDiffers = _iterableDiffers;
+ this._keyValueDiffers = _keyValueDiffers;
+ this._ngEl = _ngEl;
+ this._renderer = _renderer;
+ this.initialClasses = EMPTY_ARRAY;
+ this.stateMap = new Map();
}
- if (rf & 2) {
- const src_r2 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", src_r2);
+ set klass(value) {
+ this.initialClasses = value != null ? value.trim().split(WS_REGEXP) : EMPTY_ARRAY;
}
-}
-class TuiTooltipComponent extends _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintOptionsDirective {
- constructor(destroy$, mode$, options, isMobile) {
- super(options);
- this.isMobile = isMobile;
- this.mode = null;
- this.describeId = '';
- mode$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.takeUntil)(destroy$)).subscribe(mode => {
- this.mode = mode;
- });
+ set ngClass(value) {
+ this.rawClass = typeof value === 'string' ? value.trim().split(WS_REGEXP) : value;
}
- get computedAppearance() {
- return this.appearance || this.mode || '';
+ /*
+ The NgClass directive uses the custom change detection algorithm for its inputs. The custom
+ algorithm is necessary since inputs are represented as complex object or arrays that need to be
+ deeply-compared.
+ This algorithm is perf-sensitive since NgClass is used very frequently and its poor performance
+ might negatively impact runtime performance of the entire change detection cycle. The design of
+ this algorithm is making sure that:
+ - there is no unnecessary DOM manipulation (CSS classes are added / removed from the DOM only when
+ needed), even if references to bound objects change;
+ - there is no memory allocation if nothing changes (even relatively modest memory allocation
+ during the change detection cycle can result in GC pauses for some of the CD cycles).
+ The algorithm works by iterating over the set of bound classes, staring with [class] binding and
+ then going over [ngClass] binding. For each CSS class name:
+ - check if it was seen before (this information is tracked in the state map) and if its value
+ changed;
+ - mark it as "touched" - names that are not marked are not present in the latest set of binding
+ and we can remove such class name from the internal data structures;
+ After iteration over all the CSS class names we've got data structure with all the information
+ necessary to synchronize changes to the DOM - it is enough to iterate over the state map, flush
+ changes to the DOM and reset internal data structures so those are ready for the next change
+ detection cycle.
+ */
+ ngDoCheck() {
+ // classes from the [class] binding
+ for (const klass of this.initialClasses) {
+ this._updateState(klass, true);
+ }
+ // classes from the [ngClass] binding
+ const rawClass = this.rawClass;
+ if (Array.isArray(rawClass) || rawClass instanceof Set) {
+ for (const klass of rawClass) {
+ this._updateState(klass, true);
+ }
+ } else if (rawClass != null) {
+ for (const klass of Object.keys(rawClass)) {
+ this._updateState(klass, Boolean(rawClass[klass]));
+ }
+ }
+ this._applyStateDiff();
}
- stopOnMobile(event) {
- var _a;
- if (this.isMobile) {
- event.preventDefault();
- event.stopPropagation();
+ _updateState(klass, nextEnabled) {
+ const state = this.stateMap.get(klass);
+ if (state !== undefined) {
+ if (state.enabled !== nextEnabled) {
+ state.changed = true;
+ state.enabled = nextEnabled;
+ }
+ state.touched = true;
+ } else {
+ this.stateMap.set(klass, {
+ enabled: nextEnabled,
+ changed: true,
+ touched: true
+ });
}
- (_a = this.driver$) === null || _a === void 0 ? void 0 : _a.toggle();
}
-}
-TuiTooltipComponent.ɵfac = function TuiTooltipComponent_Factory(t) {
- return new (t || TuiTooltipComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_4__.TUI_MODE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TUI_HINT_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.TUI_IS_MOBILE));
-};
-TuiTooltipComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiTooltipComponent,
- selectors: [["tui-tooltip"]],
- viewQuery: function TuiTooltipComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintHoverDirective, 5);
+ _applyStateDiff() {
+ for (const stateEntry of this.stateMap) {
+ const klass = stateEntry[0];
+ const state = stateEntry[1];
+ if (state.changed) {
+ this._toggleClass(klass, state.enabled);
+ state.changed = false;
+ } else if (!state.touched) {
+ // A class that was previously active got removed from the new collection of classes -
+ // remove from the DOM as well.
+ if (state.enabled) {
+ this._toggleClass(klass, false);
+ }
+ this.stateMap.delete(klass);
+ }
+ state.touched = false;
}
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.driver$ = _t.first);
+ }
+ _toggleClass(klass, enabled) {
+ if (ngDevMode) {
+ if (typeof klass !== 'string') {
+ throw new Error(`NgClass can only toggle CSS classes expressed as strings, got ${(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(klass)}`);
+ }
}
- },
- hostVars: 1,
- hostBindings: function TuiTooltipComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("mousedown", function TuiTooltipComponent_mousedown_HostBindingHandler($event) {
- return ctx.stopOnMobile($event);
+ klass = klass.trim();
+ if (klass.length > 0) {
+ klass.split(WS_REGEXP).forEach(klass => {
+ if (enabled) {
+ this._renderer.addClass(this._ngEl.nativeElement, klass);
+ } else {
+ this._renderer.removeClass(this._ngEl.nativeElement, klass);
+ }
});
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-appearance", ctx.computedAppearance);
- }
- },
+ }
+}
+_NgClass = NgClass;
+_NgClass.ɵfac = function _NgClass_Factory(t) {
+ return new (t || _NgClass)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2));
+};
+_NgClass.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgClass,
+ selectors: [["", "ngClass", ""]],
inputs: {
- content: "content",
- direction: "direction",
- appearance: "appearance",
- showDelay: "showDelay",
- hideDelay: "hideDelay",
- describeId: "describeId",
- context: "context"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService, _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_6__.MODE_PROVIDER]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]],
- decls: 4,
- vars: 11,
- consts: [["appearance", "icon", "automation-id", "tui-tooltip__icon", "tuiWrapper", "", 1, "t-tooltip-icon", 3, "hover", "tuiHint", "tuiHintAppearance", "tuiHintContext", "tuiHintDescribe", "tuiHintDirection", "tuiHintHideDelay", "tuiHintShowDelay"], ["driver", "tuiHintHover"], [3, "src", 4, "polymorpheusOutlet"], [3, "src"]],
- template: function TuiTooltipComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "span", 0, 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](2, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](3, TuiTooltipComponent_tui_svg_3_Template, 1, 1, "tui-svg", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const _r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("hover", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](2, 9, _r0) || null)("tuiHint", ctx.content)("tuiHintAppearance", ctx.computedAppearance)("tuiHintContext", ctx.context)("tuiHintDescribe", ctx.describeId)("tuiHintDirection", ctx.direction)("tuiHintHideDelay", ctx.hideDelay)("tuiHintShowDelay", ctx.showDelay);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx.icon);
- }
+ klass: ["class", "klass"],
+ ngClass: "ngClass"
},
- dependencies: [_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_7__.TuiSvgComponent, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_8__.TuiWrapperDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintDriverDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintHoverDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintPositionDirective, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintDescribeDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_10__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{transition-property:color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:relative;display:inline-block;width:1.5rem;height:1.5rem;vertical-align:middle;font-size:0;line-height:0;pointer-events:auto;cursor:pointer;color:var(--tui-text-01)}[data-appearance=error][_nghost-%COMP%]{color:var(--tui-error-fill)}.t-tooltip-icon[_ngcontent-%COMP%]{display:inline-block;width:100%;height:100%;color:inherit}[tuiWrapper][data-appearance=\"textfield\"][data-state=\"disabled\"][_nghost-%COMP%] .t-tooltip-icon[_ngcontent-%COMP%], [tuiWrapper][data-appearance=\"textfield\"][data-state=\"disabled\"] [_nghost-%COMP%] .t-tooltip-icon[_ngcontent-%COMP%]{opacity:1}"],
- changeDetection: 0
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiTooltipComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgClass, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: 'tui-tooltip',
- templateUrl: './tooltip.template.html',
- styleUrls: ['./tooltip.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService, _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_6__.MODE_PROVIDER],
- inputs: ['content', 'direction', 'appearance', 'showDelay', 'hideDelay']
+ selector: '[ngClass]',
+ standalone: true
}]
}], function () {
return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_11__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers
}, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_11__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_4__.TUI_MODE]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers
}, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TUI_HINT_OPTIONS]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef
}, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.TUI_IS_MOBILE]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2
}];
}, {
- driver$: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChild,
- args: [_taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintHoverDirective]
- }],
- describeId: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- context: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- computedAppearance: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-appearance']
+ klass: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: ['class']
}],
- stopOnMobile: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['mousedown', ['$event']]
- }]
- });
-})();
-class TuiTooltipModule {}
-TuiTooltipModule.ɵfac = function TuiTooltipModule_Factory(t) {
- return new (t || TuiTooltipModule)();
-};
-TuiTooltipModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiTooltipModule
-});
-TuiTooltipModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_10__.CommonModule, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_8__.TuiWrapperModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_7__.TuiSvgModule, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__.PolymorpheusModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiTooltipModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_10__.CommonModule, _taiga_ui_core_directives_wrapper__WEBPACK_IMPORTED_MODULE_8__.TuiWrapperModule, _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_7__.TuiSvgModule, _taiga_ui_core_directives__WEBPACK_IMPORTED_MODULE_1__.TuiHintModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_9__.PolymorpheusModule],
- declarations: [TuiTooltipComponent],
- exports: [TuiTooltipComponent]
+ ngClass: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: ['ngClass']
}]
- }], null, null);
+ });
})();
/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 6628:
-/*!*************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-constants.js ***!
- \*************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ DEFAULT_ICONS_PATH: () => (/* binding */ DEFAULT_ICONS_PATH),
-/* harmony export */ MASK_CARET_TRAP: () => (/* binding */ MASK_CARET_TRAP),
-/* harmony export */ TUI_CACHE_BUSTING_PAYLOAD: () => (/* binding */ TUI_CACHE_BUSTING_PAYLOAD),
-/* harmony export */ TUI_DECIMAL_SYMBOLS: () => (/* binding */ TUI_DECIMAL_SYMBOLS),
-/* harmony export */ TUI_DEFAULT_MARKER_HANDLER: () => (/* binding */ TUI_DEFAULT_MARKER_HANDLER),
-/* harmony export */ TUI_DEFAULT_NUMBER_FORMAT: () => (/* binding */ TUI_DEFAULT_NUMBER_FORMAT),
-/* harmony export */ TUI_DIGIT_REGEXP: () => (/* binding */ TUI_DIGIT_REGEXP),
-/* harmony export */ TUI_EXPAND_LOADED: () => (/* binding */ TUI_EXPAND_LOADED),
-/* harmony export */ TUI_HINT_DIRECTIONS: () => (/* binding */ TUI_HINT_DIRECTIONS),
-/* harmony export */ TUI_ICON_ERROR: () => (/* binding */ TUI_ICON_ERROR),
-/* harmony export */ TUI_LAST_PUNCTUATION_MARK_REGEXP: () => (/* binding */ TUI_LAST_PUNCTUATION_MARK_REGEXP),
-/* harmony export */ TUI_LATIN_AND_NUMBERS_REGEXP: () => (/* binding */ TUI_LATIN_AND_NUMBERS_REGEXP),
-/* harmony export */ TUI_LATIN_REGEXP: () => (/* binding */ TUI_LATIN_REGEXP),
-/* harmony export */ TUI_LEADING_ZEROES_REGEXP: () => (/* binding */ TUI_LEADING_ZEROES_REGEXP),
-/* harmony export */ TUI_MASK_SYMBOLS_REGEXP: () => (/* binding */ TUI_MASK_SYMBOLS_REGEXP),
-/* harmony export */ TUI_NON_DIGITS_REGEXP: () => (/* binding */ TUI_NON_DIGITS_REGEXP),
-/* harmony export */ TUI_NON_DIGIT_REGEXP: () => (/* binding */ TUI_NON_DIGIT_REGEXP),
-/* harmony export */ TUI_SCROLLABLE: () => (/* binding */ TUI_SCROLLABLE),
-/* harmony export */ TUI_SCROLL_INTO_VIEW: () => (/* binding */ TUI_SCROLL_INTO_VIEW),
-/* harmony export */ tuiEditingKeys: () => (/* binding */ tuiEditingKeys)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-
-const TUI_CACHE_BUSTING_PAYLOAD = `?v=${_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.TUI_VERSION}`;
-
-/**
- * @deprecated
- * TODO: delete in v4.0
- */
-const TUI_DECIMAL_SYMBOLS = [',', '.'];
-const DEFAULT_ICONS_PATH = name => name.includes('.svg#') ? name : `#${name}`;
-const TUI_DEFAULT_MARKER_HANDLER = () => _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.EMPTY_ARRAY;
-const TUI_DEFAULT_NUMBER_FORMAT = {
- decimalLimit: Infinity,
- decimalSeparator: ',',
- thousandSeparator: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.CHAR_NO_BREAK_SPACE,
- zeroPadding: true,
- rounding: 'truncate',
- decimal: 'not-zero'
-};
-const tuiEditingKeys = ['Spacebar', 'Backspace', 'Delete', 'ArrowLeft', 'ArrowRight', 'Left', 'Right', 'End', 'Home'];
-
-/**
- * An event indicating that async data for expand has finished loading.
- * Dispatch to finish loading states for {@link TuiExpandComponent}.
- */
-const TUI_EXPAND_LOADED = 'tui-expand-loaded';
-/**
- * An event for scrolling an element into view within {@link TuiScrollbarComponent}.
- */
-const TUI_SCROLL_INTO_VIEW = 'tui-scroll-into-view';
-/**
- * An event to notify {@link TuiScrollbarComponent} that
- * it should control a nested element.
- */
-const TUI_SCROLLABLE = 'tui-scrollable';
-/**
- * An event indicating and error during icon loading in {@link TuiSvgComponent}.
- */
-const TUI_ICON_ERROR = 'tui-icon-error';
-const TUI_HINT_DIRECTIONS = ['bottom-left', 'bottom', 'bottom-right', 'top-left', 'top', 'top-right', 'left-top', 'left', 'left-bottom', 'right-top', 'right', 'right-bottom'];
-
-/**
- * @deprecated Use {@link https://github.com/taiga-family/maskito Maskito}
- * TODO: delete in v4.0
- */
-const MASK_CARET_TRAP = '[]';
-const TUI_DIGIT_REGEXP = /\d/;
-const TUI_NON_DIGIT_REGEXP = /\D/;
-const TUI_NON_DIGITS_REGEXP = /\D+/g;
-const TUI_LEADING_ZEROES_REGEXP = /^0+/;
-const TUI_MASK_SYMBOLS_REGEXP = /[ \-_()]/g;
-const TUI_LAST_PUNCTUATION_MARK_REGEXP = /[.,\\/#!$%\\^&\\*;:{}=\\-_`~()]$/;
-const TUI_LATIN_REGEXP = /[A-z]/;
-const TUI_LATIN_AND_NUMBERS_REGEXP = /[A-z|0-9]/;
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 2577:
-/*!***********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-directives-dropdown.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_DROPDOWN_COMPONENT: () => (/* binding */ TUI_DROPDOWN_COMPONENT),
-/* harmony export */ TUI_DROPDOWN_DEFAULT_OPTIONS: () => (/* binding */ TUI_DROPDOWN_DEFAULT_OPTIONS),
-/* harmony export */ TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS: () => (/* binding */ TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS),
-/* harmony export */ TUI_DROPDOWN_HOVER_OPTIONS: () => (/* binding */ TUI_DROPDOWN_HOVER_OPTIONS),
-/* harmony export */ TUI_DROPDOWN_OPTIONS: () => (/* binding */ TUI_DROPDOWN_OPTIONS),
-/* harmony export */ TuiDropdownComponent: () => (/* binding */ TuiDropdownComponent),
-/* harmony export */ TuiDropdownContextDirective: () => (/* binding */ TuiDropdownContextDirective),
-/* harmony export */ TuiDropdownDirective: () => (/* binding */ TuiDropdownDirective),
-/* harmony export */ TuiDropdownDriverDirective: () => (/* binding */ TuiDropdownDriverDirective),
-/* harmony export */ TuiDropdownHostDirective: () => (/* binding */ TuiDropdownHostDirective),
-/* harmony export */ TuiDropdownHoverDirective: () => (/* binding */ TuiDropdownHoverDirective),
-/* harmony export */ TuiDropdownManualDirective: () => (/* binding */ TuiDropdownManualDirective),
-/* harmony export */ TuiDropdownModule: () => (/* binding */ TuiDropdownModule),
-/* harmony export */ TuiDropdownOpenDirective: () => (/* binding */ TuiDropdownOpenDirective),
-/* harmony export */ TuiDropdownOptionsDirective: () => (/* binding */ TuiDropdownOptionsDirective),
-/* harmony export */ TuiDropdownPositionDirective: () => (/* binding */ TuiDropdownPositionDirective),
-/* harmony export */ TuiDropdownPositionSidedDirective: () => (/* binding */ TuiDropdownPositionSidedDirective),
-/* harmony export */ TuiDropdownSelectionDirective: () => (/* binding */ TuiDropdownSelectionDirective),
-/* harmony export */ tuiDropdownHoverOptionsProvider: () => (/* binding */ tuiDropdownHoverOptionsProvider),
-/* harmony export */ tuiDropdownOptionsProvider: () => (/* binding */ tuiDropdownOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/cdk */ 3190);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @taiga-ui/cdk */ 625);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! @taiga-ui/cdk */ 3535);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @taiga-ui/cdk */ 293);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk */ 2515);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @taiga-ui/cdk */ 3406);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! @taiga-ui/cdk */ 4333);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/core/abstract */ 9139);
-/* harmony import */ var _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @taiga-ui/core/animations */ 6270);
-/* harmony import */ var _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @taiga-ui/core/providers */ 2871);
-/* harmony import */ var _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @taiga-ui/core/services */ 1717);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 3919);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 5171);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 1969);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 5603);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var _taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/core/utils */ 6721);
-/* harmony import */ var _taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @taiga-ui/core/utils */ 2189);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 3150);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! rxjs */ 5536);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! rxjs */ 1640);
-/* harmony import */ var _taiga_ui_core_components_scrollbar__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @taiga-ui/core/components/scrollbar */ 1938);
-/* harmony import */ var _tinkoff_ng_event_plugins__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! @tinkoff/ng-event-plugins */ 652);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/**
- * A component to display a dropdown
+ * Instantiates a {@link Component} type and inserts its Host View into the current View.
+ * `NgComponentOutlet` provides a declarative approach for dynamic component creation.
+ *
+ * `NgComponentOutlet` requires a component type, if a falsy value is set the view will clear and
+ * any existing component will be destroyed.
+ *
+ * @usageNotes
+ *
+ * ### Fine tune control
+ *
+ * You can control the component creation process by using the following optional attributes:
+ *
+ * * `ngComponentOutletInputs`: Optional component inputs object, which will be bind to the
+ * component.
+ *
+ * * `ngComponentOutletInjector`: Optional custom {@link Injector} that will be used as parent for
+ * the Component. Defaults to the injector of the current view container.
+ *
+ * * `ngComponentOutletContent`: Optional list of projectable nodes to insert into the content
+ * section of the component, if it exists.
+ *
+ * * `ngComponentOutletNgModule`: Optional NgModule class reference to allow loading another
+ * module dynamically, then loading a component from that module.
+ *
+ * * `ngComponentOutletNgModuleFactory`: Deprecated config option that allows providing optional
+ * NgModule factory to allow loading another module dynamically, then loading a component from that
+ * module. Use `ngComponentOutletNgModule` instead.
+ *
+ * ### Syntax
+ *
+ * Simple
+ * ```
+ *
+ * ```
+ *
+ * With inputs
+ * ```
+ *
+ *
+ * ```
+ *
+ * Customized injector/content
+ * ```
+ *
+ *
+ * ```
+ *
+ * Customized NgModule reference
+ * ```
+ *
+ *
+ * ```
+ *
+ * ### A simple example
+ *
+ * {@example common/ngComponentOutlet/ts/module.ts region='SimpleExample'}
+ *
+ * A more complete example with additional options:
+ *
+ * {@example common/ngComponentOutlet/ts/module.ts region='CompleteExample'}
+ *
+ * @publicApi
+ * @ngModule CommonModule
*/
-function TuiDropdownComponent_div_3_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const text_r2 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r2, " ");
- }
-}
-const _c0 = function (a0) {
- return {
- $implicit: a0
- };
-};
-const TUI_DROPDOWN_COMPONENT = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateTokenFromFactory)(() => TuiDropdownComponent);
-class TuiDropdownOpenDirective {
- constructor() {
- this.tuiDropdownOpen = false;
- this.tuiDropdownOpenChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
- }
- update(open) {
- this.tuiDropdownOpen = open;
- this.tuiDropdownOpenChange.emit(open);
- }
- ngOnChanges() {
- var _a;
- (_a = this.dropdown) === null || _a === void 0 ? void 0 : _a.toggle(this.tuiDropdownOpen);
- }
-}
-TuiDropdownOpenDirective.ɵfac = function TuiDropdownOpenDirective_Factory(t) {
- return new (t || TuiDropdownOpenDirective)();
-};
-TuiDropdownOpenDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownOpenDirective,
- selectors: [["", "tuiDropdownOpen", ""], ["", "tuiDropdownOpenChange", ""]],
- inputs: {
- tuiDropdownOpen: "tuiDropdownOpen"
- },
- outputs: {
- tuiDropdownOpenChange: "tuiDropdownOpenChange"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownOpenDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiDropdownOpen],[tuiDropdownOpenChange]'
- }]
- }], null, {
- tuiDropdownOpen: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- tuiDropdownOpenChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output
- }]
- });
-})();
-class TuiDropdownDirective {
- constructor(destroy$, el, dropdown, injector, dropdownService, open) {
- this.el = el;
- this.dropdown = dropdown;
- this.injector = injector;
- this.dropdownService = dropdownService;
- this.open = open;
- this.refresh$ = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject();
- this.dropdownBoxRef = null;
- this.type = 'dropdown';
- this.component = new _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_3__.PolymorpheusComponent(this.dropdown, this.injector);
- if (this.open && !this.open.dropdown) {
- this.open.dropdown = this;
- } else {
- this.open = null;
- }
- // Ignore multiple change detection triggers at the same frame
- this.refresh$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.throttleTime)(0), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.takeUntil)(destroy$)).subscribe(() => {
- var _a, _b;
- (_a = this.dropdownBoxRef) === null || _a === void 0 ? void 0 : _a.changeDetectorRef.detectChanges();
- (_b = this.dropdownBoxRef) === null || _b === void 0 ? void 0 : _b.changeDetectorRef.markForCheck();
- });
+class NgComponentOutlet {
+ constructor(_viewContainerRef) {
+ this._viewContainerRef = _viewContainerRef;
+ this.ngComponentOutlet = null;
+ /**
+ * A helper data structure that allows us to track inputs that were part of the
+ * ngComponentOutletInputs expression. Tracking inputs is necessary for proper removal of ones
+ * that are no longer referenced.
+ */
+ this._inputsUsed = new Map();
}
- get position() {
- return (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_6__.tuiCheckFixedPosition)(this.el.nativeElement) ? 'fixed' : 'absolute';
+ _needToReCreateNgModuleInstance(changes) {
+ // Note: square brackets property accessor is safe for Closure compiler optimizations (the
+ // `changes` argument of the `ngOnChanges` lifecycle hook retains the names of the fields that
+ // were changed).
+ return changes['ngComponentOutletNgModule'] !== undefined || changes['ngComponentOutletNgModuleFactory'] !== undefined;
}
- ngAfterViewChecked() {
- this.refresh$.next();
+ _needToReCreateComponentInstance(changes) {
+ // Note: square brackets property accessor is safe for Closure compiler optimizations (the
+ // `changes` argument of the `ngOnChanges` lifecycle hook retains the names of the fields that
+ // were changed).
+ return changes['ngComponentOutlet'] !== undefined || changes['ngComponentOutletContent'] !== undefined || changes['ngComponentOutletInjector'] !== undefined || this._needToReCreateNgModuleInstance(changes);
}
- ngAfterViewInit() {
- if (this.open) {
- this.toggle(this.open.tuiDropdownOpen);
+ /** @nodoc */
+ ngOnChanges(changes) {
+ if (this._needToReCreateComponentInstance(changes)) {
+ this._viewContainerRef.clear();
+ this._inputsUsed.clear();
+ this._componentRef = undefined;
+ if (this.ngComponentOutlet) {
+ const injector = this.ngComponentOutletInjector || this._viewContainerRef.parentInjector;
+ if (this._needToReCreateNgModuleInstance(changes)) {
+ this._moduleRef?.destroy();
+ if (this.ngComponentOutletNgModule) {
+ this._moduleRef = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.createNgModule)(this.ngComponentOutletNgModule, getParentInjector(injector));
+ } else if (this.ngComponentOutletNgModuleFactory) {
+ this._moduleRef = this.ngComponentOutletNgModuleFactory.create(getParentInjector(injector));
+ } else {
+ this._moduleRef = undefined;
+ }
+ }
+ this._componentRef = this._viewContainerRef.createComponent(this.ngComponentOutlet, {
+ injector,
+ ngModuleRef: this._moduleRef,
+ projectableNodes: this.ngComponentOutletContent
+ });
+ }
}
}
- ngOnChanges() {
- if (!this.content) {
- this.toggle(false);
+ /** @nodoc */
+ ngDoCheck() {
+ if (this._componentRef) {
+ if (this.ngComponentOutletInputs) {
+ for (const inputName of Object.keys(this.ngComponentOutletInputs)) {
+ this._inputsUsed.set(inputName, true);
+ }
+ }
+ this._applyInputStateDiff(this._componentRef);
}
}
+ /** @nodoc */
ngOnDestroy() {
- this.toggle(false);
- if (this.open) {
- this.open.dropdown = undefined;
- }
- }
- getClientRect() {
- return this.el.nativeElement.getBoundingClientRect();
+ this._moduleRef?.destroy();
}
- toggle(show) {
- var _a, _b;
- if (show && this.content && !this.dropdownBoxRef) {
- this.dropdownBoxRef = this.dropdownService.add(this.component);
- (_a = this.open) === null || _a === void 0 ? void 0 : _a.update(true);
- } else if (!show && this.dropdownBoxRef) {
- this.dropdownService.remove(this.dropdownBoxRef);
- this.dropdownBoxRef = null;
- (_b = this.open) === null || _b === void 0 ? void 0 : _b.update(false);
+ _applyInputStateDiff(componentRef) {
+ for (const [inputName, touched] of this._inputsUsed) {
+ if (!touched) {
+ // The input that was previously active no longer exists and needs to be set to undefined.
+ componentRef.setInput(inputName, undefined);
+ this._inputsUsed.delete(inputName);
+ } else {
+ // Since touched is true, it can be asserted that the inputs object is not empty.
+ componentRef.setInput(inputName, this.ngComponentOutletInputs[inputName]);
+ this._inputsUsed.set(inputName, false);
+ }
}
}
}
-TuiDropdownDirective.ɵfac = function TuiDropdownDirective_Factory(t) {
- return new (t || TuiDropdownDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_DROPDOWN_COMPONENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.INJECTOR), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TuiDropdownPortalService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiDropdownOpenDirective, 8));
+_NgComponentOutlet = NgComponentOutlet;
+_NgComponentOutlet.ɵfac = function _NgComponentOutlet_Factory(t) {
+ return new (t || _NgComponentOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef));
};
-TuiDropdownDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownDirective,
- selectors: [["", "tuiDropdown", "", 5, "ng-container"]],
+_NgComponentOutlet.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgComponentOutlet,
+ selectors: [["", "ngComponentOutlet", ""]],
inputs: {
- content: ["tuiDropdown", "content"]
+ ngComponentOutlet: "ngComponentOutlet",
+ ngComponentOutletInputs: "ngComponentOutletInputs",
+ ngComponentOutletInjector: "ngComponentOutletInjector",
+ ngComponentOutletContent: "ngComponentOutletContent",
+ ngComponentOutletNgModule: "ngComponentOutletNgModule",
+ ngComponentOutletNgModuleFactory: "ngComponentOutletNgModuleFactory"
},
- exportAs: ["tuiDropdown"],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsRectAccessor)(TuiDropdownDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsVehicle)(TuiDropdownDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]]
+ standalone: true,
+ features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]]
});
-(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.tuiPure], TuiDropdownDirective.prototype, "position", null);
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownDirective, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgComponentOutlet, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: '[tuiDropdown]:not(ng-container)',
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsRectAccessor)(TuiDropdownDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsVehicle)(TuiDropdownDirective)],
- exportAs: 'tuiDropdown'
+ selector: '[ngComponentOutlet]',
+ standalone: true
}]
}], function () {
return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Type,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_DROPDOWN_COMPONENT]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.INJECTOR]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TuiDropdownPortalService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TuiDropdownPortalService]
- }]
- }, {
- type: TuiDropdownOpenDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiDropdownOpenDirective]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef
}];
}, {
- content: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdown']
+ ngComponentOutlet: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}],
- position: []
- });
-})();
-
-/** Default values for hint options */
-const TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS = {
- showDelay: 200,
- hideDelay: 500
-};
-/**
- * Default parameters for dropdown hover directive
- */
-const TUI_DROPDOWN_HOVER_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)(TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS);
-function tuiDropdownHoverOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiProvideOptions)(TUI_DROPDOWN_HOVER_OPTIONS, options, TUI_DROPDOWN_HOVER_DEFAULT_OPTIONS);
-}
-class TuiDropdownHoverDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiDriver {
- constructor(hovered$, options, parentHover) {
- super(subscriber => this.stream$.subscribe(subscriber));
- this.hovered$ = hovered$;
- this.options = options;
- this.parentHover = parentHover;
- this.toggle$ = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject();
- this.stream$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_13__.merge)(this.toggle$, this.hovered$).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.switchMap)(visible => (0,rxjs__WEBPACK_IMPORTED_MODULE_15__.of)(visible).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.delay)(visible ? this.showDelay : this.hideDelay))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.tap)(visible => {
- this.hovered = visible;
- }), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.share)());
- this.showDelay = this.options.showDelay;
- this.hideDelay = this.options.hideDelay;
- this.hovered = false;
- this.type = 'dropdown';
- }
- toggle(visible) {
- var _a;
- (_a = this.parentHover) === null || _a === void 0 ? void 0 : _a.toggle(visible);
- this.toggle$.next(visible);
- }
-}
-TuiDropdownHoverDirective.ɵfac = function TuiDropdownHoverDirective_Factory(t) {
- return new (t || TuiDropdownHoverDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.TuiHoveredService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_DROPDOWN_HOVER_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiDropdownHoverDirective, 12));
-};
-TuiDropdownHoverDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownHoverDirective,
- selectors: [["", "tuiDropdownHover", "", 5, "ng-container"]],
- inputs: {
- showDelay: ["tuiDropdownShowDelay", "showDelay"],
- hideDelay: ["tuiDropdownHideDelay", "hideDelay"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsDriver)(TuiDropdownHoverDirective), _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.TuiHoveredService]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownHoverDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiDropdownHover]:not(ng-container)',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsDriver)(TuiDropdownHoverDirective), _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.TuiHoveredService]
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.TuiHoveredService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_DROPDOWN_HOVER_OPTIONS]
- }]
- }, {
- type: TuiDropdownHoverDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiDropdownHoverDirective]
- }]
- }];
- }, {
- showDelay: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownShowDelay']
+ ngComponentOutletInputs: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}],
- hideDelay: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownHideDelay']
+ ngComponentOutletInjector: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }],
+ ngComponentOutletContent: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }],
+ ngComponentOutletNgModule: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }],
+ ngComponentOutletNgModuleFactory: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}]
});
})();
+// Helper function that returns an Injector instance of a parent NgModule.
+function getParentInjector(injector) {
+ const parentNgModule = injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModuleRef);
+ return parentNgModule.injector;
+}
-/** Default values for dropdown options */
-const TUI_DROPDOWN_DEFAULT_OPTIONS = {
- align: 'left',
- direction: null,
- limitWidth: 'auto',
- maxHeight: 400,
- minHeight: 80,
- offset: 4,
- appearance: ''
-};
/**
- * Default parameters for dropdown directive
+ * @publicApi
*/
-const TUI_DROPDOWN_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)(TUI_DROPDOWN_DEFAULT_OPTIONS);
-const tuiDropdownOptionsProvider = override => ({
- provide: TUI_DROPDOWN_OPTIONS,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), TuiDropdownOptionsDirective], [new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf(), TUI_DROPDOWN_OPTIONS]],
- useFactory: (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_20__.tuiOverrideOptions)(override, TUI_DROPDOWN_DEFAULT_OPTIONS)
-});
-class TuiDropdownOptionsDirective {
- constructor(options) {
- this.options = options;
- this.align = this.options.align;
- this.appearance = this.options.appearance;
- this.direction = this.options.direction;
- this.limitWidth = this.options.limitWidth;
- this.minHeight = this.options.minHeight;
- this.maxHeight = this.options.maxHeight;
- this.offset = this.options.offset;
+class NgForOfContext {
+ constructor($implicit, ngForOf, index, count) {
+ this.$implicit = $implicit;
+ this.ngForOf = ngForOf;
+ this.index = index;
+ this.count = count;
+ }
+ get first() {
+ return this.index === 0;
+ }
+ get last() {
+ return this.index === this.count - 1;
+ }
+ get even() {
+ return this.index % 2 === 0;
+ }
+ get odd() {
+ return !this.even;
}
}
-TuiDropdownOptionsDirective.ɵfac = function TuiDropdownOptionsDirective_Factory(t) {
- return new (t || TuiDropdownOptionsDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_DROPDOWN_OPTIONS, 4));
-};
-TuiDropdownOptionsDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownOptionsDirective,
- selectors: [["", "tuiDropdownAlign", ""], ["", "tuiDropdownAppearance", ""], ["", "tuiDropdownDirection", ""], ["", "tuiDropdownLimitWidth", ""], ["", "tuiDropdownMinHeight", ""], ["", "tuiDropdownMaxHeight", ""], ["", "tuiDropdownOffset", ""]],
- inputs: {
- align: ["tuiDropdownAlign", "align"],
- appearance: ["tuiDropdownAppearance", "appearance"],
- direction: ["tuiDropdownDirection", "direction"],
- limitWidth: ["tuiDropdownLimitWidth", "limitWidth"],
- minHeight: ["tuiDropdownMinHeight", "minHeight"],
- maxHeight: ["tuiDropdownMaxHeight", "maxHeight"],
- offset: ["tuiDropdownOffset", "offset"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: TUI_DROPDOWN_OPTIONS,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => TuiDropdownOptionsDirective)
- }])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownOptionsDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiDropdownAlign], [tuiDropdownAppearance], [tuiDropdownDirection], [tuiDropdownLimitWidth], [tuiDropdownMinHeight], [tuiDropdownMaxHeight], [tuiDropdownOffset]',
- providers: [{
- provide: TUI_DROPDOWN_OPTIONS,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => TuiDropdownOptionsDirective)
- }]
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_DROPDOWN_OPTIONS]
- }]
- }];
- }, {
- align: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownAlign']
- }],
- appearance: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownAppearance']
- }],
- direction: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownDirection']
- }],
- limitWidth: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownLimitWidth']
- }],
- minHeight: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownMinHeight']
- }],
- maxHeight: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownMaxHeight']
- }],
- offset: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownOffset']
- }]
- });
-})();
-class TuiDropdownPositionDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiPositionAccessor {
- constructor(options, viewport, accessors, directive) {
- super();
- this.options = options;
- this.viewport = viewport;
- this.accessors = accessors;
- this.directive = directive;
- this.type = 'dropdown';
- }
- getPosition({
- width,
- height
- }) {
- var _a, _b;
- if (!width && !height) {
- this.previous = undefined;
- }
- const hostRect = (_b = (_a = this.accessor) === null || _a === void 0 ? void 0 : _a.getClientRect()) !== null && _b !== void 0 ? _b : _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.EMPTY_CLIENT_RECT;
- const viewportRect = this.viewport.getClientRect();
- const {
- minHeight,
- align,
- direction,
- offset,
- limitWidth
- } = this.options;
- const viewport = {
- top: viewportRect.top - offset,
- bottom: viewportRect.bottom + offset,
- right: viewportRect.right - offset,
- left: viewportRect.left + offset
- };
- const previous = this.previous || direction || 'bottom';
- const available = {
- top: hostRect.top - 2 * offset - viewport.top,
- bottom: viewport.bottom - hostRect.bottom - 2 * offset
- };
- const rectWidth = limitWidth === 'fixed' ? hostRect.width : width;
- const right = Math.max(hostRect.right - rectWidth, offset);
- const left = hostRect.left + width < viewport.right ? hostRect.left : right;
- const position = {
- top: hostRect.top - offset - height,
- bottom: hostRect.bottom + offset,
- right: Math.max(viewport.left, right),
- center: hostRect.left + hostRect.width / 2 + width / 2 < viewport.right ? hostRect.left + hostRect.width / 2 - width / 2 : right,
- left: Math.max(viewport.left, left)
- };
- const better = available.top > available.bottom ? 'top' : 'bottom';
- if (available[previous] > minHeight && direction || available[previous] > height) {
- return [position[previous], position[align]];
- }
- this.previous = better;
- return [position[better], position[align]];
- }
- get accessor() {
- return (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiFallbackRectAccessor)('dropdown')(this.accessors, this.directive);
- }
-}
-TuiDropdownPositionDirective.ɵfac = function TuiDropdownPositionDirective_Factory(t) {
- return new (t || TuiDropdownPositionDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_DROPDOWN_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_VIEWPORT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiRectAccessor), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiDropdownDirective));
-};
-TuiDropdownPositionDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownPositionDirective,
- selectors: [["", "tuiDropdown", ""]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.tuiPure], TuiDropdownPositionDirective.prototype, "accessor", null);
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownPositionDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiDropdown]'
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_DROPDOWN_OPTIONS]
- }]
- }, {
- type: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiRectAccessor,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_VIEWPORT]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiRectAccessor]
- }]
- }, {
- type: TuiDropdownDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiDropdownDirective]
- }]
- }];
- }, {
- accessor: []
- });
-})();
-
/**
- * @description:
- * This component is used to show template in a portal
- * using default style of white rounded box with a shadow
+ * A [structural directive](guide/structural-directives) that renders
+ * a template for each item in a collection.
+ * The directive is placed on an element, which becomes the parent
+ * of the cloned templates.
+ *
+ * The `ngForOf` directive is generally used in the
+ * [shorthand form](guide/structural-directives#asterisk) `*ngFor`.
+ * In this form, the template to be rendered for each iteration is the content
+ * of an anchor element containing the directive.
+ *
+ * The following example shows the shorthand syntax with some options,
+ * contained in an `
` element.
+ *
+ * ```
+ *
...
+ * ```
+ *
+ * The shorthand form expands into a long form that uses the `ngForOf` selector
+ * on an `` element.
+ * The content of the `` element is the `
` element that held the
+ * short-form directive.
+ *
+ * Here is the expanded version of the short-form example.
+ *
+ * ```
+ *
+ *
...
+ *
+ * ```
+ *
+ * Angular automatically expands the shorthand syntax as it compiles the template.
+ * The context for each embedded view is logically merged to the current component
+ * context according to its lexical position.
+ *
+ * When using the shorthand syntax, Angular allows only [one structural directive
+ * on an element](guide/structural-directives#one-per-element).
+ * If you want to iterate conditionally, for example,
+ * put the `*ngIf` on a container element that wraps the `*ngFor` element.
+ * For further discussion, see
+ * [Structural Directives](guide/structural-directives#one-per-element).
+ *
+ * @usageNotes
+ *
+ * ### Local variables
+ *
+ * `NgForOf` provides exported values that can be aliased to local variables.
+ * For example:
+ *
+ * ```
+ *
+ * {{i}}/{{users.length}}. {{user}} default
+ *
+ * ```
+ *
+ * The following exported values can be aliased to local variables:
+ *
+ * - `$implicit: T`: The value of the individual items in the iterable (`ngForOf`).
+ * - `ngForOf: NgIterable`: The value of the iterable expression. Useful when the expression is
+ * more complex then a property access, for example when using the async pipe (`userStreams |
+ * async`).
+ * - `index: number`: The index of the current item in the iterable.
+ * - `count: number`: The length of the iterable.
+ * - `first: boolean`: True when the item is the first item in the iterable.
+ * - `last: boolean`: True when the item is the last item in the iterable.
+ * - `even: boolean`: True when the item has an even index in the iterable.
+ * - `odd: boolean`: True when the item has an odd index in the iterable.
+ *
+ * ### Change propagation
+ *
+ * When the contents of the iterator changes, `NgForOf` makes the corresponding changes to the DOM:
+ *
+ * * When an item is added, a new instance of the template is added to the DOM.
+ * * When an item is removed, its template instance is removed from the DOM.
+ * * When items are reordered, their respective templates are reordered in the DOM.
+ *
+ * Angular uses object identity to track insertions and deletions within the iterator and reproduce
+ * those changes in the DOM. This has important implications for animations and any stateful
+ * controls that are present, such as `` elements that accept user input. Inserted rows can
+ * be animated in, deleted rows can be animated out, and unchanged rows retain any unsaved state
+ * such as user input.
+ * For more on animations, see [Transitions and Triggers](guide/transition-and-triggers).
+ *
+ * The identities of elements in the iterator can change while the data does not.
+ * This can happen, for example, if the iterator is produced from an RPC to the server, and that
+ * RPC is re-run. Even if the data hasn't changed, the second response produces objects with
+ * different identities, and Angular must tear down the entire DOM and rebuild it (as if all old
+ * elements were deleted and all new elements inserted).
+ *
+ * To avoid this expensive operation, you can customize the default tracking algorithm.
+ * by supplying the `trackBy` option to `NgForOf`.
+ * `trackBy` takes a function that has two arguments: `index` and `item`.
+ * If `trackBy` is given, Angular tracks changes by the return value of the function.
+ *
+ * @see [Structural Directives](guide/structural-directives)
+ * @ngModule CommonModule
+ * @publicApi
*/
-class TuiDropdownComponent {
- constructor(vvs, position$, destroy$, directive, animation, el, accessor, win, mode$, options, hoverDirective) {
- this.directive = directive;
- this.animation = animation;
- this.el = el;
- this.accessor = accessor;
- this.win = win;
- this.mode$ = mode$;
- this.options = options;
- this.hoverDirective = hoverDirective;
- position$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_23__.map)(point => this.directive.position === 'fixed' ? vvs.correct(point) : point), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.takeUntil)(destroy$)).subscribe(([top, left]) => {
- if (this.directive.el.nativeElement.isConnected) {
- this.update(top, left);
- } else {
- this.directive.toggle(false);
- }
- });
- this.updateWidth(this.accessor.getClientRect().width);
+class NgForOf {
+ /**
+ * The value of the iterable expression, which can be used as a
+ * [template input variable](guide/structural-directives#shorthand).
+ */
+ set ngForOf(ngForOf) {
+ this._ngForOf = ngForOf;
+ this._ngForOfDirty = true;
}
- onHoveredChange(hovered) {
- var _a;
- (_a = this.hoverDirective) === null || _a === void 0 ? void 0 : _a.toggle(hovered);
+ /**
+ * Specifies a custom `TrackByFunction` to compute the identity of items in an iterable.
+ *
+ * If a custom `TrackByFunction` is not provided, `NgForOf` will use the item's [object
+ * identity](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is)
+ * as the key.
+ *
+ * `NgForOf` uses the computed key to associate items in an iterable with DOM elements
+ * it produces for these items.
+ *
+ * A custom `TrackByFunction` is useful to provide good user experience in cases when items in an
+ * iterable rendered using `NgForOf` have a natural identifier (for example, custom ID or a
+ * primary key), and this iterable could be updated with new object instances that still
+ * represent the same underlying entity (for example, when data is re-fetched from the server,
+ * and the iterable is recreated and re-rendered, but most of the data is still the same).
+ *
+ * @see {@link TrackByFunction}
+ */
+ set ngForTrackBy(fn) {
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && fn != null && typeof fn !== 'function') {
+ console.warn(`trackBy must be a function, but received ${JSON.stringify(fn)}. ` + `See https://angular.io/api/common/NgForOf#change-propagation for more information.`);
+ }
+ this._trackByFn = fn;
}
- onTopFocus() {
- this.moveFocusOutside(true);
+ get ngForTrackBy() {
+ return this._trackByFn;
}
- onBottomFocus() {
- this.moveFocusOutside(false);
+ constructor(_viewContainer, _template, _differs) {
+ this._viewContainer = _viewContainer;
+ this._template = _template;
+ this._differs = _differs;
+ this._ngForOf = null;
+ this._ngForOfDirty = true;
+ this._differ = null;
}
- update(top, left) {
- var _a;
- const {
- style
- } = this.el.nativeElement;
- const {
- right
- } = this.el.nativeElement.getBoundingClientRect();
- const {
- maxHeight,
- minHeight,
- offset
- } = this.options;
- const {
- innerHeight
- } = this.win;
- const clientRect = (_a = this.el.nativeElement.offsetParent) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect();
- const {
- position
- } = this.directive;
- const rect = this.accessor.getClientRect();
- const offsetX = position === 'fixed' ? 0 : -((clientRect === null || clientRect === void 0 ? void 0 : clientRect.left) || 0);
- const offsetY = position === 'fixed' ? 0 : -((clientRect === null || clientRect === void 0 ? void 0 : clientRect.top) || 0);
- top += offsetY;
- left += offsetX;
- const isIntersecting = left < rect.right && right > rect.left && top < offsetY + 2 * offset;
- const available = isIntersecting ? rect.top - 2 * offset : offsetY + innerHeight - top - offset;
- const sided = right <= rect.left || left >= rect.right;
- style.position = position;
- style.top = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.tuiPx)(Math.max(top, offsetY + offset));
- style.left = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.tuiPx)(left);
- style.maxHeight = sided ? `${maxHeight}px` : (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.tuiPx)(Math.min(maxHeight, Math.max(available, minHeight)));
- style.width = '';
- style.minWidth = '';
- this.updateWidth(rect.width);
- }
- updateWidth(width) {
- const {
- style
- } = this.el.nativeElement;
- switch (this.options.limitWidth) {
- case 'min':
- style.minWidth = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.tuiPx)(width);
- break;
- case 'fixed':
- style.width = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.tuiPx)(width);
- break;
- case 'auto':
- break;
+ /**
+ * A reference to the template that is stamped out for each item in the iterable.
+ * @see [template reference variable](guide/template-reference-variables)
+ */
+ set ngForTemplate(value) {
+ // TODO(TS2.1): make TemplateRef>> once we move to TS v2.1
+ // The current type is too restrictive; a template that just uses index, for example,
+ // should be acceptable.
+ if (value) {
+ this._template = value;
}
}
- moveFocusOutside(previous) {
- const {
- nativeElement
- } = this.directive.el;
- const {
- ownerDocument
- } = nativeElement;
- const root = ownerDocument ? ownerDocument.body : nativeElement;
- let focusable = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_25__.tuiGetClosestFocusable)({
- initial: nativeElement,
- root,
- previous
+ /**
+ * Applies the changes when needed.
+ * @nodoc
+ */
+ ngDoCheck() {
+ if (this._ngForOfDirty) {
+ this._ngForOfDirty = false;
+ // React on ngForOf changes only once all inputs have been initialized
+ const value = this._ngForOf;
+ if (!this._differ && value) {
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
+ try {
+ // CAUTION: this logic is duplicated for production mode below, as the try-catch
+ // is only present in development builds.
+ this._differ = this._differs.find(value).create(this.ngForTrackBy);
+ } catch {
+ let errorMessage = `Cannot find a differ supporting object '${value}' of type '` + `${getTypeName(value)}'. NgFor only supports binding to Iterables, such as Arrays.`;
+ if (typeof value === 'object') {
+ errorMessage += ' Did you mean to use the keyvalue pipe?';
+ }
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](-2200 /* RuntimeErrorCode.NG_FOR_MISSING_DIFFER */, errorMessage);
+ }
+ } else {
+ // CAUTION: this logic is duplicated for development mode above, as the try-catch
+ // is only present in development builds.
+ this._differ = this._differs.find(value).create(this.ngForTrackBy);
+ }
+ }
+ }
+ if (this._differ) {
+ const changes = this._differ.diff(this._ngForOf);
+ if (changes) this._applyChanges(changes);
+ }
+ }
+ _applyChanges(changes) {
+ const viewContainer = this._viewContainer;
+ changes.forEachOperation((item, adjustedPreviousIndex, currentIndex) => {
+ if (item.previousIndex == null) {
+ // NgForOf is never "null" or "undefined" here because the differ detected
+ // that a new item needs to be inserted from the iterable. This implies that
+ // there is an iterable value for "_ngForOf".
+ viewContainer.createEmbeddedView(this._template, new NgForOfContext(item.item, this._ngForOf, -1, -1), currentIndex === null ? undefined : currentIndex);
+ } else if (currentIndex == null) {
+ viewContainer.remove(adjustedPreviousIndex === null ? undefined : adjustedPreviousIndex);
+ } else if (adjustedPreviousIndex !== null) {
+ const view = viewContainer.get(adjustedPreviousIndex);
+ viewContainer.move(view, currentIndex);
+ applyViewChange(view, item);
+ }
});
- while (focusable !== null && nativeElement.contains(focusable)) {
- focusable = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_25__.tuiGetClosestFocusable)({
- initial: focusable,
- root,
- previous
- });
+ for (let i = 0, ilen = viewContainer.length; i < ilen; i++) {
+ const viewRef = viewContainer.get(i);
+ const context = viewRef.context;
+ context.index = i;
+ context.count = ilen;
+ context.ngForOf = this._ngForOf;
}
- focusable === null || focusable === void 0 ? void 0 : focusable.focus();
+ changes.forEachIdentityChange(record => {
+ const viewRef = viewContainer.get(record.currentIndex);
+ applyViewChange(viewRef, record);
+ });
+ }
+ /**
+ * Asserts the correct type of the context for the template that `NgForOf` will render.
+ *
+ * The presence of this method is a signal to the Ivy template type-check compiler that the
+ * `NgForOf` structural directive renders its template with a specific context type.
+ */
+ static ngTemplateContextGuard(dir, ctx) {
+ return true;
}
}
-TuiDropdownComponent.ɵfac = function TuiDropdownComponent_Factory(t) {
- return new (t || TuiDropdownComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_26__.TuiVisualViewportService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_26__.TuiPositionService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiDropdownDirective), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_ANIMATION_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiRectAccessor), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_27__.WINDOW), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_MODE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_DROPDOWN_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiDropdownHoverDirective, 8));
+_NgForOf = NgForOf;
+_NgForOf.ɵfac = function _NgForOf_Factory(t) {
+ return new (t || _NgForOf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers));
};
-TuiDropdownComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiDropdownComponent,
- selectors: [["tui-dropdown"]],
- hostVars: 2,
- hostBindings: function TuiDropdownComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("$.data-mode.attr", function TuiDropdownComponent___data_mode_attr_HostBindingHandler() {
- return ctx.mode$;
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-appearance", ctx.options.appearance);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsyntheticHostProperty"]("@tuiDropdownAnimation", ctx.animation);
- }
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_26__.TuiPositionService, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiPositionAccessorFor)('dropdown', TuiDropdownPositionDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiRectAccessorFor)('dropdown', TuiDropdownDirective), _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_28__.MODE_PROVIDER])],
- decls: 5,
- vars: 4,
- consts: [["tuiActiveZone", "", "tuiOverscroll", "all", 1, "t-scroll", 3, "tuiHoveredChange"], ["activeZone", "tuiActiveZone"], ["tabindex", "0", 3, "focus"], ["class", "t-primitive", 4, "polymorpheusOutlet", "polymorpheusOutletContext"], [1, "t-primitive"]],
- template: function TuiDropdownComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "tui-scrollbar", 0, 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("tuiHoveredChange", function TuiDropdownComponent_Template_tui_scrollbar_tuiHoveredChange_0_listener($event) {
- return ctx.onHoveredChange($event);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "div", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("focus", function TuiDropdownComponent_Template_div_focus_2_listener() {
- return ctx.onTopFocus();
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](3, TuiDropdownComponent_div_3_Template, 2, 1, "div", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](4, "div", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("focus", function TuiDropdownComponent_Template_div_focus_4_listener() {
- return ctx.onBottomFocus();
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
- }
- if (rf & 2) {
- const _r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx.directive.content)("polymorpheusOutletContext", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpureFunction1"](2, _c0, _r0));
- }
+_NgForOf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgForOf,
+ selectors: [["", "ngFor", "", "ngForOf", ""]],
+ inputs: {
+ ngForOf: "ngForOf",
+ ngForTrackBy: "ngForTrackBy",
+ ngForTemplate: "ngForTemplate"
},
- dependencies: [_taiga_ui_core_components_scrollbar__WEBPACK_IMPORTED_MODULE_29__.TuiScrollbarComponent, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_30__.TuiActiveZoneDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_31__.TuiOverscrollDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.TuiHoveredDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_3__.PolymorpheusOutletDirective],
- styles: ["[_nghost-%COMP%]{position:absolute;display:flex;box-shadow:var(--tui-shadow-dropdown);background:var(--tui-elevation-02);border-radius:var(--tui-radius-m);overflow:hidden;border:1px solid var(--tui-base-04);box-sizing:border-box;max-width:calc(100% - 8px);isolation:isolate;pointer-events:auto}.ng-animating[_nghost-%COMP%]{pointer-events:none}[_nghost-%COMP%]:not([style*=\"top\"]){visibility:hidden}[data-mode=onDark][_nghost-%COMP%]{--tui-text-01: var(--tui-text-01-night);--tui-clear: var(--tui-clear-inverse);background:#222;border:1px solid #808080}.t-scroll[_ngcontent-%COMP%]{flex-grow:1;max-width:100%}.t-primitive[_ngcontent-%COMP%]{padding:1rem}"],
- data: {
- animation: [_taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_32__.tuiDropdownAnimation]
- }
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgForOf, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: 'tui-dropdown',
- templateUrl: './dropdown.template.html',
- styleUrls: ['./dropdown.style.less'],
- // @bad TODO: OnPush
- // eslint-disable-next-line @angular-eslint/prefer-on-push-component-change-detection
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.Default,
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_26__.TuiPositionService, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiPositionAccessorFor)('dropdown', TuiDropdownPositionDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiRectAccessorFor)('dropdown', TuiDropdownDirective), _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_28__.MODE_PROVIDER],
- host: {
- '[@tuiDropdownAnimation]': 'animation',
- '[attr.data-appearance]': 'options.appearance',
- '($.data-mode.attr)': 'mode$'
- },
- animations: [_taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_32__.tuiDropdownAnimation]
+ selector: '[ngFor][ngForOf]',
+ standalone: true
}]
}], function () {
return [{
- type: _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_26__.TuiVisualViewportService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_26__.TuiVisualViewportService]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_26__.TuiPositionService]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService]
- }]
- }, {
- type: TuiDropdownDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiDropdownDirective]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_ANIMATION_OPTIONS]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiRectAccessor,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiRectAccessor]
- }]
- }, {
- type: Window,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_27__.WINDOW]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_MODE]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef
}, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_DROPDOWN_OPTIONS]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef
}, {
- type: TuiDropdownHoverDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiDropdownHoverDirective]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.IterableDiffers
}];
- }, null);
+ }, {
+ ngForOf: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }],
+ ngForTrackBy: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }],
+ ngForTemplate: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }]
+ });
})();
-function activeZoneFilter(target) {
- return !this.activeZone.contains(target);
+function applyViewChange(view, record) {
+ view.context.$implicit = record.item;
}
-const TAP_DELAY = 700;
-const MOVE_THRESHOLD = 15;
-class TuiDropdownContextDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiDriver {
- constructor(activeZone, isIOS, isTouch) {
- super(subscriber => this.stream$.subscribe(subscriber));
- this.activeZone = activeZone;
- this.isIOS = isIOS;
- this.isTouch = isTouch;
- this.stream$ = new rxjs__WEBPACK_IMPORTED_MODULE_2__.Subject();
- this.currentRect = _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.EMPTY_CLIENT_RECT;
- this.longTapTimeout = NaN;
- this.type = 'dropdown';
- }
- get userSelect() {
- return this.isTouch ? 'none' : null;
- }
- onContextMenu(x, y) {
- this.currentRect = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_33__.tuiPointToClientRect)(x, y);
- this.stream$.next(true);
+function getTypeName(type) {
+ return type['name'] || typeof type;
+}
+
+/**
+ * A structural directive that conditionally includes a template based on the value of
+ * an expression coerced to Boolean.
+ * When the expression evaluates to true, Angular renders the template
+ * provided in a `then` clause, and when false or null,
+ * Angular renders the template provided in an optional `else` clause. The default
+ * template for the `else` clause is blank.
+ *
+ * A [shorthand form](guide/structural-directives#asterisk) of the directive,
+ * `*ngIf="condition"`, is generally used, provided
+ * as an attribute of the anchor element for the inserted template.
+ * Angular expands this into a more explicit version, in which the anchor element
+ * is contained in an `` element.
+ *
+ * Simple form with shorthand syntax:
+ *
+ * ```
+ *
Content to render when condition is true.
+ * ```
+ *
+ * Simple form with expanded syntax:
+ *
+ * ```
+ *
Content to render when condition is
+ * true.
+ * ```
+ *
+ * Form with an "else" block:
+ *
+ * ```
+ *
Content to render when condition is true.
+ * Content to render when condition is false.
+ * ```
+ *
+ * Shorthand form with "then" and "else" blocks:
+ *
+ * ```
+ *
+ * Content to render when condition is true.
+ * Content to render when condition is false.
+ * ```
+ *
+ * Form with storing the value locally:
+ *
+ * ```
+ *
{{value}}
+ * Content to render when value is null.
+ * ```
+ *
+ * @usageNotes
+ *
+ * The `*ngIf` directive is most commonly used to conditionally show an inline template,
+ * as seen in the following example.
+ * The default `else` template is blank.
+ *
+ * {@example common/ngIf/ts/module.ts region='NgIfSimple'}
+ *
+ * ### Showing an alternative template using `else`
+ *
+ * To display a template when `expression` evaluates to false, use an `else` template
+ * binding as shown in the following example.
+ * The `else` binding points to an `` element labeled `#elseBlock`.
+ * The template can be defined anywhere in the component view, but is typically placed right after
+ * `ngIf` for readability.
+ *
+ * {@example common/ngIf/ts/module.ts region='NgIfElse'}
+ *
+ * ### Using an external `then` template
+ *
+ * In the previous example, the then-clause template is specified inline, as the content of the
+ * tag that contains the `ngIf` directive. You can also specify a template that is defined
+ * externally, by referencing a labeled `` element. When you do this, you can
+ * change which template to use at runtime, as shown in the following example.
+ *
+ * {@example common/ngIf/ts/module.ts region='NgIfThenElse'}
+ *
+ * ### Storing a conditional result in a variable
+ *
+ * You might want to show a set of properties from the same object. If you are waiting
+ * for asynchronous data, the object can be undefined.
+ * In this case, you can use `ngIf` and store the result of the condition in a local
+ * variable as shown in the following example.
+ *
+ * {@example common/ngIf/ts/module.ts region='NgIfAs'}
+ *
+ * This code uses only one `AsyncPipe`, so only one subscription is created.
+ * The conditional statement stores the result of `userStream|async` in the local variable `user`.
+ * You can then bind the local `user` repeatedly.
+ *
+ * The conditional displays the data only if `userStream` returns a value,
+ * so you don't need to use the
+ * safe-navigation-operator (`?.`)
+ * to guard against null values when accessing properties.
+ * You can display an alternative template while waiting for the data.
+ *
+ * ### Shorthand syntax
+ *
+ * The shorthand syntax `*ngIf` expands into two separate template specifications
+ * for the "then" and "else" clauses. For example, consider the following shorthand statement,
+ * that is meant to show a loading page while waiting for data to be loaded.
+ *
+ * ```
+ *
+ * ...
+ *
+ *
+ *
+ *
Loading...
+ *
+ * ```
+ *
+ * You can see that the "else" clause references the ``
+ * with the `#loading` label, and the template for the "then" clause
+ * is provided as the content of the anchor element.
+ *
+ * However, when Angular expands the shorthand syntax, it creates
+ * another `` tag, with `ngIf` and `ngIfElse` directives.
+ * The anchor element containing the template for the "then" clause becomes
+ * the content of this unlabeled `` tag.
+ *
+ * ```
+ *
+ *
+ * ...
+ *
+ *
+ *
+ *
+ *
Loading...
+ *
+ * ```
+ *
+ * The presence of the implicit template object has implications for the nesting of
+ * structural directives. For more on this subject, see
+ * [Structural Directives](guide/structural-directives#one-per-element).
+ *
+ * @ngModule CommonModule
+ * @publicApi
+ */
+class NgIf {
+ constructor(_viewContainer, templateRef) {
+ this._viewContainer = _viewContainer;
+ this._context = new NgIfContext();
+ this._thenTemplateRef = null;
+ this._elseTemplateRef = null;
+ this._thenViewRef = null;
+ this._elseViewRef = null;
+ this._thenTemplateRef = templateRef;
}
- closeDropdown() {
- this.stream$.next(false);
- this.currentRect = _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.EMPTY_CLIENT_RECT;
+ /**
+ * The Boolean expression to evaluate as the condition for showing a template.
+ */
+ set ngIf(condition) {
+ this._context.$implicit = this._context.ngIf = condition;
+ this._updateView();
}
- onTouchMove(x, y) {
- if (this.isIOS && this.isTouch && this.currentRect !== _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.EMPTY_CLIENT_RECT && Math.hypot(x - this.currentRect.x, y - this.currentRect.y) > MOVE_THRESHOLD) {
- this.onTouchEnd();
- }
+ /**
+ * A template to show if the condition expression evaluates to true.
+ */
+ set ngIfThen(templateRef) {
+ assertTemplate('ngIfThen', templateRef);
+ this._thenTemplateRef = templateRef;
+ this._thenViewRef = null; // clear previous view if any.
+ this._updateView();
}
- onTouchStart(x, y) {
- if (!this.isIOS || !this.isTouch || this.currentRect !== _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.EMPTY_CLIENT_RECT) {
- return;
- }
- this.longTapTimeout = setTimeout(() => {
- this.currentRect = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_33__.tuiPointToClientRect)(x, y);
- this.stream$.next(true);
- }, TAP_DELAY);
+ /**
+ * A template to show if the condition expression evaluates to false.
+ */
+ set ngIfElse(templateRef) {
+ assertTemplate('ngIfElse', templateRef);
+ this._elseTemplateRef = templateRef;
+ this._elseViewRef = null; // clear previous view if any.
+ this._updateView();
}
- onTouchEnd() {
- if (this.isIOS && this.isTouch) {
- clearTimeout(this.longTapTimeout);
+ _updateView() {
+ if (this._context.$implicit) {
+ if (!this._thenViewRef) {
+ this._viewContainer.clear();
+ this._elseViewRef = null;
+ if (this._thenTemplateRef) {
+ this._thenViewRef = this._viewContainer.createEmbeddedView(this._thenTemplateRef, this._context);
+ }
+ }
+ } else {
+ if (!this._elseViewRef) {
+ this._viewContainer.clear();
+ this._thenViewRef = null;
+ if (this._elseTemplateRef) {
+ this._elseViewRef = this._viewContainer.createEmbeddedView(this._elseTemplateRef, this._context);
+ }
+ }
}
}
- getClientRect() {
- return this.currentRect;
+ /**
+ * Asserts the correct type of the context for the template that `NgIf` will render.
+ *
+ * The presence of this method is a signal to the Ivy template type-check compiler that the
+ * `NgIf` structural directive renders its template with a specific context type.
+ */
+ static ngTemplateContextGuard(dir, ctx) {
+ return true;
}
}
-TuiDropdownContextDirective.ɵfac = function TuiDropdownContextDirective_Factory(t) {
- return new (t || TuiDropdownContextDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_30__.TuiActiveZoneDirective), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_34__.TUI_IS_IOS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_34__.TUI_IS_TOUCH));
+_NgIf = NgIf;
+_NgIf.ɵfac = function _NgIf_Factory(t) {
+ return new (t || _NgIf)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef));
};
-TuiDropdownContextDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownContextDirective,
- selectors: [["", "tuiDropdown", "", "tuiDropdownContext", ""]],
- hostVars: 6,
- hostBindings: function TuiDropdownContextDirective_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("contextmenu.prevent.stop", function TuiDropdownContextDirective_contextmenu_prevent_stop_HostBindingHandler($event) {
- return ctx.onContextMenu($event.clientX, $event.clientY);
- })("click.silent", function TuiDropdownContextDirective_click_silent_HostBindingHandler($event) {
- return ctx.closeDropdown($event.target);
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresolveDocument"])("contextmenu.capture.silent", function TuiDropdownContextDirective_contextmenu_capture_silent_HostBindingHandler($event) {
- return ctx.closeDropdown($event.target);
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresolveDocument"])("keydown.esc", function TuiDropdownContextDirective_keydown_esc_HostBindingHandler($event) {
- return ctx.closeDropdown($event.currentTarget);
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresolveDocument"])("touchmove.silent.passive", function TuiDropdownContextDirective_touchmove_silent_passive_HostBindingHandler($event) {
- return ctx.onTouchMove($event.touches[0].clientX, $event.touches[0].clientY);
- })("touchstart.silent.passive", function TuiDropdownContextDirective_touchstart_silent_passive_HostBindingHandler($event) {
- return ctx.onTouchStart($event.touches[0].clientX, $event.touches[0].clientY);
- })("touchend.silent.passive", function TuiDropdownContextDirective_touchend_silent_passive_HostBindingHandler() {
- return ctx.onTouchEnd();
- })("touchcancel.silent.passive", function TuiDropdownContextDirective_touchcancel_silent_passive_HostBindingHandler() {
- return ctx.onTouchEnd();
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("user-select", ctx.userSelect)("-webkit-touch-callout", ctx.userSelect)("-webkit-user-select", ctx.userSelect);
- }
+_NgIf.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgIf,
+ selectors: [["", "ngIf", ""]],
+ inputs: {
+ ngIf: "ngIf",
+ ngIfThen: "ngIfThen",
+ ngIfElse: "ngIfElse"
},
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_30__.TuiActiveZoneDirective, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsDriver)(TuiDropdownContextDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsRectAccessor)(TuiDropdownContextDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
+ standalone: true
});
-(0,tslib__WEBPACK_IMPORTED_MODULE_10__.__decorate)([(0,_tinkoff_ng_event_plugins__WEBPACK_IMPORTED_MODULE_35__.shouldCall)(activeZoneFilter)], TuiDropdownContextDirective.prototype, "closeDropdown", null);
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownContextDirective, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgIf, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: '[tuiDropdown][tuiDropdownContext]',
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_30__.TuiActiveZoneDirective, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsDriver)(TuiDropdownContextDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsRectAccessor)(TuiDropdownContextDirective)]
+ selector: '[ngIf]',
+ standalone: true
}]
}], function () {
return [{
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_30__.TuiActiveZoneDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_30__.TuiActiveZoneDirective]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_34__.TUI_IS_IOS]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef
}, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_34__.TUI_IS_TOUCH]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef
}];
}, {
- userSelect: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['style.user-select']
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['style.-webkit-touch-callout']
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['style.-webkit-user-select']
- }],
- onContextMenu: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['contextmenu.prevent.stop', ['$event.clientX', '$event.clientY']]
- }],
- closeDropdown: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['document:click.silent', ['$event.target']]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['document:contextmenu.capture.silent', ['$event.target']]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['document:keydown.esc', ['$event.currentTarget']]
- }],
- onTouchMove: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['touchmove.silent.passive', ['$event.touches[0].clientX', '$event.touches[0].clientY']]
+ ngIf: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}],
- onTouchStart: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['touchstart.silent.passive', ['$event.touches[0].clientX', '$event.touches[0].clientY']]
+ ngIfThen: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}],
- onTouchEnd: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['touchend.silent.passive']
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['touchcancel.silent.passive']
+ ngIfElse: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}]
});
})();
-class TuiDropdownDriverDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.AbstractTuiDriverDirective {
- // TODO: Figure out why this is necessary under nx test runner
- constructor(destroy$, drivers, vehicles) {
- super(destroy$, drivers, vehicles);
- this.type = 'dropdown';
+/**
+ * @publicApi
+ */
+class NgIfContext {
+ constructor() {
+ this.$implicit = null;
+ this.ngIf = null;
}
}
-TuiDropdownDriverDirective.ɵfac = function TuiDropdownDriverDirective_Factory(t) {
- return new (t || TuiDropdownDriverDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiDriver), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiVehicle));
-};
-TuiDropdownDriverDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownDriverDirective,
- selectors: [["", "tuiDropdown", ""]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownDriverDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiDropdown]',
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService]
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiDestroyService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiDriver]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiVehicle]
- }]
- }];
- }, null);
-})();
-class TuiDropdownHostDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiRectAccessor {
+function assertTemplate(property, templateRef) {
+ const isTemplateRefOrNull = !!(!templateRef || templateRef.createEmbeddedView);
+ if (!isTemplateRefOrNull) {
+ throw new Error(`${property} must be a TemplateRef, but received '${(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(templateRef)}'.`);
+ }
+}
+class SwitchView {
+ constructor(_viewContainerRef, _templateRef) {
+ this._viewContainerRef = _viewContainerRef;
+ this._templateRef = _templateRef;
+ this._created = false;
+ }
+ create() {
+ this._created = true;
+ this._viewContainerRef.createEmbeddedView(this._templateRef);
+ }
+ destroy() {
+ this._created = false;
+ this._viewContainerRef.clear();
+ }
+ enforceState(created) {
+ if (created && !this._created) {
+ this.create();
+ } else if (!created && this._created) {
+ this.destroy();
+ }
+ }
+}
+/**
+ * @ngModule CommonModule
+ *
+ * @description
+ * The `[ngSwitch]` directive on a container specifies an expression to match against.
+ * The expressions to match are provided by `ngSwitchCase` directives on views within the container.
+ * - Every view that matches is rendered.
+ * - If there are no matches, a view with the `ngSwitchDefault` directive is rendered.
+ * - Elements within the `[NgSwitch]` statement but outside of any `NgSwitchCase`
+ * or `ngSwitchDefault` directive are preserved at the location.
+ *
+ * @usageNotes
+ * Define a container element for the directive, and specify the switch expression
+ * to match against as an attribute:
+ *
+ * ```
+ *
+ * ```
+ *
+ * Within the container, `*ngSwitchCase` statements specify the match expressions
+ * as attributes. Include `*ngSwitchDefault` as the final case.
+ *
+ * ```
+ *
+ * ...
+ * ...
+ * ...
+ *
+ * ```
+ *
+ * ### Usage Examples
+ *
+ * The following example shows how to use more than one case to display the same view:
+ *
+ * ```
+ *
+ *
+ * ...
+ * ...
+ * ...
+ *
+ * ...
+ *
+ * ```
+ *
+ * The following example shows how cases can be nested:
+ * ```
+ *
+ * ...
+ * ...
+ * ...
+ *
+ *
+ *
+ *
+ *
+ * ...
+ *
+ * ```
+ *
+ * @publicApi
+ * @see {@link NgSwitchCase}
+ * @see {@link NgSwitchDefault}
+ * @see [Structural Directives](guide/structural-directives)
+ *
+ */
+class NgSwitch {
constructor() {
- super(...arguments);
- this.type = 'dropdown';
+ this._defaultViews = [];
+ this._defaultUsed = false;
+ this._caseCount = 0;
+ this._lastCaseCheckIndex = 0;
+ this._lastCasesMatched = false;
}
- getClientRect() {
- var _a;
- return ((_a = this.tuiDropdownHost) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.EMPTY_CLIENT_RECT;
+ set ngSwitch(newValue) {
+ this._ngSwitch = newValue;
+ if (this._caseCount === 0) {
+ this._updateDefaultCases(true);
+ }
+ }
+ /** @internal */
+ _addCase() {
+ return this._caseCount++;
+ }
+ /** @internal */
+ _addDefault(view) {
+ this._defaultViews.push(view);
+ }
+ /** @internal */
+ _matchCase(value) {
+ const matched = value == this._ngSwitch;
+ this._lastCasesMatched = this._lastCasesMatched || matched;
+ this._lastCaseCheckIndex++;
+ if (this._lastCaseCheckIndex === this._caseCount) {
+ this._updateDefaultCases(!this._lastCasesMatched);
+ this._lastCaseCheckIndex = 0;
+ this._lastCasesMatched = false;
+ }
+ return matched;
+ }
+ _updateDefaultCases(useDefault) {
+ if (this._defaultViews.length > 0 && useDefault !== this._defaultUsed) {
+ this._defaultUsed = useDefault;
+ for (const defaultView of this._defaultViews) {
+ defaultView.enforceState(useDefault);
+ }
+ }
}
}
-TuiDropdownHostDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiDropdownHostDirective_BaseFactory;
- return function TuiDropdownHostDirective_Factory(t) {
- return (ɵTuiDropdownHostDirective_BaseFactory || (ɵTuiDropdownHostDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](TuiDropdownHostDirective)))(t || TuiDropdownHostDirective);
- };
-}();
-TuiDropdownHostDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownHostDirective,
- selectors: [["", "tuiDropdown", "", "tuiDropdownHost", ""]],
+_NgSwitch = NgSwitch;
+_NgSwitch.ɵfac = function _NgSwitch_Factory(t) {
+ return new (t || _NgSwitch)();
+};
+_NgSwitch.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgSwitch,
+ selectors: [["", "ngSwitch", ""]],
inputs: {
- tuiDropdownHost: "tuiDropdownHost"
+ ngSwitch: "ngSwitch"
},
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsRectAccessor)(TuiDropdownHostDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownHostDirective, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitch, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: '[tuiDropdown][tuiDropdownHost]',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsRectAccessor)(TuiDropdownHostDirective)]
+ selector: '[ngSwitch]',
+ standalone: true
}]
}], null, {
- tuiDropdownHost: [{
+ ngSwitch: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}]
});
})();
-class TuiDropdownManualDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiDriver {
- constructor() {
- super(subscriber => this.stream$.subscribe(subscriber));
- this.stream$ = new rxjs__WEBPACK_IMPORTED_MODULE_36__.BehaviorSubject(false);
- this.tuiDropdownManual = false;
- this.type = 'dropdown';
+/**
+ * @ngModule CommonModule
+ *
+ * @description
+ * Provides a switch case expression to match against an enclosing `ngSwitch` expression.
+ * When the expressions match, the given `NgSwitchCase` template is rendered.
+ * If multiple match expressions match the switch expression value, all of them are displayed.
+ *
+ * @usageNotes
+ *
+ * Within a switch container, `*ngSwitchCase` statements specify the match expressions
+ * as attributes. Include `*ngSwitchDefault` as the final case.
+ *
+ * ```
+ *
+ * ...
+ * ...
+ * ...
+ *
+ * ```
+ *
+ * Each switch-case statement contains an in-line HTML template or template reference
+ * that defines the subtree to be selected if the value of the match expression
+ * matches the value of the switch expression.
+ *
+ * Unlike JavaScript, which uses strict equality, Angular uses loose equality.
+ * This means that the empty string, `""` matches 0.
+ *
+ * @publicApi
+ * @see {@link NgSwitch}
+ * @see {@link NgSwitchDefault}
+ *
+ */
+class NgSwitchCase {
+ constructor(viewContainer, templateRef, ngSwitch) {
+ this.ngSwitch = ngSwitch;
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {
+ throwNgSwitchProviderNotFoundError('ngSwitchCase', 'NgSwitchCase');
+ }
+ ngSwitch._addCase();
+ this._view = new SwitchView(viewContainer, templateRef);
}
- ngOnChanges() {
- this.stream$.next(this.tuiDropdownManual);
+ /**
+ * Performs case matching. For internal use only.
+ * @nodoc
+ */
+ ngDoCheck() {
+ this._view.enforceState(this.ngSwitch._matchCase(this.ngSwitchCase));
}
}
-TuiDropdownManualDirective.ɵfac = function TuiDropdownManualDirective_Factory(t) {
- return new (t || TuiDropdownManualDirective)();
+_NgSwitchCase = NgSwitchCase;
+_NgSwitchCase.ɵfac = function _NgSwitchCase_Factory(t) {
+ return new (t || _NgSwitchCase)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgSwitch, 9));
};
-TuiDropdownManualDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownManualDirective,
- selectors: [["", "tuiDropdown", "", "tuiDropdownManual", ""]],
+_NgSwitchCase.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgSwitchCase,
+ selectors: [["", "ngSwitchCase", ""]],
inputs: {
- tuiDropdownManual: "tuiDropdownManual"
+ ngSwitchCase: "ngSwitchCase"
},
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsDriver)(TuiDropdownManualDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]]
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownManualDirective, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitchCase, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: '[tuiDropdown][tuiDropdownManual]',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsDriver)(TuiDropdownManualDirective)]
- }]
- }], function () {
- return [];
- }, {
- tuiDropdownManual: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiDropdownPositionSidedDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiPositionAccessor {
- constructor(options, viewport, vertical) {
- super();
- this.options = options;
- this.viewport = viewport;
- this.vertical = vertical;
- this.previous = this.options.direction || 'bottom';
- this.tuiDropdownSided = '';
- this.tuiDropdownSidedOffset = 4;
- this.type = 'dropdown';
- }
- getPosition(rect) {
- var _a, _b;
- if (this.tuiDropdownSided === false) {
- return this.vertical.getPosition(rect);
- }
- const {
- height,
- width
- } = rect;
- const hostRect = (_b = (_a = this.vertical.accessor) === null || _a === void 0 ? void 0 : _a.getClientRect()) !== null && _b !== void 0 ? _b : _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.EMPTY_CLIENT_RECT;
- const viewport = this.viewport.getClientRect();
- const {
- direction,
- minHeight,
- offset
- } = this.options;
- const align = this.options.align === 'center' ? 'left' : this.options.align;
- const available = {
- top: hostRect.bottom - viewport.top,
- left: hostRect.left - offset - viewport.left,
- right: viewport.right - hostRect.right - offset,
- bottom: viewport.bottom - hostRect.top
- };
- const position = {
- top: hostRect.bottom - height + this.tuiDropdownSidedOffset + 1,
- left: hostRect.left - width - offset,
- right: hostRect.right + offset,
- bottom: hostRect.top - this.tuiDropdownSidedOffset - 1 // 1 for border
- };
- const better = available.top > available.bottom ? 'top' : 'bottom';
- const maxLeft = available.left > available.right ? position.left : position.right;
- const left = available[align] > width ? position[align] : maxLeft;
- if (available[this.previous] > minHeight && direction || this.previous === better) {
- return [position[this.previous], left];
- }
- this.previous = better;
- return [position[better], left];
- }
-}
-TuiDropdownPositionSidedDirective.ɵfac = function TuiDropdownPositionSidedDirective_Factory(t) {
- return new (t || TuiDropdownPositionSidedDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_DROPDOWN_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_VIEWPORT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiDropdownPositionDirective));
-};
-TuiDropdownPositionSidedDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownPositionSidedDirective,
- selectors: [["", "tuiDropdownSided", ""]],
- inputs: {
- tuiDropdownSided: "tuiDropdownSided",
- tuiDropdownSidedOffset: "tuiDropdownSidedOffset"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([TuiDropdownPositionDirective, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsPositionAccessor)(TuiDropdownPositionSidedDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownPositionSidedDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiDropdownSided]',
- providers: [TuiDropdownPositionDirective, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsPositionAccessor)(TuiDropdownPositionSidedDirective)]
+ selector: '[ngSwitchCase]',
+ standalone: true
}]
}], function () {
return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_DROPDOWN_OPTIONS]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef
}, {
- type: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiRectAccessor,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_VIEWPORT]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef
}, {
- type: TuiDropdownPositionDirective,
+ type: NgSwitch,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiDropdownPositionDirective]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
+ }, {
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Host
}]
}];
}, {
- tuiDropdownSided: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- tuiDropdownSidedOffset: [{
+ ngSwitchCase: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}]
});
})();
-class TuiDropdownSelectionDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.TuiDriver {
- constructor(range, doc, selection$, el, vcr, dropdown) {
- super(subscriber => this.stream$.subscribe(subscriber));
- this.range = range;
- this.doc = doc;
- this.selection$ = selection$;
- this.el = el;
- this.vcr = vcr;
- this.dropdown = dropdown;
- this.handler$ = new rxjs__WEBPACK_IMPORTED_MODULE_36__.BehaviorSubject(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.ALWAYS_TRUE_HANDLER);
- this.stream$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_37__.combineLatest)([this.handler$, this.selection$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_23__.map)(() => this.getRange()), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_38__.distinctUntilChanged)((x, y) => x.startOffset === y.startOffset && x.endOffset === y.endOffset && x.commonAncestorContainer === y.commonAncestorContainer))]).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_23__.map)(([handler, range]) => {
- const contained = this.el.nativeElement.contains(range.commonAncestorContainer);
- this.range = contained && (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_33__.tuiIsTextNode)(range.commonAncestorContainer) ? range : this.range;
- return contained && handler(this.range) || this.inDropdown(range);
- }));
- this.position = 'selection';
- this.type = 'dropdown';
- }
- set tuiDropdownSelection(visible) {
- if (!(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiIsString)(visible)) {
- this.handler$.next(visible);
- }
- }
- getClientRect() {
- switch (this.position) {
- case 'tag':
- {
- const {
- commonAncestorContainer
- } = this.range;
- const element = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_33__.tuiIsElement)(commonAncestorContainer) ? commonAncestorContainer : commonAncestorContainer.parentNode;
- return element && (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_33__.tuiIsElement)(element) ? element.getBoundingClientRect() : _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.EMPTY_CLIENT_RECT;
- }
- case 'word':
- return (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_6__.tuiGetWordRange)(this.range).getBoundingClientRect();
- default:
- return this.range.getBoundingClientRect();
- }
- }
- ngOnDestroy() {
- if (this.ghost) {
- this.vcr.element.nativeElement.removeChild(this.ghost);
+/**
+ * @ngModule CommonModule
+ *
+ * @description
+ *
+ * Creates a view that is rendered when no `NgSwitchCase` expressions
+ * match the `NgSwitch` expression.
+ * This statement should be the final case in an `NgSwitch`.
+ *
+ * @publicApi
+ * @see {@link NgSwitch}
+ * @see {@link NgSwitchCase}
+ *
+ */
+class NgSwitchDefault {
+ constructor(viewContainer, templateRef, ngSwitch) {
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && !ngSwitch) {
+ throwNgSwitchProviderNotFoundError('ngSwitchDefault', 'NgSwitchDefault');
}
- }
- getRange() {
- const active = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_25__.tuiGetNativeFocused)(this.doc);
- const selection = this.doc.getSelection();
- const range = active && (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_33__.tuiIsTextfield)(active) && this.el.nativeElement.contains(active) ? this.veryVerySadInputFix(active) : (selection === null || selection === void 0 ? void 0 : selection.rangeCount) && selection.getRangeAt(0) || this.range;
- return range.cloneRange();
- }
- /**
- * Check if given range is at least partially inside dropdown
- */
- inDropdown(range) {
- const {
- startContainer,
- endContainer
- } = range;
- const {
- nativeElement
- } = this.el;
- const inDropdown = this.boxContains(range.commonAncestorContainer);
- const hostToDropdown = this.boxContains(endContainer) && nativeElement.contains(startContainer);
- const dropdownToHost = this.boxContains(startContainer) && nativeElement.contains(endContainer);
- return inDropdown || hostToDropdown || dropdownToHost;
- }
- veryVerySadInputFix(element) {
- const {
- ghost = this.initGhost(element)
- } = this;
- const {
- top,
- left,
- width,
- height
- } = element.getBoundingClientRect();
- const {
- selectionStart,
- selectionEnd,
- value
- } = element;
- const range = this.doc.createRange();
- const hostRect = this.el.nativeElement.getBoundingClientRect();
- ghost.style.top = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.tuiPx)(top - hostRect.top);
- ghost.style.left = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.tuiPx)(left - hostRect.left);
- ghost.style.width = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.tuiPx)(width);
- ghost.style.height = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.tuiPx)(height);
- ghost.textContent = _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.CHAR_ZERO_WIDTH_SPACE + value + _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.CHAR_NO_BREAK_SPACE;
- range.setStart(ghost.firstChild, selectionStart || 0);
- range.setEnd(ghost.firstChild, selectionEnd || 0);
- return range;
- }
- /**
- * Check if Node is inside dropdown
- */
- boxContains(node) {
- var _a;
- return !!((_a = this.dropdown.dropdownBoxRef) === null || _a === void 0 ? void 0 : _a.location.nativeElement.contains(node));
- }
- /**
- * Create an invisible DIV styled exactly like input/textarea element inside directive
- */
- initGhost(element) {
- const ghost = this.doc.createElement('div');
- const {
- font,
- letterSpacing,
- textTransform,
- padding
- } = getComputedStyle(element);
- ghost.style.position = 'absolute';
- ghost.style.pointerEvents = 'none';
- ghost.style.opacity = '0';
- ghost.style.whiteSpace = 'pre-wrap';
- ghost.style.font = font;
- ghost.style.letterSpacing = letterSpacing;
- ghost.style.textTransform = textTransform;
- ghost.style.padding = padding;
- this.vcr.element.nativeElement.appendChild(ghost);
- this.ghost = ghost;
- return ghost;
+ ngSwitch._addDefault(new SwitchView(viewContainer, templateRef));
}
}
-TuiDropdownSelectionDirective.ɵfac = function TuiDropdownSelectionDirective_Factory(t) {
- return new (t || TuiDropdownSelectionDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_34__.TUI_RANGE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_39__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_SELECTION_STREAM), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiDropdownDirective));
+_NgSwitchDefault = NgSwitchDefault;
+_NgSwitchDefault.ɵfac = function _NgSwitchDefault_Factory(t) {
+ return new (t || _NgSwitchDefault)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgSwitch, 9));
};
-TuiDropdownSelectionDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiDropdownSelectionDirective,
- selectors: [["", "tuiDropdown", "", "tuiDropdownSelection", ""]],
- inputs: {
- position: ["tuiDropdownSelectionPosition", "position"],
- tuiDropdownSelection: "tuiDropdownSelection"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsDriver)(TuiDropdownSelectionDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsRectAccessor)(TuiDropdownSelectionDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
+_NgSwitchDefault.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgSwitchDefault,
+ selectors: [["", "ngSwitchDefault", ""]],
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownSelectionDirective, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgSwitchDefault, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: '[tuiDropdown][tuiDropdownSelection]',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsDriver)(TuiDropdownSelectionDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_9__.tuiAsRectAccessor)(TuiDropdownSelectionDirective)]
+ selector: '[ngSwitchDefault]',
+ standalone: true
}]
}], function () {
return [{
- type: Range,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_34__.TUI_RANGE]
- }]
- }, {
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_39__.DOCUMENT]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_12__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_22__.TUI_SELECTION_STREAM]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef
}, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef
}, {
- type: TuiDropdownDirective,
+ type: NgSwitch,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiDropdownDirective]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
+ }, {
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Host
}]
}];
- }, {
- position: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiDropdownSelectionPosition']
- }],
- tuiDropdownSelection: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiDropdownModule {}
-TuiDropdownModule.ɵfac = function TuiDropdownModule_Factory(t) {
- return new (t || TuiDropdownModule)();
-};
-TuiDropdownModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiDropdownModule
-});
-TuiDropdownModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_3__.PolymorpheusModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_30__.TuiActiveZoneModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_31__.TuiOverscrollModule, _taiga_ui_core_components_scrollbar__WEBPACK_IMPORTED_MODULE_29__.TuiScrollbarModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.TuiHoveredModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDropdownModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_3__.PolymorpheusModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_30__.TuiActiveZoneModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_31__.TuiOverscrollModule, _taiga_ui_core_components_scrollbar__WEBPACK_IMPORTED_MODULE_29__.TuiScrollbarModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.TuiHoveredModule],
- declarations: [TuiDropdownDirective, TuiDropdownComponent, TuiDropdownOpenDirective, TuiDropdownOptionsDirective, TuiDropdownHostDirective, TuiDropdownDriverDirective, TuiDropdownManualDirective, TuiDropdownHoverDirective, TuiDropdownContextDirective, TuiDropdownPositionDirective, TuiDropdownPositionSidedDirective, TuiDropdownSelectionDirective],
- exports: [TuiDropdownDirective, TuiDropdownComponent, TuiDropdownOpenDirective, TuiDropdownOptionsDirective, TuiDropdownHostDirective, TuiDropdownDriverDirective, TuiDropdownManualDirective, TuiDropdownHoverDirective, TuiDropdownContextDirective, TuiDropdownPositionDirective, TuiDropdownPositionSidedDirective, TuiDropdownSelectionDirective]
- }]
- }], null, null);
+ }, null);
})();
+function throwNgSwitchProviderNotFoundError(attrName, directiveName) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2000 /* RuntimeErrorCode.PARENT_NG_SWITCH_NOT_FOUND */, `An element with the "${attrName}" attribute ` + `(matching the "${directiveName}" directive) must be located inside an element with the "ngSwitch" attribute ` + `(matching "NgSwitch" directive)`);
+}
/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 7169:
-/*!*******************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-directives-hint.js ***!
- \*******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_HINT_COMPONENT: () => (/* binding */ TUI_HINT_COMPONENT),
-/* harmony export */ TUI_HINT_DEFAULT_OPTIONS: () => (/* binding */ TUI_HINT_DEFAULT_OPTIONS),
-/* harmony export */ TUI_HINT_OPTIONS: () => (/* binding */ TUI_HINT_OPTIONS),
-/* harmony export */ TuiHintComponent: () => (/* binding */ TuiHintComponent),
-/* harmony export */ TuiHintDescribeDirective: () => (/* binding */ TuiHintDescribeDirective),
-/* harmony export */ TuiHintDirective: () => (/* binding */ TuiHintDirective),
-/* harmony export */ TuiHintDriverDirective: () => (/* binding */ TuiHintDriverDirective),
-/* harmony export */ TuiHintHostDirective: () => (/* binding */ TuiHintHostDirective),
-/* harmony export */ TuiHintHoverDirective: () => (/* binding */ TuiHintHoverDirective),
-/* harmony export */ TuiHintManualDirective: () => (/* binding */ TuiHintManualDirective),
-/* harmony export */ TuiHintModule: () => (/* binding */ TuiHintModule),
-/* harmony export */ TuiHintOptionsDirective: () => (/* binding */ TuiHintOptionsDirective),
-/* harmony export */ TuiHintPointerDirective: () => (/* binding */ TuiHintPointerDirective),
-/* harmony export */ TuiHintPositionDirective: () => (/* binding */ TuiHintPositionDirective),
-/* harmony export */ TuiHintUnstyledComponent: () => (/* binding */ TuiHintUnstyledComponent),
-/* harmony export */ TuiHintUnstyledDirective: () => (/* binding */ TuiHintUnstyledDirective),
-/* harmony export */ tuiHintOptionsProvider: () => (/* binding */ tuiHintOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/cdk */ 625);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @taiga-ui/cdk */ 293);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @taiga-ui/cdk */ 4333);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @taiga-ui/cdk */ 2515);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @taiga-ui/cdk */ 9291);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! @taiga-ui/cdk */ 3406);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/core/abstract */ 9139);
-/* harmony import */ var _taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! @taiga-ui/core/animations */ 6270);
-/* harmony import */ var _taiga_ui_core_directives_mode__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! @taiga-ui/core/directives/mode */ 7279);
-/* harmony import */ var _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/core/services */ 1717);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var _taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/utils */ 2189);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 5171);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs/operators */ 2393);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! rxjs/operators */ 1856);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 1969);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! rxjs/operators */ 417);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! rxjs/operators */ 9473);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 3150);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! rxjs */ 1151);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! rxjs */ 5219);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! rxjs */ 5536);
-/* harmony import */ var _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @taiga-ui/core/constants */ 6628);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/**
- * A component to display a hint
+ * @ngModule CommonModule
+ *
+ * @usageNotes
+ * ```
+ *
+ * there is nothing
+ * there is one
+ * there are a few
+ *
+ * ```
+ *
+ * @description
+ *
+ * Adds / removes DOM sub-trees based on a numeric value. Tailored for pluralization.
+ *
+ * Displays DOM sub-trees that match the switch expression value, or failing that, DOM sub-trees
+ * that match the switch expression's pluralization category.
+ *
+ * To use this directive you must provide a container element that sets the `[ngPlural]` attribute
+ * to a switch expression. Inner elements with a `[ngPluralCase]` will display based on their
+ * expression:
+ * - if `[ngPluralCase]` is set to a value starting with `=`, it will only display if the value
+ * matches the switch expression exactly,
+ * - otherwise, the view will be treated as a "category match", and will only display if exact
+ * value matches aren't found and the value maps to its category for the defined locale.
+ *
+ * See http://cldr.unicode.org/index/cldr-spec/plural-rules
+ *
+ * @publicApi
*/
-function TuiHintComponent_span_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "span", 1);
+class NgPlural {
+ constructor(_localization) {
+ this._localization = _localization;
+ this._caseViews = {};
}
- if (rf & 2) {
- const text_r1 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("innerHTML", text_r1, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]);
+ set ngPlural(value) {
+ this._updateView(value);
}
-}
-const _c0 = ["*"];
-function TuiHintUnstyledComponent_ng_container_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainer"](0);
+ addCase(value, switchView) {
+ this._caseViews[value] = switchView;
}
-}
-const TUI_HINT_COMPONENT = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateTokenFromFactory)(() => TuiHintComponent);
-
-/** Default values for hint options */
-const TUI_HINT_DEFAULT_OPTIONS = {
- direction: 'bottom-left',
- showDelay: 500,
- hideDelay: 200,
- appearance: '',
- icon: 'tuiIconHelpCircle'
-};
-/**
- * Default parameters for hint directive
- */
-const TUI_HINT_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)(TUI_HINT_DEFAULT_OPTIONS);
-const tuiHintOptionsProvider = override => ({
- provide: TUI_HINT_OPTIONS,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), TuiHintOptionsDirective], [new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), new _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf(), TUI_HINT_OPTIONS]],
- useFactory: (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_2__.tuiOverrideOptions)(override, TUI_HINT_DEFAULT_OPTIONS)
-});
-class TuiHintOptionsDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.AbstractTuiController {
- constructor(options) {
- super();
- this.options = options;
- this.direction = this.options.direction;
- this.appearance = this.options.appearance;
- this.showDelay = this.options.showDelay;
- this.hideDelay = this.options.hideDelay;
- this.icon = this.options.icon;
+ _updateView(switchValue) {
+ this._clearViews();
+ const cases = Object.keys(this._caseViews);
+ const key = getPluralCategory(switchValue, cases, this._localization);
+ this._activateView(this._caseViews[key]);
+ }
+ _clearViews() {
+ if (this._activeView) this._activeView.destroy();
+ }
+ _activateView(view) {
+ if (view) {
+ this._activeView = view;
+ this._activeView.create();
+ }
}
}
-TuiHintOptionsDirective.ɵfac = function TuiHintOptionsDirective_Factory(t) {
- return new (t || TuiHintOptionsDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_HINT_OPTIONS, 4));
+_NgPlural = NgPlural;
+_NgPlural.ɵfac = function _NgPlural_Factory(t) {
+ return new (t || _NgPlural)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgLocalization));
};
-TuiHintOptionsDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintOptionsDirective,
- selectors: [["", "tuiHintContent", ""]],
+_NgPlural.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgPlural,
+ selectors: [["", "ngPlural", ""]],
inputs: {
- content: ["tuiHintContent", "content"],
- direction: ["tuiHintDirection", "direction"],
- appearance: ["tuiHintAppearance", "appearance"],
- showDelay: ["tuiHintShowDelay", "showDelay"],
- hideDelay: ["tuiHintHideDelay", "hideDelay"]
+ ngPlural: "ngPlural"
},
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: TUI_HINT_OPTIONS,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => TuiHintOptionsDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintOptionsDirective, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgPlural, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: '[tuiHintContent]',
- providers: [{
- provide: TUI_HINT_OPTIONS,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => TuiHintOptionsDirective)
- }]
+ selector: '[ngPlural]',
+ standalone: true
}]
}], function () {
return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_HINT_OPTIONS]
- }]
+ type: NgLocalization
}];
}, {
- content: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiHintContent']
- }],
- direction: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiHintDirection']
- }],
- appearance: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiHintAppearance']
- }],
- showDelay: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiHintShowDelay']
- }],
- hideDelay: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiHintHideDelay']
+ ngPlural: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}]
});
})();
-class TuiHintDirective {
- constructor(el, component, hintService, options, activeZone) {
- this.el = el;
- this.component = component;
- this.hintService = hintService;
- this.options = options;
- this.activeZone = activeZone;
- this.tuiHintAppearance = null;
- this.type = 'hint';
- }
- set tuiHint(content) {
- this.content = content;
- if (!content) {
- this.toggle(false);
- }
- }
- get appearance() {
- var _a;
- return (_a = this.tuiHintAppearance) !== null && _a !== void 0 ? _a : this.options.appearance;
- }
- ngOnDestroy() {
- this.toggle(false);
- }
- getClientRect() {
- return this.el.nativeElement.getBoundingClientRect();
- }
- toggle(show) {
- if (show && this.content) {
- this.hintService.add(this);
- } else {
- this.hintService.remove(this);
- }
+/**
+ * @ngModule CommonModule
+ *
+ * @description
+ *
+ * Creates a view that will be added/removed from the parent {@link NgPlural} when the
+ * given expression matches the plural expression according to CLDR rules.
+ *
+ * @usageNotes
+ * ```
+ *
+ * ...
+ * ...
+ *
+ *```
+ *
+ * See {@link NgPlural} for more details and example.
+ *
+ * @publicApi
+ */
+class NgPluralCase {
+ constructor(value, template, viewContainer, ngPlural) {
+ this.value = value;
+ const isANumber = !isNaN(Number(value));
+ ngPlural.addCase(isANumber ? `=${value}` : value, new SwitchView(viewContainer, template));
}
}
-TuiHintDirective.ɵfac = function TuiHintDirective_Factory(t) {
- return new (t || TuiHintDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusComponent), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiHintService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_HINT_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TuiActiveZoneDirective, 8));
+_NgPluralCase = NgPluralCase;
+_NgPluralCase.ɵfac = function _NgPluralCase_Factory(t) {
+ return new (t || _NgPluralCase)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinjectAttribute"]('ngPluralCase'), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgPlural, 1));
};
-TuiHintDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintDirective,
- selectors: [["", "tuiHint", "", 5, "ng-container", 5, "ng-template"]],
- inputs: {
- tuiHint: "tuiHint",
- context: ["tuiHintContext", "context"],
- tuiHintAppearance: "tuiHintAppearance"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsRectAccessor)(TuiHintDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsVehicle)(TuiHintDirective), {
- provide: _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusComponent,
- deps: [TUI_HINT_COMPONENT, _angular_core__WEBPACK_IMPORTED_MODULE_0__.INJECTOR],
- useClass: _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusComponent
- }])]
+_NgPluralCase.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgPluralCase,
+ selectors: [["", "ngPluralCase", ""]],
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintDirective, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgPluralCase, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: '[tuiHint]:not(ng-container):not(ng-template)',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsRectAccessor)(TuiHintDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsVehicle)(TuiHintDirective), {
- provide: _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusComponent,
- deps: [TUI_HINT_COMPONENT, _angular_core__WEBPACK_IMPORTED_MODULE_0__.INJECTOR],
- useClass: _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusComponent
- }]
+ selector: '[ngPluralCase]',
+ standalone: true
}]
}], function () {
return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
+ type: undefined,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Attribute,
+ args: ['ngPluralCase']
}]
}, {
- type: _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusComponent,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusComponent]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef
}, {
- type: _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiHintService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiHintService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_HINT_OPTIONS]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef
}, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TuiActiveZoneDirective,
+ type: NgPlural,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TuiActiveZoneDirective]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Host
}]
}];
- }, {
- tuiHint: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- context: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiHintContext']
- }],
- tuiHintAppearance: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
+ }, null);
})();
-/* eslint-disable rxjs/no-unsafe-takeuntil */
-class TuiHintHoverDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiDriver {
- constructor(hovered$, options, el, parent) {
- super(subscriber => this.stream$.subscribe(subscriber));
- this.hovered$ = hovered$;
- this.options = options;
- this.el = el;
- this.parent = parent;
- this.visible = false;
- this.toggle$ = new rxjs__WEBPACK_IMPORTED_MODULE_8__.Subject();
- this.stream$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.merge)(this.toggle$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.switchMap)(visible => (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.of)(visible).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.delay)(visible ? 0 : this.hideDelay))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.takeUntil)(this.hovered$), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.repeat)()), this.hovered$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.switchMap)(visible => (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.of)(visible).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.delay)(visible ? this.showDelay : this.hideDelay))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.takeUntil)(this.toggle$), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.repeat)())).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_15__.filter)(() => this.enabled), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.map)(value => value && (this.el.nativeElement.hasAttribute('tuiHintPointer') || !(0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_2__.tuiIsObscured)(this.el.nativeElement))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.tap)(visible => {
- this.visible = visible;
- }));
- this.showDelay = this.options.showDelay;
- this.hideDelay = this.options.hideDelay;
- this.type = 'hint';
- this.enabled = true;
+/**
+ * @ngModule CommonModule
+ *
+ * @usageNotes
+ *
+ * Set the font of the containing element to the result of an expression.
+ *
+ * ```
+ * ...
+ * ```
+ *
+ * Set the width of the containing element to a pixel value returned by an expression.
+ *
+ * ```
+ * ...
+ * ```
+ *
+ * Set a collection of style values using an expression that returns key-value pairs.
+ *
+ * ```
+ * ...
+ * ```
+ *
+ * @description
+ *
+ * An attribute directive that updates styles for the containing HTML element.
+ * Sets one or more style properties, specified as colon-separated key-value pairs.
+ * The key is a style name, with an optional `.` suffix
+ * (such as 'top.px', 'font-style.em').
+ * The value is an expression to be evaluated.
+ * The resulting non-null value, expressed in the given unit,
+ * is assigned to the given style property.
+ * If the result of evaluation is null, the corresponding style is removed.
+ *
+ * @publicApi
+ */
+class NgStyle {
+ constructor(_ngEl, _differs, _renderer) {
+ this._ngEl = _ngEl;
+ this._differs = _differs;
+ this._renderer = _renderer;
+ this._ngStyle = null;
+ this._differ = null;
}
- toggle(visible = !this.visible) {
- var _a;
- this.toggle$.next(visible);
- (_a = this.parent) === null || _a === void 0 ? void 0 : _a.toggle(visible);
+ set ngStyle(values) {
+ this._ngStyle = values;
+ if (!this._differ && values) {
+ this._differ = this._differs.find(values).create();
+ }
+ }
+ ngDoCheck() {
+ if (this._differ) {
+ const changes = this._differ.diff(this._ngStyle);
+ if (changes) {
+ this._applyChanges(changes);
+ }
+ }
+ }
+ _setStyle(nameAndUnit, value) {
+ const [name, unit] = nameAndUnit.split('.');
+ const flags = name.indexOf('-') === -1 ? undefined : _angular_core__WEBPACK_IMPORTED_MODULE_0__.RendererStyleFlags2.DashCase;
+ if (value != null) {
+ this._renderer.setStyle(this._ngEl.nativeElement, name, unit ? `${value}${unit}` : value, flags);
+ } else {
+ this._renderer.removeStyle(this._ngEl.nativeElement, name, flags);
+ }
+ }
+ _applyChanges(changes) {
+ changes.forEachRemovedItem(record => this._setStyle(record.key, null));
+ changes.forEachAddedItem(record => this._setStyle(record.key, record.currentValue));
+ changes.forEachChangedItem(record => this._setStyle(record.key, record.currentValue));
}
}
-TuiHintHoverDirective.ɵfac = function TuiHintHoverDirective_Factory(t) {
- return new (t || TuiHintHoverDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiHoveredService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_HINT_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiHintHoverDirective, 12));
+_NgStyle = NgStyle;
+_NgStyle.ɵfac = function _NgStyle_Factory(t) {
+ return new (t || _NgStyle)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2));
};
-TuiHintHoverDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintHoverDirective,
- selectors: [["", "tuiHint", "", 5, "ng-container", 5, "ng-template"]],
+_NgStyle.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgStyle,
+ selectors: [["", "ngStyle", ""]],
inputs: {
- showDelay: ["tuiHintShowDelay", "showDelay"],
- hideDelay: ["tuiHintHideDelay", "hideDelay"]
+ ngStyle: "ngStyle"
},
- exportAs: ["tuiHintHover"],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsDriver)(TuiHintHoverDirective), _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiHoveredService]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintHoverDirective, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgStyle, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: '[tuiHint]:not(ng-container):not(ng-template)',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsDriver)(TuiHintHoverDirective), _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiHoveredService],
- exportAs: 'tuiHintHover'
+ selector: '[ngStyle]',
+ standalone: true
}]
}], function () {
return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_19__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiHoveredService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_HINT_OPTIONS]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef
}, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers
}, {
- type: TuiHintHoverDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.SkipSelf
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiHintHoverDirective]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2
}];
}, {
- showDelay: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiHintShowDelay']
- }],
- hideDelay: [{
+ ngStyle: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiHintHideDelay']
- }]
- });
-})();
-class TuiHintPointerDirective extends TuiHintHoverDirective {
- constructor() {
- super(...arguments);
- this.currentRect = _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.EMPTY_CLIENT_RECT;
- }
- onMove({
- clientX,
- clientY
- }) {
- this.currentRect = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_21__.tuiPointToClientRect)(clientX, clientY);
- }
- getClientRect() {
- return this.currentRect;
- }
-}
-TuiHintPointerDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiHintPointerDirective_BaseFactory;
- return function TuiHintPointerDirective_Factory(t) {
- return (ɵTuiHintPointerDirective_BaseFactory || (ɵTuiHintPointerDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](TuiHintPointerDirective)))(t || TuiHintPointerDirective);
- };
-}();
-TuiHintPointerDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintPointerDirective,
- selectors: [["", "tuiHint", "", "tuiHintPointer", ""]],
- hostBindings: function TuiHintPointerDirective_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("mousemove.silent", function TuiHintPointerDirective_mousemove_silent_HostBindingHandler($event) {
- return ctx.onMove($event);
- });
- }
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsRectAccessor)(TuiHintPointerDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsDriver)(TuiHintPointerDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintPointerDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiHint][tuiHintPointer]',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsRectAccessor)(TuiHintPointerDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsDriver)(TuiHintPointerDirective)]
- }]
- }], null, {
- onMove: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['mousemove.silent', ['$event']]
+ args: ['ngStyle']
}]
});
})();
-const OFFSET = 8;
-const ARROW_OFFSET = 22;
-const TOP = 0;
-const LEFT = 1;
-class TuiHintPositionDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiPositionAccessor {
- constructor(options, viewport, directive, accessors) {
- super();
- this.options = options;
- this.viewport = viewport;
- this.directive = directive;
- this.accessors = accessors;
- this.points = _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_22__.TUI_HINT_DIRECTIONS.reduce((acc, direction) => Object.assign(Object.assign({}, acc), {
- [direction]: [0, 0]
- }), {});
- this.direction = this.options.direction;
- this.type = 'hint';
+
+/**
+ * @ngModule CommonModule
+ *
+ * @description
+ *
+ * Inserts an embedded view from a prepared `TemplateRef`.
+ *
+ * You can attach a context object to the `EmbeddedViewRef` by setting `[ngTemplateOutletContext]`.
+ * `[ngTemplateOutletContext]` should be an object, the object's keys will be available for binding
+ * by the local template `let` declarations.
+ *
+ * @usageNotes
+ * ```
+ *
+ * ```
+ *
+ * Using the key `$implicit` in the context object will set its value as default.
+ *
+ * ### Example
+ *
+ * {@example common/ngTemplateOutlet/ts/module.ts region='NgTemplateOutlet'}
+ *
+ * @publicApi
+ */
+class NgTemplateOutlet {
+ constructor(_viewContainerRef) {
+ this._viewContainerRef = _viewContainerRef;
+ this._viewRef = null;
+ /**
+ * A context object to attach to the {@link EmbeddedViewRef}. This should be an
+ * object, the object's keys will be available for binding by the local template `let`
+ * declarations.
+ * Using the key `$implicit` in the context object will set its value as default.
+ */
+ this.ngTemplateOutletContext = null;
+ /**
+ * A string defining the template reference and optionally the context object for the template.
+ */
+ this.ngTemplateOutlet = null;
+ /** Injector to be used within the embedded view. */
+ this.ngTemplateOutletInjector = null;
}
- getPosition({
- width,
- height
- }) {
- var _a, _b;
- const hostRect = (_b = (_a = this.accessor) === null || _a === void 0 ? void 0 : _a.getClientRect()) !== null && _b !== void 0 ? _b : _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.EMPTY_CLIENT_RECT;
- const leftCenter = hostRect.left + hostRect.width / 2;
- const topCenter = hostRect.top + hostRect.height / 2;
- this.points['top-left'][TOP] = hostRect.top - height - OFFSET;
- this.points['top-left'][LEFT] = leftCenter - width + ARROW_OFFSET;
- this.points.top[TOP] = this.points['top-left'][TOP];
- this.points.top[LEFT] = leftCenter - width / 2;
- this.points['top-right'][TOP] = this.points['top-left'][TOP];
- this.points['top-right'][LEFT] = leftCenter - ARROW_OFFSET;
- this.points['bottom-left'][TOP] = hostRect.bottom + OFFSET;
- this.points['bottom-left'][LEFT] = this.points['top-left'][LEFT];
- this.points.bottom[TOP] = this.points['bottom-left'][TOP];
- this.points.bottom[LEFT] = this.points.top[LEFT];
- this.points['bottom-right'][TOP] = this.points['bottom-left'][TOP];
- this.points['bottom-right'][LEFT] = this.points['top-right'][LEFT];
- this.points['left-top'][TOP] = topCenter - height + ARROW_OFFSET;
- this.points['left-top'][LEFT] = hostRect.left - width - OFFSET;
- this.points.left[TOP] = topCenter - height / 2;
- this.points.left[LEFT] = this.points['left-top'][LEFT];
- this.points['left-bottom'][TOP] = topCenter - ARROW_OFFSET;
- this.points['left-bottom'][LEFT] = this.points['left-top'][LEFT];
- this.points['right-top'][TOP] = this.points['left-top'][TOP];
- this.points['right-top'][LEFT] = hostRect.right + OFFSET;
- this.points.right[TOP] = this.points.left[TOP];
- this.points.right[LEFT] = this.points['right-top'][LEFT];
- this.points['right-bottom'][TOP] = this.points['left-bottom'][TOP];
- this.points['right-bottom'][LEFT] = this.points['right-top'][LEFT];
- if (this.checkPosition(this.points[this.direction], width, height)) {
- return this.points[this.direction];
+ /** @nodoc */
+ ngOnChanges(changes) {
+ if (changes['ngTemplateOutlet'] || changes['ngTemplateOutletInjector']) {
+ const viewContainerRef = this._viewContainerRef;
+ if (this._viewRef) {
+ viewContainerRef.remove(viewContainerRef.indexOf(this._viewRef));
+ }
+ if (this.ngTemplateOutlet) {
+ const {
+ ngTemplateOutlet: template,
+ ngTemplateOutletContext: context,
+ ngTemplateOutletInjector: injector
+ } = this;
+ this._viewRef = viewContainerRef.createEmbeddedView(template, context, injector ? {
+ injector
+ } : undefined);
+ } else {
+ this._viewRef = null;
+ }
+ } else if (this._viewRef && changes['ngTemplateOutletContext'] && this.ngTemplateOutletContext) {
+ this._viewRef.context = this.ngTemplateOutletContext;
}
- const direction = _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_22__.TUI_HINT_DIRECTIONS.find(direction => this.checkPosition(this.points[direction], width, height));
- return this.points[direction || this.fallback];
- }
- get accessor() {
- return (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiFallbackRectAccessor)('hint')(this.accessors, this.directive);
- }
- get fallback() {
- return this.points.top[TOP] > this.viewport.getClientRect().bottom - this.points.bottom[TOP] ? 'top' : 'bottom';
- }
- checkPosition([top, left], width, height) {
- const viewport = this.viewport.getClientRect();
- return top > OFFSET / 4 && left > OFFSET / 4 && top + height < viewport.bottom - OFFSET / 4 && left + width < viewport.right - OFFSET / 4;
}
}
-TuiHintPositionDirective.ɵfac = function TuiHintPositionDirective_Factory(t) {
- return new (t || TuiHintPositionDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_HINT_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_23__.TUI_VIEWPORT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiHintDirective), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiRectAccessor));
+_NgTemplateOutlet = NgTemplateOutlet;
+_NgTemplateOutlet.ɵfac = function _NgTemplateOutlet_Factory(t) {
+ return new (t || _NgTemplateOutlet)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef));
};
-TuiHintPositionDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintPositionDirective,
- selectors: [["", "tuiHint", "", 5, "ng-container", 5, "ng-template"]],
+_NgTemplateOutlet.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgTemplateOutlet,
+ selectors: [["", "ngTemplateOutlet", ""]],
inputs: {
- direction: ["tuiHintDirection", "direction"]
+ ngTemplateOutletContext: "ngTemplateOutletContext",
+ ngTemplateOutlet: "ngTemplateOutlet",
+ ngTemplateOutletInjector: "ngTemplateOutletInjector"
},
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
+ standalone: true,
+ features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]]
});
-(0,tslib__WEBPACK_IMPORTED_MODULE_24__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_25__.tuiPure], TuiHintPositionDirective.prototype, "accessor", null);
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintPositionDirective, [{
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgTemplateOutlet, [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
args: [{
- selector: '[tuiHint]:not(ng-container):not(ng-template)'
+ selector: '[ngTemplateOutlet]',
+ standalone: true
}]
}], function () {
return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_HINT_OPTIONS]
- }]
- }, {
- type: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiRectAccessor,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_23__.TUI_VIEWPORT]
- }]
- }, {
- type: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiRectAccessor,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiHintDirective]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiRectAccessor]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewContainerRef
}];
}, {
- direction: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
- args: ['tuiHintDirection']
+ ngTemplateOutletContext: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }],
+ ngTemplateOutlet: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}],
- accessor: []
+ ngTemplateOutletInjector: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }]
});
})();
-const GAP = 4;
-class TuiHintComponent {
- constructor(hovered$, position$, destroy$, animation, pointer, accessor, el, polymorpheus, hover, mode, vvs, viewport) {
- var _a;
- this.animation = animation;
- this.pointer = pointer;
- this.accessor = accessor;
- this.el = el;
- this.polymorpheus = polymorpheus;
- this.hover = hover;
- this.mode = mode;
- this.vvs = vvs;
- this.viewport = viewport;
- this.appearance = this.polymorpheus.$implicit.appearance || ((_a = this.mode) === null || _a === void 0 ? void 0 : _a.mode);
- position$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.map)(point => this.vvs.correct(point)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.takeUntil)(destroy$)).subscribe(([top, left]) => {
- this.update(top, left);
- });
- hovered$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_13__.takeUntil)(destroy$)).subscribe(hover => this.hover.toggle(hover));
+
+/**
+ * A collection of Angular directives that are likely to be used in each and every Angular
+ * application.
+ */
+const COMMON_DIRECTIVES = [NgClass, NgComponentOutlet, NgForOf, NgIf, NgTemplateOutlet, NgStyle, NgSwitch, NgSwitchCase, NgSwitchDefault, NgPlural, NgPluralCase];
+function invalidPipeArgumentError(type, value) {
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2100 /* RuntimeErrorCode.INVALID_PIPE_ARGUMENT */, ngDevMode && `InvalidPipeArgument: '${value}' for pipe '${(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵstringify"])(type)}'`);
+}
+class SubscribableStrategy {
+ createSubscription(async, updateLatestValue) {
+ // Subscription can be side-effectful, and we don't want any signal reads which happen in the
+ // side effect of the subscription to be tracked by a component's template when that
+ // subscription is triggered via the async pipe. So we wrap the subscription in `untracked` to
+ // decouple from the current reactive context.
+ //
+ // `untracked` also prevents signal _writes_ which happen in the subscription side effect from
+ // being treated as signal writes during the template evaluation (which throws errors).
+ return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.untracked)(() => async.subscribe({
+ next: updateLatestValue,
+ error: e => {
+ throw e;
+ }
+ }));
}
- get content() {
- return this.polymorpheus.$implicit.content;
+ dispose(subscription) {
+ // See the comment in `createSubscription` above on the use of `untracked`.
+ (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.untracked)(() => subscription.unsubscribe());
}
- get context() {
- return this.polymorpheus.$implicit.context;
+}
+class PromiseStrategy {
+ createSubscription(async, updateLatestValue) {
+ return async.then(updateLatestValue, e => {
+ throw e;
+ });
}
- onClick(target) {
- if (!target.closest('tui-hint') && !this.hover.el.nativeElement.contains(target) || (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_2__.tuiIsObscured)(this.hover.el.nativeElement)) {
- this.hover.toggle(false);
+ dispose(subscription) {}
+}
+const _promiseStrategy = new PromiseStrategy();
+const _subscribableStrategy = new SubscribableStrategy();
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Unwraps a value from an asynchronous primitive.
+ *
+ * The `async` pipe subscribes to an `Observable` or `Promise` and returns the latest value it has
+ * emitted. When a new value is emitted, the `async` pipe marks the component to be checked for
+ * changes. When the component gets destroyed, the `async` pipe unsubscribes automatically to avoid
+ * potential memory leaks. When the reference of the expression changes, the `async` pipe
+ * automatically unsubscribes from the old `Observable` or `Promise` and subscribes to the new one.
+ *
+ * @usageNotes
+ *
+ * ### Examples
+ *
+ * This example binds a `Promise` to the view. Clicking the `Resolve` button resolves the
+ * promise.
+ *
+ * {@example common/pipes/ts/async_pipe.ts region='AsyncPipePromise'}
+ *
+ * It's also possible to use `async` with Observables. The example below binds the `time` Observable
+ * to the view. The Observable continuously updates the view with the current time.
+ *
+ * {@example common/pipes/ts/async_pipe.ts region='AsyncPipeObservable'}
+ *
+ * @publicApi
+ */
+class AsyncPipe {
+ constructor(ref) {
+ this._latestValue = null;
+ this._subscription = null;
+ this._obj = null;
+ this._strategy = null;
+ // Assign `ref` into `this._ref` manually instead of declaring `_ref` in the constructor
+ // parameter list, as the type of `this._ref` includes `null` unlike the type of `ref`.
+ this._ref = ref;
+ }
+ ngOnDestroy() {
+ if (this._subscription) {
+ this._dispose();
}
+ // Clear the `ChangeDetectorRef` and its association with the view data, to mitigate
+ // potential memory leaks in Observables that could otherwise cause the view data to
+ // be retained.
+ // https://github.com/angular/angular/issues/17624
+ this._ref = null;
}
- update(top, left) {
- if (!this.hover.el.nativeElement.isConnected) {
- this.hover.toggle(false);
- return;
+ transform(obj) {
+ if (!this._obj) {
+ if (obj) {
+ this._subscribe(obj);
+ }
+ return this._latestValue;
}
- const {
- height,
- width
- } = this.el.nativeElement.getBoundingClientRect();
- const {
- style
- } = this.el.nativeElement;
- const rect = this.accessor.getClientRect();
- const viewport = this.viewport.getClientRect();
- if (rect === _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.EMPTY_CLIENT_RECT) {
- return;
+ if (obj !== this._obj) {
+ this._dispose();
+ return this.transform(obj);
}
- const safeLeft = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.tuiClamp)(left, GAP, viewport.width - width - GAP);
- const [beakTop, beakLeft] = this.vvs.correct([rect.top + rect.height / 2 - top, rect.left + rect.width / 2 - safeLeft]);
- style.top = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_27__.tuiPx)(top);
- style.left = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_27__.tuiPx)(safeLeft);
- style.setProperty('--top', (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_27__.tuiPx)((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.tuiClamp)(beakTop, 0.5, height - 1)));
- style.setProperty('--left', (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_27__.tuiPx)((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.tuiClamp)(beakLeft, 0.5, width - 1)));
+ return this._latestValue;
}
-}
-TuiHintComponent.ɵfac = function TuiHintComponent_Factory(t) {
- return new (t || TuiHintComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiHoveredService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiPositionService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_28__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_23__.TUI_ANIMATION_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiHintPointerDirective, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiRectAccessor), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.POLYMORPHEUS_CONTEXT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiHintHoverDirective), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_directives_mode__WEBPACK_IMPORTED_MODULE_29__.TuiModeDirective, 8), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiVisualViewportService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_23__.TUI_VIEWPORT));
-};
-TuiHintComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiHintComponent,
- selectors: [["tui-hint"]],
- hostVars: 4,
- hostBindings: function TuiHintComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function TuiHintComponent_click_HostBindingHandler($event) {
- return ctx.onClick($event.target);
- }, false, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresolveDocument"]);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-appearance", ctx.appearance);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsyntheticHostProperty"]("@tuiFadeIn", ctx.animation);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_untouchable", ctx.pointer);
+ _subscribe(obj) {
+ this._obj = obj;
+ this._strategy = this._selectStrategy(obj);
+ this._subscription = this._strategy.createSubscription(obj, value => this._updateLatestValue(obj, value));
+ }
+ _selectStrategy(obj) {
+ if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisPromise"])(obj)) {
+ return _promiseStrategy;
}
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_28__.TuiDestroyService, _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiPositionService, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiHoveredService, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiPositionAccessorFor)('hint', TuiHintPositionDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiRectAccessorFor)('hint', TuiHintDirective)])],
- ngContentSelectors: _c0,
- decls: 2,
- vars: 2,
- consts: [[3, "innerHTML", 4, "polymorpheusOutlet", "polymorpheusOutletContext"], [3, "innerHTML"]],
- template: function TuiHintComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiHintComponent_span_1_Template, 1, 1, "span", 0);
+ if ((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵisSubscribable"])(obj)) {
+ return _subscribableStrategy;
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx.content)("polymorpheusOutletContext", ctx.context);
+ throw invalidPipeArgumentError(AsyncPipe, obj);
+ }
+ _dispose() {
+ // Note: `dispose` is only called if a subscription has been initialized before, indicating
+ // that `this._strategy` is also available.
+ this._strategy.dispose(this._subscription);
+ this._latestValue = null;
+ this._subscription = null;
+ this._obj = null;
+ }
+ _updateLatestValue(async, value) {
+ if (async === this._obj) {
+ this._latestValue = value;
+ // Note: `this._ref` is only cleared in `ngOnDestroy` so is known to be available when a
+ // value is being updated.
+ this._ref.markForCheck();
}
- },
- dependencies: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusOutletDirective],
- styles: ["[_nghost-%COMP%]{position:absolute;max-width:18rem;min-height:var(--tui-height-m);padding:.75rem 1rem;background:var(--tui-primary);border-radius:var(--tui-radius-l);color:var(--tui-primary-text);box-sizing:border-box;font:var(--tui-font-text-s);white-space:pre-line;word-wrap:break-word;line-height:1.25rem}[_nghost-%COMP%]:before{content:\"\";position:absolute;top:var(--top);left:var(--left);width:.5rem;height:.5rem;border-radius:.125rem;box-sizing:border-box;background:inherit;transform:translate(-50%,-50%) rotate(45deg)}[data-appearance=error][_nghost-%COMP%]{background:var(--tui-error-fill)}[data-appearance=onDark][_nghost-%COMP%]{background:var(--tui-elevation-02);color:var(--tui-text-01);filter:drop-shadow(0 0 .125rem rgba(0,0,0,.16)) drop-shadow(0 1.5rem 1rem rgba(0,0,0,.03)) drop-shadow(0 .75rem .75rem rgba(0,0,0,.04)) drop-shadow(0 .25rem .375rem rgba(0,0,0,.05))}[_nghost-%COMP%]:not([style*=\"top\"]){visibility:hidden}._untouchable[_nghost-%COMP%]{pointer-events:none}"],
- data: {
- animation: [_taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_30__.tuiFadeIn]
- },
- changeDetection: 0
+ }
+}
+_AsyncPipe = AsyncPipe;
+_AsyncPipe.ɵfac = function _AsyncPipe_Factory(t) {
+ return new (t || _AsyncPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef, 16));
+};
+_AsyncPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "async",
+ type: _AsyncPipe,
+ pure: false,
+ standalone: true
});
-(0,tslib__WEBPACK_IMPORTED_MODULE_24__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_25__.tuiPure], TuiHintComponent.prototype, "update", null);
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-hint',
- template: `
-
-
- `,
- styleUrls: ['./hint.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_28__.TuiDestroyService, _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiPositionService, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiHoveredService, (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiPositionAccessorFor)('hint', TuiHintPositionDirective), (0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiRectAccessorFor)('hint', TuiHintDirective)],
- animations: [_taiga_ui_core_animations__WEBPACK_IMPORTED_MODULE_30__.tuiFadeIn],
- host: {
- '[@tuiFadeIn]': 'animation',
- '[class._untouchable]': 'pointer'
- }
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_19__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.TuiHoveredService]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_19__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiPositionService]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_19__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_28__.TuiDestroyService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_23__.TUI_ANIMATION_OPTIONS]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiHintPointerDirective]
- }]
- }, {
- type: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiRectAccessor,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiRectAccessor]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.POLYMORPHEUS_CONTEXT]
- }]
- }, {
- type: TuiHintHoverDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiHintHoverDirective]
- }]
- }, {
- type: _taiga_ui_core_directives_mode__WEBPACK_IMPORTED_MODULE_29__.TuiModeDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_directives_mode__WEBPACK_IMPORTED_MODULE_29__.TuiModeDirective]
- }]
- }, {
- type: _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiVisualViewportService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_5__.TuiVisualViewportService]
- }]
- }, {
- type: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiRectAccessor,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_23__.TUI_VIEWPORT]
- }]
- }];
- }, {
- appearance: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-appearance']
- }],
- onClick: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostListener,
- args: ['document:click', ['$event.target']]
- }],
- update: []
- });
-})();
-class TuiHintDescribeDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiDriver {
- constructor(zone, doc, el) {
- super(subscriber => this.stream$.subscribe(subscriber));
- this.zone = zone;
- this.doc = doc;
- this.el = el;
- this.id$ = new rxjs__WEBPACK_IMPORTED_MODULE_31__.ReplaySubject(1);
- this.stream$ = this.id$.pipe((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_32__.tuiIfMap)(() => (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_32__.tuiTypedFromEvent)(this.doc, 'keydown', {
- capture: true
- }), _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiIsPresent), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.switchMap)(() => this.focused ? (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.of)(false) : (0,rxjs__WEBPACK_IMPORTED_MODULE_9__.merge)((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_32__.tuiTypedFromEvent)(this.doc, 'keyup'), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_32__.tuiTypedFromEvent)(this.element, 'blur')).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.map)(() => this.focused))), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_33__.debounce)(visible => visible ? (0,rxjs__WEBPACK_IMPORTED_MODULE_34__.timer)(1000) : (0,rxjs__WEBPACK_IMPORTED_MODULE_11__.of)(null)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_35__.startWith)(false), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_36__.distinctUntilChanged)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_37__.skip)(1), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_32__.tuiZoneOptimized)(this.zone));
- this.tuiHintDescribe = '';
- this.type = 'hint';
- }
- ngOnChanges() {
- this.id$.next(this.tuiHintDescribe);
- }
- get focused() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_38__.tuiIsNativeFocused)(this.element);
- }
- get element() {
- return this.doc.getElementById(this.tuiHintDescribe || '') || this.el.nativeElement;
- }
-}
-TuiHintDescribeDirective.ɵfac = function TuiHintDescribeDirective_Factory(t) {
- return new (t || TuiHintDescribeDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_common__WEBPACK_IMPORTED_MODULE_39__.DOCUMENT), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef));
-};
-TuiHintDescribeDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintDescribeDirective,
- selectors: [["", "tuiHintDescribe", ""]],
- inputs: {
- tuiHintDescribe: "tuiHintDescribe"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsDriver)(TuiHintDescribeDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]]
-});
-(0,tslib__WEBPACK_IMPORTED_MODULE_24__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_25__.tuiPure], TuiHintDescribeDirective.prototype, "element", null);
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintDescribeDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiHintDescribe]',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsDriver)(TuiHintDescribeDirective)]
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone]
- }]
- }, {
- type: Document,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_common__WEBPACK_IMPORTED_MODULE_39__.DOCUMENT]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }];
- }, {
- tuiHintDescribe: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- element: []
- });
-})();
-class TuiHintDriverDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.AbstractTuiDriverDirective {
- // TODO: Figure out why this is necessary under nx test runner
- constructor(destroy$, drivers, vehicles) {
- super(destroy$, drivers, vehicles);
- this.type = 'hint';
- }
-}
-TuiHintDriverDirective.ɵfac = function TuiHintDriverDirective_Factory(t) {
- return new (t || TuiHintDriverDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_28__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiDriver), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiVehicle));
-};
-TuiHintDriverDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintDriverDirective,
- selectors: [["", "tuiHint", "", 5, "ng-container", 5, "ng-template"]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_28__.TuiDestroyService]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintDriverDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiHint]:not(ng-container):not(ng-template)',
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_28__.TuiDestroyService]
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_19__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_28__.TuiDestroyService]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiDriver]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiVehicle]
- }]
- }];
- }, null);
-})();
-class TuiHintHostDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiRectAccessor {
- constructor() {
- super(...arguments);
- this.type = 'hint';
- }
- getClientRect() {
- var _a;
- return ((_a = this.tuiHintHost) === null || _a === void 0 ? void 0 : _a.getBoundingClientRect()) || _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.EMPTY_CLIENT_RECT;
- }
-}
-TuiHintHostDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiHintHostDirective_BaseFactory;
- return function TuiHintHostDirective_Factory(t) {
- return (ɵTuiHintHostDirective_BaseFactory || (ɵTuiHintHostDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetInheritedFactory"](TuiHintHostDirective)))(t || TuiHintHostDirective);
- };
-}();
-TuiHintHostDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintHostDirective,
- selectors: [["", "tuiHint", "", "tuiHintHost", ""]],
- inputs: {
- tuiHintHost: "tuiHintHost"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsRectAccessor)(TuiHintHostDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintHostDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiHint][tuiHintHost]',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsRectAccessor)(TuiHintHostDirective)]
- }]
- }], null, {
- tuiHintHost: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiHintManualDirective extends _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.TuiDriver {
- constructor(hover) {
- super(subscriber => this.stream$.subscribe(subscriber));
- this.stream$ = new rxjs__WEBPACK_IMPORTED_MODULE_40__.BehaviorSubject(false);
- this.tuiHintManual = false;
- this.type = 'hint';
- hover.enabled = false;
- }
- ngOnChanges() {
- this.stream$.next(this.tuiHintManual);
- }
-}
-TuiHintManualDirective.ɵfac = function TuiHintManualDirective_Factory(t) {
- return new (t || TuiHintManualDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiHintHoverDirective));
-};
-TuiHintManualDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintManualDirective,
- selectors: [["", "tuiHint", "", "tuiHintManual", ""]],
- inputs: {
- tuiHintManual: "tuiHintManual"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsDriver)(TuiHintManualDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintManualDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiHint][tuiHintManual]',
- providers: [(0,_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_7__.tuiAsDriver)(TuiHintManualDirective)]
- }]
- }], function () {
- return [{
- type: TuiHintHoverDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiHintHoverDirective]
- }]
- }];
- }, {
- tuiHintManual: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiHintUnstyledComponent {
- constructor(context) {
- this.context = context;
- }
-}
-TuiHintUnstyledComponent.ɵfac = function TuiHintUnstyledComponent_Factory(t) {
- return new (t || TuiHintUnstyledComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.POLYMORPHEUS_CONTEXT));
-};
-TuiHintUnstyledComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiHintUnstyledComponent,
- selectors: [["ng-component"]],
- hostVars: 1,
- hostBindings: function TuiHintUnstyledComponent_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsyntheticHostProperty"]("@tuiParentAnimation", undefined);
- }
- },
- decls: 1,
- vars: 2,
- consts: [[4, "polymorpheusOutlet", "polymorpheusOutletContext"]],
- template: function TuiHintUnstyledComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiHintUnstyledComponent_ng_container_0_Template, 1, 0, "ng-container", 0);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx.context.$implicit.content)("polymorpheusOutletContext", ctx.context);
- }
- },
- dependencies: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusOutletDirective],
- encapsulation: 2,
- data: {
- animation: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.TUI_PARENT_ANIMATION]
- },
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintUnstyledComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- template: `
-
- `,
- host: {
- '[@tuiParentAnimation]': ''
- },
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- animations: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_20__.TUI_PARENT_ANIMATION]
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.POLYMORPHEUS_CONTEXT]
- }]
- }];
- }, null);
-})();
-class TuiHintUnstyledDirective {
- constructor(templateRef, hint) {
- hint.component = new _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusComponent(TuiHintUnstyledComponent);
- hint.content = templateRef;
- }
-}
-TuiHintUnstyledDirective.ɵfac = function TuiHintUnstyledDirective_Factory(t) {
- return new (t || TuiHintUnstyledDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TuiHintDirective));
-};
-TuiHintUnstyledDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiHintUnstyledDirective,
- selectors: [["ng-template", "tuiHint", ""]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.POLYMORPHEUS_CONTEXT,
- useValue: {
- $implicit: {}
- }
- }])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintUnstyledDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AsyncPipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- selector: 'ng-template[tuiHint]',
- providers: [{
- provide: _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.POLYMORPHEUS_CONTEXT,
- useValue: {
- $implicit: {}
- }
- }]
+ name: 'async',
+ pure: false,
+ standalone: true
}]
}], function () {
return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef]
- }]
- }, {
- type: TuiHintDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TuiHintDirective]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef
}];
}, null);
})();
-class TuiHintModule {}
-TuiHintModule.ɵfac = function TuiHintModule_Factory(t) {
- return new (t || TuiHintModule)();
-};
-TuiHintModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiHintModule
-});
-TuiHintModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_39__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiHintModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_39__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_4__.PolymorpheusModule],
- declarations: [TuiHintComponent, TuiHintDirective, TuiHintDriverDirective, TuiHintHostDirective, TuiHintHoverDirective, TuiHintManualDirective, TuiHintPointerDirective, TuiHintDescribeDirective, TuiHintPositionDirective, TuiHintOptionsDirective, TuiHintUnstyledComponent, TuiHintUnstyledDirective],
- exports: [TuiHintComponent, TuiHintDirective, TuiHintDriverDirective, TuiHintHostDirective, TuiHintHoverDirective, TuiHintManualDirective, TuiHintPointerDirective, TuiHintDescribeDirective, TuiHintPositionDirective, TuiHintOptionsDirective, TuiHintUnstyledDirective]
- }]
- }], null, null);
-})();
/**
- * Generated bundle index. Do not edit.
+ * Transforms text to all lower case.
+ *
+ * @see {@link UpperCasePipe}
+ * @see {@link TitleCasePipe}
+ * @usageNotes
+ *
+ * The following example defines a view that allows the user to enter
+ * text, and then uses the pipe to convert the input text to all lower case.
+ *
+ *
+ *
+ * @ngModule CommonModule
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 7794:
-/*!****************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-directives-mask-accessor.js ***!
- \****************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiMaskAccessorDirective: () => (/* binding */ TuiMaskAccessorDirective),
-/* harmony export */ TuiMaskAccessorModule: () => (/* binding */ TuiMaskAccessorModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/forms */ 8015);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-
-
-
-
-class TuiMaskAccessorDirective {}
-TuiMaskAccessorDirective.ɵfac = function TuiMaskAccessorDirective_Factory(t) {
- return new (t || TuiMaskAccessorDirective)();
+class LowerCasePipe {
+ transform(value) {
+ if (value == null) return null;
+ if (typeof value !== 'string') {
+ throw invalidPipeArgumentError(LowerCasePipe, value);
+ }
+ return value.toLowerCase();
+ }
+}
+_LowerCasePipe = LowerCasePipe;
+_LowerCasePipe.ɵfac = function _LowerCasePipe_Factory(t) {
+ return new (t || _LowerCasePipe)();
};
-TuiMaskAccessorDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiMaskAccessorDirective,
- selectors: [["input", "tuiMaskAccessor", ""]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([{
- provide: _angular_forms__WEBPACK_IMPORTED_MODULE_1__.NG_VALUE_ACCESSOR,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_VALUE_ACCESSOR], _angular_forms__WEBPACK_IMPORTED_MODULE_1__.DefaultValueAccessor],
- multi: true,
- useFactory: (accessor, fallback) => accessor ? accessor[0] : fallback
- }])]
+_LowerCasePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "lowercase",
+ type: _LowerCasePipe,
+ pure: true,
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiMaskAccessorDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LowerCasePipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- selector: 'input[tuiMaskAccessor]',
- providers: [{
- provide: _angular_forms__WEBPACK_IMPORTED_MODULE_1__.NG_VALUE_ACCESSOR,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional(), _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_VALUE_ACCESSOR], _angular_forms__WEBPACK_IMPORTED_MODULE_1__.DefaultValueAccessor],
- multi: true,
- useFactory: (accessor, fallback) => accessor ? accessor[0] : fallback
- }]
+ name: 'lowercase',
+ standalone: true
}]
}], null, null);
})();
-
+//
+// Regex below matches any Unicode word and number compatible with ES5. In ES2018 the same result
+// can be achieved by using /[0-9\p{L}]\S*/gu and also known as Unicode Property Escapes
+// (https://2ality.com/2017/07/regexp-unicode-property-escapes.html). Since there is no
+// transpilation of this functionality down to ES5 without external tool, the only solution is
+// to use already transpiled form. Example can be found here -
+// https://mothereff.in/regexpu#input=var+regex+%3D+%2F%5B0-9%5Cp%7BL%7D%5D%5CS*%2Fgu%3B%0A%0A&unicodePropertyEscape=1
+//
+const unicodeWordMatch = /(?:[0-9A-Za-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CA\uA7D0\uA7D1\uA7D3\uA7D5-\uA7D9\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF1C\uDF27\uDF30-\uDF45\uDF70-\uDF81\uDFB0-\uDFC4\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDEB8\uDF00-\uDF1A\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2\uDFB0]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE70-\uDEBE\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD837[\uDF00-\uDF1E]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB]|\uD839[\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43\uDD4B]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF38\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])\S*/g;
/**
- * @internal
+ * Transforms text to title case.
+ * Capitalizes the first letter of each word and transforms the
+ * rest of the word to lower case.
+ * Words are delimited by any whitespace character, such as a space, tab, or line-feed character.
+ *
+ * @see {@link LowerCasePipe}
+ * @see {@link UpperCasePipe}
+ *
+ * @usageNotes
+ * The following example shows the result of transforming various strings into title case.
+ *
+ *
+ *
+ * @ngModule CommonModule
+ * @publicApi
*/
-class TuiMaskAccessorModule {}
-TuiMaskAccessorModule.ɵfac = function TuiMaskAccessorModule_Factory(t) {
- return new (t || TuiMaskAccessorModule)();
+class TitleCasePipe {
+ transform(value) {
+ if (value == null) return null;
+ if (typeof value !== 'string') {
+ throw invalidPipeArgumentError(TitleCasePipe, value);
+ }
+ return value.replace(unicodeWordMatch, txt => txt[0].toUpperCase() + txt.slice(1).toLowerCase());
+ }
+}
+_TitleCasePipe = TitleCasePipe;
+_TitleCasePipe.ɵfac = function _TitleCasePipe_Factory(t) {
+ return new (t || _TitleCasePipe)();
};
-TuiMaskAccessorModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiMaskAccessorModule
+_TitleCasePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "titlecase",
+ type: _TitleCasePipe,
+ pure: true,
+ standalone: true
});
-TuiMaskAccessorModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiMaskAccessorModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TitleCasePipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- declarations: [TuiMaskAccessorDirective],
- exports: [TuiMaskAccessorDirective]
+ name: 'titlecase',
+ standalone: true
}]
}], null, null);
})();
-
/**
- * Generated bundle index. Do not edit.
+ * Transforms text to all upper case.
+ * @see {@link LowerCasePipe}
+ * @see {@link TitleCasePipe}
+ *
+ * @ngModule CommonModule
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 7279:
-/*!*******************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-directives-mode.js ***!
- \*******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiModeDirective: () => (/* binding */ TuiModeDirective),
-/* harmony export */ TuiModeModule: () => (/* binding */ TuiModeModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-
-
-
-class TuiModeDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiController {
- constructor() {
- super(...arguments);
- this.mode = null;
+class UpperCasePipe {
+ transform(value) {
+ if (value == null) return null;
+ if (typeof value !== 'string') {
+ throw invalidPipeArgumentError(UpperCasePipe, value);
+ }
+ return value.toUpperCase();
}
}
-TuiModeDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiModeDirective_BaseFactory;
- return function TuiModeDirective_Factory(t) {
- return (ɵTuiModeDirective_BaseFactory || (ɵTuiModeDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetInheritedFactory"](TuiModeDirective)))(t || TuiModeDirective);
- };
-}();
-TuiModeDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({
- type: TuiModeDirective,
- selectors: [["", "tuiMode", ""]],
- inputs: {
- mode: ["tuiMode", "mode"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiModeDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive,
- args: [{
- selector: '[tuiMode]'
- }]
- }], null, {
- mode: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input,
- args: ['tuiMode']
- }]
- });
-})();
-class TuiModeModule {}
-TuiModeModule.ɵfac = function TuiModeModule_Factory(t) {
- return new (t || TuiModeModule)();
+_UpperCasePipe = UpperCasePipe;
+_UpperCasePipe.ɵfac = function _UpperCasePipe_Factory(t) {
+ return new (t || _UpperCasePipe)();
};
-TuiModeModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
- type: TuiModeModule
+_UpperCasePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "uppercase",
+ type: _UpperCasePipe,
+ pure: true,
+ standalone: true
});
-TuiModeModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiModeModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](UpperCasePipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- declarations: [TuiModeDirective],
- exports: [TuiModeDirective]
+ name: 'uppercase',
+ standalone: true
}]
}], null, null);
})();
/**
- * Generated bundle index. Do not edit.
+ * The default date format of Angular date pipe, which corresponds to the following format:
+ * `'MMM d,y'` (e.g. `Jun 15, 2015`)
*/
-
-
-
-/***/ }),
-
-/***/ 1812:
-/*!*******************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-directives-scroll-into-view.js ***!
- \*******************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiScrollIntoViewDirective: () => (/* binding */ TuiScrollIntoViewDirective),
-/* harmony export */ TuiScrollIntoViewModule: () => (/* binding */ TuiScrollIntoViewModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/constants */ 6628);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 5219);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ 5213);
-
-
-
-
-
-
-
+const DEFAULT_DATE_FORMAT = 'mediumDate';
/**
- * Directive scrolls element into view inside tui-scrollbar
+ * Optionally-provided default timezone to use for all instances of `DatePipe` (such as `'+0430'`).
+ * If the value isn't provided, the `DatePipe` will use the end-user's local system timezone.
+ *
+ * @deprecated use DATE_PIPE_DEFAULT_OPTIONS token to configure DatePipe
*/
-class TuiScrollIntoViewDirective {
- constructor(el, destroy$) {
- this.el = el;
- this.destroy$ = destroy$;
- }
- set tuiScrollIntoView(scroll) {
- if (!scroll) {
- return;
- }
- // Timeout is necessary in order to give element render cycle to get into its final spot
- // (for example if it is inside dropdown box which has to be positioned first)
- (0,rxjs__WEBPACK_IMPORTED_MODULE_0__.timer)(0).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.takeUntil)(this.destroy$)).subscribe(() => {
- this.el.nativeElement.dispatchEvent(new CustomEvent(_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_2__.TUI_SCROLL_INTO_VIEW, {
- bubbles: true,
- detail: this.el.nativeElement
- }));
- });
- }
-}
-TuiScrollIntoViewDirective.ɵfac = function TuiScrollIntoViewDirective_Factory(t) {
- return new (t || TuiScrollIntoViewDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_3__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.TuiDestroyService, 2));
-};
-TuiScrollIntoViewDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineDirective"]({
- type: TuiScrollIntoViewDirective,
- selectors: [["", "tuiScrollIntoView", ""]],
- inputs: {
- tuiScrollIntoView: "tuiScrollIntoView"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.TuiDestroyService])]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵsetClassMetadata"](TuiScrollIntoViewDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Directive,
- args: [{
- selector: '[tuiScrollIntoView]',
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.TuiDestroyService]
+const DATE_PIPE_DEFAULT_TIMEZONE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('DATE_PIPE_DEFAULT_TIMEZONE');
+/**
+ * DI token that allows to provide default configuration for the `DatePipe` instances in an
+ * application. The value is an object which can include the following fields:
+ * - `dateFormat`: configures the default date format. If not provided, the `DatePipe`
+ * will use the 'mediumDate' as a value.
+ * - `timezone`: configures the default timezone. If not provided, the `DatePipe` will
+ * use the end-user's local system timezone.
+ *
+ * @see {@link DatePipeConfig}
+ *
+ * @usageNotes
+ *
+ * Various date pipe default values can be overwritten by providing this token with
+ * the value that has this interface.
+ *
+ * For example:
+ *
+ * Override the default date format by providing a value using the token:
+ * ```typescript
+ * providers: [
+ * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {dateFormat: 'shortDate'}}
+ * ]
+ * ```
+ *
+ * Override the default timezone by providing a value using the token:
+ * ```typescript
+ * providers: [
+ * {provide: DATE_PIPE_DEFAULT_OPTIONS, useValue: {timezone: '-1200'}}
+ * ]
+ * ```
+ */
+const DATE_PIPE_DEFAULT_OPTIONS = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('DATE_PIPE_DEFAULT_OPTIONS');
+// clang-format off
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Formats a date value according to locale rules.
+ *
+ * `DatePipe` is executed only when it detects a pure change to the input value.
+ * A pure change is either a change to a primitive input value
+ * (such as `String`, `Number`, `Boolean`, or `Symbol`),
+ * or a changed object reference (such as `Date`, `Array`, `Function`, or `Object`).
+ *
+ * Note that mutating a `Date` object does not cause the pipe to be rendered again.
+ * To ensure that the pipe is executed, you must create a new `Date` object.
+ *
+ * Only the `en-US` locale data comes with Angular. To localize dates
+ * in another language, you must import the corresponding locale data.
+ * See the [I18n guide](guide/i18n-common-format-data-locale) for more information.
+ *
+ * The time zone of the formatted value can be specified either by passing it in as the second
+ * parameter of the pipe, or by setting the default through the `DATE_PIPE_DEFAULT_OPTIONS`
+ * injection token. The value that is passed in as the second parameter takes precedence over
+ * the one defined using the injection token.
+ *
+ * @see {@link formatDate}
+ *
+ *
+ * @usageNotes
+ *
+ * The result of this pipe is not reevaluated when the input is mutated. To avoid the need to
+ * reformat the date on every change-detection cycle, treat the date as an immutable object
+ * and change the reference when the pipe needs to run again.
+ *
+ * ### Pre-defined format options
+ *
+ * | Option | Equivalent to | Examples (given in `en-US` locale) |
+ * |---------------|-------------------------------------|-------------------------------------------------|
+ * | `'short'` | `'M/d/yy, h:mm a'` | `6/15/15, 9:03 AM` |
+ * | `'medium'` | `'MMM d, y, h:mm:ss a'` | `Jun 15, 2015, 9:03:01 AM` |
+ * | `'long'` | `'MMMM d, y, h:mm:ss a z'` | `June 15, 2015 at 9:03:01 AM GMT+1` |
+ * | `'full'` | `'EEEE, MMMM d, y, h:mm:ss a zzzz'` | `Monday, June 15, 2015 at 9:03:01 AM GMT+01:00` |
+ * | `'shortDate'` | `'M/d/yy'` | `6/15/15` |
+ * | `'mediumDate'`| `'MMM d, y'` | `Jun 15, 2015` |
+ * | `'longDate'` | `'MMMM d, y'` | `June 15, 2015` |
+ * | `'fullDate'` | `'EEEE, MMMM d, y'` | `Monday, June 15, 2015` |
+ * | `'shortTime'` | `'h:mm a'` | `9:03 AM` |
+ * | `'mediumTime'`| `'h:mm:ss a'` | `9:03:01 AM` |
+ * | `'longTime'` | `'h:mm:ss a z'` | `9:03:01 AM GMT+1` |
+ * | `'fullTime'` | `'h:mm:ss a zzzz'` | `9:03:01 AM GMT+01:00` |
+ *
+ * ### Custom format options
+ *
+ * You can construct a format string using symbols to specify the components
+ * of a date-time value, as described in the following table.
+ * Format details depend on the locale.
+ * Fields marked with (*) are only available in the extra data set for the given locale.
+ *
+ * | Field type | Format | Description | Example Value |
+ * |-------------------- |-------------|---------------------------------------------------------------|------------------------------------------------------------|
+ * | Era | G, GG & GGG | Abbreviated | AD |
+ * | | GGGG | Wide | Anno Domini |
+ * | | GGGGG | Narrow | A |
+ * | Year | y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |
+ * | | yy | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |
+ * | | yyy | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |
+ * | | yyyy | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |
+ * | Week-numbering year | Y | Numeric: minimum digits | 2, 20, 201, 2017, 20173 |
+ * | | YY | Numeric: 2 digits + zero padded | 02, 20, 01, 17, 73 |
+ * | | YYY | Numeric: 3 digits + zero padded | 002, 020, 201, 2017, 20173 |
+ * | | YYYY | Numeric: 4 digits or more + zero padded | 0002, 0020, 0201, 2017, 20173 |
+ * | Month | M | Numeric: 1 digit | 9, 12 |
+ * | | MM | Numeric: 2 digits + zero padded | 09, 12 |
+ * | | MMM | Abbreviated | Sep |
+ * | | MMMM | Wide | September |
+ * | | MMMMM | Narrow | S |
+ * | Month standalone | L | Numeric: 1 digit | 9, 12 |
+ * | | LL | Numeric: 2 digits + zero padded | 09, 12 |
+ * | | LLL | Abbreviated | Sep |
+ * | | LLLL | Wide | September |
+ * | | LLLLL | Narrow | S |
+ * | Week of year | w | Numeric: minimum digits | 1... 53 |
+ * | | ww | Numeric: 2 digits + zero padded | 01... 53 |
+ * | Week of month | W | Numeric: 1 digit | 1... 5 |
+ * | Day of month | d | Numeric: minimum digits | 1 |
+ * | | dd | Numeric: 2 digits + zero padded | 01 |
+ * | Week day | E, EE & EEE | Abbreviated | Tue |
+ * | | EEEE | Wide | Tuesday |
+ * | | EEEEE | Narrow | T |
+ * | | EEEEEE | Short | Tu |
+ * | Week day standalone | c, cc | Numeric: 1 digit | 2 |
+ * | | ccc | Abbreviated | Tue |
+ * | | cccc | Wide | Tuesday |
+ * | | ccccc | Narrow | T |
+ * | | cccccc | Short | Tu |
+ * | Period | a, aa & aaa | Abbreviated | am/pm or AM/PM |
+ * | | aaaa | Wide (fallback to `a` when missing) | ante meridiem/post meridiem |
+ * | | aaaaa | Narrow | a/p |
+ * | Period* | B, BB & BBB | Abbreviated | mid. |
+ * | | BBBB | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
+ * | | BBBBB | Narrow | md |
+ * | Period standalone* | b, bb & bbb | Abbreviated | mid. |
+ * | | bbbb | Wide | am, pm, midnight, noon, morning, afternoon, evening, night |
+ * | | bbbbb | Narrow | md |
+ * | Hour 1-12 | h | Numeric: minimum digits | 1, 12 |
+ * | | hh | Numeric: 2 digits + zero padded | 01, 12 |
+ * | Hour 0-23 | H | Numeric: minimum digits | 0, 23 |
+ * | | HH | Numeric: 2 digits + zero padded | 00, 23 |
+ * | Minute | m | Numeric: minimum digits | 8, 59 |
+ * | | mm | Numeric: 2 digits + zero padded | 08, 59 |
+ * | Second | s | Numeric: minimum digits | 0... 59 |
+ * | | ss | Numeric: 2 digits + zero padded | 00... 59 |
+ * | Fractional seconds | S | Numeric: 1 digit | 0... 9 |
+ * | | SS | Numeric: 2 digits + zero padded | 00... 99 |
+ * | | SSS | Numeric: 3 digits + zero padded (= milliseconds) | 000... 999 |
+ * | Zone | z, zz & zzz | Short specific non location format (fallback to O) | GMT-8 |
+ * | | zzzz | Long specific non location format (fallback to OOOO) | GMT-08:00 |
+ * | | Z, ZZ & ZZZ | ISO8601 basic format | -0800 |
+ * | | ZZZZ | Long localized GMT format | GMT-8:00 |
+ * | | ZZZZZ | ISO8601 extended format + Z indicator for offset 0 (= XXXXX) | -08:00 |
+ * | | O, OO & OOO | Short localized GMT format | GMT-8 |
+ * | | OOOO | Long localized GMT format | GMT-08:00 |
+ *
+ *
+ * ### Format examples
+ *
+ * These examples transform a date into various formats,
+ * assuming that `dateObj` is a JavaScript `Date` object for
+ * year: 2015, month: 6, day: 15, hour: 21, minute: 43, second: 11,
+ * given in the local time for the `en-US` locale.
+ *
+ * ```
+ * {{ dateObj | date }} // output is 'Jun 15, 2015'
+ * {{ dateObj | date:'medium' }} // output is 'Jun 15, 2015, 9:43:11 PM'
+ * {{ dateObj | date:'shortTime' }} // output is '9:43 PM'
+ * {{ dateObj | date:'mm:ss' }} // output is '43:11'
+ * {{ dateObj | date:"MMM dd, yyyy 'at' hh:mm a" }} // output is 'Jun 15, 2015 at 09:43 PM'
+ * ```
+ *
+ * ### Usage example
+ *
+ * The following component uses a date pipe to display the current date in different formats.
+ *
+ * ```
+ * @Component({
+ * selector: 'date-pipe',
+ * template: `
+ *
Today is {{today | date}}
+ *
Or if you prefer, {{today | date:'fullDate'}}
+ *
The time is {{today | date:'h:mm a z'}}
+ *
`
+ * })
+ * // Get the current date and time as a date-time value.
+ * export class DatePipeComponent {
+ * today: number = Date.now();
+ * }
+ * ```
+ *
+ * @publicApi
+ */
+// clang-format on
+class DatePipe {
+ constructor(locale, defaultTimezone, defaultOptions) {
+ this.locale = locale;
+ this.defaultTimezone = defaultTimezone;
+ this.defaultOptions = defaultOptions;
+ }
+ transform(value, format, timezone, locale) {
+ if (value == null || value === '' || value !== value) return null;
+ try {
+ const _format = format ?? this.defaultOptions?.dateFormat ?? DEFAULT_DATE_FORMAT;
+ const _timezone = timezone ?? this.defaultOptions?.timezone ?? this.defaultTimezone ?? undefined;
+ return formatDate(value, _format, locale || this.locale, _timezone);
+ } catch (error) {
+ throw invalidPipeArgumentError(DatePipe, error.message);
+ }
+ }
+}
+_DatePipe = DatePipe;
+_DatePipe.ɵfac = function _DatePipe_Factory(t) {
+ return new (t || _DatePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID, 16), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](DATE_PIPE_DEFAULT_TIMEZONE, 24), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](DATE_PIPE_DEFAULT_OPTIONS, 24));
+};
+_DatePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "date",
+ type: _DatePipe,
+ pure: true,
+ standalone: true
+});
+(function () {
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DatePipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
+ args: [{
+ name: 'date',
+ pure: true,
+ standalone: true
}]
}], function () {
return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.ElementRef,
+ type: undefined,
+ decorators: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
+ args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID]
+ }]
+ }, {
+ type: undefined,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_3__.ElementRef]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
+ args: [DATE_PIPE_DEFAULT_TIMEZONE]
+ }, {
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
}]
}, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_5__.Observable,
+ type: undefined,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Self
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
+ args: [DATE_PIPE_DEFAULT_OPTIONS]
}, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.TuiDestroyService]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
}]
}];
- }, {
- tuiScrollIntoView: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.Input
- }]
- });
+ }, null);
})();
-class TuiScrollIntoViewModule {}
-TuiScrollIntoViewModule.ɵfac = function TuiScrollIntoViewModule_Factory(t) {
- return new (t || TuiScrollIntoViewModule)();
+const _INTERPOLATION_REGEXP = /#/g;
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Maps a value to a string that pluralizes the value according to locale rules.
+ *
+ * @usageNotes
+ *
+ * ### Example
+ *
+ * {@example common/pipes/ts/i18n_pipe.ts region='I18nPluralPipeComponent'}
+ *
+ * @publicApi
+ */
+class I18nPluralPipe {
+ constructor(_localization) {
+ this._localization = _localization;
+ }
+ /**
+ * @param value the number to be formatted
+ * @param pluralMap an object that mimics the ICU format, see
+ * https://unicode-org.github.io/icu/userguide/format_parse/messages/.
+ * @param locale a `string` defining the locale to use (uses the current {@link LOCALE_ID} by
+ * default).
+ */
+ transform(value, pluralMap, locale) {
+ if (value == null) return '';
+ if (typeof pluralMap !== 'object' || pluralMap === null) {
+ throw invalidPipeArgumentError(I18nPluralPipe, pluralMap);
+ }
+ const key = getPluralCategory(value, Object.keys(pluralMap), this._localization, locale);
+ return pluralMap[key].replace(_INTERPOLATION_REGEXP, value.toString());
+ }
+}
+_I18nPluralPipe = I18nPluralPipe;
+_I18nPluralPipe.ɵfac = function _I18nPluralPipe_Factory(t) {
+ return new (t || _I18nPluralPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](NgLocalization, 16));
};
-TuiScrollIntoViewModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineNgModule"]({
- type: TuiScrollIntoViewModule
+_I18nPluralPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "i18nPlural",
+ type: _I18nPluralPipe,
+ pure: true,
+ standalone: true
});
-TuiScrollIntoViewModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵɵdefineInjector"]({});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_3__["ɵsetClassMetadata"](TuiScrollIntoViewModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_3__.NgModule,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](I18nPluralPipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- declarations: [TuiScrollIntoViewDirective],
- exports: [TuiScrollIntoViewDirective]
+ name: 'i18nPlural',
+ pure: true,
+ standalone: true
}]
- }], null, null);
+ }], function () {
+ return [{
+ type: NgLocalization
+ }];
+ }, null);
})();
/**
- * Generated bundle index. Do not edit.
+ * @ngModule CommonModule
+ * @description
+ *
+ * Generic selector that displays the string that matches the current value.
+ *
+ * If none of the keys of the `mapping` match the `value`, then the content
+ * of the `other` key is returned when present, otherwise an empty string is returned.
+ *
+ * @usageNotes
+ *
+ * ### Example
+ *
+ * {@example common/pipes/ts/i18n_pipe.ts region='I18nSelectPipeComponent'}
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 1460:
-/*!***********************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-directives-textfield-controller.js ***!
- \***********************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TEXTFIELD_CONTROLLER_PROVIDER: () => (/* binding */ TEXTFIELD_CONTROLLER_PROVIDER),
-/* harmony export */ TUI_TEXTFIELD_APPEARANCE_DIRECTIVE: () => (/* binding */ TUI_TEXTFIELD_APPEARANCE_DIRECTIVE),
-/* harmony export */ TUI_TEXTFIELD_CLEANER: () => (/* binding */ TUI_TEXTFIELD_CLEANER),
-/* harmony export */ TUI_TEXTFIELD_CUSTOM_CONTENT: () => (/* binding */ TUI_TEXTFIELD_CUSTOM_CONTENT),
-/* harmony export */ TUI_TEXTFIELD_DEFAULT_OPTIONS: () => (/* binding */ TUI_TEXTFIELD_DEFAULT_OPTIONS),
-/* harmony export */ TUI_TEXTFIELD_FILLER: () => (/* binding */ TUI_TEXTFIELD_FILLER),
-/* harmony export */ TUI_TEXTFIELD_ICON: () => (/* binding */ TUI_TEXTFIELD_ICON),
-/* harmony export */ TUI_TEXTFIELD_ICON_LEFT: () => (/* binding */ TUI_TEXTFIELD_ICON_LEFT),
-/* harmony export */ TUI_TEXTFIELD_LABEL_OUTSIDE: () => (/* binding */ TUI_TEXTFIELD_LABEL_OUTSIDE),
-/* harmony export */ TUI_TEXTFIELD_OPTIONS: () => (/* binding */ TUI_TEXTFIELD_OPTIONS),
-/* harmony export */ TUI_TEXTFIELD_POSTFIX: () => (/* binding */ TUI_TEXTFIELD_POSTFIX),
-/* harmony export */ TUI_TEXTFIELD_PREFIX: () => (/* binding */ TUI_TEXTFIELD_PREFIX),
-/* harmony export */ TUI_TEXTFIELD_SIZE: () => (/* binding */ TUI_TEXTFIELD_SIZE),
-/* harmony export */ TUI_TEXTFIELD_WATCHED_CONTROLLER: () => (/* binding */ TUI_TEXTFIELD_WATCHED_CONTROLLER),
-/* harmony export */ TuiTextfieldAppearanceDirective: () => (/* binding */ TuiTextfieldAppearanceDirective),
-/* harmony export */ TuiTextfieldCleanerDirective: () => (/* binding */ TuiTextfieldCleanerDirective),
-/* harmony export */ TuiTextfieldController: () => (/* binding */ TuiTextfieldController),
-/* harmony export */ TuiTextfieldControllerModule: () => (/* binding */ TuiTextfieldControllerModule),
-/* harmony export */ TuiTextfieldCustomContentDirective: () => (/* binding */ TuiTextfieldCustomContentDirective),
-/* harmony export */ TuiTextfieldFillerDirective: () => (/* binding */ TuiTextfieldFillerDirective),
-/* harmony export */ TuiTextfieldIconDirective: () => (/* binding */ TuiTextfieldIconDirective),
-/* harmony export */ TuiTextfieldIconLeftDirective: () => (/* binding */ TuiTextfieldIconLeftDirective),
-/* harmony export */ TuiTextfieldLabelOutsideDirective: () => (/* binding */ TuiTextfieldLabelOutsideDirective),
-/* harmony export */ TuiTextfieldPostfixDirective: () => (/* binding */ TuiTextfieldPostfixDirective),
-/* harmony export */ TuiTextfieldPrefixDirective: () => (/* binding */ TuiTextfieldPrefixDirective),
-/* harmony export */ TuiTextfieldSizeDirective: () => (/* binding */ TuiTextfieldSizeDirective),
-/* harmony export */ tuiTextfieldOptionsProvider: () => (/* binding */ tuiTextfieldOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 9488);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ 5213);
-
-
-
-
-
-
-class TuiTextfieldController {
- constructor(change$, options, legacyAppearance, appearanceDirective, cleanerDirective, customContentDirective, iconDirective, iconLeftDirective, labelOutsideDirective, sizeDirective, prefixDirective, postfixDirective, fillerDirective) {
- this.change$ = change$;
- this.options = options;
- this.legacyAppearance = legacyAppearance;
- this.appearanceDirective = appearanceDirective;
- this.cleanerDirective = cleanerDirective;
- this.customContentDirective = customContentDirective;
- this.iconDirective = iconDirective;
- this.iconLeftDirective = iconLeftDirective;
- this.labelOutsideDirective = labelOutsideDirective;
- this.sizeDirective = sizeDirective;
- this.prefixDirective = prefixDirective;
- this.postfixDirective = postfixDirective;
- this.fillerDirective = fillerDirective;
- }
- get appearance() {
- return this.appearanceDirective.appearance || this.legacyAppearance;
- }
- get cleaner() {
- return this.cleanerDirective.cleaner;
- }
- get customContent() {
- return this.customContentDirective.customContent || '';
- }
- get icon() {
- return this.iconDirective.icon;
- }
- get iconLeft() {
- return this.iconLeftDirective.iconLeft;
- }
- get labelOutside() {
- return this.labelOutsideDirective.labelOutside;
- }
- get size() {
- return this.sizeDirective.size;
- }
- get prefix() {
- return this.prefixDirective.prefix;
- }
- get postfix() {
- return this.postfixDirective.postfix;
- }
- get filler() {
- return this.fillerDirective.filler;
+class I18nSelectPipe {
+ /**
+ * @param value a string to be internationalized.
+ * @param mapping an object that indicates the text that should be displayed
+ * for different values of the provided `value`.
+ */
+ transform(value, mapping) {
+ if (value == null) return '';
+ if (typeof mapping !== 'object' || typeof value !== 'string') {
+ throw invalidPipeArgumentError(I18nSelectPipe, mapping);
+ }
+ if (mapping.hasOwnProperty(value)) {
+ return mapping[value];
+ }
+ if (mapping.hasOwnProperty('other')) {
+ return mapping['other'];
+ }
+ return '';
}
}
-
-/** Default values for primitive textfield options */
-const TUI_TEXTFIELD_DEFAULT_OPTIONS = {
- iconCleaner: 'tuiIconClose',
- hintOnDisabled: false
+_I18nSelectPipe = I18nSelectPipe;
+_I18nSelectPipe.ɵfac = function _I18nSelectPipe_Factory(t) {
+ return new (t || _I18nSelectPipe)();
};
-/**
- * Default parameters for textfield
- */
-const TUI_TEXTFIELD_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(TUI_TEXTFIELD_DEFAULT_OPTIONS);
-function tuiTextfieldOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiProvideOptions)(TUI_TEXTFIELD_OPTIONS, options, TUI_TEXTFIELD_DEFAULT_OPTIONS);
-}
-
-// TODO: rename to TUI_TEXTFIELD_APPEARANCE in v4
-const TUI_TEXTFIELD_APPEARANCE_DIRECTIVE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldAppearanceDirective());
-class TuiTextfieldAppearanceDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {
- constructor() {
- super(...arguments);
- // it's an empty string by default for backward compatibility
- // (see comment https://github.com/taiga-family/taiga-ui/pull/3007#issuecomment-1315179508)
- this.appearance = '';
- }
-}
-TuiTextfieldAppearanceDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldAppearanceDirective_BaseFactory;
- return function TuiTextfieldAppearanceDirective_Factory(t) {
- return (ɵTuiTextfieldAppearanceDirective_BaseFactory || (ɵTuiTextfieldAppearanceDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldAppearanceDirective)))(t || TuiTextfieldAppearanceDirective);
- };
-}();
-TuiTextfieldAppearanceDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldAppearanceDirective,
- selectors: [["", "tuiTextfieldAppearance", ""]],
- inputs: {
- appearance: ["tuiTextfieldAppearance", "appearance"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_APPEARANCE_DIRECTIVE,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldAppearanceDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
+_I18nSelectPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "i18nSelect",
+ type: _I18nSelectPipe,
+ pure: true,
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldAppearanceDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](I18nSelectPipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- selector: '[tuiTextfieldAppearance]',
- providers: [{
- provide: TUI_TEXTFIELD_APPEARANCE_DIRECTIVE,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldAppearanceDirective)
- }]
- }]
- }], null, {
- appearance: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldAppearance']
+ name: 'i18nSelect',
+ pure: true,
+ standalone: true
}]
- });
+ }], null, null);
})();
-const TUI_TEXTFIELD_CLEANER = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldCleanerDirective());
-class TuiTextfieldCleanerDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {
- constructor() {
- super(...arguments);
- this.cleaner = false;
+
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Converts a value into its JSON-format representation. Useful for debugging.
+ *
+ * @usageNotes
+ *
+ * The following component uses a JSON pipe to convert an object
+ * to JSON format, and displays the string in both formats for comparison.
+ *
+ * {@example common/pipes/ts/json_pipe.ts region='JsonPipe'}
+ *
+ * @publicApi
+ */
+class JsonPipe {
+ /**
+ * @param value A value of any type to convert into a JSON-format string.
+ */
+ transform(value) {
+ return JSON.stringify(value, null, 2);
}
}
-TuiTextfieldCleanerDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldCleanerDirective_BaseFactory;
- return function TuiTextfieldCleanerDirective_Factory(t) {
- return (ɵTuiTextfieldCleanerDirective_BaseFactory || (ɵTuiTextfieldCleanerDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldCleanerDirective)))(t || TuiTextfieldCleanerDirective);
- };
-}();
-TuiTextfieldCleanerDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldCleanerDirective,
- selectors: [["", "tuiTextfieldCleaner", ""]],
- inputs: {
- cleaner: ["tuiTextfieldCleaner", "cleaner"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_CLEANER,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldCleanerDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
+_JsonPipe = JsonPipe;
+_JsonPipe.ɵfac = function _JsonPipe_Factory(t) {
+ return new (t || _JsonPipe)();
+};
+_JsonPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "json",
+ type: _JsonPipe,
+ pure: false,
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldCleanerDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](JsonPipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- selector: '[tuiTextfieldCleaner]',
- providers: [{
- provide: TUI_TEXTFIELD_CLEANER,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldCleanerDirective)
- }]
- }]
- }], null, {
- cleaner: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldCleaner']
+ name: 'json',
+ pure: false,
+ standalone: true
}]
- });
+ }], null, null);
})();
-const TUI_TEXTFIELD_CUSTOM_CONTENT = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldCustomContentDirective());
-class TuiTextfieldCustomContentDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {}
-TuiTextfieldCustomContentDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldCustomContentDirective_BaseFactory;
- return function TuiTextfieldCustomContentDirective_Factory(t) {
- return (ɵTuiTextfieldCustomContentDirective_BaseFactory || (ɵTuiTextfieldCustomContentDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldCustomContentDirective)))(t || TuiTextfieldCustomContentDirective);
+function makeKeyValuePair(key, value) {
+ return {
+ key: key,
+ value: value
};
-}();
-TuiTextfieldCustomContentDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldCustomContentDirective,
- selectors: [["", "tuiTextfieldCustomContent", ""]],
- inputs: {
- customContent: ["tuiTextfieldCustomContent", "customContent"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_CUSTOM_CONTENT,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldCustomContentDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldCustomContentDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
- args: [{
- selector: '[tuiTextfieldCustomContent]',
- providers: [{
- provide: TUI_TEXTFIELD_CUSTOM_CONTENT,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldCustomContentDirective)
- }]
- }]
- }], null, {
- customContent: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldCustomContent']
- }]
- });
-})();
-const TUI_TEXTFIELD_FILLER = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldFillerDirective());
-class TuiTextfieldFillerDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {
- constructor() {
- super(...arguments);
- this.filler = '';
- }
}
-TuiTextfieldFillerDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldFillerDirective_BaseFactory;
- return function TuiTextfieldFillerDirective_Factory(t) {
- return (ɵTuiTextfieldFillerDirective_BaseFactory || (ɵTuiTextfieldFillerDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldFillerDirective)))(t || TuiTextfieldFillerDirective);
- };
-}();
-TuiTextfieldFillerDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldFillerDirective,
- selectors: [["", "tuiTextfieldFiller", ""]],
- inputs: {
- filler: ["tuiTextfieldFiller", "filler"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_FILLER,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldFillerDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldFillerDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
- args: [{
- selector: '[tuiTextfieldFiller]',
- providers: [{
- provide: TUI_TEXTFIELD_FILLER,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldFillerDirective)
- }]
- }]
- }], null, {
- filler: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldFiller']
- }]
- });
-})();
-const TUI_TEXTFIELD_ICON = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldIconDirective());
-class TuiTextfieldIconDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {}
-TuiTextfieldIconDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldIconDirective_BaseFactory;
- return function TuiTextfieldIconDirective_Factory(t) {
- return (ɵTuiTextfieldIconDirective_BaseFactory || (ɵTuiTextfieldIconDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldIconDirective)))(t || TuiTextfieldIconDirective);
- };
-}();
-TuiTextfieldIconDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldIconDirective,
- selectors: [["", "tuiTextfieldIcon", ""]],
- inputs: {
- icon: ["tuiTextfieldIcon", "icon"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_ICON,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldIconDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldIconDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
- args: [{
- selector: '[tuiTextfieldIcon]',
- providers: [{
- provide: TUI_TEXTFIELD_ICON,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldIconDirective)
- }]
- }]
- }], null, {
- icon: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldIcon']
- }]
- });
-})();
-const TUI_TEXTFIELD_ICON_LEFT = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldIconLeftDirective());
-class TuiTextfieldIconLeftDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {}
-TuiTextfieldIconLeftDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldIconLeftDirective_BaseFactory;
- return function TuiTextfieldIconLeftDirective_Factory(t) {
- return (ɵTuiTextfieldIconLeftDirective_BaseFactory || (ɵTuiTextfieldIconLeftDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldIconLeftDirective)))(t || TuiTextfieldIconLeftDirective);
- };
-}();
-TuiTextfieldIconLeftDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldIconLeftDirective,
- selectors: [["", "tuiTextfieldIconLeft", ""]],
- inputs: {
- iconLeft: ["tuiTextfieldIconLeft", "iconLeft"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_ICON_LEFT,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldIconLeftDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldIconLeftDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
- args: [{
- selector: '[tuiTextfieldIconLeft]',
- providers: [{
- provide: TUI_TEXTFIELD_ICON_LEFT,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldIconLeftDirective)
- }]
- }]
- }], null, {
- iconLeft: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldIconLeft']
- }]
- });
-})();
-const TUI_TEXTFIELD_LABEL_OUTSIDE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldLabelOutsideDirective());
-class TuiTextfieldLabelOutsideDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {
- constructor() {
- super(...arguments);
- this.labelOutside = false;
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Transforms Object or Map into an array of key value pairs.
+ *
+ * The output array will be ordered by keys.
+ * By default the comparator will be by Unicode point value.
+ * You can optionally pass a compareFn if your keys are complex types.
+ *
+ * @usageNotes
+ * ### Examples
+ *
+ * This examples show how an Object or a Map can be iterated by ngFor with the use of this
+ * keyvalue pipe.
+ *
+ * {@example common/pipes/ts/keyvalue_pipe.ts region='KeyValuePipe'}
+ *
+ * @publicApi
+ */
+class KeyValuePipe {
+ constructor(differs) {
+ this.differs = differs;
+ this.keyValues = [];
+ this.compareFn = defaultComparator;
}
-}
-TuiTextfieldLabelOutsideDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldLabelOutsideDirective_BaseFactory;
- return function TuiTextfieldLabelOutsideDirective_Factory(t) {
- return (ɵTuiTextfieldLabelOutsideDirective_BaseFactory || (ɵTuiTextfieldLabelOutsideDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldLabelOutsideDirective)))(t || TuiTextfieldLabelOutsideDirective);
- };
-}();
-TuiTextfieldLabelOutsideDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldLabelOutsideDirective,
- selectors: [["", "tuiTextfieldLabelOutside", ""]],
- inputs: {
- labelOutside: ["tuiTextfieldLabelOutside", "labelOutside"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_LABEL_OUTSIDE,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldLabelOutsideDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldLabelOutsideDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
- args: [{
- selector: '[tuiTextfieldLabelOutside]',
- providers: [{
- provide: TUI_TEXTFIELD_LABEL_OUTSIDE,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldLabelOutsideDirective)
- }]
- }]
- }], null, {
- labelOutside: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldLabelOutside']
- }]
- });
-})();
-const TUI_TEXTFIELD_POSTFIX = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldPostfixDirective());
-class TuiTextfieldPostfixDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {
- constructor() {
- super(...arguments);
- this.postfix = '';
+ transform(input, compareFn = defaultComparator) {
+ if (!input || !(input instanceof Map) && typeof input !== 'object') {
+ return null;
+ }
+ if (!this.differ) {
+ // make a differ for whatever type we've been passed in
+ this.differ = this.differs.find(input).create();
+ }
+ const differChanges = this.differ.diff(input);
+ const compareFnChanged = compareFn !== this.compareFn;
+ if (differChanges) {
+ this.keyValues = [];
+ differChanges.forEachItem(r => {
+ this.keyValues.push(makeKeyValuePair(r.key, r.currentValue));
+ });
+ }
+ if (differChanges || compareFnChanged) {
+ this.keyValues.sort(compareFn);
+ this.compareFn = compareFn;
+ }
+ return this.keyValues;
}
}
-TuiTextfieldPostfixDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldPostfixDirective_BaseFactory;
- return function TuiTextfieldPostfixDirective_Factory(t) {
- return (ɵTuiTextfieldPostfixDirective_BaseFactory || (ɵTuiTextfieldPostfixDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldPostfixDirective)))(t || TuiTextfieldPostfixDirective);
- };
-}();
-TuiTextfieldPostfixDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldPostfixDirective,
- selectors: [["", "tuiTextfieldPostfix", ""]],
- inputs: {
- postfix: ["tuiTextfieldPostfix", "postfix"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_POSTFIX,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldPostfixDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
+_KeyValuePipe = KeyValuePipe;
+_KeyValuePipe.ɵfac = function _KeyValuePipe_Factory(t) {
+ return new (t || _KeyValuePipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers, 16));
+};
+_KeyValuePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "keyvalue",
+ type: _KeyValuePipe,
+ pure: false,
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldPostfixDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](KeyValuePipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- selector: '[tuiTextfieldPostfix]',
- providers: [{
- provide: TUI_TEXTFIELD_POSTFIX,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldPostfixDirective)
- }]
- }]
- }], null, {
- postfix: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldPostfix']
+ name: 'keyvalue',
+ pure: false,
+ standalone: true
}]
- });
+ }], function () {
+ return [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.KeyValueDiffers
+ }];
+ }, null);
})();
-const TUI_TEXTFIELD_PREFIX = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldPrefixDirective());
-class TuiTextfieldPrefixDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {
- constructor() {
- super(...arguments);
- this.prefix = '';
+function defaultComparator(keyValueA, keyValueB) {
+ const a = keyValueA.key;
+ const b = keyValueB.key;
+ // if same exit with 0;
+ if (a === b) return 0;
+ // make sure that undefined are at the end of the sort.
+ if (a === undefined) return 1;
+ if (b === undefined) return -1;
+ // make sure that nulls are at the end of the sort.
+ if (a === null) return 1;
+ if (b === null) return -1;
+ if (typeof a == 'string' && typeof b == 'string') {
+ return a < b ? -1 : 1;
}
-}
-TuiTextfieldPrefixDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldPrefixDirective_BaseFactory;
- return function TuiTextfieldPrefixDirective_Factory(t) {
- return (ɵTuiTextfieldPrefixDirective_BaseFactory || (ɵTuiTextfieldPrefixDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldPrefixDirective)))(t || TuiTextfieldPrefixDirective);
- };
-}();
-TuiTextfieldPrefixDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldPrefixDirective,
- selectors: [["", "tuiTextfieldPrefix", ""]],
- inputs: {
- prefix: ["tuiTextfieldPrefix", "prefix"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_PREFIX,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldPrefixDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldPrefixDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
- args: [{
- selector: '[tuiTextfieldPrefix]',
- providers: [{
- provide: TUI_TEXTFIELD_PREFIX,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldPrefixDirective)
- }]
- }]
- }], null, {
- prefix: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldPrefix']
- }]
- });
-})();
-const TUI_TEXTFIELD_SIZE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => new TuiTextfieldSizeDirective());
-class TuiTextfieldSizeDirective extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.AbstractTuiController {
- constructor() {
- super(...arguments);
- this.size = 'l';
+ if (typeof a == 'number' && typeof b == 'number') {
+ return a - b;
}
-}
-TuiTextfieldSizeDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiTextfieldSizeDirective_BaseFactory;
- return function TuiTextfieldSizeDirective_Factory(t) {
- return (ɵTuiTextfieldSizeDirective_BaseFactory || (ɵTuiTextfieldSizeDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiTextfieldSizeDirective)))(t || TuiTextfieldSizeDirective);
- };
-}();
-TuiTextfieldSizeDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiTextfieldSizeDirective,
- selectors: [["", "tuiTextfieldSize", ""]],
- inputs: {
- size: ["tuiTextfieldSize", "size"]
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([{
- provide: TUI_TEXTFIELD_SIZE,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldSizeDirective)
- }]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldSizeDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
- args: [{
- selector: '[tuiTextfieldSize]',
- providers: [{
- provide: TUI_TEXTFIELD_SIZE,
- useExisting: (0,_angular_core__WEBPACK_IMPORTED_MODULE_2__.forwardRef)(() => TuiTextfieldSizeDirective)
- }]
- }]
- }], null, {
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input,
- args: ['tuiTextfieldSize']
- }]
- });
-})();
-class TuiTextfieldControllerModule {}
-TuiTextfieldControllerModule.ɵfac = function TuiTextfieldControllerModule_Factory(t) {
- return new (t || TuiTextfieldControllerModule)();
-};
-TuiTextfieldControllerModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({
- type: TuiTextfieldControllerModule
-});
-TuiTextfieldControllerModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiTextfieldControllerModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule,
- args: [{
- declarations: [TuiTextfieldAppearanceDirective, TuiTextfieldCleanerDirective, TuiTextfieldCustomContentDirective, TuiTextfieldLabelOutsideDirective, TuiTextfieldSizeDirective, TuiTextfieldIconDirective, TuiTextfieldIconLeftDirective, TuiTextfieldPrefixDirective, TuiTextfieldPostfixDirective, TuiTextfieldFillerDirective],
- exports: [TuiTextfieldAppearanceDirective, TuiTextfieldCleanerDirective, TuiTextfieldCustomContentDirective, TuiTextfieldLabelOutsideDirective, TuiTextfieldSizeDirective, TuiTextfieldIconDirective, TuiTextfieldIconLeftDirective, TuiTextfieldPrefixDirective, TuiTextfieldPostfixDirective, TuiTextfieldFillerDirective]
- }]
- }], null, null);
-})();
-const TUI_TEXTFIELD_WATCHED_CONTROLLER = new _angular_core__WEBPACK_IMPORTED_MODULE_2__.InjectionToken('[TUI_TEXTFIELD_WATCHED_CONTROLLER]');
-const TEXTFIELD_CONTROLLER_PROVIDER = [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService, {
- provide: TUI_TEXTFIELD_WATCHED_CONTROLLER,
- deps: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDestroyService, TUI_TEXTFIELD_OPTIONS, _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_4__.TUI_TEXTFIELD_APPEARANCE, TUI_TEXTFIELD_APPEARANCE_DIRECTIVE, TUI_TEXTFIELD_CLEANER, TUI_TEXTFIELD_CUSTOM_CONTENT, TUI_TEXTFIELD_ICON, TUI_TEXTFIELD_ICON_LEFT, TUI_TEXTFIELD_LABEL_OUTSIDE, TUI_TEXTFIELD_SIZE, TUI_TEXTFIELD_PREFIX, TUI_TEXTFIELD_POSTFIX, TUI_TEXTFIELD_FILLER],
- useFactory: (cdr, destroy$, options, legacyAppearance, ...controllers) => {
- const change$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.merge)(...controllers.map(({
- change$
- }) => change$ || rxjs__WEBPACK_IMPORTED_MODULE_6__.NEVER)).pipe((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiWatch)(cdr), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.takeUntil)(destroy$));
- change$.subscribe();
- return new TuiTextfieldController(change$, options, legacyAppearance, ...controllers);
+ if (typeof a == 'boolean' && typeof b == 'boolean') {
+ return a < b ? -1 : 1;
}
-}];
+ // `a` and `b` are of different types. Compare their string values.
+ const aString = String(a);
+ const bString = String(b);
+ return aString == bString ? 0 : aString < bString ? -1 : 1;
+}
/**
- * Generated bundle index. Do not edit.
+ * @ngModule CommonModule
+ * @description
+ *
+ * Formats a value according to digit options and locale rules.
+ * Locale determines group sizing and separator,
+ * decimal point character, and other locale-specific configurations.
+ *
+ * @see {@link formatNumber}
+ *
+ * @usageNotes
+ *
+ * ### digitsInfo
+ *
+ * The value's decimal representation is specified by the `digitsInfo`
+ * parameter, written in the following format:
+ *
+ * ```
+ * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}
+ * ```
+ *
+ * - `minIntegerDigits`:
+ * The minimum number of integer digits before the decimal point.
+ * Default is 1.
+ *
+ * - `minFractionDigits`:
+ * The minimum number of digits after the decimal point.
+ * Default is 0.
+ *
+ * - `maxFractionDigits`:
+ * The maximum number of digits after the decimal point.
+ * Default is 3.
+ *
+ * If the formatted value is truncated it will be rounded using the "to-nearest" method:
+ *
+ * ```
+ * {{3.6 | number: '1.0-0'}}
+ *
+ *
+ * {{-3.6 | number:'1.0-0'}}
+ *
+ * ```
+ *
+ * ### locale
+ *
+ * `locale` will format a value according to locale rules.
+ * Locale determines group sizing and separator,
+ * decimal point character, and other locale-specific configurations.
+ *
+ * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
+ *
+ * See [Setting your app locale](guide/i18n-common-locale-id).
+ *
+ * ### Example
+ *
+ * The following code shows how the pipe transforms values
+ * according to various format specifications,
+ * where the caller's default locale is `en-US`.
+ *
+ *
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 8001:
-/*!**********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-directives-wrapper.js ***!
- \**********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiWrapperDirective: () => (/* binding */ TuiWrapperDirective),
-/* harmony export */ TuiWrapperModule: () => (/* binding */ TuiWrapperModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/core/enums */ 4715);
-/* harmony import */ var _taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core/providers */ 2871);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 4517);
-
-
-
-
-
-
-class TuiWrapperDirective {
- constructor(mode$) {
- this.mode$ = mode$;
- this.disabled = false;
- this.readOnly = false;
- this.hover = null;
- this.active = null;
- this.focus = false;
- this.invalid = false;
- this.appearance = '';
- }
- get computedInvalid() {
- return !this.disabled && !this.readOnly && this.invalid;
- }
- get computedFocused() {
- return this.focus && !this.disabled;
+class DecimalPipe {
+ constructor(_locale) {
+ this._locale = _locale;
}
- get interactiveState() {
- if (this.disabled) {
- return _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_0__.TuiInteractiveState.Disabled;
- }
- if (this.readOnly) {
- return _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_0__.TuiInteractiveState.Readonly;
- }
- if (this.active) {
- return _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_0__.TuiInteractiveState.Active;
- }
- if (this.hover) {
- return _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_0__.TuiInteractiveState.Hover;
+ /**
+ * @param value The value to be formatted.
+ * @param digitsInfo Sets digit and decimal representation.
+ * [See more](#digitsinfo).
+ * @param locale Specifies what locale format rules to use.
+ * [See more](#locale).
+ */
+ transform(value, digitsInfo, locale) {
+ if (!isValue(value)) return null;
+ locale = locale || this._locale;
+ try {
+ const num = strToNumber(value);
+ return formatNumber(num, locale, digitsInfo);
+ } catch (error) {
+ throw invalidPipeArgumentError(DecimalPipe, error.message);
}
- return null;
- }
- get noHover() {
- return this.readOnly || this.hover === false;
- }
- get noActive() {
- return this.readOnly || this.active === false;
}
}
-TuiWrapperDirective.ɵfac = function TuiWrapperDirective_Factory(t) {
- return new (t || TuiWrapperDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_MODE));
+_DecimalPipe = DecimalPipe;
+_DecimalPipe.ɵfac = function _DecimalPipe_Factory(t) {
+ return new (t || _DecimalPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID, 16));
};
-TuiWrapperDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({
- type: TuiWrapperDirective,
- selectors: [["", "tuiWrapper", ""]],
- hostVars: 10,
- hostBindings: function TuiWrapperDirective_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("$.data-mode.attr", function TuiWrapperDirective___data_mode_attr_HostBindingHandler() {
- return ctx.mode$;
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵattribute"]("data-appearance", ctx.appearance)("data-state", ctx.interactiveState);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵclassProp"]("_invalid", ctx.computedInvalid)("_focused", ctx.computedFocused)("_no-hover", ctx.noHover)("_no-active", ctx.noActive);
- }
- },
- inputs: {
- disabled: "disabled",
- readOnly: "readOnly",
- hover: "hover",
- active: "active",
- focus: "focus",
- invalid: "invalid",
- appearance: "appearance"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([_taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_3__.MODE_PROVIDER])]
+_DecimalPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "number",
+ type: _DecimalPipe,
+ pure: true,
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiWrapperDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](DecimalPipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- selector: '[tuiWrapper]',
- providers: [_taiga_ui_core_providers__WEBPACK_IMPORTED_MODULE_3__.MODE_PROVIDER],
- host: {
- '($.data-mode.attr)': 'mode$'
- }
+ name: 'number',
+ standalone: true
}]
}], function () {
return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_4__.Observable,
+ type: undefined,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_MODE]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
+ args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID]
}]
}];
- }, {
- disabled: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- readOnly: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- hover: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- active: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- focus: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- invalid: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- appearance: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['attr.data-appearance']
- }],
- computedInvalid: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['class._invalid']
- }],
- computedFocused: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['class._focused']
- }],
- interactiveState: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['attr.data-state']
- }],
- noHover: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['class._no-hover']
- }],
- noActive: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['class._no-active']
- }]
- });
-})();
-class TuiWrapperModule {}
-TuiWrapperModule.ɵfac = function TuiWrapperModule_Factory(t) {
- return new (t || TuiWrapperModule)();
-};
-TuiWrapperModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
- type: TuiWrapperModule
-});
-TuiWrapperModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiWrapperModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule,
- args: [{
- declarations: [TuiWrapperDirective],
- exports: [TuiWrapperDirective]
- }]
- }], null, null);
+ }, null);
})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 4715:
-/*!*********************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-enums.js ***!
- \*********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiAppearance: () => (/* binding */ TuiAppearance),
-/* harmony export */ TuiDropdownAnimation: () => (/* binding */ TuiDropdownAnimation),
-/* harmony export */ TuiInteractiveState: () => (/* binding */ TuiInteractiveState),
-/* harmony export */ TuiNotification: () => (/* binding */ TuiNotification),
-/* harmony export */ TuiRangeState: () => (/* binding */ TuiRangeState)
-/* harmony export */ });
-// TODO: change type in v4.0
-// eslint-disable-next-line no-restricted-syntax
-var TuiAppearance;
-(function (TuiAppearance) {
- TuiAppearance["Accent"] = "accent";
- TuiAppearance["Flat"] = "flat";
- TuiAppearance["Icon"] = "icon";
- TuiAppearance["Outline"] = "outline";
- TuiAppearance["Primary"] = "primary";
- TuiAppearance["Secondary"] = "secondary";
- TuiAppearance["SecondaryDestructive"] = "secondary-destructive";
- TuiAppearance["Table"] = "table";
- TuiAppearance["Textfield"] = "textfield";
- TuiAppearance["Whiteblock"] = "whiteblock";
- TuiAppearance["WhiteblockActive"] = "whiteblock-active";
-})(TuiAppearance || (TuiAppearance = {}));
-
-/** @deprecated not used anymore TODO: remove in 4.0 **/
-// eslint-disable-next-line no-restricted-syntax
-var TuiDropdownAnimation;
-(function (TuiDropdownAnimation) {
- TuiDropdownAnimation["FadeInBottom"] = "fadeInBottom";
- TuiDropdownAnimation["FadeInTop"] = "fadeInTop";
-})(TuiDropdownAnimation || (TuiDropdownAnimation = {}));
-
-/**
- * @internal used in calendar, year picker and wrapper
- */
-// TODO: change type in v4.0
-// eslint-disable-next-line no-restricted-syntax
-var TuiInteractiveState;
-(function (TuiInteractiveState) {
- TuiInteractiveState["Active"] = "active";
- TuiInteractiveState["Disabled"] = "disabled";
- TuiInteractiveState["Hover"] = "hover";
- TuiInteractiveState["Readonly"] = "readonly";
-})(TuiInteractiveState || (TuiInteractiveState = {}));
-
-/**
- * @deprecated use union type TuiNotificationT instead
- */
-// eslint-disable-next-line no-restricted-syntax
-var TuiNotification;
-(function (TuiNotification) {
- TuiNotification["Error"] = "error";
- TuiNotification["Info"] = "info";
- TuiNotification["Success"] = "success";
- TuiNotification["Warning"] = "warning";
-})(TuiNotification || (TuiNotification = {}));
-
-/**
- * @internal used in calendar and year picker
- */
-// TODO: change type in v4.0
-// eslint-disable-next-line no-restricted-syntax
-var TuiRangeState;
-(function (TuiRangeState) {
- TuiRangeState["End"] = "end";
- TuiRangeState["Single"] = "single";
- TuiRangeState["Start"] = "start";
-})(TuiRangeState || (TuiRangeState = {}));
-
/**
- * Generated bundle index. Do not edit.
+ * @ngModule CommonModule
+ * @description
+ *
+ * Transforms a number to a percentage
+ * string, formatted according to locale rules that determine group sizing and
+ * separator, decimal-point character, and other locale-specific
+ * configurations.
+ *
+ * @see {@link formatPercent}
+ *
+ * @usageNotes
+ * The following code shows how the pipe transforms numbers
+ * into text strings, according to various format specifications,
+ * where the caller's default locale is `en-US`.
+ *
+ *
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 7007:
-/*!**************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-internal-svg-defs-host.js ***!
- \**************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiSvgDefsHostComponent: () => (/* binding */ TuiSvgDefsHostComponent),
-/* harmony export */ TuiSvgDefsHostModule: () => (/* binding */ TuiSvgDefsHostModule)
-/* harmony export */ });
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 9163);
-/* harmony import */ var _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core/services */ 1717);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 5213);
-
-
-
-
-
-
-
-
-
-function TuiSvgDefsHostComponent__svg_ng_container_1__svg_defs_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnamespaceSVG"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "defs", 4);
- }
- if (rf & 2) {
- const def_r4 = ctx.$implicit;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("innerHTML", def_r4, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]);
- }
-}
-function TuiSvgDefsHostComponent__svg_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnamespaceSVG"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiSvgDefsHostComponent__svg_ng_container_1__svg_defs_1_Template, 1, 1, "defs", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx_r0.items);
- }
-}
-function TuiSvgDefsHostComponent__svg_ng_template_2__svg_defs_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnamespaceSVG"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "defs");
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](1, "svg", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const def_r6 = ctx.$implicit;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("outerHTML", def_r6, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵsanitizeHtml"]);
- }
-}
-function TuiSvgDefsHostComponent__svg_ng_template_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnamespaceSVG"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiSvgDefsHostComponent__svg_ng_template_2__svg_defs_0_Template, 2, 1, "defs", 5);
- }
- if (rf & 2) {
- const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx_r2.items);
- }
-}
-class TuiSvgDefsHostComponent {
- constructor(svgService, cdr, destroy$, platformId) {
- this.svgService = svgService;
- this.cdr = cdr;
- this.destroy$ = destroy$;
- this.isBrowser = true;
- this.isBrowser = !(0,_angular_common__WEBPACK_IMPORTED_MODULE_1__.isPlatformServer)(platformId);
+class PercentPipe {
+ constructor(_locale) {
+ this._locale = _locale;
}
- // @bad TODO: Looks like it could be async piped but it was probably written like that for a reason
- ngOnInit() {
- this.svgService.items$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.takeUntil)(this.destroy$)).subscribe(defsMap => {
- this.items = defsMap.values();
- this.cdr.detectChanges();
- });
+ /**
+ *
+ * @param value The number to be formatted as a percentage.
+ * @param digitsInfo Decimal representation options, specified by a string
+ * in the following format:
+ * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}.
+ * - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
+ * Default is `1`.
+ * - `minFractionDigits`: The minimum number of digits after the decimal point.
+ * Default is `0`.
+ * - `maxFractionDigits`: The maximum number of digits after the decimal point.
+ * Default is `0`.
+ * @param locale A locale code for the locale format rules to use.
+ * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
+ * See [Setting your app locale](guide/i18n-common-locale-id).
+ */
+ transform(value, digitsInfo, locale) {
+ if (!isValue(value)) return null;
+ locale = locale || this._locale;
+ try {
+ const num = strToNumber(value);
+ return formatPercent(num, locale, digitsInfo);
+ } catch (error) {
+ throw invalidPipeArgumentError(PercentPipe, error.message);
+ }
}
}
-TuiSvgDefsHostComponent.ɵfac = function TuiSvgDefsHostComponent_Factory(t) {
- return new (t || TuiSvgDefsHostComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_3__.TuiSvgService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.TuiDestroyService, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.PLATFORM_ID));
+_PercentPipe = PercentPipe;
+_PercentPipe.ɵfac = function _PercentPipe_Factory(t) {
+ return new (t || _PercentPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID, 16));
};
-TuiSvgDefsHostComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiSvgDefsHostComponent,
- selectors: [["tui-svg-defs-host"]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.TuiDestroyService])],
- decls: 4,
- vars: 2,
- consts: [["version", "1.1", 0, "xmlns", "xlink", "http://www.w3.org/1999/xlink", "xmlns", "http://www.w3.org/2000/svg"], [4, "ngIf", "ngIfElse"], ["server", ""], [3, "innerHTML", 4, "ngFor", "ngForOf"], [3, "innerHTML"], [4, "ngFor", "ngForOf"], [3, "outerHTML"]],
- template: function TuiSvgDefsHostComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnamespaceSVG"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "svg", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiSvgDefsHostComponent__svg_ng_container_1_Template, 2, 1, "ng-container", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiSvgDefsHostComponent__svg_ng_template_2_Template, 1, 1, "ng-template", null, 2, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplateRefExtractor"]);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.isBrowser)("ngIfElse", _r1);
- }
- },
- dependencies: [_angular_common__WEBPACK_IMPORTED_MODULE_1__.NgIf, _angular_common__WEBPACK_IMPORTED_MODULE_1__.NgForOf],
- styles: ["[_nghost-%COMP%]{display:none}"],
- changeDetection: 0
+_PercentPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "percent",
+ type: _PercentPipe,
+ pure: true,
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiSvgDefsHostComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PercentPipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- selector: 'tui-svg-defs-host',
- templateUrl: './svg-defs-host.template.html',
- styleUrls: ['./svg-defs-host.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.TuiDestroyService]
+ name: 'percent',
+ standalone: true
}]
}], function () {
return [{
- type: _taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_3__.TuiSvgService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core_services__WEBPACK_IMPORTED_MODULE_3__.TuiSvgService]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.TuiDestroyService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.TuiDestroyService]
- }]
- }, {
type: undefined,
decorators: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.PLATFORM_ID]
+ args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID]
}]
}];
}, null);
})();
-class TuiSvgDefsHostModule {}
-TuiSvgDefsHostModule.ɵfac = function TuiSvgDefsHostModule_Factory(t) {
- return new (t || TuiSvgDefsHostModule)();
-};
-TuiSvgDefsHostModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiSvgDefsHostModule
-});
-TuiSvgDefsHostModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_1__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.TuiLetModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiSvgDefsHostModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_1__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.TuiLetModule],
- declarations: [TuiSvgDefsHostComponent],
- exports: [TuiSvgDefsHostComponent]
- }]
- }], null, null);
-})();
-
/**
- * Generated bundle index. Do not edit.
+ * @ngModule CommonModule
+ * @description
+ *
+ * Transforms a number to a currency string, formatted according to locale rules
+ * that determine group sizing and separator, decimal-point character,
+ * and other locale-specific configurations.
+ *
+ *
+ * @see {@link getCurrencySymbol}
+ * @see {@link formatCurrency}
+ *
+ * @usageNotes
+ * The following code shows how the pipe transforms numbers
+ * into text strings, according to various format specifications,
+ * where the caller's default locale is `en-US`.
+ *
+ *
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 5523:
-/*!**************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-pipes-flag.js ***!
- \**************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiFlagPipe: () => (/* binding */ TuiFlagPipe),
-/* harmony export */ TuiFlagPipeModule: () => (/* binding */ TuiFlagPipeModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core/components/svg */ 3442);
-/* harmony import */ var _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/core/constants */ 6628);
-/* harmony import */ var _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/i18n */ 9633);
-
-
-
-
-
-class TuiFlagPipe {
- constructor(svgOptions) {
- this.svgOptions = svgOptions;
- this.staticPath = this.svgOptions.path('tuiIcon').replace('tuiIcon.svg#tuiIcon', '').replace(`tuiIcon.svg${_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_0__.TUI_CACHE_BUSTING_PAYLOAD}#tuiIcon`, '');
+class CurrencyPipe {
+ constructor(_locale, _defaultCurrencyCode = 'USD') {
+ this._locale = _locale;
+ this._defaultCurrencyCode = _defaultCurrencyCode;
}
- transform(countryIsoCode) {
- if (!countryIsoCode) {
- return null;
+ /**
+ *
+ * @param value The number to be formatted as currency.
+ * @param currencyCode The [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) currency code,
+ * such as `USD` for the US dollar and `EUR` for the euro. The default currency code can be
+ * configured using the `DEFAULT_CURRENCY_CODE` injection token.
+ * @param display The format for the currency indicator. One of the following:
+ * - `code`: Show the code (such as `USD`).
+ * - `symbol`(default): Show the symbol (such as `$`).
+ * - `symbol-narrow`: Use the narrow symbol for locales that have two symbols for their
+ * currency.
+ * For example, the Canadian dollar CAD has the symbol `CA$` and the symbol-narrow `$`. If the
+ * locale has no narrow symbol, uses the standard symbol for the locale.
+ * - String: Use the given string value instead of a code or a symbol.
+ * For example, an empty string will suppress the currency & symbol.
+ * - Boolean (marked deprecated in v5): `true` for symbol and false for `code`.
+ *
+ * @param digitsInfo Decimal representation options, specified by a string
+ * in the following format:
+ * {minIntegerDigits}.{minFractionDigits}-{maxFractionDigits}.
+ * - `minIntegerDigits`: The minimum number of integer digits before the decimal point.
+ * Default is `1`.
+ * - `minFractionDigits`: The minimum number of digits after the decimal point.
+ * Default is `2`.
+ * - `maxFractionDigits`: The maximum number of digits after the decimal point.
+ * Default is `2`.
+ * If not provided, the number will be formatted with the proper amount of digits,
+ * depending on what the [ISO 4217](https://en.wikipedia.org/wiki/ISO_4217) specifies.
+ * For example, the Canadian dollar has 2 digits, whereas the Chilean peso has none.
+ * @param locale A locale code for the locale format rules to use.
+ * When not supplied, uses the value of `LOCALE_ID`, which is `en-US` by default.
+ * See [Setting your app locale](guide/i18n-common-locale-id).
+ */
+ transform(value, currencyCode = this._defaultCurrencyCode, display = 'symbol', digitsInfo, locale) {
+ if (!isValue(value)) return null;
+ locale = locale || this._locale;
+ if (typeof display === 'boolean') {
+ if ((typeof ngDevMode === 'undefined' || ngDevMode) && console && console.warn) {
+ console.warn(`Warning: the currency pipe has been changed in Angular v5. The symbolDisplay option (third parameter) is now a string instead of a boolean. The accepted values are "code", "symbol" or "symbol-narrow".`);
+ }
+ display = display ? 'symbol' : 'code';
}
- switch (countryIsoCode) {
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.BL:
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.BQ:
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.CW:
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.GF:
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.GP:
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.MF:
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.MQ:
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.NC:
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.RE:
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.YT:
- return `${this.staticPath}${_taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.FR}.png`;
- case _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.SX:
- return `${this.staticPath}${_taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_1__.TuiCountryIsoCode.NL}.png`;
- default:
- return `${this.staticPath}${countryIsoCode}.png`;
+ let currency = currencyCode || this._defaultCurrencyCode;
+ if (display !== 'code') {
+ if (display === 'symbol' || display === 'symbol-narrow') {
+ currency = getCurrencySymbol(currency, display === 'symbol' ? 'wide' : 'narrow', locale);
+ } else {
+ currency = display;
+ }
+ }
+ try {
+ const num = strToNumber(value);
+ return formatCurrency(num, locale, currency, currencyCode, digitsInfo);
+ } catch (error) {
+ throw invalidPipeArgumentError(CurrencyPipe, error.message);
}
}
}
-TuiFlagPipe.ɵfac = function TuiFlagPipe_Factory(t) {
- return new (t || TuiFlagPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__.TUI_SVG_OPTIONS, 16));
+_CurrencyPipe = CurrencyPipe;
+_CurrencyPipe.ɵfac = function _CurrencyPipe_Factory(t) {
+ return new (t || _CurrencyPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID, 16), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_CURRENCY_CODE, 16));
};
-TuiFlagPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefinePipe"]({
- name: "tuiFlag",
- type: TuiFlagPipe,
- pure: true
+_CurrencyPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "currency",
+ type: _CurrencyPipe,
+ pure: true,
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiFlagPipe, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Pipe,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CurrencyPipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- name: 'tuiFlag'
+ name: 'currency',
+ standalone: true
}]
}], function () {
return [{
type: undefined,
decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_taiga_ui_core_components_svg__WEBPACK_IMPORTED_MODULE_3__.TUI_SVG_OPTIONS]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
+ args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.LOCALE_ID]
+ }]
+ }, {
+ type: undefined,
+ decorators: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
+ args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_CURRENCY_CODE]
}]
}];
}, null);
})();
-class TuiFlagPipeModule {}
-TuiFlagPipeModule.ɵfac = function TuiFlagPipeModule_Factory(t) {
- return new (t || TuiFlagPipeModule)();
-};
-TuiFlagPipeModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({
- type: TuiFlagPipeModule
-});
-TuiFlagPipeModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiFlagPipeModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule,
- args: [{
- declarations: [TuiFlagPipe],
- exports: [TuiFlagPipe]
- }]
- }], null, null);
-})();
-
+function isValue(value) {
+ return !(value == null || value === '' || value !== value);
+}
/**
- * Generated bundle index. Do not edit.
+ * Transforms a string into a number (if needed).
*/
+function strToNumber(value) {
+ // Convert strings to numbers
+ if (typeof value === 'string' && !isNaN(Number(value) - parseFloat(value))) {
+ return Number(value);
+ }
+ if (typeof value !== 'number') {
+ throw new Error(`${value} is not a number`);
+ }
+ return value;
+}
-
-
-/***/ }),
-
-/***/ 475:
-/*!***************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-pipes-month.js ***!
- \***************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiMonthPipe: () => (/* binding */ TuiMonthPipe),
-/* harmony export */ TuiMonthPipeModule: () => (/* binding */ TuiMonthPipeModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 4517);
-
-
-
-
-
-class TuiMonthPipe {
- constructor(months$) {
- this.months$ = months$;
+/**
+ * @ngModule CommonModule
+ * @description
+ *
+ * Creates a new `Array` or `String` containing a subset (slice) of the elements.
+ *
+ * @usageNotes
+ *
+ * All behavior is based on the expected behavior of the JavaScript API `Array.prototype.slice()`
+ * and `String.prototype.slice()`.
+ *
+ * When operating on an `Array`, the returned `Array` is always a copy even when all
+ * the elements are being returned.
+ *
+ * When operating on a blank value, the pipe returns the blank value.
+ *
+ * ### List Example
+ *
+ * This `ngFor` example:
+ *
+ * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_list'}
+ *
+ * produces the following:
+ *
+ * ```html
+ *
b
+ *
c
+ * ```
+ *
+ * ### String Examples
+ *
+ * {@example common/pipes/ts/slice_pipe.ts region='SlicePipe_string'}
+ *
+ * @publicApi
+ */
+class SlicePipe {
+ transform(value, start, end) {
+ if (value == null) return null;
+ if (!this.supports(value)) {
+ throw invalidPipeArgumentError(SlicePipe, value);
+ }
+ return value.slice(start, end);
}
- transform({
- month
- }) {
- return this.months$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_0__.map)(months => months[month]));
+ supports(obj) {
+ return typeof obj === 'string' || Array.isArray(obj);
}
}
-TuiMonthPipe.ɵfac = function TuiMonthPipe_Factory(t) {
- return new (t || TuiMonthPipe)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_MONTHS, 16));
+_SlicePipe = SlicePipe;
+_SlicePipe.ɵfac = function _SlicePipe_Factory(t) {
+ return new (t || _SlicePipe)();
};
-TuiMonthPipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefinePipe"]({
- name: "tuiMonth",
- type: TuiMonthPipe,
- pure: true
+_SlicePipe.ɵpipe = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefinePipe"]({
+ name: "slice",
+ type: _SlicePipe,
+ pure: false,
+ standalone: true
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiMonthPipe, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Pipe,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](SlicePipe, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Pipe,
args: [{
- name: 'tuiMonth'
+ name: 'slice',
+ pure: false,
+ standalone: true
}]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_3__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_2__.TUI_MONTHS]
- }]
- }];
- }, null);
+ }], null, null);
})();
-class TuiMonthPipeModule {}
-TuiMonthPipeModule.ɵfac = function TuiMonthPipeModule_Factory(t) {
- return new (t || TuiMonthPipeModule)();
+
+/**
+ * @module
+ * @description
+ * This module provides a set of common Pipes.
+ */
+/**
+ * A collection of Angular pipes that are likely to be used in each and every application.
+ */
+const COMMON_PIPES = [AsyncPipe, UpperCasePipe, LowerCasePipe, JsonPipe, SlicePipe, DecimalPipe, PercentPipe, TitleCasePipe, CurrencyPipe, DatePipe, I18nPluralPipe, I18nSelectPipe, KeyValuePipe];
+
+// Note: This does not contain the location providers,
+// as they need some platform specific implementations to work.
+/**
+ * Exports all the basic Angular directives and pipes,
+ * such as `NgIf`, `NgForOf`, `DecimalPipe`, and so on.
+ * Re-exported by `BrowserModule`, which is included automatically in the root
+ * `AppModule` when you create a new app with the CLI `new` command.
+ *
+ * @publicApi
+ */
+class CommonModule {}
+_CommonModule = CommonModule;
+_CommonModule.ɵfac = function _CommonModule_Factory(t) {
+ return new (t || _CommonModule)();
};
-TuiMonthPipeModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
- type: TuiMonthPipeModule
+_CommonModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
+ type: _CommonModule
});
-TuiMonthPipeModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({});
+_CommonModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiMonthPipeModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule,
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](CommonModule, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
args: [{
- declarations: [TuiMonthPipe],
- exports: [TuiMonthPipe]
+ imports: [COMMON_DIRECTIVES, COMMON_PIPES],
+ exports: [COMMON_DIRECTIVES, COMMON_PIPES]
}]
}], null, null);
})();
-
+const PLATFORM_BROWSER_ID = 'browser';
+const PLATFORM_SERVER_ID = 'server';
+const PLATFORM_WORKER_APP_ID = 'browserWorkerApp';
+const PLATFORM_WORKER_UI_ID = 'browserWorkerUi';
/**
- * Generated bundle index. Do not edit.
+ * Returns whether a platform id represents a browser platform.
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 2871:
-/*!*************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-providers.js ***!
- \*************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ MODE_PROVIDER: () => (/* binding */ MODE_PROVIDER),
-/* harmony export */ TUI_IS_MOBILE_RES_PROVIDER: () => (/* binding */ TUI_IS_MOBILE_RES_PROVIDER),
-/* harmony export */ tuiWatchedControllerFactory: () => (/* binding */ tuiWatchedControllerFactory)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var _taiga_ui_core_directives_mode__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core/directives/mode */ 7279);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-
-
-
-
-
-
-
+function isPlatformBrowser(platformId) {
+ return platformId === PLATFORM_BROWSER_ID;
+}
/**
- * @deprecated: drop in v4.0
+ * Returns whether a platform id represents a server platform.
+ * @publicApi
*/
-const TUI_IS_MOBILE_RES_PROVIDER = {
- provide: _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_0__.TUI_IS_MOBILE_RES,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_1__.SkipSelf(), _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_0__.TUI_IS_MOBILE_RES], _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef],
- useFactory: (mobile$, {
- nativeElement
- }) => {
- nativeElement['$.class._mobile'] = mobile$;
- return mobile$;
- }
-};
-const MODE_PROVIDER = {
- provide: _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_0__.TUI_MODE,
- deps: [[new _angular_core__WEBPACK_IMPORTED_MODULE_1__.Optional(), _taiga_ui_core_directives_mode__WEBPACK_IMPORTED_MODULE_2__.TuiModeDirective], _angular_core__WEBPACK_IMPORTED_MODULE_1__.ElementRef],
- useFactory: (mode, {
- nativeElement
- }) => {
- const mode$ = mode ? mode.change$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.startWith)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(() => mode.mode)) : (0,rxjs__WEBPACK_IMPORTED_MODULE_5__.of)(null);
- nativeElement['$.data-mode.attr'] = mode$;
- return mode$;
- }
-};
-function tuiWatchedControllerFactory(controller, cdr, destroy$) {
- controller.change$.pipe((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.tuiWatch)(cdr), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.takeUntil)(destroy$)).subscribe();
- return controller;
+function isPlatformServer(platformId) {
+ return platformId === PLATFORM_SERVER_ID;
}
-
/**
- * Generated bundle index. Do not edit.
+ * Returns whether a platform id represents a web worker app platform.
+ * @publicApi
+ * @deprecated This function serves no purpose since the removal of the Webworker platform. It will
+ * always return `false`.
*/
-
-
-
-/***/ }),
-
-/***/ 1717:
-/*!************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-services.js ***!
- \************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiBreakpointService: () => (/* binding */ TuiBreakpointService),
-/* harmony export */ TuiFormatDateService: () => (/* binding */ TuiFormatDateService),
-/* harmony export */ TuiHintService: () => (/* binding */ TuiHintService),
-/* harmony export */ TuiNightThemeService: () => (/* binding */ TuiNightThemeService),
-/* harmony export */ TuiPositionService: () => (/* binding */ TuiPositionService),
-/* harmony export */ TuiRouterLinkActiveService: () => (/* binding */ TuiRouterLinkActiveService),
-/* harmony export */ TuiSvgService: () => (/* binding */ TuiSvgService),
-/* harmony export */ TuiVisualViewportService: () => (/* binding */ TuiVisualViewportService)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! @taiga-ui/cdk */ 7589);
-/* harmony import */ var _taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/core/tokens */ 3359);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 5536);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs */ 7066);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs */ 5219);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! rxjs */ 523);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 5840);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 5603);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs/operators */ 9848);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @taiga-ui/core/abstract */ 9139);
-/* harmony import */ var _angular_router__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @angular/router */ 1099);
-/* harmony import */ var _angular_platform_browser__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @angular/platform-browser */ 4199);
-/* harmony import */ var _taiga_ui_core_utils_dom__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @taiga-ui/core/utils/dom */ 6721);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+function isPlatformWorkerApp(platformId) {
+ return platformId === PLATFORM_WORKER_APP_ID;
+}
/**
- * Service to provide the current breakpoint based on Taiga UI's media queries
+ * Returns whether a platform id represents a web worker UI platform.
+ * @publicApi
+ * @deprecated This function serves no purpose since the removal of the Webworker platform. It will
+ * always return `false`.
*/
-class TuiBreakpointService extends rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable {
- constructor(media, ngZone, size$) {
- super(subscriber => this.stream$.subscribe(subscriber));
- this.media = media;
- this.ngZone = ngZone;
- this.size$ = size$;
- this.sorted = Object.values(this.media).sort((a, b) => a - b);
- this.invert = Object.keys(this.media).reduce((ret, key) => Object.assign(Object.assign({}, ret), {
- [this.media[key]]: key
- }), {});
- this.stream$ = this.size$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.map)(({
- width
- }) => this.sorted.find(size => size > width)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.map)(key => this.invert[key || this.sorted[this.sorted.length - 1]]), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.distinctUntilChanged)(), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiZoneOptimized)(this.ngZone), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.shareReplay)({
- bufferSize: 1,
- refCount: true
- }));
- }
-}
-TuiBreakpointService.ɵfac = function TuiBreakpointService_Factory(t) {
- return new (t || TuiBreakpointService)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_MEDIA), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TUI_WINDOW_SIZE));
-};
-TuiBreakpointService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
- token: TuiBreakpointService,
- factory: TuiBreakpointService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](TuiBreakpointService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_MEDIA]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TUI_WINDOW_SIZE]
- }]
- }];
- }, null);
-})();
-class TuiFormatDateService {
- constructor(locale) {
- this.locale = locale;
- }
- format(timestamp) {
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_8__.of)(new Date(timestamp).toLocaleTimeString(this.locale, {
- hour: 'numeric',
- minute: '2-digit'
- }));
- }
+function isPlatformWorkerUi(platformId) {
+ return platformId === PLATFORM_WORKER_UI_ID;
}
-TuiFormatDateService.ɵfac = function TuiFormatDateService_Factory(t) {
- return new (t || TuiFormatDateService)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_5__.LOCALE_ID));
-};
-TuiFormatDateService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
- token: TuiFormatDateService,
- factory: TuiFormatDateService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](TuiFormatDateService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_5__.LOCALE_ID]
- }]
- }];
- }, null);
-})();
/**
- * Service for displaying hints/tooltips
+ * @module
+ * @description
+ * Entry point for all public APIs of the common package.
*/
-class TuiHintService extends rxjs__WEBPACK_IMPORTED_MODULE_9__.BehaviorSubject {
- constructor() {
- super([]);
- }
- add(directive) {
- this.next(this.value.concat(directive));
- }
- remove(directive) {
- if (this.value.includes(directive)) {
- this.next(this.value.filter(hint => hint !== directive));
- }
- }
-}
-TuiHintService.ɵfac = function TuiHintService_Factory(t) {
- return new (t || TuiHintService)();
-};
-TuiHintService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
- token: TuiHintService,
- factory: TuiHintService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](TuiHintService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [];
- }, null);
-})();
-class TuiNightThemeService extends rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable {
- constructor(win) {
- const media = win.matchMedia('(prefers-color-scheme: dark)');
- const media$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_10__.fromEvent)(media, 'change').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_11__.startWith)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.map)(() => media.matches), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.share)());
- super(subscriber => media$.subscribe(subscriber));
- }
-}
-TuiNightThemeService.ɵfac = function TuiNightThemeService_Factory(t) {
- return new (t || TuiNightThemeService)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_13__.WINDOW));
-};
-TuiNightThemeService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
- token: TuiNightThemeService,
- factory: TuiNightThemeService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](TuiNightThemeService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: Window,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_13__.WINDOW]
- }]
- }];
- }, null);
-})();
-class TuiPositionService extends rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable {
- constructor(
- // Destructuring here causes memory leak
- el, animationFrame, zone, accessor) {
- super(subscriber => animationFrame.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.map)(() => el.nativeElement.getBoundingClientRect()), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.map)(rect => accessor.getPosition(rect)), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiZonefree)(zone), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_14__.finalize)(() => accessor.getPosition(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_15__.EMPTY_CLIENT_RECT))).subscribe(subscriber));
- }
-}
-TuiPositionService.ɵfac = function TuiPositionService_Factory(t) {
- return new (t || TuiPositionService)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_5__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_13__.ANIMATION_FRAME), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_16__.TuiPositionAccessor));
-};
-TuiPositionService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
- token: TuiPositionService,
- factory: TuiPositionService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](TuiPositionService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_5__.ElementRef]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_13__.ANIMATION_FRAME]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone]
- }]
- }, {
- type: _taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_16__.TuiPositionAccessor,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_core_abstract__WEBPACK_IMPORTED_MODULE_16__.TuiPositionAccessor]
- }]
- }];
- }, null);
-})();
-
-// TODO: Remove when Angular is update and `RouterLinkActive` has output
-class TuiRouterLinkActiveService extends rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable {
- constructor(routerLinkActive, zone, animationFrame$, destroy$) {
- const stream$ = routerLinkActive ? (0,rxjs__WEBPACK_IMPORTED_MODULE_17__.merge)((0,rxjs__WEBPACK_IMPORTED_MODULE_18__.timer)(0),
- // SSR (animationFrame$ never emits value during SSR)
- animationFrame$).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_1__.map)(() => routerLinkActive.isActive), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.distinctUntilChanged)(), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiZoneOptimized)(zone), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_19__.takeUntil)(destroy$)) : rxjs__WEBPACK_IMPORTED_MODULE_20__.EMPTY;
- super(subscriber => stream$.subscribe(subscriber));
- }
-}
-TuiRouterLinkActiveService.ɵfac = function TuiRouterLinkActiveService_Factory(t) {
- return new (t || TuiRouterLinkActiveService)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_angular_router__WEBPACK_IMPORTED_MODULE_21__.RouterLinkActive, 8), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_13__.ANIMATION_FRAME), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__.TuiDestroyService, 2));
-};
-TuiRouterLinkActiveService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
- token: TuiRouterLinkActiveService,
- factory: TuiRouterLinkActiveService.ɵfac
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](TuiRouterLinkActiveService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable
- }], function () {
- return [{
- type: _angular_router__WEBPACK_IMPORTED_MODULE_21__.RouterLinkActive,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_angular_router__WEBPACK_IMPORTED_MODULE_21__.RouterLinkActive]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_0__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_13__.ANIMATION_FRAME]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__.TuiDestroyService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_22__.TuiDestroyService]
- }]
- }];
- }, null);
-})();
+/**
+ * @publicApi
+ */
+const VERSION = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.Version('16.2.12');
/**
- * Service for reusing SVGs without inlining each instance
+ * Defines a scroll position manager. Implemented by `BrowserViewportScroller`.
+ *
+ * @publicApi
+ */
+class ViewportScroller {}
+/**
+ * Manages the scroll position for a browser window.
*/
-class TuiSvgService {
- constructor(tuiSanitizer, sanitizer, icons) {
- this.tuiSanitizer = tuiSanitizer;
- this.sanitizer = sanitizer;
- this.originals = {};
- this.items$ = new rxjs__WEBPACK_IMPORTED_MODULE_9__.BehaviorSubject(new Map());
- this.define(icons);
+_ViewportScroller = ViewportScroller;
+// De-sugared tree-shakable injection
+// See #23917
+/** @nocollapse */
+_ViewportScroller.ɵprov = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"])({
+ token: _ViewportScroller,
+ providedIn: 'root',
+ factory: () => new BrowserViewportScroller((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinject"])(DOCUMENT), window)
+});
+class BrowserViewportScroller {
+ constructor(document, window) {
+ this.document = document;
+ this.window = window;
+ this.offset = () => [0, 0];
}
- define(icons) {
- const {
- value
- } = this.items$;
- Object.keys(icons).forEach(key => {
- this.defineIcon(key, icons[key], value);
- });
- this.items$.next(value);
+ /**
+ * Configures the top offset used when scrolling to an anchor.
+ * @param offset A position in screen coordinates (a tuple with x and y values)
+ * or a function that returns the top offset position.
+ *
+ */
+ setOffset(offset) {
+ if (Array.isArray(offset)) {
+ this.offset = () => offset;
+ } else {
+ this.offset = offset;
+ }
}
- getOriginal(name) {
- return this.originals[name] || null;
+ /**
+ * Retrieves the current scroll position.
+ * @returns The position in screen coordinates.
+ */
+ getScrollPosition() {
+ if (this.supportsScrolling()) {
+ return [this.window.pageXOffset, this.window.pageYOffset];
+ } else {
+ return [0, 0];
+ }
}
- defineIcon(name, src, map) {
- if (map.has(name)) {
- return;
+ /**
+ * Sets the scroll position.
+ * @param position The new position in screen coordinates.
+ */
+ scrollToPosition(position) {
+ if (this.supportsScrolling()) {
+ this.window.scrollTo(position[0], position[1]);
}
- const parsed = this.parseSrc(name, src);
- if (!parsed) {
- ngDevMode && _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_23__.tuiAssert.assert(false, 'Unable to parse given SVG src');
+ }
+ /**
+ * Scrolls to an element and attempts to focus the element.
+ *
+ * Note that the function name here is misleading in that the target string may be an ID for a
+ * non-anchor element.
+ *
+ * @param target The ID of an element or name of the anchor.
+ *
+ * @see https://html.spec.whatwg.org/#the-indicated-part-of-the-document
+ * @see https://html.spec.whatwg.org/#scroll-to-fragid
+ */
+ scrollToAnchor(target) {
+ if (!this.supportsScrolling()) {
return;
}
- map.set(name, parsed);
- this.originals = Object.assign(Object.assign({}, this.originals), {
- [name]: src
- });
- }
- parseSrc(name, src) {
- return this.sanitize((0,_taiga_ui_core_utils_dom__WEBPACK_IMPORTED_MODULE_24__.tuiProcessIcon)(src, name));
+ const elSelected = findAnchorFromDocument(this.document, target);
+ if (elSelected) {
+ this.scrollToElement(elSelected);
+ // After scrolling to the element, the spec dictates that we follow the focus steps for the
+ // target. Rather than following the robust steps, simply attempt focus.
+ //
+ // @see https://html.spec.whatwg.org/#get-the-focusable-area
+ // @see https://developer.mozilla.org/en-US/docs/Web/API/HTMLOrForeignElement/focus
+ // @see https://html.spec.whatwg.org/#focusable-area
+ elSelected.focus();
+ }
}
- sanitize(src) {
- return this.sanitizer.bypassSecurityTrustHtml((this.tuiSanitizer ? this.tuiSanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_5__.SecurityContext.HTML, src) : this.sanitizer.sanitize(_angular_core__WEBPACK_IMPORTED_MODULE_5__.SecurityContext.HTML, src)) || '');
+ /**
+ * Disables automatic scroll restoration provided by the browser.
+ */
+ setHistoryScrollRestoration(scrollRestoration) {
+ if (this.supportsScrolling()) {
+ this.window.history.scrollRestoration = scrollRestoration;
+ }
}
-}
-TuiSvgService.ɵfac = function TuiSvgService_Factory(t) {
- return new (t || TuiSvgService)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_SANITIZER, 8), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_angular_platform_browser__WEBPACK_IMPORTED_MODULE_25__.DomSanitizer), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_ICONS));
-};
-TuiSvgService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
- token: TuiSvgService,
- factory: TuiSvgService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](TuiSvgService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Sanitizer,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_SANITIZER]
- }]
- }, {
- type: _angular_platform_browser__WEBPACK_IMPORTED_MODULE_25__.DomSanitizer,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_angular_platform_browser__WEBPACK_IMPORTED_MODULE_25__.DomSanitizer]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_core_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_ICONS]
- }]
- }];
- }, null);
-})();
-class TuiVisualViewportService {
- constructor(win, isWebkit) {
- this.win = win;
- this.isWebkit = isWebkit;
+ /**
+ * Scrolls to an element using the native offset and the specified offset set on this scroller.
+ *
+ * The offset can be used when we know that there is a floating header and scrolling naively to an
+ * element (ex: `scrollIntoView`) leaves the element hidden behind the floating header.
+ */
+ scrollToElement(el) {
+ const rect = el.getBoundingClientRect();
+ const left = rect.left + this.window.pageXOffset;
+ const top = rect.top + this.window.pageYOffset;
+ const offset = this.offset();
+ this.window.scrollTo(left - offset[0], top - offset[1]);
}
- // https://bugs.webkit.org/show_bug.cgi?id=207089
- correct([y, x]) {
- return [this.correctY(y), this.correctX(x)];
+ supportsScrolling() {
+ try {
+ return !!this.window && !!this.window.scrollTo && 'pageXOffset' in this.window;
+ } catch {
+ return false;
+ }
}
- correctX(x) {
- var _a, _b;
- return this.isWebkit ? x + ((_b = (_a = this.win.visualViewport) === null || _a === void 0 ? void 0 : _a.offsetLeft) !== null && _b !== void 0 ? _b : 0) : x;
+}
+function findAnchorFromDocument(document, target) {
+ const documentResult = document.getElementById(target) || document.getElementsByName(target)[0];
+ if (documentResult) {
+ return documentResult;
}
- correctY(y) {
- var _a, _b;
- return this.isWebkit ? y + ((_b = (_a = this.win.visualViewport) === null || _a === void 0 ? void 0 : _a.offsetTop) !== null && _b !== void 0 ? _b : 0) : y;
+ // `getElementById` and `getElementsByName` won't pierce through the shadow DOM so we
+ // have to traverse the DOM manually and do the lookup through the shadow roots.
+ if (typeof document.createTreeWalker === 'function' && document.body && typeof document.body.attachShadow === 'function') {
+ const treeWalker = document.createTreeWalker(document.body, NodeFilter.SHOW_ELEMENT);
+ let currentNode = treeWalker.currentNode;
+ while (currentNode) {
+ const shadowRoot = currentNode.shadowRoot;
+ if (shadowRoot) {
+ // Note that `ShadowRoot` doesn't support `getElementsByName`
+ // so we have to fall back to `querySelector`.
+ const result = shadowRoot.getElementById(target) || shadowRoot.querySelector(`[name="${target}"]`);
+ if (result) {
+ return result;
+ }
+ }
+ currentNode = treeWalker.nextNode();
+ }
}
+ return null;
}
-TuiVisualViewportService.ɵfac = function TuiVisualViewportService_Factory(t) {
- return new (t || TuiVisualViewportService)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_13__.WINDOW), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TUI_IS_WEBKIT));
-};
-TuiVisualViewportService.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
- token: TuiVisualViewportService,
- factory: TuiVisualViewportService.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](TuiVisualViewportService, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: Window,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_13__.WINDOW]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TUI_IS_WEBKIT]
- }]
- }];
- }, null);
-})();
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 3359:
-/*!**********************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-tokens.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ STATUS_ICON: () => (/* binding */ STATUS_ICON),
-/* harmony export */ TUI_ANIMATIONS_DEFAULT_DURATION: () => (/* binding */ TUI_ANIMATIONS_DEFAULT_DURATION),
-/* harmony export */ TUI_ANIMATIONS_DURATION: () => (/* binding */ TUI_ANIMATIONS_DURATION),
-/* harmony export */ TUI_ANIMATION_OPTIONS: () => (/* binding */ TUI_ANIMATION_OPTIONS),
-/* harmony export */ TUI_ASSERT_ENABLED: () => (/* binding */ TUI_ASSERT_ENABLED),
-/* harmony export */ TUI_CLOSE_WORD: () => (/* binding */ TUI_CLOSE_WORD),
-/* harmony export */ TUI_COMMON_ICONS: () => (/* binding */ TUI_COMMON_ICONS),
-/* harmony export */ TUI_DATA_LIST_ACCESSOR: () => (/* binding */ TUI_DATA_LIST_ACCESSOR),
-/* harmony export */ TUI_DATA_LIST_HOST: () => (/* binding */ TUI_DATA_LIST_HOST),
-/* harmony export */ TUI_DAY_TYPE_HANDLER: () => (/* binding */ TUI_DAY_TYPE_HANDLER),
-/* harmony export */ TUI_DEFAULT_ERROR_MESSAGE: () => (/* binding */ TUI_DEFAULT_ERROR_MESSAGE),
-/* harmony export */ TUI_DEFAULT_ICONS_PLACE: () => (/* binding */ TUI_DEFAULT_ICONS_PLACE),
-/* harmony export */ TUI_DOCUMENT_OR_SHADOW_ROOT: () => (/* binding */ TUI_DOCUMENT_OR_SHADOW_ROOT),
-/* harmony export */ TUI_ELEMENT_REF: () => (/* binding */ TUI_ELEMENT_REF),
-/* harmony export */ TUI_FIRST_DAY_OF_WEEK: () => (/* binding */ TUI_FIRST_DAY_OF_WEEK),
-/* harmony export */ TUI_ICONS: () => (/* binding */ TUI_ICONS),
-/* harmony export */ TUI_ICONS_PATH: () => (/* binding */ TUI_ICONS_PATH),
-/* harmony export */ TUI_ICONS_PLACE: () => (/* binding */ TUI_ICONS_PLACE),
-/* harmony export */ TUI_IS_MOBILE_RES: () => (/* binding */ TUI_IS_MOBILE_RES),
-/* harmony export */ TUI_LEGACY_MASK: () => (/* binding */ TUI_LEGACY_MASK),
-/* harmony export */ TUI_MEDIA: () => (/* binding */ TUI_MEDIA),
-/* harmony export */ TUI_MODE: () => (/* binding */ TUI_MODE),
-/* harmony export */ TUI_MONTHS: () => (/* binding */ TUI_MONTHS),
-/* harmony export */ TUI_NOTHING_FOUND_MESSAGE: () => (/* binding */ TUI_NOTHING_FOUND_MESSAGE),
-/* harmony export */ TUI_NOTIFICATION_DEFAULT_OPTIONS: () => (/* binding */ TUI_NOTIFICATION_DEFAULT_OPTIONS),
-/* harmony export */ TUI_NOTIFICATION_OPTIONS: () => (/* binding */ TUI_NOTIFICATION_OPTIONS),
-/* harmony export */ TUI_NUMBER_FORMAT: () => (/* binding */ TUI_NUMBER_FORMAT),
-/* harmony export */ TUI_NUMBER_FORMAT_OBSERVABLE: () => (/* binding */ TUI_NUMBER_FORMAT_OBSERVABLE),
-/* harmony export */ TUI_OPTION_CONTENT: () => (/* binding */ TUI_OPTION_CONTENT),
-/* harmony export */ TUI_ORDERED_SHORT_WEEK_DAYS: () => (/* binding */ TUI_ORDERED_SHORT_WEEK_DAYS),
-/* harmony export */ TUI_REDUCED_MOTION: () => (/* binding */ TUI_REDUCED_MOTION),
-/* harmony export */ TUI_SANITIZER: () => (/* binding */ TUI_SANITIZER),
-/* harmony export */ TUI_SCROLL_REF: () => (/* binding */ TUI_SCROLL_REF),
-/* harmony export */ TUI_SELECTION_STREAM: () => (/* binding */ TUI_SELECTION_STREAM),
-/* harmony export */ TUI_SHORT_WEEK_DAYS: () => (/* binding */ TUI_SHORT_WEEK_DAYS),
-/* harmony export */ TUI_SPIN_ICONS: () => (/* binding */ TUI_SPIN_ICONS),
-/* harmony export */ TUI_SPIN_TEXTS: () => (/* binding */ TUI_SPIN_TEXTS),
-/* harmony export */ TUI_SVG_CONTENT_PROCESSOR: () => (/* binding */ TUI_SVG_CONTENT_PROCESSOR),
-/* harmony export */ TUI_SVG_SRC_PROCESSOR: () => (/* binding */ TUI_SVG_SRC_PROCESSOR),
-/* harmony export */ TUI_TEXTFIELD_APPEARANCE: () => (/* binding */ TUI_TEXTFIELD_APPEARANCE),
-/* harmony export */ TUI_TEXTFIELD_HOST: () => (/* binding */ TUI_TEXTFIELD_HOST),
-/* harmony export */ TUI_THEME: () => (/* binding */ TUI_THEME),
-/* harmony export */ TUI_VALUE_ACCESSOR: () => (/* binding */ TUI_VALUE_ACCESSOR),
-/* harmony export */ TUI_VIEWPORT: () => (/* binding */ TUI_VIEWPORT),
-/* harmony export */ tuiAsDataListAccessor: () => (/* binding */ tuiAsDataListAccessor),
-/* harmony export */ tuiAsDataListHost: () => (/* binding */ tuiAsDataListHost),
-/* harmony export */ tuiAsOptionContent: () => (/* binding */ tuiAsOptionContent),
-/* harmony export */ tuiAsTextfieldHost: () => (/* binding */ tuiAsTextfieldHost),
-/* harmony export */ tuiAsViewport: () => (/* binding */ tuiAsViewport),
-/* harmony export */ tuiCommonIconsProvider: () => (/* binding */ tuiCommonIconsProvider),
-/* harmony export */ tuiNotificationOptionsProvider: () => (/* binding */ tuiNotificationOptionsProvider),
-/* harmony export */ tuiNumberFormatProvider: () => (/* binding */ tuiNumberFormatProvider)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 396);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @taiga-ui/cdk */ 3915);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/i18n */ 1204);
-/* harmony import */ var _taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/core/utils */ 2189);
-/* harmony import */ var _taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/core/utils */ 3043);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! rxjs/operators */ 5603);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs/operators */ 6816);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 9746);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/core/constants */ 6628);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! rxjs */ 2337);
-/* harmony import */ var _taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! @taiga-ui/core/enums */ 4715);
-
-
-
-
-
-
-
-
-
-
-const TUI_REDUCED_MOTION = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- var _a, _b, _c;
- return (_c = (_b = (_a = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT).defaultView) === null || _a === void 0 ? void 0 : _a.matchMedia) === null || _b === void 0 ? void 0 : _b.call(_a, '(prefers-reduced-motion: reduce)').matches) !== null && _c !== void 0 ? _c : false;
-});
-const TUI_ANIMATIONS_DEFAULT_DURATION = 300;
-/**
- * Duration of all Taiga UI animations in ms
- */
-const TUI_ANIMATIONS_DURATION = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(TUI_REDUCED_MOTION) ? 0 : TUI_ANIMATIONS_DEFAULT_DURATION);
-
/**
- * Options for Taiga UI animations
+ * Provides an empty implementation of the viewport scroller.
*/
-const TUI_ANIMATION_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => ({
- value: '',
- params: {
- duration: (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(TUI_ANIMATIONS_DURATION)
+class NullViewportScroller {
+ /**
+ * Empty implementation
+ */
+ setOffset(offset) {}
+ /**
+ * Empty implementation
+ */
+ getScrollPosition() {
+ return [0, 0];
}
-}));
+ /**
+ * Empty implementation
+ */
+ scrollToPosition(position) {}
+ /**
+ * Empty implementation
+ */
+ scrollToAnchor(anchor) {}
+ /**
+ * Empty implementation
+ */
+ setHistoryScrollRestoration(scrollRestoration) {}
+}
/**
- * @deprecated:
- * Flag to enable assertions across Taiga UI
+ * A wrapper around the `XMLHttpRequest` constructor.
*
- * The current token no longer matters as
- * it will not be provided in production
+ * @publicApi
*/
-const TUI_ASSERT_ENABLED = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.isDevMode)());
-const COMMON_ICONS = {
- check: 'tuiIconCheck',
- close: 'tuiIconClose',
- error: 'tuiIconAlertCircle',
- more: 'tuiIconChevronRight'
-};
-const TUI_COMMON_ICONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(COMMON_ICONS);
-function tuiCommonIconsProvider(icons) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiProvideOptions)(TUI_COMMON_ICONS, icons, COMMON_ICONS);
-}
+class XhrFactory {}
-/**
- * Accessor for data-list options
- */
-const TUI_DATA_LIST_ACCESSOR = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_DATA_LIST_ACCESSOR]');
-function tuiAsDataListAccessor(useExisting) {
- return {
- provide: TUI_DATA_LIST_ACCESSOR,
- useExisting
- };
+// Converts a string that represents a URL into a URL class instance.
+function getUrl(src, win) {
+ // Don't use a base URL is the URL is absolute.
+ return isAbsoluteUrl(src) ? new URL(src) : new URL(src, win.location.href);
}
-
-/**
- * DataList controller
- */
-const TUI_DATA_LIST_HOST = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_DATA_LIST_HOST]');
-function tuiAsDataListHost(useExisting) {
- return {
- provide: TUI_DATA_LIST_HOST,
- useExisting
- };
+// Checks whether a URL is absolute (i.e. starts with `http://` or `https://`).
+function isAbsoluteUrl(src) {
+ return /^https?:\/\//.test(src);
+}
+// Given a URL, extract the hostname part.
+// If a URL is a relative one - the URL is returned as is.
+function extractHostname(url) {
+ return isAbsoluteUrl(url) ? new URL(url).hostname : url;
+}
+function isValidPath(path) {
+ const isString = typeof path === 'string';
+ if (!isString || path.trim() === '') {
+ return false;
+ }
+ // Calling new URL() will throw if the path string is malformed
+ try {
+ const url = new URL(path);
+ return true;
+ } catch {
+ return false;
+ }
+}
+function normalizePath(path) {
+ return path.endsWith('/') ? path.slice(0, -1) : path;
+}
+function normalizeSrc(src) {
+ return src.startsWith('/') ? src.slice(1) : src;
}
/**
- * Token for adding data-type attribute to calendar cell
- */
-const TUI_DAY_TYPE_HANDLER = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(day => day.isWeekend ? 'weekend' : 'weekday');
-const TUI_DOCUMENT_OR_SHADOW_ROOT = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_DOCUMENT_OR_SHADOW_ROOT]');
-
-/**
- * ElementRef when you cannot use @Input for single time injection
- */
-const TUI_ELEMENT_REF = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_ELEMENT_REF]');
-
-/**
- * The first day of the week index
- */
-const TUI_FIRST_DAY_OF_WEEK = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiDayOfWeek.Monday);
-
-/**
- * Localized months names
- */
-const TUI_MONTHS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)((0,_taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_4__.tuiExtractI18n)('months'));
-/**
- * i18n 'close' word
- */
-const TUI_CLOSE_WORD = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)((0,_taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_4__.tuiExtractI18n)('close'));
-/**
- * i18n 'Nothing found' message
- */
-const TUI_NOTHING_FOUND_MESSAGE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)((0,_taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_4__.tuiExtractI18n)('nothingFoundMessage'));
-/**
- * i18n of error message
- */
-const TUI_DEFAULT_ERROR_MESSAGE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)((0,_taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_4__.tuiExtractI18n)('defaultErrorMessage'));
-/**
- * spin i18n texts
- */
-const TUI_SPIN_TEXTS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)((0,_taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_4__.tuiExtractI18n)('spinTexts'));
-/**
- * calendars i18n texts
- */
-const TUI_SHORT_WEEK_DAYS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)((0,_taiga_ui_i18n__WEBPACK_IMPORTED_MODULE_4__.tuiExtractI18n)('shortWeekDays'));
-const TUI_DEFAULT_ICONS_PLACE = 'assets/taiga-ui/icons';
-/**
- * Path to icons
- * @deprecated Use {@link TUI_SVG_OPTIONS} instead
- */
-const TUI_ICONS_PLACE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(TUI_DEFAULT_ICONS_PLACE);
-
-/**
- * A key/value dictionary of icon names and src to be defined with TuiSvgService
- */
-const TUI_ICONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)({});
-
-/**
- * A handler to retrieve USE id for icon by name
- * @deprecated Use {@link TUI_SVG_OPTIONS} instead
- */
-const TUI_ICONS_PATH = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_5__.tuiIconsPathFactory)((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(TUI_ICONS_PLACE)));
-
-/**
- * Token for media constant
+ * Noop image loader that does no transformation to the original src and just returns it as is.
+ * This loader is used as a default one if more specific logic is not provided in an app config.
+ *
+ * @see {@link ImageLoader}
+ * @see {@link NgOptimizedImage}
*/
-const TUI_MEDIA = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)({
- mobile: 768,
- desktopSmall: 1024,
- desktopLarge: 1280
-});
-
+const noopImageLoader = config => config.src;
/**
- * @deprecated use {@link https://taiga-ui.dev/services/breakpoint-service TuiBreakpointService}
- * TODO: drop in v4.0
- * Mobile resolution stream for private providers
+ * Injection token that configures the image loader function.
+ *
+ * @see {@link ImageLoader}
+ * @see {@link NgOptimizedImage}
+ * @publicApi
*/
-const TUI_IS_MOBILE_RES = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- const win = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_6__.WINDOW);
- const media = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(TUI_MEDIA);
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiTypedFromEvent)(win, 'resize').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.share)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_9__.startWith)(null), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.map)(() => (0,_taiga_ui_core_utils__WEBPACK_IMPORTED_MODULE_11__.tuiIsMobile)(win, media)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_12__.distinctUntilChanged)(), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiZoneOptimized)((0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_1__.NgZone)));
+const IMAGE_LOADER = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('ImageLoader', {
+ providedIn: 'root',
+ factory: () => noopImageLoader
});
-
-/**
- * @internal
- * @deprecated
- * Don't use it! Will be removed after changing the mask.
- */
-const TUI_LEGACY_MASK = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_LEGACY_MASK]');
-
-/**
- * Mode stream for private providers
- */
-const TUI_MODE = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_MODE]');
-
-/** @deprecated remove export */
-const STATUS_ICON = {
- info: 'tuiIconInfo',
- success: 'tuiIconCheckCircle',
- error: 'tuiIconXCircle',
- warning: 'tuiIconAlertCircle',
- neutral: 'tuiIconInfo'
-};
-/** Default values for the notification options. */
-const TUI_NOTIFICATION_DEFAULT_OPTIONS = {
- autoClose: 3000,
- label: '',
- status: 'info',
- hasCloseButton: true,
- icon: ({
- $implicit
- }) => STATUS_ICON[$implicit],
- size: 'm',
- hasIcon: true,
- defaultAutoCloseTime: 3000
-};
/**
- * Default parameters for notification alert component
+ * Internal helper function that makes it easier to introduce custom image loaders for the
+ * `NgOptimizedImage` directive. It is enough to specify a URL builder function to obtain full DI
+ * configuration for a given loader: a DI token corresponding to the actual loader function, plus DI
+ * tokens managing preconnect check functionality.
+ * @param buildUrlFn a function returning a full URL based on loader's configuration
+ * @param exampleUrls example of full URLs for a given loader (used in error messages)
+ * @returns a set of DI providers corresponding to the configured image loader
*/
-const TUI_NOTIFICATION_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(TUI_NOTIFICATION_DEFAULT_OPTIONS);
-function tuiNotificationOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiProvideOptions)(TUI_NOTIFICATION_OPTIONS, options, TUI_NOTIFICATION_DEFAULT_OPTIONS);
+function createImageLoader(buildUrlFn, exampleUrls) {
+ return function provideImageLoader(path) {
+ if (!isValidPath(path)) {
+ throwInvalidPathError(path, exampleUrls || []);
+ }
+ // The trailing / is stripped (if provided) to make URL construction (concatenation) easier in
+ // the individual loader functions.
+ path = normalizePath(path);
+ const loaderFn = config => {
+ if (isAbsoluteUrl(config.src)) {
+ // Image loader functions expect an image file name (e.g. `my-image.png`)
+ // or a relative path + a file name (e.g. `/a/b/c/my-image.png`) as an input,
+ // so the final absolute URL can be constructed.
+ // When an absolute URL is provided instead - the loader can not
+ // build a final URL, thus the error is thrown to indicate that.
+ throwUnexpectedAbsoluteUrlError(path, config.src);
+ }
+ return buildUrlFn(path, {
+ ...config,
+ src: normalizeSrc(config.src)
+ });
+ };
+ const providers = [{
+ provide: IMAGE_LOADER,
+ useValue: loaderFn
+ }];
+ return providers;
+ };
}
-
-/**
- * Formatting configuration for displayed numbers
- */
-const TUI_NUMBER_FORMAT = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_13__.TUI_DEFAULT_NUMBER_FORMAT);
-function tuiNumberFormatProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiProvideOptions)(TUI_NUMBER_FORMAT, options, _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_13__.TUI_DEFAULT_NUMBER_FORMAT);
+function throwInvalidPathError(path, exampleUrls) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2959 /* RuntimeErrorCode.INVALID_LOADER_ARGUMENTS */, ngDevMode && `Image loader has detected an invalid path (\`${path}\`). ` + `To fix this, supply a path using one of the following formats: ${exampleUrls.join(' or ')}`);
+}
+function throwUnexpectedAbsoluteUrlError(path, url) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2959 /* RuntimeErrorCode.INVALID_LOADER_ARGUMENTS */, ngDevMode && `Image loader has detected a \`\` tag with an invalid \`ngSrc\` attribute: ${url}. ` + `This image loader expects \`ngSrc\` to be a relative URL - ` + `however the provided value is an absolute URL. ` + `To fix this, provide \`ngSrc\` as a path relative to the base URL ` + `configured for this loader (\`${path}\`).`);
}
/**
- * Formatting configuration for displayed numbers
- */
-const TUI_NUMBER_FORMAT_OBSERVABLE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)((0,rxjs__WEBPACK_IMPORTED_MODULE_14__.of)(Object.assign(Object.assign({}, _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_13__.TUI_DEFAULT_NUMBER_FORMAT), {
- decimalLimit: NaN
-})));
-
-/**
- * Content for tuiOption component
+ * Function that generates an ImageLoader for [Cloudflare Image
+ * Resizing](https://developers.cloudflare.com/images/image-resizing/) and turns it into an Angular
+ * provider. Note: Cloudflare has multiple image products - this provider is specifically for
+ * Cloudflare Image Resizing; it will not work with Cloudflare Images or Cloudflare Polish.
+ *
+ * @param path Your domain name, e.g. https://mysite.com
+ * @returns Provider that provides an ImageLoader function
+ *
+ * @publicApi
*/
-const TUI_OPTION_CONTENT = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_OPTION_CONTENT]');
-function tuiAsOptionContent(useValue) {
- return {
- provide: TUI_OPTION_CONTENT,
- useValue
- };
+const provideCloudflareLoader = createImageLoader(createCloudflareUrl, ngDevMode ? ['https:///cdn-cgi/image//'] : undefined);
+function createCloudflareUrl(path, config) {
+ let params = `format=auto`;
+ if (config.width) {
+ params += `,width=${config.width}`;
+ }
+ // Cloudflare image URLs format:
+ // https://developers.cloudflare.com/images/image-resizing/url-format/
+ return `${path}/cdn-cgi/image/${params}/${config.src}`;
}
/**
- * TODO: v4.0 delete the whole file
+ * Name and URL tester for Cloudinary.
*/
-const convertToSundayFirstWeekFormat = weekDaysNames => {
- const sundayIndex = weekDaysNames.length - 1;
- return [weekDaysNames[sundayIndex], ...weekDaysNames.slice(0, sundayIndex)];
+const cloudinaryLoaderInfo = {
+ name: 'Cloudinary',
+ testUrl: isCloudinaryUrl
};
+const CLOUDINARY_LOADER_REGEX = /https?\:\/\/[^\/]+\.cloudinary\.com\/.+/;
/**
- * Ordered calendars i18n texts
- * @deprecated
- */
-const TUI_ORDERED_SHORT_WEEK_DAYS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- const firstDayOfWeekIndex = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(TUI_FIRST_DAY_OF_WEEK);
- return (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(TUI_SHORT_WEEK_DAYS).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.map)(convertToSundayFirstWeekFormat), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_10__.map)(weekDays => [...weekDays.slice(firstDayOfWeekIndex), ...weekDays.slice(0, firstDayOfWeekIndex)]));
-});
-
-/**
- * A custom Sanitizer to sanitize source before inlining
+ * Tests whether a URL is from Cloudinary CDN.
*/
-const TUI_SANITIZER = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_SANITIZER]');
-
+function isCloudinaryUrl(url) {
+ return CLOUDINARY_LOADER_REGEX.test(url);
+}
/**
- * @deprecated import from `@taiga-ui/cdk` instead
+ * Function that generates an ImageLoader for Cloudinary and turns it into an Angular provider.
+ *
+ * @param path Base URL of your Cloudinary images
+ * This URL should match one of the following formats:
+ * https://res.cloudinary.com/mysite
+ * https://mysite.cloudinary.com
+ * https://subdomain.mysite.com
+ * @returns Set of providers to configure the Cloudinary loader.
+ *
+ * @publicApi
*/
-const TUI_SCROLL_REF = _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_15__.TUI_SCROLL_REF;
+const provideCloudinaryLoader = createImageLoader(createCloudinaryUrl, ngDevMode ? ['https://res.cloudinary.com/mysite', 'https://mysite.cloudinary.com', 'https://subdomain.mysite.com'] : undefined);
+function createCloudinaryUrl(path, config) {
+ // Cloudinary image URLformat:
+ // https://cloudinary.com/documentation/image_transformations#transformation_url_structure
+ // Example of a Cloudinary image URL:
+ // https://res.cloudinary.com/mysite/image/upload/c_scale,f_auto,q_auto,w_600/marketing/tile-topics-m.png
+ let params = `f_auto,q_auto`; // sets image format and quality to "auto"
+ if (config.width) {
+ params += `,w_${config.width}`;
+ }
+ return `${path}/image/upload/${params}/${config.src}`;
+}
/**
- * A stream of possible selection changes
+ * Name and URL tester for ImageKit.
*/
-const TUI_SELECTION_STREAM = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- const doc = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_angular_common__WEBPACK_IMPORTED_MODULE_2__.DOCUMENT);
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_16__.merge)((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiTypedFromEvent)(doc, 'selectionchange'), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiTypedFromEvent)(doc, 'mouseup'), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiTypedFromEvent)(doc, 'mousedown').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.switchMap)(() => (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiTypedFromEvent)(doc, 'mousemove').pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.takeUntil)((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiTypedFromEvent)(doc, 'mouseup'))))), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiTypedFromEvent)(doc, 'keydown'), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiTypedFromEvent)(doc, 'keyup')).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_8__.share)());
-});
-const TUI_SPIN_ICONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)({
- decrement: 'tuiIconChevronLeft',
- increment: 'tuiIconChevronRight'
-});
-
+const imageKitLoaderInfo = {
+ name: 'ImageKit',
+ testUrl: isImageKitUrl
+};
+const IMAGE_KIT_LOADER_REGEX = /https?\:\/\/[^\/]+\.imagekit\.io\/.+/;
/**
- * Transform function the contents of the loaded svg file
- * @deprecated Use {@link TUI_SVG_OPTIONS} instead
+ * Tests whether a URL is from ImageKit CDN.
*/
-const TUI_SVG_CONTENT_PROCESSOR = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.tuiSvgLinearGradientProcessor);
-
+function isImageKitUrl(url) {
+ return IMAGE_KIT_LOADER_REGEX.test(url);
+}
/**
- * Source path processor for svg
- * @deprecated Use {@link TUI_SVG_OPTIONS} instead
+ * Function that generates an ImageLoader for ImageKit and turns it into an Angular provider.
+ *
+ * @param path Base URL of your ImageKit images
+ * This URL should match one of the following formats:
+ * https://ik.imagekit.io/myaccount
+ * https://subdomain.mysite.com
+ * @returns Set of providers to configure the ImageKit loader.
+ *
+ * @publicApi
*/
-const TUI_SVG_SRC_PROCESSOR = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(rxjs__WEBPACK_IMPORTED_MODULE_20__.identity);
+const provideImageKitLoader = createImageLoader(createImagekitUrl, ngDevMode ? ['https://ik.imagekit.io/mysite', 'https://subdomain.mysite.com'] : undefined);
+function createImagekitUrl(path, config) {
+ // Example of an ImageKit image URL:
+ // https://ik.imagekit.io/demo/tr:w-300,h-300/medium_cafe_B1iTdD0C.jpg
+ const {
+ src,
+ width
+ } = config;
+ let urlSegments;
+ if (width) {
+ const params = `tr:w-${width}`;
+ urlSegments = [path, params, src];
+ } else {
+ urlSegments = [path, src];
+ }
+ return urlSegments.join('/');
+}
/**
- * Appearance for inputs
- * @deprecated use {@link TUI_TEXTFIELD_APPEARANCE_DIRECTIVE} instead
- * TODO: Remove in 4.0
+ * Name and URL tester for Imgix.
*/
-const TUI_TEXTFIELD_APPEARANCE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)(_taiga_ui_core_enums__WEBPACK_IMPORTED_MODULE_21__.TuiAppearance.Textfield);
-
+const imgixLoaderInfo = {
+ name: 'Imgix',
+ testUrl: isImgixUrl
+};
+const IMGIX_LOADER_REGEX = /https?\:\/\/[^\/]+\.imgix\.net\/.+/;
/**
- * An interface to communicate with textfield based controls
+ * Tests whether a URL is from Imgix CDN.
*/
-const TUI_TEXTFIELD_HOST = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_TEXTFIELD_HOST]');
-function tuiAsTextfieldHost(useExisting) {
- return {
- provide: TUI_TEXTFIELD_HOST,
- useExisting
- };
+function isImgixUrl(url) {
+ return IMGIX_LOADER_REGEX.test(url);
}
-const TUI_THEME = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateToken)('Taiga');
-
/**
- * Buffer token to pass NG_VALUE_ACCESSOR to a different Injector
+ * Function that generates an ImageLoader for Imgix and turns it into an Angular provider.
+ *
+ * @param path path to the desired Imgix origin,
+ * e.g. https://somepath.imgix.net or https://images.mysite.com
+ * @returns Set of providers to configure the Imgix loader.
+ *
+ * @publicApi
*/
-const TUI_VALUE_ACCESSOR = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('[TUI_VALUE_ACCESSOR]');
+const provideImgixLoader = createImageLoader(createImgixUrl, ngDevMode ? ['https://somepath.imgix.net/'] : undefined);
+function createImgixUrl(path, config) {
+ const url = new URL(`${path}/${config.src}`);
+ // This setting ensures the smallest allowable format is set.
+ url.searchParams.set('auto', 'format');
+ if (config.width) {
+ url.searchParams.set('w', config.width.toString());
+ }
+ return url.href;
+}
-/**
- * Viewport accessor
- */
-const TUI_VIEWPORT = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiCreateTokenFromFactory)(() => {
- const win = (0,_angular_core__WEBPACK_IMPORTED_MODULE_1__.inject)(_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_6__.WINDOW);
- return {
- type: 'viewport',
- getClientRect() {
- return {
- top: 0,
- left: 0,
- right: win.innerWidth,
- bottom: win.innerHeight,
- width: win.innerWidth,
- height: win.innerHeight
- };
- }
- };
-});
-function tuiAsViewport(useExisting) {
- return {
- provide: TUI_VIEWPORT,
- useExisting
- };
+// Assembles directive details string, useful for error messages.
+function imgDirectiveDetails(ngSrc, includeNgSrc = true) {
+ const ngSrcInfo = includeNgSrc ? `(activated on an element with the \`ngSrc="${ngSrc}"\`) ` : '';
+ return `The NgOptimizedImage directive ${ngSrcInfo}has detected that`;
}
/**
- * Generated bundle index. Do not edit.
+ * Asserts that the application is in development mode. Throws an error if the application is in
+ * production mode. This assert can be used to make sure that there is no dev-mode code invoked in
+ * the prod mode accidentally.
*/
-
-
-
-/***/ }),
-
-/***/ 6721:
-/*!*************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-utils-dom.js ***!
- \*************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiCheckFixedPosition: () => (/* binding */ tuiCheckFixedPosition),
-/* harmony export */ tuiGetSafeAreaSize: () => (/* binding */ tuiGetSafeAreaSize),
-/* harmony export */ tuiGetScreenWidth: () => (/* binding */ tuiGetScreenWidth),
-/* harmony export */ tuiGetViewportHeight: () => (/* binding */ tuiGetViewportHeight),
-/* harmony export */ tuiGetViewportWidth: () => (/* binding */ tuiGetViewportWidth),
-/* harmony export */ tuiGetWordRange: () => (/* binding */ tuiGetWordRange),
-/* harmony export */ tuiProcessIcon: () => (/* binding */ tuiProcessIcon)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-
-function tuiCheckFixedPosition(element) {
- if (!element || typeof getComputedStyle === 'undefined') {
- return false;
+function assertDevMode(checkName) {
+ if (!ngDevMode) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2958 /* RuntimeErrorCode.UNEXPECTED_DEV_MODE_CHECK_IN_PROD_MODE */, `Unexpected invocation of the ${checkName} in the prod mode. ` + `Please make sure that the prod mode is enabled for production builds.`);
}
- const style = getComputedStyle(element);
- return style.getPropertyValue('position') === 'fixed' || tuiCheckFixedPosition(element.parentElement);
}
/**
- * Calculates size of safe area on mobile devices (status bars)
+ * Observer that detects whether an image with `NgOptimizedImage`
+ * is treated as a Largest Contentful Paint (LCP) element. If so,
+ * asserts that the image has the `priority` attribute.
*
- * ATTENTION: Only use in browser environment
+ * Note: this is a dev-mode only class and it does not appear in prod bundles,
+ * thus there is no `ngDevMode` use in the code.
+ *
+ * Based on https://web.dev/lcp/#measure-lcp-in-javascript.
*/
-function tuiGetSafeAreaSize() {
- if (!CSS.supports('padding-top: env(safe-area-inset-top)')) {
- return 0;
+class LCPImageObserver {
+ constructor() {
+ // Map of full image URLs -> original `ngSrc` values.
+ this.images = new Map();
+ this.window = null;
+ this.observer = null;
+ assertDevMode('LCP checker');
+ const win = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT).defaultView;
+ if (typeof win !== 'undefined' && typeof PerformanceObserver !== 'undefined') {
+ this.window = win;
+ this.observer = this.initPerformanceObserver();
+ }
}
- const div = document.createElement('div');
- div.style.paddingTop = 'env(safe-area-inset-top)';
- document.body.appendChild(div);
- const safeAreaSize = parseInt(window.getComputedStyle(div).paddingTop, 10) || 0;
- document.body.removeChild(div);
- return safeAreaSize;
+ /**
+ * Inits PerformanceObserver and subscribes to LCP events.
+ * Based on https://web.dev/lcp/#measure-lcp-in-javascript
+ */
+ initPerformanceObserver() {
+ const observer = new PerformanceObserver(entryList => {
+ const entries = entryList.getEntries();
+ if (entries.length === 0) return;
+ // We use the latest entry produced by the `PerformanceObserver` as the best
+ // signal on which element is actually an LCP one. As an example, the first image to load on
+ // a page, by virtue of being the only thing on the page so far, is often a LCP candidate
+ // and gets reported by PerformanceObserver, but isn't necessarily the LCP element.
+ const lcpElement = entries[entries.length - 1];
+ // Cast to `any` due to missing `element` on the `LargestContentfulPaint` type of entry.
+ // See https://developer.mozilla.org/en-US/docs/Web/API/LargestContentfulPaint
+ const imgSrc = lcpElement.element?.src ?? '';
+ // Exclude `data:` and `blob:` URLs, since they are not supported by the directive.
+ if (imgSrc.startsWith('data:') || imgSrc.startsWith('blob:')) return;
+ const img = this.images.get(imgSrc);
+ if (!img) return;
+ if (!img.priority && !img.alreadyWarnedPriority) {
+ img.alreadyWarnedPriority = true;
+ logMissingPriorityWarning(imgSrc);
+ }
+ if (img.modified && !img.alreadyWarnedModified) {
+ img.alreadyWarnedModified = true;
+ logModifiedWarning(imgSrc);
+ }
+ });
+ observer.observe({
+ type: 'largest-contentful-paint',
+ buffered: true
+ });
+ return observer;
+ }
+ registerImage(rewrittenSrc, originalNgSrc, isPriority) {
+ if (!this.observer) return;
+ const newObservedImageState = {
+ priority: isPriority,
+ modified: false,
+ alreadyWarnedModified: false,
+ alreadyWarnedPriority: false
+ };
+ this.images.set(getUrl(rewrittenSrc, this.window).href, newObservedImageState);
+ }
+ unregisterImage(rewrittenSrc) {
+ if (!this.observer) return;
+ this.images.delete(getUrl(rewrittenSrc, this.window).href);
+ }
+ updateImage(originalSrc, newSrc) {
+ const originalUrl = getUrl(originalSrc, this.window).href;
+ const img = this.images.get(originalUrl);
+ if (img) {
+ img.modified = true;
+ this.images.set(getUrl(newSrc, this.window).href, img);
+ this.images.delete(originalUrl);
+ }
+ }
+ ngOnDestroy() {
+ if (!this.observer) return;
+ this.observer.disconnect();
+ this.images.clear();
+ }
+}
+_LCPImageObserver = LCPImageObserver;
+_LCPImageObserver.ɵfac = function _LCPImageObserver_Factory(t) {
+ return new (t || _LCPImageObserver)();
+};
+_LCPImageObserver.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _LCPImageObserver,
+ factory: _LCPImageObserver.ɵfac,
+ providedIn: 'root'
+});
+(function () {
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](LCPImageObserver, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
+ args: [{
+ providedIn: 'root'
+ }]
+ }], function () {
+ return [];
+ }, null);
+})();
+function logMissingPriorityWarning(ngSrc) {
+ const directiveDetails = imgDirectiveDetails(ngSrc);
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2955 /* RuntimeErrorCode.LCP_IMG_MISSING_PRIORITY */, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element but was not marked "priority". This image should be marked ` + `"priority" in order to prioritize its loading. ` + `To fix this, add the "priority" attribute.`));
}
-function tuiGetScreenWidth(doc) {
- return Math.max(doc.documentElement.clientWidth, doc.defaultView ? doc.defaultView.innerWidth : 0);
+function logModifiedWarning(ngSrc) {
+ const directiveDetails = imgDirectiveDetails(ngSrc);
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2964 /* RuntimeErrorCode.LCP_IMG_NGSRC_MODIFIED */, `${directiveDetails} this image is the Largest Contentful Paint (LCP) ` + `element and has had its "ngSrc" attribute modified. This can cause ` + `slower loading performance. It is recommended not to modify the "ngSrc" ` + `property on any image which could be the LCP element.`));
}
+// Set of origins that are always excluded from the preconnect checks.
+const INTERNAL_PRECONNECT_CHECK_BLOCKLIST = new Set(['localhost', '127.0.0.1', '0.0.0.0']);
/**
- * @description:
- * Cross-browser @media (height)
+ * Injection token to configure which origins should be excluded
+ * from the preconnect checks. It can either be a single string or an array of strings
+ * to represent a group of origins, for example:
*
- * 1. window.innerWidth
- * 1.1. gets CSS viewport @media (height) which include scrollbars
- * 1.2. initial-scale and zoom variations may cause mobile values to
- * wrongly scale down to what PPK calls the visual
- * viewport and be smaller than the @media values
- * 1.3. zoom may cause values to be 1px off due to native rounding
+ * ```typescript
+ * {provide: PRECONNECT_CHECK_BLOCKLIST, useValue: 'https://your-domain.com'}
+ * ```
*
- * 2. document.documentElement.clientHeight
- * 2.1. equals CSS viewport width minus scrollbar width
- * 2.2. matches @media (height) when there is no scrollbar
- * 2.3. available cross-browser
- * 2.4. inaccurate if doctype is missing
- */
-function tuiGetViewportHeight({
- document,
- innerHeight
-}) {
- return Math.max(document.documentElement.clientHeight || 0, innerHeight || 0);
-}
-
-/**
- * @description:
- * Cross-browser @media (width)
+ * or:
*
- * 1. window.innerWidth
- * 1.1. gets CSS viewport @media (width) which include scrollbars
- * 1.2. initial-scale and zoom variations may cause mobile values to
- * wrongly scale down to what PPK calls the visual
- * viewport and be smaller than the @media values
- * 1.3. zoom may cause values to be 1px off due to native rounding
+ * ```typescript
+ * {provide: PRECONNECT_CHECK_BLOCKLIST,
+ * useValue: ['https://your-domain-1.com', 'https://your-domain-2.com']}
+ * ```
*
- * 2. document.documentElement.clientWidth
- * 2.1. equals CSS viewport width minus scrollbar width
- * 2.2. matches @media (width) when there is no scrollbar
- * 2.3. available cross-browser
- * 2.4. inaccurate if doctype is missing
+ * @publicApi
*/
-function tuiGetViewportWidth({
- document,
- innerWidth
-}) {
- return Math.max(document.documentElement.clientWidth || 0, innerWidth || 0);
-}
-
+const PRECONNECT_CHECK_BLOCKLIST = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('PRECONNECT_CHECK_BLOCKLIST');
/**
- * Creates a cloned range with its boundaries set at word boundaries
+ * Contains the logic to detect whether an image, marked with the "priority" attribute
+ * has a corresponding `` tag in the `document.head`.
*
- * @param currentRange a range to clone
- * @return modified range
+ * Note: this is a dev-mode only class, which should not appear in prod bundles,
+ * thus there is no `ngDevMode` use in the code.
*/
-function tuiGetWordRange(currentRange) {
- const range = currentRange.cloneRange();
- const {
- startContainer,
- startOffset,
- endContainer,
- endOffset
- } = range;
- const {
- ownerDocument
- } = startContainer;
- if (!ownerDocument) {
- return range;
+class PreconnectLinkChecker {
+ constructor() {
+ this.document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT);
+ /**
+ * Set of tags found on this page.
+ * The `null` value indicates that there was no DOM query operation performed.
+ */
+ this.preconnectLinks = null;
+ /*
+ * Keep track of all already seen origin URLs to avoid repeating the same check.
+ */
+ this.alreadySeen = new Set();
+ this.window = null;
+ this.blocklist = new Set(INTERNAL_PRECONNECT_CHECK_BLOCKLIST);
+ assertDevMode('preconnect link checker');
+ const win = this.document.defaultView;
+ if (typeof win !== 'undefined') {
+ this.window = win;
+ }
+ const blocklist = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PRECONNECT_CHECK_BLOCKLIST, {
+ optional: true
+ });
+ if (blocklist) {
+ this.populateBlocklist(blocklist);
+ }
}
- const treeWalker = ownerDocument.createTreeWalker(ownerDocument.body, NodeFilter.SHOW_TEXT, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.svgNodeFilter);
- treeWalker.currentNode = startContainer;
- do {
- const container = treeWalker.currentNode;
- const textContent = container.textContent || '';
- const content = container === startContainer ? textContent.slice(0, Math.max(0, startOffset + 1)) : textContent;
- const offset = Math.max(content.lastIndexOf(' '), content.lastIndexOf(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.CHAR_NO_BREAK_SPACE), content.lastIndexOf(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.CHAR_ZERO_WIDTH_SPACE)) + 1;
- range.setStart(container, 0);
- if (offset) {
- range.setStart(container, offset);
- break;
+ populateBlocklist(origins) {
+ if (Array.isArray(origins)) {
+ deepForEach(origins, origin => {
+ this.blocklist.add(extractHostname(origin));
+ });
+ } else {
+ this.blocklist.add(extractHostname(origins));
}
- } while (treeWalker.previousNode());
- treeWalker.currentNode = endContainer;
- do {
- const container = treeWalker.currentNode;
- const textContent = container.textContent || '';
- const content = container === endContainer ? textContent.slice(endOffset + 1) : textContent;
- const offset = [content.indexOf(' '), content.indexOf(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.CHAR_NO_BREAK_SPACE), content.indexOf(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.CHAR_ZERO_WIDTH_SPACE)].reduce((result, item) => result === -1 || item === -1 ? Math.max(result, item) : Math.min(result, item), -1);
- range.setEnd(container, textContent.length);
- if (offset !== -1) {
- range.setEnd(container, offset + textContent.length - content.length);
- break;
+ }
+ /**
+ * Checks that a preconnect resource hint exists in the head for the
+ * given src.
+ *
+ * @param rewrittenSrc src formatted with loader
+ * @param originalNgSrc ngSrc value
+ */
+ assertPreconnect(rewrittenSrc, originalNgSrc) {
+ if (!this.window) return;
+ const imgUrl = getUrl(rewrittenSrc, this.window);
+ if (this.blocklist.has(imgUrl.hostname) || this.alreadySeen.has(imgUrl.origin)) return;
+ // Register this origin as seen, so we don't check it again later.
+ this.alreadySeen.add(imgUrl.origin);
+ if (!this.preconnectLinks) {
+ // Note: we query for preconnect links only *once* and cache the results
+ // for the entire lifespan of an application, since it's unlikely that the
+ // list would change frequently. This allows to make sure there are no
+ // performance implications of making extra DOM lookups for each image.
+ this.preconnectLinks = this.queryPreconnectLinks();
+ }
+ if (!this.preconnectLinks.has(imgUrl.origin)) {
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2956 /* RuntimeErrorCode.PRIORITY_IMG_MISSING_PRECONNECT_TAG */, `${imgDirectiveDetails(originalNgSrc)} there is no preconnect tag present for this ` + `image. Preconnecting to the origin(s) that serve priority images ensures that these ` + `images are delivered as soon as possible. To fix this, please add the following ` + `element into the of the document:\n` + ` `));
}
- } while (treeWalker.nextNode());
- return range;
-}
-const WIDTH_SEARCH = 'width="';
-const HEIGHT_SEARCH = 'height="';
-const START = '')));
- if (!(attributes === null || attributes === void 0 ? void 0 : attributes.includes(WIDTH_SEARCH)) || !attributes.includes(HEIGHT_SEARCH)) {
- return `${src.replace(START, ``;
+ queryPreconnectLinks() {
+ const preconnectUrls = new Set();
+ const selector = 'link[rel=preconnect]';
+ const links = Array.from(this.document.querySelectorAll(selector));
+ for (let link of links) {
+ const url = getUrl(link.href, this.window);
+ preconnectUrls.add(url.origin);
+ }
+ return preconnectUrls;
}
- const indexOfWidth = attributes.indexOf(WIDTH_SEARCH);
- const indexOfHeight = attributes.indexOf(HEIGHT_SEARCH);
- const widthOffset = indexOfWidth + WIDTH_SEARCH.length;
- const heightOffset = indexOfHeight + HEIGHT_SEARCH.length;
- const widthString = attributes.slice(widthOffset, attributes.indexOf('"', widthOffset));
- const heightString = attributes.slice(heightOffset, attributes.indexOf('"', heightOffset));
- if (!heightString || !widthString || widthString.includes('%') || heightString.includes('%') || widthString.includes('em') || heightString.includes('em')) {
- return src.replace(START, `${src}`;
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 5650:
-/*!****************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-utils-format.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiCapitalize: () => (/* binding */ tuiCapitalize),
-/* harmony export */ tuiCapitalizeFirstLetter: () => (/* binding */ tuiCapitalizeFirstLetter),
-/* harmony export */ tuiFormatNumber: () => (/* binding */ tuiFormatNumber),
-/* harmony export */ tuiFormatPhone: () => (/* binding */ tuiFormatPhone),
-/* harmony export */ tuiGetFractionPartPadded: () => (/* binding */ tuiGetFractionPartPadded),
-/* harmony export */ tuiNumberToStringWithoutExp: () => (/* binding */ tuiNumberToStringWithoutExp),
-/* harmony export */ tuiOtherDecimalSymbol: () => (/* binding */ tuiOtherDecimalSymbol)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 9291);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/core/constants */ 6628);
-
-
-
-/**
- * Capitalizes a given string, replacing it with a lowercase string and making
- * the first letter of each word uppercase.
- *
- * @param value the input string
- * @return the capitalized string
- */
-function tuiCapitalize(value) {
- return value.toLowerCase().replace(/(?:^|\s)\S/g, char => char.toUpperCase());
}
-function tuiCapitalizeFirstLetter(value) {
- return `${value.charAt(0).toUpperCase()}${value.slice(1)}`;
-}
-
+_PreconnectLinkChecker = PreconnectLinkChecker;
+_PreconnectLinkChecker.ɵfac = function _PreconnectLinkChecker_Factory(t) {
+ return new (t || _PreconnectLinkChecker)();
+};
+_PreconnectLinkChecker.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _PreconnectLinkChecker,
+ factory: _PreconnectLinkChecker.ɵfac,
+ providedIn: 'root'
+});
+(function () {
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PreconnectLinkChecker, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
+ args: [{
+ providedIn: 'root'
+ }]
+ }], function () {
+ return [];
+ }, null);
+})();
/**
- * Convert number to string with replacing exponent part on decimals
- *
- * @param value the number
- * @return string representation of a number
+ * Invokes a callback for each element in the array. Also invokes a callback
+ * recursively for each nested array.
*/
-function tuiNumberToStringWithoutExp(value) {
- const valueAsString = String(value);
- const [numberPart, expPart] = valueAsString.split('e-');
- let valueWithoutExp = valueAsString;
- if (expPart) {
- const [, fractionalPart] = numberPart.split('.');
- const decimalDigits = Number(expPart) + ((fractionalPart === null || fractionalPart === void 0 ? void 0 : fractionalPart.length) || 0);
- valueWithoutExp = value.toFixed(decimalDigits);
+function deepForEach(input, fn) {
+ for (let value of input) {
+ Array.isArray(value) ? deepForEach(value, fn) : fn(value);
}
- return valueWithoutExp;
}
/**
- * Return fractional part of number
- *
- * @param value the number
- * @param precision number of digits of decimal part, null to keep untouched
- * @return the fractional part of number
+ * In SSR scenarios, a preload `` element is generated for priority images.
+ * Having a large number of preload tags may negatively affect the performance,
+ * so we warn developers (by throwing an error) if the number of preloaded images
+ * is above a certain threshold. This const specifies this threshold.
*/
-function tuiGetFractionPartPadded(value, precision) {
- const [, fractionPartPadded = ''] = tuiNumberToStringWithoutExp(value).split('.');
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiIsNumber)(precision) ? fractionPartPadded.slice(0, Math.max(0, precision)) : fractionPartPadded;
-}
-
+const DEFAULT_PRELOADED_IMAGES_LIMIT = 5;
/**
- * Formats number adding a thousand separators and correct decimal separator
- * padding decimal part with zeroes to given length
+ * Helps to keep track of priority images that already have a corresponding
+ * preload tag (to avoid generating multiple preload tags with the same URL).
*
- * @param value the input number
- * @param settings See {@link TuiNumberFormatSettings}
- * @return the formatted string
+ * This Set tracks the original src passed into the `ngSrc` input not the src after it has been
+ * run through the specified `IMAGE_LOADER`.
*/
-function tuiFormatNumber(value, settings = {}) {
- const {
- decimalLimit,
- decimalSeparator,
- thousandSeparator,
- zeroPadding,
- rounding
- } = Object.assign(Object.assign({}, _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_1__.TUI_DEFAULT_NUMBER_FORMAT), settings);
- const rounded = Number.isFinite(decimalLimit) ? (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiRoundWith)({
- value,
- precision: decimalLimit,
- method: rounding
- }) : value;
- const integerPartString = String(Math.floor(Math.abs(rounded)));
- let fractionPartPadded = tuiGetFractionPartPadded(rounded, decimalLimit);
- if (Number.isFinite(decimalLimit)) {
- if (zeroPadding) {
- const zeroPaddingSize = Math.max(decimalLimit - fractionPartPadded.length, 0);
- const zeroPartString = '0'.repeat(zeroPaddingSize);
- fractionPartPadded = `${fractionPartPadded}${zeroPartString}`;
- } else {
- fractionPartPadded = fractionPartPadded.replace(/0*$/, '');
- }
- }
- const remainder = integerPartString.length % 3;
- const sign = value < 0 ? _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.CHAR_HYPHEN : '';
- let result = sign + integerPartString.charAt(0);
- for (let i = 1; i < integerPartString.length; i++) {
- if (i % 3 === remainder && integerPartString.length > 3) {
- result += thousandSeparator;
- }
- result += integerPartString.charAt(i);
- }
- return fractionPartPadded ? result + decimalSeparator + fractionPartPadded : result;
-}
+const PRELOADED_IMAGES = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('NG_OPTIMIZED_PRELOADED_IMAGES', {
+ providedIn: 'root',
+ factory: () => new Set()
+});
/**
- * TODO: delete in v4.0
- * @deprecated Use {@link https://maskito.dev/core-concepts/transformer maskitoTransform} instead
- * @example
- * import {maskitoTransform} from '@maskito/core';
- *
- * const mask = {
- * mask: ['+', '1', ' ', /\d/, /\d/, /\d/, ')', ' ', /\d/, /\d/, /\d/, '-', /\d/, /\d/, /\d/, /\d/],
- * };
- * maskitoTransform('12125552368', mask); // +1 (212) 555-2368
- * ___
- * Formats a string with the phone format +7XXXXXXXXXXXX or XXXXXXXXXXXX,
- * adding parentheses and hyphens.
+ * @description Contains the logic needed to track and add preload link tags to the `` tag. It
+ * will also track what images have already had preload link tags added so as to not duplicate link
+ * tags.
*
- * @param value the input string
- * @param countryCode a country code
- * @param phoneMask a phone number mask
- * @return the formatted phone string of the form +7 XXX XXX-XX-XX
+ * In dev mode this service will validate that the number of preloaded images does not exceed the
+ * configured default preloaded images limit: {@link DEFAULT_PRELOADED_IMAGES_LIMIT}.
*/
-function tuiFormatPhone(value, countryCode, phoneMask) {
- if (!value) {
- return '';
- }
- let result = countryCode;
- countryCode = countryCode.replace(/[()]/g, '');
- if (!value.startsWith(countryCode)) {
- value = countryCode + value.replace(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.CHAR_PLUS, '');
- }
- const splitPhoneMask = phoneMask.split('');
- const splitValue = value.slice(countryCode.length).split('');
- result += ' ';
- if (splitValue.length === 0) {
- return result;
+class PreloadLinkCreator {
+ constructor() {
+ this.preloadedImages = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PRELOADED_IMAGES);
+ this.document = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(DOCUMENT);
}
- for (const mask of splitPhoneMask) {
- if (splitValue.length === 0) {
- break;
+ /**
+ * @description Add a preload `` to the `` of the `index.html` that is served from the
+ * server while using Angular Universal and SSR to kick off image loads for high priority images.
+ *
+ * The `sizes` (passed in from the user) and `srcset` (parsed and formatted from `ngSrcset`)
+ * properties used to set the corresponding attributes, `imagesizes` and `imagesrcset`
+ * respectively, on the preload `` tag so that the correctly sized image is preloaded from
+ * the CDN.
+ *
+ * {@link https://web.dev/preload-responsive-images/#imagesrcset-and-imagesizes}
+ *
+ * @param renderer The `Renderer2` passed in from the directive
+ * @param src The original src of the image that is set on the `ngSrc` input.
+ * @param srcset The parsed and formatted srcset created from the `ngSrcset` input
+ * @param sizes The value of the `sizes` attribute passed in to the `` tag
+ */
+ createPreloadLinkTag(renderer, src, srcset, sizes) {
+ if (ngDevMode) {
+ if (this.preloadedImages.size >= DEFAULT_PRELOADED_IMAGES_LIMIT) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2961 /* RuntimeErrorCode.TOO_MANY_PRELOADED_IMAGES */, ngDevMode && `The \`NgOptimizedImage\` directive has detected that more than ` + `${DEFAULT_PRELOADED_IMAGES_LIMIT} images were marked as priority. ` + `This might negatively affect an overall performance of the page. ` + `To fix this, remove the "priority" attribute from images with less priority.`);
+ }
}
- if (mask === '#') {
- result += splitValue[0] || '';
- splitValue.splice(0, 1);
- } else {
- result += mask;
+ if (this.preloadedImages.has(src)) {
+ return;
+ }
+ this.preloadedImages.add(src);
+ const preload = renderer.createElement('link');
+ renderer.setAttribute(preload, 'as', 'image');
+ renderer.setAttribute(preload, 'href', src);
+ renderer.setAttribute(preload, 'rel', 'preload');
+ renderer.setAttribute(preload, 'fetchpriority', 'high');
+ if (sizes) {
+ renderer.setAttribute(preload, 'imageSizes', sizes);
}
+ if (srcset) {
+ renderer.setAttribute(preload, 'imageSrcset', srcset);
+ }
+ renderer.appendChild(this.document.head, preload);
}
- return result;
-}
-function tuiOtherDecimalSymbol(symbol) {
- return symbol === '.' ? ',' : '.';
}
+_PreloadLinkCreator = PreloadLinkCreator;
+_PreloadLinkCreator.ɵfac = function _PreloadLinkCreator_Factory(t) {
+ return new (t || _PreloadLinkCreator)();
+};
+_PreloadLinkCreator.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjectable"]({
+ token: _PreloadLinkCreator,
+ factory: _PreloadLinkCreator.ɵfac,
+ providedIn: 'root'
+});
+(function () {
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](PreloadLinkCreator, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Injectable,
+ args: [{
+ providedIn: 'root'
+ }]
+ }], null, null);
+})();
/**
- * Generated bundle index. Do not edit.
+ * When a Base64-encoded image is passed as an input to the `NgOptimizedImage` directive,
+ * an error is thrown. The image content (as a string) might be very long, thus making
+ * it hard to read an error message if the entire string is included. This const defines
+ * the number of characters that should be included into the error message. The rest
+ * of the content is truncated.
*/
-
-
-
-/***/ }),
-
-/***/ 2189:
-/*!***********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-utils-miscellaneous.js ***!
- \***********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiGetBorder: () => (/* binding */ tuiGetBorder),
-/* harmony export */ tuiIconsPathFactory: () => (/* binding */ tuiIconsPathFactory),
-/* harmony export */ tuiIsEditingKey: () => (/* binding */ tuiIsEditingKey),
-/* harmony export */ tuiIsObscured: () => (/* binding */ tuiIsObscured),
-/* harmony export */ tuiIsPresumedHTMLString: () => (/* binding */ tuiIsPresumedHTMLString),
-/* harmony export */ tuiOverrideOptions: () => (/* binding */ tuiOverrideOptions),
-/* harmony export */ tuiSizeBigger: () => (/* binding */ tuiSizeBigger)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/core/constants */ 6628);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 4333);
-
-
-const ITEM_SIZE = 1.5;
-const CONTENT_SIZE = 2.5;
-function tuiGetBorder(hasIcon, hasCleaner = false, hasTooltip = false, hasContent = false, size = 'm') {
- const offset = size === 's' ? 0 : 0.25;
- let border = 0;
- if (hasIcon) {
- border += ITEM_SIZE + offset;
- }
- if (hasCleaner) {
- border += ITEM_SIZE + offset;
- }
- if (hasTooltip) {
- border += ITEM_SIZE + offset;
- }
- if (hasContent) {
- border += CONTENT_SIZE + offset;
- }
- return border;
-}
-function tuiIconsPathFactory(staticPath) {
- const base = staticPath.endsWith('/') ? staticPath : `${staticPath}/`;
- return name => {
- if (name.startsWith('tuiIcon')) {
- return `${base}${name}.svg${_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_0__.TUI_CACHE_BUSTING_PAYLOAD}#${name}`;
- }
- return (0,_taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_0__.DEFAULT_ICONS_PATH)(name);
- };
-}
-
+const BASE64_IMG_MAX_LENGTH_IN_ERROR = 50;
/**
- * Check if pressed key is interactive in terms of input field
+ * RegExpr to determine whether a src in a srcset is using width descriptors.
+ * Should match something like: "100w, 200w".
*/
-function tuiIsEditingKey(key) {
- return key.length === 1 || _taiga_ui_core_constants__WEBPACK_IMPORTED_MODULE_0__.tuiEditingKeys.includes(key);
-}
-
+const VALID_WIDTH_DESCRIPTOR_SRCSET = /^((\s*\d+w\s*(,|$)){1,})$/;
/**
- * @internal
+ * RegExpr to determine whether a src in a srcset is using density descriptors.
+ * Should match something like: "1x, 2x, 50x". Also supports decimals like "1.5x, 1.50x".
*/
-function tuiIsObscured(el, exceptSelector = 'tui-hints-host') {
- var _a;
- return !!((_a = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiGetElementObscures)(el)) === null || _a === void 0 ? void 0 : _a.some(el => !el.closest(exceptSelector)));
-}
-function tuiIsPresumedHTMLString(candidate) {
- const trimmed = candidate.trim();
- return trimmed.startsWith('<') && trimmed.endsWith('>');
-}
-function tuiOverrideOptions(override, fallback) {
- return (directive, options) => {
- const result = directive || Object.assign({}, options || fallback);
- Object.keys(override).forEach(key => {
- // Update directive props with new defaults before inputs are processed
- result[key] = override[key];
- });
- return result;
- };
-}
-const SIZES = {
- xxs: 0,
- xs: 1,
- s: 2,
- m: 3,
- l: 4,
- xl: 5,
- xxl: 6
-};
+const VALID_DENSITY_DESCRIPTOR_SRCSET = /^((\s*\d+(\.\d+)?x\s*(,|$)){1,})$/;
/**
- * Compares size constants to determine if first size is bigger than the second
- *
- * @param size size that we need to compare
- * @param biggerThanSize size to compare with, 's' by default
+ * Srcset values with a density descriptor higher than this value will actively
+ * throw an error. Such densities are not permitted as they cause image sizes
+ * to be unreasonably large and slow down LCP.
*/
-function tuiSizeBigger(size, biggerThanSize = 's') {
- return SIZES[size] > SIZES[biggerThanSize];
-}
-
+const ABSOLUTE_SRCSET_DENSITY_CAP = 3;
/**
- * Generated bundle index. Do not edit.
+ * Used only in error message text to communicate best practices, as we will
+ * only throw based on the slightly more conservative ABSOLUTE_SRCSET_DENSITY_CAP.
*/
-
-
-
-/***/ }),
-
-/***/ 3043:
-/*!****************************************************************************!*\
- !*** ./node_modules/@taiga-ui/core/fesm2015/taiga-ui-core-utils-mobile.js ***!
- \****************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiIsMobile: () => (/* binding */ tuiIsMobile)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_core_utils_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/core/utils/dom */ 6721);
-
-function tuiIsMobile(win, {
- mobile
-}) {
- return (0,_taiga_ui_core_utils_dom__WEBPACK_IMPORTED_MODULE_0__.tuiGetViewportWidth)(win) < mobile;
-}
-
+const RECOMMENDED_SRCSET_DENSITY_CAP = 2;
/**
- * Generated bundle index. Do not edit.
+ * Used in generating automatic density-based srcsets
*/
-
-
-
-/***/ }),
-
-/***/ 9633:
-/*!*********************************************************************!*\
- !*** ./node_modules/@taiga-ui/i18n/fesm2015/taiga-ui-i18n-enums.js ***!
- \*********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiCountryIsoCode: () => (/* binding */ TuiCountryIsoCode)
-/* harmony export */ });
-// TODO: change type in v4.0
-// eslint-disable-next-line no-restricted-syntax
-var TuiCountryIsoCode;
-(function (TuiCountryIsoCode) {
- TuiCountryIsoCode["AD"] = "AD";
- TuiCountryIsoCode["AE"] = "AE";
- TuiCountryIsoCode["AF"] = "AF";
- TuiCountryIsoCode["AG"] = "AG";
- TuiCountryIsoCode["AI"] = "AI";
- TuiCountryIsoCode["AL"] = "AL";
- TuiCountryIsoCode["AM"] = "AM";
- TuiCountryIsoCode["AO"] = "AO";
- TuiCountryIsoCode["AR"] = "AR";
- TuiCountryIsoCode["AT"] = "AT";
- TuiCountryIsoCode["AU"] = "AU";
- TuiCountryIsoCode["AW"] = "AW";
- TuiCountryIsoCode["AZ"] = "AZ";
- TuiCountryIsoCode["BA"] = "BA";
- TuiCountryIsoCode["BB"] = "BB";
- TuiCountryIsoCode["BD"] = "BD";
- TuiCountryIsoCode["BE"] = "BE";
- TuiCountryIsoCode["BF"] = "BF";
- TuiCountryIsoCode["BG"] = "BG";
- TuiCountryIsoCode["BH"] = "BH";
- TuiCountryIsoCode["BI"] = "BI";
- TuiCountryIsoCode["BJ"] = "BJ";
- TuiCountryIsoCode["BL"] = "BL";
- TuiCountryIsoCode["BM"] = "BM";
- TuiCountryIsoCode["BN"] = "BN";
- TuiCountryIsoCode["BO"] = "BO";
- TuiCountryIsoCode["BQ"] = "BQ";
- TuiCountryIsoCode["BR"] = "BR";
- TuiCountryIsoCode["BS"] = "BS";
- TuiCountryIsoCode["BT"] = "BT";
- TuiCountryIsoCode["BW"] = "BW";
- TuiCountryIsoCode["BY"] = "BY";
- TuiCountryIsoCode["BZ"] = "BZ";
- TuiCountryIsoCode["CA"] = "CA";
- TuiCountryIsoCode["CD"] = "CD";
- TuiCountryIsoCode["CF"] = "CF";
- TuiCountryIsoCode["CG"] = "CG";
- TuiCountryIsoCode["CH"] = "CH";
- TuiCountryIsoCode["CI"] = "CI";
- TuiCountryIsoCode["CL"] = "CL";
- TuiCountryIsoCode["CM"] = "CM";
- TuiCountryIsoCode["CN"] = "CN";
- TuiCountryIsoCode["CO"] = "CO";
- TuiCountryIsoCode["CR"] = "CR";
- TuiCountryIsoCode["CU"] = "CU";
- TuiCountryIsoCode["CV"] = "CV";
- TuiCountryIsoCode["CW"] = "CW";
- TuiCountryIsoCode["CY"] = "CY";
- TuiCountryIsoCode["CZ"] = "CZ";
- TuiCountryIsoCode["DE"] = "DE";
- TuiCountryIsoCode["DJ"] = "DJ";
- TuiCountryIsoCode["DK"] = "DK";
- TuiCountryIsoCode["DM"] = "DM";
- TuiCountryIsoCode["DO"] = "DO";
- TuiCountryIsoCode["DZ"] = "DZ";
- TuiCountryIsoCode["EC"] = "EC";
- TuiCountryIsoCode["EE"] = "EE";
- TuiCountryIsoCode["EG"] = "EG";
- TuiCountryIsoCode["ER"] = "ER";
- TuiCountryIsoCode["ES"] = "ES";
- TuiCountryIsoCode["ET"] = "ET";
- TuiCountryIsoCode["FI"] = "FI";
- TuiCountryIsoCode["FJ"] = "FJ";
- TuiCountryIsoCode["FK"] = "FK";
- TuiCountryIsoCode["FM"] = "FM";
- TuiCountryIsoCode["FR"] = "FR";
- TuiCountryIsoCode["GA"] = "GA";
- TuiCountryIsoCode["GB"] = "GB";
- TuiCountryIsoCode["GD"] = "GD";
- TuiCountryIsoCode["GE"] = "GE";
- TuiCountryIsoCode["GF"] = "GF";
- TuiCountryIsoCode["GH"] = "GH";
- TuiCountryIsoCode["GI"] = "GI";
- TuiCountryIsoCode["GL"] = "GL";
- TuiCountryIsoCode["GM"] = "GM";
- TuiCountryIsoCode["GN"] = "GN";
- TuiCountryIsoCode["GP"] = "GP";
- TuiCountryIsoCode["GQ"] = "GQ";
- TuiCountryIsoCode["GR"] = "GR";
- TuiCountryIsoCode["GT"] = "GT";
- TuiCountryIsoCode["GW"] = "GW";
- TuiCountryIsoCode["GY"] = "GY";
- TuiCountryIsoCode["HK"] = "HK";
- TuiCountryIsoCode["HN"] = "HN";
- TuiCountryIsoCode["HR"] = "HR";
- TuiCountryIsoCode["HT"] = "HT";
- TuiCountryIsoCode["HU"] = "HU";
- TuiCountryIsoCode["ID"] = "ID";
- TuiCountryIsoCode["IE"] = "IE";
- TuiCountryIsoCode["IL"] = "IL";
- TuiCountryIsoCode["IN"] = "IN";
- TuiCountryIsoCode["IQ"] = "IQ";
- TuiCountryIsoCode["IR"] = "IR";
- TuiCountryIsoCode["IS"] = "IS";
- TuiCountryIsoCode["IT"] = "IT";
- TuiCountryIsoCode["JM"] = "JM";
- TuiCountryIsoCode["JO"] = "JO";
- TuiCountryIsoCode["JP"] = "JP";
- TuiCountryIsoCode["KE"] = "KE";
- TuiCountryIsoCode["KG"] = "KG";
- TuiCountryIsoCode["KH"] = "KH";
- TuiCountryIsoCode["KM"] = "KM";
- TuiCountryIsoCode["KN"] = "KN";
- TuiCountryIsoCode["KP"] = "KP";
- TuiCountryIsoCode["KR"] = "KR";
- TuiCountryIsoCode["KW"] = "KW";
- TuiCountryIsoCode["KY"] = "KY";
- TuiCountryIsoCode["KZ"] = "KZ";
- TuiCountryIsoCode["LA"] = "LA";
- TuiCountryIsoCode["LB"] = "LB";
- TuiCountryIsoCode["LC"] = "LC";
- TuiCountryIsoCode["LI"] = "LI";
- TuiCountryIsoCode["LK"] = "LK";
- TuiCountryIsoCode["LR"] = "LR";
- TuiCountryIsoCode["LS"] = "LS";
- TuiCountryIsoCode["LT"] = "LT";
- TuiCountryIsoCode["LU"] = "LU";
- TuiCountryIsoCode["LV"] = "LV";
- TuiCountryIsoCode["LY"] = "LY";
- TuiCountryIsoCode["MA"] = "MA";
- TuiCountryIsoCode["MC"] = "MC";
- TuiCountryIsoCode["MD"] = "MD";
- TuiCountryIsoCode["ME"] = "ME";
- TuiCountryIsoCode["MF"] = "MF";
- TuiCountryIsoCode["MG"] = "MG";
- TuiCountryIsoCode["MK"] = "MK";
- TuiCountryIsoCode["ML"] = "ML";
- TuiCountryIsoCode["MM"] = "MM";
- TuiCountryIsoCode["MN"] = "MN";
- TuiCountryIsoCode["MO"] = "MO";
- TuiCountryIsoCode["MQ"] = "MQ";
- TuiCountryIsoCode["MR"] = "MR";
- TuiCountryIsoCode["MS"] = "MS";
- TuiCountryIsoCode["MT"] = "MT";
- TuiCountryIsoCode["MU"] = "MU";
- TuiCountryIsoCode["MV"] = "MV";
- TuiCountryIsoCode["MW"] = "MW";
- TuiCountryIsoCode["MX"] = "MX";
- TuiCountryIsoCode["MY"] = "MY";
- TuiCountryIsoCode["MZ"] = "MZ";
- TuiCountryIsoCode["NA"] = "NA";
- TuiCountryIsoCode["NC"] = "NC";
- TuiCountryIsoCode["NE"] = "NE";
- TuiCountryIsoCode["NG"] = "NG";
- TuiCountryIsoCode["NI"] = "NI";
- TuiCountryIsoCode["NL"] = "NL";
- TuiCountryIsoCode["NO"] = "NO";
- TuiCountryIsoCode["NP"] = "NP";
- TuiCountryIsoCode["NZ"] = "NZ";
- TuiCountryIsoCode["OM"] = "OM";
- TuiCountryIsoCode["PA"] = "PA";
- TuiCountryIsoCode["PE"] = "PE";
- TuiCountryIsoCode["PF"] = "PF";
- TuiCountryIsoCode["PG"] = "PG";
- TuiCountryIsoCode["PH"] = "PH";
- TuiCountryIsoCode["PK"] = "PK";
- TuiCountryIsoCode["PL"] = "PL";
- TuiCountryIsoCode["PT"] = "PT";
- TuiCountryIsoCode["PW"] = "PW";
- TuiCountryIsoCode["PY"] = "PY";
- TuiCountryIsoCode["QA"] = "QA";
- TuiCountryIsoCode["RE"] = "RE";
- TuiCountryIsoCode["RO"] = "RO";
- TuiCountryIsoCode["RS"] = "RS";
- TuiCountryIsoCode["RU"] = "RU";
- TuiCountryIsoCode["RW"] = "RW";
- TuiCountryIsoCode["SA"] = "SA";
- TuiCountryIsoCode["SB"] = "SB";
- TuiCountryIsoCode["SC"] = "SC";
- TuiCountryIsoCode["SD"] = "SD";
- TuiCountryIsoCode["SE"] = "SE";
- TuiCountryIsoCode["SG"] = "SG";
- TuiCountryIsoCode["SH"] = "SH";
- TuiCountryIsoCode["SI"] = "SI";
- TuiCountryIsoCode["SK"] = "SK";
- TuiCountryIsoCode["SL"] = "SL";
- TuiCountryIsoCode["SM"] = "SM";
- TuiCountryIsoCode["SN"] = "SN";
- TuiCountryIsoCode["SO"] = "SO";
- TuiCountryIsoCode["SR"] = "SR";
- TuiCountryIsoCode["ST"] = "ST";
- TuiCountryIsoCode["SV"] = "SV";
- TuiCountryIsoCode["SX"] = "SX";
- TuiCountryIsoCode["SY"] = "SY";
- TuiCountryIsoCode["SZ"] = "SZ";
- TuiCountryIsoCode["TC"] = "TC";
- TuiCountryIsoCode["TD"] = "TD";
- TuiCountryIsoCode["TG"] = "TG";
- TuiCountryIsoCode["TH"] = "TH";
- TuiCountryIsoCode["TJ"] = "TJ";
- TuiCountryIsoCode["TL"] = "TL";
- TuiCountryIsoCode["TM"] = "TM";
- TuiCountryIsoCode["TN"] = "TN";
- TuiCountryIsoCode["TO"] = "TO";
- TuiCountryIsoCode["TR"] = "TR";
- TuiCountryIsoCode["TT"] = "TT";
- TuiCountryIsoCode["TW"] = "TW";
- TuiCountryIsoCode["TZ"] = "TZ";
- TuiCountryIsoCode["UA"] = "UA";
- TuiCountryIsoCode["UG"] = "UG";
- TuiCountryIsoCode["US"] = "US";
- TuiCountryIsoCode["UY"] = "UY";
- TuiCountryIsoCode["UZ"] = "UZ";
- TuiCountryIsoCode["VC"] = "VC";
- TuiCountryIsoCode["VE"] = "VE";
- TuiCountryIsoCode["VG"] = "VG";
- TuiCountryIsoCode["VN"] = "VN";
- TuiCountryIsoCode["VU"] = "VU";
- TuiCountryIsoCode["WS"] = "WS";
- TuiCountryIsoCode["XK"] = "XK";
- TuiCountryIsoCode["YE"] = "YE";
- TuiCountryIsoCode["YT"] = "YT";
- TuiCountryIsoCode["ZA"] = "ZA";
- TuiCountryIsoCode["ZM"] = "ZM";
- TuiCountryIsoCode["ZW"] = "ZW";
-})(TuiCountryIsoCode || (TuiCountryIsoCode = {}));
-
+const DENSITY_SRCSET_MULTIPLIERS = [1, 2];
/**
- * Generated bundle index. Do not edit.
+ * Used to determine which breakpoints to use on full-width images
*/
-
-
-
-/***/ }),
-
-/***/ 6534:
-/*!*********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/i18n/fesm2015/taiga-ui-i18n-languages-english.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_ENGLISH_LANGUAGE: () => (/* binding */ TUI_ENGLISH_LANGUAGE),
-/* harmony export */ TUI_ENGLISH_LANGUAGE_ADDON_COMMERCE: () => (/* binding */ TUI_ENGLISH_LANGUAGE_ADDON_COMMERCE),
-/* harmony export */ TUI_ENGLISH_LANGUAGE_ADDON_EDITOR: () => (/* binding */ TUI_ENGLISH_LANGUAGE_ADDON_EDITOR),
-/* harmony export */ TUI_ENGLISH_LANGUAGE_ADDON_PREVIEW: () => (/* binding */ TUI_ENGLISH_LANGUAGE_ADDON_PREVIEW),
-/* harmony export */ TUI_ENGLISH_LANGUAGE_ADDON_TABLE: () => (/* binding */ TUI_ENGLISH_LANGUAGE_ADDON_TABLE),
-/* harmony export */ TUI_ENGLISH_LANGUAGE_CORE: () => (/* binding */ TUI_ENGLISH_LANGUAGE_CORE),
-/* harmony export */ TUI_ENGLISH_LANGUAGE_COUNTRIES: () => (/* binding */ TUI_ENGLISH_LANGUAGE_COUNTRIES),
-/* harmony export */ TUI_ENGLISH_LANGUAGE_KIT: () => (/* binding */ TUI_ENGLISH_LANGUAGE_KIT)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/i18n/enums */ 9633);
-
-const TUI_ENGLISH_LANGUAGE_ADDON_COMMERCE = {
- cardNumber: ['Number', 'Card number'],
- cardExpiry: ['Expires', 'Valid through']
-};
-const TUI_ENGLISH_LANGUAGE_ADDON_EDITOR = {
- colorSelectorModeNames: ['Solid color', 'Gradient'],
- toolbarTools: {
- undo: 'Undo',
- redo: 'Redo',
- font: 'Font',
- fontStyle: 'Font style',
- fontSize: 'Font size',
- bold: 'Bold',
- italic: 'Italic',
- underline: 'Underline',
- strikeThrough: 'Strike through',
- justify: 'Justify',
- justifyLeft: 'Justify left',
- justifyCenter: 'Justify center',
- justifyRight: 'Justify right',
- justifyFull: 'Justify full',
- list: 'List',
- indent: 'Indent',
- outdent: 'Outdent',
- unorderedList: 'Unordered list',
- orderedList: 'Ordered list',
- quote: 'Quote',
- foreColor: 'Color',
- backColor: 'Background color',
- hiliteColor: 'Highlight color',
- clear: 'Clear',
- link: 'Link',
- attach: 'Attach file',
- tex: 'Insert TeX',
- code: 'Code',
- image: 'Insert image',
- insertHorizontalRule: 'Insert horizontal rule',
- superscript: 'Superscript',
- subscript: 'Subscript',
- insertTable: 'Insert table',
- insertGroup: 'Insert group',
- hiliteGroup: 'Hilite group',
- removeGroup: 'Remove group',
- insertAnchor: 'Insert anchor',
- mergeCells: 'Merge cells',
- splitCells: 'Split cells',
- rowsColumnsManaging: 'Managing rows and columns',
- cellColor: 'Cell color',
- setDetails: 'Details',
- removeDetails: 'Remove details'
- },
- editorEditLink: {
- urlExample: 'example.com',
- anchorExample: 'anchor'
- },
- editorTableCommands: [['Insert column before', 'Insert column after'], ['Insert row before', 'Insert row after'], ['Delete column', 'Delete row']],
- editorCodeOptions: ['Code in the text', 'Code in block'],
- editorFontOptions: {
- small: 'Small',
- large: 'Large',
- normal: 'Normal',
- title: 'Title',
- subtitle: 'Subtitle'
- }
-};
-const TUI_ENGLISH_LANGUAGE_ADDON_PREVIEW = {
- previewTexts: {
- rotate: 'Rotate'
- },
- zoomTexts: {
- zoomOut: 'Zoom out',
- zoomIn: 'Zoom in',
- reset: 'Reset'
- }
-};
-const TUI_ENGLISH_LANGUAGE_ADDON_TABLE = {
- showHideText: 'Show/Hide',
- paginationTexts: {
- pages: 'Pages',
- linesPerPage: 'Lines per page',
- of: 'of'
- }
-};
-const TUI_ENGLISH_LANGUAGE_COUNTRIES = {
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AD]: 'Andorra',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AE]: 'United Arab Emirates',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AF]: 'Afghanistan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AG]: 'Antigua and Barbuda',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BL]: 'Saint Barthélemy',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AI]: 'Anguilla',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AL]: 'Albania',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AM]: 'Armenia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AO]: 'Angola',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AR]: 'Argentina',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AT]: 'Austria',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AU]: 'Australia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AW]: 'Aruba',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.AZ]: 'Azerbaijan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BA]: 'Bosnia and Herzegovina',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BB]: 'Barbados',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BD]: 'Bangladesh',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BE]: 'Belgium',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BF]: 'Burkina Faso',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BG]: 'Bulgaria',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BH]: 'Bahrain',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BI]: 'Burundi',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BJ]: 'Benin',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GF]: 'Guyana',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BM]: 'Bermuda',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BN]: 'Brunei Darussalam',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BO]: 'Bolivia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BQ]: 'Bonaire, Sint Eustatius and Saba',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BR]: 'Brazil',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BS]: 'Bahamas',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BT]: 'Bhutan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BW]: 'Botswana',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BY]: 'Belarus',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.BZ]: 'Belize',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CA]: 'Canada',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CD]: 'Dem. Rep. Congo (Kinshasa)',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CF]: 'Central African Republic',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CG]: 'Congo (Brazzaville)',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CH]: 'Switzerland',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CI]: 'Ivory Coast',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CL]: 'Chile',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CM]: 'Cameroon',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CN]: 'China',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CO]: 'Colombia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CR]: 'Costa Rica',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CU]: 'Cuba',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CV]: 'Cape Verde',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CW]: 'Curaçao',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CY]: 'Cyprus',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.CZ]: 'Czech Republic',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.DE]: 'Germany',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.DJ]: 'Djibouti',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.DK]: 'Denmark',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.DM]: 'Dominica',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.DO]: 'Dominican Republic',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.DZ]: 'Algeria',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.EC]: 'Ecuador',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.EE]: 'Estonia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.EG]: 'Egypt',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ER]: 'Eritrea',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ES]: 'Spain',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ET]: 'Ethiopia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.FI]: 'Finland',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.FJ]: 'Fiji',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.FK]: 'Falkland Islands',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.FM]: 'F.S. of Micronesia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.FR]: 'France',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GA]: 'Gabon',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GB]: 'United Kingdom',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GD]: 'Grenada',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GE]: 'Georgia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GP]: 'Guadeloupe',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GH]: 'Ghana',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GI]: 'Gibraltar',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GL]: 'Greenland',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GM]: 'Gambia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GN]: 'Guinea',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MF]: 'Saint-Martin',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GQ]: 'Equatorial Guinea',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GR]: 'Greece',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GT]: 'Guatemala',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GW]: 'Guinea-Bissau',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.GY]: 'Guyana',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.HK]: 'Hong Kong',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.HN]: 'Honduras',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.HR]: 'Croatia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.HT]: 'Haiti',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.HU]: 'Hungary',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ID]: 'Indonesia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.IE]: 'Ireland',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.IL]: 'Israel',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.IN]: 'India',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.IQ]: 'Iraq',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.IR]: 'Iran',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.IS]: 'Iceland',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.IT]: 'Italy',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.JM]: 'Jamaica',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.JO]: 'Jordan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.JP]: 'Japan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KE]: 'Kenya',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KG]: 'Kyrgyzstan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KH]: 'Cambodia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KM]: 'Comoros',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KN]: 'Saint Kitts and Nevis',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KP]: 'Korean PDR',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KR]: 'Rep. Korea',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KW]: 'Kuwait',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KY]: 'Cayman Islands',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.KZ]: 'Kazakhstan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LA]: 'Laos',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LB]: 'Lebanon',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LC]: 'Saint Lucia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LI]: 'Liechtenstein',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LK]: 'Sri Lanka',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LR]: 'Liberia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LS]: 'Lesotho',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LT]: 'Lithuania',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LU]: 'Luxembourg',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LV]: 'Latvia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.LY]: 'Libya',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MA]: 'Morocco',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MC]: 'Monaco',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MD]: 'Moldova',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ME]: 'Montenegro',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MQ]: 'Martinique',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MG]: 'Madagascar',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MK]: 'Rep. of North Macedonia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ML]: 'Mali',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MM]: 'Burma (Myanmar)',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MN]: 'Mongolia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MO]: 'Macau',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.RE]: 'Réunion',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MR]: 'Mauritania',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MS]: 'Montserrat',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MT]: 'Malta',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MU]: 'Mauritius',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MV]: 'Maldives',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MW]: 'Malawi',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MX]: 'Mexico',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MY]: 'Malaysia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.MZ]: 'Mozambique',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.NA]: 'Namibia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.NC]: 'New Caledonia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.NE]: 'Niger',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.NG]: 'Nigeria',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.NI]: 'Nicaragua',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.NL]: 'Netherlands',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.NO]: 'Norway',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.NP]: 'Nepal',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.NZ]: 'New Zealand',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.OM]: 'Oman',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PA]: 'Panama',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PE]: 'Peru',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PF]: 'French Polynesia (Tahiti)',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PG]: 'Papua New Guinea',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PH]: 'Philippines',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PK]: 'Pakistan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PL]: 'Poland',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PT]: 'Portugal',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PW]: 'Palau',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.PY]: 'Paraguay',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.QA]: 'Qatar',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.YT]: 'Mayotte',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.RO]: 'Romania',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.RS]: 'Serbia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.RU]: 'Russia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.RW]: 'Rwanda',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SA]: 'Saudi Arabia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SB]: 'Solomon Islands',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SC]: 'Seychelles',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SD]: 'Sudan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SE]: 'Sweden',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SG]: 'Singapore',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SH]: 'Saint Helena',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SI]: 'Slovenia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SK]: 'Slovakia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SL]: 'Sierra Leone',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SM]: 'San Marino',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SN]: 'Senegal',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SO]: 'Somalia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SR]: 'Suriname',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ST]: 'Sao Tome and Principe',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SV]: 'El Salvador',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SX]: 'Sint Maarten',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SY]: 'Syrian Arab Republic',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.SZ]: 'Swaziland',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TC]: 'Turks and Caicos',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TD]: 'Chad',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TG]: 'Togo',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TH]: 'Thailand',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TJ]: 'Tajikistan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TL]: 'East Timor',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TM]: 'Turkmenistan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TN]: 'Tunisia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TO]: 'Tonga',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TR]: 'Turkey',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TT]: 'Trinidad and Tobago',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TW]: 'Taiwan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.TZ]: 'Tanzania',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.UA]: 'Ukraine',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.UG]: 'Uganda',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.US]: 'USA',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.UY]: 'Uruguay',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.UZ]: 'Uzbekistan',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.VC]: 'Saint Vincent and the Grenadines',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.VE]: 'Venezuela',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.VG]: 'British Virgin Islands',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.VN]: 'Vietnam',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.VU]: 'Vanuatu',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.WS]: 'Samoa',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.XK]: 'Kosovo',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.YE]: 'Yemen',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ZA]: 'South Africa',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ZM]: 'Zambia',
- [_taiga_ui_i18n_enums__WEBPACK_IMPORTED_MODULE_0__.TuiCountryIsoCode.ZW]: 'Zimbabwe'
-};
-const TUI_ENGLISH_LANGUAGE_CORE = {
- months: ['January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December'],
- close: 'Close',
- nothingFoundMessage: 'Nothing found',
- defaultErrorMessage: 'Value is invalid',
- spinTexts: ['Previous', 'Next'],
- shortWeekDays: ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],
- countries: TUI_ENGLISH_LANGUAGE_COUNTRIES
-};
-const TUI_ENGLISH_LANGUAGE_KIT = {
- cancel: 'Cancel',
- done: 'Done',
- more: 'More',
- otherDate: 'Other date...',
- showAll: 'Show all',
- hide: 'Hide',
- mobileCalendarTexts: ['Choose day', 'Choose range', 'Choose days'],
- range: ['from', 'to'],
- countTexts: ['Plus', 'Minus'],
- time: {
- 'HH:MM': 'HH:MM',
- 'HH:MM:SS': 'HH:MM:SS',
- 'HH:MM:SS.MSS': 'HH:MM:SS.MSS'
- },
- dateTexts: {
- DMY: 'dd.mm.yyyy',
- MDY: 'mm.dd.yyyy',
- YMD: 'yyyy.mm.dd'
- },
- digitalInformationUnits: ['B', 'KiB', 'MiB'],
- passwordTexts: ['Show password', 'Hide password'],
- copyTexts: ['Copy', 'Copied'],
- shortCalendarMonths: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec'],
- pagination: ['Previous page', 'Next page'],
- fileTexts: {
- loadingError: 'Upload failed',
- preview: 'Preview',
- remove: 'Remove'
- },
- inputFileTexts: {
- defaultLabelSingle: 'or drop\u00A0it\u00A0here',
- defaultLabelMultiple: 'or drop\u00A0them\u00A0here',
- defaultLinkSingle: 'Choose a file',
- defaultLinkMultiple: 'Choose files',
- maxSizeRejectionReason: 'File is larger than',
- formatRejectionReason: 'Wrong file type',
- drop: 'Drop file here',
- dropMultiple: 'Drop files here'
- },
- multiSelectTexts: {
- all: 'Select all',
- none: 'Select none'
- },
- prompt: {
- yes: 'Yes',
- no: 'No'
- }
-};
-const TUI_ENGLISH_LANGUAGE = Object.assign(Object.assign(Object.assign(Object.assign(Object.assign(Object.assign({
- name: 'english'
-}, TUI_ENGLISH_LANGUAGE_CORE), TUI_ENGLISH_LANGUAGE_KIT), TUI_ENGLISH_LANGUAGE_ADDON_TABLE), TUI_ENGLISH_LANGUAGE_ADDON_COMMERCE), TUI_ENGLISH_LANGUAGE_ADDON_EDITOR), TUI_ENGLISH_LANGUAGE_ADDON_PREVIEW);
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 2823:
-/*!**********************************************************************!*\
- !*** ./node_modules/@taiga-ui/i18n/fesm2015/taiga-ui-i18n-switch.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiLanguageSwitcher: () => (/* binding */ TuiLanguageSwitcher),
-/* harmony export */ tuiAsyncLoadLanguage: () => (/* binding */ tuiAsyncLoadLanguage),
-/* harmony export */ tuiLanguageSwitcher: () => (/* binding */ tuiLanguageSwitcher),
-/* harmony export */ tuiLoadLanguage: () => (/* binding */ tuiLoadLanguage)
-/* harmony export */ });
-/* harmony import */ var _taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/i18n/tokens */ 5321);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @ng-web-apis/common */ 2684);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 3496);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 5536);
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 4406);
-
-
-
-
-
-
-
-
-// CommonJS `module.exports` is wrapped as `default` in ESModule.
-function normalizeCommonJSImport(importPromise) {
- return (0,tslib__WEBPACK_IMPORTED_MODULE_0__.__awaiter)(this, void 0, void 0, function* () {
- return importPromise.then(m => m.default || m);
- });
-}
-function tuiLoadLanguage(language, loader) {
- return (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.from)(normalizeCommonJSImport(loader(language))).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.map)(module => module === null || module === void 0 ? void 0 : module[`TUI_${language.toUpperCase()}_LANGUAGE`]));
-}
-function tuiAsyncLoadLanguage(language, loader, fallback) {
- return language && loader ? tuiLoadLanguage(language, loader) : (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(fallback);
-}
-class TuiLanguageSwitcher extends rxjs__WEBPACK_IMPORTED_MODULE_4__.BehaviorSubject {
- constructor(fallback, key, storage, loader) {
- super(tuiAsyncLoadLanguage(storage.getItem(key), loader, fallback));
- this.fallback = fallback;
- this.key = key;
- this.storage = storage;
- this.loader = loader;
- }
- get language() {
- return this.storage.getItem(this.key) || this.fallback.name;
- }
- setLanguage(language) {
- this.storage.setItem(this.key, language);
- this.next(tuiAsyncLoadLanguage(language, this.loader, this.fallback));
- }
- clear() {
- this.storage.removeItem(this.key);
- this.next((0,rxjs__WEBPACK_IMPORTED_MODULE_3__.of)(this.fallback));
- }
-}
-TuiLanguageSwitcher.ɵfac = function TuiLanguageSwitcher_Factory(t) {
- return new (t || TuiLanguageSwitcher)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_DEFAULT_LANGUAGE), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_LANGUAGE_STORAGE_KEY), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.LOCAL_STORAGE), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_LANGUAGE_LOADER, 8));
-};
-TuiLanguageSwitcher.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
- token: TuiLanguageSwitcher,
- factory: TuiLanguageSwitcher.ɵfac,
- providedIn: 'root'
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](TuiLanguageSwitcher, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable,
- args: [{
- providedIn: 'root'
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_DEFAULT_LANGUAGE]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_LANGUAGE_STORAGE_KEY]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_ng_web_apis_common__WEBPACK_IMPORTED_MODULE_7__.LOCAL_STORAGE]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Inject,
- args: [_taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_LANGUAGE_LOADER]
- }]
- }];
- }, null);
-})();
-function tuiLanguageSwitcher(loader) {
- return [{
- provide: _taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_LANGUAGE_LOADER,
- useFactory: () => loader
- }, {
- provide: _taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_6__.TUI_LANGUAGE,
- useExisting: TuiLanguageSwitcher
- }];
-}
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 5321:
-/*!**********************************************************************!*\
- !*** ./node_modules/@taiga-ui/i18n/fesm2015/taiga-ui-i18n-tokens.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_DEFAULT_LANGUAGE: () => (/* binding */ TUI_DEFAULT_LANGUAGE),
-/* harmony export */ TUI_LANGUAGE: () => (/* binding */ TUI_LANGUAGE),
-/* harmony export */ TUI_LANGUAGE_LOADER: () => (/* binding */ TUI_LANGUAGE_LOADER),
-/* harmony export */ TUI_LANGUAGE_STORAGE_KEY: () => (/* binding */ TUI_LANGUAGE_STORAGE_KEY)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_i18n_languages_english__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/i18n/languages/english */ 6534);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs */ 3901);
-
-
-
-
+const VIEWPORT_BREAKPOINT_CUTOFF = 640;
/**
- * Default Language for Taiga UI libraries i18n
+ * Used to determine whether two aspect ratios are similar in value.
*/
-const TUI_DEFAULT_LANGUAGE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('[TUI_DEFAULT_LANGUAGE]', {
- factory: () => _taiga_ui_i18n_languages_english__WEBPACK_IMPORTED_MODULE_1__.TUI_ENGLISH_LANGUAGE
-});
+const ASPECT_RATIO_TOLERANCE = .1;
/**
- * Language for Taiga UI libraries i18n
+ * Used to determine whether the image has been requested at an overly
+ * large size compared to the actual rendered image size (after taking
+ * into account a typical device pixel ratio). In pixels.
*/
-const TUI_LANGUAGE = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('[TUI_LANGUAGE]', {
- factory: () => (0,rxjs__WEBPACK_IMPORTED_MODULE_2__.of)((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(TUI_DEFAULT_LANGUAGE))
-});
-
+const OVERSIZED_IMAGE_TOLERANCE = 1000;
/**
- * Webpack chunk loader for Taiga UI libraries i18n
- * @note: cannot be transferred to a shared file
- * ReferenceError: Cannot access 'TUI_LANGUAGE_LOADER' before initialization
+ * Used to limit automatic srcset generation of very large sources for
+ * fixed-size images. In pixels.
*/
-const TUI_LANGUAGE_LOADER = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('[TUI_LANGUAGE_LOADER]');
-
+const FIXED_SRCSET_WIDTH_LIMIT = 1920;
+const FIXED_SRCSET_HEIGHT_LIMIT = 1080;
+/** Info about built-in loaders we can test for. */
+const BUILT_IN_LOADERS = [imgixLoaderInfo, imageKitLoaderInfo, cloudinaryLoaderInfo];
+const defaultConfig = {
+ breakpoints: [16, 32, 48, 64, 96, 128, 256, 384, 640, 750, 828, 1080, 1200, 1920, 2048, 3840]
+};
/**
- * Default key for search value in storage
+ * Injection token that configures the image optimized image functionality.
+ *
+ * @see {@link NgOptimizedImage}
+ * @publicApi
*/
-const TUI_LANGUAGE_STORAGE_KEY = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('[TUI_LANGUAGE_STORAGE_KEY]', {
- factory: () => 'tuiLanguage'
+const IMAGE_CONFIG = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.InjectionToken('ImageConfig', {
+ providedIn: 'root',
+ factory: () => defaultConfig
});
-
-/**
- * Generated bundle index. Do not edit.
- */
-
-
-
-/***/ }),
-
-/***/ 1204:
-/*!*********************************************************************!*\
- !*** ./node_modules/@taiga-ui/i18n/fesm2015/taiga-ui-i18n-tools.js ***!
- \*********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ tuiExtractI18n: () => (/* binding */ tuiExtractI18n)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/i18n/tokens */ 5321);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs */ 9918);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 3901);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! rxjs/operators */ 4406);
-
-
-
-
-function tuiExtractI18n(key) {
- return () => (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_taiga_ui_i18n_tokens__WEBPACK_IMPORTED_MODULE_1__.TUI_LANGUAGE).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.switchMap)(streamOrValue => (0,rxjs__WEBPACK_IMPORTED_MODULE_3__.isObservable)(streamOrValue) ? streamOrValue : (0,rxjs__WEBPACK_IMPORTED_MODULE_4__.of)(streamOrValue)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_5__.map)(lang => lang[key]));
-}
-
/**
- * Generated bundle index. Do not edit.
+ * Directive that improves image loading performance by enforcing best practices.
+ *
+ * `NgOptimizedImage` ensures that the loading of the Largest Contentful Paint (LCP) image is
+ * prioritized by:
+ * - Automatically setting the `fetchpriority` attribute on the `` tag
+ * - Lazy loading non-priority images by default
+ * - Asserting that there is a corresponding preconnect link tag in the document head
+ *
+ * In addition, the directive:
+ * - Generates appropriate asset URLs if a corresponding `ImageLoader` function is provided
+ * - Automatically generates a srcset
+ * - Requires that `width` and `height` are set
+ * - Warns if `width` or `height` have been set incorrectly
+ * - Warns if the image will be visually distorted when rendered
+ *
+ * @usageNotes
+ * The `NgOptimizedImage` directive is marked as [standalone](guide/standalone-components) and can
+ * be imported directly.
+ *
+ * Follow the steps below to enable and use the directive:
+ * 1. Import it into the necessary NgModule or a standalone Component.
+ * 2. Optionally provide an `ImageLoader` if you use an image hosting service.
+ * 3. Update the necessary `` tags in templates and replace `src` attributes with `ngSrc`.
+ * Using a `ngSrc` allows the directive to control when the `src` gets set, which triggers an image
+ * download.
+ *
+ * Step 1: import the `NgOptimizedImage` directive.
+ *
+ * ```typescript
+ * import { NgOptimizedImage } from '@angular/common';
+ *
+ * // Include it into the necessary NgModule
+ * @NgModule({
+ * imports: [NgOptimizedImage],
+ * })
+ * class AppModule {}
+ *
+ * // ... or a standalone Component
+ * @Component({
+ * standalone: true
+ * imports: [NgOptimizedImage],
+ * })
+ * class MyStandaloneComponent {}
+ * ```
+ *
+ * Step 2: configure a loader.
+ *
+ * To use the **default loader**: no additional code changes are necessary. The URL returned by the
+ * generic loader will always match the value of "src". In other words, this loader applies no
+ * transformations to the resource URL and the value of the `ngSrc` attribute will be used as is.
+ *
+ * To use an existing loader for a **third-party image service**: add the provider factory for your
+ * chosen service to the `providers` array. In the example below, the Imgix loader is used:
+ *
+ * ```typescript
+ * import {provideImgixLoader} from '@angular/common';
+ *
+ * // Call the function and add the result to the `providers` array:
+ * providers: [
+ * provideImgixLoader("https://my.base.url/"),
+ * ],
+ * ```
+ *
+ * The `NgOptimizedImage` directive provides the following functions:
+ * - `provideCloudflareLoader`
+ * - `provideCloudinaryLoader`
+ * - `provideImageKitLoader`
+ * - `provideImgixLoader`
+ *
+ * If you use a different image provider, you can create a custom loader function as described
+ * below.
+ *
+ * To use a **custom loader**: provide your loader function as a value for the `IMAGE_LOADER` DI
+ * token.
+ *
+ * ```typescript
+ * import {IMAGE_LOADER, ImageLoaderConfig} from '@angular/common';
+ *
+ * // Configure the loader using the `IMAGE_LOADER` token.
+ * providers: [
+ * {
+ * provide: IMAGE_LOADER,
+ * useValue: (config: ImageLoaderConfig) => {
+ * return `https://example.com/${config.src}-${config.width}.jpg}`;
+ * }
+ * },
+ * ],
+ * ```
+ *
+ * Step 3: update `` tags in templates to use `ngSrc` instead of `src`.
+ *
+ * ```
+ *
+ * ```
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 5155:
-/*!**********************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-abstract.js ***!
- \**********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ AbstractTuiNativeSelect: () => (/* binding */ AbstractTuiNativeSelect)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/core */ 3359);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/core */ 8623);
-/* harmony import */ var _taiga_ui_kit_tokens__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/kit/tokens */ 991);
-
-
-
-
-
-
-class AbstractTuiNativeSelect {
- constructor(host, control, el, idService, itemsHandlers) {
- this.host = host;
- this.control = control;
- this.el = el;
- this.idService = idService;
- this.itemsHandlers = itemsHandlers;
- this.placeholder = '';
- this.disabledItemHandler = null;
- this.datalist = null;
- }
- get id() {
- return this.el.nativeElement.id || this.idService.generate();
- }
- get emptyOption() {
- return !!this.placeholder && !this.control.value;
- }
-}
-AbstractTuiNativeSelect.ɵfac = function AbstractTuiNativeSelect_Factory(t) {
- return new (t || AbstractTuiNativeSelect)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_1__.TUI_TEXTFIELD_HOST), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.AbstractTuiControl), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiIdService), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_kit_tokens__WEBPACK_IMPORTED_MODULE_4__.TUI_ITEMS_HANDLERS));
-};
-AbstractTuiNativeSelect.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: AbstractTuiNativeSelect,
- viewQuery: function AbstractTuiNativeSelect_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__.TuiDataListDirective, 7, _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.datalist = _t.first);
- }
- },
- hostVars: 1,
- hostBindings: function AbstractTuiNativeSelect_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵhostProperty"]("id", ctx.id);
- }
- },
- inputs: {
- placeholder: "placeholder",
- disabledItemHandler: "disabledItemHandler"
+class NgOptimizedImage {
+ constructor() {
+ this.imageLoader = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(IMAGE_LOADER);
+ this.config = processConfig((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(IMAGE_CONFIG));
+ this.renderer = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Renderer2);
+ this.imgElement = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef).nativeElement;
+ this.injector = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.Injector);
+ this.isServer = isPlatformServer((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_0__.PLATFORM_ID));
+ this.preloadLinkCreator = (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.inject)(PreloadLinkCreator);
+ // a LCP image observer - should be injected only in the dev mode
+ this.lcpObserver = ngDevMode ? this.injector.get(LCPImageObserver) : null;
+ /**
+ * Calculate the rewritten `src` once and store it.
+ * This is needed to avoid repetitive calculations and make sure the directive cleanup in the
+ * `ngOnDestroy` does not rely on the `IMAGE_LOADER` logic (which in turn can rely on some other
+ * instance that might be already destroyed).
+ */
+ this._renderedSrc = null;
+ /**
+ * Indicates whether this image should have a high priority.
+ */
+ this.priority = false;
+ /**
+ * Disables automatic srcset generation for this image.
+ */
+ this.disableOptimizedSrcset = false;
+ /**
+ * Sets the image to "fill mode", which eliminates the height/width requirement and adds
+ * styles such that the image fills its containing element.
+ */
+ this.fill = false;
}
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AbstractTuiNativeSelect, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_1__.TUI_TEXTFIELD_HOST]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.AbstractTuiControl,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.AbstractTuiControl]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ElementRef]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiIdService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.TuiIdService]
+ /** @nodoc */
+ ngOnInit() {
+ if (ngDevMode) {
+ const ngZone = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone);
+ assertNonEmptyInput(this, 'ngSrc', this.ngSrc);
+ assertValidNgSrcset(this, this.ngSrcset);
+ assertNoConflictingSrc(this);
+ if (this.ngSrcset) {
+ assertNoConflictingSrcset(this);
+ }
+ assertNotBase64Image(this);
+ assertNotBlobUrl(this);
+ if (this.fill) {
+ assertEmptyWidthAndHeight(this);
+ // This leaves the Angular zone to avoid triggering unnecessary change detection cycles when
+ // `load` tasks are invoked on images.
+ ngZone.runOutsideAngular(() => assertNonZeroRenderedHeight(this, this.imgElement, this.renderer));
+ } else {
+ assertNonEmptyWidthAndHeight(this);
+ if (this.height !== undefined) {
+ assertGreaterThanZero(this, this.height, 'height');
+ }
+ if (this.width !== undefined) {
+ assertGreaterThanZero(this, this.width, 'width');
+ }
+ // Only check for distorted images when not in fill mode, where
+ // images may be intentionally stretched, cropped or letterboxed.
+ ngZone.runOutsideAngular(() => assertNoImageDistortion(this, this.imgElement, this.renderer));
+ }
+ assertValidLoadingInput(this);
+ if (!this.ngSrcset) {
+ assertNoComplexSizes(this);
+ }
+ assertNotMissingBuiltInLoader(this.ngSrc, this.imageLoader);
+ assertNoNgSrcsetWithoutLoader(this, this.imageLoader);
+ assertNoLoaderParamsWithoutLoader(this, this.imageLoader);
+ if (this.lcpObserver !== null) {
+ const ngZone = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone);
+ ngZone.runOutsideAngular(() => {
+ this.lcpObserver.registerImage(this.getRewrittenSrc(), this.ngSrc, this.priority);
+ });
+ }
+ if (this.priority) {
+ const checker = this.injector.get(PreconnectLinkChecker);
+ checker.assertPreconnect(this.getRewrittenSrc(), this.ngSrc);
+ }
+ }
+ this.setHostAttributes();
+ }
+ setHostAttributes() {
+ // Must set width/height explicitly in case they are bound (in which case they will
+ // only be reflected and not found by the browser)
+ if (this.fill) {
+ if (!this.sizes) {
+ this.sizes = '100vw';
+ }
+ } else {
+ this.setHostAttribute('width', this.width.toString());
+ this.setHostAttribute('height', this.height.toString());
+ }
+ this.setHostAttribute('loading', this.getLoadingBehavior());
+ this.setHostAttribute('fetchpriority', this.getFetchPriority());
+ // The `data-ng-img` attribute flags an image as using the directive, to allow
+ // for analysis of the directive's performance.
+ this.setHostAttribute('ng-img', 'true');
+ // The `src` and `srcset` attributes should be set last since other attributes
+ // could affect the image's loading behavior.
+ const rewrittenSrcset = this.updateSrcAndSrcset();
+ if (this.sizes) {
+ this.setHostAttribute('sizes', this.sizes);
+ }
+ if (this.isServer && this.priority) {
+ this.preloadLinkCreator.createPreloadLinkTag(this.renderer, this.getRewrittenSrc(), rewrittenSrcset, this.sizes);
+ }
+ }
+ /** @nodoc */
+ ngOnChanges(changes) {
+ if (ngDevMode) {
+ assertNoPostInitInputChange(this, changes, ['ngSrcset', 'width', 'height', 'priority', 'fill', 'loading', 'sizes', 'loaderParams', 'disableOptimizedSrcset']);
+ }
+ if (changes['ngSrc'] && !changes['ngSrc'].isFirstChange()) {
+ const oldSrc = this._renderedSrc;
+ this.updateSrcAndSrcset(true);
+ const newSrc = this._renderedSrc;
+ if (this.lcpObserver !== null && oldSrc && newSrc && oldSrc !== newSrc) {
+ const ngZone = this.injector.get(_angular_core__WEBPACK_IMPORTED_MODULE_0__.NgZone);
+ ngZone.runOutsideAngular(() => {
+ this.lcpObserver?.updateImage(oldSrc, newSrc);
+ });
+ }
+ }
+ }
+ callImageLoader(configWithoutCustomParams) {
+ let augmentedConfig = configWithoutCustomParams;
+ if (this.loaderParams) {
+ augmentedConfig.loaderParams = this.loaderParams;
+ }
+ return this.imageLoader(augmentedConfig);
+ }
+ getLoadingBehavior() {
+ if (!this.priority && this.loading !== undefined) {
+ return this.loading;
+ }
+ return this.priority ? 'eager' : 'lazy';
+ }
+ getFetchPriority() {
+ return this.priority ? 'high' : 'auto';
+ }
+ getRewrittenSrc() {
+ // ImageLoaderConfig supports setting a width property. However, we're not setting width here
+ // because if the developer uses rendered width instead of intrinsic width in the HTML width
+ // attribute, the image requested may be too small for 2x+ screens.
+ if (!this._renderedSrc) {
+ const imgConfig = {
+ src: this.ngSrc
+ };
+ // Cache calculated image src to reuse it later in the code.
+ this._renderedSrc = this.callImageLoader(imgConfig);
+ }
+ return this._renderedSrc;
+ }
+ getRewrittenSrcset() {
+ const widthSrcSet = VALID_WIDTH_DESCRIPTOR_SRCSET.test(this.ngSrcset);
+ const finalSrcs = this.ngSrcset.split(',').filter(src => src !== '').map(srcStr => {
+ srcStr = srcStr.trim();
+ const width = widthSrcSet ? parseFloat(srcStr) : parseFloat(srcStr) * this.width;
+ return `${this.callImageLoader({
+ src: this.ngSrc,
+ width
+ })} ${srcStr}`;
+ });
+ return finalSrcs.join(', ');
+ }
+ getAutomaticSrcset() {
+ if (this.sizes) {
+ return this.getResponsiveSrcset();
+ } else {
+ return this.getFixedSrcset();
+ }
+ }
+ getResponsiveSrcset() {
+ const {
+ breakpoints
+ } = this.config;
+ let filteredBreakpoints = breakpoints;
+ if (this.sizes?.trim() === '100vw') {
+ // Since this is a full-screen-width image, our srcset only needs to include
+ // breakpoints with full viewport widths.
+ filteredBreakpoints = breakpoints.filter(bp => bp >= VIEWPORT_BREAKPOINT_CUTOFF);
+ }
+ const finalSrcs = filteredBreakpoints.map(bp => `${this.callImageLoader({
+ src: this.ngSrc,
+ width: bp
+ })} ${bp}w`);
+ return finalSrcs.join(', ');
+ }
+ updateSrcAndSrcset(forceSrcRecalc = false) {
+ if (forceSrcRecalc) {
+ // Reset cached value, so that the followup `getRewrittenSrc()` call
+ // will recalculate it and update the cache.
+ this._renderedSrc = null;
+ }
+ const rewrittenSrc = this.getRewrittenSrc();
+ this.setHostAttribute('src', rewrittenSrc);
+ let rewrittenSrcset = undefined;
+ if (this.ngSrcset) {
+ rewrittenSrcset = this.getRewrittenSrcset();
+ } else if (this.shouldGenerateAutomaticSrcset()) {
+ rewrittenSrcset = this.getAutomaticSrcset();
+ }
+ if (rewrittenSrcset) {
+ this.setHostAttribute('srcset', rewrittenSrcset);
+ }
+ return rewrittenSrcset;
+ }
+ getFixedSrcset() {
+ const finalSrcs = DENSITY_SRCSET_MULTIPLIERS.map(multiplier => `${this.callImageLoader({
+ src: this.ngSrc,
+ width: this.width * multiplier
+ })} ${multiplier}x`);
+ return finalSrcs.join(', ');
+ }
+ shouldGenerateAutomaticSrcset() {
+ let oversizedImage = false;
+ if (!this.sizes) {
+ oversizedImage = this.width > FIXED_SRCSET_WIDTH_LIMIT || this.height > FIXED_SRCSET_HEIGHT_LIMIT;
+ }
+ return !this.disableOptimizedSrcset && !this.srcset && this.imageLoader !== noopImageLoader && !oversizedImage;
+ }
+ /** @nodoc */
+ ngOnDestroy() {
+ if (ngDevMode) {
+ if (!this.priority && this._renderedSrc !== null && this.lcpObserver !== null) {
+ this.lcpObserver.unregisterImage(this._renderedSrc);
+ }
+ }
+ }
+ setHostAttribute(name, value) {
+ this.renderer.setAttribute(this.imgElement, name, value);
+ }
+}
+_NgOptimizedImage = NgOptimizedImage;
+_NgOptimizedImage.ɵfac = function _NgOptimizedImage_Factory(t) {
+ return new (t || _NgOptimizedImage)();
+};
+_NgOptimizedImage.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
+ type: _NgOptimizedImage,
+ selectors: [["img", "ngSrc", ""]],
+ hostVars: 8,
+ hostBindings: function _NgOptimizedImage_HostBindings(rf, ctx) {
+ if (rf & 2) {
+ _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵstyleProp"]("position", ctx.fill ? "absolute" : null)("width", ctx.fill ? "100%" : null)("height", ctx.fill ? "100%" : null)("inset", ctx.fill ? "0px" : null);
+ }
+ },
+ inputs: {
+ ngSrc: ["ngSrc", "ngSrc", unwrapSafeUrl],
+ ngSrcset: "ngSrcset",
+ sizes: "sizes",
+ width: ["width", "width", _angular_core__WEBPACK_IMPORTED_MODULE_0__.numberAttribute],
+ height: ["height", "height", _angular_core__WEBPACK_IMPORTED_MODULE_0__.numberAttribute],
+ loading: "loading",
+ priority: ["priority", "priority", _angular_core__WEBPACK_IMPORTED_MODULE_0__.booleanAttribute],
+ loaderParams: "loaderParams",
+ disableOptimizedSrcset: ["disableOptimizedSrcset", "disableOptimizedSrcset", _angular_core__WEBPACK_IMPORTED_MODULE_0__.booleanAttribute],
+ fill: ["fill", "fill", _angular_core__WEBPACK_IMPORTED_MODULE_0__.booleanAttribute],
+ src: "src",
+ srcset: "srcset"
+ },
+ standalone: true,
+ features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInputTransformsFeature"], _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵNgOnChangesFeature"]]
+});
+(function () {
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](NgOptimizedImage, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
+ args: [{
+ standalone: true,
+ selector: 'img[ngSrc]',
+ host: {
+ '[style.position]': 'fill ? "absolute" : null',
+ '[style.width]': 'fill ? "100%" : null',
+ '[style.height]': 'fill ? "100%" : null',
+ '[style.inset]': 'fill ? "0px" : null'
+ }
+ }]
+ }], null, {
+ ngSrc: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: [{
+ required: true,
+ transform: unwrapSafeUrl
}]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_kit_tokens__WEBPACK_IMPORTED_MODULE_4__.TUI_ITEMS_HANDLERS]
+ }],
+ ngSrcset: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }],
+ sizes: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }],
+ width: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: [{
+ transform: _angular_core__WEBPACK_IMPORTED_MODULE_0__.numberAttribute
}]
- }];
- }, {
- placeholder: [{
+ }],
+ height: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: [{
+ transform: _angular_core__WEBPACK_IMPORTED_MODULE_0__.numberAttribute
+ }]
+ }],
+ loading: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}],
- disabledItemHandler: [{
+ priority: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: [{
+ transform: _angular_core__WEBPACK_IMPORTED_MODULE_0__.booleanAttribute
+ }]
+ }],
+ loaderParams: [{
type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}],
- datalist: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChild,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__.TuiDataListDirective, {
- read: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef,
- static: true
+ disableOptimizedSrcset: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: [{
+ transform: _angular_core__WEBPACK_IMPORTED_MODULE_0__.booleanAttribute
}]
}],
- id: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['id']
+ fill: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input,
+ args: [{
+ transform: _angular_core__WEBPACK_IMPORTED_MODULE_0__.booleanAttribute
+ }]
+ }],
+ src: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
+ }],
+ srcset: [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
}]
});
})();
-
+/***** Helpers *****/
/**
- * Generated bundle index. Do not edit.
+ * Sorts provided config breakpoints and uses defaults.
*/
-
-
-
-/***/ }),
-
-/***/ 7585:
-/*!*********************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-classes.js ***!
- \*********************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiDayRangePeriod: () => (/* binding */ TuiDayRangePeriod),
-/* harmony export */ TuiNamedDay: () => (/* binding */ TuiNamedDay),
-/* harmony export */ TuiStringifiableItem: () => (/* binding */ TuiStringifiableItem)
-/* harmony export */ });
-class TuiDayRangePeriod {
- constructor(range, name, content) {
- this.range = range;
- this.name = name;
- this.content = content;
- }
- toString() {
- return this.name;
+function processConfig(config) {
+ let sortedBreakpoints = {};
+ if (config.breakpoints) {
+ sortedBreakpoints.breakpoints = config.breakpoints.sort((a, b) => a - b);
}
+ return Object.assign({}, defaultConfig, config, sortedBreakpoints);
}
-class TuiNamedDay {
- constructor(day, name, displayDay = day) {
- this.day = day;
- this.name = name;
- this.displayDay = displayDay;
- }
- toString() {
- return this.name;
+/***** Assert functions *****/
+/**
+ * Verifies that there is no `src` set on a host element.
+ */
+function assertNoConflictingSrc(dir) {
+ if (dir.src) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2950 /* RuntimeErrorCode.UNEXPECTED_SRC_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \`src\` and \`ngSrc\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`src\` itself based on the value of \`ngSrc\`. ` + `To fix this, please remove the \`src\` attribute.`);
}
}
-
/**
- * Wrapper around an item to add `toString()` method
+ * Verifies that there is no `srcset` set on a host element.
*/
-class TuiStringifiableItem {
- constructor(item, stringify) {
- this.item = item;
- this.stringify = stringify;
- }
- toString() {
- return this.stringify(this.item);
+function assertNoConflictingSrcset(dir) {
+ if (dir.srcset) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2951 /* RuntimeErrorCode.UNEXPECTED_SRCSET_ATTR */, `${imgDirectiveDetails(dir.ngSrc)} both \`srcset\` and \`ngSrcset\` have been set. ` + `Supplying both of these attributes breaks lazy loading. ` + `The NgOptimizedImage directive sets \`srcset\` itself based on the value of ` + `\`ngSrcset\`. To fix this, please remove the \`srcset\` attribute.`);
}
}
-
/**
- * Generated bundle index. Do not edit.
+ * Verifies that the `ngSrc` is not a Base64-encoded image.
*/
-
-
-
-/***/ }),
-
-/***/ 8202:
-/*!**********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-components-accordion.js ***!
- \**********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiAccordionComponent: () => (/* binding */ TuiAccordionComponent),
-/* harmony export */ TuiAccordionItemComponent: () => (/* binding */ TuiAccordionItemComponent),
-/* harmony export */ TuiAccordionItemContentDirective: () => (/* binding */ TuiAccordionItemContentDirective),
-/* harmony export */ TuiAccordionItemEagerContentDirective: () => (/* binding */ TuiAccordionItemEagerContentDirective),
-/* harmony export */ TuiAccordionModule: () => (/* binding */ TuiAccordionModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk */ 8502);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk */ 7507);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! @taiga-ui/cdk */ 7609);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/cdk */ 2143);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! @taiga-ui/cdk */ 6493);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! rxjs */ 870);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! rxjs */ 2337);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! rxjs/operators */ 3246);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! rxjs/operators */ 4406);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! rxjs/operators */ 1856);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! rxjs/operators */ 1082);
-/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! rxjs/operators */ 5213);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/core */ 3442);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/core */ 6434);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! @taiga-ui/core */ 5571);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core */ 3359);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/core */ 2871);
-/* harmony import */ var _taiga_ui_kit_components_arrow__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/kit/components/arrow */ 2889);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-const _c0 = ["focusableElement"];
-function TuiAccordionItemComponent_ng_container_5_tui_svg_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 9);
- }
- if (rf & 2) {
- const src_r5 = ctx.polymorpheusOutlet;
- const ctx_r4 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-icon_open", ctx_r4.open);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", src_r5);
+function assertNotBase64Image(dir) {
+ let ngSrc = dir.ngSrc.trim();
+ if (ngSrc.startsWith('data:')) {
+ if (ngSrc.length > BASE64_IMG_MAX_LENGTH_IN_ERROR) {
+ ngSrc = ngSrc.substring(0, BASE64_IMG_MAX_LENGTH_IN_ERROR) + '...';
+ }
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \`ngSrc\` is a Base64-encoded string ` + `(${ngSrc}). NgOptimizedImage does not support Base64-encoded strings. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a standard \`src\` attribute instead.`);
}
}
-function TuiAccordionItemComponent_ng_container_5_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiAccordionItemComponent_ng_container_5_tui_svg_1_Template, 1, 3, "tui-svg", 8);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const ctx_r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r1.options.iconLarge);
+/**
+ * Verifies that the 'sizes' only includes responsive values.
+ */
+function assertNoComplexSizes(dir) {
+ let sizes = dir.sizes;
+ if (sizes?.match(/((\)|,)\s|^)\d+px/)) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc, false)} \`sizes\` was set to a string including ` + `pixel values. For automatic \`srcset\` generation, \`sizes\` must only include responsive ` + `values, such as \`sizes="50vw"\` or \`sizes="(min-width: 768px) 50vw, 100vw"\`. ` + `To fix this, modify the \`sizes\` attribute, or provide your own \`ngSrcset\` value directly.`);
}
}
-function TuiAccordionItemComponent_ng_template_7_div_0_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
+/**
+ * Verifies that the `ngSrc` is not a Blob URL.
+ */
+function assertNotBlobUrl(dir) {
+ const ngSrc = dir.ngSrc.trim();
+ if (ngSrc.startsWith('blob:')) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrc\` was set to a blob URL (${ngSrc}). ` + `Blob URLs are not supported by the NgOptimizedImage directive. ` + `To fix this, disable the NgOptimizedImage directive for this element ` + `by removing \`ngSrc\` and using a regular \`src\` attribute instead.`);
}
- if (rf & 2) {
- const text_r8 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r8, " ");
+}
+/**
+ * Verifies that the input is set to a non-empty string.
+ */
+function assertNonEmptyInput(dir, name, value) {
+ const isString = typeof value === 'string';
+ const isEmptyString = isString && value.trim() === '';
+ if (!isString || isEmptyString) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`${name}\` has an invalid value ` + `(\`${value}\`). To fix this, change the value to a non-empty string.`);
}
}
-function TuiAccordionItemComponent_ng_template_7_div_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 11);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiAccordionItemComponent_ng_template_7_div_0_ng_container_1_Template, 2, 1, "ng-container", 12);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+/**
+ * Verifies that the `ngSrcset` is in a valid format, e.g. "100w, 200w" or "1x, 2x".
+ */
+function assertValidNgSrcset(dir, value) {
+ if (value == null) return;
+ assertNonEmptyInput(dir, 'ngSrcset', value);
+ const stringVal = value;
+ const isValidWidthDescriptor = VALID_WIDTH_DESCRIPTOR_SRCSET.test(stringVal);
+ const isValidDensityDescriptor = VALID_DENSITY_DESCRIPTOR_SRCSET.test(stringVal);
+ if (isValidDensityDescriptor) {
+ assertUnderDensityCap(dir, stringVal);
}
- if (rf & 2) {
- const ctx_r6 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r6.lazyContent);
+ const isValidSrcset = isValidWidthDescriptor || isValidDensityDescriptor;
+ if (!isValidSrcset) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`ngSrcset\` has an invalid value (\`${value}\`). ` + `To fix this, supply \`ngSrcset\` using a comma-separated list of one or more width ` + `descriptors (e.g. "100w, 200w") or density descriptors (e.g. "1x, 2x").`);
}
}
-function TuiAccordionItemComponent_ng_template_7_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiAccordionItemComponent_ng_template_7_div_0_Template, 2, 1, "div", 10);
- }
- if (rf & 2) {
- const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx_r2.lazyContent);
+function assertUnderDensityCap(dir, value) {
+ const underDensityCap = value.split(',').every(num => num === '' || parseFloat(num) <= ABSOLUTE_SRCSET_DENSITY_CAP);
+ if (!underDensityCap) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` contains an unsupported image density:` + `\`${value}\`. NgOptimizedImage generally recommends a max image density of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}x but supports image densities up to ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x. The human eye cannot distinguish between image densities ` + `greater than ${RECOMMENDED_SRCSET_DENSITY_CAP}x - which makes them unnecessary for ` + `most use cases. Images that will be pinch-zoomed are typically the primary use case for ` + `${ABSOLUTE_SRCSET_DENSITY_CAP}x images. Please remove the high density descriptor and try again.`);
}
}
-function TuiAccordionItemComponent_div_8_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 13);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](1, 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+/**
+ * Creates a `RuntimeError` instance to represent a situation when an input is set after
+ * the directive has initialized.
+ */
+function postInitInputChangeError(dir, inputName) {
+ let reason;
+ if (inputName === 'width' || inputName === 'height') {
+ reason = `Changing \`${inputName}\` may result in different attribute value ` + `applied to the underlying image element and cause layout shifts on a page.`;
+ } else {
+ reason = `Changing the \`${inputName}\` would have no effect on the underlying ` + `image element, because the resource loading has already occurred.`;
}
+ return new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2953 /* RuntimeErrorCode.UNEXPECTED_INPUT_CHANGE */, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` was updated after initialization. ` + `The NgOptimizedImage directive will not react to this input change. ${reason} ` + `To fix this, either switch \`${inputName}\` to a static value ` + `or wrap the image element in an *ngIf that is gated on the necessary value.`);
+}
+/**
+ * Verify that none of the listed inputs has changed.
+ */
+function assertNoPostInitInputChange(dir, changes, inputs) {
+ inputs.forEach(input => {
+ const isUpdated = changes.hasOwnProperty(input);
+ if (isUpdated && !changes[input].isFirstChange()) {
+ if (input === 'ngSrc') {
+ // When the `ngSrc` input changes, we detect that only in the
+ // `ngOnChanges` hook, thus the `ngSrc` is already set. We use
+ // `ngSrc` in the error message, so we use a previous value, but
+ // not the updated one in it.
+ dir = {
+ ngSrc: changes[input].previousValue
+ };
+ }
+ throw postInitInputChangeError(dir, input);
+ }
+ });
}
-const _c1 = ["*", [["", "tuiAccordionItemContent", ""]]];
-const _c2 = ["*", "[tuiAccordionItemContent]"];
-const _c3 = [[["tui-accordion-item"]]];
-const _c4 = ["tui-accordion-item"];
-class TuiAccordionItemContentDirective extends _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_1__.PolymorpheusTemplate {
- constructor(templateRef, cdr) {
- super(templateRef, cdr);
+/**
+ * Verifies that a specified input is a number greater than 0.
+ */
+function assertGreaterThanZero(dir, inputValue, inputName) {
+ const validNumber = typeof inputValue === 'number' && inputValue > 0;
+ const validString = typeof inputValue === 'string' && /^\d+$/.test(inputValue.trim()) && parseInt(inputValue) > 0;
+ if (!validNumber && !validString) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} \`${inputName}\` has an invalid value. ` + `To fix this, provide \`${inputName}\` as a number greater than 0.`);
}
}
-TuiAccordionItemContentDirective.ɵfac = function TuiAccordionItemContentDirective_Factory(t) {
- return new (t || TuiAccordionItemContentDirective)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef, 2), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef));
-};
-TuiAccordionItemContentDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiAccordionItemContentDirective,
- selectors: [["ng-template", "tuiAccordionItemContent", ""]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAccordionItemContentDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: 'ng-template[tuiAccordionItemContent]'
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.TemplateRef]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef]
- }]
- }];
- }, null);
-})();
-class TuiAccordionItemEagerContentDirective {}
-TuiAccordionItemEagerContentDirective.ɵfac = function TuiAccordionItemEagerContentDirective_Factory(t) {
- return new (t || TuiAccordionItemEagerContentDirective)();
-};
-TuiAccordionItemEagerContentDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: TuiAccordionItemEagerContentDirective,
- selectors: [["", "tuiAccordionItemContent", "", 5, "ng-template"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAccordionItemEagerContentDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive,
- args: [{
- selector: '[tuiAccordionItemContent]:not(ng-template)'
- }]
- }], null, null);
-})();
-class TuiAccordionItemComponent extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.AbstractTuiInteractive {
- constructor(cdr, mode$, options) {
- super();
- this.cdr = cdr;
- this.mode$ = mode$;
- this.options = options;
- this.noPadding = false;
- this.showArrow = true;
- this.borders = 'all';
- this.size = 'm';
- this.disabled = false;
- this.disableHover = false;
- this.open = false;
- this.async = false;
- this.openChange = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
- }
- get nativeFocusableElement() {
- return this.disabled || !this.focusableElement ? null : this.focusableElement.nativeElement;
- }
- get focused() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiIsNativeFocused)(this.nativeFocusableElement);
- }
- onFocused(focused) {
- this.updateFocused(focused);
- }
- onRowToggle() {
- if (!this.disabled) {
- this.updateOpen(!this.open);
+/**
+ * Verifies that the rendered image is not visually distorted. Effectively this is checking:
+ * - Whether the "width" and "height" attributes reflect the actual dimensions of the image.
+ * - Whether image styling is "correct" (see below for a longer explanation).
+ */
+function assertNoImageDistortion(dir, img, renderer) {
+ const removeListenerFn = renderer.listen(img, 'load', () => {
+ removeListenerFn();
+ const computedStyle = window.getComputedStyle(img);
+ let renderedWidth = parseFloat(computedStyle.getPropertyValue('width'));
+ let renderedHeight = parseFloat(computedStyle.getPropertyValue('height'));
+ const boxSizing = computedStyle.getPropertyValue('box-sizing');
+ if (boxSizing === 'border-box') {
+ const paddingTop = computedStyle.getPropertyValue('padding-top');
+ const paddingRight = computedStyle.getPropertyValue('padding-right');
+ const paddingBottom = computedStyle.getPropertyValue('padding-bottom');
+ const paddingLeft = computedStyle.getPropertyValue('padding-left');
+ renderedWidth -= parseFloat(paddingRight) + parseFloat(paddingLeft);
+ renderedHeight -= parseFloat(paddingTop) + parseFloat(paddingBottom);
}
- }
- onItemKeyDownEsc(event) {
- if (!this.open) {
- return;
+ const renderedAspectRatio = renderedWidth / renderedHeight;
+ const nonZeroRenderedDimensions = renderedWidth !== 0 && renderedHeight !== 0;
+ const intrinsicWidth = img.naturalWidth;
+ const intrinsicHeight = img.naturalHeight;
+ const intrinsicAspectRatio = intrinsicWidth / intrinsicHeight;
+ const suppliedWidth = dir.width;
+ const suppliedHeight = dir.height;
+ const suppliedAspectRatio = suppliedWidth / suppliedHeight;
+ // Tolerance is used to account for the impact of subpixel rendering.
+ // Due to subpixel rendering, the rendered, intrinsic, and supplied
+ // aspect ratios of a correctly configured image may not exactly match.
+ // For example, a `width=4030 height=3020` image might have a rendered
+ // size of "1062w, 796.48h". (An aspect ratio of 1.334... vs. 1.333...)
+ const inaccurateDimensions = Math.abs(suppliedAspectRatio - intrinsicAspectRatio) > ASPECT_RATIO_TOLERANCE;
+ const stylingDistortion = nonZeroRenderedDimensions && Math.abs(intrinsicAspectRatio - renderedAspectRatio) > ASPECT_RATIO_TOLERANCE;
+ if (inaccurateDimensions) {
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the image does not match ` + `the aspect ratio indicated by the width and height attributes. ` + `\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}). \nSupplied width and height attributes: ` + `${suppliedWidth}w x ${suppliedHeight}h (aspect-ratio: ${round(suppliedAspectRatio)}). ` + `\nTo fix this, update the width and height attributes.`));
+ } else if (stylingDistortion) {
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the aspect ratio of the rendered image ` + `does not match the image's intrinsic aspect ratio. ` + `\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h ` + `(aspect-ratio: ${round(intrinsicAspectRatio)}). \nRendered image size: ` + `${renderedWidth}w x ${renderedHeight}h (aspect-ratio: ` + `${round(renderedAspectRatio)}). \nThis issue can occur if "width" and "height" ` + `attributes are added to an image without updating the corresponding ` + `image styling. To fix this, adjust image styling. In most cases, ` + `adding "height: auto" or "width: auto" to the image styling will fix ` + `this issue.`));
+ } else if (!dir.ngSrcset && nonZeroRenderedDimensions) {
+ // If `ngSrcset` hasn't been set, sanity check the intrinsic size.
+ const recommendedWidth = RECOMMENDED_SRCSET_DENSITY_CAP * renderedWidth;
+ const recommendedHeight = RECOMMENDED_SRCSET_DENSITY_CAP * renderedHeight;
+ const oversizedWidth = intrinsicWidth - recommendedWidth >= OVERSIZED_IMAGE_TOLERANCE;
+ const oversizedHeight = intrinsicHeight - recommendedHeight >= OVERSIZED_IMAGE_TOLERANCE;
+ if (oversizedWidth || oversizedHeight) {
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2960 /* RuntimeErrorCode.OVERSIZED_IMAGE */, `${imgDirectiveDetails(dir.ngSrc)} the intrinsic image is significantly ` + `larger than necessary. ` + `\nRendered image size: ${renderedWidth}w x ${renderedHeight}h. ` + `\nIntrinsic image size: ${intrinsicWidth}w x ${intrinsicHeight}h. ` + `\nRecommended intrinsic image size: ${recommendedWidth}w x ${recommendedHeight}h. ` + `\nNote: Recommended intrinsic image size is calculated assuming a maximum DPR of ` + `${RECOMMENDED_SRCSET_DENSITY_CAP}. To improve loading time, resize the image ` + `or consider using the "ngSrcset" and "sizes" attributes.`));
+ }
}
- event.stopPropagation();
- this.updateOpen(false);
- }
- close() {
- this.updateOpen(false);
- this.cdr.markForCheck();
+ });
+}
+/**
+ * Verifies that a specified input is set.
+ */
+function assertNonEmptyWidthAndHeight(dir) {
+ let missingAttributes = [];
+ if (dir.width === undefined) missingAttributes.push('width');
+ if (dir.height === undefined) missingAttributes.push('height');
+ if (missingAttributes.length > 0) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2954 /* RuntimeErrorCode.REQUIRED_INPUT_MISSING */, `${imgDirectiveDetails(dir.ngSrc)} these required attributes ` + `are missing: ${missingAttributes.map(attr => `"${attr}"`).join(', ')}. ` + `Including "width" and "height" attributes will prevent image-related layout shifts. ` + `To fix this, include "width" and "height" attributes on the image tag or turn on ` + `"fill" mode with the \`fill\` attribute.`);
}
- updateOpen(open) {
- if (this.open === open) {
- return;
- }
- this.open = open;
- this.openChange.emit(open);
+}
+/**
+ * Verifies that width and height are not set. Used in fill mode, where those attributes don't make
+ * sense.
+ */
+function assertEmptyWidthAndHeight(dir) {
+ if (dir.width || dir.height) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the attributes \`height\` and/or \`width\` are present ` + `along with the \`fill\` attribute. Because \`fill\` mode causes an image to fill its containing ` + `element, the size attributes have no effect and should be removed.`);
}
}
-TuiAccordionItemComponent.ɵfac = function TuiAccordionItemComponent_Factory(t) {
- return new (t || TuiAccordionItemComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_MODE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_kit_components_arrow__WEBPACK_IMPORTED_MODULE_5__.TUI_ARROW_OPTIONS));
-};
-TuiAccordionItemComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiAccordionItemComponent,
- selectors: [["tui-accordion-item"]],
- contentQueries: function TuiAccordionItemComponent_ContentQueries(rf, ctx, dirIndex) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵcontentQuery"](dirIndex, TuiAccordionItemEagerContentDirective, 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵcontentQuery"](dirIndex, TuiAccordionItemContentDirective, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.eagerContent = _t.first);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.lazyContent = _t.first);
- }
- },
- viewQuery: function TuiAccordionItemComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_c0, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.focusableElement = _t.first);
- }
- },
- hostVars: 8,
- hostBindings: function TuiAccordionItemComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("$.data-mode.attr", function TuiAccordionItemComponent___data_mode_attr_HostBindingHandler() {
- return ctx.mode$;
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵattribute"]("data-borders", ctx.borders)("data-size", ctx.size);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_no-padding", ctx.noPadding)("_has-arrow", ctx.showArrow)("_disabled", ctx.disabled);
- }
- },
- inputs: {
- noPadding: "noPadding",
- showArrow: "showArrow",
- borders: "borders",
- size: "size",
- disabled: "disabled",
- disableHover: "disableHover",
- open: "open",
- async: "async"
- },
- outputs: {
- openChange: "openChange"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.tuiAsFocusableItemAccessor)(TuiAccordionItemComponent), _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.MODE_PROVIDER]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]],
- ngContentSelectors: _c2,
- decls: 9,
- vars: 10,
- consts: [["automation-id", "tui-accordion__item-wrapper", 1, "t-wrapper"], ["automation-id", "tui-accordion__item-header", "type", "button", 1, "t-header", 3, "disabled", "tuiFocusable", "click", "keydown.esc", "tuiFocusedChange"], ["focusableElement", ""], ["automation-id", "tui-accordion__item-title", 1, "t-title"], [4, "ngIf"], [3, "async", "expanded"], ["tuiExpandContent", ""], ["class", "t-content", 4, "ngIf"], ["automation-id", "tui-accordion__item-arrow", "class", "t-icon", 3, "t-icon_open", "src", 4, "polymorpheusOutlet"], ["automation-id", "tui-accordion__item-arrow", 1, "t-icon", 3, "src"], ["automation-id", "tui-accordion__item-content", "class", "t-content", 4, "ngIf"], ["automation-id", "tui-accordion__item-content", 1, "t-content"], [4, "polymorpheusOutlet"], [1, "t-content"]],
- template: function TuiAccordionItemComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"](_c1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0)(1, "button", 1, 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function TuiAccordionItemComponent_Template_button_click_1_listener() {
- return ctx.onRowToggle();
- })("keydown.esc", function TuiAccordionItemComponent_Template_button_keydown_esc_1_listener($event) {
- return ctx.onItemKeyDownEsc($event);
- })("tuiFocusedChange", function TuiAccordionItemComponent_Template_button_tuiFocusedChange_1_listener($event) {
- return ctx.onFocused($event);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](3, "span", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](5, TuiAccordionItemComponent_ng_container_5_Template, 2, 1, "ng-container", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](6, "tui-expand", 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](7, TuiAccordionItemComponent_ng_template_7_Template, 1, 1, "ng-template", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](8, TuiAccordionItemComponent_div_8_Template, 2, 0, "div", 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("t-header_hoverable", !ctx.disableHover)("t-header_open", ctx.open);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("disabled", ctx.computedDisabled)("tuiFocusable", ctx.computedFocusable);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.showArrow);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("async", ctx.async)("expanded", ctx.open);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.eagerContent);
+/**
+ * Verifies that the rendered image has a nonzero height. If the image is in fill mode, provides
+ * guidance that this can be caused by the containing element's CSS position property.
+ */
+function assertNonZeroRenderedHeight(dir, img, renderer) {
+ const removeListenerFn = renderer.listen(img, 'load', () => {
+ removeListenerFn();
+ const renderedHeight = img.clientHeight;
+ if (dir.fill && renderedHeight === 0) {
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the height of the fill-mode image is zero. ` + `This is likely because the containing element does not have the CSS 'position' ` + `property set to one of the following: "relative", "fixed", or "absolute". ` + `To fix this problem, make sure the container element has the CSS 'position' ` + `property defined and the height of the element is not zero.`));
}
- },
- dependencies: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__.TuiSvgComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__.TuiExpandComponent, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.TuiFocusableDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiFocusedDirective, _angular_common__WEBPACK_IMPORTED_MODULE_12__.NgIf, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_1__.PolymorpheusOutletDirective, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__.TuiExpandContentDirective],
- styles: ["[_nghost-%COMP%]{position:relative;display:block;overflow:hidden;border-radius:var(--tui-radius-l)}[data-borders=top-bottom][_nghost-%COMP%]{border-radius:0!important}.t-wrapper[_ngcontent-%COMP%]{position:relative;border-radius:inherit}.t-wrapper[_ngcontent-%COMP%]:after{position:absolute;top:0;left:0;width:100%;height:100%;content:\"\";box-sizing:border-box;border-radius:inherit;border:1px solid var(--tui-base-04);pointer-events:none}[_nghost-%COMP%]:not([data-borders]) .t-wrapper[_ngcontent-%COMP%]:after{border-width:0}[data-borders=all][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]:after{border-width:1px}[data-borders=top-bottom][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]:after{border-left-width:0;border-right-width:0}[data-borders=top][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]:after{border-left-width:0;border-right-width:0;border-bottom-width:0}[data-borders=bottom][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]:after{border-left-width:0;border-right-width:0;border-top-width:0}[data-mode=onDark][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]:after{border-color:var(--tui-base-03)}[data-mode=onLight][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]:after{border-color:var(--tui-text-01)}[_nghost-%COMP%]:not([data-mode]) .t-wrapper[_ngcontent-%COMP%]{background:var(--tui-base-01)}.t-header[_ngcontent-%COMP%]{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:0;background:none;font-size:inherit;line-height:inherit;text-decoration:none;transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:flex;width:100%;font:var(--tui-font-text-l);align-items:center;box-sizing:border-box;border-bottom:1px solid var(--tui-base-04);min-height:var(--tui-height-l);padding:.75rem 1.25rem;color:var(--tui-text-01);cursor:pointer;text-align:left;outline:none}.t-header[_ngcontent-%COMP%]:focus-visible{box-shadow:inset 0 0 0 2px var(--tui-focus)}[data-mode=onDark][_nghost-%COMP%] .t-header[_ngcontent-%COMP%]{color:var(--tui-text-01-night);border-color:var(--tui-base-03)}[data-mode=onLight][_nghost-%COMP%] .t-header[_ngcontent-%COMP%]{border-color:var(--tui-text-01)}[_nghost-%COMP%]:not([data-borders]) .t-header[_ngcontent-%COMP%]{border-bottom-width:0;box-shadow:none}._has-arrow[_nghost-%COMP%] .t-header[_ngcontent-%COMP%]{padding-right:.75rem}[data-mode=onDark][_nghost-%COMP%] .t-header_open[_ngcontent-%COMP%]{background:var(--tui-clear-inverse)}[data-mode=onLight][_nghost-%COMP%] .t-header_open[_ngcontent-%COMP%]{background:var(--tui-clear)}[data-size=s][_nghost-%COMP%] .t-header[_ngcontent-%COMP%]{font:var(--tui-font-text-m);min-height:var(--tui-height-m);padding:.625rem .75rem .625rem 1rem}._no-padding[_nghost-%COMP%] .t-header[_ngcontent-%COMP%]{padding-left:0;padding-right:0}._disabled[_nghost-%COMP%] .t-header[_ngcontent-%COMP%]{cursor:default}.t-wrapper[_ngcontent-%COMP%]:hover:not([data-mode]) > .t-header_hoverable[_ngcontent-%COMP%]{background:var(--tui-base-02)}.t-wrapper[_ngcontent-%COMP%]:hover[data-mode=onDark] > .t-header_hoverable[_ngcontent-%COMP%]{background:var(--tui-clear-inverse)}.t-wrapper[_ngcontent-%COMP%]:hover[data-mode=onLight] > .t-header_hoverable[_ngcontent-%COMP%]{background:var(--tui-clear)}.t-title[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis;margin-right:0;flex-grow:1}._has-arrow[_nghost-%COMP%] .t-title[_ngcontent-%COMP%]{margin-right:.5rem}.t-icon[_ngcontent-%COMP%]{transition-property:transform,color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;width:1.5rem;height:1.5rem;margin-left:auto;color:var(--tui-base-06)}.t-icon_open[_ngcontent-%COMP%]{transform:rotate(180deg)}[data-mode][_nghost-%COMP%] .t-icon[_ngcontent-%COMP%]{opacity:var(--tui-disabled-opacity)}[_nghost-%COMP%]:hover[data-mode] .t-icon[_ngcontent-%COMP%]{opacity:.8}[data-mode=onDark][_nghost-%COMP%] .t-icon[_ngcontent-%COMP%]{color:var(--tui-text-01-night)}[data-mode=onLight][_nghost-%COMP%] .t-icon[_ngcontent-%COMP%]{color:var(--tui-text-01)}[_nghost-%COMP%]:hover:not([data-mode]) .t-icon[_ngcontent-%COMP%]{color:var(--tui-base-07)}.t-content[_ngcontent-%COMP%]{font:var(--tui-font-text-m);padding:1.25rem;word-wrap:break-word}[data-size=s][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{font:var(--tui-font-text-s);padding:1rem}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAccordionItemComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-accordion-item',
- templateUrl: './accordion-item.template.html',
- styleUrls: ['./accordion-item.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.tuiAsFocusableItemAccessor)(TuiAccordionItemComponent), _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.MODE_PROVIDER],
- host: {
- '($.data-mode.attr)': 'mode$'
- }
- }]
- }], function () {
- return [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectorRef]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_13__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_MODE]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_kit_components_arrow__WEBPACK_IMPORTED_MODULE_5__.TUI_ARROW_OPTIONS]
- }]
- }];
- }, {
- focusableElement: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChild,
- args: ['focusableElement']
- }],
- noPadding: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._no-padding']
- }],
- showArrow: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._has-arrow']
- }],
- borders: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-borders']
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['attr.data-size']
- }],
- disabled: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._disabled']
- }],
- disableHover: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- open: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- async: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- openChange: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output
- }],
- eagerContent: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ContentChild,
- args: [TuiAccordionItemEagerContentDirective]
- }],
- lazyContent: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ContentChild,
- args: [TuiAccordionItemContentDirective]
- }]
});
-})();
-class TuiAccordionComponent {
- constructor(destroy$) {
- this.destroy$ = destroy$;
- this.closeOthers = true;
- this.rounded = true;
- this.accordionItems = _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_14__.EMPTY_QUERY;
+}
+/**
+ * Verifies that the `loading` attribute is set to a valid input &
+ * is not used on priority images.
+ */
+function assertValidLoadingInput(dir) {
+ if (dir.loading && dir.priority) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `was used on an image that was marked "priority". ` + `Setting \`loading\` on priority images is not allowed ` + `because these images will always be eagerly loaded. ` + `To fix this, remove the “loading” attribute from the priority image.`);
}
- ngAfterContentInit() {
- const {
- accordionItems
- } = this;
- const rows$ = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_15__.tuiQueryListChanges)(accordionItems);
- const newOpenRow$ = rows$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_16__.pairwise)(), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.map)(([previous, current]) => current.find(item => !previous.includes(item) && item.open)), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.filter)(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_19__.tuiIsPresent));
- const rowsOpen$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_20__.merge)(rows$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_21__.switchMap)(rows => (0,rxjs__WEBPACK_IMPORTED_MODULE_20__.merge)(...rows.map(row => row.openChange.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.filter)(rxjs__WEBPACK_IMPORTED_MODULE_22__.identity), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_17__.map)(() => row)))))), newOpenRow$).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_18__.filter)(() => this.closeOthers), (0,rxjs_operators__WEBPACK_IMPORTED_MODULE_23__.takeUntil)(this.destroy$));
- rowsOpen$.subscribe(currentRow => {
- accordionItems.forEach(row => {
- if (currentRow !== row) {
- row.close();
- }
- });
- });
+ const validInputs = ['auto', 'eager', 'lazy'];
+ if (typeof dir.loading === 'string' && !validInputs.includes(dir.loading)) {
+ throw new _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵRuntimeError"](2952 /* RuntimeErrorCode.INVALID_INPUT */, `${imgDirectiveDetails(dir.ngSrc)} the \`loading\` attribute ` + `has an invalid value (\`${dir.loading}\`). ` + `To fix this, provide a valid value ("lazy", "eager", or "auto").`);
}
}
-TuiAccordionComponent.ɵfac = function TuiAccordionComponent_Factory(t) {
- return new (t || TuiAccordionComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiDestroyService, 2));
-};
-TuiAccordionComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiAccordionComponent,
- selectors: [["tui-accordion"]],
- contentQueries: function TuiAccordionComponent_ContentQueries(rf, ctx, dirIndex) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵcontentQuery"](dirIndex, TuiAccordionItemComponent, 4);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.accordionItems = _t);
- }
- },
- inputs: {
- closeOthers: "closeOthers",
- rounded: "rounded"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiDestroyService])],
- ngContentSelectors: _c4,
- decls: 2,
- vars: 2,
- consts: [["automation-id", "tui-accordion__group", "orientation", "vertical", "size", "l", "tuiGroup", "", 1, "t-group", 3, "collapsed", "rounded"]],
- template: function TuiAccordionComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojectionDef"](_c3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "div", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵprojection"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+/**
+ * Warns if NOT using a loader (falling back to the generic loader) and
+ * the image appears to be hosted on one of the image CDNs for which
+ * we do have a built-in image loader. Suggests switching to the
+ * built-in loader.
+ *
+ * @param ngSrc Value of the ngSrc attribute
+ * @param imageLoader ImageLoader provided
+ */
+function assertNotMissingBuiltInLoader(ngSrc, imageLoader) {
+ if (imageLoader === noopImageLoader) {
+ let builtInLoaderName = '';
+ for (const loader of BUILT_IN_LOADERS) {
+ if (loader.testUrl(ngSrc)) {
+ builtInLoaderName = loader.name;
+ break;
+ }
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("collapsed", true)("rounded", ctx.rounded);
+ if (builtInLoaderName) {
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2962 /* RuntimeErrorCode.MISSING_BUILTIN_LOADER */, `NgOptimizedImage: It looks like your images may be hosted on the ` + `${builtInLoaderName} CDN, but your app is not using Angular's ` + `built-in loader for that CDN. We recommend switching to use ` + `the built-in by calling \`provide${builtInLoaderName}Loader()\` ` + `in your \`providers\` and passing it your instance's base URL. ` + `If you don't want to use the built-in loader, define a custom ` + `loader function using IMAGE_LOADER to silence this warning.`));
}
- },
- dependencies: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_25__.TuiGroupDirective],
- styles: ["[_nghost-%COMP%]{display:block}.t-group[_ngcontent-%COMP%]{display:flex;align-items:stretch}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAccordionComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-accordion',
- templateUrl: './accordion.template.html',
- styleUrls: ['./accordion.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiDestroyService]
- }]
- }], function () {
- return [{
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiDestroyService,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_24__.TuiDestroyService]
- }]
- }];
- }, {
- closeOthers: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- rounded: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- accordionItems: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ContentChildren,
- args: [TuiAccordionItemComponent]
- }]
- });
-})();
-class TuiAccordionModule {}
-TuiAccordionModule.ɵfac = function TuiAccordionModule_Factory(t) {
- return new (t || TuiAccordionModule)();
-};
-TuiAccordionModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiAccordionModule
-});
-TuiAccordionModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_12__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiFocusedModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.TuiFocusVisibleModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.TuiFocusableModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_1__.PolymorpheusModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__.TuiSvgModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_25__.TuiGroupModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__.TuiExpandModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiAccordionModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_12__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiFocusedModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_26__.TuiFocusVisibleModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.TuiFocusableModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_1__.PolymorpheusModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__.TuiSvgModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_25__.TuiGroupModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__.TuiExpandModule],
- declarations: [TuiAccordionComponent, TuiAccordionItemComponent, TuiAccordionItemContentDirective, TuiAccordionItemEagerContentDirective],
- exports: [TuiAccordionComponent, TuiAccordionItemComponent, TuiAccordionItemContentDirective, TuiAccordionItemEagerContentDirective]
- }]
- }], null, null);
-})();
+ }
+}
+/**
+ * Warns if ngSrcset is present and no loader is configured (i.e. the default one is being used).
+ */
+function assertNoNgSrcsetWithoutLoader(dir, imageLoader) {
+ if (dir.ngSrcset && imageLoader === noopImageLoader) {
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \`ngSrcset\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which would result in the same image being used for all configured sizes. ` + `To fix this, provide a loader or remove the \`ngSrcset\` attribute from the image.`));
+ }
+}
+/**
+ * Warns if loaderParams is present and no loader is configured (i.e. the default one is being
+ * used).
+ */
+function assertNoLoaderParamsWithoutLoader(dir, imageLoader) {
+ if (dir.loaderParams && imageLoader === noopImageLoader) {
+ console.warn((0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵformatRuntimeError"])(2963 /* RuntimeErrorCode.MISSING_NECESSARY_LOADER */, `${imgDirectiveDetails(dir.ngSrc)} the \`loaderParams\` attribute is present but ` + `no image loader is configured (i.e. the default one is being used), ` + `which means that the loaderParams data will not be consumed and will not affect the URL. ` + `To fix this, provide a custom loader or remove the \`loaderParams\` attribute from the image.`));
+ }
+}
+function round(input) {
+ return Number.isInteger(input) ? input : input.toFixed(2);
+}
+// Transform function to handle SafeValue input for ngSrc. This doesn't do any sanitization,
+// as that is not needed for img.src and img.srcset. This transform is purely for compatibility.
+function unwrapSafeUrl(value) {
+ if (typeof value === 'string') {
+ return value;
+ }
+ return (0,_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵunwrapSafeValue"])(value);
+}
+
+// These exports represent the set of symbols exposed as a public API.
+
+/**
+ * @module
+ * @description
+ * Entry point for all public APIs of the common package.
+ */
+
+/**
+ * @module
+ * @description
+ * Entry point for all public APIs of this package.
+ */
+// This file only reexports content of the `src` folder. Keep it that way.
+
+// This file is not used to build this module. It is only used during editing
/**
* Generated bundle index. Do not edit.
@@ -30860,34 +21815,70 @@ TuiAccordionModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE
/***/ }),
-/***/ 2889:
-/*!******************************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-components-arrow.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
+/***/ 7008:
+/*!********************************************************!*\
+ !*** ./node_modules/@angular/common/fesm2022/http.mjs ***!
+ \********************************************************/
+/***/ ((__unused_webpack___webpack_module__, __webpack_exports__, __webpack_require__) => {
__webpack_require__.r(__webpack_exports__);
/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_ARROW: () => (/* binding */ TUI_ARROW),
-/* harmony export */ TUI_ARROW_DEFAULT_MODE: () => (/* binding */ TUI_ARROW_DEFAULT_MODE),
-/* harmony export */ TUI_ARROW_DEFAULT_OPTIONS: () => (/* binding */ TUI_ARROW_DEFAULT_OPTIONS),
-/* harmony export */ TUI_ARROW_MODE: () => (/* binding */ TUI_ARROW_MODE),
-/* harmony export */ TUI_ARROW_OPTIONS: () => (/* binding */ TUI_ARROW_OPTIONS),
-/* harmony export */ TuiArrowComponent: () => (/* binding */ TuiArrowComponent),
-/* harmony export */ TuiArrowModule: () => (/* binding */ TuiArrowModule),
-/* harmony export */ tuiArrowModeProvider: () => (/* binding */ tuiArrowModeProvider),
-/* harmony export */ tuiArrowOptionsProvider: () => (/* binding */ tuiArrowOptionsProvider)
+/* harmony export */ FetchBackend: () => (/* binding */ FetchBackend),
+/* harmony export */ HTTP_INTERCEPTORS: () => (/* binding */ HTTP_INTERCEPTORS),
+/* harmony export */ HttpBackend: () => (/* binding */ HttpBackend),
+/* harmony export */ HttpClient: () => (/* binding */ HttpClient),
+/* harmony export */ HttpClientJsonpModule: () => (/* binding */ HttpClientJsonpModule),
+/* harmony export */ HttpClientModule: () => (/* binding */ HttpClientModule),
+/* harmony export */ HttpClientXsrfModule: () => (/* binding */ HttpClientXsrfModule),
+/* harmony export */ HttpContext: () => (/* binding */ HttpContext),
+/* harmony export */ HttpContextToken: () => (/* binding */ HttpContextToken),
+/* harmony export */ HttpErrorResponse: () => (/* binding */ HttpErrorResponse),
+/* harmony export */ HttpEventType: () => (/* binding */ HttpEventType),
+/* harmony export */ HttpFeatureKind: () => (/* binding */ HttpFeatureKind),
+/* harmony export */ HttpHandler: () => (/* binding */ HttpHandler),
+/* harmony export */ HttpHeaderResponse: () => (/* binding */ HttpHeaderResponse),
+/* harmony export */ HttpHeaders: () => (/* binding */ HttpHeaders),
+/* harmony export */ HttpParams: () => (/* binding */ HttpParams),
+/* harmony export */ HttpRequest: () => (/* binding */ HttpRequest),
+/* harmony export */ HttpResponse: () => (/* binding */ HttpResponse),
+/* harmony export */ HttpResponseBase: () => (/* binding */ HttpResponseBase),
+/* harmony export */ HttpUrlEncodingCodec: () => (/* binding */ HttpUrlEncodingCodec),
+/* harmony export */ HttpXhrBackend: () => (/* binding */ HttpXhrBackend),
+/* harmony export */ HttpXsrfTokenExtractor: () => (/* binding */ HttpXsrfTokenExtractor),
+/* harmony export */ JsonpClientBackend: () => (/* binding */ JsonpClientBackend),
+/* harmony export */ JsonpInterceptor: () => (/* binding */ JsonpInterceptor),
+/* harmony export */ provideHttpClient: () => (/* binding */ provideHttpClient),
+/* harmony export */ withFetch: () => (/* binding */ withFetch),
+/* harmony export */ withInterceptors: () => (/* binding */ withInterceptors),
+/* harmony export */ withInterceptorsFromDi: () => (/* binding */ withInterceptorsFromDi),
+/* harmony export */ withJsonpSupport: () => (/* binding */ withJsonpSupport),
+/* harmony export */ withNoXsrfProtection: () => (/* binding */ withNoXsrfProtection),
+/* harmony export */ withRequestsMadeViaParent: () => (/* binding */ withRequestsMadeViaParent),
+/* harmony export */ withXsrfConfiguration: () => (/* binding */ withXsrfConfiguration),
+/* harmony export */ "ɵHttpInterceptingHandler": () => (/* binding */ HttpInterceptorHandler),
+/* harmony export */ "ɵHttpInterceptorHandler": () => (/* binding */ HttpInterceptorHandler),
+/* harmony export */ "ɵwithHttpTransferCache": () => (/* binding */ withHttpTransferCache)
/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/core */ 3442);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core */ 1443);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core */ 1460);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core */ 2189);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @angular/common */ 9191);
-
+/* harmony import */ var _home_runner_work_ng_morph_ng_morph_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./node_modules/@babel/runtime/helpers/esm/asyncToGenerator.js */ 6207);
+/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/core */ 6623);
+/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! rxjs */ 3901);
+/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! rxjs */ 4517);
+/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 3496);
+/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! rxjs/operators */ 5214);
+/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! rxjs/operators */ 1856);
+/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs/operators */ 4406);
+/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! rxjs/operators */ 9848);
+/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! rxjs/operators */ 1082);
+/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! rxjs/operators */ 1969);
+/* harmony import */ var rxjs_operators__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! rxjs/operators */ 3782);
+/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/common */ 9191);
+var _HttpClient, _FetchBackend, _HttpInterceptorHandler, _JsonpClientBackend, _JsonpInterceptor, _HttpXhrBackend, _HttpXsrfCookieExtractor, _HttpXsrfInterceptor, _HttpClientXsrfModule, _HttpClientModule, _HttpClientJsonpModule;
+/**
+ * @license Angular v16.2.12
+ * (c) 2010-2022 Google LLC. https://angular.io/
+ * License: MIT
+ */
@@ -30896,67832 +21887,68332 @@ __webpack_require__.r(__webpack_exports__);
-/** Default values for arrow options */
-function TuiArrowComponent_tui_svg_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-svg", 2);
- }
- if (rf & 2) {
- const src_r2 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("src", src_r2);
- }
-}
-function TuiArrowComponent_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainer"](0);
- }
-}
-const TUI_ARROW_DEFAULT_OPTIONS = {
- iconSmall: 'tuiIconChevronDown',
- iconLarge: 'tuiIconChevronDownLarge'
-};
/**
- * Default parameters for arrow component
- */
-const TUI_ARROW_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)(TUI_ARROW_DEFAULT_OPTIONS);
-function tuiArrowOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiProvideOptions)(TUI_ARROW_OPTIONS, options, TUI_ARROW_DEFAULT_OPTIONS);
-}
-class TuiArrowComponent {
- constructor(dropdown, textfieldSize, options) {
- this.dropdown = dropdown;
- this.textfieldSize = textfieldSize;
- this.options = options;
- }
- get rotated() {
- return this.dropdown.open;
- }
- get arrowIcon() {
- return (0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_2__.tuiSizeBigger)(this.textfieldSize.size) ? this.options.iconLarge : this.options.iconSmall;
- }
-}
-TuiArrowComponent.ɵfac = function TuiArrowComponent_Factory(t) {
- return new (t || TuiArrowComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__.TuiHostedDropdownComponent), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_TEXTFIELD_SIZE), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](TUI_ARROW_OPTIONS));
-};
-TuiArrowComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiArrowComponent,
- selectors: [["tui-arrow"]],
- hostVars: 2,
- hostBindings: function TuiArrowComponent_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵclassProp"]("_rotated", ctx.rotated);
- }
- },
- decls: 3,
- vars: 4,
- consts: [[3, "src", 4, "polymorpheusOutlet"], [4, "ngIf"], [3, "src"]],
- template: function TuiArrowComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiArrowComponent_tui_svg_0_Template, 1, 1, "tui-svg", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiArrowComponent_ng_container_1_Template, 1, 0, "ng-container", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipe"](2, "async");
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx.arrowIcon);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵpipeBind1"](2, 2, ctx.dropdown.openChange));
- }
- },
- dependencies: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__.TuiSvgComponent, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_7__.NgIf, _angular_common__WEBPACK_IMPORTED_MODULE_7__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{transition-property:transform;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;display:block;cursor:pointer;pointer-events:none}._rotated[_nghost-%COMP%]{transform:rotate(180deg)}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiArrowComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-arrow',
- templateUrl: './arrow.template.html',
- styleUrls: ['./arrow.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush
- }]
- }], function () {
- return [{
- type: _taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__.TuiHostedDropdownComponent,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__.TuiHostedDropdownComponent]
- }]
- }, {
- type: _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiTextfieldSizeDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_TEXTFIELD_SIZE]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [TUI_ARROW_OPTIONS]
- }]
- }];
- }, {
- rotated: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.HostBinding,
- args: ['class._rotated']
- }]
- });
-})();
-const TUI_ARROW = new _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusComponent(TuiArrowComponent);
-class TuiArrowModule {}
-TuiArrowModule.ɵfac = function TuiArrowModule_Factory(t) {
- return new (t || TuiArrowModule)();
-};
-TuiArrowModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiArrowModule
-});
-TuiArrowModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_7__.CommonModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__.TuiSvgModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiArrowModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_7__.CommonModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__.TuiSvgModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_6__.PolymorpheusModule],
- declarations: [TuiArrowComponent],
- exports: [TuiArrowComponent]
- }]
- }], null, null);
-})();
-const TUI_ARROW_DEFAULT_MODE = {
- interactive: TUI_ARROW,
- disabled: TUI_ARROW
-};
+ * Transforms an `HttpRequest` into a stream of `HttpEvent`s, one of which will likely be a
+ * `HttpResponse`.
+ *
+ * `HttpHandler` is injectable. When injected, the handler instance dispatches requests to the
+ * first interceptor in the chain, which dispatches to the second, etc, eventually reaching the
+ * `HttpBackend`.
+ *
+ * In an `HttpInterceptor`, the `HttpHandler` parameter is the next interceptor in the chain.
+ *
+ * @publicApi
+ */
+class HttpHandler {}
/**
- * Type of icon in dropdowns for interactive or disable mode
+ * A final `HttpHandler` which will dispatch the request via browser HTTP APIs to a backend.
+ *
+ * Interceptors sit between the `HttpClient` interface and the `HttpBackend`.
+ *
+ * When injected, `HttpBackend` dispatches requests directly to the backend, without going
+ * through the interceptor chain.
+ *
+ * @publicApi
*/
-const TUI_ARROW_MODE = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiCreateToken)(TUI_ARROW_DEFAULT_MODE);
-function tuiArrowModeProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiProvideOptions)(TUI_ARROW_MODE, options, TUI_ARROW_DEFAULT_MODE);
-}
+class HttpBackend {}
/**
- * Generated bundle index. Do not edit.
+ * Represents the header configuration options for an HTTP request.
+ * Instances are immutable. Modifying methods return a cloned
+ * instance with the change. The original object is never changed.
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 7655:
-/*!******************************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-components-badge.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiBadgeComponent: () => (/* binding */ TuiBadgeComponent),
-/* harmony export */ TuiBadgeModule: () => (/* binding */ TuiBadgeModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/core */ 3359);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/core */ 2871);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-const _c0 = ["*"];
-class TuiBadgeComponent {
- constructor(mode$) {
- this.mode$ = mode$;
- this.size = 'm';
- this.status = 'default';
- this.hoverable = false;
- }
- get padding() {
- var _a;
- if (this.isEmpty) {
- return 'none';
+class HttpHeaders {
+ /** Constructs a new HTTP header object with the given values.*/
+ constructor(headers) {
+ /**
+ * Internal map of lowercased header names to the normalized
+ * form of the name (the form seen first).
+ */
+ this.normalizedNames = new Map();
+ /**
+ * Queued updates to be materialized the next initialization.
+ */
+ this.lazyUpdate = null;
+ if (!headers) {
+ this.headers = new Map();
+ } else if (typeof headers === 'string') {
+ this.lazyInit = () => {
+ this.headers = new Map();
+ headers.split('\n').forEach(line => {
+ const index = line.indexOf(':');
+ if (index > 0) {
+ const name = line.slice(0, index);
+ const key = name.toLowerCase();
+ const value = line.slice(index + 1).trim();
+ this.maybeSetNormalizedName(name, key);
+ if (this.headers.has(key)) {
+ this.headers.get(key).push(value);
+ } else {
+ this.headers.set(key, [value]);
+ }
+ }
+ });
+ };
+ } else if (typeof Headers !== 'undefined' && headers instanceof Headers) {
+ this.headers = new Map();
+ headers.forEach((values, name) => {
+ this.setHeaderEntries(name, values);
+ });
+ } else {
+ this.lazyInit = () => {
+ if (typeof ngDevMode === 'undefined' || ngDevMode) {
+ assertValidHeaders(headers);
+ }
+ this.headers = new Map();
+ Object.entries(headers).forEach(([name, values]) => {
+ this.setHeaderEntries(name, values);
+ });
+ };
}
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiIsNumber)((_a = this.value) === null || _a === void 0 ? void 0 : _a.valueOf()) ? 'm' : 'l';
}
- get outputValue() {
- var _a;
- const value = (_a = this.value) === null || _a === void 0 ? void 0 : _a.valueOf();
- if ((0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiIsNumber)(value) && value > 99) {
- return '99+';
- }
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiIsPresent)(this.value) ? String(this.value) : '';
+ /**
+ * Checks for existence of a given header.
+ *
+ * @param name The header name to check for existence.
+ *
+ * @returns True if the header exists, false otherwise.
+ */
+ has(name) {
+ this.init();
+ return this.headers.has(name.toLowerCase());
}
- get isEmpty() {
- return !this.value && this.value !== 0;
+ /**
+ * Retrieves the first value of a given header.
+ *
+ * @param name The header name.
+ *
+ * @returns The value string if the header exists, null otherwise
+ */
+ get(name) {
+ this.init();
+ const values = this.headers.get(name.toLowerCase());
+ return values && values.length > 0 ? values[0] : null;
}
- titleText({
- offsetWidth,
- scrollWidth
- }) {
- return offsetWidth < scrollWidth ? this.outputValue : '';
+ /**
+ * Retrieves the names of the headers.
+ *
+ * @returns A list of header names.
+ */
+ keys() {
+ this.init();
+ return Array.from(this.normalizedNames.values());
}
-}
-TuiBadgeComponent.ɵfac = function TuiBadgeComponent_Factory(t) {
- return new (t || TuiBadgeComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_2__.TUI_MODE));
-};
-TuiBadgeComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({
- type: TuiBadgeComponent,
- selectors: [["tui-badge"]],
- hostVars: 7,
- hostBindings: function TuiBadgeComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("$.data-mode.attr", function TuiBadgeComponent___data_mode_attr_HostBindingHandler() {
- return ctx.mode$;
- });
+ /**
+ * Retrieves a list of values for a given header.
+ *
+ * @param name The header name from which to retrieve values.
+ *
+ * @returns A string of values if the header exists, null otherwise.
+ */
+ getAll(name) {
+ this.init();
+ return this.headers.get(name.toLowerCase()) || null;
+ }
+ /**
+ * Appends a new value to the existing set of values for a header
+ * and returns them in a clone of the original instance.
+ *
+ * @param name The header name for which to append the values.
+ * @param value The value to append.
+ *
+ * @returns A clone of the HTTP headers object with the value appended to the given header.
+ */
+ append(name, value) {
+ return this.clone({
+ name,
+ value,
+ op: 'a'
+ });
+ }
+ /**
+ * Sets or modifies a value for a given header in a clone of the original instance.
+ * If the header already exists, its value is replaced with the given value
+ * in the returned object.
+ *
+ * @param name The header name.
+ * @param value The value or values to set or override for the given header.
+ *
+ * @returns A clone of the HTTP headers object with the newly set header value.
+ */
+ set(name, value) {
+ return this.clone({
+ name,
+ value,
+ op: 's'
+ });
+ }
+ /**
+ * Deletes values for a given header in a clone of the original instance.
+ *
+ * @param name The header name.
+ * @param value The value or values to delete for the given header.
+ *
+ * @returns A clone of the HTTP headers object with the given value deleted.
+ */
+ delete(name, value) {
+ return this.clone({
+ name,
+ value,
+ op: 'd'
+ });
+ }
+ maybeSetNormalizedName(name, lcName) {
+ if (!this.normalizedNames.has(lcName)) {
+ this.normalizedNames.set(lcName, name);
}
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵattribute"]("data-size", ctx.size)("data-status", ctx.status)("data-padding", ctx.padding);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵclassProp"]("_hoverable", ctx.hoverable)("_empty-value", ctx.isEmpty);
+ }
+ init() {
+ if (!!this.lazyInit) {
+ if (this.lazyInit instanceof HttpHeaders) {
+ this.copyFrom(this.lazyInit);
+ } else {
+ this.lazyInit();
+ }
+ this.lazyInit = null;
+ if (!!this.lazyUpdate) {
+ this.lazyUpdate.forEach(update => this.applyUpdate(update));
+ this.lazyUpdate = null;
+ }
}
- },
- inputs: {
- value: "value",
- size: "size",
- status: "status",
- hoverable: "hoverable"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([_taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__.MODE_PROVIDER])],
- ngContentSelectors: _c0,
- decls: 5,
- vars: 2,
- consts: [[1, "t-left-content"], [1, "t-text", 3, "title", "mouseenter"], ["text", ""]],
- template: function TuiBadgeComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "span", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojection"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](2, "span", 1, 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("mouseenter", function TuiBadgeComponent_Template_span_mouseenter_2_listener() {
- return 0;
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](4);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]();
+ }
+ copyFrom(other) {
+ other.init();
+ Array.from(other.headers.keys()).forEach(key => {
+ this.headers.set(key, other.headers.get(key));
+ this.normalizedNames.set(key, other.normalizedNames.get(key));
+ });
+ }
+ clone(update) {
+ const clone = new HttpHeaders();
+ clone.lazyInit = !!this.lazyInit && this.lazyInit instanceof HttpHeaders ? this.lazyInit : this;
+ clone.lazyUpdate = (this.lazyUpdate || []).concat([update]);
+ return clone;
+ }
+ applyUpdate(update) {
+ const key = update.name.toLowerCase();
+ switch (update.op) {
+ case 'a':
+ case 's':
+ let value = update.value;
+ if (typeof value === 'string') {
+ value = [value];
+ }
+ if (value.length === 0) {
+ return;
+ }
+ this.maybeSetNormalizedName(update.name, key);
+ const base = (update.op === 'a' ? this.headers.get(key) : undefined) || [];
+ base.push(...value);
+ this.headers.set(key, base);
+ break;
+ case 'd':
+ const toDelete = update.value;
+ if (!toDelete) {
+ this.headers.delete(key);
+ this.normalizedNames.delete(key);
+ } else {
+ let existing = this.headers.get(key);
+ if (!existing) {
+ return;
+ }
+ existing = existing.filter(value => toDelete.indexOf(value) === -1);
+ if (existing.length === 0) {
+ this.headers.delete(key);
+ this.normalizedNames.delete(key);
+ } else {
+ this.headers.set(key, existing);
+ }
+ }
+ break;
}
- if (rf & 2) {
- const _r0 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵreference"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("title", ctx.titleText(_r0));
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"](" ", ctx.outputValue, "\n");
+ }
+ setHeaderEntries(name, values) {
+ const headerValues = (Array.isArray(values) ? values : [values]).map(value => value.toString());
+ const key = name.toLowerCase();
+ this.headers.set(key, headerValues);
+ this.maybeSetNormalizedName(name, key);
+ }
+ /**
+ * @internal
+ */
+ forEach(fn) {
+ this.init();
+ Array.from(this.normalizedNames.keys()).forEach(key => fn(this.normalizedNames.get(key), this.headers.get(key)));
+ }
+}
+/**
+ * Verifies that the headers object has the right shape: the values
+ * must be either strings, numbers or arrays. Throws an error if an invalid
+ * header value is present.
+ */
+function assertValidHeaders(headers) {
+ for (const [key, value] of Object.entries(headers)) {
+ if (!(typeof value === 'string' || typeof value === 'number') && !Array.isArray(value)) {
+ throw new Error(`Unexpected value of the \`${key}\` header provided. ` + `Expecting either a string, a number or an array, but got: \`${value}\`.`);
}
- },
- styles: ["[_nghost-%COMP%]{transition-property:background-color;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;--left-content-color: currentColor;position:relative;display:inline-flex;font:var(--tui-font-text-s);align-items:center;justify-content:center;box-sizing:border-box;color:var(--tui-base-01);border-radius:6.25rem;white-space:nowrap;overflow:hidden;vertical-align:middle;max-width:100%}[_nghost-%COMP%]:after{transition-property:background;transition-duration:var(--tui-duration, .3s);transition-timing-function:ease-in-out;position:absolute;top:0;left:0;width:100%;height:100%;content:\"\";box-sizing:border-box;border-radius:inherit;pointer-events:none}._hoverable[_nghost-%COMP%]:hover[data-status=custom]:after, ._hoverable[_nghost-%COMP%]:active[data-status=custom]:after{background-color:var(--tui-clear)}[data-status=primary][_nghost-%COMP%]{background-color:var(--tui-primary);color:var(--tui-primary-text)}[data-status=primary]._hoverable[_nghost-%COMP%]:hover{background-color:var(--tui-primary-hover)}[data-status=primary]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-primary-active)}[data-status=error][_nghost-%COMP%]{--left-content-color: var(--tui-error-fill);background-color:var(--tui-error-bg);color:var(--tui-text-01)}[data-status=error]._hoverable[_nghost-%COMP%]:hover, [data-status=error]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-error-bg-hover)}[data-status=error][data-mode=onDark][_nghost-%COMP%]{background-color:var(--tui-error-bg-night);color:var(--tui-text-01-night)}[data-status=error][data-mode=onDark]._hoverable[_nghost-%COMP%]:hover, [data-status=error][data-mode=onDark]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-error-bg-night-hover)}[data-status=success][_nghost-%COMP%]{--left-content-color: var(--tui-success-fill);background-color:var(--tui-success-bg);color:var(--tui-text-01)}[data-status=success]._hoverable[_nghost-%COMP%]:hover, [data-status=success]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-success-bg-hover)}[data-status=success][data-mode=onDark][_nghost-%COMP%]{background-color:var(--tui-success-bg-night);color:var(--tui-text-01-night)}[data-status=success][data-mode=onDark]._hoverable[_nghost-%COMP%]:hover, [data-status=success][data-mode=onDark]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-success-bg-night-hover)}[data-status=warning][_nghost-%COMP%]{--left-content-color: var(--tui-warning-fill);background-color:var(--tui-warning-bg);color:var(--tui-text-01)}[data-status=warning]._hoverable[_nghost-%COMP%]:hover, [data-status=warning]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-warning-bg-hover)}[data-status=warning][data-mode=onDark][_nghost-%COMP%]{background-color:var(--tui-warning-bg-night);color:var(--tui-text-01-night)}[data-status=warning][data-mode=onDark]._hoverable[_nghost-%COMP%]:hover, [data-status=warning][data-mode=onDark]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-warning-bg-night-hover)}[data-status=info][_nghost-%COMP%]{--left-content-color: var(--tui-info-fill);background-color:var(--tui-info-bg);color:var(--tui-text-01)}[data-status=info]._hoverable[_nghost-%COMP%]:hover, [data-status=info]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-info-bg-hover)}[data-status=info][data-mode=onDark][_nghost-%COMP%]{background-color:var(--tui-info-bg-night);color:var(--tui-text-01-night)}[data-status=info][data-mode=onDark]._hoverable[_nghost-%COMP%]:hover, [data-status=info][data-mode=onDark]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-info-bg-night-hover)}[data-status=neutral][_nghost-%COMP%]{--left-content-color: var(--tui-neutral-fill);background-color:var(--tui-neutral-bg);color:var(--tui-text-01)}[data-status=neutral]._hoverable[_nghost-%COMP%]:hover, [data-status=neutral]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-neutral-bg-hover)}[data-status=neutral][data-mode=onDark][_nghost-%COMP%]{background-color:var(--tui-neutral-bg-night);color:var(--tui-text-01-night)}[data-status=neutral][data-mode=onDark]._hoverable[_nghost-%COMP%]:hover, [data-status=neutral][data-mode=onDark]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-neutral-bg-night-hover)}[data-status=default][_nghost-%COMP%]{background-color:var(--tui-base-06)}[data-status=default][_nghost-%COMP%]:not([data-mode])._hoverable:hover{background-color:var(--tui-base-07)}[data-status=default][_nghost-%COMP%]:not([data-mode])._hoverable:active{background-color:var(--tui-base-08)}[data-status=default][data-mode=onDark][_nghost-%COMP%]{background-color:var(--tui-clear-inverse-hover)}[data-status=default][data-mode=onDark]._hoverable[_nghost-%COMP%]:hover{background-color:var(--tui-clear-inverse-active)}[data-status=default][data-mode=onDark]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-clear-inverse-active)}[data-status=default][data-mode=onDark][_nghost-%COMP%]:focus:after{border:2px solid var(--tui-base-01)}[data-status=default][data-mode=onLight][_nghost-%COMP%]{background-color:var(--tui-clear);color:var(--tui-text-01)}[data-status=default][data-mode=onLight]._hoverable[_nghost-%COMP%]:hover{background-color:var(--tui-clear-hover)}[data-status=default][data-mode=onLight]._hoverable[_nghost-%COMP%]:active{background-color:var(--tui-clear-active)}._hoverable[_nghost-%COMP%]{cursor:pointer}[data-padding=m][_nghost-%COMP%]{padding:0 .5rem}[data-padding=m][data-size=xs][_nghost-%COMP%]{padding:0 .25rem}[data-padding=m][data-size=s][_nghost-%COMP%]{padding:0 .375rem}[data-padding=m][data-size=l][_nghost-%COMP%]{padding:0 .625rem}[data-padding=l][_nghost-%COMP%]{padding:0 .625rem}[data-padding=l][data-size=xs][_nghost-%COMP%]{padding:0 .375rem}[data-padding=l][data-size=s][_nghost-%COMP%]{padding:0 .5rem}[data-padding=l][data-size=l][_nghost-%COMP%]{padding:0 .75rem}[data-size=xs][_nghost-%COMP%]{font:var(--tui-font-text-xs);height:1rem;min-width:1rem}[data-size=xs][_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%]:before{width:.34375rem;height:.34375rem}[data-size=s][_nghost-%COMP%]{font:var(--tui-font-text-xs);height:1.25rem;min-width:1.25rem}[data-size=s][_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%]:before{width:.25rem;height:.25rem}[data-size=m][_nghost-%COMP%]{height:var(--tui-height-xs);line-height:var(--tui-height-xs);min-width:var(--tui-height-xs)}[data-size=l][_nghost-%COMP%]{height:var(--tui-height-s);line-height:var(--tui-height-s);min-width:var(--tui-height-s)}[data-size=l][_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%]:before{margin:0 .5rem 0 0;width:.5rem;height:.5rem}._empty-value[_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%]{margin:0 -.25rem}._empty-value[_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%]:before{margin:0}.t-left-content[_ngcontent-%COMP%]{display:none;color:var(--left-content-color);line-height:0}.t-left-content[_ngcontent-%COMP%]:not(:empty){display:block;margin-left:-.25rem}.t-left-content[_ngcontent-%COMP%]:not(:empty):before{content:none}[data-status=error][_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%], [data-status=success][_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%], [data-status=warning][_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%], [data-status=info][_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%], [data-status=neutral][_nghost-%COMP%] .t-left-content[_ngcontent-%COMP%]{display:block}.t-left-content[_ngcontent-%COMP%]:before{content:\"\";display:block;background:currentColor;margin:0 .375rem 0 0;width:.375rem;height:.375rem;border-radius:100%}.t-text[_ngcontent-%COMP%]{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiBadgeComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Component,
- args: [{
- selector: 'tui-badge',
- templateUrl: './badge.template.html',
- styleUrls: ['./badge.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectionStrategy.OnPush,
- providers: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_3__.MODE_PROVIDER],
- host: {
- '($.data-mode.attr)': 'mode$'
- }
- }]
- }], function () {
- return [{
- type: rxjs__WEBPACK_IMPORTED_MODULE_4__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_2__.TUI_MODE]
- }]
- }];
- }, {
- value: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['attr.data-size']
- }],
- status: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['attr.data-status']
- }],
- hoverable: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['class._hoverable']
- }],
- padding: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['attr.data-padding']
- }],
- isEmpty: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['class._empty-value']
- }]
- });
-})();
-class TuiBadgeModule {}
-TuiBadgeModule.ɵfac = function TuiBadgeModule_Factory(t) {
- return new (t || TuiBadgeModule)();
-};
-TuiBadgeModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
- type: TuiBadgeModule
-});
-TuiBadgeModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiBadgeModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_5__.CommonModule],
- declarations: [TuiBadgeComponent],
- exports: [TuiBadgeComponent]
- }]
- }], null, null);
-})();
+ }
+}
/**
- * Generated bundle index. Do not edit.
+ * Provides encoding and decoding of URL parameter and query-string values.
+ *
+ * Serializes and parses URL parameter keys and values to encode and decode them.
+ * If you pass URL query parameters without encoding,
+ * the query parameters can be misinterpreted at the receiving end.
+ *
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 993:
-/*!*****************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-components-checkbox-labeled.js ***!
- \*****************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiCheckboxLabeledComponent: () => (/* binding */ TuiCheckboxLabeledComponent),
-/* harmony export */ TuiCheckboxLabeledModule: () => (/* binding */ TuiCheckboxLabeledModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ 8015);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core */ 3359);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/core */ 2499);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/core */ 2871);
-/* harmony import */ var _taiga_ui_kit_components_checkbox__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/kit/components/checkbox */ 8151);
-/* harmony import */ var rxjs__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! rxjs */ 4517);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-
-const _c0 = ["*"];
-class TuiCheckboxLabeledComponent extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiNullableControl {
- constructor(control, cdr, mode$, options) {
- super(control, cdr);
- this.mode$ = mode$;
- this.options = options;
- this.size = this.options.size;
- }
- get focused() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiIsNativeFocused)(this.nativeFocusableElement);
+class HttpUrlEncodingCodec {
+ /**
+ * Encodes a key name for a URL parameter or query-string.
+ * @param key The key name.
+ * @returns The encoded key name.
+ */
+ encodeKey(key) {
+ return standardEncoding(key);
}
- get nativeFocusableElement() {
- var _a, _b;
- return (_b = (_a = this.checkbox) === null || _a === void 0 ? void 0 : _a.nativeFocusableElement) !== null && _b !== void 0 ? _b : null;
+ /**
+ * Encodes the value of a URL parameter or query-string.
+ * @param value The value.
+ * @returns The encoded value.
+ */
+ encodeValue(value) {
+ return standardEncoding(value);
}
- onFocused(focused) {
- this.updateFocused(focused);
+ /**
+ * Decodes an encoded URL parameter or query-string key.
+ * @param key The encoded key name.
+ * @returns The decoded key name.
+ */
+ decodeKey(key) {
+ return decodeURIComponent(key);
}
- stopReadonlyChanging(event) {
- if (this.readOnly) {
- event.preventDefault();
- }
+ /**
+ * Decodes an encoded URL parameter or query-string value.
+ * @param value The encoded value.
+ * @returns The decoded value.
+ */
+ decodeValue(value) {
+ return decodeURIComponent(value);
}
- /** @deprecated use 'value' setter */
- onModelChange(value) {
- this.value = value;
+}
+function paramParser(rawParams, codec) {
+ const map = new Map();
+ if (rawParams.length > 0) {
+ // The `window.location.search` can be used while creating an instance of the `HttpParams` class
+ // (e.g. `new HttpParams({ fromString: window.location.search })`). The `window.location.search`
+ // may start with the `?` char, so we strip it if it's present.
+ const params = rawParams.replace(/^\?/, '').split('&');
+ params.forEach(param => {
+ const eqIdx = param.indexOf('=');
+ const [key, val] = eqIdx == -1 ? [codec.decodeKey(param), ''] : [codec.decodeKey(param.slice(0, eqIdx)), codec.decodeValue(param.slice(eqIdx + 1))];
+ const list = map.get(key) || [];
+ list.push(val);
+ map.set(key, list);
+ });
}
+ return map;
}
-TuiCheckboxLabeledComponent.ɵfac = function TuiCheckboxLabeledComponent_Factory(t) {
- return new (t || TuiCheckboxLabeledComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControl, 10), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_MODE), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__.TUI_CHECKBOX_OPTIONS));
-};
-TuiCheckboxLabeledComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({
- type: TuiCheckboxLabeledComponent,
- selectors: [["tui-checkbox-labeled"]],
- viewQuery: function TuiCheckboxLabeledComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵviewQuery"](_taiga_ui_kit_components_checkbox__WEBPACK_IMPORTED_MODULE_6__.TuiCheckboxComponent, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵloadQuery"]()) && (ctx.checkbox = _t.first);
- }
- },
- hostVars: 1,
- hostBindings: function TuiCheckboxLabeledComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("$.data-mode.attr", function TuiCheckboxLabeledComponent___data_mode_attr_HostBindingHandler() {
- return ctx.mode$;
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵattribute"]("data-size", ctx.size);
- }
- },
- inputs: {
- size: "size"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiAsFocusableItemAccessor)(TuiCheckboxLabeledComponent), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiAsControl)(TuiCheckboxLabeledComponent), _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__.MODE_PROVIDER]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]],
- ngContentSelectors: _c0,
- decls: 4,
- vars: 12,
- consts: [[1, "t-wrapper", 3, "click"], [3, "disabled", "focusable", "nativeId", "pseudoActive", "pseudoFocus", "pseudoHover", "pseudoInvalid", "readOnly", "size", "ngModel", "ngModelChange", "focusedChange"], [1, "t-content"]],
- template: function TuiCheckboxLabeledComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵprojectionDef"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "label", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("click", function TuiCheckboxLabeledComponent_Template_label_click_0_listener($event) {
- return ctx.stopReadonlyChanging($event);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](1, "tui-checkbox", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("ngModelChange", function TuiCheckboxLabeledComponent_Template_tui_checkbox_ngModelChange_1_listener($event) {
- return ctx.value = $event;
- })("focusedChange", function TuiCheckboxLabeledComponent_Template_tui_checkbox_focusedChange_1_listener($event) {
- return ctx.onFocused($event);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](2, "div", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵprojection"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()();
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("disabled", ctx.computedDisabled)("focusable", ctx.focusable)("nativeId", ctx.nativeId)("pseudoActive", ctx.pseudoActive)("pseudoFocus", ctx.pseudoFocus)("pseudoHover", ctx.pseudoHover)("pseudoInvalid", ctx.computedInvalid)("readOnly", ctx.readOnly)("size", ctx.size)("ngModel", ctx.value);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵclassProp"]("t-content_disabled", ctx.computedDisabled);
- }
- },
- dependencies: [_taiga_ui_kit_components_checkbox__WEBPACK_IMPORTED_MODULE_6__.TuiCheckboxComponent, _angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControlStatus, _angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgModel],
- styles: ["[_nghost-%COMP%]{position:relative;display:block;line-height:0}._disabled[_nghost-%COMP%], ._readonly[_nghost-%COMP%]{pointer-events:none}.t-wrapper[_ngcontent-%COMP%]{display:inline-flex;max-width:100%;cursor:pointer}._disabled[_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]{cursor:default}[data-mode=onDark][_nghost-%COMP%] .t-wrapper[_ngcontent-%COMP%]{color:var(--tui-text-01-night)}.t-content[_ngcontent-%COMP%]{font:var(--tui-font-text-s);line-height:1rem;word-wrap:break-word;min-width:0}.t-content_disabled[_ngcontent-%COMP%]{opacity:var(--tui-disabled-opacity)}[data-size=m][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{margin-left:.5rem}[data-size=l][_nghost-%COMP%] .t-content[_ngcontent-%COMP%]{font:var(--tui-font-text-m);line-height:1.5rem;margin-left:.75rem}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiCheckboxLabeledComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Component,
- args: [{
- selector: 'tui-checkbox-labeled',
- templateUrl: './checkbox-labeled.template.html',
- styleUrls: ['./checkbox-labeled.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.tuiAsFocusableItemAccessor)(TuiCheckboxLabeledComponent), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiAsControl)(TuiCheckboxLabeledComponent), _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__.MODE_PROVIDER],
- host: {
- '($.data-mode.attr)': 'mode$',
- '[attr.data-size]': 'size'
- }
- }]
- }], function () {
- return [{
- type: _angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControl,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControl]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef]
- }]
- }, {
- type: rxjs__WEBPACK_IMPORTED_MODULE_9__.Observable,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_MODE]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__.TUI_CHECKBOX_OPTIONS]
- }]
- }];
- }, {
- checkbox: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewChild,
- args: [_taiga_ui_kit_components_checkbox__WEBPACK_IMPORTED_MODULE_6__.TuiCheckboxComponent]
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input
- }]
- });
-})();
-class TuiCheckboxLabeledModule {}
-TuiCheckboxLabeledModule.ɵfac = function TuiCheckboxLabeledModule_Factory(t) {
- return new (t || TuiCheckboxLabeledModule)();
+/**
+ * Encode input string with standard encodeURIComponent and then un-encode specific characters.
+ */
+const STANDARD_ENCODING_REGEX = /%(\d[a-f0-9])/gi;
+const STANDARD_ENCODING_REPLACEMENTS = {
+ '40': '@',
+ '3A': ':',
+ '24': '$',
+ '2C': ',',
+ '3B': ';',
+ '3D': '=',
+ '3F': '?',
+ '2F': '/'
};
-TuiCheckboxLabeledModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({
- type: TuiCheckboxLabeledModule
-});
-TuiCheckboxLabeledModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_10__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_3__.FormsModule, _taiga_ui_kit_components_checkbox__WEBPACK_IMPORTED_MODULE_6__.TuiCheckboxModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiCheckboxLabeledModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_10__.CommonModule, _angular_forms__WEBPACK_IMPORTED_MODULE_3__.FormsModule, _taiga_ui_kit_components_checkbox__WEBPACK_IMPORTED_MODULE_6__.TuiCheckboxModule],
- declarations: [TuiCheckboxLabeledComponent],
- exports: [TuiCheckboxLabeledComponent]
- }]
- }], null, null);
-})();
-
+function standardEncoding(v) {
+ return encodeURIComponent(v).replace(STANDARD_ENCODING_REGEX, (s, t) => STANDARD_ENCODING_REPLACEMENTS[t] ?? s);
+}
+function valueToString(value) {
+ return `${value}`;
+}
/**
- * Generated bundle index. Do not edit.
+ * An HTTP request/response body that represents serialized parameters,
+ * per the MIME type `application/x-www-form-urlencoded`.
+ *
+ * This class is immutable; all mutation operations return a new instance.
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 8151:
-/*!*********************************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-components-checkbox.js ***!
- \*********************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiCheckboxComponent: () => (/* binding */ TuiCheckboxComponent),
-/* harmony export */ TuiCheckboxModule: () => (/* binding */ TuiCheckboxModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ 8015);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/cdk */ 5235);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/cdk */ 8502);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/cdk */ 7507);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/cdk */ 6493);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core */ 2499);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-const _c0 = ["focusableElement"];
-class TuiCheckboxComponent extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiNullableControl {
- constructor(control, options, cdr) {
- super(control, cdr);
- this.options = options;
- this.size = this.options.size;
+class HttpParams {
+ constructor(options = {}) {
+ this.updates = null;
+ this.cloneFrom = null;
+ this.encoder = options.encoder || new HttpUrlEncodingCodec();
+ if (!!options.fromString) {
+ if (!!options.fromObject) {
+ throw new Error(`Cannot specify both fromString and fromObject.`);
+ }
+ this.map = paramParser(options.fromString, this.encoder);
+ } else if (!!options.fromObject) {
+ this.map = new Map();
+ Object.keys(options.fromObject).forEach(key => {
+ const value = options.fromObject[key];
+ // convert the values to strings
+ const values = Array.isArray(value) ? value.map(valueToString) : [valueToString(value)];
+ this.map.set(key, values);
+ });
+ } else {
+ this.map = null;
+ }
}
- get nativeFocusableElement() {
- return !this.focusableElement || this.computedDisabled ? null : this.focusableElement.nativeElement;
+ /**
+ * Reports whether the body includes one or more values for a given parameter.
+ * @param param The parameter name.
+ * @returns True if the parameter has one or more values,
+ * false if it has no value or is not present.
+ */
+ has(param) {
+ this.init();
+ return this.map.has(param);
}
- get focused() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiIsNativeFocused)(this.nativeFocusableElement);
+ /**
+ * Retrieves the first value for a parameter.
+ * @param param The parameter name.
+ * @returns The first value of the given parameter,
+ * or `null` if the parameter is not present.
+ */
+ get(param) {
+ this.init();
+ const res = this.map.get(param);
+ return !!res ? res[0] : null;
}
- get computedFocusable() {
- return this.interactive && this.focusable;
+ /**
+ * Retrieves all values for a parameter.
+ * @param param The parameter name.
+ * @returns All values in a string array,
+ * or `null` if the parameter not present.
+ */
+ getAll(param) {
+ this.init();
+ return this.map.get(param) || null;
+ }
+ /**
+ * Retrieves all the parameters for this body.
+ * @returns The parameter names in a string array.
+ */
+ keys() {
+ this.init();
+ return Array.from(this.map.keys());
}
- /** @deprecated use 'value' setter */
- onChecked(checked) {
- this.value = checked;
+ /**
+ * Appends a new value to existing values for a parameter.
+ * @param param The parameter name.
+ * @param value The new value to add.
+ * @return A new body with the appended value.
+ */
+ append(param, value) {
+ return this.clone({
+ param,
+ value,
+ op: 'a'
+ });
}
- onFocused(focused) {
- this.updateFocused(focused);
+ /**
+ * Constructs a new body with appended values for the given parameter name.
+ * @param params parameters and values
+ * @return A new body with the new value.
+ */
+ appendAll(params) {
+ const updates = [];
+ Object.keys(params).forEach(param => {
+ const value = params[param];
+ if (Array.isArray(value)) {
+ value.forEach(_value => {
+ updates.push({
+ param,
+ value: _value,
+ op: 'a'
+ });
+ });
+ } else {
+ updates.push({
+ param,
+ value: value,
+ op: 'a'
+ });
+ }
+ });
+ return this.clone(updates);
+ }
+ /**
+ * Replaces the value for a parameter.
+ * @param param The parameter name.
+ * @param value The new value.
+ * @return A new body with the new value.
+ */
+ set(param, value) {
+ return this.clone({
+ param,
+ value,
+ op: 's'
+ });
}
- onFocusVisible(focusVisible) {
- this.updateFocusVisible(focusVisible);
+ /**
+ * Removes a given value or all values from a parameter.
+ * @param param The parameter name.
+ * @param value The value to remove, if provided.
+ * @return A new body with the given value removed, or with all values
+ * removed if no value is specified.
+ */
+ delete(param, value) {
+ return this.clone({
+ param,
+ value,
+ op: 'd'
+ });
}
-}
-TuiCheckboxComponent.ɵfac = function TuiCheckboxComponent_Factory(t) {
- return new (t || TuiCheckboxComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControl, 10), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_CHECKBOX_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef));
-};
-TuiCheckboxComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({
- type: TuiCheckboxComponent,
- selectors: [["tui-checkbox"]],
- viewQuery: function TuiCheckboxComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵviewQuery"](_c0, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵloadQuery"]()) && (ctx.focusableElement = _t.first);
- }
- },
- hostVars: 1,
- hostBindings: function TuiCheckboxComponent_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵattribute"]("data-size", ctx.size);
+ /**
+ * Serializes the body to an encoded string, where key-value pairs (separated by `=`) are
+ * separated by `&`s.
+ */
+ toString() {
+ this.init();
+ return this.keys().map(key => {
+ const eKey = this.encoder.encodeKey(key);
+ // `a: ['1']` produces `'a=1'`
+ // `b: []` produces `''`
+ // `c: ['1', '2']` produces `'c=1&c=2'`
+ return this.map.get(key).map(value => eKey + '=' + this.encoder.encodeValue(value)).join('&');
+ })
+ // filter out empty values because `b: []` produces `''`
+ // which results in `a=1&&c=1&c=2` instead of `a=1&c=1&c=2` if we don't
+ .filter(param => param !== '').join('&');
+ }
+ clone(update) {
+ const clone = new HttpParams({
+ encoder: this.encoder
+ });
+ clone.cloneFrom = this.cloneFrom || this;
+ clone.updates = (this.updates || []).concat(update);
+ return clone;
+ }
+ init() {
+ if (this.map === null) {
+ this.map = new Map();
}
- },
- inputs: {
- size: "size"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiAsFocusableItemAccessor)(TuiCheckboxComponent), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiAsControl)(TuiCheckboxComponent)]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]],
- decls: 3,
- vars: 11,
- consts: [[3, "disabled", "focused", "hovered", "invalid", "pressed", "size", "value"], ["automation-id", "tui-checkbox__native", "type", "checkbox", 1, "t-native", 3, "disabled", "id", "tuiFocusable", "tuiChecked", "tuiCheckedChange", "tuiFocusedChange", "tuiFocusVisibleChange"], ["focusableElement", ""]],
- template: function TuiCheckboxComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "tui-primitive-checkbox", 0)(1, "input", 1, 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("tuiCheckedChange", function TuiCheckboxComponent_Template_input_tuiCheckedChange_1_listener($event) {
- return ctx.value = $event;
- })("tuiFocusedChange", function TuiCheckboxComponent_Template_input_tuiFocusedChange_1_listener($event) {
- return ctx.onFocused($event);
- })("tuiFocusVisibleChange", function TuiCheckboxComponent_Template_input_tuiFocusVisibleChange_1_listener($event) {
- return ctx.onFocusVisible($event);
+ if (this.cloneFrom !== null) {
+ this.cloneFrom.init();
+ this.cloneFrom.keys().forEach(key => this.map.set(key, this.cloneFrom.map.get(key)));
+ this.updates.forEach(update => {
+ switch (update.op) {
+ case 'a':
+ case 's':
+ const base = (update.op === 'a' ? this.map.get(update.param) : undefined) || [];
+ base.push(valueToString(update.value));
+ this.map.set(update.param, base);
+ break;
+ case 'd':
+ if (update.value !== undefined) {
+ let base = this.map.get(update.param) || [];
+ const idx = base.indexOf(valueToString(update.value));
+ if (idx !== -1) {
+ base.splice(idx, 1);
+ }
+ if (base.length > 0) {
+ this.map.set(update.param, base);
+ } else {
+ this.map.delete(update.param);
+ }
+ } else {
+ this.map.delete(update.param);
+ break;
+ }
+ }
});
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()();
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("disabled", ctx.disabled)("focused", ctx.computedFocusVisible)("hovered", ctx.pseudoHover)("invalid", ctx.computedInvalid)("pressed", ctx.pseudoActive)("size", ctx.size)("value", ctx.value);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("disabled", ctx.disabled)("id", ctx.id)("tuiFocusable", ctx.computedFocusable)("tuiChecked", ctx.value);
+ this.cloneFrom = this.updates = null;
}
- },
- dependencies: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiPrimitiveCheckboxComponent, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TuiCheckedDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiFocusableDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TuiFocusedDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__.TuiFocusVisibleDirective],
- styles: ["[_nghost-%COMP%]{font:var(--tui-font-text-s);color:var(--tui-text-01);position:relative;display:block;flex-shrink:0}[data-size=m][_nghost-%COMP%]{width:1rem;height:1rem}[data-size=l][_nghost-%COMP%]{width:1.5rem;height:1.5rem}._readonly[_nghost-%COMP%] tui-primitive-checkbox[_ngcontent-%COMP%]{pointer-events:none}.t-native[_ngcontent-%COMP%]{padding:0;margin:0;border-width:0;border-radius:inherit;background:none;font-size:inherit;line-height:inherit;font-weight:inherit;color:inherit;caret-color:currentColor;outline:none;-webkit-appearance:none;-moz-appearance:none;appearance:none;word-break:keep-all;-webkit-text-fill-color:currentColor;position:absolute;top:0;left:0;width:100%;height:100%;opacity:0;cursor:pointer}.t-native[_ngcontent-%COMP%]:-webkit-autofill, .t-native[_ngcontent-%COMP%]:-webkit-autofill:hover, .t-native[_ngcontent-%COMP%]:-webkit-autofill:focus{caret-color:var(--tui-base-09);border-radius:inherit;color:inherit!important;background-color:transparent!important;-webkit-text-fill-color:var(--tui-text-01)!important;border-color:var(--tui-autofill);-webkit-box-shadow:0 0 0 100rem var(--tui-autofill) inset!important}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiCheckboxComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Component,
- args: [{
- selector: 'tui-checkbox',
- templateUrl: './checkbox.template.html',
- styleUrls: ['./checkbox.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiAsFocusableItemAccessor)(TuiCheckboxComponent), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiAsControl)(TuiCheckboxComponent)]
- }]
- }], function () {
- return [{
- type: _angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControl,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControl]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_CHECKBOX_OPTIONS]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef]
- }]
- }];
- }, {
- focusableElement: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewChild,
- args: ['focusableElement']
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Input
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.HostBinding,
- args: ['attr.data-size']
- }]
- });
-})();
-class TuiCheckboxModule {}
-TuiCheckboxModule.ɵfac = function TuiCheckboxModule_Factory(t) {
- return new (t || TuiCheckboxModule)();
-};
-TuiCheckboxModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({
- type: TuiCheckboxModule
-});
-TuiCheckboxModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_10__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TuiCheckedModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiFocusableModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TuiFocusedModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__.TuiFocusVisibleModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiPrimitiveCheckboxModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiCheckboxModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_10__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_6__.TuiCheckedModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_7__.TuiFocusableModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_8__.TuiFocusedModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__.TuiFocusVisibleModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiPrimitiveCheckboxModule],
- declarations: [TuiCheckboxComponent],
- exports: [TuiCheckboxComponent]
- }]
- }], null, null);
-})();
+ }
+}
/**
- * Generated bundle index. Do not edit.
+ * A token used to manipulate and access values stored in `HttpContext`.
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 8977:
-/*!******************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-components-data-list-wrapper.js ***!
- \******************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ AbstractTuiDataListWrapper: () => (/* binding */ AbstractTuiDataListWrapper),
-/* harmony export */ TuiDataListGroupWrapperComponent: () => (/* binding */ TuiDataListGroupWrapperComponent),
-/* harmony export */ TuiDataListWrapperComponent: () => (/* binding */ TuiDataListWrapperComponent),
-/* harmony export */ TuiDataListWrapperModule: () => (/* binding */ TuiDataListWrapperModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core */ 8623);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/core */ 6645);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/core */ 1460);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/core */ 3359);
-/* harmony import */ var _taiga_ui_kit_tokens__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/kit/tokens */ 991);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk */ 5558);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @angular/common */ 9191);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-
-
-
-
-
-
-
-
-
-
-
-const _c0 = ["labels", ""];
-function TuiDataListGroupWrapperComponent_tui_data_list_0_tui_opt_group_1_button_1_ng_container_2_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const text_r10 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r10, " ");
- }
-}
-function TuiDataListGroupWrapperComponent_tui_data_list_0_tui_opt_group_1_button_1_Template(rf, ctx) {
- if (rf & 1) {
- const _r12 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "button", 6, 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function TuiDataListGroupWrapperComponent_tui_data_list_0_tui_opt_group_1_button_1_Template_button_click_0_listener() {
- const restoredCtx = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r12);
- const item_r7 = restoredCtx.$implicit;
- const ctx_r11 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](3);
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r11.itemClick.emit(item_r7));
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](2, TuiDataListGroupWrapperComponent_tui_data_list_0_tui_opt_group_1_button_1_ng_container_2_Template, 2, 1, "ng-container", 8);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const item_r7 = ctx.$implicit;
- const _r8 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](1);
- const ctx_r6 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("disabled", ctx_r6.disabledItemHandler(item_r7))("value", item_r7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r6.itemContent)("polymorpheusOutletContext", ctx_r6.getContext(item_r7, _r8));
+class HttpContextToken {
+ constructor(defaultValue) {
+ this.defaultValue = defaultValue;
}
}
-function TuiDataListGroupWrapperComponent_tui_data_list_0_tui_opt_group_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "tui-opt-group", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiDataListGroupWrapperComponent_tui_data_list_0_tui_opt_group_1_button_1_Template, 3, 4, "button", 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+/**
+ * Http context stores arbitrary user defined values and ensures type safety without
+ * actually knowing the types. It is backed by a `Map` and guarantees that keys do not clash.
+ *
+ * This context is mutable and is shared between cloned requests unless explicitly specified.
+ *
+ * @usageNotes
+ *
+ * ### Usage Example
+ *
+ * ```typescript
+ * // inside cache.interceptors.ts
+ * export const IS_CACHE_ENABLED = new HttpContextToken(() => false);
+ *
+ * export class CacheInterceptor implements HttpInterceptor {
+ *
+ * intercept(req: HttpRequest, delegate: HttpHandler): Observable> {
+ * if (req.context.get(IS_CACHE_ENABLED) === true) {
+ * return ...;
+ * }
+ * return delegate.handle(req);
+ * }
+ * }
+ *
+ * // inside a service
+ *
+ * this.httpClient.get('/api/weather', {
+ * context: new HttpContext().set(IS_CACHE_ENABLED, true)
+ * }).subscribe(...);
+ * ```
+ *
+ * @publicApi
+ */
+class HttpContext {
+ constructor() {
+ this.map = new Map();
}
- if (rf & 2) {
- const group_r4 = ctx.$implicit;
- const index_r5 = ctx.index;
- const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("label", ctx_r3.labels[index_r5]);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", group_r4);
+ /**
+ * Store a value in the context. If a value is already present it will be overwritten.
+ *
+ * @param token The reference to an instance of `HttpContextToken`.
+ * @param value The value to store.
+ *
+ * @returns A reference to itself for easy chaining.
+ */
+ set(token, value) {
+ this.map.set(token, value);
+ return this;
}
-}
-function TuiDataListGroupWrapperComponent_tui_data_list_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "tui-data-list", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiDataListGroupWrapperComponent_tui_data_list_0_tui_opt_group_1_Template, 2, 2, "tui-opt-group", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
+ /**
+ * Retrieve the value associated with the given token.
+ *
+ * @param token The reference to an instance of `HttpContextToken`.
+ *
+ * @returns The stored value or default if one is defined.
+ */
+ get(token) {
+ if (!this.map.has(token)) {
+ this.map.set(token, token.defaultValue());
+ }
+ return this.map.get(token);
}
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("emptyContent", ctx_r0.emptyContent)("size", ctx_r0.size);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx_r0.items);
+ /**
+ * Delete the value associated with the given token.
+ *
+ * @param token The reference to an instance of `HttpContextToken`.
+ *
+ * @returns A reference to itself for easy chaining.
+ */
+ delete(token) {
+ this.map.delete(token);
+ return this;
}
-}
-function TuiDataListGroupWrapperComponent_ng_template_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-loader", 9);
- }
-}
-function TuiDataListWrapperComponent_tui_data_list_0_button_1_ng_container_3_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementContainerEnd"]();
+ /**
+ * Checks for existence of a given token.
+ *
+ * @param token The reference to an instance of `HttpContextToken`.
+ *
+ * @returns True if the token exists, false otherwise.
+ */
+ has(token) {
+ return this.map.has(token);
}
- if (rf & 2) {
- const text_r7 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtextInterpolate1"](" ", text_r7, " ");
+ /**
+ * @returns a list of tokens currently stored in the context.
+ */
+ keys() {
+ return this.map.keys();
}
}
-function TuiDataListWrapperComponent_tui_data_list_0_button_1_Template(rf, ctx) {
- if (rf & 1) {
- const _r9 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "button", 4, 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵlistener"]("click", function TuiDataListWrapperComponent_tui_data_list_0_button_1_Template_button_click_0_listener() {
- const restoredCtx = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵrestoreView"](_r9);
- const item_r4 = restoredCtx.$implicit;
- const ctx_r8 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- return _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵresetView"](ctx_r8.itemClick.emit(item_r4));
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](2, "span", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](3, TuiDataListWrapperComponent_tui_data_list_0_button_1_ng_container_3_Template, 2, 1, "ng-container", 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]()();
- }
- if (rf & 2) {
- const item_r4 = ctx.$implicit;
- const _r5 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](1);
- const ctx_r3 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("disabled", ctx_r3.disabledItemHandler(item_r4))("value", item_r4);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("polymorpheusOutlet", ctx_r3.itemContent)("polymorpheusOutletContext", ctx_r3.getContext(item_r4, _r5));
+
+/**
+ * Determine whether the given HTTP method may include a body.
+ */
+function mightHaveBody(method) {
+ switch (method) {
+ case 'DELETE':
+ case 'GET':
+ case 'HEAD':
+ case 'OPTIONS':
+ case 'JSONP':
+ return false;
+ default:
+ return true;
}
}
-function TuiDataListWrapperComponent_tui_data_list_0_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementStart"](0, "tui-data-list", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiDataListWrapperComponent_tui_data_list_0_button_1_Template, 4, 4, "button", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- const ctx_r0 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵnextContext"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("emptyContent", ctx_r0.emptyContent)("size", ctx_r0.size);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngForOf", ctx_r0.items);
- }
+/**
+ * Safely assert whether the given value is an ArrayBuffer.
+ *
+ * In some execution environments ArrayBuffer is not defined.
+ */
+function isArrayBuffer(value) {
+ return typeof ArrayBuffer !== 'undefined' && value instanceof ArrayBuffer;
}
-function TuiDataListWrapperComponent_ng_template_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵelement"](0, "tui-loader", 8);
- }
+/**
+ * Safely assert whether the given value is a Blob.
+ *
+ * In some execution environments Blob is not defined.
+ */
+function isBlob(value) {
+ return typeof Blob !== 'undefined' && value instanceof Blob;
}
-const _c1 = "[_nghost-%COMP%]{display:block}.t-content[_ngcontent-%COMP%]{flex:1}.t-loader[_ngcontent-%COMP%]{margin:.75rem 0}";
-class AbstractTuiDataListWrapper {
- constructor(itemsHandlers, defaultSize) {
- this.itemsHandlers = itemsHandlers;
- this.defaultSize = defaultSize;
- this.optionsQuery = _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.EMPTY_QUERY;
- this.disabledItemHandler = this.itemsHandlers.disabledItemHandler;
- this.size = this.defaultSize;
- this.itemClick = new _angular_core__WEBPACK_IMPORTED_MODULE_0__.EventEmitter();
- this.itemContent = ({
- $implicit
- }) => this.itemsHandlers.stringify($implicit);
- }
- getContext($implicit, {
- nativeElement
- }) {
- return {
- $implicit,
- active: (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiIsNativeFocused)(nativeElement)
- };
- }
- getOptions(includeDisabled = false) {
- return this.optionsQuery.filter(({
- disabled
- }) => includeDisabled || !disabled).map(({
- value
- }) => value).filter(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiIsPresent);
- }
+/**
+ * Safely assert whether the given value is a FormData instance.
+ *
+ * In some execution environments FormData is not defined.
+ */
+function isFormData(value) {
+ return typeof FormData !== 'undefined' && value instanceof FormData;
}
-AbstractTuiDataListWrapper.ɵfac = function AbstractTuiDataListWrapper_Factory(t) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵinvalidFactory"]();
-};
-AbstractTuiDataListWrapper.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineDirective"]({
- type: AbstractTuiDataListWrapper,
- viewQuery: function AbstractTuiDataListWrapper_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵviewQuery"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiOptionComponent, 5);
+/**
+ * Safely assert whether the given value is a URLSearchParams instance.
+ *
+ * In some execution environments URLSearchParams is not defined.
+ */
+function isUrlSearchParams(value) {
+ return typeof URLSearchParams !== 'undefined' && value instanceof URLSearchParams;
+}
+/**
+ * An outgoing HTTP request with an optional typed body.
+ *
+ * `HttpRequest` represents an outgoing request, including URL, method,
+ * headers, body, and other request configuration options. Instances should be
+ * assumed to be immutable. To modify a `HttpRequest`, the `clone`
+ * method should be used.
+ *
+ * @publicApi
+ */
+class HttpRequest {
+ constructor(method, url, third, fourth) {
+ this.url = url;
+ /**
+ * The request body, or `null` if one isn't set.
+ *
+ * Bodies are not enforced to be immutable, as they can include a reference to any
+ * user-defined data type. However, interceptors should take care to preserve
+ * idempotence by treating them as such.
+ */
+ this.body = null;
+ /**
+ * Whether this request should be made in a way that exposes progress events.
+ *
+ * Progress events are expensive (change detection runs on each event) and so
+ * they should only be requested if the consumer intends to monitor them.
+ *
+ * Note: The `FetchBackend` doesn't support progress report on uploads.
+ */
+ this.reportProgress = false;
+ /**
+ * Whether this request should be sent with outgoing credentials (cookies).
+ */
+ this.withCredentials = false;
+ /**
+ * The expected response type of the server.
+ *
+ * This is used to parse the response appropriately before returning it to
+ * the requestee.
+ */
+ this.responseType = 'json';
+ this.method = method.toUpperCase();
+ // Next, need to figure out which argument holds the HttpRequestInit
+ // options, if any.
+ let options;
+ // Check whether a body argument is expected. The only valid way to omit
+ // the body argument is to use a known no-body method like GET.
+ if (mightHaveBody(this.method) || !!fourth) {
+ // Body is the third argument, options are the fourth.
+ this.body = third !== undefined ? third : null;
+ options = fourth;
+ } else {
+ // No body required, options are the third argument. The body stays null.
+ options = third;
}
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵloadQuery"]()) && (ctx.optionsQuery = _t);
+ // If options have been passed, interpret them.
+ if (options) {
+ // Normalize reportProgress and withCredentials.
+ this.reportProgress = !!options.reportProgress;
+ this.withCredentials = !!options.withCredentials;
+ // Override default response type of 'json' if one is provided.
+ if (!!options.responseType) {
+ this.responseType = options.responseType;
+ }
+ // Override headers if they're provided.
+ if (!!options.headers) {
+ this.headers = options.headers;
+ }
+ if (!!options.context) {
+ this.context = options.context;
+ }
+ if (!!options.params) {
+ this.params = options.params;
+ }
+ }
+ // If no headers have been passed in, construct a new HttpHeaders instance.
+ if (!this.headers) {
+ this.headers = new HttpHeaders();
+ }
+ // If no context have been passed in, construct a new HttpContext instance.
+ if (!this.context) {
+ this.context = new HttpContext();
+ }
+ // If no parameters have been passed in, construct a new HttpUrlEncodedParams instance.
+ if (!this.params) {
+ this.params = new HttpParams();
+ this.urlWithParams = url;
+ } else {
+ // Encode the parameters to a string in preparation for inclusion in the URL.
+ const params = this.params.toString();
+ if (params.length === 0) {
+ // No parameters, the visible URL is just the URL given at creation time.
+ this.urlWithParams = url;
+ } else {
+ // Does the URL already have query parameters? Look for '?'.
+ const qIdx = url.indexOf('?');
+ // There are 3 cases to handle:
+ // 1) No existing parameters -> append '?' followed by params.
+ // 2) '?' exists and is followed by existing query string ->
+ // append '&' followed by params.
+ // 3) '?' exists at the end of the url -> append params directly.
+ // This basically amounts to determining the character, if any, with
+ // which to join the URL and parameters.
+ const sep = qIdx === -1 ? '?' : qIdx < url.length - 1 ? '&' : '';
+ this.urlWithParams = url + sep + params;
+ }
}
- },
- inputs: {
- disabledItemHandler: "disabledItemHandler",
- emptyContent: "emptyContent",
- size: "size",
- itemContent: "itemContent"
- },
- outputs: {
- itemClick: "itemClick"
}
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](AbstractTuiDataListWrapper, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Directive
- }], function () {
- return [{
- type: undefined
- }, {
- type: undefined
- }];
- }, {
- optionsQuery: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ViewChildren,
- args: [(0,_angular_core__WEBPACK_IMPORTED_MODULE_0__.forwardRef)(() => _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiOptionComponent)]
- }],
- disabledItemHandler: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- emptyContent: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- itemClick: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Output
- }],
- itemContent: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiDataListGroupWrapperComponent extends AbstractTuiDataListWrapper {
- constructor(itemsHandlers, controller) {
- super(itemsHandlers, (controller === null || controller === void 0 ? void 0 : controller.size) || 'm');
- this.items = [];
- this.labels = [];
+ /**
+ * Transform the free-form body into a serialized format suitable for
+ * transmission to the server.
+ */
+ serializeBody() {
+ // If no body is present, no need to serialize it.
+ if (this.body === null) {
+ return null;
+ }
+ // Check whether the body is already in a serialized form. If so,
+ // it can just be returned directly.
+ if (isArrayBuffer(this.body) || isBlob(this.body) || isFormData(this.body) || isUrlSearchParams(this.body) || typeof this.body === 'string') {
+ return this.body;
+ }
+ // Check whether the body is an instance of HttpUrlEncodedParams.
+ if (this.body instanceof HttpParams) {
+ return this.body.toString();
+ }
+ // Check whether the body is an object or array, and serialize with JSON if so.
+ if (typeof this.body === 'object' || typeof this.body === 'boolean' || Array.isArray(this.body)) {
+ return JSON.stringify(this.body);
+ }
+ // Fall back on toString() for everything else.
+ return this.body.toString();
}
-}
-TuiDataListGroupWrapperComponent.ɵfac = function TuiDataListGroupWrapperComponent_Factory(t) {
- return new (t || TuiDataListGroupWrapperComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_kit_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_ITEMS_HANDLERS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TuiTextfieldSizeDirective, 8));
-};
-TuiDataListGroupWrapperComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiDataListGroupWrapperComponent,
- selectors: [["tui-data-list-wrapper", "labels", ""]],
- inputs: {
- items: "items",
- labels: "labels"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.tuiAsDataListAccessor)(TuiDataListGroupWrapperComponent)]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]],
- attrs: _c0,
- decls: 3,
- vars: 2,
- consts: [[3, "emptyContent", "size", 4, "ngIf", "ngIfElse"], ["loading", ""], [3, "emptyContent", "size"], [3, "label", 4, "ngFor", "ngForOf"], [3, "label"], ["automation-id", "tui-data-list-wrapper__option", "tuiElement", "", "tuiOption", "", 3, "disabled", "value", "click", 4, "ngFor", "ngForOf"], ["automation-id", "tui-data-list-wrapper__option", "tuiElement", "", "tuiOption", "", 3, "disabled", "value", "click"], ["elementRef", "elementRef"], [4, "polymorpheusOutlet", "polymorpheusOutletContext"], [1, "t-loader"]],
- template: function TuiDataListGroupWrapperComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiDataListGroupWrapperComponent_tui_data_list_0_Template, 2, 3, "tui-data-list", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiDataListGroupWrapperComponent_ng_template_1_Template, 1, 0, "ng-template", null, 1, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplateRefExtractor"]);
+ /**
+ * Examine the body and attempt to infer an appropriate MIME type
+ * for it.
+ *
+ * If no such type can be inferred, this method will return `null`.
+ */
+ detectContentTypeHeader() {
+ // An empty body has no content type.
+ if (this.body === null) {
+ return null;
}
- if (rf & 2) {
- const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.items)("ngIfElse", _r1);
+ // FormData bodies rely on the browser's content type assignment.
+ if (isFormData(this.body)) {
+ return null;
}
- },
- dependencies: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiDataListComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiOptionComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__.TuiLoaderComponent, _angular_common__WEBPACK_IMPORTED_MODULE_9__.NgIf, _angular_common__WEBPACK_IMPORTED_MODULE_9__.NgForOf, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiOptGroupDirective, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.TuiElementDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_11__.PolymorpheusOutletDirective],
- styles: ["[_nghost-%COMP%]{display:block}.t-content[_ngcontent-%COMP%]{flex:1}.t-loader[_ngcontent-%COMP%]{margin:.75rem 0}"],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDataListGroupWrapperComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-data-list-wrapper[labels]',
- templateUrl: './data-list-group-wrapper.template.html',
- styleUrls: ['./data-list-wrapper.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.tuiAsDataListAccessor)(TuiDataListGroupWrapperComponent)]
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_kit_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_ITEMS_HANDLERS]
- }]
- }, {
- type: _taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TuiTextfieldSizeDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TuiTextfieldSizeDirective]
- }]
- }];
- }, {
- items: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }],
- labels: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiDataListWrapperComponent extends AbstractTuiDataListWrapper {
- constructor(itemsHandlers, controller) {
- super(itemsHandlers, (controller === null || controller === void 0 ? void 0 : controller.size) || 'm');
- this.items = [];
+ // Blobs usually have their own content type. If it doesn't, then
+ // no type can be inferred.
+ if (isBlob(this.body)) {
+ return this.body.type || null;
+ }
+ // Array buffers have unknown contents and thus no type can be inferred.
+ if (isArrayBuffer(this.body)) {
+ return null;
+ }
+ // Technically, strings could be a form of JSON data, but it's safe enough
+ // to assume they're plain strings.
+ if (typeof this.body === 'string') {
+ return 'text/plain';
+ }
+ // `HttpUrlEncodedParams` has its own content-type.
+ if (this.body instanceof HttpParams) {
+ return 'application/x-www-form-urlencoded;charset=UTF-8';
+ }
+ // Arrays, objects, boolean and numbers will be encoded as JSON.
+ if (typeof this.body === 'object' || typeof this.body === 'number' || typeof this.body === 'boolean') {
+ return 'application/json';
+ }
+ // No type could be inferred.
+ return null;
}
-}
-TuiDataListWrapperComponent.ɵfac = function TuiDataListWrapperComponent_Factory(t) {
- return new (t || TuiDataListWrapperComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_kit_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_ITEMS_HANDLERS), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TUI_TEXTFIELD_WATCHED_CONTROLLER, 8));
-};
-TuiDataListWrapperComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineComponent"]({
- type: TuiDataListWrapperComponent,
- selectors: [["tui-data-list-wrapper", 3, "labels", ""]],
- inputs: {
- items: "items"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵProvidersFeature"]([(0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.tuiAsDataListAccessor)(TuiDataListWrapperComponent), _taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TEXTFIELD_CONTROLLER_PROVIDER]), _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵInheritDefinitionFeature"]],
- decls: 3,
- vars: 2,
- consts: [[3, "emptyContent", "size", 4, "ngIf", "ngIfElse"], ["loading", ""], [3, "emptyContent", "size"], ["automation-id", "tui-data-list-wrapper__option", "tuiElement", "", "tuiOption", "", 3, "disabled", "value", "click", 4, "ngFor", "ngForOf"], ["automation-id", "tui-data-list-wrapper__option", "tuiElement", "", "tuiOption", "", 3, "disabled", "value", "click"], ["elementRef", "elementRef"], [1, "t-content"], [4, "polymorpheusOutlet", "polymorpheusOutletContext"], ["automation-id", "tui-data-list-wrapper__loader", 1, "t-loader"]],
- template: function TuiDataListWrapperComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](0, TuiDataListWrapperComponent_tui_data_list_0_Template, 2, 3, "tui-data-list", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplate"](1, TuiDataListWrapperComponent_ng_template_1_Template, 1, 0, "ng-template", null, 1, _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵtemplateRefExtractor"]);
+ clone(update = {}) {
+ // For method, url, and responseType, take the current value unless
+ // it is overridden in the update hash.
+ const method = update.method || this.method;
+ const url = update.url || this.url;
+ const responseType = update.responseType || this.responseType;
+ // The body is somewhat special - a `null` value in update.body means
+ // whatever current body is present is being overridden with an empty
+ // body, whereas an `undefined` value in update.body implies no
+ // override.
+ const body = update.body !== undefined ? update.body : this.body;
+ // Carefully handle the boolean options to differentiate between
+ // `false` and `undefined` in the update args.
+ const withCredentials = update.withCredentials !== undefined ? update.withCredentials : this.withCredentials;
+ const reportProgress = update.reportProgress !== undefined ? update.reportProgress : this.reportProgress;
+ // Headers and params may be appended to if `setHeaders` or
+ // `setParams` are used.
+ let headers = update.headers || this.headers;
+ let params = update.params || this.params;
+ // Pass on context if needed
+ const context = update.context ?? this.context;
+ // Check whether the caller has asked to add headers.
+ if (update.setHeaders !== undefined) {
+ // Set every requested header.
+ headers = Object.keys(update.setHeaders).reduce((headers, name) => headers.set(name, update.setHeaders[name]), headers);
}
- if (rf & 2) {
- const _r1 = _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵreference"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵproperty"]("ngIf", ctx.items)("ngIfElse", _r1);
+ // Check whether the caller has asked to set params.
+ if (update.setParams) {
+ // Set every requested param.
+ params = Object.keys(update.setParams).reduce((params, param) => params.set(param, update.setParams[param]), params);
}
- },
- dependencies: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiDataListComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiOptionComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__.TuiLoaderComponent, _angular_common__WEBPACK_IMPORTED_MODULE_9__.NgIf, _angular_common__WEBPACK_IMPORTED_MODULE_9__.NgForOf, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.TuiElementDirective, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_11__.PolymorpheusOutletDirective],
- styles: [_c1],
- changeDetection: 0
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDataListWrapperComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Component,
- args: [{
- selector: 'tui-data-list-wrapper:not([labels])',
- templateUrl: './data-list-wrapper.template.html',
- styleUrls: ['./data-list-wrapper.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_0__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.tuiAsDataListAccessor)(TuiDataListWrapperComponent), _taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TEXTFIELD_CONTROLLER_PROVIDER]
- }]
- }], function () {
- return [{
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_kit_tokens__WEBPACK_IMPORTED_MODULE_5__.TUI_ITEMS_HANDLERS]
- }]
- }, {
- type: _taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TuiTextfieldController,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TUI_TEXTFIELD_WATCHED_CONTROLLER]
- }]
- }];
- }, {
- items: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.Input
- }]
- });
-})();
-class TuiDataListWrapperModule {}
-TuiDataListWrapperModule.ɵfac = function TuiDataListWrapperModule_Factory(t) {
- return new (t || TuiDataListWrapperModule)();
-};
-TuiDataListWrapperModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineNgModule"]({
- type: TuiDataListWrapperModule
-});
-TuiDataListWrapperModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_9__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_11__.PolymorpheusModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.TuiElementModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiDataListModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__.TuiLoaderModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_0__["ɵsetClassMetadata"](TuiDataListWrapperModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_0__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_9__.CommonModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_11__.PolymorpheusModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.TuiElementModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiDataListModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_8__.TuiLoaderModule],
- declarations: [TuiDataListWrapperComponent, TuiDataListGroupWrapperComponent],
- exports: [TuiDataListWrapperComponent, TuiDataListGroupWrapperComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiDataListDirective]
- }]
- }], null, null);
-})();
+ // Finally, construct the new HttpRequest using the pieces from above.
+ return new HttpRequest(method, url, body, {
+ params,
+ headers,
+ context,
+ reportProgress,
+ responseType,
+ withCredentials
+ });
+ }
+}
/**
- * Generated bundle index. Do not edit.
+ * Type enumeration for the different kinds of `HttpEvent`.
+ *
+ * @publicApi
*/
-
-
-
-/***/ }),
-
-/***/ 4556:
-/*!*************************************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-components-input-number.js ***!
- \*************************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TUI_INPUT_NUMBER_DEFAULT_OPTIONS: () => (/* binding */ TUI_INPUT_NUMBER_DEFAULT_OPTIONS),
-/* harmony export */ TUI_INPUT_NUMBER_OPTIONS: () => (/* binding */ TUI_INPUT_NUMBER_OPTIONS),
-/* harmony export */ TUI_NUMBER_VALUE_TRANSFORMER: () => (/* binding */ TUI_NUMBER_VALUE_TRANSFORMER),
-/* harmony export */ TuiInputNumberComponent: () => (/* binding */ TuiInputNumberComponent),
-/* harmony export */ TuiInputNumberDirective: () => (/* binding */ TuiInputNumberDirective),
-/* harmony export */ TuiInputNumberModule: () => (/* binding */ TuiInputNumberModule),
-/* harmony export */ tuiInputNumberOptionsProvider: () => (/* binding */ tuiInputNumberOptionsProvider)
-/* harmony export */ });
-/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! tslib */ 9799);
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @angular/forms */ 8015);
-/* harmony import */ var _maskito_kit__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @maskito/kit */ 616);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @taiga-ui/cdk */ 6049);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/cdk */ 5968);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/cdk */ 9291);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! @taiga-ui/cdk */ 2515);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @taiga-ui/core */ 6345);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! @taiga-ui/core */ 3474);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/core */ 1460);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/core */ 5650);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/core */ 3359);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! @taiga-ui/core */ 9139);
-/* harmony import */ var _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @tinkoff/ng-polymorpheus */ 244);
-/* harmony import */ var _taiga_ui_kit_directives__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! @taiga-ui/kit/directives */ 519);
-/* harmony import */ var _maskito_angular__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! @maskito/angular */ 776);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-/** Default values for the input number options. */
-function TuiInputNumberComponent_div_4_ng_container_1_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementContainerStart"](0);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementContainerEnd"]();
- }
- if (rf & 2) {
- const text_r7 = ctx.polymorpheusOutlet;
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtextInterpolate1"](" ", text_r7, " ");
+var HttpEventType;
+(function (HttpEventType) {
+ /**
+ * The request was sent out over the wire.
+ */
+ HttpEventType[HttpEventType["Sent"] = 0] = "Sent";
+ /**
+ * An upload progress event was received.
+ *
+ * Note: The `FetchBackend` doesn't support progress report on uploads.
+ */
+ HttpEventType[HttpEventType["UploadProgress"] = 1] = "UploadProgress";
+ /**
+ * The response status code and headers were received.
+ */
+ HttpEventType[HttpEventType["ResponseHeader"] = 2] = "ResponseHeader";
+ /**
+ * A download progress event was received.
+ */
+ HttpEventType[HttpEventType["DownloadProgress"] = 3] = "DownloadProgress";
+ /**
+ * The full response including the body was received.
+ */
+ HttpEventType[HttpEventType["Response"] = 4] = "Response";
+ /**
+ * A custom event from an interceptor or a backend.
+ */
+ HttpEventType[HttpEventType["User"] = 5] = "User";
+})(HttpEventType || (HttpEventType = {}));
+/**
+ * Base class for both `HttpResponse` and `HttpHeaderResponse`.
+ *
+ * @publicApi
+ */
+class HttpResponseBase {
+ /**
+ * Super-constructor for all responses.
+ *
+ * The single parameter accepted is an initialization hash. Any properties
+ * of the response passed there will override the default values.
+ */
+ constructor(init, defaultStatus = 200 /* HttpStatusCode.Ok */, defaultStatusText = 'OK') {
+ // If the hash has values passed, use them to initialize the response.
+ // Otherwise use the default values.
+ this.headers = init.headers || new HttpHeaders();
+ this.status = init.status !== undefined ? init.status : defaultStatus;
+ this.statusText = init.statusText || defaultStatusText;
+ this.url = init.url || null;
+ // Cache the ok value to avoid defining a getter.
+ this.ok = this.status >= 200 && this.status < 300;
}
}
-function TuiInputNumberComponent_div_4_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "div", 6);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](1, TuiInputNumberComponent_div_4_ng_container_1_Template, 2, 1, "ng-container", 7);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]();
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"]();
- const _r4 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵreference"](9);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("polymorpheusOutlet", _r4);
+/**
+ * A partial HTTP response which only includes the status and header data,
+ * but no response body.
+ *
+ * `HttpHeaderResponse` is a `HttpEvent` available on the response
+ * event stream, only when progress events are requested.
+ *
+ * @publicApi
+ */
+class HttpHeaderResponse extends HttpResponseBase {
+ /**
+ * Create a new `HttpHeaderResponse` with the given parameters.
+ */
+ constructor(init = {}) {
+ super(init);
+ this.type = HttpEventType.ResponseHeader;
}
-}
-function TuiInputNumberComponent_section_5_Template(rf, ctx) {
- if (rf & 1) {
- const _r9 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetCurrentView"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "section", 8)(1, "button", 9);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click.prevent", function TuiInputNumberComponent_section_5_Template_button_click_prevent_1_listener() {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r9);
- const ctx_r8 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r8.onArrow(ctx_r8.step));
- })("mousedown.prevent", function TuiInputNumberComponent_section_5_Template_button_mousedown_prevent_1_listener() {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r9);
- const ctx_r10 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r10.nativeFocusableElement == null ? null : ctx_r10.nativeFocusableElement.focus());
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](2, " + ");
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](3, "button", 9);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("click.prevent", function TuiInputNumberComponent_section_5_Template_button_click_prevent_3_listener() {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r9);
- const ctx_r11 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r11.onArrow(-ctx_r11.step));
- })("mousedown.prevent", function TuiInputNumberComponent_section_5_Template_button_mousedown_prevent_3_listener() {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵrestoreView"](_r9);
- const ctx_r12 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"]();
- return _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵresetView"](ctx_r12.nativeFocusableElement == null ? null : ctx_r12.nativeFocusableElement.focus());
+ /**
+ * Copy this `HttpHeaderResponse`, overriding its contents with the
+ * given parameter hash.
+ */
+ clone(update = {}) {
+ // Perform a straightforward initialization of the new HttpHeaderResponse,
+ // overriding the current parameters with new ones if given.
+ return new HttpHeaderResponse({
+ headers: update.headers || this.headers,
+ status: update.status !== undefined ? update.status : this.status,
+ statusText: update.statusText || this.statusText,
+ url: update.url || this.url || undefined
});
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtext"](4, " - ");
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]()();
- }
- if (rf & 2) {
- const ctx_r2 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵnextContext"]();
- const _r0 = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵreference"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appearance", _r0.appearance)("disabled", !ctx_r2.canIncrement)("focusable", false)("icon", ctx_r2.options.icons.up);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("appearance", _r0.appearance)("disabled", !ctx_r2.canDecrement)("focusable", false)("icon", ctx_r2.options.icons.down);
}
}
-function TuiInputNumberComponent_ng_container_6_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementContainer"](0);
+/**
+ * A full HTTP response, including a typed response body (which may be `null`
+ * if one was not returned).
+ *
+ * `HttpResponse` is a `HttpEvent` available on the response event
+ * stream.
+ *
+ * @publicApi
+ */
+class HttpResponse extends HttpResponseBase {
+ /**
+ * Construct a new `HttpResponse`.
+ */
+ constructor(init = {}) {
+ super(init);
+ this.type = HttpEventType.Response;
+ this.body = init.body !== undefined ? init.body : null;
+ }
+ clone(update = {}) {
+ return new HttpResponse({
+ body: update.body !== undefined ? update.body : this.body,
+ headers: update.headers || this.headers,
+ status: update.status !== undefined ? update.status : this.status,
+ statusText: update.statusText || this.statusText,
+ url: update.url || this.url || undefined
+ });
}
}
-function TuiInputNumberComponent_ng_template_8_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojection"](0, 2);
+/**
+ * A response that represents an error or failure, either from a
+ * non-successful HTTP status, an error while executing the request,
+ * or some other failure which occurred during the parsing of the response.
+ *
+ * Any error returned on the `Observable` response stream will be
+ * wrapped in an `HttpErrorResponse` to provide additional context about
+ * the state of the HTTP layer when the error occurred. The error property
+ * will contain either a wrapped Error object or the error response returned
+ * from the server.
+ *
+ * @publicApi
+ */
+class HttpErrorResponse extends HttpResponseBase {
+ constructor(init) {
+ // Initialize with a default status of 0 / Unknown Error.
+ super(init, 0, 'Unknown Error');
+ this.name = 'HttpErrorResponse';
+ /**
+ * Errors are never okay, even when the status code is in the 2xx success range.
+ */
+ this.ok = false;
+ // If the response was successful, then this was a parse error. Otherwise, it was
+ // a protocol-level failure of some sort. Either the request failed in transit
+ // or the server returned an unsuccessful status code.
+ if (this.status >= 200 && this.status < 300) {
+ this.message = `Http failure during parsing for ${init.url || '(unknown url)'}`;
+ } else {
+ this.message = `Http failure response for ${init.url || '(unknown url)'}: ${init.status} ${init.statusText}`;
+ }
+ this.error = init.error || null;
}
}
-const _c0 = ["*", [["input"]], [["tuiContent"]]];
-const _c1 = ["*", "input", "tuiContent"];
-const TUI_INPUT_NUMBER_DEFAULT_OPTIONS = {
- icons: {
- up: 'tuiIconPlus',
- down: 'tuiIconMinus'
- },
- min: Number.MIN_SAFE_INTEGER,
- max: Number.MAX_SAFE_INTEGER,
- step: 0,
- decimal: 'not-zero',
- precision: 2
-};
+
/**
- * Default parameters for input count component
+ * Constructs an instance of `HttpRequestOptions` from a source `HttpMethodOptions` and
+ * the given `body`. This function clones the object and adds the body.
+ *
+ * Note that the `responseType` *options* value is a String that identifies the
+ * single data type of the response.
+ * A single overload version of the method handles each response type.
+ * The value of `responseType` cannot be a union, as the combined signature could imply.
+ *
*/
-const TUI_INPUT_NUMBER_OPTIONS = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiCreateToken)(TUI_INPUT_NUMBER_DEFAULT_OPTIONS);
-function tuiInputNumberOptionsProvider(options) {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_2__.tuiProvideOptions)(TUI_INPUT_NUMBER_OPTIONS, options, TUI_INPUT_NUMBER_DEFAULT_OPTIONS);
+function addBody(options, body) {
+ return {
+ body,
+ headers: options.headers,
+ context: options.context,
+ observe: options.observe,
+ params: options.params,
+ reportProgress: options.reportProgress,
+ responseType: options.responseType,
+ withCredentials: options.withCredentials
+ };
}
-const DEFAULT_MAX_LENGTH = 18;
-const TUI_NUMBER_VALUE_TRANSFORMER = new _angular_core__WEBPACK_IMPORTED_MODULE_1__.InjectionToken('');
-class TuiInputNumberComponent extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.AbstractTuiNullableControl {
- constructor(control, cdr, transformer, options, numberFormat, isIOS, textfieldSize, controller) {
- super(control, cdr, transformer);
- this.options = options;
- this.numberFormat = numberFormat;
- this.isIOS = isIOS;
- this.textfieldSize = textfieldSize;
- this.controller = controller;
- this.unfinishedValue = '';
- this.min = this.options.min;
- this.max = this.options.max;
- this.decimal = this.options.decimal;
- this.precision = this.options.precision;
- this.step = this.options.step;
- /** @deprecated use `tuiTextfieldPrefix` from {@link TuiTextfieldControllerModule} instead */
- this.prefix = '';
- /** @deprecated use `tuiTextfieldPostfix` from {@link TuiTextfieldControllerModule} instead */
- this.postfix = '';
- this.polymorpheusValueContent = _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.EMPTY_QUERY;
- }
- get size() {
- return this.textfieldSize.size;
- }
- get computedMin() {
- return this.computeMin(this.min, this.max);
- }
- get computedMax() {
- return this.computeMax(this.min, this.max);
- }
- get nativeFocusableElement() {
- return !this.textfield || this.computedDisabled ? null : this.textfield.nativeFocusableElement;
- }
- get focused() {
- var _a;
- return !!((_a = this.textfield) === null || _a === void 0 ? void 0 : _a.focused);
- }
- get isNegativeAllowed() {
- return this.computedMin < 0;
+/**
+ * Performs HTTP requests.
+ * This service is available as an injectable class, with methods to perform HTTP requests.
+ * Each request method has multiple signatures, and the return type varies based on
+ * the signature that is called (mainly the values of `observe` and `responseType`).
+ *
+ * Note that the `responseType` *options* value is a String that identifies the
+ * single data type of the response.
+ * A single overload version of the method handles each response type.
+ * The value of `responseType` cannot be a union, as the combined signature could imply.
+
+ *
+ * @usageNotes
+ * Sample HTTP requests for the [Tour of Heroes](/tutorial/tour-of-heroes/toh-pt0) application.
+ *
+ * ### HTTP Request Example
+ *
+ * ```
+ * // GET heroes whose name contains search term
+ * searchHeroes(term: string): observable{
+ *
+ * const params = new HttpParams({fromString: 'name=term'});
+ * return this.httpClient.request('GET', this.heroesUrl, {responseType:'json', params});
+ * }
+ * ```
+ *
+ * Alternatively, the parameter string can be used without invoking HttpParams
+ * by directly joining to the URL.
+ * ```
+ * this.httpClient.request('GET', this.heroesUrl + '?' + 'name=term', {responseType:'json'});
+ * ```
+ *
+ *
+ * ### JSONP Example
+ * ```
+ * requestJsonp(url, callback = 'callback') {
+ * return this.httpClient.jsonp(this.heroesURL, callback);
+ * }
+ * ```
+ *
+ * ### PATCH Example
+ * ```
+ * // PATCH one of the heroes' name
+ * patchHero (id: number, heroName: string): Observable<{}> {
+ * const url = `${this.heroesUrl}/${id}`; // PATCH api/heroes/42
+ * return this.httpClient.patch(url, {name: heroName}, httpOptions)
+ * .pipe(catchError(this.handleError('patchHero')));
+ * }
+ * ```
+ *
+ * @see [HTTP Guide](guide/understanding-communicating-with-http)
+ * @see [HTTP Request](api/common/http/HttpRequest)
+ *
+ * @publicApi
+ */
+class HttpClient {
+ constructor(handler) {
+ this.handler = handler;
}
- get inputMode() {
- if (this.isIOS && this.isNegativeAllowed) {
- // iPhone does not have minus sign if inputMode is equal to 'numeric' / 'decimal'
- return 'text';
+ /**
+ * Constructs an observable for a generic HTTP request that, when subscribed,
+ * fires the request through the chain of registered interceptors and on to the
+ * server.
+ *
+ * You can pass an `HttpRequest` directly as the only parameter. In this case,
+ * the call returns an observable of the raw `HttpEvent` stream.
+ *
+ * Alternatively you can pass an HTTP method as the first parameter,
+ * a URL string as the second, and an options hash containing the request body as the third.
+ * See `addBody()`. In this case, the specified `responseType` and `observe` options determine the
+ * type of returned observable.
+ * * The `responseType` value determines how a successful response body is parsed.
+ * * If `responseType` is the default `json`, you can pass a type interface for the resulting
+ * object as a type parameter to the call.
+ *
+ * The `observe` value determines the return type, according to what you are interested in
+ * observing.
+ * * An `observe` value of events returns an observable of the raw `HttpEvent` stream, including
+ * progress events by default.
+ * * An `observe` value of response returns an observable of `HttpResponse`,
+ * where the `T` parameter depends on the `responseType` and any optionally provided type
+ * parameter.
+ * * An `observe` value of body returns an observable of `` with the same `T` body type.
+ *
+ */
+ request(first, url, options = {}) {
+ let req;
+ // First, check whether the primary argument is an instance of `HttpRequest`.
+ if (first instanceof HttpRequest) {
+ // It is. The other arguments must be undefined (per the signatures) and can be
+ // ignored.
+ req = first;
+ } else {
+ // It's a string, so it represents a URL. Construct a request based on it,
+ // and incorporate the remaining arguments (assuming `GET` unless a method is
+ // provided.
+ // Figure out the headers.
+ let headers = undefined;
+ if (options.headers instanceof HttpHeaders) {
+ headers = options.headers;
+ } else {
+ headers = new HttpHeaders(options.headers);
+ }
+ // Sort out parameters.
+ let params = undefined;
+ if (!!options.params) {
+ if (options.params instanceof HttpParams) {
+ params = options.params;
+ } else {
+ params = new HttpParams({
+ fromObject: options.params
+ });
+ }
+ }
+ // Construct the request.
+ req = new HttpRequest(first, url, options.body !== undefined ? options.body : null, {
+ headers,
+ context: options.context,
+ params,
+ reportProgress: options.reportProgress,
+ // By default, JSON is assumed to be returned for all calls.
+ responseType: options.responseType || 'json',
+ withCredentials: options.withCredentials
+ });
+ }
+ // Start with an Observable.of() the initial request, and run the handler (which
+ // includes all interceptors) inside a concatMap(). This way, the handler runs
+ // inside an Observable chain, which causes interceptors to be re-run on every
+ // subscription (this also makes retries re-run the handler, including interceptors).
+ const events$ = (0,rxjs__WEBPACK_IMPORTED_MODULE_1__.of)(req).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_2__.concatMap)(req => this.handler.handle(req)));
+ // If coming via the API signature which accepts a previously constructed HttpRequest,
+ // the only option is to get the event stream. Otherwise, return the event stream if
+ // that is what was requested.
+ if (first instanceof HttpRequest || options.observe === 'events') {
+ return events$;
+ }
+ // The requested stream contains either the full response or the body. In either
+ // case, the first step is to filter the event stream to extract a stream of
+ // responses(s).
+ const res$ = events$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_3__.filter)(event => event instanceof HttpResponse));
+ // Decide which stream to return.
+ switch (options.observe || 'body') {
+ case 'body':
+ // The requested stream is the body. Map the response stream to the response
+ // body. This could be done more simply, but a misbehaving interceptor might
+ // transform the response body into a different format and ignore the requested
+ // responseType. Guard against this by validating that the response is of the
+ // requested type.
+ switch (req.responseType) {
+ case 'arraybuffer':
+ return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(res => {
+ // Validate that the body is an ArrayBuffer.
+ if (res.body !== null && !(res.body instanceof ArrayBuffer)) {
+ throw new Error('Response is not an ArrayBuffer.');
+ }
+ return res.body;
+ }));
+ case 'blob':
+ return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(res => {
+ // Validate that the body is a Blob.
+ if (res.body !== null && !(res.body instanceof Blob)) {
+ throw new Error('Response is not a Blob.');
+ }
+ return res.body;
+ }));
+ case 'text':
+ return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(res => {
+ // Validate that the body is a string.
+ if (res.body !== null && typeof res.body !== 'string') {
+ throw new Error('Response is not a string.');
+ }
+ return res.body;
+ }));
+ case 'json':
+ default:
+ // No validation needed for JSON responses, as they can be of any type.
+ return res$.pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_4__.map)(res => res.body));
+ }
+ case 'response':
+ // The response stream was requested directly, so return it.
+ return res$;
+ default:
+ // Guard against new future observe types being added.
+ throw new Error(`Unreachable: unhandled observe type ${options.observe}}`);
}
- return this.decimal === 'never' ? 'numeric' : 'decimal';
}
- get calculatedMaxLength() {
- const decimalPart = this.decimal !== 'never' && this.nativeValue.includes(this.numberFormat.decimalSeparator);
- const precision = decimalPart ? Math.min(this.precision + 1, 20) : 0;
- const takeThousand = this.numberFormat.thousandSeparator.repeat(5).length;
- return DEFAULT_MAX_LENGTH + precision + takeThousand;
+ /**
+ * Constructs an observable that, when subscribed, causes the configured
+ * `DELETE` request to execute on the server. See the individual overloads for
+ * details on the return type.
+ *
+ * @param url The endpoint URL.
+ * @param options The HTTP options to send with the request.
+ *
+ */
+ delete(url, options = {}) {
+ return this.request('DELETE', url, options);
}
- get formattedValue() {
- return this.value !== null ? this.getFormattedValue(this.value || 0) : '';
+ /**
+ * Constructs an observable that, when subscribed, causes the configured
+ * `GET` request to execute on the server. See the individual overloads for
+ * details on the return type.
+ */
+ get(url, options = {}) {
+ return this.request('GET', url, options);
}
- get computedValue() {
- return this.focused ? this.nativeValue : this.formattedValue;
+ /**
+ * Constructs an observable that, when subscribed, causes the configured
+ * `HEAD` request to execute on the server. The `HEAD` method returns
+ * meta information about the resource without transferring the
+ * resource itself. See the individual overloads for
+ * details on the return type.
+ */
+ head(url, options = {}) {
+ return this.request('HEAD', url, options);
}
- get canDecrement() {
- return this.interactive && (this.value || 0) > this.computedMin;
+ /**
+ * Constructs an `Observable` that, when subscribed, causes a request with the special method
+ * `JSONP` to be dispatched via the interceptor pipeline.
+ * The [JSONP pattern](https://en.wikipedia.org/wiki/JSONP) works around limitations of certain
+ * API endpoints that don't support newer,
+ * and preferable [CORS](https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS) protocol.
+ * JSONP treats the endpoint API as a JavaScript file and tricks the browser to process the
+ * requests even if the API endpoint is not located on the same domain (origin) as the client-side
+ * application making the request.
+ * The endpoint API must support JSONP callback for JSONP requests to work.
+ * The resource API returns the JSON response wrapped in a callback function.
+ * You can pass the callback function name as one of the query parameters.
+ * Note that JSONP requests can only be used with `GET` requests.
+ *
+ * @param url The resource URL.
+ * @param callbackParam The callback function name.
+ *
+ */
+ jsonp(url, callbackParam) {
+ return this.request('JSONP', url, {
+ params: new HttpParams().append(callbackParam, 'JSONP_CALLBACK'),
+ observe: 'body',
+ responseType: 'json'
+ });
}
- get canIncrement() {
- return this.interactive && (this.value || 0) < this.computedMax;
+ /**
+ * Constructs an `Observable` that, when subscribed, causes the configured
+ * `OPTIONS` request to execute on the server. This method allows the client
+ * to determine the supported HTTP methods and other capabilities of an endpoint,
+ * without implying a resource action. See the individual overloads for
+ * details on the return type.
+ */
+ options(url, options = {}) {
+ return this.request('OPTIONS', url, options);
}
- get computedPrefix() {
- return this.prefix || this.controller.prefix;
+ /**
+ * Constructs an observable that, when subscribed, causes the configured
+ * `PATCH` request to execute on the server. See the individual overloads for
+ * details on the return type.
+ */
+ patch(url, body, options = {}) {
+ return this.request('PATCH', url, addBody(options, body));
}
- get computedPostfix() {
- const postfix = this.postfix || this.controller.postfix;
- return postfix && ` ${postfix}`;
- }
- get mask() {
- return this.calculateMask(this.precision, this.decimal, this.numberFormat.decimalSeparator, this.numberFormat.thousandSeparator, this.computedMin, this.computedMax, this.computedPrefix, this.computedPostfix);
- }
- onArrow(step) {
- if (!step) {
- return;
- }
- this.value = (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_5__.tuiClamp)((this.value || 0) + step, this.computedMin, this.computedMax);
- this.nativeValue = this.formattedValue;
- }
- onValueChange(nativeValue) {
- const parsedValue = (0,_maskito_kit__WEBPACK_IMPORTED_MODULE_0__.maskitoParseNumber)(nativeValue, this.numberFormat.decimalSeparator);
- this.unfinishedValue = null;
- if (Number.isNaN(parsedValue)) {
- this.value = null;
- return;
- }
- if (this.isNativeValueNotFinished) {
- this.unfinishedValue = nativeValue;
- this.cdr.markForCheck();
- return;
- }
- if (parsedValue < this.computedMin || parsedValue > this.computedMax) {
- return;
- }
- this.value = parsedValue;
- }
- onFocused(focused) {
- this.updateFocused(focused);
- const nativeNumberValue = this.unfinishedValue ? (0,_maskito_kit__WEBPACK_IMPORTED_MODULE_0__.maskitoParseNumber)(this.unfinishedValue, this.numberFormat.decimalSeparator) : this.nativeNumberValue;
- this.unfinishedValue = null;
- if (Number.isNaN(nativeNumberValue)) {
- this.nativeValue = focused && !this.readOnly ? this.computedPrefix + this.computedPostfix : '';
- this.value = null;
- return;
- }
- if (!focused) {
- this.value = nativeNumberValue;
- this.nativeValue = this.formattedValue;
- }
- }
- getFormattedValue(value) {
- const absValue = Math.abs(value);
- const hasFraction = absValue % 1 > 0;
- let decimalLimit = this.decimal === 'always' || hasFraction && this.decimal !== 'never' ? this.precision : 0;
- const fraction = hasFraction ? (0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.tuiGetFractionPartPadded)(value, this.precision) : '';
- if (this.focused && this.decimal !== 'always') {
- decimalLimit = fraction.length;
- }
- return this.computedPrefix + (0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.tuiFormatNumber)(value, Object.assign(Object.assign({}, this.numberFormat), {
- decimalLimit
- })).replace(_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.CHAR_HYPHEN, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_4__.CHAR_MINUS) + this.computedPostfix;
- }
- get isNativeValueNotFinished() {
- const nativeNumberValue = this.nativeNumberValue;
- return nativeNumberValue < 0 ? nativeNumberValue > this.computedMax : nativeNumberValue < this.computedMin;
- }
- get nativeValue() {
- var _a;
- return ((_a = this.nativeFocusableElement) === null || _a === void 0 ? void 0 : _a.value) || '';
- }
- set nativeValue(value) {
- if (!this.textfield || !this.nativeFocusableElement) {
- return;
- }
- this.textfield.value = value;
- this.nativeFocusableElement.value = value;
- }
- writeValue(value) {
- super.writeValue(value);
- this.nativeValue = this.formattedValue;
- }
- get nativeNumberValue() {
- return (0,_maskito_kit__WEBPACK_IMPORTED_MODULE_0__.maskitoParseNumber)(this.nativeValue, this.numberFormat.decimalSeparator);
- }
- computeMin(min, max) {
- var _a, _b, _c, _d, _e, _f;
- return Math.min((_c = (_b = (_a = this.valueTransformer) === null || _a === void 0 ? void 0 : _a.fromControlValue(min)) !== null && _b !== void 0 ? _b : min) !== null && _c !== void 0 ? _c : this.options.min, (_f = (_e = (_d = this.valueTransformer) === null || _d === void 0 ? void 0 : _d.fromControlValue(max)) !== null && _e !== void 0 ? _e : max) !== null && _f !== void 0 ? _f : this.options.max);
- }
- computeMax(min, max) {
- var _a, _b, _c, _d, _e, _f;
- return Math.max((_c = (_b = (_a = this.valueTransformer) === null || _a === void 0 ? void 0 : _a.fromControlValue(min)) !== null && _b !== void 0 ? _b : min) !== null && _c !== void 0 ? _c : this.options.min, (_f = (_e = (_d = this.valueTransformer) === null || _d === void 0 ? void 0 : _d.fromControlValue(max)) !== null && _e !== void 0 ? _e : max) !== null && _f !== void 0 ? _f : this.options.max);
+ /**
+ * Constructs an observable that, when subscribed, causes the configured
+ * `POST` request to execute on the server. The server responds with the location of
+ * the replaced resource. See the individual overloads for
+ * details on the return type.
+ */
+ post(url, body, options = {}) {
+ return this.request('POST', url, addBody(options, body));
}
- calculateMask(precision, decimalMode, decimalSeparator, thousandSeparator, min, max, prefix, postfix) {
- const _a = (0,_maskito_kit__WEBPACK_IMPORTED_MODULE_0__.maskitoNumberOptionsGenerator)({
- decimalSeparator,
- thousandSeparator,
- min,
- max,
- prefix,
- postfix,
- precision: decimalMode === 'never' ? 0 : precision,
- decimalZeroPadding: decimalMode === 'always'
- }),
- {
- plugins
- } = _a,
- options = (0,tslib__WEBPACK_IMPORTED_MODULE_7__.__rest)(_a, ["plugins"]);
- return Object.assign(Object.assign({}, options), {
- plugins: [...plugins, (0,_maskito_kit__WEBPACK_IMPORTED_MODULE_0__.maskitoCaretGuard)(value => [prefix.length, value.length - postfix.length])]
- });
+ /**
+ * Constructs an observable that, when subscribed, causes the configured
+ * `PUT` request to execute on the server. The `PUT` method replaces an existing resource
+ * with a new set of values.
+ * See the individual overloads for details on the return type.
+ */
+ put(url, body, options = {}) {
+ return this.request('PUT', url, addBody(options, body));
}
}
-TuiInputNumberComponent.ɵfac = function TuiInputNumberComponent_Factory(t) {
- return new (t || TuiInputNumberComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_forms__WEBPACK_IMPORTED_MODULE_8__.NgControl, 10), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](TUI_NUMBER_VALUE_TRANSFORMER, 8), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](TUI_INPUT_NUMBER_OPTIONS), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__.TUI_NUMBER_FORMAT), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.TUI_IS_IOS), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TUI_TEXTFIELD_SIZE), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TUI_TEXTFIELD_WATCHED_CONTROLLER));
+_HttpClient = HttpClient;
+_HttpClient.ɵfac = function _HttpClient_Factory(t) {
+ return new (t || _HttpClient)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](HttpHandler));
};
-TuiInputNumberComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineComponent"]({
- type: TuiInputNumberComponent,
- selectors: [["tui-input-number"]],
- contentQueries: function TuiInputNumberComponent_ContentQueries(rf, ctx, dirIndex) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵcontentQuery"](dirIndex, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_12__.PolymorpheusOutletDirective, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵloadQuery"]()) && (ctx.polymorpheusValueContent = _t);
- }
- },
- viewQuery: function TuiInputNumberComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵviewQuery"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_13__.TuiPrimitiveTextfieldComponent, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵloadQuery"]()) && (ctx.textfield = _t.first);
- }
- },
- hostVars: 1,
- hostBindings: function TuiInputNumberComponent_HostBindings(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("keydown.arrowDown", function TuiInputNumberComponent_keydown_arrowDown_HostBindingHandler() {
- return ctx.onArrow(-ctx.step);
- })("keydown.arrowUp", function TuiInputNumberComponent_keydown_arrowUp_HostBindingHandler() {
- return ctx.onArrow(ctx.step);
- });
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵattribute"]("data-size", ctx.size);
- }
- },
- inputs: {
- min: "min",
- max: "max",
- decimal: "decimal",
- precision: "precision",
- step: "step",
- prefix: "prefix",
- postfix: "postfix"
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiAsFocusableItemAccessor)(TuiInputNumberComponent), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiAsControl)(TuiInputNumberComponent), _taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TEXTFIELD_CONTROLLER_PROVIDER]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]],
- ngContentSelectors: _c1,
- decls: 10,
- vars: 14,
- consts: [["tuiTextfieldPostfix", "", "tuiTextfieldPrefix", "", "tuiValueAccessor", "", 1, "t-textfield", 3, "disabled", "focusable", "invalid", "maskito", "pseudoActive", "pseudoFocus", "pseudoHover", "readOnly", "value", "focusedChange", "valueChange"], ["textfield", ""], ["ngProjectAs", "tuiContent", "class", "t-value-content", 5, ["tuiContent"], 4, "ngIf"], ["class", "t-buttons", 4, "ngIf"], [4, "ngIf"], ["valueContent", ""], ["ngProjectAs", "tuiContent", 5, ["tuiContent"], 1, "t-value-content"], [4, "polymorpheusOutlet"], [1, "t-buttons"], ["size", "s", "tuiIconButton", "", "type", "button", 1, "t-button", 3, "appearance", "disabled", "focusable", "icon", "click.prevent", "mousedown.prevent"]],
- template: function TuiInputNumberComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojectionDef"](_c0);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementStart"](0, "tui-primitive-textfield", 0, 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵlistener"]("focusedChange", function TuiInputNumberComponent_Template_tui_primitive_textfield_focusedChange_0_listener($event) {
- return ctx.onFocused($event);
- })("valueChange", function TuiInputNumberComponent_Template_tui_primitive_textfield_valueChange_0_listener($event) {
- return ctx.onValueChange($event);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojection"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵprojection"](3, 1, ["ngProjectAs", "input", 5, ["input"]]);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](4, TuiInputNumberComponent_div_4_Template, 2, 1, "div", 2);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵelementEnd"]();
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](5, TuiInputNumberComponent_section_5_Template, 5, 8, "section", 3);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](6, TuiInputNumberComponent_ng_container_6_Template, 1, 0, "ng-container", 4);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipe"](7, "async");
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplate"](8, TuiInputNumberComponent_ng_template_8_Template, 1, 0, "ng-template", null, 5, _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵtemplateRefExtractor"]);
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("disabled", ctx.computedDisabled)("focusable", ctx.focusable)("invalid", ctx.computedInvalid)("maskito", ctx.mask)("pseudoActive", ctx.pseudoActive)("pseudoFocus", ctx.computedFocused)("pseudoHover", ctx.pseudoHover)("readOnly", ctx.readOnly)("value", ctx.computedValue);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](4);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngIf", ctx.polymorpheusValueContent.length);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngIf", ctx.step);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵproperty"]("ngIf", _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵpipeBind1"](7, 12, ctx.polymorpheusValueContent.changes));
- }
- },
- dependencies: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_13__.TuiPrimitiveTextfieldComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_14__.TuiButtonComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_13__.TuiPrimitiveTextfieldDirective, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TuiTextfieldPostfixDirective, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TuiTextfieldPrefixDirective, _taiga_ui_kit_directives__WEBPACK_IMPORTED_MODULE_15__.TuiValueAccessorDirective, _maskito_angular__WEBPACK_IMPORTED_MODULE_16__.MaskitoDirective, _angular_common__WEBPACK_IMPORTED_MODULE_17__.NgIf, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_12__.PolymorpheusOutletDirective, _angular_common__WEBPACK_IMPORTED_MODULE_17__.AsyncPipe],
- styles: ["[_nghost-%COMP%]{display:flex;border-radius:var(--tui-radius-m);text-align:left}.t-textfield[_ngcontent-%COMP%]{flex:1;max-width:100%;border-radius:inherit;text-align:inherit}.t-textfield[_ngcontent-%COMP%]:not(:last-child){border-top-right-radius:0;border-bottom-right-radius:0}.t-value-content[_ngcontent-%COMP%]{width:100%}.t-buttons[_ngcontent-%COMP%]{display:flex;flex-direction:column;align-items:stretch;margin-left:.125rem;border-radius:inherit}[data-size=s][_ngcontent-%COMP%] + .t-buttons[_ngcontent-%COMP%]{flex-direction:row-reverse}[data-size=s][_ngcontent-%COMP%] + .t-buttons[_ngcontent-%COMP%] .t-button[_ngcontent-%COMP%]:first-child{margin:0 0 0 .125rem;border-top-right-radius:inherit;border-bottom-right-radius:inherit}[data-size=s][_ngcontent-%COMP%] + .t-buttons[_ngcontent-%COMP%] .t-button[_ngcontent-%COMP%]:last-child{border-radius:0}[data-size=m][_ngcontent-%COMP%] + .t-buttons[_ngcontent-%COMP%] .t-button[_ngcontent-%COMP%]{width:calc(var(--tui-height-m) * .75)}[data-size=l][_ngcontent-%COMP%] + .t-buttons[_ngcontent-%COMP%] .t-button[_ngcontent-%COMP%]{width:calc(var(--tui-height-l) * .75)}.t-buttons[_ngcontent-%COMP%] .t-button[_ngcontent-%COMP%]{display:flex;flex:1;height:auto;border-radius:0}.t-buttons[_ngcontent-%COMP%] .t-button[_ngcontent-%COMP%]:first-child{margin-bottom:.125rem;border-top-right-radius:inherit}.t-buttons[_ngcontent-%COMP%] .t-button[_ngcontent-%COMP%]:last-child{border-bottom-right-radius:inherit}"],
- changeDetection: 0
+_HttpClient.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
+ token: _HttpClient,
+ factory: _HttpClient.ɵfac
});
-(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.tuiPure], TuiInputNumberComponent.prototype, "computeMin", null);
-(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.tuiPure], TuiInputNumberComponent.prototype, "computeMax", null);
-(0,tslib__WEBPACK_IMPORTED_MODULE_7__.__decorate)([_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_18__.tuiPure], TuiInputNumberComponent.prototype, "calculateMask", null);
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiInputNumberComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Component,
- args: [{
- selector: 'tui-input-number',
- templateUrl: './input-number.template.html',
- styleUrls: ['./input-number.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectionStrategy.OnPush,
- providers: [(0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.tuiAsFocusableItemAccessor)(TuiInputNumberComponent), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.tuiAsControl)(TuiInputNumberComponent), _taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TEXTFIELD_CONTROLLER_PROVIDER]
- }]
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](HttpClient, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable
}], function () {
return [{
- type: _angular_forms__WEBPACK_IMPORTED_MODULE_8__.NgControl,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_forms__WEBPACK_IMPORTED_MODULE_8__.NgControl]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_1__.ChangeDetectorRef]
- }]
- }, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_3__.AbstractTuiValueTransformer,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [TUI_NUMBER_VALUE_TRANSFORMER]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [TUI_INPUT_NUMBER_OPTIONS]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__.TUI_NUMBER_FORMAT]
- }]
- }, {
- type: undefined,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_10__.TUI_IS_IOS]
- }]
- }, {
- type: _taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TuiTextfieldSizeDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TUI_TEXTFIELD_SIZE]
- }]
- }, {
- type: _taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TuiTextfieldController,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TUI_TEXTFIELD_WATCHED_CONTROLLER]
- }]
+ type: HttpHandler
}];
- }, {
- textfield: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ViewChild,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_13__.TuiPrimitiveTextfieldComponent]
- }],
- min: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- max: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- decimal: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- precision: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- step: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- prefix: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- postfix: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Input
- }],
- polymorpheusValueContent: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.ContentChildren,
- args: [_tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_12__.PolymorpheusOutletDirective, {
- descendants: true
- }]
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostBinding,
- args: ['attr.data-size']
- }],
- onArrow: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostListener,
- args: ['keydown.arrowDown', ['-step']]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.HostListener,
- args: ['keydown.arrowUp', ['step']]
- }],
- computeMin: [],
- computeMax: [],
- calculateMask: []
- });
+ }, null);
})();
-class TuiInputNumberDirective extends _taiga_ui_core__WEBPACK_IMPORTED_MODULE_19__.AbstractTuiTextfieldHost {
- get value() {
- return this.host.computedValue;
+const XSSI_PREFIX$1 = /^\)\]\}',?\n/;
+const REQUEST_URL_HEADER = `X-Request-URL`;
+/**
+ * Determine an appropriate URL for the response, by checking either
+ * response url or the X-Request-URL header.
+ */
+function getResponseUrl$1(response) {
+ if (response.url) {
+ return response.url;
}
- onValueChange(value) {
- this.host.onValueChange(value);
+ // stored as lowercase in the map
+ const xRequestUrl = REQUEST_URL_HEADER.toLocaleLowerCase();
+ return response.headers.get(xRequestUrl);
+}
+/**
+ * Uses `fetch` to send requests to a backend server.
+ *
+ * This `FetchBackend` requires the support of the
+ * [Fetch API](https://developer.mozilla.org/en-US/docs/Web/API/Fetch_API) which is available on all
+ * supported browsers and on Node.js v18 or later.
+ *
+ * @see {@link HttpHandler}
+ *
+ * @publicApi
+ * @developerPreview
+ */
+class FetchBackend {
+ constructor() {
+ // We need to bind the native fetch to its context or it will throw an "illegal invocation"
+ this.fetchImpl = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(FetchFactory, {
+ optional: true
+ })?.fetch ?? fetch.bind(globalThis);
+ this.ngZone = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__.NgZone);
}
- ngDoCheck() {
- if (!this.host.nativeFocusableElement) {
- return;
+ handle(request) {
+ return new rxjs__WEBPACK_IMPORTED_MODULE_6__.Observable(observer => {
+ const aborter = new AbortController();
+ this.doRequest(request, aborter.signal, observer).then(noop, error => observer.error(new HttpErrorResponse({
+ error
+ })));
+ return () => aborter.abort();
+ });
+ }
+ doRequest(request, signal, observer) {
+ var _this = this;
+ return (0,_home_runner_work_ng_morph_ng_morph_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
+ const init = _this.createRequestInit(request);
+ let response;
+ try {
+ const fetchPromise = _this.fetchImpl(request.urlWithParams, {
+ signal,
+ ...init
+ });
+ // Make sure Zone.js doesn't trigger false-positive unhandled promise
+ // error in case the Promise is rejected synchronously. See function
+ // description for additional information.
+ silenceSuperfluousUnhandledPromiseRejection(fetchPromise);
+ // Send the `Sent` event before awaiting the response.
+ observer.next({
+ type: HttpEventType.Sent
+ });
+ response = yield fetchPromise;
+ } catch (error) {
+ observer.error(new HttpErrorResponse({
+ error,
+ status: error.status ?? 0,
+ statusText: error.statusText,
+ url: request.urlWithParams,
+ headers: error.headers
+ }));
+ return;
+ }
+ const headers = new HttpHeaders(response.headers);
+ const statusText = response.statusText;
+ const url = getResponseUrl$1(response) ?? request.urlWithParams;
+ let status = response.status;
+ let body = null;
+ if (request.reportProgress) {
+ observer.next(new HttpHeaderResponse({
+ headers,
+ status,
+ statusText,
+ url
+ }));
+ }
+ if (response.body) {
+ // Read Progress
+ const contentLength = response.headers.get('content-length');
+ const chunks = [];
+ const reader = response.body.getReader();
+ let receivedLength = 0;
+ let decoder;
+ let partialText;
+ // We have to check whether the Zone is defined in the global scope because this may be called
+ // when the zone is nooped.
+ const reqZone = typeof Zone !== 'undefined' && Zone.current;
+ // Perform response processing outside of Angular zone to
+ // ensure no excessive change detection runs are executed
+ // Here calling the async ReadableStreamDefaultReader.read() is responsible for triggering CD
+ yield _this.ngZone.runOutsideAngular(/*#__PURE__*/(0,_home_runner_work_ng_morph_ng_morph_node_modules_babel_runtime_helpers_esm_asyncToGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"])(function* () {
+ while (true) {
+ const {
+ done,
+ value
+ } = yield reader.read();
+ if (done) {
+ break;
+ }
+ chunks.push(value);
+ receivedLength += value.length;
+ if (request.reportProgress) {
+ partialText = request.responseType === 'text' ? (partialText ?? '') + (decoder ?? (decoder = new TextDecoder())).decode(value, {
+ stream: true
+ }) : undefined;
+ const reportProgress = () => observer.next({
+ type: HttpEventType.DownloadProgress,
+ total: contentLength ? +contentLength : undefined,
+ loaded: receivedLength,
+ partialText
+ });
+ reqZone ? reqZone.run(reportProgress) : reportProgress();
+ }
+ }
+ }));
+ // Combine all chunks.
+ const chunksAll = _this.concatChunks(chunks, receivedLength);
+ try {
+ body = _this.parseBody(request, chunksAll);
+ } catch (error) {
+ // Body loading or parsing failed
+ observer.error(new HttpErrorResponse({
+ error,
+ headers: new HttpHeaders(response.headers),
+ status: response.status,
+ statusText: response.statusText,
+ url: getResponseUrl$1(response) ?? request.urlWithParams
+ }));
+ return;
+ }
+ }
+ // Same behavior as the XhrBackend
+ if (status === 0) {
+ status = body ? 200 /* HttpStatusCode.Ok */ : 0;
+ }
+ // ok determines whether the response will be transmitted on the event or
+ // error channel. Unsuccessful status codes (not 2xx) will always be errors,
+ // but a successful status code can still result in an error if the user
+ // asked for JSON data and the body cannot be parsed as such.
+ const ok = status >= 200 && status < 300;
+ if (ok) {
+ observer.next(new HttpResponse({
+ body,
+ headers,
+ status,
+ statusText,
+ url
+ }));
+ // The full body has been received and delivered, no further events
+ // are possible. This request is complete.
+ observer.complete();
+ } else {
+ observer.error(new HttpErrorResponse({
+ error: body,
+ headers,
+ status,
+ statusText,
+ url
+ }));
+ }
+ })();
+ }
+ parseBody(request, binContent) {
+ switch (request.responseType) {
+ case 'json':
+ // stripping the XSSI when present
+ const text = new TextDecoder().decode(binContent).replace(XSSI_PREFIX$1, '');
+ return text === '' ? null : JSON.parse(text);
+ case 'text':
+ return new TextDecoder().decode(binContent);
+ case 'blob':
+ return new Blob([binContent]);
+ case 'arraybuffer':
+ return binContent.buffer;
}
- this.host.nativeFocusableElement.inputMode = this.host.inputMode;
- this.host.nativeFocusableElement.maxLength = this.host.nativeFocusableElement.maxLength > 0 ? this.host.nativeFocusableElement.maxLength : this.host.calculatedMaxLength;
+ }
+ createRequestInit(req) {
+ var _Accept;
+ // We could share some of this logic with the XhrBackend
+ const headers = {};
+ const credentials = req.withCredentials ? 'include' : undefined;
+ // Setting all the requested headers.
+ req.headers.forEach((name, values) => headers[name] = values.join(','));
+ // Add an Accept header if one isn't present already.
+ headers[_Accept = 'Accept'] ?? (headers[_Accept] = 'application/json, text/plain, */*');
+ // Auto-detect the Content-Type header if one isn't present already.
+ if (!headers['Content-Type']) {
+ const detectedType = req.detectContentTypeHeader();
+ // Sometimes Content-Type detection fails.
+ if (detectedType !== null) {
+ headers['Content-Type'] = detectedType;
+ }
+ }
+ return {
+ body: req.serializeBody(),
+ method: req.method,
+ headers,
+ credentials
+ };
+ }
+ concatChunks(chunks, totalLength) {
+ const chunksAll = new Uint8Array(totalLength);
+ let position = 0;
+ for (const chunk of chunks) {
+ chunksAll.set(chunk, position);
+ position += chunk.length;
+ }
+ return chunksAll;
}
}
-TuiInputNumberDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiInputNumberDirective_BaseFactory;
- return function TuiInputNumberDirective_Factory(t) {
- return (ɵTuiInputNumberDirective_BaseFactory || (ɵTuiInputNumberDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵgetInheritedFactory"](TuiInputNumberDirective)))(t || TuiInputNumberDirective);
- };
-}();
-TuiInputNumberDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineDirective"]({
- type: TuiInputNumberDirective,
- selectors: [["tui-input-number"]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵProvidersFeature"]([(0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__.tuiAsTextfieldHost)(TuiInputNumberDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiInputNumberDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.Directive,
- args: [{
- selector: 'tui-input-number',
- providers: [(0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_9__.tuiAsTextfieldHost)(TuiInputNumberDirective)]
- }]
- }], null, null);
-})();
-class TuiInputNumberModule {}
-TuiInputNumberModule.ɵfac = function TuiInputNumberModule_Factory(t) {
- return new (t || TuiInputNumberModule)();
+_FetchBackend = FetchBackend;
+_FetchBackend.ɵfac = function _FetchBackend_Factory(t) {
+ return new (t || _FetchBackend)();
};
-TuiInputNumberModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineNgModule"]({
- type: TuiInputNumberModule
-});
-TuiInputNumberModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_17__.CommonModule, _maskito_angular__WEBPACK_IMPORTED_MODULE_16__.MaskitoModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_13__.TuiPrimitiveTextfieldModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TuiTextfieldControllerModule, _taiga_ui_kit_directives__WEBPACK_IMPORTED_MODULE_15__.TuiValueAccessorModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_12__.PolymorpheusModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_14__.TuiButtonModule]]
+_FetchBackend.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
+ token: _FetchBackend,
+ factory: _FetchBackend.ɵfac
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_1__["ɵsetClassMetadata"](TuiInputNumberModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_1__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_17__.CommonModule, _maskito_angular__WEBPACK_IMPORTED_MODULE_16__.MaskitoModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_13__.TuiPrimitiveTextfieldModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_11__.TuiTextfieldControllerModule, _taiga_ui_kit_directives__WEBPACK_IMPORTED_MODULE_15__.TuiValueAccessorModule, _tinkoff_ng_polymorpheus__WEBPACK_IMPORTED_MODULE_12__.PolymorpheusModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_14__.TuiButtonModule],
- declarations: [TuiInputNumberComponent, TuiInputNumberDirective],
- exports: [TuiInputNumberComponent, TuiInputNumberDirective, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_13__.TuiTextfieldComponent]
- }]
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](FetchBackend, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable
}], null, null);
})();
-
/**
- * Generated bundle index. Do not edit.
+ * Abstract class to provide a mocked implementation of `fetch()`
*/
-
-
-
-/***/ }),
-
-/***/ 2912:
-/*!******************************************************************************!*\
- !*** ./node_modules/@taiga-ui/kit/fesm2015/taiga-ui-kit-components-input.js ***!
- \******************************************************************************/
-/***/ ((__unused_webpack_module, __webpack_exports__, __webpack_require__) => {
-
-__webpack_require__.r(__webpack_exports__);
-/* harmony export */ __webpack_require__.d(__webpack_exports__, {
-/* harmony export */ TuiInputComponent: () => (/* binding */ TuiInputComponent),
-/* harmony export */ TuiInputDirective: () => (/* binding */ TuiInputDirective),
-/* harmony export */ TuiInputModule: () => (/* binding */ TuiInputModule)
-/* harmony export */ });
-/* harmony import */ var _angular_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @angular/core */ 6623);
-/* harmony import */ var _angular_forms__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @angular/forms */ 8015);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @taiga-ui/cdk */ 625);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @taiga-ui/cdk */ 5071);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @taiga-ui/cdk */ 3573);
-/* harmony import */ var _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @taiga-ui/cdk */ 1355);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @taiga-ui/core */ 1443);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @taiga-ui/core */ 6345);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @taiga-ui/core */ 1460);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @taiga-ui/core */ 8623);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @taiga-ui/core */ 3359);
-/* harmony import */ var _taiga_ui_core__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! @taiga-ui/core */ 9139);
-/* harmony import */ var _taiga_ui_kit_providers__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @taiga-ui/kit/providers */ 5719);
-/* harmony import */ var _angular_common__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! @angular/common */ 9191);
-
-
-
-
-
-
-
-
-
-
-const _c0 = ["*", [["input"]]];
-const _c1 = ["*", "input"];
-class TuiInputComponent extends _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiControl {
- constructor(control, cdr, textfieldSize, valueTransformer) {
- super(control, cdr, valueTransformer);
- this.textfieldSize = textfieldSize;
- this.open = false;
- }
- get size() {
- return this.textfieldSize.size;
- }
- get nativeFocusableElement() {
- return this.computedDisabled || !this.textfield ? null : this.textfield.nativeFocusableElement;
- }
- get focused() {
- return (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_1__.tuiIsNativeFocused)(this.nativeFocusableElement) || !!this.hostedDropdown && this.hostedDropdown.focused;
- }
- get canOpen() {
- return this.interactive && !!this.datalist;
- }
- onValueChange(value) {
- this.value = value;
- this.open = true;
- }
- onActiveZone(active) {
- this.updateFocused(active);
- }
- handleOption(item) {
- this.setNativeValue(String(item));
- this.focusInput();
- this.value = String(item);
- this.open = false;
- }
- getFallbackValue() {
- return '';
- }
- focusInput(preventScroll = false) {
- if (this.nativeFocusableElement) {
- this.nativeFocusableElement.focus({
- preventScroll
- });
+class FetchFactory {}
+function noop() {}
+/**
+ * Zone.js treats a rejected promise that has not yet been awaited
+ * as an unhandled error. This function adds a noop `.then` to make
+ * sure that Zone.js doesn't throw an error if the Promise is rejected
+ * synchronously.
+ */
+function silenceSuperfluousUnhandledPromiseRejection(promise) {
+ promise.then(noop, noop);
+}
+function interceptorChainEndFn(req, finalHandlerFn) {
+ return finalHandlerFn(req);
+}
+/**
+ * Constructs a `ChainedInterceptorFn` which adapts a legacy `HttpInterceptor` to the
+ * `ChainedInterceptorFn` interface.
+ */
+function adaptLegacyInterceptorToChain(chainTailFn, interceptor) {
+ return (initialRequest, finalHandlerFn) => interceptor.intercept(initialRequest, {
+ handle: downstreamRequest => chainTailFn(downstreamRequest, finalHandlerFn)
+ });
+}
+/**
+ * Constructs a `ChainedInterceptorFn` which wraps and invokes a functional interceptor in the given
+ * injector.
+ */
+function chainedInterceptorFn(chainTailFn, interceptorFn, injector) {
+ // clang-format off
+ return (initialRequest, finalHandlerFn) => injector.runInContext(() => interceptorFn(initialRequest, downstreamRequest => chainTailFn(downstreamRequest, finalHandlerFn)));
+ // clang-format on
+}
+/**
+ * A multi-provider token that represents the array of registered
+ * `HttpInterceptor` objects.
+ *
+ * @publicApi
+ */
+const HTTP_INTERCEPTORS = new _angular_core__WEBPACK_IMPORTED_MODULE_5__.InjectionToken(ngDevMode ? 'HTTP_INTERCEPTORS' : '');
+/**
+ * A multi-provided token of `HttpInterceptorFn`s.
+ */
+const HTTP_INTERCEPTOR_FNS = new _angular_core__WEBPACK_IMPORTED_MODULE_5__.InjectionToken(ngDevMode ? 'HTTP_INTERCEPTOR_FNS' : '');
+/**
+ * A multi-provided token of `HttpInterceptorFn`s that are only set in root.
+ */
+const HTTP_ROOT_INTERCEPTOR_FNS = new _angular_core__WEBPACK_IMPORTED_MODULE_5__.InjectionToken(ngDevMode ? 'HTTP_ROOT_INTERCEPTOR_FNS' : '');
+/**
+ * Creates an `HttpInterceptorFn` which lazily initializes an interceptor chain from the legacy
+ * class-based interceptors and runs the request through it.
+ */
+function legacyInterceptorFnFactory() {
+ let chain = null;
+ return (req, handler) => {
+ if (chain === null) {
+ const interceptors = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(HTTP_INTERCEPTORS, {
+ optional: true
+ }) ?? [];
+ // Note: interceptors are wrapped right-to-left so that final execution order is
+ // left-to-right. That is, if `interceptors` is the array `[a, b, c]`, we want to
+ // produce a chain that is conceptually `c(b(a(end)))`, which we build from the inside
+ // out.
+ chain = interceptors.reduceRight(adaptLegacyInterceptorToChain, interceptorChainEndFn);
}
+ const pendingTasks = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵInitialRenderPendingTasks"]);
+ const taskId = pendingTasks.add();
+ return chain(req, handler).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.finalize)(() => pendingTasks.remove(taskId)));
+ };
+}
+class HttpInterceptorHandler extends HttpHandler {
+ constructor(backend, injector) {
+ super();
+ this.backend = backend;
+ this.injector = injector;
+ this.chain = null;
+ this.pendingTasks = (0,_angular_core__WEBPACK_IMPORTED_MODULE_5__.inject)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵInitialRenderPendingTasks"]);
}
- setNativeValue(value) {
- if (this.nativeFocusableElement) {
- this.nativeFocusableElement.value = value;
+ handle(initialRequest) {
+ if (this.chain === null) {
+ const dedupedInterceptorFns = Array.from(new Set([...this.injector.get(HTTP_INTERCEPTOR_FNS), ...this.injector.get(HTTP_ROOT_INTERCEPTOR_FNS, [])]));
+ // Note: interceptors are wrapped right-to-left so that final execution order is
+ // left-to-right. That is, if `dedupedInterceptorFns` is the array `[a, b, c]`, we want to
+ // produce a chain that is conceptually `c(b(a(end)))`, which we build from the inside
+ // out.
+ this.chain = dedupedInterceptorFns.reduceRight((nextSequencedFn, interceptorFn) => chainedInterceptorFn(nextSequencedFn, interceptorFn, this.injector), interceptorChainEndFn);
}
+ const taskId = this.pendingTasks.add();
+ return this.chain(initialRequest, downstreamRequest => this.backend.handle(downstreamRequest)).pipe((0,rxjs_operators__WEBPACK_IMPORTED_MODULE_7__.finalize)(() => this.pendingTasks.remove(taskId)));
}
}
-TuiInputComponent.ɵfac = function TuiInputComponent_Factory(t) {
- return new (t || TuiInputComponent)(_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControl, 10), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_TEXTFIELD_SIZE), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdirectiveInject"](_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiValueTransformer, 8));
+_HttpInterceptorHandler = HttpInterceptorHandler;
+_HttpInterceptorHandler.ɵfac = function _HttpInterceptorHandler_Factory(t) {
+ return new (t || _HttpInterceptorHandler)(_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](HttpBackend), _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵinject"](_angular_core__WEBPACK_IMPORTED_MODULE_5__.EnvironmentInjector));
};
-TuiInputComponent.ɵcmp = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineComponent"]({
- type: TuiInputComponent,
- selectors: [["tui-input"]],
- contentQueries: function TuiInputComponent_ContentQueries(rf, ctx, dirIndex) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵcontentQuery"](dirIndex, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__.TuiDataListDirective, 5, _angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵloadQuery"]()) && (ctx.datalist = _t.first);
- }
- },
- viewQuery: function TuiInputComponent_Query(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵviewQuery"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TuiHostedDropdownComponent, 5);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵviewQuery"](_taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.TuiPrimitiveTextfieldComponent, 5);
- }
- if (rf & 2) {
- let _t;
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵloadQuery"]()) && (ctx.hostedDropdown = _t.first);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵqueryRefresh"](_t = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵloadQuery"]()) && (ctx.textfield = _t.first);
- }
- },
- hostVars: 1,
- hostBindings: function TuiInputComponent_HostBindings(rf, ctx) {
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵattribute"]("data-size", ctx.size);
- }
- },
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([_taiga_ui_kit_providers__WEBPACK_IMPORTED_MODULE_8__.TUI_VALUE_ACCESSOR_PROVIDER, (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__.tuiAsFocusableItemAccessor)(TuiInputComponent), (0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_10__.tuiAsDataListHost)(TuiInputComponent), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiAsControl)(TuiInputComponent)], [_taiga_ui_kit_providers__WEBPACK_IMPORTED_MODULE_8__.FIXED_DROPDOWN_CONTROLLER_PROVIDER]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]],
- ngContentSelectors: _c1,
- decls: 4,
- vars: 11,
- consts: [[1, "t-hosted", 3, "canOpen", "content", "open", "openChange", "tuiActiveZoneChange"], ["automation-id", "tui-input__textfield", 1, "t-textfield", 3, "disabled", "focusable", "invalid", "nativeId", "pseudoFocus", "pseudoHover", "readOnly", "value", "valueChange"]],
- template: function TuiInputComponent_Template(rf, ctx) {
- if (rf & 1) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵprojectionDef"](_c0);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](0, "tui-hosted-dropdown", 0);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("openChange", function TuiInputComponent_Template_tui_hosted_dropdown_openChange_0_listener($event) {
- return ctx.open = $event;
- })("tuiActiveZoneChange", function TuiInputComponent_Template_tui_hosted_dropdown_tuiActiveZoneChange_0_listener($event) {
- return ctx.onActiveZone($event);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementStart"](1, "tui-primitive-textfield", 1);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵlistener"]("valueChange", function TuiInputComponent_Template_tui_primitive_textfield_valueChange_1_listener($event) {
- return ctx.onValueChange($event);
- });
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵprojection"](2);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵprojection"](3, 1, ["ngProjectAs", "input", 5, ["input"]]);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵelementEnd"]()();
- }
- if (rf & 2) {
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("canOpen", ctx.canOpen)("content", ctx.datalist || "")("open", ctx.open);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵadvance"](1);
- _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵproperty"]("disabled", ctx.computedDisabled)("focusable", ctx.computedFocusable)("invalid", ctx.computedInvalid)("nativeId", ctx.nativeId)("pseudoFocus", ctx.computedFocused)("pseudoHover", ctx.pseudoHover)("readOnly", ctx.readOnly)("value", ctx.value);
- }
- },
- dependencies: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TuiHostedDropdownComponent, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.TuiPrimitiveTextfieldComponent, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiActiveZoneDirective, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.TuiPrimitiveTextfieldDirective],
- styles: ["[_nghost-%COMP%]{display:block;border-radius:var(--tui-radius-m);text-align:left}._disabled[_nghost-%COMP%]{pointer-events:none}.t-hosted[_ngcontent-%COMP%]{display:block;border-radius:inherit}.t-textfield[_ngcontent-%COMP%]{border-radius:inherit;text-align:inherit}"],
- changeDetection: 0
+_HttpInterceptorHandler.ɵprov = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵɵdefineInjectable"]({
+ token: _HttpInterceptorHandler,
+ factory: _HttpInterceptorHandler.ɵfac
});
(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiInputComponent, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Component,
- args: [{
- selector: 'tui-input',
- templateUrl: './input.template.html',
- styleUrls: ['./input.style.less'],
- changeDetection: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectionStrategy.OnPush,
- providers: [_taiga_ui_kit_providers__WEBPACK_IMPORTED_MODULE_8__.TUI_VALUE_ACCESSOR_PROVIDER, (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_9__.tuiAsFocusableItemAccessor)(TuiInputComponent), (0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_10__.tuiAsDataListHost)(TuiInputComponent), (0,_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.tuiAsControl)(TuiInputComponent)],
- viewProviders: [_taiga_ui_kit_providers__WEBPACK_IMPORTED_MODULE_8__.FIXED_DROPDOWN_CONTROLLER_PROVIDER]
- }]
+ (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_5__["ɵsetClassMetadata"](HttpInterceptorHandler, [{
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.Injectable
}], function () {
return [{
- type: _angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControl,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Self
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_angular_forms__WEBPACK_IMPORTED_MODULE_3__.NgControl]
- }]
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_angular_core__WEBPACK_IMPORTED_MODULE_2__.ChangeDetectorRef]
- }]
- }, {
- type: _taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TuiTextfieldSizeDirective,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_4__.TUI_TEXTFIELD_SIZE]
- }]
+ type: HttpBackend
}, {
- type: _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiValueTransformer,
- decorators: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Optional
- }, {
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Inject,
- args: [_taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_0__.AbstractTuiValueTransformer]
- }]
+ type: _angular_core__WEBPACK_IMPORTED_MODULE_5__.EnvironmentInjector
}];
- }, {
- hostedDropdown: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewChild,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TuiHostedDropdownComponent]
- }],
- textfield: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ViewChild,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.TuiPrimitiveTextfieldComponent]
- }],
- datalist: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.ContentChild,
- args: [_taiga_ui_core__WEBPACK_IMPORTED_MODULE_5__.TuiDataListDirective, {
- read: _angular_core__WEBPACK_IMPORTED_MODULE_2__.TemplateRef
- }]
- }],
- size: [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.HostBinding,
- args: ['attr.data-size']
- }]
- });
-})();
-class TuiInputDirective extends _taiga_ui_core__WEBPACK_IMPORTED_MODULE_12__.AbstractTuiTextfieldHost {
- onValueChange(value) {
- this.host.onValueChange(value);
- }
-}
-TuiInputDirective.ɵfac = /* @__PURE__ */function () {
- let ɵTuiInputDirective_BaseFactory;
- return function TuiInputDirective_Factory(t) {
- return (ɵTuiInputDirective_BaseFactory || (ɵTuiInputDirective_BaseFactory = _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵgetInheritedFactory"](TuiInputDirective)))(t || TuiInputDirective);
- };
-}();
-TuiInputDirective.ɵdir = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineDirective"]({
- type: TuiInputDirective,
- selectors: [["tui-input"]],
- features: [_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵProvidersFeature"]([(0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_10__.tuiAsTextfieldHost)(TuiInputDirective)]), _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵInheritDefinitionFeature"]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiInputDirective, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.Directive,
- args: [{
- selector: 'tui-input',
- providers: [(0,_taiga_ui_core__WEBPACK_IMPORTED_MODULE_10__.tuiAsTextfieldHost)(TuiInputDirective)]
- }]
- }], null, null);
-})();
-class TuiInputModule {}
-TuiInputModule.ɵfac = function TuiInputModule_Factory(t) {
- return new (t || TuiInputModule)();
-};
-TuiInputModule.ɵmod = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineNgModule"]({
- type: TuiInputModule
-});
-TuiInputModule.ɵinj = /* @__PURE__ */_angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵɵdefineInjector"]({
- imports: [[_angular_common__WEBPACK_IMPORTED_MODULE_13__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiActiveZoneModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.TuiPrimitiveTextfieldModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TuiHostedDropdownModule]]
-});
-(function () {
- (typeof ngDevMode === "undefined" || ngDevMode) && _angular_core__WEBPACK_IMPORTED_MODULE_2__["ɵsetClassMetadata"](TuiInputModule, [{
- type: _angular_core__WEBPACK_IMPORTED_MODULE_2__.NgModule,
- args: [{
- imports: [_angular_common__WEBPACK_IMPORTED_MODULE_13__.CommonModule, _taiga_ui_cdk__WEBPACK_IMPORTED_MODULE_11__.TuiActiveZoneModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.TuiPrimitiveTextfieldModule, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_6__.TuiHostedDropdownModule],
- declarations: [TuiInputComponent, TuiInputDirective],
- exports: [TuiInputComponent, TuiInputDirective, _taiga_ui_core__WEBPACK_IMPORTED_MODULE_7__.TuiTextfieldComponent]
- }]
- }], null, null);
+ }, null);
})();
+// Every request made through JSONP needs a callback name that's unique across the
+// whole page. Each request is assigned an id and the callback name is constructed
+// from that. The next id to be assigned is tracked in a global variable here that
+// is shared among all applications on the page.
+let nextRequestId = 0;
/**
- * Generated bundle index. Do not edit.
+ * When a pending