From 115470db705dc0b51e02fe709def2b27dd9417b5 Mon Sep 17 00:00:00 2001 From: dtopalov Date: Wed, 5 Jul 2017 16:55:04 +0300 Subject: [PATCH] chore: Change repo structure and add asp net core sample app --- .../.template.config/icon.png | Bin 0 -> 3377 bytes .../A4CoreServer.csproj | 36 + .../ClientApp/app/app.module.client.ts | 24 + .../ClientApp/app/app.module.server.ts | 16 + .../ClientApp/app/app.module.shared.ts | 30 + .../app/components/app/app.component.css | 6 + .../app/components/app/app.component.html | 10 + .../app/components/app/app.component.ts | 9 + .../components/counter/counter.component.html | 7 + .../components/counter/counter.component.ts | 13 + .../fetchdata/fetchdata.component.html | 13 + .../fetchdata/fetchdata.component.ts | 26 + .../app/components/home/home.component.html | 16 + .../app/components/home/home.component.ts | 8 + .../components/navmenu/navmenu.component.css | 59 + .../components/navmenu/navmenu.component.html | 33 + .../components/navmenu/navmenu.component.ts | 9 + .../ClientApp/boot-client.ts | 22 + .../ClientApp/boot-server.ts | 36 + .../dist/89889688147bd7575d6327160d64e760.svg | 288 + .../ClientApp/dist/main-server.js | 95520 ++++++++++++++++ .../ClientApp/dist/vendor-manifest.json | 1 + .../ClientApp/dist/vendor.js | 92070 +++++++++++++++ .../Controllers/HomeController.cs | 21 + .../Controllers/SampleDataController.cs | 44 + aspnet_core_sample_application/Program.cs | 24 + aspnet_core_sample_application/Startup.cs | 67 + .../Views/Home/Index.cshtml | 10 + .../Views/Shared/Error.cshtml | 6 + .../Views/Shared/_Layout.cshtml | 15 + .../Views/_ViewImports.cshtml | 3 + .../Views/_ViewStart.cshtml | 3 + .../appsettings.json | 10 + aspnet_core_sample_application/global.json | 3 + aspnet_core_sample_application/package.json | 55 + aspnet_core_sample_application/tsconfig.json | 14 + aspnet_core_sample_application/web.config | 14 + .../webpack.config.js | 71 + .../webpack.config.vendor.js | 88 + .../dist/89889688147bd7575d6327160d64e760.svg | 288 + .../wwwroot/dist/main-client.js | 91303 +++++++++++++++ .../wwwroot/dist/main-client.js.map | 1 + .../wwwroot/dist/vendor-manifest.json | 1 + .../wwwroot/dist/vendor.css | 6756 ++ .../wwwroot/dist/vendor.js | 92295 +++++++++++++++ .../wwwroot/favicon.ico | Bin 0 -> 85432 bytes .../.bithoundrc | 0 .../.cache}/ngx-config__settings | 0 .../.cache}/ngx-translate__translations_en | 0 .../.gitattributes | 0 .../.gitignore | 0 .../.jshintrc | 0 .../.server}/server.0.chunk.js | 0 .../.server}/server.1.chunk.js | 0 .../.server}/server.10.chunk.js | 0 .../.server}/server.11.chunk.js | 0 .../.server}/server.12.chunk.js | 0 .../.server}/server.2.chunk.js | 0 .../.server}/server.3.chunk.js | 0 .../.server}/server.4.chunk.js | 0 .../.server}/server.5.chunk.js | 0 .../.server}/server.6.chunk.js | 0 .../.server}/server.7.chunk.js | 0 .../.server}/server.8.chunk.js | 0 .../.server}/server.9.chunk.js | 0 .../.server}/server.js | 0 .../.server}/spa-server.hmr.js | 0 .../.server}/spa-server.js | 0 LICENSE => node_sample_application/LICENSE | 0 .../README.md | 0 .../config}/.sasslint.yml | 0 .../config}/build-config.json | 0 .../config}/gulp-helpers.js | 0 .../config}/gulp-tasks.js | 0 .../config}/helpers.js | 0 .../config}/html-elements.config.js | 0 .../config}/karma.conf.js | 0 .../config}/postcss.config.js | 0 .../config}/protractor.conf.js | 0 .../config}/spec-bundle.js | 0 .../config}/stylelint.config.js | 0 .../config}/webpack.config.js | 0 .../gulpfile.js | 0 .../karma.conf.js | 0 .../package.json | 0 .../postcss.config.js | 0 .../protractor.conf.js | 0 .../assets/0.a9996195cfa96d590739.chunk.js | 0 .../assets/1.cc5056ff76696227dff6.chunk.js | 0 .../assets/10.e89dd39f0129b4076393.chunk.js | 0 .../assets/11.84db92ca6c1789518e01.chunk.js | 0 .../assets/12.b6629e798759273a1676.chunk.js | 0 .../assets/2.8f98d5dd83d1bb91fca7.chunk.js | 0 .../assets/3.c4e3b84cea36fcc05d68.chunk.js | 0 .../assets/4.0183dedc09b48be7883b.chunk.js | 0 .../assets/5.5e84ff7f8dbb2dee35b0.chunk.js | 0 .../assets/6.3ab3ef02481618cfdf99.chunk.js | 0 .../assets/7.65c2fb49268f9ccc6d94.chunk.js | 0 .../assets/8.220c4af054cb15a9c56c.chunk.js | 0 .../assets/9.25bc12cff30469fafaa0.chunk.js | 0 .../assets/app.57f39682d55d456c12b3.bundle.js | 0 .../assets/app.57f39682d55d456c12b3.style.css | 0 .../public}/assets/config.json | 0 .../public}/assets/i18n/en.json | 0 .../public}/assets/i18n/tr.json | 0 .../polyfills.087d42e5c1ecb4b33604.bundle.js | 0 .../public}/assets/webpack-assets.json | 0 .../public}/index.html | 0 .../app/+about/about-apple-pear.component.ts | 0 .../app/+about/about-banana.component.ts | 0 .../client/app/+about/about-us.component.ts | 0 .../src}/client/app/+about/about.component.ts | 0 .../src}/client/app/+about/about.module.ts | 0 .../src}/client/app/+about/about.routes.ts | 0 .../app/+buttons/kendo-buttons.component.ts | 0 .../app/+buttons/kendo-buttons.module.ts | 0 .../app/+buttons/kendo-buttons.routes.ts | 0 .../app/+charts/kendo-charts.component.ts | 0 .../client/app/+charts/kendo-charts.module.ts | 0 .../client/app/+charts/kendo-charts.routes.ts | 0 .../kendo-date-inputs.component.ts | 0 .../+dateinputs/kendo-date-inputs.module.ts | 0 .../+dateinputs/kendo-date-inputs.routes.ts | 0 .../+dropdowns/kendo-dropdowns.component.ts | 0 .../app/+dropdowns/kendo-dropdowns.module.ts | 0 .../app/+dropdowns/kendo-dropdowns.routes.ts | 0 .../client/app/+grid/kendo-grid.component.ts | 0 .../client/app/+grid/kendo-grid.module.ts | 0 .../client/app/+grid/kendo-grid.routes.ts | 0 .../src}/client/app/+grid/products.ts | 0 .../src}/client/app/+home/home.component.ts | 0 .../src}/client/app/+home/home.module.ts | 0 .../src}/client/app/+home/home.routes.ts | 0 .../app/+inputs/kendo-inputs.component.ts | 0 .../client/app/+inputs/kendo-inputs.module.ts | 0 .../client/app/+inputs/kendo-inputs.routes.ts | 0 .../app/+label/kendo-label.component.ts | 0 .../client/app/+label/kendo-label.module.ts | 0 .../client/app/+label/kendo-label.routes.ts | 0 .../app/+layout/kendo-layout.component.ts | 0 .../client/app/+layout/kendo-layout.module.ts | 0 .../client/app/+layout/kendo-layout.routes.ts | 0 .../app/+popup/kendo-popup.component.ts | 0 .../client/app/+popup/kendo-popup.module.ts | 0 .../client/app/+popup/kendo-popup.routes.ts | 0 .../+scrollview/kendo-scrollview.component.ts | 0 .../+scrollview/kendo-scrollview.module.ts | 0 .../+scrollview/kendo-scrollview.routes.ts | 0 .../app/+sortable/kendo-sortable.component.ts | 0 .../app/+sortable/kendo-sortable.module.ts | 0 .../app/+sortable/kendo-sortable.routes.ts | 0 .../app/+upload/kendo-upload.component.ts | 0 .../client/app/+upload/kendo-upload.module.ts | 0 .../client/app/+upload/kendo-upload.routes.ts | 0 .../src}/client/app/app.browser.module.ts | 0 .../src}/client/app/app.component.html | 0 .../src}/client/app/app.component.scss | 0 .../src}/client/app/app.component.ts | 0 .../src}/client/app/app.module.ts | 0 .../src}/client/app/app.routes.ts | 0 .../client/app/change-language.component.ts | 0 .../src}/client/assets/config.json | 0 .../src}/client/assets/favicon.ico | Bin .../src}/client/assets/i18n/en.json | 0 .../src}/client/assets/i18n/tr.json | 0 .../src}/client/assets/sass/layout.scss | 0 .../src}/client/custom-typings.d.ts | 0 .../src}/client/index.html | 0 .../src}/client/main-browser.ts | 0 .../src}/client/main-spa.ts | 0 .../src}/client/polyfills.ts | 0 .../src}/server/app/app.server.module.ts | 0 .../src}/server/server.ts | 0 .../stylelint.config.js | 0 .../tsconfig.json | 0 .../tslint.json | 0 .../webpack.config.js | 0 177 files changed, 379344 insertions(+) create mode 100644 aspnet_core_sample_application/.template.config/icon.png create mode 100644 aspnet_core_sample_application/A4CoreServer.csproj create mode 100644 aspnet_core_sample_application/ClientApp/app/app.module.client.ts create mode 100644 aspnet_core_sample_application/ClientApp/app/app.module.server.ts create mode 100644 aspnet_core_sample_application/ClientApp/app/app.module.shared.ts create mode 100644 aspnet_core_sample_application/ClientApp/app/components/app/app.component.css create mode 100644 aspnet_core_sample_application/ClientApp/app/components/app/app.component.html create mode 100644 aspnet_core_sample_application/ClientApp/app/components/app/app.component.ts create mode 100644 aspnet_core_sample_application/ClientApp/app/components/counter/counter.component.html create mode 100644 aspnet_core_sample_application/ClientApp/app/components/counter/counter.component.ts create mode 100644 aspnet_core_sample_application/ClientApp/app/components/fetchdata/fetchdata.component.html create mode 100644 aspnet_core_sample_application/ClientApp/app/components/fetchdata/fetchdata.component.ts create mode 100644 aspnet_core_sample_application/ClientApp/app/components/home/home.component.html create mode 100644 aspnet_core_sample_application/ClientApp/app/components/home/home.component.ts create mode 100644 aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.css create mode 100644 aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.html create mode 100644 aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.ts create mode 100644 aspnet_core_sample_application/ClientApp/boot-client.ts create mode 100644 aspnet_core_sample_application/ClientApp/boot-server.ts create mode 100644 aspnet_core_sample_application/ClientApp/dist/89889688147bd7575d6327160d64e760.svg create mode 100644 aspnet_core_sample_application/ClientApp/dist/main-server.js create mode 100644 aspnet_core_sample_application/ClientApp/dist/vendor-manifest.json create mode 100644 aspnet_core_sample_application/ClientApp/dist/vendor.js create mode 100644 aspnet_core_sample_application/Controllers/HomeController.cs create mode 100644 aspnet_core_sample_application/Controllers/SampleDataController.cs create mode 100644 aspnet_core_sample_application/Program.cs create mode 100644 aspnet_core_sample_application/Startup.cs create mode 100644 aspnet_core_sample_application/Views/Home/Index.cshtml create mode 100644 aspnet_core_sample_application/Views/Shared/Error.cshtml create mode 100644 aspnet_core_sample_application/Views/Shared/_Layout.cshtml create mode 100644 aspnet_core_sample_application/Views/_ViewImports.cshtml create mode 100644 aspnet_core_sample_application/Views/_ViewStart.cshtml create mode 100644 aspnet_core_sample_application/appsettings.json create mode 100644 aspnet_core_sample_application/global.json create mode 100644 aspnet_core_sample_application/package.json create mode 100644 aspnet_core_sample_application/tsconfig.json create mode 100644 aspnet_core_sample_application/web.config create mode 100644 aspnet_core_sample_application/webpack.config.js create mode 100644 aspnet_core_sample_application/webpack.config.vendor.js create mode 100644 aspnet_core_sample_application/wwwroot/dist/89889688147bd7575d6327160d64e760.svg create mode 100644 aspnet_core_sample_application/wwwroot/dist/main-client.js create mode 100644 aspnet_core_sample_application/wwwroot/dist/main-client.js.map create mode 100644 aspnet_core_sample_application/wwwroot/dist/vendor-manifest.json create mode 100644 aspnet_core_sample_application/wwwroot/dist/vendor.css create mode 100644 aspnet_core_sample_application/wwwroot/dist/vendor.js create mode 100644 aspnet_core_sample_application/wwwroot/favicon.ico rename .bithoundrc => node_sample_application/.bithoundrc (100%) rename {.cache => node_sample_application/.cache}/ngx-config__settings (100%) rename {.cache => node_sample_application/.cache}/ngx-translate__translations_en (100%) rename .gitattributes => node_sample_application/.gitattributes (100%) rename .gitignore => node_sample_application/.gitignore (100%) rename .jshintrc => node_sample_application/.jshintrc (100%) rename {.server => node_sample_application/.server}/server.0.chunk.js (100%) rename {.server => node_sample_application/.server}/server.1.chunk.js (100%) rename {.server => node_sample_application/.server}/server.10.chunk.js (100%) rename {.server => node_sample_application/.server}/server.11.chunk.js (100%) rename {.server => node_sample_application/.server}/server.12.chunk.js (100%) rename {.server => node_sample_application/.server}/server.2.chunk.js (100%) rename {.server => node_sample_application/.server}/server.3.chunk.js (100%) rename {.server => node_sample_application/.server}/server.4.chunk.js (100%) rename {.server => node_sample_application/.server}/server.5.chunk.js (100%) rename {.server => node_sample_application/.server}/server.6.chunk.js (100%) rename {.server => node_sample_application/.server}/server.7.chunk.js (100%) rename {.server => node_sample_application/.server}/server.8.chunk.js (100%) rename {.server => node_sample_application/.server}/server.9.chunk.js (100%) rename {.server => node_sample_application/.server}/server.js (100%) rename {.server => node_sample_application/.server}/spa-server.hmr.js (100%) rename {.server => node_sample_application/.server}/spa-server.js (100%) rename LICENSE => node_sample_application/LICENSE (100%) rename README.md => node_sample_application/README.md (100%) rename {config => node_sample_application/config}/.sasslint.yml (100%) rename {config => node_sample_application/config}/build-config.json (100%) rename {config => node_sample_application/config}/gulp-helpers.js (100%) rename {config => node_sample_application/config}/gulp-tasks.js (100%) rename {config => node_sample_application/config}/helpers.js (100%) rename {config => node_sample_application/config}/html-elements.config.js (100%) rename {config => node_sample_application/config}/karma.conf.js (100%) rename {config => node_sample_application/config}/postcss.config.js (100%) rename {config => node_sample_application/config}/protractor.conf.js (100%) rename {config => node_sample_application/config}/spec-bundle.js (100%) rename {config => node_sample_application/config}/stylelint.config.js (100%) rename {config => node_sample_application/config}/webpack.config.js (100%) rename gulpfile.js => node_sample_application/gulpfile.js (100%) rename karma.conf.js => node_sample_application/karma.conf.js (100%) rename package.json => node_sample_application/package.json (100%) rename postcss.config.js => node_sample_application/postcss.config.js (100%) rename protractor.conf.js => node_sample_application/protractor.conf.js (100%) rename {public => node_sample_application/public}/assets/0.a9996195cfa96d590739.chunk.js (100%) rename {public => node_sample_application/public}/assets/1.cc5056ff76696227dff6.chunk.js (100%) rename {public => node_sample_application/public}/assets/10.e89dd39f0129b4076393.chunk.js (100%) rename {public => node_sample_application/public}/assets/11.84db92ca6c1789518e01.chunk.js (100%) rename {public => node_sample_application/public}/assets/12.b6629e798759273a1676.chunk.js (100%) rename {public => node_sample_application/public}/assets/2.8f98d5dd83d1bb91fca7.chunk.js (100%) rename {public => node_sample_application/public}/assets/3.c4e3b84cea36fcc05d68.chunk.js (100%) rename {public => node_sample_application/public}/assets/4.0183dedc09b48be7883b.chunk.js (100%) rename {public => node_sample_application/public}/assets/5.5e84ff7f8dbb2dee35b0.chunk.js (100%) rename {public => node_sample_application/public}/assets/6.3ab3ef02481618cfdf99.chunk.js (100%) rename {public => node_sample_application/public}/assets/7.65c2fb49268f9ccc6d94.chunk.js (100%) rename {public => node_sample_application/public}/assets/8.220c4af054cb15a9c56c.chunk.js (100%) rename {public => node_sample_application/public}/assets/9.25bc12cff30469fafaa0.chunk.js (100%) rename {public => node_sample_application/public}/assets/app.57f39682d55d456c12b3.bundle.js (100%) rename {public => node_sample_application/public}/assets/app.57f39682d55d456c12b3.style.css (100%) rename {public => node_sample_application/public}/assets/config.json (100%) rename {public => node_sample_application/public}/assets/i18n/en.json (100%) rename {public => node_sample_application/public}/assets/i18n/tr.json (100%) rename {public => node_sample_application/public}/assets/polyfills.087d42e5c1ecb4b33604.bundle.js (100%) rename {public => node_sample_application/public}/assets/webpack-assets.json (100%) rename {public => node_sample_application/public}/index.html (100%) rename {src => node_sample_application/src}/client/app/+about/about-apple-pear.component.ts (100%) rename {src => node_sample_application/src}/client/app/+about/about-banana.component.ts (100%) rename {src => node_sample_application/src}/client/app/+about/about-us.component.ts (100%) rename {src => node_sample_application/src}/client/app/+about/about.component.ts (100%) rename {src => node_sample_application/src}/client/app/+about/about.module.ts (100%) rename {src => node_sample_application/src}/client/app/+about/about.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+buttons/kendo-buttons.component.ts (100%) rename {src => node_sample_application/src}/client/app/+buttons/kendo-buttons.module.ts (100%) rename {src => node_sample_application/src}/client/app/+buttons/kendo-buttons.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+charts/kendo-charts.component.ts (100%) rename {src => node_sample_application/src}/client/app/+charts/kendo-charts.module.ts (100%) rename {src => node_sample_application/src}/client/app/+charts/kendo-charts.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+dateinputs/kendo-date-inputs.component.ts (100%) rename {src => node_sample_application/src}/client/app/+dateinputs/kendo-date-inputs.module.ts (100%) rename {src => node_sample_application/src}/client/app/+dateinputs/kendo-date-inputs.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+dropdowns/kendo-dropdowns.component.ts (100%) rename {src => node_sample_application/src}/client/app/+dropdowns/kendo-dropdowns.module.ts (100%) rename {src => node_sample_application/src}/client/app/+dropdowns/kendo-dropdowns.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+grid/kendo-grid.component.ts (100%) rename {src => node_sample_application/src}/client/app/+grid/kendo-grid.module.ts (100%) rename {src => node_sample_application/src}/client/app/+grid/kendo-grid.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+grid/products.ts (100%) rename {src => node_sample_application/src}/client/app/+home/home.component.ts (100%) rename {src => node_sample_application/src}/client/app/+home/home.module.ts (100%) rename {src => node_sample_application/src}/client/app/+home/home.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+inputs/kendo-inputs.component.ts (100%) rename {src => node_sample_application/src}/client/app/+inputs/kendo-inputs.module.ts (100%) rename {src => node_sample_application/src}/client/app/+inputs/kendo-inputs.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+label/kendo-label.component.ts (100%) rename {src => node_sample_application/src}/client/app/+label/kendo-label.module.ts (100%) rename {src => node_sample_application/src}/client/app/+label/kendo-label.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+layout/kendo-layout.component.ts (100%) rename {src => node_sample_application/src}/client/app/+layout/kendo-layout.module.ts (100%) rename {src => node_sample_application/src}/client/app/+layout/kendo-layout.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+popup/kendo-popup.component.ts (100%) rename {src => node_sample_application/src}/client/app/+popup/kendo-popup.module.ts (100%) rename {src => node_sample_application/src}/client/app/+popup/kendo-popup.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+scrollview/kendo-scrollview.component.ts (100%) rename {src => node_sample_application/src}/client/app/+scrollview/kendo-scrollview.module.ts (100%) rename {src => node_sample_application/src}/client/app/+scrollview/kendo-scrollview.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+sortable/kendo-sortable.component.ts (100%) rename {src => node_sample_application/src}/client/app/+sortable/kendo-sortable.module.ts (100%) rename {src => node_sample_application/src}/client/app/+sortable/kendo-sortable.routes.ts (100%) rename {src => node_sample_application/src}/client/app/+upload/kendo-upload.component.ts (100%) rename {src => node_sample_application/src}/client/app/+upload/kendo-upload.module.ts (100%) rename {src => node_sample_application/src}/client/app/+upload/kendo-upload.routes.ts (100%) rename {src => node_sample_application/src}/client/app/app.browser.module.ts (100%) rename {src => node_sample_application/src}/client/app/app.component.html (100%) rename {src => node_sample_application/src}/client/app/app.component.scss (100%) rename {src => node_sample_application/src}/client/app/app.component.ts (100%) rename {src => node_sample_application/src}/client/app/app.module.ts (100%) rename {src => node_sample_application/src}/client/app/app.routes.ts (100%) rename {src => node_sample_application/src}/client/app/change-language.component.ts (100%) rename {src => node_sample_application/src}/client/assets/config.json (100%) rename {src => node_sample_application/src}/client/assets/favicon.ico (100%) rename {src => node_sample_application/src}/client/assets/i18n/en.json (100%) rename {src => node_sample_application/src}/client/assets/i18n/tr.json (100%) rename {src => node_sample_application/src}/client/assets/sass/layout.scss (100%) rename {src => node_sample_application/src}/client/custom-typings.d.ts (100%) rename {src => node_sample_application/src}/client/index.html (100%) rename {src => node_sample_application/src}/client/main-browser.ts (100%) rename {src => node_sample_application/src}/client/main-spa.ts (100%) rename {src => node_sample_application/src}/client/polyfills.ts (100%) rename {src => node_sample_application/src}/server/app/app.server.module.ts (100%) rename {src => node_sample_application/src}/server/server.ts (100%) rename stylelint.config.js => node_sample_application/stylelint.config.js (100%) rename tsconfig.json => node_sample_application/tsconfig.json (100%) rename tslint.json => node_sample_application/tslint.json (100%) rename webpack.config.js => node_sample_application/webpack.config.js (100%) diff --git a/aspnet_core_sample_application/.template.config/icon.png b/aspnet_core_sample_application/.template.config/icon.png new file mode 100644 index 0000000000000000000000000000000000000000..da33e859ebf6ca9a0cad4e2bf70c8e8a3d8e035a GIT binary patch literal 3377 zcmaJ@>u*#=6uF##7?Y2uF(8uy9rS0yvMJP)jx7`+&?PJ?6(DE$M+7=4fLI8P2 z4WcCaL1F}=F&a@n7!&=fNTPnx_yGfn5u*tv22Bk73;upH*SWV_LUPV;&SU1xnKNhZ z?vp#WGXq=vd1ZN;rukD_lfxK0$sPyr$(`GZG|i!9`m#NJGjo@OM{9;ps{`aW5*h$` zEwpi+gl)%uFruI9W`QHnFctL*$&ZOl+x%B*i=??rH*v z03v6NHIPMQJQ3c@$>Ip+JaG;)yk8wg%oAQQS>{*I0G#6DmOhbzsG3+t5H*m%3`C|P zAyIZA`58q>(yO9~Wg>BrshL`Ud&srw2qGbKijZ<5`?yT(VQ!?c*e(^ttFjlHi=a;0 zAt7Aie_-V)Key zE?NKZ$~#bk+;ZS3VCDiqQFRBzVx}^BOc||0->g*|Ic(LIG(Udj#^aZ+!S;%n=i9Qonpw{t8xYUa4r5ZnIG$6s0vN}jz0v8f**&Ys`;=>5->6GG)?t2Ql_ z{t1jNgH}&syH%6&-yeRy*l4vFx8>VlH7=IJov=+X(Z+3yy|A<`xXGtZk;W}Nz*2s{ zokqVy;DBxayoF5+0{cB0!DqbWbgLZ?PHjlH3PJ#EbU#r3CG4pMd8S%PlN`rrT z55OK6JN3gi7|I#G0sQT?jX+6DqH+w%0Y7$wsidAgqb5v_hV*67!kp2q>zzY3ms7X# z?JuSyr}eHBJ7Olr?5*_p%^Sae^&3s6+w$A39?0gqF+40vb_IZ!B8kOUbpB%Nex>k+ zUIfQ{{Ml9HH!dR_z4xj#ww~R|56<9OUdCE**)E>r!5e_d=w6_tNTk!N6#da#H`z6y zA74|}l97pQN0Cw?Or?9fwz(S)jGj2x{Q`CH+=7Q*E~ig(XHb1P*Z0JWfhlPM9xkie z&rF!SQNwlh=hjs4BVFwzfG_Z_^Ogb%!NZ;HD~r4X3l85>1xG2^#on=j6}hTLAR|IhIatou&L4jqa6+uJa`#ufIkgJAt8arE5hv1{D4%ac?(8?q$SStRz^>3oaEa2 z9YJXZ_JddOYCycDY4!wPXO?s3OAj_<0M$gMrEpXZD|_pt;65P7>1ZUz)|IqM=Nsi= z7ZdMlj<1zX05TpIli+o;4BjKrbxfo?;jQC)D)sS5pvxV~JJ3 zN-#e%Ui(zKXd5>`j~myOK3|+Ymf_hpvlqf$(#?}`(>Q)3 NwN%dl8?1|W^B)PVJMaJi literal 0 HcmV?d00001 diff --git a/aspnet_core_sample_application/A4CoreServer.csproj b/aspnet_core_sample_application/A4CoreServer.csproj new file mode 100644 index 00000000..b8bd8238 --- /dev/null +++ b/aspnet_core_sample_application/A4CoreServer.csproj @@ -0,0 +1,36 @@ + + + netcoreapp1.1 + true + false + + + + + + + + + + + + + + + + + + + + + + + + + + %(DistFiles.Identity) + PreserveNewest + + + + \ No newline at end of file diff --git a/aspnet_core_sample_application/ClientApp/app/app.module.client.ts b/aspnet_core_sample_application/ClientApp/app/app.module.client.ts new file mode 100644 index 00000000..f586071a --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/app.module.client.ts @@ -0,0 +1,24 @@ +import { NgModule } from '@angular/core'; +import { BrowserModule } from '@angular/platform-browser'; +import { FormsModule } from '@angular/forms'; +import { HttpModule } from '@angular/http'; +import { BrowserAnimationsModule } from "@angular/platform-browser/animations"; + +import { sharedConfig } from './app.module.shared'; + +@NgModule({ + bootstrap: sharedConfig.bootstrap, + declarations: sharedConfig.declarations, + imports: [ + BrowserModule, + BrowserAnimationsModule, + FormsModule, + HttpModule, + ...sharedConfig.imports + ], + providers: [ + { provide: 'ORIGIN_URL', useValue: location.origin } + ] +}) +export class AppModule { +} diff --git a/aspnet_core_sample_application/ClientApp/app/app.module.server.ts b/aspnet_core_sample_application/ClientApp/app/app.module.server.ts new file mode 100644 index 00000000..32789b99 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/app.module.server.ts @@ -0,0 +1,16 @@ +import { NgModule } from "@angular/core"; +import { ServerModule } from "@angular/platform-server"; +import { NoopAnimationsModule } from "@angular/platform-browser/animations"; +import { sharedConfig } from "./app.module.shared"; + +@NgModule({ + bootstrap: sharedConfig.bootstrap, + declarations: sharedConfig.declarations, + imports: [ + ServerModule, + NoopAnimationsModule, + ...sharedConfig.imports + ] +}) +export class AppModule { +} diff --git a/aspnet_core_sample_application/ClientApp/app/app.module.shared.ts b/aspnet_core_sample_application/ClientApp/app/app.module.shared.ts new file mode 100644 index 00000000..04db76d7 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/app.module.shared.ts @@ -0,0 +1,30 @@ +import { NgModule } from "@angular/core"; +import { RouterModule } from "@angular/router"; + +import { AppComponent } from "./components/app/app.component"; +import { NavMenuComponent } from "./components/navmenu/navmenu.component"; +import { HomeComponent } from "./components/home/home.component"; +import { FetchDataComponent } from "./components/fetchdata/fetchdata.component"; +import { CounterComponent } from "./components/counter/counter.component"; +import { GridModule } from "@progress/kendo-angular-grid"; + +export const sharedConfig: NgModule = { + bootstrap: [ AppComponent ], + declarations: [ + AppComponent, + NavMenuComponent, + CounterComponent, + FetchDataComponent, + HomeComponent + ], + imports: [ + GridModule, + RouterModule.forRoot([ + { path: "", redirectTo: "home", pathMatch: "full" }, + { path: "home", component: HomeComponent }, + { path: "counter", component: CounterComponent }, + { path: "fetch-data", component: FetchDataComponent }, + { path: "**", redirectTo: "home" } + ]) + ] +}; diff --git a/aspnet_core_sample_application/ClientApp/app/components/app/app.component.css b/aspnet_core_sample_application/ClientApp/app/components/app/app.component.css new file mode 100644 index 00000000..63926006 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/app/app.component.css @@ -0,0 +1,6 @@ +@media (max-width: 767px) { + /* On small screens, the nav menu spans the full width of the screen. Leave a space for it. */ + .body-content { + padding-top: 50px; + } +} diff --git a/aspnet_core_sample_application/ClientApp/app/components/app/app.component.html b/aspnet_core_sample_application/ClientApp/app/components/app/app.component.html new file mode 100644 index 00000000..f208d1e8 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/app/app.component.html @@ -0,0 +1,10 @@ +
+
+
+ +
+
+ +
+
+
diff --git a/aspnet_core_sample_application/ClientApp/app/components/app/app.component.ts b/aspnet_core_sample_application/ClientApp/app/components/app/app.component.ts new file mode 100644 index 00000000..b20a1aed --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/app/app.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'app', + templateUrl: './app.component.html', + styleUrls: ['./app.component.css'] +}) +export class AppComponent { +} diff --git a/aspnet_core_sample_application/ClientApp/app/components/counter/counter.component.html b/aspnet_core_sample_application/ClientApp/app/components/counter/counter.component.html new file mode 100644 index 00000000..2521eda7 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/counter/counter.component.html @@ -0,0 +1,7 @@ +

Counter

+ +

This is a simple example of an Angular component.

+ +

Current count: {{ currentCount }}

+ + diff --git a/aspnet_core_sample_application/ClientApp/app/components/counter/counter.component.ts b/aspnet_core_sample_application/ClientApp/app/components/counter/counter.component.ts new file mode 100644 index 00000000..69de17d9 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/counter/counter.component.ts @@ -0,0 +1,13 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'counter', + templateUrl: './counter.component.html' +}) +export class CounterComponent { + public currentCount = 0; + + public incrementCounter() { + this.currentCount++; + } +} diff --git a/aspnet_core_sample_application/ClientApp/app/components/fetchdata/fetchdata.component.html b/aspnet_core_sample_application/ClientApp/app/components/fetchdata/fetchdata.component.html new file mode 100644 index 00000000..ff94fa0a --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/fetchdata/fetchdata.component.html @@ -0,0 +1,13 @@ +

Weather forecast

+ +

This component demonstrates fetching data from the server.

+ +

Loading...

+ + + + + + + diff --git a/aspnet_core_sample_application/ClientApp/app/components/fetchdata/fetchdata.component.ts b/aspnet_core_sample_application/ClientApp/app/components/fetchdata/fetchdata.component.ts new file mode 100644 index 00000000..3279acdc --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/fetchdata/fetchdata.component.ts @@ -0,0 +1,26 @@ +import { Component, Inject, ViewEncapsulation } from "@angular/core"; +import { Http } from "@angular/http"; +import "rxjs/add/observable/fromEvent"; + +@Component({ + selector: "fetchdata", + templateUrl: "./fetchdata.component.html", + styleUrls: ["./../../../../node_modules/@progress/kendo-theme-default/dist/all.css"], + encapsulation: ViewEncapsulation.None +}) +export class FetchDataComponent { + public forecasts: IWeatherForecast[]; + + constructor(http: Http, @Inject("ORIGIN_URL") originUrl: string) { + http.get(originUrl + "/api/SampleData/WeatherForecasts").subscribe(result => { + this.forecasts = result.json() as IWeatherForecast[]; + }); + } +} + +interface IWeatherForecast { + dateFormatted: string; + temperatureC: number; + temperatureF: number; + summary: string; +} diff --git a/aspnet_core_sample_application/ClientApp/app/components/home/home.component.html b/aspnet_core_sample_application/ClientApp/app/components/home/home.component.html new file mode 100644 index 00000000..3f2c0584 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/home/home.component.html @@ -0,0 +1,16 @@ +

Hello, world!

+

Welcome to your new single-page application, built with:

+ +

To help you get started, we've also set up:

+
    +
  • Client-side navigation. For example, click Counter then Back to return here.
  • +
  • Server-side prerendering. For faster initial loading and improved SEO, your Angular app is prerendered on the server. The resulting HTML is then transferred to the browser where a client-side copy of the app takes over.
  • +
  • Webpack dev middleware. In development mode, there's no need to run the webpack build tool. Your client-side resources are dynamically built on demand. Updates are available as soon as you modify any file.
  • +
  • Hot module replacement. In development mode, you don't even need to reload the page after making most changes. Within seconds of saving changes to files, your Angular app will be rebuilt and a new instance injected is into the page.
  • +
  • Efficient production builds. In production mode, development-time features are disabled, and the webpack build tool produces minified static CSS and JavaScript files.
  • +
diff --git a/aspnet_core_sample_application/ClientApp/app/components/home/home.component.ts b/aspnet_core_sample_application/ClientApp/app/components/home/home.component.ts new file mode 100644 index 00000000..81846cee --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/home/home.component.ts @@ -0,0 +1,8 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'home', + templateUrl: './home.component.html' +}) +export class HomeComponent { +} diff --git a/aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.css b/aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.css new file mode 100644 index 00000000..e15c6128 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.css @@ -0,0 +1,59 @@ +li .glyphicon { + margin-right: 10px; +} + +/* Highlighting rules for nav menu items */ +li.link-active a, +li.link-active a:hover, +li.link-active a:focus { + background-color: #4189C7; + color: white; +} + +/* Keep the nav menu independent of scrolling and on top of other items */ +.main-nav { + position: fixed; + top: 0; + left: 0; + right: 0; + z-index: 1; +} + +@media (min-width: 768px) { + /* On small screens, convert the nav menu to a vertical sidebar */ + .main-nav { + height: 100%; + width: calc(25% - 20px); + } + .navbar { + border-radius: 0px; + border-width: 0px; + height: 100%; + } + .navbar-header { + float: none; + } + .navbar-collapse { + border-top: 1px solid #444; + padding: 0px; + } + .navbar ul { + float: none; + } + .navbar li { + float: none; + font-size: 15px; + margin: 6px; + } + .navbar li a { + padding: 10px 16px; + border-radius: 4px; + } + .navbar a { + /* If a menu item's text is too long, truncate it */ + width: 100%; + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } +} diff --git a/aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.html b/aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.html new file mode 100644 index 00000000..c49d5097 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.html @@ -0,0 +1,33 @@ + diff --git a/aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.ts b/aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.ts new file mode 100644 index 00000000..7a1691cb --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/app/components/navmenu/navmenu.component.ts @@ -0,0 +1,9 @@ +import { Component } from '@angular/core'; + +@Component({ + selector: 'nav-menu', + templateUrl: './navmenu.component.html', + styleUrls: ['./navmenu.component.css'] +}) +export class NavMenuComponent { +} diff --git a/aspnet_core_sample_application/ClientApp/boot-client.ts b/aspnet_core_sample_application/ClientApp/boot-client.ts new file mode 100644 index 00000000..45c471c4 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/boot-client.ts @@ -0,0 +1,22 @@ +import 'reflect-metadata'; +import 'zone.js'; +import { enableProdMode } from '@angular/core'; +import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; +import { AppModule } from './app/app.module.client'; + +if (module['hot']) { + module['hot'].accept(); + module['hot'].dispose(() => { + // Before restarting the app, we create a new root element and dispose the old one + const oldRootElem = document.querySelector('app'); + const newRootElem = document.createElement('app'); + oldRootElem.parentNode.insertBefore(newRootElem, oldRootElem); + modulePromise.then(appModule => appModule.destroy()); + }); +} else { + enableProdMode(); +} + +// Note: @ng-tools/webpack looks for the following expression when performing production +// builds. Don't change how this line looks, otherwise you may break tree-shaking. +const modulePromise = platformBrowserDynamic().bootstrapModule(AppModule); diff --git a/aspnet_core_sample_application/ClientApp/boot-server.ts b/aspnet_core_sample_application/ClientApp/boot-server.ts new file mode 100644 index 00000000..08474cfa --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/boot-server.ts @@ -0,0 +1,36 @@ +import 'reflect-metadata'; +import 'zone.js'; +import 'rxjs/add/operator/first'; +import { enableProdMode, ApplicationRef, NgZone, ValueProvider } from '@angular/core'; +import { platformDynamicServer, PlatformState, INITIAL_CONFIG } from '@angular/platform-server'; +import { createServerRenderer, RenderResult } from 'aspnet-prerendering'; +import { AppModule } from './app/app.module.server'; + +enableProdMode(); + +export default createServerRenderer(params => { + const providers = [ + { provide: INITIAL_CONFIG, useValue: { document: '', url: params.url } }, + { provide: 'ORIGIN_URL', useValue: params.origin } + ]; + + return platformDynamicServer(providers).bootstrapModule(AppModule).then(moduleRef => { + const appRef = moduleRef.injector.get(ApplicationRef); + const state = moduleRef.injector.get(PlatformState); + const zone = moduleRef.injector.get(NgZone); + + return new Promise((resolve, reject) => { + zone.onError.subscribe(errorInfo => reject(errorInfo)); + appRef.isStable.first(isStable => isStable).subscribe(() => { + // Because 'onStable' fires before 'onError', we have to delay slightly before + // completing the request in case there's an error to report + setImmediate(() => { + resolve({ + html: state.renderToString() + }); + moduleRef.destroy(); + }); + }); + }); + }); +}); diff --git a/aspnet_core_sample_application/ClientApp/dist/89889688147bd7575d6327160d64e760.svg b/aspnet_core_sample_application/ClientApp/dist/89889688147bd7575d6327160d64e760.svg new file mode 100644 index 00000000..94fb5490 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/dist/89889688147bd7575d6327160d64e760.svg @@ -0,0 +1,288 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/aspnet_core_sample_application/ClientApp/dist/main-server.js b/aspnet_core_sample_application/ClientApp/dist/main-server.js new file mode 100644 index 00000000..0f8e0cf6 --- /dev/null +++ b/aspnet_core_sample_application/ClientApp/dist/main-server.js @@ -0,0 +1,95520 @@ +(function(e, a) { for(var i in a) e[i] = a[i]; }(exports, /******/ (function(modules) { // webpackBootstrap +/******/ // The module cache +/******/ var installedModules = {}; +/******/ +/******/ // The require function +/******/ function __webpack_require__(moduleId) { +/******/ +/******/ // Check if module is in cache +/******/ if(installedModules[moduleId]) { +/******/ return installedModules[moduleId].exports; +/******/ } +/******/ // Create a new module (and put it into the cache) +/******/ var module = installedModules[moduleId] = { +/******/ i: moduleId, +/******/ l: false, +/******/ exports: {} +/******/ }; +/******/ +/******/ // Execute the module function +/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__); +/******/ +/******/ // Flag the module as loaded +/******/ module.l = true; +/******/ +/******/ // Return the exports of the module +/******/ return module.exports; +/******/ } +/******/ +/******/ +/******/ // expose the modules object (__webpack_modules__) +/******/ __webpack_require__.m = modules; +/******/ +/******/ // expose the module cache +/******/ __webpack_require__.c = installedModules; +/******/ +/******/ // identity function for calling harmony imports with the correct context +/******/ __webpack_require__.i = function(value) { return value; }; +/******/ +/******/ // define getter function for harmony exports +/******/ __webpack_require__.d = function(exports, name, getter) { +/******/ if(!__webpack_require__.o(exports, name)) { +/******/ Object.defineProperty(exports, name, { +/******/ configurable: false, +/******/ enumerable: true, +/******/ get: getter +/******/ }); +/******/ } +/******/ }; +/******/ +/******/ // getDefaultExport function for compatibility with non-harmony modules +/******/ __webpack_require__.n = function(module) { +/******/ var getter = module && module.__esModule ? +/******/ function getDefault() { return module['default']; } : +/******/ function getModuleExports() { return module; }; +/******/ __webpack_require__.d(getter, 'a', getter); +/******/ return getter; +/******/ }; +/******/ +/******/ // Object.prototype.hasOwnProperty.call +/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); }; +/******/ +/******/ // __webpack_public_path__ +/******/ __webpack_require__.p = "/dist/"; +/******/ +/******/ // Load entry module and return exports +/******/ return __webpack_require__(__webpack_require__.s = 429); +/******/ }) +/************************************************************************/ +/******/ ([ +/* 0 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(3); + +/***/ }), +/* 1 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(0); + +/***/ }), +/* 2 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(269)); +__export(__webpack_require__(399)); +__export(__webpack_require__(400)); +__export(__webpack_require__(401)); + + +/***/ }), +/* 3 */ +/***/ (function(module, exports) { + +module.exports = require("./vendor"); + +/***/ }), +/* 4 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(2); + +/***/ }), +/* 5 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(10); + +/***/ }), +/* 6 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(8); + +/***/ }), +/* 7 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Observable_1 = __webpack_require__(1); +__webpack_require__(144); +/** + * @hidden + */ +exports.isPresent = function (value) { return value !== null && value !== undefined; }; +/** + * @hidden + */ +exports.isBlank = function (value) { return value === null || value === undefined; }; +/** + * @hidden + */ +exports.isArray = function (value) { return Array.isArray(value); }; +/** + * @hidden + */ +exports.isTruthy = function (value) { return !!value; }; +/** + * @hidden + */ +exports.isNullOrEmptyString = function (value) { return exports.isBlank(value) || value.trim().length === 0; }; +/** + * @hidden + */ +exports.isChanged = function (propertyName, changes, skipFirstChange) { + if (skipFirstChange === void 0) { skipFirstChange = true; } + return (changes[propertyName] && (!changes[propertyName].isFirstChange() || !skipFirstChange) && + changes[propertyName].previousValue !== changes[propertyName].currentValue); +}; +/** + * @hidden + */ +exports.anyChanged = function (propertyNames, changes, skipFirstChange) { + if (skipFirstChange === void 0) { skipFirstChange = true; } + return propertyNames.some(function (name) { return exports.isChanged(name, changes, skipFirstChange); }); +}; +/** + * @hidden + */ +exports.observe = function (list) { return Observable_1.Observable.from([list]).merge(list.changes); }; +/** + * @hidden + */ +exports.isUniversal = function () { return typeof document === 'undefined'; }; +/** + * @hidden + */ +exports.extractFormat = function (format) { + if (!exports.isNullOrEmptyString(format) && format.startsWith('{0:')) { + return format.slice(3, format.length - 1); + } + return format; +}; + + +/***/ }), +/* 8 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(6); + +/***/ }), +/* 9 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(7); + +/***/ }), +/* 10 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(81)); +__export(__webpack_require__(266)); +__export(__webpack_require__(267)); +__export(__webpack_require__(268)); +__export(__webpack_require__(398)); +__export(__webpack_require__(80)); + + +/***/ }), +/* 11 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(9); + +/***/ }), +/* 12 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(37); + +/***/ }), +/* 13 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var utils_1 = __webpack_require__(7); +var localizeOperators = function (operators) { return function (localization) { + return Object.keys(operators).reduce(function (acc, key) { + acc[operators[key]] = localization.get(key); + return acc; + }, {}); +}; }; // tslint:disable-line:align +var operatorTexts = localizeOperators({ + "filterEqOperator": "eq", + "filterNotEqOperator": "neq", + // tslint:disable-next-line:object-literal-sort-keys + "filterGteOperator": "gte", + "filterGtOperator": "gt", + "filterLteOperator": "lte", + "filterLtOperator": "lt", + "filterIsNullOperator": "isnull", + "filterIsNotNullOperator": "isnotnull", + "filterIsEmptyOperator": "isempty", + "filterIsNotEmptyOperator": "isnotempty", + "filterContainsOperator": "contains", + "filterNotContainsOperator": "doesnotcontain", + "filterStartsWithOperator": "startswith", + "filterEndsWithOperator": "endswith" +}); +/** + * @hidden + */ +exports.toJSON = function (xs) { return xs.map(function (x) { return x.toJSON(); }); }; +/** + * @hidden + */ +var FilterOperatorBase = (function () { + function FilterOperatorBase(operator, localization) { + this.operator = operator; + this.localization = localization; + this.messages = operatorTexts(this.localization); + this._text = this.messages[this.operator]; + } + Object.defineProperty(FilterOperatorBase.prototype, "text", { + /** + * The text to be displayed in the DropDownList. + * @readonly + * @type {string} + * @memberOf FilterOperatorBase + */ + get: function () { + return this._text; + }, + /** + * + */ + set: function (value) { + this._text = utils_1.isNullOrEmptyString(value) ? this.messages[this.operator] : value; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + FilterOperatorBase.prototype.toJSON = function () { + return { + text: this.text, + value: this.operator + }; + }; + return FilterOperatorBase; +}()); +FilterOperatorBase.propDecorators = { + 'text': [{ type: core_1.Input },], +}; +exports.FilterOperatorBase = FilterOperatorBase; + + +/***/ }), +/* 14 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(29); + +/***/ }), +/* 15 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(92); + +/***/ }), +/* 16 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var AsyncAction_1 = __webpack_require__(68); +var AsyncScheduler_1 = __webpack_require__(69); +/** + * + * Async Scheduler + * + * Schedule task as if you used setTimeout(task, duration) + * + * `async` scheduler schedules tasks asynchronously, by putting them on the JavaScript + * event loop queue. It is best used to delay tasks in time or to schedule tasks repeating + * in intervals. + * + * If you just want to "defer" task, that is to perform it right after currently + * executing synchronous code ends (commonly achieved by `setTimeout(deferredTask, 0)`), + * better choice will be the {@link asap} scheduler. + * + * @example Use async scheduler to delay task + * const task = () => console.log('it works!'); + * + * Rx.Scheduler.async.schedule(task, 2000); + * + * // After 2 seconds logs: + * // "it works!" + * + * + * @example Use async scheduler to repeat task in intervals + * function task(state) { + * console.log(state); + * this.schedule(state + 1, 1000); // `this` references currently executing Action, + * // which we reschedule with new state and delay + * } + * + * Rx.Scheduler.async.schedule(task, 3000, 0); + * + * // Logs: + * // 0 after 3s + * // 1 after 4s + * // 2 after 5s + * // 3 after 6s + * + * @static true + * @name async + * @owner Scheduler + */ +exports.async = new AsyncScheduler_1.AsyncScheduler(AsyncAction_1.AsyncAction); +//# sourceMappingURL=async.js.map + +/***/ }), +/* 17 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * @hidden + */ +exports.isPresent = function (value) { return value !== null && value !== undefined; }; +/** + * @hidden + */ +exports.isBlank = function (value) { return value === null || value === undefined; }; +/** + * @hidden + */ +exports.isArray = function (value) { return Array.isArray(value); }; +/** + * @hidden + */ +exports.isFunction = function (value) { return typeof value === 'function'; }; +/** + * @hidden + */ +exports.isString = function (value) { return typeof value === 'string'; }; +/** + * @hidden + */ +exports.isTruthy = function (value) { return !!value; }; +/** + * @hidden + */ +exports.isNullOrEmptyString = function (value) { return exports.isBlank(value) || value.trim().length === 0; }; +/** + * @hidden + */ +exports.isNotNullOrEmptyString = function (value) { return !exports.isNullOrEmptyString(value); }; +/** + * @hidden + */ +exports.isNumeric = function (value) { return !isNaN(value - parseFloat(value)); }; +/** + * @hidden + */ +exports.isDate = function (value) { return value && value.getTime; }; + + +/***/ }), +/* 18 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:no-bitwise */ +var kendo_date_math_1 = __webpack_require__(19); +var isSet = function (value) { return value !== null && value !== undefined; }; +/** + * @hidden + */ +exports.range = function (start, end) { + var result = []; + for (var i = start; i < end; i++) { + result.push(i); + } + return result; +}; +/** + * @hidden + */ +exports.isInDatesArray = function (date, dates) { + if (dates === void 0) { dates = []; } + return (!!dates.length && kendo_date_math_1.firstDayOfMonth(dates[0]) <= date && date <= kendo_date_math_1.lastDayOfMonth(dates[dates.length - 1])); +}; +/** + * @hidden + */ +exports.isInRange = function (candidate, min, max) { return (!candidate || !((min && min > candidate) || (max && max < candidate))); }; +/** + * @hidden + */ +exports.isValidRange = function (min, max) { return (!isSet(min) || !isSet(max) || min <= max); }; +/** + * @hidden + */ +exports.dateInRange = function (candidate, min, max) { + if (!candidate) { + return candidate; + } + if (min && candidate < min) { + return kendo_date_math_1.cloneDate(min); + } + if (max && candidate > max) { + return kendo_date_math_1.cloneDate(max); + } + return candidate; +}; +/** + * @hidden + */ +exports.guid = function () { + var id = "", random; + for (var i = 0; i < 32; i++) { + random = Math.random() * 16 | 0; + if (i === 8 || i === 12 || i === 16 || i === 20) { + id += "-"; + } + id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16); + } + return id; +}; +/** + * @hidden + */ +exports.noop = function (_) { }; // tslint:disable-line:no-empty +/** + * @hidden + */ +exports.isDocumentAvailable = function () { + return typeof document !== 'undefined'; +}; +/** + * @hidden + */ +exports.cellContextToString = function (ctx) { return (ctx ? "" + ctx.isFocused + ctx.isSelected + ctx.isWeekend + ctx.id : 'null'); }; +/** + * @hidden + */ +exports.stringifyClassObject = function (classes) { + var pushToAcc = function (acc, cls) { return classes[cls] ? acc.concat(cls) : acc; }; + return Object.keys(classes).reduce(pushToAcc, []).join(' '); +}; +/** + * @hidden + */ +exports.generateDates = function (start, count) { return (exports.range(0, count).map(function (i) { return kendo_date_math_1.addMonths(start, i); })); }; +/** + * @hidden + */ +exports.monthsDistance = function (d1, d2) { return (((d1.getFullYear() - d2.getFullYear())) * 12 + (d1.getMonth() - d2.getMonth())); }; +/** + * @hidden + */ +exports.shiftWeekNames = function (names, offset) { return (names.slice(offset).concat(names.slice(0, offset))); }; +/** + * @hidden + */ +exports.approximateStringMatching = function (oldTextOrigin, oldFormat, newTextOrigin, caret) { + // Remove the right part of the cursor. + //oldFormat = oldFormat.substring(0, caret + oldText.length - newText.length); + var oldTextSeparator = oldTextOrigin[caret + oldTextOrigin.length - newTextOrigin.length]; + var oldText = oldTextOrigin.substring(0, caret + oldTextOrigin.length - newTextOrigin.length); + var newText = newTextOrigin.substring(0, caret); + var diff = []; + // Handle typing a single character over the same selection. + if (oldText === newText && caret > 0) { + diff.push([oldFormat[caret - 1], newText[caret - 1]]); + return diff; + } + if (oldText.indexOf(newText) === 0 && (newText.length === 0 || oldFormat[newText.length - 1] !== oldFormat[newText.length])) { + // Handle Delete/Backspace. + var deletedSymbol = ""; + //XXX: + // Whole text is replaced with a same char + // Nasty patch required to keep the selection in the first segment + if (newText.length === 1) { + diff.push([oldFormat[0], newText[0]]); + } + for (var i = newText.length; i < oldText.length; i++) { + if (oldFormat[i] !== deletedSymbol && oldFormat[i] !== "_") { + deletedSymbol = oldFormat[i]; + diff.push([deletedSymbol, ""]); + } + } + return diff; + } + // Handle inserting text (the new text is longer than the previous one). + // Handle typing over a literal as well. + if (newText.indexOf(oldText) === 0 || oldFormat[caret - 1] === "_") { + var symbol = oldFormat[0]; + for (var i = Math.max(0, oldText.length - 1); i < oldFormat.length; i++) { + if (oldFormat[i] !== "_") { + symbol = oldFormat[i]; + break; + } + } + return [[symbol, newText[caret - 1]]]; + } + // Handle entering a space or a separator, for navigation to the next item. + if (newText[newText.length - 1] === " " || newText[newText.length - 1] === oldTextSeparator) { + return [[oldFormat[caret - 1], "_"]]; + } + // Handle typing over a correctly selected part. + return [[oldFormat[caret - 1], newText[caret - 1]]]; +}; + + +/***/ }), +/* 19 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +__export(__webpack_require__(85)); +__export(__webpack_require__(413)); +__export(__webpack_require__(414)); +__export(__webpack_require__(62)); +__export(__webpack_require__(46)); +__export(__webpack_require__(63)); +__export(__webpack_require__(136)); +__export(__webpack_require__(137)); +__export(__webpack_require__(86)); +__export(__webpack_require__(418)); +__export(__webpack_require__(279)); +__export(__webpack_require__(275)); +__export(__webpack_require__(415)); +__export(__webpack_require__(416)); +__export(__webpack_require__(276)); +__export(__webpack_require__(417)); +__export(__webpack_require__(277)); +__export(__webpack_require__(278)); +__export(__webpack_require__(419)); + + +/***/ }), +/* 20 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var NS = exports.NAMESPACES = { + HTML: 'http://www.w3.org/1999/xhtml', + MATHML: 'http://www.w3.org/1998/Math/MathML', + SVG: 'http://www.w3.org/2000/svg', + XLINK: 'http://www.w3.org/1999/xlink', + XML: 'http://www.w3.org/XML/1998/namespace', + XMLNS: 'http://www.w3.org/2000/xmlns/' +}; + +exports.ATTRS = { + TYPE: 'type', + ACTION: 'action', + ENCODING: 'encoding', + PROMPT: 'prompt', + NAME: 'name', + COLOR: 'color', + FACE: 'face', + SIZE: 'size' +}; + +exports.DOCUMENT_MODE = { + NO_QUIRKS: 'no-quirks', + QUIRKS: 'quirks', + LIMITED_QUIRKS: 'limited-quirks' +}; + +var $ = exports.TAG_NAMES = { + A: 'a', + ADDRESS: 'address', + ANNOTATION_XML: 'annotation-xml', + APPLET: 'applet', + AREA: 'area', + ARTICLE: 'article', + ASIDE: 'aside', + + B: 'b', + BASE: 'base', + BASEFONT: 'basefont', + BGSOUND: 'bgsound', + BIG: 'big', + BLOCKQUOTE: 'blockquote', + BODY: 'body', + BR: 'br', + BUTTON: 'button', + + CAPTION: 'caption', + CENTER: 'center', + CODE: 'code', + COL: 'col', + COLGROUP: 'colgroup', + + DD: 'dd', + DESC: 'desc', + DETAILS: 'details', + DIALOG: 'dialog', + DIR: 'dir', + DIV: 'div', + DL: 'dl', + DT: 'dt', + + EM: 'em', + EMBED: 'embed', + + FIELDSET: 'fieldset', + FIGCAPTION: 'figcaption', + FIGURE: 'figure', + FONT: 'font', + FOOTER: 'footer', + FOREIGN_OBJECT: 'foreignObject', + FORM: 'form', + FRAME: 'frame', + FRAMESET: 'frameset', + + H1: 'h1', + H2: 'h2', + H3: 'h3', + H4: 'h4', + H5: 'h5', + H6: 'h6', + HEAD: 'head', + HEADER: 'header', + HGROUP: 'hgroup', + HR: 'hr', + HTML: 'html', + + I: 'i', + IMG: 'img', + IMAGE: 'image', + INPUT: 'input', + IFRAME: 'iframe', + + KEYGEN: 'keygen', + + LABEL: 'label', + LI: 'li', + LINK: 'link', + LISTING: 'listing', + + MAIN: 'main', + MALIGNMARK: 'malignmark', + MARQUEE: 'marquee', + MATH: 'math', + MENU: 'menu', + MENUITEM: 'menuitem', + META: 'meta', + MGLYPH: 'mglyph', + MI: 'mi', + MO: 'mo', + MN: 'mn', + MS: 'ms', + MTEXT: 'mtext', + + NAV: 'nav', + NOBR: 'nobr', + NOFRAMES: 'noframes', + NOEMBED: 'noembed', + NOSCRIPT: 'noscript', + + OBJECT: 'object', + OL: 'ol', + OPTGROUP: 'optgroup', + OPTION: 'option', + + P: 'p', + PARAM: 'param', + PLAINTEXT: 'plaintext', + PRE: 'pre', + + RB: 'rb', + RP: 'rp', + RT: 'rt', + RTC: 'rtc', + RUBY: 'ruby', + + S: 's', + SCRIPT: 'script', + SECTION: 'section', + SELECT: 'select', + SOURCE: 'source', + SMALL: 'small', + SPAN: 'span', + STRIKE: 'strike', + STRONG: 'strong', + STYLE: 'style', + SUB: 'sub', + SUMMARY: 'summary', + SUP: 'sup', + + TABLE: 'table', + TBODY: 'tbody', + TEMPLATE: 'template', + TEXTAREA: 'textarea', + TFOOT: 'tfoot', + TD: 'td', + TH: 'th', + THEAD: 'thead', + TITLE: 'title', + TR: 'tr', + TRACK: 'track', + TT: 'tt', + + U: 'u', + UL: 'ul', + + SVG: 'svg', + + VAR: 'var', + + WBR: 'wbr', + + XMP: 'xmp' +}; + +var SPECIAL_ELEMENTS = exports.SPECIAL_ELEMENTS = Object.create(null); + +SPECIAL_ELEMENTS[NS.HTML] = Object.create(null); +SPECIAL_ELEMENTS[NS.HTML][$.ADDRESS] = true; +SPECIAL_ELEMENTS[NS.HTML][$.APPLET] = true; +SPECIAL_ELEMENTS[NS.HTML][$.AREA] = true; +SPECIAL_ELEMENTS[NS.HTML][$.ARTICLE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.ASIDE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BASE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BASEFONT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BGSOUND] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BLOCKQUOTE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BODY] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.BUTTON] = true; +SPECIAL_ELEMENTS[NS.HTML][$.CAPTION] = true; +SPECIAL_ELEMENTS[NS.HTML][$.CENTER] = true; +SPECIAL_ELEMENTS[NS.HTML][$.COL] = true; +SPECIAL_ELEMENTS[NS.HTML][$.COLGROUP] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DD] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DETAILS] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DIR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DIV] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DL] = true; +SPECIAL_ELEMENTS[NS.HTML][$.DT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.EMBED] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FIELDSET] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FIGCAPTION] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FIGURE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FOOTER] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FORM] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FRAME] = true; +SPECIAL_ELEMENTS[NS.HTML][$.FRAMESET] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H1] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H2] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H3] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H4] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H5] = true; +SPECIAL_ELEMENTS[NS.HTML][$.H6] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HEAD] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HEADER] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HGROUP] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.HTML] = true; +SPECIAL_ELEMENTS[NS.HTML][$.IFRAME] = true; +SPECIAL_ELEMENTS[NS.HTML][$.IMG] = true; +SPECIAL_ELEMENTS[NS.HTML][$.INPUT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.LI] = true; +SPECIAL_ELEMENTS[NS.HTML][$.LINK] = true; +SPECIAL_ELEMENTS[NS.HTML][$.LISTING] = true; +SPECIAL_ELEMENTS[NS.HTML][$.MAIN] = true; +SPECIAL_ELEMENTS[NS.HTML][$.MARQUEE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.MENU] = true; +SPECIAL_ELEMENTS[NS.HTML][$.META] = true; +SPECIAL_ELEMENTS[NS.HTML][$.NAV] = true; +SPECIAL_ELEMENTS[NS.HTML][$.NOEMBED] = true; +SPECIAL_ELEMENTS[NS.HTML][$.NOFRAMES] = true; +SPECIAL_ELEMENTS[NS.HTML][$.NOSCRIPT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.OBJECT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.OL] = true; +SPECIAL_ELEMENTS[NS.HTML][$.P] = true; +SPECIAL_ELEMENTS[NS.HTML][$.PARAM] = true; +SPECIAL_ELEMENTS[NS.HTML][$.PLAINTEXT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.PRE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SCRIPT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SECTION] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SELECT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SOURCE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.STYLE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.SUMMARY] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TABLE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TBODY] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TD] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TEMPLATE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TEXTAREA] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TFOOT] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TH] = true; +SPECIAL_ELEMENTS[NS.HTML][$.THEAD] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TITLE] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.TRACK] = true; +SPECIAL_ELEMENTS[NS.HTML][$.UL] = true; +SPECIAL_ELEMENTS[NS.HTML][$.WBR] = true; +SPECIAL_ELEMENTS[NS.HTML][$.XMP] = true; + +SPECIAL_ELEMENTS[NS.MATHML] = Object.create(null); +SPECIAL_ELEMENTS[NS.MATHML][$.MI] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.MO] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.MN] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.MS] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.MTEXT] = true; +SPECIAL_ELEMENTS[NS.MATHML][$.ANNOTATION_XML] = true; + +SPECIAL_ELEMENTS[NS.SVG] = Object.create(null); +SPECIAL_ELEMENTS[NS.SVG][$.TITLE] = true; +SPECIAL_ELEMENTS[NS.SVG][$.FOREIGN_OBJECT] = true; +SPECIAL_ELEMENTS[NS.SVG][$.DESC] = true; + + +/***/ }), +/* 21 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var fromEvent_1 = __webpack_require__(572); +Observable_1.Observable.fromEvent = fromEvent_1.fromEvent; +//# sourceMappingURL=fromEvent.js.map + +/***/ }), +/* 22 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var span_column_component_1 = __webpack_require__(127); +/** + * @hidden + */ +exports.expandColumns = function (columns) { return (columns.reduce(function (acc, column) { return acc.concat(span_column_component_1.isSpanColumnComponent(column) ? column.childColumns.toArray() : [column]); }, []) // tslint:disable-line:align +); }; +/** + * @hidden + */ +exports.columnsToRender = function (columns) { return (exports.expandColumns(columns).filter(function (x) { return !x.hidden; })); }; +/** + * @hidden + */ +exports.columnsSpan = function (columns) { + return (columns || []).reduce(function (acc, col) { return acc + col.colspan; }, 0); +}; + + +/***/ }), +/* 23 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(4); + +/***/ }), +/* 24 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/* tslint:disable:no-null-keyword */ +/* tslint:disable:no-bitwise */ +/* tslint:disable:align */ +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +exports.isPresent = function (value) { return value !== null && value !== undefined; }; +/** + * @hidden + */ +exports.isNumber = function (value) { return !isNaN(value); }; +/** + * @hidden + */ +exports.isChanged = function (propertyName, changes) { return (changes[propertyName] && !changes[propertyName].isFirstChange() && + changes[propertyName].previousValue !== changes[propertyName].currentValue); }; +/** + * @hidden + */ +exports.guid = function () { + var id = ""; + var i; + var random; + for (i = 0; i < 32; i++) { + random = Math.random() * 16 | 0; + if (i === 8 || i === 12 || i === 16 || i === 20) { + id += "-"; + } + id += (i === 12 ? 4 : (i === 16 ? (random & 3 | 8) : random)).toString(16); + } + return id; +}; +/** + * @hidden + */ +exports.combineStr = function (begin, end) { + return begin.concat(end.substr(end.toLowerCase().indexOf(begin.toLowerCase()) + begin.length)); +}; +/** + * @hidden + */ +exports.isDocumentAvailable = function () { return typeof document !== 'undefined'; }; +/** + * @hidden + */ +exports.isArray = function (value) { return Array.isArray(value); }; +/** + * @hidden + */ +exports.isObject = function (value) { return typeof value === 'object'; }; +/** + * @hidden + */ +exports.resolveValuesInArray = function (values, data, valueField) { + if (data === void 0) { data = []; } + return data.filter(function (curr) { + return values.some(function (item) { return item === curr[valueField]; }); + }); +}; +/** + * @hidden + */ +exports.validateComplexValues = function (values, valueField) { + return exports.isArray(values) && values.filter(function (item) { + return exports.isObject(item) && item[valueField]; + }); +}; +/** + * @hidden + */ +exports.resolveAllValues = function (value, data, valueField) { + var customValues = exports.validateComplexValues(value, valueField) || []; + var resolvedValues = exports.resolveValuesInArray(value, data, valueField) || []; + return resolvedValues.concat(customValues); +}; +/** + * @hidden + */ +exports.isObjectArray = function (values) { + return exports.isArray(values) && values.some(function (item) { return exports.isObject(item); }); +}; +/** + * @hidden + */ +exports.selectedIndices = function (values, data, valueField) { + var extractedValues = data.map(function (item) { + return exports.isPresent(item[valueField]) ? item[valueField] : item; + }); + return values.reduce(function (arr, item) { + var value = exports.isPresent(item[valueField]) ? item[valueField] : item; + var index = extractedValues.indexOf(value); + if (index !== -1) { + arr.push(index); + } + return arr; + }, []); +}; +/** + * @hidden + */ +exports.getter = function (dataItem, field, usePrimitive) { + if (usePrimitive === void 0) { usePrimitive = false; } + if (exports.isPresent(dataItem)) { + if (usePrimitive) { + return field && exports.isPresent(dataItem[field]) ? dataItem[field] : dataItem; + } + else { + return field ? dataItem[field] : dataItem; + } + } +}; +/** + * @hidden + */ +exports.resolveValue = function (args) { + var dataItem; + if (exports.isPresent(args.value)) { + dataItem = args.data.find(function (element) { return exports.getter(element, args.valueField) === args.value; }); + return { + dataItem: dataItem, + focused: args.data.indexOf(dataItem), + selected: args.data.indexOf(dataItem) + }; + } + else if (args.index) { + dataItem = args.data[args.index]; + return { + dataItem: args.data[args.index], + focused: args.index, + selected: args.index + }; + } + return { + dataItem: args.defaultItem, + focused: -1, + selected: -1 + }; +}; + + +/***/ }), +/* 25 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var utils_1 = __webpack_require__(7); +/** + * @hidden + */ +var isEqual = function (index) { return function (item) { return item.index === index; }; }; +/** + * @hidden + */ +var isNotEqual = function (index) { return function (item) { return item.index !== index; }; }; +/** + * @hidden + */ +var isNewRow = function (index) { return index === -1 || index === undefined; }; +/** + * @hidden + */ +var EditService = (function () { + function EditService() { + this.changes = new core_1.EventEmitter(); + this.editedIndices = []; + } + EditService.prototype.editRow = function (index, group) { + if (group === void 0) { group = undefined; } + this.editedIndices.push({ index: index, group: group }); + }; + EditService.prototype.addRow = function (group) { + this.newItemGroup = { group: group }; + }; + Object.defineProperty(EditService.prototype, "hasNewItem", { + get: function () { + return utils_1.isPresent(this.newItemGroup); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(EditService.prototype, "newDataItem", { + get: function () { + if (this.hasNewItem) { + return this.newItemGroup.group.value; + } + return {}; + }, + enumerable: true, + configurable: true + }); + EditService.prototype.close = function (index) { + if (isNewRow(index)) { + this.newItemGroup = undefined; + return; + } + this.editedIndices = this.editedIndices.filter(isNotEqual(index)); + }; + EditService.prototype.context = function (index) { + if (isNewRow(index)) { + return this.newItemGroup; + } + return this.editedIndices.find(isEqual(index)); + }; + EditService.prototype.isEdited = function (index) { + return utils_1.isPresent(this.context(index)); + }; + EditService.prototype.beginEdit = function (rowIndex) { + this.changes.emit({ action: 'edit', rowIndex: rowIndex }); + }; + EditService.prototype.beginAdd = function () { + this.changes.emit({ action: 'add' }); + }; + EditService.prototype.endEdit = function (rowIndex) { + var formGroup = this.context(rowIndex).group; + this.changes.emit({ action: 'cancel', rowIndex: rowIndex, formGroup: formGroup, isNew: isNewRow(rowIndex) }); + }; + EditService.prototype.save = function (rowIndex) { + var formGroup = this.context(rowIndex).group; + this.changes.emit({ action: 'save', rowIndex: rowIndex, formGroup: formGroup, isNew: isNewRow(rowIndex) }); + }; + EditService.prototype.remove = function (rowIndex) { + this.changes.emit({ action: 'remove', rowIndex: rowIndex }); + }; + return EditService; +}()); +EditService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +EditService.ctorParameters = function () { return []; }; +exports.EditService = EditService; + + +/***/ }), +/* 26 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Subject_1 = __webpack_require__(8); +/** + * Represent a service to set the filter descriptor. + */ +var FilterService = (function () { + function FilterService() { + /** + * Fires when the filter descriptors is set. + */ + this.changes = new Subject_1.Subject(); + } + /** + * Sets the filter descriptor. + * + * @param {CompositeFilterDescriptor} value - The filter descriptor that will be set. + */ + FilterService.prototype.filter = function (value) { + this.changes.next(value); + }; + return FilterService; +}()); +exports.FilterService = FilterService; + + +/***/ }), +/* 27 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var Subject_1 = __webpack_require__(8); +/** + * @hidden + */ +var PagerContextService = (function () { + function PagerContextService() { + this.changes = new Subject_1.Subject(); + this.pageChange = new Subject_1.Subject(); + } + PagerContextService.prototype.notifyChanges = function (changes) { + this.total = changes.total; + this.pageSize = changes.pageSize; + this.skip = changes.skip; + this.changes.next(changes); + }; + PagerContextService.prototype.changePage = function (page) { + this.pageChange.next({ skip: page * this.pageSize, take: this.pageSize }); + }; + PagerContextService.prototype.changePageSize = function (value) { + this.pageChange.next({ skip: 0, take: value }); + }; + return PagerContextService; +}()); +exports.PagerContextService = PagerContextService; + + +/***/ }), +/* 28 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var popup_service_1 = __webpack_require__(270); +exports.PopupService = popup_service_1.PopupService; +exports.POPUP_CONTAINER = popup_service_1.POPUP_CONTAINER; +var popup_component_1 = __webpack_require__(131); +exports.PopupComponent = popup_component_1.PopupComponent; +var popup_module_1 = __webpack_require__(402); +exports.PopupModule = popup_module_1.PopupModule; + + +/***/ }), +/* 29 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var header_template_directive_1 = __webpack_require__(122); +var footer_template_directive_1 = __webpack_require__(117); +/** + * @hidden + */ +exports.isSpanColumn = function (column) { return column.isSpanColumn; }; +var isColumnContainer = function (column) { return column.isColumnGroup || exports.isSpanColumn(column); }; +/** + * @hidden + */ +var ColumnBase = (function () { + function ColumnBase(parent) { + this.parent = parent; + /** + * @hidden + */ + this.headerTemplates = new core_1.QueryList(); + if (parent && !isColumnContainer(parent)) { + throw new Error('Columns can be nested only inside ColumnGroupComponent'); + } + } + Object.defineProperty(ColumnBase.prototype, "width", { + get: function () { return this._width; }, + /** + * The width of the column in pixels. + */ + set: function (value) { + this._width = parseInt(value, 10); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnBase.prototype, "level", { + /** + * @hidden + */ + get: function () { + if (this.parent && exports.isSpanColumn(this.parent)) { + return this.parent.level; + } + return this.parent ? this.parent.level + 1 : 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnBase.prototype, "isLocked", { + /** + * @hidden + */ + get: function () { + return this.parent ? this.parent.isLocked : this.locked; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnBase.prototype, "colspan", { + /** + * @hidden + */ + get: function () { + return 1; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + ColumnBase.prototype.rowspan = function (totalColumnLevels) { + return this.level < totalColumnLevels ? (totalColumnLevels - this.level) + 1 : 1; + }; + Object.defineProperty(ColumnBase.prototype, "headerTemplateRef", { + /** + * @hidden + */ + get: function () { + var template = this.headerTemplates.first; + return template ? template.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnBase.prototype, "footerTemplateRef", { + /** + * @hidden + */ + get: function () { + return this.footerTemplate ? this.footerTemplate.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnBase.prototype, "displayTitle", { + get: function () { + return this.title; + }, + enumerable: true, + configurable: true + }); + return ColumnBase; +}()); +ColumnBase.propDecorators = { + 'title': [{ type: core_1.Input },], + 'width': [{ type: core_1.Input },], + 'locked': [{ type: core_1.Input },], + 'hidden': [{ type: core_1.Input },], + 'media': [{ type: core_1.Input },], + 'style': [{ type: core_1.Input },], + 'headerStyle': [{ type: core_1.Input },], + 'footerStyle': [{ type: core_1.Input },], + 'cssClass': [{ type: core_1.Input, args: ['class',] },], + 'headerClass': [{ type: core_1.Input },], + 'footerClass': [{ type: core_1.Input },], + 'headerTemplates': [{ type: core_1.ContentChildren, args: [header_template_directive_1.HeaderTemplateDirective, { descendants: false },] },], + 'footerTemplate': [{ type: core_1.ContentChild, args: [footer_template_directive_1.FooterTemplateDirective,] },], +}; +exports.ColumnBase = ColumnBase; + + +/***/ }), +/* 30 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var cell_template_directive_1 = __webpack_require__(57); +var group_header_template_directive_1 = __webpack_require__(120); +var edit_template_directive_1 = __webpack_require__(111); +var group_footer_template_directive_1 = __webpack_require__(119); +var column_base_1 = __webpack_require__(29); +var utils_1 = __webpack_require__(7); +var filter_cell_template_directive_1 = __webpack_require__(114); +/** + * @hidden + */ +function isColumnComponent(column) { + return utils_1.isPresent(column.field); +} +exports.isColumnComponent = isColumnComponent; +/** + * Represents the columns of the Grid. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * + * + * + * + * + * + * + * + * + * + * ` + * }) + * + * class AppComponent { + * private gridData: any[]; + * + * constructor() { + * this.gridData = products; + * } + * } + * + * const products = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": true + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false + * } + * ]; + * + * ``` + */ +var ColumnComponent = (function (_super) { + __extends(ColumnComponent, _super); + function ColumnComponent(parent) { + var _this = _super.call(this, parent) || this; + /** + * Allows the column headers to be clicked and the `sortChange` event emitted. + * You have to handle the `sortChange` event yourself and sort the data. + */ + _this.sortable = true; + /** + * Defines the editor type. Used when the column enters the edit mode. The default editor type is `text`. + * + * @example + * ```ts-no-run + * + * + * + * + * ``` + */ + _this.editor = 'text'; + /** + * Defines the filter type that is displayed inside the filter row. The default value is `text`. + * + * @example + * ```ts-no-run + * + * + * + * + * ``` + */ + _this.filter = 'text'; + /** + * Defines if a filter UI will be displayed for this column. The default value is `true`. + * + * @example + * ```ts-no-run + * + * + * + * + * ``` + */ + _this.filterable = true; + /** + * Defines whether the column is editable. The default value is `true`. + * + * @example + * ```ts-no-run + * + * + * + * + * ``` + */ + _this.editable = true; + return _this; + } + Object.defineProperty(ColumnComponent.prototype, "templateRef", { + get: function () { + return this.template ? this.template.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnComponent.prototype, "groupHeaderTemplateRef", { + get: function () { + return this.groupHeaderTemplate ? this.groupHeaderTemplate.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnComponent.prototype, "groupFooterTemplateRef", { + get: function () { + return this.groupFooterTemplate ? this.groupFooterTemplate.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnComponent.prototype, "editTemplateRef", { + get: function () { + return this.editTemplate ? this.editTemplate.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnComponent.prototype, "filterCellTemplateRef", { + get: function () { + return this.filterCellTemplate ? this.filterCellTemplate.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ColumnComponent.prototype, "displayTitle", { + get: function () { + return this.title === undefined ? this.field : this.title; + }, + enumerable: true, + configurable: true + }); + return ColumnComponent; +}(column_base_1.ColumnBase)); +ColumnComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: column_base_1.ColumnBase, + useExisting: core_1.forwardRef(function () { return ColumnComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-grid-column', + template: "" + },] }, +]; +/** @nocollapse */ +ColumnComponent.ctorParameters = function () { return [ + { type: column_base_1.ColumnBase, decorators: [{ type: core_1.SkipSelf }, { type: core_1.Host }, { type: core_1.Optional },] }, +]; }; +ColumnComponent.propDecorators = { + 'field': [{ type: core_1.Input },], + 'format': [{ type: core_1.Input },], + 'sortable': [{ type: core_1.Input },], + 'editor': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], + 'filterable': [{ type: core_1.Input },], + 'editable': [{ type: core_1.Input },], + 'template': [{ type: core_1.ContentChild, args: [cell_template_directive_1.CellTemplateDirective,] },], + 'groupHeaderTemplate': [{ type: core_1.ContentChild, args: [group_header_template_directive_1.GroupHeaderTemplateDirective,] },], + 'groupFooterTemplate': [{ type: core_1.ContentChild, args: [group_footer_template_directive_1.GroupFooterTemplateDirective,] },], + 'editTemplate': [{ type: core_1.ContentChild, args: [edit_template_directive_1.EditTemplateDirective,] },], + 'filterCellTemplate': [{ type: core_1.ContentChild, args: [filter_cell_template_directive_1.FilterCellTemplateDirective,] },], +}; +exports.ColumnComponent = ColumnComponent; + + +/***/ }), +/* 31 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_data_query_1 = __webpack_require__(134); +var utils_1 = __webpack_require__(7); +var filter_operator_base_1 = __webpack_require__(13); +var flatten = function (filter) { + if (utils_1.isPresent(filter.filters)) { + return filter.filters.reduce(function (acc, curr) { + return acc.concat(kendo_data_query_1.isCompositeFilterDescriptor(curr) ? flatten(curr) : [curr]); + }, []); + } + return []; +}; +var trimFilterByField = function (filter, field) { + if (utils_1.isPresent(filter) && utils_1.isPresent(filter.filters)) { + filter.filters = filter.filters.filter(function (x) { + if (kendo_data_query_1.isCompositeFilterDescriptor(x)) { + trimFilterByField(x, field); + return x.filters.length; + } + else { + return x.field !== field; + } + }); + } +}; +/** + * @hidden + */ +exports.localizeOperators = function (operators) { return function (localization) { return Object.keys(operators).map(function (key) { return ({ + text: localization.get(key), + value: operators[key] +}); }); }; }; +/** + * An abstract base class for the filter-cell component. + */ +var BaseFilterCellComponent = (function () { + function BaseFilterCellComponent(filterService) { + this.filterService = filterService; + this.operatorList = new core_1.QueryList(); + } + Object.defineProperty(BaseFilterCellComponent.prototype, "hostClasses", { + /** + * @hidden + */ + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BaseFilterCellComponent.prototype, "operators", { + get: function () { + return this._operators.length ? this._operators : this.defaultOperators; + }, + set: function (values) { + this._operators = values; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + BaseFilterCellComponent.prototype.ngAfterContentInit = function () { + var _this = this; + this.operationListSubscription = utils_1.observe(this.operatorList) + .map(filter_operator_base_1.toJSON) + .subscribe(function (x) { + _this.operators = x; + }); + }; + BaseFilterCellComponent.prototype.ngOnDestroy = function () { + if (this.operationListSubscription) { + this.operationListSubscription.unsubscribe(); + } + }; + BaseFilterCellComponent.prototype.filterByField = function (field) { + var currentFilter = this.filtersByField(field)[0]; + return currentFilter; + }; + BaseFilterCellComponent.prototype.filtersByField = function (field) { + return flatten(this.filter || {}).filter(function (x) { return x.field === field; }); + }; + BaseFilterCellComponent.prototype.removeFilter = function (field) { + trimFilterByField(this.filter, field); + return this.filter; + }; + BaseFilterCellComponent.prototype.updateFilter = function (filter) { + var root = this.filter || { + filters: [], + logic: "and" + }; + var currentFilter = flatten(root).filter(function (x) { return x.field === filter.field; })[0]; + if (!utils_1.isPresent(currentFilter)) { + root.filters.push(filter); + } + else { + Object.assign(currentFilter, filter); + } + return root; + }; + BaseFilterCellComponent.prototype.applyFilter = function (filter) { + this.filterService.filter(filter); + }; + return BaseFilterCellComponent; +}()); +BaseFilterCellComponent.propDecorators = { + 'hostClasses': [{ type: core_1.HostBinding, args: ['class.k-filtercell',] },], + 'operatorList': [{ type: core_1.ContentChildren, args: [filter_operator_base_1.FilterOperatorBase,] },], +}; +exports.BaseFilterCellComponent = BaseFilterCellComponent; + + +/***/ }), +/* 32 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var common_1 = __webpack_require__(9); +var column_component_1 = __webpack_require__(30); +var span_column_component_1 = __webpack_require__(127); +var column_group_component_1 = __webpack_require__(58); +var footer_template_directive_1 = __webpack_require__(117); +var col_group_component_1 = __webpack_require__(197); +var resizable_directive_1 = __webpack_require__(241); +var template_context_directive_1 = __webpack_require__(247); +var detail_template_directive_1 = __webpack_require__(108); +var draggable_directive_1 = __webpack_require__(110); +var field_accessor_pipe_1 = __webpack_require__(365); +var exportedModules = [ + draggable_directive_1.DraggableDirective, + column_component_1.ColumnComponent, + column_group_component_1.ColumnGroupComponent, + footer_template_directive_1.FooterTemplateDirective, + col_group_component_1.ColGroupComponent, + resizable_directive_1.ResizableContainerDirective, + template_context_directive_1.TemplateContextDirective, + field_accessor_pipe_1.FieldAccessorPipe, + detail_template_directive_1.DetailTemplateDirective, + span_column_component_1.SpanColumnComponent +]; +/** + * @hidden + */ +var SharedModule = (function () { + function SharedModule() { + } + SharedModule.exports = function () { + return [ + column_component_1.ColumnComponent, + span_column_component_1.SpanColumnComponent, + column_group_component_1.ColumnGroupComponent, + footer_template_directive_1.FooterTemplateDirective, + detail_template_directive_1.DetailTemplateDirective + ]; + }; + return SharedModule; +}()); +SharedModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [exportedModules], + exports: [exportedModules], + imports: [common_1.CommonModule] + },] }, +]; +/** @nocollapse */ +SharedModule.ctorParameters = function () { return []; }; +exports.SharedModule = SharedModule; + + +/***/ }), +/* 33 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var filter_1 = __webpack_require__(155); +Observable_1.Observable.prototype.filter = filter_1.filter; +//# sourceMappingURL=filter.js.map + +/***/ }), +/* 34 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var map_1 = __webpack_require__(152); +Observable_1.Observable.prototype.map = map_1.map; +//# sourceMappingURL=map.js.map + +/***/ }), +/* 35 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(34); + +/***/ }), +/* 36 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +var Keys; +(function (Keys) { + Keys[Keys["backspace"] = 8] = "backspace"; + Keys[Keys["tab"] = 9] = "tab"; + Keys[Keys["enter"] = 13] = "enter"; + Keys[Keys["shift"] = 16] = "shift"; + Keys[Keys["ctrl"] = 17] = "ctrl"; + Keys[Keys["alt"] = 18] = "alt"; + Keys[Keys["pause/break"] = 19] = "pause/break"; + Keys[Keys["caps lock"] = 20] = "caps lock"; + Keys[Keys["esc"] = 27] = "esc"; + Keys[Keys["space"] = 32] = "space"; + Keys[Keys["page up"] = 33] = "page up"; + Keys[Keys["page down"] = 34] = "page down"; + Keys[Keys["end"] = 35] = "end"; + Keys[Keys["home"] = 36] = "home"; + Keys[Keys["left"] = 37] = "left"; + Keys[Keys["up"] = 38] = "up"; + Keys[Keys["right"] = 39] = "right"; + Keys[Keys["down"] = 40] = "down"; + Keys[Keys["insert"] = 45] = "insert"; + Keys[Keys["delete"] = 46] = "delete"; + Keys[Keys["command"] = 91] = "command"; + Keys[Keys["left command"] = 91] = "left command"; + Keys[Keys["right command"] = 93] = "right command"; + Keys[Keys["numpad *"] = 106] = "numpad *"; + Keys[Keys["numpad +"] = 107] = "numpad +"; + Keys[Keys["numpad -"] = 109] = "numpad -"; + Keys[Keys["numpad ."] = 110] = "numpad ."; + Keys[Keys["numpad /"] = 111] = "numpad /"; + Keys[Keys["num lock"] = 144] = "num lock"; + Keys[Keys["scroll lock"] = 145] = "scroll lock"; + Keys[Keys["my computer"] = 182] = "my computer"; + Keys[Keys["my calculator"] = 183] = "my calculator"; + Keys[Keys[";"] = 186] = ";"; + Keys[Keys["="] = 187] = "="; + Keys[Keys[","] = 188] = ","; + Keys[Keys["-"] = 189] = "-"; + Keys[Keys["."] = 190] = "."; + Keys[Keys["/"] = 191] = "/"; + Keys[Keys["`"] = 192] = "`"; + Keys[Keys["["] = 219] = "["; + Keys[Keys["\\"] = 220] = "\\"; + Keys[Keys["]"] = 221] = "]"; + Keys[Keys["'"] = 222] = "'"; +})(Keys = exports.Keys || (exports.Keys = {})); + + +/***/ }), +/* 37 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var util_1 = __webpack_require__(24); +/** + * @hidden + */ +var SelectionService = (function () { + function SelectionService() { + this.onSelect = new core_1.EventEmitter(); + this.onChange = new core_1.EventEmitter(); + this.onFocus = new core_1.EventEmitter(); + this.selectedIndices = []; + } + SelectionService.prototype.isSelected = function (index) { + return util_1.isPresent(this.selectedIndices.find(function (current) { return current === index; })); + }; + SelectionService.prototype.isFocused = function (index) { + return index === this.focused; + }; + SelectionService.prototype.focus = function (index) { + if (this.isFocused(index)) { + return; + } + this.focused = index; + this.onFocus.emit(index); + }; + SelectionService.prototype.select = function (index) { + if (this.isSelected(index)) { + return; + } + this.selectedIndices = [index]; + this.focused = index; + this.onSelect.emit({ + indices: this.selectedIndices.slice() + }); + }; + SelectionService.prototype.add = function (index) { + if (this.isSelected(index)) { + return; + } + this.selectedIndices.push(index); + this.focused = index; + this.onChange.emit({ + added: index, + indices: this.selectedIndices.slice() + }); + }; + SelectionService.prototype.unselect = function (index) { + if (!this.isSelected(index)) { + return; + } + var position = this.selectedIndices.indexOf(index); + this.selectedIndices.splice(position, 1); + this.focused = index; + this.onChange.emit({ + indices: this.selectedIndices.slice(), + removed: index + }); + }; + SelectionService.prototype.change = function (index) { + this.selectedIndices = [index]; + this.focused = index; + this.onChange.emit({ + indices: this.selectedIndices.slice() + }); + }; + SelectionService.prototype.resetSelection = function (index) { + this.selectedIndices = index instanceof Array ? index : [index]; + this.focused = this.selectedIndices[this.selectedIndices.length - 1]; + }; + Object.defineProperty(SelectionService.prototype, "selected", { + get: function () { + return this.selectedIndices.slice(); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SelectionService.prototype, "focused", { + get: function () { + return this.focusedIndex; + }, + set: function (index) { + if (this.focusedIndex !== index) { + this.focusedIndex = index; + this.onFocus.emit(index); + } + }, + enumerable: true, + configurable: true + }); + return SelectionService; +}()); +SelectionService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +SelectionService.ctorParameters = function () { return []; }; +exports.SelectionService = SelectionService; + + +/***/ }), +/* 38 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var item_template_directive_1 = __webpack_require__(41); +var header_template_directive_1 = __webpack_require__(40); +var footer_template_directive_1 = __webpack_require__(39); +var no_data_template_directive_1 = __webpack_require__(56); +var SHARED_DIRECTIVES = [ + header_template_directive_1.HeaderTemplateDirective, + footer_template_directive_1.FooterTemplateDirective, + item_template_directive_1.ItemTemplateDirective, + no_data_template_directive_1.NoDataTemplateDirective +]; +/** + * @hidden + * + * The exported package module. + * + * The package exports: + * - `ItemTemplateDirective`—The item template directive. + * - `HeaderTemplateDirective`—The header template directive. + * - `FooterTemplateDirective`—The footer template directive. + * - `NoDataTemplateDirective`—The noData template directive. + */ +var SharedDirectivesModule = (function () { + function SharedDirectivesModule() { + } + return SharedDirectivesModule; +}()); +SharedDirectivesModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [SHARED_DIRECTIVES], + exports: [SHARED_DIRECTIVES] + },] }, +]; +/** @nocollapse */ +SharedDirectivesModule.ctorParameters = function () { return []; }; +exports.SharedDirectivesModule = SharedDirectivesModule; + + +/***/ }), +/* 39 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:max-line-length */ +var core_1 = __webpack_require__(0); +/** + * Used for rendering the list footer content. + * + * To define the footer template, nest a `` tag with the `kendoFooterTemplate` directive inside the component tag. + * + * Use: + * - The `kendoAutoCompleteFooterTemplate` directive for the AutoComplete. + * - The `kendoComboBoxFooterTemplate` directive for the ComboBox. + * - The `kendoDropDownListFooterTemplate` directive for the DropDownList. + * - The `kendoMultiSelectFooterTemplate` directive for the MultiSelect. + * + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + *

Footer template

+ *
+ *
+ * ` + * }) + * class AppComponent { + * public listItems: Array = ["Item 1", "Item 2", "Item 3", "Item 4"]; + * } + * ``` + * + * For more examples, refer to the article on [templates]({% slug overview_ddl_kendouiforangular %}#toc-templates). + */ +var FooterTemplateDirective = (function () { + function FooterTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return FooterTemplateDirective; +}()); +FooterTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoDropDownListFooterTemplate],[kendoComboBoxFooterTemplate],[kendoAutoCompleteFooterTemplate],[kendoMultiSelectFooterTemplate]' + },] }, +]; +/** @nocollapse */ +FooterTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, }, +]; }; +exports.FooterTemplateDirective = FooterTemplateDirective; + + +/***/ }), +/* 40 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:max-line-length */ +var core_1 = __webpack_require__(0); +/** + * Used for rendering the list header content. + * + * To define the header template, nest a `` tag with the `kendoHeaderTemplate` directive inside the component tag. + * + * Use: + * - The `kendoAutoCompleteHeaderTemplate` directive for the AutoComplete. + * - The `kendoComboBoxHeaderTemplate` directive for the ComboBox. + * - The `kendoDropDownListHeaderTemplate` directive for the DropDownList. + * - The `kendoMultiSelectHeaderTemplate` directive for the MultiSelect. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + *

Header template

+ *
+ *
+ * ` + * }) + * class AppComponent { + * public listItems: Array = ["Item 1", "Item 2", "Item 3", "Item 4"]; + * } + * ``` + * For more examples, refer to the article on [templates]({% slug overview_ddl_kendouiforangular %}#toc-templates). + */ +var HeaderTemplateDirective = (function () { + function HeaderTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return HeaderTemplateDirective; +}()); +HeaderTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoDropDownListHeaderTemplate],[kendoComboBoxHeaderTemplate],[kendoAutoCompleteHeaderTemplate],[kendoMultiSelectHeaderTemplate]' + },] }, +]; +/** @nocollapse */ +HeaderTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, }, +]; }; +exports.HeaderTemplateDirective = HeaderTemplateDirective; + + +/***/ }), +/* 41 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:max-line-length */ +var core_1 = __webpack_require__(0); +/** + * Used for rendering the list item content. + * + * To define the item template, nest a `` tag with the `kendoItemTemplate` directive inside the component tag. + * + * Use: + * - The `kendoAutoCompleteItemTemplate` directive for the AutoComplete. + * - The `kendoComboBoxItemTemplate` directive for the ComboBox. + * - The `kendoDropDownListItemTemplate` directive for the DropDownList. + * - The `kendoMultiSelectItemTemplate` directive for the MultiSelect. + * + * The template context is set to the current component. To get a reference to the current data item, use the `let-dataItem` directive. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * {{dataItem}} option + * + * + * ` + * }) + * class AppComponent { + * public listItems: Array = ["Item 1", "Item 2", "Item 3", "Item 4"]; + * } + * ``` + * + * For more examples, refer to the article on [templates]({% slug overview_ddl_kendouiforangular %}#toc-templates). + */ +var ItemTemplateDirective = (function () { + function ItemTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return ItemTemplateDirective; +}()); +ItemTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoDropDownListItemTemplate],[kendoComboBoxItemTemplate],[kendoAutoCompleteItemTemplate],[kendoMultiSelectItemTemplate]' + },] }, +]; +/** @nocollapse */ +ItemTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, }, +]; }; +exports.ItemTemplateDirective = ItemTemplateDirective; + + +/***/ }), +/* 42 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +exports.CELL_CONTEXT = new core_1.OpaqueToken('grid-cell-context'); +/** + * @hidden + */ +exports.EMPTY_CELL_CONTEXT = {}; + + +/***/ }), +/* 43 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +var PagerElementComponent = (function () { + function PagerElementComponent(localization, pagerContext) { + this.localization = localization; + this.pagerContext = pagerContext; + this.total = this.pagerContext.total; + this.skip = this.pagerContext.skip; + this.pageSize = this.pagerContext.pageSize; + } + Object.defineProperty(PagerElementComponent.prototype, "currentPage", { + /** + * @hidden + * + * @readonly + * @type {number} + * @memberOf PagerElementComponent + */ + get: function () { + return Math.floor((this.skip || 0) / this.pageSize) + 1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerElementComponent.prototype, "totalPages", { + /** + * @hidden + * + * @readonly + * @type {number} + * @memberOf PagerElementComponent + */ + get: function () { + return Math.ceil((this.total || 0) / this.pageSize); + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + * + * @param {string} key + * @returns {string} + * + * @memberOf PagerElementComponent + */ + PagerElementComponent.prototype.textFor = function (key) { + return this.localization.get(key); + }; + /** + * @hidden + * + * @param {number} page + * + * @memberOf PagerElementComponent + */ + PagerElementComponent.prototype.changePage = function (page) { + this.pagerContext.changePage(page); + return false; + }; + /** + * @hidden + * + * @memberOf PagerElementComponent + */ + PagerElementComponent.prototype.ngOnInit = function () { + this.changesSubscription = this.pagerContext.changes.subscribe(this.onChanges.bind(this)); + }; + PagerElementComponent.prototype.ngOnDestroy = function () { + if (this.changesSubscription) { + this.changesSubscription.unsubscribe(); + } + }; + return PagerElementComponent; +}()); +exports.PagerElementComponent = PagerElementComponent; + + +/***/ }), +/* 44 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +exports.eitherRect = function (rect, offset) { + if (!rect) { + return { height: 0, left: offset.left, top: offset.top, width: 0 }; + } + return rect; +}; +/** + * @hidden + */ +exports.replaceOffset = function (rect, offset) { + if (!offset) { + return rect; + } + var result = { + height: rect.height, + left: offset.left, + top: offset.top, + width: rect.width + }; + return result; +}; +/** + * @hidden + */ +exports.removeStackingOffset = function (rect, stackingOffset) { + if (!stackingOffset) { + return rect; + } + var result = { + height: rect.height, + left: rect.left - stackingOffset.left, + top: rect.top - stackingOffset.top, + width: rect.width + }; + return result; +}; +/** + * @hidden + */ +exports.isDifferentOffset = function (oldOffset, newOffset) { + var oldLeft = oldOffset.left, oldTop = oldOffset.top; + var newLeft = newOffset.left, newTop = newOffset.top; + return Math.abs(oldLeft - newLeft) >= 1 || Math.abs(oldTop - newTop) >= 1; +}; +/** + * @hidden + */ +exports.isDocumentAvailable = function () { + return typeof document !== 'undefined' && !!document.body; +}; +/** + * @hidden + */ +exports.isWindowAvailable = function () { + return typeof window !== 'undefined'; +}; +/** + * @hidden + */ +exports.hasBoundingRect = function (elem) { return !!elem.getBoundingClientRect; }; +/** + * @hidden + */ +exports.OVERFLOW_REGEXP = /auto|scroll/; +/** + * @hidden + */ +exports.scrollableParents = function (element) { + var parents = []; + if (!exports.isDocumentAvailable() || !exports.isWindowAvailable()) { + return parents; + } + var parent = element.parentElement; + while (parent) { + if (exports.OVERFLOW_REGEXP.test(window.getComputedStyle(parent).overflow)) { + parents.push(parent); + } + parent = parent.parentElement; + } + parents.push(window); + return parents; +}; +/** + * @hidden + */ +exports.FRAME_DURATION = 1000 / 60; //1000ms divided by 60fps +/** + * @hidden + */ +exports.hasRelativeStackingContext = function () { + if (!exports.isDocumentAvailable()) { + return false; + } + var top = 10; + var parent = document.createElement("div"); + parent.style.transform = "matrix(10, 0, 0, 10, 0, 0)"; + parent.innerHTML = "
child
"; + document.body.appendChild(parent); + var isDifferent = parent.children[0].getBoundingClientRect().top !== top; + document.body.removeChild(parent); + return isDifferent; +}; +/** + * @hidden + */ +exports.HAS_RELATIVE_STACKING_CONTEXT = exports.hasRelativeStackingContext(); +var parents = function (element, until) { + var result = []; + var next = element.parentNode; + while (next) { + result.push(next); + if (next === until) { + break; + } + next = next.parentNode; + } + return result; +}; +var siblings = function (element) { + var result = []; + var sibling = element.parentNode.firstElementChild; + while (sibling) { + if (sibling !== element) { + result.push(sibling); + } + sibling = sibling.nextElementSibling; + } + return result; +}; +var siblingContainer = function (anchor, container) { + var parentElements = parents(anchor); + var containerElement = container; + var siblingElements; + var result; + while (containerElement) { + siblingElements = siblings(containerElement); + result = parentElements.reduce(function (list, p) { return list.concat(siblingElements.filter(function (s) { return s === p; })); }, [])[0]; + if (result) { + break; + } + containerElement = containerElement.parentElement; + } + return result; +}; +/** + * @hidden + */ +exports.zIndex = function (anchor, container) { + if (!anchor || !exports.isDocumentAvailable() || !exports.isWindowAvailable()) { + return null; + } + var sibling = siblingContainer(anchor, container); + if (!sibling) { + return null; + } + var result = [anchor].concat(parents(anchor, sibling)).reduce(function (index, p) { + var zIndexStyle = p.style.zIndex || window.getComputedStyle(p).zIndex; + var current = parseInt(zIndexStyle, 10); + return current > index ? current : index; + }, 0); + return result ? (result + 1) : null; +}; + + +/***/ }), +/* 45 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var utils_1 = __webpack_require__(17); +var empty = ["", ""]; +var concat = function (left, right) { return [left[0] + right[0], left[1] + right[1]]; }; +var notEmpty = function (member) { return !utils_1.isNullOrEmptyString(member); }; +var parseMember = function (member, idx, length) { + var first = "("; + var index = member.indexOf('['); + if (index === -1) { + member = "." + member; + } + else if (index > 0) { + first += "("; + member = "." + member.substring(0, index) + " || {})" + member.substring(index); + } + member += (idx < length - 1) ? " || {})" : ")"; + return [first, member]; +}; +var wrapExpression = function (members, paramName) { return (members + .filter(notEmpty) + .reduce(function (pair, member, idx, arr) { return concat(pair, parseMember(member, idx, arr.length)); }, empty) + .join(paramName)); }; +var getterCache = {}; +/** + * @hidden + */ +exports.expr = function (expression, safe, paramName) { + if (expression === void 0) { expression = ""; } + if (safe === void 0) { safe = false; } + if (paramName === void 0) { paramName = "d"; } + if (expression && expression.charAt(0) !== "[") { + expression = "." + expression; + } + if (safe) { + expression = expression.replace(/"([^.]*)\.([^"]*)"/g, '"$1_$DOT$_$2"'); + expression = expression.replace(/'([^.]*)\.([^']*)'/g, "'$1_$DOT$_$2'"); + expression = wrapExpression(expression.split("."), paramName); + expression = expression.replace(/_\$DOT\$_/g, "."); + } + else { + expression = paramName + expression; + } + return expression; +}; +/** + * @hidden + */ +exports.getter = function (expression, safe) { + var key = expression + safe; + return getterCache[key] = getterCache[key] || new Function("d", "return " + exports.expr(expression, safe)); +}; + + +/***/ }), +/* 46 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * A function that clones the passed date. The parameter could be `null`. + * + * @param date - The initial date value. + * @returns - A new `Date` instance. + * + * @example + * ```ts-no-run + * cloneDate(new Date(2016, 0, 1)); // returns new Date(2016, 0, 1); + * cloneDate(null); // returns null + * ``` + */ +exports.cloneDate = function (date) { return date ? new Date(date.getTime()) : date; }; + + +/***/ }), +/* 47 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var merge_1 = __webpack_require__(700); +Observable_1.Observable.prototype.merge = merge_1.merge; +//# sourceMappingURL=merge.js.map + +/***/ }), +/* 48 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(11); + +/***/ }), +/* 49 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(18); + +/***/ }), +/* 50 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(86); + +/***/ }), +/* 51 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var util_1 = __webpack_require__(18); +var div = function (styles, content) { + if (styles === void 0) { styles = ""; } + if (content === void 0) { content = ""; } + var el = document.createElement('div'); + el.className = styles; + el.innerHTML = content; + return el; +}; +var containerFactory = function (type) { return function (children, styles) { + if (styles === void 0) { styles = ""; } + var container = document.createElement(type); + container.className = styles; + children.forEach(function (child) { return container.appendChild(child); }); + return container; +}; }; +var cell = function (type, content, styles) { + if (styles === void 0) { styles = ""; } + var tableCell = document.createElement(type); + tableCell.innerHTML = content; + tableCell.className = styles; + return tableCell; +}; +var tr = containerFactory('tr'); +var tbody = containerFactory('tbody'); +var thead = containerFactory('thead'); +var table = function (body, styles) { + if (styles === void 0) { styles = ""; } + var tableElement = document.createElement('table'); + tableElement.appendChild(body); + tableElement.className = styles; + return tableElement; +}; +var monthHeader = function () { + return div('k-calendar-header', "\n March 2017\n TODAY\n "); +}; +var monthWeekHeader = function () { + return table(thead([ + tr([cell('th', 'MO')]) + ]), 'k-calendar-weekdays'); +}; +var monthContent = function () { + return table(tbody([ + tr([cell('th', '1')]), + tr([cell('td', '1')]), + tr([cell('td', '1')]), + tr([cell('td', '1')]), + tr([cell('td', '1')]), + tr([cell('td', '1')]), + tr([cell('td', '1')]) + ])); +}; +var scrollable = function () { + return div('k-content k-scrollable'); +}; +var monthScrollable = function () { + var scrollableElement = scrollable(); + scrollableElement.appendChild(monthContent()); + return scrollableElement; +}; +var monthView = function () { + var view = div('k-calendar-monthview'); + view.appendChild(monthHeader()); + view.appendChild(monthWeekHeader()); + view.appendChild(monthScrollable()); + return view; +}; +var listItem = function () { + var li = document.createElement('li'); + li.innerHTML = "FEB"; + return li; +}; +var list = function () { + var listElement = document.createElement('ul'); + listElement.appendChild(listItem()); + return listElement; +}; +var navigationScrollable = function () { + var scrollableElement = scrollable(); + scrollableElement.appendChild(list()); + return scrollableElement; +}; +var navigation = function () { + var nav = div('k-calendar-navigation'); + nav.appendChild(navigationScrollable()); + return nav; +}; +var calendar = function () { + if (!util_1.isDocumentAvailable()) { + return null; + } + var cal = div('k-widget k-calendar k-calendar-infinite'); + cal.style.left = '-10000px'; + cal.appendChild(navigation()); + cal.appendChild(monthView()); + return cal; +}; +var CALENDAR_ELEMENT = calendar(); +/** + * @hidden + */ +var DOMService = (function () { + function DOMService() { + } + DOMService.prototype.calendarHeight = function () { + return this.computedHeight(function (el) { return el; }); + }; + DOMService.prototype.monthScrollableContentHeight = function () { + return this.computedHeight(function (el) { return el.querySelector('.k-calendar-monthview').querySelector('.k-scrollable'); }); + }; + DOMService.prototype.monthViewHeight = function () { + return this.computedHeight(function (el) { return el.querySelector('tbody'); }); + }; + DOMService.prototype.monthHeaderHeight = function () { + return this.computedHeight(function (el) { return el.querySelector('tbody').children[0]; }); + }; + DOMService.prototype.navigationItemHeight = function () { + return this.computedHeight(function (el) { return el.querySelector('li'); }); + }; + DOMService.prototype.computedHeight = function (selector) { + if (!util_1.isDocumentAvailable()) { + return 0; + } + var rootElement = document.body.appendChild(CALENDAR_ELEMENT); + var element = selector(rootElement); + var height = parseFloat(window.getComputedStyle(element).height) || element.offsetHeight; + document.body.removeChild(rootElement); + return height; + }; + return DOMService; +}()); +DOMService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +DOMService.ctorParameters = function () { return []; }; +exports.DOMService = DOMService; + + +/***/ }), +/* 52 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +exports.MIN_DATE = new Date(1900, 0, 1); +/** + * @hidden + */ +exports.MAX_DATE = new Date(2099, 11, 31); + + +/***/ }), +/* 53 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +var PreventableEvent = (function () { + function PreventableEvent() { + this.prevented = false; + } + /** + * Prevents the default action for a specified event. + * In this way, the source component suppresses the built-in behavior that follows the event. + */ + PreventableEvent.prototype.preventDefault = function () { + this.prevented = true; + }; + /** + * If the event is prevented by any of its subscribers, returns `true`. + * + * @returns `true` if the default action was prevented. Otherwise, returns `false`. + */ + PreventableEvent.prototype.isDefaultPrevented = function () { + return this.prevented; + }; + return PreventableEvent; +}()); +exports.PreventableEvent = PreventableEvent; + + +/***/ }), +/* 54 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +var NavigationAction; +(function (NavigationAction) { + NavigationAction[NavigationAction["Undefined"] = 0] = "Undefined"; + NavigationAction[NavigationAction["Open"] = 1] = "Open"; + NavigationAction[NavigationAction["Close"] = 2] = "Close"; + NavigationAction[NavigationAction["Enter"] = 3] = "Enter"; + NavigationAction[NavigationAction["Tab"] = 4] = "Tab"; + NavigationAction[NavigationAction["Esc"] = 5] = "Esc"; + NavigationAction[NavigationAction["Delete"] = 6] = "Delete"; + NavigationAction[NavigationAction["Backspace"] = 7] = "Backspace"; + NavigationAction[NavigationAction["Home"] = 8] = "Home"; + NavigationAction[NavigationAction["End"] = 9] = "End"; + NavigationAction[NavigationAction["Up"] = 10] = "Up"; + NavigationAction[NavigationAction["Down"] = 11] = "Down"; + NavigationAction[NavigationAction["Left"] = 12] = "Left"; + NavigationAction[NavigationAction["Right"] = 13] = "Right"; +})(NavigationAction = exports.NavigationAction || (exports.NavigationAction = {})); + + +/***/ }), +/* 55 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var common_1 = __webpack_require__(9); +var forms_1 = __webpack_require__(12); +var list_component_1 = __webpack_require__(184); +var searchbar_component_1 = __webpack_require__(75); +var kendo_angular_popup_1 = __webpack_require__(28); +var kendo_angular_resize_sensor_1 = __webpack_require__(82); +var shared_directives_module_1 = __webpack_require__(38); +var list_item_directive_1 = __webpack_require__(183); +var selectable_directive_1 = __webpack_require__(187); +var template_context_directive_1 = __webpack_require__(190); +var INTERNAL_DIRECTIVES = [ + list_component_1.ListComponent, + list_item_directive_1.ListItemDirective, + selectable_directive_1.SelectableDirective, + searchbar_component_1.SearchBarComponent, + template_context_directive_1.TemplateContextDirective +]; +/** + * @hidden + */ +var SharedModule = (function () { + function SharedModule() { + } + return SharedModule; +}()); +SharedModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [INTERNAL_DIRECTIVES], + exports: [INTERNAL_DIRECTIVES, common_1.CommonModule, forms_1.FormsModule, kendo_angular_popup_1.PopupModule, kendo_angular_resize_sensor_1.ResizeSensorModule, shared_directives_module_1.SharedDirectivesModule], + imports: [common_1.CommonModule, forms_1.FormsModule, kendo_angular_popup_1.PopupModule, kendo_angular_resize_sensor_1.ResizeSensorModule, shared_directives_module_1.SharedDirectivesModule] + },] }, +]; +/** @nocollapse */ +SharedModule.ctorParameters = function () { return []; }; +exports.SharedModule = SharedModule; + + +/***/ }), +/* 56 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:max-line-length */ +var core_1 = __webpack_require__(0); +/** + * Used for rendering content when there is no data present. + * + * To define the no-data template, nest a `` tag with the `kendoNoDataTemplate` directive inside the component tag. + * + * Use: + * - The `kendoAutoCompleteNoDataTemplate` directive for the AutoComplete. + * - The `kendoComboBoxNoDataTemplate` directive for the ComboBox. + * - The `kendoDropDownListNoDataTemplate` directive for the DropDownList. + * - The `kendoMultiSelectNoDataTemplate` directive for the MultiSelect. + * + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + *

No data!

+ *
+ *
+ * ` + * }) + * class AppComponent { + * public listItems: Array = []; + * } + * ``` + * + * For more examples, refer to the article on [templates]({% slug overview_ddl_kendouiforangular %}#toc-templates). + */ +var NoDataTemplateDirective = (function () { + function NoDataTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return NoDataTemplateDirective; +}()); +NoDataTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoDropDownListNoDataTemplate],[kendoComboBoxNoDataTemplate],[kendoAutoCompleteNoDataTemplate],[kendoMultiSelectNoDataTemplate]' + },] }, +]; +/** @nocollapse */ +NoDataTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, }, +]; }; +exports.NoDataTemplateDirective = NoDataTemplateDirective; + + +/***/ }), +/* 57 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the column cell template of the Grid. + * It helps to customize the content of the cells. + * + * To define the cell template, nest a `` tag with the `kendoGridCellTemplate` directive inside + * a `` tag. + * + * The template context is set to the current data item and the following additional fields are passed: + * - `columnIndex`—The current column index. + * - `rowIndex`—The current row index. + * - `dataItem`—The current data item. + * - `column`—The current column instance. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * Row: {{rowIndex}} / + * {{dataItem.ProductName}} + * ({{dataItem.Discontinued ? "discontinued" : "active"}}) + * + * + * + * ` + * }) + * + * class AppComponent { + * public gridData = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": true + * } + * ]; + * } + * + * ``` + */ +var CellTemplateDirective = (function () { + function CellTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return CellTemplateDirective; +}()); +CellTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridCellTemplate]' + },] }, +]; +/** @nocollapse */ +CellTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.CellTemplateDirective = CellTemplateDirective; + + +/***/ }), +/* 58 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var column_base_1 = __webpack_require__(29); +var column_common_1 = __webpack_require__(22); +/** + * @hidden + */ +function isColumnGroupComponent(column) { + return column.isColumnGroup; +} +exports.isColumnGroupComponent = isColumnGroupComponent; +/** + * Represents the column-group header of the Grid. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * Column index: {{columnIndex}} / column title: {{column.title}} + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * ` + * }) + * + * class AppComponent { + * private gridData: any[]; + * + * constructor() { + * this.gridData = products; + * } + * } + * + * const products = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": true + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false + * } + * ]; + * + * ``` + */ +var ColumnGroupComponent = (function (_super) { + __extends(ColumnGroupComponent, _super); + function ColumnGroupComponent(parent) { + var _this = _super.call(this, parent) || this; + _this.parent = parent; + /** + * @hidden + */ + _this.isColumnGroup = true; + if (parent && parent.isSpanColumn) { + throw new Error('ColumnGroupComponent cannot be nested inside SpanColumnComponent'); + } + return _this; + } + /** + * @hidden + */ + ColumnGroupComponent.prototype.rowspan = function () { + return 1; + }; + Object.defineProperty(ColumnGroupComponent.prototype, "colspan", { + /** + * @hidden + */ + get: function () { + var _this = this; + if (!this.children || this.children.length === 1) { + return 1; + } + return column_common_1.columnsSpan(this.children + .filter(function (child) { return child !== _this && !child.hidden; })); + }, + enumerable: true, + configurable: true + }); + return ColumnGroupComponent; +}(column_base_1.ColumnBase)); +ColumnGroupComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: column_base_1.ColumnBase, + useExisting: core_1.forwardRef(function () { return ColumnGroupComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-grid-column-group', + template: "" + },] }, +]; +/** @nocollapse */ +ColumnGroupComponent.ctorParameters = function () { return [ + { type: column_base_1.ColumnBase, decorators: [{ type: core_1.SkipSelf }, { type: core_1.Host }, { type: core_1.Optional },] }, +]; }; +ColumnGroupComponent.propDecorators = { + 'children': [{ type: core_1.ContentChildren, args: [column_base_1.ColumnBase,] },], +}; +exports.ColumnGroupComponent = ColumnGroupComponent; + + +/***/ }), +/* 59 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +__webpack_require__(34); +__webpack_require__(47); +__webpack_require__(296); +var kendo_angular_l10n_1 = __webpack_require__(2); +var column_component_1 = __webpack_require__(30); +var column_group_component_1 = __webpack_require__(58); +var detail_template_directive_1 = __webpack_require__(108); +var utils_1 = __webpack_require__(7); +var browser_support_service_1 = __webpack_require__(356); +var data_collection_1 = __webpack_require__(359); +var selection_service_1 = __webpack_require__(245); +var edit_service_1 = __webpack_require__(25); +var details_service_1 = __webpack_require__(109); +var groups_service_1 = __webpack_require__(79); +var columns_container_1 = __webpack_require__(199); +var group_info_service_1 = __webpack_require__(121); +var group_connection_service_1 = __webpack_require__(118); +var list_component_1 = __webpack_require__(123); +var change_notification_service_1 = __webpack_require__(107); +var no_records_template_directive_1 = __webpack_require__(124); +var column_base_1 = __webpack_require__(29); +var row_sync_1 = __webpack_require__(242); +var cell_context_1 = __webpack_require__(42); +var kendo_angular_l10n_2 = __webpack_require__(2); +var filter_service_1 = __webpack_require__(26); +var pager_template_directive_1 = __webpack_require__(234); +var pager_context_service_1 = __webpack_require__(27); +var pdf_service_1 = __webpack_require__(126); +var pdf_export_event_1 = __webpack_require__(380); +var suspend_service_1 = __webpack_require__(128); +var responsive_service_1 = __webpack_require__(383); +var excel_service_1 = __webpack_require__(112); +var column_list_1 = __webpack_require__(198); +var toolbar_template_directive_1 = __webpack_require__(129); +var column_common_1 = __webpack_require__(22); +var scroll_sync_service_1 = __webpack_require__(243); +var createControl = function (source) { return function (acc, key) { + acc[key] = new forms_1.FormControl(source[key]); + return acc; +}; }; +/** + * Represents the Kendo UI Grid component for Angular. + * + * @example + * ```ts-preview + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * class AppComponent { + * private gridData: any[] = products; + * } + * + * const products = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": true + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false + * } + * ]; + * ``` + */ +var GridComponent = (function () { + function GridComponent(supportService, selectionService, wrapper, groupInfoService, groupsService, changeNotification, detailsService, editService, filterService, pdfService, responsiveService, renderer, excelService, ngZone, scrollSyncService, rtl) { + var _this = this; + this.wrapper = wrapper; + this.groupInfoService = groupInfoService; + this.groupsService = groupsService; + this.changeNotification = changeNotification; + this.detailsService = detailsService; + this.editService = editService; + this.filterService = filterService; + this.pdfService = pdfService; + this.responsiveService = responsiveService; + this.renderer = renderer; + this.excelService = excelService; + this.ngZone = ngZone; + this.scrollSyncService = scrollSyncService; + this.rtl = rtl; + /** + * Sets the data of the Grid. If an array is provided, the Grid automatically gets the total count. + */ + this.data = []; + /** + * Defines the number of records to be skipped by the pager. + * Required by the [paging]({% slug paging_grid_kendouiforangular %}) functionality. + */ + this.skip = 0; + /** + * Defines the scroll mode used by the Grid. + * + * The available options are: + * - `none`—Renders no scrollbar. + * - `scrollable`—This is the default scroll mode. It requires the setting of the `height` option. + * - `virtual`—Displays no pager and renders a portion of the data (optimized rendering) while the user is scrolling the content. + */ + this.scrollable = 'scrollable'; + /** + * Enables the single-row [selection]({% slug selection_grid_kendouiforangular %}) of the Grid. + */ + this.selectable = false; + /** + * Enables the [filtering]({% slug filtering_grid_kendouiforangular %}) of the Grid columns that have their `field` option set. + */ + this.filterable = false; + /** + * Enables the [sorting]({% slug sorting_grid_kendouiforangular %}) of the Grid columns that have their `field` option set. + */ + this.sortable = false; + /** + * Configures the pager of the Grid. + * + * The available options are: + * + * - `buttonCount: Number`—Sets the maximum numeric buttons count before the buttons are collapsed. + * - `info: Boolean`—Toggles the information about the current page and the total number of records. + * - `type: PagerType`—Accepts the `numeric` (buttons with numbers) and `input` (input for typing the page number) values. + * - `pageSizes: Boolean` or `Array`—Shows a menu for selecting the page size. + * - `previousNext: Boolean`—Toggles the **Previous** and **Next** buttons. + */ + this.pageable = false; + /** + * If set to `true`, the user can group the Grid by dragging the column header cells. + * By default, grouping is disabled. + */ + this.groupable = false; + /** + * Fires when the Grid filter is modified through the UI. + * You have to handle the event yourself and filter the data. + */ + this.filterChange = new core_1.EventEmitter(); + /** + * Fires when the page of the Grid is changed. + * You have to handle the event yourself and page the data. + */ + this.pageChange = new core_1.EventEmitter(); + /** + * Fires when the grouping of the Grid is changed. + * You have to handle the event yourself and group the data. + */ + this.groupChange = new core_1.EventEmitter(); + /** + * Fires when the sorting of the Grid is changed. + * You have to handle the event yourself and sort the data. + */ + this.sortChange = new core_1.EventEmitter(); + /** + * Fires when the user selects a Grid row. + * Emits the [`SelectionEvent`]({% slug api_grid_selectionevent_kendouiforangular %}#toc-selectionchange). + */ + this.selectionChange = new core_1.EventEmitter(); + /** + * Fires when the data state of the Grid is changed. + */ + this.dataStateChange = new core_1.EventEmitter(); + /** + * Fires when the user expands a group header. + */ + this.groupExpand = new core_1.EventEmitter(); + /** + * Fires when the user collapses a group header. + */ + this.groupCollapse = new core_1.EventEmitter(); + /** + * Fires when the user expands a master row. + */ + this.detailExpand = new core_1.EventEmitter(); + /** + * Fires when the user collapses a master row. + */ + this.detailCollapse = new core_1.EventEmitter(); + /** + * Fires when the user clicks the **Edit** command button to edit a row. + */ + this.edit = new core_1.EventEmitter(); + /** + * Fires when the user clicks the **Cancel** command button to close a row. + */ + this.cancel = new core_1.EventEmitter(); + /** + * Fires when the user clicks the **Save** command button to save changes in a row. + */ + this.save = new core_1.EventEmitter(); + /** + * Fires when the user clicks the **Remove** command button to remove a row. + */ + this.remove = new core_1.EventEmitter(); + /** + * Fires when the user clicks the **Add** command button to add a new row. + */ + this.add = new core_1.EventEmitter(); + /** + * Fires when the user clicks the **Export to PDF** command button. + */ + this.pdfExport = new core_1.EventEmitter(); + /** + * Fires when the user clicks the **Export to Excel** command button. + */ + this.excelExport = new core_1.EventEmitter(); + this.columns = new core_1.QueryList(); + this.columnsContainer = new columns_container_1.ColumnsContainer(function () { return _this.columnList.filter(function (column) { return !_this.isHidden(column) && _this.matchesMedia(column); }); }); + this.view = new data_collection_1.DataCollection(function () { return new data_collection_1.DataResultIterator(_this.data, _this.skip, _this.showGroupFooters); }); + this.shouldGenerateColumns = true; + this._sort = new Array(); + this._group = new Array(); + this.cachedWindowWidth = 0; + this._rowClass = function () { return null; }; + this.direction = rtl ? 'rtl' : 'ltr'; + this.scrollbarWidth = supportService.scrollbarWidth; + this.groupInfoService.registerColumnsContainer(function () { return _this.columnList; }); + if (selectionService) { + this.selectionSubscription = selectionService.changes.subscribe(function (event) { + _this.selectionChange.emit(event); + }); + } + this.groupExpandCollapseSubscription = groupsService.changes + .filter(function (_a) { + var dataItem = _a.dataItem; + return utils_1.isPresent(dataItem); + }) + .subscribe(function (_a) { + var expand = _a.expand, group = _a.dataItem; + return !expand ? + _this.groupExpand.emit({ group: group }) : + _this.groupCollapse.emit({ group: group }); + }); + this.detailsServiceSubscription = detailsService.changes + .filter(function (_a) { + var dataItem = _a.dataItem; + return utils_1.isPresent(dataItem); + }) + .subscribe(function (_a) { + var expand = _a.expand, dataItem = _a.dataItem, index = _a.index; + return expand ? + _this.detailExpand.emit({ dataItem: dataItem, index: index }) : + _this.detailCollapse.emit({ dataItem: dataItem, index: index }); + }); + this.filterSubscription = this.filterService.changes.subscribe(function (x) { + _this.filterChange.emit(x); + }); + this.attachStateChangesEmitter(); + this.attachEditHandlers(); + this.pdfSubscription = this.pdfService.exportClick.subscribe(this.emitPDFExportEvent.bind(this)); + this.excelSubscription = this.excelService.exportClick.subscribe(this.saveAsExcel.bind(this)); + this.columnsContainerChangeSubscription = this.columnsContainer.changes + .filter(function () { return _this.totalColumnLevels > 0 && _this.lockedColumns.length > 0; }) + .subscribe(this.columnsContainerChange.bind(this)); + this.columnList = new column_list_1.ColumnList(this.columns); + } + Object.defineProperty(GridComponent.prototype, "sort", { + /** + */ + get: function () { + return this._sort; + }, + /** + * The descriptors by which the data will be sorted. + */ + set: function (value) { + if (utils_1.isArray(value)) { + this._sort = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "group", { + /** + */ + get: function () { + return this._group; + }, + /** + * The descriptors by which the data will to be grouped. + */ + set: function (value) { + if (utils_1.isArray(value)) { + this._group = value; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "showTopToolbar", { + /** + * @hidden + */ + get: function () { + return this.toolbarTemplate && ['top', 'both'].indexOf(this.toolbarTemplate.position) > -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "showBottomToolbar", { + /** + * @hidden + */ + get: function () { + return this.toolbarTemplate && ['bottom', 'both'].indexOf(this.toolbarTemplate.position) > -1; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "isLocked", { + /** + * @hidden + */ + get: function () { + return this.lockedLeafColumns.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "showPager", { + /** + * @hidden + */ + get: function () { + return !this.isVirtual && this.pageable !== false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "showGroupPanel", { + /** + * @hidden + */ + get: function () { + return this.groupable && this.groupable.enabled !== false; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "rowClass", { + get: function () { + return this._rowClass; + }, + /** + * Defines a function that is executed for every data row in the component. + * + * @example + * ```ts + * import { Component, ViewEncapsulation } from '@angular/core'; + * import { RowClassArgs } from '@progress/kendo-angular-grid'; + * + * @@Component({ + * selector: 'my-app', + * encapsulation: ViewEncapsulation.None, + * styles: [` + * .k-grid tr.even { background-color: #f45c42; } + * .k-grid tr.odd { background-color: #41f4df; } + * `], + * template: ` + * + * + * ` + * }) + * class AppComponent { + * private gridData: any[] = products; + * + * rowCallback(context: RowClassArgs) { + * const isEven = context.index % 2 == 0; + * return { + * even: isEven, + * odd: !isEven + * }; + * } + * } + * + * const products = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": true + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false + * } + * ]; + * ``` + */ + set: function (fn) { + if (typeof fn !== 'function') { + throw new Error("rowClass must be a function, but received " + JSON.stringify(fn) + "."); + } + this._rowClass = fn; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "dir", { + get: function () { + return this.direction; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "hostClasses", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "lockedClasses", { + get: function () { + return this.lockedLeafColumns.length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "virtualClasses", { + get: function () { + return this.isVirtual; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "headerPadding", { + get: function () { + var padding = this.scrollbarWidth + 'px'; + var right = this.rtl ? 0 : padding; + var left = this.rtl ? padding : 0; + return "0 " + right + " 0 " + left; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "showGroupFooters", { + get: function () { + return column_common_1.columnsToRender(this.columnList.toArray()).filter(function (column) { return column.groupFooterTemplateRef; }).length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "showFooter", { + get: function () { + return this.columnList.filter(function (column) { return column.footerTemplateRef; }).length > 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "isVirtual", { + get: function () { + return this.scrollable === 'virtual'; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "isScrollable", { + get: function () { + return this.scrollable !== 'none'; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "visibleColumns", { + get: function () { + return this.columnsContainer.allColumns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "lockedColumns", { + get: function () { + return this.columnsContainer.lockedColumns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "nonLockedColumns", { + get: function () { + return this.columnsContainer.nonLockedColumns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "lockedLeafColumns", { + get: function () { + return this.columnsContainer.lockedLeafColumns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "nonLockedLeafColumns", { + get: function () { + return this.columnsContainer.nonLockedLeafColumns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "leafColumns", { + get: function () { + return this.columnsContainer.leafColumns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "totalColumnLevels", { + get: function () { + return this.columnsContainer.totalLevels; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "lockedWidth", { + get: function () { + var groupCellsWidth = this.group.length * 30; // this should be the value of group-cell inside the theme! + return column_common_1.expandColumns(this.lockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, groupCellsWidth); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(GridComponent.prototype, "nonLockedWidth", { + get: function () { + if (this.lockedLeafColumns.length) { + return column_common_1.expandColumns(this.nonLockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, 0); + } + return undefined; + }, + enumerable: true, + configurable: true + }); + /** + * Expands the specified master row. + * + * @param {number} index - The absolute index of the master row. + */ + GridComponent.prototype.expandRow = function (index) { + if (!this.detailsService.isExpanded(index)) { + this.detailsService.toggleRow(index, null); + } + }; + /** + * Collapses the specified master row. + * + * @param {number} index - The absolute index of the master row. + */ + GridComponent.prototype.collapseRow = function (index) { + if (this.detailsService.isExpanded(index)) { + this.detailsService.toggleRow(index, null); + } + }; + /** + * Expands a group header item for the given index. + * For example, `0_1` expands the second inner group of the first master group. + * + * @param {string} index - The underscore separated hierarchical index of the group. + */ + GridComponent.prototype.expandGroup = function (index) { + if (!this.groupsService.isExpanded(index)) { + this.groupsService.toggleRow(index, null); + } + }; + /** + * Collapses a group header item for the given index. + * For example, `0_1` collapses the second inner group of the first master group. + * + * @param {string} index - The underscore separated hierarchical index of the group. + */ + GridComponent.prototype.collapseGroup = function (index) { + if (this.groupsService.isExpanded(index)) { + this.groupsService.toggleRow(index, null); + } + }; + /** + * @hidden + */ + GridComponent.prototype.onDataChange = function () { + this.autoGenerateColumns(); + this.changeNotification.notify(); + this.pdfService.dataChanged.emit(); + }; + GridComponent.prototype.ngOnChanges = function (changes) { + if (utils_1.isChanged("data", changes)) { + this.onDataChange(); + } + if (this.lockedLeafColumns.length && utils_1.anyChanged(["pageSize", "skip", "sort", "group"], changes)) { + this.changeNotification.notify(); + } + if (utils_1.isChanged("height", changes, false)) { + this.renderer.setStyle(this.wrapper.nativeElement, 'height', this.height + "px"); + } + }; + GridComponent.prototype.ngAfterViewInit = function () { + var resizeCheck = this.resizeCheck.bind(this); + this.resizeSubscription = this.renderer.listen('window', 'resize', resizeCheck); + this.orientationSubscription = this.renderer.listen('window', 'orientationchange', resizeCheck); + this.attachScrollSync(); + }; + GridComponent.prototype.ngAfterContentChecked = function () { + this.columnsContainer.refresh(); + this.verifySettings(); + }; + GridComponent.prototype.ngAfterContentInit = function () { + var _this = this; + this.shouldGenerateColumns = !this.columns.length; + this.autoGenerateColumns(); + this.columnList = new column_list_1.ColumnList(this.columns); + this.columnsChangeSubscription = this.columns.changes.subscribe(function () { return _this.verifySettings(); }); + }; + GridComponent.prototype.ngOnDestroy = function () { + if (this.selectionSubscription) { + this.selectionSubscription.unsubscribe(); + } + if (this.stateChangeSubscription) { + this.stateChangeSubscription.unsubscribe(); + } + if (this.groupExpandCollapseSubscription) { + this.groupExpandCollapseSubscription.unsubscribe(); + } + if (this.detailsServiceSubscription) { + this.detailsServiceSubscription.unsubscribe(); + } + if (this.editServiceSubscription) { + this.editServiceSubscription.unsubscribe(); + } + if (this.pdfSubscription) { + this.pdfSubscription.unsubscribe(); + } + if (this.filterSubscription) { + this.filterSubscription.unsubscribe(); + } + if (this.columnsChangeSubscription) { + this.columnsChangeSubscription.unsubscribe(); + } + if (this.resizeSubscription) { + this.resizeSubscription(); + } + if (this.orientationSubscription) { + this.orientationSubscription(); + } + if (this.excelSubscription) { + this.excelSubscription.unsubscribe(); + } + if (this.columnsContainerChangeSubscription) { + this.columnsContainerChangeSubscription.unsubscribe(); + } + if (this.scrollSyncService) { + this.scrollSyncService.destroy(); + } + }; + /** + * @hidden + */ + GridComponent.prototype.attachScrollSync = function () { + if (utils_1.isUniversal()) { + return; + } + if (this.header) { + this.scrollSyncService.registerEmitter(this.header.nativeElement, "header"); + } + if (this.footer) { + this.scrollSyncService.registerEmitter(this.footer.nativeElement, "footer"); + } + }; + /** + * Switches the specified table row in the edit mode. + * + * @param {number} index - The row index that will be switched in the edit mode. + * @param {FormGroup} group - The [`FormGroup`](https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html) + * that describes the edit form. + */ + GridComponent.prototype.editRow = function (index, group) { + this.editService.editRow(index, group); + }; + /** + * Closes the editor for a given row. + * + * @param {number} index - The row index that will be switched out of the edit mode. If no index is provided, it is assumed + * that the new item editor will be closed. + */ + GridComponent.prototype.closeRow = function (index) { + this.editService.close(index); + }; + /** + * Creates a new row editor. + * + * @param {FormGroup} group - The [`FormGroup`](https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html) that describes + * the edit form. If called with a data item, it will build the `FormGroup` from the data item fields. + */ + GridComponent.prototype.addRow = function (group) { + var isFormGroup = group instanceof forms_1.FormGroup; + if (!isFormGroup) { + var fields = Object.keys(group).reduce(createControl(group), {}); + group = new forms_1.FormGroup(fields); + } + this.editService.addRow(group); + }; + /** + * Initiates the PDF export. + */ + GridComponent.prototype.saveAsPDF = function () { + this.pdfService.save(this); + }; + /** + * Initiates the Excel export. + */ + GridComponent.prototype.saveAsExcel = function () { + this.excelService.save(this); + }; + /** + * @hidden + */ + GridComponent.prototype.notifyPageChange = function (source, event) { + if (source === "list" && !this.isVirtual) { + return; + } + this.pageChange.emit(event); + }; + GridComponent.prototype.verifySettings = function () { + if (core_1.isDevMode()) { + if (this.lockedLeafColumns.length && this.detailTemplate) { + throw new Error('Having both detail template and locked columns is not supported'); + } + if (this.lockedLeafColumns.length && !this.nonLockedLeafColumns.length) { + throw new Error('There should be at least one non locked column'); + } + if (this.lockedLeafColumns.length && column_common_1.expandColumns(this.columnList.toArray()).filter(function (x) { return !x.width; }).length) { + throw new Error('Locked columns feature requires all columns to have width set'); + } + if (this.lockedLeafColumns.length && !this.isScrollable) { + throw new Error('Locked columns are only supported when scrolling is enabled'); + } + if (this.columnList.filter(column_group_component_1.isColumnGroupComponent).filter(function (x) { return x.children.length < 2; }).length) { + throw new Error('ColumnGroupComponent should contain ColumnComponent or CommandColumnComponent'); + } + if (this.columnList.filter(function (x) { return x.locked && x.parent && !x.parent.isLocked; }).length) { + throw new Error('Locked child columns require their parent columns to be locked.'); + } + if ((this.rowHeight || this.detailRowHeight) && !this.isVirtual) { + throw new Error('Row height and detail row height settings requires virtual scrolling mode to be enabled.'); + } + } + }; + GridComponent.prototype.autoGenerateColumns = function () { + if (this.shouldGenerateColumns && !this.columns.length && this.view.length) { + this.columns.reset(Object.keys(this.view.at(0)).map(function (field) { + var column = new column_component_1.ColumnComponent(); + column.field = field; + return column; + })); + } + }; + GridComponent.prototype.attachStateChangesEmitter = function () { + var _this = this; + this.stateChangeSubscription = + this.pageChange.map(function (x) { return ({ + filter: _this.filter, group: _this.group, skip: x.skip, sort: _this.sort, take: x.take + }); }) + .merge(this.sortChange.map(function (sort) { return ({ + filter: _this.filter, group: _this.group, skip: _this.skip, sort: sort, take: _this.pageSize + }); })) + .merge(this.groupChange.map(function (group) { return ({ + filter: _this.filter, group: group, skip: _this.skip, sort: _this.sort, take: _this.pageSize + }); })) + .merge(this.filterChange.map(function (filter) { return ({ + filter: filter, group: _this.group, skip: 0, sort: _this.sort, take: _this.pageSize + }); })) + .subscribe(function (x) { return _this.dataStateChange.emit(x); }); + }; + GridComponent.prototype.attachEditHandlers = function () { + if (!this.editService) { + return; + } + this.editServiceSubscription = this.editService + .changes.subscribe(this.emitCRUDEvent.bind(this)); + }; + GridComponent.prototype.emitCRUDEvent = function (_a) { + var action = _a.action, rowIndex = _a.rowIndex, formGroup = _a.formGroup, isNew = _a.isNew; + var dataItem = this.view.at(rowIndex - this.skip); + if (action !== 'add' && !dataItem) { + dataItem = formGroup.value; + } + var args = { + dataItem: dataItem, + formGroup: formGroup, + isNew: isNew, + rowIndex: rowIndex, + sender: this + }; + switch (action) { + case 'add': + this.add.emit(args); + break; + case 'cancel': + this.cancel.emit(args); + break; + case 'edit': + this.edit.emit(args); + break; + case 'remove': + this.remove.emit(args); + break; + case 'save': + this.save.emit(args); + break; + default: break; + } + }; + GridComponent.prototype.isHidden = function (c) { + return c.hidden || (c.parent && this.isHidden(c.parent)); + }; + GridComponent.prototype.matchesMedia = function (c) { + var matches = this.responsiveService.matchesMedia(c.media); + return matches && (!c.parent || this.matchesMedia(c.parent)); + }; + GridComponent.prototype.resizeCheck = function () { + if (window.innerWidth !== this.cachedWindowWidth) { + this.cachedWindowWidth = window.innerWidth; + this.columnsContainer.refresh(); + this.verifySettings(); + } + }; + GridComponent.prototype.emitPDFExportEvent = function () { + var args = new pdf_export_event_1.PDFExportEvent(); + this.pdfExport.emit(args); + if (!args.isDefaultPrevented()) { + this.saveAsPDF(); + } + }; + GridComponent.prototype.columnsContainerChange = function () { + var _this = this; + this.ngZone.onStable.take(1).subscribe(function () { + if (_this.lockedHeader) { + row_sync_1.syncRowsHeight(_this.lockedHeader.nativeElement.children[0], _this.header.nativeElement.children[0]); + } + }); + }; + return GridComponent; +}()); +GridComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoGrid', + providers: [ + kendo_angular_l10n_2.LocalizationService, + browser_support_service_1.BrowserSupportService, + selection_service_1.SelectionService, + details_service_1.DetailsService, + groups_service_1.GroupsService, + group_info_service_1.GroupInfoService, + group_connection_service_1.GroupConnectionService, + change_notification_service_1.ChangeNotificationService, + edit_service_1.EditService, + pdf_service_1.PDFService, + suspend_service_1.SuspendService, + { + provide: cell_context_1.CELL_CONTEXT, + useValue: cell_context_1.EMPTY_CELL_CONTEXT + }, + { + provide: kendo_angular_l10n_2.L10N_PREFIX, + useValue: 'kendo.grid' + }, + filter_service_1.FilterService, + responsive_service_1.ResponsiveService, + pager_context_service_1.PagerContextService, + excel_service_1.ExcelService, + scroll_sync_service_1.ScrollSyncService + ], + selector: 'kendo-grid', + template: "\n \n \n \n \n \n \n \n
\n \n \n \n \n \n
\n
\n \n \n \n \n \n
\n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n
\n \n \n \n " + },] }, +]; +/** @nocollapse */ +GridComponent.ctorParameters = function () { return [ + { type: browser_support_service_1.BrowserSupportService, }, + { type: selection_service_1.SelectionService, }, + { type: core_1.ElementRef, }, + { type: group_info_service_1.GroupInfoService, }, + { type: groups_service_1.GroupsService, }, + { type: change_notification_service_1.ChangeNotificationService, }, + { type: details_service_1.DetailsService, }, + { type: edit_service_1.EditService, }, + { type: filter_service_1.FilterService, }, + { type: pdf_service_1.PDFService, }, + { type: responsive_service_1.ResponsiveService, }, + { type: core_1.Renderer2, }, + { type: excel_service_1.ExcelService, }, + { type: core_1.NgZone, }, + { type: scroll_sync_service_1.ScrollSyncService, }, + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, +]; }; +GridComponent.propDecorators = { + 'data': [{ type: core_1.Input },], + 'pageSize': [{ type: core_1.Input },], + 'height': [{ type: core_1.Input },], + 'rowHeight': [{ type: core_1.Input },], + 'detailRowHeight': [{ type: core_1.Input },], + 'skip': [{ type: core_1.Input },], + 'scrollable': [{ type: core_1.Input },], + 'selectable': [{ type: core_1.Input },], + 'sort': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], + 'group': [{ type: core_1.Input },], + 'filterable': [{ type: core_1.Input },], + 'sortable': [{ type: core_1.Input },], + 'pageable': [{ type: core_1.Input },], + 'groupable': [{ type: core_1.Input },], + 'rowClass': [{ type: core_1.Input },], + 'filterChange': [{ type: core_1.Output },], + 'pageChange': [{ type: core_1.Output },], + 'groupChange': [{ type: core_1.Output },], + 'sortChange': [{ type: core_1.Output },], + 'selectionChange': [{ type: core_1.Output },], + 'dataStateChange': [{ type: core_1.Output },], + 'groupExpand': [{ type: core_1.Output },], + 'groupCollapse': [{ type: core_1.Output },], + 'detailExpand': [{ type: core_1.Output },], + 'detailCollapse': [{ type: core_1.Output },], + 'edit': [{ type: core_1.Output },], + 'cancel': [{ type: core_1.Output },], + 'save': [{ type: core_1.Output },], + 'remove': [{ type: core_1.Output },], + 'add': [{ type: core_1.Output },], + 'pdfExport': [{ type: core_1.Output },], + 'excelExport': [{ type: core_1.Output },], + 'columns': [{ type: core_1.ContentChildren, args: [column_base_1.ColumnBase,] },], + 'dir': [{ type: core_1.HostBinding, args: ['attr.dir',] },], + 'hostClasses': [{ type: core_1.HostBinding, args: ['class.k-widget',] }, { type: core_1.HostBinding, args: ['class.k-grid',] },], + 'lockedClasses': [{ type: core_1.HostBinding, args: ['class.k-grid-lockedcolumns',] },], + 'virtualClasses': [{ type: core_1.HostBinding, args: ['class.k-grid-virtual',] },], + 'detailTemplate': [{ type: core_1.ContentChild, args: [detail_template_directive_1.DetailTemplateDirective,] },], + 'noRecordsTemplate': [{ type: core_1.ContentChild, args: [no_records_template_directive_1.NoRecordsTemplateDirective,] },], + 'pagerTemplate': [{ type: core_1.ContentChild, args: [pager_template_directive_1.PagerTemplateDirective,] },], + 'toolbarTemplate': [{ type: core_1.ContentChild, args: [toolbar_template_directive_1.ToolbarTemplateDirective,] },], + 'lockedHeader': [{ type: core_1.ViewChild, args: ["lockedHeader",] },], + 'header': [{ type: core_1.ViewChild, args: ["header",] },], + 'footer': [{ type: core_1.ViewChild, args: ["footer",] },], + 'list': [{ type: core_1.ViewChild, args: [list_component_1.ListComponent,] },], +}; +exports.GridComponent = GridComponent; + + +/***/ }), +/* 60 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_popup_common_1 = __webpack_require__(421); +var util_1 = __webpack_require__(44); +/** + * @hidden + */ +var DOMService = (function () { + function DOMService() { + } + DOMService.prototype.addOffset = function (current, addition) { + return { + left: current.left + addition.left, + top: current.top + addition.top + }; + }; + DOMService.prototype.align = function (settings) { + return kendo_popup_common_1.align(settings); + }; + DOMService.prototype.boundingOffset = function (el) { + return kendo_popup_common_1.boundingOffset(this.nativeElement(el)); + }; + DOMService.prototype.getWindow = function () { + return util_1.isWindowAvailable() ? window : null; + }; + DOMService.prototype.isBodyOffset = function (el) { + return kendo_popup_common_1.isBodyOffset(this.nativeElement(el)); + }; + DOMService.prototype.offset = function (el) { + if (!el) { + return null; + } + return kendo_popup_common_1.offset(this.nativeElement(el)); + }; + DOMService.prototype.staticOffset = function (el) { + if (!el) { + return null; + } + var element = this.nativeElement(el); + var _a = element.style, left = _a.left, top = _a.top; + element.style.left = '0px'; + element.style.top = '0px'; + var currentOffset = kendo_popup_common_1.offset(element); + element.style.left = left; + element.style.top = top; + return currentOffset; + }; + DOMService.prototype.nativeElement = function (el) { + if (!el) { + return null; + } + return el.nativeElement || el; + }; + DOMService.prototype.position = function (el) { + if (!el) { + return null; + } + return kendo_popup_common_1.position(this.nativeElement(el)); + }; + DOMService.prototype.relativeOffset = function (el, currentLocation) { + return kendo_popup_common_1.applyLocationOffset(this.offset(el), currentLocation, this.isBodyOffset(el)); + }; + DOMService.prototype.removeScroll = function (rect, scroll) { + return kendo_popup_common_1.removeScroll(rect, scroll); + }; + DOMService.prototype.restrictToView = function (settings) { + return kendo_popup_common_1.restrictToView(settings); + }; + DOMService.prototype.scrollPosition = function (el) { + return kendo_popup_common_1.scrollPosition(this.nativeElement(el)); + }; + DOMService.prototype.scrollableParents = function (el) { + return util_1.scrollableParents(this.nativeElement(el)); + }; + DOMService.prototype.stackingElementOffset = function (el) { + var relativeContextElement = this.getRelativeContextElement(el); + return relativeContextElement ? kendo_popup_common_1.offset(relativeContextElement) : null; + }; + DOMService.prototype.getRelativeContextElement = function (el) { + if (!el || !util_1.HAS_RELATIVE_STACKING_CONTEXT) { + return null; + } + var parent = this.nativeElement(el).parentElement; + while (parent) { + if (window.getComputedStyle(parent).transform !== 'none') { + return parent; + } + parent = parent.parentElement; + } + return null; + }; + DOMService.prototype.useRelativePosition = function (el) { + return !!this.getRelativeContextElement(el); + }; + DOMService.prototype.windowViewPort = function (el) { + return kendo_popup_common_1.getWindowViewPort(this.nativeElement(el)); + }; + DOMService.prototype.zIndex = function (anchor, container) { + return util_1.zIndex(this.nativeElement(anchor), this.nativeElement(container)); + }; + return DOMService; +}()); +DOMService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +DOMService.ctorParameters = function () { return []; }; +exports.DOMService = DOMService; + + +/***/ }), +/* 61 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var utils_1 = __webpack_require__(17); +/** + * @hidden + * Type guard for `CompositeFilterDescriptor`. + */ +exports.isCompositeFilterDescriptor = function (source) { + return utils_1.isPresent(source.filters); +}; + + +/***/ }), +/* 62 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var clone_date_1 = __webpack_require__(46); +/** + * @hidden + */ +exports.adjustDST = function (date, hour) { + var newDate = clone_date_1.cloneDate(date); + if (hour === 0 && newDate.getHours() === 23) { + newDate.setHours(newDate.getHours() + 2); + } + return newDate; +}; + + +/***/ }), +/* 63 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var adjust_dst_1 = __webpack_require__(62); +/** + * A function returning a new Date instance + * + * @param year - The year value. + * @param month - The month value. + * @param day - The day value. + * @param hours - The hours value. + * @param minutes - The minutes value. + * @param seconds - The seconds value. + * @param milliseconds - milliseconds value. + * @returns The date instance. + * + * @example + * ```ts-no-run + * createDate(2016, 0, 15); // 2016-01-15 00:00:00 + * createDate(2016, 0, 15, 22, 22, 20); // 2016-01-15 22:22:20 + * ``` + */ +exports.createDate = function (year, month, day, hours, minutes, seconds, milliseconds) { + if (hours === void 0) { hours = 0; } + if (minutes === void 0) { minutes = 0; } + if (seconds === void 0) { seconds = 0; } + if (milliseconds === void 0) { milliseconds = 0; } + var date = new Date(year, month, day, hours, minutes, seconds, milliseconds); + if (year > -1 && year < 100) { + date.setFullYear(date.getFullYear() - 1900); + } + return adjust_dst_1.adjustDST(date, hours); +}; + + +/***/ }), +/* 64 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +exports.REPLACEMENT_CHARACTER = '\uFFFD'; + +exports.CODE_POINTS = { + EOF: -1, + NULL: 0x00, + TABULATION: 0x09, + CARRIAGE_RETURN: 0x0D, + LINE_FEED: 0x0A, + FORM_FEED: 0x0C, + SPACE: 0x20, + EXCLAMATION_MARK: 0x21, + QUOTATION_MARK: 0x22, + NUMBER_SIGN: 0x23, + AMPERSAND: 0x26, + APOSTROPHE: 0x27, + HYPHEN_MINUS: 0x2D, + SOLIDUS: 0x2F, + DIGIT_0: 0x30, + DIGIT_9: 0x39, + SEMICOLON: 0x3B, + LESS_THAN_SIGN: 0x3C, + EQUALS_SIGN: 0x3D, + GREATER_THAN_SIGN: 0x3E, + QUESTION_MARK: 0x3F, + LATIN_CAPITAL_A: 0x41, + LATIN_CAPITAL_F: 0x46, + LATIN_CAPITAL_X: 0x58, + LATIN_CAPITAL_Z: 0x5A, + GRAVE_ACCENT: 0x60, + LATIN_SMALL_A: 0x61, + LATIN_SMALL_F: 0x66, + LATIN_SMALL_X: 0x78, + LATIN_SMALL_Z: 0x7A, + REPLACEMENT_CHARACTER: 0xFFFD +}; + +exports.CODE_POINT_SEQUENCES = { + DASH_DASH_STRING: [0x2D, 0x2D], //-- + DOCTYPE_STRING: [0x44, 0x4F, 0x43, 0x54, 0x59, 0x50, 0x45], //DOCTYPE + CDATA_START_STRING: [0x5B, 0x43, 0x44, 0x41, 0x54, 0x41, 0x5B], //[CDATA[ + CDATA_END_STRING: [0x5D, 0x5D, 0x3E], //]]> + SCRIPT_STRING: [0x73, 0x63, 0x72, 0x69, 0x70, 0x74], //script + PUBLIC_STRING: [0x50, 0x55, 0x42, 0x4C, 0x49, 0x43], //PUBLIC + SYSTEM_STRING: [0x53, 0x59, 0x53, 0x54, 0x45, 0x4D] //SYSTEM +}; + + +/***/ }), +/* 65 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Preprocessor = __webpack_require__(448), + locationInfoMixin = __webpack_require__(440), + UNICODE = __webpack_require__(64), + neTree = __webpack_require__(447); + +//Aliases +var $ = UNICODE.CODE_POINTS, + $$ = UNICODE.CODE_POINT_SEQUENCES; + +//Replacement code points for numeric entities +var NUMERIC_ENTITY_REPLACEMENTS = { + 0x00: 0xFFFD, 0x0D: 0x000D, 0x80: 0x20AC, 0x81: 0x0081, 0x82: 0x201A, 0x83: 0x0192, 0x84: 0x201E, + 0x85: 0x2026, 0x86: 0x2020, 0x87: 0x2021, 0x88: 0x02C6, 0x89: 0x2030, 0x8A: 0x0160, 0x8B: 0x2039, + 0x8C: 0x0152, 0x8D: 0x008D, 0x8E: 0x017D, 0x8F: 0x008F, 0x90: 0x0090, 0x91: 0x2018, 0x92: 0x2019, + 0x93: 0x201C, 0x94: 0x201D, 0x95: 0x2022, 0x96: 0x2013, 0x97: 0x2014, 0x98: 0x02DC, 0x99: 0x2122, + 0x9A: 0x0161, 0x9B: 0x203A, 0x9C: 0x0153, 0x9D: 0x009D, 0x9E: 0x017E, 0x9F: 0x0178 +}; + +// Named entity tree flags +var HAS_DATA_FLAG = 1 << 0; +var DATA_DUPLET_FLAG = 1 << 1; +var HAS_BRANCHES_FLAG = 1 << 2; +var MAX_BRANCH_MARKER_VALUE = HAS_DATA_FLAG | DATA_DUPLET_FLAG | HAS_BRANCHES_FLAG; + + +//States +var DATA_STATE = 'DATA_STATE', + CHARACTER_REFERENCE_IN_DATA_STATE = 'CHARACTER_REFERENCE_IN_DATA_STATE', + RCDATA_STATE = 'RCDATA_STATE', + CHARACTER_REFERENCE_IN_RCDATA_STATE = 'CHARACTER_REFERENCE_IN_RCDATA_STATE', + RAWTEXT_STATE = 'RAWTEXT_STATE', + SCRIPT_DATA_STATE = 'SCRIPT_DATA_STATE', + PLAINTEXT_STATE = 'PLAINTEXT_STATE', + TAG_OPEN_STATE = 'TAG_OPEN_STATE', + END_TAG_OPEN_STATE = 'END_TAG_OPEN_STATE', + TAG_NAME_STATE = 'TAG_NAME_STATE', + RCDATA_LESS_THAN_SIGN_STATE = 'RCDATA_LESS_THAN_SIGN_STATE', + RCDATA_END_TAG_OPEN_STATE = 'RCDATA_END_TAG_OPEN_STATE', + RCDATA_END_TAG_NAME_STATE = 'RCDATA_END_TAG_NAME_STATE', + RAWTEXT_LESS_THAN_SIGN_STATE = 'RAWTEXT_LESS_THAN_SIGN_STATE', + RAWTEXT_END_TAG_OPEN_STATE = 'RAWTEXT_END_TAG_OPEN_STATE', + RAWTEXT_END_TAG_NAME_STATE = 'RAWTEXT_END_TAG_NAME_STATE', + SCRIPT_DATA_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_LESS_THAN_SIGN_STATE', + SCRIPT_DATA_END_TAG_OPEN_STATE = 'SCRIPT_DATA_END_TAG_OPEN_STATE', + SCRIPT_DATA_END_TAG_NAME_STATE = 'SCRIPT_DATA_END_TAG_NAME_STATE', + SCRIPT_DATA_ESCAPE_START_STATE = 'SCRIPT_DATA_ESCAPE_START_STATE', + SCRIPT_DATA_ESCAPE_START_DASH_STATE = 'SCRIPT_DATA_ESCAPE_START_DASH_STATE', + SCRIPT_DATA_ESCAPED_STATE = 'SCRIPT_DATA_ESCAPED_STATE', + SCRIPT_DATA_ESCAPED_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_STATE', + SCRIPT_DATA_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_ESCAPED_DASH_DASH_STATE', + SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE', + SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE', + SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE = 'SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE', + SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE', + SCRIPT_DATA_DOUBLE_ESCAPED_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_STATE', + SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE', + SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE', + SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE', + SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE = 'SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE', + BEFORE_ATTRIBUTE_NAME_STATE = 'BEFORE_ATTRIBUTE_NAME_STATE', + ATTRIBUTE_NAME_STATE = 'ATTRIBUTE_NAME_STATE', + AFTER_ATTRIBUTE_NAME_STATE = 'AFTER_ATTRIBUTE_NAME_STATE', + BEFORE_ATTRIBUTE_VALUE_STATE = 'BEFORE_ATTRIBUTE_VALUE_STATE', + ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE', + ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE = 'ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE', + ATTRIBUTE_VALUE_UNQUOTED_STATE = 'ATTRIBUTE_VALUE_UNQUOTED_STATE', + CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE = 'CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE', + AFTER_ATTRIBUTE_VALUE_QUOTED_STATE = 'AFTER_ATTRIBUTE_VALUE_QUOTED_STATE', + SELF_CLOSING_START_TAG_STATE = 'SELF_CLOSING_START_TAG_STATE', + BOGUS_COMMENT_STATE = 'BOGUS_COMMENT_STATE', + BOGUS_COMMENT_STATE_CONTINUATION = 'BOGUS_COMMENT_STATE_CONTINUATION', + MARKUP_DECLARATION_OPEN_STATE = 'MARKUP_DECLARATION_OPEN_STATE', + COMMENT_START_STATE = 'COMMENT_START_STATE', + COMMENT_START_DASH_STATE = 'COMMENT_START_DASH_STATE', + COMMENT_STATE = 'COMMENT_STATE', + COMMENT_END_DASH_STATE = 'COMMENT_END_DASH_STATE', + COMMENT_END_STATE = 'COMMENT_END_STATE', + COMMENT_END_BANG_STATE = 'COMMENT_END_BANG_STATE', + DOCTYPE_STATE = 'DOCTYPE_STATE', + DOCTYPE_NAME_STATE = 'DOCTYPE_NAME_STATE', + AFTER_DOCTYPE_NAME_STATE = 'AFTER_DOCTYPE_NAME_STATE', + BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE', + DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE', + DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE', + BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE = 'BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE', + BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE', + DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE', + DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE = 'DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE', + AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE = 'AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE', + BOGUS_DOCTYPE_STATE = 'BOGUS_DOCTYPE_STATE', + CDATA_SECTION_STATE = 'CDATA_SECTION_STATE'; + +//Utils + +//OPTIMIZATION: these utility functions should not be moved out of this module. V8 Crankshaft will not inline +//this functions if they will be situated in another module due to context switch. +//Always perform inlining check before modifying this functions ('node --trace-inlining'). +function isWhitespace(cp) { + return cp === $.SPACE || cp === $.LINE_FEED || cp === $.TABULATION || cp === $.FORM_FEED; +} + +function isAsciiDigit(cp) { + return cp >= $.DIGIT_0 && cp <= $.DIGIT_9; +} + +function isAsciiUpper(cp) { + return cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_Z; +} + +function isAsciiLower(cp) { + return cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_Z; +} + +function isAsciiLetter(cp) { + return isAsciiLower(cp) || isAsciiUpper(cp); +} + +function isAsciiAlphaNumeric(cp) { + return isAsciiLetter(cp) || isAsciiDigit(cp); +} + +function isDigit(cp, isHex) { + return isAsciiDigit(cp) || isHex && (cp >= $.LATIN_CAPITAL_A && cp <= $.LATIN_CAPITAL_F || + cp >= $.LATIN_SMALL_A && cp <= $.LATIN_SMALL_F); +} + +function isReservedCodePoint(cp) { + return cp >= 0xD800 && cp <= 0xDFFF || cp > 0x10FFFF; +} + +function toAsciiLowerCodePoint(cp) { + return cp + 0x0020; +} + +//NOTE: String.fromCharCode() function can handle only characters from BMP subset. +//So, we need to workaround this manually. +//(see: https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/fromCharCode#Getting_it_to_work_with_higher_values) +function toChar(cp) { + if (cp <= 0xFFFF) + return String.fromCharCode(cp); + + cp -= 0x10000; + return String.fromCharCode(cp >>> 10 & 0x3FF | 0xD800) + String.fromCharCode(0xDC00 | cp & 0x3FF); +} + +function toAsciiLowerChar(cp) { + return String.fromCharCode(toAsciiLowerCodePoint(cp)); +} + +function findNamedEntityTreeBranch(nodeIx, cp) { + var branchCount = neTree[++nodeIx], + lo = ++nodeIx, + hi = lo + branchCount - 1; + + while (lo <= hi) { + var mid = lo + hi >>> 1, + midCp = neTree[mid]; + + if (midCp < cp) + lo = mid + 1; + + else if (midCp > cp) + hi = mid - 1; + + else + return neTree[mid + branchCount]; + } + + return -1; +} + + +//Tokenizer +var Tokenizer = module.exports = function (options) { + this.preprocessor = new Preprocessor(); + + this.tokenQueue = []; + + this.allowCDATA = false; + + this.state = DATA_STATE; + this.returnState = ''; + + this.tempBuff = []; + this.additionalAllowedCp = void 0; + this.lastStartTagName = ''; + + this.consumedAfterSnapshot = -1; + this.active = false; + + this.currentCharacterToken = null; + this.currentToken = null; + this.currentAttr = null; + + if (options && options.locationInfo) + locationInfoMixin.assign(this); +}; + +//Token types +Tokenizer.CHARACTER_TOKEN = 'CHARACTER_TOKEN'; +Tokenizer.NULL_CHARACTER_TOKEN = 'NULL_CHARACTER_TOKEN'; +Tokenizer.WHITESPACE_CHARACTER_TOKEN = 'WHITESPACE_CHARACTER_TOKEN'; +Tokenizer.START_TAG_TOKEN = 'START_TAG_TOKEN'; +Tokenizer.END_TAG_TOKEN = 'END_TAG_TOKEN'; +Tokenizer.COMMENT_TOKEN = 'COMMENT_TOKEN'; +Tokenizer.DOCTYPE_TOKEN = 'DOCTYPE_TOKEN'; +Tokenizer.EOF_TOKEN = 'EOF_TOKEN'; +Tokenizer.HIBERNATION_TOKEN = 'HIBERNATION_TOKEN'; + +//Tokenizer initial states for different modes +Tokenizer.MODE = Tokenizer.prototype.MODE = { + DATA: DATA_STATE, + RCDATA: RCDATA_STATE, + RAWTEXT: RAWTEXT_STATE, + SCRIPT_DATA: SCRIPT_DATA_STATE, + PLAINTEXT: PLAINTEXT_STATE +}; + +//Static +Tokenizer.getTokenAttr = function (token, attrName) { + for (var i = token.attrs.length - 1; i >= 0; i--) { + if (token.attrs[i].name === attrName) + return token.attrs[i].value; + } + + return null; +}; + +//API +Tokenizer.prototype.getNextToken = function () { + while (!this.tokenQueue.length && this.active) { + this._hibernationSnapshot(); + + var cp = this._consume(); + + if (!this._ensureHibernation()) + this[this.state](cp); + } + + return this.tokenQueue.shift(); +}; + +Tokenizer.prototype.write = function (chunk, isLastChunk) { + this.active = true; + this.preprocessor.write(chunk, isLastChunk); +}; + +Tokenizer.prototype.insertHtmlAtCurrentPos = function (chunk) { + this.active = true; + this.preprocessor.insertHtmlAtCurrentPos(chunk); +}; + +//Hibernation +Tokenizer.prototype._hibernationSnapshot = function () { + this.consumedAfterSnapshot = 0; +}; + +Tokenizer.prototype._ensureHibernation = function () { + if (this.preprocessor.endOfChunkHit) { + for (; this.consumedAfterSnapshot > 0; this.consumedAfterSnapshot--) + this.preprocessor.retreat(); + + this.active = false; + this.tokenQueue.push({type: Tokenizer.HIBERNATION_TOKEN}); + + return true; + } + + return false; +}; + + +//Consumption +Tokenizer.prototype._consume = function () { + this.consumedAfterSnapshot++; + return this.preprocessor.advance(); +}; + +Tokenizer.prototype._unconsume = function () { + this.consumedAfterSnapshot--; + this.preprocessor.retreat(); +}; + +Tokenizer.prototype._unconsumeSeveral = function (count) { + while (count--) + this._unconsume(); +}; + +Tokenizer.prototype._reconsumeInState = function (state) { + this.state = state; + this._unconsume(); +}; + +Tokenizer.prototype._consumeSubsequentIfMatch = function (pattern, startCp, caseSensitive) { + var consumedCount = 0, + isMatch = true, + patternLength = pattern.length, + patternPos = 0, + cp = startCp, + patternCp = void 0; + + for (; patternPos < patternLength; patternPos++) { + if (patternPos > 0) { + cp = this._consume(); + consumedCount++; + } + + if (cp === $.EOF) { + isMatch = false; + break; + } + + patternCp = pattern[patternPos]; + + if (cp !== patternCp && (caseSensitive || cp !== toAsciiLowerCodePoint(patternCp))) { + isMatch = false; + break; + } + } + + if (!isMatch) + this._unconsumeSeveral(consumedCount); + + return isMatch; +}; + +//Lookahead +Tokenizer.prototype._lookahead = function () { + var cp = this._consume(); + + this._unconsume(); + + return cp; +}; + +//Temp buffer +Tokenizer.prototype.isTempBufferEqualToScriptString = function () { + if (this.tempBuff.length !== $$.SCRIPT_STRING.length) + return false; + + for (var i = 0; i < this.tempBuff.length; i++) { + if (this.tempBuff[i] !== $$.SCRIPT_STRING[i]) + return false; + } + + return true; +}; + +//Token creation +Tokenizer.prototype._createStartTagToken = function () { + this.currentToken = { + type: Tokenizer.START_TAG_TOKEN, + tagName: '', + selfClosing: false, + attrs: [] + }; +}; + +Tokenizer.prototype._createEndTagToken = function () { + this.currentToken = { + type: Tokenizer.END_TAG_TOKEN, + tagName: '', + attrs: [] + }; +}; + +Tokenizer.prototype._createCommentToken = function () { + this.currentToken = { + type: Tokenizer.COMMENT_TOKEN, + data: '' + }; +}; + +Tokenizer.prototype._createDoctypeToken = function (initialName) { + this.currentToken = { + type: Tokenizer.DOCTYPE_TOKEN, + name: initialName, + forceQuirks: false, + publicId: null, + systemId: null + }; +}; + +Tokenizer.prototype._createCharacterToken = function (type, ch) { + this.currentCharacterToken = { + type: type, + chars: ch + }; +}; + +//Tag attributes +Tokenizer.prototype._createAttr = function (attrNameFirstCh) { + this.currentAttr = { + name: attrNameFirstCh, + value: '' + }; +}; + +Tokenizer.prototype._isDuplicateAttr = function () { + return Tokenizer.getTokenAttr(this.currentToken, this.currentAttr.name) !== null; +}; + +Tokenizer.prototype._leaveAttrName = function (toState) { + this.state = toState; + + if (!this._isDuplicateAttr()) + this.currentToken.attrs.push(this.currentAttr); +}; + +Tokenizer.prototype._leaveAttrValue = function (toState) { + this.state = toState; +}; + +//Appropriate end tag token +//(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#appropriate-end-tag-token) +Tokenizer.prototype._isAppropriateEndTagToken = function () { + return this.lastStartTagName === this.currentToken.tagName; +}; + +//Token emission +Tokenizer.prototype._emitCurrentToken = function () { + this._emitCurrentCharacterToken(); + + //NOTE: store emited start tag's tagName to determine is the following end tag token is appropriate. + if (this.currentToken.type === Tokenizer.START_TAG_TOKEN) + this.lastStartTagName = this.currentToken.tagName; + + this.tokenQueue.push(this.currentToken); + this.currentToken = null; +}; + +Tokenizer.prototype._emitCurrentCharacterToken = function () { + if (this.currentCharacterToken) { + this.tokenQueue.push(this.currentCharacterToken); + this.currentCharacterToken = null; + } +}; + +Tokenizer.prototype._emitEOFToken = function () { + this._emitCurrentCharacterToken(); + this.tokenQueue.push({type: Tokenizer.EOF_TOKEN}); +}; + +//Characters emission + +//OPTIMIZATION: specification uses only one type of character tokens (one token per character). +//This causes a huge memory overhead and a lot of unnecessary parser loops. parse5 uses 3 groups of characters. +//If we have a sequence of characters that belong to the same group, parser can process it +//as a single solid character token. +//So, there are 3 types of character tokens in parse5: +//1)NULL_CHARACTER_TOKEN - \u0000-character sequences (e.g. '\u0000\u0000\u0000') +//2)WHITESPACE_CHARACTER_TOKEN - any whitespace/new-line character sequences (e.g. '\n \r\t \f') +//3)CHARACTER_TOKEN - any character sequence which don't belong to groups 1 and 2 (e.g. 'abcdef1234@@#$%^') +Tokenizer.prototype._appendCharToCurrentCharacterToken = function (type, ch) { + if (this.currentCharacterToken && this.currentCharacterToken.type !== type) + this._emitCurrentCharacterToken(); + + if (this.currentCharacterToken) + this.currentCharacterToken.chars += ch; + + else + this._createCharacterToken(type, ch); +}; + +Tokenizer.prototype._emitCodePoint = function (cp) { + var type = Tokenizer.CHARACTER_TOKEN; + + if (isWhitespace(cp)) + type = Tokenizer.WHITESPACE_CHARACTER_TOKEN; + + else if (cp === $.NULL) + type = Tokenizer.NULL_CHARACTER_TOKEN; + + this._appendCharToCurrentCharacterToken(type, toChar(cp)); +}; + +Tokenizer.prototype._emitSeveralCodePoints = function (codePoints) { + for (var i = 0; i < codePoints.length; i++) + this._emitCodePoint(codePoints[i]); +}; + +//NOTE: used then we emit character explicitly. This is always a non-whitespace and a non-null character. +//So we can avoid additional checks here. +Tokenizer.prototype._emitChar = function (ch) { + this._appendCharToCurrentCharacterToken(Tokenizer.CHARACTER_TOKEN, ch); +}; + +//Character reference tokenization +Tokenizer.prototype._consumeNumericEntity = function (isHex) { + var digits = '', + nextCp = void 0; + + do { + digits += toChar(this._consume()); + nextCp = this._lookahead(); + } while (nextCp !== $.EOF && isDigit(nextCp, isHex)); + + if (this._lookahead() === $.SEMICOLON) + this._consume(); + + var referencedCp = parseInt(digits, isHex ? 16 : 10), + replacement = NUMERIC_ENTITY_REPLACEMENTS[referencedCp]; + + if (replacement) + return replacement; + + if (isReservedCodePoint(referencedCp)) + return $.REPLACEMENT_CHARACTER; + + return referencedCp; +}; + +// NOTE: for the details on this algorithm see +// https://github.com/inikulin/parse5/tree/master/scripts/generate_named_entity_data/README.md +Tokenizer.prototype._consumeNamedEntity = function (inAttr) { + var referencedCodePoints = null, + referenceSize = 0, + cp = null, + consumedCount = 0, + semicolonTerminated = false; + + for (var i = 0; i > -1;) { + var current = neTree[i], + inNode = current < MAX_BRANCH_MARKER_VALUE, + nodeWithData = inNode && current & HAS_DATA_FLAG; + + if (nodeWithData) { + referencedCodePoints = current & DATA_DUPLET_FLAG ? [neTree[++i], neTree[++i]] : [neTree[++i]]; + referenceSize = consumedCount; + + if (cp === $.SEMICOLON) { + semicolonTerminated = true; + break; + } + } + + cp = this._consume(); + consumedCount++; + + if (cp === $.EOF) + break; + + if (inNode) + i = current & HAS_BRANCHES_FLAG ? findNamedEntityTreeBranch(i, cp) : -1; + + else + i = cp === current ? ++i : -1; + } + + + if (referencedCodePoints) { + if (!semicolonTerminated) { + //NOTE: unconsume excess (e.g. 'it' in '¬it') + this._unconsumeSeveral(consumedCount - referenceSize); + + //NOTE: If the character reference is being consumed as part of an attribute and the next character + //is either a U+003D EQUALS SIGN character (=) or an alphanumeric ASCII character, then, for historical + //reasons, all the characters that were matched after the U+0026 AMPERSAND character (&) must be + //unconsumed, and nothing is returned. + //However, if this next character is in fact a U+003D EQUALS SIGN character (=), then this is a + //parse error, because some legacy user agents will misinterpret the markup in those cases. + //(see: http://www.whatwg.org/specs/web-apps/current-work/multipage/tokenization.html#tokenizing-character-references) + if (inAttr) { + var nextCp = this._lookahead(); + + if (nextCp === $.EQUALS_SIGN || isAsciiAlphaNumeric(nextCp)) { + this._unconsumeSeveral(referenceSize); + return null; + } + } + } + + return referencedCodePoints; + } + + this._unconsumeSeveral(consumedCount); + + return null; +}; + +Tokenizer.prototype._consumeCharacterReference = function (startCp, inAttr) { + if (isWhitespace(startCp) || startCp === $.GREATER_THAN_SIGN || + startCp === $.AMPERSAND || startCp === this.additionalAllowedCp || startCp === $.EOF) { + //NOTE: not a character reference. No characters are consumed, and nothing is returned. + this._unconsume(); + return null; + } + + if (startCp === $.NUMBER_SIGN) { + //NOTE: we have a numeric entity candidate, now we should determine if it's hex or decimal + var isHex = false, + nextCp = this._lookahead(); + + if (nextCp === $.LATIN_SMALL_X || nextCp === $.LATIN_CAPITAL_X) { + this._consume(); + isHex = true; + } + + nextCp = this._lookahead(); + + //NOTE: if we have at least one digit this is a numeric entity for sure, so we consume it + if (nextCp !== $.EOF && isDigit(nextCp, isHex)) + return [this._consumeNumericEntity(isHex)]; + + //NOTE: otherwise this is a bogus number entity and a parse error. Unconsume the number sign + //and the 'x'-character if appropriate. + this._unconsumeSeveral(isHex ? 2 : 1); + return null; + } + + this._unconsume(); + + return this._consumeNamedEntity(inAttr); +}; + +//State machine +var _ = Tokenizer.prototype; + +//12.2.4.1 Data state +//------------------------------------------------------------------ +_[DATA_STATE] = function dataState(cp) { + this.preprocessor.dropParsedChunk(); + + if (cp === $.AMPERSAND) + this.state = CHARACTER_REFERENCE_IN_DATA_STATE; + + else if (cp === $.LESS_THAN_SIGN) + this.state = TAG_OPEN_STATE; + + else if (cp === $.NULL) + this._emitCodePoint(cp); + + else if (cp === $.EOF) + this._emitEOFToken(); + + else + this._emitCodePoint(cp); +}; + + +//12.2.4.2 Character reference in data state +//------------------------------------------------------------------ +_[CHARACTER_REFERENCE_IN_DATA_STATE] = function characterReferenceInDataState(cp) { + this.additionalAllowedCp = void 0; + + var referencedCodePoints = this._consumeCharacterReference(cp, false); + + if (!this._ensureHibernation()) { + if (referencedCodePoints) + this._emitSeveralCodePoints(referencedCodePoints); + + else + this._emitChar('&'); + + this.state = DATA_STATE; + } +}; + + +//12.2.4.3 RCDATA state +//------------------------------------------------------------------ +_[RCDATA_STATE] = function rcdataState(cp) { + this.preprocessor.dropParsedChunk(); + + if (cp === $.AMPERSAND) + this.state = CHARACTER_REFERENCE_IN_RCDATA_STATE; + + else if (cp === $.LESS_THAN_SIGN) + this.state = RCDATA_LESS_THAN_SIGN_STATE; + + else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + + else if (cp === $.EOF) + this._emitEOFToken(); + + else + this._emitCodePoint(cp); +}; + + +//12.2.4.4 Character reference in RCDATA state +//------------------------------------------------------------------ +_[CHARACTER_REFERENCE_IN_RCDATA_STATE] = function characterReferenceInRcdataState(cp) { + this.additionalAllowedCp = void 0; + + var referencedCodePoints = this._consumeCharacterReference(cp, false); + + if (!this._ensureHibernation()) { + if (referencedCodePoints) + this._emitSeveralCodePoints(referencedCodePoints); + + else + this._emitChar('&'); + + this.state = RCDATA_STATE; + } +}; + + +//12.2.4.5 RAWTEXT state +//------------------------------------------------------------------ +_[RAWTEXT_STATE] = function rawtextState(cp) { + this.preprocessor.dropParsedChunk(); + + if (cp === $.LESS_THAN_SIGN) + this.state = RAWTEXT_LESS_THAN_SIGN_STATE; + + else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + + else if (cp === $.EOF) + this._emitEOFToken(); + + else + this._emitCodePoint(cp); +}; + + +//12.2.4.6 Script data state +//------------------------------------------------------------------ +_[SCRIPT_DATA_STATE] = function scriptDataState(cp) { + this.preprocessor.dropParsedChunk(); + + if (cp === $.LESS_THAN_SIGN) + this.state = SCRIPT_DATA_LESS_THAN_SIGN_STATE; + + else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + + else if (cp === $.EOF) + this._emitEOFToken(); + + else + this._emitCodePoint(cp); +}; + + +//12.2.4.7 PLAINTEXT state +//------------------------------------------------------------------ +_[PLAINTEXT_STATE] = function plaintextState(cp) { + this.preprocessor.dropParsedChunk(); + + if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + + else if (cp === $.EOF) + this._emitEOFToken(); + + else + this._emitCodePoint(cp); +}; + + +//12.2.4.8 Tag open state +//------------------------------------------------------------------ +_[TAG_OPEN_STATE] = function tagOpenState(cp) { + if (cp === $.EXCLAMATION_MARK) + this.state = MARKUP_DECLARATION_OPEN_STATE; + + else if (cp === $.SOLIDUS) + this.state = END_TAG_OPEN_STATE; + + else if (isAsciiLetter(cp)) { + this._createStartTagToken(); + this._reconsumeInState(TAG_NAME_STATE); + } + + else if (cp === $.QUESTION_MARK) + this._reconsumeInState(BOGUS_COMMENT_STATE); + + else { + this._emitChar('<'); + this._reconsumeInState(DATA_STATE); + } +}; + + +//12.2.4.9 End tag open state +//------------------------------------------------------------------ +_[END_TAG_OPEN_STATE] = function endTagOpenState(cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this._reconsumeInState(TAG_NAME_STATE); + } + + else if (cp === $.GREATER_THAN_SIGN) + this.state = DATA_STATE; + + else if (cp === $.EOF) { + this._reconsumeInState(DATA_STATE); + this._emitChar('<'); + this._emitChar('/'); + } + + else + this._reconsumeInState(BOGUS_COMMENT_STATE); +}; + + +//12.2.4.10 Tag name state +//------------------------------------------------------------------ +_[TAG_NAME_STATE] = function tagNameState(cp) { + if (isWhitespace(cp)) + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + + else if (cp === $.SOLIDUS) + this.state = SELF_CLOSING_START_TAG_STATE; + + else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } + + else if (isAsciiUpper(cp)) + this.currentToken.tagName += toAsciiLowerChar(cp); + + else if (cp === $.NULL) + this.currentToken.tagName += UNICODE.REPLACEMENT_CHARACTER; + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else + this.currentToken.tagName += toChar(cp); +}; + + +//12.2.4.11 RCDATA less-than sign state +//------------------------------------------------------------------ +_[RCDATA_LESS_THAN_SIGN_STATE] = function rcdataLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = RCDATA_END_TAG_OPEN_STATE; + } + + else { + this._emitChar('<'); + this._reconsumeInState(RCDATA_STATE); + } +}; + + +//12.2.4.12 RCDATA end tag open state +//------------------------------------------------------------------ +_[RCDATA_END_TAG_OPEN_STATE] = function rcdataEndTagOpenState(cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this._reconsumeInState(RCDATA_END_TAG_NAME_STATE); + } + + else { + this._emitChar('<'); + this._emitChar('/'); + this._reconsumeInState(RCDATA_STATE); + } +}; + + +//12.2.4.13 RCDATA end tag name state +//------------------------------------------------------------------ +_[RCDATA_END_TAG_NAME_STATE] = function rcdataEndTagNameState(cp) { + if (isAsciiUpper(cp)) { + this.currentToken.tagName += toAsciiLowerChar(cp); + this.tempBuff.push(cp); + } + + else if (isAsciiLower(cp)) { + this.currentToken.tagName += toChar(cp); + this.tempBuff.push(cp); + } + + else { + if (this._isAppropriateEndTagToken()) { + if (isWhitespace(cp)) { + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + return; + } + + if (cp === $.SOLIDUS) { + this.state = SELF_CLOSING_START_TAG_STATE; + return; + } + + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + return; + } + } + + this._emitChar('<'); + this._emitChar('/'); + this._emitSeveralCodePoints(this.tempBuff); + this._reconsumeInState(RCDATA_STATE); + } +}; + + +//12.2.4.14 RAWTEXT less-than sign state +//------------------------------------------------------------------ +_[RAWTEXT_LESS_THAN_SIGN_STATE] = function rawtextLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = RAWTEXT_END_TAG_OPEN_STATE; + } + + else { + this._emitChar('<'); + this._reconsumeInState(RAWTEXT_STATE); + } +}; + + +//12.2.4.15 RAWTEXT end tag open state +//------------------------------------------------------------------ +_[RAWTEXT_END_TAG_OPEN_STATE] = function rawtextEndTagOpenState(cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this._reconsumeInState(RAWTEXT_END_TAG_NAME_STATE); + } + + else { + this._emitChar('<'); + this._emitChar('/'); + this._reconsumeInState(RAWTEXT_STATE); + } +}; + + +//12.2.4.16 RAWTEXT end tag name state +//------------------------------------------------------------------ +_[RAWTEXT_END_TAG_NAME_STATE] = function rawtextEndTagNameState(cp) { + if (isAsciiUpper(cp)) { + this.currentToken.tagName += toAsciiLowerChar(cp); + this.tempBuff.push(cp); + } + + else if (isAsciiLower(cp)) { + this.currentToken.tagName += toChar(cp); + this.tempBuff.push(cp); + } + + else { + if (this._isAppropriateEndTagToken()) { + if (isWhitespace(cp)) { + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + return; + } + + if (cp === $.SOLIDUS) { + this.state = SELF_CLOSING_START_TAG_STATE; + return; + } + + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + return; + } + } + + this._emitChar('<'); + this._emitChar('/'); + this._emitSeveralCodePoints(this.tempBuff); + this._reconsumeInState(RAWTEXT_STATE); + } +}; + + +//12.2.4.17 Script data less-than sign state +//------------------------------------------------------------------ +_[SCRIPT_DATA_LESS_THAN_SIGN_STATE] = function scriptDataLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = SCRIPT_DATA_END_TAG_OPEN_STATE; + } + + else if (cp === $.EXCLAMATION_MARK) { + this.state = SCRIPT_DATA_ESCAPE_START_STATE; + this._emitChar('<'); + this._emitChar('!'); + } + + else { + this._emitChar('<'); + this._reconsumeInState(SCRIPT_DATA_STATE); + } +}; + + +//12.2.4.18 Script data end tag open state +//------------------------------------------------------------------ +_[SCRIPT_DATA_END_TAG_OPEN_STATE] = function scriptDataEndTagOpenState(cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this._reconsumeInState(SCRIPT_DATA_END_TAG_NAME_STATE); + } + + else { + this._emitChar('<'); + this._emitChar('/'); + this._reconsumeInState(SCRIPT_DATA_STATE); + } +}; + + +//12.2.4.19 Script data end tag name state +//------------------------------------------------------------------ +_[SCRIPT_DATA_END_TAG_NAME_STATE] = function scriptDataEndTagNameState(cp) { + if (isAsciiUpper(cp)) { + this.currentToken.tagName += toAsciiLowerChar(cp); + this.tempBuff.push(cp); + } + + else if (isAsciiLower(cp)) { + this.currentToken.tagName += toChar(cp); + this.tempBuff.push(cp); + } + + else { + if (this._isAppropriateEndTagToken()) { + if (isWhitespace(cp)) { + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + return; + } + + else if (cp === $.SOLIDUS) { + this.state = SELF_CLOSING_START_TAG_STATE; + return; + } + + else if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + return; + } + } + + this._emitChar('<'); + this._emitChar('/'); + this._emitSeveralCodePoints(this.tempBuff); + this._reconsumeInState(SCRIPT_DATA_STATE); + } +}; + + +//12.2.4.20 Script data escape start state +//------------------------------------------------------------------ +_[SCRIPT_DATA_ESCAPE_START_STATE] = function scriptDataEscapeStartState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_ESCAPE_START_DASH_STATE; + this._emitChar('-'); + } + + else + this._reconsumeInState(SCRIPT_DATA_STATE); +}; + + +//12.2.4.21 Script data escape start dash state +//------------------------------------------------------------------ +_[SCRIPT_DATA_ESCAPE_START_DASH_STATE] = function scriptDataEscapeStartDashState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE; + this._emitChar('-'); + } + + else + this._reconsumeInState(SCRIPT_DATA_STATE); +}; + + +//12.2.4.22 Script data escaped state +//------------------------------------------------------------------ +_[SCRIPT_DATA_ESCAPED_STATE] = function scriptDataEscapedState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_ESCAPED_DASH_STATE; + this._emitChar('-'); + } + + else if (cp === $.LESS_THAN_SIGN) + this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; + + else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else + this._emitCodePoint(cp); +}; + + +//12.2.4.23 Script data escaped dash state +//------------------------------------------------------------------ +_[SCRIPT_DATA_ESCAPED_DASH_STATE] = function scriptDataEscapedDashState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_ESCAPED_DASH_DASH_STATE; + this._emitChar('-'); + } + + else if (cp === $.LESS_THAN_SIGN) + this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; + + else if (cp === $.NULL) { + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + } + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else { + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitCodePoint(cp); + } +}; + + +//12.2.4.24 Script data escaped dash dash state +//------------------------------------------------------------------ +_[SCRIPT_DATA_ESCAPED_DASH_DASH_STATE] = function scriptDataEscapedDashDashState(cp) { + if (cp === $.HYPHEN_MINUS) + this._emitChar('-'); + + else if (cp === $.LESS_THAN_SIGN) + this.state = SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE; + + else if (cp === $.GREATER_THAN_SIGN) { + this.state = SCRIPT_DATA_STATE; + this._emitChar('>'); + } + + else if (cp === $.NULL) { + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + } + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else { + this.state = SCRIPT_DATA_ESCAPED_STATE; + this._emitCodePoint(cp); + } +}; + + +//12.2.4.25 Script data escaped less-than sign state +//------------------------------------------------------------------ +_[SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN_STATE] = function scriptDataEscapedLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE; + } + + else if (isAsciiLetter(cp)) { + this.tempBuff = []; + this._emitChar('<'); + this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE); + } + + else { + this._emitChar('<'); + this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); + } +}; + + +//12.2.4.26 Script data escaped end tag open state +//------------------------------------------------------------------ +_[SCRIPT_DATA_ESCAPED_END_TAG_OPEN_STATE] = function scriptDataEscapedEndTagOpenState(cp) { + if (isAsciiLetter(cp)) { + this._createEndTagToken(); + this._reconsumeInState(SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE); + } + + else { + this._emitChar('<'); + this._emitChar('/'); + this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); + } +}; + + +//12.2.4.27 Script data escaped end tag name state +//------------------------------------------------------------------ +_[SCRIPT_DATA_ESCAPED_END_TAG_NAME_STATE] = function scriptDataEscapedEndTagNameState(cp) { + if (isAsciiUpper(cp)) { + this.currentToken.tagName += toAsciiLowerChar(cp); + this.tempBuff.push(cp); + } + + else if (isAsciiLower(cp)) { + this.currentToken.tagName += toChar(cp); + this.tempBuff.push(cp); + } + + else { + if (this._isAppropriateEndTagToken()) { + if (isWhitespace(cp)) { + this.state = BEFORE_ATTRIBUTE_NAME_STATE; + return; + } + + if (cp === $.SOLIDUS) { + this.state = SELF_CLOSING_START_TAG_STATE; + return; + } + + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + return; + } + } + + this._emitChar('<'); + this._emitChar('/'); + this._emitSeveralCodePoints(this.tempBuff); + this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); + } +}; + + +//12.2.4.28 Script data double escape start state +//------------------------------------------------------------------ +_[SCRIPT_DATA_DOUBLE_ESCAPE_START_STATE] = function scriptDataDoubleEscapeStartState(cp) { + if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) { + this.state = this.isTempBufferEqualToScriptString() ? SCRIPT_DATA_DOUBLE_ESCAPED_STATE : SCRIPT_DATA_ESCAPED_STATE; + this._emitCodePoint(cp); + } + + else if (isAsciiUpper(cp)) { + this.tempBuff.push(toAsciiLowerCodePoint(cp)); + this._emitCodePoint(cp); + } + + else if (isAsciiLower(cp)) { + this.tempBuff.push(cp); + this._emitCodePoint(cp); + } + + else + this._reconsumeInState(SCRIPT_DATA_ESCAPED_STATE); +}; + + +//12.2.4.29 Script data double escaped state +//------------------------------------------------------------------ +_[SCRIPT_DATA_DOUBLE_ESCAPED_STATE] = function scriptDataDoubleEscapedState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE; + this._emitChar('-'); + } + + else if (cp === $.LESS_THAN_SIGN) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE; + this._emitChar('<'); + } + + else if (cp === $.NULL) + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else + this._emitCodePoint(cp); +}; + + +//12.2.4.30 Script data double escaped dash state +//------------------------------------------------------------------ +_[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_STATE] = function scriptDataDoubleEscapedDashState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE; + this._emitChar('-'); + } + + else if (cp === $.LESS_THAN_SIGN) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE; + this._emitChar('<'); + } + + else if (cp === $.NULL) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + } + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitCodePoint(cp); + } +}; + + +//12.2.4.31 Script data double escaped dash dash state +//------------------------------------------------------------------ +_[SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH_STATE] = function scriptDataDoubleEscapedDashDashState(cp) { + if (cp === $.HYPHEN_MINUS) + this._emitChar('-'); + + else if (cp === $.LESS_THAN_SIGN) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE; + this._emitChar('<'); + } + + else if (cp === $.GREATER_THAN_SIGN) { + this.state = SCRIPT_DATA_STATE; + this._emitChar('>'); + } + + else if (cp === $.NULL) { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitChar(UNICODE.REPLACEMENT_CHARACTER); + } + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else { + this.state = SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + this._emitCodePoint(cp); + } +}; + + +//12.2.4.32 Script data double escaped less-than sign state +//------------------------------------------------------------------ +_[SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN_STATE] = function scriptDataDoubleEscapedLessThanSignState(cp) { + if (cp === $.SOLIDUS) { + this.tempBuff = []; + this.state = SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE; + this._emitChar('/'); + } + + else + this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE); +}; + + +//12.2.4.33 Script data double escape end state +//------------------------------------------------------------------ +_[SCRIPT_DATA_DOUBLE_ESCAPE_END_STATE] = function scriptDataDoubleEscapeEndState(cp) { + if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN) { + this.state = this.isTempBufferEqualToScriptString() ? SCRIPT_DATA_ESCAPED_STATE : SCRIPT_DATA_DOUBLE_ESCAPED_STATE; + + this._emitCodePoint(cp); + } + + else if (isAsciiUpper(cp)) { + this.tempBuff.push(toAsciiLowerCodePoint(cp)); + this._emitCodePoint(cp); + } + + else if (isAsciiLower(cp)) { + this.tempBuff.push(cp); + this._emitCodePoint(cp); + } + + else + this._reconsumeInState(SCRIPT_DATA_DOUBLE_ESCAPED_STATE); +}; + + +//12.2.4.34 Before attribute name state +//------------------------------------------------------------------ +_[BEFORE_ATTRIBUTE_NAME_STATE] = function beforeAttributeNameState(cp) { + if (isWhitespace(cp)) + return; + + if (cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN || cp === $.EOF) + this._reconsumeInState(AFTER_ATTRIBUTE_NAME_STATE); + + else if (cp === $.EQUALS_SIGN) { + this._createAttr('='); + this.state = ATTRIBUTE_NAME_STATE; + } + + else { + this._createAttr(''); + this._reconsumeInState(ATTRIBUTE_NAME_STATE); + } +}; + + +//12.2.4.35 Attribute name state +//------------------------------------------------------------------ +_[ATTRIBUTE_NAME_STATE] = function attributeNameState(cp) { + if (isWhitespace(cp) || cp === $.SOLIDUS || cp === $.GREATER_THAN_SIGN || cp === $.EOF) { + this._leaveAttrName(AFTER_ATTRIBUTE_NAME_STATE); + this._unconsume(); + } + + else if (cp === $.EQUALS_SIGN) + this._leaveAttrName(BEFORE_ATTRIBUTE_VALUE_STATE); + + else if (isAsciiUpper(cp)) + this.currentAttr.name += toAsciiLowerChar(cp); + + else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN) + this.currentAttr.name += toChar(cp); + + else if (cp === $.NULL) + this.currentAttr.name += UNICODE.REPLACEMENT_CHARACTER; + + else + this.currentAttr.name += toChar(cp); +}; + + +//12.2.4.36 After attribute name state +//------------------------------------------------------------------ +_[AFTER_ATTRIBUTE_NAME_STATE] = function afterAttributeNameState(cp) { + if (isWhitespace(cp)) + return; + + if (cp === $.SOLIDUS) + this.state = SELF_CLOSING_START_TAG_STATE; + + else if (cp === $.EQUALS_SIGN) + this.state = BEFORE_ATTRIBUTE_VALUE_STATE; + + else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else { + this._createAttr(''); + this._reconsumeInState(ATTRIBUTE_NAME_STATE); + } +}; + + +//12.2.4.37 Before attribute value state +//------------------------------------------------------------------ +_[BEFORE_ATTRIBUTE_VALUE_STATE] = function beforeAttributeValueState(cp) { + if (isWhitespace(cp)) + return; + + if (cp === $.QUOTATION_MARK) + this.state = ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE; + + else if (cp === $.APOSTROPHE) + this.state = ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE; + + else + this._reconsumeInState(ATTRIBUTE_VALUE_UNQUOTED_STATE); +}; + + +//12.2.4.38 Attribute value (double-quoted) state +//------------------------------------------------------------------ +_[ATTRIBUTE_VALUE_DOUBLE_QUOTED_STATE] = function attributeValueDoubleQuotedState(cp) { + if (cp === $.QUOTATION_MARK) + this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE; + + else if (cp === $.AMPERSAND) { + this.additionalAllowedCp = $.QUOTATION_MARK; + this.returnState = this.state; + this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE; + } + + else if (cp === $.NULL) + this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else + this.currentAttr.value += toChar(cp); +}; + + +//12.2.4.39 Attribute value (single-quoted) state +//------------------------------------------------------------------ +_[ATTRIBUTE_VALUE_SINGLE_QUOTED_STATE] = function attributeValueSingleQuotedState(cp) { + if (cp === $.APOSTROPHE) + this.state = AFTER_ATTRIBUTE_VALUE_QUOTED_STATE; + + else if (cp === $.AMPERSAND) { + this.additionalAllowedCp = $.APOSTROPHE; + this.returnState = this.state; + this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE; + } + + else if (cp === $.NULL) + this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else + this.currentAttr.value += toChar(cp); +}; + + +//12.2.4.40 Attribute value (unquoted) state +//------------------------------------------------------------------ +_[ATTRIBUTE_VALUE_UNQUOTED_STATE] = function attributeValueUnquotedState(cp) { + if (isWhitespace(cp)) + this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE); + + else if (cp === $.AMPERSAND) { + this.additionalAllowedCp = $.GREATER_THAN_SIGN; + this.returnState = this.state; + this.state = CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE; + } + + else if (cp === $.GREATER_THAN_SIGN) { + this._leaveAttrValue(DATA_STATE); + this._emitCurrentToken(); + } + + else if (cp === $.NULL) + this.currentAttr.value += UNICODE.REPLACEMENT_CHARACTER; + + else if (cp === $.QUOTATION_MARK || cp === $.APOSTROPHE || cp === $.LESS_THAN_SIGN || + cp === $.EQUALS_SIGN || cp === $.GRAVE_ACCENT) + this.currentAttr.value += toChar(cp); + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else + this.currentAttr.value += toChar(cp); +}; + + +//12.2.4.41 Character reference in attribute value state +//------------------------------------------------------------------ +_[CHARACTER_REFERENCE_IN_ATTRIBUTE_VALUE_STATE] = function characterReferenceInAttributeValueState(cp) { + var referencedCodePoints = this._consumeCharacterReference(cp, true); + + if (!this._ensureHibernation()) { + if (referencedCodePoints) { + for (var i = 0; i < referencedCodePoints.length; i++) + this.currentAttr.value += toChar(referencedCodePoints[i]); + } + else + this.currentAttr.value += '&'; + + this.state = this.returnState; + } +}; + + +//12.2.4.42 After attribute value (quoted) state +//------------------------------------------------------------------ +_[AFTER_ATTRIBUTE_VALUE_QUOTED_STATE] = function afterAttributeValueQuotedState(cp) { + if (isWhitespace(cp)) + this._leaveAttrValue(BEFORE_ATTRIBUTE_NAME_STATE); + + else if (cp === $.SOLIDUS) + this._leaveAttrValue(SELF_CLOSING_START_TAG_STATE); + + else if (cp === $.GREATER_THAN_SIGN) { + this._leaveAttrValue(DATA_STATE); + this._emitCurrentToken(); + } + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else + this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE); +}; + + +//12.2.4.43 Self-closing start tag state +//------------------------------------------------------------------ +_[SELF_CLOSING_START_TAG_STATE] = function selfClosingStartTagState(cp) { + if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.selfClosing = true; + this.state = DATA_STATE; + this._emitCurrentToken(); + } + + else if (cp === $.EOF) + this._reconsumeInState(DATA_STATE); + + else + this._reconsumeInState(BEFORE_ATTRIBUTE_NAME_STATE); +}; + + +//12.2.4.44 Bogus comment state +//------------------------------------------------------------------ +_[BOGUS_COMMENT_STATE] = function bogusCommentState() { + this._createCommentToken(); + this._reconsumeInState(BOGUS_COMMENT_STATE_CONTINUATION); +}; + +//HACK: to support streaming and make BOGUS_COMMENT_STATE reentrant we've +//introduced BOGUS_COMMENT_STATE_CONTINUATION state which will not produce +//comment token on each call. +_[BOGUS_COMMENT_STATE_CONTINUATION] = function bogusCommentStateContinuation(cp) { + while (true) { + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + break; + } + + else if (cp === $.EOF) { + this._reconsumeInState(DATA_STATE); + break; + } + + else { + this.currentToken.data += cp === $.NULL ? UNICODE.REPLACEMENT_CHARACTER : toChar(cp); + + this._hibernationSnapshot(); + cp = this._consume(); + + if (this._ensureHibernation()) + return; + } + } + + this._emitCurrentToken(); +}; + +//12.2.4.45 Markup declaration open state +//------------------------------------------------------------------ +_[MARKUP_DECLARATION_OPEN_STATE] = function markupDeclarationOpenState(cp) { + var dashDashMatch = this._consumeSubsequentIfMatch($$.DASH_DASH_STRING, cp, true), + doctypeMatch = !dashDashMatch && this._consumeSubsequentIfMatch($$.DOCTYPE_STRING, cp, false), + cdataMatch = !dashDashMatch && !doctypeMatch && + this.allowCDATA && + this._consumeSubsequentIfMatch($$.CDATA_START_STRING, cp, true); + + if (!this._ensureHibernation()) { + if (dashDashMatch) { + this._createCommentToken(); + this.state = COMMENT_START_STATE; + } + + else if (doctypeMatch) + this.state = DOCTYPE_STATE; + + else if (cdataMatch) + this.state = CDATA_SECTION_STATE; + + else + this._reconsumeInState(BOGUS_COMMENT_STATE); + } +}; + + +//12.2.4.46 Comment start state +//------------------------------------------------------------------ +_[COMMENT_START_STATE] = function commentStartState(cp) { + if (cp === $.HYPHEN_MINUS) + this.state = COMMENT_START_DASH_STATE; + + else if (cp === $.NULL) { + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } + + else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } + + else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else { + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } +}; + + +//12.2.4.47 Comment start dash state +//------------------------------------------------------------------ +_[COMMENT_START_DASH_STATE] = function commentStartDashState(cp) { + if (cp === $.HYPHEN_MINUS) + this.state = COMMENT_END_STATE; + + else if (cp === $.NULL) { + this.currentToken.data += '-'; + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } + + else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } + + else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else { + this.currentToken.data += '-'; + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } +}; + + +//12.2.4.48 Comment state +//------------------------------------------------------------------ +_[COMMENT_STATE] = function commentState(cp) { + if (cp === $.HYPHEN_MINUS) + this.state = COMMENT_END_DASH_STATE; + + else if (cp === $.NULL) + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + + else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else + this.currentToken.data += toChar(cp); +}; + + +//12.2.4.49 Comment end dash state +//------------------------------------------------------------------ +_[COMMENT_END_DASH_STATE] = function commentEndDashState(cp) { + if (cp === $.HYPHEN_MINUS) + this.state = COMMENT_END_STATE; + + else if (cp === $.NULL) { + this.currentToken.data += '-'; + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } + + else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else { + this.currentToken.data += '-'; + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } +}; + + +//12.2.4.50 Comment end state +//------------------------------------------------------------------ +_[COMMENT_END_STATE] = function commentEndState(cp) { + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } + + else if (cp === $.EXCLAMATION_MARK) + this.state = COMMENT_END_BANG_STATE; + + else if (cp === $.HYPHEN_MINUS) + this.currentToken.data += '-'; + + else if (cp === $.NULL) { + this.currentToken.data += '--'; + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } + + else if (cp === $.EOF) { + this._reconsumeInState(DATA_STATE); + this._emitCurrentToken(); + } + + else { + this.currentToken.data += '--'; + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } +}; + + +//12.2.4.51 Comment end bang state +//------------------------------------------------------------------ +_[COMMENT_END_BANG_STATE] = function commentEndBangState(cp) { + if (cp === $.HYPHEN_MINUS) { + this.currentToken.data += '--!'; + this.state = COMMENT_END_DASH_STATE; + } + + else if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } + + else if (cp === $.NULL) { + this.currentToken.data += '--!'; + this.currentToken.data += UNICODE.REPLACEMENT_CHARACTER; + this.state = COMMENT_STATE; + } + + else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else { + this.currentToken.data += '--!'; + this.currentToken.data += toChar(cp); + this.state = COMMENT_STATE; + } +}; + + +//12.2.4.52 DOCTYPE state +//------------------------------------------------------------------ +_[DOCTYPE_STATE] = function doctypeState(cp) { + if (isWhitespace(cp)) + return; + + else if (cp === $.GREATER_THAN_SIGN) { + this._createDoctypeToken(null); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } + + else if (cp === $.EOF) { + this._createDoctypeToken(null); + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + else { + this._createDoctypeToken(''); + this._reconsumeInState(DOCTYPE_NAME_STATE); + } +}; + + +//12.2.4.54 DOCTYPE name state +//------------------------------------------------------------------ +_[DOCTYPE_NAME_STATE] = function doctypeNameState(cp) { + if (isWhitespace(cp) || cp === $.GREATER_THAN_SIGN || cp === $.EOF) + this._reconsumeInState(AFTER_DOCTYPE_NAME_STATE); + + else if (isAsciiUpper(cp)) + this.currentToken.name += toAsciiLowerChar(cp); + + else if (cp === $.NULL) + this.currentToken.name += UNICODE.REPLACEMENT_CHARACTER; + + else + this.currentToken.name += toChar(cp); +}; + + +//12.2.4.55 After DOCTYPE name state +//------------------------------------------------------------------ +_[AFTER_DOCTYPE_NAME_STATE] = function afterDoctypeNameState(cp) { + if (isWhitespace(cp)) + return; + + if (cp === $.GREATER_THAN_SIGN) { + this.state = DATA_STATE; + this._emitCurrentToken(); + } + + else { + var publicMatch = this._consumeSubsequentIfMatch($$.PUBLIC_STRING, cp, false), + systemMatch = !publicMatch && this._consumeSubsequentIfMatch($$.SYSTEM_STRING, cp, false); + + if (!this._ensureHibernation()) { + if (publicMatch) + this.state = BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE; + + else if (systemMatch) + this.state = BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE; + + else { + this.currentToken.forceQuirks = true; + this.state = BOGUS_DOCTYPE_STATE; + } + } + } +}; + + +//12.2.4.57 Before DOCTYPE public identifier state +//------------------------------------------------------------------ +_[BEFORE_DOCTYPE_PUBLIC_IDENTIFIER_STATE] = function beforeDoctypePublicIdentifierState(cp) { + if (isWhitespace(cp)) + return; + + if (cp === $.QUOTATION_MARK) { + this.currentToken.publicId = ''; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE; + } + + else if (cp === $.APOSTROPHE) { + this.currentToken.publicId = ''; + this.state = DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE; + } + + else { + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } +}; + + +//12.2.4.58 DOCTYPE public identifier (double-quoted) state +//------------------------------------------------------------------ +_[DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED_STATE] = function doctypePublicIdentifierDoubleQuotedState(cp) { + if (cp === $.QUOTATION_MARK) + this.state = BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE; + + else if (cp === $.NULL) + this.currentToken.publicId += UNICODE.REPLACEMENT_CHARACTER; + + else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } + + else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else + this.currentToken.publicId += toChar(cp); +}; + + +//12.2.4.59 DOCTYPE public identifier (single-quoted) state +//------------------------------------------------------------------ +_[DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED_STATE] = function doctypePublicIdentifierSingleQuotedState(cp) { + if (cp === $.APOSTROPHE) + this.state = BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE; + + else if (cp === $.NULL) + this.currentToken.publicId += UNICODE.REPLACEMENT_CHARACTER; + + else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } + + else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else + this.currentToken.publicId += toChar(cp); +}; + + +//12.2.4.61 Between DOCTYPE public and system identifiers state +//------------------------------------------------------------------ +_[BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS_STATE] = function betweenDoctypePublicAndSystemIdentifiersState(cp) { + if (isWhitespace(cp)) + return; + + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } + + else if (cp === $.QUOTATION_MARK) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } + + + else if (cp === $.APOSTROPHE) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } + + else { + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } +}; + + +//12.2.4.63 Before DOCTYPE system identifier state +//------------------------------------------------------------------ +_[BEFORE_DOCTYPE_SYSTEM_IDENTIFIER_STATE] = function beforeDoctypeSystemIdentifierState(cp) { + if (isWhitespace(cp)) + return; + + if (cp === $.QUOTATION_MARK) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE; + } + + else if (cp === $.APOSTROPHE) { + this.currentToken.systemId = ''; + this.state = DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE; + } + + else { + this.currentToken.forceQuirks = true; + this._reconsumeInState(BOGUS_DOCTYPE_STATE); + } +}; + + +//12.2.4.64 DOCTYPE system identifier (double-quoted) state +//------------------------------------------------------------------ +_[DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED_STATE] = function doctypeSystemIdentifierDoubleQuotedState(cp) { + if (cp === $.QUOTATION_MARK) + this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE; + + else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } + + else if (cp === $.NULL) + this.currentToken.systemId += UNICODE.REPLACEMENT_CHARACTER; + + else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else + this.currentToken.systemId += toChar(cp); +}; + + +//12.2.4.65 DOCTYPE system identifier (single-quoted) state +//------------------------------------------------------------------ +_[DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED_STATE] = function doctypeSystemIdentifierSingleQuotedState(cp) { + if (cp === $.APOSTROPHE) + this.state = AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE; + + else if (cp === $.GREATER_THAN_SIGN) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this.state = DATA_STATE; + } + + else if (cp === $.NULL) + this.currentToken.systemId += UNICODE.REPLACEMENT_CHARACTER; + + else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else + this.currentToken.systemId += toChar(cp); +}; + + +//12.2.4.66 After DOCTYPE system identifier state +//------------------------------------------------------------------ +_[AFTER_DOCTYPE_SYSTEM_IDENTIFIER_STATE] = function afterDoctypeSystemIdentifierState(cp) { + if (isWhitespace(cp)) + return; + + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } + + else if (cp === $.EOF) { + this.currentToken.forceQuirks = true; + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } + + else + this.state = BOGUS_DOCTYPE_STATE; +}; + + +//12.2.4.67 Bogus DOCTYPE state +//------------------------------------------------------------------ +_[BOGUS_DOCTYPE_STATE] = function bogusDoctypeState(cp) { + if (cp === $.GREATER_THAN_SIGN) { + this._emitCurrentToken(); + this.state = DATA_STATE; + } + + else if (cp === $.EOF) { + this._emitCurrentToken(); + this._reconsumeInState(DATA_STATE); + } +}; + + +//12.2.4.68 CDATA section state +//------------------------------------------------------------------ +_[CDATA_SECTION_STATE] = function cdataSectionState(cp) { + while (true) { + if (cp === $.EOF) { + this._reconsumeInState(DATA_STATE); + break; + } + + else { + var cdataEndMatch = this._consumeSubsequentIfMatch($$.CDATA_END_STRING, cp, true); + + if (this._ensureHibernation()) + break; + + if (cdataEndMatch) { + this.state = DATA_STATE; + break; + } + + this._emitCodePoint(cp); + + this._hibernationSnapshot(); + cp = this._consume(); + + if (this._ensureHibernation()) + break; + } + } +}; + + +/***/ }), +/* 66 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subject_1 = __webpack_require__(8); +var queue_1 = __webpack_require__(318); +var Subscription_1 = __webpack_require__(11); +var observeOn_1 = __webpack_require__(332); +var ObjectUnsubscribedError_1 = __webpack_require__(326); +var SubjectSubscription_1 = __webpack_require__(688); +/** + * @class ReplaySubject + */ +var ReplaySubject = (function (_super) { + __extends(ReplaySubject, _super); + function ReplaySubject(bufferSize, windowTime, scheduler) { + if (bufferSize === void 0) { bufferSize = Number.POSITIVE_INFINITY; } + if (windowTime === void 0) { windowTime = Number.POSITIVE_INFINITY; } + _super.call(this); + this.scheduler = scheduler; + this._events = []; + this._bufferSize = bufferSize < 1 ? 1 : bufferSize; + this._windowTime = windowTime < 1 ? 1 : windowTime; + } + ReplaySubject.prototype.next = function (value) { + var now = this._getNow(); + this._events.push(new ReplayEvent(now, value)); + this._trimBufferThenGetEvents(); + _super.prototype.next.call(this, value); + }; + ReplaySubject.prototype._subscribe = function (subscriber) { + var _events = this._trimBufferThenGetEvents(); + var scheduler = this.scheduler; + var subscription; + if (this.closed) { + throw new ObjectUnsubscribedError_1.ObjectUnsubscribedError(); + } + else if (this.hasError) { + subscription = Subscription_1.Subscription.EMPTY; + } + else if (this.isStopped) { + subscription = Subscription_1.Subscription.EMPTY; + } + else { + this.observers.push(subscriber); + subscription = new SubjectSubscription_1.SubjectSubscription(this, subscriber); + } + if (scheduler) { + subscriber.add(subscriber = new observeOn_1.ObserveOnSubscriber(subscriber, scheduler)); + } + var len = _events.length; + for (var i = 0; i < len && !subscriber.closed; i++) { + subscriber.next(_events[i].value); + } + if (this.hasError) { + subscriber.error(this.thrownError); + } + else if (this.isStopped) { + subscriber.complete(); + } + return subscription; + }; + ReplaySubject.prototype._getNow = function () { + return (this.scheduler || queue_1.queue).now(); + }; + ReplaySubject.prototype._trimBufferThenGetEvents = function () { + var now = this._getNow(); + var _bufferSize = this._bufferSize; + var _windowTime = this._windowTime; + var _events = this._events; + var eventsCount = _events.length; + var spliceCount = 0; + // Trim events that fall out of the time window. + // Start at the front of the list. Break early once + // we encounter an event that falls within the window. + while (spliceCount < eventsCount) { + if ((now - _events[spliceCount].time) < _windowTime) { + break; + } + spliceCount++; + } + if (eventsCount > _bufferSize) { + spliceCount = Math.max(spliceCount, eventsCount - _bufferSize); + } + if (spliceCount > 0) { + _events.splice(0, spliceCount); + } + return _events; + }; + return ReplaySubject; +}(Subject_1.Subject)); +exports.ReplaySubject = ReplaySubject; +var ReplayEvent = (function () { + function ReplayEvent(time, value) { + this.time = time; + this.value = value; + } + return ReplayEvent; +}()); +//# sourceMappingURL=ReplaySubject.js.map + +/***/ }), +/* 67 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var merge_1 = __webpack_require__(693); +Observable_1.Observable.merge = merge_1.merge; +//# sourceMappingURL=merge.js.map + +/***/ }), +/* 68 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var root_1 = __webpack_require__(23); +var Action_1 = __webpack_require__(658); +/** + * We need this JSDoc comment for affecting ESDoc. + * @ignore + * @extends {Ignored} + */ +var AsyncAction = (function (_super) { + __extends(AsyncAction, _super); + function AsyncAction(scheduler, work) { + _super.call(this, scheduler, work); + this.scheduler = scheduler; + this.work = work; + this.pending = false; + } + AsyncAction.prototype.schedule = function (state, delay) { + if (delay === void 0) { delay = 0; } + if (this.closed) { + return this; + } + // Always replace the current state with the new state. + this.state = state; + // Set the pending flag indicating that this action has been scheduled, or + // has recursively rescheduled itself. + this.pending = true; + var id = this.id; + var scheduler = this.scheduler; + // + // Important implementation note: + // + // Actions only execute once by default, unless rescheduled from within the + // scheduled callback. This allows us to implement single and repeat + // actions via the same code path, without adding API surface area, as well + // as mimic traditional recursion but across asynchronous boundaries. + // + // However, JS runtimes and timers distinguish between intervals achieved by + // serial `setTimeout` calls vs. a single `setInterval` call. An interval of + // serial `setTimeout` calls can be individually delayed, which delays + // scheduling the next `setTimeout`, and so on. `setInterval` attempts to + // guarantee the interval callback will be invoked more precisely to the + // interval period, regardless of load. + // + // Therefore, we use `setInterval` to schedule single and repeat actions. + // If the action reschedules itself with the same delay, the interval is not + // canceled. If the action doesn't reschedule, or reschedules with a + // different delay, the interval will be canceled after scheduled callback + // execution. + // + if (id != null) { + this.id = this.recycleAsyncId(scheduler, id, delay); + } + this.delay = delay; + // If this action has already an async Id, don't request a new one. + this.id = this.id || this.requestAsyncId(scheduler, this.id, delay); + return this; + }; + AsyncAction.prototype.requestAsyncId = function (scheduler, id, delay) { + if (delay === void 0) { delay = 0; } + return root_1.root.setInterval(scheduler.flush.bind(scheduler, this), delay); + }; + AsyncAction.prototype.recycleAsyncId = function (scheduler, id, delay) { + if (delay === void 0) { delay = 0; } + // If this action is rescheduled with the same delay time, don't clear the interval id. + if (delay !== null && this.delay === delay && this.pending === false) { + return id; + } + // Otherwise, if the action's delay time is different from the current delay, + // or the action has been rescheduled before it's executed, clear the interval id + return root_1.root.clearInterval(id) && undefined || undefined; + }; + /** + * Immediately executes this action and the `work` it contains. + * @return {any} + */ + AsyncAction.prototype.execute = function (state, delay) { + if (this.closed) { + return new Error('executing a cancelled action'); + } + this.pending = false; + var error = this._execute(state, delay); + if (error) { + return error; + } + else if (this.pending === false && this.id != null) { + // Dequeue if the action didn't reschedule itself. Don't call + // unsubscribe(), because the action could reschedule later. + // For example: + // ``` + // scheduler.schedule(function doWork(counter) { + // /* ... I'm a busy worker bee ... */ + // var originalAction = this; + // /* wait 100ms before rescheduling the action */ + // setTimeout(function () { + // originalAction.schedule(counter + 1); + // }, 100); + // }, 1000); + // ``` + this.id = this.recycleAsyncId(this.scheduler, this.id, null); + } + }; + AsyncAction.prototype._execute = function (state, delay) { + var errored = false; + var errorValue = undefined; + try { + this.work(state); + } + catch (e) { + errored = true; + errorValue = !!e && e || new Error(e); + } + if (errored) { + this.unsubscribe(); + return errorValue; + } + }; + AsyncAction.prototype._unsubscribe = function () { + var id = this.id; + var scheduler = this.scheduler; + var actions = scheduler.actions; + var index = actions.indexOf(this); + this.work = null; + this.delay = null; + this.state = null; + this.pending = false; + this.scheduler = null; + if (index !== -1) { + actions.splice(index, 1); + } + if (id != null) { + this.id = this.recycleAsyncId(scheduler, id, null); + } + }; + return AsyncAction; +}(Action_1.Action)); +exports.AsyncAction = AsyncAction; +//# sourceMappingURL=AsyncAction.js.map + +/***/ }), +/* 69 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Scheduler_1 = __webpack_require__(450); +var AsyncScheduler = (function (_super) { + __extends(AsyncScheduler, _super); + function AsyncScheduler() { + _super.apply(this, arguments); + this.actions = []; + /** + * A flag to indicate whether the Scheduler is currently executing a batch of + * queued actions. + * @type {boolean} + */ + this.active = false; + /** + * An internal ID used to track the latest asynchronous task such as those + * coming from `setTimeout`, `setInterval`, `requestAnimationFrame`, and + * others. + * @type {any} + */ + this.scheduled = undefined; + } + AsyncScheduler.prototype.flush = function (action) { + var actions = this.actions; + if (this.active) { + actions.push(action); + return; + } + var error; + this.active = true; + do { + if (error = action.execute(action.state, action.delay)) { + break; + } + } while (action = actions.shift()); // exhaust the scheduler queue + this.active = false; + if (error) { + while (action = actions.shift()) { + action.unsubscribe(); + } + throw error; + } + }; + return AsyncScheduler; +}(Scheduler_1.Scheduler)); +exports.AsyncScheduler = AsyncScheduler; +//# sourceMappingURL=AsyncScheduler.js.map + +/***/ }), +/* 70 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +/** + * An error thrown when an element was queried at a certain index of an + * Observable, but no such index or position exists in that sequence. + * + * @see {@link elementAt} + * @see {@link take} + * @see {@link takeLast} + * + * @class ArgumentOutOfRangeError + */ +var ArgumentOutOfRangeError = (function (_super) { + __extends(ArgumentOutOfRangeError, _super); + function ArgumentOutOfRangeError() { + var err = _super.call(this, 'argument out of range'); + this.name = err.name = 'ArgumentOutOfRangeError'; + this.stack = err.stack; + this.message = err.message; + } + return ArgumentOutOfRangeError; +}(Error)); +exports.ArgumentOutOfRangeError = ArgumentOutOfRangeError; +//# sourceMappingURL=ArgumentOutOfRangeError.js.map + +/***/ }), +/* 71 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(12); + +/***/ }), +/* 72 */ +/***/ (function(module, exports) { + +module.exports = require("util"); + +/***/ }), +/* 73 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_date_math_1 = __webpack_require__(19); +var kendo_angular_intl_1 = __webpack_require__(10); +var util_1 = __webpack_require__(18); +var EMPTY_DATA = [[]]; +var CELLS_LENGTH = 7; +var ROWS_LENGTH = 6; +var SATURDAY = 6; +var SUNDAY = 0; +/** + * @hidden + */ +var MonthViewService = (function () { + function MonthViewService(_intlService) { + this._intlService = _intlService; + } + MonthViewService.prototype.prev = function (current) { + return kendo_date_math_1.addMonths(current, -1); + }; + MonthViewService.prototype.next = function (current) { + return kendo_date_math_1.addMonths(current, 1); + }; + MonthViewService.prototype.dayValue = function (current) { + return current ? current.getDate().toString() : ""; + }; + MonthViewService.prototype.title = function (current) { + return this.abbrMonthNames()[current.getMonth()] + " " + current.getFullYear(); + }; + MonthViewService.prototype.viewData = function (options) { + var _this = this; + var cellUID = options.cellUID, focusedDate = options.focusedDate, max = options.max, min = options.min, selectedDate = options.selectedDate, viewDate = options.viewDate; + if (!viewDate) { + return EMPTY_DATA; + } + var firstMonthDate = kendo_date_math_1.firstDayOfMonth(viewDate); + var lastMonthDate = kendo_date_math_1.lastDayOfMonth(viewDate); + var backward = -1; + var date = kendo_date_math_1.dayOfWeek(firstMonthDate, this._intlService.firstDay(), backward); + var cells = util_1.range(0, CELLS_LENGTH); + return util_1.range(0, ROWS_LENGTH).map(function (rowOffset) { + var baseDate = kendo_date_math_1.addDays(date, rowOffset * 7); + return cells.map(function (cellOffset) { + var cellDate = kendo_date_math_1.addDays(baseDate, cellOffset); + var otherMonth = cellDate < firstMonthDate || cellDate > lastMonthDate; + var outOfRange = cellDate < min || cellDate > max; + if (otherMonth || outOfRange) { + return null; + } + return { + id: "" + cellUID + cellDate.getTime(), + isFocused: _this.isEqual(cellDate, focusedDate), + isSelected: _this.isEqual(cellDate, selectedDate), + isWeekend: _this.isWeekend(cellDate), + value: cellDate + }; + }); + }); + }; + MonthViewService.prototype.weekNumber = function (date) { + return kendo_date_math_1.weekInYear(date, this._intlService.firstDay()); + }; + MonthViewService.prototype.isWeekend = function (date) { + var day = date.getDay(); + return day === SATURDAY || day === SUNDAY; + }; + MonthViewService.prototype.isEqual = function (candidate, expected) { + if (!candidate || !expected) { + return false; + } + return kendo_date_math_1.getDate(candidate).getTime() === kendo_date_math_1.getDate(expected).getTime(); + }; + MonthViewService.prototype.weekNames = function () { + return util_1.shiftWeekNames(this._intlService.dateFormatNames({ nameType: 'short', type: 'days' }), this._intlService.firstDay()); + }; + //TODO: rename this method as it doesn't return abbr, but wide month names + MonthViewService.prototype.abbrMonthNames = function () { + return this._intlService.dateFormatNames({ nameType: 'wide', type: 'months' }); + }; + return MonthViewService; +}()); +MonthViewService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +MonthViewService.ctorParameters = function () { return [ + { type: kendo_angular_intl_1.IntlService, }, +]; }; +exports.MonthViewService = MonthViewService; + + +/***/ }), +/* 74 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var util_1 = __webpack_require__(24); +var keys_1 = __webpack_require__(36); +var navigation_action_1 = __webpack_require__(54); +var MIN_INDEX = 0; +/** + * @hidden + */ +var NavigationEvent = (function () { + /** + * The index of the item to which was navigated. + */ + function NavigationEvent(index, originalEvent) { + this.index = index; + this.originalEvent = originalEvent; + } + return NavigationEvent; +}()); +exports.NavigationEvent = NavigationEvent; +/** + * @hidden + */ +var NavigationService = (function () { + function NavigationService() { + this.open = new core_1.EventEmitter(); + this.close = new core_1.EventEmitter(); + this.enter = new core_1.EventEmitter(); + this.tab = new core_1.EventEmitter(); + this.esc = new core_1.EventEmitter(); + this.up = new core_1.EventEmitter(); + this.right = new core_1.EventEmitter(); + this.down = new core_1.EventEmitter(); + this.left = new core_1.EventEmitter(); + this.delete = new core_1.EventEmitter(); + this.backspace = new core_1.EventEmitter(); + this.home = new core_1.EventEmitter(); + this.end = new core_1.EventEmitter(); + } + NavigationService.prototype.process = function (args) { + var keyCode = args.originalEvent.keyCode; + var altKey = args.originalEvent.altKey; + var index; + var action = navigation_action_1.NavigationAction.Undefined; + if (altKey && keyCode === keys_1.Keys.down) { + action = navigation_action_1.NavigationAction.Open; + } + else if (altKey && keyCode === keys_1.Keys.up) { + action = navigation_action_1.NavigationAction.Close; + } + else if (keyCode === keys_1.Keys.enter) { + action = navigation_action_1.NavigationAction.Enter; + } + else if (keyCode === keys_1.Keys.esc) { + action = navigation_action_1.NavigationAction.Esc; + } + else if (keyCode === keys_1.Keys.tab) { + action = navigation_action_1.NavigationAction.Tab; + } + else if (keyCode === keys_1.Keys.up) { + index = this.next({ current: args.current, start: args.max, end: args.min, step: -1 }); + action = navigation_action_1.NavigationAction.Up; + } + else if (keyCode === keys_1.Keys.left) { + index = this.next({ current: args.current, start: args.max, end: args.min, step: -1 }); + action = navigation_action_1.NavigationAction.Left; + } + else if (keyCode === keys_1.Keys.down) { + index = this.next({ current: args.current, start: args.min, end: args.max, step: 1 }); + action = navigation_action_1.NavigationAction.Down; + } + else if (keyCode === keys_1.Keys.right) { + index = this.next({ current: args.current, start: args.min, end: args.max, step: 1 }); + action = navigation_action_1.NavigationAction.Right; + } + else if (keyCode === keys_1.Keys.home) { + index = MIN_INDEX; + action = navigation_action_1.NavigationAction.Home; + } + else if (keyCode === keys_1.Keys.end) { + index = args.max; + action = navigation_action_1.NavigationAction.End; + } + else if (keyCode === keys_1.Keys.delete) { + action = navigation_action_1.NavigationAction.Delete; + } + else if (keyCode === keys_1.Keys.backspace) { + action = navigation_action_1.NavigationAction.Backspace; + } + var eventData = new NavigationEvent(index, args.originalEvent); + if (action !== navigation_action_1.NavigationAction.Undefined) { + this[navigation_action_1.NavigationAction[action].toLowerCase()].emit(eventData); + } + return action; + }; + NavigationService.prototype.next = function (args) { + if (!util_1.isPresent(args.current)) { + return args.start; + } + else { + return args.current !== args.end ? args.current + args.step : args.end; + } + }; + return NavigationService; +}()); +NavigationService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +NavigationService.ctorParameters = function () { return []; }; +exports.NavigationService = NavigationService; + + +/***/ }), +/* 75 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:member-ordering */ +var core_1 = __webpack_require__(0); +var keys_1 = __webpack_require__(36); +var util_1 = __webpack_require__(24); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * @hidden + */ +var SearchBarComponent = (function () { + function SearchBarComponent(rtl, renderer) { + this.valueChange = new core_1.EventEmitter(); + this.onBlur = new core_1.EventEmitter(); + this.onFocus = new core_1.EventEmitter(); + this.onClick = new core_1.EventEmitter(); + this.onNavigate = new core_1.EventEmitter(); + this._userInput = ""; + this._composing = false; + this.direction = rtl ? 'rtl' : 'ltr'; + this.renderer = renderer; + } + Object.defineProperty(SearchBarComponent.prototype, "userInput", { + get: function () { + return this._userInput; + }, + set: function (userInput) { + this._userInput = userInput || ""; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchBarComponent.prototype, "searchBarClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SearchBarComponent.prototype, "value", { + get: function () { + return this.input.nativeElement.value; + }, + enumerable: true, + configurable: true + }); + SearchBarComponent.prototype.compositionStart = function () { + this._composing = true; + }; + SearchBarComponent.prototype.compositionUpdate = function () { + this._composing = true; + }; + SearchBarComponent.prototype.compositionEnd = function () { + this._composing = false; + this.valueChange.emit(this.value); + }; + SearchBarComponent.prototype.ngOnChanges = function (changes) { + if (this.input && (changes.userInput || changes.suggestedText)) { + var previousUserInput = (changes.userInput && changes.userInput.previousValue) ? changes.userInput.previousValue : ""; + var caretIndex = this.input.nativeElement.selectionStart; + var caretAtEnd = previousUserInput.length === caretIndex; + this.writeInputValue(this.suggestedText ? util_1.combineStr(this.userInput, this.suggestedText) : this.userInput); + if (this.suggestedText) { + this.setInputSelection(this.userInput.length, this.suggestedText.length); + } + else if (caretAtEnd) { + this.setInputSelection(this.userInput.length, this.userInput.length); + } + else { + this.setInputSelection(caretIndex, caretIndex); + } + } + }; + SearchBarComponent.prototype.writeInputValue = function (text) { + if (util_1.isDocumentAvailable()) { + this.renderer.setProperty(this.input.nativeElement, 'value', text); + } + }; + SearchBarComponent.prototype.setInputSelection = function (start, end) { + if (util_1.isDocumentAvailable()) { + try { + this.input.nativeElement.setSelectionRange(start, end); + } + catch (e) { + //Make sure element is in the DOM before invoking its methods + } + } + }; + SearchBarComponent.prototype.handleInput = function (event) { + var text = event.target.value; + if (text !== this.userInput && !this._composing) { + this.valueChange.emit(text); + } + }; + SearchBarComponent.prototype.handleFocus = function (event) { + this.onFocus.emit(event); + }; + SearchBarComponent.prototype.handleBlur = function (event) { + this.onBlur.emit(event); + }; + SearchBarComponent.prototype.handleKeydown = function (event) { + var keyCode = event.keyCode; + var keys = [keys_1.Keys.up, keys_1.Keys.down, keys_1.Keys.left, keys_1.Keys.right, keys_1.Keys.enter, + keys_1.Keys.esc, keys_1.Keys.delete, keys_1.Keys.backspace, keys_1.Keys.home, keys_1.Keys.end]; + if (keys.indexOf(keyCode) > -1) { + this.onNavigate.emit(event); + } + }; + SearchBarComponent.prototype.focus = function () { + if (util_1.isDocumentAvailable()) { + this.input.nativeElement.focus(); + } + }; + SearchBarComponent.prototype.blur = function () { + if (util_1.isDocumentAvailable()) { + this.input.nativeElement.blur(); + } + }; + SearchBarComponent.prototype.resizeInput = function (size) { + var input = this.input.nativeElement; + this.renderer.setAttribute(input, 'size', size.toString()); + }; + return SearchBarComponent; +}()); +SearchBarComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-searchbar', + template: "\n \n " + },] }, +]; +/** @nocollapse */ +SearchBarComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, + { type: core_1.Renderer2, }, +]; }; +SearchBarComponent.propDecorators = { + 'activeDescendant': [{ type: core_1.Input },], + 'id': [{ type: core_1.Input },], + 'disabled': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'popupOpen': [{ type: core_1.Input },], + 'placeholder': [{ type: core_1.Input },], + 'role': [{ type: core_1.Input },], + 'userInput': [{ type: core_1.Input },], + 'suggestedText': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'onBlur': [{ type: core_1.Output },], + 'onFocus': [{ type: core_1.Output },], + 'onClick': [{ type: core_1.Output },], + 'onNavigate': [{ type: core_1.Output },], + 'input': [{ type: core_1.ViewChild, args: ["input",] },], + 'searchBarClass': [{ type: core_1.HostBinding, args: ['class.k-searchbar',] },], + 'compositionStart': [{ type: core_1.HostListener, args: ["compositionstart",] },], + 'compositionUpdate': [{ type: core_1.HostListener, args: ["compositionupdate",] },], + 'compositionEnd': [{ type: core_1.HostListener, args: ["compositionend",] },], +}; +exports.SearchBarComponent = SearchBarComponent; + + +/***/ }), +/* 76 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +var ColumnBase = (function () { + function ColumnBase(parent) { + this.parent = parent; + } + Object.defineProperty(ColumnBase.prototype, "level", { + /** + * @hidden + */ + get: function () { + return this.parent ? this.parent.level + 1 : 0; + }, + enumerable: true, + configurable: true + }); + return ColumnBase; +}()); +ColumnBase.propDecorators = { + 'title': [{ type: core_1.Input },], + 'width': [{ type: core_1.Input },], + 'locked': [{ type: core_1.Input },], + 'hidden': [{ type: core_1.Input },], + 'headerCellOptions': [{ type: core_1.Input },], + 'children': [{ type: core_1.ContentChildren, args: [ColumnBase,] },], +}; +exports.ColumnBase = ColumnBase; + + +/***/ }), +/* 77 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// tslint:disable:no-access-missing-member +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_service_1 = __webpack_require__(26); +var base_filter_cell_component_1 = __webpack_require__(31); +var kendo_angular_l10n_1 = __webpack_require__(2); +var stringOperators = base_filter_cell_component_1.localizeOperators({ + "filterEqOperator": "eq", + "filterNotEqOperator": "neq", + // tslint:disable-next-line:object-literal-sort-keys + "filterContainsOperator": "contains", + "filterNotContainsOperator": "doesnotcontain", + "filterStartsWithOperator": "startswith", + "filterEndsWithOperator": "endswith", + "filterIsNullOperator": "isnull", + "filterIsNotNullOperator": "isnotnull", + "filterIsEmptyOperator": "isempty", + "filterIsNotEmptyOperator": "isnotempty" +}); +/** + * Represents a string filter-cell component. + * + * @example + * + * ```ts-no-run + * + * + * + * + * + * + * ``` + */ +var StringFilterCellComponent = (function (_super) { + __extends(StringFilterCellComponent, _super); + function StringFilterCellComponent(filterService, localization) { + var _this = _super.call(this, filterService) || this; + _this.localization = localization; + /** + * Determines if the drop-down filter operators should be shown. The default value is `true`. + * @type {boolean} + */ + _this.showOperators = true; + /** + * The default filter operator. Defaults to `contains`. + * @type {string} + */ + _this.operator = "contains"; + _this.defaultOperators = stringOperators(_this.localization); + return _this; + } + Object.defineProperty(StringFilterCellComponent.prototype, "currentFilter", { + /** + * The current filter for the associated column field. + * @readonly + * @type {FilterDescriptor} + */ + get: function () { + return this.filterByField(this.column.field); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(StringFilterCellComponent.prototype, "currentOperator", { + /** + * The current filter operator for the associated column field. + * @readonly + * @type {string} + */ + get: function () { + return this.currentFilter ? this.currentFilter.operator : this.operator; + }, + enumerable: true, + configurable: true + }); + return StringFilterCellComponent; +}(base_filter_cell_component_1.BaseFilterCellComponent)); +StringFilterCellComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-grid-string-filter-cell', + template: "\n \n \n \n " + },] }, +]; +/** @nocollapse */ +StringFilterCellComponent.ctorParameters = function () { return [ + { type: filter_service_1.FilterService, }, + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +StringFilterCellComponent.propDecorators = { + 'showOperators': [{ type: core_1.Input },], + 'column': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], + 'operator': [{ type: core_1.Input },], +}; +exports.StringFilterCellComponent = StringFilterCellComponent; + + +/***/ }), +/* 78 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var common_1 = __webpack_require__(9); +var group_header_template_directive_1 = __webpack_require__(120); +var group_header_component_1 = __webpack_require__(372); +var group_footer_template_directive_1 = __webpack_require__(119); +var group_panel_component_1 = __webpack_require__(374); +var group_indicator_component_1 = __webpack_require__(373); +var shared_module_1 = __webpack_require__(32); +var exportedModules = [ + group_header_template_directive_1.GroupHeaderTemplateDirective, + group_footer_template_directive_1.GroupFooterTemplateDirective, + group_header_component_1.GroupHeaderComponent, + group_panel_component_1.GroupPanelComponent, + group_indicator_component_1.GroupIndicatorComponent +]; +/** + * @hidden + */ +var GroupModule = (function () { + function GroupModule() { + } + GroupModule.exports = function () { + return [ + group_header_template_directive_1.GroupHeaderTemplateDirective, + group_footer_template_directive_1.GroupFooterTemplateDirective + ]; + }; + return GroupModule; +}()); +GroupModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [exportedModules], + exports: [exportedModules], + imports: [common_1.CommonModule, shared_module_1.SharedModule] + },] }, +]; +/** @nocollapse */ +GroupModule.ctorParameters = function () { return []; }; +exports.GroupModule = GroupModule; + + +/***/ }), +/* 79 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var expand_state_service_1 = __webpack_require__(203); +var removeLast = function (groupIndex) { return groupIndex.lastIndexOf("_") > -1 + ? groupIndex.slice(0, groupIndex.lastIndexOf("_")) + : ""; }; +/** + * @hidden + */ +var GroupsService = (function (_super) { + __extends(GroupsService, _super); + function GroupsService() { + return _super !== null && _super.apply(this, arguments) || this; + } + GroupsService.prototype.isInExpandedGroup = function (groupIndex, skipSelf) { + if (skipSelf === void 0) { skipSelf = true; } + if (skipSelf) { + groupIndex = removeLast(groupIndex); + } + var expanded = true; + while (groupIndex && expanded) { + expanded = this.isExpanded(groupIndex); + groupIndex = removeLast(groupIndex); + } + return expanded; + }; + GroupsService.prototype.isExpanded = function (index) { + return !_super.prototype.isExpanded.call(this, index); + }; + return GroupsService; +}(expand_state_service_1.ExpandStateService)); +GroupsService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +GroupsService.ctorParameters = function () { return []; }; +exports.GroupsService = GroupsService; + + +/***/ }), +/* 80 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var intl = __webpack_require__(422); +var error_solutions_1 = __webpack_require__(397); +function formatMessage(error) { + var message = error.message; + var errorSolution = error_solutions_1.errorSolutions[Object.keys(error_solutions_1.errorSolutions).filter(function (key) { return message.indexOf(key) === 0; })[0]]; + return errorSolution ? message + " " + errorSolution : message; +} +function intlMethod(fn) { + return function () { + var values = []; + for (var _i = 0; _i < arguments.length; _i++) { + values[_i] = arguments[_i]; + } + try { + return fn.apply(null, values); + } + catch (error) { + error.message = formatMessage(error); + throw error; + } + }; +} +/** + * @hidden + */ +exports.dateFormatNames = intlMethod(intl.dateFormatNames); +/** + * @hidden + */ +exports.dateFieldName = intlMethod(intl.dateFieldName); +/** + * @hidden + */ +exports.firstDay = intlMethod(intl.firstDay); +/** + * @hidden + */ +exports.format = intlMethod(intl.format); +/** + * @hidden + */ +exports.formatDate = intlMethod(intl.formatDate); +/** + * @hidden + */ +exports.formatNumber = intlMethod(intl.formatNumber); +/** + * @hidden + */ +exports.load = intlMethod(intl.load); +/** + * @hidden + */ +exports.numberSymbols = intlMethod(intl.numberSymbols); +/** + * @hidden + */ +exports.parseDate = intlMethod(intl.parseDate); +/** + * @hidden + */ +exports.parseNumber = intlMethod(intl.parseNumber); +/** + * @hidden + */ +exports.splitDateFormat = intlMethod(intl.splitDateFormat); +/** + * @hidden + */ +exports.toString = intlMethod(intl.toString); +/** + * @hidden + */ +exports.setData = intlMethod(intl.setData); + + +/***/ }), +/* 81 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * An abstract base class that implements + * the Internationalization service methods + * for the current locale. + */ +var IntlService = (function () { + function IntlService() { + } + return IntlService; +}()); +IntlService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +IntlService.ctorParameters = function () { return []; }; +exports.IntlService = IntlService; + + +/***/ }), +/* 82 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var resize_sensor_component_1 = __webpack_require__(271); +exports.ResizeSensorComponent = resize_sensor_component_1.ResizeSensorComponent; +var resize_sensor_module_1 = __webpack_require__(407); +exports.ResizeSensorModule = resize_sensor_module_1.ResizeSensorModule; + + +/***/ }), +/* 83 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var accessor_1 = __webpack_require__(45); +var utils_1 = __webpack_require__(17); +var filter_descriptor_interface_1 = __webpack_require__(61); +var filter_operators_1 = __webpack_require__(132); +var logic = { and: " && ", or: " || " }; +var fieldProp = function (field, fieldFunctions) { + if (utils_1.isFunction(field)) { + var prop = "__f[" + fieldFunctions.length + "](d)"; + return [prop, fieldFunctions.concat([field])]; + } + return [accessor_1.expr(field), fieldFunctions]; +}; +var operatorExpression = function (filter, operatorFunctions, prop) { + if (utils_1.isFunction(filter.operator)) { + var expression = "__o[" + operatorFunctions.length + "](" + prop + ", " + filter_operators_1.operators.quote(filter.value) + ")"; + return [expression, operatorFunctions.concat([filter.operator])]; + } + var ignoreCase = utils_1.isPresent(filter.ignoreCase) ? filter.ignoreCase : true; + return [ + filter_operators_1.operators[filter.operator || 'eq'](prop, filter.value, ignoreCase), + operatorFunctions + ]; +}; +var fieldExpression = function (filter, expressions, operatorFunctions, fieldFunctions) { + var _a = fieldProp(filter.field, fieldFunctions), prop = _a[0], fields = _a[1]; + var _b = operatorExpression(filter, operatorFunctions, prop), expression = _b[0], funcs = _b[1]; + return { + expression: expressions.concat([expression]), + fields: fields, + operators: funcs + }; +}; +var factory = (function () { return ({ + compositeFilterExpression: function (filter, expressions, operatorFunctions, fieldFunctions) { + var inner = factory.filterExpr(filter); + //Nested function fields or operators - update their index e.g. __o[0] -> __o[1] + var expression = inner.expression + .replace(/__o\[(\d+)\]/g, function (_, index) { return ("__o[" + (operatorFunctions.length + (+index)) + "]"); }) + .replace(/__f\[(\d+)\]/g, function (_, index) { return ("__f[" + (fieldFunctions.length + (+index)) + "]"); }); + return { + expression: expressions.concat([expression]), + fields: fieldFunctions.concat(inner.fields), + operators: operatorFunctions.concat(inner.operators) + }; + }, + createExpression: function (acc, filter) { + if (filter_descriptor_interface_1.isCompositeFilterDescriptor(filter)) { + return factory.compositeFilterExpression(filter, acc.expression, acc.operators, acc.fields); + } + return fieldExpression(filter, acc.expression, acc.operators, acc.fields); + }, + filterExpr: function (descriptor) { + var filters = descriptor.filters; + var result = { expression: [], fields: [], operators: [] }; + for (var idx = 0, length_1 = filters.length; idx < length_1; idx++) { + result = factory.createExpression(result, filters[idx]); + } + return { + expression: "(" + result.expression.join(logic[descriptor.logic]) + ")", + fields: result.fields, + operators: result.operators + }; + } +}); })(); +/** + * Creates a function expression from the provided `CompositeFilterDescriptor`. + * @hidden + */ +exports.filterExpr = factory.filterExpr; +/** + * Creates a [`Predicate`]({% slug api_kendo-data-query_predicate_kendouiforangular %}) function + * for the specified [`CompositeFilterDescriptor`]({% slug api_kendo-data-query_compositefilterdescriptor_kendouiforangular %}). + * + * @param {CompositeFilterDescriptor} descriptor - The descriptor for which the predicate is created. + * @returns {Predicate} - The created function instance. + * + * @example + * ```ts-no-run + * import { compileFilter } from '@progress/kendo-data-query'; + * + * const data = [{ name: "Pork" }, { name: "Pepper" }, { name: "Beef" } ]; + * const predicate = compileFilter({ logic: "and", filters: [{ field: "name", operator: "startswith", value: "P" }] }); + * const result = data.filter(predicate); + * + * ``` + */ +exports.compileFilter = function (descriptor) { + if (!descriptor || descriptor.filters.length === 0) { + return function () { return true; }; + } + var expr = exports.filterExpr(descriptor); + var predicate = new Function("d, __f, __o", "return " + expr.expression); + var shouldWrap = expr.fields.length || expr.operators.length; + return (!shouldWrap ? predicate : function (d) { return predicate(d, expr.fields, expr.operators); }); +}; +/** + * Filters the provided array according to the specified + * [`CompositeFilterDescriptor`]({% slug api_kendo-data-query_compositefilterdescriptor_kendouiforangular %}). + * + * @param {T[]} data - The data to be filtered. + * @param {(CompositeFilterDescriptor | FilterDescriptor)} descriptor - The filter criteria to be applied. + * @returns {T[]} - The filtered data. + * + * @example + * ```ts-no-run + * import { filterBy } from '@progress/kendo-data-query'; + * + * const data = [ + * { name: "Pork", category: "Food", subcategory: "Meat" }, + * { name: "Pepper", category: "Food", subcategory: "Vegetables" }, + * { name: "Beef", category: "Food", subcategory: "Meat" } + * ]; + * + * const result = filterBy(data, { + * logic: 'and', + * filters: [ + * { field: "name", operator: "startswith", value: "p", ignoreCase: true }, + * { field: "subcategory", operator: "eq", value: "Meat" }, + * ] + * }); + * + * // output: + * //[{ "name": "Pork", "category": "Food", "subcategory": "Meat" }] + * ``` + */ +exports.filterBy = function (data, descriptor) { + if (!utils_1.isPresent(descriptor) || (filter_descriptor_interface_1.isCompositeFilterDescriptor(descriptor) && descriptor.filters.length === 0)) { + return data; + } + return data.filter(exports.compileFilter(filter_operators_1.normalizeFilters(descriptor))); +}; + + +/***/ }), +/* 84 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/** + * @hidden + */ +exports.either = function (predicate, right, left) { return function (value) { return predicate(value) ? right(value) : left(value); }; }; +/** + * @hidden + * Performs the right-to-left function composition. Functions should have a unary. + */ +exports.compose = function () { + var args = []; + for (var _i = 0; _i < arguments.length; _i++) { + args[_i - 0] = arguments[_i]; + } + return function (data) { return args.reduceRight(function (acc, curr) { return curr(acc); }, data); }; +}; + + +/***/ }), +/* 85 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var adjust_dst_1 = __webpack_require__(62); +var clone_date_1 = __webpack_require__(46); +/** + * A function that adds and subtracts days from a `Date` object. + * + * @param date - The initial date value. + * @param offset - The number of days to add and subtract from the date. + * @returns - A new `Date` instance. + * + * @example + * ```ts-no-run + * addDays(new Date(2016, 0, 1), 5); // 2016-1-6 + * addDays(new Date(2016, 0, 1), -5); // 2015-12-26 + * ``` + */ +exports.addDays = function (date, offset) { + var newDate = clone_date_1.cloneDate(date); + newDate.setDate(newDate.getDate() + offset); + return adjust_dst_1.adjustDST(newDate, date.getHours()); +}; + + +/***/ }), +/* 86 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Enumeration representing the horizontal direction. + * The `Forward` option moves forward. + * The `Backward` option moves backward. + */ +var Direction; +(function (Direction) { + /** + * The `Forward` value with an underlying `1` number value. + */ + Direction[Direction["Forward"] = 1] = "Forward"; + /** + * The `Backward` value with an underlying `-1` (minus one) number value. + */ + Direction[Direction["Backward"] = -1] = "Backward"; +})(Direction = exports.Direction || (exports.Direction = {})); + + +/***/ }), +/* 87 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var Subject_1 = __webpack_require__(8); +var Subscription_1 = __webpack_require__(11); +/** + * @class AsyncSubject + */ +var AsyncSubject = (function (_super) { + __extends(AsyncSubject, _super); + function AsyncSubject() { + _super.apply(this, arguments); + this.value = null; + this.hasNext = false; + this.hasCompleted = false; + } + AsyncSubject.prototype._subscribe = function (subscriber) { + if (this.hasError) { + subscriber.error(this.thrownError); + return Subscription_1.Subscription.EMPTY; + } + else if (this.hasCompleted && this.hasNext) { + subscriber.next(this.value); + subscriber.complete(); + return Subscription_1.Subscription.EMPTY; + } + return _super.prototype._subscribe.call(this, subscriber); + }; + AsyncSubject.prototype.next = function (value) { + if (!this.hasCompleted) { + this.value = value; + this.hasNext = true; + } + }; + AsyncSubject.prototype.error = function (error) { + if (!this.hasCompleted) { + _super.prototype.error.call(this, error); + } + }; + AsyncSubject.prototype.complete = function () { + this.hasCompleted = true; + if (this.hasNext) { + _super.prototype.next.call(this, this.value); + } + _super.prototype.complete.call(this); + }; + return AsyncSubject; +}(Subject_1.Subject)); +exports.AsyncSubject = AsyncSubject; +//# sourceMappingURL=AsyncSubject.js.map + +/***/ }), +/* 88 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var interval_1 = __webpack_require__(575); +Observable_1.Observable.interval = interval_1.interval; +//# sourceMappingURL=interval.js.map + +/***/ }), +/* 89 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var auditTime_1 = __webpack_require__(584); +Observable_1.Observable.prototype.auditTime = auditTime_1.auditTime; +//# sourceMappingURL=auditTime.js.map + +/***/ }), +/* 90 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var take_1 = __webpack_require__(643); +Observable_1.Observable.prototype.take = take_1.take; +//# sourceMappingURL=take.js.map + +/***/ }), +/* 91 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var takeUntil_1 = __webpack_require__(645); +Observable_1.Observable.prototype.takeUntil = takeUntil_1.takeUntil; +//# sourceMappingURL=takeUntil.js.map + +/***/ }), +/* 92 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function isDate(value) { + return value instanceof Date && !isNaN(+value); +} +exports.isDate = isDate; +//# sourceMappingURL=isDate.js.map + +/***/ }), +/* 93 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var isArray_1 = __webpack_require__(49); +function isNumeric(val) { + // parseFloat NaNs numeric-cast false positives (null|true|false|"") + // ...but misinterprets leading-number strings, particularly hex literals ("0x...") + // subtraction forces infinities to NaN + // adding 1 corrects loss of precision from parseFloat (#15100) + return !isArray_1.isArray(val) && (val - parseFloat(val) + 1) >= 0; +} +exports.isNumeric = isNumeric; +; +//# sourceMappingURL=isNumeric.js.map + +/***/ }), +/* 94 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(14); + +/***/ }), +/* 95 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(67); + +/***/ }), +/* 96 */ +/***/ (function(module, exports) { + +module.exports = require("stream"); + +/***/ }), +/* 97 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var common_1 = __webpack_require__(9); +var kendo_angular_intl_1 = __webpack_require__(10); +var templates_module_1 = __webpack_require__(167); +var calendar_component_1 = __webpack_require__(161); +var header_component_1 = __webpack_require__(338); +var virtualization_component_1 = __webpack_require__(99); +var navigation_component_1 = __webpack_require__(165); +var month_view_component_1 = __webpack_require__(164); +var month_component_1 = __webpack_require__(341); +var dom_service_1 = __webpack_require__(51); +var month_view_service_1 = __webpack_require__(73); +var navigation_service_1 = __webpack_require__(166); +var localized_messages_directive_1 = __webpack_require__(339); +var calendar_custom_messages_component_1 = __webpack_require__(162); +var COMPONENT_DIRECTIVES = [ + calendar_component_1.CalendarComponent, + header_component_1.HeaderComponent, + navigation_component_1.NavigationComponent, + month_view_component_1.MonthViewComponent, + month_component_1.MonthComponent, + virtualization_component_1.VirtualizationComponent, + calendar_custom_messages_component_1.CalendarCustomMessagesComponent, + localized_messages_directive_1.LocalizedMessagesDirective +]; +var CALENDAR_PROVIDERS = [ + dom_service_1.DOMService, + month_view_service_1.MonthViewService, + navigation_service_1.NavigationService +]; +/** + * The exported package module. + * + * The package exports: + * - `CalendarComponent`—The Calendar component class. + * - `CellTemplateDirective`—The cell template directive. + * + * @example + * + * ```ts-no-run + * // Import the Calendar module. + * import { CalendarModule } from '@progress/kendo-angular-dateinputs'; + * + * // The browser platform with a compiler. + * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + * + * import { NgModule } from '@angular/core'; + * + * // Import the app component. + * import { AppComponent } from './app.component'; + * + * // Define the app module. + * @@NgModule({ + * declarations: [AppComponent], // declare app component + * imports: [BrowserModule, CalendarModule], // import Calendar module + * bootstrap: [AppComponent] + * }) + * export class AppModule {} + * + * // Compile and launch the module. + * platformBrowserDynamic().bootstrapModule(AppModule); + * + * ``` + */ +var CalendarModule = (function () { + function CalendarModule() { + } + return CalendarModule; +}()); +CalendarModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [COMPONENT_DIRECTIVES], + exports: [COMPONENT_DIRECTIVES, templates_module_1.TemplatesModule], + imports: [common_1.CommonModule, kendo_angular_intl_1.IntlModule, templates_module_1.TemplatesModule], + providers: CALENDAR_PROVIDERS + },] }, +]; +/** @nocollapse */ +CalendarModule.ctorParameters = function () { return []; }; +exports.CalendarModule = CalendarModule; + + +/***/ }), +/* 98 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Used for rendering the cell content of the Calendar. + * + * To define the cell template, nest a `` tag with the `kendoCalendarCellTemplate` directive inside the component tag. + * + * The template context is set to the current component. To get a reference to the current date, use the `let-date` directive. + * To provide more details about the current cell, get a reference to the current `cellContext` by using the `let-cellContext` directive. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * styles: ['.custom { color: red; }'], + * template: ` + * + * + * {{date.getDate()}} + * + * + * ` + * }) + * class AppComponent { } + * ``` + * + * For more examples, refer to the section on [templates]({% slug overview_calendar_kendouiforangular %}#toc-templates). + */ +var CellTemplateDirective = (function () { + function CellTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return CellTemplateDirective; +}()); +CellTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoCalendarCellTemplate]' + },] }, +]; +/** @nocollapse */ +CellTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, }, +]; }; +exports.CellTemplateDirective = CellTemplateDirective; + + +/***/ }), +/* 99 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:component-selector-name component-selector-type */ +var core_1 = __webpack_require__(0); +var dom_service_1 = __webpack_require__(51); +var row_height_service_1 = __webpack_require__(342); +var scroller_service_1 = __webpack_require__(344); +var util_1 = __webpack_require__(18); +var Rx_1 = __webpack_require__(288); +var Observable_1 = __webpack_require__(1); +var Subject_1 = __webpack_require__(8); +__webpack_require__(21); +__webpack_require__(88); +__webpack_require__(289); +__webpack_require__(293); +__webpack_require__(33); +__webpack_require__(34); +__webpack_require__(299); +__webpack_require__(304); +/** + * @hidden + */ +exports.SCROLLER_FACTORY_TOKEN = new core_1.OpaqueToken('calendar-scroll-service-factory'); +/** + * @hidden + */ +function DEFAULT_SCROLLER_FACTORY(observable) { + return new scroller_service_1.ScrollerService(observable); +} +exports.DEFAULT_SCROLLER_FACTORY = DEFAULT_SCROLLER_FACTORY; +/** + * @hidden + */ +var ScrollDirection; +(function (ScrollDirection) { + ScrollDirection[ScrollDirection["Up"] = 0] = "Up"; + ScrollDirection[ScrollDirection["Down"] = 1] = "Down"; +})(ScrollDirection = exports.ScrollDirection || (exports.ScrollDirection = {})); +var FRAME_DURATION = 17; +var scrollModifiers = (_a = {}, + _a[ScrollDirection.Down] = function (step) { return function (value) { return value + step; }; }, + _a[ScrollDirection.Up] = function (step) { return function (value) { return value - step; }; }, + _a); +var scrollNormalizers = (_b = {}, + _b[ScrollDirection.Down] = function (end) { return function (value) { return Math.min(value, end); }; }, + _b[ScrollDirection.Up] = function (end) { return function (value) { return Math.max(value, end); }; }, + _b); +var scrollValidators = (_c = {}, + _c[ScrollDirection.Down] = function (end) { return function (start) { return start < end; }; }, + _c[ScrollDirection.Up] = function (end) { return function (start) { return start > end; }; }, + _c); +var differenceToScroll = function (scrollTop, staticOffset, maxScrollDifference) { + return Math.min(Math.abs(staticOffset - scrollTop), maxScrollDifference); +}; +/** + * @hidden + */ +var VirtualizationComponent = (function () { + function VirtualizationComponent(scrollerFactory, container, dom, renderer, zone) { + this.container = container; + this.dom = dom; + this.renderer = renderer; + this.zone = zone; + this.itemHeight = 1; + this.topOffset = 0; + this.bottomOffset = 0; + this.scrollOffsetHeight = 0; + this.scrollDuration = 150; + this.activeIndexChange = new core_1.EventEmitter(); + this.pageChange = new core_1.EventEmitter(); + this.scrollChange = new core_1.EventEmitter(); + this.dispatcher = new Subject_1.Subject(); + this.scroller = scrollerFactory(this.dispatcher); + } + VirtualizationComponent.prototype.wrapperClasses = function () { + return true; + }; + VirtualizationComponent.prototype.ngOnChanges = function (changes) { + if (changes.take || changes.total) { + this.initServices(); + this.totalHeight = this.getTotalHeight(); + } + }; + VirtualizationComponent.prototype.ngOnInit = function () { + if (!this.rowHeightService) { + this.rowHeightService = this.createRowHeightService(); + } + }; + VirtualizationComponent.prototype.ngAfterViewInit = function () { + var _this = this; + this.zone.runOutsideAngular(function () { + _this.containerScrollSubscription = _this.scroll$() + .map(function (event) { return event.target; }) + .subscribe(function (t) { + _this.dispatcher.next(t); + _this.zone.run(function () { return _this.emitActiveIndex(t); }); + }); + }); + }; + VirtualizationComponent.prototype.ngOnDestroy = function () { + if (this.containerScrollSubscription) { + this.containerScrollSubscription.unsubscribe(); + } + if (this.scrollSubscription) { + this.scrollSubscription.unsubscribe(); + } + }; + VirtualizationComponent.prototype.isIndexVisible = function (index) { + if (!this.rowHeightService) { + return false; + } + var currentScrollTop = this.container.nativeElement.scrollTop; + var top = this.rowHeightService.offset(index); + var bottom = top + this.rowHeightService.height(index); + return currentScrollTop >= top && currentScrollTop <= bottom; + }; + VirtualizationComponent.prototype.scrollTo = function (value) { + this.renderer.setProperty(this.container.nativeElement, 'scrollTop', value); + }; + VirtualizationComponent.prototype.scrollToIndex = function (index) { + this.scrollTo(this.rowHeightService.offset(index)); + }; + VirtualizationComponent.prototype.scrollToBottom = function () { + this.scrollTo(this.totalHeight); + }; + VirtualizationComponent.prototype.animateToIndex = function (index) { + var _this = this; + if (this.animationSubscription) { + this.animationSubscription.unsubscribe(); + } + var indexOffset = this.rowHeightService.offset(index); + var direction = this.getScrollDirection(indexOffset); + var _a = this.scrollRange(indexOffset, direction), start = _a.start, end = _a.end; + var step = this.scrollStep(start, end); + if (start === end) { + return; + } + var modifyScroll = scrollModifiers[direction](step); + var normalizeScroll = scrollNormalizers[direction](end); + var isScrollValid = scrollValidators[direction](modifyScroll(end)); + var animationFrame$ = Observable_1.Observable.interval(0, Rx_1.Scheduler.animationFrame); + this.animationSubscription = Observable_1.Observable.of(start) + .combineLatest(animationFrame$) + .map(function (stream) { return stream[0]; }) + .scan(modifyScroll) + .takeWhile(isScrollValid) + .map(normalizeScroll) + .subscribe(function (x) { return _this.scrollTo(x); }); + }; + VirtualizationComponent.prototype.scrollRange = function (indexOffset, direction) { + var containerElement = this.container.nativeElement; + var sign = direction === ScrollDirection.Up ? 1 : -1; + var max = this.containerMaxScroll(); + var difference = differenceToScroll(containerElement.scrollTop, indexOffset, this.dom.monthViewHeight()); + var end = Math.min(indexOffset, max); + var start = Math.min(Math.max(end + (sign * difference), 0), max); + return { start: start, end: end }; + }; + VirtualizationComponent.prototype.scrollStep = function (start, end) { + return Math.abs(end - start) / (this.scrollDuration / FRAME_DURATION); + }; + VirtualizationComponent.prototype.scroll$ = function () { + return util_1.isDocumentAvailable() ? Observable_1.Observable.fromEvent(this.container.nativeElement, 'scroll') : Observable_1.Observable.empty(); + }; + VirtualizationComponent.prototype.initServices = function () { + var _this = this; + this.rowHeightService = this.createRowHeightService(); + if (this.scrollSubscription) { + this.scrollSubscription.unsubscribe(); + } + this.scrollSubscription = this.scroller + .create(this.rowHeightService, this.skip, this.take, this.total, this.topOffset, this.scrollOffsetHeight) + .subscribe(function (x) { return _this.zone.run(function () { + if (x instanceof scroller_service_1.PageAction) { + _this.pageChange.emit(x); + } + else { + _this.scrollChange.emit(x); + } + }); }); + }; + VirtualizationComponent.prototype.createRowHeightService = function () { + return new row_height_service_1.RowHeightService(this.total, this.itemHeight, 0); + }; + VirtualizationComponent.prototype.getTotalHeight = function () { + return this.rowHeightService.totalHeight() + this.bottomOffset; + }; + VirtualizationComponent.prototype.emitActiveIndex = function (_a) { + var scrollTop = _a.scrollTop; + var index = this.rowHeightService.index(scrollTop - this.topOffset); + if (this.lastActiveIndex !== index) { + this.lastActiveIndex = index; + this.activeIndexChange.emit(index); + } + }; + VirtualizationComponent.prototype.getScrollDirection = function (indexOffset) { + return indexOffset < this.container.nativeElement.scrollTop ? ScrollDirection.Up : ScrollDirection.Down; + }; + VirtualizationComponent.prototype.containerMaxScroll = function () { + var containerElement = this.container.nativeElement; + return containerElement.scrollHeight - containerElement.offsetHeight; + }; + return VirtualizationComponent; +}()); +VirtualizationComponent.decorators = [ + { type: core_1.Component, args: [{ + changeDetection: core_1.ChangeDetectionStrategy.OnPush, + providers: [{ + provide: exports.SCROLLER_FACTORY_TOKEN, + useValue: DEFAULT_SCROLLER_FACTORY + }], + selector: 'kendo-calendar-virtualization', + template: "\n \n \n " + },] }, +]; +/** @nocollapse */ +VirtualizationComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Inject, args: [exports.SCROLLER_FACTORY_TOKEN,] },] }, + { type: core_1.ElementRef, }, + { type: dom_service_1.DOMService, }, + { type: core_1.Renderer2, }, + { type: core_1.NgZone, }, +]; }; +VirtualizationComponent.propDecorators = { + 'itemHeight': [{ type: core_1.Input },], + 'topOffset': [{ type: core_1.Input },], + 'bottomOffset': [{ type: core_1.Input },], + 'scrollOffsetHeight': [{ type: core_1.Input },], + 'scrollDuration': [{ type: core_1.Input },], + 'skip': [{ type: core_1.Input },], + 'take': [{ type: core_1.Input },], + 'total': [{ type: core_1.Input },], + 'activeIndexChange': [{ type: core_1.Output },], + 'pageChange': [{ type: core_1.Output },], + 'scrollChange': [{ type: core_1.Output },], + 'wrapperClasses': [{ type: core_1.HostBinding, args: ['class.k-content',] }, { type: core_1.HostBinding, args: ['class.k-scrollable',] },], +}; +exports.VirtualizationComponent = VirtualizationComponent; +var _a, _b, _c; + + +/***/ }), +/* 100 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var dateinput_component_1 = __webpack_require__(168); +var common_1 = __webpack_require__(9); +var kendo_angular_intl_1 = __webpack_require__(10); +var localized_messages_directive_1 = __webpack_require__(347); +var dateinput_custom_messages_component_1 = __webpack_require__(169); +var COMPONENT_DIRECTIVES = [ + dateinput_component_1.DateInputComponent, + dateinput_custom_messages_component_1.DateInputCustomMessagesComponent, + localized_messages_directive_1.LocalizedMessagesDirective +]; +/** + * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) + * definition for the DateInput component. + */ +var DateInputModule = (function () { + function DateInputModule() { + } + return DateInputModule; +}()); +DateInputModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [COMPONENT_DIRECTIVES], + exports: [COMPONENT_DIRECTIVES], + imports: [common_1.CommonModule, kendo_angular_intl_1.IntlModule] + },] }, +]; +/** @nocollapse */ +DateInputModule.ctorParameters = function () { return []; }; +exports.DateInputModule = DateInputModule; + + +/***/ }), +/* 101 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +exports.maxValidator = function (maxValue) { + return function (control) { + var err = { + maxError: { + maxValue: maxValue, + value: control.value + } + }; + if (!maxValue || !control.value) { + return null; + } + return control.value > maxValue ? err : null; + }; +}; + + +/***/ }), +/* 102 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +exports.minValidator = function (minValue) { + return function (control) { + var err = { + minError: { + minValue: minValue, + value: control.value + } + }; + if (!minValue || !control.value) { + return null; + } + return control.value < minValue ? err : null; + }; +}; + + +/***/ }), +/* 103 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:max-line-length */ +var core_1 = __webpack_require__(0); +/** + * Used for rendering the selected value of the component. It can only be used with the DropDownList. + * + * The template context is set to the current DropDownList. To get a reference to the current data item, use the `let-dataItem` directive. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * {{dataItem}} option + * + * + * ` + * }) + * class AppComponent { + * public listItems: Array = ["Item 1", "Item 2", "Item 3", "Item 4"]; + * } + * ``` + * + * For more examples, refer to the article on [templates]({% slug overview_ddl_kendouiforangular %}#toc-templates). + */ +var ValueTemplateDirective = (function () { + function ValueTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return ValueTemplateDirective; +}()); +ValueTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoDropDownListValueTemplate]' + },] }, +]; +/** @nocollapse */ +ValueTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, }, +]; }; +exports.ValueTemplateDirective = ValueTemplateDirective; + + +/***/ }), +/* 104 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the column footer cell template of the Kendo ExcelExport column component. + * + * It helps to customize the footer cell for the column. + */ +var FooterTemplateDirective = (function () { + function FooterTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return FooterTemplateDirective; +}()); +FooterTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoExcelExportFooterTemplate]' + },] }, +]; +/** @nocollapse */ +FooterTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.FooterTemplateDirective = FooterTemplateDirective; + + +/***/ }), +/* 105 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the column group footer cell template of the ExcelExport column component. + * + * It helps to customize the group footer cell for the column. + */ +var GroupFooterTemplateDirective = (function () { + function GroupFooterTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return GroupFooterTemplateDirective; +}()); +GroupFooterTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoExcelExportGroupFooterTemplate]' + },] }, +]; +/** @nocollapse */ +GroupFooterTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.GroupFooterTemplateDirective = GroupFooterTemplateDirective; + + +/***/ }), +/* 106 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the group header cell template of the ExcelExport column component. + * + * It helps to customize the content of the group header item. + */ +var GroupHeaderTemplateDirective = (function () { + function GroupHeaderTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return GroupHeaderTemplateDirective; +}()); +GroupHeaderTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoExcelExportGroupHeaderTemplate]' + },] }, +]; +/** @nocollapse */ +GroupHeaderTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.GroupHeaderTemplateDirective = GroupHeaderTemplateDirective; + + +/***/ }), +/* 107 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +__webpack_require__(90); +/** + * @hidden + */ +var ChangeNotificationService = (function () { + function ChangeNotificationService(ngZone) { + this.ngZone = ngZone; + this.changes = new core_1.EventEmitter(); + } + ChangeNotificationService.prototype.notify = function () { + var _this = this; + if (!this.subscription || this.subscription.closed) { + this.subscription = this.ngZone.onStable + .take(1) + .subscribe(function () { return _this.changes.emit(); }); + } + }; + return ChangeNotificationService; +}()); +ChangeNotificationService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +ChangeNotificationService.ctorParameters = function () { return [ + { type: core_1.NgZone, }, +]; }; +exports.ChangeNotificationService = ChangeNotificationService; + + +/***/ }), +/* 108 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the detail template of the Grid. + * Provides additional details about a particular data row by expanding or collapsing its content. + * The detail template does not work with locked columns and requires you to set the `detailRowHeight` option for virtual scrolling. + * + * To define the detail template, nest an `` tag with the `kendoGridDetailTemplate` directive inside a `` tag. + * The template context is set to the current data item and the following additional fields are passed: + * - `dataItem`—Defines the current data item. + * - `rowIndex`—Defines the current row index. + * + *   + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * + * + *
+ *
{{dataItem.Category?.CategoryName}}
+ * {{dataItem.Category?.Description}} + *
+ *
+ *
+ * ` + * }) + * + * class AppComponent { + * public data = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false, + * "Category": { + * "CategoryID": 1, + * "CategoryName": "Beverages", + * "Description": "Soft drinks, coffees, teas, beers, and ales" + * } + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false, + * "Category": { + * "CategoryID": 1, + * "CategoryName": "Beverages", + * "Description": "Soft drinks, coffees, teas, beers, and ales" + * } + * }, { + * "ProductID": 3, + * "ProductName": "Aniseed Syrup", + * "UnitPrice": 10.0000, + * "Discontinued": false, + * "Category": { + * "CategoryID": 2, + * "CategoryName": "Condiments", + * "Description": "Sweet and savory sauces, relishes, spreads, and seasonings" + * } + * }]; + * + * } + * + * ``` + * + *   + * + * To indicate if a detail row should be displayed, specify the + * [`DetailTemplateShowIfFn`]({% slug api_grid_detailtemplateshowiffn_kendouiforangular %}) setting. + * + * ```ts-no-run + *
+ * + *
+ * ``` + * + * The following example demonstrates how to use `DetailTemplateShowIfFn` with the `` element. + * + * ```ts-no-run + * + * + * + * ``` + *   + * + * @example + * ```ts + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * + * + *
+ *
{{dataItem.Category?.CategoryName}}
+ * {{dataItem.Category?.Description}} + *
+ *
+ *
+ * ` + * }) + * class AppComponent { + * public data = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false, + * "Category": { + * "CategoryID": 1, + * "CategoryName": "Beverages", + * "Description": "Soft drinks, coffees, teas, beers, and ales" + * } + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false, + * "Category": { + * "CategoryID": 1, + * "CategoryName": "Beverages", + * "Description": "Soft drinks, coffees, teas, beers, and ales" + * } + * }, { + * "ProductID": 3, + * "ProductName": "Aniseed Syrup", + * "UnitPrice": 10.0000, + * "Discontinued": false, + * "Category": { + * "CategoryID": 2, + * "CategoryName": "Condiments", + * "Description": "Sweet and savory sauces, relishes, spreads, and seasonings" + * } + * }]; + * + * public showOnlyBeveragesDetails(dataItem: any, index: number): boolean { + * return dataItem.Category.CategoryID === 1; + * } + * } + * + * ``` + * + */ +var DetailTemplateDirective = (function () { + function DetailTemplateDirective(templateRef) { + this.templateRef = templateRef; + this._condition = function () { return true; }; + } + Object.defineProperty(DetailTemplateDirective.prototype, "showIf", { + get: function () { + return this._condition; + }, + /** + * Defines the function that indicates if a given detail row and the associated **Expand** or **Collapse** button will be shown. + */ + set: function (fn) { + if (typeof fn !== 'function') { + throw new Error("showIf must be a function, but received " + JSON.stringify(fn) + "."); + } + this._condition = fn; + }, + enumerable: true, + configurable: true + }); + return DetailTemplateDirective; +}()); +DetailTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridDetailTemplate]' + },] }, +]; +/** @nocollapse */ +DetailTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +DetailTemplateDirective.propDecorators = { + 'showIf': [{ type: core_1.Input, args: ["kendoGridDetailTemplateShowIf",] },], +}; +exports.DetailTemplateDirective = DetailTemplateDirective; + + +/***/ }), +/* 109 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var expand_state_service_1 = __webpack_require__(203); +/** + * @hidden + */ +var DetailsService = (function (_super) { + __extends(DetailsService, _super); + function DetailsService() { + return _super !== null && _super.apply(this, arguments) || this; + } + return DetailsService; +}(expand_state_service_1.ExpandStateService)); +DetailsService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +DetailsService.ctorParameters = function () { return []; }; +exports.DetailsService = DetailsService; + + +/***/ }), +/* 110 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_draggable_1 = __webpack_require__(281); +__webpack_require__(295); +/** + * @hidden + */ +var DraggableDirective = (function () { + function DraggableDirective(element) { + var _this = this; + this.kendo = { + drag: new core_1.EventEmitter(), + press: new core_1.EventEmitter(), + release: new core_1.EventEmitter() + }; + if (typeof document !== 'undefined') { + this.draggable = new kendo_draggable_1.default({ + drag: function (e) { return _this.kendo.drag.delay(50).next(Object.assign({}, e, { column: _this.column })); }, + press: function (e) { return _this.kendo.press.next(Object.assign({}, e, { column: _this.column })); }, + release: function (e) { return _this.kendo.release.next(Object.assign({}, e, { column: _this.column })); } + }); + this.draggable.bindTo(element.nativeElement); + } + } + Object.defineProperty(DraggableDirective.prototype, "kendoGridDraggable", { + set: function (column) { + this.column = column; + }, + enumerable: true, + configurable: true + }); + DraggableDirective.prototype.ngOnDestroy = function () { + if (typeof document !== 'undefined') { + this.draggable.destroy(); + } + }; + return DraggableDirective; +}()); +DraggableDirective.decorators = [ + { type: core_1.Directive, args: [{ + outputs: ['kendo.press', 'kendo.drag', 'kendo.release'], + selector: '[kendoGridDraggable]' + },] }, +]; +/** @nocollapse */ +DraggableDirective.ctorParameters = function () { return [ + { type: core_1.ElementRef, }, +]; }; +DraggableDirective.propDecorators = { + 'kendoGridDraggable': [{ type: core_1.Input },], +}; +exports.DraggableDirective = DraggableDirective; + + +/***/ }), +/* 111 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the column edit cell template of the Grid. + * It helps to customize the content of the edited cells. + * + * To define the cell template, nest a `` tag with the `kendoGridEditTemplate` directive + * inside a `` tag. + * + * The template context contains the following fields: + * - `formGroup`—The current [`FormGroup`](https://angular.io/docs/ts/latest/api/forms/index/FormGroup-class.html). + * If you use the Grid inside [Template-Driven Forms](https://angular.io/docs/ts/latest/guide/forms.html), it will be `undefined`. + * - `rowIndex`—The current row index. If inside a new item row, it is `-1`. + * - `dataItem`—The current data item. + * - `column`—The current column instance. + * - `isNew`—The state of the current item. + */ +var EditTemplateDirective = (function () { + function EditTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return EditTemplateDirective; +}()); +EditTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridEditTemplate]' + },] }, +]; +/** @nocollapse */ +EditTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.EditTemplateDirective = EditTemplateDirective; + + +/***/ }), +/* 112 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +var ExcelService = (function () { + function ExcelService() { + this.saveToExcel = new core_1.EventEmitter(); + this.exportClick = new core_1.EventEmitter(); + } + ExcelService.prototype.save = function (component) { + if (this.saveToExcel.observers.length === 0) { + if (core_1.isDevMode()) { + throw new Error('Saving excel requires including the ExcelModule and adding the component.'); + } + } + else { + this.saveToExcel.emit(component); + } + }; + return ExcelService; +}()); +ExcelService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +ExcelService.ctorParameters = function () { return []; }; +exports.ExcelService = ExcelService; + + +/***/ }), +/* 113 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// tslint:disable:no-access-missing-member +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_service_1 = __webpack_require__(26); +var base_filter_cell_component_1 = __webpack_require__(31); +var kendo_angular_l10n_1 = __webpack_require__(2); +var utils_1 = __webpack_require__(7); +var dateOperators = base_filter_cell_component_1.localizeOperators({ + "filterEqOperator": "eq", + "filterNotEqOperator": "neq", + // tslint:disable-next-line:object-literal-sort-keys + "filterAfterOrEqualOperator": "gte", + "filterAfterOperator": "gt", + "filterBeforeOrEqualOperator": "lte", + "filterBeforeOperator": "lt", + "filterIsNullOperator": "isnull", + "filterIsNotNullOperator": "isnotnull" +}); +/** + * Represents a date filter-cell component. + * + * @example + * + * ```ts-no-run + * + * + * + * + * + * + * ``` + */ +var DateFilterCellComponent = (function (_super) { + __extends(DateFilterCellComponent, _super); + function DateFilterCellComponent(filterService, localization) { + var _this = _super.call(this, filterService) || this; + _this.localization = localization; + /** + * Determines if the drop-down filter operators should be shown. The default value is `true`. + * @type {boolean} + */ + _this.showOperators = true; + /** + * The default filter operator. Defaults to `contains`. + * @type {string} + */ + _this.operator = "gte"; + _this.defaultOperators = dateOperators(_this.localization); + return _this; + } + Object.defineProperty(DateFilterCellComponent.prototype, "currentFilter", { + /** + * The current filter for the associated column field. + * @readonly + * @type {FilterDescriptor} + */ + get: function () { + return this.filterByField(this.column.field); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateFilterCellComponent.prototype, "format", { + /** + * Specifies the date format used when the component is not focused. + * By default, the `column.format` value is used, if set. + * + * @readonly + * @type {string} + */ + get: function () { + return !utils_1.isNullOrEmptyString(this._format) ? this._format : this.columnFormat; + }, + /** + * Specifies the date format used when the component is not focused. + * By default, the `column.format` value is used, if set. + */ + set: function (value) { + this._format = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateFilterCellComponent.prototype, "columnFormat", { + get: function () { + return this.column && !utils_1.isNullOrEmptyString(this.column.format) ? + utils_1.extractFormat(this.column.format) : "d"; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateFilterCellComponent.prototype, "currentOperator", { + /** + * The current filter operator for the associated column field. + * @readonly + * @type {string} + */ + get: function () { + return this.currentFilter ? this.currentFilter.operator : this.operator; + }, + enumerable: true, + configurable: true + }); + return DateFilterCellComponent; +}(base_filter_cell_component_1.BaseFilterCellComponent)); +DateFilterCellComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-grid-date-filter-cell', + template: "\n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +DateFilterCellComponent.ctorParameters = function () { return [ + { type: filter_service_1.FilterService, }, + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +DateFilterCellComponent.propDecorators = { + 'showOperators': [{ type: core_1.Input },], + 'column': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], + 'operator': [{ type: core_1.Input },], + 'format': [{ type: core_1.Input },], + 'min': [{ type: core_1.Input },], + 'max': [{ type: core_1.Input },], +}; +exports.DateFilterCellComponent = DateFilterCellComponent; + + +/***/ }), +/* 114 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the filter-cell template. + */ +var FilterCellTemplateDirective = (function () { + function FilterCellTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return FilterCellTemplateDirective; +}()); +FilterCellTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridFilterCellTemplate]' + },] }, +]; +/** @nocollapse */ +FilterCellTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.FilterCellTemplateDirective = FilterCellTemplateDirective; + + +/***/ }), +/* 115 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var common_1 = __webpack_require__(9); +var forms_1 = __webpack_require__(12); +var kendo_angular_dropdowns_1 = __webpack_require__(352); +var kendo_angular_inputs_1 = __webpack_require__(251); +var kendo_angular_dateinputs_1 = __webpack_require__(175); +var filter_row_component_1 = __webpack_require__(370); +var filter_cell_component_1 = __webpack_require__(206); +var filter_cell_template_directive_1 = __webpack_require__(114); +var numeric_filter_cell_component_1 = __webpack_require__(116); +var filter_input_directive_1 = __webpack_require__(207); +var filter_cell_wrapper_component_1 = __webpack_require__(368); +var string_filter_cell_component_1 = __webpack_require__(77); +var filter_cell_operators_component_1 = __webpack_require__(367); +var filter_host_directive_1 = __webpack_require__(369); +var autocomplete_filter_cell_component_1 = __webpack_require__(204); +var boolean_filter_cell_component_1 = __webpack_require__(205); +var date_filter_cell_component_1 = __webpack_require__(113); +var contains_filter_operator_component_1 = __webpack_require__(208); +var not_contains_filter_operator_component_1 = __webpack_require__(220); +var ends_with_filter_operator_component_1 = __webpack_require__(209); +var eq_filter_operator_component_1 = __webpack_require__(210); +var is_empty_filter_operator_component_1 = __webpack_require__(213); +var is_not_empty_filter_operator_component_1 = __webpack_require__(214); +var is_not_null_filter_operator_component_1 = __webpack_require__(215); +var isnull_filter_operator_component_1 = __webpack_require__(216); +var neq_filter_operator_component_1 = __webpack_require__(219); +var starts_with_filter_operator_component_1 = __webpack_require__(221); +var gt_filter_operator_component_1 = __webpack_require__(211); +var gte_filter_operator_component_1 = __webpack_require__(212); +var lt_filter_operator_component_1 = __webpack_require__(217); +var lte_filter_operator_component_1 = __webpack_require__(218); +var FILTER_OPERATORS = [ + filter_cell_operators_component_1.FilterCellOperatorsComponent, + contains_filter_operator_component_1.ContainsFilterOperatorComponent, + not_contains_filter_operator_component_1.DoesNotContainFilterOperatorComponent, + ends_with_filter_operator_component_1.EndsWithFilterOperatorComponent, + eq_filter_operator_component_1.EqualFilterOperatorComponent, + is_empty_filter_operator_component_1.IsEmptyFilterOperatorComponent, + is_not_empty_filter_operator_component_1.IsNotEmptyFilterOperatorComponent, + is_not_null_filter_operator_component_1.IsNotNullFilterOperatorComponent, + isnull_filter_operator_component_1.IsNullFilterOperatorComponent, + neq_filter_operator_component_1.NotEqualFilterOperatorComponent, + starts_with_filter_operator_component_1.StartsWithFilterOperatorComponent, + gt_filter_operator_component_1.GreaterFilterOperatorComponent, + gte_filter_operator_component_1.GreaterOrEqualToFilterOperatorComponent, + lt_filter_operator_component_1.LessFilterOperatorComponent, + lte_filter_operator_component_1.LessOrEqualToFilterOperatorComponent +]; +var INTERNAL_COMPONENTS = [ + filter_row_component_1.FilterRowComponent, + filter_cell_component_1.FilterCellComponent, + filter_cell_template_directive_1.FilterCellTemplateDirective, + filter_cell_operators_component_1.FilterCellOperatorsComponent, + string_filter_cell_component_1.StringFilterCellComponent, + numeric_filter_cell_component_1.NumericFilterCellComponent, + autocomplete_filter_cell_component_1.AutoCompleteFilterCellComponent, + boolean_filter_cell_component_1.BooleanFilterCellComponent, + filter_host_directive_1.FilterHostDirective, + filter_cell_wrapper_component_1.FilterCellWrapperComponent, + filter_input_directive_1.FilterInputDirective, + date_filter_cell_component_1.DateFilterCellComponent +]; +var importedModules = [ + common_1.CommonModule, + forms_1.ReactiveFormsModule, + forms_1.FormsModule, + kendo_angular_dropdowns_1.DropDownListModule, + kendo_angular_dropdowns_1.AutoCompleteModule, + kendo_angular_inputs_1.InputsModule, + kendo_angular_dateinputs_1.DatePickerModule +]; +var ENTRY_COMPONENTS = [ + string_filter_cell_component_1.StringFilterCellComponent, + numeric_filter_cell_component_1.NumericFilterCellComponent, + boolean_filter_cell_component_1.BooleanFilterCellComponent, + date_filter_cell_component_1.DateFilterCellComponent +]; +/** + * @hidden + */ +var RowFilterModule = (function () { + function RowFilterModule() { + } + RowFilterModule.exports = function () { + return [ + filter_row_component_1.FilterRowComponent, + filter_cell_component_1.FilterCellComponent, + filter_cell_template_directive_1.FilterCellTemplateDirective, + filter_cell_operators_component_1.FilterCellOperatorsComponent, + string_filter_cell_component_1.StringFilterCellComponent, + numeric_filter_cell_component_1.NumericFilterCellComponent, + autocomplete_filter_cell_component_1.AutoCompleteFilterCellComponent, + boolean_filter_cell_component_1.BooleanFilterCellComponent, + date_filter_cell_component_1.DateFilterCellComponent + ].concat(FILTER_OPERATORS); + }; + return RowFilterModule; +}()); +RowFilterModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [INTERNAL_COMPONENTS, FILTER_OPERATORS], + entryComponents: ENTRY_COMPONENTS, + exports: [INTERNAL_COMPONENTS, FILTER_OPERATORS], + imports: importedModules.slice() + },] }, +]; +/** @nocollapse */ +RowFilterModule.ctorParameters = function () { return []; }; +exports.RowFilterModule = RowFilterModule; + + +/***/ }), +/* 116 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// tslint:disable:no-access-missing-member +var core_1 = __webpack_require__(0); +var filter_service_1 = __webpack_require__(26); +var base_filter_cell_component_1 = __webpack_require__(31); +var kendo_angular_l10n_1 = __webpack_require__(2); +var utils_1 = __webpack_require__(7); +var numericOperators = base_filter_cell_component_1.localizeOperators({ + "filterEqOperator": "eq", + "filterNotEqOperator": "neq", + // tslint:disable-next-line:object-literal-sort-keys + "filterGteOperator": "gte", + "filterGtOperator": "gt", + "filterLteOperator": "lte", + "filterLtOperator": "lt", + "filterIsNullOperator": "isnull", + "filterIsNotNullOperator": "isnotnull" +}); +/** + * Represents a numeric filter cell. + * + * @example + * ```ts-no-run + * + * + * + * + * + * + * ``` + */ +var NumericFilterCellComponent = (function (_super) { + __extends(NumericFilterCellComponent, _super); + function NumericFilterCellComponent(filterService, localization) { + var _this = _super.call(this, filterService) || this; + _this.localization = localization; + /** + * Determines if the drop-down filter operators should be shown. The default value is `true`. + * @type {boolean} + */ + _this.showOperators = true; + /** + * The default filter operator. Defaults to `eq`. + * @type {string} + */ + _this.operator = "eq"; + /** + * Specifies the value used to increment or decrement the component value. + * @type {numeric} + */ + _this.step = 1; + /** + * Specifies whether the **Up** and **Down** spin buttons should be rendered. + * @type {boolean} + */ + _this.spinners = true; + _this.defaultOperators = numericOperators(_this.localization); + return _this; + } + Object.defineProperty(NumericFilterCellComponent.prototype, "format", { + /** + * Specifies the number format used when the component is not focused. + * By default, the `column.format` value is used, if set. + * + * @readonly + * @type {string} + */ + get: function () { + return !utils_1.isNullOrEmptyString(this._format) ? this._format : this.columnFormat; + }, + /** + * Specifies the number format used when the component is not focused. + * By default, the `column.format` value is used, if set. + */ + set: function (value) { + this._format = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NumericFilterCellComponent.prototype, "currentFilter", { + /** + * The current filter for the associated column field. + * @readonly + * @type {FilterDescriptor} + */ + get: function () { + return this.filterByField(this.column.field); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NumericFilterCellComponent.prototype, "currentOperator", { + /** + * The current filter operator for the associated column field. + * @readonly + * @type {string} + */ + get: function () { + return this.currentFilter ? this.currentFilter.operator : this.operator; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NumericFilterCellComponent.prototype, "columnFormat", { + get: function () { + return this.column && !utils_1.isNullOrEmptyString(this.column.format) ? + utils_1.extractFormat(this.column.format) : "n2"; + }, + enumerable: true, + configurable: true + }); + return NumericFilterCellComponent; +}(base_filter_cell_component_1.BaseFilterCellComponent)); +NumericFilterCellComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-grid-numeric-filter-cell', + template: "\n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +NumericFilterCellComponent.ctorParameters = function () { return [ + { type: filter_service_1.FilterService, }, + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +NumericFilterCellComponent.propDecorators = { + 'showOperators': [{ type: core_1.Input },], + 'column': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], + 'operator': [{ type: core_1.Input },], + 'step': [{ type: core_1.Input },], + 'min': [{ type: core_1.Input },], + 'max': [{ type: core_1.Input },], + 'spinners': [{ type: core_1.Input },], + 'decimals': [{ type: core_1.Input },], + 'format': [{ type: core_1.Input },], +}; +exports.NumericFilterCellComponent = NumericFilterCellComponent; + + +/***/ }), +/* 117 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the column footer cell template of the Grid. + * It helps to customize the table footer cell for the column. + * + * To define the footer template, nest a `` tag with the `kendoGridFooterTemplate` directive + * inside a `` tag. + * + * The template context is set to the current column and the following additional fields are passed: + * - `column`—Defines an instance of the `ColumnComponent` option. + * - `columnIndex`—Defines the current column index. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * {{column.field}}({{columnIndex}}) + * + * + * + * + * {{column.field}}({{columnIndex}}) + * + * + * + * ` + * }) + * + * class AppComponent { + * public gridData = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": true + * } + * ]; + * } + * + * ``` + */ +var FooterTemplateDirective = (function () { + function FooterTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return FooterTemplateDirective; +}()); +FooterTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridFooterTemplate]' + },] }, +]; +/** @nocollapse */ +FooterTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.FooterTemplateDirective = FooterTemplateDirective; + + +/***/ }), +/* 118 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var utils_1 = __webpack_require__(7); +var Observable_1 = __webpack_require__(1); +__webpack_require__(144); +__webpack_require__(67); +__webpack_require__(21); +__webpack_require__(90); +__webpack_require__(91); +__webpack_require__(303); +__webpack_require__(148); +__webpack_require__(300); +var getDocument = function (el) { return el.ownerDocument.documentElement; }; +var getWindow = function (el) { return el.ownerDocument.defaultView; }; +var hasClass = function (className, el) { return new RegExp("(^| )" + className + "( |$)").test(el.className); }; +var isDeleteButton = function (el) { return hasClass("k-i-group-delete", el) || hasClass("k-button-icon", el); }; +var scrollPosition = function (element) { + var documentElement = getDocument(element); + var win = getWindow(element); + return { + x: win.pageXOffset || documentElement.scrollLeft || 0, + y: win.pageYOffset || documentElement.scrollTop || 0 + }; +}; +var isOutside = function (target, _a) { + var pageX = _a.pageX, pageY = _a.pageY; + var _b = target.getBoundingClientRect(), right = _b.right, left = _b.left, top = _b.top, bottom = _b.bottom; + var _c = scrollPosition(target), x = _c.x, y = _c.y; + return !(pageX > left + x && pageX < right + x && pageY > top + y && pageY < bottom + y); +}; +var preventDefault = function (e) { return e.originalEvent.preventDefault(); }; +var createDropCue = function (container) { + var cue = document.createElement("div"); + cue.className = "k-grouping-dropclue"; + cue.style.display = "none"; + container.appendChild(cue); + return { + hide: function () { return cue.style.display = "none"; }, + position: function (element, e, idx, isLast) { + var left = element.offsetLeft - cue.offsetWidth; + if (isLast && e.pageX > element.offsetLeft + element.offsetWidth / 2) { + left = element.offsetLeft + element.offsetWidth; + idx += 1; + } + cue.style.top = element.offsetTop + "px"; + cue.style.left = left + "px"; + cue.style.display = ""; + return idx; + }, + remove: function () { return container.removeChild(cue); } + }; +}; +/** + * @hidden + */ +var GroupConnectionService = (function () { + function GroupConnectionService() { + this.change = new core_1.EventEmitter(); + } + GroupConnectionService.prototype.register = function (target) { + if (utils_1.isPresent(target)) { + this.target = target; + this.cue = createDropCue(target); + } + return this.change.asObservable(); + }; + GroupConnectionService.prototype.isOutside = function (e) { + return isOutside(this.target, e); + }; + GroupConnectionService.prototype.showCue = function (e) { + var item = this.items.filter(function (x) { return !isOutside(x, e); })[0]; + if (item) { + var index = this.items.indexOf(item); + this.currentIndex = this.cue.position(item, e, index, index === this.items.length - 1); + } + else { + this.cue.hide(); + this.currentIndex = 0; + } + }; + GroupConnectionService.prototype.registerItems = function (items) { + this.items = items; + }; + GroupConnectionService.prototype.add = function (field, idx) { + if (idx === void 0) { idx = this.currentIndex; } + if (!utils_1.isNullOrEmptyString(field)) { + this.change.emit({ field: field, idx: idx }); + } + }; + GroupConnectionService.prototype.hideCue = function () { + if (utils_1.isPresent(this.cue)) { + this.cue.hide(); + } + }; + return GroupConnectionService; +}()); +GroupConnectionService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +GroupConnectionService.ctorParameters = function () { return []; }; +exports.GroupConnectionService = GroupConnectionService; +var append = function (element) { + var appended = false; + return function () { + if (!appended) { + document.body.appendChild(element); + appended = true; + } + return element; + }; +}; +var createHint = function (column) { + var hint = document.createElement("div"); + hint.className = "k-header k-drag-clue"; + hint.style.cssText = "display:none;position:absolute;"; + hint.innerHTML = "" + (column.title || column.field); + var getElement = append(hint); + return { + move: function (e) { + preventDefault(e); + var element = getElement(); + element.style.top = e.pageY + "px"; + element.style.left = e.pageX + "px"; + element.style.display = ""; + return function () { return document.body.removeChild(hint); }; + } + }; +}; +/** + * @hidden + */ +var GroupDragService = (function () { + function GroupDragService(connection, ngzone) { + this.connection = connection; + this.ngzone = ngzone; + this.subscriptions = []; + } + GroupDragService.prototype.connect = function (draggables, filter) { + var _this = this; + if (filter === void 0) { filter = function () { return true; }; } + this.ngzone.runOutsideAngular(function () { + _this.unsubscribe(); + _this.subscriptions = draggables.map(function (draggable) { + var presses = Observable_1.Observable.from(draggable.kendo.press); + var drags = Observable_1.Observable.from(draggable.kendo.drag); + var releases = Observable_1.Observable.from(draggable.kendo.release); + return presses + .filter(function (_a) { + var target = _a.originalEvent.target; + return !isDeleteButton(target); + }) + .filter(filter) + .do(preventDefault) + .switchMap(function (_a) { + var column = _a.column; + return drags + .filter(filter) + .do(function (e) { return _this.connection.showCue(e); }) + .map(createHint(column).move); + }) + .switchMap(function (removeHint) { return releases.take(1).do(function () { + removeHint(); + _this.connection.hideCue(); + }); }) + .filter(function (e) { return !_this.connection.isOutside(e); }) + .subscribe(function () { return _this.connection.add(draggable.column.field); }); + }); + }); + }; + GroupDragService.prototype.unsubscribe = function () { + (this.subscriptions || []).forEach(function (x) { return x.unsubscribe(); }); + this.subscriptions = []; + }; + return GroupDragService; +}()); +GroupDragService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +GroupDragService.ctorParameters = function () { return [ + { type: GroupConnectionService, }, + { type: core_1.NgZone, }, +]; }; +exports.GroupDragService = GroupDragService; + + +/***/ }), +/* 119 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the column group footer cell template of the Grid which helps to customize the group footer cell for the column. + * + * To define the group footer template, nest a `` tag with + * the `kendoGridGroupFooterTemplate` directive inside ``. + * + * The template context is set to the current aggregates and the following additional fields are passed: + * - `column`—Defines an instance of the `ColumnComponent` option. + * - `field`—The current column field name. + * - `group`—The current group data item. + * + * @example + * ```ts-preview + * import { process } from '@progress/kendo-data-query'; + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * Count: {{aggregates[field].count}} + * + * + * + * ` + * }) + * + * class AppComponent { + * public groups = [{ field: "ProductName", aggregates: [{ field: "ProductName", aggregate: "count" }] }]; + * + * public gridData = process([{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": true + * } + * ], { + * group: this.groups + * }); + * } + * ``` + */ +var GroupFooterTemplateDirective = (function () { + function GroupFooterTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return GroupFooterTemplateDirective; +}()); +GroupFooterTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridGroupFooterTemplate]' + },] }, +]; +/** @nocollapse */ +GroupFooterTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.GroupFooterTemplateDirective = GroupFooterTemplateDirective; + + +/***/ }), +/* 120 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the group header cell template of the Grid which helps to customize the content of the group header item. + * + * To define the group header template, nest a `` tag with + * the `kendoGridGroupHeaderTemplate` directive inside ``. + * + * The template context is set to the current data item and the following additional fields are passed: + * - `group`—The current group item. + * - `field`—The name of the field by which data is grouped. + * - `value`—The current group value. + * - `aggregates`—All aggregate values for the current group. + * + * @example + * ```ts-preview + * import { process } from '@progress/kendo-data-query'; + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * {{field}}: {{value}} + * + * + * + * ` + * }) + * + * class AppComponent { + * public groups = [{ field: "ProductName" }]; + * + * public gridData = process([{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": true + * } + * ], { + * group: this.groups + * }); + * } + * + * ``` + */ +var GroupHeaderTemplateDirective = (function () { + function GroupHeaderTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return GroupHeaderTemplateDirective; +}()); +GroupHeaderTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridGroupHeaderTemplate]' + },] }, +]; +/** @nocollapse */ +GroupHeaderTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.GroupHeaderTemplateDirective = GroupHeaderTemplateDirective; + + +/***/ }), +/* 121 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var column_component_1 = __webpack_require__(30); +var column_list_1 = __webpack_require__(198); +var column_common_1 = __webpack_require__(22); +/** + * @hidden + */ +var GroupInfoService = (function () { + function GroupInfoService() { + this._columnList = column_list_1.ColumnList.empty; + } + Object.defineProperty(GroupInfoService.prototype, "columns", { + get: function () { + return column_common_1.expandColumns(this._columnList().toArray()).filter(column_component_1.isColumnComponent); + }, + enumerable: true, + configurable: true + }); + GroupInfoService.prototype.registerColumnsContainer = function (columns) { + this._columnList = columns; + }; + GroupInfoService.prototype.formatForGroup = function (item) { + var column = this.columnForGroup(item); + return column ? column.format : ""; + }; + GroupInfoService.prototype.groupTitle = function (item) { + var column = this.columnForGroup(item); + return column ? (column.title || column.field) : this.groupField(item); + }; + GroupInfoService.prototype.groupHeaderTemplate = function (item) { + var column = this.columnForGroup(item); + return column ? column.groupHeaderTemplateRef : undefined; + }; + GroupInfoService.prototype.groupField = function (group) { + return group.data ? group.data.field : group.field; + }; + GroupInfoService.prototype.columnForGroup = function (group) { + var field = this.groupField(group); + var column = this.columns.filter(function (x) { return x.field === field; })[0]; + return column; + }; + return GroupInfoService; +}()); +exports.GroupInfoService = GroupInfoService; + + +/***/ }), +/* 122 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the column header cell template of the Grid. + * It helps to customize the table header cell for the column. + * + * To define a header template, nest a `` tag with the `kendoGridHeaderTemplate` directive inside ``. + * The template context is set to the current column and the following additional fields are passed: + * - `column`—Defines an instance of the `ColumnComponent` option. + * - `columnIndex`—Defines the current column index. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * {{column.field}}({{columnIndex}}) + * + * + * + * + * {{column.field}}({{columnIndex}}) + * + * + * + * ` + * }) + * + * class AppComponent { + * public gridData = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": true + * } + * ]; + * } + * + * ``` + */ +var HeaderTemplateDirective = (function () { + function HeaderTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return HeaderTemplateDirective; +}()); +HeaderTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridHeaderTemplate]' + },] }, +]; +/** @nocollapse */ +HeaderTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.HeaderTemplateDirective = HeaderTemplateDirective; + + +/***/ }), +/* 123 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var Observable_1 = __webpack_require__(1); +var Subject_1 = __webpack_require__(8); +__webpack_require__(21); +__webpack_require__(34); +__webpack_require__(47); +__webpack_require__(33); +__webpack_require__(147); +__webpack_require__(148); +__webpack_require__(146); +__webpack_require__(294); +var kendo_angular_l10n_1 = __webpack_require__(2); +var row_height_service_1 = __webpack_require__(384); +var scroller_service_1 = __webpack_require__(386); +var utils_1 = __webpack_require__(7); +var details_service_1 = __webpack_require__(109); +var columns_container_1 = __webpack_require__(199); +var change_notification_service_1 = __webpack_require__(107); +var row_sync_1 = __webpack_require__(242); +var suspend_service_1 = __webpack_require__(128); +var groups_service_1 = __webpack_require__(79); +var column_common_1 = __webpack_require__(22); +var scroll_sync_service_1 = __webpack_require__(243); +/** + * @hidden + */ +exports.SCROLLER_FACTORY_TOKEN = new core_1.OpaqueToken('grid-scroll-service-factory'); +/** + * @hidden + */ +function DEFAULT_SCROLLER_FACTORY(observable) { + return new scroller_service_1.ScrollerService(observable); +} +exports.DEFAULT_SCROLLER_FACTORY = DEFAULT_SCROLLER_FACTORY; +var wheelDeltaY = function (e) { + var deltaY = e.wheelDeltaY; + if (e.wheelDelta && (deltaY === undefined || deltaY)) { + return e.wheelDelta; + } + else if (e.detail && e.axis === e.VERTICAL_AXIS) { + return (-e.detail) * 10; + } + return 0; +}; +var preventLockedScroll = function (el) { return function (event) { + if (el.scrollHeight > el.offsetHeight + el.scrollTop && el.scrollTop > 0) { + event.preventDefault(); + } +}; }; +var translateY = function (renderer, value) { return function (el) { return renderer.setStyle(el, "transform", "translateY(" + value + "px)"); }; }; +var firstChild = function (el) { return el ? el.nativeElement.children[0] : null; }; +/** + * @hidden + */ +var ListComponent = (function () { + function ListComponent(scrollerFactory, detailsService, changeNotification, suspendService, rtl, groupsService, ngZone, renderer, scrollSyncService) { + if (rtl === void 0) { rtl = false; } + var _this = this; + this.changeNotification = changeNotification; + this.suspendService = suspendService; + this.rtl = rtl; + this.groupsService = groupsService; + this.ngZone = ngZone; + this.renderer = renderer; + this.scrollSyncService = scrollSyncService; + this.groups = []; + this.skip = 0; + this.columns = new columns_container_1.ColumnsContainer(function () { return []; }); + this.groupable = false; + this.pageChange = new core_1.EventEmitter(); + this.dispatcher = new Subject_1.Subject(); + this.scroller = scrollerFactory(this.dispatcher); + this.subscriptions = detailsService.changes.subscribe(function (x) { return _this.detailExpand(x); }); + } + Object.defineProperty(ListComponent.prototype, "hostClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ListComponent.prototype, "showFooter", { + get: function () { + return this.groupable && this.groupable.showFooter; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ListComponent.prototype, "lockedLeafColumns", { + get: function () { + return this.columns.lockedLeafColumns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ListComponent.prototype, "nonLockedLeafColumns", { + get: function () { + return this.columns.nonLockedLeafColumns; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ListComponent.prototype, "lockedWidth", { + get: function () { + var groupCellsWidth = this.groups.length * 30; + return column_common_1.expandColumns(this.lockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, groupCellsWidth); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ListComponent.prototype, "nonLockedWidth", { + get: function () { + var nonLockedLeafColumns = this.nonLockedLeafColumns; + if (this.lockedLeafColumns.length) { + return column_common_1.expandColumns(nonLockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + (curr.width || 0); }, 0); + } + if (this.rtl) { + return column_common_1.expandColumns(nonLockedLeafColumns.toArray()).reduce(function (prev, curr) { return prev + curr.width; }, 0) || "100%"; + } + return undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ListComponent.prototype, "isLocked", { + get: function () { + return this.lockedLeafColumns.length > 0; + }, + enumerable: true, + configurable: true + }); + ListComponent.prototype.ngOnInit = function () { + this.init(); + this.handleRowSync(); + }; + ListComponent.prototype.ngOnChanges = function (changes) { + if (utils_1.isChanged("total", changes)) { + this.init(); + } + }; + ListComponent.prototype.ngAfterViewInit = function () { + this.container.nativeElement.scrollTop = this.rowHeightService.offset(this.skip); + this.attachContainerScroll(); + }; + ListComponent.prototype.syncRowsHeight = function () { + if (this.lockedContainer) { + row_sync_1.syncRowsHeight(this.lockedContainer.nativeElement.children[0], this.container.nativeElement.children[0]); + } + }; + ListComponent.prototype.ngOnDestroy = function () { + if (this.subscriptions) { + this.subscriptions.unsubscribe(); + } + if (this.scroller) { + this.scroller.destroy(); + } + }; + ListComponent.prototype.init = function () { + if (this.suspendService.scroll) { + return; + } + this.rowHeightService = new row_height_service_1.RowHeightService(this.total, this.rowHeight, this.detailRowHeight); + this.totalHeight = this.rowHeightService.totalHeight(); + if (!utils_1.isUniversal()) { + this.ngZone.runOutsideAngular(this.createScroller.bind(this)); + } + }; + ListComponent.prototype.detailExpand = function (_a) { + var index = _a.index, expand = _a.expand; + if (expand) { + this.rowHeightService.expandDetail(index); + } + else { + this.rowHeightService.collapseDetail(index); + } + this.totalHeight = this.rowHeightService.totalHeight(); + }; + ListComponent.prototype.attachContainerScroll = function () { + var _this = this; + if (!utils_1.isUniversal()) { + this.ngZone.runOutsideAngular(function () { + return _this.subscriptions.add(Observable_1.Observable.fromEvent(_this.container.nativeElement, 'scroll') + .map(function (event) { return event.target; }) + .filter(function () { return !_this.suspendService.scroll; }) + .do(_this.onContainerScroll.bind(_this)) + .subscribe(_this.dispatcher)); + }); + this.scrollSyncService.registerEmitter(this.container.nativeElement, "body"); + if (this.lockedContainer) { + this.subscriptions.add(Observable_1.Observable.fromEvent(this.lockedContainer.nativeElement, 'mousewheel') + .merge(Observable_1.Observable.fromEvent(this.lockedContainer.nativeElement, 'DOMMouseScroll')) + .filter(function (event) { return !event.ctrlKey; }) + .do(preventLockedScroll(this.container.nativeElement)) + .map(wheelDeltaY) + .subscribe(function (x) { return _this.container.nativeElement.scrollTop -= x; })); + this.syncRowsHeight(); + } + } + }; + ListComponent.prototype.createScroller = function () { + var _this = this; + var observable = this.scroller + .create(this.rowHeightService, this.skip, this.take, this.total); + this.subscriptions.add(observable + .filter(function (x) { return x instanceof scroller_service_1.PageAction; }) + .subscribe(function (x) { return _this.ngZone.run(function () { return _this.pageChange.emit(x); }); }) + .add(observable + .filter(function (x) { return x instanceof scroller_service_1.ScrollAction; }) + .subscribe(this.scroll.bind(this)))); + }; + ListComponent.prototype.scroll = function (_a) { + var offset = _a.offset; + [ + firstChild(this.container), + firstChild(this.lockedContainer) + ].filter(utils_1.isPresent).forEach(translateY(this.renderer, offset)); + }; + ListComponent.prototype.onContainerScroll = function (_a) { + var scrollTop = _a.scrollTop; + if (this.lockedContainer) { + this.lockedContainer.nativeElement.scrollTop = scrollTop; + } + }; + ListComponent.prototype.handleRowSync = function () { + var _this = this; + this.ngZone.runOutsideAngular(function () { + return _this.subscriptions.add(_this.changeNotification.changes + .merge(_this.groupsService.changes.switchMap(function () { return _this.ngZone.onStable.take(1); })) + .filter(function () { return utils_1.isPresent(_this.lockedContainer); }) + .subscribe(function () { return _this.syncRowsHeight(); })); + }); + }; + return ListComponent; +}()); +ListComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: exports.SCROLLER_FACTORY_TOKEN, + useValue: DEFAULT_SCROLLER_FACTORY + } + ], + selector: 'kendo-grid-list', + template: "\n
\n \n \n \n \n \n
\n
\n
\n
\n
\n \n \n \n \n \n
\n
\n
\n
\n
" + },] }, +]; +/** @nocollapse */ +ListComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Inject, args: [exports.SCROLLER_FACTORY_TOKEN,] },] }, + { type: details_service_1.DetailsService, }, + { type: change_notification_service_1.ChangeNotificationService, }, + { type: suspend_service_1.SuspendService, }, + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, + { type: groups_service_1.GroupsService, }, + { type: core_1.NgZone, }, + { type: core_1.Renderer2, }, + { type: scroll_sync_service_1.ScrollSyncService, }, +]; }; +ListComponent.propDecorators = { + 'hostClass': [{ type: core_1.HostBinding, args: ["class.k-grid-container",] },], + 'data': [{ type: core_1.Input },], + 'groups': [{ type: core_1.Input },], + 'total': [{ type: core_1.Input },], + 'rowHeight': [{ type: core_1.Input },], + 'detailRowHeight': [{ type: core_1.Input },], + 'take': [{ type: core_1.Input },], + 'skip': [{ type: core_1.Input },], + 'columns': [{ type: core_1.Input },], + 'detailTemplate': [{ type: core_1.Input },], + 'noRecordsTemplate': [{ type: core_1.Input },], + 'selectable': [{ type: core_1.Input },], + 'groupable': [{ type: core_1.Input },], + 'rowClass': [{ type: core_1.Input },], + 'pageChange': [{ type: core_1.Output },], + 'container': [{ type: core_1.ViewChild, args: ["container",] },], + 'lockedContainer': [{ type: core_1.ViewChild, args: ["lockedContainer",] },], +}; +exports.ListComponent = ListComponent; + + +/***/ }), +/* 124 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the no-records template of the Grid. + * Provides a way to customize the appearance of the item that is displayed when no data is present. + * + * To define the no-record template, nest a `` tag with the `kendoGridNoRecordsTemplate` directive inside ``. + * + * > When the locked columns of the Grid are in use, the template is displayed in the non-locked part of the content. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * + * + * There are not products. Click here to refresh. + * + * + * ` + * }) + * + * class AppComponent { + * public data = []; + * public refresh() { + * this.data = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false, + * "Category": { + * "CategoryID": 1, + * "CategoryName": "Beverages", + * "Description": "Soft drinks, coffees, teas, beers, and ales" + * } + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false, + * "Category": { + * "CategoryID": 1, + * "CategoryName": "Beverages", + * "Description": "Soft drinks, coffees, teas, beers, and ales" + * } + * }, { + * "ProductID": 3, + * "ProductName": "Aniseed Syrup", + * "UnitPrice": 10.0000, + * "Discontinued": false, + * "Category": { + * "CategoryID": 2, + * "CategoryName": "Condiments", + * "Description": "Sweet and savory sauces, relishes, spreads, and seasonings" + * } + * }]; + * + * } + * } + * + * ``` + */ +var NoRecordsTemplateDirective = (function () { + function NoRecordsTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return NoRecordsTemplateDirective; +}()); +NoRecordsTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridNoRecordsTemplate]' + },] }, +]; +/** @nocollapse */ +NoRecordsTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.NoRecordsTemplateDirective = NoRecordsTemplateDirective; + + +/***/ }), +/* 125 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var FIELDS = ['bottom', 'left', 'right', 'top']; +var PDFMarginComponent = (function () { + function PDFMarginComponent() { + } + Object.defineProperty(PDFMarginComponent.prototype, "options", { + /** + * @hidden + */ + get: function () { + var options = {}; + for (var idx = 0; idx < FIELDS.length; idx++) { + var field = FIELDS[idx]; + var value = this[field]; + if (typeof value !== 'undefined') { + options[field] = value; + } + } + return options; + }, + enumerable: true, + configurable: true + }); + return PDFMarginComponent; +}()); +PDFMarginComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-grid-pdf-margin', + template: '' + },] }, +]; +/** @nocollapse */ +PDFMarginComponent.ctorParameters = function () { return []; }; +PDFMarginComponent.propDecorators = { + 'bottom': [{ type: core_1.Input },], + 'left': [{ type: core_1.Input },], + 'right': [{ type: core_1.Input },], + 'top': [{ type: core_1.Input },], +}; +exports.PDFMarginComponent = PDFMarginComponent; + + +/***/ }), +/* 126 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +var PDFService = (function () { + function PDFService() { + this.savePDF = new core_1.EventEmitter(); + this.exportClick = new core_1.EventEmitter(); + this.dataChanged = new core_1.EventEmitter(); + } + PDFService.prototype.save = function (component) { + if (this.savePDF.observers.length === 0) { + if (core_1.isDevMode()) { + throw new Error('Saving pdf requires including the PDFModule and adding the component.'); + } + } + else { + this.savePDF.emit(component); + } + }; + return PDFService; +}()); +PDFService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +PDFService.ctorParameters = function () { return []; }; +exports.PDFService = PDFService; + + +/***/ }), +/* 127 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var cell_template_directive_1 = __webpack_require__(57); +var edit_template_directive_1 = __webpack_require__(111); +var column_base_1 = __webpack_require__(29); +var column_component_1 = __webpack_require__(30); +var utils_1 = __webpack_require__(7); +/** + * @hidden + */ +function isSpanColumnComponent(column) { + return column.isSpanColumn; +} +exports.isSpanColumnComponent = isSpanColumnComponent; +/** + * Represents a column which can be spanned over multiple data cells while the individual header and footer cells are retained. + * This behavior enables you to achieve more flexible layout and, at the same time, + * keep the built-in UI element for sorting, filtering, and grouping. + * The columns that will be merged have to be wrapped inside the `` tag. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * ` + * }) + * + * class AppComponent { + * public products = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": true + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false + * } + * ]; + * } + * + * ``` + * + * By default, the data cell displays the data for the specified fields. + * To further customize the spanned-column functionality, + * you can use a [cell template]({% slug api_grid_celltemplatedirective_kendouiforangular %}). + * + * ```html-no-run + * + * + * + * + *
{{ dataItem.field1 }}
+ *

{{ dataItem.field2 }}

+ *
+ *
+ * ``` + */ +var SpanColumnComponent = (function (_super) { + __extends(SpanColumnComponent, _super); + function SpanColumnComponent(parent) { + var _this = _super.call(this, parent) || this; + /* + * @hidden + */ + _this.isSpanColumn = true; + _this.template = new core_1.QueryList(); + _this.editTemplate = new core_1.QueryList(); + /** + * @hidden + */ + _this.childColumns = new core_1.QueryList(); + _this._editable = true; + _this._hidden = false; + _this._locked = false; + if (parent && parent.isSpanColumn) { + throw new Error('SpanColumn cannot be nested inside another SpanColumn'); + } + return _this; + } + Object.defineProperty(SpanColumnComponent.prototype, "hidden", { + get: function () { + return this._hidden || this.childColumns.toArray().every(function (x) { return x.hidden; }); + }, + /** + * Sets the visibility of the column. + * + * @default false + */ + set: function (value) { + this._hidden = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpanColumnComponent.prototype, "editable", { + get: function () { + return utils_1.isPresent(this.editTemplateRef) && this._editable; + }, + /** + * Defines whether the edit template of the column will be rendered. The default value is `false`. + * + * > To enable the editing functionality for a spanned column, set an edit template for it. + * + * @example + * ```ts-no-run + * + * + * + * + * + * + * + * ..... + * + * + * + * ``` + */ + set: function (value) { + this._editable = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpanColumnComponent.prototype, "templateRef", { + /** + * @hidden + */ + get: function () { + var template = this.template.first; + return template ? template.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpanColumnComponent.prototype, "editTemplateRef", { + /** + * @hidden + */ + get: function () { + var editTemplate = this.editTemplate.first; + return editTemplate ? editTemplate.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpanColumnComponent.prototype, "colspan", { + /** + * @hidden + */ + get: function () { + return this.childColumns.filter(function (c) { return !c.hidden; }).length; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SpanColumnComponent.prototype, "locked", { + get: function () { + return this._locked || this.childColumns.some(function (c) { return c.locked; }); + }, + /** + * Toggles the locked (frozen) state of the columns. + * Locked columns are visible at all times during the horizontal scrolling of the Grid. + * For the option to work properly, make sure that the Grid is configured to meet the following requirements: + * - Scrolling is enabled. + * - The `height` option of the Grid is set. + * - The widths of all Grid columns are explicitly set in pixels. + * In this way, the Grid adjusts the layout of the locked and unlocked columns. + * + * @default false + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * + * + * + * + * + * + * + * ` + * }) + * + * class AppComponent { + * private gridData: any[]; + * + * constructor() { + * this.gridData = products; + * } + * } + * + * const products = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": true + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false + * } + * ]; + * + * ``` + */ + set: function (value) { + this._locked = value; + }, + enumerable: true, + configurable: true + }); + return SpanColumnComponent; +}(column_base_1.ColumnBase)); +SpanColumnComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: column_base_1.ColumnBase, + useExisting: core_1.forwardRef(function () { return SpanColumnComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-grid-span-column', + template: "" + },] }, +]; +/** @nocollapse */ +SpanColumnComponent.ctorParameters = function () { return [ + { type: column_base_1.ColumnBase, decorators: [{ type: core_1.SkipSelf }, { type: core_1.Host }, { type: core_1.Optional },] }, +]; }; +SpanColumnComponent.propDecorators = { + 'template': [{ type: core_1.ContentChildren, args: [cell_template_directive_1.CellTemplateDirective, { descendants: false },] },], + 'editTemplate': [{ type: core_1.ContentChildren, args: [edit_template_directive_1.EditTemplateDirective, { descendants: false },] },], + 'childColumns': [{ type: core_1.ContentChildren, args: [column_component_1.ColumnComponent,] },], + 'hidden': [{ type: core_1.Input },], + 'editable': [{ type: core_1.Input },], + 'locked': [{ type: core_1.Input },], +}; +exports.SpanColumnComponent = SpanColumnComponent; + + +/***/ }), +/* 128 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +var SuspendService = (function () { + function SuspendService() { + this.scroll = false; + } + return SuspendService; +}()); +SuspendService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +SuspendService.ctorParameters = function () { return []; }; +exports.SuspendService = SuspendService; + + +/***/ }), +/* 129 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the toolbar template of the Grid. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + *
+ * + *
+ * + *
+ * + *
+ *
+ * + * + * + * + * + * + * + * + * + * ` + * }) + * + * class AppComponent { + * public position: 'top' | 'bottom' | 'both' = 'top'; + * + * public gridData = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": true + * } + * ]; + * + * public onClick(): void { + * console.log("button was clicked"); + * } + * + * public positionChange({ target }): void { + * this.position = target.value; + * } + * } + * + * ``` + */ +var ToolbarTemplateDirective = (function () { + function ToolbarTemplateDirective(templateRef) { + this.templateRef = templateRef; + this._position = "top"; + } + Object.defineProperty(ToolbarTemplateDirective.prototype, "position", { + get: function () { + return this._position; + }, + /** + * The position of the toolbar. + * The possible values are: + * - `top`—Positions the toolbar above the group panel or header. + * - `bottom`—Positions the toolbar below the pager. + * - `both`—Displays two toolbar instances. Positions the first one above + * the group panel or header and the second one below the pager. + */ + set: function (position) { + this._position = position; + }, + enumerable: true, + configurable: true + }); + return ToolbarTemplateDirective; +}()); +ToolbarTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridToolbarTemplate]' + },] }, +]; +/** @nocollapse */ +ToolbarTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +ToolbarTemplateDirective.propDecorators = { + 'position': [{ type: core_1.Input, args: ["position",] },], +}; +exports.ToolbarTemplateDirective = ToolbarTemplateDirective; + + +/***/ }), +/* 130 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +var Keys; +(function (Keys) { + Keys[Keys["backspace"] = 8] = "backspace"; + Keys[Keys["tab"] = 9] = "tab"; + Keys[Keys["enter"] = 13] = "enter"; + Keys[Keys["shift"] = 16] = "shift"; + Keys[Keys["ctrl"] = 17] = "ctrl"; + Keys[Keys["alt"] = 18] = "alt"; + Keys[Keys["space"] = 32] = "space"; + Keys[Keys["page up"] = 33] = "page up"; + Keys[Keys["page down"] = 34] = "page down"; + Keys[Keys["end"] = 35] = "end"; + Keys[Keys["home"] = 36] = "home"; + Keys[Keys["left"] = 37] = "left"; + Keys[Keys["up"] = 38] = "up"; + Keys[Keys["right"] = 39] = "right"; + Keys[Keys["down"] = 40] = "down"; + Keys[Keys["delete"] = 46] = "delete"; +})(Keys = exports.Keys || (exports.Keys = {})); + + +/***/ }), +/* 131 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var align_service_1 = __webpack_require__(403); +var dom_service_1 = __webpack_require__(60); +var position_service_1 = __webpack_require__(404); +var resize_service_1 = __webpack_require__(405); +var scrollable_service_1 = __webpack_require__(406); +var util_1 = __webpack_require__(44); +var DEFAULT_OFFSET = { left: -10000, top: 0 }; +/** + * Represents the Kendo UI Popup component for Angular. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * Popup content! + * + * ` + * }) + * class AppComponent { + * public show: boolean = false; + * } + * ``` + */ +var PopupComponent = (function () { + function PopupComponent(container, _alignService, _domService, _cdr, _positionService, _resizeService, _scrollableService, _renderer) { + this.container = container; + this._alignService = _alignService; + this._domService = _domService; + this._cdr = _cdr; + this._positionService = _positionService; + this._resizeService = _resizeService; + this._scrollableService = _scrollableService; + this._renderer = _renderer; + /** + * Controls the Popup animation. By default, the open and close animations are enabled. + * + * For more information, refer to the section on + * [animation control]({% slug overview_popup_kendouiforangular %}#toc-enable-and-disable-animations). + */ + this.animate = true; + /** + * Specifies the anchor pivot point. + * + * For more information, refer to the section on + * [positioning]({% slug overview_popup_kendouiforangular %}#toc-set-the-position). + */ + this.anchorAlign = { horizontal: 'left', vertical: 'bottom' }; + /** + * Configures the collision behavior of the Popup. + * + * For more information, refer to the section on + * [collisions]({% slug overview_popup_kendouiforangular %}#toc-set-behavior-when-outside-the-viewport). + */ + this.collision = { horizontal: 'fit', vertical: 'flip' }; + /** + * Specifies the pivot point of the Popup. + * + * For more information, refer to the section on + * [positioning]({% slug overview_popup_kendouiforangular %}#toc-set-the-position). + */ + this.popupAlign = { horizontal: 'left', vertical: 'top' }; + /** + * Specifies the absolute position of the element. The Popup opens next to that point. + * + * The Popup pivot point is defined by the `popupAlign` configuration option. + * The boundary detection is applied by using the window viewport. + * + * For more information, refer to the section on + * [static alignment]({% slug overview_popup_kendouiforangular %}#toc-align-to-specific-static-points). + */ + this.offset = DEFAULT_OFFSET; + /** + * Fires when the anchor is scrolled outside the screen boundaries. + * + * For more information, refer to the section on + * [scrolling outside the viewport]({% slug overview_popup_kendouiforangular %}#toc-set-behavior-when-outside-the-viewport). + */ + this.anchorViewportLeave = new core_1.EventEmitter(); + /** + * Fires after the component is closed. + */ + this.close = new core_1.EventEmitter(); + /** + * Fires after the component is opened and the open animation has ended. + */ + this.open = new core_1.EventEmitter(); + /** + * @hidden + */ + this.direction = 'down'; + this.currentOffset = DEFAULT_OFFSET; + this.resolvedPromised = Promise.resolve(null); + this._renderer.setElementClass(container.nativeElement, 'k-animation-container', true); + this._renderer.setElementClass(container.nativeElement, 'k-animation-container-fixed', true); + } + Object.defineProperty(PopupComponent.prototype, "offsetLeft", { + /** + * @hidden + */ + get: function () { + return this.currentOffset.left; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PopupComponent.prototype, "offsetTop", { + /** + * @hidden + */ + get: function () { + return this.currentOffset.top; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PopupComponent.prototype, "getZIndex", { + /** + * @hidden + */ + get: function () { + if (!this.anchor) { + return null; + } + return this.hostZIndex; + }, + enumerable: true, + configurable: true + }); + PopupComponent.prototype.ngOnInit = function () { + var repositionCallback = this.reposition.bind(this); + this._resizeService.subscribe(repositionCallback); + this._scrollableService.forElement(this.anchor || this.container).subscribe(this.onScroll.bind(this)); + this.hostZIndex = this._domService.zIndex(this.anchor, this.container); + }; + PopupComponent.prototype.ngAfterViewChecked = function () { + var _this = this; + if (!util_1.isDocumentAvailable()) { + return; + } + var _a = this.position(), flipped = _a.flipped, offset = _a.offset; + var newDirection = this.getDirection(flipped); + if (this.direction === newDirection && !util_1.isDifferentOffset(this.currentOffset, offset)) { + return; + } + this.resolvedPromised.then(function () { + _this.currentOffset = offset; + _this.direction = newDirection; + _this._cdr.markForCheck(); + }); + }; + PopupComponent.prototype.ngOnDestroy = function () { + this.anchorViewportLeave.complete(); + this.close.emit(); + this.close.complete(); + this._resizeService.unsubscribe(); + this._scrollableService.unsubscribe(); + }; + /** + * @hidden + */ + PopupComponent.prototype.triggerOpen = function (_event) { + this._renderer.setElementClass(this.container.nativeElement, 'k-animation-container-shown', true); + this.open.emit(); + this.open.complete(); + }; + PopupComponent.prototype.reposition = function () { + if (!util_1.isDocumentAvailable()) { + return; + } + var _a = this.position(), flipped = _a.flipped, offset = _a.offset; + this.direction = this.getDirection(flipped); + this.currentOffset = offset; + }; + PopupComponent.prototype.position = function () { + var alignedOffset = this._alignService.alignElement({ + anchor: this.anchor, + anchorAlign: this.anchorAlign, + element: this.container, + elementAlign: this.popupAlign, + offset: this.offset + }); + return this._positionService.positionElement({ + anchor: this.anchor, + anchorAlign: this.anchorAlign, + collisions: this.collision, + currentLocation: alignedOffset, + element: this.container, + elementAlign: this.popupAlign + }); + }; + PopupComponent.prototype.getDirection = function (flipped) { + return this.animate ? (flipped ? 'up' : 'down') : 'none'; + }; + PopupComponent.prototype.onScroll = function (isInViewPort) { + if (isInViewPort) { + this.reposition(); + } + else { + this.anchorViewportLeave.emit(); + } + }; + return PopupComponent; +}()); +PopupComponent.decorators = [ + { type: core_1.Component, args: [{ + animations: [ + core_1.trigger('toggle', [ + core_1.transition('void => down, up => down', [ + core_1.style({ transform: 'translateY(-100%)' }), + core_1.animate('0.1s ease-in', core_1.style({ transform: 'translateY(0)' })) + ]), + core_1.transition('down => void', [ + core_1.style({ transform: 'translateY(0)' }), + core_1.animate('0.1s ease-in', core_1.style({ transform: 'translateY(-100%)' })) + ]), + core_1.transition('void => up, down => up', [ + core_1.style({ transform: 'translateY(100%)' }), + core_1.animate('0.1s ease-in', core_1.style({ transform: 'translateY(0)' })) + ]), + core_1.transition('up => void', [ + core_1.style({ transform: 'translateY(0)' }), + core_1.animate('0.1s ease-in', core_1.style({ transform: 'translateY(100%)' })) + ]) + ]) + ], + exportAs: 'kendo-popup', + providers: [align_service_1.AlignService, dom_service_1.DOMService, position_service_1.PositionService, resize_service_1.ResizeService, scrollable_service_1.ScrollableService], + selector: 'kendo-popup', + template: "\n
\n \n \n
\n " + },] }, +]; +/** @nocollapse */ +PopupComponent.ctorParameters = function () { return [ + { type: core_1.ElementRef, }, + { type: align_service_1.AlignService, }, + { type: dom_service_1.DOMService, }, + { type: core_1.ChangeDetectorRef, }, + { type: position_service_1.PositionService, }, + { type: resize_service_1.ResizeService, }, + { type: scrollable_service_1.ScrollableService, }, + { type: core_1.Renderer, }, +]; }; +PopupComponent.propDecorators = { + 'animate': [{ type: core_1.Input },], + 'anchor': [{ type: core_1.Input },], + 'anchorAlign': [{ type: core_1.Input },], + 'collision': [{ type: core_1.Input },], + 'popupAlign': [{ type: core_1.Input },], + 'popupClass': [{ type: core_1.Input },], + 'offset': [{ type: core_1.Input },], + 'anchorViewportLeave': [{ type: core_1.Output },], + 'close': [{ type: core_1.Output },], + 'open': [{ type: core_1.Output },], + 'offsetLeft': [{ type: core_1.HostBinding, args: ['style.left.px',] },], + 'offsetTop': [{ type: core_1.HostBinding, args: ['style.top.px',] },], + 'getZIndex': [{ type: core_1.HostBinding, args: ['style.z-index',] },], +}; +exports.PopupComponent = PopupComponent; + + +/***/ }), +/* 132 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var utils_1 = __webpack_require__(17); +var filter_descriptor_interface_1 = __webpack_require__(61); +var dateRegExp = /^\/Date\((.*?)\)\/$/; +var newLineRegExp = /(\r+|\n+)/g; +var quoteRegExp = /(?=['\\])/g; +var operatorMap = function (key) { return ({ + "!=": "neq", + "<": "lt", + "<=": "lte", + "==": "eq", + ">": "gt", + ">=": "gte", + equal: "eq", + equals: "eq", + equalto: "eq", + ge: "gte", + greater: "gt", + greaterthan: "gt", + greaterthanequal: "gte", + isempty: "isempty", + isequalto: "eq", + isgreaterthan: "gt", + isgreaterthanorequalto: "gte", + islessthan: "lt", + islessthanorequalto: "lte", + isnotempty: "isnotempty", + isnotequalto: "neq", + isnull: "isnull", + le: "lte", + less: "lt", + lessthan: "lt", + lessthanequal: "lte", + ne: "neq", + notequal: "neq", + notequals: "neq", + notequalto: "neq", + notsubstringof: "doesnotcontain" +}[key.toLowerCase()] || key); }; +var normalizeOperator = function (descriptor) { + var filters = descriptor.filters || []; + filters.forEach(function (filter) { + if (!filter_descriptor_interface_1.isCompositeFilterDescriptor(filter) && utils_1.isString(filter.operator)) { + filter.operator = operatorMap(filter.operator); + } + if (filter_descriptor_interface_1.isCompositeFilterDescriptor(filter)) { + normalizeOperator(filter); + } + }); +}; +var normalizeDescriptor = function (descriptor) { + if (!filter_descriptor_interface_1.isCompositeFilterDescriptor(descriptor)) { + return { + filters: utils_1.isArray(descriptor) ? descriptor : [descriptor], + logic: "and" + }; + } + return descriptor; +}; +/** + * Converts a [`FilterDescriptor`]({% slug api_kendo-data-query_filterdescriptor_kendouiforangular %}) into a + * [`CompositeFilterDescriptor`]({% slug api_kendo-data-query_compositefilterdescriptor_kendouiforangular %}). + * + * If a `CompositeFilterDescriptor` is passed, no modifications will be made. + * + * @param {CompositeFilterDescriptor | FilterDescriptor} descriptor - The descriptor to be normalized. + * @returns {CompositeFilterDescriptor} - The normalized descriptor. + */ +exports.normalizeFilters = function (descriptor) { + if (utils_1.isPresent(descriptor)) { + descriptor = normalizeDescriptor(descriptor); + normalizeOperator(descriptor); + } + return descriptor; +}; +/** + * @hidden + */ +exports.operators = (function () { + var quote = function (value) { return (value.replace(quoteRegExp, "\\").replace(newLineRegExp, "")); }; + var operator = function (op, a, b, ignore) { + if (b != null) { + if (utils_1.isString(b)) { + b = quote(b); + var date = dateRegExp.exec(b); + if (date) { + b = new Date(+date[1]); + } + else if (ignore) { + b = "'" + b.toLowerCase() + "'"; + a = "((" + a + " || '')+'').toLowerCase()"; + } + else { + b = "'" + b + "'"; + } + } + if (b.getTime) { + //b looks like a Date + a = "(" + a + " && " + a + ".getTime?" + a + ".getTime():" + a + ")"; + b = b.getTime(); + } + } + return a + " " + op + " " + b; + }; + var apply = function (template, a, b, ignore) { + if (ignore) { + a = "(" + a + " || '').toLowerCase()"; + if (b) { + b = b.toLowerCase(); + } + } + if (b) { + b = quote(b); + } + return template(a, b); + }; + return { + contains: function (a, b, ignore) { + return apply(function (s1, s2) { return (s1 + ".indexOf('" + s2 + "') >= 0"); }, a, b, ignore); + }, + doesnotcontain: function (a, b, ignore) { + return apply(function (s1, s2) { return (s1 + ".indexOf('" + s2 + "') == -1"); }, a, b, ignore); + }, + doesnotendwith: function (a, b, ignore) { + return apply(function (s1, s2) { return (s1 + ".indexOf('" + s2 + "', " + s1 + ".length - " + (s2 || "").length + ") < 0"); }, a, b, ignore); + }, + doesnotstartwith: function (a, b, ignore) { + return apply(function (s1, s2) { return (s1 + ".lastIndexOf('" + s2 + "', 0) == -1"); }, a, b, ignore); + }, + endswith: function (a, b, ignore) { + return apply(function (s1, s2) { return (s1 + ".indexOf('" + s2 + "', " + s1 + ".length - " + (s2 || "").length + ") >= 0"); }, a, b, ignore); + }, + eq: function (a, b, ignore) { + return operator("==", a, b, ignore); + }, + gt: function (a, b, ignore) { + return operator(">", a, b, ignore); + }, + gte: function (a, b, ignore) { + return operator(">=", a, b, ignore); + }, + isempty: function (a) { + return a + " === ''"; + }, + isnotempty: function (a) { + return a + " !== ''"; + }, + isnotnull: function (a) { + return "(" + a + " !== null && " + a + " !== undefined)"; + }, + isnull: function (a) { + return "(" + a + " === null || " + a + " === undefined)"; + }, + lt: function (a, b, ignore) { + return operator("<", a, b, ignore); + }, + lte: function (a, b, ignore) { + return operator("<=", a, b, ignore); + }, + neq: function (a, b, ignore) { + return operator("!=", a, b, ignore); + }, + quote: function (value) { + if (value && value.getTime) { + return "new Date(" + value.getTime() + ")"; + } + if (utils_1.isString(value)) { + return "'" + quote(value) + "'"; + } + return "" + value; + }, + startswith: function (a, b, ignore) { + return apply(function (s1, s2) { return (s1 + ".lastIndexOf('" + s2 + "', 0) == 0"); }, a, b, ignore); + } + }; +})(); + + +/***/ }), +/* 133 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var transducers_1 = __webpack_require__(135); +var utils_1 = __webpack_require__(17); +var aggregate_operators_1 = __webpack_require__(273); +var filter_expression_factory_1 = __webpack_require__(83); +/** + * @hidden + */ +exports.normalizeGroups = function (descriptors) { + descriptors = utils_1.isArray(descriptors) ? descriptors : [descriptors]; + return descriptors.map(function (x) { return Object.assign({ dir: "asc" }, x); }); +}; +var identity = transducers_1.map(function (x) { return x; }); +/** + * Groups the provided data according to the specified descriptors. + * + * @param {Array} data - The data to be grouped. + * @param {GroupDescriptor[]} descriptors - The descriptors. + * @param {any} transformers - For internal use. + * @param {Array} originalData - For internal use. + * @returns {(Array> | T[])} - The grouped data. + * + * @example + * ```ts-no-run + * + * import { groupBy } from '@progress/kendo-data-query'; + * + * const data = [ + * { name: "Pork", category: "Food", subcategory: "Meat" }, + * { name: "Pepper", category: "Food", subcategory: "Vegetables" }, + * { name: "Beef", category: "Food", subcategory: "Meat" } + * ]; + * + * const result = groupBy(data, [{ field: "subcategory" }]); + * ``` + */ +exports.groupBy = function (data, descriptors, transformers, originalData) { + if (descriptors === void 0) { descriptors = []; } + if (transformers === void 0) { transformers = identity; } + if (originalData === void 0) { originalData = data; } + descriptors = exports.normalizeGroups(descriptors); + if (!descriptors.length) { + return data; + } + var descriptor = descriptors[0]; + var initialValue = {}; + var view = transducers_1.exec(transformers(transducers_1.groupCombinator(descriptor.field)), initialValue, data); + var result = []; + Object.keys(view).forEach(function (field) { + Object.keys(view[field]).forEach(function (value) { + var group = view[field][value]; + var aggregateResult = {}; + var filteredData = originalData; + if (utils_1.isPresent(descriptor.aggregates)) { + filteredData = filter_expression_factory_1.filterBy(originalData, { + field: descriptor.field, + ignoreCase: false, + operator: 'eq', + value: group.value + }); + aggregateResult = aggregate_operators_1.aggregateBy(filteredData, descriptor.aggregates); + } + result[group.__position] = { + aggregates: aggregateResult, + field: field, + items: descriptors.length > 1 ? + exports.groupBy(group.items, descriptors.slice(1), identity, filteredData) + : group.items, + value: group.value + }; + }); + }); + return result; +}; + + +/***/ }), +/* 134 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var filter_descriptor_interface_1 = __webpack_require__(61); +exports.isCompositeFilterDescriptor = filter_descriptor_interface_1.isCompositeFilterDescriptor; +var odata_operators_1 = __webpack_require__(412); +exports.toODataString = odata_operators_1.toODataString; +var operators_1 = __webpack_require__(410); +exports.toDataSourceRequestString = operators_1.toDataSourceRequestString; +var deserialization_1 = __webpack_require__(409); +exports.translateDataSourceResultGroups = deserialization_1.translateDataSourceResultGroups; +exports.translateAggregateResults = deserialization_1.translateAggregateResults; +var array_operators_1 = __webpack_require__(408); +exports.orderBy = array_operators_1.orderBy; +exports.process = array_operators_1.process; +exports.distinct = array_operators_1.distinct; +var accessor_1 = __webpack_require__(45); +exports.expr = accessor_1.expr; +exports.getter = accessor_1.getter; +var filter_expression_factory_1 = __webpack_require__(83); +exports.filterBy = filter_expression_factory_1.filterBy; +exports.compileFilter = filter_expression_factory_1.compileFilter; +var group_operators_1 = __webpack_require__(133); +exports.groupBy = group_operators_1.groupBy; +var sort_array_operator_1 = __webpack_require__(274); +exports.composeSortDescriptors = sort_array_operator_1.composeSortDescriptors; +var filter_expression_factory_2 = __webpack_require__(83); +exports.filterExpr = filter_expression_factory_2.filterExpr; +var filter_operators_1 = __webpack_require__(132); +exports.normalizeFilters = filter_operators_1.normalizeFilters; +var group_operators_2 = __webpack_require__(133); +exports.normalizeGroups = group_operators_2.normalizeGroups; +var aggregate_operators_1 = __webpack_require__(273); +exports.aggregateBy = aggregate_operators_1.aggregateBy; + + +/***/ }), +/* 135 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var utils_1 = __webpack_require__(17); +var accessor_1 = __webpack_require__(45); +var valueToString = function (value) { + value = utils_1.isPresent(value) && value.getTime ? value.getTime() : value; + return value + ""; +}; +/** + * @hidden + */ +exports.groupCombinator = function (field) { + var prop = accessor_1.getter(field, true); + var position = 0; + return function (agg, value) { + agg[field] = agg[field] || {}; + var groupValue = prop(value); + var key = valueToString(groupValue); + var values = agg[field][key] || { __position: position++, aggregates: {}, items: [], value: groupValue }; + values.items.push(value); + agg[field][key] = values; + return agg; + }; +}; +; +/** + * @hidden + */ +exports.expandAggregates = function (result) { + if (result === void 0) { result = {}; } + Object.keys(result).forEach(function (field) { + var aggregates = result[field]; + Object.keys(aggregates).forEach(function (aggregate) { + aggregates[aggregate] = aggregates[aggregate].result(); + }); + }); + return result; +}; +var aggregatesFuncs = function (name) { return ({ + average: function () { + var value = 0; + var count = 0; + return { + calc: function (curr) { + if (utils_1.isNumeric(curr)) { + value += curr; + count++; + } + else { + value = curr; + } + }, + result: function () { return utils_1.isNumeric(value) ? value / count : value; } + }; + }, + count: function () { + var state = 0; + return { + calc: function () { return state++; }, + result: function () { return state; } + }; + }, + max: function () { + var state = Number.NEGATIVE_INFINITY; + return { + calc: function (value) { + state = utils_1.isNumeric(state) || utils_1.isDate(state) ? state : value; + if (state < value && (utils_1.isNumeric(value) || utils_1.isDate(value))) { + state = value; + } + }, + result: function () { return state; } + }; + }, + min: function () { + var state = Number.POSITIVE_INFINITY; + return { + calc: function (value) { + state = utils_1.isNumeric(state) || utils_1.isDate(state) ? state : value; + if (state > value && (utils_1.isNumeric(value) || utils_1.isDate(value))) { + state = value; + } + }, + result: function () { return state; } + }; + }, + sum: function () { + var state = 0; + return { + calc: function (value) { return state += value; }, + result: function () { return state; } + }; + } +}[name]()); }; +/** + * @hidden + */ +exports.aggregatesCombinator = function (descriptors) { + var functions = descriptors.map(function (descriptor) { + var fieldAccessor = accessor_1.getter(descriptor.field, true); + var aggregateName = (descriptor.aggregate || "").toLowerCase(); + var aggregateAccessor = accessor_1.getter(aggregateName, true); + return function (state, value) { + var fieldAggregates = fieldAccessor(state) || {}; + var aggregateFunction = aggregateAccessor(fieldAggregates) + || aggregatesFuncs(aggregateName); + aggregateFunction.calc(fieldAccessor(value)); + fieldAggregates[descriptor.aggregate] = aggregateFunction; + state[descriptor.field] = fieldAggregates; + return state; + }; + }); + return function (state, value) { return functions.reduce(function (agg, calc) { return calc(agg, value); }, state); }; +}; +/** + * @hidden + * Adds the value to the `arr` producing a new array. + * + * > The original array will be modified. + */ +exports.concat = function (arr, value) { + arr.push(value); + return arr; +}; +/** + * @hidden + * Returns a reducer that will apply the specified transformation to the value. + */ +exports.map = function (transform) { return (function (reduce) { return (function (acc, curr, index) { return reduce(acc, transform(curr, index)); }); }); }; +/** + * @hidden + * Returns a reducer that will filter out items which do not match the `Predicate`. + */ +exports.filter = function (predicate) { return (function (reduce) { return (function (acc, curr) { return predicate(curr) ? reduce(acc, curr) : acc; }); }); }; +/** + * @hidden + */ +exports.isTransformerResult = function (source) { + return utils_1.isPresent(source.__value); +}; +var reduced = function (x) { + if (exports.isTransformerResult(x)) { + return x; + } + return { + __value: x, + reduced: true + }; +}; +/** + * @hidden + * Returns a reducer that will take the specified number of items. + */ +exports.take = function (count) { return (function (reduce) { return (function (acc, curr) { return count-- > 0 ? reduce(acc, curr) : reduced(acc); }); }); }; +/** + * @hidden + * Returns a reducer that will take the specified number of items. + */ +exports.takeWhile = function (predicate) { return (function (reduce) { return (function (acc, curr) { return predicate(curr) ? reduce(acc, curr) : reduced(acc); }); }); }; +/** + * @hidden + * Returns a reducer that will skip the specified number of items. + */ +exports.skip = function (count) { return (function (reduce) { return (function (acc, curr) { return count-- <= 0 ? reduce(acc, curr) : acc; }); }); }; +/** + * @hidden + * Transforms the data by applying the supplied transformer. + */ +exports.exec = function (transform, initialValue, data) { + var result = initialValue; + for (var idx = 0, length_1 = data.length; idx < length_1; idx++) { + result = transform(result, data[idx], idx); + if (exports.isTransformerResult(result)) { + result = result.__value; + break; + } + } + return result; +}; + + +/***/ }), +/* 136 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var direction_enum_1 = __webpack_require__(86); +var adjust_dst_1 = __webpack_require__(62); +var clone_date_1 = __webpack_require__(46); +/** + * @hidden + * + * A function returning the next or previous date for a specific week day. + * For example, `Day.Monday`. + * + * @param date - The date to calculate from. + * @param weekDay - The `Day` enum specifying the desired week day. + * @param direction - The `Direction` enum specifying the calculation direction. + * @returns - A `Date` instance. + * + * @example + * ```ts-no-run + * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Forward); // 2016-01-06, Wednesday + * dayOfWeek(new Date(2016, 0, 1), Day.Wednesday, Direction.Backward); // 2015-12-30, Wednesday + * ``` + */ +exports.dayOfWeek = function (date, weekDay, direction) { + if (direction === void 0) { direction = direction_enum_1.Direction.Forward; } + var newDate = clone_date_1.cloneDate(date); + var newDay = ((weekDay - newDate.getDay()) + (7 * direction)) % 7; + newDate.setDate(newDate.getDate() + newDay); + return adjust_dst_1.adjustDST(newDate, date.getHours()); +}; + + +/***/ }), +/* 137 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * Enumeration representing the week days. + */ +var Day; +(function (Day) { + /** + * The Sunday value with an underlying `0` number value. + */ + Day[Day["Sunday"] = 0] = "Sunday"; + /** + * The Monday value with an underlying `1` number value. + */ + Day[Day["Monday"] = 1] = "Monday"; + /** + * The Tuesday value with an underlying `2` number value. + */ + Day[Day["Tuesday"] = 2] = "Tuesday"; + /** + * The Wednesday value with an underlying `3` number value. + */ + Day[Day["Wednesday"] = 3] = "Wednesday"; + /** + * The Thursday value with an underlying `4` number value. + */ + Day[Day["Thursday"] = 4] = "Thursday"; + /** + * The Friday value with an underlying `5` number value. + */ + Day[Day["Friday"] = 5] = "Friday"; + /** + * The Saturday value with an underlying `6` number value. + */ + Day[Day["Saturday"] = 6] = "Saturday"; +})(Day = exports.Day || (exports.Day = {})); + + +/***/ }), +/* 138 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { value: true }); + +function saveAs(data, fileName, options) { + if ( options === void 0 ) options = {}; + + var save = postToProxy; + + if (options.forceProxy && !options.proxyURL) { + throw new Error('No proxyURL is set, but forceProxy is true'); + } + + if (!options.forceProxy) { + if (canDownload()) { + save = saveAsDataURI; + } + + if (navigator.msSaveBlob) { + save = saveAsBlob; + } + } + + save(data, fileName, options); +} + +var anchor = function () { return document.createElement('a'); }; +var canDownload = function () { return 'download' in anchor(); }; + +function saveAsBlob(data, fileName) { + var blob = data; // could be a Blob object + + if (typeof data === 'string') { + var parts = data.split(';base64,'); + var contentType = parts[0]; + var base64 = atob(parts[1]); + var array = new Uint8Array(base64.length); + + for (var idx = 0; idx < base64.length; idx++) { + array[idx] = base64.charCodeAt(idx); + } + + blob = new Blob([ array.buffer ], { type: contentType }); + } + + navigator.msSaveBlob(blob, fileName); +} + +function saveAsDataURI(data, fileName) { + var dataURI = data; + if (window.Blob && data instanceof Blob) { + dataURI = URL.createObjectURL(data); + } + + var fileSaver = anchor(); + fileSaver.download = fileName; + fileSaver.href = dataURI; + + var e = document.createEvent('MouseEvents'); + e.initMouseEvent('click', true, false, window, + 0, 0, 0, 0, 0, false, false, false, false, 0, null); + + fileSaver.dispatchEvent(e); + setTimeout(function () { return URL.revokeObjectURL(dataURI); }); +} + +function postToProxy(dataURI, fileName, options) { + if (!options.proxyURL) { + return; + } + + var form = document.createElement('form'); + form.setAttribute('action', options.proxyURL); + form.setAttribute('method', 'POST'); + form.setAttribute('target', options.proxyTarget || '_self'); + + var formData = options.proxyData || {}; + formData.fileName = fileName; + + var parts = dataURI.split(";base64,"); + formData.contentType = parts[0].replace("data:", ""); + formData.base64 = parts[1]; + + for (var name in formData) { + if (formData.hasOwnProperty(name)) { + var input = document.createElement('input'); + input.setAttribute('type', 'hidden'); + input.setAttribute('name', name); + input.setAttribute('value', formData[name]); + + form.appendChild(input); + } + } + + document.body.appendChild(form); + form.submit(); + document.body.removeChild(form); +} + +var KEY_STR = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; +var fromCharCode = String.fromCharCode; + +function encodeBase64(plainText) { + var input = encodeUTF8(plainText); + var output = ""; + var chr1, chr2, chr3, enc1, enc2, enc3, enc4; + var i = 0; + + while (i < input.length) { + chr1 = input.charCodeAt(i++); + chr2 = input.charCodeAt(i++); + chr3 = input.charCodeAt(i++); + + enc1 = chr1 >> 2; + enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + + KEY_STR.charAt(enc1) + KEY_STR.charAt(enc2) + + KEY_STR.charAt(enc3) + KEY_STR.charAt(enc4); + } + + return output; +} + +function encodeUTF8(input) { + var output = ""; + + for (var i = 0; i < input.length; i++) { + var c = input.charCodeAt(i); + + if (c < 0x80) { + // One byte + output += fromCharCode(c); + } else if (c < 0x800) { + // Two bytes + output += fromCharCode(0xC0 | (c >>> 6)); + output += fromCharCode(0x80 | (c & 0x3f)); + } else if (c < 0x10000) { + // Three bytes + output += fromCharCode(0xE0 | (c >>> 12)); + output += fromCharCode(0x80 | (c >>> 6 & 0x3f)); + output += fromCharCode(0x80 | (c & 0x3f)); + } + } + + return output; +} + +exports.saveAs = saveAs; +exports.encodeBase64 = encodeBase64; + +//# sourceMappingURL=main.js.map + + +/***/ }), +/* 139 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { value: true }); + +/* DOM dependent */ +function caretIndex(element) { + return element.disabled ? undefined : element.selectionStart; +} + +function caretSelection(element, startIndex, endIndex) { + if ( endIndex === void 0 ) endIndex = startIndex; + + if (startIndex && !element.disabled && element.selectionStart !== undefined) { + element.focus(); + element.setSelectionRange(startIndex, endIndex); + } +} + +function endOfWordIndex(text, startIndex, separator) { + var endIndex; + if (separator !== "") { + var word = wordAtCaret(startIndex, text, separator); + var tmp = text.substring(0, startIndex).split(separator); + var beginning = tmp[tmp.length - 1]; + endIndex = startIndex + (word.length - beginning.length); + } else { + endIndex = text.length; + } + + return endIndex; +} + +function selectEndOfWord(element, startIndex, separator) { + caretSelection(element, startIndex, endOfWordIndex(element.value, startIndex, separator)); +} + +function moveToEndOfWord(element, caretIdx, separator) { + var word = wordAtCaret(element, element.value, separator); + var end = caretIdx + word.length; + caretSelection(element, end, end); + + return end; +} + +function hasSelection(element) { + return element.selectionStart !== element.selectionEnd; +} + +function getExtraHeight(element) { + var result = 0; + var dom = element.previousElementSibling; + + while (dom) { + result += dom.offsetHeight; + dom = dom.previousElementSibling; + } + + return result; +} + +function resizeList(list, listContainer, height) { + var extraHeight = getExtraHeight(list); + var listHeight = list.scrollHeight || list.offsetHeight; + + listContainer.style.height = listHeight > height ? height + "px" : "auto"; + list.style.height = listHeight > height ? height - extraHeight + "px" : "auto"; +} + +/* DOM independent */ +function indexOfWordAtCaret(caretIdx, text, separator) { + return separator ? text.substring(0, caretIdx).split(separator).length - 1 : 0; +} + +function trim(word, separator) { + var str = separator.substring(0, separator.length - 1); + return word.endsWith(str) ? word.substring(0, word.length - str.length) : word; +} + +function wordAtCaret(caretIdx, text, separator) { + var result = text.split(separator)[indexOfWordAtCaret(caretIdx, text, separator)]; + return trim(result, separator); +} + +function replaceWordAtCaret(caretIdx, text, word, separator) { + var words = text.split(separator); + + words.splice(indexOfWordAtCaret(caretIdx, text, separator), 1, word); + + return words.join(separator); +} + +function textReduced(newValue, oldValue) { + if ( newValue === void 0 ) newValue = ""; + if ( oldValue === void 0 ) oldValue = ""; + + var result; + + if (!newValue && !oldValue) { + result = false; + } else if (newValue.length < oldValue.length) { + result = true; + } else if (newValue.length === oldValue.length) { + result = newValue === oldValue; + } else { + result = false; + } + + return result; +} + +function resolveValue(props) { + var data = props.data; + var defaultItem = props.defaultItem; + var value = props.value; + var index = props.index; + var valueField = props.valueField; + var dataItem; + if (value !== undefined) { + dataItem = data.find(function (element) { return getter(element, valueField) === value; }); + return { + dataItem: dataItem, + selected: data.indexOf(dataItem), + focused: data.indexOf(dataItem) + }; + } else if (index) { + dataItem = data[index]; + return { + dataItem: data[index], + selected: index, + focused: index + }; + } + return { + dataItem: defaultItem, + selected: -1, + focused: -1 + }; +} + +function sameCharsOnly(word, character) { + for (var idx = 0; idx < word.length; idx++) { + if (word.charAt(idx) !== character) { + return false; + } + } + return true; +} + +function normalizeIndex(index, length) { + var result = index; + + if (result >= length) { + result -= length; + } + + return result; +} + +function shuffleData(data, splitIndex, defaultItem) { + var result = data; + + if (defaultItem) { + result = [ defaultItem ].concat(result); + } + + return result.slice(splitIndex).concat(result.slice(0, splitIndex)); +} + +function matchText(text, word, ignoreCase) { + if (text === undefined || text === null) { + return false; + } + + var temp = String(text); + + if (ignoreCase) { + temp = temp.toLowerCase(); + } + + return temp.indexOf(word) === 0; +} + +function getter(dataItem, field) { + if (dataItem) { + return field ? dataItem[field] : dataItem; + } + return null; +} + +var Util = { + caretIndex: caretIndex, + caretSelection: caretSelection, + getter: getter, + getExtraHeight: getExtraHeight, + hasSelection: hasSelection, + indexOfWordAtCaret: indexOfWordAtCaret, + moveToEndOfWord: moveToEndOfWord, + matchText: matchText, + normalizeIndex: normalizeIndex, + textReduced: textReduced, + trim: trim, + wordAtCaret: wordAtCaret, + selectEndOfWord: selectEndOfWord, + sameCharsOnly: sameCharsOnly, + shuffleData: shuffleData, + replaceWordAtCaret: replaceWordAtCaret, + resizeList: resizeList, + resolveValue: resolveValue, + endOfWordIndex: endOfWordIndex +}; + +exports.DropDownsUtil = Util; + +//# sourceMappingURL=main.js.map + + +/***/ }), +/* 140 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var DOCUMENT_MODE = __webpack_require__(20).DOCUMENT_MODE; + +//Const +var VALID_DOCTYPE_NAME = 'html', + QUIRKS_MODE_SYSTEM_ID = 'http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd', + QUIRKS_MODE_PUBLIC_ID_PREFIXES = [ + '+//silmaril//dtd html pro v0r11 19970101//en', + '-//advasoft ltd//dtd html 3.0 aswedit + extensions//en', + '-//as//dtd html 3.0 aswedit + extensions//en', + '-//ietf//dtd html 2.0 level 1//en', + '-//ietf//dtd html 2.0 level 2//en', + '-//ietf//dtd html 2.0 strict level 1//en', + '-//ietf//dtd html 2.0 strict level 2//en', + '-//ietf//dtd html 2.0 strict//en', + '-//ietf//dtd html 2.0//en', + '-//ietf//dtd html 2.1e//en', + '-//ietf//dtd html 3.0//en', + '-//ietf//dtd html 3.0//en//', + '-//ietf//dtd html 3.2 final//en', + '-//ietf//dtd html 3.2//en', + '-//ietf//dtd html 3//en', + '-//ietf//dtd html level 0//en', + '-//ietf//dtd html level 0//en//2.0', + '-//ietf//dtd html level 1//en', + '-//ietf//dtd html level 1//en//2.0', + '-//ietf//dtd html level 2//en', + '-//ietf//dtd html level 2//en//2.0', + '-//ietf//dtd html level 3//en', + '-//ietf//dtd html level 3//en//3.0', + '-//ietf//dtd html strict level 0//en', + '-//ietf//dtd html strict level 0//en//2.0', + '-//ietf//dtd html strict level 1//en', + '-//ietf//dtd html strict level 1//en//2.0', + '-//ietf//dtd html strict level 2//en', + '-//ietf//dtd html strict level 2//en//2.0', + '-//ietf//dtd html strict level 3//en', + '-//ietf//dtd html strict level 3//en//3.0', + '-//ietf//dtd html strict//en', + '-//ietf//dtd html strict//en//2.0', + '-//ietf//dtd html strict//en//3.0', + '-//ietf//dtd html//en', + '-//ietf//dtd html//en//2.0', + '-//ietf//dtd html//en//3.0', + '-//metrius//dtd metrius presentational//en', + '-//microsoft//dtd internet explorer 2.0 html strict//en', + '-//microsoft//dtd internet explorer 2.0 html//en', + '-//microsoft//dtd internet explorer 2.0 tables//en', + '-//microsoft//dtd internet explorer 3.0 html strict//en', + '-//microsoft//dtd internet explorer 3.0 html//en', + '-//microsoft//dtd internet explorer 3.0 tables//en', + '-//netscape comm. corp.//dtd html//en', + '-//netscape comm. corp.//dtd strict html//en', + '-//o\'reilly and associates//dtd html 2.0//en', + '-//o\'reilly and associates//dtd html extended 1.0//en', + '-//spyglass//dtd html 2.0 extended//en', + '-//sq//dtd html 2.0 hotmetal + extensions//en', + '-//sun microsystems corp.//dtd hotjava html//en', + '-//sun microsystems corp.//dtd hotjava strict html//en', + '-//w3c//dtd html 3 1995-03-24//en', + '-//w3c//dtd html 3.2 draft//en', + '-//w3c//dtd html 3.2 final//en', + '-//w3c//dtd html 3.2//en', + '-//w3c//dtd html 3.2s draft//en', + '-//w3c//dtd html 4.0 frameset//en', + '-//w3c//dtd html 4.0 transitional//en', + '-//w3c//dtd html experimental 19960712//en', + '-//w3c//dtd html experimental 970421//en', + '-//w3c//dtd w3 html//en', + '-//w3o//dtd w3 html 3.0//en', + '-//w3o//dtd w3 html 3.0//en//', + '-//webtechs//dtd mozilla html 2.0//en', + '-//webtechs//dtd mozilla html//en' + ], + QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES = QUIRKS_MODE_PUBLIC_ID_PREFIXES.concat([ + '-//w3c//dtd html 4.01 frameset//', + '-//w3c//dtd html 4.01 transitional//' + ]), + QUIRKS_MODE_PUBLIC_IDS = [ + '-//w3o//dtd w3 html strict 3.0//en//', + '-/w3c/dtd html 4.0 transitional/en', + 'html' + ], + LIMITED_QUIRKS_PUBLIC_ID_PREFIXES = [ + '-//W3C//DTD XHTML 1.0 Frameset//', + '-//W3C//DTD XHTML 1.0 Transitional//' + ], + LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES = LIMITED_QUIRKS_PUBLIC_ID_PREFIXES.concat([ + '-//W3C//DTD HTML 4.01 Frameset//', + '-//W3C//DTD HTML 4.01 Transitional//' + ]); + + +//Utils +function enquoteDoctypeId(id) { + var quote = id.indexOf('"') !== -1 ? '\'' : '"'; + + return quote + id + quote; +} + +function hasPrefix(publicId, prefixes) { + for (var i = 0; i < prefixes.length; i++) { + if (publicId.indexOf(prefixes[i]) === 0) + return true; + } + + return false; +} + + +//API +exports.getDocumentMode = function (name, publicId, systemId) { + if (name !== VALID_DOCTYPE_NAME) + return DOCUMENT_MODE.QUIRKS; + + if (systemId && systemId.toLowerCase() === QUIRKS_MODE_SYSTEM_ID) + return DOCUMENT_MODE.QUIRKS; + + if (publicId !== null) { + publicId = publicId.toLowerCase(); + + if (QUIRKS_MODE_PUBLIC_IDS.indexOf(publicId) > -1) + return DOCUMENT_MODE.QUIRKS; + + var prefixes = systemId === null ? QUIRKS_MODE_NO_SYSTEM_ID_PUBLIC_ID_PREFIXES : QUIRKS_MODE_PUBLIC_ID_PREFIXES; + + if (hasPrefix(publicId, prefixes)) + return DOCUMENT_MODE.QUIRKS; + + prefixes = systemId === null ? LIMITED_QUIRKS_PUBLIC_ID_PREFIXES : LIMITED_QUIRKS_WITH_SYSTEM_ID_PUBLIC_ID_PREFIXES; + + if (hasPrefix(publicId, prefixes)) + return DOCUMENT_MODE.LIMITED_QUIRKS; + } + + return DOCUMENT_MODE.NO_QUIRKS; +}; + +exports.serializeContent = function (name, publicId, systemId) { + var str = '!DOCTYPE '; + + if (name) + str += name; + + if (publicId !== null) + str += ' PUBLIC ' + enquoteDoctypeId(publicId); + + else if (systemId !== null) + str += ' SYSTEM'; + + if (systemId !== null) + str += ' ' + enquoteDoctypeId(systemId); + + return str; +}; + + +/***/ }), +/* 141 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +module.exports = function mergeOptions(defaults, options) { + options = options || Object.create(null); + + return [defaults, options].reduce(function (merged, optObj) { + Object.keys(optObj).forEach(function (key) { + merged[key] = optObj[key]; + }); + + return merged; + }, Object.create(null)); +}; + + +/***/ }), +/* 142 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Parser = __webpack_require__(284), + Serializer = __webpack_require__(287); + + +// Shorthands +exports.parse = function parse(html, options) { + var parser = new Parser(options); + + return parser.parse(html); +}; + +exports.parseFragment = function parseFragment(fragmentContext, html, options) { + if (typeof fragmentContext === 'string') { + options = html; + html = fragmentContext; + fragmentContext = null; + } + + var parser = new Parser(options); + + return parser.parseFragment(html, fragmentContext); +}; + +exports.serialize = function (node, options) { + var serializer = new Serializer(node, options); + + return serializer.serialize(); +}; + + +// Tree adapters +exports.treeAdapters = { + default: __webpack_require__(143), + htmlparser2: __webpack_require__(449) +}; + + +// Streaming +exports.ParserStream = __webpack_require__(286); +exports.PlainTextConversionStream = __webpack_require__(442); +exports.SerializerStream = __webpack_require__(446); +exports.SAXParser = __webpack_require__(444); + + +/***/ }), +/* 143 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var DOCUMENT_MODE = __webpack_require__(20).DOCUMENT_MODE; + +//Node construction +exports.createDocument = function () { + return { + nodeName: '#document', + mode: DOCUMENT_MODE.NO_QUIRKS, + childNodes: [] + }; +}; + +exports.createDocumentFragment = function () { + return { + nodeName: '#document-fragment', + childNodes: [] + }; +}; + +exports.createElement = function (tagName, namespaceURI, attrs) { + return { + nodeName: tagName, + tagName: tagName, + attrs: attrs, + namespaceURI: namespaceURI, + childNodes: [], + parentNode: null + }; +}; + +exports.createCommentNode = function (data) { + return { + nodeName: '#comment', + data: data, + parentNode: null + }; +}; + +var createTextNode = function (value) { + return { + nodeName: '#text', + value: value, + parentNode: null + }; +}; + + +//Tree mutation +var appendChild = exports.appendChild = function (parentNode, newNode) { + parentNode.childNodes.push(newNode); + newNode.parentNode = parentNode; +}; + +var insertBefore = exports.insertBefore = function (parentNode, newNode, referenceNode) { + var insertionIdx = parentNode.childNodes.indexOf(referenceNode); + + parentNode.childNodes.splice(insertionIdx, 0, newNode); + newNode.parentNode = parentNode; +}; + +exports.setTemplateContent = function (templateElement, contentElement) { + templateElement.content = contentElement; +}; + +exports.getTemplateContent = function (templateElement) { + return templateElement.content; +}; + +exports.setDocumentType = function (document, name, publicId, systemId) { + var doctypeNode = null; + + for (var i = 0; i < document.childNodes.length; i++) { + if (document.childNodes[i].nodeName === '#documentType') { + doctypeNode = document.childNodes[i]; + break; + } + } + + if (doctypeNode) { + doctypeNode.name = name; + doctypeNode.publicId = publicId; + doctypeNode.systemId = systemId; + } + + else { + appendChild(document, { + nodeName: '#documentType', + name: name, + publicId: publicId, + systemId: systemId + }); + } +}; + +exports.setDocumentMode = function (document, mode) { + document.mode = mode; +}; + +exports.getDocumentMode = function (document) { + return document.mode; +}; + +exports.detachNode = function (node) { + if (node.parentNode) { + var idx = node.parentNode.childNodes.indexOf(node); + + node.parentNode.childNodes.splice(idx, 1); + node.parentNode = null; + } +}; + +exports.insertText = function (parentNode, text) { + if (parentNode.childNodes.length) { + var prevNode = parentNode.childNodes[parentNode.childNodes.length - 1]; + + if (prevNode.nodeName === '#text') { + prevNode.value += text; + return; + } + } + + appendChild(parentNode, createTextNode(text)); +}; + +exports.insertTextBefore = function (parentNode, text, referenceNode) { + var prevNode = parentNode.childNodes[parentNode.childNodes.indexOf(referenceNode) - 1]; + + if (prevNode && prevNode.nodeName === '#text') + prevNode.value += text; + else + insertBefore(parentNode, createTextNode(text), referenceNode); +}; + +exports.adoptAttributes = function (recipient, attrs) { + var recipientAttrsMap = []; + + for (var i = 0; i < recipient.attrs.length; i++) + recipientAttrsMap.push(recipient.attrs[i].name); + + for (var j = 0; j < attrs.length; j++) { + if (recipientAttrsMap.indexOf(attrs[j].name) === -1) + recipient.attrs.push(attrs[j]); + } +}; + + +//Tree traversing +exports.getFirstChild = function (node) { + return node.childNodes[0]; +}; + +exports.getChildNodes = function (node) { + return node.childNodes; +}; + +exports.getParentNode = function (node) { + return node.parentNode; +}; + +exports.getAttrList = function (element) { + return element.attrs; +}; + +//Node data +exports.getTagName = function (element) { + return element.tagName; +}; + +exports.getNamespaceURI = function (element) { + return element.namespaceURI; +}; + +exports.getTextNodeContent = function (textNode) { + return textNode.value; +}; + +exports.getCommentNodeContent = function (commentNode) { + return commentNode.data; +}; + +exports.getDocumentTypeNodeName = function (doctypeNode) { + return doctypeNode.name; +}; + +exports.getDocumentTypeNodePublicId = function (doctypeNode) { + return doctypeNode.publicId; +}; + +exports.getDocumentTypeNodeSystemId = function (doctypeNode) { + return doctypeNode.systemId; +}; + +//Node types +exports.isTextNode = function (node) { + return node.nodeName === '#text'; +}; + +exports.isCommentNode = function (node) { + return node.nodeName === '#comment'; +}; + +exports.isDocumentTypeNode = function (node) { + return node.nodeName === '#documentType'; +}; + +exports.isElementNode = function (node) { + return !!node.tagName; +}; + + +/***/ }), +/* 144 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var from_1 = __webpack_require__(692); +Observable_1.Observable.from = from_1.from; +//# sourceMappingURL=from.js.map + +/***/ }), +/* 145 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var concatMap_1 = __webpack_require__(697); +Observable_1.Observable.prototype.concatMap = concatMap_1.concatMap; +//# sourceMappingURL=concatMap.js.map + +/***/ }), +/* 146 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var distinctUntilChanged_1 = __webpack_require__(307); +Observable_1.Observable.prototype.distinctUntilChanged = distinctUntilChanged_1.distinctUntilChanged; +//# sourceMappingURL=distinctUntilChanged.js.map + +/***/ }), +/* 147 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var do_1 = __webpack_require__(601); +Observable_1.Observable.prototype.do = do_1._do; +Observable_1.Observable.prototype._do = do_1._do; +//# sourceMappingURL=do.js.map + +/***/ }), +/* 148 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var switchMap_1 = __webpack_require__(641); +Observable_1.Observable.prototype.switchMap = switchMap_1.switchMap; +//# sourceMappingURL=switchMap.js.map + +/***/ }), +/* 149 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var ArrayObservable_1 = __webpack_require__(48); +var isArray_1 = __webpack_require__(49); +var OuterSubscriber_1 = __webpack_require__(6); +var subscribeToResult_1 = __webpack_require__(5); +var none = {}; +/* tslint:enable:max-line-length */ +/** + * Combines multiple Observables to create an Observable whose values are + * calculated from the latest values of each of its input Observables. + * + * Whenever any input Observable emits a value, it + * computes a formula using the latest values from all the inputs, then emits + * the output of that formula. + * + * + * + * `combineLatest` combines the values from this Observable with values from + * Observables passed as arguments. This is done by subscribing to each + * Observable, in order, and collecting an array of each of the most recent + * values any time any of the input Observables emits, then either taking that + * array and passing it as arguments to an optional `project` function and + * emitting the return value of that, or just emitting the array of recent + * values directly if there is no `project` function. + * + * @example Dynamically calculate the Body-Mass Index from an Observable of weight and one for height + * var weight = Rx.Observable.of(70, 72, 76, 79, 75); + * var height = Rx.Observable.of(1.76, 1.77, 1.78); + * var bmi = weight.combineLatest(height, (w, h) => w / (h * h)); + * bmi.subscribe(x => console.log('BMI is ' + x)); + * + * // With output to console: + * // BMI is 24.212293388429753 + * // BMI is 23.93948099205209 + * // BMI is 23.671253629592222 + * + * @see {@link combineAll} + * @see {@link merge} + * @see {@link withLatestFrom} + * + * @param {ObservableInput} other An input Observable to combine with the source + * Observable. More than one input Observables may be given as argument. + * @param {function} [project] An optional function to project the values from + * the combined latest values into a new value on the output Observable. + * @return {Observable} An Observable of projected values from the most recent + * values from each input Observable, or an array of the most recent values from + * each input Observable. + * @method combineLatest + * @owner Observable + */ +function combineLatest() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var project = null; + if (typeof observables[observables.length - 1] === 'function') { + project = observables.pop(); + } + // if the first and only other argument besides the resultSelector is an array + // assume it's been called with `combineLatest([obs1, obs2, obs3], project)` + if (observables.length === 1 && isArray_1.isArray(observables[0])) { + observables = observables[0].slice(); + } + observables.unshift(this); + return this.lift.call(new ArrayObservable_1.ArrayObservable(observables), new CombineLatestOperator(project)); +} +exports.combineLatest = combineLatest; +var CombineLatestOperator = (function () { + function CombineLatestOperator(project) { + this.project = project; + } + CombineLatestOperator.prototype.call = function (subscriber, source) { + return source.subscribe(new CombineLatestSubscriber(subscriber, this.project)); + }; + return CombineLatestOperator; +}()); +exports.CombineLatestOperator = CombineLatestOperator; +/** + * We need this JSDoc comment for affecting ESDoc. + * @ignore + * @extends {Ignored} + */ +var CombineLatestSubscriber = (function (_super) { + __extends(CombineLatestSubscriber, _super); + function CombineLatestSubscriber(destination, project) { + _super.call(this, destination); + this.project = project; + this.active = 0; + this.values = []; + this.observables = []; + } + CombineLatestSubscriber.prototype._next = function (observable) { + this.values.push(none); + this.observables.push(observable); + }; + CombineLatestSubscriber.prototype._complete = function () { + var observables = this.observables; + var len = observables.length; + if (len === 0) { + this.destination.complete(); + } + else { + this.active = len; + this.toRespond = len; + for (var i = 0; i < len; i++) { + var observable = observables[i]; + this.add(subscribeToResult_1.subscribeToResult(this, observable, observable, i)); + } + } + }; + CombineLatestSubscriber.prototype.notifyComplete = function (unused) { + if ((this.active -= 1) === 0) { + this.destination.complete(); + } + }; + CombineLatestSubscriber.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { + var values = this.values; + var oldVal = values[outerIndex]; + var toRespond = !this.toRespond + ? 0 + : oldVal === none ? --this.toRespond : this.toRespond; + values[outerIndex] = innerValue; + if (toRespond === 0) { + if (this.project) { + this._tryProject(values); + } + else { + this.destination.next(values.slice()); + } + } + }; + CombineLatestSubscriber.prototype._tryProject = function (values) { + var result; + try { + result = this.project.apply(this, values); + } + catch (err) { + this.destination.error(err); + return; + } + this.destination.next(result); + }; + return CombineLatestSubscriber; +}(OuterSubscriber_1.OuterSubscriber)); +exports.CombineLatestSubscriber = CombineLatestSubscriber; +//# sourceMappingURL=combineLatest.js.map + +/***/ }), +/* 150 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var isScheduler_1 = __webpack_require__(35); +var ArrayObservable_1 = __webpack_require__(48); +var mergeAll_1 = __webpack_require__(324); +/* tslint:enable:max-line-length */ +/** + * Creates an output Observable which sequentially emits all values from every + * given input Observable after the current Observable. + * + * Concatenates multiple Observables together by + * sequentially emitting their values, one Observable after the other. + * + * + * + * Joins this Observable with multiple other Observables by subscribing to them + * one at a time, starting with the source, and merging their results into the + * output Observable. Will wait for each Observable to complete before moving + * on to the next. + * + * @example Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10 + * var timer = Rx.Observable.interval(1000).take(4); + * var sequence = Rx.Observable.range(1, 10); + * var result = timer.concat(sequence); + * result.subscribe(x => console.log(x)); + * + * // results in: + * // 1000ms-> 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10 + * + * @example Concatenate 3 Observables + * var timer1 = Rx.Observable.interval(1000).take(10); + * var timer2 = Rx.Observable.interval(2000).take(6); + * var timer3 = Rx.Observable.interval(500).take(10); + * var result = timer1.concat(timer2, timer3); + * result.subscribe(x => console.log(x)); + * + * // results in the following: + * // (Prints to console sequentially) + * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9 + * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5 + * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9 + * + * @see {@link concatAll} + * @see {@link concatMap} + * @see {@link concatMapTo} + * + * @param {ObservableInput} other An input Observable to concatenate after the source + * Observable. More than one input Observables may be given as argument. + * @param {Scheduler} [scheduler=null] An optional IScheduler to schedule each + * Observable subscription on. + * @return {Observable} All values of each passed Observable merged into a + * single Observable, in order, in serial fashion. + * @method concat + * @owner Observable + */ +function concat() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + return this.lift.call(concatStatic.apply(void 0, [this].concat(observables))); +} +exports.concat = concat; +/* tslint:enable:max-line-length */ +/** + * Creates an output Observable which sequentially emits all values from given + * Observable and then moves on to the next. + * + * Concatenates multiple Observables together by + * sequentially emitting their values, one Observable after the other. + * + * + * + * `concat` joins multiple Observables together, by subscribing to them one at a time and + * merging their results into the output Observable. You can pass either an array of + * Observables, or put them directly as arguments. Passing an empty array will result + * in Observable that completes immediately. + * + * `concat` will subscribe to first input Observable and emit all its values, without + * changing or affecting them in any way. When that Observable completes, it will + * subscribe to then next Observable passed and, again, emit its values. This will be + * repeated, until the operator runs out of Observables. When last input Observable completes, + * `concat` will complete as well. At any given moment only one Observable passed to operator + * emits values. If you would like to emit values from passed Observables concurrently, check out + * {@link merge} instead, especially with optional `concurrent` parameter. As a matter of fact, + * `concat` is an equivalent of `merge` operator with `concurrent` parameter set to `1`. + * + * Note that if some input Observable never completes, `concat` will also never complete + * and Observables following the one that did not complete will never be subscribed. On the other + * hand, if some Observable simply completes immediately after it is subscribed, it will be + * invisible for `concat`, which will just move on to the next Observable. + * + * If any Observable in chain errors, instead of passing control to the next Observable, + * `concat` will error immediately as well. Observables that would be subscribed after + * the one that emitted error, never will. + * + * If you pass to `concat` the same Observable many times, its stream of values + * will be "replayed" on every subscription, which means you can repeat given Observable + * as many times as you like. If passing the same Observable to `concat` 1000 times becomes tedious, + * you can always use {@link repeat}. + * + * @example Concatenate a timer counting from 0 to 3 with a synchronous sequence from 1 to 10 + * var timer = Rx.Observable.interval(1000).take(4); + * var sequence = Rx.Observable.range(1, 10); + * var result = Rx.Observable.concat(timer, sequence); + * result.subscribe(x => console.log(x)); + * + * // results in: + * // 0 -1000ms-> 1 -1000ms-> 2 -1000ms-> 3 -immediate-> 1 ... 10 + * + * + * @example Concatenate an array of 3 Observables + * var timer1 = Rx.Observable.interval(1000).take(10); + * var timer2 = Rx.Observable.interval(2000).take(6); + * var timer3 = Rx.Observable.interval(500).take(10); + * var result = Rx.Observable.concat([timer1, timer2, timer3]); // note that array is passed + * result.subscribe(x => console.log(x)); + * + * // results in the following: + * // (Prints to console sequentially) + * // -1000ms-> 0 -1000ms-> 1 -1000ms-> ... 9 + * // -2000ms-> 0 -2000ms-> 1 -2000ms-> ... 5 + * // -500ms-> 0 -500ms-> 1 -500ms-> ... 9 + * + * + * @example Concatenate the same Observable to repeat it + * const timer = Rx.Observable.interval(1000).take(2); + * + * Rx.Observable.concat(timer, timer) // concating the same Observable! + * .subscribe( + * value => console.log(value), + * err => {}, + * () => console.log('...and it is done!') + * ); + * + * // Logs: + * // 0 after 1s + * // 1 after 2s + * // 0 after 3s + * // 1 after 4s + * // "...and it is done!" also after 4s + * + * @see {@link concatAll} + * @see {@link concatMap} + * @see {@link concatMapTo} + * + * @param {ObservableInput} input1 An input Observable to concatenate with others. + * @param {ObservableInput} input2 An input Observable to concatenate with others. + * More than one input Observables may be given as argument. + * @param {Scheduler} [scheduler=null] An optional IScheduler to schedule each + * Observable subscription on. + * @return {Observable} All values of each passed Observable merged into a + * single Observable, in order, in serial fashion. + * @static true + * @name concat + * @owner Observable + */ +function concatStatic() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var scheduler = null; + var args = observables; + if (isScheduler_1.isScheduler(args[observables.length - 1])) { + scheduler = args.pop(); + } + if (scheduler === null && observables.length === 1 && observables[0] instanceof Observable_1.Observable) { + return observables[0]; + } + return new ArrayObservable_1.ArrayObservable(observables, scheduler).lift(new mergeAll_1.MergeAllOperator(1)); +} +exports.concatStatic = concatStatic; +//# sourceMappingURL=concat.js.map + +/***/ }), +/* 151 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || function (d, b) { + for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +}; +var ArrayObservable_1 = __webpack_require__(48); +var isArray_1 = __webpack_require__(49); +var Subscriber_1 = __webpack_require__(4); +var OuterSubscriber_1 = __webpack_require__(6); +var subscribeToResult_1 = __webpack_require__(5); +var iterator_1 = __webpack_require__(94); +/* tslint:enable:max-line-length */ +/** + * @param observables + * @return {Observable} + * @method zip + * @owner Observable + */ +function zipProto() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + return this.lift.call(zipStatic.apply(void 0, [this].concat(observables))); +} +exports.zipProto = zipProto; +/* tslint:enable:max-line-length */ +/** + * Combines multiple Observables to create an Observable whose values are calculated from the values, in order, of each + * of its input Observables. + * + * If the latest parameter is a function, this function is used to compute the created value from the input values. + * Otherwise, an array of the input values is returned. + * + * @example Combine age and name from different sources + * + * let age$ = Observable.of(27, 25, 29); + * let name$ = Observable.of('Foo', 'Bar', 'Beer'); + * let isDev$ = Observable.of(true, true, false); + * + * Observable + * .zip(age$, + * name$, + * isDev$, + * (age: number, name: string, isDev: boolean) => ({ age, name, isDev })) + * .subscribe(x => console.log(x)); + * + * // outputs + * // { age: 27, name: 'Foo', isDev: true } + * // { age: 25, name: 'Bar', isDev: true } + * // { age: 29, name: 'Beer', isDev: false } + * + * @param observables + * @return {Observable} + * @static true + * @name zip + * @owner Observable + */ +function zipStatic() { + var observables = []; + for (var _i = 0; _i < arguments.length; _i++) { + observables[_i - 0] = arguments[_i]; + } + var project = observables[observables.length - 1]; + if (typeof project === 'function') { + observables.pop(); + } + return new ArrayObservable_1.ArrayObservable(observables).lift(new ZipOperator(project)); +} +exports.zipStatic = zipStatic; +var ZipOperator = (function () { + function ZipOperator(project) { + this.project = project; + } + ZipOperator.prototype.call = function (subscriber, source) { + return source.subscribe(new ZipSubscriber(subscriber, this.project)); + }; + return ZipOperator; +}()); +exports.ZipOperator = ZipOperator; +/** + * We need this JSDoc comment for affecting ESDoc. + * @ignore + * @extends {Ignored} + */ +var ZipSubscriber = (function (_super) { + __extends(ZipSubscriber, _super); + function ZipSubscriber(destination, project, values) { + if (values === void 0) { values = Object.create(null); } + _super.call(this, destination); + this.iterators = []; + this.active = 0; + this.project = (typeof project === 'function') ? project : null; + this.values = values; + } + ZipSubscriber.prototype._next = function (value) { + var iterators = this.iterators; + if (isArray_1.isArray(value)) { + iterators.push(new StaticArrayIterator(value)); + } + else if (typeof value[iterator_1.iterator] === 'function') { + iterators.push(new StaticIterator(value[iterator_1.iterator]())); + } + else { + iterators.push(new ZipBufferIterator(this.destination, this, value)); + } + }; + ZipSubscriber.prototype._complete = function () { + var iterators = this.iterators; + var len = iterators.length; + if (len === 0) { + this.destination.complete(); + return; + } + this.active = len; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (iterator.stillUnsubscribed) { + this.add(iterator.subscribe(iterator, i)); + } + else { + this.active--; // not an observable + } + } + }; + ZipSubscriber.prototype.notifyInactive = function () { + this.active--; + if (this.active === 0) { + this.destination.complete(); + } + }; + ZipSubscriber.prototype.checkIterators = function () { + var iterators = this.iterators; + var len = iterators.length; + var destination = this.destination; + // abort if not all of them have values + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + if (typeof iterator.hasValue === 'function' && !iterator.hasValue()) { + return; + } + } + var shouldComplete = false; + var args = []; + for (var i = 0; i < len; i++) { + var iterator = iterators[i]; + var result = iterator.next(); + // check to see if it's completed now that you've gotten + // the next value. + if (iterator.hasCompleted()) { + shouldComplete = true; + } + if (result.done) { + destination.complete(); + return; + } + args.push(result.value); + } + if (this.project) { + this._tryProject(args); + } + else { + destination.next(args); + } + if (shouldComplete) { + destination.complete(); + } + }; + ZipSubscriber.prototype._tryProject = function (args) { + var result; + try { + result = this.project.apply(this, args); + } + catch (err) { + this.destination.error(err); + return; + } + this.destination.next(result); + }; + return ZipSubscriber; +}(Subscriber_1.Subscriber)); +exports.ZipSubscriber = ZipSubscriber; +var StaticIterator = (function () { + function StaticIterator(iterator) { + this.iterator = iterator; + this.nextResult = iterator.next(); + } + StaticIterator.prototype.hasValue = function () { + return true; + }; + StaticIterator.prototype.next = function () { + var result = this.nextResult; + this.nextResult = this.iterator.next(); + return result; + }; + StaticIterator.prototype.hasCompleted = function () { + var nextResult = this.nextResult; + return nextResult && nextResult.done; + }; + return StaticIterator; +}()); +var StaticArrayIterator = (function () { + function StaticArrayIterator(array) { + this.array = array; + this.index = 0; + this.length = 0; + this.length = array.length; + } + StaticArrayIterator.prototype[iterator_1.iterator] = function () { + return this; + }; + StaticArrayIterator.prototype.next = function (value) { + var i = this.index++; + var array = this.array; + return i < this.length ? { value: array[i], done: false } : { value: null, done: true }; + }; + StaticArrayIterator.prototype.hasValue = function () { + return this.array.length > this.index; + }; + StaticArrayIterator.prototype.hasCompleted = function () { + return this.array.length === this.index; + }; + return StaticArrayIterator; +}()); +/** + * We need this JSDoc comment for affecting ESDoc. + * @ignore + * @extends {Ignored} + */ +var ZipBufferIterator = (function (_super) { + __extends(ZipBufferIterator, _super); + function ZipBufferIterator(destination, parent, observable) { + _super.call(this, destination); + this.parent = parent; + this.observable = observable; + this.stillUnsubscribed = true; + this.buffer = []; + this.isComplete = false; + } + ZipBufferIterator.prototype[iterator_1.iterator] = function () { + return this; + }; + // NOTE: there is actually a name collision here with Subscriber.next and Iterator.next + // this is legit because `next()` will never be called by a subscription in this case. + ZipBufferIterator.prototype.next = function () { + var buffer = this.buffer; + if (buffer.length === 0 && this.isComplete) { + return { value: null, done: true }; + } + else { + return { value: buffer.shift(), done: false }; + } + }; + ZipBufferIterator.prototype.hasValue = function () { + return this.buffer.length > 0; + }; + ZipBufferIterator.prototype.hasCompleted = function () { + return this.buffer.length === 0 && this.isComplete; + }; + ZipBufferIterator.prototype.notifyComplete = function () { + if (this.buffer.length > 0) { + this.isComplete = true; + this.parent.notifyInactive(); + } + else { + this.destination.complete(); + } + }; + ZipBufferIterator.prototype.notifyNext = function (outerValue, innerValue, outerIndex, innerIndex, innerSub) { + this.buffer.push(innerValue); + this.parent.checkIterators(); + }; + ZipBufferIterator.prototype.subscribe = function (value, index) { + return subscribeToResult_1.subscribeToResult(this, this.observable, this, index); + }; + return ZipBufferIterator; +}(OuterSubscriber_1.OuterSubscriber)); +//# sourceMappingURL=zip.js.map + +/***/ }), +/* 152 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(26); + +/***/ }), +/* 153 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(62); + +/***/ }), +/* 154 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(65); + +/***/ }), +/* 155 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(82); + +/***/ }), +/* 156 */ +/***/ (function(module, exports, __webpack_require__) { + +module.exports = (__webpack_require__(3))(88); + +/***/ }), +/* 157 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @license Angular v4.2.5 + * (c) 2010-2017 Google, Inc. https://angular.io/ + * License: MIT + */ +(function (global, factory) { + true ? factory(exports, __webpack_require__(0), __webpack_require__(330), __webpack_require__(159), __webpack_require__(9), __webpack_require__(683), __webpack_require__(329), __webpack_require__(160), __webpack_require__(1), __webpack_require__(8), __webpack_require__(333), __webpack_require__(155), __webpack_require__(331), __webpack_require__(315)) : + typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/platform-browser', '@angular/animations/browser', '@angular/common', '@angular/compiler', '@angular/http', '@angular/platform-browser/animations', 'rxjs/Observable', 'rxjs/Subject', 'url', 'rxjs/operator/filter', 'rxjs/operator/first', 'rxjs/operator/toPromise'], factory) : + (factory((global.ng = global.ng || {}, global.ng.platformServer = global.ng.platformServer || {}),global.ng.core,global.ng.platformBrowser,global._angular_animations_browser,global.ng.common,global.ng.compiler,global._angular_http,global._angular_platformBrowser_animations,global.Rx,global.Rx,global.url,global.Rx.Observable.prototype,global.Rx.Observable.prototype,global.Rx.Observable.prototype)); +}(this, (function (exports,_angular_core,_angular_platformBrowser,_angular_animations_browser,_angular_common,_angular_compiler,_angular_http,_angular_platformBrowser_animations,rxjs_Observable,rxjs_Subject,url,rxjs_operator_filter,rxjs_operator_first,rxjs_operator_toPromise) { 'use strict'; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +/** + * @license Angular v4.2.5 + * (c) 2010-2017 Google, Inc. https://angular.io/ + * License: MIT + */ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var parse5 = __webpack_require__(142); +/** + * Representation of the current platform state. + * + * \@experimental + */ +var PlatformState = (function () { + /** + * @param {?} _doc + */ + function PlatformState(_doc) { + this._doc = _doc; + } + /** + * Renders the current state of the platform to string. + * @return {?} + */ + PlatformState.prototype.renderToString = function () { return _angular_platformBrowser.ɵgetDOM().getInnerHTML(this._doc); }; + /** + * Returns the current DOM state. + * @return {?} + */ + PlatformState.prototype.getDocument = function () { return this._doc; }; + return PlatformState; +}()); +PlatformState.decorators = [ + { type: _angular_core.Injectable }, +]; +/** + * @nocollapse + */ +PlatformState.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_platformBrowser.DOCUMENT,] },] }, +]; }; +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var xhr2 = __webpack_require__(680); +var isAbsoluteUrl = /^[a-zA-Z\-\+.]+:\/\//; +/** + * @param {?} url + * @return {?} + */ +function validateRequestUrl(url$$1) { + if (!isAbsoluteUrl.test(url$$1)) { + throw new Error("URLs requested via Http on the server must be absolute. URL: " + url$$1); + } +} +var ServerXhr = (function () { + function ServerXhr() { + } + /** + * @return {?} + */ + ServerXhr.prototype.build = function () { return new xhr2.XMLHttpRequest(); }; + return ServerXhr; +}()); +ServerXhr.decorators = [ + { type: _angular_core.Injectable }, +]; +/** + * @nocollapse + */ +ServerXhr.ctorParameters = function () { return []; }; +var ServerXsrfStrategy = (function () { + function ServerXsrfStrategy() { + } + /** + * @param {?} req + * @return {?} + */ + ServerXsrfStrategy.prototype.configureRequest = function (req) { }; + return ServerXsrfStrategy; +}()); +ServerXsrfStrategy.decorators = [ + { type: _angular_core.Injectable }, +]; +/** + * @nocollapse + */ +ServerXsrfStrategy.ctorParameters = function () { return []; }; +var ZoneMacroTaskConnection = (function () { + /** + * @param {?} request + * @param {?} backend + */ + function ZoneMacroTaskConnection(request, backend) { + var _this = this; + this.request = request; + validateRequestUrl(request.url); + this.response = new rxjs_Observable.Observable(function (observer) { + var task = null; + var scheduled = false; + var sub = null; + var savedResult = null; + var savedError = null; + var scheduleTask = function (_task) { + task = _task; + scheduled = true; + _this.lastConnection = backend.createConnection(request); + sub = _this.lastConnection.response + .subscribe(function (res) { return savedResult = res; }, function (err) { + if (!scheduled) { + throw new Error('invoke twice'); + } + savedError = err; + scheduled = false; + task.invoke(); + }, function () { + if (!scheduled) { + throw new Error('invoke twice'); + } + scheduled = false; + task.invoke(); + }); + }; + var cancelTask = function (_task) { + if (!scheduled) { + return; + } + scheduled = false; + if (sub) { + sub.unsubscribe(); + sub = null; + } + }; + var onComplete = function () { + if (savedError !== null) { + observer.error(savedError); + } + else { + observer.next(savedResult); + observer.complete(); + } + }; + // MockBackend is currently synchronous, which means that if scheduleTask is by + // scheduleMacroTask, the request will hit MockBackend and the response will be + // sent, causing task.invoke() to be called. + var _task = Zone.current.scheduleMacroTask('ZoneMacroTaskConnection.subscribe', onComplete, {}, function () { return null; }, cancelTask); + scheduleTask(_task); + return function () { + if (scheduled && task) { + task.zone.cancelTask(task); + scheduled = false; + } + if (sub) { + sub.unsubscribe(); + sub = null; + } + }; + }); + } + Object.defineProperty(ZoneMacroTaskConnection.prototype, "readyState", { + /** + * @return {?} + */ + get: function () { + return !!this.lastConnection ? this.lastConnection.readyState : _angular_http.ReadyState.Unsent; + }, + enumerable: true, + configurable: true + }); + return ZoneMacroTaskConnection; +}()); +var ZoneMacroTaskBackend = (function () { + /** + * @param {?} backend + */ + function ZoneMacroTaskBackend(backend) { + this.backend = backend; + } + /** + * @param {?} request + * @return {?} + */ + ZoneMacroTaskBackend.prototype.createConnection = function (request) { + return new ZoneMacroTaskConnection(request, this.backend); + }; + return ZoneMacroTaskBackend; +}()); +/** + * @param {?} xhrBackend + * @param {?} options + * @return {?} + */ +function httpFactory(xhrBackend, options) { + var /** @type {?} */ macroBackend = new ZoneMacroTaskBackend(xhrBackend); + return new _angular_http.Http(macroBackend, options); +} +var SERVER_HTTP_PROVIDERS = [ + { provide: _angular_http.Http, useFactory: httpFactory, deps: [_angular_http.XHRBackend, _angular_http.RequestOptions] }, + { provide: _angular_http.BrowserXhr, useClass: ServerXhr }, + { provide: _angular_http.XSRFStrategy, useClass: ServerXsrfStrategy }, +]; +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * The DI token for setting the initial config for the platform. + * + * \@experimental + */ +var INITIAL_CONFIG = new _angular_core.InjectionToken('Server.INITIAL_CONFIG'); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * @param {?} urlStr + * @return {?} + */ +function parseUrl(urlStr) { + var /** @type {?} */ parsedUrl = url.parse(urlStr); + return { + pathname: parsedUrl.pathname || '', + search: parsedUrl.search || '', + hash: parsedUrl.hash || '', + }; +} +/** + * Server-side implementation of URL state. Implements `pathname`, `search`, and `hash` + * but not the state stack. + */ +var ServerPlatformLocation = (function () { + /** + * @param {?} _doc + * @param {?} _config + */ + function ServerPlatformLocation(_doc, _config) { + this._doc = _doc; + this._path = '/'; + this._search = ''; + this._hash = ''; + this._hashUpdate = new rxjs_Subject.Subject(); + var config = _config; + if (!!config && !!config.url) { + var parsedUrl = parseUrl(config.url); + this._path = parsedUrl.pathname; + this._search = parsedUrl.search; + this._hash = parsedUrl.hash; + } + } + /** + * @return {?} + */ + ServerPlatformLocation.prototype.getBaseHrefFromDOM = function () { return ((_angular_platformBrowser.ɵgetDOM().getBaseHref(this._doc))); }; + /** + * @param {?} fn + * @return {?} + */ + ServerPlatformLocation.prototype.onPopState = function (fn) { + // No-op: a state stack is not implemented, so + // no events will ever come. + }; + /** + * @param {?} fn + * @return {?} + */ + ServerPlatformLocation.prototype.onHashChange = function (fn) { this._hashUpdate.subscribe(fn); }; + Object.defineProperty(ServerPlatformLocation.prototype, "pathname", { + /** + * @return {?} + */ + get: function () { return this._path; }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ServerPlatformLocation.prototype, "search", { + /** + * @return {?} + */ + get: function () { return this._search; }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ServerPlatformLocation.prototype, "hash", { + /** + * @return {?} + */ + get: function () { return this._hash; }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ServerPlatformLocation.prototype, "url", { + /** + * @return {?} + */ + get: function () { return "" + this.pathname + this.search + this.hash; }, + enumerable: true, + configurable: true + }); + /** + * @param {?} value + * @param {?} oldUrl + * @return {?} + */ + ServerPlatformLocation.prototype.setHash = function (value, oldUrl) { + var _this = this; + if (this._hash === value) { + // Don't fire events if the hash has not changed. + return; + } + this._hash = value; + var /** @type {?} */ newUrl = this.url; + scheduleMicroTask(function () { return _this._hashUpdate.next(/** @type {?} */ ({ type: 'hashchange', oldUrl: oldUrl, newUrl: newUrl })); }); + }; + /** + * @param {?} state + * @param {?} title + * @param {?} newUrl + * @return {?} + */ + ServerPlatformLocation.prototype.replaceState = function (state, title, newUrl) { + var /** @type {?} */ oldUrl = this.url; + var /** @type {?} */ parsedUrl = parseUrl(newUrl); + this._path = parsedUrl.pathname; + this._search = parsedUrl.search; + this.setHash(parsedUrl.hash, oldUrl); + }; + /** + * @param {?} state + * @param {?} title + * @param {?} newUrl + * @return {?} + */ + ServerPlatformLocation.prototype.pushState = function (state, title, newUrl) { + this.replaceState(state, title, newUrl); + }; + /** + * @return {?} + */ + ServerPlatformLocation.prototype.forward = function () { throw new Error('Not implemented'); }; + /** + * @return {?} + */ + ServerPlatformLocation.prototype.back = function () { throw new Error('Not implemented'); }; + return ServerPlatformLocation; +}()); +ServerPlatformLocation.decorators = [ + { type: _angular_core.Injectable }, +]; +/** + * @nocollapse + */ +ServerPlatformLocation.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_platformBrowser.DOCUMENT,] },] }, + { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [INITIAL_CONFIG,] },] }, +]; }; +/** + * @param {?} fn + * @return {?} + */ +function scheduleMicroTask(fn) { + Zone.current.scheduleMicroTask('scheduleMicrotask', fn); +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var parse5$1 = __webpack_require__(142); +var treeAdapter; +var _attrToPropMap = { + 'class': 'className', + 'innerHtml': 'innerHTML', + 'readonly': 'readOnly', + 'tabindex': 'tabIndex', +}; +var mapProps = ['attribs', 'x-attribsNamespace', 'x-attribsPrefix']; +/** + * @param {?} methodName + * @return {?} + */ +function _notImplemented(methodName) { + return new Error('This method is not implemented in Parse5DomAdapter: ' + methodName); +} +/** + * @param {?} el + * @param {?} name + * @return {?} + */ +function _getElement(el, name) { + for (var /** @type {?} */ i = 0; i < el.childNodes.length; i++) { + var /** @type {?} */ node = el.childNodes[i]; + if (node.name === name) { + return node; + } + } + return null; +} +/** + * Parses a document string to a Document object. + * @param {?} html + * @return {?} + */ +function parseDocument(html) { + var /** @type {?} */ doc = parse5$1.parse(html, { treeAdapter: parse5$1.treeAdapters.htmlparser2 }); + var /** @type {?} */ docElement = _getElement(doc, 'html'); + doc['head'] = _getElement(docElement, 'head'); + doc['body'] = _getElement(docElement, 'body'); + doc['_window'] = {}; + return doc; +} +/** + * A `DomAdapter` powered by the `parse5` NodeJS module. + * + * \@security Tread carefully! Interacting with the DOM directly is dangerous and + * can introduce XSS risks. + */ +var Parse5DomAdapter = (function (_super) { + __extends(Parse5DomAdapter, _super); + function Parse5DomAdapter() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @return {?} + */ + Parse5DomAdapter.makeCurrent = function () { + treeAdapter = parse5$1.treeAdapters.htmlparser2; + _angular_platformBrowser.ɵsetRootDomAdapter(new Parse5DomAdapter()); + }; + /** + * @param {?} nodeA + * @param {?} nodeB + * @return {?} + */ + Parse5DomAdapter.prototype.contains = function (nodeA, nodeB) { + var /** @type {?} */ inner = nodeB; + while (inner) { + if (inner === nodeA) + return true; + inner = inner.parent; + } + return false; + }; + /** + * @param {?} element + * @param {?} name + * @return {?} + */ + Parse5DomAdapter.prototype.hasProperty = function (element, name) { + return _HTMLElementPropertyList.indexOf(name) > -1; + }; + /** + * @param {?} el + * @param {?} name + * @param {?} value + * @return {?} + */ + Parse5DomAdapter.prototype.setProperty = function (el, name, value) { + if (name === 'innerHTML') { + this.setInnerHTML(el, value); + } + else if (name === 'innerText') { + this.setText(el, value); + } + else if (name === 'className') { + el.attribs['class'] = el.className = value; + } + else { + el[name] = value; + } + }; + /** + * @param {?} el + * @param {?} name + * @return {?} + */ + Parse5DomAdapter.prototype.getProperty = function (el, name) { return el[name]; }; + /** + * @param {?} error + * @return {?} + */ + Parse5DomAdapter.prototype.logError = function (error) { console.error(error); }; + /** + * @param {?} error + * @return {?} + */ + Parse5DomAdapter.prototype.log = function (error) { console.log(error); }; + /** + * @param {?} error + * @return {?} + */ + Parse5DomAdapter.prototype.logGroup = function (error) { console.error(error); }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.logGroupEnd = function () { }; + Object.defineProperty(Parse5DomAdapter.prototype, "attrToPropMap", { + /** + * @return {?} + */ + get: function () { return _attrToPropMap; }, + enumerable: true, + configurable: true + }); + /** + * @param {?} el + * @param {?} selector + * @return {?} + */ + Parse5DomAdapter.prototype.querySelector = function (el, selector) { + return this.querySelectorAll(el, selector)[0] || null; + }; + /** + * @param {?} el + * @param {?} selector + * @return {?} + */ + Parse5DomAdapter.prototype.querySelectorAll = function (el, selector) { + var _this = this; + var /** @type {?} */ res = []; + var /** @type {?} */ _recursive = function (result, node, selector, matcher) { + var /** @type {?} */ cNodes = node.childNodes; + if (cNodes && cNodes.length > 0) { + for (var /** @type {?} */ i = 0; i < cNodes.length; i++) { + var /** @type {?} */ childNode = cNodes[i]; + if (_this.elementMatches(childNode, selector, matcher)) { + result.push(childNode); + } + _recursive(result, childNode, selector, matcher); + } + } + }; + var /** @type {?} */ matcher = new _angular_compiler.SelectorMatcher(); + matcher.addSelectables(_angular_compiler.CssSelector.parse(selector)); + _recursive(res, el, selector, matcher); + return res; + }; + /** + * @param {?} node + * @param {?} selector + * @param {?=} matcher + * @return {?} + */ + Parse5DomAdapter.prototype.elementMatches = function (node, selector, matcher) { + if (matcher === void 0) { matcher = null; } + if (this.isElementNode(node) && selector === '*') { + return true; + } + var /** @type {?} */ result = false; + if (selector && selector.charAt(0) == '#') { + result = this.getAttribute(node, 'id') == selector.substring(1); + } + else if (selector) { + if (!matcher) { + matcher = new _angular_compiler.SelectorMatcher(); + matcher.addSelectables(_angular_compiler.CssSelector.parse(selector)); + } + var /** @type {?} */ cssSelector = new _angular_compiler.CssSelector(); + cssSelector.setElement(this.tagName(node)); + if (node.attribs) { + for (var /** @type {?} */ attrName in node.attribs) { + cssSelector.addAttribute(attrName, node.attribs[attrName]); + } + } + var /** @type {?} */ classList = this.classList(node); + for (var /** @type {?} */ i = 0; i < classList.length; i++) { + cssSelector.addClassName(classList[i]); + } + matcher.match(cssSelector, function (selector, cb) { result = true; }); + } + return result; + }; + /** + * @param {?} el + * @param {?} evt + * @param {?} listener + * @return {?} + */ + Parse5DomAdapter.prototype.on = function (el, evt, listener) { + var /** @type {?} */ listenersMap = el._eventListenersMap; + if (!listenersMap) { + listenersMap = {}; + el._eventListenersMap = listenersMap; + } + var /** @type {?} */ listeners = listenersMap[evt] || []; + listenersMap[evt] = listeners.concat([listener]); + }; + /** + * @param {?} el + * @param {?} evt + * @param {?} listener + * @return {?} + */ + Parse5DomAdapter.prototype.onAndCancel = function (el, evt, listener) { + this.on(el, evt, listener); + return function () { remove(/** @type {?} */ ((el._eventListenersMap[evt])), listener); }; + }; + /** + * @param {?} el + * @param {?} evt + * @return {?} + */ + Parse5DomAdapter.prototype.dispatchEvent = function (el, evt) { + if (!evt.target) { + evt.target = el; + } + if (el._eventListenersMap) { + var /** @type {?} */ listeners = el._eventListenersMap[evt.type]; + if (listeners) { + for (var /** @type {?} */ i = 0; i < listeners.length; i++) { + listeners[i](evt); + } + } + } + if (el.parent) { + this.dispatchEvent(el.parent, evt); + } + if (el._window) { + this.dispatchEvent(el._window, evt); + } + }; + /** + * @param {?} eventType + * @return {?} + */ + Parse5DomAdapter.prototype.createMouseEvent = function (eventType) { return this.createEvent(eventType); }; + /** + * @param {?} eventType + * @return {?} + */ + Parse5DomAdapter.prototype.createEvent = function (eventType) { + var /** @type {?} */ event = ({ + type: eventType, + defaultPrevented: false, + preventDefault: function () { ((event)).defaultPrevented = true; } + }); + return event; + }; + /** + * @param {?} event + * @return {?} + */ + Parse5DomAdapter.prototype.preventDefault = function (event) { event.returnValue = false; }; + /** + * @param {?} event + * @return {?} + */ + Parse5DomAdapter.prototype.isPrevented = function (event) { return event.returnValue != null && !event.returnValue; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getInnerHTML = function (el) { + return parse5$1.serialize(this.templateAwareRoot(el), { treeAdapter: treeAdapter }); + }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getTemplateContent = function (el) { return null; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getOuterHTML = function (el) { + var /** @type {?} */ fragment = treeAdapter.createDocumentFragment(); + this.appendChild(fragment, el); + return parse5$1.serialize(fragment, { treeAdapter: treeAdapter }); + }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.nodeName = function (node) { return node.tagName; }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.nodeValue = function (node) { return node.nodeValue; }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.type = function (node) { throw _notImplemented('type'); }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.content = function (node) { return node.childNodes[0]; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.firstChild = function (el) { return el.firstChild; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.nextSibling = function (el) { return el.nextSibling; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.parentElement = function (el) { return el.parent; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.childNodes = function (el) { return el.childNodes; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.childNodesAsList = function (el) { + var /** @type {?} */ childNodes = el.childNodes; + var /** @type {?} */ res = new Array(childNodes.length); + for (var /** @type {?} */ i = 0; i < childNodes.length; i++) { + res[i] = childNodes[i]; + } + return res; + }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.clearNodes = function (el) { + while (el.childNodes.length > 0) { + this.remove(el.childNodes[0]); + } + }; + /** + * @param {?} el + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.appendChild = function (el, node) { + this.remove(node); + treeAdapter.appendChild(this.templateAwareRoot(el), node); + }; + /** + * @param {?} el + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.removeChild = function (el, node) { + if (el.childNodes.indexOf(node) > -1) { + this.remove(node); + } + }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.remove = function (el) { + var /** @type {?} */ parent = el.parent; + if (parent) { + var /** @type {?} */ index = parent.childNodes.indexOf(el); + parent.childNodes.splice(index, 1); + } + var /** @type {?} */ prev = el.previousSibling; + var /** @type {?} */ next = el.nextSibling; + if (prev) { + prev.next = next; + } + if (next) { + next.prev = prev; + } + el.prev = null; + el.next = null; + el.parent = null; + return el; + }; + /** + * @param {?} parent + * @param {?} ref + * @param {?} newNode + * @return {?} + */ + Parse5DomAdapter.prototype.insertBefore = function (parent, ref, newNode) { + this.remove(newNode); + if (ref) { + treeAdapter.insertBefore(parent, newNode, ref); + } + else { + this.appendChild(parent, newNode); + } + }; + /** + * @param {?} parent + * @param {?} ref + * @param {?} nodes + * @return {?} + */ + Parse5DomAdapter.prototype.insertAllBefore = function (parent, ref, nodes) { + var _this = this; + nodes.forEach(function (n) { return _this.insertBefore(parent, ref, n); }); + }; + /** + * @param {?} parent + * @param {?} ref + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.insertAfter = function (parent, ref, node) { + if (ref.nextSibling) { + this.insertBefore(parent, ref.nextSibling, node); + } + else { + this.appendChild(parent, node); + } + }; + /** + * @param {?} el + * @param {?} value + * @return {?} + */ + Parse5DomAdapter.prototype.setInnerHTML = function (el, value) { + this.clearNodes(el); + var /** @type {?} */ content = parse5$1.parseFragment(value, { treeAdapter: treeAdapter }); + for (var /** @type {?} */ i = 0; i < content.childNodes.length; i++) { + treeAdapter.appendChild(el, content.childNodes[i]); + } + }; + /** + * @param {?} el + * @param {?=} isRecursive + * @return {?} + */ + Parse5DomAdapter.prototype.getText = function (el, isRecursive) { + if (this.isTextNode(el)) { + return el.data; + } + if (this.isCommentNode(el)) { + // In the DOM, comments within an element return an empty string for textContent + // However, comment node instances return the comment content for textContent getter + return isRecursive ? '' : el.data; + } + if (!el.childNodes || el.childNodes.length == 0) { + return ''; + } + var /** @type {?} */ textContent = ''; + for (var /** @type {?} */ i = 0; i < el.childNodes.length; i++) { + textContent += this.getText(el.childNodes[i], true); + } + return textContent; + }; + /** + * @param {?} el + * @param {?} value + * @return {?} + */ + Parse5DomAdapter.prototype.setText = function (el, value) { + if (this.isTextNode(el) || this.isCommentNode(el)) { + el.data = value; + } + else { + this.clearNodes(el); + if (value !== '') + treeAdapter.insertText(el, value); + } + }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getValue = function (el) { return el.value; }; + /** + * @param {?} el + * @param {?} value + * @return {?} + */ + Parse5DomAdapter.prototype.setValue = function (el, value) { el.value = value; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getChecked = function (el) { return el.checked; }; + /** + * @param {?} el + * @param {?} value + * @return {?} + */ + Parse5DomAdapter.prototype.setChecked = function (el, value) { el.checked = value; }; + /** + * @param {?} text + * @return {?} + */ + Parse5DomAdapter.prototype.createComment = function (text) { return treeAdapter.createCommentNode(text); }; + /** + * @param {?} html + * @return {?} + */ + Parse5DomAdapter.prototype.createTemplate = function (html) { + var /** @type {?} */ template = treeAdapter.createElement('template', 'http://www.w3.org/1999/xhtml', []); + var /** @type {?} */ content = parse5$1.parseFragment(html, { treeAdapter: treeAdapter }); + treeAdapter.setTemplateContent(template, content); + return template; + }; + /** + * @param {?} tagName + * @return {?} + */ + Parse5DomAdapter.prototype.createElement = function (tagName) { + return treeAdapter.createElement(tagName, 'http://www.w3.org/1999/xhtml', []); + }; + /** + * @param {?} ns + * @param {?} tagName + * @return {?} + */ + Parse5DomAdapter.prototype.createElementNS = function (ns, tagName) { + return treeAdapter.createElement(tagName, ns, []); + }; + /** + * @param {?} text + * @return {?} + */ + Parse5DomAdapter.prototype.createTextNode = function (text) { + var /** @type {?} */ t = (this.createComment(text)); + t.type = 'text'; + return t; + }; + /** + * @param {?} attrName + * @param {?} attrValue + * @return {?} + */ + Parse5DomAdapter.prototype.createScriptTag = function (attrName, attrValue) { + return treeAdapter.createElement('script', 'http://www.w3.org/1999/xhtml', [{ name: attrName, value: attrValue }]); + }; + /** + * @param {?} css + * @return {?} + */ + Parse5DomAdapter.prototype.createStyleElement = function (css) { + var /** @type {?} */ style = this.createElement('style'); + this.setText(style, css); + return (style); + }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.createShadowRoot = function (el) { + el.shadowRoot = treeAdapter.createDocumentFragment(); + el.shadowRoot.parent = el; + return el.shadowRoot; + }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getShadowRoot = function (el) { return el.shadowRoot; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getHost = function (el) { return el.host; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getDistributedNodes = function (el) { throw _notImplemented('getDistributedNodes'); }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.clone = function (node) { + var /** @type {?} */ _recursive = function (node) { + var /** @type {?} */ nodeClone = Object.create(Object.getPrototypeOf(node)); + for (var /** @type {?} */ prop in node) { + var /** @type {?} */ desc = Object.getOwnPropertyDescriptor(node, prop); + if (desc && 'value' in desc && typeof desc.value !== 'object') { + nodeClone[prop] = node[prop]; + } + } + nodeClone.parent = null; + nodeClone.prev = null; + nodeClone.next = null; + nodeClone.children = null; + mapProps.forEach(function (mapName) { + if (node[mapName] != null) { + nodeClone[mapName] = {}; + for (var /** @type {?} */ prop in node[mapName]) { + nodeClone[mapName][prop] = node[mapName][prop]; + } + } + }); + var /** @type {?} */ cNodes = node.children; + if (cNodes) { + var /** @type {?} */ cNodesClone = new Array(cNodes.length); + for (var /** @type {?} */ i = 0; i < cNodes.length; i++) { + var /** @type {?} */ childNode = cNodes[i]; + var /** @type {?} */ childNodeClone = _recursive(childNode); + cNodesClone[i] = childNodeClone; + if (i > 0) { + childNodeClone.prev = cNodesClone[i - 1]; + cNodesClone[i - 1].next = childNodeClone; + } + childNodeClone.parent = nodeClone; + } + nodeClone.children = cNodesClone; + } + return nodeClone; + }; + return _recursive(node); + }; + /** + * @param {?} element + * @param {?} name + * @return {?} + */ + Parse5DomAdapter.prototype.getElementsByClassName = function (element, name) { + return this.querySelectorAll(element, '.' + name); + }; + /** + * @param {?} element + * @param {?} name + * @return {?} + */ + Parse5DomAdapter.prototype.getElementsByTagName = function (element, name) { + return this.querySelectorAll(element, name); + }; + /** + * @param {?} element + * @return {?} + */ + Parse5DomAdapter.prototype.classList = function (element) { + var /** @type {?} */ classAttrValue = null; + var /** @type {?} */ attributes = element.attribs; + if (attributes && attributes['class'] != null) { + classAttrValue = attributes['class']; + } + return classAttrValue ? classAttrValue.trim().split(/\s+/g) : []; + }; + /** + * @param {?} element + * @param {?} className + * @return {?} + */ + Parse5DomAdapter.prototype.addClass = function (element, className) { + var /** @type {?} */ classList = this.classList(element); + var /** @type {?} */ index = classList.indexOf(className); + if (index == -1) { + classList.push(className); + element.attribs['class'] = element.className = classList.join(' '); + } + }; + /** + * @param {?} element + * @param {?} className + * @return {?} + */ + Parse5DomAdapter.prototype.removeClass = function (element, className) { + var /** @type {?} */ classList = this.classList(element); + var /** @type {?} */ index = classList.indexOf(className); + if (index > -1) { + classList.splice(index, 1); + element.attribs['class'] = element.className = classList.join(' '); + } + }; + /** + * @param {?} element + * @param {?} className + * @return {?} + */ + Parse5DomAdapter.prototype.hasClass = function (element, className) { + return this.classList(element).indexOf(className) > -1; + }; + /** + * @param {?} element + * @param {?} styleName + * @param {?=} styleValue + * @return {?} + */ + Parse5DomAdapter.prototype.hasStyle = function (element, styleName, styleValue) { + var /** @type {?} */ value = this.getStyle(element, styleName) || ''; + return styleValue ? value == styleValue : value.length > 0; + }; + /** + * \@internal + * @param {?} element + * @return {?} + */ + Parse5DomAdapter.prototype._readStyleAttribute = function (element) { + var /** @type {?} */ styleMap = {}; + var /** @type {?} */ attributes = element.attribs; + if (attributes && attributes['style'] != null) { + var /** @type {?} */ styleAttrValue = attributes['style']; + var /** @type {?} */ styleList = styleAttrValue.split(/;+/g); + for (var /** @type {?} */ i = 0; i < styleList.length; i++) { + if (styleList[i].length > 0) { + var /** @type {?} */ style = (styleList[i]); + var /** @type {?} */ colon = style.indexOf(':'); + if (colon === -1) { + throw new Error("Invalid CSS style: " + style); + } + ((styleMap))[style.substr(0, colon).trim()] = style.substr(colon + 1).trim(); + } + } + } + return styleMap; + }; + /** + * \@internal + * @param {?} element + * @param {?} styleMap + * @return {?} + */ + Parse5DomAdapter.prototype._writeStyleAttribute = function (element, styleMap) { + var /** @type {?} */ styleAttrValue = ''; + for (var /** @type {?} */ key in styleMap) { + var /** @type {?} */ newValue = styleMap[key]; + if (newValue) { + styleAttrValue += key + ':' + styleMap[key] + ';'; + } + } + element.attribs['style'] = styleAttrValue; + }; + /** + * @param {?} element + * @param {?} styleName + * @param {?=} styleValue + * @return {?} + */ + Parse5DomAdapter.prototype.setStyle = function (element, styleName, styleValue) { + var /** @type {?} */ styleMap = this._readStyleAttribute(element); + ((styleMap))[styleName] = styleValue; + this._writeStyleAttribute(element, styleMap); + }; + /** + * @param {?} element + * @param {?} styleName + * @return {?} + */ + Parse5DomAdapter.prototype.removeStyle = function (element, styleName) { this.setStyle(element, styleName, null); }; + /** + * @param {?} element + * @param {?} styleName + * @return {?} + */ + Parse5DomAdapter.prototype.getStyle = function (element, styleName) { + var /** @type {?} */ styleMap = this._readStyleAttribute(element); + return styleMap.hasOwnProperty(styleName) ? ((styleMap))[styleName] : ''; + }; + /** + * @param {?} element + * @return {?} + */ + Parse5DomAdapter.prototype.tagName = function (element) { return element.tagName == 'style' ? 'STYLE' : element.tagName; }; + /** + * @param {?} element + * @return {?} + */ + Parse5DomAdapter.prototype.attributeMap = function (element) { + var /** @type {?} */ res = new Map(); + var /** @type {?} */ elAttrs = treeAdapter.getAttrList(element); + for (var /** @type {?} */ i = 0; i < elAttrs.length; i++) { + var /** @type {?} */ attrib = elAttrs[i]; + res.set(attrib.name, attrib.value); + } + return res; + }; + /** + * @param {?} element + * @param {?} attribute + * @return {?} + */ + Parse5DomAdapter.prototype.hasAttribute = function (element, attribute) { + return element.attribs && element.attribs[attribute] != null; + }; + /** + * @param {?} element + * @param {?} ns + * @param {?} attribute + * @return {?} + */ + Parse5DomAdapter.prototype.hasAttributeNS = function (element, ns, attribute) { + return this.hasAttribute(element, attribute); + }; + /** + * @param {?} element + * @param {?} attribute + * @return {?} + */ + Parse5DomAdapter.prototype.getAttribute = function (element, attribute) { + return this.hasAttribute(element, attribute) ? element.attribs[attribute] : null; + }; + /** + * @param {?} element + * @param {?} ns + * @param {?} attribute + * @return {?} + */ + Parse5DomAdapter.prototype.getAttributeNS = function (element, ns, attribute) { + return this.getAttribute(element, attribute); + }; + /** + * @param {?} element + * @param {?} attribute + * @param {?} value + * @return {?} + */ + Parse5DomAdapter.prototype.setAttribute = function (element, attribute, value) { + if (attribute) { + element.attribs[attribute] = value; + if (attribute === 'class') { + element.className = value; + } + } + }; + /** + * @param {?} element + * @param {?} ns + * @param {?} attribute + * @param {?} value + * @return {?} + */ + Parse5DomAdapter.prototype.setAttributeNS = function (element, ns, attribute, value) { + this.setAttribute(element, attribute, value); + }; + /** + * @param {?} element + * @param {?} attribute + * @return {?} + */ + Parse5DomAdapter.prototype.removeAttribute = function (element, attribute) { + if (attribute) { + delete element.attribs[attribute]; + } + }; + /** + * @param {?} element + * @param {?} ns + * @param {?} name + * @return {?} + */ + Parse5DomAdapter.prototype.removeAttributeNS = function (element, ns, name) { throw 'not implemented'; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.templateAwareRoot = function (el) { + return this.isTemplateElement(el) ? treeAdapter.getTemplateContent(el) : el; + }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.createHtmlDocument = function () { + var /** @type {?} */ newDoc = treeAdapter.createDocument(); + newDoc.title = 'fakeTitle'; + var /** @type {?} */ head = treeAdapter.createElement('head', null, []); + var /** @type {?} */ body = treeAdapter.createElement('body', 'http://www.w3.org/1999/xhtml', []); + this.appendChild(newDoc, head); + this.appendChild(newDoc, body); + newDoc['head'] = head; + newDoc['body'] = body; + newDoc['_window'] = {}; + return newDoc; + }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getBoundingClientRect = function (el) { return { left: 0, top: 0, width: 0, height: 0 }; }; + /** + * @param {?} doc + * @return {?} + */ + Parse5DomAdapter.prototype.getTitle = function (doc) { return this.getText(this.getTitleNode(doc)) || ''; }; + /** + * @param {?} doc + * @param {?} newTitle + * @return {?} + */ + Parse5DomAdapter.prototype.setTitle = function (doc, newTitle) { + this.setText(this.getTitleNode(doc), newTitle || ''); + }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.isTemplateElement = function (el) { + return this.isElementNode(el) && this.tagName(el) === 'template'; + }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.isTextNode = function (node) { return treeAdapter.isTextNode(node); }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.isCommentNode = function (node) { return treeAdapter.isCommentNode(node); }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.isElementNode = function (node) { return node ? treeAdapter.isElementNode(node) : false; }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.hasShadowRoot = function (node) { return node.shadowRoot != null; }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.isShadowRoot = function (node) { return this.getShadowRoot(node) == node; }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.importIntoDoc = function (node) { return this.clone(node); }; + /** + * @param {?} node + * @return {?} + */ + Parse5DomAdapter.prototype.adoptNode = function (node) { return node; }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getHref = function (el) { return this.getAttribute(el, 'href'); }; + /** + * @param {?} el + * @param {?} baseUrl + * @param {?} href + * @return {?} + */ + Parse5DomAdapter.prototype.resolveAndSetHref = function (el, baseUrl, href) { + if (href == null) { + el.href = baseUrl; + } + else { + el.href = baseUrl + '/../' + href; + } + }; + /** + * \@internal + * @param {?} parsedRules + * @param {?=} css + * @return {?} + */ + Parse5DomAdapter.prototype._buildRules = function (parsedRules, css) { + var /** @type {?} */ rules = []; + for (var /** @type {?} */ i = 0; i < parsedRules.length; i++) { + var /** @type {?} */ parsedRule = parsedRules[i]; + var /** @type {?} */ rule = {}; + rule['cssText'] = css; + rule['style'] = { content: '', cssText: '' }; + if (parsedRule.type == 'rule') { + rule['type'] = 1; + rule['selectorText'] = + parsedRule.selectors.join(', '.replace(/\s{2,}/g, ' ') + .replace(/\s*~\s*/g, ' ~ ') + .replace(/\s*\+\s*/g, ' + ') + .replace(/\s*>\s*/g, ' > ') + .replace(/\[(\w+)=(\w+)\]/g, '[$1="$2"]')); + if (parsedRule.declarations == null) { + continue; + } + for (var /** @type {?} */ j = 0; j < parsedRule.declarations.length; j++) { + var /** @type {?} */ declaration = parsedRule.declarations[j]; + rule['style'] = declaration.property[declaration.value]; + rule['style'].cssText += declaration.property + ': ' + declaration.value + ';'; + } + } + else if (parsedRule.type == 'media') { + rule['type'] = 4; + rule['media'] = { mediaText: parsedRule.media }; + if (parsedRule.rules) { + rule['cssRules'] = this._buildRules(parsedRule.rules); + } + } + rules.push(rule); + } + return rules; + }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.supportsDOMEvents = function () { return false; }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.supportsNativeShadowDOM = function () { return false; }; + /** + * @param {?} doc + * @param {?} target + * @return {?} + */ + Parse5DomAdapter.prototype.getGlobalEventTarget = function (doc, target) { + if (target == 'window') { + return ((doc))._window; + } + else if (target == 'document') { + return doc; + } + else if (target == 'body') { + return doc.body; + } + }; + /** + * @param {?} doc + * @return {?} + */ + Parse5DomAdapter.prototype.getBaseHref = function (doc) { + var /** @type {?} */ base = this.querySelector(doc, 'base'); + var /** @type {?} */ href = ''; + if (base) { + href = this.getHref(base); + } + // TODO(alxhub): Need relative path logic from BrowserDomAdapter here? + return href == null ? null : href; + }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.resetBaseElement = function () { throw 'not implemented'; }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.getHistory = function () { throw 'not implemented'; }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.getLocation = function () { throw 'not implemented'; }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.getUserAgent = function () { return 'Fake user agent'; }; + /** + * @param {?} el + * @param {?} name + * @return {?} + */ + Parse5DomAdapter.prototype.getData = function (el, name) { return this.getAttribute(el, 'data-' + name); }; + /** + * @param {?} el + * @return {?} + */ + Parse5DomAdapter.prototype.getComputedStyle = function (el) { throw 'not implemented'; }; + /** + * @param {?} el + * @param {?} name + * @param {?} value + * @return {?} + */ + Parse5DomAdapter.prototype.setData = function (el, name, value) { this.setAttribute(el, 'data-' + name, value); }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.supportsWebAnimation = function () { return false; }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.performanceNow = function () { return Date.now(); }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.getAnimationPrefix = function () { return ''; }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.getTransitionEnd = function () { return 'transitionend'; }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.supportsAnimation = function () { return true; }; + /** + * @param {?} el + * @param {?} newNode + * @param {?} oldNode + * @return {?} + */ + Parse5DomAdapter.prototype.replaceChild = function (el, newNode, oldNode) { throw new Error('not implemented'); }; + /** + * @param {?} templateHtml + * @return {?} + */ + Parse5DomAdapter.prototype.parse = function (templateHtml) { throw new Error('not implemented'); }; + /** + * @param {?} el + * @param {?} methodName + * @param {?} args + * @return {?} + */ + Parse5DomAdapter.prototype.invoke = function (el, methodName, args) { throw new Error('not implemented'); }; + /** + * @param {?} event + * @return {?} + */ + Parse5DomAdapter.prototype.getEventKey = function (event) { throw new Error('not implemented'); }; + /** + * @return {?} + */ + Parse5DomAdapter.prototype.supportsCookies = function () { return false; }; + /** + * @param {?} name + * @return {?} + */ + Parse5DomAdapter.prototype.getCookie = function (name) { throw new Error('not implemented'); }; + /** + * @param {?} name + * @param {?} value + * @return {?} + */ + Parse5DomAdapter.prototype.setCookie = function (name, value) { throw new Error('not implemented'); }; + /** + * @param {?} element + * @param {?} keyframes + * @param {?} options + * @return {?} + */ + Parse5DomAdapter.prototype.animate = function (element, keyframes, options) { throw new Error('not implemented'); }; + /** + * @param {?} doc + * @return {?} + */ + Parse5DomAdapter.prototype.getTitleNode = function (doc) { + var /** @type {?} */ title = this.querySelector(doc, 'title'); + if (!title) { + title = (this.createElement('title')); + this.appendChild(this.querySelector(doc, 'head'), title); + } + return title; + }; + return Parse5DomAdapter; +}(_angular_platformBrowser.ɵDomAdapter)); +// TODO: build a proper list, this one is all the keys of a HTMLInputElement +var _HTMLElementPropertyList = [ + 'webkitEntries', + 'incremental', + 'webkitdirectory', + 'selectionDirection', + 'selectionEnd', + 'selectionStart', + 'labels', + 'validationMessage', + 'validity', + 'willValidate', + 'width', + 'valueAsNumber', + 'valueAsDate', + 'value', + 'useMap', + 'defaultValue', + 'type', + 'step', + 'src', + 'size', + 'required', + 'readOnly', + 'placeholder', + 'pattern', + 'name', + 'multiple', + 'min', + 'minLength', + 'maxLength', + 'max', + 'list', + 'indeterminate', + 'height', + 'formTarget', + 'formNoValidate', + 'formMethod', + 'formEnctype', + 'formAction', + 'files', + 'form', + 'disabled', + 'dirName', + 'checked', + 'defaultChecked', + 'autofocus', + 'autocomplete', + 'alt', + 'align', + 'accept', + 'onautocompleteerror', + 'onautocomplete', + 'onwaiting', + 'onvolumechange', + 'ontoggle', + 'ontimeupdate', + 'onsuspend', + 'onsubmit', + 'onstalled', + 'onshow', + 'onselect', + 'onseeking', + 'onseeked', + 'onscroll', + 'onresize', + 'onreset', + 'onratechange', + 'onprogress', + 'onplaying', + 'onplay', + 'onpause', + 'onmousewheel', + 'onmouseup', + 'onmouseover', + 'onmouseout', + 'onmousemove', + 'onmouseleave', + 'onmouseenter', + 'onmousedown', + 'onloadstart', + 'onloadedmetadata', + 'onloadeddata', + 'onload', + 'onkeyup', + 'onkeypress', + 'onkeydown', + 'oninvalid', + 'oninput', + 'onfocus', + 'onerror', + 'onended', + 'onemptied', + 'ondurationchange', + 'ondrop', + 'ondragstart', + 'ondragover', + 'ondragleave', + 'ondragenter', + 'ondragend', + 'ondrag', + 'ondblclick', + 'oncuechange', + 'oncontextmenu', + 'onclose', + 'onclick', + 'onchange', + 'oncanplaythrough', + 'oncanplay', + 'oncancel', + 'onblur', + 'onabort', + 'spellcheck', + 'isContentEditable', + 'contentEditable', + 'outerText', + 'innerText', + 'accessKey', + 'hidden', + 'webkitdropzone', + 'draggable', + 'tabIndex', + 'dir', + 'translate', + 'lang', + 'title', + 'childElementCount', + 'lastElementChild', + 'firstElementChild', + 'children', + 'onwebkitfullscreenerror', + 'onwebkitfullscreenchange', + 'nextElementSibling', + 'previousElementSibling', + 'onwheel', + 'onselectstart', + 'onsearch', + 'onpaste', + 'oncut', + 'oncopy', + 'onbeforepaste', + 'onbeforecut', + 'onbeforecopy', + 'shadowRoot', + 'dataset', + 'classList', + 'className', + 'outerHTML', + 'innerHTML', + 'scrollHeight', + 'scrollWidth', + 'scrollTop', + 'scrollLeft', + 'clientHeight', + 'clientWidth', + 'clientTop', + 'clientLeft', + 'offsetParent', + 'offsetHeight', + 'offsetWidth', + 'offsetTop', + 'offsetLeft', + 'localName', + 'prefix', + 'namespaceURI', + 'id', + 'style', + 'attributes', + 'tagName', + 'parentElement', + 'textContent', + 'baseURI', + 'ownerDocument', + 'nextSibling', + 'previousSibling', + 'lastChild', + 'firstChild', + 'childNodes', + 'parentNode', + 'nodeType', + 'nodeValue', + 'nodeName', + 'closure_lm_714617', + '__jsaction', +]; +/** + * @template T + * @param {?} list + * @param {?} el + * @return {?} + */ +function remove(list, el) { + var /** @type {?} */ index = list.indexOf(el); + if (index > -1) { + list.splice(index, 1); + } +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var EMPTY_ARRAY = []; +var ServerRendererFactory2 = (function () { + /** + * @param {?} ngZone + * @param {?} document + * @param {?} sharedStylesHost + */ + function ServerRendererFactory2(ngZone, document, sharedStylesHost) { + this.ngZone = ngZone; + this.document = document; + this.sharedStylesHost = sharedStylesHost; + this.rendererByCompId = new Map(); + this.schema = new _angular_compiler.DomElementSchemaRegistry(); + this.defaultRenderer = new DefaultServerRenderer2(document, ngZone, this.schema); + } + + /** + * @param {?} element + * @param {?} type + * @return {?} + */ + ServerRendererFactory2.prototype.createRenderer = function (element, type) { + if (!element || !type) { + return this.defaultRenderer; + } + switch (type.encapsulation) { + case _angular_core.ViewEncapsulation.Native: + case _angular_core.ViewEncapsulation.Emulated: { + var /** @type {?} */ renderer = this.rendererByCompId.get(type.id); + if (!renderer) { + renderer = new EmulatedEncapsulationServerRenderer2(this.document, this.ngZone, this.sharedStylesHost, this.schema, type); + this.rendererByCompId.set(type.id, renderer); + } + ((renderer)).applyToHost(element); + return renderer; + } + case _angular_core.ViewEncapsulation.Native: + throw new Error('Native encapsulation is not supported on the server!'); + default: { + if (!this.rendererByCompId.has(type.id)) { + var /** @type {?} */ styles = _angular_platformBrowser.ɵflattenStyles(type.id, type.styles, []); + this.sharedStylesHost.addStyles(styles); + this.rendererByCompId.set(type.id, this.defaultRenderer); + } + return this.defaultRenderer; + } + } + }; + /** + * @return {?} + */ + ServerRendererFactory2.prototype.begin = function () { }; + /** + * @return {?} + */ + ServerRendererFactory2.prototype.end = function () { }; + return ServerRendererFactory2; +}()); +ServerRendererFactory2.decorators = [ + { type: _angular_core.Injectable }, +]; +/** + * @nocollapse + */ +ServerRendererFactory2.ctorParameters = function () { return [ + { type: _angular_core.NgZone, }, + { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_platformBrowser.DOCUMENT,] },] }, + { type: _angular_platformBrowser.ɵSharedStylesHost, }, +]; }; +var DefaultServerRenderer2 = (function () { + /** + * @param {?} document + * @param {?} ngZone + * @param {?} schema + */ + function DefaultServerRenderer2(document, ngZone, schema) { + this.document = document; + this.ngZone = ngZone; + this.schema = schema; + this.data = Object.create(null); + } + /** + * @return {?} + */ + DefaultServerRenderer2.prototype.destroy = function () { }; + /** + * @param {?} name + * @param {?=} namespace + * @param {?=} debugInfo + * @return {?} + */ + DefaultServerRenderer2.prototype.createElement = function (name, namespace, debugInfo) { + if (namespace) { + return _angular_platformBrowser.ɵgetDOM().createElementNS(_angular_platformBrowser.ɵNAMESPACE_URIS[namespace], name); + } + return _angular_platformBrowser.ɵgetDOM().createElement(name); + }; + /** + * @param {?} value + * @param {?=} debugInfo + * @return {?} + */ + DefaultServerRenderer2.prototype.createComment = function (value, debugInfo) { return _angular_platformBrowser.ɵgetDOM().createComment(value); }; + /** + * @param {?} value + * @param {?=} debugInfo + * @return {?} + */ + DefaultServerRenderer2.prototype.createText = function (value, debugInfo) { return _angular_platformBrowser.ɵgetDOM().createTextNode(value); }; + /** + * @param {?} parent + * @param {?} newChild + * @return {?} + */ + DefaultServerRenderer2.prototype.appendChild = function (parent, newChild) { _angular_platformBrowser.ɵgetDOM().appendChild(parent, newChild); }; + /** + * @param {?} parent + * @param {?} newChild + * @param {?} refChild + * @return {?} + */ + DefaultServerRenderer2.prototype.insertBefore = function (parent, newChild, refChild) { + if (parent) { + _angular_platformBrowser.ɵgetDOM().insertBefore(parent, refChild, newChild); + } + }; + /** + * @param {?} parent + * @param {?} oldChild + * @return {?} + */ + DefaultServerRenderer2.prototype.removeChild = function (parent, oldChild) { + if (parent) { + _angular_platformBrowser.ɵgetDOM().removeChild(parent, oldChild); + } + }; + /** + * @param {?} selectorOrNode + * @param {?=} debugInfo + * @return {?} + */ + DefaultServerRenderer2.prototype.selectRootElement = function (selectorOrNode, debugInfo) { + var /** @type {?} */ el; + if (typeof selectorOrNode === 'string') { + el = _angular_platformBrowser.ɵgetDOM().querySelector(this.document, selectorOrNode); + if (!el) { + throw new Error("The selector \"" + selectorOrNode + "\" did not match any elements"); + } + } + else { + el = selectorOrNode; + } + _angular_platformBrowser.ɵgetDOM().clearNodes(el); + return el; + }; + /** + * @param {?} node + * @return {?} + */ + DefaultServerRenderer2.prototype.parentNode = function (node) { return _angular_platformBrowser.ɵgetDOM().parentElement(node); }; + /** + * @param {?} node + * @return {?} + */ + DefaultServerRenderer2.prototype.nextSibling = function (node) { return _angular_platformBrowser.ɵgetDOM().nextSibling(node); }; + /** + * @param {?} el + * @param {?} name + * @param {?} value + * @param {?=} namespace + * @return {?} + */ + DefaultServerRenderer2.prototype.setAttribute = function (el, name, value, namespace) { + if (namespace) { + _angular_platformBrowser.ɵgetDOM().setAttributeNS(el, _angular_platformBrowser.ɵNAMESPACE_URIS[namespace], namespace + ':' + name, value); + } + else { + _angular_platformBrowser.ɵgetDOM().setAttribute(el, name, value); + } + }; + /** + * @param {?} el + * @param {?} name + * @param {?=} namespace + * @return {?} + */ + DefaultServerRenderer2.prototype.removeAttribute = function (el, name, namespace) { + if (namespace) { + _angular_platformBrowser.ɵgetDOM().removeAttributeNS(el, _angular_platformBrowser.ɵNAMESPACE_URIS[namespace], name); + } + else { + _angular_platformBrowser.ɵgetDOM().removeAttribute(el, name); + } + }; + /** + * @param {?} el + * @param {?} name + * @return {?} + */ + DefaultServerRenderer2.prototype.addClass = function (el, name) { _angular_platformBrowser.ɵgetDOM().addClass(el, name); }; + /** + * @param {?} el + * @param {?} name + * @return {?} + */ + DefaultServerRenderer2.prototype.removeClass = function (el, name) { _angular_platformBrowser.ɵgetDOM().removeClass(el, name); }; + /** + * @param {?} el + * @param {?} style + * @param {?} value + * @param {?} flags + * @return {?} + */ + DefaultServerRenderer2.prototype.setStyle = function (el, style, value, flags) { + _angular_platformBrowser.ɵgetDOM().setStyle(el, style, value); + }; + /** + * @param {?} el + * @param {?} style + * @param {?} flags + * @return {?} + */ + DefaultServerRenderer2.prototype.removeStyle = function (el, style, flags) { + _angular_platformBrowser.ɵgetDOM().removeStyle(el, style); + }; + /** + * @param {?} tagName + * @param {?} propertyName + * @return {?} + */ + DefaultServerRenderer2.prototype._isSafeToReflectProperty = function (tagName, propertyName) { + return this.schema.securityContext(tagName, propertyName, true) === + this.schema.securityContext(tagName, propertyName, false); + }; + /** + * @param {?} el + * @param {?} name + * @param {?} value + * @return {?} + */ + DefaultServerRenderer2.prototype.setProperty = function (el, name, value) { + checkNoSyntheticProp(name, 'property'); + _angular_platformBrowser.ɵgetDOM().setProperty(el, name, value); + // Mirror property values for known HTML element properties in the attributes. + var /** @type {?} */ tagName = ((el.tagName)).toLowerCase(); + if (value != null && (typeof value === 'number' || typeof value == 'string') && + this.schema.hasElement(tagName, EMPTY_ARRAY) && + this.schema.hasProperty(tagName, name, EMPTY_ARRAY) && + this._isSafeToReflectProperty(tagName, name)) { + this.setAttribute(el, name, value.toString()); + } + }; + /** + * @param {?} node + * @param {?} value + * @return {?} + */ + DefaultServerRenderer2.prototype.setValue = function (node, value) { _angular_platformBrowser.ɵgetDOM().setText(node, value); }; + /** + * @param {?} target + * @param {?} eventName + * @param {?} callback + * @return {?} + */ + DefaultServerRenderer2.prototype.listen = function (target, eventName, callback) { + var _this = this; + // Note: We are not using the EventsPlugin here as this is not needed + // to run our tests. + checkNoSyntheticProp(eventName, 'listener'); + var /** @type {?} */ el = typeof target === 'string' ? _angular_platformBrowser.ɵgetDOM().getGlobalEventTarget(this.document, target) : target; + var /** @type {?} */ outsideHandler = function (event) { return _this.ngZone.runGuarded(function () { return callback(event); }); }; + return this.ngZone.runOutsideAngular(function () { return _angular_platformBrowser.ɵgetDOM().onAndCancel(el, eventName, outsideHandler); }); + }; + return DefaultServerRenderer2; +}()); +var AT_CHARCODE = '@'.charCodeAt(0); +/** + * @param {?} name + * @param {?} nameKind + * @return {?} + */ +function checkNoSyntheticProp(name, nameKind) { + if (name.charCodeAt(0) === AT_CHARCODE) { + throw new Error("Found the synthetic " + nameKind + " " + name + ". Please include either \"BrowserAnimationsModule\" or \"NoopAnimationsModule\" in your application."); + } +} +var EmulatedEncapsulationServerRenderer2 = (function (_super) { + __extends(EmulatedEncapsulationServerRenderer2, _super); + /** + * @param {?} document + * @param {?} ngZone + * @param {?} sharedStylesHost + * @param {?} schema + * @param {?} component + */ + function EmulatedEncapsulationServerRenderer2(document, ngZone, sharedStylesHost, schema, component) { + var _this = _super.call(this, document, ngZone, schema) || this; + _this.component = component; + var styles = _angular_platformBrowser.ɵflattenStyles(component.id, component.styles, []); + sharedStylesHost.addStyles(styles); + _this.contentAttr = _angular_platformBrowser.ɵshimContentAttribute(component.id); + _this.hostAttr = _angular_platformBrowser.ɵshimHostAttribute(component.id); + return _this; + } + /** + * @param {?} element + * @return {?} + */ + EmulatedEncapsulationServerRenderer2.prototype.applyToHost = function (element) { _super.prototype.setAttribute.call(this, element, this.hostAttr, ''); }; + /** + * @param {?} parent + * @param {?} name + * @return {?} + */ + EmulatedEncapsulationServerRenderer2.prototype.createElement = function (parent, name) { + var /** @type {?} */ el = _super.prototype.createElement.call(this, parent, name); + _super.prototype.setAttribute.call(this, el, this.contentAttr, ''); + return el; + }; + return EmulatedEncapsulationServerRenderer2; +}(DefaultServerRenderer2)); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var ServerStylesHost = (function (_super) { + __extends(ServerStylesHost, _super); + /** + * @param {?} doc + * @param {?} transitionId + */ + function ServerStylesHost(doc, transitionId) { + var _this = _super.call(this) || this; + _this.doc = doc; + _this.transitionId = transitionId; + _this.head = null; + _this.head = _angular_platformBrowser.ɵgetDOM().getElementsByTagName(doc, 'head')[0]; + return _this; + } + /** + * @param {?} style + * @return {?} + */ + ServerStylesHost.prototype._addStyle = function (style) { + var /** @type {?} */ adapter = (_angular_platformBrowser.ɵgetDOM()); + var /** @type {?} */ el = adapter.createElement('style'); + adapter.setText(el, style); + if (!!this.transitionId) { + adapter.setAttribute(el, 'ng-transition', this.transitionId); + } + adapter.appendChild(this.head, el); + }; + /** + * @param {?} additions + * @return {?} + */ + ServerStylesHost.prototype.onStylesAdded = function (additions) { + var _this = this; + additions.forEach(function (style) { return _this._addStyle(style); }); + }; + return ServerStylesHost; +}(_angular_platformBrowser.ɵSharedStylesHost)); +ServerStylesHost.decorators = [ + { type: _angular_core.Injectable }, +]; +/** + * @nocollapse + */ +ServerStylesHost.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: _angular_core.Inject, args: [_angular_platformBrowser.DOCUMENT,] },] }, + { type: undefined, decorators: [{ type: _angular_core.Optional }, { type: _angular_core.Inject, args: [_angular_platformBrowser.ɵTRANSITION_ID,] },] }, +]; }; +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var INTERNAL_SERVER_PLATFORM_PROVIDERS = [ + { provide: _angular_platformBrowser.DOCUMENT, useFactory: _document, deps: [_angular_core.Injector] }, + { provide: _angular_core.PLATFORM_ID, useValue: _angular_common.ɵPLATFORM_SERVER_ID }, + { provide: _angular_core.PLATFORM_INITIALIZER, useFactory: initParse5Adapter, multi: true, deps: [_angular_core.Injector] }, + { provide: _angular_common.PlatformLocation, useClass: ServerPlatformLocation }, PlatformState, + // Add special provider that allows multiple instances of platformServer* to be created. + { provide: _angular_core.ɵALLOW_MULTIPLE_PLATFORMS, useValue: true } +]; +/** + * @param {?} injector + * @return {?} + */ +function initParse5Adapter(injector) { + return function () { Parse5DomAdapter.makeCurrent(); }; +} +/** + * @param {?} renderer + * @param {?} engine + * @param {?} zone + * @return {?} + */ +function instantiateServerRendererFactory(renderer, engine, zone) { + return new _angular_platformBrowser_animations.ɵAnimationRendererFactory(renderer, engine, zone); +} +var SERVER_RENDER_PROVIDERS = [ + ServerRendererFactory2, + { + provide: _angular_core.RendererFactory2, + useFactory: instantiateServerRendererFactory, + deps: [ServerRendererFactory2, _angular_animations_browser.ɵAnimationEngine, _angular_core.NgZone] + }, + ServerStylesHost, + { provide: _angular_platformBrowser.ɵSharedStylesHost, useExisting: ServerStylesHost }, +]; +/** + * The ng module for the server. + * + * \@experimental + */ +var ServerModule = (function () { + function ServerModule() { + } + return ServerModule; +}()); +ServerModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + exports: [_angular_platformBrowser.BrowserModule], + imports: [_angular_http.HttpModule, _angular_platformBrowser_animations.NoopAnimationsModule], + providers: [ + SERVER_RENDER_PROVIDERS, + SERVER_HTTP_PROVIDERS, + { provide: _angular_core.Testability, useValue: null }, + ], + },] }, +]; +/** + * @nocollapse + */ +ServerModule.ctorParameters = function () { return []; }; +/** + * @param {?} injector + * @return {?} + */ +function _document(injector) { + var /** @type {?} */ config = injector.get(INITIAL_CONFIG, null); + if (config && config.document) { + return parseDocument(config.document); + } + else { + return _angular_platformBrowser.ɵgetDOM().createHtmlDocument(); + } +} +/** + * \@experimental + */ +var platformServer = _angular_core.createPlatformFactory(_angular_core.platformCore, 'server', INTERNAL_SERVER_PLATFORM_PROVIDERS); +/** + * The server platform that supports the runtime compiler. + * + * \@experimental + */ +var platformDynamicServer = _angular_core.createPlatformFactory(_angular_compiler.platformCoreDynamic, 'serverDynamic', INTERNAL_SERVER_PLATFORM_PROVIDERS); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var parse5$2 = __webpack_require__(142); +/** + * @param {?} platformFactory + * @param {?} options + * @return {?} + */ +function _getPlatform(platformFactory, options) { + var /** @type {?} */ extraProviders = options.extraProviders ? options.extraProviders : []; + return platformFactory([ + { provide: INITIAL_CONFIG, useValue: { document: options.document, url: options.url } }, + extraProviders + ]); +} +/** + * @template T + * @param {?} platform + * @param {?} moduleRefPromise + * @return {?} + */ +function _render(platform, moduleRefPromise) { + return moduleRefPromise.then(function (moduleRef) { + var /** @type {?} */ transitionId = moduleRef.injector.get(_angular_platformBrowser.ɵTRANSITION_ID, null); + if (!transitionId) { + throw new Error("renderModule[Factory]() requires the use of BrowserModule.withServerTransition() to ensure\nthe server-rendered app can be properly bootstrapped into a client app."); + } + var /** @type {?} */ applicationRef = moduleRef.injector.get(_angular_core.ApplicationRef); + return rxjs_operator_toPromise.toPromise + .call(rxjs_operator_first.first.call(rxjs_operator_filter.filter.call(applicationRef.isStable, function (isStable) { return isStable; }))) + .then(function () { + var /** @type {?} */ output = platform.injector.get(PlatformState).renderToString(); + platform.destroy(); + return output; + }); + }); +} +/** + * Renders a Module to string. + * + * Do not use this in a production server environment. Use pre-compiled {\@link NgModuleFactory} with + * {link renderModuleFactory} instead. + * + * \@experimental + * @template T + * @param {?} module + * @param {?} options + * @return {?} + */ +function renderModule(module, options) { + var /** @type {?} */ platform = _getPlatform(platformDynamicServer, options); + return _render(platform, platform.bootstrapModule(module)); +} +/** + * Renders a {\@link NgModuleFactory} to string. + * + * \@experimental + * @template T + * @param {?} moduleFactory + * @param {?} options + * @return {?} + */ +function renderModuleFactory(moduleFactory, options) { + var /** @type {?} */ platform = _getPlatform(platformServer, options); + return _render(platform, platform.bootstrapModuleFactory(moduleFactory)); +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * @module + * @description + * Entry point for all public APIs of the common package. + */ +/** + * \@stable + */ +var VERSION = new _angular_core.Version('4.2.5'); + +exports.PlatformState = PlatformState; +exports.ServerModule = ServerModule; +exports.platformDynamicServer = platformDynamicServer; +exports.platformServer = platformServer; +exports.INITIAL_CONFIG = INITIAL_CONFIG; +exports.renderModule = renderModule; +exports.renderModuleFactory = renderModuleFactory; +exports.VERSION = VERSION; +exports.ɵINTERNAL_SERVER_PLATFORM_PROVIDERS = INTERNAL_SERVER_PLATFORM_PROVIDERS; +exports.ɵSERVER_RENDER_PROVIDERS = SERVER_RENDER_PROVIDERS; +exports.ɵServerRendererFactory2 = ServerRendererFactory2; +exports.ɵf = SERVER_HTTP_PROVIDERS; +exports.ɵc = ServerXhr; +exports.ɵd = ServerXsrfStrategy; +exports.ɵe = httpFactory; +exports.ɵa = instantiateServerRendererFactory; +exports.ɵb = ServerStylesHost; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=platform-server.umd.js.map + + +/***/ }), +/* 158 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var Observable_1 = __webpack_require__(1); +var first_1 = __webpack_require__(331); +Observable_1.Observable.prototype.first = first_1.first; +//# sourceMappingURL=first.js.map + +/***/ }), +/* 159 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @license Angular v4.2.5 + * (c) 2010-2017 Google, Inc. https://angular.io/ + * License: MIT + */ +(function (global, factory) { + true ? factory(exports, __webpack_require__(328)) : + typeof define === 'function' && define.amd ? define(['exports', '@angular/animations'], factory) : + (factory((global.ng = global.ng || {}, global.ng.animations = global.ng.animations || {}, global.ng.animations.browser = global.ng.animations.browser || {}),global.ng.animations)); +}(this, (function (exports,_angular_animations) { 'use strict'; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +/** + * @license Angular v4.2.5 + * (c) 2010-2017 Google, Inc. https://angular.io/ + * License: MIT + */ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +function optimizeGroupPlayer(players) { + switch (players.length) { + case 0: + return new _angular_animations.NoopAnimationPlayer(); + case 1: + return players[0]; + default: + return new _angular_animations.ɵAnimationGroupPlayer(players); + } +} +function normalizeKeyframes(driver, normalizer, element, keyframes, preStyles, postStyles) { + if (preStyles === void 0) { preStyles = {}; } + if (postStyles === void 0) { postStyles = {}; } + var errors = []; + var normalizedKeyframes = []; + var previousOffset = -1; + var previousKeyframe = null; + keyframes.forEach(function (kf) { + var offset = kf['offset']; + var isSameOffset = offset == previousOffset; + var normalizedKeyframe = (isSameOffset && previousKeyframe) || {}; + Object.keys(kf).forEach(function (prop) { + var normalizedProp = prop; + var normalizedValue = kf[prop]; + if (normalizedValue == _angular_animations.ɵPRE_STYLE) { + normalizedValue = preStyles[prop]; + } + else if (normalizedValue == _angular_animations.AUTO_STYLE) { + normalizedValue = postStyles[prop]; + } + else if (prop != 'offset') { + normalizedProp = normalizer.normalizePropertyName(prop, errors); + normalizedValue = normalizer.normalizeStyleValue(prop, normalizedProp, kf[prop], errors); + } + normalizedKeyframe[normalizedProp] = normalizedValue; + }); + if (!isSameOffset) { + normalizedKeyframes.push(normalizedKeyframe); + } + previousKeyframe = normalizedKeyframe; + previousOffset = offset; + }); + if (errors.length) { + var LINE_START = '\n - '; + throw new Error("Unable to animate due to the following errors:" + LINE_START + errors.join(LINE_START)); + } + return normalizedKeyframes; +} +function listenOnPlayer(player, eventName, event, callback) { + switch (eventName) { + case 'start': + player.onStart(function () { return callback(event && copyAnimationEvent(event, 'start', player.totalTime)); }); + break; + case 'done': + player.onDone(function () { return callback(event && copyAnimationEvent(event, 'done', player.totalTime)); }); + break; + case 'destroy': + player.onDestroy(function () { return callback(event && copyAnimationEvent(event, 'destroy', player.totalTime)); }); + break; + } +} +function copyAnimationEvent(e, phaseName, totalTime) { + var event = makeAnimationEvent(e.element, e.triggerName, e.fromState, e.toState, phaseName || e.phaseName, totalTime == undefined ? e.totalTime : totalTime); + var data = e['_data']; + if (data != null) { + event['_data'] = data; + } + return event; +} +function makeAnimationEvent(element, triggerName, fromState, toState, phaseName, totalTime) { + if (phaseName === void 0) { phaseName = ''; } + if (totalTime === void 0) { totalTime = 0; } + return { element: element, triggerName: triggerName, fromState: fromState, toState: toState, phaseName: phaseName, totalTime: totalTime }; +} +function getOrSetAsInMap(map, key, defaultValue) { + var value; + if (map instanceof Map) { + value = map.get(key); + if (!value) { + map.set(key, value = defaultValue); + } + } + else { + value = map[key]; + if (!value) { + value = map[key] = defaultValue; + } + } + return value; +} +function parseTimelineCommand(command) { + var separatorPos = command.indexOf(':'); + var id = command.substring(1, separatorPos); + var action = command.substr(separatorPos + 1); + return [id, action]; +} +var _contains = function (elm1, elm2) { return false; }; +var _matches = function (element, selector) { return false; }; +var _query = function (element, selector, multi) { + return []; +}; +if (typeof Element != 'undefined') { + // this is well supported in all browsers + _contains = function (elm1, elm2) { return elm1.contains(elm2); }; + if (Element.prototype.matches) { + _matches = function (element, selector) { return element.matches(selector); }; + } + else { + var proto = Element.prototype; + var fn_1 = proto.matchesSelector || proto.mozMatchesSelector || proto.msMatchesSelector || + proto.oMatchesSelector || proto.webkitMatchesSelector; + if (fn_1) { + _matches = function (element, selector) { return fn_1.apply(element, [selector]); }; + } + } + _query = function (element, selector, multi) { + var results = []; + if (multi) { + results.push.apply(results, element.querySelectorAll(selector)); + } + else { + var elm = element.querySelector(selector); + if (elm) { + results.push(elm); + } + } + return results; + }; +} +var matchesElement = _matches; +var containsElement = _contains; +var invokeQuery = _query; +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * @experimental + */ +var NoopAnimationDriver = (function () { + function NoopAnimationDriver() { + } + NoopAnimationDriver.prototype.matchesElement = function (element, selector) { + return matchesElement(element, selector); + }; + NoopAnimationDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); }; + NoopAnimationDriver.prototype.query = function (element, selector, multi) { + return invokeQuery(element, selector, multi); + }; + NoopAnimationDriver.prototype.computeStyle = function (element, prop, defaultValue) { + return defaultValue || ''; + }; + NoopAnimationDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers) { + if (previousPlayers === void 0) { previousPlayers = []; } + return new _angular_animations.NoopAnimationPlayer(); + }; + return NoopAnimationDriver; +}()); +/** + * @experimental + */ +var AnimationDriver = (function () { + function AnimationDriver() { + } + return AnimationDriver; +}()); +AnimationDriver.NOOP = new NoopAnimationDriver(); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var ONE_SECOND = 1000; +var ENTER_CLASSNAME = 'ng-enter'; +var LEAVE_CLASSNAME = 'ng-leave'; +var ENTER_SELECTOR = '.ng-enter'; +var LEAVE_SELECTOR = '.ng-leave'; +var NG_TRIGGER_CLASSNAME = 'ng-trigger'; +var NG_TRIGGER_SELECTOR = '.ng-trigger'; +var NG_ANIMATING_CLASSNAME = 'ng-animating'; +var NG_ANIMATING_SELECTOR = '.ng-animating'; +/** + * @param {?} value + * @return {?} + */ +function resolveTimingValue(value) { + if (typeof value == 'number') + return value; + var /** @type {?} */ matches = ((value)).match(/^(-?[\.\d]+)(m?s)/); + if (!matches || matches.length < 2) + return 0; + return _convertTimeValueToMS(parseFloat(matches[1]), matches[2]); +} +/** + * @param {?} value + * @param {?} unit + * @return {?} + */ +function _convertTimeValueToMS(value, unit) { + switch (unit) { + case 's': + return value * ONE_SECOND; + default: + return value; + } +} +/** + * @param {?} timings + * @param {?} errors + * @param {?=} allowNegativeValues + * @return {?} + */ +function resolveTiming(timings, errors, allowNegativeValues) { + return timings.hasOwnProperty('duration') ? (timings) : + parseTimeExpression(/** @type {?} */ (timings), errors, allowNegativeValues); +} +/** + * @param {?} exp + * @param {?} errors + * @param {?=} allowNegativeValues + * @return {?} + */ +function parseTimeExpression(exp, errors, allowNegativeValues) { + var /** @type {?} */ regex = /^(-?[\.\d]+)(m?s)(?:\s+(-?[\.\d]+)(m?s))?(?:\s+([-a-z]+(?:\(.+?\))?))?$/i; + var /** @type {?} */ duration; + var /** @type {?} */ delay = 0; + var /** @type {?} */ easing = ''; + if (typeof exp === 'string') { + var /** @type {?} */ matches = exp.match(regex); + if (matches === null) { + errors.push("The provided timing value \"" + exp + "\" is invalid."); + return { duration: 0, delay: 0, easing: '' }; + } + duration = _convertTimeValueToMS(parseFloat(matches[1]), matches[2]); + var /** @type {?} */ delayMatch = matches[3]; + if (delayMatch != null) { + delay = _convertTimeValueToMS(Math.floor(parseFloat(delayMatch)), matches[4]); + } + var /** @type {?} */ easingVal = matches[5]; + if (easingVal) { + easing = easingVal; + } + } + else { + duration = (exp); + } + if (!allowNegativeValues) { + var /** @type {?} */ containsErrors = false; + var /** @type {?} */ startIndex = errors.length; + if (duration < 0) { + errors.push("Duration values below 0 are not allowed for this animation step."); + containsErrors = true; + } + if (delay < 0) { + errors.push("Delay values below 0 are not allowed for this animation step."); + containsErrors = true; + } + if (containsErrors) { + errors.splice(startIndex, 0, "The provided timing value \"" + exp + "\" is invalid."); + } + } + return { duration: duration, delay: delay, easing: easing }; +} +/** + * @param {?} obj + * @param {?=} destination + * @return {?} + */ +function copyObj(obj, destination) { + if (destination === void 0) { destination = {}; } + Object.keys(obj).forEach(function (prop) { destination[prop] = obj[prop]; }); + return destination; +} +/** + * @param {?} styles + * @return {?} + */ +function normalizeStyles(styles) { + var /** @type {?} */ normalizedStyles = {}; + if (Array.isArray(styles)) { + styles.forEach(function (data) { return copyStyles(data, false, normalizedStyles); }); + } + else { + copyStyles(styles, false, normalizedStyles); + } + return normalizedStyles; +} +/** + * @param {?} styles + * @param {?} readPrototype + * @param {?=} destination + * @return {?} + */ +function copyStyles(styles, readPrototype, destination) { + if (destination === void 0) { destination = {}; } + if (readPrototype) { + // we make use of a for-in loop so that the + // prototypically inherited properties are + // revealed from the backFill map + for (var /** @type {?} */ prop in styles) { + destination[prop] = styles[prop]; + } + } + else { + copyObj(styles, destination); + } + return destination; +} +/** + * @param {?} element + * @param {?} styles + * @return {?} + */ +function setStyles(element, styles) { + if (element['style']) { + Object.keys(styles).forEach(function (prop) { + var /** @type {?} */ camelProp = dashCaseToCamelCase(prop); + element.style[camelProp] = styles[prop]; + }); + } +} +/** + * @param {?} element + * @param {?} styles + * @return {?} + */ +function eraseStyles(element, styles) { + if (element['style']) { + Object.keys(styles).forEach(function (prop) { + var /** @type {?} */ camelProp = dashCaseToCamelCase(prop); + element.style[camelProp] = ''; + }); + } +} +/** + * @param {?} steps + * @return {?} + */ +function normalizeAnimationEntry(steps) { + if (Array.isArray(steps)) { + if (steps.length == 1) + return steps[0]; + return _angular_animations.sequence(steps); + } + return (steps); +} +/** + * @param {?} value + * @param {?} options + * @param {?} errors + * @return {?} + */ +function validateStyleParams(value, options, errors) { + var /** @type {?} */ params = options.params || {}; + if (typeof value !== 'string') + return; + var /** @type {?} */ matches = value.toString().match(PARAM_REGEX); + if (matches) { + matches.forEach(function (varName) { + if (!params.hasOwnProperty(varName)) { + errors.push("Unable to resolve the local animation param " + varName + " in the given list of values"); + } + }); + } +} +var PARAM_REGEX = /\{\{\s*(.+?)\s*\}\}/g; +/** + * @param {?} value + * @param {?} params + * @param {?} errors + * @return {?} + */ +function interpolateParams(value, params, errors) { + var /** @type {?} */ original = value.toString(); + var /** @type {?} */ str = original.replace(PARAM_REGEX, function (_, varName) { + var /** @type {?} */ localVal = params[varName]; + // this means that the value was never overidden by the data passed in by the user + if (!params.hasOwnProperty(varName)) { + errors.push("Please provide a value for the animation param " + varName); + localVal = ''; + } + return localVal.toString(); + }); + // we do this to assert that numeric values stay as they are + return str == original ? value : str; +} +/** + * @param {?} iterator + * @return {?} + */ +function iteratorToArray(iterator) { + var /** @type {?} */ arr = []; + var /** @type {?} */ item = iterator.next(); + while (!item.done) { + arr.push(item.value); + item = iterator.next(); + } + return arr; +} +/** + * @param {?} source + * @param {?} destination + * @return {?} + */ +function mergeAnimationOptions(source, destination) { + if (source.params) { + var /** @type {?} */ p0_1 = source.params; + if (!destination.params) { + destination.params = {}; + } + var /** @type {?} */ p1_1 = destination.params; + Object.keys(p0_1).forEach(function (param) { + if (!p1_1.hasOwnProperty(param)) { + p1_1[param] = p0_1[param]; + } + }); + } + return destination; +} +var DASH_CASE_REGEXP = /-+([a-z0-9])/g; +/** + * @param {?} input + * @return {?} + */ +function dashCaseToCamelCase(input) { + return input.replace(DASH_CASE_REGEXP, function () { + var m = []; + for (var _i = 0; _i < arguments.length; _i++) { + m[_i] = arguments[_i]; + } + return m[1].toUpperCase(); + }); +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var EMPTY_ANIMATION_OPTIONS = {}; +/** + * @abstract + */ +var Ast = (function () { + function Ast() { + this.options = EMPTY_ANIMATION_OPTIONS; + } + /** + * @abstract + * @param {?} ast + * @param {?} context + * @return {?} + */ + Ast.prototype.visit = function (ast, context) { }; + Object.defineProperty(Ast.prototype, "params", { + /** + * @return {?} + */ + get: function () { return this.options['params'] || null; }, + enumerable: true, + configurable: true + }); + return Ast; +}()); +var TriggerAst = (function (_super) { + __extends(TriggerAst, _super); + /** + * @param {?} name + * @param {?} states + * @param {?} transitions + */ + function TriggerAst(name, states, transitions) { + var _this = _super.call(this) || this; + _this.name = name; + _this.states = states; + _this.transitions = transitions; + _this.queryCount = 0; + _this.depCount = 0; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + TriggerAst.prototype.visit = function (visitor, context) { return visitor.visitTrigger(this, context); }; + return TriggerAst; +}(Ast)); +var StateAst = (function (_super) { + __extends(StateAst, _super); + /** + * @param {?} name + * @param {?} style + */ + function StateAst(name, style$$1) { + var _this = _super.call(this) || this; + _this.name = name; + _this.style = style$$1; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + StateAst.prototype.visit = function (visitor, context) { return visitor.visitState(this, context); }; + return StateAst; +}(Ast)); +var TransitionAst = (function (_super) { + __extends(TransitionAst, _super); + /** + * @param {?} matchers + * @param {?} animation + */ + function TransitionAst(matchers, animation) { + var _this = _super.call(this) || this; + _this.matchers = matchers; + _this.animation = animation; + _this.queryCount = 0; + _this.depCount = 0; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + TransitionAst.prototype.visit = function (visitor, context) { return visitor.visitTransition(this, context); }; + return TransitionAst; +}(Ast)); +var SequenceAst = (function (_super) { + __extends(SequenceAst, _super); + /** + * @param {?} steps + */ + function SequenceAst(steps) { + var _this = _super.call(this) || this; + _this.steps = steps; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + SequenceAst.prototype.visit = function (visitor, context) { return visitor.visitSequence(this, context); }; + return SequenceAst; +}(Ast)); +var GroupAst = (function (_super) { + __extends(GroupAst, _super); + /** + * @param {?} steps + */ + function GroupAst(steps) { + var _this = _super.call(this) || this; + _this.steps = steps; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + GroupAst.prototype.visit = function (visitor, context) { return visitor.visitGroup(this, context); }; + return GroupAst; +}(Ast)); +var AnimateAst = (function (_super) { + __extends(AnimateAst, _super); + /** + * @param {?} timings + * @param {?} style + */ + function AnimateAst(timings, style$$1) { + var _this = _super.call(this) || this; + _this.timings = timings; + _this.style = style$$1; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + AnimateAst.prototype.visit = function (visitor, context) { return visitor.visitAnimate(this, context); }; + return AnimateAst; +}(Ast)); +var StyleAst = (function (_super) { + __extends(StyleAst, _super); + /** + * @param {?} styles + * @param {?} easing + * @param {?} offset + */ + function StyleAst(styles, easing, offset) { + var _this = _super.call(this) || this; + _this.styles = styles; + _this.easing = easing; + _this.offset = offset; + _this.isEmptyStep = false; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + StyleAst.prototype.visit = function (visitor, context) { return visitor.visitStyle(this, context); }; + return StyleAst; +}(Ast)); +var KeyframesAst = (function (_super) { + __extends(KeyframesAst, _super); + /** + * @param {?} styles + */ + function KeyframesAst(styles) { + var _this = _super.call(this) || this; + _this.styles = styles; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + KeyframesAst.prototype.visit = function (visitor, context) { return visitor.visitKeyframes(this, context); }; + return KeyframesAst; +}(Ast)); +var ReferenceAst = (function (_super) { + __extends(ReferenceAst, _super); + /** + * @param {?} animation + */ + function ReferenceAst(animation) { + var _this = _super.call(this) || this; + _this.animation = animation; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + ReferenceAst.prototype.visit = function (visitor, context) { return visitor.visitReference(this, context); }; + return ReferenceAst; +}(Ast)); +var AnimateChildAst = (function (_super) { + __extends(AnimateChildAst, _super); + function AnimateChildAst() { + return _super.call(this) || this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + AnimateChildAst.prototype.visit = function (visitor, context) { return visitor.visitAnimateChild(this, context); }; + return AnimateChildAst; +}(Ast)); +var AnimateRefAst = (function (_super) { + __extends(AnimateRefAst, _super); + /** + * @param {?} animation + */ + function AnimateRefAst(animation) { + var _this = _super.call(this) || this; + _this.animation = animation; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + AnimateRefAst.prototype.visit = function (visitor, context) { return visitor.visitAnimateRef(this, context); }; + return AnimateRefAst; +}(Ast)); +var QueryAst = (function (_super) { + __extends(QueryAst, _super); + /** + * @param {?} selector + * @param {?} limit + * @param {?} optional + * @param {?} includeSelf + * @param {?} animation + */ + function QueryAst(selector, limit, optional, includeSelf, animation) { + var _this = _super.call(this) || this; + _this.selector = selector; + _this.limit = limit; + _this.optional = optional; + _this.includeSelf = includeSelf; + _this.animation = animation; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + QueryAst.prototype.visit = function (visitor, context) { return visitor.visitQuery(this, context); }; + return QueryAst; +}(Ast)); +var StaggerAst = (function (_super) { + __extends(StaggerAst, _super); + /** + * @param {?} timings + * @param {?} animation + */ + function StaggerAst(timings, animation) { + var _this = _super.call(this) || this; + _this.timings = timings; + _this.animation = animation; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + StaggerAst.prototype.visit = function (visitor, context) { return visitor.visitStagger(this, context); }; + return StaggerAst; +}(Ast)); +var TimingAst = (function (_super) { + __extends(TimingAst, _super); + /** + * @param {?} duration + * @param {?=} delay + * @param {?=} easing + */ + function TimingAst(duration, delay, easing) { + if (delay === void 0) { delay = 0; } + if (easing === void 0) { easing = null; } + var _this = _super.call(this) || this; + _this.duration = duration; + _this.delay = delay; + _this.easing = easing; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + TimingAst.prototype.visit = function (visitor, context) { return visitor.visitTiming(this, context); }; + return TimingAst; +}(Ast)); +var DynamicTimingAst = (function (_super) { + __extends(DynamicTimingAst, _super); + /** + * @param {?} value + */ + function DynamicTimingAst(value) { + var _this = _super.call(this, 0, 0, '') || this; + _this.value = value; + return _this; + } + /** + * @param {?} visitor + * @param {?} context + * @return {?} + */ + DynamicTimingAst.prototype.visit = function (visitor, context) { return visitor.visitTiming(this, context); }; + return DynamicTimingAst; +}(TimingAst)); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * @param {?} visitor + * @param {?} node + * @param {?} context + * @return {?} + */ +function visitAnimationNode(visitor, node, context) { + switch (node.type) { + case 7 /* Trigger */: + return visitor.visitTrigger(/** @type {?} */ (node), context); + case 0 /* State */: + return visitor.visitState(/** @type {?} */ (node), context); + case 1 /* Transition */: + return visitor.visitTransition(/** @type {?} */ (node), context); + case 2 /* Sequence */: + return visitor.visitSequence(/** @type {?} */ (node), context); + case 3 /* Group */: + return visitor.visitGroup(/** @type {?} */ (node), context); + case 4 /* Animate */: + return visitor.visitAnimate(/** @type {?} */ (node), context); + case 5 /* Keyframes */: + return visitor.visitKeyframes(/** @type {?} */ (node), context); + case 6 /* Style */: + return visitor.visitStyle(/** @type {?} */ (node), context); + case 8 /* Reference */: + return visitor.visitReference(/** @type {?} */ (node), context); + case 9 /* AnimateChild */: + return visitor.visitAnimateChild(/** @type {?} */ (node), context); + case 10 /* AnimateRef */: + return visitor.visitAnimateRef(/** @type {?} */ (node), context); + case 11 /* Query */: + return visitor.visitQuery(/** @type {?} */ (node), context); + case 12 /* Stagger */: + return visitor.visitStagger(/** @type {?} */ (node), context); + default: + throw new Error("Unable to resolve animation metadata node #" + node.type); + } +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var ANY_STATE = '*'; +/** + * @param {?} transitionValue + * @param {?} errors + * @return {?} + */ +function parseTransitionExpr(transitionValue, errors) { + var /** @type {?} */ expressions = []; + if (typeof transitionValue == 'string') { + ((transitionValue)) + .split(/\s*,\s*/) + .forEach(function (str) { return parseInnerTransitionStr(str, expressions, errors); }); + } + else { + expressions.push(/** @type {?} */ (transitionValue)); + } + return expressions; +} +/** + * @param {?} eventStr + * @param {?} expressions + * @param {?} errors + * @return {?} + */ +function parseInnerTransitionStr(eventStr, expressions, errors) { + if (eventStr[0] == ':') { + eventStr = parseAnimationAlias(eventStr, errors); + } + var /** @type {?} */ match = eventStr.match(/^(\*|[-\w]+)\s*()\s*(\*|[-\w]+)$/); + if (match == null || match.length < 4) { + errors.push("The provided transition expression \"" + eventStr + "\" is not supported"); + return expressions; + } + var /** @type {?} */ fromState = match[1]; + var /** @type {?} */ separator = match[2]; + var /** @type {?} */ toState = match[3]; + expressions.push(makeLambdaFromStates(fromState, toState)); + var /** @type {?} */ isFullAnyStateExpr = fromState == ANY_STATE && toState == ANY_STATE; + if (separator[0] == '<' && !isFullAnyStateExpr) { + expressions.push(makeLambdaFromStates(toState, fromState)); + } +} +/** + * @param {?} alias + * @param {?} errors + * @return {?} + */ +function parseAnimationAlias(alias, errors) { + switch (alias) { + case ':enter': + return 'void => *'; + case ':leave': + return '* => void'; + default: + errors.push("The transition alias value \"" + alias + "\" is not supported"); + return '* => *'; + } +} +/** + * @param {?} lhs + * @param {?} rhs + * @return {?} + */ +function makeLambdaFromStates(lhs, rhs) { + return function (fromState, toState) { + var /** @type {?} */ lhsMatch = lhs == ANY_STATE || lhs == fromState; + var /** @type {?} */ rhsMatch = rhs == ANY_STATE || rhs == toState; + if (!lhsMatch && typeof fromState === 'boolean') { + lhsMatch = fromState ? lhs === 'true' : lhs === 'false'; + } + if (!rhsMatch && typeof toState === 'boolean') { + rhsMatch = toState ? rhs === 'true' : rhs === 'false'; + } + return lhsMatch && rhsMatch; + }; +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var SELF_TOKEN = ':self'; +var SELF_TOKEN_REGEX = new RegExp("s*" + SELF_TOKEN + "s*,?", 'g'); +/** + * @param {?} metadata + * @param {?} errors + * @return {?} + */ +function buildAnimationAst(metadata, errors) { + return new AnimationAstBuilderVisitor().build(metadata, errors); +} +var LEAVE_TOKEN = ':leave'; +var LEAVE_TOKEN_REGEX = new RegExp(LEAVE_TOKEN, 'g'); +var ENTER_TOKEN = ':enter'; +var ENTER_TOKEN_REGEX = new RegExp(ENTER_TOKEN, 'g'); +var ROOT_SELECTOR = ''; +var AnimationAstBuilderVisitor = (function () { + function AnimationAstBuilderVisitor() { + } + /** + * @param {?} metadata + * @param {?} errors + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.build = function (metadata, errors) { + var /** @type {?} */ context = new AnimationAstBuilderContext(errors); + this._resetContextStyleTimingState(context); + return (visitAnimationNode(this, normalizeAnimationEntry(metadata), context)); + }; + /** + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype._resetContextStyleTimingState = function (context) { + context.currentQuerySelector = ROOT_SELECTOR; + context.collectedStyles = {}; + context.collectedStyles[ROOT_SELECTOR] = {}; + context.currentTime = 0; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitTrigger = function (metadata, context) { + var _this = this; + var /** @type {?} */ queryCount = context.queryCount = 0; + var /** @type {?} */ depCount = context.depCount = 0; + var /** @type {?} */ states = []; + var /** @type {?} */ transitions = []; + metadata.definitions.forEach(function (def) { + _this._resetContextStyleTimingState(context); + if (def.type == 0 /* State */) { + var /** @type {?} */ stateDef_1 = (def); + var /** @type {?} */ name = stateDef_1.name; + name.split(/\s*,\s*/).forEach(function (n) { + stateDef_1.name = n; + states.push(_this.visitState(stateDef_1, context)); + }); + stateDef_1.name = name; + } + else if (def.type == 1 /* Transition */) { + var /** @type {?} */ transition = _this.visitTransition(/** @type {?} */ (def), context); + queryCount += transition.queryCount; + depCount += transition.depCount; + transitions.push(transition); + } + else { + context.errors.push('only state() and transition() definitions can sit inside of a trigger()'); + } + }); + var /** @type {?} */ ast = new TriggerAst(metadata.name, states, transitions); + ast.options = normalizeAnimationOptions(metadata.options); + ast.queryCount = queryCount; + ast.depCount = depCount; + return ast; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitState = function (metadata, context) { + return new StateAst(metadata.name, this.visitStyle(metadata.styles, context)); + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitTransition = function (metadata, context) { + context.queryCount = 0; + context.depCount = 0; + var /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context); + var /** @type {?} */ matchers = parseTransitionExpr(metadata.expr, context.errors); + var /** @type {?} */ ast = new TransitionAst(matchers, entry); + ast.options = normalizeAnimationOptions(metadata.options); + ast.queryCount = context.queryCount; + ast.depCount = context.depCount; + return ast; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitSequence = function (metadata, context) { + var _this = this; + var /** @type {?} */ ast = new SequenceAst(metadata.steps.map(function (s) { return visitAnimationNode(_this, s, context); })); + ast.options = normalizeAnimationOptions(metadata.options); + return ast; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitGroup = function (metadata, context) { + var _this = this; + var /** @type {?} */ currentTime = context.currentTime; + var /** @type {?} */ furthestTime = 0; + var /** @type {?} */ steps = metadata.steps.map(function (step) { + context.currentTime = currentTime; + var /** @type {?} */ innerAst = visitAnimationNode(_this, step, context); + furthestTime = Math.max(furthestTime, context.currentTime); + return innerAst; + }); + context.currentTime = furthestTime; + var /** @type {?} */ ast = new GroupAst(steps); + ast.options = normalizeAnimationOptions(metadata.options); + return ast; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitAnimate = function (metadata, context) { + var /** @type {?} */ timingAst = constructTimingAst(metadata.timings, context.errors); + context.currentAnimateTimings = timingAst; + var /** @type {?} */ styles; + var /** @type {?} */ styleMetadata = metadata.styles ? metadata.styles : _angular_animations.style({}); + if (styleMetadata.type == 5 /* Keyframes */) { + styles = this.visitKeyframes(/** @type {?} */ (styleMetadata), context); + } + else { + var /** @type {?} */ styleMetadata_1 = (metadata.styles); + var /** @type {?} */ isEmpty = false; + if (!styleMetadata_1) { + isEmpty = true; + var /** @type {?} */ newStyleData = {}; + if (timingAst.easing) { + newStyleData['easing'] = timingAst.easing; + } + styleMetadata_1 = _angular_animations.style(newStyleData); + } + context.currentTime += timingAst.duration + timingAst.delay; + var /** @type {?} */ styleAst = this.visitStyle(styleMetadata_1, context); + styleAst.isEmptyStep = isEmpty; + styles = styleAst; + } + context.currentAnimateTimings = null; + return new AnimateAst(timingAst, styles); + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitStyle = function (metadata, context) { + var /** @type {?} */ ast = this._makeStyleAst(metadata, context); + this._validateStyleAst(ast, context); + return ast; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype._makeStyleAst = function (metadata, context) { + var /** @type {?} */ styles = []; + if (Array.isArray(metadata.styles)) { + ((metadata.styles)).forEach(function (styleTuple) { + if (typeof styleTuple == 'string') { + if (styleTuple == _angular_animations.AUTO_STYLE) { + styles.push(/** @type {?} */ (styleTuple)); + } + else { + context.errors.push("The provided style string value " + styleTuple + " is not allowed."); + } + } + else { + styles.push(/** @type {?} */ (styleTuple)); + } + }); + } + else { + styles.push(metadata.styles); + } + var /** @type {?} */ collectedEasing = null; + styles.forEach(function (styleData) { + if (isObject(styleData)) { + var /** @type {?} */ styleMap = (styleData); + var /** @type {?} */ easing = styleMap['easing']; + if (easing) { + collectedEasing = (easing); + delete styleMap['easing']; + } + } + }); + return new StyleAst(styles, collectedEasing, metadata.offset); + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype._validateStyleAst = function (ast, context) { + var /** @type {?} */ timings = context.currentAnimateTimings; + var /** @type {?} */ endTime = context.currentTime; + var /** @type {?} */ startTime = context.currentTime; + if (timings && startTime > 0) { + startTime -= timings.duration + timings.delay; + } + ast.styles.forEach(function (tuple) { + if (typeof tuple == 'string') + return; + Object.keys(tuple).forEach(function (prop) { + var /** @type {?} */ collectedStyles = context.collectedStyles[((context.currentQuerySelector))]; + var /** @type {?} */ collectedEntry = collectedStyles[prop]; + var /** @type {?} */ updateCollectedStyle = true; + if (collectedEntry) { + if (startTime != endTime && startTime >= collectedEntry.startTime && + endTime <= collectedEntry.endTime) { + context.errors.push("The CSS property \"" + prop + "\" that exists between the times of \"" + collectedEntry.startTime + "ms\" and \"" + collectedEntry.endTime + "ms\" is also being animated in a parallel animation between the times of \"" + startTime + "ms\" and \"" + endTime + "ms\""); + 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[prop] = { startTime: startTime, endTime: endTime }; + } + if (context.options) { + validateStyleParams(tuple[prop], context.options, context.errors); + } + }); + }); + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitKeyframes = function (metadata, context) { + var _this = this; + if (!context.currentAnimateTimings) { + context.errors.push("keyframes() must be placed inside of a call to animate()"); + return new KeyframesAst([]); + } + var /** @type {?} */ MAX_KEYFRAME_OFFSET = 1; + var /** @type {?} */ totalKeyframesWithOffsets = 0; + var /** @type {?} */ offsets = []; + var /** @type {?} */ offsetsOutOfOrder = false; + var /** @type {?} */ keyframesOutOfRange = false; + var /** @type {?} */ previousOffset = 0; + var /** @type {?} */ keyframes = metadata.steps.map(function (styles) { + var /** @type {?} */ style$$1 = _this._makeStyleAst(styles, context); + var /** @type {?} */ offsetVal = style$$1.offset != null ? style$$1.offset : consumeOffset(style$$1.styles); + var /** @type {?} */ offset = 0; + if (offsetVal != null) { + totalKeyframesWithOffsets++; + offset = style$$1.offset = offsetVal; + } + keyframesOutOfRange = keyframesOutOfRange || offset < 0 || offset > 1; + offsetsOutOfOrder = offsetsOutOfOrder || offset < previousOffset; + previousOffset = offset; + offsets.push(offset); + return style$$1; + }); + if (keyframesOutOfRange) { + context.errors.push("Please ensure that all keyframe offsets are between 0 and 1"); + } + if (offsetsOutOfOrder) { + context.errors.push("Please ensure that all keyframe offsets are in order"); + } + var /** @type {?} */ length = metadata.steps.length; + var /** @type {?} */ generatedOffset = 0; + if (totalKeyframesWithOffsets > 0 && totalKeyframesWithOffsets < length) { + context.errors.push("Not all style() steps within the declared keyframes() contain offsets"); + } + else if (totalKeyframesWithOffsets == 0) { + generatedOffset = MAX_KEYFRAME_OFFSET / (length - 1); + } + var /** @type {?} */ limit = length - 1; + var /** @type {?} */ currentTime = context.currentTime; + var /** @type {?} */ currentAnimateTimings = ((context.currentAnimateTimings)); + var /** @type {?} */ animateDuration = currentAnimateTimings.duration; + keyframes.forEach(function (kf, i) { + var /** @type {?} */ offset = generatedOffset > 0 ? (i == limit ? 1 : (generatedOffset * i)) : offsets[i]; + var /** @type {?} */ durationUpToThisFrame = offset * animateDuration; + context.currentTime = currentTime + currentAnimateTimings.delay + durationUpToThisFrame; + currentAnimateTimings.duration = durationUpToThisFrame; + _this._validateStyleAst(kf, context); + kf.offset = offset; + }); + return new KeyframesAst(keyframes); + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitReference = function (metadata, context) { + var /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context); + var /** @type {?} */ ast = new ReferenceAst(entry); + ast.options = normalizeAnimationOptions(metadata.options); + return ast; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitAnimateChild = function (metadata, context) { + context.depCount++; + var /** @type {?} */ ast = new AnimateChildAst(); + ast.options = normalizeAnimationOptions(metadata.options); + return ast; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitAnimateRef = function (metadata, context) { + var /** @type {?} */ animation = this.visitReference(metadata.animation, context); + var /** @type {?} */ ast = new AnimateRefAst(animation); + ast.options = normalizeAnimationOptions(metadata.options); + return ast; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitQuery = function (metadata, context) { + var /** @type {?} */ parentSelector = ((context.currentQuerySelector)); + var /** @type {?} */ options = ((metadata.options || {})); + context.queryCount++; + context.currentQuery = metadata; + var _a = normalizeSelector(metadata.selector), selector = _a[0], includeSelf = _a[1]; + context.currentQuerySelector = + parentSelector.length ? (parentSelector + ' ' + selector) : selector; + getOrSetAsInMap(context.collectedStyles, context.currentQuerySelector, {}); + var /** @type {?} */ entry = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context); + context.currentQuery = null; + context.currentQuerySelector = parentSelector; + var /** @type {?} */ ast = new QueryAst(selector, options.limit || 0, !!options.optional, includeSelf, entry); + ast.originalSelector = metadata.selector; + ast.options = normalizeAnimationOptions(metadata.options); + return ast; + }; + /** + * @param {?} metadata + * @param {?} context + * @return {?} + */ + AnimationAstBuilderVisitor.prototype.visitStagger = function (metadata, context) { + if (!context.currentQuery) { + context.errors.push("stagger() can only be used inside of query()"); + } + var /** @type {?} */ timings = metadata.timings === 'full' ? + { duration: 0, delay: 0, easing: 'full' } : + resolveTiming(metadata.timings, context.errors, true); + var /** @type {?} */ animation = visitAnimationNode(this, normalizeAnimationEntry(metadata.animation), context); + return new StaggerAst(timings, animation); + }; + return AnimationAstBuilderVisitor; +}()); +/** + * @param {?} selector + * @return {?} + */ +function normalizeSelector(selector) { + var /** @type {?} */ hasAmpersand = selector.split(/\s*,\s*/).find(function (token) { return token == SELF_TOKEN; }) ? true : false; + if (hasAmpersand) { + selector = selector.replace(SELF_TOKEN_REGEX, ''); + } + selector = selector.replace(ENTER_TOKEN_REGEX, ENTER_SELECTOR) + .replace(LEAVE_TOKEN_REGEX, LEAVE_SELECTOR) + .replace(/@\*/g, NG_TRIGGER_SELECTOR) + .replace(/@\w+/g, function (match) { return NG_TRIGGER_SELECTOR + '-' + match.substr(1); }) + .replace(/:animating/g, NG_ANIMATING_SELECTOR); + return [selector, hasAmpersand]; +} +/** + * @param {?} obj + * @return {?} + */ +function normalizeParams(obj) { + return obj ? copyObj(obj) : null; +} +var AnimationAstBuilderContext = (function () { + /** + * @param {?} errors + */ + function AnimationAstBuilderContext(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 = {}; + this.options = null; + } + return AnimationAstBuilderContext; +}()); +/** + * @param {?} styles + * @return {?} + */ +function consumeOffset(styles) { + if (typeof styles == 'string') + return null; + var /** @type {?} */ offset = null; + if (Array.isArray(styles)) { + styles.forEach(function (styleTuple) { + if (isObject(styleTuple) && styleTuple.hasOwnProperty('offset')) { + var /** @type {?} */ obj = (styleTuple); + offset = parseFloat(/** @type {?} */ (obj['offset'])); + delete obj['offset']; + } + }); + } + else if (isObject(styles) && styles.hasOwnProperty('offset')) { + var /** @type {?} */ obj = (styles); + offset = parseFloat(/** @type {?} */ (obj['offset'])); + delete obj['offset']; + } + return offset; +} +/** + * @param {?} value + * @return {?} + */ +function isObject(value) { + return !Array.isArray(value) && typeof value == 'object'; +} +/** + * @param {?} value + * @param {?} errors + * @return {?} + */ +function constructTimingAst(value, errors) { + var /** @type {?} */ timings = null; + if (value.hasOwnProperty('duration')) { + timings = (value); + } + else if (typeof value == 'number') { + var /** @type {?} */ duration = resolveTiming(/** @type {?} */ (value), errors).duration; + return new TimingAst(/** @type {?} */ (value), 0, ''); + } + var /** @type {?} */ strValue = (value); + var /** @type {?} */ isDynamic = strValue.split(/\s+/).some(function (v) { return v.charAt(0) == '{' && v.charAt(1) == '{'; }); + if (isDynamic) { + return new DynamicTimingAst(strValue); + } + timings = timings || resolveTiming(strValue, errors); + return new TimingAst(timings.duration, timings.delay, timings.easing); +} +/** + * @param {?} options + * @return {?} + */ +function normalizeAnimationOptions(options) { + if (options) { + options = copyObj(options); + if (options['params']) { + options['params'] = ((normalizeParams(options['params']))); + } + } + else { + options = {}; + } + return options; +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * @param {?} element + * @param {?} keyframes + * @param {?} preStyleProps + * @param {?} postStyleProps + * @param {?} duration + * @param {?} delay + * @param {?=} easing + * @param {?=} subTimeline + * @return {?} + */ +function createTimelineInstruction(element, keyframes, preStyleProps, postStyleProps, duration, delay, easing, subTimeline) { + if (easing === void 0) { easing = null; } + if (subTimeline === void 0) { subTimeline = false; } + return { + type: 1 /* TimelineAnimation */, + element: element, + keyframes: keyframes, + preStyleProps: preStyleProps, + postStyleProps: postStyleProps, + duration: duration, + delay: delay, + totalTime: duration + delay, easing: easing, subTimeline: subTimeline + }; +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var ElementInstructionMap = (function () { + function ElementInstructionMap() { + this._map = new Map(); + } + /** + * @param {?} element + * @return {?} + */ + ElementInstructionMap.prototype.consume = function (element) { + var /** @type {?} */ instructions = this._map.get(element); + if (instructions) { + this._map.delete(element); + } + else { + instructions = []; + } + return instructions; + }; + /** + * @param {?} element + * @param {?} instructions + * @return {?} + */ + ElementInstructionMap.prototype.append = function (element, instructions) { + var /** @type {?} */ existingInstructions = this._map.get(element); + if (!existingInstructions) { + this._map.set(element, existingInstructions = []); + } + existingInstructions.push.apply(existingInstructions, instructions); + }; + /** + * @param {?} element + * @return {?} + */ + ElementInstructionMap.prototype.has = function (element) { return this._map.has(element); }; + /** + * @return {?} + */ + ElementInstructionMap.prototype.clear = function () { this._map.clear(); }; + return ElementInstructionMap; +}()); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var ONE_FRAME_IN_MILLISECONDS = 1; +/** + * @param {?} driver + * @param {?} rootElement + * @param {?} ast + * @param {?=} startingStyles + * @param {?=} finalStyles + * @param {?=} options + * @param {?=} subInstructions + * @param {?=} errors + * @return {?} + */ +function buildAnimationTimelines(driver, rootElement, ast, startingStyles, finalStyles, options, subInstructions, errors) { + if (startingStyles === void 0) { startingStyles = {}; } + if (finalStyles === void 0) { finalStyles = {}; } + if (errors === void 0) { errors = []; } + return new AnimationTimelineBuilderVisitor().buildKeyframes(driver, rootElement, ast, startingStyles, finalStyles, options, subInstructions, errors); +} +var AnimationTimelineBuilderVisitor = (function () { + function AnimationTimelineBuilderVisitor() { + } + /** + * @param {?} driver + * @param {?} rootElement + * @param {?} ast + * @param {?} startingStyles + * @param {?} finalStyles + * @param {?} options + * @param {?=} subInstructions + * @param {?=} errors + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.buildKeyframes = function (driver, rootElement, ast, startingStyles, finalStyles, options, subInstructions, errors) { + if (errors === void 0) { errors = []; } + subInstructions = subInstructions || new ElementInstructionMap(); + var /** @type {?} */ context = new AnimationTimelineContext(driver, rootElement, subInstructions, errors, []); + context.options = options; + context.currentTimeline.setStyles([startingStyles], null, context.errors, options); + ast.visit(this, context); + // this checks to see if an actual animation happened + var /** @type {?} */ timelines = context.timelines.filter(function (timeline) { return timeline.containsAnimation(); }); + if (timelines.length && Object.keys(finalStyles).length) { + var /** @type {?} */ tl = timelines[timelines.length - 1]; + if (!tl.allowOnlyTimelineStyles()) { + tl.setStyles([finalStyles], null, context.errors, options); + } + } + return timelines.length ? timelines.map(function (timeline) { return timeline.buildKeyframes(); }) : + [createTimelineInstruction(rootElement, [], [], [], 0, 0, '', false)]; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitTrigger = function (ast, context) { + // these values are not visited in this AST + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitState = function (ast, context) { + // these values are not visited in this AST + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitTransition = function (ast, context) { + // these values are not visited in this AST + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitAnimateChild = function (ast, context) { + var /** @type {?} */ elementInstructions = context.subInstructions.consume(context.element); + if (elementInstructions) { + var /** @type {?} */ innerContext = context.createSubContext(ast.options); + var /** @type {?} */ startTime = context.currentTimeline.currentTime; + var /** @type {?} */ endTime = this._visitSubInstructions(elementInstructions, innerContext, /** @type {?} */ (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); + } + } + context.previousNode = ast; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitAnimateRef = function (ast, context) { + var /** @type {?} */ innerContext = context.createSubContext(ast.options); + innerContext.transformIntoNewTimeline(); + this.visitReference(ast.animation, innerContext); + context.transformIntoNewTimeline(innerContext.currentTimeline.currentTime); + context.previousNode = ast; + }; + /** + * @param {?} instructions + * @param {?} context + * @param {?} options + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype._visitSubInstructions = function (instructions, context, options) { + var /** @type {?} */ startTime = context.currentTimeline.currentTime; + var /** @type {?} */ furthestTime = startTime; + // this is a special-case for when a user wants to skip a sub + // animation from being fired entirely. + var /** @type {?} */ duration = options.duration != null ? resolveTimingValue(options.duration) : null; + var /** @type {?} */ delay = options.delay != null ? resolveTimingValue(options.delay) : null; + if (duration !== 0) { + instructions.forEach(function (instruction) { + var /** @type {?} */ instructionTimings = context.appendInstructionToTimeline(instruction, duration, delay); + furthestTime = + Math.max(furthestTime, instructionTimings.duration + instructionTimings.delay); + }); + } + return furthestTime; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitReference = function (ast, context) { + context.updateOptions(ast.options, true); + ast.animation.visit(this, context); + context.previousNode = ast; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitSequence = function (ast, context) { + var _this = this; + var /** @type {?} */ subContextCount = context.subContextCount; + var /** @type {?} */ ctx = context; + var /** @type {?} */ options = ast.options; + if (options && (options.params || options.delay)) { + ctx = context.createSubContext(options); + ctx.transformIntoNewTimeline(); + if (options.delay != null) { + if (ctx.previousNode instanceof StyleAst) { + ctx.currentTimeline.snapshotCurrentStyles(); + ctx.previousNode = DEFAULT_NOOP_PREVIOUS_NODE; + } + var /** @type {?} */ delay = resolveTimingValue(options.delay); + ctx.delayNextStep(delay); + } + } + if (ast.steps.length) { + ast.steps.forEach(function (s) { return s.visit(_this, ctx); }); + // this is here just incase 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(); + } + } + context.previousNode = ast; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitGroup = function (ast, context) { + var _this = this; + var /** @type {?} */ innerTimelines = []; + var /** @type {?} */ furthestTime = context.currentTimeline.currentTime; + var /** @type {?} */ delay = ast.options && ast.options.delay ? resolveTimingValue(ast.options.delay) : 0; + ast.steps.forEach(function (s) { + var /** @type {?} */ innerContext = context.createSubContext(ast.options); + if (delay) { + innerContext.delayNextStep(delay); + } + s.visit(_this, 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(function (timeline) { return context.currentTimeline.mergeTimelineCollectedStyles(timeline); }); + context.transformIntoNewTimeline(furthestTime); + context.previousNode = ast; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitTiming = function (ast, context) { + if (ast instanceof DynamicTimingAst) { + var /** @type {?} */ strValue = context.params ? + interpolateParams(ast.value, context.params, context.errors) : + ast.value.toString(); + return resolveTiming(strValue, context.errors); + } + else { + return { duration: ast.duration, delay: ast.delay, easing: ast.easing }; + } + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitAnimate = function (ast, context) { + var /** @type {?} */ timings = context.currentAnimateTimings = this.visitTiming(ast.timings, context); + var /** @type {?} */ timeline = context.currentTimeline; + if (timings.delay) { + context.incrementTime(timings.delay); + timeline.snapshotCurrentStyles(); + } + var /** @type {?} */ style$$1 = ast.style; + if (style$$1 instanceof KeyframesAst) { + this.visitKeyframes(style$$1, context); + } + else { + context.incrementTime(timings.duration); + this.visitStyle(/** @type {?} */ (style$$1), context); + timeline.applyStylesToKeyframe(); + } + context.currentAnimateTimings = null; + context.previousNode = ast; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitStyle = function (ast, context) { + var /** @type {?} */ timeline = context.currentTimeline; + var /** @type {?} */ 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.getCurrentStyleProperties().length) { + timeline.forwardFrame(); + } + var /** @type {?} */ easing = (timings && timings.easing) || ast.easing; + if (ast.isEmptyStep) { + timeline.applyEmptyStep(easing); + } + else { + timeline.setStyles(ast.styles, easing, context.errors, context.options); + } + context.previousNode = ast; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitKeyframes = function (ast, context) { + var /** @type {?} */ currentAnimateTimings = ((context.currentAnimateTimings)); + var /** @type {?} */ startTime = (((context.currentTimeline))).duration; + var /** @type {?} */ duration = currentAnimateTimings.duration; + var /** @type {?} */ innerContext = context.createSubContext(); + var /** @type {?} */ innerTimeline = innerContext.currentTimeline; + innerTimeline.easing = currentAnimateTimings.easing; + ast.styles.forEach(function (step) { + var /** @type {?} */ 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; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitQuery = function (ast, context) { + var _this = this; + // 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 + var /** @type {?} */ startTime = context.currentTimeline.currentTime; + var /** @type {?} */ options = ((ast.options || {})); + var /** @type {?} */ delay = options.delay ? resolveTimingValue(options.delay) : 0; + if (delay && (context.previousNode instanceof StyleAst || + (startTime == 0 && context.currentTimeline.getCurrentStyleProperties().length))) { + context.currentTimeline.snapshotCurrentStyles(); + context.previousNode = DEFAULT_NOOP_PREVIOUS_NODE; + } + var /** @type {?} */ furthestTime = startTime; + var /** @type {?} */ elms = context.invokeQuery(ast.selector, ast.originalSelector, ast.limit, ast.includeSelf, options.optional ? true : false, context.errors); + context.currentQueryTotal = elms.length; + var /** @type {?} */ sameElementTimeline = null; + elms.forEach(function (element, i) { + context.currentQueryIndex = i; + var /** @type {?} */ innerContext = context.createSubContext(ast.options, element); + if (delay) { + innerContext.delayNextStep(delay); + } + if (element === context.element) { + sameElementTimeline = innerContext.currentTimeline; + } + ast.animation.visit(_this, 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(); + var /** @type {?} */ 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; + }; + /** + * @param {?} ast + * @param {?} context + * @return {?} + */ + AnimationTimelineBuilderVisitor.prototype.visitStagger = function (ast, context) { + var /** @type {?} */ parentContext = ((context.parentContext)); + var /** @type {?} */ tl = context.currentTimeline; + var /** @type {?} */ timings = ast.timings; + var /** @type {?} */ duration = Math.abs(timings.duration); + var /** @type {?} */ maxTime = duration * (context.currentQueryTotal - 1); + var /** @type {?} */ delay = duration * context.currentQueryIndex; + var /** @type {?} */ staggerTransformer = timings.duration < 0 ? 'reverse' : timings.easing; + switch (staggerTransformer) { + case 'reverse': + delay = maxTime - delay; + break; + case 'full': + delay = parentContext.currentStaggerTime; + break; + } + var /** @type {?} */ timeline = context.currentTimeline; + if (delay) { + timeline.delayNextStep(delay); + } + var /** @type {?} */ startingTime = timeline.currentTime; + ast.animation.visit(this, 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); + }; + return AnimationTimelineBuilderVisitor; +}()); +var DEFAULT_NOOP_PREVIOUS_NODE = ({}); +var AnimationTimelineContext = (function () { + /** + * @param {?} _driver + * @param {?} element + * @param {?} subInstructions + * @param {?} errors + * @param {?} timelines + * @param {?=} initialTimeline + */ + function AnimationTimelineContext(_driver, element, subInstructions, errors, timelines, initialTimeline) { + this._driver = _driver; + this.element = element; + this.subInstructions = subInstructions; + 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(element, 0); + timelines.push(this.currentTimeline); + } + Object.defineProperty(AnimationTimelineContext.prototype, "params", { + /** + * @return {?} + */ + get: function () { return this.options.params; }, + enumerable: true, + configurable: true + }); + /** + * @param {?} options + * @param {?=} skipIfExists + * @return {?} + */ + AnimationTimelineContext.prototype.updateOptions = function (options, skipIfExists) { + var _this = this; + if (!options) + return; + var /** @type {?} */ newOptions = (options); + var /** @type {?} */ 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); + } + var /** @type {?} */ newParams = newOptions.params; + if (newParams) { + var /** @type {?} */ paramsToUpdate_1 = ((optionsToUpdate.params)); + if (!paramsToUpdate_1) { + paramsToUpdate_1 = this.options.params = {}; + } + Object.keys(newParams).forEach(function (name) { + if (!skipIfExists || !paramsToUpdate_1.hasOwnProperty(name)) { + paramsToUpdate_1[name] = interpolateParams(newParams[name], paramsToUpdate_1, _this.errors); + } + }); + } + }; + /** + * @return {?} + */ + AnimationTimelineContext.prototype._copyOptions = function () { + var /** @type {?} */ options = {}; + if (this.options) { + var /** @type {?} */ oldParams_1 = this.options.params; + if (oldParams_1) { + var /** @type {?} */ params_1 = options['params'] = {}; + Object.keys(this.options.params).forEach(function (name) { params_1[name] = oldParams_1[name]; }); + } + } + return options; + }; + /** + * @param {?=} options + * @param {?=} element + * @param {?=} newTime + * @return {?} + */ + AnimationTimelineContext.prototype.createSubContext = function (options, element, newTime) { + if (options === void 0) { options = null; } + var /** @type {?} */ target = element || this.element; + var /** @type {?} */ context = new AnimationTimelineContext(this._driver, target, this.subInstructions, 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; + }; + /** + * @param {?=} newTime + * @return {?} + */ + AnimationTimelineContext.prototype.transformIntoNewTimeline = function (newTime) { + this.previousNode = DEFAULT_NOOP_PREVIOUS_NODE; + this.currentTimeline = this.currentTimeline.fork(this.element, newTime); + this.timelines.push(this.currentTimeline); + return this.currentTimeline; + }; + /** + * @param {?} instruction + * @param {?} duration + * @param {?} delay + * @return {?} + */ + AnimationTimelineContext.prototype.appendInstructionToTimeline = function (instruction, duration, delay) { + var /** @type {?} */ updatedTimings = { + duration: duration != null ? duration : instruction.duration, + delay: this.currentTimeline.currentTime + (delay != null ? delay : 0) + instruction.delay, + easing: '' + }; + var /** @type {?} */ builder = new SubTimelineBuilder(instruction.element, instruction.keyframes, instruction.preStyleProps, instruction.postStyleProps, updatedTimings, instruction.stretchStartingKeyframe); + this.timelines.push(builder); + return updatedTimings; + }; + /** + * @param {?} time + * @return {?} + */ + AnimationTimelineContext.prototype.incrementTime = function (time) { + this.currentTimeline.forwardTime(this.currentTimeline.duration + time); + }; + /** + * @param {?} delay + * @return {?} + */ + AnimationTimelineContext.prototype.delayNextStep = function (delay) { + // negative delays are not yet supported + if (delay > 0) { + this.currentTimeline.delayNextStep(delay); + } + }; + /** + * @param {?} selector + * @param {?} originalSelector + * @param {?} limit + * @param {?} includeSelf + * @param {?} optional + * @param {?} errors + * @return {?} + */ + AnimationTimelineContext.prototype.invokeQuery = function (selector, originalSelector, limit, includeSelf, optional, errors) { + var /** @type {?} */ results = []; + if (includeSelf) { + results.push(this.element); + } + if (selector.length > 0) { + var /** @type {?} */ multi = limit != 1; + results.push.apply(results, this._driver.query(this.element, selector, multi)); + } + if (!optional && results.length == 0) { + errors.push("`query(\"" + originalSelector + "\")` returned zero elements. (Use `query(\"" + originalSelector + "\", { optional: true })` if you wish to allow this.)"); + } + return results; + }; + return AnimationTimelineContext; +}()); +var TimelineBuilder = (function () { + /** + * @param {?} element + * @param {?} startTime + * @param {?=} _elementTimelineStylesLookup + */ + function TimelineBuilder(element, startTime, _elementTimelineStylesLookup) { + this.element = element; + this.startTime = startTime; + this._elementTimelineStylesLookup = _elementTimelineStylesLookup; + this.duration = 0; + this._previousKeyframe = {}; + this._currentKeyframe = {}; + this._keyframes = new Map(); + this._styleSummary = {}; + this._pendingStyles = {}; + this._backFill = {}; + this._currentEmptyStepKeyframe = null; + if (!this._elementTimelineStylesLookup) { + this._elementTimelineStylesLookup = new Map(); + } + this._localTimelineStyles = Object.create(this._backFill, {}); + this._globalTimelineStyles = this._elementTimelineStylesLookup.get(element); + if (!this._globalTimelineStyles) { + this._globalTimelineStyles = this._localTimelineStyles; + this._elementTimelineStylesLookup.set(element, this._localTimelineStyles); + } + this._loadKeyframe(); + } + /** + * @return {?} + */ + TimelineBuilder.prototype.containsAnimation = function () { + switch (this._keyframes.size) { + case 0: + return false; + case 1: + return this.getCurrentStyleProperties().length > 0; + default: + return true; + } + }; + /** + * @return {?} + */ + TimelineBuilder.prototype.getCurrentStyleProperties = function () { return Object.keys(this._currentKeyframe); }; + Object.defineProperty(TimelineBuilder.prototype, "currentTime", { + /** + * @return {?} + */ + get: function () { return this.startTime + this.duration; }, + enumerable: true, + configurable: true + }); + /** + * @param {?} delay + * @return {?} + */ + TimelineBuilder.prototype.delayNextStep = function (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... + var /** @type {?} */ hasPreStyleStep = this._keyframes.size == 1 && Object.keys(this._pendingStyles).length; + if (this.duration || hasPreStyleStep) { + this.forwardTime(this.currentTime + delay); + if (hasPreStyleStep) { + this.snapshotCurrentStyles(); + } + } + else { + this.startTime += delay; + } + }; + /** + * @param {?} element + * @param {?=} currentTime + * @return {?} + */ + TimelineBuilder.prototype.fork = function (element, currentTime) { + this.applyStylesToKeyframe(); + return new TimelineBuilder(element, currentTime || this.currentTime, this._elementTimelineStylesLookup); + }; + /** + * @return {?} + */ + TimelineBuilder.prototype._loadKeyframe = function () { + if (this._currentKeyframe) { + this._previousKeyframe = this._currentKeyframe; + } + this._currentKeyframe = ((this._keyframes.get(this.duration))); + if (!this._currentKeyframe) { + this._currentKeyframe = Object.create(this._backFill, {}); + this._keyframes.set(this.duration, this._currentKeyframe); + } + }; + /** + * @return {?} + */ + TimelineBuilder.prototype.forwardFrame = function () { + this.duration += ONE_FRAME_IN_MILLISECONDS; + this._loadKeyframe(); + }; + /** + * @param {?} time + * @return {?} + */ + TimelineBuilder.prototype.forwardTime = function (time) { + this.applyStylesToKeyframe(); + this.duration = time; + this._loadKeyframe(); + }; + /** + * @param {?} prop + * @param {?} value + * @return {?} + */ + TimelineBuilder.prototype._updateStyle = function (prop, value) { + this._localTimelineStyles[prop] = value; + this._globalTimelineStyles[prop] = value; + this._styleSummary[prop] = { time: this.currentTime, value: value }; + }; + /** + * @return {?} + */ + TimelineBuilder.prototype.allowOnlyTimelineStyles = function () { return this._currentEmptyStepKeyframe !== this._currentKeyframe; }; + /** + * @param {?} easing + * @return {?} + */ + TimelineBuilder.prototype.applyEmptyStep = function (easing) { + var _this = this; + if (easing) { + this._previousKeyframe['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 + Object.keys(this._globalTimelineStyles).forEach(function (prop) { + _this._backFill[prop] = _this._globalTimelineStyles[prop] || _angular_animations.AUTO_STYLE; + _this._currentKeyframe[prop] = _angular_animations.AUTO_STYLE; + }); + this._currentEmptyStepKeyframe = this._currentKeyframe; + }; + /** + * @param {?} input + * @param {?} easing + * @param {?} errors + * @param {?=} options + * @return {?} + */ + TimelineBuilder.prototype.setStyles = function (input, easing, errors, options) { + var _this = this; + if (easing) { + this._previousKeyframe['easing'] = easing; + } + var /** @type {?} */ params = (options && options.params) || {}; + var /** @type {?} */ styles = flattenStyles(input, this._globalTimelineStyles); + Object.keys(styles).forEach(function (prop) { + var /** @type {?} */ val = interpolateParams(styles[prop], params, errors); + _this._pendingStyles[prop] = val; + if (!_this._localTimelineStyles.hasOwnProperty(prop)) { + _this._backFill[prop] = _this._globalTimelineStyles.hasOwnProperty(prop) ? + _this._globalTimelineStyles[prop] : + _angular_animations.AUTO_STYLE; + } + _this._updateStyle(prop, val); + }); + }; + /** + * @return {?} + */ + TimelineBuilder.prototype.applyStylesToKeyframe = function () { + var _this = this; + var /** @type {?} */ styles = this._pendingStyles; + var /** @type {?} */ props = Object.keys(styles); + if (props.length == 0) + return; + this._pendingStyles = {}; + props.forEach(function (prop) { + var /** @type {?} */ val = styles[prop]; + _this._currentKeyframe[prop] = val; + }); + Object.keys(this._localTimelineStyles).forEach(function (prop) { + if (!_this._currentKeyframe.hasOwnProperty(prop)) { + _this._currentKeyframe[prop] = _this._localTimelineStyles[prop]; + } + }); + }; + /** + * @return {?} + */ + TimelineBuilder.prototype.snapshotCurrentStyles = function () { + var _this = this; + Object.keys(this._localTimelineStyles).forEach(function (prop) { + var /** @type {?} */ val = _this._localTimelineStyles[prop]; + _this._pendingStyles[prop] = val; + _this._updateStyle(prop, val); + }); + }; + /** + * @return {?} + */ + TimelineBuilder.prototype.getFinalKeyframe = function () { return this._keyframes.get(this.duration); }; + Object.defineProperty(TimelineBuilder.prototype, "properties", { + /** + * @return {?} + */ + get: function () { + var /** @type {?} */ properties = []; + for (var /** @type {?} */ prop in this._currentKeyframe) { + properties.push(prop); + } + return properties; + }, + enumerable: true, + configurable: true + }); + /** + * @param {?} timeline + * @return {?} + */ + TimelineBuilder.prototype.mergeTimelineCollectedStyles = function (timeline) { + var _this = this; + Object.keys(timeline._styleSummary).forEach(function (prop) { + var /** @type {?} */ details0 = _this._styleSummary[prop]; + var /** @type {?} */ details1 = timeline._styleSummary[prop]; + if (!details0 || details1.time > details0.time) { + _this._updateStyle(prop, details1.value); + } + }); + }; + /** + * @return {?} + */ + TimelineBuilder.prototype.buildKeyframes = function () { + var _this = this; + this.applyStylesToKeyframe(); + var /** @type {?} */ preStyleProps = new Set(); + var /** @type {?} */ postStyleProps = new Set(); + var /** @type {?} */ isEmpty = this._keyframes.size === 1 && this.duration === 0; + var /** @type {?} */ finalKeyframes = []; + this._keyframes.forEach(function (keyframe, time) { + var /** @type {?} */ finalKeyframe = copyStyles(keyframe, true); + Object.keys(finalKeyframe).forEach(function (prop) { + var /** @type {?} */ value = finalKeyframe[prop]; + if (value == _angular_animations.ɵPRE_STYLE) { + preStyleProps.add(prop); + } + else if (value == _angular_animations.AUTO_STYLE) { + postStyleProps.add(prop); + } + }); + if (!isEmpty) { + finalKeyframe['offset'] = time / _this.duration; + } + finalKeyframes.push(finalKeyframe); + }); + var /** @type {?} */ preProps = preStyleProps.size ? iteratorToArray(preStyleProps.values()) : []; + var /** @type {?} */ postProps = postStyleProps.size ? iteratorToArray(postStyleProps.values()) : []; + // special case for a 0-second animation (which is designed just to place styles onscreen) + if (isEmpty) { + var /** @type {?} */ kf0 = finalKeyframes[0]; + var /** @type {?} */ kf1 = copyObj(kf0); + kf0['offset'] = 0; + kf1['offset'] = 1; + finalKeyframes = [kf0, kf1]; + } + return createTimelineInstruction(this.element, finalKeyframes, preProps, postProps, this.duration, this.startTime, this.easing, false); + }; + return TimelineBuilder; +}()); +var SubTimelineBuilder = (function (_super) { + __extends(SubTimelineBuilder, _super); + /** + * @param {?} element + * @param {?} keyframes + * @param {?} preStyleProps + * @param {?} postStyleProps + * @param {?} timings + * @param {?=} _stretchStartingKeyframe + */ + function SubTimelineBuilder(element, keyframes, preStyleProps, postStyleProps, timings, _stretchStartingKeyframe) { + if (_stretchStartingKeyframe === void 0) { _stretchStartingKeyframe = false; } + var _this = _super.call(this, element, timings.delay) || this; + _this.element = element; + _this.keyframes = keyframes; + _this.preStyleProps = preStyleProps; + _this.postStyleProps = postStyleProps; + _this._stretchStartingKeyframe = _stretchStartingKeyframe; + _this.timings = { duration: timings.duration, delay: timings.delay, easing: timings.easing }; + return _this; + } + /** + * @return {?} + */ + SubTimelineBuilder.prototype.containsAnimation = function () { return this.keyframes.length > 1; }; + /** + * @return {?} + */ + SubTimelineBuilder.prototype.buildKeyframes = function () { + var /** @type {?} */ keyframes = this.keyframes; + var _a = this.timings, delay = _a.delay, duration = _a.duration, easing = _a.easing; + if (this._stretchStartingKeyframe && delay) { + var /** @type {?} */ newKeyframes = []; + var /** @type {?} */ totalTime = duration + delay; + var /** @type {?} */ startingGap = delay / totalTime; + // the original starting keyframe now starts once the delay is done + var /** @type {?} */ newFirstKeyframe = copyStyles(keyframes[0], false); + newFirstKeyframe['offset'] = 0; + newKeyframes.push(newFirstKeyframe); + var /** @type {?} */ oldFirstKeyframe = copyStyles(keyframes[0], false); + oldFirstKeyframe['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 renderered. 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 + var /** @type {?} */ limit = keyframes.length - 1; + for (var /** @type {?} */ i = 1; i <= limit; i++) { + var /** @type {?} */ kf = copyStyles(keyframes[i], false); + var /** @type {?} */ oldOffset = (kf['offset']); + var /** @type {?} */ timeAtKeyframe = delay + oldOffset * duration; + kf['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); + }; + return SubTimelineBuilder; +}(TimelineBuilder)); +/** + * @param {?} offset + * @param {?=} decimalPoints + * @return {?} + */ +function roundOffset(offset, decimalPoints) { + if (decimalPoints === void 0) { decimalPoints = 3; } + var /** @type {?} */ mult = Math.pow(10, decimalPoints - 1); + return Math.round(offset * mult) / mult; +} +/** + * @param {?} input + * @param {?} allStyles + * @return {?} + */ +function flattenStyles(input, allStyles) { + var /** @type {?} */ styles = {}; + var /** @type {?} */ allProperties; + input.forEach(function (token) { + if (token === '*') { + allProperties = allProperties || Object.keys(allStyles); + allProperties.forEach(function (prop) { styles[prop] = _angular_animations.AUTO_STYLE; }); + } + else { + copyStyles(/** @type {?} */ (token), false, styles); + } + }); + return styles; +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var Animation = (function () { + /** + * @param {?} _driver + * @param {?} input + */ + function Animation(_driver, input) { + this._driver = _driver; + var errors = []; + var ast = buildAnimationAst(input, errors); + if (errors.length) { + var errorMessage = "animation validation failed:\n" + errors.join("\n"); + throw new Error(errorMessage); + } + this._animationAst = ast; + } + /** + * @param {?} element + * @param {?} startingStyles + * @param {?} destinationStyles + * @param {?} options + * @param {?=} subInstructions + * @return {?} + */ + Animation.prototype.buildTimelines = function (element, startingStyles, destinationStyles, options, subInstructions) { + var /** @type {?} */ start = Array.isArray(startingStyles) ? normalizeStyles(startingStyles) : (startingStyles); + var /** @type {?} */ dest = Array.isArray(destinationStyles) ? normalizeStyles(destinationStyles) : (destinationStyles); + var /** @type {?} */ errors = []; + subInstructions = subInstructions || new ElementInstructionMap(); + var /** @type {?} */ result = buildAnimationTimelines(this._driver, element, this._animationAst, start, dest, options, subInstructions, errors); + if (errors.length) { + var /** @type {?} */ errorMessage = "animation building failed:\n" + errors.join("\n"); + throw new Error(errorMessage); + } + return result; + }; + return Animation; +}()); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * @experimental Animation support is experimental. + */ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ var AnimationStyleNormalizer = (function () { + function AnimationStyleNormalizer() { + } + return AnimationStyleNormalizer; +}()); +/** + * @experimental Animation support is experimental. + */ +var NoopAnimationStyleNormalizer = (function () { + function NoopAnimationStyleNormalizer() { + } + NoopAnimationStyleNormalizer.prototype.normalizePropertyName = function (propertyName, errors) { return propertyName; }; + NoopAnimationStyleNormalizer.prototype.normalizeStyleValue = function (userProvidedProperty, normalizedProperty, value, errors) { + return value; + }; + return NoopAnimationStyleNormalizer; +}()); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var WebAnimationsStyleNormalizer = (function (_super) { + __extends(WebAnimationsStyleNormalizer, _super); + function WebAnimationsStyleNormalizer() { + return _super !== null && _super.apply(this, arguments) || this; + } + /** + * @param {?} propertyName + * @param {?} errors + * @return {?} + */ + WebAnimationsStyleNormalizer.prototype.normalizePropertyName = function (propertyName, errors) { + return dashCaseToCamelCase(propertyName); + }; + /** + * @param {?} userProvidedProperty + * @param {?} normalizedProperty + * @param {?} value + * @param {?} errors + * @return {?} + */ + WebAnimationsStyleNormalizer.prototype.normalizeStyleValue = function (userProvidedProperty, normalizedProperty, value, errors) { + var /** @type {?} */ unit = ''; + var /** @type {?} */ strVal = value.toString().trim(); + if (DIMENSIONAL_PROP_MAP[normalizedProperty] && value !== 0 && value !== '0') { + if (typeof value === 'number') { + unit = 'px'; + } + else { + var /** @type {?} */ valAndSuffixMatch = value.match(/^[+-]?[\d\.]+([a-z]*)$/); + if (valAndSuffixMatch && valAndSuffixMatch[1].length == 0) { + errors.push("Please provide a CSS unit value for " + userProvidedProperty + ":" + value); + } + } + } + return strVal + unit; + }; + return WebAnimationsStyleNormalizer; +}(AnimationStyleNormalizer)); +var DIMENSIONAL_PROP_MAP = makeBooleanMap('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' + .split(',')); +/** + * @param {?} keys + * @return {?} + */ +function makeBooleanMap(keys) { + var /** @type {?} */ map = {}; + keys.forEach(function (key) { return map[key] = true; }); + return map; +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * @param {?} element + * @param {?} triggerName + * @param {?} fromState + * @param {?} toState + * @param {?} isRemovalTransition + * @param {?} fromStyles + * @param {?} toStyles + * @param {?} timelines + * @param {?} queriedElements + * @param {?} preStyleProps + * @param {?} postStyleProps + * @return {?} + */ +function createTransitionInstruction(element, triggerName, fromState, toState, isRemovalTransition, fromStyles, toStyles, timelines, queriedElements, preStyleProps, postStyleProps) { + return { + type: 0 /* TransitionAnimation */, + element: element, + triggerName: triggerName, + isRemovalTransition: isRemovalTransition, + fromState: fromState, + fromStyles: fromStyles, + toState: toState, + toStyles: toStyles, + timelines: timelines, + queriedElements: queriedElements, + preStyleProps: preStyleProps, + postStyleProps: postStyleProps + }; +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var AnimationTransitionFactory = (function () { + /** + * @param {?} _triggerName + * @param {?} ast + * @param {?} _stateStyles + */ + function AnimationTransitionFactory(_triggerName, ast, _stateStyles) { + this._triggerName = _triggerName; + this.ast = ast; + this._stateStyles = _stateStyles; + } + /** + * @param {?} currentState + * @param {?} nextState + * @return {?} + */ + AnimationTransitionFactory.prototype.match = function (currentState, nextState) { + return oneOrMoreTransitionsMatch(this.ast.matchers, currentState, nextState); + }; + /** + * @param {?} driver + * @param {?} element + * @param {?} currentState + * @param {?} nextState + * @param {?=} options + * @param {?=} subInstructions + * @return {?} + */ + AnimationTransitionFactory.prototype.build = function (driver, element, currentState, nextState, options, subInstructions) { + var /** @type {?} */ animationOptions = mergeAnimationOptions(this.ast.options || {}, options || {}); + var /** @type {?} */ backupStateStyles = this._stateStyles['*'] || {}; + var /** @type {?} */ currentStateStyles = this._stateStyles[currentState] || backupStateStyles; + var /** @type {?} */ nextStateStyles = this._stateStyles[nextState] || backupStateStyles; + var /** @type {?} */ errors = []; + var /** @type {?} */ timelines = buildAnimationTimelines(driver, element, this.ast.animation, currentStateStyles, nextStateStyles, animationOptions, subInstructions, errors); + if (errors.length) { + var /** @type {?} */ errorMessage = "animation building failed:\n" + errors.join("\n"); + throw new Error(errorMessage); + } + var /** @type {?} */ preStyleMap = new Map(); + var /** @type {?} */ postStyleMap = new Map(); + var /** @type {?} */ queriedElements = new Set(); + timelines.forEach(function (tl) { + var /** @type {?} */ elm = tl.element; + var /** @type {?} */ preProps = getOrSetAsInMap(preStyleMap, elm, {}); + tl.preStyleProps.forEach(function (prop) { return preProps[prop] = true; }); + var /** @type {?} */ postProps = getOrSetAsInMap(postStyleMap, elm, {}); + tl.postStyleProps.forEach(function (prop) { return postProps[prop] = true; }); + if (elm !== element) { + queriedElements.add(elm); + } + }); + var /** @type {?} */ queriedElementsList = iteratorToArray(queriedElements.values()); + return createTransitionInstruction(element, this._triggerName, currentState, nextState, nextState === 'void', currentStateStyles, nextStateStyles, timelines, queriedElementsList, preStyleMap, postStyleMap); + }; + return AnimationTransitionFactory; +}()); +/** + * @param {?} matchFns + * @param {?} currentState + * @param {?} nextState + * @return {?} + */ +function oneOrMoreTransitionsMatch(matchFns, currentState, nextState) { + return matchFns.some(function (fn) { return fn(currentState, nextState); }); +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * \@experimental Animation support is experimental. + * @param {?} name + * @param {?} ast + * @return {?} + */ +function buildTrigger(name, ast) { + return new AnimationTrigger(name, ast); +} +/** + * \@experimental Animation support is experimental. + */ +var AnimationTrigger = (function () { + /** + * @param {?} name + * @param {?} ast + */ + function AnimationTrigger(name, ast) { + var _this = this; + this.name = name; + this.ast = ast; + this.transitionFactories = []; + this.states = {}; + ast.states.forEach(function (ast) { + var obj = _this.states[ast.name] = {}; + ast.style.styles.forEach(function (styleTuple) { + if (typeof styleTuple == 'object') { + copyStyles(styleTuple, false, obj); + } + }); + }); + balanceProperties(this.states, 'true', '1'); + balanceProperties(this.states, 'false', '0'); + ast.transitions.forEach(function (ast) { + _this.transitionFactories.push(new AnimationTransitionFactory(name, ast, _this.states)); + }); + this.fallbackTransition = createFallbackTransition(name, this.states); + } + Object.defineProperty(AnimationTrigger.prototype, "containsQueries", { + /** + * @return {?} + */ + get: function () { return this.ast.queryCount > 0; }, + enumerable: true, + configurable: true + }); + /** + * @param {?} currentState + * @param {?} nextState + * @return {?} + */ + AnimationTrigger.prototype.matchTransition = function (currentState, nextState) { + var /** @type {?} */ entry = this.transitionFactories.find(function (f) { return f.match(currentState, nextState); }); + return entry || null; + }; + return AnimationTrigger; +}()); +/** + * @param {?} triggerName + * @param {?} states + * @return {?} + */ +function createFallbackTransition(triggerName, states) { + var /** @type {?} */ matchers = [function (fromState, toState) { return true; }]; + var /** @type {?} */ animation = new SequenceAst([]); + var /** @type {?} */ transition = new TransitionAst(matchers, animation); + return new AnimationTransitionFactory(triggerName, transition, states); +} +/** + * @param {?} obj + * @param {?} key1 + * @param {?} key2 + * @return {?} + */ +function balanceProperties(obj, key1, key2) { + if (obj.hasOwnProperty(key1)) { + if (!obj.hasOwnProperty(key2)) { + obj[key2] = obj[key1]; + } + } + else if (obj.hasOwnProperty(key2)) { + obj[key1] = obj[key2]; + } +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var EMPTY_INSTRUCTION_MAP = new ElementInstructionMap(); +var TimelineAnimationEngine = (function () { + /** + * @param {?} _driver + * @param {?} _normalizer + */ + function TimelineAnimationEngine(_driver, _normalizer) { + this._driver = _driver; + this._normalizer = _normalizer; + this._animations = {}; + this._playersById = {}; + this.players = []; + } + /** + * @param {?} id + * @param {?} metadata + * @return {?} + */ + TimelineAnimationEngine.prototype.register = function (id, metadata) { + var /** @type {?} */ errors = []; + var /** @type {?} */ ast = buildAnimationAst(metadata, errors); + if (errors.length) { + throw new Error("Unable to build the animation due to the following errors: " + errors.join("\n")); + } + else { + this._animations[id] = ast; + } + }; + /** + * @param {?} i + * @param {?} preStyles + * @param {?=} postStyles + * @return {?} + */ + TimelineAnimationEngine.prototype._buildPlayer = function (i, preStyles, postStyles) { + var /** @type {?} */ element = i.element; + var /** @type {?} */ keyframes = normalizeKeyframes(this._driver, this._normalizer, element, i.keyframes, preStyles, postStyles); + return this._driver.animate(element, keyframes, i.duration, i.delay, i.easing, []); + }; + /** + * @param {?} id + * @param {?} element + * @param {?=} options + * @return {?} + */ + TimelineAnimationEngine.prototype.create = function (id, element, options) { + var _this = this; + if (options === void 0) { options = {}; } + var /** @type {?} */ errors = []; + var /** @type {?} */ ast = this._animations[id]; + var /** @type {?} */ instructions; + var /** @type {?} */ autoStylesMap = new Map(); + if (ast) { + instructions = buildAnimationTimelines(this._driver, element, ast, {}, {}, options, EMPTY_INSTRUCTION_MAP, errors); + instructions.forEach(function (inst) { + var /** @type {?} */ styles = getOrSetAsInMap(autoStylesMap, inst.element, {}); + inst.postStyleProps.forEach(function (prop) { return styles[prop] = null; }); + }); + } + else { + errors.push('The requested animation doesn\'t exist or has already been destroyed'); + instructions = []; + } + if (errors.length) { + throw new Error("Unable to create the animation due to the following errors: " + errors.join("\n")); + } + autoStylesMap.forEach(function (styles, element) { + Object.keys(styles).forEach(function (prop) { styles[prop] = _this._driver.computeStyle(element, prop, _angular_animations.AUTO_STYLE); }); + }); + var /** @type {?} */ players = instructions.map(function (i) { + var /** @type {?} */ styles = autoStylesMap.get(i.element); + return _this._buildPlayer(i, {}, styles); + }); + var /** @type {?} */ player = optimizeGroupPlayer(players); + this._playersById[id] = player; + player.onDestroy(function () { return _this.destroy(id); }); + this.players.push(player); + return player; + }; + /** + * @param {?} id + * @return {?} + */ + TimelineAnimationEngine.prototype.destroy = function (id) { + var /** @type {?} */ player = this._getPlayer(id); + player.destroy(); + delete this._playersById[id]; + var /** @type {?} */ index = this.players.indexOf(player); + if (index >= 0) { + this.players.splice(index, 1); + } + }; + /** + * @param {?} id + * @return {?} + */ + TimelineAnimationEngine.prototype._getPlayer = function (id) { + var /** @type {?} */ player = this._playersById[id]; + if (!player) { + throw new Error("Unable to find the timeline player referenced by " + id); + } + return player; + }; + /** + * @param {?} id + * @param {?} element + * @param {?} eventName + * @param {?} callback + * @return {?} + */ + TimelineAnimationEngine.prototype.listen = function (id, element, eventName, callback) { + // triggerName, fromState, toState are all ignored for timeline animations + var /** @type {?} */ baseEvent = makeAnimationEvent(element, '', '', ''); + listenOnPlayer(this._getPlayer(id), eventName, baseEvent, callback); + return function () { }; + }; + /** + * @param {?} id + * @param {?} element + * @param {?} command + * @param {?} args + * @return {?} + */ + TimelineAnimationEngine.prototype.command = function (id, element, command, args) { + if (command == 'register') { + this.register(id, /** @type {?} */ (args[0])); + return; + } + if (command == 'create') { + var /** @type {?} */ options = ((args[0] || {})); + this.create(id, element, options); + return; + } + var /** @type {?} */ 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(/** @type {?} */ (args[0]))); + break; + case 'destroy': + this.destroy(id); + break; + } + }; + return TimelineAnimationEngine; +}()); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var EMPTY_PLAYER_ARRAY = []; +var NULL_REMOVAL_STATE = { + namespaceId: '', + setForRemoval: null, + hasAnimation: false, + removedBeforeQueried: false +}; +var NULL_REMOVED_QUERIED_STATE = { + namespaceId: '', + setForRemoval: null, + hasAnimation: false, + removedBeforeQueried: true +}; +var REMOVAL_FLAG = '__ng_removed'; +var StateValue = (function () { + /** + * @param {?} input + */ + function StateValue(input) { + var isObj = input && input.hasOwnProperty('value'); + var value = isObj ? input['value'] : input; + this.value = normalizeTriggerValue(value); + if (isObj) { + var options = copyObj(input); + delete options['value']; + this.options = options; + } + else { + this.options = {}; + } + if (!this.options.params) { + this.options.params = {}; + } + } + /** + * @param {?} options + * @return {?} + */ + StateValue.prototype.absorbOptions = function (options) { + var /** @type {?} */ newParams = options.params; + if (newParams) { + var /** @type {?} */ oldParams_2 = ((this.options.params)); + Object.keys(newParams).forEach(function (prop) { + if (oldParams_2[prop] == null) { + oldParams_2[prop] = newParams[prop]; + } + }); + } + }; + return StateValue; +}()); +var VOID_VALUE = 'void'; +var DEFAULT_STATE_VALUE = new StateValue(VOID_VALUE); +var DELETED_STATE_VALUE = new StateValue('DELETED'); +var AnimationTransitionNamespace = (function () { + /** + * @param {?} id + * @param {?} hostElement + * @param {?} _engine + */ + function AnimationTransitionNamespace(id, hostElement, _engine) { + this.id = id; + this.hostElement = hostElement; + this._engine = _engine; + this.players = []; + this._triggers = {}; + this._queue = []; + this._elementListeners = new Map(); + this._hostClassName = 'ng-tns-' + id; + addClass(hostElement, this._hostClassName); + } + /** + * @param {?} element + * @param {?} name + * @param {?} phase + * @param {?} callback + * @return {?} + */ + AnimationTransitionNamespace.prototype.listen = function (element, name, phase, callback) { + var _this = this; + if (!this._triggers.hasOwnProperty(name)) { + throw new Error("Unable to listen on the animation trigger event \"" + phase + "\" because the animation trigger \"" + name + "\" doesn't exist!"); + } + if (phase == null || phase.length == 0) { + throw new Error("Unable to listen on the animation trigger \"" + name + "\" because the provided event is undefined!"); + } + if (!isTriggerEventValid(phase)) { + throw new Error("The provided animation trigger event \"" + phase + "\" for the animation trigger \"" + name + "\" is not supported!"); + } + var /** @type {?} */ listeners = getOrSetAsInMap(this._elementListeners, element, []); + var /** @type {?} */ data = { name: name, phase: phase, callback: callback }; + listeners.push(data); + var /** @type {?} */ triggersWithStates = getOrSetAsInMap(this._engine.statesByElement, element, {}); + if (!triggersWithStates.hasOwnProperty(name)) { + addClass(element, NG_TRIGGER_CLASSNAME); + addClass(element, NG_TRIGGER_CLASSNAME + '-' + name); + triggersWithStates[name] = null; + } + return function () { + // 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(function () { + var /** @type {?} */ index = listeners.indexOf(data); + if (index >= 0) { + listeners.splice(index, 1); + } + if (!_this._triggers[name]) { + delete triggersWithStates[name]; + } + }); + }; + }; + /** + * @param {?} name + * @param {?} ast + * @return {?} + */ + AnimationTransitionNamespace.prototype.register = function (name, ast) { + if (this._triggers[name]) { + // throw + return false; + } + else { + this._triggers[name] = ast; + return true; + } + }; + /** + * @param {?} name + * @return {?} + */ + AnimationTransitionNamespace.prototype._getTrigger = function (name) { + var /** @type {?} */ trigger = this._triggers[name]; + if (!trigger) { + throw new Error("The provided animation trigger \"" + name + "\" has not been registered!"); + } + return trigger; + }; + /** + * @param {?} element + * @param {?} triggerName + * @param {?} value + * @param {?=} defaultToFallback + * @return {?} + */ + AnimationTransitionNamespace.prototype.trigger = function (element, triggerName, value, defaultToFallback) { + var _this = this; + if (defaultToFallback === void 0) { defaultToFallback = true; } + var /** @type {?} */ trigger = this._getTrigger(triggerName); + var /** @type {?} */ player = new TransitionAnimationPlayer(this.id, triggerName, element); + var /** @type {?} */ 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 = {}); + } + var /** @type {?} */ fromState = triggersWithStates[triggerName]; + var /** @type {?} */ toState = new StateValue(value); + var /** @type {?} */ isObj = value && value.hasOwnProperty('value'); + if (!isObj && fromState) { + toState.absorbOptions(fromState.options); + } + triggersWithStates[triggerName] = toState; + if (!fromState) { + fromState = DEFAULT_STATE_VALUE; + } + else if (fromState === DELETED_STATE_VALUE) { + return player; + } + var /** @type {?} */ playersOnElement = getOrSetAsInMap(this._engine.playersByElement, element, []); + playersOnElement.forEach(function (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 palyer) + if (player.namespaceId == _this.id && player.triggerName == triggerName && player.queued) { + player.destroy(); + } + }); + var /** @type {?} */ transition = trigger.matchTransition(fromState.value, toState.value); + var /** @type {?} */ isFallbackTransition = false; + if (!transition) { + if (!defaultToFallback) + return; + transition = trigger.fallbackTransition; + isFallbackTransition = true; + } + this._engine.totalQueuedPlayers++; + this._queue.push({ element: element, triggerName: triggerName, transition: transition, fromState: fromState, toState: toState, player: player, isFallbackTransition: isFallbackTransition }); + if (!isFallbackTransition) { + addClass(element, NG_ANIMATING_CLASSNAME); + } + player.onDone(function () { + removeClass(element, NG_ANIMATING_CLASSNAME); + var /** @type {?} */ index = _this.players.indexOf(player); + if (index >= 0) { + _this.players.splice(index, 1); + } + var /** @type {?} */ players = _this._engine.playersByElement.get(element); + if (players) { + var /** @type {?} */ index_1 = players.indexOf(player); + if (index_1 >= 0) { + players.splice(index_1, 1); + } + } + }); + this.players.push(player); + playersOnElement.push(player); + return player; + }; + /** + * @param {?} name + * @return {?} + */ + AnimationTransitionNamespace.prototype.deregister = function (name) { + var _this = this; + delete this._triggers[name]; + this._engine.statesByElement.forEach(function (stateMap, element) { delete stateMap[name]; }); + this._elementListeners.forEach(function (listeners, element) { + _this._elementListeners.set(element, listeners.filter(function (entry) { return entry.name != name; })); + }); + }; + /** + * @param {?} element + * @return {?} + */ + AnimationTransitionNamespace.prototype.clearElementCache = function (element) { + this._engine.statesByElement.delete(element); + this._elementListeners.delete(element); + var /** @type {?} */ elementPlayers = this._engine.playersByElement.get(element); + if (elementPlayers) { + elementPlayers.forEach(function (player) { return player.destroy(); }); + this._engine.playersByElement.delete(element); + } + }; + /** + * @param {?} rootElement + * @param {?} context + * @param {?=} animate + * @return {?} + */ + AnimationTransitionNamespace.prototype._destroyInnerNodes = function (rootElement, context, animate) { + var _this = this; + if (animate === void 0) { animate = false; } + this._engine.driver.query(rootElement, NG_TRIGGER_SELECTOR, true).forEach(function (elm) { + if (animate && containsClass(elm, _this._hostClassName)) { + var /** @type {?} */ innerNs = _this._engine.namespacesByHostElement.get(elm); + // special case for a host element with animations on the same element + if (innerNs) { + innerNs.removeNode(elm, context, true); + } + _this.removeNode(elm, context, true); + } + else { + _this.clearElementCache(elm); + } + }); + }; + /** + * @param {?} element + * @param {?} context + * @param {?=} doNotRecurse + * @return {?} + */ + AnimationTransitionNamespace.prototype.removeNode = function (element, context, doNotRecurse) { + var _this = this; + var /** @type {?} */ engine = this._engine; + if (!doNotRecurse && element.childElementCount) { + this._destroyInnerNodes(element, context, true); + } + var /** @type {?} */ triggerStates = engine.statesByElement.get(element); + if (triggerStates) { + var /** @type {?} */ players_1 = []; + Object.keys(triggerStates).forEach(function (triggerName) { + // 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[triggerName]) { + var /** @type {?} */ player = _this.trigger(element, triggerName, VOID_VALUE, false); + if (player) { + players_1.push(player); + } + } + }); + if (players_1.length) { + engine.markElementAsRemoved(this.id, element, true, context); + optimizeGroupPlayer(players_1).onDone(function () { return engine.processLeaveNode(element); }); + return; + } + } + // find the player that is animating and make sure that the + // removal is delayed until that player has completed + var /** @type {?} */ containsPotentialParentTransition = false; + if (engine.totalAnimations) { + var /** @type {?} */ 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 fowards and + // allow the element to be queued up for animation later. + if (currentPlayers && currentPlayers.length) { + containsPotentialParentTransition = true; + } + else { + var /** @type {?} */ parent = element; + while (parent = parent.parentNode) { + var /** @type {?} */ 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) + var /** @type {?} */ listeners = this._elementListeners.get(element); + if (listeners) { + var /** @type {?} */ visitedTriggers_1 = new Set(); + listeners.forEach(function (listener) { + var /** @type {?} */ triggerName = listener.name; + if (visitedTriggers_1.has(triggerName)) + return; + visitedTriggers_1.add(triggerName); + var /** @type {?} */ trigger = _this._triggers[triggerName]; + var /** @type {?} */ transition = trigger.fallbackTransition; + var /** @type {?} */ elementStates = ((engine.statesByElement.get(element))); + var /** @type {?} */ fromState = elementStates[triggerName] || DEFAULT_STATE_VALUE; + var /** @type {?} */ toState = new StateValue(VOID_VALUE); + var /** @type {?} */ player = new TransitionAnimationPlayer(_this.id, triggerName, element); + _this._engine.totalQueuedPlayers++; + _this._queue.push({ + element: element, + triggerName: triggerName, + transition: transition, + fromState: fromState, + toState: toState, + player: player, + isFallbackTransition: true + }); + }); + } + // 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 { + // we do this after the flush has occurred such + // that the callbacks can be fired + engine.afterFlush(function () { return _this.clearElementCache(element); }); + engine.destroyInnerAnimations(element); + engine._onRemovalComplete(element, context); + } + }; + /** + * @param {?} element + * @param {?} parent + * @return {?} + */ + AnimationTransitionNamespace.prototype.insertNode = function (element, parent) { addClass(element, this._hostClassName); }; + /** + * @param {?} microtaskId + * @return {?} + */ + AnimationTransitionNamespace.prototype.drainQueuedTransitions = function (microtaskId) { + var _this = this; + var /** @type {?} */ instructions = []; + this._queue.forEach(function (entry) { + var /** @type {?} */ player = entry.player; + if (player.destroyed) + return; + var /** @type {?} */ element = entry.element; + var /** @type {?} */ listeners = _this._elementListeners.get(element); + if (listeners) { + listeners.forEach(function (listener) { + if (listener.name == entry.triggerName) { + var /** @type {?} */ 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(function () { + // 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(function (a, b) { + // if depCount == 0 them move to front + // otherwise if a contains b then move back + var /** @type {?} */ d0 = a.transition.ast.depCount; + var /** @type {?} */ d1 = b.transition.ast.depCount; + if (d0 == 0 || d1 == 0) { + return d0 - d1; + } + return _this._engine.driver.containsElement(a.element, b.element) ? 1 : -1; + }); + }; + /** + * @param {?} context + * @return {?} + */ + AnimationTransitionNamespace.prototype.destroy = function (context) { + this.players.forEach(function (p) { return p.destroy(); }); + this._destroyInnerNodes(this.hostElement, context); + }; + /** + * @param {?} element + * @return {?} + */ + AnimationTransitionNamespace.prototype.elementContainsData = function (element) { + var /** @type {?} */ containsData = false; + if (this._elementListeners.has(element)) + containsData = true; + containsData = + (this._queue.find(function (entry) { return entry.element === element; }) ? true : false) || containsData; + return containsData; + }; + return AnimationTransitionNamespace; +}()); +var TransitionAnimationEngine = (function () { + /** + * @param {?} driver + * @param {?} _normalizer + */ + function TransitionAnimationEngine(driver, _normalizer) { + 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.totalAnimations = 0; + this.totalQueuedPlayers = 0; + this._namespaceLookup = {}; + this._namespaceList = []; + this._flushFns = []; + this._whenQuietFns = []; + this.namespacesByHostElement = new Map(); + this.collectedEnterElements = []; + this.collectedLeaveElements = []; + this.onRemovalComplete = function (element, context) { }; + } + /** + * @param {?} element + * @param {?} context + * @return {?} + */ + TransitionAnimationEngine.prototype._onRemovalComplete = function (element, context) { this.onRemovalComplete(element, context); }; + Object.defineProperty(TransitionAnimationEngine.prototype, "queuedPlayers", { + /** + * @return {?} + */ + get: function () { + var /** @type {?} */ players = []; + this._namespaceList.forEach(function (ns) { + ns.players.forEach(function (player) { + if (player.queued) { + players.push(player); + } + }); + }); + return players; + }, + enumerable: true, + configurable: true + }); + /** + * @param {?} namespaceId + * @param {?} hostElement + * @return {?} + */ + TransitionAnimationEngine.prototype.createNamespace = function (namespaceId, hostElement) { + var /** @type {?} */ ns = new AnimationTransitionNamespace(namespaceId, hostElement, this); + if (hostElement.parentNode) { + 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 apart of the animation code, it + // may or may not be inserted by a parent node that is an 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; + }; + /** + * @param {?} ns + * @param {?} hostElement + * @return {?} + */ + TransitionAnimationEngine.prototype._balanceNamespaceList = function (ns, hostElement) { + var /** @type {?} */ limit = this._namespaceList.length - 1; + if (limit >= 0) { + var /** @type {?} */ found = false; + for (var /** @type {?} */ i = limit; i >= 0; i--) { + var /** @type {?} */ nextNamespace = this._namespaceList[i]; + if (this.driver.containsElement(nextNamespace.hostElement, hostElement)) { + this._namespaceList.splice(i + 1, 0, ns); + found = true; + break; + } + } + if (!found) { + this._namespaceList.splice(0, 0, ns); + } + } + else { + this._namespaceList.push(ns); + } + this.namespacesByHostElement.set(hostElement, ns); + return ns; + }; + /** + * @param {?} namespaceId + * @param {?} hostElement + * @return {?} + */ + TransitionAnimationEngine.prototype.register = function (namespaceId, hostElement) { + var /** @type {?} */ ns = this._namespaceLookup[namespaceId]; + if (!ns) { + ns = this.createNamespace(namespaceId, hostElement); + } + return ns; + }; + /** + * @param {?} namespaceId + * @param {?} name + * @param {?} trigger + * @return {?} + */ + TransitionAnimationEngine.prototype.registerTrigger = function (namespaceId, name, trigger) { + var /** @type {?} */ ns = this._namespaceLookup[namespaceId]; + if (ns && ns.register(name, trigger)) { + this.totalAnimations++; + } + }; + /** + * @param {?} namespaceId + * @param {?} context + * @return {?} + */ + TransitionAnimationEngine.prototype.destroy = function (namespaceId, context) { + var _this = this; + if (!namespaceId) + return; + var /** @type {?} */ ns = this._fetchNamespace(namespaceId); + this.afterFlush(function () { + _this.namespacesByHostElement.delete(ns.hostElement); + delete _this._namespaceLookup[namespaceId]; + var /** @type {?} */ index = _this._namespaceList.indexOf(ns); + if (index >= 0) { + _this._namespaceList.splice(index, 1); + } + }); + this.afterFlushAnimationsDone(function () { return ns.destroy(context); }); + }; + /** + * @param {?} id + * @return {?} + */ + TransitionAnimationEngine.prototype._fetchNamespace = function (id) { return this._namespaceLookup[id]; }; + /** + * @param {?} namespaceId + * @param {?} element + * @param {?} name + * @param {?} value + * @return {?} + */ + TransitionAnimationEngine.prototype.trigger = function (namespaceId, element, name, value) { + if (isElementNode(element)) { + this._fetchNamespace(namespaceId).trigger(element, name, value); + return true; + } + return false; + }; + /** + * @param {?} namespaceId + * @param {?} element + * @param {?} parent + * @param {?} insertBefore + * @return {?} + */ + TransitionAnimationEngine.prototype.insertNode = function (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 + var /** @type {?} */ details = (element[REMOVAL_FLAG]); + if (details && details.setForRemoval) { + details.setForRemoval = false; + } + // 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) { + this._fetchNamespace(namespaceId).insertNode(element, parent); + } + // only *directives and host elements are inserted before + if (insertBefore) { + this.collectEnterElement(element); + } + }; + /** + * @param {?} element + * @return {?} + */ + TransitionAnimationEngine.prototype.collectEnterElement = function (element) { this.collectedEnterElements.push(element); }; + /** + * @param {?} namespaceId + * @param {?} element + * @param {?} context + * @param {?=} doNotRecurse + * @return {?} + */ + TransitionAnimationEngine.prototype.removeNode = function (namespaceId, element, context, doNotRecurse) { + if (!isElementNode(element)) { + this._onRemovalComplete(element, context); + return; + } + var /** @type {?} */ ns = namespaceId ? this._fetchNamespace(namespaceId) : null; + if (ns) { + ns.removeNode(element, context, doNotRecurse); + } + else { + this.markElementAsRemoved(namespaceId, element, false, context); + } + }; + /** + * @param {?} namespaceId + * @param {?} element + * @param {?=} hasAnimation + * @param {?=} context + * @return {?} + */ + TransitionAnimationEngine.prototype.markElementAsRemoved = function (namespaceId, element, hasAnimation, context) { + this.collectedLeaveElements.push(element); + element[REMOVAL_FLAG] = { + namespaceId: namespaceId, + setForRemoval: context, hasAnimation: hasAnimation, + removedBeforeQueried: false + }; + }; + /** + * @param {?} namespaceId + * @param {?} element + * @param {?} name + * @param {?} phase + * @param {?} callback + * @return {?} + */ + TransitionAnimationEngine.prototype.listen = function (namespaceId, element, name, phase, callback) { + if (isElementNode(element)) { + return this._fetchNamespace(namespaceId).listen(element, name, phase, callback); + } + return function () { }; + }; + /** + * @param {?} entry + * @param {?} subTimelines + * @return {?} + */ + TransitionAnimationEngine.prototype._buildInstruction = function (entry, subTimelines) { + return entry.transition.build(this.driver, entry.element, entry.fromState.value, entry.toState.value, entry.toState.options, subTimelines); + }; + /** + * @param {?} containerElement + * @return {?} + */ + TransitionAnimationEngine.prototype.destroyInnerAnimations = function (containerElement) { + var _this = this; + var /** @type {?} */ elements = this.driver.query(containerElement, NG_TRIGGER_SELECTOR, true); + elements.forEach(function (element) { + var /** @type {?} */ players = _this.playersByElement.get(element); + if (players) { + players.forEach(function (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(); + } + }); + } + var /** @type {?} */ stateMap = _this.statesByElement.get(element); + if (stateMap) { + Object.keys(stateMap).forEach(function (triggerName) { return stateMap[triggerName] = DELETED_STATE_VALUE; }); + } + }); + if (this.playersByQueriedElement.size == 0) + return; + elements = this.driver.query(containerElement, NG_ANIMATING_SELECTOR, true); + if (elements.length) { + elements.forEach(function (element) { + var /** @type {?} */ players = _this.playersByQueriedElement.get(element); + if (players) { + players.forEach(function (player) { return player.finish(); }); + } + }); + } + }; + /** + * @return {?} + */ + TransitionAnimationEngine.prototype.whenRenderingDone = function () { + var _this = this; + return new Promise(function (resolve) { + if (_this.players.length) { + return optimizeGroupPlayer(_this.players).onDone(function () { return resolve(); }); + } + else { + resolve(); + } + }); + }; + /** + * @param {?} element + * @return {?} + */ + TransitionAnimationEngine.prototype.processLeaveNode = function (element) { + var /** @type {?} */ 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); + var /** @type {?} */ ns = this._fetchNamespace(details.namespaceId); + if (ns) { + ns.clearElementCache(element); + } + } + this._onRemovalComplete(element, details.setForRemoval); + } + }; + /** + * @param {?=} microtaskId + * @return {?} + */ + TransitionAnimationEngine.prototype.flush = function (microtaskId) { + var _this = this; + if (microtaskId === void 0) { microtaskId = -1; } + var /** @type {?} */ players = []; + if (this.newHostElements.size) { + this.newHostElements.forEach(function (ns, element) { return _this._balanceNamespaceList(ns, element); }); + this.newHostElements.clear(); + } + if (this._namespaceList.length && + (this.totalQueuedPlayers || this.collectedLeaveElements.length)) { + players = this._flushAnimations(microtaskId); + } + else { + for (var /** @type {?} */ i = 0; i < this.collectedLeaveElements.length; i++) { + var /** @type {?} */ element = this.collectedLeaveElements[i]; + this.processLeaveNode(element); + } + } + this.totalQueuedPlayers = 0; + this.collectedEnterElements.length = 0; + this.collectedLeaveElements.length = 0; + this._flushFns.forEach(function (fn) { return 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 + var /** @type {?} */ quietFns_1 = this._whenQuietFns; + this._whenQuietFns = []; + if (players.length) { + optimizeGroupPlayer(players).onDone(function () { quietFns_1.forEach(function (fn) { return fn(); }); }); + } + else { + quietFns_1.forEach(function (fn) { return fn(); }); + } + } + }; + /** + * @param {?} microtaskId + * @return {?} + */ + TransitionAnimationEngine.prototype._flushAnimations = function (microtaskId) { + var _this = this; + var /** @type {?} */ subTimelines = new ElementInstructionMap(); + var /** @type {?} */ skippedPlayers = []; + var /** @type {?} */ skippedPlayersMap = new Map(); + var /** @type {?} */ queuedInstructions = []; + var /** @type {?} */ queriedElements = new Map(); + var /** @type {?} */ allPreStyleElements = new Map(); + var /** @type {?} */ allPostStyleElements = new Map(); + var /** @type {?} */ bodyNode = getBodyNode(); + var /** @type {?} */ allEnterNodes = this.collectedEnterElements.length ? + this.collectedEnterElements.filter(createIsRootFilterFn(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). + for (var /** @type {?} */ i = 0; i < allEnterNodes.length; i++) { + addClass(allEnterNodes[i], ENTER_CLASSNAME); + } + var /** @type {?} */ allLeaveNodes = []; + var /** @type {?} */ leaveNodesWithoutAnimations = []; + for (var /** @type {?} */ i = 0; i < this.collectedLeaveElements.length; i++) { + var /** @type {?} */ element = this.collectedLeaveElements[i]; + var /** @type {?} */ details = (element[REMOVAL_FLAG]); + if (details && details.setForRemoval) { + addClass(element, LEAVE_CLASSNAME); + allLeaveNodes.push(element); + if (!details.hasAnimation) { + leaveNodesWithoutAnimations.push(element); + } + } + } + for (var /** @type {?} */ i = this._namespaceList.length - 1; i >= 0; i--) { + var /** @type {?} */ ns = this._namespaceList[i]; + ns.drainQueuedTransitions(microtaskId).forEach(function (entry) { + var /** @type {?} */ player = entry.player; + var /** @type {?} */ element = entry.element; + if (!bodyNode || !_this.driver.containsElement(bodyNode, element)) { + player.destroy(); + return; + } + var /** @type {?} */ instruction = _this._buildInstruction(entry, subTimelines); + if (!instruction) + return; + // if a unmatched transition is queued to go then it SHOULD NOT render + // an animation and cancel the previously running animations. + if (entry.isFallbackTransition) { + player.onStart(function () { return eraseStyles(element, instruction.fromStyles); }); + player.onDestroy(function () { return 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 to not add a player delay, but + // instead stretch the first keyframe gap up until the animation starts. The + // reason this is important is to prevent extra initialization styles from being + // required by the user in the animation. + instruction.timelines.forEach(function (tl) { return tl.stretchStartingKeyframe = true; }); + subTimelines.append(element, instruction.timelines); + var /** @type {?} */ tuple = { instruction: instruction, player: player, element: element }; + queuedInstructions.push(tuple); + instruction.queriedElements.forEach(function (element) { return getOrSetAsInMap(queriedElements, element, []).push(player); }); + instruction.preStyleProps.forEach(function (stringMap, element) { + var /** @type {?} */ props = Object.keys(stringMap); + if (props.length) { + var /** @type {?} */ setVal_1 = ((allPreStyleElements.get(element))); + if (!setVal_1) { + allPreStyleElements.set(element, setVal_1 = new Set()); + } + props.forEach(function (prop) { return setVal_1.add(prop); }); + } + }); + instruction.postStyleProps.forEach(function (stringMap, element) { + var /** @type {?} */ props = Object.keys(stringMap); + var /** @type {?} */ setVal = ((allPostStyleElements.get(element))); + if (!setVal) { + allPostStyleElements.set(element, setVal = new Set()); + } + props.forEach(function (prop) { return setVal.add(prop); }); + }); + }); + } + // these can only be detected here since we have a map of all the elements + // that have animations attached to them... + var /** @type {?} */ enterNodesWithoutAnimations = []; + for (var /** @type {?} */ i = 0; i < allEnterNodes.length; i++) { + var /** @type {?} */ element = allEnterNodes[i]; + if (!subTimelines.has(element)) { + enterNodesWithoutAnimations.push(element); + } + } + var /** @type {?} */ allPreviousPlayersMap = new Map(); + var /** @type {?} */ sortedParentElements = []; + queuedInstructions.forEach(function (entry) { + var /** @type {?} */ element = entry.element; + if (subTimelines.has(element)) { + sortedParentElements.unshift(element); + _this._beforeAnimationBuild(entry.player.namespaceId, entry.instruction, allPreviousPlayersMap); + } + }); + skippedPlayers.forEach(function (player) { + var /** @type {?} */ element = player.element; + var /** @type {?} */ previousPlayers = _this._getPreviousPlayers(element, false, player.namespaceId, player.triggerName, null); + previousPlayers.forEach(function (prevPlayer) { getOrSetAsInMap(allPreviousPlayersMap, element, []).push(prevPlayer); }); + }); + allPreviousPlayersMap.forEach(function (players) { return players.forEach(function (player) { return player.destroy(); }); }); + // PRE STAGE: fill the ! styles + var /** @type {?} */ preStylesMap = allPreStyleElements.size ? + cloakAndComputeStyles(this.driver, enterNodesWithoutAnimations, allPreStyleElements, _angular_animations.ɵPRE_STYLE) : + new Map(); + // POST STAGE: fill the * styles + var /** @type {?} */ postStylesMap = cloakAndComputeStyles(this.driver, leaveNodesWithoutAnimations, allPostStyleElements, _angular_animations.AUTO_STYLE); + var /** @type {?} */ rootPlayers = []; + var /** @type {?} */ subPlayers = []; + queuedInstructions.forEach(function (entry) { + var element = entry.element, player = entry.player, instruction = entry.instruction; + // 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)) { + var /** @type {?} */ innerPlayer = _this._buildAnimation(player.namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap); + player.setRealPlayer(innerPlayer); + var /** @type {?} */ parentHasPriority = null; + for (var /** @type {?} */ i = 0; i < sortedParentElements.length; i++) { + var /** @type {?} */ parent = sortedParentElements[i]; + if (parent === element) + break; + if (_this.driver.containsElement(parent, element)) { + parentHasPriority = parent; + break; + } + } + if (parentHasPriority) { + var /** @type {?} */ parentPlayers = _this.playersByElement.get(parentHasPriority); + if (parentPlayers && parentPlayers.length) { + player.parentPlayer = optimizeGroupPlayer(parentPlayers); + } + skippedPlayers.push(player); + } + else { + rootPlayers.push(player); + } + } + else { + eraseStyles(element, instruction.fromStyles); + player.onDestroy(function () { return setStyles(element, instruction.toStyles); }); + subPlayers.push(player); + } + }); + subPlayers.forEach(function (player) { + var /** @type {?} */ playersForElement = skippedPlayersMap.get(player.element); + if (playersForElement && playersForElement.length) { + var /** @type {?} */ 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(function (player) { + if (player.parentPlayer) { + player.parentPlayer.onDestroy(function () { return player.destroy(); }); + } + 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 (var /** @type {?} */ i = 0; i < allLeaveNodes.length; i++) { + var /** @type {?} */ element = allLeaveNodes[i]; + var /** @type {?} */ details = (element[REMOVAL_FLAG]); + // 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; + var /** @type {?} */ 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) { + var /** @type {?} */ queriedPlayerResults = queriedElements.get(element); + if (queriedPlayerResults && queriedPlayerResults.length) { + players.push.apply(players, queriedPlayerResults); + } + var /** @type {?} */ queriedInnerElements = this.driver.query(element, NG_ANIMATING_SELECTOR, true); + for (var /** @type {?} */ j = 0; j < queriedInnerElements.length; j++) { + var /** @type {?} */ queriedPlayers = queriedElements.get(queriedInnerElements[j]); + if (queriedPlayers && queriedPlayers.length) { + players.push.apply(players, queriedPlayers); + } + } + } + if (players.length) { + removeNodesAfterAnimationDone(this, element, players); + } + else { + this.processLeaveNode(element); + } + } + rootPlayers.forEach(function (player) { + _this.players.push(player); + player.onDone(function () { + player.destroy(); + var /** @type {?} */ index = _this.players.indexOf(player); + _this.players.splice(index, 1); + }); + player.play(); + }); + allEnterNodes.forEach(function (element) { return removeClass(element, ENTER_CLASSNAME); }); + return rootPlayers; + }; + /** + * @param {?} namespaceId + * @param {?} element + * @return {?} + */ + TransitionAnimationEngine.prototype.elementContainsData = function (namespaceId, element) { + var /** @type {?} */ containsData = false; + var /** @type {?} */ details = (element[REMOVAL_FLAG]); + if (details && details.setForRemoval) + containsData = true; + if (this.playersByElement.has(element)) + containsData = true; + if (this.playersByQueriedElement.has(element)) + containsData = true; + if (this.statesByElement.has(element)) + containsData = true; + return this._fetchNamespace(namespaceId).elementContainsData(element) || containsData; + }; + /** + * @param {?} callback + * @return {?} + */ + TransitionAnimationEngine.prototype.afterFlush = function (callback) { this._flushFns.push(callback); }; + /** + * @param {?} callback + * @return {?} + */ + TransitionAnimationEngine.prototype.afterFlushAnimationsDone = function (callback) { this._whenQuietFns.push(callback); }; + /** + * @param {?} element + * @param {?} isQueriedElement + * @param {?=} namespaceId + * @param {?=} triggerName + * @param {?=} toStateValue + * @return {?} + */ + TransitionAnimationEngine.prototype._getPreviousPlayers = function (element, isQueriedElement, namespaceId, triggerName, toStateValue) { + var /** @type {?} */ players = []; + if (isQueriedElement) { + var /** @type {?} */ queriedElementPlayers = this.playersByQueriedElement.get(element); + if (queriedElementPlayers) { + players = queriedElementPlayers; + } + } + else { + var /** @type {?} */ elementPlayers = this.playersByElement.get(element); + if (elementPlayers) { + var /** @type {?} */ isRemovalAnimation_1 = !toStateValue || toStateValue == VOID_VALUE; + elementPlayers.forEach(function (player) { + if (player.queued) + return; + if (!isRemovalAnimation_1 && player.triggerName != triggerName) + return; + players.push(player); + }); + } + } + if (namespaceId || triggerName) { + players = players.filter(function (player) { + if (namespaceId && namespaceId != player.namespaceId) + return false; + if (triggerName && triggerName != player.triggerName) + return false; + return true; + }); + } + return players; + }; + /** + * @param {?} namespaceId + * @param {?} instruction + * @param {?} allPreviousPlayersMap + * @return {?} + */ + TransitionAnimationEngine.prototype._beforeAnimationBuild = function (namespaceId, instruction, allPreviousPlayersMap) { + var _this = this; + // it's important to do this step before destroying the players + // so that the onDone callback below won't fire before this + eraseStyles(instruction.element, instruction.fromStyles); + var /** @type {?} */ triggerName = instruction.triggerName; + var /** @type {?} */ rootElement = instruction.element; + // when a removal animation occurs, ALL previous players are collected + // and destroyed (even if they are outside of the current namespace) + var /** @type {?} */ targetNameSpaceId = instruction.isRemovalTransition ? undefined : namespaceId; + var /** @type {?} */ targetTriggerName = instruction.isRemovalTransition ? undefined : triggerName; + instruction.timelines.map(function (timelineInstruction) { + var /** @type {?} */ element = timelineInstruction.element; + var /** @type {?} */ isQueriedElement = element !== rootElement; + var /** @type {?} */ players = getOrSetAsInMap(allPreviousPlayersMap, element, []); + var /** @type {?} */ previousPlayers = _this._getPreviousPlayers(element, isQueriedElement, targetNameSpaceId, targetTriggerName, instruction.toState); + previousPlayers.forEach(function (player) { + var /** @type {?} */ realPlayer = (player.getRealPlayer()); + if (realPlayer.beforeDestroy) { + realPlayer.beforeDestroy(); + } + players.push(player); + }); + }); + }; + /** + * @param {?} namespaceId + * @param {?} instruction + * @param {?} allPreviousPlayersMap + * @param {?} skippedPlayersMap + * @param {?} preStylesMap + * @param {?} postStylesMap + * @return {?} + */ + TransitionAnimationEngine.prototype._buildAnimation = function (namespaceId, instruction, allPreviousPlayersMap, skippedPlayersMap, preStylesMap, postStylesMap) { + var _this = this; + var /** @type {?} */ triggerName = instruction.triggerName; + var /** @type {?} */ rootElement = instruction.element; + // we first run this so that the previous animation player + // data can be passed into the successive animation players + var /** @type {?} */ allQueriedPlayers = []; + var /** @type {?} */ allConsumedElements = new Set(); + var /** @type {?} */ allSubElements = new Set(); + var /** @type {?} */ allNewPlayers = instruction.timelines.map(function (timelineInstruction) { + var /** @type {?} */ element = timelineInstruction.element; + // FIXME (matsko): make sure to-be-removed animations are removed properly + var /** @type {?} */ details = element[REMOVAL_FLAG]; + if (details && details.removedBeforeQueried) + return new _angular_animations.NoopAnimationPlayer(); + var /** @type {?} */ isQueriedElement = element !== rootElement; + var /** @type {?} */ previousPlayers = EMPTY_PLAYER_ARRAY; + if (!allConsumedElements.has(element)) { + allConsumedElements.add(element); + var /** @type {?} */ _previousPlayers = allPreviousPlayersMap.get(element); + if (_previousPlayers) { + previousPlayers = _previousPlayers.map(function (p) { return p.getRealPlayer(); }); + } + } + var /** @type {?} */ preStyles = preStylesMap.get(element); + var /** @type {?} */ postStyles = postStylesMap.get(element); + var /** @type {?} */ keyframes = normalizeKeyframes(_this.driver, _this._normalizer, element, timelineInstruction.keyframes, preStyles, postStyles); + var /** @type {?} */ 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) { + var /** @type {?} */ wrappedPlayer = new TransitionAnimationPlayer(namespaceId, triggerName, element); + wrappedPlayer.setRealPlayer(player); + allQueriedPlayers.push(wrappedPlayer); + } + return player; + }); + allQueriedPlayers.forEach(function (player) { + getOrSetAsInMap(_this.playersByQueriedElement, player.element, []).push(player); + player.onDone(function () { return deleteOrUnsetInMap(_this.playersByQueriedElement, player.element, player); }); + }); + allConsumedElements.forEach(function (element) { return addClass(element, NG_ANIMATING_CLASSNAME); }); + var /** @type {?} */ player = optimizeGroupPlayer(allNewPlayers); + player.onDestroy(function () { + allConsumedElements.forEach(function (element) { return 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(function (element) { getOrSetAsInMap(skippedPlayersMap, element, []).push(player); }); + return player; + }; + /** + * @param {?} instruction + * @param {?} keyframes + * @param {?} previousPlayers + * @return {?} + */ + TransitionAnimationEngine.prototype._buildPlayer = function (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.NoopAnimationPlayer(); + }; + return TransitionAnimationEngine; +}()); +var TransitionAnimationPlayer = (function () { + /** + * @param {?} namespaceId + * @param {?} triggerName + * @param {?} element + */ + function TransitionAnimationPlayer(namespaceId, triggerName, element) { + this.namespaceId = namespaceId; + this.triggerName = triggerName; + this.element = element; + this._player = new _angular_animations.NoopAnimationPlayer(); + this._containsRealPlayer = false; + this._queuedCallbacks = {}; + this._destroyed = false; + this.markedForDestroy = false; + } + Object.defineProperty(TransitionAnimationPlayer.prototype, "queued", { + /** + * @return {?} + */ + get: function () { return this._containsRealPlayer == false; }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TransitionAnimationPlayer.prototype, "destroyed", { + /** + * @return {?} + */ + get: function () { return this._destroyed; }, + enumerable: true, + configurable: true + }); + /** + * @param {?} player + * @return {?} + */ + TransitionAnimationPlayer.prototype.setRealPlayer = function (player) { + var _this = this; + if (this._containsRealPlayer) + return; + this._player = player; + Object.keys(this._queuedCallbacks).forEach(function (phase) { + _this._queuedCallbacks[phase].forEach(function (callback) { return listenOnPlayer(player, phase, undefined, callback); }); + }); + this._queuedCallbacks = {}; + this._containsRealPlayer = true; + }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.getRealPlayer = function () { return this._player; }; + /** + * @param {?} name + * @param {?} callback + * @return {?} + */ + TransitionAnimationPlayer.prototype._queueEvent = function (name, callback) { + getOrSetAsInMap(this._queuedCallbacks, name, []).push(callback); + }; + /** + * @param {?} fn + * @return {?} + */ + TransitionAnimationPlayer.prototype.onDone = function (fn) { + if (this.queued) { + this._queueEvent('done', fn); + } + this._player.onDone(fn); + }; + /** + * @param {?} fn + * @return {?} + */ + TransitionAnimationPlayer.prototype.onStart = function (fn) { + if (this.queued) { + this._queueEvent('start', fn); + } + this._player.onStart(fn); + }; + /** + * @param {?} fn + * @return {?} + */ + TransitionAnimationPlayer.prototype.onDestroy = function (fn) { + if (this.queued) { + this._queueEvent('destroy', fn); + } + this._player.onDestroy(fn); + }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.init = function () { this._player.init(); }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.hasStarted = function () { return this.queued ? false : this._player.hasStarted(); }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.play = function () { !this.queued && this._player.play(); }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.pause = function () { !this.queued && this._player.pause(); }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.restart = function () { !this.queued && this._player.restart(); }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.finish = function () { this._player.finish(); }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.destroy = function () { + this._destroyed = true; + this._player.destroy(); + }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.reset = function () { !this.queued && this._player.reset(); }; + /** + * @param {?} p + * @return {?} + */ + TransitionAnimationPlayer.prototype.setPosition = function (p) { + if (!this.queued) { + this._player.setPosition(p); + } + }; + /** + * @return {?} + */ + TransitionAnimationPlayer.prototype.getPosition = function () { return this.queued ? 0 : this._player.getPosition(); }; + Object.defineProperty(TransitionAnimationPlayer.prototype, "totalTime", { + /** + * @return {?} + */ + get: function () { return this._player.totalTime; }, + enumerable: true, + configurable: true + }); + return TransitionAnimationPlayer; +}()); +/** + * @param {?} map + * @param {?} key + * @param {?} value + * @return {?} + */ +function deleteOrUnsetInMap(map, key, value) { + var /** @type {?} */ currentValues; + if (map instanceof Map) { + currentValues = map.get(key); + if (currentValues) { + if (currentValues.length) { + var /** @type {?} */ index = currentValues.indexOf(value); + currentValues.splice(index, 1); + } + if (currentValues.length == 0) { + map.delete(key); + } + } + } + else { + currentValues = map[key]; + if (currentValues) { + if (currentValues.length) { + var /** @type {?} */ index = currentValues.indexOf(value); + currentValues.splice(index, 1); + } + if (currentValues.length == 0) { + delete map[key]; + } + } + } + return currentValues; +} +/** + * @param {?} value + * @return {?} + */ +function normalizeTriggerValue(value) { + switch (typeof value) { + case 'boolean': + return value ? '1' : '0'; + default: + return value != null ? value.toString() : null; + } +} +/** + * @param {?} node + * @return {?} + */ +function isElementNode(node) { + return node && node['nodeType'] === 1; +} +/** + * @param {?} eventName + * @return {?} + */ +function isTriggerEventValid(eventName) { + return eventName == 'start' || eventName == 'done'; +} +/** + * @param {?} element + * @param {?=} value + * @return {?} + */ +function cloakElement(element, value) { + var /** @type {?} */ oldValue = element.style.display; + element.style.display = value != null ? value : 'none'; + return oldValue; +} +/** + * @param {?} driver + * @param {?} elements + * @param {?} elementPropsMap + * @param {?} defaultStyle + * @return {?} + */ +function cloakAndComputeStyles(driver, elements, elementPropsMap, defaultStyle) { + var /** @type {?} */ cloakVals = elements.map(function (element) { return cloakElement(element); }); + var /** @type {?} */ valuesMap = new Map(); + elementPropsMap.forEach(function (props, element) { + var /** @type {?} */ styles = {}; + props.forEach(function (prop) { + var /** @type {?} */ value = styles[prop] = driver.computeStyle(element, prop, defaultStyle); + // 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; + } + }); + valuesMap.set(element, styles); + }); + elements.forEach(function (element, i) { return cloakElement(element, cloakVals[i]); }); + return valuesMap; +} +/** + * @param {?} nodes + * @return {?} + */ +function createIsRootFilterFn(nodes) { + var /** @type {?} */ nodeSet = new Set(nodes); + var /** @type {?} */ knownRootContainer = new Set(); + var /** @type {?} */ isRoot; + isRoot = function (node) { + if (!node) + return true; + if (nodeSet.has(node.parentNode)) + return false; + if (knownRootContainer.has(node.parentNode)) + return true; + if (isRoot(node.parentNode)) { + knownRootContainer.add(node); + return true; + } + return false; + }; + return isRoot; +} +var CLASSES_CACHE_KEY = '$$classes'; +/** + * @param {?} element + * @param {?} className + * @return {?} + */ +function containsClass(element, className) { + if (element.classList) { + return element.classList.contains(className); + } + else { + var /** @type {?} */ classes = element[CLASSES_CACHE_KEY]; + return classes && classes[className]; + } +} +/** + * @param {?} element + * @param {?} className + * @return {?} + */ +function addClass(element, className) { + if (element.classList) { + element.classList.add(className); + } + else { + var /** @type {?} */ classes = element[CLASSES_CACHE_KEY]; + if (!classes) { + classes = element[CLASSES_CACHE_KEY] = {}; + } + classes[className] = true; + } +} +/** + * @param {?} element + * @param {?} className + * @return {?} + */ +function removeClass(element, className) { + if (element.classList) { + element.classList.remove(className); + } + else { + var /** @type {?} */ classes = element[CLASSES_CACHE_KEY]; + if (classes) { + delete classes[className]; + } + } +} +/** + * @return {?} + */ +function getBodyNode() { + if (typeof document != 'undefined') { + return document.body; + } + return null; +} +/** + * @param {?} engine + * @param {?} element + * @param {?} players + * @return {?} + */ +function removeNodesAfterAnimationDone(engine, element, players) { + optimizeGroupPlayer(players).onDone(function () { return engine.processLeaveNode(element); }); +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var AnimationEngine = (function () { + /** + * @param {?} driver + * @param {?} normalizer + */ + function AnimationEngine(driver, normalizer) { + var _this = this; + this._triggerCache = {}; + this.onRemovalComplete = function (element, context) { }; + this._transitionEngine = new TransitionAnimationEngine(driver, normalizer); + this._timelineEngine = new TimelineAnimationEngine(driver, normalizer); + this._transitionEngine.onRemovalComplete = + function (element, context) { _this.onRemovalComplete(element, context); }; + } + /** + * @param {?} componentId + * @param {?} namespaceId + * @param {?} hostElement + * @param {?} name + * @param {?} metadata + * @return {?} + */ + AnimationEngine.prototype.registerTrigger = function (componentId, namespaceId, hostElement, name, metadata) { + var /** @type {?} */ cacheKey = componentId + '-' + name; + var /** @type {?} */ trigger = this._triggerCache[cacheKey]; + if (!trigger) { + var /** @type {?} */ errors = []; + var /** @type {?} */ ast = (buildAnimationAst(/** @type {?} */ (metadata), errors)); + if (errors.length) { + throw new Error("The animation trigger \"" + name + "\" has failed to build due to the following errors:\n - " + errors.join("\n - ")); + } + trigger = buildTrigger(name, ast); + this._triggerCache[cacheKey] = trigger; + } + this._transitionEngine.registerTrigger(namespaceId, name, trigger); + }; + /** + * @param {?} namespaceId + * @param {?} hostElement + * @return {?} + */ + AnimationEngine.prototype.register = function (namespaceId, hostElement) { + this._transitionEngine.register(namespaceId, hostElement); + }; + /** + * @param {?} namespaceId + * @param {?} context + * @return {?} + */ + AnimationEngine.prototype.destroy = function (namespaceId, context) { + this._transitionEngine.destroy(namespaceId, context); + }; + /** + * @param {?} namespaceId + * @param {?} element + * @param {?} parent + * @param {?} insertBefore + * @return {?} + */ + AnimationEngine.prototype.onInsert = function (namespaceId, element, parent, insertBefore) { + this._transitionEngine.insertNode(namespaceId, element, parent, insertBefore); + }; + /** + * @param {?} namespaceId + * @param {?} element + * @param {?} context + * @return {?} + */ + AnimationEngine.prototype.onRemove = function (namespaceId, element, context) { + this._transitionEngine.removeNode(namespaceId, element, context); + }; + /** + * @param {?} namespaceId + * @param {?} element + * @param {?} property + * @param {?} value + * @return {?} + */ + AnimationEngine.prototype.setProperty = function (namespaceId, element, property, value) { + // @@property + if (property.charAt(0) == '@') { + var _a = parseTimelineCommand(property), id = _a[0], action = _a[1]; + var /** @type {?} */ args = (value); + this._timelineEngine.command(id, element, action, args); + return false; + } + return this._transitionEngine.trigger(namespaceId, element, property, value); + }; + /** + * @param {?} namespaceId + * @param {?} element + * @param {?} eventName + * @param {?} eventPhase + * @param {?} callback + * @return {?} + */ + AnimationEngine.prototype.listen = function (namespaceId, element, eventName, eventPhase, callback) { + // @@listen + if (eventName.charAt(0) == '@') { + var _a = parseTimelineCommand(eventName), id = _a[0], action = _a[1]; + return this._timelineEngine.listen(id, element, action, callback); + } + return this._transitionEngine.listen(namespaceId, element, eventName, eventPhase, callback); + }; + /** + * @param {?=} microtaskId + * @return {?} + */ + AnimationEngine.prototype.flush = function (microtaskId) { + if (microtaskId === void 0) { microtaskId = -1; } + this._transitionEngine.flush(microtaskId); + }; + Object.defineProperty(AnimationEngine.prototype, "players", { + /** + * @return {?} + */ + get: function () { + return ((this._transitionEngine.players)) + .concat(/** @type {?} */ (this._timelineEngine.players)); + }, + enumerable: true, + configurable: true + }); + /** + * @return {?} + */ + AnimationEngine.prototype.whenRenderingDone = function () { return this._transitionEngine.whenRenderingDone(); }; + return AnimationEngine; +}()); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var WebAnimationsPlayer = (function () { + /** + * @param {?} element + * @param {?} keyframes + * @param {?} options + * @param {?=} previousPlayers + */ + function WebAnimationsPlayer(element, keyframes, options, previousPlayers) { + if (previousPlayers === void 0) { previousPlayers = []; } + var _this = this; + this.element = element; + this.keyframes = keyframes; + this.options = options; + this.previousPlayers = previousPlayers; + this._onDoneFns = []; + this._onStartFns = []; + this._onDestroyFns = []; + this._initialized = false; + this._finished = false; + this._started = false; + this._destroyed = false; + this.time = 0; + this.parentPlayer = null; + this.currentSnapshot = {}; + this._duration = options['duration']; + this._delay = options['delay'] || 0; + this.time = this._duration + this._delay; + this.previousStyles = {}; + previousPlayers.forEach(function (player) { + var styles = player.currentSnapshot; + Object.keys(styles).forEach(function (prop) { return _this.previousStyles[prop] = styles[prop]; }); + }); + } + /** + * @return {?} + */ + WebAnimationsPlayer.prototype._onFinish = function () { + if (!this._finished) { + this._finished = true; + this._onDoneFns.forEach(function (fn) { return fn(); }); + this._onDoneFns = []; + } + }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.init = function () { + this._buildPlayer(); + this._preparePlayerBeforeStart(); + }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype._buildPlayer = function () { + var _this = this; + if (this._initialized) + return; + this._initialized = true; + var /** @type {?} */ keyframes = this.keyframes.map(function (styles) { return copyStyles(styles, false); }); + var /** @type {?} */ previousStyleProps = Object.keys(this.previousStyles); + if (previousStyleProps.length) { + var /** @type {?} */ startingKeyframe_1 = keyframes[0]; + var /** @type {?} */ missingStyleProps_1 = []; + previousStyleProps.forEach(function (prop) { + if (!startingKeyframe_1.hasOwnProperty(prop)) { + missingStyleProps_1.push(prop); + } + startingKeyframe_1[prop] = _this.previousStyles[prop]; + }); + if (missingStyleProps_1.length) { + var /** @type {?} */ self_1 = this; + var _loop_1 = function () { + var /** @type {?} */ kf = keyframes[i]; + missingStyleProps_1.forEach(function (prop) { + kf[prop] = _computeStyle(self_1.element, prop); + }); + }; + // tslint:disable-next-line + for (var /** @type {?} */ i = 1; i < keyframes.length; i++) { + _loop_1(); + } + } + } + this._player = this._triggerWebAnimation(this.element, keyframes, this.options); + this._finalKeyframe = keyframes.length ? keyframes[keyframes.length - 1] : {}; + this._player.addEventListener('finish', function () { return _this._onFinish(); }); + }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype._preparePlayerBeforeStart = function () { + // this is required so that the player doesn't start to animate right away + if (this._delay) { + this._resetDomPlayerState(); + } + else { + this._player.pause(); + } + }; + /** + * \@internal + * @param {?} element + * @param {?} keyframes + * @param {?} options + * @return {?} + */ + WebAnimationsPlayer.prototype._triggerWebAnimation = function (element, keyframes, options) { + // jscompiler doesn't seem to know animate is a native property because it's not fully + // supported yet across common browsers (we polyfill it for Edge/Safari) [CL #143630929] + return (element['animate'](keyframes, options)); + }; + Object.defineProperty(WebAnimationsPlayer.prototype, "domPlayer", { + /** + * @return {?} + */ + get: function () { return this._player; }, + enumerable: true, + configurable: true + }); + /** + * @param {?} fn + * @return {?} + */ + WebAnimationsPlayer.prototype.onStart = function (fn) { this._onStartFns.push(fn); }; + /** + * @param {?} fn + * @return {?} + */ + WebAnimationsPlayer.prototype.onDone = function (fn) { this._onDoneFns.push(fn); }; + /** + * @param {?} fn + * @return {?} + */ + WebAnimationsPlayer.prototype.onDestroy = function (fn) { this._onDestroyFns.push(fn); }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.play = function () { + this._buildPlayer(); + if (!this.hasStarted()) { + this._onStartFns.forEach(function (fn) { return fn(); }); + this._onStartFns = []; + this._started = true; + } + this._player.play(); + }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.pause = function () { + this.init(); + this._player.pause(); + }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.finish = function () { + this.init(); + this._onFinish(); + this._player.finish(); + }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.reset = function () { + this._resetDomPlayerState(); + this._destroyed = false; + this._finished = false; + this._started = false; + }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype._resetDomPlayerState = function () { + if (this._player) { + this._player.cancel(); + } + }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.restart = function () { + this.reset(); + this.play(); + }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.hasStarted = function () { return this._started; }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.destroy = function () { + if (!this._destroyed) { + this._resetDomPlayerState(); + this._onFinish(); + this._destroyed = true; + this._onDestroyFns.forEach(function (fn) { return fn(); }); + this._onDestroyFns = []; + } + }; + /** + * @param {?} p + * @return {?} + */ + WebAnimationsPlayer.prototype.setPosition = function (p) { this._player.currentTime = p * this.time; }; + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.getPosition = function () { return this._player.currentTime / this.time; }; + Object.defineProperty(WebAnimationsPlayer.prototype, "totalTime", { + /** + * @return {?} + */ + get: function () { return this._delay + this._duration; }, + enumerable: true, + configurable: true + }); + /** + * @return {?} + */ + WebAnimationsPlayer.prototype.beforeDestroy = function () { + var _this = this; + var /** @type {?} */ styles = {}; + if (this.hasStarted()) { + Object.keys(this._finalKeyframe).forEach(function (prop) { + if (prop != 'offset') { + styles[prop] = + _this._finished ? _this._finalKeyframe[prop] : _computeStyle(_this.element, prop); + } + }); + } + this.currentSnapshot = styles; + }; + return WebAnimationsPlayer; +}()); +/** + * @param {?} element + * @param {?} prop + * @return {?} + */ +function _computeStyle(element, prop) { + return ((window.getComputedStyle(element)))[prop]; +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var WebAnimationsDriver = (function () { + function WebAnimationsDriver() { + } + /** + * @param {?} element + * @param {?} selector + * @return {?} + */ + WebAnimationsDriver.prototype.matchesElement = function (element, selector) { + return matchesElement(element, selector); + }; + /** + * @param {?} elm1 + * @param {?} elm2 + * @return {?} + */ + WebAnimationsDriver.prototype.containsElement = function (elm1, elm2) { return containsElement(elm1, elm2); }; + /** + * @param {?} element + * @param {?} selector + * @param {?} multi + * @return {?} + */ + WebAnimationsDriver.prototype.query = function (element, selector, multi) { + return invokeQuery(element, selector, multi); + }; + /** + * @param {?} element + * @param {?} prop + * @param {?=} defaultValue + * @return {?} + */ + WebAnimationsDriver.prototype.computeStyle = function (element, prop, defaultValue) { + return (((window.getComputedStyle(element)))[prop]); + }; + /** + * @param {?} element + * @param {?} keyframes + * @param {?} duration + * @param {?} delay + * @param {?} easing + * @param {?=} previousPlayers + * @return {?} + */ + WebAnimationsDriver.prototype.animate = function (element, keyframes, duration, delay, easing, previousPlayers) { + if (previousPlayers === void 0) { previousPlayers = []; } + var /** @type {?} */ fill = delay == 0 ? 'both' : 'forwards'; + var /** @type {?} */ playerOptions = { duration: duration, delay: delay, fill: 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; + } + var /** @type {?} */ previousWebAnimationPlayers = (previousPlayers.filter(function (player) { return player instanceof WebAnimationsPlayer; })); + return new WebAnimationsPlayer(element, keyframes, playerOptions, previousWebAnimationPlayers); + }; + return WebAnimationsDriver; +}()); +/** + * @return {?} + */ +function supportsWebAnimations() { + return typeof Element !== 'undefined' && typeof ((Element)).prototype['animate'] === 'function'; +} + +exports.AnimationDriver = AnimationDriver; +exports.ɵAnimation = Animation; +exports.ɵAnimationStyleNormalizer = AnimationStyleNormalizer; +exports.ɵNoopAnimationStyleNormalizer = NoopAnimationStyleNormalizer; +exports.ɵWebAnimationsStyleNormalizer = WebAnimationsStyleNormalizer; +exports.ɵNoopAnimationDriver = NoopAnimationDriver; +exports.ɵAnimationEngine = AnimationEngine; +exports.ɵWebAnimationsDriver = WebAnimationsDriver; +exports.ɵsupportsWebAnimations = supportsWebAnimations; +exports.ɵWebAnimationsPlayer = WebAnimationsPlayer; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=animations-browser.umd.js.map + + +/***/ }), +/* 160 */ +/***/ (function(module, exports, __webpack_require__) { + +/** + * @license Angular v4.2.5 + * (c) 2010-2017 Google, Inc. https://angular.io/ + * License: MIT + */ +(function (global, factory) { + true ? factory(exports, __webpack_require__(0), __webpack_require__(330), __webpack_require__(328), __webpack_require__(159)) : + typeof define === 'function' && define.amd ? define(['exports', '@angular/core', '@angular/platform-browser', '@angular/animations', '@angular/animations/browser'], factory) : + (factory((global.ng = global.ng || {}, global.ng.platformBrowser = global.ng.platformBrowser || {}, global.ng.platformBrowser.animations = global.ng.platformBrowser.animations || {}),global.ng.core,global.ng.platformBrowser,global.ng.animations,global.ng.animations.browser)); +}(this, (function (exports,_angular_core,_angular_platformBrowser,_angular_animations,_angular_animations_browser) { 'use strict'; + +/*! ***************************************************************************** +Copyright (c) Microsoft Corporation. All rights reserved. +Licensed under the Apache License, Version 2.0 (the "License"); you may not use +this file except in compliance with the License. You may obtain a copy of the +License at http://www.apache.org/licenses/LICENSE-2.0 + +THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED +WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE, +MERCHANTABLITY OR NON-INFRINGEMENT. + +See the Apache Version 2.0 License for specific language governing permissions +and limitations under the License. +***************************************************************************** */ +/* global Reflect, Promise */ + +var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + +function __extends(d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); +} + +/** + * @license Angular v4.2.5 + * (c) 2010-2017 Google, Inc. https://angular.io/ + * License: MIT + */ +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var BrowserAnimationBuilder = (function (_super) { + __extends(BrowserAnimationBuilder, _super); + /** + * @param {?} rootRenderer + */ + function BrowserAnimationBuilder(rootRenderer) { + var _this = _super.call(this) || this; + _this._nextAnimationId = 0; + var typeData = { + id: '0', + encapsulation: _angular_core.ViewEncapsulation.None, + styles: [], + data: { animation: [] } + }; + _this._renderer = rootRenderer.createRenderer(document.body, typeData); + return _this; + } + /** + * @param {?} animation + * @return {?} + */ + BrowserAnimationBuilder.prototype.build = function (animation) { + var /** @type {?} */ id = this._nextAnimationId.toString(); + this._nextAnimationId++; + var /** @type {?} */ entry = Array.isArray(animation) ? _angular_animations.sequence(animation) : animation; + issueAnimationCommand(this._renderer, null, id, 'register', [entry]); + return new BrowserAnimationFactory(id, this._renderer); + }; + return BrowserAnimationBuilder; +}(_angular_animations.AnimationBuilder)); +BrowserAnimationBuilder.decorators = [ + { type: _angular_core.Injectable }, +]; +/** + * @nocollapse + */ +BrowserAnimationBuilder.ctorParameters = function () { return [ + { type: _angular_core.RendererFactory2, }, +]; }; +var BrowserAnimationFactory = (function (_super) { + __extends(BrowserAnimationFactory, _super); + /** + * @param {?} _id + * @param {?} _renderer + */ + function BrowserAnimationFactory(_id, _renderer) { + var _this = _super.call(this) || this; + _this._id = _id; + _this._renderer = _renderer; + return _this; + } + /** + * @param {?} element + * @param {?=} options + * @return {?} + */ + BrowserAnimationFactory.prototype.create = function (element, options) { + return new RendererAnimationPlayer(this._id, element, options || {}, this._renderer); + }; + return BrowserAnimationFactory; +}(_angular_animations.AnimationFactory)); +var RendererAnimationPlayer = (function () { + /** + * @param {?} id + * @param {?} element + * @param {?} options + * @param {?} _renderer + */ + function RendererAnimationPlayer(id, element, options, _renderer) { + this.id = id; + this.element = element; + this._renderer = _renderer; + this.parentPlayer = null; + this._started = false; + this.totalTime = 0; + this._command('create', options); + } + /** + * @param {?} eventName + * @param {?} callback + * @return {?} + */ + RendererAnimationPlayer.prototype._listen = function (eventName, callback) { + return this._renderer.listen(this.element, "@@" + this.id + ":" + eventName, callback); + }; + /** + * @param {?} command + * @param {...?} args + * @return {?} + */ + RendererAnimationPlayer.prototype._command = function (command) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return issueAnimationCommand(this._renderer, this.element, this.id, command, args); + }; + /** + * @param {?} fn + * @return {?} + */ + RendererAnimationPlayer.prototype.onDone = function (fn) { this._listen('done', fn); }; + /** + * @param {?} fn + * @return {?} + */ + RendererAnimationPlayer.prototype.onStart = function (fn) { this._listen('start', fn); }; + /** + * @param {?} fn + * @return {?} + */ + RendererAnimationPlayer.prototype.onDestroy = function (fn) { this._listen('destroy', fn); }; + /** + * @return {?} + */ + RendererAnimationPlayer.prototype.init = function () { this._command('init'); }; + /** + * @return {?} + */ + RendererAnimationPlayer.prototype.hasStarted = function () { return this._started; }; + /** + * @return {?} + */ + RendererAnimationPlayer.prototype.play = function () { + this._command('play'); + this._started = true; + }; + /** + * @return {?} + */ + RendererAnimationPlayer.prototype.pause = function () { this._command('pause'); }; + /** + * @return {?} + */ + RendererAnimationPlayer.prototype.restart = function () { this._command('restart'); }; + /** + * @return {?} + */ + RendererAnimationPlayer.prototype.finish = function () { this._command('finish'); }; + /** + * @return {?} + */ + RendererAnimationPlayer.prototype.destroy = function () { this._command('destroy'); }; + /** + * @return {?} + */ + RendererAnimationPlayer.prototype.reset = function () { this._command('reset'); }; + /** + * @param {?} p + * @return {?} + */ + RendererAnimationPlayer.prototype.setPosition = function (p) { this._command('setPosition', p); }; + /** + * @return {?} + */ + RendererAnimationPlayer.prototype.getPosition = function () { return 0; }; + return RendererAnimationPlayer; +}()); +/** + * @param {?} renderer + * @param {?} element + * @param {?} id + * @param {?} command + * @param {?} args + * @return {?} + */ +function issueAnimationCommand(renderer, element, id, command, args) { + return renderer.setProperty(element, "@@" + id + ":" + command, args); +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var AnimationRendererFactory = (function () { + /** + * @param {?} delegate + * @param {?} engine + * @param {?} _zone + */ + function AnimationRendererFactory(delegate, engine, _zone) { + this.delegate = delegate; + this.engine = engine; + this._zone = _zone; + this._currentId = 0; + this._microtaskId = 1; + this._animationCallbacksBuffer = []; + this._rendererCache = new Map(); + engine.onRemovalComplete = function (element, delegate) { + // Note: if an component element has a leave animation, and the component + // a host leave animation, the view engine will call `removeChild` for the parent + // component renderer as well as for the child component renderer. + // Therefore, we need to check if we already removed the element. + if (delegate && delegate.parentNode(element)) { + delegate.removeChild(element.parentNode, element); + } + }; + } + /** + * @param {?} hostElement + * @param {?} type + * @return {?} + */ + AnimationRendererFactory.prototype.createRenderer = function (hostElement, type) { + var _this = this; + var /** @type {?} */ EMPTY_NAMESPACE_ID = ''; + // cache the delegates to find out which cached delegate can + // be used by which cached renderer + var /** @type {?} */ delegate = this.delegate.createRenderer(hostElement, type); + if (!hostElement || !type || !type.data || !type.data['animation']) { + var /** @type {?} */ renderer = this._rendererCache.get(delegate); + if (!renderer) { + renderer = new BaseAnimationRenderer(EMPTY_NAMESPACE_ID, delegate, this.engine); + // only cache this result when the base renderer is used + this._rendererCache.set(delegate, renderer); + } + return renderer; + } + var /** @type {?} */ componentId = type.id; + var /** @type {?} */ namespaceId = type.id + '-' + this._currentId; + this._currentId++; + this.engine.register(namespaceId, hostElement); + var /** @type {?} */ animationTriggers = (type.data['animation']); + animationTriggers.forEach(function (trigger) { return _this.engine.registerTrigger(componentId, namespaceId, hostElement, trigger.name, trigger); }); + return new AnimationRenderer(this, namespaceId, delegate, this.engine); + }; + /** + * @return {?} + */ + AnimationRendererFactory.prototype.begin = function () { + if (this.delegate.begin) { + this.delegate.begin(); + } + }; + /** + * @return {?} + */ + AnimationRendererFactory.prototype._scheduleCountTask = function () { + var _this = this; + Zone.current.scheduleMicroTask('incremenet the animation microtask', function () { return _this._microtaskId++; }); + }; + /** + * @param {?} count + * @param {?} fn + * @param {?} data + * @return {?} + */ + AnimationRendererFactory.prototype.scheduleListenerCallback = function (count, fn, data) { + var _this = this; + if (count >= 0 && count < this._microtaskId) { + this._zone.run(function () { return fn(data); }); + return; + } + if (this._animationCallbacksBuffer.length == 0) { + Promise.resolve(null).then(function () { + _this._zone.run(function () { + _this._animationCallbacksBuffer.forEach(function (tuple) { + var fn = tuple[0], data = tuple[1]; + fn(data); + }); + _this._animationCallbacksBuffer = []; + }); + }); + } + this._animationCallbacksBuffer.push([fn, data]); + }; + /** + * @return {?} + */ + AnimationRendererFactory.prototype.end = function () { + var _this = this; + this._zone.runOutsideAngular(function () { + _this._scheduleCountTask(); + _this.engine.flush(_this._microtaskId); + }); + if (this.delegate.end) { + this.delegate.end(); + } + }; + /** + * @return {?} + */ + AnimationRendererFactory.prototype.whenRenderingDone = function () { return this.engine.whenRenderingDone(); }; + return AnimationRendererFactory; +}()); +AnimationRendererFactory.decorators = [ + { type: _angular_core.Injectable }, +]; +/** + * @nocollapse + */ +AnimationRendererFactory.ctorParameters = function () { return [ + { type: _angular_core.RendererFactory2, }, + { type: _angular_animations_browser.ɵAnimationEngine, }, + { type: _angular_core.NgZone, }, +]; }; +var BaseAnimationRenderer = (function () { + /** + * @param {?} namespaceId + * @param {?} delegate + * @param {?} engine + */ + function BaseAnimationRenderer(namespaceId, delegate, engine) { + this.namespaceId = namespaceId; + this.delegate = delegate; + this.engine = engine; + this.destroyNode = this.delegate.destroyNode ? function (n) { return delegate.destroyNode(n); } : null; + } + Object.defineProperty(BaseAnimationRenderer.prototype, "data", { + /** + * @return {?} + */ + get: function () { return this.delegate.data; }, + enumerable: true, + configurable: true + }); + /** + * @return {?} + */ + BaseAnimationRenderer.prototype.destroy = function () { + this.engine.destroy(this.namespaceId, this.delegate); + this.delegate.destroy(); + }; + /** + * @param {?} name + * @param {?=} namespace + * @return {?} + */ + BaseAnimationRenderer.prototype.createElement = function (name, namespace) { + return this.delegate.createElement(name, namespace); + }; + /** + * @param {?} value + * @return {?} + */ + BaseAnimationRenderer.prototype.createComment = function (value) { return this.delegate.createComment(value); }; + /** + * @param {?} value + * @return {?} + */ + BaseAnimationRenderer.prototype.createText = function (value) { return this.delegate.createText(value); }; + /** + * @param {?} parent + * @param {?} newChild + * @return {?} + */ + BaseAnimationRenderer.prototype.appendChild = function (parent, newChild) { + this.delegate.appendChild(parent, newChild); + this.engine.onInsert(this.namespaceId, newChild, parent, false); + }; + /** + * @param {?} parent + * @param {?} newChild + * @param {?} refChild + * @return {?} + */ + BaseAnimationRenderer.prototype.insertBefore = function (parent, newChild, refChild) { + this.delegate.insertBefore(parent, newChild, refChild); + this.engine.onInsert(this.namespaceId, newChild, parent, true); + }; + /** + * @param {?} parent + * @param {?} oldChild + * @return {?} + */ + BaseAnimationRenderer.prototype.removeChild = function (parent, oldChild) { + this.engine.onRemove(this.namespaceId, oldChild, this.delegate); + }; + /** + * @param {?} selectorOrNode + * @return {?} + */ + BaseAnimationRenderer.prototype.selectRootElement = function (selectorOrNode) { return this.delegate.selectRootElement(selectorOrNode); }; + /** + * @param {?} node + * @return {?} + */ + BaseAnimationRenderer.prototype.parentNode = function (node) { return this.delegate.parentNode(node); }; + /** + * @param {?} node + * @return {?} + */ + BaseAnimationRenderer.prototype.nextSibling = function (node) { return this.delegate.nextSibling(node); }; + /** + * @param {?} el + * @param {?} name + * @param {?} value + * @param {?=} namespace + * @return {?} + */ + BaseAnimationRenderer.prototype.setAttribute = function (el, name, value, namespace) { + this.delegate.setAttribute(el, name, value, namespace); + }; + /** + * @param {?} el + * @param {?} name + * @param {?=} namespace + * @return {?} + */ + BaseAnimationRenderer.prototype.removeAttribute = function (el, name, namespace) { + this.delegate.removeAttribute(el, name, namespace); + }; + /** + * @param {?} el + * @param {?} name + * @return {?} + */ + BaseAnimationRenderer.prototype.addClass = function (el, name) { this.delegate.addClass(el, name); }; + /** + * @param {?} el + * @param {?} name + * @return {?} + */ + BaseAnimationRenderer.prototype.removeClass = function (el, name) { this.delegate.removeClass(el, name); }; + /** + * @param {?} el + * @param {?} style + * @param {?} value + * @param {?=} flags + * @return {?} + */ + BaseAnimationRenderer.prototype.setStyle = function (el, style, value, flags) { + this.delegate.setStyle(el, style, value, flags); + }; + /** + * @param {?} el + * @param {?} style + * @param {?=} flags + * @return {?} + */ + BaseAnimationRenderer.prototype.removeStyle = function (el, style, flags) { + this.delegate.removeStyle(el, style, flags); + }; + /** + * @param {?} el + * @param {?} name + * @param {?} value + * @return {?} + */ + BaseAnimationRenderer.prototype.setProperty = function (el, name, value) { + this.delegate.setProperty(el, name, value); + }; + /** + * @param {?} node + * @param {?} value + * @return {?} + */ + BaseAnimationRenderer.prototype.setValue = function (node, value) { this.delegate.setValue(node, value); }; + /** + * @param {?} target + * @param {?} eventName + * @param {?} callback + * @return {?} + */ + BaseAnimationRenderer.prototype.listen = function (target, eventName, callback) { + return this.delegate.listen(target, eventName, callback); + }; + return BaseAnimationRenderer; +}()); +var AnimationRenderer = (function (_super) { + __extends(AnimationRenderer, _super); + /** + * @param {?} factory + * @param {?} namespaceId + * @param {?} delegate + * @param {?} engine + */ + function AnimationRenderer(factory, namespaceId, delegate, engine) { + var _this = _super.call(this, namespaceId, delegate, engine) || this; + _this.factory = factory; + _this.namespaceId = namespaceId; + return _this; + } + /** + * @param {?} el + * @param {?} name + * @param {?} value + * @return {?} + */ + AnimationRenderer.prototype.setProperty = function (el, name, value) { + if (name.charAt(0) == '@') { + name = name.substr(1); + this.engine.setProperty(this.namespaceId, el, name, value); + } + else { + this.delegate.setProperty(el, name, value); + } + }; + /** + * @param {?} target + * @param {?} eventName + * @param {?} callback + * @return {?} + */ + AnimationRenderer.prototype.listen = function (target, eventName, callback) { + var _this = this; + if (eventName.charAt(0) == '@') { + var /** @type {?} */ element = resolveElementFromTarget(target); + var /** @type {?} */ name = eventName.substr(1); + var /** @type {?} */ phase = ''; + if (name.charAt(0) != '@') { + _a = parseTriggerCallbackName(name), name = _a[0], phase = _a[1]; + } + return this.engine.listen(this.namespaceId, element, name, phase, function (event) { + var /** @type {?} */ countId = ((event))['_data'] || -1; + _this.factory.scheduleListenerCallback(countId, callback, event); + }); + } + return this.delegate.listen(target, eventName, callback); + var _a; + }; + return AnimationRenderer; +}(BaseAnimationRenderer)); +/** + * @param {?} target + * @return {?} + */ +function resolveElementFromTarget(target) { + switch (target) { + case 'body': + return document.body; + case 'document': + return document; + case 'window': + return window; + default: + return target; + } +} +/** + * @param {?} triggerName + * @return {?} + */ +function parseTriggerCallbackName(triggerName) { + var /** @type {?} */ dotIndex = triggerName.indexOf('.'); + var /** @type {?} */ trigger = triggerName.substring(0, dotIndex); + var /** @type {?} */ phase = triggerName.substr(dotIndex + 1); + return [trigger, phase]; +} +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +var InjectableAnimationEngine = (function (_super) { + __extends(InjectableAnimationEngine, _super); + /** + * @param {?} driver + * @param {?} normalizer + */ + function InjectableAnimationEngine(driver, normalizer) { + return _super.call(this, driver, normalizer) || this; + } + return InjectableAnimationEngine; +}(_angular_animations_browser.ɵAnimationEngine)); +InjectableAnimationEngine.decorators = [ + { type: _angular_core.Injectable }, +]; +/** + * @nocollapse + */ +InjectableAnimationEngine.ctorParameters = function () { return [ + { type: _angular_animations_browser.AnimationDriver, }, + { type: _angular_animations_browser.ɵAnimationStyleNormalizer, }, +]; }; +/** + * @return {?} + */ +function instantiateSupportedAnimationDriver() { + if (_angular_animations_browser.ɵsupportsWebAnimations()) { + return new _angular_animations_browser.ɵWebAnimationsDriver(); + } + return new _angular_animations_browser.ɵNoopAnimationDriver(); +} +/** + * @return {?} + */ +function instantiateDefaultStyleNormalizer() { + return new _angular_animations_browser.ɵWebAnimationsStyleNormalizer(); +} +/** + * @param {?} renderer + * @param {?} engine + * @param {?} zone + * @return {?} + */ +function instantiateRendererFactory(renderer, engine, zone) { + return new AnimationRendererFactory(renderer, engine, zone); +} +var SHARED_ANIMATION_PROVIDERS = [ + { provide: _angular_animations.AnimationBuilder, useClass: BrowserAnimationBuilder }, + { provide: _angular_animations_browser.ɵAnimationStyleNormalizer, useFactory: instantiateDefaultStyleNormalizer }, + { provide: _angular_animations_browser.ɵAnimationEngine, useClass: InjectableAnimationEngine }, { + provide: _angular_core.RendererFactory2, + useFactory: instantiateRendererFactory, + deps: [_angular_platformBrowser.ɵDomRendererFactory2, _angular_animations_browser.ɵAnimationEngine, _angular_core.NgZone] + } +]; +/** + * Separate providers from the actual module so that we can do a local modification in Google3 to + * include them in the BrowserModule. + */ +var BROWSER_ANIMATIONS_PROVIDERS = [ + { provide: _angular_animations_browser.AnimationDriver, useFactory: instantiateSupportedAnimationDriver } +].concat(SHARED_ANIMATION_PROVIDERS); +/** + * Separate providers from the actual module so that we can do a local modification in Google3 to + * include them in the BrowserTestingModule. + */ +var BROWSER_NOOP_ANIMATIONS_PROVIDERS = [{ provide: _angular_animations_browser.AnimationDriver, useClass: _angular_animations_browser.ɵNoopAnimationDriver }].concat(SHARED_ANIMATION_PROVIDERS); +/** + * @license + * Copyright Google Inc. All Rights Reserved. + * + * Use of this source code is governed by an MIT-style license that can be + * found in the LICENSE file at https://angular.io/license + */ +/** + * \@experimental Animation support is experimental. + */ +var BrowserAnimationsModule = (function () { + function BrowserAnimationsModule() { + } + return BrowserAnimationsModule; +}()); +BrowserAnimationsModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [_angular_platformBrowser.BrowserModule], + providers: BROWSER_ANIMATIONS_PROVIDERS, + },] }, +]; +/** + * @nocollapse + */ +BrowserAnimationsModule.ctorParameters = function () { return []; }; +/** + * \@experimental Animation support is experimental. + */ +var NoopAnimationsModule = (function () { + function NoopAnimationsModule() { + } + return NoopAnimationsModule; +}()); +NoopAnimationsModule.decorators = [ + { type: _angular_core.NgModule, args: [{ + imports: [_angular_platformBrowser.BrowserModule], + providers: BROWSER_NOOP_ANIMATIONS_PROVIDERS, + },] }, +]; +/** + * @nocollapse + */ +NoopAnimationsModule.ctorParameters = function () { return []; }; + +exports.BrowserAnimationsModule = BrowserAnimationsModule; +exports.NoopAnimationsModule = NoopAnimationsModule; +exports.ɵBrowserAnimationBuilder = BrowserAnimationBuilder; +exports.ɵBrowserAnimationFactory = BrowserAnimationFactory; +exports.ɵAnimationRenderer = AnimationRenderer; +exports.ɵAnimationRendererFactory = AnimationRendererFactory; +exports.ɵa = BaseAnimationRenderer; +exports.ɵf = BROWSER_ANIMATIONS_PROVIDERS; +exports.ɵg = BROWSER_NOOP_ANIMATIONS_PROVIDERS; +exports.ɵb = InjectableAnimationEngine; +exports.ɵd = instantiateDefaultStyleNormalizer; +exports.ɵe = instantiateRendererFactory; +exports.ɵc = instantiateSupportedAnimationDriver; + +Object.defineProperty(exports, '__esModule', { value: true }); + +}))); +//# sourceMappingURL=platform-browser-animations.umd.js.map + + +/***/ }), +/* 161 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:no-forward-ref max-line-length */ +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +var kendo_angular_l10n_1 = __webpack_require__(2); +var kendo_date_math_1 = __webpack_require__(19); +var navigation_component_1 = __webpack_require__(165); +var month_view_component_1 = __webpack_require__(164); +var navigation_service_1 = __webpack_require__(166); +var scroll_sync_service_1 = __webpack_require__(343); +var cell_template_directive_1 = __webpack_require__(98); +var min_validator_1 = __webpack_require__(102); +var max_validator_1 = __webpack_require__(101); +var defaults_1 = __webpack_require__(52); +var util_1 = __webpack_require__(18); +var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-min'; +var MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/CalendarComponent/#toc-max'; +var hasChange = function (changes, field) { return changes[field] && changes[field].currentValue; }; +var virtualizationProp = function (x) { return x ? x.virtualization : null; }; +/** + * @hidden + */ +exports.CALENDAR_VALUE_ACCESSOR = { + multi: true, + provide: forms_1.NG_VALUE_ACCESSOR, + useExisting: core_1.forwardRef(function () { return CalendarComponent; }) //tslint:disable-line:no-use-before-declare +}; +/** + * @hidden + */ +exports.CALENDAR_RANGE_VALIDATORS = { + multi: true, + provide: forms_1.NG_VALIDATORS, + useExisting: core_1.forwardRef(function () { return CalendarComponent; }) //tslint:disable-line:no-use-before-declare +}; +/** + * Represents the Kendo UI Calendar component for Angular. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * ` + * }) + * class AppComponent { } + * ``` + */ +var CalendarComponent = (function () { + function CalendarComponent(element, navigator, scrollSyncService) { + this.element = element; + this.navigator = navigator; + this.scrollSyncService = scrollSyncService; + /** + * Determines whether the built-in min or max validators are enforced when validating a form. + */ + this.rangeValidation = false; + /** + * Sets or gets the `disabled` property of the Calendar and determines whether the component is active. + */ + this.disabled = false; + /** + * Sets or gets the `tabIndex` property of the Calendar. Based on the [HTML tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) behavior, + * it determines whether the component is focusable. + * . + */ + this.tabIndex = 0; + /** + * Sets or gets the `navigation` property of the Calendar and determines whether the navigation component is shown. + */ + this.navigation = true; + /** + * Fires when the value is changed. + * + * For more details, refer to the section on [events]({% slug overview_calendar_kendouiforangular %}#toc-events). + */ + this.valueChange = new core_1.EventEmitter(); + this.isActive = false; + this.cellUID = util_1.guid(); + this._min = new Date(defaults_1.MIN_DATE); + this._max = new Date(defaults_1.MAX_DATE); + this._focusedDate = kendo_date_math_1.getDate(new Date()); + this.propagateChange = util_1.noop; + this.propagateTouched = util_1.noop; + this.minValidateFn = util_1.noop; + this.maxValidateFn = util_1.noop; + this.syncNavigation = true; + } + Object.defineProperty(CalendarComponent.prototype, "focusedDate", { + get: function () { + return this._focusedDate; + }, + /** + * Sets or gets the `focusedDate` property of the Calendar and defines the focused date of the component. + * + * > If the Calendar is out of the min or max range, it normalizes the defined `focusedDate`. + */ + set: function (focusedDate) { + this._focusedDate = focusedDate || kendo_date_math_1.getDate(new Date()); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarComponent.prototype, "min", { + get: function () { + return this._min; + }, + /** + * Sets or gets the `min` property of the Calendar and defines the minimum allowed date value. + */ + set: function (min) { + this._min = min || new Date(defaults_1.MIN_DATE); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarComponent.prototype, "max", { + get: function () { + return this._max; + }, + /** + * Sets or gets the `max` property of the Calendar and defines the maximum allowed date value. + */ + set: function (max) { + this._max = max || new Date(defaults_1.MAX_DATE); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarComponent.prototype, "value", { + /** + * Sets or gets the `value` property of the Calendar and defines the selected value of the component. + */ + get: function () { + return this._value; + }, + set: function (candidate) { + this.prevValue = kendo_date_math_1.cloneDate(candidate); + this._value = kendo_date_math_1.cloneDate(candidate); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarComponent.prototype, "widgetRole", { + get: function () { + return 'grid'; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarComponent.prototype, "widgetClasses", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarComponent.prototype, "calendarTabIndex", { + get: function () { + return this.disabled ? undefined : this.tabIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarComponent.prototype, "ariaDisabled", { + get: function () { + return this.disabled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(CalendarComponent.prototype, "ariaActivedescendant", { + get: function () { + return this.cellUID + this.focusedDate.getTime(); + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + CalendarComponent.prototype.handleBlur = function () { + this.propagateTouched(); + this.isActive = false; + }; + /** + * @hidden + */ + CalendarComponent.prototype.handleFocus = function () { + this.isActive = true; + }; + /** + * @hidden + */ + CalendarComponent.prototype.handleMousedown = function (event) { + event.preventDefault(); + }; + /** + * @hidden + */ + CalendarComponent.prototype.handleClick = function () { + if (!this.isActive) { + this.focusedDate = kendo_date_math_1.cloneDate(this.focusedDate); + this.focus(); + } + }; + /** + * @hidden + */ + CalendarComponent.prototype.keydown = function (event) { + var candidate = util_1.dateInRange(this.navigator.move(this.focusedDate, this.navigator.action(event)), this.min, this.max); + if (kendo_date_math_1.isEqual(this.focusedDate, candidate)) { + return; + } + this.focusedDate = candidate; + event.preventDefault(); + }; + /** + * @hidden + */ + CalendarComponent.prototype.enter = function () { + this.handleDateChange(this.focusedDate); + }; + CalendarComponent.prototype.ngOnChanges = function (changes) { + this.verifySettings(); + var useValue = hasChange(changes, 'value') && !hasChange(changes, 'focusedDate'); //TODO: test + var focusedDate = useValue ? this.value : this.focusedDate; + this.focusedDate = util_1.dateInRange(kendo_date_math_1.cloneDate(focusedDate), this.min, this.max); + if (changes.navigation) { + this.syncNavigation = true; + } + if (changes.min || changes.max) { + this.minValidateFn = this.rangeValidation ? min_validator_1.minValidator(this.min) : util_1.noop; + this.maxValidateFn = this.rangeValidation ? max_validator_1.maxValidator(this.max) : util_1.noop; + } + }; + CalendarComponent.prototype.ngAfterViewChecked = function () { + if (!this.syncNavigation) { + return; + } + this.syncNavigation = false; + this.scrollSyncService.sync(virtualizationProp(this.navigationView), virtualizationProp(this.monthView)); + }; + CalendarComponent.prototype.ngOnDestroy = function () { + this.scrollSyncService.destroy(); + }; + /** + * Focuses the host element of the Calendar. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * class AppComponent { } + * ``` + */ + CalendarComponent.prototype.focus = function () { + if (!this.element) { + return; + } + this.element.nativeElement.focus(); + }; + /** + * Blurs the Calendar component. + */ + CalendarComponent.prototype.blur = function () { + if (!this.element) { + return; + } + this.element.nativeElement.blur(); + }; + /** + * @hidden + */ + CalendarComponent.prototype.handleNavigation = function (candidate) { + if (this.disabled) { + return; + } + this.focusedDate = kendo_date_math_1.cloneDate(candidate) || this.focusedDate; + }; + /** + * @hidden + */ + CalendarComponent.prototype.handleDateChange = function (candidate) { + this.focusedDate = kendo_date_math_1.cloneDate(candidate) || this.focusedDate; + if (this.disabled || kendo_date_math_1.isEqual(candidate, this.prevValue)) { + return; + } + this.value = kendo_date_math_1.cloneDate(candidate); + this.valueChange.emit(kendo_date_math_1.cloneDate(candidate)); + this.propagateChange(kendo_date_math_1.cloneDate(candidate)); + }; + /** + * @hidden + */ + CalendarComponent.prototype.writeValue = function (candidate) { + this.focusedDate = util_1.dateInRange(kendo_date_math_1.cloneDate(candidate) || this.focusedDate, this.min, this.max); + this.value = kendo_date_math_1.cloneDate(candidate); + }; + /** + * @hidden + */ + CalendarComponent.prototype.registerOnChange = function (fn) { + this.propagateChange = fn; + }; + /** + * @hidden + */ + CalendarComponent.prototype.registerOnTouched = function (fn) { + this.propagateTouched = fn; + }; + /** + * @hidden + */ + CalendarComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + /** + * @hidden + */ + CalendarComponent.prototype.validate = function (control) { + return this.minValidateFn(control) || this.maxValidateFn(control); + }; + CalendarComponent.prototype.verifySettings = function () { + if (!core_1.isDevMode()) { + return; + } + if (this.min > this.max) { + throw new Error("The max value should be bigger than the min. See " + MIN_DOC_LINK + " and " + MAX_DOC_LINK + "."); + } + }; + return CalendarComponent; +}()); +CalendarComponent.decorators = [ + { type: core_1.Component, args: [{ + changeDetection: core_1.ChangeDetectionStrategy.OnPush, + exportAs: 'kendo-calendar', + providers: [ + exports.CALENDAR_VALUE_ACCESSOR, + exports.CALENDAR_RANGE_VALIDATORS, + kendo_angular_l10n_1.LocalizationService, + { + provide: kendo_angular_l10n_1.L10N_PREFIX, + useValue: 'kendo.calendar' + }, + scroll_sync_service_1.ScrollSyncService + ], + selector: 'kendo-calendar', + template: "\n \n \n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +CalendarComponent.ctorParameters = function () { return [ + { type: core_1.ElementRef, }, + { type: navigation_service_1.NavigationService, }, + { type: scroll_sync_service_1.ScrollSyncService, }, +]; }; +CalendarComponent.propDecorators = { + 'focusedDate': [{ type: core_1.Input },], + 'min': [{ type: core_1.Input },], + 'max': [{ type: core_1.Input },], + 'rangeValidation': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'disabled': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'navigation': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'cellTemplate': [{ type: core_1.Input }, { type: core_1.ContentChild, args: [cell_template_directive_1.CellTemplateDirective,] },], + 'navigationView': [{ type: core_1.ViewChild, args: [navigation_component_1.NavigationComponent,] },], + 'monthView': [{ type: core_1.ViewChild, args: [month_view_component_1.MonthViewComponent,] },], + 'widgetRole': [{ type: core_1.HostBinding, args: ['attr.role',] },], + 'widgetClasses': [{ type: core_1.HostBinding, args: ["class.k-widget",] }, { type: core_1.HostBinding, args: ["class.k-calendar",] }, { type: core_1.HostBinding, args: ["class.k-calendar-infinite",] },], + 'calendarTabIndex': [{ type: core_1.HostBinding, args: ['attr.tabindex',] },], + 'ariaDisabled': [{ type: core_1.HostBinding, args: ['attr.aria-disabled',] }, { type: core_1.HostBinding, args: ['class.k-state-disabled',] },], + 'ariaActivedescendant': [{ type: core_1.HostBinding, args: ['attr.aria-activedescendant',] },], + 'handleBlur': [{ type: core_1.HostListener, args: ["blur",] },], + 'handleFocus': [{ type: core_1.HostListener, args: ["focus",] },], + 'handleMousedown': [{ type: core_1.HostListener, args: ["mousedown", ['$event'],] },], + 'handleClick': [{ type: core_1.HostListener, args: ["click",] },], + 'keydown': [{ type: core_1.HostListener, args: ["keydown", ["$event"],] },], + 'enter': [{ type: core_1.HostListener, args: ["keydown.enter",] },], +}; +exports.CalendarComponent = CalendarComponent; + + +/***/ }), +/* 162 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +var messages_1 = __webpack_require__(163); +/** + * Custom component messages override default component messages. + */ +var CalendarCustomMessagesComponent = (function (_super) { + __extends(CalendarCustomMessagesComponent, _super); + function CalendarCustomMessagesComponent(service) { + var _this = _super.call(this) || this; + _this.service = service; + return _this; + } + Object.defineProperty(CalendarCustomMessagesComponent.prototype, "override", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + return CalendarCustomMessagesComponent; +}(messages_1.Messages)); +CalendarCustomMessagesComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: messages_1.Messages, + useExisting: core_1.forwardRef(function () { return CalendarCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-calendar-messages', + template: "" + },] }, +]; +/** @nocollapse */ +CalendarCustomMessagesComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.CalendarCustomMessagesComponent = CalendarCustomMessagesComponent; + + +/***/ }), +/* 163 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * @hidden + */ +var Messages = (function (_super) { + __extends(Messages, _super); + function Messages() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Messages; +}(kendo_angular_l10n_1.ComponentMessages)); +Messages.propDecorators = { + 'today': [{ type: core_1.Input },], +}; +exports.Messages = Messages; + + +/***/ }), +/* 164 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:component-selector-name component-selector-type */ +var core_1 = __webpack_require__(0); +var virtualization_component_1 = __webpack_require__(99); +var defaults_1 = __webpack_require__(52); +var dom_service_1 = __webpack_require__(51); +var month_view_service_1 = __webpack_require__(73); +var kendo_date_math_1 = __webpack_require__(19); +var util_1 = __webpack_require__(18); +/** + * @hidden + */ +var MonthViewComponent = (function () { + function MonthViewComponent(service, dom) { + this.service = service; + this.isActive = true; + this.min = new Date(defaults_1.MIN_DATE); + this.max = new Date(defaults_1.MAX_DATE); + this.change = new core_1.EventEmitter(); + this.dates = []; + this.take = 3; + this.indexToScroll = -1; + this.minViewsToRender = 1; + this.viewHeight = dom.monthViewHeight(); + this.viewOffset = -1 * dom.monthHeaderHeight(); + this.bottomOffset = dom.monthScrollableContentHeight() - this.viewHeight; + } + Object.defineProperty(MonthViewComponent.prototype, "getComponentClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + MonthViewComponent.prototype.ngOnChanges = function (changes) { + var focusedDate = this.focusedDate; + var viewDate = this.getViewDate(focusedDate); + var total = util_1.monthsDistance(this.max, this.min) + 1; + var totalChanged = this.total && this.total !== total; + this.activeDate = kendo_date_math_1.cloneDate(focusedDate); + this.skip = util_1.monthsDistance(viewDate, this.min); + this.total = total; + if (totalChanged || !util_1.isInDatesArray(focusedDate, this.dates)) { + this.dates = util_1.generateDates(kendo_date_math_1.firstDayOfMonth(viewDate), this.getTake(util_1.monthsDistance(viewDate, this.min))); + } + if (!!changes.focusedDate || this.virtualization.isIndexVisible(this.skip)) { + this.indexToScroll = util_1.monthsDistance(this.focusedDate, this.min); + } + }; + MonthViewComponent.prototype.ngAfterViewInit = function () { + var _this = this; + this.scrollOnce(function (index) { return _this.virtualization.scrollToIndex(index); }); + }; + MonthViewComponent.prototype.ngAfterViewChecked = function () { + var _this = this; + this.scrollOnce(function (index) { return _this.virtualization.animateToIndex(index); }); + }; + MonthViewComponent.prototype.trackByDates = function (_, date) { + return date.getFullYear() + "-" + date.getMonth(); + }; + MonthViewComponent.prototype.pageChange = function (_a) { + var skip = _a.skip; + this.dates = util_1.generateDates(kendo_date_math_1.addMonths(this.min, skip), this.getTake(skip)); + }; + MonthViewComponent.prototype.scrollChange = function (_a) { + var offset = _a.offset; + this.style = { transform: "translateY(" + offset + "px)" }; + }; + MonthViewComponent.prototype.setActiveDate = function (index) { + this.activeDate = kendo_date_math_1.addMonths(this.min, index); + }; + MonthViewComponent.prototype.handleDateChange = function (candidate) { + this.change.emit(candidate); + }; + MonthViewComponent.prototype.getTake = function (skip) { + return Math.min(this.total - skip, this.take); + }; + MonthViewComponent.prototype.getViewDate = function (date) { + var renderTwoViews = util_1.monthsDistance(this.max, date) < this.minViewsToRender; + var candidate = renderTwoViews ? kendo_date_math_1.addMonths(date, -1) : date; + return util_1.dateInRange(candidate, this.min, this.max); + }; + MonthViewComponent.prototype.scrollOnce = function (action) { + if (this.indexToScroll !== -1) { + action(this.indexToScroll); + this.indexToScroll = -1; + } + }; + return MonthViewComponent; +}()); +MonthViewComponent.decorators = [ + { type: core_1.Component, args: [{ + changeDetection: core_1.ChangeDetectionStrategy.OnPush, + selector: 'kendo-calendar-monthview', + template: "\n \n \n \n \n \n \n \n \n \n
{{name}}
\n \n \n \n \n
\n \n " + },] }, +]; +/** @nocollapse */ +MonthViewComponent.ctorParameters = function () { return [ + { type: month_view_service_1.MonthViewService, }, + { type: dom_service_1.DOMService, }, +]; }; +MonthViewComponent.propDecorators = { + 'cellTemplateRef': [{ type: core_1.Input },], + 'cellUID': [{ type: core_1.Input },], + 'focusedDate': [{ type: core_1.Input },], + 'isActive': [{ type: core_1.Input },], + 'min': [{ type: core_1.Input },], + 'max': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'change': [{ type: core_1.Output },], + 'virtualization': [{ type: core_1.ViewChild, args: [virtualization_component_1.VirtualizationComponent,] },], + 'getComponentClass': [{ type: core_1.HostBinding, args: ["class.k-calendar-monthview",] },], +}; +exports.MonthViewComponent = MonthViewComponent; + + +/***/ }), +/* 165 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:component-selector-name component-selector-type */ +var core_1 = __webpack_require__(0); +var kendo_angular_intl_1 = __webpack_require__(10); +var virtualization_component_1 = __webpack_require__(99); +var defaults_1 = __webpack_require__(52); +var dom_service_1 = __webpack_require__(51); +var kendo_date_math_1 = __webpack_require__(19); +var util_1 = __webpack_require__(18); +/** + * @hidden + */ +var NavigationComponent = (function () { + function NavigationComponent(dom, intlService) { + this.min = new Date(defaults_1.MIN_DATE); + this.max = new Date(defaults_1.MAX_DATE); + this.focusedDate = new Date(); + this.valueChange = new core_1.EventEmitter(); + this.dates = []; + this.take = 30; + this.indexToScroll = -1; + var calendarHeight = dom.calendarHeight(); + this.itemHeight = dom.navigationItemHeight(); + this.topOffset = (calendarHeight - this.itemHeight) / 2; + this.bottomOffset = calendarHeight - this.itemHeight; + this.monthNames = intlService.dateFormatNames({ nameType: 'abbreviated', type: 'months' }); + } + Object.defineProperty(NavigationComponent.prototype, "getComponentClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + NavigationComponent.prototype.ngOnChanges = function (changes) { + var viewDate = util_1.dateInRange(this.focusedDate, this.min, this.max); + var total = util_1.monthsDistance(this.max, this.min) + 1; + var totalChanged = this.total && this.total !== total; + this.skip = util_1.monthsDistance(viewDate, this.min); + this.total = total; + if (totalChanged || !util_1.isInDatesArray(viewDate, this.dates)) { + this.dates = util_1.generateDates(kendo_date_math_1.firstDayOfMonth(viewDate), this.getTake(this.skip)); + } + if (!!changes.focusedDate || totalChanged) { + this.indexToScroll = util_1.monthsDistance(this.focusedDate, this.min); + } + }; + NavigationComponent.prototype.ngAfterViewInit = function () { + var _this = this; + this.scrollOnce(function (index) { return _this.virtualization.scrollToIndex(index); }); + }; + NavigationComponent.prototype.ngAfterViewChecked = function () { + var _this = this; + this.scrollOnce(function (index) { return _this.virtualization.animateToIndex(index); }); + }; + NavigationComponent.prototype.trackByDates = function (_, date) { + return date.getFullYear() + "-" + date.getMonth(); + }; + NavigationComponent.prototype.pageChange = function (_a) { + var skip = _a.skip; + this.dates = util_1.generateDates(kendo_date_math_1.addMonths(this.min, skip), this.getTake(skip)); + }; + NavigationComponent.prototype.scrollChange = function (_a) { + var offset = _a.offset; + this.style = { transform: "translateY(" + offset + "px)" }; + }; + NavigationComponent.prototype.handleDateChange = function (candidate) { + this.valueChange.emit(kendo_date_math_1.cloneDate(candidate)); + }; + NavigationComponent.prototype.getTake = function (skip) { + return Math.min(this.total - skip, this.take); + }; + NavigationComponent.prototype.scrollOnce = function (action) { + if (this.indexToScroll !== -1) { + action(this.indexToScroll); + this.indexToScroll = -1; + } + }; + return NavigationComponent; +}()); +NavigationComponent.decorators = [ + { type: core_1.Component, args: [{ + changeDetection: core_1.ChangeDetectionStrategy.OnPush, + selector: 'kendo-calendar-navigation', + template: "\n \n \n
    \n
  • \n {{date.getFullYear()}}\n {{monthNames[date.getMonth()]}}\n
  • \n
\n \n " + },] }, +]; +/** @nocollapse */ +NavigationComponent.ctorParameters = function () { return [ + { type: dom_service_1.DOMService, }, + { type: kendo_angular_intl_1.IntlService, }, +]; }; +NavigationComponent.propDecorators = { + 'min': [{ type: core_1.Input },], + 'max': [{ type: core_1.Input },], + 'focusedDate': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'virtualization': [{ type: core_1.ViewChild, args: [virtualization_component_1.VirtualizationComponent,] },], + 'getComponentClass': [{ type: core_1.HostBinding, args: ["class.k-calendar-navigation",] },], +}; +exports.NavigationComponent = NavigationComponent; + + +/***/ }), +/* 166 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var navigation_action_enum_1 = __webpack_require__(340); +var kendo_date_math_1 = __webpack_require__(19); +var KEY_TO_ACTION = { + '33': navigation_action_enum_1.Action.PrevView, + '34': navigation_action_enum_1.Action.NextView, + '35': navigation_action_enum_1.Action.LastInView, + '36': navigation_action_enum_1.Action.FirstInView, + '37': navigation_action_enum_1.Action.Left, + '38': navigation_action_enum_1.Action.Up, + '39': navigation_action_enum_1.Action.Right, + '40': navigation_action_enum_1.Action.Down, + 'meta+38': navigation_action_enum_1.Action.PrevView, + 'meta+40': navigation_action_enum_1.Action.NextView +}; +//Month specific modifiers +var ACTIONS = (_a = {}, + _a[navigation_action_enum_1.Action.Left] = function (date) { return kendo_date_math_1.addDays(date, -1); }, + _a[navigation_action_enum_1.Action.Up] = function (date) { return kendo_date_math_1.addWeeks(date, -1); }, + _a[navigation_action_enum_1.Action.Right] = function (date) { return kendo_date_math_1.addDays(date, 1); }, + _a[navigation_action_enum_1.Action.Down] = function (date) { return kendo_date_math_1.addWeeks(date, 1); }, + _a[navigation_action_enum_1.Action.PrevView] = function (date) { return kendo_date_math_1.addMonths(date, -1); }, + _a[navigation_action_enum_1.Action.NextView] = function (date) { return kendo_date_math_1.addMonths(date, 1); }, + _a[navigation_action_enum_1.Action.FirstInView] = function (date) { return kendo_date_math_1.firstDayOfMonth(date); }, + _a[navigation_action_enum_1.Action.LastInView] = function (date) { return kendo_date_math_1.lastDayOfMonth(date); }, + _a); +/** + * @hidden + */ +var NavigationService = (function () { + function NavigationService() { + } + NavigationService.prototype.action = function (event) { + var action = "" + (event.ctrlKey || event.metaKey ? 'meta+' : '') + event.keyCode; + return KEY_TO_ACTION[action]; + }; + NavigationService.prototype.move = function (candidate, action) { + var modifier = ACTIONS[action]; + if (!modifier) { + return candidate; + } + return modifier(candidate); + }; + return NavigationService; +}()); +NavigationService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +NavigationService.ctorParameters = function () { return []; }; +exports.NavigationService = NavigationService; +var _a; + + +/***/ }), +/* 167 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var cell_template_directive_1 = __webpack_require__(98); +var COMPONENT_DIRECTIVES = [ + cell_template_directive_1.CellTemplateDirective +]; +/** + * @hidden + * + * The exported package module. + * + * The package exports: + * - `CellTemplateDirective`—The cell template directive. + */ +var TemplatesModule = (function () { + function TemplatesModule() { + } + return TemplatesModule; +}()); +TemplatesModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [COMPONENT_DIRECTIVES], + exports: [COMPONENT_DIRECTIVES] + },] }, +]; +/** @nocollapse */ +TemplatesModule.ctorParameters = function () { return []; }; +exports.TemplatesModule = TemplatesModule; + + +/***/ }), +/* 168 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var min_validator_1 = __webpack_require__(102); +var max_validator_1 = __webpack_require__(101); +var keys_enum_1 = __webpack_require__(346); +var forms_1 = __webpack_require__(12); +var kendo_angular_l10n_1 = __webpack_require__(2); +var kendo_angular_intl_1 = __webpack_require__(10); +var kendo_date_math_1 = __webpack_require__(19); +var util_1 = __webpack_require__(18); +var arrow_enum_1 = __webpack_require__(345); +var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-min'; +var MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DateInputComponent/#toc-max'; +var time = function (date) { return date ? date.getTime() : null; }; +var padZero = function (length) { return new Array(Math.max(length, 0)).fill('0').join(''); }; +var Mask = (function () { + function Mask() { + this.symbols = ""; + } + return Mask; +}()); +var KendoDate = (function () { + function KendoDate(intl, format, value) { + this.year = true; + this.month = true; + this.date = true; + this.hours = true; + this.minutes = true; + this.seconds = true; + this.milliseconds = true; + this.value = kendo_date_math_1.getDate(new Date()); + this.format = ""; + this.typedMonthPart = ""; + this.monthNames = null; + this.knownParts = "adHhmMsEy"; + this.symbols = { + "E": "E", + "H": "H", + "M": "M", + "a": "a", + "d": "d", + "h": "h", + "m": "m", + "s": "s", + "y": "y" + }; + this.intl = intl; + this.format = format; + this.monthNames = this.allFormatedMonths(); + if (!value) { + this.value = kendo_date_math_1.getDate(new Date()); + var sampleFormat = this.dateFormatString(this.value, this.format).symbols; + for (var i = 0; i < sampleFormat.length; i++) { + this.setExisting(sampleFormat[i], false); + } + } + else { + this.value = kendo_date_math_1.cloneDate(value); + } + } + KendoDate.prototype.getDateObject = function () { + for (var i = 0; i < this.knownParts.length; i++) { + if (!this.getExisting(this.knownParts[i])) { + return null; + } + } + return kendo_date_math_1.cloneDate(this.value); + }; + KendoDate.prototype.getTextAndFormat = function () { + return this.merge(this.intl.formatDate(this.value, this.format), this.dateFormatString(this.value, this.format)); + }; + KendoDate.prototype.setExisting = function (symbol, value) { + switch (symbol) { + case "y": + this.year = value; + if (value === false) { + this.value.setFullYear(2000); + } + break; //allow 2/29 dates + case "M": + this.month = value; + if (value === false) { + this.value.setMonth(0); + } + break; //make sure you can type 31 at day part + case "d": + this.date = value; + break; + case "h": + case "H": + this.hours = value; + break; + case "m": + this.minutes = value; + break; + case "s": + this.seconds = value; + break; + default: return; + } + }; + KendoDate.prototype.modifyPart = function (symbol, offset) { + var newValue = kendo_date_math_1.cloneDate(this.value); + switch (symbol) { + case "y": + newValue.setFullYear(newValue.getFullYear() + offset); + break; + case "M": + newValue = kendo_date_math_1.addMonths(this.value, offset); + break; + case "d": + case "E": + newValue.setDate(newValue.getDate() + offset); + break; + case "h": + case "H": + newValue.setHours(newValue.getHours() + offset); + break; + case "m": + newValue.setMinutes(newValue.getMinutes() + offset); + break; + case "s": + newValue.setSeconds(newValue.getSeconds() + offset); + break; + case "a": + newValue.setHours(newValue.getHours() + (12 * offset)); + break; + default: break; + } + if (newValue.getFullYear() > 0) { + this.setExisting(symbol, true); + this.value = newValue; + } + }; + KendoDate.prototype.parsePart = function (symbol, currentChar, resetSegmentValue) { + if (!currentChar) { + this.setExisting(symbol, false); + return { value: null, switchToNext: false }; + } + var baseDate = this.intl.formatDate(this.value, this.format); + var dateParts = this.dateFormatString(this.value, this.format); + var baseFormat = dateParts.symbols; + var replaced = false; + var prefix = ""; + var current = ""; + var suffix = ""; + for (var i = 0; i < baseDate.length; i++) { + if (baseFormat[i] === symbol) { + current += this.getExisting(symbol) ? baseDate[i] : "0"; + replaced = true; + } + else if (!replaced) { + prefix += baseDate[i]; + } + else { + suffix += baseDate[i]; + } + } + var currentMaxLength = current.length - 3; + var parsedDate = null; + var month = this.matchMonth(currentChar); + for (var i = Math.max(0, currentMaxLength); i <= current.length; i++) { + var middle = resetSegmentValue ? currentChar : (current.substring(i) + currentChar); + var middleNumber = parseInt(middle, 10); + parsedDate = this.intl.parseDate(prefix + middle + suffix, this.format); + if (!parsedDate && !isNaN(middleNumber) && !isNaN(parseInt(currentChar, 10))) { + if (symbol === 'M' && !month) { + var monthNumber = middleNumber - 1; + if (monthNumber > -1 && monthNumber < 12) { + parsedDate = kendo_date_math_1.cloneDate(this.value); + parsedDate.setMonth(monthNumber); + if (parsedDate.getMonth() !== monthNumber) { + parsedDate = kendo_date_math_1.lastDayOfMonth(kendo_date_math_1.addMonths(parsedDate, -1)); + } + } + } + if (symbol === 'y') { + parsedDate = kendo_date_math_1.createDate(parseInt(middle, 10), this.month ? this.value.getMonth() : 0, this.date ? this.value.getDate() : 1, this.hours ? this.value.getHours() : 0, this.minutes ? this.value.getMinutes() : 0, this.seconds ? this.value.getSeconds() : 0, this.milliseconds ? this.value.getMilliseconds() : 0); + if (parsedDate.getDate() !== this.value.getDate()) { + parsedDate = kendo_date_math_1.lastDayOfMonth(kendo_date_math_1.addMonths(parsedDate, -1)); + } + } + } + if (parsedDate) { + //move to next segment if the part will overflow with next char + //when start from empty date (01, then 010), padded zeros should be trimmed + var pattern = this.partPattern(dateParts.partMap, symbol); + var peekDate = this.intl.parseDate("" + prefix + this.peek(middle, pattern) + suffix, this.format); + this.value = parsedDate; + this.setExisting(symbol, true); + return { value: this.value, switchToNext: peekDate === null }; + } + } + if (month) { + parsedDate = this.intl.parseDate(prefix + month + suffix, this.format); + if (parsedDate) { + this.value = parsedDate; + this.setExisting(symbol, true); + return { value: this.value, switchToNext: false }; + } + } + if (currentChar === "0") { + this.setExisting(symbol, false); + } + return { value: null, switchToNext: false }; + }; + KendoDate.prototype.partPattern = function (parts, symbol) { + return parts.filter(function (part) { return part.pattern.indexOf(symbol) !== -1; })[0].pattern; + }; + KendoDate.prototype.peek = function (value, pattern) { + var peekValue = value.replace(/^0*/, '') + '0'; + return padZero(pattern.length - peekValue.length) + peekValue; + }; + KendoDate.prototype.matchMonth = function (typedChar) { + this.typedMonthPart += typedChar.toLowerCase(); + if (!this.monthNames) { + return ""; + } + while (this.typedMonthPart.length > 0) { + for (var i = 0; i < this.monthNames.length; i++) { + if (this.monthNames[i].toLowerCase().indexOf(this.typedMonthPart) === 0) { + return this.monthNames[i]; + } + } + var monthAsNum = parseInt(this.typedMonthPart, 10); + if (monthAsNum >= 1 && monthAsNum <= 12 && monthAsNum.toString() === this.typedMonthPart /*ensure they exact match*/) { + return this.monthNames[monthAsNum - 1]; + } + this.typedMonthPart = this.typedMonthPart.substring(1, this.typedMonthPart.length); + } + return ""; + }; + KendoDate.prototype.allFormatedMonths = function () { + var dateFormatParts = this.intl.splitDateFormat(this.format); + for (var i = 0; i < dateFormatParts.length; i++) { + if (dateFormatParts[i].type === "month" && dateFormatParts[i].names) { + return this.intl.dateFormatNames(dateFormatParts[i].names); + } + } + return null; + }; + //TODO: REMOVE! + KendoDate.prototype.dateFormatString = function (date, format) { + var dateFormatParts = this.intl.splitDateFormat(format); + var parts = []; + var partMap = []; + for (var i = 0; i < dateFormatParts.length; i++) { + var partLength = this.intl.formatDate(date, { pattern: dateFormatParts[i].pattern }).length; + while (partLength > 0) { + parts.push(this.symbols[dateFormatParts[i].pattern[0]] || "_"); + partMap.push(dateFormatParts[i]); + partLength--; + } + } + var returnValue = new Mask(); + returnValue.symbols = parts.join(""); + returnValue.partMap = partMap; + return returnValue; + }; + KendoDate.prototype.merge = function (text, mask) { + // Important: right to left. + var resultText = ""; + var resultFormat = ""; + var format = mask.symbols; + for (var r = format.length - 1; r >= 0; r--) { + if (this.knownParts.indexOf(format[r]) === -1 + || this.getExisting(format[r])) { + resultText = text[r] + resultText; + resultFormat = format[r] + resultFormat; + } + else { + var currentSymbol = format[r]; + while (r >= 0 && currentSymbol === format[r]) { + r--; + } + r++; + resultText = this.intl.dateFieldName(mask.partMap[r]) + resultText; + while (resultFormat.length < resultText.length) { + resultFormat = format[r] + resultFormat; + } + } + } + return [resultText, resultFormat]; + }; + KendoDate.prototype.getExisting = function (symbol) { + switch (symbol) { + case "y": return this.year; + case "M": + case "L": return this.month; + case "d": return this.date; + case "E": return this.date && this.month && this.year; + case "h": + case "H": return this.hours; + case "m": return this.minutes; + case "s": return this.seconds; + default: return true; + } + }; + return KendoDate; +}()); +/** + * Represents the Kendo UI DateInput component for Angular. + */ +var DateInputComponent = (function () { + function DateInputComponent(intl, renderer, localization) { + this.intl = intl; + this.renderer = renderer; + this.localization = localization; + /** + * Sets or gets the `disabled` property of the DateInput and determines whether the component is active. + */ + this.disabled = false; + /** + * Sets the title of the input element of the DateInput. + */ + this.title = ""; + /** + * Sets or gets the `tabIndex` property of the DateInput. + * . + */ + this.tabIndex = 0; + /** + * Specifies the date format used to display the input value. + */ + this.format = "d"; + /** + * Determines whether the built-in min or max validators are enforced when validating a form. + */ + this.rangeValidation = true; + /** + * @hidden + * Based on the min and max values, specifies whether the value will be auto-corrected while typing. + */ + this.autoCorrect = false; + /** + * Specifies whether the **Up** and **Down** spin buttons will be rendered. + */ + this.spinners = false; + /** + * @hidden + */ + this.isPopupOpen = false; + /** + * @hidden + */ + this.hasPopup = false; + /** + * Fires each time the user selects a new value. + */ + this.valueChange = new core_1.EventEmitter(); + /** + * Fires each time the user focuses the input element. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * ` + * }) + * class AppComponent { + * public handleFocus(): void { + * console.log("Component is focused"); + * } + * } + * ``` + * + * > To wire the event programmatically, use the `onFocus` property. + */ + this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * Fires each time the input element gets blurred. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * ` + * }) + * class AppComponent { + * public handleBlur(): void { + * console.log("Component is blurred"); + * } + * } + * ``` + * + * > To wire the event programmatically, use the `onBlur` property. + */ + this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + this.arrow = arrow_enum_1.Arrow; + this.arrowDirection = arrow_enum_1.Arrow.None; + this.isActive = false; + this.currentValue = ""; + this.currentFormat = ""; + this.backspace = false; + this.resetSegmentValue = true; + this.resolvedPromise = Promise.resolve(null); + this.minValidateFn = util_1.noop; + this.maxValidateFn = util_1.noop; + this._value = null; + this.kendoDate = null; + this.ngChange = function (_) { }; + this.ngTouched = function () { }; + } + Object.defineProperty(DateInputComponent.prototype, "max", { + get: function () { + return this._max; + }, + /** + * Specifies the biggest date that is valid. + */ + set: function (max) { + this._max = max; + this.ariaValueMax = time(max); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateInputComponent.prototype, "min", { + get: function () { + return this._min; + }, + /** + * Specifies the smallest date that is valid. + */ + set: function (min) { + this._min = min; + this.ariaValueMin = time(min); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateInputComponent.prototype, "value", { + get: function () { + return this._value; + }, + /** + * Specifies the value of the DateInput component. + */ + set: function (value) { + if (this.autoCorrect && !util_1.isInRange(value, this.min, this.max)) { + return; + } + this._value = kendo_date_math_1.cloneDate(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateInputComponent.prototype, "wrapperClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DateInputComponent.prototype, "disabledClass", { + get: function () { + return this.disabled; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + DateInputComponent.prototype.mousescroll = function (event) { + this.handleMouseWheel(event); + }; + /** + * @hidden + */ + DateInputComponent.prototype.handlePaste = function (event) { + event.preventDefault(); + }; + /** + * @hidden + */ + DateInputComponent.prototype.keydown = function (event) { + if (this.disabled || event.altKey || event.ctrlKey || event.metaKey) { + return; + } + if (event.keyCode === keys_enum_1.Keys.tab) { + var moved = this.switchDateSegment(event.shiftKey ? -1 : 1); + if (moved) { + event.preventDefault(); + } + return; + } + if (event.keyCode === keys_enum_1.Keys.backspace) { + this.backspace = true; + return; + } + switch (event.keyCode) { + case keys_enum_1.Keys.down: + this.modifyDateSegmentValue(-1); + break; + case keys_enum_1.Keys.up: + this.modifyDateSegmentValue(1); + break; + case keys_enum_1.Keys.right: + this.switchDateSegment(1); + break; + case keys_enum_1.Keys.left: + this.switchDateSegment(-1); + break; + case keys_enum_1.Keys.home: + this.selectNearestSegment(0); + break; + case keys_enum_1.Keys.end: + this.selectNearestSegment(this.dateInput.nativeElement.value.length); + break; + default: + return; //skip the preventDefault if we didn't handled the keyCode + } + event.preventDefault(); + }; + /** + * @hidden + */ + DateInputComponent.prototype.handleInput = function () { + if (this.disabled) { + return; + } + var diff = util_1.approximateStringMatching(this.currentValue, this.currentFormat, this.dateInput.nativeElement.value, this.caret()[0]); + var navigationOnly = (diff.length === 1 && diff[0][1] === "_"); + var switchPart = false; + if (!navigationOnly) { + var parsedPart = void 0; + for (var i = 0; i < diff.length; i++) { + parsedPart = this.kendoDate.parsePart(diff[i][0], diff[i][1], this.resetSegmentValue); + switchPart = parsedPart.switchToNext; + } + } + this.resetSegmentValue = false; + this.putDateInRange(); + this.updateElementValue(); + this.triggerChange(); + if (diff.length && diff[0][0] !== "_") { + this.selectDateSegment(diff[0][0]); + } + if (switchPart || navigationOnly) { + this.switchDateSegment(1); + } + if (this.backspace) { + this.switchDateSegment(-1); + } + this.backspace = false; + }; + /** + * @hidden + */ + DateInputComponent.prototype.ngOnChanges = function (changes) { + var _this = this; + this.verifySettings(); + if (this.hasChanged(changes, 'min') || this.hasChanged(changes, 'max')) { + this.minValidateFn = this.rangeValidation ? min_validator_1.minValidator(this.min) : util_1.noop; + this.maxValidateFn = this.rangeValidation ? max_validator_1.maxValidator(this.max) : util_1.noop; + if (!changes.value) { + this.resolvedPromise.then(function () { return _this.ngChange(kendo_date_math_1.cloneDate(_this.value)); }); + } + } + if (this.kendoDate && !kendo_date_math_1.isEqual(this.value, this.kendoDate.getDateObject())) { + this.writeValue(this.value); + } + }; + /** + * @hidden + */ + DateInputComponent.prototype.validate = function (control) { + return this.minValidateFn(control) || this.maxValidateFn(control); + }; + /** + * @hidden + */ + DateInputComponent.prototype.ngOnInit = function () { + this.kendoDate = new KendoDate(this.intl, this.format, this.value); + this.updateElementValue(); + }; + /** + * @hidden + */ + DateInputComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + //ngModel binding + /** + * @hidden + */ + DateInputComponent.prototype.writeValue = function (value) { + this.value = kendo_date_math_1.cloneDate(value); + this.kendoDate = new KendoDate(this.intl, this.format, kendo_date_math_1.cloneDate(this.value)); + this.updateElementValue(); + }; + /** + * @hidden + */ + DateInputComponent.prototype.triggerChange = function () { + var dateObject = this.kendoDate.getDateObject(); + if (+dateObject !== +this.value) { + this.value = kendo_date_math_1.cloneDate(dateObject); + this.valueChange.emit(kendo_date_math_1.cloneDate(this.value)); + this.ngChange(kendo_date_math_1.cloneDate(this.value)); + } + }; + /** + * @hidden + */ + DateInputComponent.prototype.registerOnChange = function (fn) { + this.ngChange = fn; + }; + /** + * @hidden + */ + DateInputComponent.prototype.registerOnTouched = function (fn) { + this.ngTouched = fn; + }; + /** + * Focuses the DateInput component. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * class AppComponent { } + * ``` + */ + DateInputComponent.prototype.focus = function () { + if (!this.dateInput) { + return; + } + this.dateInput.nativeElement.focus(); + this.selectDateSegment(this.currentFormat[0]); + }; + /** + * Blurs the DateInput component. + */ + DateInputComponent.prototype.blur = function () { + if (!this.dateInput) { + return; + } + this.dateInput.nativeElement.blur(); + }; + /** + * @hidden + */ + DateInputComponent.prototype.handleButtonClick = function (offset) { + this.arrowDirection = arrow_enum_1.Arrow.None; + this.modifyDateSegmentValue(offset); + }; + /** + * @hidden + */ + DateInputComponent.prototype.modifyDateSegmentValue = function (offset) { + var caret = this.caret(); + var symbol = this.currentFormat[caret[0]]; + this.kendoDate.modifyPart(symbol, offset); + this.putDateInRange(); + this.updateElementValue(); + this.triggerChange(); + this.selectDateSegment(symbol); + }; + /** + * @hidden + */ + DateInputComponent.prototype.switchDateSegment = function (offset) { + var caret = this.caret(); + if (caret[0] < caret[1] && this.currentFormat[caret[0]] !== this.currentFormat[caret[1] - 1]) { + this.selectNearestSegment(offset > 0 ? caret[0] : caret[1] - 1); + this.resetSegmentValue = true; + return true; + } + var previousFormatSymbol = this.currentFormat[caret[0]]; + var a = caret[0] + offset; + while (a > 0 && a < this.currentFormat.length) { + if (this.currentFormat[a] !== previousFormatSymbol && + this.currentFormat[a] !== "_") { + break; + } + a += offset; + } + if (this.currentFormat[a] === "_") { + //there is not known symbol found + return false; + } + var b = a; + while (b >= 0 && b < this.currentFormat.length) { + if (this.currentFormat[b] !== this.currentFormat[a]) { + break; + } + b += offset; + } + if (a > b && (b + 1 !== caret[0] || a + 1 !== caret[1])) { + this.caret(b + 1, a + 1); + this.resetSegmentValue = true; + return true; + } + else if (a < b && (a !== caret[0] || b !== caret[1])) { + this.caret(a, b); + this.resetSegmentValue = true; + return true; + } + return false; + }; + /** + * @hidden + */ + DateInputComponent.prototype.selectDateSegment = function (symbol) { + var begin = -1; + var end = 0; + for (var i = 0; i < this.currentFormat.length; i++) { + if (this.currentFormat[i] === symbol) { + end = i + 1; + if (begin === -1) { + begin = i; + } + } + } + if (begin < 0) { + begin = 0; + } + this.caret(0, 0); + this.caret(begin, end); + }; + /** + * @hidden + */ + DateInputComponent.prototype.handleClick = function () { + this.selectNearestSegment(this.caret()[0]); + }; + /** + * @hidden + */ + DateInputComponent.prototype.handleFocus = function () { + this.isActive = true; + this.onFocus.emit(); + }; + /** + * @hidden + */ + DateInputComponent.prototype.handleBlur = function () { + this.isActive = false; + this.ngTouched(); + this.onBlur.emit(); + }; + DateInputComponent.prototype.handleMouseWheel = function (event) { + if (this.disabled || !this.isActive) { + return; + } + event = window.event || event; + if (event.shiftKey) { + this.switchDateSegment((event.wheelDelta || -event.detail) > 0 ? -1 : 1); + } + else { + this.modifyDateSegmentValue((event.wheelDelta || -event.detail) > 0 ? 1 : -1); + } + event.returnValue = false; + if (event.preventDefault) { + event.preventDefault(); + } + if (event.stopPropagation) { + event.stopPropagation(); + } + }; + DateInputComponent.prototype.updateElementValue = function () { + var texts = this.kendoDate.getTextAndFormat(); + var start = this.caret()[0]; + this.currentValue = texts[0]; + this.currentFormat = texts[1]; + this.renderer.setProperty(this.dateInput.nativeElement, "value", this.currentValue); + if (this.isActive) { + this.selectNearestSegment(start); + } + var currentDate = this.kendoDate.getDateObject(); + this.ariaValueNow = time(currentDate); + this.ariaValueText = this.intl.formatDate(currentDate, this.format); + }; + DateInputComponent.prototype.hasChanged = function (changes, field) { + var change = changes[field]; + return change && !kendo_date_math_1.isEqual(change.previousValue, change.currentValue); + }; + DateInputComponent.prototype.caret = function (start, end) { + if (end === void 0) { end = start; } + var isPosition = start !== undefined; + var returnValue = [start, start]; + var element = this.dateInput.nativeElement; + if (isPosition && this.disabled) { + return undefined; + } + try { + if (element.selectionStart !== undefined) { + if (isPosition) { + element.focus(); + element.setSelectionRange(start, end); + } + returnValue = [element.selectionStart, element.selectionEnd]; + } + } + catch (e) { + returnValue = []; + } + return returnValue; + }; + DateInputComponent.prototype.selectNearestSegment = function (index) { + // Finds the nearest (in both directions) known part. + for (var i = index, j = index - 1; i < this.currentFormat.length || j >= 0; i++, j--) { + if (i < this.currentFormat.length && this.currentFormat[i] !== "_") { + this.selectDateSegment(this.currentFormat[i]); + return; + } + if (j >= 0 && this.currentFormat[j] !== "_") { + this.selectDateSegment(this.currentFormat[j]); + return; + } + } + }; + DateInputComponent.prototype.verifySettings = function () { + if (!core_1.isDevMode()) { + return; + } + if (!util_1.isValidRange(this.min, this.max)) { + throw new Error("The max value should be bigger than the min. See " + MIN_DOC_LINK + " and " + MAX_DOC_LINK + "."); + } + }; + DateInputComponent.prototype.putDateInRange = function () { + var currentDate = this.kendoDate.getDateObject(); + var candidate = util_1.dateInRange(currentDate, this.min, this.max); + if (this.autoCorrect && !kendo_date_math_1.isEqual(currentDate, candidate)) { + this.kendoDate = new KendoDate(this.intl, this.format, candidate); + } + }; + return DateInputComponent; +}()); +DateInputComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendo-dateinput', + providers: [ + { provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(function () { return DateInputComponent; }), multi: true }, + { provide: forms_1.NG_VALIDATORS, useExisting: core_1.forwardRef(function () { return DateInputComponent; }), multi: true }, + { provide: kendo_angular_l10n_1.L10N_PREFIX, useValue: 'kendo.dateinput' }, + kendo_angular_l10n_1.LocalizationService + ], + selector: 'kendo-dateinput', + template: "\n \n \n \n \n \n \n \n \n \n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +DateInputComponent.ctorParameters = function () { return [ + { type: kendo_angular_intl_1.IntlService, }, + { type: core_1.Renderer2, }, + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +DateInputComponent.propDecorators = { + 'disabled': [{ type: core_1.Input },], + 'title': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'format': [{ type: core_1.Input },], + 'max': [{ type: core_1.Input },], + 'min': [{ type: core_1.Input },], + 'rangeValidation': [{ type: core_1.Input },], + 'autoCorrect': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'spinners': [{ type: core_1.Input },], + 'isPopupOpen': [{ type: core_1.Input },], + 'hasPopup': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'onFocus': [{ type: core_1.Output, args: ['focus',] },], + 'onBlur': [{ type: core_1.Output, args: ['blur',] },], + 'dateInput': [{ type: core_1.ViewChild, args: ['dateInput',] },], + 'wrapperClass': [{ type: core_1.HostBinding, args: ['class.k-widget',] }, { type: core_1.HostBinding, args: ['class.k-dateinput',] },], + 'disabledClass': [{ type: core_1.HostBinding, args: ['class.k-state-disabled',] },], + 'mousescroll': [{ type: core_1.HostListener, args: ['mousewheel', ['$event'],] }, { type: core_1.HostListener, args: ['onmousewheel', ['$event'],] }, { type: core_1.HostListener, args: ['DOMMouseScroll', ['$event'],] },], + 'handlePaste': [{ type: core_1.HostListener, args: ['paste', ['$event'],] },], + 'keydown': [{ type: core_1.HostListener, args: ['keydown', ['$event'],] },], + 'handleInput': [{ type: core_1.HostListener, args: ['input',] },], +}; +exports.DateInputComponent = DateInputComponent; + + +/***/ }), +/* 169 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +var messages_1 = __webpack_require__(170); +/** + * Custom component messages override default component messages. + */ +var DateInputCustomMessagesComponent = (function (_super) { + __extends(DateInputCustomMessagesComponent, _super); + function DateInputCustomMessagesComponent(service) { + var _this = _super.call(this) || this; + _this.service = service; + return _this; + } + Object.defineProperty(DateInputCustomMessagesComponent.prototype, "override", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + return DateInputCustomMessagesComponent; +}(messages_1.Messages)); +DateInputCustomMessagesComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: messages_1.Messages, + useExisting: core_1.forwardRef(function () { return DateInputCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-dateinput-messages', + template: "" + },] }, +]; +/** @nocollapse */ +DateInputCustomMessagesComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.DateInputCustomMessagesComponent = DateInputCustomMessagesComponent; + + +/***/ }), +/* 170 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * @hidden + */ +var Messages = (function (_super) { + __extends(Messages, _super); + function Messages() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Messages; +}(kendo_angular_l10n_1.ComponentMessages)); +Messages.propDecorators = { + 'decrement': [{ type: core_1.Input },], + 'increment': [{ type: core_1.Input },], +}; +exports.Messages = Messages; + + +/***/ }), +/* 171 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +var kendo_angular_l10n_1 = __webpack_require__(2); +var kendo_angular_popup_1 = __webpack_require__(28); +var kendo_date_math_1 = __webpack_require__(19); +var defaults_1 = __webpack_require__(52); +var min_validator_1 = __webpack_require__(102); +var max_validator_1 = __webpack_require__(101); +var preventable_event_1 = __webpack_require__(176); +var cell_template_directive_1 = __webpack_require__(98); +var util_1 = __webpack_require__(18); +var MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DatePickerComponent/#toc-min'; +var MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/dateinputs/api/DatePickerComponent/#toc-max'; +/** + * Represents the Kendo UI DatePicker component for Angular. + */ +var DatePickerComponent = (function () { + // + function DatePickerComponent(zone, localization, popupService, rtl) { + this.zone = zone; + this.localization = localization; + this.popupService = popupService; + this.rtl = rtl; + /** + * Sets or gets the `disabled` property of the Calendar and determines whether the component is active. + */ + this.disabled = false; + /** + * Specifies the smallest valid date. + */ + this.min = kendo_date_math_1.cloneDate(defaults_1.MIN_DATE); + /** + * Specifies the biggest valid date. + */ + this.max = kendo_date_math_1.cloneDate(defaults_1.MAX_DATE); + /** + * Specifies the focused date of the Calendar component. + */ + this.focusedDate = null; + /** + * Specifies the value of the DatePicker component. + */ + this.value = null; + /** + * Specifies the date format used to display the input value. + */ + this.format = "d"; + /** + * Sets or gets the `tabIndex` property of the DatePicker. + */ + this.tabIndex = 0; + /** + * Sets the title of the input element of the DatePicker. + */ + this.title = ""; + /** + * Determines whether the built-in min or max validators are enforced when validating a form. + */ + this.rangeValidation = true; + /** + * Fires each time the user selects a new value. + */ + this.valueChange = new core_1.EventEmitter(); + /** + * Fires each time the user focuses the input element. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * ` + * }) + * class AppComponent { + * public handleFocus(): void { + * console.log("Component is focused"); + * } + * } + * ``` + * + * > To wire the event programmatically, use the `onFocus` property. + */ + this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * Fires each time the input element gets blurred. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * ` + * }) + * class AppComponent { + * public handleBlur(): void { + * console.log("Component is blurred"); + * } + * } + * ``` + * + * > To wire the event programmatically, use the `onBlur` property. + */ + this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * Fires each time the popup is about to open. + * This event is preventable. If you cancel the event, the popup will remain closed. + */ + this.open = new core_1.EventEmitter(); + /** + * Fires each time the popup is about to close. + * This event is preventable. If you cancel the event, the popup will remain opened. + */ + this.close = new core_1.EventEmitter(); + this.isActive = false; + this.popupUID = util_1.guid(); + this._popupSettings = { animate: true }; + this._show = false; + this.onChange = util_1.noop; + this.onTouched = util_1.noop; + this.minValidateFn = util_1.noop; + this.maxValidateFn = util_1.noop; + } + Object.defineProperty(DatePickerComponent.prototype, "popupSettings", { + get: function () { + return this._popupSettings; + }, + /** + * Configures the popup of the DatePicker. + * + * The available options are: + * - `animation: Boolean`—Controls the popup animation. By default, the open and close animations are enabled. + * - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup. + */ + set: function (settings) { + this._popupSettings = Object.assign({}, { animate: true }, settings); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DatePickerComponent.prototype, "show", { + get: function () { + return this._show; + }, + set: function (show) { + var event = new preventable_event_1.PreventableEvent(); + if (!this._show && show) { + this.open.emit(event); + } + else if (this._show && !show) { + this.close.emit(event); + } + if (event.isDefaultPrevented()) { + return; + } + this._toggle(show); + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + DatePickerComponent.prototype.wrapperClasses = function () { + return true; + }; + /** + * @hidden + */ + DatePickerComponent.prototype.handleKeydown = function (event) { + var altKey = event.altKey, keyCode = event.keyCode; + if (keyCode === 27) { + this.show = false; + } + if (altKey) { + if (keyCode === 40) { + this.show = true; + } + if (keyCode === 38) { + this.show = false; + } + } + }; + /** + * @hidden + */ + DatePickerComponent.prototype.ngOnChanges = function (changes) { + this.verifySettings(); + if (changes.min || changes.max) { + this.minValidateFn = this.rangeValidation ? min_validator_1.minValidator(this.min) : util_1.noop; + this.maxValidateFn = this.rangeValidation ? max_validator_1.maxValidator(this.max) : util_1.noop; + } + }; + /** + * @hidden + */ + DatePickerComponent.prototype.ngOnDestroy = function () { + this.show = false; + }; + Object.defineProperty(DatePickerComponent.prototype, "isOpen", { + /** + * Returns the current open state of the popup. + */ + get: function () { + return this.show; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + DatePickerComponent.prototype.writeValue = function (value) { + this.value = kendo_date_math_1.cloneDate(value); + }; + /** + * @hidden + */ + DatePickerComponent.prototype.registerOnChange = function (fn) { + this.onChange = fn; + }; + /** + * @hidden + */ + DatePickerComponent.prototype.registerOnTouched = function (fn) { + this.onTouched = fn; + }; + /** + * @hidden + */ + DatePickerComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + /** + * @hidden + */ + DatePickerComponent.prototype.validate = function (control) { + return this.minValidateFn(control) || this.maxValidateFn(control); + }; + /** + * Focuses the DatePicker component. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * class AppComponent { } + * ``` + */ + DatePickerComponent.prototype.focus = function () { + this.input.focus(); + }; + /** + * Blurs the DatePicker component. + */ + DatePickerComponent.prototype.blur = function () { + (this.calendar || this.input)['blur'](); //tslint:disable-line:no-string-literal + }; + /** + * Toggles the visibility of the popup. If you use the `toggle` method to show or hide the popup, + * the `open` and `close` events are not fired. + * + * @param show - The state of the popup. + */ + DatePickerComponent.prototype.toggle = function (show) { + var _this = this; + if (this.disabled) { + return; + } + Promise.resolve(null).then(function () { + _this._toggle((show === undefined) ? !_this.show : show); + }); + }; + /** + * @hidden + */ + DatePickerComponent.prototype.handleIconClick = function () { + this.input.focus(); + this.show = !this.show; + }; + /** + * @hidden + */ + DatePickerComponent.prototype.handleChange = function (value) { + this.value = value; + this.input.focus(); + this.show = false; + this.valueChange.emit(kendo_date_math_1.cloneDate(value)); + this.onChange(kendo_date_math_1.cloneDate(value)); + }; + /** + * @hidden + */ + DatePickerComponent.prototype.handleFocus = function () { + var _this = this; + if (this.isActive) { + return; + } + this.isActive = true; + this.nextTick(function () { + if (!_this.hasActiveComponent()) { + return; + } + _this.onFocus.emit(); + }); + }; + /** + * @hidden + */ + DatePickerComponent.prototype.handleBlur = function () { + var _this = this; + this.nextTick(function () { + if (_this.hasActiveComponent()) { + return; + } + _this.isActive = false; + _this.show = false; + _this.onTouched(); + _this.onBlur.emit(); + }); + }; + Object.defineProperty(DatePickerComponent.prototype, "popupClasses", { + /** + * @hidden + */ + get: function () { + return [ + 'k-calendar-container', + 'k-group', + 'k-reset' + ].concat(this.popupSettings.popupClass || []); + }, + enumerable: true, + configurable: true + }); + DatePickerComponent.prototype._toggle = function (show) { + var _this = this; + this._show = show; + if (this.popupRef) { + this.popupRef.close(); + this.popupRef = null; + } + if (this._show) { + var direction = this.rtl ? 'right' : 'left'; + this.popupRef = this.popupService.open({ + anchor: this.wrapper, + anchorAlign: { vertical: 'bottom', horizontal: direction }, + animate: this.popupSettings.animate, + content: this.popupTemplate, + popupAlign: { vertical: 'top', horizontal: direction }, + popupClass: this.popupClasses + }); + this.popupRef.popupElement.setAttribute('id', this.popupUID); + this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.show = false; }); + this.popupRef.popupOpen.subscribe(function () { + if (_this.isActive && _this.calendar) { + _this.calendar.focus(); + } + }); + this.popupRef.popupClose.subscribe(function () { + if (_this.isActive) { + _this.input.focus(); + } + }); + } + }; + DatePickerComponent.prototype.hasActiveComponent = function () { + return this.input.isActive || (this.calendar && this.calendar.isActive); + }; + DatePickerComponent.prototype.verifySettings = function () { + if (!core_1.isDevMode()) { + return; + } + if (!util_1.isValidRange(this.min, this.max)) { + throw new Error("The max value should be bigger than the min. See " + MIN_DOC_LINK + " and " + MAX_DOC_LINK + "."); + } + }; + DatePickerComponent.prototype.nextTick = function (f) { + var _this = this; + this.zone.runOutsideAngular(function () { + //use setTimeout instead of resolved promise + //as the latter doesn't wait enough + setTimeout(function () { return _this.zone.run(f); }); + }); + }; + return DatePickerComponent; +}()); +DatePickerComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendo-datepicker', + providers: [ + { provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(function () { return DatePickerComponent; }), multi: true }, + { provide: forms_1.NG_VALIDATORS, useExisting: core_1.forwardRef(function () { return DatePickerComponent; }), multi: true }, + kendo_angular_l10n_1.LocalizationService, + { + provide: kendo_angular_l10n_1.L10N_PREFIX, + useValue: 'kendo.datepicker' + } + ], + selector: 'kendo-datepicker', + template: "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +DatePickerComponent.ctorParameters = function () { return [ + { type: core_1.NgZone, }, + { type: kendo_angular_l10n_1.LocalizationService, }, + { type: kendo_angular_popup_1.PopupService, }, + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, +]; }; +DatePickerComponent.propDecorators = { + 'calendar': [{ type: core_1.ViewChild, args: ['calendar',] },], + 'input': [{ type: core_1.ViewChild, args: ['input',] },], + 'popupTemplate': [{ type: core_1.ViewChild, args: ['popupTemplate',] },], + 'wrapper': [{ type: core_1.ViewChild, args: ['wrapper',] },], + 'cellTemplate': [{ type: core_1.ContentChild, args: [cell_template_directive_1.CellTemplateDirective,] },], + 'disabled': [{ type: core_1.Input },], + 'popupSettings': [{ type: core_1.Input },], + 'min': [{ type: core_1.Input },], + 'max': [{ type: core_1.Input },], + 'focusedDate': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'format': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'title': [{ type: core_1.Input },], + 'rangeValidation': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'onFocus': [{ type: core_1.Output, args: ['focus',] },], + 'onBlur': [{ type: core_1.Output, args: ['blur',] },], + 'open': [{ type: core_1.Output },], + 'close': [{ type: core_1.Output },], + 'wrapperClasses': [{ type: core_1.HostBinding, args: ['class.k-widget',] }, { type: core_1.HostBinding, args: ['class.k-datepicker',] }, { type: core_1.HostBinding, args: ['class.k-header',] },], + 'handleKeydown': [{ type: core_1.HostListener, args: ['keydown', ['$event'],] },], +}; +exports.DatePickerComponent = DatePickerComponent; + + +/***/ }), +/* 172 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var datepicker_component_1 = __webpack_require__(171); +var common_1 = __webpack_require__(9); +var kendo_angular_intl_1 = __webpack_require__(10); +var kendo_angular_popup_1 = __webpack_require__(28); +var calendar_module_1 = __webpack_require__(97); +var templates_module_1 = __webpack_require__(167); +var dateinput_module_1 = __webpack_require__(100); +var localized_messages_directive_1 = __webpack_require__(349); +var datepicker_custom_messages_component_1 = __webpack_require__(173); +var COMPONENT_DIRECTIVES = [ + datepicker_component_1.DatePickerComponent, + datepicker_custom_messages_component_1.DatePickerCustomMessagesComponent, + localized_messages_directive_1.LocalizedMessagesDirective +]; +var COMPONENT_MODULES = [ + dateinput_module_1.DateInputModule, + calendar_module_1.CalendarModule, + kendo_angular_intl_1.IntlModule, + kendo_angular_popup_1.PopupModule, + templates_module_1.TemplatesModule +]; +/** + * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) + * definition for the DatePicker component. + */ +var DatePickerModule = (function () { + function DatePickerModule() { + } + return DatePickerModule; +}()); +DatePickerModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [COMPONENT_DIRECTIVES], + exports: [COMPONENT_DIRECTIVES, templates_module_1.TemplatesModule], + imports: [common_1.CommonModule].concat(COMPONENT_MODULES) + },] }, +]; +/** @nocollapse */ +DatePickerModule.ctorParameters = function () { return []; }; +exports.DatePickerModule = DatePickerModule; + + +/***/ }), +/* 173 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +var messages_1 = __webpack_require__(174); +/** + * Custom component messages override default component messages. + */ +var DatePickerCustomMessagesComponent = (function (_super) { + __extends(DatePickerCustomMessagesComponent, _super); + function DatePickerCustomMessagesComponent(service) { + var _this = _super.call(this) || this; + _this.service = service; + return _this; + } + Object.defineProperty(DatePickerCustomMessagesComponent.prototype, "override", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + return DatePickerCustomMessagesComponent; +}(messages_1.Messages)); +DatePickerCustomMessagesComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: messages_1.Messages, + useExisting: core_1.forwardRef(function () { return DatePickerCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-datepicker-messages', + template: "" + },] }, +]; +/** @nocollapse */ +DatePickerCustomMessagesComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.DatePickerCustomMessagesComponent = DatePickerCustomMessagesComponent; + + +/***/ }), +/* 174 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * @hidden + */ +var Messages = (function (_super) { + __extends(Messages, _super); + function Messages() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Messages; +}(kendo_angular_l10n_1.ComponentMessages)); +Messages.propDecorators = { + 'today': [{ type: core_1.Input },], + 'toggle': [{ type: core_1.Input },], +}; +exports.Messages = Messages; + + +/***/ }), +/* 175 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var calendar_component_1 = __webpack_require__(161); +exports.CalendarComponent = calendar_component_1.CalendarComponent; +var dateinput_component_1 = __webpack_require__(168); +exports.DateInputComponent = dateinput_component_1.DateInputComponent; +var datepicker_component_1 = __webpack_require__(171); +exports.DatePickerComponent = datepicker_component_1.DatePickerComponent; +var calendar_module_1 = __webpack_require__(97); +exports.CalendarModule = calendar_module_1.CalendarModule; +var dateinput_module_1 = __webpack_require__(100); +exports.DateInputModule = dateinput_module_1.DateInputModule; +var datepicker_module_1 = __webpack_require__(172); +exports.DatePickerModule = datepicker_module_1.DatePickerModule; +var dateinputs_module_1 = __webpack_require__(348); +exports.DateInputsModule = dateinputs_module_1.DateInputsModule; +var calendar_custom_messages_component_1 = __webpack_require__(162); +exports.CalendarCustomMessagesComponent = calendar_custom_messages_component_1.CalendarCustomMessagesComponent; +var dateinput_custom_messages_component_1 = __webpack_require__(169); +exports.DateInputCustomMessagesComponent = dateinput_custom_messages_component_1.DateInputCustomMessagesComponent; +var datepicker_custom_messages_component_1 = __webpack_require__(173); +exports.DatePickerCustomMessagesComponent = datepicker_custom_messages_component_1.DatePickerCustomMessagesComponent; +var preventable_event_1 = __webpack_require__(176); +exports.PreventableEvent = preventable_event_1.PreventableEvent; + + +/***/ }), +/* 176 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * A preventable event instance triggered by the open and close events. + */ +var PreventableEvent = (function () { + function PreventableEvent() { + this.prevented = false; + } + /** + * Prevents the default action for a specified event. + * In this way, the source component suppresses the built-in behavior that follows the event. + */ + PreventableEvent.prototype.preventDefault = function () { + this.prevented = true; + }; + /** + * If the event is prevented by any of its subscribers, returns `true`. + * + * @returns `true` if the default action was prevented. Otherwise, returns `false`. + */ + PreventableEvent.prototype.isDefaultPrevented = function () { + return this.prevented; + }; + return PreventableEvent; +}()); +exports.PreventableEvent = PreventableEvent; + + +/***/ }), +/* 177 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/* tslint:disable:no-null-keyword */ +/* tslint:disable:max-line-length */ +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +var searchbar_component_1 = __webpack_require__(75); +var item_template_directive_1 = __webpack_require__(41); +var header_template_directive_1 = __webpack_require__(40); +var footer_template_directive_1 = __webpack_require__(39); +var selection_service_1 = __webpack_require__(37); +var navigation_service_1 = __webpack_require__(74); +var Observable_1 = __webpack_require__(1); +var util_1 = __webpack_require__(24); +var navigation_action_1 = __webpack_require__(54); +var no_data_template_directive_1 = __webpack_require__(56); +var keys_1 = __webpack_require__(36); +var preventable_event_1 = __webpack_require__(53); +var kendo_angular_l10n_1 = __webpack_require__(2); +var kendo_angular_popup_1 = __webpack_require__(28); +/** + * @hidden + */ +exports.AUTOCOMPLETE_VALUE_ACCESSOR = { + multi: true, + provide: forms_1.NG_VALUE_ACCESSOR, + // tslint:disable-next-line:no-use-before-declare + useExisting: core_1.forwardRef(function () { return AutoCompleteComponent; }) +}; +/** + * Represents the Kendo UI AutoComplete component for Angular. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * ` + * }) + * class AppComponent { + * public placeholder: string = 'Type "it" for suggestions'; + * public listItems: Array = ["Item 1", "Item 2", "Item 3", "Item 4"]; + * } + * ``` + */ +var AutoCompleteComponent = (function () { + function AutoCompleteComponent(rtl, popupService, selectionService, navigationService, wrapper) { + this.popupService = popupService; + this.selectionService = selectionService; + this.navigationService = navigationService; + /** + * The hint displayed when the component is empty. + * + */ + this.placeholder = ""; + /** + * @hidden + * + * Unless this options is set to `false`, a button will appear when hovering over the component. Clicking that button resets the component value to undefined and triggers the `change` event. + */ + this.clearButton = true; + /** + * Sets the disabled state of the component. + */ + this.disabled = false; + /** + * Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component. + */ + this.tabIndex = 0; + /** + * Enables the filter functionality. If set to `true`, the component emits the `filterChange` event. + */ + this.filterable = false; + /** + * Fires each time the value is changed. + * + * For more details, refer to the section on the [`valueChange`]({% slug overview_autocomplete_kendouiforangular %}#toc-on-value-change) event. + */ + this.valueChange = new core_1.EventEmitter(); + /** + * Fires each time the user types in the input. You can filter the source based on the passed filtration value. + * + * For more details, refer to the section on the [`filterChange`]({% slug overview_autocomplete_kendouiforangular %}#toc-on-filter-change) event. + */ + this.filterChange = new core_1.EventEmitter(); + /** + * Fires each time the popup is about to open. + * This event is preventable. If you cancel the event, the popup will remain closed. + */ + this.open = new core_1.EventEmitter(); + /** + * Fires each time the popup is about to close. + * This event is preventable. If you cancel the event, the popup will remain opened. + */ + this.close = new core_1.EventEmitter(); + /** + * Fires each time the user focuses the AutoComplete component. + */ + this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * Fires each time the AutoComplete component gets blurred. + */ + this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + this.listBoxId = util_1.guid(); + this.optionPrefix = util_1.guid(); + this.onChangeCallback = function (_value) { }; + this.onTouchedCallback = function (_) { }; + this.popupMouseDownHandler = function (event) { return event.preventDefault(); }; + this._popupSettings = { height: 200, animate: true }; + this._open = false; + this._value = ""; + this._isFocused = false; + this.direction = rtl ? 'rtl' : 'ltr'; + this.wrapper = wrapper.nativeElement; + this.data = []; + this.subscribeEvents(); + this.selectionService.resetSelection([-1]); + } + Object.defineProperty(AutoCompleteComponent.prototype, "width", { + get: function () { + var wrapperOffsetWidth = 0; + if (util_1.isDocumentAvailable()) { + wrapperOffsetWidth = this.wrapper.offsetWidth; + } + var width = this.popupSettings.width || wrapperOffsetWidth; + var minWidth = isNaN(wrapperOffsetWidth) ? wrapperOffsetWidth : wrapperOffsetWidth + "px"; + var maxWidth = isNaN(width) ? width : width + "px"; + return { min: minWidth, max: maxWidth }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "height", { + get: function () { + return this.popupSettings.height; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "listContainerClasses", { + get: function () { + var containerClasses = ['k-list-container', 'k-reset']; + if (this.popupSettings.popupClass) { + containerClasses.push(this.popupSettings.popupClass); + } + return containerClasses; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "suggestion", { + get: function () { + if (!this.value || !this.suggestedText) { + this.suggestedText = undefined; + return; + } + var hasMatch = this.suggestedText.toLowerCase().startsWith(this.value.toLowerCase()); + var shouldSuggest = this.suggest && !this.backspacePressed; + if (shouldSuggest && hasMatch) { + return this.suggestedText; + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "popupOpen", { + get: function () { + return this._open; + }, + set: function (open) { + if (this.disabled || this.popupOpen === open) { + return; + } + var eventArgs = new preventable_event_1.PreventableEvent(); + if (open && !this.popupOpen) { + this.open.emit(eventArgs); + } + if (!open && this.popupOpen) { + this.close.emit(eventArgs); + } + if (eventArgs.isDefaultPrevented()) { + return; + } + this._toggle(open); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "activeDescendant", { + get: function () { + return this.optionPrefix + "-" + this.value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "data", { + get: function () { + return this._data; + }, + /** + * Sets the data of the AutoComplete. + * + * > The data has to be provided in an array-like list. + */ + set: function (data) { + this._data = data || []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "value", { + get: function () { + return this._value; + }, + /** + * Sets the value of the AutoComplete. + * + */ + set: function (newValue) { + this.verifySettings(newValue); + this._value = newValue; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "popupSettings", { + get: function () { + return this._popupSettings; + }, + /** + * Configures the popup of the AutoComplete. + * + * The available options are: + * - `animation: Boolean`—Controls the popup animation. By default, the open and close animations are enabled. + * - `width: Number | String`—Sets the width of the popup container. By default, the width of the host element is used If set to `auto`, the component automatically adjusts the width of the popup, so no item labels are wrapped. + * - `height: Number`—Sets the height of the popup container. By default, the height is 200px. + * - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup. + */ + set: function (settings) { + this._popupSettings = Object.assign({ height: 200, animate: true }, settings); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "widgetClasses", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "isFocused", { + get: function () { + return this._isFocused; + }, + set: function (isFocused) { + this._isFocused = isFocused; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "isDisabled", { + get: function () { + return this.disabled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "widgetHeight", { + get: function () { + return this.popupSettings.height + "px"; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteComponent.prototype, "dir", { + get: function () { + return this.direction; + }, + enumerable: true, + configurable: true + }); + AutoCompleteComponent.prototype.ngOnDestroy = function () { + this._toggle(false); + this.unsubscribeEvents(); + }; + AutoCompleteComponent.prototype.ngOnChanges = function (_changes) { + var shouldSuggest = this.suggest && this.data && this.data.length && this.value; + if (shouldSuggest) { + this.suggestedText = util_1.getter(this.data[0], this.valueField); + } + }; + /** + * Toggles the visibility of the popup. If you use the `toggle` method to open or close the popup, the `open` and `close` events will not be fired. + * + * @param open - The state of the popup. + */ + AutoCompleteComponent.prototype.toggle = function (open) { + var _this = this; + Promise.resolve(null).then(function () { + _this._toggle((open === undefined) ? !_this._open : open); + }); + }; + Object.defineProperty(AutoCompleteComponent.prototype, "isOpen", { + /** + * Returns the current open state of the popup. + */ + get: function () { + return this.popupOpen; + }, + enumerable: true, + configurable: true + }); + /** + * Resets the value of the AutoComplete. + */ + AutoCompleteComponent.prototype.reset = function () { + this._previousValue = undefined; + this.value = undefined; + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.clearValue = function (event) { + event.stopImmediatePropagation(); + if (this.filterable) { + this.filterChange.emit(""); + } + if (this._previousValue !== undefined) { + this._previousValue = this.value; + } + this.change(undefined); + this.selectionService.resetSelection([]); + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.writeValue = function (value) { + this._previousValue = this.value; + this.value = value; + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.registerOnChange = function (fn) { + this.onChangeCallback = fn; + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.registerOnTouched = function (fn) { + this.onTouchedCallback = fn; + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.popupOpened = function () { + this.popupWidth = this.width.max; + this.popupMinWidth = this.width.min; + }; + /** + * Focuses the AutoComplete component. + */ + AutoCompleteComponent.prototype.focus = function () { + if (!this.disabled) { + this.searchbar.focus(); + } + }; + /** + * Blurs the AutoComplete component. + */ + AutoCompleteComponent.prototype.blur = function () { + if (!this.disabled) { + this.searchbar.blur(); + } + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.onResize = function () { + if (this._open) { + var popupWrapper = this.popupRef.popupElement; + var _a = this.width, min = _a.min, max = _a.max; + popupWrapper.style.minWidth = min; + popupWrapper.style.width = max; + } + }; + AutoCompleteComponent.prototype.verifySettings = function (newValue) { + if (!core_1.isDevMode()) { + return; + } + if (util_1.isPresent(newValue) && typeof newValue !== "string") { + throw new Error("Expected value of type string. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/autocomplete/#toc-value"); + } + }; + AutoCompleteComponent.prototype.search = function (text) { + var _this = this; + var index = this.data.findIndex(function (item) { + var itemText = util_1.getter(item, _this.valueField); + itemText = itemText === undefined ? "" : itemText.toString().toLowerCase(); + return itemText.startsWith(text.toLowerCase()); + }); + this.selectionService.focus(index); + if (this.suggest) { + this.suggestedText = util_1.getter(this.data[index], this.valueField); + } + }; + AutoCompleteComponent.prototype.navigate = function (index) { + if (!this.popupOpen) { + return; + } + if (index < 0 || index > this.data.length) { + index = 0; + } + this.selectionService.focus(index); + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.handleNavigate = function (event) { + var focused = isNaN(this.selectionService.focused) ? 0 : this.selectionService.focused; + var hasFocused = util_1.isPresent(focused); + var offset = 0; + if (this.disabled) { + return; + } + if (!hasFocused) { + if (event.keyCode === keys_1.Keys.down) { + offset = -1; + } + else if (event.keyCode === keys_1.Keys.up) { + offset = 1; + } + } + var action = this.navigationService.process({ + current: focused + offset, + max: this.data.length - 1, + min: 0, + originalEvent: event + }); + if (action !== navigation_action_1.NavigationAction.Undefined && + action !== navigation_action_1.NavigationAction.Backspace && + action !== navigation_action_1.NavigationAction.Delete && + action !== navigation_action_1.NavigationAction.Home && + action !== navigation_action_1.NavigationAction.End && + action !== navigation_action_1.NavigationAction.Left && + action !== navigation_action_1.NavigationAction.Right && + ((action === navigation_action_1.NavigationAction.Enter && this.popupOpen) || action !== navigation_action_1.NavigationAction.Enter)) { + event.preventDefault(); + } + }; + AutoCompleteComponent.prototype.handleEnter = function (event) { + var focused = this.selectionService.focused; + var value; + if (this.popupOpen) { + event.originalEvent.preventDefault(); + } + if (focused >= 0) { + value = util_1.getter(this.data[focused], this.valueField); + } + else { + var match = this.suggest && this.suggestedText && this.data.length && + util_1.getter(this.data[0], this.valueField, true).toLowerCase() === this.searchbar.value.toLowerCase(); + if (this.popupOpen && match) { + value = this.suggestedText; + } + else { + value = this.searchbar.value; + } + } + this.change(value); + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.searchBarChange = function (text) { + var currentTextLength = this.value ? this.value.length : 0; + this.backspacePressed = (text.length < currentTextLength) ? true : false; + this.value = text; + this.popupOpen = text.length > 0; + if (this.filterable) { + this.selectionService.focused = -1; + this.filterChange.emit(text); + } + else { + this.search(text); + } + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.handleFocus = function () { + this._previousValue = this.value; + this.isFocused = true; + this.onFocus.emit(); + }; + /** + * @hidden + */ + AutoCompleteComponent.prototype.handleBlur = function () { + if (this.value === undefined) { + this.popupOpen = false; + this.isFocused = false; + this.onBlur.emit(); + this.onTouchedCallback(); + return; + } + var focused = this.selectionService.focused; + var dataItem; + var text; + var value = this.value; + if (focused !== -1) { + dataItem = this.data[focused]; + text = util_1.getter(dataItem, this.valueField) || ""; + } + else { + text = this.searchbar.value; + } + if (text === this.searchbar.value) { + value = text; + } + else if (text && text.toLowerCase() === this.searchbar.value.toLowerCase()) { + this.selectionService.resetSelection([]); + value = this.searchbar.value; + } + this.change(value); + this.popupOpen = false; + this.isFocused = false; + this.onBlur.emit(); + this.onTouchedCallback(); + }; + AutoCompleteComponent.prototype.change = function (candidate) { + this.popupOpen = false; + if (candidate === this._previousValue) { + this.value = candidate; + return; + } + this.value = candidate; + this._previousValue = this.value; + this.onChangeCallback(this.value); + this.valueChange.emit(this.value); + }; + AutoCompleteComponent.prototype.subscribeEvents = function () { + var _this = this; + if (!util_1.isDocumentAvailable()) { + return; + } + this.changeSubscribtion = this.selectionService.onChange.subscribe(this.handleItemChange.bind(this)); + this.focusSubscribtion = this.selectionService.onFocus.subscribe(this.handleItemFocus.bind(this)); + this.navigationSubscribtion = Observable_1.Observable.merge(this.navigationService.up, this.navigationService.down).subscribe(function (event) { return _this.navigate(event.index); }); + this.closeSubscription = this.navigationService.close.subscribe(function () { return _this.popupOpen = false; }); + this.enterSubscription = this.navigationService.enter.subscribe(this.handleEnter.bind(this)); + this.escSubscription = this.navigationService.esc.subscribe(this.handleBlur.bind(this)); + }; + AutoCompleteComponent.prototype.unsubscribeEvents = function () { + if (!util_1.isDocumentAvailable()) { + return; + } + this.changeSubscribtion.unsubscribe(); + this.navigationSubscribtion.unsubscribe(); + this.closeSubscription.unsubscribe(); + this.enterSubscription.unsubscribe(); + this.escSubscription.unsubscribe(); + }; + AutoCompleteComponent.prototype.handleItemChange = function (event) { + var index = event.indices.length ? event.indices[0] : undefined; + this.selectionService.resetSelection([-1]); + if (!util_1.isPresent(index)) { + return; + } + var text = util_1.getter(this.data[index], this.valueField); + this.change(text); + }; + AutoCompleteComponent.prototype.handleItemFocus = function (_event) { + var focused = this.selectionService.focused; + var shouldSuggest = Boolean(this.suggest && this.data && this.data.length && focused >= 0); + if (shouldSuggest) { + this.suggestedText = util_1.getter(this.data[focused], this.valueField); + } + }; + AutoCompleteComponent.prototype._toggle = function (open) { + var _this = this; + this._open = open; + if (this.popupRef) { + this.popupRef.popupElement + .removeEventListener('mousedown', this.popupMouseDownHandler); + this.popupRef.close(); + this.popupRef = null; + } + if (this._open) { + this.popupRef = this.popupService.open({ + anchor: this.wrapper, + animate: this.popupSettings.animate, + content: this.popupTemplate, + popupClass: this.listContainerClasses + }); + var popupWrapper = this.popupRef.popupElement; + var _a = this.width, min = _a.min, max = _a.max; + popupWrapper.addEventListener('mousedown', this.popupMouseDownHandler); + popupWrapper.style.minWidth = min; + popupWrapper.style.width = max; + this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.popupOpen = false; }); + } + }; + return AutoCompleteComponent; +}()); +AutoCompleteComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoAutoComplete', + providers: [exports.AUTOCOMPLETE_VALUE_ACCESSOR, selection_service_1.SelectionService, navigation_service_1.NavigationService], + selector: 'kendo-autocomplete', + template: "\n \n \n\n \n \n \n \n \n \n \n \n \n
\n \n \n \n
NO DATA FOUND.
\n
\n
\n \n \n \n
\n \n " + },] }, +]; +/** @nocollapse */ +AutoCompleteComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, + { type: kendo_angular_popup_1.PopupService, }, + { type: selection_service_1.SelectionService, }, + { type: navigation_service_1.NavigationService, }, + { type: core_1.ElementRef, }, +]; }; +AutoCompleteComponent.propDecorators = { + 'data': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'valueField': [{ type: core_1.Input },], + 'placeholder': [{ type: core_1.Input },], + 'popupSettings': [{ type: core_1.Input },], + 'loading': [{ type: core_1.Input },], + 'clearButton': [{ type: core_1.Input },], + 'suggest': [{ type: core_1.Input },], + 'disabled': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'filterable': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'filterChange': [{ type: core_1.Output },], + 'open': [{ type: core_1.Output },], + 'close': [{ type: core_1.Output },], + 'onFocus': [{ type: core_1.Output, args: ['focus',] },], + 'onBlur': [{ type: core_1.Output, args: ['blur',] },], + 'template': [{ type: core_1.ContentChild, args: [item_template_directive_1.ItemTemplateDirective,] },], + 'headerTemplate': [{ type: core_1.ContentChild, args: [header_template_directive_1.HeaderTemplateDirective,] },], + 'footerTemplate': [{ type: core_1.ContentChild, args: [footer_template_directive_1.FooterTemplateDirective,] },], + 'noDataTemplate': [{ type: core_1.ContentChild, args: [no_data_template_directive_1.NoDataTemplateDirective,] },], + 'popupTemplate': [{ type: core_1.ViewChild, args: ['popupTemplate',] },], + 'searchbar': [{ type: core_1.ViewChild, args: [searchbar_component_1.SearchBarComponent,] },], + 'widgetClasses': [{ type: core_1.HostBinding, args: ['class.k-widget',] }, { type: core_1.HostBinding, args: ['class.k-autocomplete',] }, { type: core_1.HostBinding, args: ['class.k-header',] },], + 'isFocused': [{ type: core_1.HostBinding, args: ['class.k-state-focused',] },], + 'isDisabled': [{ type: core_1.HostBinding, args: ['class.k-state-disabled',] },], + 'widgetHeight': [{ type: core_1.HostBinding, args: ['style.max-height',] },], + 'dir': [{ type: core_1.HostBinding, args: ['attr.dir',] },], +}; +exports.AutoCompleteComponent = AutoCompleteComponent; + + +/***/ }), +/* 178 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var autocomplete_component_1 = __webpack_require__(177); +var shared_module_1 = __webpack_require__(55); +var shared_directives_module_1 = __webpack_require__(38); +var AUTOCOMPLETE_DIRECTIVES = [ + autocomplete_component_1.AutoCompleteComponent +]; +/** + * @hidden + * + * The exported package module. + * + * The package exports: + * - `AutoCompleteComponent`—The AutoComplete component class. + * - `ItemTemplateDirective`—The item template directive. + * - `HeaderTemplateDirective`—The header template directive. + * - `FooterTemplateDirective`—The footer template directive. + */ +var AutoCompleteModule = (function () { + function AutoCompleteModule() { + } + return AutoCompleteModule; +}()); +AutoCompleteModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [AUTOCOMPLETE_DIRECTIVES], + exports: [AUTOCOMPLETE_DIRECTIVES, shared_directives_module_1.SharedDirectivesModule], + imports: [shared_module_1.SharedModule] + },] }, +]; +/** @nocollapse */ +AutoCompleteModule.ctorParameters = function () { return []; }; +exports.AutoCompleteModule = AutoCompleteModule; + + +/***/ }), +/* 179 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/* tslint:disable:no-null-keyword */ +/* tslint:disable:max-line-length */ +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +var searchbar_component_1 = __webpack_require__(75); +var kendo_dropdowns_common_1 = __webpack_require__(139); +var item_template_directive_1 = __webpack_require__(41); +var header_template_directive_1 = __webpack_require__(40); +var footer_template_directive_1 = __webpack_require__(39); +var no_data_template_directive_1 = __webpack_require__(56); +var selection_service_1 = __webpack_require__(37); +var navigation_service_1 = __webpack_require__(74); +var Observable_1 = __webpack_require__(1); +__webpack_require__(33); +__webpack_require__(292); +__webpack_require__(147); +__webpack_require__(47); +__webpack_require__(34); +__webpack_require__(297); +__webpack_require__(298); +__webpack_require__(305); +__webpack_require__(146); +var Subject_1 = __webpack_require__(8); +var Rx_1 = __webpack_require__(288); +var util_1 = __webpack_require__(24); +var navigation_action_1 = __webpack_require__(54); +var keys_1 = __webpack_require__(36); +var preventable_event_1 = __webpack_require__(53); +var kendo_angular_l10n_1 = __webpack_require__(2); +var kendo_angular_popup_1 = __webpack_require__(28); +/** + * @hidden + */ +exports.COMBOBOX_VALUE_ACCESSOR = { + multi: true, + provide: forms_1.NG_VALUE_ACCESSOR, + // tslint:disable-next-line:no-use-before-declare + useExisting: core_1.forwardRef(function () { return ComboBoxComponent; }) +}; +/** + * Represents the Kendo UI ComboBox component for Angular. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * class AppComponent { + * public listItems: Array = ["Item 1", "Item 2", "Item 3", "Item 4"]; + * } + * ``` + */ +var ComboBoxComponent = (function () { + function ComboBoxComponent(rtl, popupService, selectionService, navigationService, wrapper) { + this.popupService = popupService; + this.selectionService = selectionService; + this.navigationService = navigationService; + this.selected = []; + /** + * Specifies whether the ComboBox allows user-defined values that are not present in the dataset. + * The default value is `false`. + * + * For more information, refer to the section on [custom values]({% slug overview_combobox_kendouiforangular %}#toc-allow-for-custom-values). + */ + this.allowCustom = false; + /** + * A user-defined callback returning normalized custom values. Typically used when the data items are not of type `string`. + * @param { Any } value - The custom value defined by the user. + * @returns { Any } + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * + * class AppComponent { + * public listItems: Array<{ text: string, value: number }> = [ + * { text: "Small", value: 1 }, + * { text: "Medium", value: 2 }, + * { text: "Large", value: 3 } + * ]; + * + * public onValueChange(value) { + * console.log("valueChange : ", value); + * } + * + * public valueNormalizer = (text: Observable) => text.map((text: string) => { + * return { ProductID: null, ProductName: text }; + * }); + * + * } + * ``` + */ + this.valueNormalizer = function (text) { return text.map(function (userInput) { return userInput; }); }; + /** + * The hint displayed when the component is empty. + * + */ + this.placeholder = ""; + /** + * @hidden + * + * Enables the auto-completion of the text based on the first data item. + */ + this.suggest = false; + /** + * Unless this options is set to `false`, a button will appear when hovering over the component. Clicking that button resets the component value to undefined and triggers the `change` event. + */ + this.clearButton = true; + /** + * Sets the disabled state of the component. + */ + this.disabled = false; + /** + * Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component. + */ + this.tabIndex = 0; + /** + * Enables the filtering functionality. If set to `true`, the component emits the `filterChange` event. + */ + this.filterable = false; + /** + * Fires each time the value is changed. + * + * For more details, refer to the section on the [`valueChange`]({% slug overview_combobox_kendouiforangular %}#toc-on-value-change) event. + */ + this.valueChange = new core_1.EventEmitter(); + /** + * Fires each time an item selection is changed. + * + * For more details, refer to the section on the [`selectionChange`]({% slug overview_combobox_kendouiforangular %}#toc-on-change-of-item-selection) event. + */ + this.selectionChange = new core_1.EventEmitter(); + /** + * Fires each time the user types in the input. + * You can filter the source based on the passed filtration value. + * + * For more details, refer to the section on the [`filterChange`]({% slug overview_combobox_kendouiforangular %}#toc-on-filter-change) event. + */ + this.filterChange = new core_1.EventEmitter(); + /** + * Fires each time the popup is about to open. + * This event is preventable. If you cancel the event, the popup will remain closed. + */ + this.open = new core_1.EventEmitter(); + /** + * Fires each time the popup is about to close. + * This event is preventable. If you cancel the event, the popup will remain opened. + */ + this.close = new core_1.EventEmitter(); + /** + * Fires each time the user focuses the AutoComplete component. + */ + this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * Fires each time the AutoComplete component gets blurred. + */ + this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + this.isFocused = false; + this.listBoxId = util_1.guid(); + this.optionPrefix = util_1.guid(); + this.onChangeCallback = function (_) { }; + this.onTouchedCallback = function (_) { }; + this.observableSubscriptions = new Rx_1.Subscription(); + this._text = ""; + this._open = false; + this._previousValue = undefined; + this.suggestedText = undefined; + this._popupSettings = { height: 200, animate: true }; + this.popupMouseDownHandler = function (event) { return event.preventDefault(); }; + this.customValueSubject = new Subject_1.Subject(); + this.valueSubject = new Subject_1.Subject(); + this.selectionSubject = new Subject_1.Subject(); + this.direction = rtl ? 'rtl' : 'ltr'; + this.wrapper = wrapper.nativeElement; + this.data = []; + this.subscribeEvents(); + } + Object.defineProperty(ComboBoxComponent.prototype, "width", { + get: function () { + var wrapperOffsetWidth = 0; + if (util_1.isDocumentAvailable()) { + wrapperOffsetWidth = this.wrapper.offsetWidth; + } + var width = this.popupSettings.width || wrapperOffsetWidth; + var minWidth = isNaN(wrapperOffsetWidth) ? wrapperOffsetWidth : wrapperOffsetWidth + "px"; + var maxWidth = isNaN(width) ? width : width + "px"; + return { min: minWidth, max: maxWidth }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "height", { + get: function () { + return this.popupSettings.height; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "text", { + get: function () { + return this._text; + }, + set: function (text) { + var textCandidate = util_1.getter(text, this.textField, true); + this._text = util_1.isPresent(textCandidate) ? textCandidate.toString() : ""; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "popupOpen", { + get: function () { + return this._open; + }, + set: function (open) { + if (this.disabled || this.popupOpen === open) { + return; + } + var eventArgs = new preventable_event_1.PreventableEvent(); + if (open) { + this.open.emit(eventArgs); + } + else { + this.close.emit(eventArgs); + } + if (eventArgs.isDefaultPrevented()) { + return; + } + this._toggle(open); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "activeDescendant", { + get: function () { + return this.optionPrefix + "-" + this.value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "data", { + get: function () { + return this._data; + }, + /** + * Sets the data of the ComboBox. + * + * > The data has to be provided in an array-like list. + */ + set: function (data) { + this._data = data || []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "value", { + get: function () { + return this._value; + }, + /** + * Sets the value of the ComboBox. It can either be of the primitive (string, numbers) or of the complex (objects) type. To define the type, use the `valuePrimitive` option. + * + * > Selected values that are not present in the dataset are considered custom values. Unless `allowCustom` is set to `true`, custom values are dismissed when "enter" key is pressed or after the component looses focus. + */ + set: function (newValue) { + this.verifySettings(newValue); + this._value = newValue; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "popupSettings", { + get: function () { + return this._popupSettings; + }, + /** + * Configures the popup of the ComboBox. + * + * The available options are: + * - `animation: Boolean`—Controls the popup animation. By default, the open and close animations are enabled. + * - `width: Number | String`—Sets the width of the popup container. By default, the width of the host element is used If set to `auto`, the component automatically adjusts the width of the popup, so no item labels are wrapped. + * - `height: Number`—Sets the height of the popup container. By default, the height is 200px. + * - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup. + */ + set: function (settings) { + this._popupSettings = Object.assign({ height: 200, animate: true }, settings); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "widgetClasses", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + ComboBoxComponent.prototype.wrapperClasses = function () { + return { + 'k-dropdown-wrap': true, + 'k-state-default': !this.disabled, + 'k-state-disabled': this.disabled, + 'k-state-focused': this.isFocused + }; + }; + Object.defineProperty(ComboBoxComponent.prototype, "clearable", { + get: function () { + return this.clearButton; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "widgetHeight", { + get: function () { + return this.popupSettings.height + "px"; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ComboBoxComponent.prototype, "dir", { + get: function () { + return this.direction; + }, + enumerable: true, + configurable: true + }); + ComboBoxComponent.prototype.ngOnInit = function () { + this.createSelectionStream(); + this.createValueStream(); + }; + ComboBoxComponent.prototype.createSelectionStream = function () { + var _this = this; + if (this.selectionSubscription) { + this.selectionSubscription.unsubscribe(); + } + this.selectionSubscription = this.selectionSubject + .map(function (index) { + return { + dataItem: _this.data[index], + value: util_1.getter(_this.data[index], _this.valueField) + }; + }) + .distinctUntilChanged(function (prev, next) { + return prev.value === next.value; + }) + .subscribe(function (args) { + _this.selectionChange.emit(args.dataItem); + }); + }; + ComboBoxComponent.prototype.createValueStream = function () { + var _this = this; + var valueStream = this.valueSubject + .filter(function (candidate) { + var current = _this.valuePrimitive ? _this.value : util_1.getter(_this.value, _this.valueField); + var newValue = util_1.getter(candidate, _this.valueField); + var newText = util_1.getter(candidate, _this.textField); + if (current === newValue && _this.text === newText) { + return false; + } + else { + return true; + } + }) + .map(function (candidate) { + var newValue = util_1.getter(candidate, _this.valueField); + var newText = util_1.getter(candidate, _this.textField); + return { + dataItem: candidate, + text: newText, + value: _this.valuePrimitive ? newValue : candidate + }; + }); + var customValueStreams = this.customValueSubject.throttleTime(300).partition(function () { return _this.allowCustom; }); + var allowCustomValueStream = customValueStreams[0] + .do(function () { + _this.loading = true; + _this.disabled = true; + }) + .filter(function () { + var hasChange = _this.text !== util_1.getter(_this.value, _this.textField); + _this.loading = hasChange; + _this.disabled = hasChange; + return hasChange; + }) + .let(this.valueNormalizer) + .map(function (normalizedValue) { + return { + dataItem: undefined, + text: _this.text, + value: normalizedValue + }; + }); + var disableCustomValueStream = customValueStreams[1] + .map(function () { + return { + dataItem: undefined, + text: undefined, + value: undefined + }; + }); + if (this.valueSubscription) { + this.valueSubscription.unsubscribe(); + } + var merged = valueStream.merge(allowCustomValueStream, disableCustomValueStream); + this.valueSubscription = merged + .catch(function () { + _this.dataItem = undefined; + _this.value = undefined; + _this.text = undefined; + _this.loading = false; + _this.disabled = false; + _this.emitChange(); + return merged; + }) + .subscribe(function (state) { + _this.dataItem = state.dataItem; + _this.value = state.value; + _this.text = state.text; + _this.loading = false; + _this.disabled = false; + if (_this.filterable && !util_1.isPresent(state.value) && !util_1.isPresent(state.text)) { + _this.filterChange.emit(""); + } + _this.emitChange(); + }); + }; + ComboBoxComponent.prototype.subscribeEvents = function () { + var _this = this; + if (!util_1.isDocumentAvailable()) { + return; + } + [ + this.selectionService.onChange + .filter(function (event) { return util_1.isPresent(event.indices[0]); }) + .map(function (event) { return event.indices[0]; }) + .subscribe(this.handleItemChange.bind(this)), + this.selectionService.onSelect + .filter(function (event) { return util_1.isPresent(event.indices[0]); }) + .map(function (event) { return event.indices[0]; }) + .subscribe(this.handleItemSelect.bind(this)), + Observable_1.Observable.merge(this.navigationService.up, this.navigationService.down, this.navigationService.home, this.navigationService.end).subscribe(function (event) { return _this.navigate(event.index); }), + this.navigationService.open.subscribe(function () { return _this.popupOpen = true; }), + this.navigationService.close.subscribe(function () { return _this.popupOpen = false; }), + this.navigationService.enter.subscribe(this.handleEnter.bind(this)), + this.navigationService.esc.subscribe(this.handleBlur.bind(this)) + ].forEach(function (s) { return _this.observableSubscriptions.add(s); }); + }; + ComboBoxComponent.prototype.unsubscribeEvents = function () { + if (!util_1.isDocumentAvailable()) { + return; + } + this.observableSubscriptions.unsubscribe(); + if (this.valueSubscription) { + this.valueSubscription.unsubscribe(); + } + if (this.selectionSubscription) { + this.selectionSubscription.unsubscribe(); + } + }; + ComboBoxComponent.prototype.handleItemChange = function (index) { + this.change(this.data[index]); + }; + ComboBoxComponent.prototype.handleItemSelect = function (index) { + if (!this.popupOpen) { + this.change(this.data[index]); + } + else { + this.selectionSubject.next(index); + } + }; + ComboBoxComponent.prototype.ngOnDestroy = function () { + this._toggle(false); + this.unsubscribeEvents(); + }; + ComboBoxComponent.prototype.ngOnChanges = function (changes) { + if (util_1.isChanged("valueNormalizer", changes)) { + this.createSelectionStream(); + this.createValueStream(); + } + if (this.valuePrimitive === undefined) { + this.valuePrimitive = this.valueField ? false : true; + } + var STATE_PROPS = /(data|value|textField|valueField|valuePrimitive)/g; + if (STATE_PROPS.test(Object.keys(changes).join())) { + this.setState(this.value); + } + if (this.suggest && this.data && this.data.length && this.text) { + this.suggestedText = util_1.getter(this.data[0], this.textField); + } + }; + /** + * Focuses the ComboBox component. + */ + ComboBoxComponent.prototype.focus = function () { + if (!this.disabled) { + this.searchbar.focus(); + } + }; + /** + * Blurs the ComboBox component. + */ + ComboBoxComponent.prototype.blur = function () { + if (!this.disabled) { + this.searchbar.blur(); + } + }; + /** + * Toggles the visibility of the popup. If you use the `toggle` method to open or close the popup, the `open` and `close` events will not be fired. + * + * @param open - The state of the popup. + */ + ComboBoxComponent.prototype.toggle = function (open) { + var _this = this; + Promise.resolve(null).then(function () { + _this._toggle((open === undefined) ? !_this._open : open); + }); + }; + Object.defineProperty(ComboBoxComponent.prototype, "isOpen", { + /** + * Returns the current open state of the popup. + */ + get: function () { + return this.popupOpen; + }, + enumerable: true, + configurable: true + }); + /** + * Resets the value of the ComboBox. + */ + ComboBoxComponent.prototype.reset = function () { + this.setState(undefined); + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.clearValue = function (event) { + event.stopImmediatePropagation(); + this.change(undefined); + this.selectionService.resetSelection([]); + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.writeValue = function (value) { + this.text = ""; + this.setState(value); + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.registerOnChange = function (fn) { + this.onChangeCallback = fn; + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.registerOnTouched = function (fn) { + this.onTouchedCallback = fn; + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.popupOpened = function () { + this.popupWidth = this.width.max; + this.popupMinWidth = this.width.min; + }; + Object.defineProperty(ComboBoxComponent.prototype, "buttonClasses", { + /** + * @hidden + */ + get: function () { + return _a = {}, + _a[this.iconClass] = !this.loading && this.iconClass, + _a['k-i-arrow-s'] = !this.loading && !this.iconClass, + _a['k-i-loading'] = this.loading, + _a['k-icon'] = true, + _a; + var _a; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + ComboBoxComponent.prototype.onResize = function () { + if (this._open) { + var popupWrapper = this.popupRef.popupElement; + var _a = this.width, min = _a.min, max = _a.max; + popupWrapper.style.minWidth = min; + popupWrapper.style.width = max; + } + }; + ComboBoxComponent.prototype.verifySettings = function (newValue) { + var valueOrText = !util_1.isPresent(this.valueField) !== !util_1.isPresent(this.textField); + if (!core_1.isDevMode()) { + return; + } + if (this.valuePrimitive === true && util_1.isPresent(newValue) && typeof newValue === "object") { + throw new Error("Expected initial value of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-value-selection"); + } + if (this.valuePrimitive === false && util_1.isPresent(newValue) && typeof newValue !== "object") { + throw new Error("Expected initial value of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-value-selection"); + } + if (valueOrText) { + throw new Error("Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/combobox/#toc-bind-to-arrays-of-complex-data"); + } + }; + ComboBoxComponent.prototype.setState = function (value) { + var primitiveValue = util_1.getter(value, this.valueField, true); + var valueCandidate; + var textCandidate; + var dataItemCandidate; + var filterState = this.filterable && !!this.text; + if (!this.data.length) { + if (filterState) { + this.selectionService.resetSelection([-1]); + return; + } + dataItemCandidate = this.valueField && !this.valuePrimitive ? value : undefined; + valueCandidate = value; + textCandidate = this.allowCustom ? value : ""; + } + else { + var result = kendo_dropdowns_common_1.DropDownsUtil.resolveValue({ + data: this.data, + value: primitiveValue, + valueField: this.valueField + }); + valueCandidate = this.valuePrimitive ? primitiveValue : value; + if (result.dataItem) { + this.selectionService.resetSelection(result.selected); + textCandidate = result.dataItem; + dataItemCandidate = result.dataItem; + } + else { + this.selectionService.resetSelection([]); + this.selectionService.focused = 0; + if (filterState) { + textCandidate = this.text; + } + else { + if (this.allowCustom) { + textCandidate = value; + dataItemCandidate = !this.valuePrimitive ? value : undefined; + } + else { + textCandidate = ""; + valueCandidate = undefined; + dataItemCandidate = undefined; + } + } + } + } + this.value = valueCandidate; + this.text = textCandidate; + this.dataItem = dataItemCandidate; + this._previousValue = valueCandidate; + }; + ComboBoxComponent.prototype.search = function (text) { + var _this = this; + var index = this.data.findIndex(function (item) { + var itemText = util_1.getter(item, _this.textField); + itemText = itemText === undefined ? "" : itemText.toString().toLowerCase(); + return itemText.startsWith(text.toLowerCase()); + }); + this.selectionService.focused = index; + this.suggestedText = util_1.getter(this.data[index], this.textField); + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.getSuggestion = function () { + var hasSelected = !!this.selectionService.selected.length; + var shouldSuggest = this.suggest && !this.backspacePressed && this.suggestedText && this.text; + if (!hasSelected && shouldSuggest && this.suggestedText.toLowerCase().startsWith(this.text.toLowerCase())) { + return this.suggestedText; + } + else { + this.suggestedText = undefined; + } + }; + ComboBoxComponent.prototype.navigate = function (index) { + this.text = this.data[index]; + this.selectionService.select(index); + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.handleNavigate = function (event) { + var hasSelected = util_1.isPresent(this.selectionService.selected[0]); + var focused = isNaN(this.selectionService.focused) ? 0 : this.selectionService.focused; + var offset = 0; + if (this.disabled) { + return; + } + if (!hasSelected) { + if (event.keyCode === keys_1.Keys.down) { + offset = -1; + } + else if (event.keyCode === keys_1.Keys.up) { + offset = 1; + } + } + var action = this.navigationService.process({ + current: focused + offset, + max: this.data.length - 1, + min: 0, + originalEvent: event + }); + if (action !== navigation_action_1.NavigationAction.Undefined && + action !== navigation_action_1.NavigationAction.Left && + action !== navigation_action_1.NavigationAction.Right && + action !== navigation_action_1.NavigationAction.Backspace && + action !== navigation_action_1.NavigationAction.Delete && + ((action === navigation_action_1.NavigationAction.Enter && this.popupOpen) || action !== navigation_action_1.NavigationAction.Enter)) { + event.preventDefault(); + } + }; + ComboBoxComponent.prototype.handleEnter = function (event) { + var focused = this.selectionService.focused; + var isCustom = focused === -1 || focused === undefined; + var previousText = util_1.getter(this._previousValue, this.textField) || ""; + var hasChange = this.text !== previousText; + if (this.popupOpen) { + event.originalEvent.preventDefault(); + } + if (!isCustom && this.popupOpen) { + this.selectionService.select(focused); + this.change(this.data[focused] || this.text, isCustom); + return; + } + if (hasChange) { + this.change(this.text, isCustom); + } + else { + this.popupOpen = false; + } + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.handleBlur = function () { + var currentText = this.searchbar.value; //value is updated, but Angular's change is not yet emitted and this.text is not updated. Fails on suggest text. + if (!currentText && !util_1.isPresent(this._previousValue)) { + this.popupOpen = false; + this.isFocused = false; + this.onBlur.emit(); + this.onTouchedCallback(); + return; + } + var focused = this.selectionService.focused; + var itemText; + if (focused !== -1) { + itemText = util_1.getter(this.data[focused], this.textField); + itemText = itemText === undefined ? "" : itemText.toString().toLowerCase(); + } + if (itemText === currentText.toLowerCase()) { + this.selectionService.change(focused); + } + else { + this.change(currentText, true); + } + this.popupOpen = false; + this.isFocused = false; + this.onBlur.emit(); + this.onTouchedCallback(); + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.searchBarChange = function (text) { + var currentTextLength = this.text ? this.text.length : 0; + this.backspacePressed = (text.length < currentTextLength) ? true : false; + this.text = text; + //Reset the selection prior filter. It will be resolved if there is a match and we don't need it if there isn't one + this.selectionService.resetSelection([]); + this.popupOpen = true; + if (this.filterable) { + this.filterChange.emit(text); + } + else { + this.search(text); + } + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.handleFocus = function () { + this.isFocused = true; + this.onFocus.emit(); + }; + ComboBoxComponent.prototype.change = function (candidate, isCustom) { + if (isCustom === void 0) { isCustom = false; } + this.popupOpen = false; + if (isCustom) { + this.customValueSubject.next(candidate); + } + else { + this.valueSubject.next(candidate); + } + }; + ComboBoxComponent.prototype.emitChange = function () { + this._previousValue = this.value; + this.selectionSubject.next(this.data.indexOf(this.value)); + this.onChangeCallback(this.value); + this.valueChange.emit(this.value); + }; + /** + * @hidden + */ + ComboBoxComponent.prototype.iconClick = function () { + this.searchbar.focus(); + this.popupOpen = !this.popupOpen; + }; + Object.defineProperty(ComboBoxComponent.prototype, "listContainerClasses", { + get: function () { + var containerClasses = ['k-list-container', 'k-reset']; + if (this.popupSettings.popupClass) { + containerClasses.push(this.popupSettings.popupClass); + } + return containerClasses; + }, + enumerable: true, + configurable: true + }); + ComboBoxComponent.prototype._toggle = function (open) { + var _this = this; + this._open = open; + if (this.popupRef) { + this.popupRef.popupElement + .removeEventListener('mousedown', this.popupMouseDownHandler); + this.popupRef.close(); + this.popupRef = null; + } + if (this._open) { + this.popupRef = this.popupService.open({ + anchor: this.wrapper, + animate: this.popupSettings.animate, + content: this.popupTemplate, + popupClass: this.listContainerClasses + }); + var popupWrapper = this.popupRef.popupElement; + var _a = this.width, min = _a.min, max = _a.max; + popupWrapper.addEventListener('mousedown', this.popupMouseDownHandler); + popupWrapper.style.minWidth = min; + popupWrapper.style.width = max; + this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.popupOpen = false; }); + } + }; + return ComboBoxComponent; +}()); +ComboBoxComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoComboBox', + providers: [exports.COMBOBOX_VALUE_ACCESSOR, selection_service_1.SelectionService, navigation_service_1.NavigationService], + selector: 'kendo-combobox', + template: "\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n \n \n \n
NO DATA FOUND.
\n
\n
\n \n \n \n
\n
\n \n " + },] }, +]; +/** @nocollapse */ +ComboBoxComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, + { type: kendo_angular_popup_1.PopupService, }, + { type: selection_service_1.SelectionService, }, + { type: navigation_service_1.NavigationService, }, + { type: core_1.ElementRef, }, +]; }; +ComboBoxComponent.propDecorators = { + 'allowCustom': [{ type: core_1.Input },], + 'data': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'textField': [{ type: core_1.Input },], + 'valueField': [{ type: core_1.Input },], + 'valuePrimitive': [{ type: core_1.Input },], + 'valueNormalizer': [{ type: core_1.Input },], + 'placeholder': [{ type: core_1.Input },], + 'popupSettings': [{ type: core_1.Input },], + 'iconClass': [{ type: core_1.Input },], + 'loading': [{ type: core_1.Input },], + 'suggest': [{ type: core_1.Input },], + 'clearButton': [{ type: core_1.Input },], + 'disabled': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'filterable': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'selectionChange': [{ type: core_1.Output },], + 'filterChange': [{ type: core_1.Output },], + 'open': [{ type: core_1.Output },], + 'close': [{ type: core_1.Output },], + 'onFocus': [{ type: core_1.Output, args: ['focus',] },], + 'onBlur': [{ type: core_1.Output, args: ['blur',] },], + 'template': [{ type: core_1.ContentChild, args: [item_template_directive_1.ItemTemplateDirective,] },], + 'headerTemplate': [{ type: core_1.ContentChild, args: [header_template_directive_1.HeaderTemplateDirective,] },], + 'footerTemplate': [{ type: core_1.ContentChild, args: [footer_template_directive_1.FooterTemplateDirective,] },], + 'noDataTemplate': [{ type: core_1.ContentChild, args: [no_data_template_directive_1.NoDataTemplateDirective,] },], + 'popupTemplate': [{ type: core_1.ViewChild, args: ['popupTemplate',] },], + 'searchbar': [{ type: core_1.ViewChild, args: [searchbar_component_1.SearchBarComponent,] },], + 'widgetClasses': [{ type: core_1.HostBinding, args: ['class.k-widget',] }, { type: core_1.HostBinding, args: ['class.k-combobox',] }, { type: core_1.HostBinding, args: ['class.k-header',] },], + 'clearable': [{ type: core_1.HostBinding, args: ['class.k-combobox-clearable',] },], + 'widgetHeight': [{ type: core_1.HostBinding, args: ['style.max-height',] },], + 'dir': [{ type: core_1.HostBinding, args: ['attr.dir',] },], +}; +exports.ComboBoxComponent = ComboBoxComponent; + + +/***/ }), +/* 180 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var combobox_component_1 = __webpack_require__(179); +var shared_module_1 = __webpack_require__(55); +var shared_directives_module_1 = __webpack_require__(38); +var COMBOBOX_DIRECTIVES = [ + combobox_component_1.ComboBoxComponent +]; +/** + * @hidden + * + * The exported package module. + * + * The package exports: + * - `ComboBoxComponent`—The ComboBox component class. + * - `ItemTemplateDirective`—The item template directive. + * - `HeaderTemplateDirective`—The header template directive. + * - `FooterTemplateDirective`—The footer template directive. + */ +var ComboBoxModule = (function () { + function ComboBoxModule() { + } + return ComboBoxModule; +}()); +ComboBoxModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [COMBOBOX_DIRECTIVES], + exports: [COMBOBOX_DIRECTIVES, shared_directives_module_1.SharedDirectivesModule], + imports: [shared_module_1.SharedModule] + },] }, +]; +/** @nocollapse */ +ComboBoxModule.ctorParameters = function () { return []; }; +exports.ComboBoxModule = ComboBoxModule; + + +/***/ }), +/* 181 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +/* tslint:disable:max-line-length */ +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +var Observable_1 = __webpack_require__(1); +__webpack_require__(21); +__webpack_require__(88); +__webpack_require__(33); +__webpack_require__(90); +__webpack_require__(91); +__webpack_require__(145); +__webpack_require__(47); +__webpack_require__(301); +var keys_1 = __webpack_require__(36); +var util_1 = __webpack_require__(24); +var kendo_dropdowns_common_1 = __webpack_require__(139); +var selection_service_1 = __webpack_require__(37); +var navigation_service_1 = __webpack_require__(74); +var item_template_directive_1 = __webpack_require__(41); +var value_template_directive_1 = __webpack_require__(103); +var header_template_directive_1 = __webpack_require__(40); +var footer_template_directive_1 = __webpack_require__(39); +var no_data_template_directive_1 = __webpack_require__(56); +var navigation_action_1 = __webpack_require__(54); +var preventable_event_1 = __webpack_require__(53); +var kendo_angular_l10n_1 = __webpack_require__(2); +var kendo_angular_popup_1 = __webpack_require__(28); +/** + * @hidden + */ +exports.DROPDOWNLIST_VALUE_ACCESSOR = { + multi: true, + provide: forms_1.NG_VALUE_ACCESSOR, + // tslint:disable-next-line:no-use-before-declare + useExisting: core_1.forwardRef(function () { return DropDownListComponent; }) +}; +/** + * Represents the Kendo UI DropDownList component for Angular. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * class AppComponent { + * public listItems: Array = ["Item 1", "Item 2", "Item 3", "Item 4"]; + * } + * ``` + */ +var DropDownListComponent = (function () { + function DropDownListComponent(rtl, popupService, selectionService, navigationService, _zone) { + this.popupService = popupService; + this.selectionService = selectionService; + this.navigationService = navigationService; + this._zone = _zone; + /** + * Sets the disabled state of the component. + */ + this.disabled = false; + /** + * Enables the [filtering]({% slug overview_ddl_kendouiforangular %}#toc-filtering) functionality of the DropDownList. + */ + this.filterable = false; + /** + * Enables a case-insensitive search. When `filtration` is disabled, use this option. + */ + this.ignoreCase = true; + /** + * Sets the delay before an item search is performed. When `filtration` is disabled, use this option. + */ + this.delay = 500; + /** + * Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component. + */ + this.tabIndex = 0; + /** + * Fires each time the value is changed. + * + * For more details, refer to the section on the [`valueChange`]({% slug overview_ddl_kendouiforangular %}#toc-on-value-change) event. + */ + this.valueChange = new core_1.EventEmitter(); + /** + * Fires each time the user types in the filter input. You can filter the source based on the passed filtration value. + * + * For more details, refer to the section on the [`filterChange`]({% slug overview_ddl_kendouiforangular %}#toc-on-filter-change) event. + */ + this.filterChange = new core_1.EventEmitter(); + /** + * Fires each time the item selection is changed. + * + * For more details, refer to the section on the [`selectionChange`]({% slug overview_ddl_kendouiforangular %}#toc-on-change-of-item-selection) event. + */ + this.selectionChange = new core_1.EventEmitter(); + /** + * Fires each time the popup is about to open. + * This event is preventable. If you cancel the event, the popup will remain closed. + */ + this.open = new core_1.EventEmitter(); + /** + * Fires each time the popup is about to close. + * This event is preventable. If you cancel the event, the popup will remain opened. + */ + this.close = new core_1.EventEmitter(); + /** + * Fires each time the user focuses the DropDownList component. + */ + this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * Fires each time the DropDownList component gets blurred. + */ + this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + this.listBoxId = util_1.guid(); + this.optionPrefix = util_1.guid(); + this.filterText = ""; + this.isFocused = false; + this.onTouchedCallback = function (_) { }; + this.onChangeCallback = function (_) { }; + this.word = ""; + this.last = ""; + this.filterFocused = new core_1.EventEmitter(); + this.wrapperBlurred = new core_1.EventEmitter(); + this._open = false; + this._popupSettings = { height: 200, animate: true }; + this.direction = rtl ? 'rtl' : 'ltr'; + this.data = []; + this.subscribeEvents(); + this.popupMouseDownHandler = this.onMouseDown.bind(this); + } + Object.defineProperty(DropDownListComponent.prototype, "width", { + get: function () { + var wrapperWidth = util_1.isDocumentAvailable() ? this.wrapper.nativeElement.offsetWidth : 0; + var width = this.popupSettings.width || wrapperWidth; + var minWidth = isNaN(wrapperWidth) ? wrapperWidth : wrapperWidth + "px"; + var maxWidth = isNaN(width) ? width : width + "px"; + return { min: minWidth, max: maxWidth }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "height", { + get: function () { + return this.popupSettings.height; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "popupOpen", { + get: function () { + return this._open; + }, + set: function (open) { + if (this.disabled || this.popupOpen === open) { + return; + } + var eventArgs = new preventable_event_1.PreventableEvent(); + if (open) { + this.open.emit(eventArgs); + } + else { + this.close.emit(eventArgs); + } + if (eventArgs.isDefaultPrevented()) { + return; + } + this._toggle(open); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "widgetTabIndex", { + get: function () { + return this.disabled ? undefined : this.tabIndex; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "ariaHasPopup", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "ariaExpanded", { + get: function () { + return this.popupOpen; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "ariaOwns", { + get: function () { + return this.listBoxId; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "ariaActivedescendant", { + get: function () { + return this.optionPrefix + "-" + util_1.getter(this.value, this.valueField); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "data", { + get: function () { + return this._data; + }, + /** + * Sets the data of the DropDownList. + * + * > The data has to be provided in an array-like list. + */ + set: function (data) { + this._data = data || []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "value", { + get: function () { + return this._value; + }, + /** + * Sets the value of the DropDownList. It could be either of the primitive (string, numbers) or of the complex (objects) type. To define the type, use the `valuePrimitive` option. + * + * > Selected values that are not present in the source are ignored. + */ + set: function (newValue) { + this.verifySettings(newValue); + this._value = newValue; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "popupSettings", { + get: function () { + return this._popupSettings; + }, + /** + * Configures the popup of the DropDownList. + * + * The available options are: + * - `animation: Boolean`—Controls the popup animation. By default, the open and close animations are enabled. + * - `width: Number`—Sets the width of the popup container. By default, the width of the host element is used. + * - `height: Number`—Sets the height of the popup container. By default, the height is 200px. + * - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup. + */ + set: function (settings) { + this._popupSettings = Object.assign({ height: 200, animate: true }, settings); + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + DropDownListComponent.prototype.blurComponent = function () { + this.wrapperBlurred.emit(); + }; + /** + * @hidden + */ + DropDownListComponent.prototype.focusComponent = function () { + if (!this.isFocused) { + this.isFocused = true; + this.onFocus.emit(); + } + }; + /** + * @hidden + */ + DropDownListComponent.prototype.keydown = function (event) { + var hasSelected = util_1.isPresent(this.selectionService.selected[0]); + var focused = isNaN(this.selectionService.focused) ? 0 : this.selectionService.focused; + var offset = 0; + if (this.disabled) { + return; + } + if (!hasSelected) { + if (event.keyCode === keys_1.Keys.down) { + offset = -1; + } + else if (event.keyCode === keys_1.Keys.up) { + offset = 1; + } + } + var eventData = event; + var action = this.navigationService.process({ + current: focused + offset, + max: this.data.length - 1, + min: this.defaultItem ? -1 : 0, + originalEvent: eventData + }); + var leftRightKeys = (action === navigation_action_1.NavigationAction.Left) || (action === navigation_action_1.NavigationAction.Right); + if (action !== navigation_action_1.NavigationAction.Undefined && + action !== navigation_action_1.NavigationAction.Tab && + action !== navigation_action_1.NavigationAction.Backspace && + action !== navigation_action_1.NavigationAction.Delete && + !(leftRightKeys && this.filterable) && + (action !== navigation_action_1.NavigationAction.Enter || (action === navigation_action_1.NavigationAction.Enter && this.popupOpen))) { + eventData.preventDefault(); + } + }; + /** + * @hidden + */ + DropDownListComponent.prototype.keypress = function (event) { + if (!this.filterable) { + this.onKeyPress(event); + } + }; + /** + * @hidden + */ + DropDownListComponent.prototype.click = function () { + this.wrapper.nativeElement.focus(); + this.popupOpen = !this.popupOpen; + }; + /** + * @hidden + */ + DropDownListComponent.prototype.onResize = function () { + if (this._open) { + var popupWrapper = this.popupRef.popupElement; + var _a = this.width, min = _a.min, max = _a.max; + popupWrapper.style.minWidth = min; + popupWrapper.style.width = max; + } + }; + Object.defineProperty(DropDownListComponent.prototype, "widgetClasses", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + DropDownListComponent.prototype.onFilterFocus = function () { + this.filterFocused.emit(); + }; + /** + * @hidden + */ + DropDownListComponent.prototype.popupOpened = function () { + if (this.filterInput) { + var nativeElement_1 = this.filterInput.nativeElement; + var text_1 = this.filterText || nativeElement_1.value; + this.nextTick(function () { + nativeElement_1.focus(); + nativeElement_1.setSelectionRange(text_1.length, text_1.length); + }); + } + }; + /** + * @hidden + */ + DropDownListComponent.prototype.ngOnDestroy = function () { + this._toggle(false); + this.unsubscribeEvents(); + }; + /** + * @hidden + */ + DropDownListComponent.prototype.ngOnChanges = function (_changes) { + if (this.valuePrimitive === undefined) { + this.valuePrimitive = this.valueField ? false : true; + } + this.setState(this.value); + }; + /** + * Focuses the DropDownList component. + */ + DropDownListComponent.prototype.focus = function () { + if (!this.disabled) { + this.wrapper.nativeElement.focus(); + } + }; + /** + * Blurs the DropDownList component. + */ + DropDownListComponent.prototype.blur = function () { + if (!this.disabled) { + this.wrapper.nativeElement.blur(); + } + }; + /** + * Toggles the visibility of the popup. If you use the `toggle` method to open or close the popup, the `open` and `close` events will not be fired. + * + * @param open - The state of the popup. + */ + DropDownListComponent.prototype.toggle = function (open) { + var _this = this; + Promise.resolve(null).then(function () { + _this._toggle((open === undefined) ? !_this._open : open); + }); + }; + Object.defineProperty(DropDownListComponent.prototype, "isOpen", { + /** + * Returns the current open state of the popup. + */ + get: function () { + return this.popupOpen; + }, + enumerable: true, + configurable: true + }); + /** + * Resets the value of the DropDownList. + */ + DropDownListComponent.prototype.reset = function () { + this.setState(undefined); + }; + /** + * @hidden + */ + DropDownListComponent.prototype.writeValue = function (newValue) { + this.verifySettings(newValue); + this.setState(newValue); + }; + /** + * @hidden + */ + DropDownListComponent.prototype.registerOnChange = function (fn) { + this.onChangeCallback = fn; + }; + /** + * @hidden + */ + DropDownListComponent.prototype.registerOnTouched = function (fn) { + this.onTouchedCallback = fn; + }; + /** + * @hidden + */ + DropDownListComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + Object.defineProperty(DropDownListComponent.prototype, "listContainerClasses", { + /** + * @hidden + */ + get: function () { + var containerClasses = ['k-list-container', 'k-reset']; + if (this.popupSettings.popupClass) { + containerClasses.push(this.popupSettings.popupClass); + } + return containerClasses; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DropDownListComponent.prototype, "buttonClasses", { + /** + * @hidden + */ + get: function () { + return _a = {}, + _a[this.iconClass] = !this.loading && this.iconClass, + _a['k-i-arrow-s'] = !this.loading && !this.iconClass, + _a['k-i-loading'] = this.loading, + _a['k-icon'] = true, + _a; + var _a; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + DropDownListComponent.prototype.setDefaultItemClasses = function () { + return { + 'k-list-optionlabel': true + }; + }; + /** + * @hidden + */ + DropDownListComponent.prototype.getText = function () { + return this.text; + }; + /** + * @hidden + */ + DropDownListComponent.prototype.getDefaultItemText = function () { + return util_1.getter(this.defaultItem, this.textField); + }; + DropDownListComponent.prototype._toggle = function (open) { + var _this = this; + this._open = open; + if (this.popupRef) { + this.popupRef.popupElement + .removeEventListener('mousedown', this.popupMouseDownHandler); + this.popupRef.close(); + this.popupRef = null; + } + if (this._open) { + this.popupRef = this.popupService.open({ + anchor: this.wrapper, + animate: this.popupSettings.animate, + content: this.popupTemplate, + popupClass: this.listContainerClasses + }); + var popupWrapper = this.popupRef.popupElement; + var _a = this.width, min = _a.min, max = _a.max; + popupWrapper.addEventListener('mousedown', this.popupMouseDownHandler); + popupWrapper.style.minWidth = min; + popupWrapper.style.width = max; + this.popupRef.popupOpen.subscribe(this.popupOpened.bind(this)); + this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.popupOpen = false; }); + } + }; + DropDownListComponent.prototype.subscribeEvents = function () { + var _this = this; + if (!util_1.isDocumentAvailable()) { + return; + } + this.changeSubscription = this.selectionService.onChange.subscribe(this.handleItemChange.bind(this)); + this.selectSubscription = this.selectionService.onSelect.subscribe(this.handleItemSelect.bind(this)); + this.navigationSubscription = Observable_1.Observable.merge(this.navigationService.up, this.navigationService.down, this.navigationService.left.skipWhile(function () { return _this.filterable; }), this.navigationService.right.skipWhile(function () { return _this.filterable; }), this.navigationService.home, this.navigationService.end) + .subscribe(function (event) { return _this.selectionService.select(event.index); }); + this.openSubscription = this.navigationService.open.subscribe(function () { return _this.popupOpen = true; }); + this.closeSubscription = this.navigationService.close.subscribe(function () { + _this.popupOpen = false; + _this.wrapper.nativeElement.focus(); + }); + this.enterSubscription = this.navigationService.enter + .merge(this.navigationService.esc) + .subscribe(this.handleEnter.bind(this)); + this._zone.runOutsideAngular(function () { + _this.componentBlurredSubscription = _this.wrapperBlurred + .concatMap(function () { return Observable_1.Observable.interval(10).take(1).takeUntil(_this.filterFocused); }) + .merge(_this.navigationService.tab) + .filter(function () { return _this.isFocused; }) + .subscribe(function () { return _this._zone.run(function () { + _this.componentBlur(); + }); }); + }); + }; + DropDownListComponent.prototype.unsubscribeEvents = function () { + if (!util_1.isDocumentAvailable()) { + return; + } + this.changeSubscription.unsubscribe(); + this.selectSubscription.unsubscribe(); + this.navigationSubscription.unsubscribe(); + this.openSubscription.unsubscribe(); + this.closeSubscription.unsubscribe(); + this.enterSubscription.unsubscribe(); + this.componentBlurredSubscription.unsubscribe(); + }; + DropDownListComponent.prototype.handleItemChange = function (event) { + var index = event.indices.length ? event.indices[0] : undefined; + if (!util_1.isPresent(index)) { + return; + } + var dataItem = util_1.isPresent(this.data[index]) ? this.data[index] : this.defaultItem; + this.change(dataItem); + }; + DropDownListComponent.prototype.handleItemSelect = function (event) { + var index = event.indices.length ? event.indices[0] : undefined; + if (!util_1.isPresent(index)) { + return; + } + var dataItem = util_1.isPresent(this.data[index]) ? this.data[index] : this.defaultItem; + if (this.popupOpen) { + this.dataItem = dataItem; + this.value = this.valuePrimitive ? util_1.getter(dataItem, this.valueField) : dataItem; + this.text = util_1.getter(dataItem, this.textField); + this.selectionChange.emit(dataItem); + } + else { + this.change(dataItem); + } + }; + DropDownListComponent.prototype.handleEnter = function () { + if (this.popupOpen) { + this.change(this.data[this.selectionService.focused]); + this.wrapper.nativeElement.focus(); + } + }; + DropDownListComponent.prototype.verifySettings = function (newValue) { + var valueOrText = !util_1.isPresent(this.valueField) !== !util_1.isPresent(this.textField); + if (!core_1.isDevMode()) { + return; + } + if (this.defaultItem && this.valueField && typeof this.defaultItem !== "object") { + throw new Error("defaultItem and data items must be of same type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/api/DropDownListComponent/#toc-defaultitem"); + } + if (this.valuePrimitive === true && util_1.isPresent(newValue) && typeof newValue === "object") { + throw new Error("Expected initial value of primitive type. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/#toc-value-selection"); + } + if (this.valuePrimitive === false && util_1.isPresent(newValue) && typeof newValue !== "object") { + throw new Error("Expected initial value of type Object. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/#toc-value-selection"); + } + if (valueOrText) { + throw new Error("Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/dropdownlist/#toc-bind-to-arrays-of-complex-data"); + } + }; + DropDownListComponent.prototype.componentBlur = function () { + if (util_1.getter(this._previousValue, this.valueField) !== util_1.getter(this.value, this.valueField)) { + this.change(this.value); + } + else { + this.popupOpen = false; + } + if (this.isFocused) { + this.isFocused = false; + this.onBlur.emit(); + this.onTouchedCallback(); + } + }; + /** + * @hidden + */ + DropDownListComponent.prototype.onMouseDown = function (event) { + var tagName = event.target.tagName.toLowerCase(); + if (tagName !== "input") { + event.preventDefault(); + } + }; + DropDownListComponent.prototype.onKeyPress = function (event) { + if (event.which === 0 || event.keyCode === keys_1.Keys.enter) { + return; + } + var character = String.fromCharCode(event.charCode || event.keyCode); + if (this.ignoreCase) { + character = character.toLowerCase(); + } + if (character === " ") { + event.preventDefault(); + } + this.word += character; + this.last = character; + this.search(); + }; + DropDownListComponent.prototype.search = function () { + var _this = this; + clearTimeout(this.typingTimeout); + if (!this.filterable) { + this.typingTimeout = setTimeout(function () { _this.word = ""; }, this.delay); + this.selectNext(); + } + }; + DropDownListComponent.prototype.selectNext = function () { + var data = this.data.map(function (item, index) { + return { item: item, itemIndex: index }; + }); + var isInLoop = kendo_dropdowns_common_1.DropDownsUtil.sameCharsOnly(this.word, this.last); + var dataLength = data.length; + var startIndex = isNaN(this.selectionService.selected[0]) ? 0 : this.selectionService.selected[0]; + var text, index, defaultItem; + if (this.defaultItem) { + defaultItem = { item: this.defaultItem, itemIndex: -1 }; + dataLength += 1; + startIndex += 1; + } + startIndex += isInLoop ? 1 : 0; + data = kendo_dropdowns_common_1.DropDownsUtil.shuffleData(data, startIndex, defaultItem); + index = 0; + for (; index < dataLength; index++) { + text = util_1.getter(data[index].item, this.textField); + var loopMatch = Boolean(isInLoop && kendo_dropdowns_common_1.DropDownsUtil.matchText(text, this.last, this.ignoreCase)); + var nextMatch = Boolean(kendo_dropdowns_common_1.DropDownsUtil.matchText(text, this.word, this.ignoreCase)); + if (loopMatch || nextMatch) { + index = data[index].itemIndex; + break; + } + } + if (index !== dataLength) { + this.navigate(index); + } + }; + DropDownListComponent.prototype.change = function (dataItem) { + dataItem = dataItem || this.defaultItem; + this.popupOpen = false; + if (util_1.getter(this._previousValue, this.valueField) === util_1.getter(dataItem, this.valueField)) { + return; + } + var primitiveValue = util_1.getter(dataItem, this.valueField); + this.dataItem = dataItem; + this.value = this.valuePrimitive ? primitiveValue : dataItem; + this.text = util_1.getter(dataItem, this.textField); + this._previousValue = this.value; + this.selectionChange.emit(this.valuePrimitive ? primitiveValue : this.value); + this.onChangeCallback(this.valuePrimitive ? primitiveValue : this.value); + this.valueChange.emit(this.valuePrimitive ? primitiveValue : this.value); + if (this.filterable && this.filterText) { + this.filterText = ""; + this.filterChange.emit(this.filterText); + } + }; + DropDownListComponent.prototype.navigate = function (index) { + this.selectionService.select(index); + }; + DropDownListComponent.prototype.setState = function (value) { + var newValue = util_1.isPresent(util_1.getter(value, this.valueField)) ? util_1.getter(value, this.valueField) : value; + var dataItemCandidate; + var valueCandidate; + var textCandidate; + if (!this.data.length) { + if (util_1.isPresent(value)) { + valueCandidate = dataItemCandidate = value; + } + else { + valueCandidate = this.valuePrimitive ? util_1.getter(this.defaultItem, this.valueField) : this.defaultItem; + dataItemCandidate = this.defaultItem; + } + textCandidate = util_1.getter(util_1.isPresent(value) ? value : this.defaultItem, this.textField); + } + else { + this.verifySettings(value); + var result = util_1.resolveValue({ + data: this.data, + defaultItem: this.defaultItem, + value: newValue, + valueField: this.valueField + }); + if (result.dataItem) { + this.selectionService.resetSelection(result.selected); + if (this.filterText) { + this.selectionService.focused = 0; + } + dataItemCandidate = result.dataItem; + valueCandidate = this.valuePrimitive ? util_1.getter(result.dataItem, this.valueField) : result.dataItem; + textCandidate = util_1.getter(result.dataItem, this.textField); + } + else if (util_1.isPresent(value)) { + this.selectionService.resetSelection([]); + this.selectionService.focused = 0; + dataItemCandidate = this.dataItem; + valueCandidate = this.value; + textCandidate = this.text; + } + else { + this.selectionService.resetSelection(this.defaultItem ? [-1] : []); + this.selectionService.focused = 0; + dataItemCandidate = this.defaultItem; + valueCandidate = this.valuePrimitive ? util_1.getter(this.defaultItem, this.valueField) : this.defaultItem; + textCandidate = util_1.getter(this.defaultItem, this.textField); + } + } + this.dataItem = dataItemCandidate; + this.value = valueCandidate; + this.text = textCandidate; + this._previousValue = this.value; + }; + /** + * @hidden + */ + DropDownListComponent.prototype.handleFilter = function (event) { + this.filterChange.emit(event.target.value); + }; + DropDownListComponent.prototype.nextTick = function (f) { + var _this = this; + this._zone.runOutsideAngular(function () { + //use setTimeout instead of resolved promise + //as the latter doesn't wait enough + setTimeout(function () { return _this._zone.run(f); }); + }); + }; + return DropDownListComponent; +}()); +DropDownListComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoDropDownList', + providers: [exports.DROPDOWNLIST_VALUE_ACCESSOR, selection_service_1.SelectionService, navigation_service_1.NavigationService], + selector: 'kendo-dropdownlist', + template: "\n \n \n \n \n {{ getText() }}\n \n \n \n \n \n \n\n \n \n \n \n \n \n \n \n
\n {{ getDefaultItemText() }}\n
\n
\n \n
\n \n \n
\n
\n \n \n \n \n \n \n \n
\n \n \n \n
NO DATA FOUND.
\n
\n
\n \n \n \n
\n
\n \n " + },] }, +]; +/** @nocollapse */ +DropDownListComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, + { type: kendo_angular_popup_1.PopupService, }, + { type: selection_service_1.SelectionService, }, + { type: navigation_service_1.NavigationService, }, + { type: core_1.NgZone, }, +]; }; +DropDownListComponent.propDecorators = { + 'iconClass': [{ type: core_1.Input },], + 'loading': [{ type: core_1.Input },], + 'data': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'textField': [{ type: core_1.Input },], + 'valueField': [{ type: core_1.Input },], + 'popupSettings': [{ type: core_1.Input },], + 'defaultItem': [{ type: core_1.Input },], + 'disabled': [{ type: core_1.Input },], + 'filterable': [{ type: core_1.Input },], + 'ignoreCase': [{ type: core_1.Input },], + 'delay': [{ type: core_1.Input },], + 'valuePrimitive': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'filterChange': [{ type: core_1.Output },], + 'selectionChange': [{ type: core_1.Output },], + 'open': [{ type: core_1.Output },], + 'close': [{ type: core_1.Output },], + 'onFocus': [{ type: core_1.Output, args: ['focus',] },], + 'onBlur': [{ type: core_1.Output, args: ['blur',] },], + 'itemTemplate': [{ type: core_1.ContentChild, args: [item_template_directive_1.ItemTemplateDirective,] },], + 'valueTemplate': [{ type: core_1.ContentChild, args: [value_template_directive_1.ValueTemplateDirective,] },], + 'headerTemplate': [{ type: core_1.ContentChild, args: [header_template_directive_1.HeaderTemplateDirective,] },], + 'footerTemplate': [{ type: core_1.ContentChild, args: [footer_template_directive_1.FooterTemplateDirective,] },], + 'noDataTemplate': [{ type: core_1.ContentChild, args: [no_data_template_directive_1.NoDataTemplateDirective,] },], + 'filterInput': [{ type: core_1.ViewChild, args: ['filterInput',] },], + 'popupTemplate': [{ type: core_1.ViewChild, args: ['popupTemplate',] },], + 'wrapper': [{ type: core_1.ViewChild, args: ['wrapper',] },], + 'widgetClasses': [{ type: core_1.HostBinding, args: ['class.k-widget',] }, { type: core_1.HostBinding, args: ['class.k-dropdown',] }, { type: core_1.HostBinding, args: ['class.k-header',] },], +}; +exports.DropDownListComponent = DropDownListComponent; + + +/***/ }), +/* 182 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var dropdownlist_component_1 = __webpack_require__(181); +var value_template_directive_1 = __webpack_require__(103); +var shared_module_1 = __webpack_require__(55); +var shared_directives_module_1 = __webpack_require__(38); +var DROPDOWNLIST_DIRECTIVES = [ + dropdownlist_component_1.DropDownListComponent, + value_template_directive_1.ValueTemplateDirective +]; +/** + * @hidden + * + * The exported package module. + * + * The package exports: + * - `DropDownListComponent`—The DropDownList component class. + * - `ItemTemplateDirective`—The item template directive. + * - `ValueTemplateDirective`—The value template directive. + * - `HeaderTemplateDirective`—The header template directive. + * - `FooterTemplateDirective`—The footer template directive. + */ +var DropDownListModule = (function () { + function DropDownListModule() { + } + return DropDownListModule; +}()); +DropDownListModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [DROPDOWNLIST_DIRECTIVES], + exports: [DROPDOWNLIST_DIRECTIVES, shared_directives_module_1.SharedDirectivesModule], + imports: [shared_module_1.SharedModule] + },] }, +]; +/** @nocollapse */ +DropDownListModule.ctorParameters = function () { return []; }; +exports.DropDownListModule = DropDownListModule; + + +/***/ }), +/* 183 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +var ListItemDirective = (function () { + function ListItemDirective(element) { + this.element = element; + } + return ListItemDirective; +}()); +ListItemDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: 'li' // tslint:disable-line + },] }, +]; +/** @nocollapse */ +ListItemDirective.ctorParameters = function () { return [ + { type: core_1.ElementRef, }, +]; }; +exports.ListItemDirective = ListItemDirective; + + +/***/ }), +/* 184 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_dropdowns_common_1 = __webpack_require__(139); +var list_item_directive_1 = __webpack_require__(183); +var util_1 = __webpack_require__(24); +var selection_service_1 = __webpack_require__(37); +__webpack_require__(34); +__webpack_require__(47); +/** + * @hidden + */ +var ListComponent = (function () { + function ListComponent(selectionService) { + this.data = []; + this.selected = []; + this.focused = -1; + this.multipleSelection = false; + this.onClick = new core_1.EventEmitter(); + this.selectionService = selectionService; + this.scrollSubscription = this.selectionService + .onSelect + .map(function (args) { return args.indices[0]; }) + .merge(this.selectionService.onFocus) + .subscribe(this.scrollToItem.bind(this)); + } + ListComponent.prototype.ngAfterViewInit = function () { + if (this.show === true) { + this.scrollToItem(this.selectionService.focused); + } + }; + ListComponent.prototype.ngOnDestroy = function () { + this.scrollSubscription.unsubscribe(); + }; + ListComponent.prototype.setContainerClasses = function () { + return { + 'k-list-scroller': true + }; + }; + ListComponent.prototype.getHeight = function () { + return this.height + "px"; + }; + ListComponent.prototype.getText = function (dataItem) { + return kendo_dropdowns_common_1.DropDownsUtil.getter(dataItem, this.textField); + }; + ListComponent.prototype.getValue = function (dataItem) { + return kendo_dropdowns_common_1.DropDownsUtil.getter(dataItem, this.valueField); + }; + ListComponent.prototype.scrollToItem = function (index) { + var items = this.items.toArray(); + if (util_1.isPresent(items[index]) && index !== -1) { + this.scroll(items[index].element); + } + }; + ListComponent.prototype.scroll = function (item) { + if (!item) { + return; + } + var nativeElement = item.nativeElement; + var content = this.content.nativeElement, itemOffsetTop = nativeElement.offsetTop, itemOffsetHeight = nativeElement.offsetHeight, contentScrollTop = content.scrollTop, contentOffsetHeight = content.clientHeight, bottomDistance = itemOffsetTop + itemOffsetHeight; + if (contentScrollTop > itemOffsetTop) { + contentScrollTop = itemOffsetTop; + } + else if (bottomDistance > (contentScrollTop + contentOffsetHeight)) { + contentScrollTop = (bottomDistance - contentOffsetHeight); + } + content.scrollTop = contentScrollTop; + }; + return ListComponent; +}()); +ListComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-list', + template: "\n
\n
    \n
  • \n \n \n {{ getText(dataItem) }}\n
  • \n
\n
\n " + },] }, +]; +/** @nocollapse */ +ListComponent.ctorParameters = function () { return [ + { type: selection_service_1.SelectionService, }, +]; }; +ListComponent.propDecorators = { + 'data': [{ type: core_1.Input },], + 'selected': [{ type: core_1.Input },], + 'focused': [{ type: core_1.Input },], + 'textField': [{ type: core_1.Input },], + 'valueField': [{ type: core_1.Input },], + 'height': [{ type: core_1.Input },], + 'template': [{ type: core_1.Input },], + 'show': [{ type: core_1.Input },], + 'id': [{ type: core_1.Input },], + 'optionPrefix': [{ type: core_1.Input },], + 'multipleSelection': [{ type: core_1.Input },], + 'onClick': [{ type: core_1.Output },], + 'items': [{ type: core_1.ViewChildren, args: [list_item_directive_1.ListItemDirective,] },], + 'content': [{ type: core_1.ViewChild, args: ['content',] },], +}; +exports.ListComponent = ListComponent; + + +/***/ }), +/* 185 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:max-line-length */ +var util_1 = __webpack_require__(24); +var searchbar_component_1 = __webpack_require__(75); +var core_1 = __webpack_require__(0); +var Subscription_1 = __webpack_require__(11); +var forms_1 = __webpack_require__(12); +var selection_service_1 = __webpack_require__(37); +var navigation_service_1 = __webpack_require__(74); +var navigation_action_1 = __webpack_require__(54); +var keys_1 = __webpack_require__(36); +var item_template_directive_1 = __webpack_require__(41); +var header_template_directive_1 = __webpack_require__(40); +var footer_template_directive_1 = __webpack_require__(39); +var tag_template_directive_1 = __webpack_require__(189); +var no_data_template_directive_1 = __webpack_require__(56); +var error_messages_1 = __webpack_require__(351); +var preventable_event_1 = __webpack_require__(53); +var kendo_angular_l10n_1 = __webpack_require__(2); +var kendo_angular_popup_1 = __webpack_require__(28); +var MULTISELECT_VALUE_ACCESSOR = { + multi: true, + provide: forms_1.NG_VALUE_ACCESSOR, + // tslint:disable-next-line:no-use-before-declare + useExisting: core_1.forwardRef(function () { return MultiSelectComponent; }) +}; +/** + * Represents the Kendo UI MultiSelect component for Angular. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * class AppComponent { + * public listItems: Array = ["Item 1", "Item 2", "Item 3", "Item 4"]; + * } + * ``` + */ +var MultiSelectComponent = (function () { + function MultiSelectComponent(rtl, popupService, selectionService, navigationService) { + this.popupService = popupService; + this.selectionService = selectionService; + this.navigationService = navigationService; + this.activeId = util_1.guid(); + this.listBoxId = util_1.guid(); + this.focusedTagIndex = undefined; + /** + * Controls whether to close the MultiSelect suggestion list after item selection. + * @default true + */ + this.autoClose = true; + /** + * Specifies the [`tabIndex`](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) of the component. + */ + this.tabIndex = 0; + /** + * Sets the disabled state of the component. + */ + this.disabled = false; + /** + * Enables the [filtering]({% slug overview_multiselect_kendouiforangular %}#toc-filtering) functionality of the MultiSelect. + */ + this.filterable = false; + /** + * Unless this options is set to `false`, a button will appear when hovering over the component. Clicking that button resets the component value to an empty array and triggers the `change` event. + */ + this.clearButton = true; + /** + * Fires each time the user types in the filter input. You can filter the source based on the passed filtration value. + */ + this.filterChange = new core_1.EventEmitter(); + /** + * Fires each time the value is changed. + * + * For more details, refer to the section on the [`valueChange`]({% slug overview_multiselect_kendouiforangular %}#toc-on-value-change) event. + */ + this.valueChange = new core_1.EventEmitter(); + /** + * Fires each time the popup is about to open. + * This event is preventable. If you cancel the event, the popup will remain closed. + */ + this.open = new core_1.EventEmitter(); + /** + * Fires each time the popup is about to close. + * This event is preventable. If you cancel the event, the popup will remain opened. + */ + this.close = new core_1.EventEmitter(); + /** + * Fires each time the user focuses the AutoComplete component. + */ + this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * Fires each time the AutoComplete component gets blurred. + */ + this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + this.onChangeCallback = function (_) { }; + this.onTouchedCallback = function (_) { }; + this._data = []; + this._placeholder = ''; + this._open = false; + this._value = []; + this.selectedDataItems = []; + this._popupSettings = { height: 200, animate: true }; + this.observableSubscriptions = new Subscription_1.Subscription(); + this.changeSubscription = new Subscription_1.Subscription(); + this.isFocused = false; + this.wrapperBlurred = new core_1.EventEmitter(); + this.popupMouseDownHandler = this.onMouseDown.bind(this); + this.direction = rtl ? 'rtl' : 'ltr'; + this.subscribeEvents(); + } + Object.defineProperty(MultiSelectComponent.prototype, "popupOpen", { + get: function () { + return this._open; + }, + set: function (open) { + if (this.disabled || this.popupOpen === open) { + return; + } + var eventArgs = new preventable_event_1.PreventableEvent(); + if (open) { + this.open.emit(eventArgs); + } + else { + this.close.emit(eventArgs); + } + if (eventArgs.isDefaultPrevented()) { + return; + } + this._toggle(open); + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + MultiSelectComponent.prototype.focusComponent = function () { + if (!this.isFocused) { + this.isFocused = true; + this.onFocus.emit(); + } + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.blurComponent = function () { + if (this.isFocused) { + this.closePopup(); + this.isFocused = false; + this.onBlur.emit(); + this.onTouchedCallback(); + } + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.wrapperMousedown = function (event) { + event.preventDefault(); + this.searchbar.focus(); + this.popupOpen = !this.popupOpen; + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.onResize = function () { + if (this._open) { + var popupWrapper = this.popupRef.popupElement; + var _a = this.width, min = _a.min, max = _a.max; + popupWrapper.style.minWidth = min; + popupWrapper.style.width = max; + } + }; + Object.defineProperty(MultiSelectComponent.prototype, "data", { + get: function () { + return this._data; + }, + /** + * Sets the data of the MultiSelect. + * + * > The data has to be provided in an array of items. + */ + set: function (data) { + this._data = data || []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MultiSelectComponent.prototype, "value", { + get: function () { + return this._value; + }, + /** + * Sets the value of the MultiSelect. It could be either of the primitive (string, numbers) or of the complex (objects) type. Use the `valuePrimitive` option to define the type. + * + * > Selected values that are not present in the source are ignored. + */ + set: function (values) { + this._value = values ? values : []; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MultiSelectComponent.prototype, "placeholder", { + get: function () { + return this.selectedDataItems.length ? '' : this._placeholder; + }, + /** + * The hint displayed when the component is empty. Will not be displayed when values are selected. + */ + set: function (text) { + this._placeholder = text || ''; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MultiSelectComponent.prototype, "popupSettings", { + get: function () { + return this._popupSettings; + }, + /** + * Configures the popup of the MultiSelect. + * + * The available options are: + * - `animation: Boolean`—Controls the popup animation. By default, the open and close animations are enabled. + * - `width: Number`—Sets the width of the popup container. By default, the width of the host element is used. + * - `height: Number`—Sets the height of the popup container. By default, the height is 200px. + * - `popupClass: String`—Specifies a list of CSS classes that are used to style the popup. + */ + set: function (settings) { + this._popupSettings = Object.assign({ height: 200, animate: true }, settings); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MultiSelectComponent.prototype, "widgetClasses", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MultiSelectComponent.prototype, "dir", { + get: function () { + return this.direction; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MultiSelectComponent.prototype, "focusedClass", { + get: function () { + return this.isFocused; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MultiSelectComponent.prototype, "disabledClass", { + get: function () { + return this.disabled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MultiSelectComponent.prototype, "listContainerClasses", { + get: function () { + var containerClasses = ['k-list-container', 'k-reset']; + if (this.popupSettings.popupClass) { + containerClasses.push(this.popupSettings.popupClass); + } + return containerClasses; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MultiSelectComponent.prototype, "width", { + get: function () { + var wrapperOffsetWidth = 0; + if (util_1.isDocumentAvailable()) { + wrapperOffsetWidth = this.wrapper.nativeElement.offsetWidth; + } + var width = this.popupSettings.width || wrapperOffsetWidth; + var minWidth = isNaN(wrapperOffsetWidth) ? wrapperOffsetWidth : wrapperOffsetWidth + "px"; + var maxWidth = isNaN(width) ? width : width + "px"; + return { min: minWidth, max: maxWidth }; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + MultiSelectComponent.prototype.popupOpened = function () { + this.popupWidth = this.width.max; + this.popupMinWidth = this.width.min; + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.onMouseDown = function (event) { + var tagName = event.target.tagName.toLowerCase(); + if (tagName !== "input") { + event.preventDefault(); + } + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.verifySettings = function () { + var valueOrText = !util_1.isPresent(this.valueField) !== !util_1.isPresent(this.textField); + if (!core_1.isDevMode() || this.value.length === 0) { + return; + } + if (!util_1.isArray(this.value)) { + throw new Error(error_messages_1.MultiselectMessages.array); + } + if (this.valuePrimitive === true && util_1.isObjectArray(this.value)) { + throw new Error(error_messages_1.MultiselectMessages.primitive); + } + if (this.valuePrimitive === false && !util_1.isObjectArray(this.value)) { + throw new Error(error_messages_1.MultiselectMessages.object); + } + if (valueOrText) { + throw new Error("Expected textField and valueField options to be set. See http://www.telerik.com/kendo-angular-ui/components/dropdowns/multiselect/#toc-bind-to-arrays-of-complex-data"); + } + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.change = function (event) { + var _this = this; + if (util_1.isPresent(event.added)) { + var dataItem = this.data[event.added]; + var newItem = (this.valuePrimitive && util_1.isPresent(dataItem[this.valueField])) ? dataItem[this.valueField] : + dataItem; + this.value = this.value.concat([newItem]); + } + if (util_1.isPresent(event.removed)) { + var dataItem_1 = this.data[event.removed]; + if (this.valuePrimitive) { + var index = this.value.indexOf(util_1.isPresent(dataItem_1[this.valueField]) ? dataItem_1[this.valueField] : dataItem_1); + this.value.splice(index, 1); + } + else { + this.value = this.value.filter(function (item) { return item[_this.valueField] !== dataItem_1[_this.valueField]; }); + } + } + this.emitValueChange(); + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.setState = function (value) { + var objectArray = util_1.isObjectArray(value); + var selection = util_1.selectedIndices(this.value, this.data, this.valueField); + this.selectionService.resetSelection(selection); + if (this.popupOpen && this.selectionService.focused === undefined && this.data.length) { + this.selectionService.focused = 0; + } + if (this.selectedDataItems.length <= 0) { + if (this.valuePrimitive && !this.valueField) { + this.selectedDataItems = value.slice(); + } + if (objectArray || this.valuePrimitive && this.valueField) { + this.selectedDataItems = util_1.resolveAllValues(value, this.data, this.valueField); + } + } + this.tags = this.selectedDataItems; + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.handleBlur = function () { + this.wrapperBlurred.emit(); + // this.closePopup(); + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.handleFilter = function (text) { + this.text = text; + this.searchbar.resizeInput(this.text.length); + if (this.filterable) { + this.filterChange.emit(text); + } + else { + this.search(text); + } + this.openPopup(); + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.handleNavigate = function (event) { + var navigateInput = this.text && event.keyCode !== keys_1.Keys.down && event.keyCode !== keys_1.Keys.up; + var selectValue = this.text && event.keyCode === keys_1.Keys.enter || event.keyCode === keys_1.Keys.esc; + var deleteTag = !this.text && event.keyCode === keys_1.Keys.backspace && this.tags.length > 0; + if (deleteTag) { + this.handleBackspace(); + return; + } + if (this.disabled || navigateInput && !selectValue) { + return; + } + var eventData = event; + var focused = isNaN(this.selectionService.focused) ? -1 : this.selectionService.focused; + var action = this.navigationService.process({ + current: focused, + max: this.data.length - 1, + min: 0, + open: this.popupOpen, + originalEvent: eventData + }); + if (action !== navigation_action_1.NavigationAction.Undefined && + ((action === navigation_action_1.NavigationAction.Enter && this.popupOpen) || action !== navigation_action_1.NavigationAction.Enter)) { + event.preventDefault(); + } + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.removeTag = function (dataItem) { + var _this = this; + var index = util_1.selectedIndices([dataItem], this.data, this.valueField)[0]; + if (util_1.isNumber(index)) { + this.selectionService.unselect(index); + this.popupOpen = false; + } + else { + var filter = function (item) { return util_1.getter(item, _this.valueField) !== util_1.getter(dataItem, _this.valueField); }; + this.value = this.value.filter(filter); + this.tags = this.selectedDataItems = this.selectedDataItems.filter(filter); + this.emitValueChange(); + } + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.clearAll = function (event) { + event.stopImmediatePropagation(); + if (this.filterable) { + this.filterChange.emit(""); + } + this.value = []; + this.selectedDataItems = []; + this.emitValueChange(); + this.setState([]); + }; + MultiSelectComponent.prototype.ngAfterContentChecked = function () { + this.verifySettings(); + }; + MultiSelectComponent.prototype.ngOnChanges = function (changes) { + var _this = this; + if (this.valuePrimitive === undefined) { + this.valuePrimitive = !this.valueField; + } + if (changes.value && this.selectedDataItems.length > 0) { + //peristed selected data items when list is filtered + this.selectedDataItems = this.selectedDataItems.concat(this.data).filter(function (curr) { + return changes.value.currentValue.find(function (item) { return item[_this.valueField] === curr; }); + }).filter(function (dataItem) { return !!dataItem; }); //filter undefined values + } + var STATE_PROPS = /(data|value|textField|valueField|valuePrimitive)/g; + if (STATE_PROPS.test(Object.keys(changes).join())) { + this.setState(this.value); + } + }; + MultiSelectComponent.prototype.ngAfterViewInit = function () { + var _this = this; + this.searchbar.resizeInput(Math.max(1, this.placeholder.length)); + this.observableSubscriptions.add(this.searchbar.onFocus.subscribe(function (event) { + if (!_this.isFocused) { + _this.isFocused = true; + _this.onFocus.emit(event); + } + })); + this.observableSubscriptions.add(this.searchbar.onBlur.subscribe(function (event) { + if (_this.isFocused) { + _this.isFocused = false; + _this.onBlur.emit(event); + _this.onTouchedCallback(); + } + })); + }; + MultiSelectComponent.prototype.ngOnDestroy = function () { + this._toggle(false); + this.unsubscribeEvents(); + }; + /** + * Focuses the MultiSelect component. + */ + MultiSelectComponent.prototype.focus = function () { + if (!this.disabled) { + this.searchbar.focus(); + } + }; + /** + * Blurs the MultiSelect component. + */ + MultiSelectComponent.prototype.blur = function () { + if (!this.disabled) { + this.searchbar.blur(); + } + }; + /** + * Toggles the visibility of the popup. If you use the `toggle` method to open or close the popup, the `open` and `close` events will not be fired. + * + * @param open - The state of the popup. + */ + MultiSelectComponent.prototype.toggle = function (open) { + var _this = this; + Promise.resolve(null).then(function () { + _this._toggle((open === undefined) ? !_this._open : open); + }); + }; + Object.defineProperty(MultiSelectComponent.prototype, "isOpen", { + /** + * Returns the current open state of the popup. + */ + get: function () { + return this.popupOpen; + }, + enumerable: true, + configurable: true + }); + /** + * Resets the value of the MultiSelect. + */ + MultiSelectComponent.prototype.reset = function () { + this.value = []; + this.selectedDataItems = []; + this.setState([]); + }; + //NG MODEL BINDINGS + /** + * @hidden + */ + MultiSelectComponent.prototype.writeValue = function (value) { + this.value = value || []; + this.selectedDataItems = []; + this.setState(this.value); + this.verifySettings(); + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.registerOnChange = function (fn) { + this.onChangeCallback = fn; + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.registerOnTouched = function (fn) { + this.onTouchedCallback = fn; + }; + /** + * @hidden + */ + MultiSelectComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + MultiSelectComponent.prototype.subscribeEvents = function () { + var _this = this; + if (!util_1.isDocumentAvailable()) { + return; + } + this.observableSubscriptions = this.changeSubscription = this.selectionService.onChange.subscribe(this.handleItemChange.bind(this)); + var isOpen = function () { return _this.popupOpen; }; + var isClosed = function () { return !_this.popupOpen; }; + var isTagFocused = function () { return !_this.popupOpen && _this.focusedTagIndex !== undefined; }; + [ + this.navigationService.esc.subscribe(this.closePopup.bind(this)), + this.navigationService.enter.filter(isOpen).subscribe(this.handleEnter.bind(this)), + this.navigationService.open.subscribe(this.openPopup.bind(this)), + this.navigationService.close.subscribe(this.handleClose.bind(this)), + this.navigationService.up.filter(isOpen).subscribe(function (event) { return _this.handleUp(event.index); }), + this.navigationService.home.filter(isClosed).subscribe(this.handleHome.bind(this)), + this.navigationService.end.filter(isClosed).subscribe(this.handleEnd.bind(this)), + this.navigationService.backspace.filter(isTagFocused).subscribe(this.handleBackspace.bind(this)), + this.navigationService.delete.filter(isTagFocused).subscribe(this.handleDelete.bind(this)), + this.navigationService.left.subscribe(this.handleLeftKey.bind(this)), + this.navigationService.right.subscribe(this.handleRightKey.bind(this)), + this.navigationService.down.subscribe(function (event) { return _this.handleDownKey(event.index); }) + ].forEach(function (s) { return _this.observableSubscriptions.add(s); }); + }; + MultiSelectComponent.prototype.unsubscribeEvents = function () { + if (!util_1.isDocumentAvailable()) { + return; + } + this.observableSubscriptions.unsubscribe(); + }; + MultiSelectComponent.prototype.handleItemChange = function (event) { + if (util_1.isPresent(event.added)) { + this.addItem(event.added); + } + else if (util_1.isPresent(event.removed)) { + this.removeItem(event.removed); + } + this.change(event); + if (this.autoClose) { + this.popupOpen = false; + } + }; + MultiSelectComponent.prototype.handleEnter = function (event) { + var focusedIndex = this.selectionService.focused; + if (this.popupOpen) { + event.originalEvent.preventDefault(); + } + if (focusedIndex === -1) { + return; + } + if (this.selectionService.isSelected(focusedIndex)) { + this.selectionService.unselect(focusedIndex); + } + else { + this.selectionService.add(focusedIndex); + } + this.handleFilter(''); + if (this.autoClose) { + this.popupOpen = false; + } + }; + MultiSelectComponent.prototype.handleClose = function () { + this.closePopup(); + this.searchbar.focus(); + }; + MultiSelectComponent.prototype.handleEnd = function () { + this.focusedTagIndex = this.tags.length - 1; + }; + MultiSelectComponent.prototype.handleHome = function () { + this.focusedTagIndex = 0; + }; + MultiSelectComponent.prototype.handleUp = function (index) { + this.selectionService.focused = index; + }; + MultiSelectComponent.prototype.handleBackspace = function () { + if (this.focusedTagIndex !== undefined) { + this.handleDelete(); + return; + } + this.focusedTagIndex = this.tags.length - 1; + var dataItem = this.tags[this.focusedTagIndex]; + var tagIndex = util_1.selectedIndices([dataItem], this.data, this.valueField)[0]; + this.selectionService.unselect(tagIndex); + this.focusedTagIndex = undefined; + this.searchbar.focus(); + }; + MultiSelectComponent.prototype.handleDelete = function () { + var dataItem = this.tags[this.focusedTagIndex]; + var tagIndex = util_1.selectedIndices([dataItem], this.data, this.valueField)[0]; + this.selectionService.unselect(tagIndex); + if (this.focusedTagIndex === this.tags.length) { + this.focusedTagIndex = undefined; + } + }; + MultiSelectComponent.prototype.handleLeftKey = function () { + if (this.direction === 'rtl' && this.focusedTagIndex === 0) { + this.focusedTagIndex = undefined; + return; + } + if (this.direction === 'rtl' && this.focusedTagIndex === undefined) { + return; + } + if (this.focusedTagIndex === undefined || this.focusedTagIndex < 0) { + this.focusedTagIndex = this.tags.length - 1; + } + else if (this.focusedTagIndex !== 0) { + this.focusedTagIndex--; + } + }; + MultiSelectComponent.prototype.handleDownKey = function (index) { + if (this.popupOpen) { + this.selectionService.focused = index || 0; + } + else { + this.openPopup(); + } + }; + MultiSelectComponent.prototype.handleRightKey = function () { + var last = this.tags.length - 1; + if (this.direction === 'rtl' && this.focusedTagIndex === undefined) { + this.focusedTagIndex = 0; + return; + } + if (this.direction === 'rtl' && this.focusedTagIndex === last) { + return; + } + if (this.focusedTagIndex === last) { + this.focusedTagIndex = undefined; + } + else if (this.focusedTagIndex < last) { + this.focusedTagIndex++; + } + }; + MultiSelectComponent.prototype.addItem = function (index) { + var dataItem = this.data[index]; + this.selectedDataItems.push(dataItem); + this.handleFilter(''); + }; + MultiSelectComponent.prototype.removeItem = function (index) { + var _this = this; + var indexToRemove = this.selectedDataItems.findIndex(function (item) { return util_1.getter(_this.data[index], _this.valueField) === util_1.getter(item, _this.valueField); }); + this.selectedDataItems.splice(indexToRemove, 1); + }; + MultiSelectComponent.prototype.search = function (text) { + var _this = this; + var index = this.data.findIndex(function (item) { + var itemText = util_1.getter(item, _this.textField); + itemText = itemText === undefined ? "" : itemText.toString().toLowerCase(); + return itemText.startsWith(text.toLowerCase()); + }); + this.selectionService.focused = index; + }; + MultiSelectComponent.prototype.closePopup = function () { + this.popupOpen = false; + this.focusedTagIndex = undefined; + }; + MultiSelectComponent.prototype.openPopup = function () { + this.popupOpen = true; + this.focusedTagIndex = undefined; + }; + MultiSelectComponent.prototype.emitValueChange = function () { + this.onChangeCallback(this.value); + this.valueChange.emit(this.value); + }; + MultiSelectComponent.prototype._toggle = function (open) { + var _this = this; + this._open = open; + if (this.popupRef) { + this.popupRef.popupElement + .removeEventListener('mousedown', this.popupMouseDownHandler); + this.popupRef.close(); + this.popupRef = null; + } + if (this._open) { + this.popupRef = this.popupService.open({ + anchor: this.wrapper, + animate: this.popupSettings.animate, + content: this.popupTemplate, + popupClass: this.listContainerClasses + }); + var popupWrapper = this.popupRef.popupElement; + var _a = this.width, min = _a.min, max = _a.max; + popupWrapper.addEventListener('mousedown', this.popupMouseDownHandler); + popupWrapper.style.minWidth = min; + popupWrapper.style.width = max; + this.popupRef.popupOpen.subscribe(this.popupOpened.bind(this)); + this.popupRef.popupAnchorViewportLeave.subscribe(function () { return _this.popupOpen = false; }); + } + }; + return MultiSelectComponent; +}()); +MultiSelectComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoMultiSelect', + providers: [MULTISELECT_VALUE_ACCESSOR, selection_service_1.SelectionService, navigation_service_1.NavigationService], + selector: 'kendo-multiselect', + template: "\n
\n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n
\n \n \n \n
NO DATA FOUND.
\n
\n
\n \n \n \n
\n \n " + },] }, +]; +/** @nocollapse */ +MultiSelectComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, + { type: kendo_angular_popup_1.PopupService, }, + { type: selection_service_1.SelectionService, }, + { type: navigation_service_1.NavigationService, }, +]; }; +MultiSelectComponent.propDecorators = { + 'autoClose': [{ type: core_1.Input },], + 'loading': [{ type: core_1.Input },], + 'data': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'valueField': [{ type: core_1.Input },], + 'textField': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'placeholder': [{ type: core_1.Input },], + 'disabled': [{ type: core_1.Input },], + 'filterable': [{ type: core_1.Input },], + 'popupSettings': [{ type: core_1.Input },], + 'valuePrimitive': [{ type: core_1.Input },], + 'clearButton': [{ type: core_1.Input },], + 'filterChange': [{ type: core_1.Output },], + 'valueChange': [{ type: core_1.Output },], + 'open': [{ type: core_1.Output },], + 'close': [{ type: core_1.Output },], + 'onFocus': [{ type: core_1.Output, args: ['focus',] },], + 'onBlur': [{ type: core_1.Output, args: ['blur',] },], + 'searchbar': [{ type: core_1.ViewChild, args: [searchbar_component_1.SearchBarComponent,] },], + 'popupTemplate': [{ type: core_1.ViewChild, args: ['popupTemplate',] },], + 'wrapper': [{ type: core_1.ViewChild, args: ['wrapper',] },], + 'template': [{ type: core_1.ContentChild, args: [item_template_directive_1.ItemTemplateDirective,] },], + 'headerTemplate': [{ type: core_1.ContentChild, args: [header_template_directive_1.HeaderTemplateDirective,] },], + 'footerTemplate': [{ type: core_1.ContentChild, args: [footer_template_directive_1.FooterTemplateDirective,] },], + 'tagTemplate': [{ type: core_1.ContentChild, args: [tag_template_directive_1.TagTemplateDirective,] },], + 'noDataTemplate': [{ type: core_1.ContentChild, args: [no_data_template_directive_1.NoDataTemplateDirective,] },], + 'widgetClasses': [{ type: core_1.HostBinding, args: ['class.k-widget',] }, { type: core_1.HostBinding, args: ['class.k-multiselect',] }, { type: core_1.HostBinding, args: ['class.k-header',] },], + 'dir': [{ type: core_1.HostBinding, args: ['attr.dir',] },], + 'focusedClass': [{ type: core_1.HostBinding, args: ['class.k-state-focused',] },], + 'disabledClass': [{ type: core_1.HostBinding, args: ['class.k-state-disabled',] },], +}; +exports.MultiSelectComponent = MultiSelectComponent; + + +/***/ }), +/* 186 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var multiselect_component_1 = __webpack_require__(185); +var taglist_component_1 = __webpack_require__(188); +var tag_template_directive_1 = __webpack_require__(189); +var shared_module_1 = __webpack_require__(55); +var shared_directives_module_1 = __webpack_require__(38); +var MULTISELECT_DIRECTIVES = [ + multiselect_component_1.MultiSelectComponent, + taglist_component_1.TagListComponent, + tag_template_directive_1.TagTemplateDirective +]; +/** + * @hidden + * + * The exported package module. + * + * The package exports: + * - `MultiSelectComponent`—The MultiSelect component class. + * - `ItemTemplateDirective`—The item template directive. + * - `TagTemplateDirective`—The tag template directive. + * - `HeaderTemplateDirective`—The header template directive. + * - `FooterTemplateDirective`—The footer template directive. + * - `NoDataTemplateDirective`—The no-data template directive. + */ +var MultiSelectModule = (function () { + function MultiSelectModule() { + } + return MultiSelectModule; +}()); +MultiSelectModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [MULTISELECT_DIRECTIVES], + exports: [MULTISELECT_DIRECTIVES, shared_directives_module_1.SharedDirectivesModule], + imports: [shared_module_1.SharedModule] + },] }, +]; +/** @nocollapse */ +MultiSelectModule.ctorParameters = function () { return []; }; +exports.MultiSelectModule = MultiSelectModule; + + +/***/ }), +/* 187 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var selection_service_1 = __webpack_require__(37); +/** + * @hidden + */ +var SelectableDirective = (function () { + function SelectableDirective(selectionService) { + this.multipleSelection = false; + this.selectionService = selectionService; + } + Object.defineProperty(SelectableDirective.prototype, "focusedClassName", { + get: function () { + return this.selectionService.isFocused(this.index); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SelectableDirective.prototype, "selectedClassName", { + get: function () { + return this.selectionService.isSelected(this.index); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SelectableDirective.prototype, "ariaSelected", { + get: function () { + return this.selectionService.isSelected(this.index) ? true : undefined; + }, + enumerable: true, + configurable: true + }); + SelectableDirective.prototype.onClick = function (event) { + event.stopPropagation(); + if (this.multipleSelection) { + if (this.selectionService.isSelected(this.index)) { + this.selectionService.unselect(this.index); + } + else { + this.selectionService.add(this.index); + } + } + else { + this.selectionService.change(this.index); + } + }; + return SelectableDirective; +}()); +SelectableDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoDropDownsSelectable]' + },] }, +]; +/** @nocollapse */ +SelectableDirective.ctorParameters = function () { return [ + { type: selection_service_1.SelectionService, }, +]; }; +SelectableDirective.propDecorators = { + 'index': [{ type: core_1.Input },], + 'multipleSelection': [{ type: core_1.Input },], + 'focusedClassName': [{ type: core_1.HostBinding, args: ['class.k-state-focused',] },], + 'selectedClassName': [{ type: core_1.HostBinding, args: ['class.k-state-selected',] },], + 'ariaSelected': [{ type: core_1.HostBinding, args: ['attr.aria-selected',] },], + 'onClick': [{ type: core_1.HostListener, args: ['click', ['$event'],] },], +}; +exports.SelectableDirective = SelectableDirective; + + +/***/ }), +/* 188 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:max-line-length */ +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +var TagListComponent = (function () { + function TagListComponent() { + this.removeTag = new core_1.EventEmitter(); + } + TagListComponent.prototype.tagText = function (tag) { + return tag[this.textField] ? tag[this.textField] : tag; + }; + TagListComponent.prototype.deleteTag = function (event, tag) { + event.preventDefault(); + event.stopImmediatePropagation(); + if (!this.disabled && event.which === 1) { + this.removeTag.emit(tag); + } + }; + TagListComponent.prototype.itemId = function (focused, index) { + return focused === index ? this.activeId : undefined; + }; + return TagListComponent; +}()); +TagListComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-taglist', + template: "\n
    \n
  • \n \n \n \n {{ tagText(dataItem) }}\n \n \n \n \n \n
  • \n
\n " + },] }, +]; +/** @nocollapse */ +TagListComponent.ctorParameters = function () { return []; }; +TagListComponent.propDecorators = { + 'tags': [{ type: core_1.Input },], + 'textField': [{ type: core_1.Input },], + 'focused': [{ type: core_1.Input },], + 'template': [{ type: core_1.Input },], + 'disabled': [{ type: core_1.Input },], + 'activeId': [{ type: core_1.Input },], + 'removeTag': [{ type: core_1.Output },], +}; +exports.TagListComponent = TagListComponent; + + +/***/ }), +/* 189 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/* tslint:disable:max-line-length */ +var core_1 = __webpack_require__(0); +/** + * Used for rendering the selected tag value. It can only be used with the MultiSelect component. + * + * The template context is set to the current MultiSelect. To get a reference to the current data item, use the `let-dataItem` directive. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * {{dataItem}} option + * + * + * ` + * }) + * class AppComponent { + * public items: Array = ["Item 1", "Item 2", "Item 3", "Item 4"]; + * } + * ``` + * + * For more examples, refer to the article on [templates]({% slug overview_ddl_kendouiforangular %}#toc-templates). + */ +var TagTemplateDirective = (function () { + function TagTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return TagTemplateDirective; +}()); +TagTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoMultiSelectTagTemplate]' + },] }, +]; +/** @nocollapse */ +TagTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, }, +]; }; +exports.TagTemplateDirective = TagTemplateDirective; + + +/***/ }), +/* 190 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +var TemplateContextDirective = (function () { + function TemplateContextDirective(viewContainerRef) { + this.viewContainerRef = viewContainerRef; + } + Object.defineProperty(TemplateContextDirective.prototype, "templateContext", { + set: function (context) { + if (this.insertedViewRef) { + this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef)); + this.insertedViewRef = undefined; + } + if (context.templateRef) { + this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context); + } + }, + enumerable: true, + configurable: true + }); + return TemplateContextDirective; +}()); +TemplateContextDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[templateContext]' // tslint:disable-line + },] }, +]; +/** @nocollapse */ +TemplateContextDirective.ctorParameters = function () { return [ + { type: core_1.ViewContainerRef, }, +]; }; +TemplateContextDirective.propDecorators = { + 'templateContext': [{ type: core_1.Input },], +}; +exports.TemplateContextDirective = TemplateContextDirective; + + +/***/ }), +/* 191 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var column_base_1 = __webpack_require__(76); +/** + * Represents the column-group component of the Kendo UI ExcelExport component. + */ +var ColumnGroupComponent = (function (_super) { + __extends(ColumnGroupComponent, _super); + function ColumnGroupComponent(parent) { + var _this = _super.call(this, parent) || this; + _this.parent = parent; + return _this; + } + return ColumnGroupComponent; +}(column_base_1.ColumnBase)); +ColumnGroupComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: column_base_1.ColumnBase, + useExisting: core_1.forwardRef(function () { return ColumnGroupComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-excelexport-column-group', + template: "" + },] }, +]; +/** @nocollapse */ +ColumnGroupComponent.ctorParameters = function () { return [ + { type: column_base_1.ColumnBase, decorators: [{ type: core_1.SkipSelf }, { type: core_1.Host }, { type: core_1.Optional },] }, +]; }; +exports.ColumnGroupComponent = ColumnGroupComponent; + + +/***/ }), +/* 192 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var group_header_template_directive_1 = __webpack_require__(106); +var group_footer_template_directive_1 = __webpack_require__(105); +var footer_template_directive_1 = __webpack_require__(104); +var column_base_1 = __webpack_require__(76); +/** + * Represents the columns of the Kendo UI ExcelExport component for Angular. + */ +var ColumnComponent = (function (_super) { + __extends(ColumnComponent, _super); + function ColumnComponent(parent) { + return _super.call(this, parent) || this; + } + return ColumnComponent; +}(column_base_1.ColumnBase)); +ColumnComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: column_base_1.ColumnBase, + useExisting: core_1.forwardRef(function () { return ColumnComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-excelexport-column', + template: "" + },] }, +]; +/** @nocollapse */ +ColumnComponent.ctorParameters = function () { return [ + { type: column_base_1.ColumnBase, decorators: [{ type: core_1.SkipSelf }, { type: core_1.Host }, { type: core_1.Optional },] }, +]; }; +ColumnComponent.propDecorators = { + 'field': [{ type: core_1.Input },], + 'cellOptions': [{ type: core_1.Input },], + 'groupHeaderCellOptions': [{ type: core_1.Input },], + 'groupFooterCellOptions': [{ type: core_1.Input },], + 'footerCellOptions': [{ type: core_1.Input },], + 'groupHeaderTemplate': [{ type: core_1.ContentChild, args: [group_header_template_directive_1.GroupHeaderTemplateDirective,] },], + 'groupFooterTemplate': [{ type: core_1.ContentChild, args: [group_footer_template_directive_1.GroupFooterTemplateDirective,] },], + 'footerTemplate': [{ type: core_1.ContentChild, args: [footer_template_directive_1.FooterTemplateDirective,] },], +}; +exports.ColumnComponent = ColumnComponent; + + +/***/ }), +/* 193 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_file_saver_1 = __webpack_require__(138); +var kendo_angular_l10n_1 = __webpack_require__(2); +var workbook_1 = __webpack_require__(195); +var column_base_1 = __webpack_require__(76); +/** + * Configures the settings for the Excel export of the Kendo UI Grid. + */ +var ExcelExportComponent = (function () { + function ExcelExportComponent(rtl) { + this.rtl = rtl; + /** + * Specifies the file name of the file exported to Excel. + * @default "Export.xlsx" + */ + this.fileName = 'Export.xlsx'; + /** + * @hidden + */ + this.columns = new core_1.QueryList(); + this.saveFile = this.saveFile.bind(this); + } + /** + * Saves the data to Excel. + * + * @param exportData - An optional parameter. Can be the data that is to be exported or [`WorkbookOptions`]({% slug api_excel-export_workbookoptions_kendouiforangular %}). + */ + ExcelExportComponent.prototype.save = function (exportData) { + this.toDataURL(exportData).then(this.saveFile); + }; + /** + * Returns [`WorkbookOptions`]({% slug api_excel-export_workbookoptions_kendouiforangular %}) based on the specified columns and data. + * + * @param exportData - The optional data to be exported. + * @returns {WorkbookOptions} - The workbook options. + */ + ExcelExportComponent.prototype.workbookOptions = function (exportData) { + var currentData = this.getExportData(exportData); + var options = workbook_1.workbookOptions({ + columns: this.columns, + data: currentData.data, + group: currentData.group, + filterable: this.filterable, + creator: this.creator, + date: this.date, + rtl: this.rtl, + paddingCellOptions: this.paddingCellOptions, + headerPaddingCellOptions: this.headerPaddingCellOptions + }); + return options; + }; + /** + * Returns a promise which will be resolved with the file data URI. + * + * @param exportData - The optional data or [`WorkbookOptions`]({% slug api_excel-export_workbookoptions_kendouiforangular %}) that are to be used to generate the data URI. + * @returns {Promise} - The promise that will be resolved by the file data URI. + */ + ExcelExportComponent.prototype.toDataURL = function (exportData) { + var options = workbook_1.isWorkbookOptions(exportData) ? exportData : this.workbookOptions(exportData); + return workbook_1.toDataURL(options); + }; + ExcelExportComponent.prototype.getExportData = function (exportData) { + var result; + if (exportData) { + if (Array.isArray(exportData)) { + result = { + data: exportData + }; + } + else { + result = exportData; + } + } + else { + result = { + data: this.data, + group: this.group + }; + } + return result; + }; + ExcelExportComponent.prototype.saveFile = function (dataURL) { + kendo_file_saver_1.saveAs(dataURL, this.fileName, { + forceProxy: this.forceProxy, + proxyURL: this.proxyURL + }); + }; + return ExcelExportComponent; +}()); +ExcelExportComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoExcelExport', + selector: 'kendo-excelexport', + template: "" + },] }, +]; +/** @nocollapse */ +ExcelExportComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, +]; }; +ExcelExportComponent.propDecorators = { + 'fileName': [{ type: core_1.Input },], + 'filterable': [{ type: core_1.Input },], + 'creator': [{ type: core_1.Input },], + 'date': [{ type: core_1.Input },], + 'forceProxy': [{ type: core_1.Input },], + 'proxyURL': [{ type: core_1.Input },], + 'data': [{ type: core_1.Input },], + 'group': [{ type: core_1.Input },], + 'paddingCellOptions': [{ type: core_1.Input },], + 'headerPaddingCellOptions': [{ type: core_1.Input },], + 'columns': [{ type: core_1.ContentChildren, args: [column_base_1.ColumnBase, { descendants: true },] },], +}; +exports.ExcelExportComponent = ExcelExportComponent; + + +/***/ }), +/* 194 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +function __export(m) { + for (var p in m) if (!exports.hasOwnProperty(p)) exports[p] = m[p]; +} +Object.defineProperty(exports, "__esModule", { value: true }); +var excel_export_component_1 = __webpack_require__(193); +exports.ExcelExportComponent = excel_export_component_1.ExcelExportComponent; +var excel_export_module_1 = __webpack_require__(353); +exports.ExcelExportModule = excel_export_module_1.ExcelExportModule; +var column_base_1 = __webpack_require__(76); +exports.ColumnBase = column_base_1.ColumnBase; +var column_component_1 = __webpack_require__(192); +exports.ColumnComponent = column_component_1.ColumnComponent; +var column_group_component_1 = __webpack_require__(191); +exports.ColumnGroupComponent = column_group_component_1.ColumnGroupComponent; +var footer_template_directive_1 = __webpack_require__(104); +exports.FooterTemplateDirective = footer_template_directive_1.FooterTemplateDirective; +var group_footer_template_directive_1 = __webpack_require__(105); +exports.GroupFooterTemplateDirective = group_footer_template_directive_1.GroupFooterTemplateDirective; +var group_header_template_directive_1 = __webpack_require__(106); +exports.GroupHeaderTemplateDirective = group_header_template_directive_1.GroupHeaderTemplateDirective; +__export(__webpack_require__(195)); +__export(__webpack_require__(280)); + + +/***/ }), +/* 195 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var kendo_ooxml_1 = __webpack_require__(280); +var exporter_columns_1 = __webpack_require__(354); +/** + * @hidden + */ +exports.workbookOptions = function (options) { + var columns = exporter_columns_1.toExporterColumns(options.columns); + var exporter = new kendo_ooxml_1.ExcelExporter({ + columns: columns, + data: options.data, + filterable: options.filterable, + groups: options.group, + paddingCellOptions: options.paddingCellOptions, + headerPaddingCellOptions: options.headerPaddingCellOptions + }); + var result = exporter.workbook(); + result.creator = options.creator; + result.date = options.date; + result.rtl = options.rtl; + exporter_columns_1.destroyColumns(columns); + return result; +}; +/** + * @hidden + */ +exports.toDataURL = function (options) { + var workbook = new kendo_ooxml_1.Workbook(options); + return workbook.toDataURL(); +}; +/** + * @hidden + */ +exports.isWorkbookOptions = function (value) { + return value && value.sheets; +}; + + +/***/ }), +/* 196 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var common_1 = __webpack_require__(9); +var forms_1 = __webpack_require__(12); +var command_column_component_1 = __webpack_require__(200); +var cell_template_directive_1 = __webpack_require__(57); +var no_records_template_directive_1 = __webpack_require__(124); +var edit_template_directive_1 = __webpack_require__(111); +var selectable_directive_1 = __webpack_require__(244); +var table_body_component_1 = __webpack_require__(246); +var cell_component_1 = __webpack_require__(358); +var edit_command_directive_1 = __webpack_require__(361); +var cancel_command_directive_1 = __webpack_require__(357); +var save_command_directive_1 = __webpack_require__(385); +var remove_command_directive_1 = __webpack_require__(382); +var add_command_directive_1 = __webpack_require__(355); +var shared_module_1 = __webpack_require__(32); +var group_module_1 = __webpack_require__(78); +var kendo_angular_inputs_1 = __webpack_require__(251); +var kendo_angular_dateinputs_1 = __webpack_require__(175); +var exported = [ + command_column_component_1.CommandColumnComponent, + cell_template_directive_1.CellTemplateDirective, + edit_template_directive_1.EditTemplateDirective, + selectable_directive_1.SelectableDirective, + table_body_component_1.TableBodyComponent, + no_records_template_directive_1.NoRecordsTemplateDirective, + cell_component_1.CellComponent, + edit_command_directive_1.EditCommandDirective, + cancel_command_directive_1.CancelCommandDirective, + save_command_directive_1.SaveCommandDirective, + remove_command_directive_1.RemoveCommandDirective, + add_command_directive_1.AddCommandDirective +]; +var importedModules = [ + common_1.CommonModule, + forms_1.ReactiveFormsModule, + forms_1.FormsModule, + shared_module_1.SharedModule, + group_module_1.GroupModule, + kendo_angular_inputs_1.NumericTextBoxModule, + kendo_angular_dateinputs_1.DatePickerModule +]; +/** + * @hidden + */ +var BodyModule = (function () { + function BodyModule() { + } + BodyModule.exports = function () { + return [ + command_column_component_1.CommandColumnComponent, + cell_template_directive_1.CellTemplateDirective, + no_records_template_directive_1.NoRecordsTemplateDirective, + edit_template_directive_1.EditTemplateDirective, + edit_command_directive_1.EditCommandDirective, + cancel_command_directive_1.CancelCommandDirective, + save_command_directive_1.SaveCommandDirective, + remove_command_directive_1.RemoveCommandDirective, + add_command_directive_1.AddCommandDirective + ]; + }; + return BodyModule; +}()); +BodyModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [exported], + exports: [exported], + imports: importedModules.slice() + },] }, +]; +/** @nocollapse */ +BodyModule.ctorParameters = function () { return []; }; +exports.BodyModule = BodyModule; + + +/***/ }), +/* 197 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var column_common_1 = __webpack_require__(22); +/** + * @hidden + */ +var ColGroupComponent = (function () { + function ColGroupComponent() { + this.columns = []; + this.groups = []; + } + Object.defineProperty(ColGroupComponent.prototype, "columnsToRender", { + get: function () { + return column_common_1.columnsToRender(this.columns); + }, + enumerable: true, + configurable: true + }); + return ColGroupComponent; +}()); +ColGroupComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: '[kendoGridColGroup]', + template: "\n \n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +ColGroupComponent.ctorParameters = function () { return []; }; +ColGroupComponent.propDecorators = { + 'columns': [{ type: core_1.Input },], + 'groups': [{ type: core_1.Input },], + 'detailTemplate': [{ type: core_1.Input },], +}; +exports.ColGroupComponent = ColGroupComponent; + + +/***/ }), +/* 198 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forEachColumn = function (list, callback) { + list.forEach(function (column) { + callback(column); + if (column.children && column.children.length > 1) { + forEachColumn(column.children.toArray().slice(1), callback); + } + }); +}; +/** + * @hidden + */ +var ColumnList = (function () { + function ColumnList(columns) { + this.columns = columns; + } + ColumnList.prototype.forEach = function (callback) { + forEachColumn(this.columns, callback); + }; + ColumnList.prototype.filter = function (callback) { + var result = []; + forEachColumn(this.columns, function (column) { + if (callback(column)) { + result.push(column); + } + }); + return result; + }; + ColumnList.prototype.toArray = function () { + var result = []; + forEachColumn(this.columns, function (column) { + result.push(column); + }); + return result; + }; + return ColumnList; +}()); +ColumnList.empty = function () { return new ColumnList(new core_1.QueryList()); }; +exports.ColumnList = ColumnList; + + +/***/ }), +/* 199 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var column_group_component_1 = __webpack_require__(58); +var reset = function () { + var lists = []; + for (var _i = 0; _i < arguments.length; _i++) { + lists[_i] = arguments[_i]; + } + var diff = false; + for (var idx = 0; idx < lists.length; idx++) { + var _a = lists[idx], list = _a[0], columns = _a[1]; + diff = diff || list.length !== columns.length; + list.reset(columns); + } + return diff; +}; +/** + * @hidden + */ +var ColumnsContainer = (function () { + function ColumnsContainer(columns) { + this.columns = columns; + this.allColumns = new core_1.QueryList(); + this.leafColumns = new core_1.QueryList(); + this.lockedColumns = new core_1.QueryList(); + this.nonLockedColumns = new core_1.QueryList(); + this.lockedLeafColumns = new core_1.QueryList(); + this.nonLockedLeafColumns = new core_1.QueryList(); + this.totalLevels = 0; + this.changes = new core_1.EventEmitter(); + } + ColumnsContainer.prototype.refresh = function () { + var _this = this; + var currentLevels = this.totalLevels; + var leafColumns = new Array(); + var lockedLeafColumns = new Array(); + var nonLockedLeafColumns = new Array(); + var lockedColumns = new Array(); + var nonLockedColumns = new Array(); + var allColumns = new Array(); + this.totalLevels = 0; + this.columns().forEach(function (column) { + var containerLeafColumns = column.isLocked === true ? lockedLeafColumns : nonLockedLeafColumns; + var containerColumns = column.isLocked === true ? lockedColumns : nonLockedColumns; + if (!column_group_component_1.isColumnGroupComponent(column)) { + containerLeafColumns.push(column); + leafColumns.push(column); + } + containerColumns.push(column); + allColumns.push(column); + _this.totalLevels = column.level > _this.totalLevels ? column.level : _this.totalLevels; + }); + var changes = reset([this.leafColumns, leafColumns], [this.lockedLeafColumns, lockedLeafColumns], [this.nonLockedLeafColumns, nonLockedLeafColumns], [this.lockedColumns, lockedColumns], [this.allColumns, allColumns], [this.nonLockedColumns, nonLockedColumns]) || currentLevels !== this.totalLevels; + if (changes) { + this.changes.emit(); + } + }; + return ColumnsContainer; +}()); +exports.ColumnsContainer = ColumnsContainer; + + +/***/ }), +/* 200 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var column_base_1 = __webpack_require__(29); +var cell_template_directive_1 = __webpack_require__(57); +/** + * Represents the command columns of the Grid. + * + * You have to define the content of the column inside an `` tag. The template context + * is set to the current data item and the following additional fields are passed: + * - `columnIndex`—The current column index. + * - `rowIndex`—The current row index. If inside a new item row, it will be `-1`. + * - `dataItem`—The current data item. + * - `column`—The current column instance. + * - `isNew`—The state of the current item. + * + * Usually, the template contains CRUD command directives such as: + * - [`EditCommandDirective`]({% slug api_grid_editcommanddirective_kendouiforangular %}) + * - [`RemoveCommandDirective`]({% slug api_grid_removecommanddirective_kendouiforangular %}) + * - [`CancelCommandDirective`]({% slug api_grid_cancelcommanddirective_kendouiforangular %}) + * - [`SaveCommandDirective`]({% slug api_grid_savecommanddirective_kendouiforangular %}) + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * ` + * }) + * + * class AppComponent { + * private gridData: any[]; + * + * constructor() { + * this.gridData = products; + * } + * } + * + * const products = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": true + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": false + * } + * ]; + * + * ``` + */ +var CommandColumnComponent = (function (_super) { + __extends(CommandColumnComponent, _super); + function CommandColumnComponent(parent) { + var _this = _super.call(this, parent) || this; + _this.parent = parent; + return _this; + } + Object.defineProperty(CommandColumnComponent.prototype, "templateRef", { + get: function () { + return this.template ? this.template.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + return CommandColumnComponent; +}(column_base_1.ColumnBase)); +CommandColumnComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: column_base_1.ColumnBase, + useExisting: core_1.forwardRef(function () { return CommandColumnComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-grid-command-column', + template: "" + },] }, +]; +/** @nocollapse */ +CommandColumnComponent.ctorParameters = function () { return [ + { type: column_base_1.ColumnBase, decorators: [{ type: core_1.SkipSelf }, { type: core_1.Host }, { type: core_1.Optional },] }, +]; }; +CommandColumnComponent.propDecorators = { + 'template': [{ type: core_1.ContentChild, args: [cell_template_directive_1.CellTemplateDirective,] },], +}; +exports.CommandColumnComponent = CommandColumnComponent; + + +/***/ }), +/* 201 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_data_query_1 = __webpack_require__(134); +var grid_component_1 = __webpack_require__(59); +var utils_1 = __webpack_require__(7); +/** + * A Directive which encapsulates the in-memory handling of data operations such as paging, sorting, and grouping. + */ +var DataBindingDirective = (function () { + function DataBindingDirective(grid) { + this.grid = grid; + this.state = { + skip: 0 + }; + this.originalData = []; + } + Object.defineProperty(DataBindingDirective.prototype, "skip", { + /** + * Defines the number of records to be skipped by the pager. + */ + set: function (value) { + if (!utils_1.isPresent(value)) { + value = 0; + } + this.grid.skip = this.state.skip = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DataBindingDirective.prototype, "sort", { + /** + * Defines the descriptors by which the data will be sorted. + */ + set: function (value) { + this.grid.sort = this.state.sort = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DataBindingDirective.prototype, "filter", { + /** + * Defines the descriptor by which the data will be filtered. + */ + set: function (value) { + this.grid.filter = this.state.filter = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DataBindingDirective.prototype, "pageSize", { + /** + * Defines the page size used by the Grid pager. + */ + set: function (value) { + this.grid.pageSize = this.state.take = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DataBindingDirective.prototype, "group", { + /** + * The descriptors by which the data will be grouped. + */ + set: function (value) { + this.grid.group = this.state.group = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(DataBindingDirective.prototype, "data", { + /** + * The array of data which will be used to populate the Grid. + */ + set: function (value) { + this.originalData = value || []; + this.grid.data = this.process(this.state); + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + DataBindingDirective.prototype.ngOnInit = function () { + this.applyState(this.state); + this.stateChangeSubscription = this.grid + .dataStateChange + .subscribe(this.onStateChange.bind(this)); + }; + /** + * @hidden + */ + DataBindingDirective.prototype.ngOnDestroy = function () { + this.stateChangeSubscription.unsubscribe(); + }; + /** + * @hidden + */ + DataBindingDirective.prototype.ngOnChanges = function (changes) { + if (utils_1.anyChanged(["pageSize", "skip", "sort", "group", "filter"], changes)) { + this.rebind(); + } + }; + /** + * @hidden + */ + DataBindingDirective.prototype.onStateChange = function (state) { + this.applyState(state); + this.rebind(); + }; + /** + * @hidden + */ + DataBindingDirective.prototype.rebind = function () { + this.data = this.originalData; + this.grid.onDataChange(); + }; + DataBindingDirective.prototype.process = function (state) { + return kendo_data_query_1.process(this.originalData, state); + }; + DataBindingDirective.prototype.applyState = function (_a) { + var skip = _a.skip, take = _a.take, sort = _a.sort, group = _a.group, filter = _a.filter; + this.skip = skip; + this.pageSize = take; + this.sort = sort; + this.group = group; + this.filter = filter; + }; + return DataBindingDirective; +}()); +DataBindingDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridBinding]' + },] }, +]; +/** @nocollapse */ +DataBindingDirective.ctorParameters = function () { return [ + { type: grid_component_1.GridComponent, }, +]; }; +DataBindingDirective.propDecorators = { + 'skip': [{ type: core_1.Input },], + 'sort': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], + 'pageSize': [{ type: core_1.Input },], + 'group': [{ type: core_1.Input },], + 'data': [{ type: core_1.Input, args: ["kendoGridBinding",] },], +}; +exports.DataBindingDirective = DataBindingDirective; + + +/***/ }), +/* 202 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var Observable_1 = __webpack_require__(1); +var kendo_file_saver_1 = __webpack_require__(138); +var kendo_angular_excel_export_1 = __webpack_require__(194); +var kendo_angular_l10n_1 = __webpack_require__(2); +var excel_service_1 = __webpack_require__(112); +var excel_export_event_1 = __webpack_require__(363); +/* tslint:disable object-literal-sort-keys */ +var fetchComponentData = function (component) { + return { + data: component.view.map(function (item) { return item; }), + group: component.group + }; +}; +/** + * Configures the Excel export settings of the Kendo UI Grid. + */ +var ExcelComponent = (function () { + function ExcelComponent(excelService, rtl) { + this.rtl = rtl; + /** + * Specifies the file name of the exported Excel file. + * @default "Export.xlsx" + */ + this.fileName = 'Export.xlsx'; + /** + * @hidden + */ + this.columns = new core_1.QueryList(); + this.saveSubscription = excelService.saveToExcel.subscribe(this.save.bind(this)); + this.saveFile = this.saveFile.bind(this); + } + ExcelComponent.prototype.ngOnDestroy = function () { + this.saveSubscription.unsubscribe(); + if (this.dataSubscription) { + this.dataSubscription.unsubscribe(); + } + }; + ExcelComponent.prototype.save = function (component) { + var _this = this; + var data = (this.fetchData || fetchComponentData)(component); + var exportData = function (result) { + delete _this.dataSubscription; + _this.exportData(component, result); + }; + if (data instanceof Promise) { + data.then(exportData); + } + else if (data instanceof Observable_1.Observable) { + this.dataSubscription = data.take(1).subscribe(exportData); + } + else { + exportData(data); + } + }; + ExcelComponent.prototype.exportData = function (component, result) { + var options = kendo_angular_excel_export_1.workbookOptions({ + columns: this.columns.length ? this.columns : component.columns, + data: result.data, + group: result.group, + filterable: this.filterable, + creator: this.creator, + date: this.date, + paddingCellOptions: this.paddingCellOptions, + headerPaddingCellOptions: this.headerPaddingCellOptions, + rtl: this.rtl + }); + var args = new excel_export_event_1.ExcelExportEvent(options); + component.excelExport.emit(args); + if (!args.isDefaultPrevented()) { + kendo_angular_excel_export_1.toDataURL(options).then(this.saveFile); + } + }; + ExcelComponent.prototype.saveFile = function (dataURL) { + kendo_file_saver_1.saveAs(dataURL, this.fileName, { + forceProxy: this.forceProxy, + proxyURL: this.proxyURL + }); + }; + return ExcelComponent; +}()); +ExcelComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-grid-excel', + template: "" + },] }, +]; +/** @nocollapse */ +ExcelComponent.ctorParameters = function () { return [ + { type: excel_service_1.ExcelService, }, + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, +]; }; +ExcelComponent.propDecorators = { + 'fileName': [{ type: core_1.Input },], + 'filterable': [{ type: core_1.Input },], + 'creator': [{ type: core_1.Input },], + 'date': [{ type: core_1.Input },], + 'forceProxy': [{ type: core_1.Input },], + 'proxyURL': [{ type: core_1.Input },], + 'fetchData': [{ type: core_1.Input },], + 'paddingCellOptions': [{ type: core_1.Input },], + 'headerPaddingCellOptions': [{ type: core_1.Input },], + 'columns': [{ type: core_1.ContentChildren, args: [kendo_angular_excel_export_1.ColumnBase, { descendants: true },] },], +}; +exports.ExcelComponent = ExcelComponent; + + +/***/ }), +/* 203 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +var ExpandStateService = (function () { + function ExpandStateService() { + this.changes = new core_1.EventEmitter(); + this.rowState = []; + } + ExpandStateService.prototype.toggleRow = function (index, dataItem) { + var rowIndex = this.rowState.indexOf(index); + var expand = rowIndex === -1; + this.rowState = expand ? this.rowState.concat([index]) : this.rowState.slice(0, rowIndex).concat(this.rowState.slice(rowIndex + 1)); + this.changes.emit({ dataItem: dataItem, expand: expand, index: index }); + }; + ExpandStateService.prototype.isExpanded = function (index) { + return this.rowState.indexOf(index) >= 0; + }; + return ExpandStateService; +}()); +exports.ExpandStateService = ExpandStateService; + + +/***/ }), +/* 204 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// tslint:disable:no-access-missing-member +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var column_component_1 = __webpack_require__(30); +var filter_service_1 = __webpack_require__(26); +var base_filter_cell_component_1 = __webpack_require__(31); +var kendo_angular_l10n_1 = __webpack_require__(2); +var stringOperators = base_filter_cell_component_1.localizeOperators({ + "filterContainsOperator": "contains", + "filterNotContainsOperator": "doesnotcontain", + // tslint:disable-next-line:object-literal-sort-keys + "filterEqOperator": "eq", + "filterNotEqOperator": "neq", + "filterStartsWithOperator": "startswith", + "filterEndsWithOperator": "endswith", + "filterIsNullOperator": "isnull", + "filterIsNotNullOperator": "isnotnull", + "filterIsEmptyOperator": "isempty", + "filterIsNotEmptyOperator": "isnotempty" +}); +/** + * @hidden + */ +var AutoCompleteFilterCellComponent = (function (_super) { + __extends(AutoCompleteFilterCellComponent, _super); + function AutoCompleteFilterCellComponent(filterService, column, localization) { + var _this = _super.call(this, filterService) || this; + _this.localization = localization; + _this.showOperators = true; + _this.defaultOperators = stringOperators(_this.localization); + _this.column = column; + return _this; + } + Object.defineProperty(AutoCompleteFilterCellComponent.prototype, "valueField", { + get: function () { + return this._valueField ? this._valueField : this.column.field; + }, + set: function (value) { + this._valueField = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteFilterCellComponent.prototype, "currentFilter", { + get: function () { + return this.filterByField(this.column.field); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(AutoCompleteFilterCellComponent.prototype, "currentOperator", { + get: function () { + return this.currentFilter ? this.currentFilter.operator : "contains"; + }, + enumerable: true, + configurable: true + }); + return AutoCompleteFilterCellComponent; +}(base_filter_cell_component_1.BaseFilterCellComponent)); +AutoCompleteFilterCellComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-grid-autocomplete-filter-cell', + template: "\n \n \n
\n \n " + },] }, +]; +/** @nocollapse */ +AutoCompleteFilterCellComponent.ctorParameters = function () { return [ + { type: filter_service_1.FilterService, }, + { type: column_component_1.ColumnComponent, }, + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +AutoCompleteFilterCellComponent.propDecorators = { + 'showOperators': [{ type: core_1.Input },], + 'column': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], + 'data': [{ type: core_1.Input },], + 'valueField': [{ type: core_1.Input },], +}; +exports.AutoCompleteFilterCellComponent = AutoCompleteFilterCellComponent; + + +/***/ }), +/* 205 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +// tslint:disable:no-access-missing-member +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_service_1 = __webpack_require__(26); +var base_filter_cell_component_1 = __webpack_require__(31); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents a Boolean filter-cell component. + * + * @example + * + * ```ts-no-run + * + * + * + * + * + * + * ``` + */ +var BooleanFilterCellComponent = (function (_super) { + __extends(BooleanFilterCellComponent, _super); + function BooleanFilterCellComponent(filterService, localization) { + var _this = _super.call(this, filterService) || this; + _this.localization = localization; + /** + * @hidden + */ + _this.operator = "eq"; + /** + * @hidden + */ + _this.items = [ + { text: _this.localization.get("filterIsTrue"), value: true }, + { text: _this.localization.get("filterIsFalse"), value: false } + ]; + /** + * @hidden + */ + _this.defaultItem = { text: _this.localization.get("filterBooleanAll"), value: null }; + return _this; + } + Object.defineProperty(BooleanFilterCellComponent.prototype, "hostClasses", { + /** + * @hidden + */ + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BooleanFilterCellComponent.prototype, "currentFilter", { + /** + * The current filter for the associated column field. + * @readonly + * @type {FilterDescriptor} + */ + get: function () { + return this.filterByField(this.column.field); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(BooleanFilterCellComponent.prototype, "currentOperator", { + /** + * The current filter operator for the associated column field. + * @readonly + * @type {string} + */ + get: function () { + return this.currentFilter ? this.currentFilter.operator : this.operator; + }, + enumerable: true, + configurable: true + }); + return BooleanFilterCellComponent; +}(base_filter_cell_component_1.BaseFilterCellComponent)); +BooleanFilterCellComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-grid-boolean-filter-cell', + template: "\n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +BooleanFilterCellComponent.ctorParameters = function () { return [ + { type: filter_service_1.FilterService, }, + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +BooleanFilterCellComponent.propDecorators = { + 'hostClasses': [{ type: core_1.HostBinding, args: ['class.k-filtercell-boolean',] },], + 'column': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], +}; +exports.BooleanFilterCellComponent = BooleanFilterCellComponent; + + +/***/ }), +/* 206 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var utils_1 = __webpack_require__(7); +/** + * @hidden + */ +var FilterCellComponent = (function () { + function FilterCellComponent() { + this._templateContext = {}; + } + Object.defineProperty(FilterCellComponent.prototype, "templateContext", { + get: function () { + this._templateContext.column = this.column; + this._templateContext.filter = this.filter; + // tslint:disable-next-line:no-string-literal + this._templateContext["$implicit"] = this.filter; + return this._templateContext; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FilterCellComponent.prototype, "hasTemplate", { + get: function () { + return utils_1.isPresent(this.column.filterCellTemplateRef); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FilterCellComponent.prototype, "isFilterable", { + get: function () { + return utils_1.isPresent(this.column) && !utils_1.isNullOrEmptyString(this.column.field) && this.column.filterable; + }, + enumerable: true, + configurable: true + }); + return FilterCellComponent; +}()); +FilterCellComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: '[kendoGridFilterCell]', + template: "\n \n \n \n \n \n \n \n \n \n \n
\n " + },] }, +]; +/** @nocollapse */ +FilterCellComponent.ctorParameters = function () { return []; }; +FilterCellComponent.propDecorators = { + 'column': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], +}; +exports.FilterCellComponent = FilterCellComponent; + + +/***/ }), +/* 207 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +/** + * @hidden + */ +var FilterInputDirective = (function () { + function FilterInputDirective(valueAccessors) { + this.change = new core_1.EventEmitter(); + this.accessor = valueAccessors[0]; + } + Object.defineProperty(FilterInputDirective.prototype, "value", { + set: function (value) { + this.accessor.writeValue(value); + }, + enumerable: true, + configurable: true + }); + FilterInputDirective.prototype.ngOnInit = function () { + var _this = this; + this.accessor.registerOnChange(function (x) { return _this.change.emit(x); }); + }; + return FilterInputDirective; +}()); +FilterInputDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoFilterInput]' + },] }, +]; +/** @nocollapse */ +FilterInputDirective.ctorParameters = function () { return [ + { type: Array, decorators: [{ type: core_1.Self }, { type: core_1.Inject, args: [forms_1.NG_VALUE_ACCESSOR,] },] }, +]; }; +FilterInputDirective.propDecorators = { + 'value': [{ type: core_1.Input },], +}; +exports.FilterInputDirective = FilterInputDirective; + + +/***/ }), +/* 208 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +var filter_operator_base_1 = __webpack_require__(13); +/** + * Represents the `Contains` (**Contains**) filter operator. + */ +var ContainsFilterOperatorComponent = (function (_super) { + __extends(ContainsFilterOperatorComponent, _super); + function ContainsFilterOperatorComponent(localization) { + return _super.call(this, "contains", localization) || this; + } + return ContainsFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +ContainsFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return ContainsFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-contains-operator', + template: "" + },] }, +]; +/** @nocollapse */ +ContainsFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.ContainsFilterOperatorComponent = ContainsFilterOperatorComponent; + + +/***/ }), +/* 209 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +var filter_operator_base_1 = __webpack_require__(13); +/** + * Represents the `EndsWith` (**Ends with**) string filter operator. + */ +var EndsWithFilterOperatorComponent = (function (_super) { + __extends(EndsWithFilterOperatorComponent, _super); + function EndsWithFilterOperatorComponent(localization) { + return _super.call(this, "endswith", localization) || this; + } + return EndsWithFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +EndsWithFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return EndsWithFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-endswith-operator', + template: "" + },] }, +]; +/** @nocollapse */ +EndsWithFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.EndsWithFilterOperatorComponent = EndsWithFilterOperatorComponent; + + +/***/ }), +/* 210 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents the `Equal` (**Is equal to**) filter operator. + */ +var EqualFilterOperatorComponent = (function (_super) { + __extends(EqualFilterOperatorComponent, _super); + function EqualFilterOperatorComponent(localization) { + return _super.call(this, "eq", localization) || this; + } + return EqualFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +EqualFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return EqualFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-eq-operator', + template: "" + },] }, +]; +/** @nocollapse */ +EqualFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.EqualFilterOperatorComponent = EqualFilterOperatorComponent; + + +/***/ }), +/* 211 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/* + * Represents the `Greater` (**Is greater than**) numeric filter operator. + */ +var GreaterFilterOperatorComponent = (function (_super) { + __extends(GreaterFilterOperatorComponent, _super); + function GreaterFilterOperatorComponent(localization) { + return _super.call(this, "gt", localization) || this; + } + return GreaterFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +GreaterFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return GreaterFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-gt-operator', + template: "" + },] }, +]; +/** @nocollapse */ +GreaterFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.GreaterFilterOperatorComponent = GreaterFilterOperatorComponent; + + +/***/ }), +/* 212 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents the `GreaterOrEqualTo` (**Is greater than or equal to**) numeric filter operator. + */ +var GreaterOrEqualToFilterOperatorComponent = (function (_super) { + __extends(GreaterOrEqualToFilterOperatorComponent, _super); + function GreaterOrEqualToFilterOperatorComponent(localization) { + return _super.call(this, "gte", localization) || this; + } + return GreaterOrEqualToFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +GreaterOrEqualToFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return GreaterOrEqualToFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-gte-operator', + template: "" + },] }, +]; +/** @nocollapse */ +GreaterOrEqualToFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.GreaterOrEqualToFilterOperatorComponent = GreaterOrEqualToFilterOperatorComponent; + + +/***/ }), +/* 213 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents the `IsEmpty` (**Is empty**) filter operator. + */ +var IsEmptyFilterOperatorComponent = (function (_super) { + __extends(IsEmptyFilterOperatorComponent, _super); + function IsEmptyFilterOperatorComponent(localization) { + return _super.call(this, "isempty", localization) || this; + } + return IsEmptyFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +IsEmptyFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return IsEmptyFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-isempty-operator', + template: "" + },] }, +]; +/** @nocollapse */ +IsEmptyFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.IsEmptyFilterOperatorComponent = IsEmptyFilterOperatorComponent; + + +/***/ }), +/* 214 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents the `IsNotEmpty` (**Is not empty**) filter operator. + */ +var IsNotEmptyFilterOperatorComponent = (function (_super) { + __extends(IsNotEmptyFilterOperatorComponent, _super); + function IsNotEmptyFilterOperatorComponent(localization) { + return _super.call(this, "isnotempty", localization) || this; + } + return IsNotEmptyFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +IsNotEmptyFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return IsNotEmptyFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-isempty-operator', + template: "" + },] }, +]; +/** @nocollapse */ +IsNotEmptyFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.IsNotEmptyFilterOperatorComponent = IsNotEmptyFilterOperatorComponent; + + +/***/ }), +/* 215 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents the `IsNotNull` (**Is not null**) filter operator. + */ +var IsNotNullFilterOperatorComponent = (function (_super) { + __extends(IsNotNullFilterOperatorComponent, _super); + function IsNotNullFilterOperatorComponent(localization) { + return _super.call(this, "isnotnull", localization) || this; + } + return IsNotNullFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +IsNotNullFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return IsNotNullFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-isnotnull-operator', + template: "" + },] }, +]; +/** @nocollapse */ +IsNotNullFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.IsNotNullFilterOperatorComponent = IsNotNullFilterOperatorComponent; + + +/***/ }), +/* 216 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents the `IsNull` (**Is null**) filter operator. + */ +var IsNullFilterOperatorComponent = (function (_super) { + __extends(IsNullFilterOperatorComponent, _super); + function IsNullFilterOperatorComponent(localization) { + return _super.call(this, "isnull", localization) || this; + } + return IsNullFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +IsNullFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return IsNullFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-isnull-operator', + template: "" + },] }, +]; +/** @nocollapse */ +IsNullFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.IsNullFilterOperatorComponent = IsNullFilterOperatorComponent; + + +/***/ }), +/* 217 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/* + * Represents the `Less` (**Is less than**) numeric filter operator. + */ +var LessFilterOperatorComponent = (function (_super) { + __extends(LessFilterOperatorComponent, _super); + function LessFilterOperatorComponent(localization) { + return _super.call(this, "lt", localization) || this; + } + return LessFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +LessFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return LessFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-lt-operator', + template: "" + },] }, +]; +/** @nocollapse */ +LessFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.LessFilterOperatorComponent = LessFilterOperatorComponent; + + +/***/ }), +/* 218 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/* + * Represents the `LessOrEqualTo` (**Is less than or equal to**) numeric filter operator. + */ +var LessOrEqualToFilterOperatorComponent = (function (_super) { + __extends(LessOrEqualToFilterOperatorComponent, _super); + function LessOrEqualToFilterOperatorComponent(localization) { + return _super.call(this, "lte", localization) || this; + } + return LessOrEqualToFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +LessOrEqualToFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return LessOrEqualToFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-lte-operator', + template: "" + },] }, +]; +/** @nocollapse */ +LessOrEqualToFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.LessOrEqualToFilterOperatorComponent = LessOrEqualToFilterOperatorComponent; + + +/***/ }), +/* 219 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents the `NotEqual` (**Is not equal to**) filter operator. + */ +var NotEqualFilterOperatorComponent = (function (_super) { + __extends(NotEqualFilterOperatorComponent, _super); + function NotEqualFilterOperatorComponent(localization) { + return _super.call(this, "neq", localization) || this; + } + return NotEqualFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +NotEqualFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return NotEqualFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-neq-operator', + template: "" + },] }, +]; +/** @nocollapse */ +NotEqualFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.NotEqualFilterOperatorComponent = NotEqualFilterOperatorComponent; + + +/***/ }), +/* 220 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents the `DoesNotContain` (**Does not contain**) filter operator. + */ +var DoesNotContainFilterOperatorComponent = (function (_super) { + __extends(DoesNotContainFilterOperatorComponent, _super); + function DoesNotContainFilterOperatorComponent(localization) { + return _super.call(this, "doesnotcontain", localization) || this; + } + return DoesNotContainFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +DoesNotContainFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return DoesNotContainFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-not-contains-operator', + template: "" + },] }, +]; +/** @nocollapse */ +DoesNotContainFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.DoesNotContainFilterOperatorComponent = DoesNotContainFilterOperatorComponent; + + +/***/ }), +/* 221 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var filter_operator_base_1 = __webpack_require__(13); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Represents the `StartsWith` (**Starts with**) filter operator. + */ +var StartsWithFilterOperatorComponent = (function (_super) { + __extends(StartsWithFilterOperatorComponent, _super); + function StartsWithFilterOperatorComponent(localization) { + return _super.call(this, "startswith", localization) || this; + } + return StartsWithFilterOperatorComponent; +}(filter_operator_base_1.FilterOperatorBase)); +StartsWithFilterOperatorComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: filter_operator_base_1.FilterOperatorBase, + useExisting: core_1.forwardRef(function () { return StartsWithFilterOperatorComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-filter-startswith-operator', + template: "" + },] }, +]; +/** @nocollapse */ +StartsWithFilterOperatorComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.StartsWithFilterOperatorComponent = StartsWithFilterOperatorComponent; + + +/***/ }), +/* 222 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var column_common_1 = __webpack_require__(22); +/** + * @hidden + */ +var FooterComponent = (function () { + function FooterComponent() { + this.columns = []; + this.groups = []; + this.lockedColumnsCount = 0; + } + Object.defineProperty(FooterComponent.prototype, "footerClass", { + get: function () { + return !this.scrollable; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(FooterComponent.prototype, "columnsToRender", { + get: function () { + return column_common_1.columnsToRender(this.columns || []); + }, + enumerable: true, + configurable: true + }); + return FooterComponent; +}()); +FooterComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: '[kendoGridFooter]', + template: "\n \n \n \n \n \n \n \n \n \n \n \n
\n " + },] }, +]; +/** @nocollapse */ +FooterComponent.ctorParameters = function () { return []; }; +FooterComponent.propDecorators = { + 'columns': [{ type: core_1.Input },], + 'groups': [{ type: core_1.Input },], + 'detailTemplate': [{ type: core_1.Input },], + 'scrollable': [{ type: core_1.Input },], + 'lockedColumnsCount': [{ type: core_1.Input },], + 'footerClass': [{ type: core_1.HostBinding, args: ['class.k-grid-footer',] },], +}; +exports.FooterComponent = FooterComponent; + + +/***/ }), +/* 223 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var common_1 = __webpack_require__(9); +var shared_module_1 = __webpack_require__(32); +var footer_component_1 = __webpack_require__(222); +var exportedModules = [ + footer_component_1.FooterComponent +]; +var importedModules = [ + common_1.CommonModule, + shared_module_1.SharedModule +]; +/** + * @hidden + */ +var FooterModule = (function () { + function FooterModule() { + } + FooterModule.exports = function () { + return []; + }; + return FooterModule; +}()); +FooterModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [exportedModules], + exports: [exportedModules], + imports: importedModules.slice() + },] }, +]; +/** @nocollapse */ +FooterModule.ctorParameters = function () { return []; }; +exports.FooterModule = FooterModule; + + +/***/ }), +/* 224 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var column_group_component_1 = __webpack_require__(58); +var sort_settings_1 = __webpack_require__(387); +var utils_1 = __webpack_require__(7); +var draggable_directive_1 = __webpack_require__(110); +var group_connection_service_1 = __webpack_require__(118); +var column_common_1 = __webpack_require__(22); +/** + * @hidden + */ +var HeaderComponent = (function () { + function HeaderComponent(groupDragService) { + this.groupDragService = groupDragService; + this.columns = []; + this.groups = []; + this.sort = new Array(); + this.sortable = false; + this.groupable = false; + this.lockedColumnsCount = 0; + this.sortChange = new core_1.EventEmitter(); + } + Object.defineProperty(HeaderComponent.prototype, "headerClass", { + get: function () { + return !this.scrollable; + }, + enumerable: true, + configurable: true + }); + HeaderComponent.prototype.sortColumn = function (column, event, link, icon) { + var target = event ? event.target : null; + if (column.headerTemplateRef && target !== link && target !== icon) { + return false; + } + this.sortChange.emit(this.toggleSort(column)); + //prevent default + return false; + }; + HeaderComponent.prototype.sortIcon = function (field) { + var state = this.sortDescriptor(field); + return { + 'k-icon': utils_1.isPresent(state.dir), + 'k-i-sort-desc-sm': state.dir === "desc", + 'k-i-sort-asc-sm': state.dir === "asc" + }; + }; + HeaderComponent.prototype.toggleSort = function (column) { + var _a = sort_settings_1.normalize(this.sortable, column.sortable), allowUnsort = _a.allowUnsort, mode = _a.mode; + var descriptor = this.toggleDirection(column.field, allowUnsort); + if (mode === 'single') { + return [descriptor]; + } + return this.sort.filter(function (desc) { return desc.field !== column.field; }).concat([descriptor]); + }; + HeaderComponent.prototype.ngAfterViewInit = function () { + var _this = this; + var isNotGrouped = function (_a) { + var column = _a.column; + return _this.groupable && !_this.groups.some(function (group) { return group.field === column.field; }); + }; + this.draggablesSubscription = utils_1.observe(this.draggables).subscribe(function (items) { + return _this.groupDragService.connect(items.filter(function (x) { return utils_1.isPresent(x.column.field); }), isNotGrouped); + }); + }; + HeaderComponent.prototype.ngOnDestroy = function () { + this.groupDragService.unsubscribe(); + if (this.draggablesSubscription) { + this.draggablesSubscription.unsubscribe(); + } + }; + HeaderComponent.prototype.isFirstOnRow = function (column, index) { + var _this = this; + var isTailing = function (c) { return c && + (_this.columnsForLevel(c.level).indexOf(c) > 0 || isTailing(c.parent)); }; + return index === 0 && !this.groups.length && !this.detailTemplate && isTailing(column.parent); + }; + HeaderComponent.prototype.isSortable = function (column) { + return !utils_1.isNullOrEmptyString(column.field) + && utils_1.isTruthy(this.sortable) && utils_1.isTruthy(column.sortable); + }; + HeaderComponent.prototype.toggleDirection = function (field, allowUnsort) { + var descriptor = this.sortDescriptor(field); + var dir = 'asc'; + if (descriptor.dir === 'asc') { + dir = 'desc'; + } + else if (descriptor.dir === 'desc' && allowUnsort) { + dir = undefined; + } + return { dir: dir, field: field }; + }; + HeaderComponent.prototype.columnsForLevel = function (level) { + return column_common_1.columnsToRender(this.columns ? this.columns.filter(function (column) { return column.level === level; }) : []); + }; + HeaderComponent.prototype.isColumnGroupComponent = function (column) { + return column_group_component_1.isColumnGroupComponent(column); + }; + HeaderComponent.prototype.sortDescriptor = function (field) { + return this.sort.find(function (item) { return item.field === field; }) || { field: field }; + }; + Object.defineProperty(HeaderComponent.prototype, "columnLevels", { + get: function () { + return new Array((this.totalColumnLevels || 0) + 1); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(HeaderComponent.prototype, "leafColumns", { + get: function () { + return column_common_1.columnsToRender(this.columns || []).filter(function (x) { return !column_group_component_1.isColumnGroupComponent(x); }); + }, + enumerable: true, + configurable: true + }); + return HeaderComponent; +}()); +HeaderComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [group_connection_service_1.GroupDragService], + selector: '[kendoGridHeader]', + template: "\n \n \n \n \n \n \n \n \n \n \n \n {{column.displayTitle}}\n \n \n \n \n \n {{column.displayTitle}}\n \n \n \n \n \n \n
\n {{column.displayTitle}}\n \n
\n \n \n
\n " + },] }, +]; +/** @nocollapse */ +HeaderComponent.ctorParameters = function () { return [ + { type: group_connection_service_1.GroupDragService, }, +]; }; +HeaderComponent.propDecorators = { + 'totalColumnLevels': [{ type: core_1.Input },], + 'columns': [{ type: core_1.Input },], + 'groups': [{ type: core_1.Input },], + 'detailTemplate': [{ type: core_1.Input },], + 'scrollable': [{ type: core_1.Input },], + 'filterable': [{ type: core_1.Input },], + 'sort': [{ type: core_1.Input },], + 'filter': [{ type: core_1.Input },], + 'sortable': [{ type: core_1.Input },], + 'groupable': [{ type: core_1.Input },], + 'lockedColumnsCount': [{ type: core_1.Input },], + 'sortChange': [{ type: core_1.Output },], + 'headerClass': [{ type: core_1.HostBinding, args: ['class.k-grid-header',] },], + 'draggables': [{ type: core_1.ViewChildren, args: [draggable_directive_1.DraggableDirective,] },], +}; +exports.HeaderComponent = HeaderComponent; + + +/***/ }), +/* 225 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var common_1 = __webpack_require__(9); +var header_component_1 = __webpack_require__(224); +var group_module_1 = __webpack_require__(78); +var shared_module_1 = __webpack_require__(32); +var filtering_module_1 = __webpack_require__(115); +var header_template_directive_1 = __webpack_require__(122); +var exportedModules = [ + header_component_1.HeaderComponent, + header_template_directive_1.HeaderTemplateDirective +]; +var importedModules = [ + common_1.CommonModule, + group_module_1.GroupModule, + filtering_module_1.RowFilterModule, + shared_module_1.SharedModule +]; +/** + * @hidden + */ +var HeaderModule = (function () { + function HeaderModule() { + } + HeaderModule.exports = function () { + return [ + header_template_directive_1.HeaderTemplateDirective + ]; + }; + return HeaderModule; +}()); +HeaderModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [exportedModules], + exports: [exportedModules], + imports: importedModules.slice() + },] }, +]; +/** @nocollapse */ +HeaderModule.ctorParameters = function () { return []; }; +exports.HeaderModule = HeaderModule; + + +/***/ }), +/* 226 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +var messages_1 = __webpack_require__(227); +/** + * Custom component messages override default component messages. + */ +var CustomMessagesComponent = (function (_super) { + __extends(CustomMessagesComponent, _super); + function CustomMessagesComponent(service) { + var _this = _super.call(this) || this; + _this.service = service; + return _this; + } + Object.defineProperty(CustomMessagesComponent.prototype, "override", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + return CustomMessagesComponent; +}(messages_1.Messages)); +CustomMessagesComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: messages_1.Messages, + useExisting: core_1.forwardRef(function () { return CustomMessagesComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-grid-messages', + template: "" + },] }, +]; +/** @nocollapse */ +CustomMessagesComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.CustomMessagesComponent = CustomMessagesComponent; + + +/***/ }), +/* 227 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * @hidden + */ +var Messages = (function (_super) { + __extends(Messages, _super); + function Messages() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Messages; +}(kendo_angular_l10n_1.ComponentMessages)); +Messages.propDecorators = { + 'groupPanelEmpty': [{ type: core_1.Input },], + 'noRecords': [{ type: core_1.Input },], + 'pagerFirstPage': [{ type: core_1.Input },], + 'pagerLastPage': [{ type: core_1.Input },], + 'pagerPreviousPage': [{ type: core_1.Input },], + 'pagerNextPage': [{ type: core_1.Input },], + 'pagerPage': [{ type: core_1.Input },], + 'pagerItemsPerPage': [{ type: core_1.Input },], + 'pagerOf': [{ type: core_1.Input },], + 'pagerItems': [{ type: core_1.Input },], + 'filterEqOperator': [{ type: core_1.Input },], + 'filterNotEqOperator': [{ type: core_1.Input },], + 'filterIsNullOperator': [{ type: core_1.Input },], + 'filterIsNotNullOperator': [{ type: core_1.Input },], + 'filterIsEmptyOperator': [{ type: core_1.Input },], + 'filterIsNotEmptyOperator': [{ type: core_1.Input },], + 'filterStartsWithOperator': [{ type: core_1.Input },], + 'filterContainsOperator': [{ type: core_1.Input },], + 'filterNotContainsOperator': [{ type: core_1.Input },], + 'filterEndsWithOperator': [{ type: core_1.Input },], + 'filterGteOperator': [{ type: core_1.Input },], + 'filterGtOperator': [{ type: core_1.Input },], + 'filterLteOperator': [{ type: core_1.Input },], + 'filterLtOperator': [{ type: core_1.Input },], + 'filterIsTrue': [{ type: core_1.Input },], + 'filterIsFalse': [{ type: core_1.Input },], + 'filterBooleanAll': [{ type: core_1.Input },], + 'filterAfterOrEqualOperator': [{ type: core_1.Input },], + 'filterAfterOperator': [{ type: core_1.Input },], + 'filterBeforeOperator': [{ type: core_1.Input },], + 'filterBeforeOrEqualOperator': [{ type: core_1.Input },], +}; +exports.Messages = Messages; + + +/***/ }), +/* 228 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// tslint:disable:no-access-missing-member +var core_1 = __webpack_require__(0); +var pager_element_component_1 = __webpack_require__(43); +var kendo_angular_l10n_1 = __webpack_require__(2); +var pager_context_service_1 = __webpack_require__(27); +/** + * Displays information about the current page and the total number of records. + */ +var PagerInfoComponent = (function (_super) { + __extends(PagerInfoComponent, _super); + function PagerInfoComponent(localization, cd, pagerContext) { + var _this = _super.call(this, localization, pagerContext) || this; + _this.cd = cd; + _this.pagerContext = pagerContext; + return _this; + } + Object.defineProperty(PagerInfoComponent.prototype, "maxItems", { + /** + * @hidden + * + * @readonly + * @type {number} + * @memberOf PagerInfoComponent + */ + get: function () { + return Math.min(this.currentPage * this.pageSize, this.total); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerInfoComponent.prototype, "currentPageText", { + /** + * @hidden + * + * @readonly + * @type {number} + * @memberOf PagerInfoComponent + */ + get: function () { + return this.total ? + (this.currentPage - 1) * this.pageSize + 1 : + 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerInfoComponent.prototype, "classes", { + /** + * @hidden + * + * @readonly + * @type {boolean} + * @memberOf PagerInfoComponent + */ + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + PagerInfoComponent.prototype.onChanges = function (_a) { + var total = _a.total, skip = _a.skip, pageSize = _a.pageSize; + this.total = total; + this.skip = skip; + this.pageSize = pageSize; + this.cd.markForCheck(); + }; + return PagerInfoComponent; +}(pager_element_component_1.PagerElementComponent)); +PagerInfoComponent.decorators = [ + { type: core_1.Component, args: [{ + changeDetection: core_1.ChangeDetectionStrategy.OnPush, + selector: 'kendo-pager-info', + template: "{{currentPageText}} - {{maxItems}} {{textFor('pagerOf')}} {{total}} {{textFor('pagerItems')}}" + },] }, +]; +/** @nocollapse */ +PagerInfoComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, + { type: core_1.ChangeDetectorRef, }, + { type: pager_context_service_1.PagerContextService, }, +]; }; +PagerInfoComponent.propDecorators = { + 'classes': [{ type: core_1.HostBinding, args: ["class.k-pager-info",] }, { type: core_1.HostBinding, args: ["class.k-label",] },], +}; +exports.PagerInfoComponent = PagerInfoComponent; + + +/***/ }), +/* 229 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// tslint:disable:no-access-missing-member +var core_1 = __webpack_require__(0); +var pager_element_component_1 = __webpack_require__(43); +var kendo_angular_l10n_1 = __webpack_require__(2); +var pager_context_service_1 = __webpack_require__(27); +/** + * Displays an input element which allows typing and rendition of a page number. + */ +var PagerInputComponent = (function (_super) { + __extends(PagerInputComponent, _super); + function PagerInputComponent(localization, pagerContext, cd) { + var _this = _super.call(this, localization, pagerContext) || this; + _this.pagerContext = pagerContext; + _this.cd = cd; + return _this; + } + /** + * @hidden + * + * @param {string} value + * + * @memberOf PagerInputComponent + */ + PagerInputComponent.prototype.onInputChange = function (value) { + var page = parseInt(value, 10); + if (isNaN(page) || page < 1 || page > this.totalPages) { + page = this.currentPage; + } + this.changePage(page - 1); + }; + PagerInputComponent.prototype.onChanges = function (_a) { + var total = _a.total, skip = _a.skip, pageSize = _a.pageSize; + this.total = total; + this.skip = skip; + this.pageSize = pageSize; + this.cd.markForCheck(); + }; + return PagerInputComponent; +}(pager_element_component_1.PagerElementComponent)); +PagerInputComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-pager-input', + template: "\n \n {{textFor('pagerPage')}}\n \n {{textFor('pagerOf')}} {{totalPages}}\n \n " + },] }, +]; +/** @nocollapse */ +PagerInputComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, + { type: pager_context_service_1.PagerContextService, }, + { type: core_1.ChangeDetectorRef, }, +]; }; +exports.PagerInputComponent = PagerInputComponent; + + +/***/ }), +/* 230 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// tslint:disable: no-access-missing-member +var core_1 = __webpack_require__(0); +var pager_context_service_1 = __webpack_require__(27); +var pager_element_component_1 = __webpack_require__(43); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Displays buttons for navigating to the next and the last page. + */ +var PagerNextButtonsComponent = (function (_super) { + __extends(PagerNextButtonsComponent, _super); + function PagerNextButtonsComponent(localization, pagerContext, cd) { + var _this = _super.call(this, localization, pagerContext) || this; + _this.cd = cd; + return _this; + } + Object.defineProperty(PagerNextButtonsComponent.prototype, "disabled", { + /** + * @hidden + * + * @readonly + * @type {boolean} + * @memberOf PagerNextButtonsComponent + */ + get: function () { + return this.currentPage === this.totalPages || !this.total; + }, + enumerable: true, + configurable: true + }); + PagerNextButtonsComponent.prototype.onChanges = function (_a) { + var total = _a.total, skip = _a.skip, pageSize = _a.pageSize; + this.total = total; + this.skip = skip; + this.pageSize = pageSize; + this.cd.markForCheck(); + }; + return PagerNextButtonsComponent; +}(pager_element_component_1.PagerElementComponent)); +PagerNextButtonsComponent.decorators = [ + { type: core_1.Component, args: [{ + changeDetection: core_1.ChangeDetectionStrategy.OnPush, + selector: 'kendo-pager-next-buttons', + template: "\n \n \n \n \n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +PagerNextButtonsComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, + { type: pager_context_service_1.PagerContextService, }, + { type: core_1.ChangeDetectorRef, }, +]; }; +exports.PagerNextButtonsComponent = PagerNextButtonsComponent; + + +/***/ }), +/* 231 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// tslint:disable:no-access-missing-member +var core_1 = __webpack_require__(0); +var pager_context_service_1 = __webpack_require__(27); +var kendo_angular_l10n_1 = __webpack_require__(2); +var pager_element_component_1 = __webpack_require__(43); +/** + * Displays numeric buttons to enable navigation between the pages. + */ +var PagerNumericButtonsComponent = (function (_super) { + __extends(PagerNumericButtonsComponent, _super); + function PagerNumericButtonsComponent(localization, cd, pagerContext) { + var _this = _super.call(this, localization, pagerContext) || this; + _this.cd = cd; + _this.pagerContext = pagerContext; + return _this; + } + Object.defineProperty(PagerNumericButtonsComponent.prototype, "buttons", { + /** + * @hidden + * + * @readonly + * @type {number[]} + * @memberOf PagerNumericButtonsComponent + */ + get: function () { + var result = []; + for (var idx = this.start; idx <= this.end; idx++) { + result.push(idx); + } + return result; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerNumericButtonsComponent.prototype, "end", { + /** + * @hidden + */ + get: function () { + return Math.min((this.start + this.buttonCount) - 1, this.totalPages); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerNumericButtonsComponent.prototype, "start", { + /** + * @hidden + */ + get: function () { + var page = this.currentPage; + var buttonCount = this.buttonCount; + if (page > buttonCount) { + var reminder = (page % buttonCount); + return (reminder === 0) ? (page - buttonCount) + 1 : (page - reminder) + 1; + } + return 1; + }, + enumerable: true, + configurable: true + }); + PagerNumericButtonsComponent.prototype.onChanges = function (_a) { + var total = _a.total, skip = _a.skip, pageSize = _a.pageSize; + this.total = total; + this.skip = skip; + this.pageSize = pageSize; + this.cd.markForCheck(); + }; + return PagerNumericButtonsComponent; +}(pager_element_component_1.PagerElementComponent)); +PagerNumericButtonsComponent.decorators = [ + { type: core_1.Component, args: [{ + changeDetection: core_1.ChangeDetectionStrategy.OnPush, + selector: 'kendo-pager-numeric-buttons', + template: "\n \n " + },] }, +]; +/** @nocollapse */ +PagerNumericButtonsComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, + { type: core_1.ChangeDetectorRef, }, + { type: pager_context_service_1.PagerContextService, }, +]; }; +PagerNumericButtonsComponent.propDecorators = { + 'buttonCount': [{ type: core_1.Input },], +}; +exports.PagerNumericButtonsComponent = PagerNumericButtonsComponent; + + +/***/ }), +/* 232 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// tslint:disable:no-access-missing-member +var core_1 = __webpack_require__(0); +var pager_element_component_1 = __webpack_require__(43); +var kendo_angular_l10n_1 = __webpack_require__(2); +var pager_context_service_1 = __webpack_require__(27); +/** + * Displays a drop-down list for the page size selection. + */ +var PagerPageSizesComponent = (function (_super) { + __extends(PagerPageSizesComponent, _super); + function PagerPageSizesComponent(localization, cd, pagerContext) { + var _this = _super.call(this, localization, pagerContext) || this; + _this.cd = cd; + _this.pagerContext = pagerContext; + return _this; + } + Object.defineProperty(PagerPageSizesComponent.prototype, "classes", { + /** + * @hidden + * + * @readonly + * @type {boolean} + * @memberOf PagerPageSizesComponent + */ + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerPageSizesComponent.prototype, "showInitialPageSize", { + /** + * @hidden + * + * @readonly + * @type {boolean} + * @memberOf PagerPageSizesComponent + */ + get: function () { + var _this = this; + return this.pageSizes + .filter(function (num) { return num === Number(_this.pageSize); }) + .length === 0; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + * + * @param {*} value + * + * @memberOf PagerPageSizesComponent + */ + PagerPageSizesComponent.prototype.pageSizeChange = function (value) { + this.pageSize = parseInt(value, 10); + this.pagerContext.changePageSize(this.pageSize); + }; + PagerPageSizesComponent.prototype.onChanges = function (_a) { + var total = _a.total, skip = _a.skip, pageSize = _a.pageSize; + this.total = total; + this.skip = skip; + this.pageSize = pageSize; + this.cd.markForCheck(); + }; + return PagerPageSizesComponent; +}(pager_element_component_1.PagerElementComponent)); +PagerPageSizesComponent.decorators = [ + { type: core_1.Component, args: [{ + changeDetection: core_1.ChangeDetectionStrategy.OnPush, + selector: 'kendo-pager-page-sizes', + template: "\n \n {{textFor('pagerItemsPerPage')}}\n " + },] }, +]; +/** @nocollapse */ +PagerPageSizesComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, + { type: core_1.ChangeDetectorRef, }, + { type: pager_context_service_1.PagerContextService, }, +]; }; +PagerPageSizesComponent.propDecorators = { + 'pageSizes': [{ type: core_1.Input },], + 'classes': [{ type: core_1.HostBinding, args: ["class.k-pager-sizes",] }, { type: core_1.HostBinding, args: ["class.k-label",] },], +}; +exports.PagerPageSizesComponent = PagerPageSizesComponent; + + +/***/ }), +/* 233 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +// tslint:disable:no-access-missing-member +var core_1 = __webpack_require__(0); +var pager_context_service_1 = __webpack_require__(27); +var pager_element_component_1 = __webpack_require__(43); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * Displays buttons for navigating to the first and the previous page. + */ +var PagerPrevButtonsComponent = (function (_super) { + __extends(PagerPrevButtonsComponent, _super); + function PagerPrevButtonsComponent(localization, pagerContext, cd) { + var _this = _super.call(this, localization, pagerContext) || this; + _this.cd = cd; + return _this; + } + Object.defineProperty(PagerPrevButtonsComponent.prototype, "disabled", { + /** + * @hidden + * + * @readonly + * @type {boolean} + * @memberOf PagerPrevButtonsComponent + */ + get: function () { + return this.currentPage === 1 || !this.total; + }, + enumerable: true, + configurable: true + }); + PagerPrevButtonsComponent.prototype.onChanges = function (_a) { + var total = _a.total, skip = _a.skip, pageSize = _a.pageSize; + this.total = total; + this.skip = skip; + this.pageSize = pageSize; + this.cd.markForCheck(); + }; + return PagerPrevButtonsComponent; +}(pager_element_component_1.PagerElementComponent)); +PagerPrevButtonsComponent.decorators = [ + { type: core_1.Component, args: [{ + changeDetection: core_1.ChangeDetectionStrategy.OnPush, + selector: 'kendo-pager-prev-buttons', + template: "\n \n \n \n \n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +PagerPrevButtonsComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, + { type: pager_context_service_1.PagerContextService, }, + { type: core_1.ChangeDetectorRef, }, +]; }; +exports.PagerPrevButtonsComponent = PagerPrevButtonsComponent; + + +/***/ }), +/* 234 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the pager template which helps to customize the pager appearance in the Kendo UI Grid. + * + * To define a pager template, nest a `` tag with the `kendoPagerTemplate` directive inside ``. + * + * The template context provides the following fields: + * - `pageSize`—The value of the current `pageSize`. + * - `currentPage`—The index of the displayed page. + * - `skip`—The current skip value. + * - `total`—The total number of records. + * - `totalPages`—The total number of available pages. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * + * ` + * }) + * + * class AppComponent { + * public gridData = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000, + * "Discontinued": false + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000, + * "Discontinued": true + * } + * ]); + * } + * + * ``` + */ +var PagerTemplateDirective = (function () { + function PagerTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return PagerTemplateDirective; +}()); +PagerTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoPagerTemplate]' + },] }, +]; +/** @nocollapse */ +PagerTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.PagerTemplateDirective = PagerTemplateDirective; + + +/***/ }), +/* 235 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var pager_settings_1 = __webpack_require__(377); +var utils_1 = __webpack_require__(7); +var pager_context_service_1 = __webpack_require__(27); +/** + * @hidden + */ +var PagerComponent = (function () { + function PagerComponent(pagerContext) { + this.pagerContext = pagerContext; + this.total = 0; + this.skip = 1; + this.pageChange = new core_1.EventEmitter(); + this.settings = pager_settings_1.normalize({}); + } + Object.defineProperty(PagerComponent.prototype, "options", { + set: function (value) { + this.settings = pager_settings_1.normalize(value); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerComponent.prototype, "pagerWrapClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerComponent.prototype, "gridPagerClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerComponent.prototype, "widgetClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerComponent.prototype, "totalPages", { + get: function () { + return Math.ceil((this.total || 0) / this.pageSize); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PagerComponent.prototype, "currentPage", { + get: function () { + return Math.floor((this.skip || 0) / this.pageSize) + 1; + }, + enumerable: true, + configurable: true + }); + PagerComponent.prototype.ngOnInit = function () { + this.pageChangeSubscription = this.pagerContext.pageChange.subscribe(this.changePage.bind(this)); + }; + PagerComponent.prototype.ngOnChanges = function (changes) { + if (utils_1.anyChanged(["pageSize", "skip", "total"], changes, false)) { + this.pagerContext.notifyChanges({ + pageSize: this.pageSize, + skip: this.skip, + total: this.total + }); + } + }; + PagerComponent.prototype.ngOnDestroy = function () { + if (this.pageChangeSubscription) { + this.pageChangeSubscription.unsubscribe(); + } + }; + PagerComponent.prototype.changePage = function (event) { + this.pageChange.emit(event); + }; + return PagerComponent; +}()); +PagerComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-pager', + template: "\n \n \n \n \n \n \n \n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +PagerComponent.ctorParameters = function () { return [ + { type: pager_context_service_1.PagerContextService, }, +]; }; +PagerComponent.propDecorators = { + 'total': [{ type: core_1.Input },], + 'skip': [{ type: core_1.Input },], + 'pageSize': [{ type: core_1.Input },], + 'options': [{ type: core_1.Input },], + 'template': [{ type: core_1.Input },], + 'pageChange': [{ type: core_1.Output },], + 'pagerWrapClass': [{ type: core_1.HostBinding, args: ['class.k-pager-wrap',] },], + 'gridPagerClass': [{ type: core_1.HostBinding, args: ['class.k-grid-pager',] },], + 'widgetClass': [{ type: core_1.HostBinding, args: ['class.k-widget',] },], +}; +exports.PagerComponent = PagerComponent; + + +/***/ }), +/* 236 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var common_1 = __webpack_require__(9); +var pager_component_1 = __webpack_require__(235); +var pager_prev_buttons_component_1 = __webpack_require__(233); +var pager_next_buttons_component_1 = __webpack_require__(230); +var pager_numeric_buttons_component_1 = __webpack_require__(231); +var pager_input_component_1 = __webpack_require__(229); +var pager_info_component_1 = __webpack_require__(228); +var pager_page_sizes_component_1 = __webpack_require__(232); +var pager_template_directive_1 = __webpack_require__(234); +var shared_module_1 = __webpack_require__(32); +var importedModules = [ + common_1.CommonModule, + shared_module_1.SharedModule +]; +var INTERNAL_COMPONENTS = [ + pager_component_1.PagerComponent, + pager_prev_buttons_component_1.PagerPrevButtonsComponent, + pager_next_buttons_component_1.PagerNextButtonsComponent, + pager_numeric_buttons_component_1.PagerNumericButtonsComponent, + pager_input_component_1.PagerInputComponent, + pager_info_component_1.PagerInfoComponent, + pager_page_sizes_component_1.PagerPageSizesComponent, + pager_template_directive_1.PagerTemplateDirective +]; +/** + * @hidden + */ +var PagerModule = (function () { + function PagerModule() { + } + PagerModule.exports = function () { + return [ + pager_component_1.PagerComponent, + pager_prev_buttons_component_1.PagerPrevButtonsComponent, + pager_next_buttons_component_1.PagerNextButtonsComponent, + pager_numeric_buttons_component_1.PagerNumericButtonsComponent, + pager_input_component_1.PagerInputComponent, + pager_info_component_1.PagerInfoComponent, + pager_page_sizes_component_1.PagerPageSizesComponent, + pager_template_directive_1.PagerTemplateDirective + ]; + }; + return PagerModule; +}()); +PagerModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [INTERNAL_COMPONENTS], + exports: [INTERNAL_COMPONENTS], + imports: importedModules.slice() + },] }, +]; +/** @nocollapse */ +PagerModule.ctorParameters = function () { return []; }; +exports.PagerModule = PagerModule; + + +/***/ }), +/* 237 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +exports.HEADER_CLASS = 'k-grid-header'; +/** + * @hidden + */ +exports.FOOTER_CLASS = 'k-grid-footer'; +var GRID_LIST = 'KENDO-GRID-LIST'; +var TABLE = 'TABLE'; +var matchesClass = function (className) { + return function (element) { return String(element.className).split(' ').indexOf(className) >= 0; }; +}; +var matchesNodeName = function (nodeName) { + return function (element) { return element.nodeName === nodeName; }; +}; +var matchesList = matchesNodeName(GRID_LIST); +var matchesTable = matchesNodeName(TABLE); +var findChild = function (element, matches) { + if (!element) { + return; + } + var children = element.childNodes; + for (var idx = 0; idx < children.length; idx++) { + if (matches(children[idx])) { + return children[idx]; + } + } +}; +var suffix = function (locked) { return locked ? 'locked' : 'wrap'; }; +/** + * @hidden + */ +var GridQuery = (function () { + function GridQuery(element) { + this.element = element; + this.list = findChild(element, matchesList); + } + GridQuery.prototype.content = function (locked) { + return findChild(this.list, matchesClass("k-grid-content" + (locked ? '-locked' : ''))); + }; + GridQuery.prototype.header = function (locked) { + this.headerWrap = this.headerWrap || findChild(this.element, matchesClass(exports.HEADER_CLASS)); + return findChild(this.headerWrap, matchesClass(exports.HEADER_CLASS + "-" + suffix(locked))); + }; + GridQuery.prototype.footer = function (locked) { + this.footerWrap = this.footerWrap || findChild(this.element, matchesClass(exports.FOOTER_CLASS)); + return findChild(this.footerWrap, matchesClass(exports.FOOTER_CLASS + "-" + suffix(locked))); + }; + GridQuery.prototype.table = function () { + return findChild(this.element, matchesTable); + }; + return GridQuery; +}()); +exports.GridQuery = GridQuery; + + +/***/ }), +/* 238 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * Represents the PDF page template of the Kendo UI Grid that helps to customize the PDF pages. + * + * To define a page template, nest a `` tag with the `kendoGridPDFTemplate` directive inside ``. + * The template context provides the following fields: + * - `pageNumber`—Defines PDF page number. + * - `totalPages`—Defines the total number of PDF pages. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * + * + * + * + * + * + * + * + *
+ * Page {{ pageNum }} of {{ totalPages }} + *
+ *
+ *
+ *
+ * ` + * }) + * + * class AppComponent { + * public gridData = [{ + * "ProductID": 1, + * "ProductName": "Chai", + * "UnitPrice": 18.0000 + * }, { + * "ProductID": 2, + * "ProductName": "Chang", + * "UnitPrice": 19.0000 + * } + * ]; + * } + * + * ``` + */ +var PDFTemplateDirective = (function () { + function PDFTemplateDirective(templateRef) { + this.templateRef = templateRef; + } + return PDFTemplateDirective; +}()); +PDFTemplateDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridPDFTemplate]' + },] }, +]; +/** @nocollapse */ +PDFTemplateDirective.ctorParameters = function () { return [ + { type: core_1.TemplateRef, decorators: [{ type: core_1.Optional },] }, +]; }; +exports.PDFTemplateDirective = PDFTemplateDirective; + + +/***/ }), +/* 239 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var suspend_service_1 = __webpack_require__(128); +var pdf_service_1 = __webpack_require__(126); +var pdf_margin_component_1 = __webpack_require__(125); +var kendo_drawing_1 = __webpack_require__(420); +var kendo_file_saver_1 = __webpack_require__(138); +var export_element_1 = __webpack_require__(378); +var grid_query_1 = __webpack_require__(237); +var pdf_template_directive_1 = __webpack_require__(238); +var column_base_1 = __webpack_require__(29); +var createElement = function (tagName, className) { + var element = document.createElement(tagName); + if (className) { + element.className = className; + } + return element; +}; +var createDiv = function (className) { + return createElement('div', className); +}; +var compileTemplate = function (templateRef) { + var context = {}; + var embeddedView = templateRef.createEmbeddedView(context); + var result = function (data) { + Object.assign(context, data); + embeddedView.detectChanges(); + var templateWrap = createElement('span'); + embeddedView.rootNodes.forEach(function (rootNode) { + templateWrap.appendChild(rootNode.cloneNode(true)); + }); + return templateWrap; + }; + result.destroy = function () { + embeddedView.destroy(); + embeddedView = null; + }; + return result; +}; +/** + * Configures the PDF export settings of the Kendo UI Grid. + */ +var PDFComponent = (function () { + function PDFComponent(pdfService, suspendService, ngZone) { + this.pdfService = pdfService; + this.suspendService = suspendService; + this.ngZone = ngZone; + /** + * The creator of the PDF document. + * @default "Kendo UI PDF Generator" + */ + this.creator = 'Kendo UI PDF Generator'; + /** + * Specifies the file name of the exported PDF file. + * @default "Export.pdf" + */ + this.fileName = 'Export.pdf'; + this.columns = new core_1.QueryList(); + this.saveSubscription = pdfService.savePDF.subscribe(this.savePDF.bind(this)); + this.complete = this.complete.bind(this); + this.reset = this.reset.bind(this); + this.draw = this.draw.bind(this); + } + PDFComponent.prototype.ngOnDestroy = function () { + this.saveSubscription.unsubscribe(); + this.reset(); + }; + PDFComponent.prototype.savePDF = function (component) { + var pageSize = component.pageSize; + var total = component.view.total; + var columns = this.columns.toArray(); + if (columns.length) { + this.originalColumns = component.columns.toArray(); + } + this.component = component; + this.suspendService.scroll = true; + this.initProgress(); + this.renderAllPages = this.allPages && pageSize < total; + if (this.renderAllPages) { + this.skip = component.skip; + this.pageSize = pageSize; + this.changePage(0, total, this.draw, columns); + } + else if (columns.length) { + this.changeColumns(columns, this.draw); + } + else { + this.draw(); + } + }; + PDFComponent.prototype.initProgress = function () { + var wrapperElement = this.component.wrapper.nativeElement; + var progress = this.progress = createDiv('k-loading-pdf-mask'); + var overlay = wrapperElement.cloneNode(true); + progress.appendChild(overlay); + progress.appendChild(createDiv('k-loading-color')); + progress.appendChild(createElement('span', 'k-i-loading k-icon')); + this.originalHeight = wrapperElement.style.height; + this.originalOverflow = wrapperElement.style.overflow; + wrapperElement.style.height = wrapperElement.offsetHeight + 'px'; + wrapperElement.style.overflow = 'hidden'; + wrapperElement.appendChild(progress); + this.applyScroll(overlay); + }; + PDFComponent.prototype.applyScroll = function (overlay) { + var query = new grid_query_1.GridQuery(this.component.wrapper.nativeElement); + var content = query.content(); + if (content) { + var overlayQuery = new grid_query_1.GridQuery(overlay); + var overlayContent = overlayQuery.content(); + overlayContent.scrollTop = content.scrollTop; + overlayContent.scrollLeft = content.scrollLeft; + overlayQuery.header().scrollLeft = query.header().scrollLeft; + var footer = query.footer(); + if (footer) { + overlayQuery.footer().scrollLeft = footer.scrollLeft; + } + var lockedContent = query.content(true); + if (lockedContent) { + var overlayLockedContent = overlayQuery.content(true); + overlayLockedContent.scrollTop = lockedContent.scrollTop; + overlayLockedContent.scrollLeft = lockedContent.scrollLeft; + } + } + }; + PDFComponent.prototype.draw = function () { + var _this = this; + this.ngZone.runOutsideAngular(function () { + var container = _this.container = createDiv('k-grid-pdf-export-element'); + var element = export_element_1.exportElement(_this.component.wrapper.nativeElement); + container.appendChild(element); + document.body.appendChild(container); + _this.drawDOM(element, _this.drawOptions); + }); + }; + PDFComponent.prototype.drawDOM = function (element, options) { + var _this = this; + kendo_drawing_1.drawDOM(element, options) + .then(function (root) { + return kendo_drawing_1.pdf.exportPDF(root, options); + }) + .then(function (dataURI) { + _this.saveFile(dataURI); + }).then(this.complete, this.complete); + }; + PDFComponent.prototype.saveFile = function (dataURI) { + kendo_file_saver_1.saveAs(dataURI, this.fileName, { + forceProxy: this.forceProxy, + proxyTarget: this.proxyTarget, + proxyURL: this.proxyURL + }); + }; + PDFComponent.prototype.complete = function () { + if (this.pageTemplate) { + this.pageTemplate.destroy(); + delete this.pageTemplate; + } + if (this.component) { + var originalColumns = this.originalColumns; + delete this.originalColumns; + if (this.renderAllPages) { + this.changePage(this.skip, this.pageSize, this.reset, originalColumns); + } + else if (originalColumns) { + this.changeColumns(originalColumns, this.reset); + } + else { + this.reset(); + } + } + else { + this.reset(); + } + this.removeContainer(); + }; + PDFComponent.prototype.removeContainer = function () { + if (this.container) { + document.body.removeChild(this.container); + delete this.container; + } + }; + PDFComponent.prototype.changePage = function (skip, take, callback, columns) { + var _this = this; + this.ngZone.run(function () { + _this.pdfService.dataChanged.take(1).subscribe(function () { + if (columns && columns.length) { + _this.changeColumns(columns, callback); + } + else { + _this.onStable(callback); + } + }); + _this.component.notifyPageChange('pdf', { skip: skip, take: take }); + }); + }; + PDFComponent.prototype.changeColumns = function (columns, callback) { + var _this = this; + this.ngZone.run(function () { + _this.onStable(callback); + _this.component.columns.reset(columns); + }); + }; + PDFComponent.prototype.reset = function () { + this.suspendService.scroll = false; + this.renderAllPages = false; + if (!this.component) { + return; + } + var wrapperElement = this.component.wrapper.nativeElement; + wrapperElement.removeChild(this.progress); + wrapperElement.style.height = this.originalHeight; + wrapperElement.style.overflow = this.originalOverflow; + delete this.progress; + delete this.component; + }; + Object.defineProperty(PDFComponent.prototype, "drawOptions", { + get: function () { + if (this.pageTemplateDirective) { + this.pageTemplate = compileTemplate(this.pageTemplateDirective.templateRef); + } + return { + _destructive: true, + allPages: this.allPages, + author: this.author, + avoidLinks: this.avoidLinks, + creator: this.creator, + date: this.date, + keywords: this.keywords, + landscape: this.landscape, + margin: this.drawMargin, + paperSize: this.paperSize, + repeatHeaders: this.repeatHeaders, + scale: this.scale, + subject: this.subject, + template: this.pageTemplate, + title: this.title + }; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PDFComponent.prototype, "drawMargin", { + get: function () { + var marginComponent = this.marginComponent; + var margin = this.margin; + if (marginComponent) { + margin = Object.assign(margin || {}, marginComponent.options); + } + return margin; + }, + enumerable: true, + configurable: true + }); + PDFComponent.prototype.onStable = function (callback) { + var _this = this; + // not sure if it is an actual scenario. occurs in the tests. + // onStable is triggered in the same pass without the change detection + // thus the callback is called before the changes are applied without the timeout + setTimeout(function () { + _this.ngZone.onStable.take(1).subscribe(callback); + }, 0); // tslint:disable-line: align + }; + return PDFComponent; +}()); +PDFComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-grid-pdf', + template: '' + },] }, +]; +/** @nocollapse */ +PDFComponent.ctorParameters = function () { return [ + { type: pdf_service_1.PDFService, }, + { type: suspend_service_1.SuspendService, }, + { type: core_1.NgZone, }, +]; }; +PDFComponent.propDecorators = { + 'allPages': [{ type: core_1.Input },], + 'author': [{ type: core_1.Input },], + 'avoidLinks': [{ type: core_1.Input },], + 'creator': [{ type: core_1.Input },], + 'date': [{ type: core_1.Input },], + 'fileName': [{ type: core_1.Input },], + 'forceProxy': [{ type: core_1.Input },], + 'keywords': [{ type: core_1.Input },], + 'landscape': [{ type: core_1.Input },], + 'margin': [{ type: core_1.Input },], + 'paperSize': [{ type: core_1.Input },], + 'repeatHeaders': [{ type: core_1.Input },], + 'scale': [{ type: core_1.Input },], + 'proxyURL': [{ type: core_1.Input },], + 'proxyTarget': [{ type: core_1.Input },], + 'subject': [{ type: core_1.Input },], + 'title': [{ type: core_1.Input },], + 'pageTemplateDirective': [{ type: core_1.ContentChild, args: [pdf_template_directive_1.PDFTemplateDirective,] },], + 'marginComponent': [{ type: core_1.ContentChild, args: [pdf_margin_component_1.PDFMarginComponent,] },], + 'columns': [{ type: core_1.ContentChildren, args: [column_base_1.ColumnBase,] },], +}; +exports.PDFComponent = PDFComponent; + + +/***/ }), +/* 240 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +var PreventableEvent = (function () { + function PreventableEvent() { + this.prevented = false; + } + /** + * Prevents the default action for a specified event. + * + * In this way, the source component suppresses + * the built-in behavior that follows the event. + */ + PreventableEvent.prototype.preventDefault = function () { + this.prevented = true; + }; + /** + * Returns `true` if the event was prevented + * by any of its subscribers. + * + * @returns `true` if the default action was prevented. + * Otherwise, returns `false`. + */ + PreventableEvent.prototype.isDefaultPrevented = function () { + return this.prevented; + }; + return PreventableEvent; +}()); +exports.PreventableEvent = PreventableEvent; + + +/***/ }), +/* 241 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var grid_component_1 = __webpack_require__(59); +/** + * @hidden + */ +var ResizableContainerDirective = (function () { + function ResizableContainerDirective(el, renderer, grid) { + this.el = el; + this.renderer = renderer; + this.grid = grid; + this.enabled = false; + } + Object.defineProperty(ResizableContainerDirective.prototype, "lockedWidth", { + set: function (value) { + this._lockedWidth = value; + if (this.enabled) { + this.attachResize(); + this.resize(); + } + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ResizableContainerDirective.prototype, "kendoGridResizableContainer", { + set: function (enabled) { + var refresh = enabled !== this.enabled; + this.enabled = enabled; + if (refresh) { + this.attachResize(); + this.resize(); + } + }, + enumerable: true, + configurable: true + }); + ResizableContainerDirective.prototype.ngOnDestroy = function () { + if (this.resizeSubscription) { + this.resizeSubscription(); + } + }; + ResizableContainerDirective.prototype.attachResize = function () { + if (this.resizeSubscription && !this.enabled) { + this.resizeSubscription(); + this.resizeSubscription = null; + } + if (!this.resizeSubscription && this.enabled) { + this.resizeSubscription = this.renderer.listen('window', 'resize', this.resize.bind(this)); + } + }; + ResizableContainerDirective.prototype.resize = function () { + if (this.grid && this.grid.wrapper) { + var containerElement = this.grid.wrapper.nativeElement; + var width = this.enabled ? Math.max(containerElement.clientWidth - this._lockedWidth, 0) + "px" : ""; + this.renderer.setStyle(this.el.nativeElement, "width", width); + } + }; + return ResizableContainerDirective; +}()); +ResizableContainerDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridResizableContainer]' + },] }, +]; +/** @nocollapse */ +ResizableContainerDirective.ctorParameters = function () { return [ + { type: core_1.ElementRef, }, + { type: core_1.Renderer2, }, + { type: grid_component_1.GridComponent, decorators: [{ type: core_1.Optional },] }, +]; }; +ResizableContainerDirective.propDecorators = { + 'lockedWidth': [{ type: core_1.Input, args: ['lockedWidth',] },], + 'kendoGridResizableContainer': [{ type: core_1.Input },], +}; +exports.ResizableContainerDirective = ResizableContainerDirective; + + +/***/ }), +/* 242 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var set = function (value) { return function (pair) { return pair.forEach(function (x) { return x.style.height = value; }); }; }; +var clearHeight = function (pairs) { return pairs + .filter(function (_a) { + var left = _a[0], right = _a[1]; + return left.style.height || right.style.height; +}) + .forEach(set("")); }; +var zip = function (arr1, arr2) { + var result = []; + for (var idx = 0, len = arr1.length; idx < len; idx++) { + if (!arr2[idx]) { + break; + } + result.push([arr1[idx], arr2[idx]]); + } + return result; +}; +var setHeight = function (heights) { return function (row, idx) { return set(heights[idx] + 1 + "px")(row); }; }; +var getHeights = function (rows) { return rows.map(function (_a) { + var left = _a[0], right = _a[1]; + var height = left.offsetHeight; + var offsetHeight2 = right.offsetHeight; + if (height < offsetHeight2) { + return offsetHeight2; + } + return height; +}); }; +/** + * @hidden + */ +exports.syncRowsHeight = function (table1, table2) { + var rows = zip(table1.rows, table2.rows); + clearHeight(rows); + var heights = getHeights(rows); + [table1, table2].forEach(function (x) { return x.style.display = 'none'; }); + rows.forEach(setHeight(heights)); + [table1, table2].forEach(function (x) { return x.style.display = ''; }); +}; + + +/***/ }), +/* 243 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var Observable_1 = __webpack_require__(1); +var Subscription_1 = __webpack_require__(11); +var Subject_1 = __webpack_require__(8); +__webpack_require__(21); +__webpack_require__(290); +/** + * @hidden + */ +var ScrollSyncService = (function () { + function ScrollSyncService(ngZone) { + var _this = this; + this.ngZone = ngZone; + this.changes = new Subject_1.Subject(); + this.elements = []; + this.subscriptions = new Subscription_1.Subscription(function () { }); + this.subscriptions.add(this.changes.subscribe(function (x) { return _this.scrollLeft(x); })); + } + ScrollSyncService.prototype.registerEmitter = function (el, sourceType) { + var _this = this; + if (this.elements.indexOf(el) !== -1) { + return; + } + this.elements.push({ element: el, sourceType: sourceType }); + if (sourceType === "body" || sourceType === "header") { + this.ngZone.runOutsideAngular(function () { + var obs = Observable_1.Observable.fromEvent(el, "scroll") + .map(function (_a) { + var _b = _a.target, scrollLeft = _b.scrollLeft, scrollRight = _b.scrollRight; + return ({ + scrollLeft: scrollLeft, + scrollRight: scrollRight, + sourceType: sourceType + }); + }); + _this.subscriptions.add(obs.filter(function (x) { return !_this.source || _this.source === x.sourceType; }) + .do(function (x) { return _this.source = x.sourceType; }) + .subscribe(function (x) { return _this.changes.next(x); })); + _this.subscriptions.add(obs.filter(function (x) { return _this.source && _this.source !== x.sourceType; }) + .subscribe(function () { return _this.source = undefined; })); + }); + } + }; + /** + * destroy + */ + ScrollSyncService.prototype.destroy = function () { + this.subscriptions.unsubscribe(); + }; + ScrollSyncService.prototype.scrollLeft = function (_a) { + var _this = this; + var scrollLeft = _a.scrollLeft, sourceType = _a.sourceType; + this.ngZone.runOutsideAngular(function () { + _this.elements + .filter(function (x) { return sourceType !== x.sourceType; }) + .forEach(function (_a) { + var element = _a.element; + return element.scrollLeft = scrollLeft; + }); + }); + }; + return ScrollSyncService; +}()); +ScrollSyncService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +ScrollSyncService.ctorParameters = function () { return [ + { type: core_1.NgZone, }, +]; }; +exports.ScrollSyncService = ScrollSyncService; + + +/***/ }), +/* 244 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var selection_service_1 = __webpack_require__(245); +/** + * @hidden + */ +var SelectableDirective = (function () { + function SelectableDirective(selectionService) { + this.selectionService = selectionService; + this.ignored = /^(a|input|textarea|button)$/i; + } + Object.defineProperty(SelectableDirective.prototype, "kendoGridSelectable", { + set: function (enabled) { + this.enabled = enabled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SelectableDirective.prototype, "className", { + get: function () { + return this.selectionService.isSelected(this.index); + }, + enumerable: true, + configurable: true + }); + SelectableDirective.prototype.onClick = function (target) { + if (!this.enabled) { + return; + } + if (this.shouldSelect(target.tagName)) { + this.selectionService.toggle(this.index); + } + }; + SelectableDirective.prototype.shouldSelect = function (tagName) { + return !this.ignored.test(tagName); + }; + return SelectableDirective; +}()); +SelectableDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoGridSelectable]' + },] }, +]; +/** @nocollapse */ +SelectableDirective.ctorParameters = function () { return [ + { type: selection_service_1.SelectionService, }, +]; }; +SelectableDirective.propDecorators = { + 'index': [{ type: core_1.Input },], + 'kendoGridSelectable': [{ type: core_1.Input },], + 'className': [{ type: core_1.HostBinding, args: ['class.k-state-selected',] },], + 'onClick': [{ type: core_1.HostListener, args: ['click', ['$event.target'],] },], +}; +exports.SelectableDirective = SelectableDirective; + + +/***/ }), +/* 245 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var utils_1 = __webpack_require__(7); +/** + * @hidden + */ +var SelectionService = (function () { + function SelectionService() { + this.changes = new core_1.EventEmitter(); + this.selectedIndices = []; + } + SelectionService.prototype.isSelected = function (index) { + return utils_1.isPresent(this.selectedIndices.find(function (current) { return current === index; })); + }; + SelectionService.prototype.select = function (index) { + if (!this.isSelected(index)) { + this.selectedIndices = [index]; + this.changes.emit({ index: index, selected: true }); + } + }; + SelectionService.prototype.unselect = function (index) { + if (this.isSelected(index)) { + this.selectedIndices = []; + this.changes.emit({ index: index, selected: false }); + } + }; + SelectionService.prototype.toggle = function (index) { + if (this.isSelected(index)) { + this.unselect(index); + return; + } + this.select(index); + }; + Object.defineProperty(SelectionService.prototype, "selected", { + get: function () { + return this.selectedIndices; + }, + enumerable: true, + configurable: true + }); + return SelectionService; +}()); +SelectionService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +SelectionService.ctorParameters = function () { return []; }; +exports.SelectionService = SelectionService; + + +/***/ }), +/* 246 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var column_base_1 = __webpack_require__(29); +var details_service_1 = __webpack_require__(109); +var groups_service_1 = __webpack_require__(79); +var change_notification_service_1 = __webpack_require__(107); +var utils_1 = __webpack_require__(7); +var edit_service_1 = __webpack_require__(25); +var kendo_angular_l10n_1 = __webpack_require__(2); +var column_common_1 = __webpack_require__(22); +/** + * @hidden + */ +var TableBodyComponent = (function () { + function TableBodyComponent(detailsService, groupsService, changeNotification, editService, localization) { + this.detailsService = detailsService; + this.groupsService = groupsService; + this.changeNotification = changeNotification; + this.editService = editService; + this.localization = localization; + this.columns = []; + this.groups = []; + this.skip = 0; + this.noRecordsText = this.localization.get('noRecords'); + this.skipGroupDecoration = false; + this.showGroupFooters = false; + this.lockedColumnsCount = 0; + this.rowClass = function () { return null; }; + } + Object.defineProperty(TableBodyComponent.prototype, "newDataItem", { + get: function () { + return this.editService.newDataItem; + }, + enumerable: true, + configurable: true + }); + TableBodyComponent.prototype.toggleRow = function (index, dataItem) { + this.detailsService.toggleRow(index, dataItem); + return false; + }; + TableBodyComponent.prototype.trackByFn = function (_, item) { + return item.data ? item.data : item; + }; + TableBodyComponent.prototype.isExpanded = function (index) { + return this.detailsService.isExpanded(index); + }; + TableBodyComponent.prototype.detailButtonStyles = function (index) { + var expanded = this.isExpanded(index); + return { 'k-minus': expanded, 'k-plus': !expanded }; + }; + TableBodyComponent.prototype.isGroup = function (item) { + return item.type === 'group'; + }; + TableBodyComponent.prototype.isDataItem = function (item) { + return !this.isGroup(item) && !this.isFooter(item); + }; + TableBodyComponent.prototype.isFooter = function (item) { + return item.type === 'footer'; + }; + TableBodyComponent.prototype.isInExpandedGroup = function (item) { + return this.groupsService.isInExpandedGroup(item.groupIndex, false); + }; + TableBodyComponent.prototype.isParentGroupExpanded = function (item) { + return this.groupsService.isInExpandedGroup(item.index || item.groupIndex); + }; + TableBodyComponent.prototype.isOdd = function (item) { + return item.index % 2 === 0; + }; + TableBodyComponent.prototype.ngOnChanges = function (changes) { + if (utils_1.isChanged("columns", changes, false)) { + this.changeNotification.notify(); + } + }; + Object.defineProperty(TableBodyComponent.prototype, "columnsSpan", { + get: function () { + return column_common_1.columnsSpan(this.columns); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableBodyComponent.prototype, "colSpan", { + get: function () { + return this.columnsSpan + this.groups.length + (utils_1.isPresent(this.detailTemplate) ? 1 : 0); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(TableBodyComponent.prototype, "footerColumns", { + get: function () { + return column_common_1.columnsToRender(this.columns); + }, + enumerable: true, + configurable: true + }); + TableBodyComponent.prototype.isSpanColumn = function (column) { + return column_base_1.isSpanColumn(column) && !column.templateRef; + }; + TableBodyComponent.prototype.childColumns = function (column) { + return column_common_1.columnsToRender([column]); + }; + TableBodyComponent.prototype.isBoundColumn = function (column) { + return column.field && !column.templateRef; + }; + return TableBodyComponent; +}()); +TableBodyComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: '[kendoGridTableBody]', + template: "\n \n \n \n \n \n \n \n \n \n \n {{newDataItem | valueOf: column.field: column.format}}\n \n \n
\n \n \n \n
\n \n {{noRecordsText}}\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n {{item.data | valueOf: childColumn.field: childColumn.format}}\n \n \n {{item.data | valueOf: column.field: column.format}}\n \n \n \n \n \n \n \n
\n \n \n \n \n \n \n \n \n \n \n
\n \n \n
\n " + },] }, +]; +/** @nocollapse */ +TableBodyComponent.ctorParameters = function () { return [ + { type: details_service_1.DetailsService, }, + { type: groups_service_1.GroupsService, }, + { type: change_notification_service_1.ChangeNotificationService, }, + { type: edit_service_1.EditService, }, + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +TableBodyComponent.propDecorators = { + 'columns': [{ type: core_1.Input },], + 'groups': [{ type: core_1.Input },], + 'detailTemplate': [{ type: core_1.Input },], + 'noRecordsTemplate': [{ type: core_1.Input },], + 'data': [{ type: core_1.Input },], + 'skip': [{ type: core_1.Input },], + 'selectable': [{ type: core_1.Input },], + 'noRecordsText': [{ type: core_1.Input },], + 'skipGroupDecoration': [{ type: core_1.Input },], + 'showGroupFooters': [{ type: core_1.Input },], + 'lockedColumnsCount': [{ type: core_1.Input },], + 'rowClass': [{ type: core_1.Input },], +}; +exports.TableBodyComponent = TableBodyComponent; + + +/***/ }), +/* 247 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/** + * @hidden + */ +var TemplateContextDirective = (function () { + function TemplateContextDirective(viewContainerRef) { + this.viewContainerRef = viewContainerRef; + } + Object.defineProperty(TemplateContextDirective.prototype, "templateContext", { + set: function (context) { + this.removeView(); + if (context.templateRef) { + this.insertedViewRef = this.viewContainerRef.createEmbeddedView(context.templateRef, context); + } + }, + enumerable: true, + configurable: true + }); + TemplateContextDirective.prototype.ngOnDestroy = function () { + this.removeView(); + }; + TemplateContextDirective.prototype.removeView = function () { + if (this.insertedViewRef) { + this.viewContainerRef.remove(this.viewContainerRef.indexOf(this.insertedViewRef)); + this.insertedViewRef = undefined; + } + }; + return TemplateContextDirective; +}()); +TemplateContextDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[templateContext]' // tslint:disable-line:directive-selector + },] }, +]; +/** @nocollapse */ +TemplateContextDirective.ctorParameters = function () { return [ + { type: core_1.ViewContainerRef, }, +]; }; +TemplateContextDirective.propDecorators = { + 'templateContext': [{ type: core_1.Input },], +}; +exports.TemplateContextDirective = TemplateContextDirective; + + +/***/ }), +/* 248 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var grid_component_1 = __webpack_require__(59); +/** + * @hidden + */ +var ToolbarComponent = (function () { + function ToolbarComponent(grid) { + this.grid = grid; + } + Object.defineProperty(ToolbarComponent.prototype, "classNames", { + get: function () { + return 'k-header k-grid-toolbar'; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(ToolbarComponent.prototype, "toolbarTemplateRef", { + get: function () { + return this.grid.toolbarTemplate ? this.grid.toolbarTemplate.templateRef : undefined; + }, + enumerable: true, + configurable: true + }); + return ToolbarComponent; +}()); +ToolbarComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-grid-toolbar', + template: "\n \n
\n " + },] }, +]; +/** @nocollapse */ +ToolbarComponent.ctorParameters = function () { return [ + { type: grid_component_1.GridComponent, }, +]; }; +ToolbarComponent.propDecorators = { + 'classNames': [{ type: core_1.HostBinding, args: ['class',] },], +}; +exports.ToolbarComponent = ToolbarComponent; + + +/***/ }), +/* 249 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_draggable_1 = __webpack_require__(281); +/** + * @hidden + */ +var KendoDraggableDirective = (function () { + function KendoDraggableDirective(ngEl) { + var _this = this; + this.kendoDrag = new core_1.EventEmitter(); + this.kendoPress = new core_1.EventEmitter(); + this.kendoRelease = new core_1.EventEmitter(); + this.draggable = new kendo_draggable_1.default({ + drag: function (e) { + if (e.hasOwnProperty("originalEvent")) { + e.originalEvent.preventDefault(); + } + _this.kendoDrag.next(e); + }, + press: function (e) { return _this.kendoPress.next(e); }, + release: function (e) { return _this.kendoRelease.next(e); } + }); + this.draggable.bindTo(ngEl.nativeElement); + } + KendoDraggableDirective.prototype.ngOnDestroy = function () { + this.draggable.destroy(); + }; + return KendoDraggableDirective; +}()); +KendoDraggableDirective.decorators = [ + { type: core_1.Directive, args: [{ + selector: '[kendoDraggable]' + },] }, +]; +/** @nocollapse */ +KendoDraggableDirective.ctorParameters = function () { return [ + { type: core_1.ElementRef, }, +]; }; +KendoDraggableDirective.propDecorators = { + 'kendoDrag': [{ type: core_1.Output },], + 'kendoPress': [{ type: core_1.Output },], + 'kendoRelease': [{ type: core_1.Output },], +}; +exports.KendoDraggableDirective = KendoDraggableDirective; + + +/***/ }), +/* 250 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var draggable_1 = __webpack_require__(249); +var common_1 = __webpack_require__(9); +var kendo_angular_intl_1 = __webpack_require__(10); +/** + * @hidden + */ +/** + * @hidden + */ +var DraggableModule = (function () { + function DraggableModule() { + } + return DraggableModule; +}()); +DraggableModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [draggable_1.KendoDraggableDirective], + exports: [draggable_1.KendoDraggableDirective], + imports: [common_1.CommonModule], + providers: [ + { provide: kendo_angular_intl_1.IntlService, useClass: kendo_angular_intl_1.CldrIntlService } + ] + },] }, +]; +/** @nocollapse */ +DraggableModule.ctorParameters = function () { return []; }; +exports.DraggableModule = DraggableModule; + + +/***/ }), +/* 251 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var slider_component_1 = __webpack_require__(263); +exports.SliderComponent = slider_component_1.SliderComponent; +var switch_component_1 = __webpack_require__(265); +exports.SwitchComponent = switch_component_1.SwitchComponent; +var numerictextbox_component_1 = __webpack_require__(260); +exports.NumericTextBoxComponent = numerictextbox_component_1.NumericTextBoxComponent; +var custom_messages_component_1 = __webpack_require__(258); +exports.NumericTextBoxCustomMessagesComponent = custom_messages_component_1.NumericTextBoxCustomMessagesComponent; +var maskedtextbox_component_1 = __webpack_require__(253); +exports.MaskedTextBoxComponent = maskedtextbox_component_1.MaskedTextBoxComponent; +var inputs_module_1 = __webpack_require__(388); +exports.InputsModule = inputs_module_1.InputsModule; +var draggable_1 = __webpack_require__(249); +exports.KendoDraggableDirective = draggable_1.KendoDraggableDirective; +var slider_ticks_component_1 = __webpack_require__(262); +exports.KendoSliderTicksComponent = slider_ticks_component_1.KendoSliderTicksComponent; +var slider_module_1 = __webpack_require__(261); +exports.SliderModule = slider_module_1.SliderModule; +var switch_module_1 = __webpack_require__(264); +exports.SwitchModule = switch_module_1.SwitchModule; +var numerictextbox_module_1 = __webpack_require__(256); +exports.NumericTextBoxModule = numerictextbox_module_1.NumericTextBoxModule; +var maskedtextbox_module_1 = __webpack_require__(252); +exports.MaskedTextBoxModule = maskedtextbox_module_1.MaskedTextBoxModule; + + +/***/ }), +/* 252 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var maskedtextbox_component_1 = __webpack_require__(253); +var common_1 = __webpack_require__(9); +var kendo_angular_intl_1 = __webpack_require__(10); +/** + * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) + * definition for the MaskedTextBox component. + * + * @example + * + * ```ts-no-run + * // Import the MaskedTextBox module + * import { MaskedTextBoxModule } from '@progress/kendo-angular-inputs'; + * + * // The browser platform with a compiler + * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + * + * import { NgModule } from '@angular/core'; + * + * // Import the app component + * import { AppComponent } from './app.component'; + * + * // Define the app module + * @@NgModule({ + * declarations: [AppComponent], // declare app component + * imports: [BrowserModule, MaskedTextBoxModule], // import MaskedTextBox module + * bootstrap: [AppComponent] + * }) + * export class AppModule {} + * + * // Compile and launch the module + * platformBrowserDynamic().bootstrapModule(AppModule); + * + * ``` + */ +var MaskedTextBoxModule = (function () { + function MaskedTextBoxModule() { + } + return MaskedTextBoxModule; +}()); +MaskedTextBoxModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [maskedtextbox_component_1.MaskedTextBoxComponent], + exports: [maskedtextbox_component_1.MaskedTextBoxComponent], + imports: [common_1.CommonModule], + providers: [ + { provide: kendo_angular_intl_1.IntlService, useClass: kendo_angular_intl_1.CldrIntlService } + ] + },] }, +]; +/** @nocollapse */ +MaskedTextBoxModule.ctorParameters = function () { return []; }; +exports.MaskedTextBoxModule = MaskedTextBoxModule; + + +/***/ }), +/* 253 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +var kendo_angular_l10n_1 = __webpack_require__(2); +var masking_service_1 = __webpack_require__(389); +var resolvedPromise = Promise.resolve(null); +/** + * @hidden + */ +exports.isChanged = function (propertyName, changes, skipFirstChange) { + if (skipFirstChange === void 0) { skipFirstChange = true; } + return (changes[propertyName] && (!changes[propertyName].isFirstChange() || !skipFirstChange) && + changes[propertyName].previousValue !== changes[propertyName].currentValue); +}; +/** + * @hidden + */ +exports.anyChanged = function (propertyNames, changes, skipFirstChange) { + if (skipFirstChange === void 0) { skipFirstChange = true; } + return propertyNames.some(function (name) { return exports.isChanged(name, changes, skipFirstChange); }); +}; +/** + * Represents the Kendo UI MaskedTextBox component for Angular. + * + * @example + * ```ts-preview + * + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * + * class AppComponent { + * public value1: number = 9580128055807792; + * public mask1: string = "0000-0000-0000-0000"; + * } + * ``` + */ +var MaskedTextBoxComponent = (function () { + function MaskedTextBoxComponent(service, renderer, rtl) { + this.service = service; + this.renderer = renderer; + /** + * Determines whether the component is disabled. + */ + this.disabled = false; + /** + * A prompt character for the masked value. + * @default `_` + */ + this.prompt = '_'; + /** + * A character representing an empty position in the raw value. + * @default ' ' + */ + this.promptPlaceholder = ' '; + /** + * Indicates whether to include literals in the raw value. + * @default false + */ + this.includeLiterals = false; + /** + * Determines whether the built-in mask validator is enforced when validating a form. + * @default true + */ + this.maskValidation = true; + /** + * Sets or gets the `tabIndex` property of the DateInput. + * . + */ + this.tabIndex = 0; + /** + * Fires each time the user focuses the input element. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * ` + * }) + * class AppComponent { + * public handleFocus(): void { + * console.log("Component is focused"); + * } + * } + * ``` + * + * > To wire the event programmatically, use the `onFocus` property. + */ + this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * Fires each time the input element gets blurred. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * ` + * }) + * class AppComponent { + * public handleBlur(): void { + * console.log("Component is blurred"); + * } + * } + * ``` + * + * > To wire the event programmatically, use the `onBlur` property. + */ + this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * Fires each time the value changes. + */ + this.valueChange = new core_1.EventEmitter(); + this.focused = false; + this.defaultRules = { + "#": /[\d\s\+\-]/, + "&": /[\S]/, + "0": /[\d]/, + "9": /[\d\s]/, + "?": /[a-zA-Z\s]/, + "A": /[a-zA-Z0-9]/, + "C": /./, + "L": /[a-zA-Z]/, + "a": /[a-zA-Z0-9\s]/ + }; + this.isPasted = false; + this.selection = [0, 0]; + this.onChange = function (_) { }; + this.onTouched = function () { }; + this.direction = rtl ? 'rtl' : 'ltr'; + this.updateService(); + } + Object.defineProperty(MaskedTextBoxComponent.prototype, "hostClasses", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MaskedTextBoxComponent.prototype, "hostFocusedClass", { + get: function () { + return this.focused; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MaskedTextBoxComponent.prototype, "hostDisabledClass", { + get: function () { + return this.disabled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(MaskedTextBoxComponent.prototype, "rules", { + /** + * Exposes the RegExp-based mask validation array. + */ + get: function () { + return this._rules || this.defaultRules; + }, + set: function (value) { + this._rules = Object.assign({}, this.defaultRules, value); + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + MaskedTextBoxComponent.prototype.handleFocus = function (event) { + this.focused = true; + this.onFocus.emit(event); + }; + /** + * @hidden + */ + MaskedTextBoxComponent.prototype.handleBlur = function (event) { + this.focused = false; + this.onBlur.emit(event); + this.onTouched(); + }; + /** + * @hidden + */ + MaskedTextBoxComponent.prototype.handleDragDrop = function () { + return false; + }; + /** + * Focuses the MaskedTextBox component. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * class AppComponent { } + * ``` + */ + MaskedTextBoxComponent.prototype.focus = function () { + if (!this.input) { + return; + } + this.renderer.invokeElementMethod(this.input.nativeElement, "focus"); + }; + /** + * Blurs the MaskedTextBox component. + */ + MaskedTextBoxComponent.prototype.blur = function () { + if (!this.input) { + return; + } + this.renderer.invokeElementMethod(this.input.nativeElement, "blur"); + }; + /** + * @hidden + */ + MaskedTextBoxComponent.prototype.pasteHandler = function (e) { + var _a = e.target, selectionStart = _a.selectionStart, selectionEnd = _a.selectionEnd; + if (selectionEnd === selectionStart) { + return; + } + this.isPasted = true; + this.selection = [selectionStart, selectionEnd]; + }; + /** + * @hidden + */ + MaskedTextBoxComponent.prototype.inputHandler = function (e) { + var value = e.target.value; + var _a = this.selection, start = _a[0], end = _a[1]; + if (!this.mask) { + this.updateValue(value); + this.isPasted = false; + return; + } + var result; + if (this.isPasted) { + this.isPasted = false; + var rightPart = this.maskedValue.length - end; + var to = value.length - rightPart; + result = this.service.maskInRange(value.slice(start, to), this.maskedValue, start, end); + } + else { + result = this.service.maskInput(value, this.maskedValue, e.target.selectionStart); + } + this.updateInput(result.value, result.selection); + this.updateValue(result.value); + }; + /** + * @hidden + */ + MaskedTextBoxComponent.prototype.ngOnChanges = function (changes) { + var _this = this; + if (!this.mask) { + this.updateInput(this.value); + return; + } + var next = this.extractChanges(changes); + this.updateService(next); + if (exports.isChanged('value', changes)) { + var maskedValue = this.service.maskRaw(this.value); + if (maskedValue !== this.maskedValue) { + this.updateInput(maskedValue); + } + } + else if (exports.anyChanged(['promptPlaceholder', 'includeLiterals'], changes)) { + resolvedPromise.then(function () { + _this.updateValue(_this.maskedValue); + }); + } + else { + this.updateInput(this.service.maskRaw(this.value)); + } + }; + /** + * @hidden + * Writes a new value to the element. + */ + MaskedTextBoxComponent.prototype.writeValue = function (value) { + this.value = value === null ? '' : value; + this.updateInput(this.service.maskRaw(this.value)); + }; + /** + * @hidden + * Sets the function that will be called when a `change` event is triggered. + */ + MaskedTextBoxComponent.prototype.registerOnChange = function (fn) { + this.onChange = fn; + }; + /** + * @hidden + * Sets the function that will be called when a `touch` event is triggered. + */ + MaskedTextBoxComponent.prototype.registerOnTouched = function (fn) { + this.onTouched = fn; + }; + /** + * @hidden + * Called when the status of the component changes to or from `disabled`. + * Depending on the value, it enables or disables the appropriate DOM element. + * + * @param isDisabled + */ + MaskedTextBoxComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + /** + * @hidden + */ + MaskedTextBoxComponent.prototype.validate = function (_) { + if (this.maskValidation === false || !this.mask) { + return null; + } + if (!this.service.validationValue(this.maskedValue)) { + return null; + } + if (this.maskedValue.indexOf(this.prompt) !== -1) { + return { + patternError: { + mask: this.mask, + maskedValue: this.maskedValue, + value: this.value + } + }; + } + return null; + }; + MaskedTextBoxComponent.prototype.updateValue = function (maskedValue) { + if (this.mask && !this.service.validationValue(maskedValue)) { + this.value = ''; + } + else { + this.value = this.service.rawValue(maskedValue); + } + this.valueChange.emit(this.value); + this.onChange(this.value); + }; + MaskedTextBoxComponent.prototype.updateInput = function (maskedValue, selection) { + if (maskedValue === void 0) { maskedValue = ''; } + this.maskedValue = maskedValue; + this.renderer.setElementProperty(this.input.nativeElement, "value", maskedValue); + if (selection !== undefined) { + this.renderer.invokeElementMethod(this.input.nativeElement, "setSelectionRange", [selection, selection]); + } + }; + MaskedTextBoxComponent.prototype.extractChanges = function (changes) { + return Object.keys(changes).filter(function (key) { return key !== 'rules'; }).reduce(function (obj, key) { + obj[key] = changes[key].currentValue; + return obj; + }, {}); // tslint:disable-line:align + }; + MaskedTextBoxComponent.prototype.updateService = function (extra) { + var config = Object.assign({ + includeLiterals: this.includeLiterals, + mask: this.mask, + prompt: this.prompt, + promptPlaceholder: this.promptPlaceholder, + rules: this.rules + }, extra); // tslint:disable-line:align + this.service.update(config); + }; + return MaskedTextBoxComponent; +}()); +MaskedTextBoxComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoMaskedTextBox', + providers: [ + masking_service_1.MaskingService, + { + multi: true, + provide: forms_1.NG_VALUE_ACCESSOR, + useExisting: core_1.forwardRef(function () { return MaskedTextBoxComponent; }) /* tslint:disable-line */ + }, + { + multi: true, + provide: forms_1.NG_VALIDATORS, + useExisting: core_1.forwardRef(function () { return MaskedTextBoxComponent; }) /* tslint:disable-line */ + } + ], + selector: 'kendo-maskedtextbox', + template: "\n \n " + },] }, +]; +/** @nocollapse */ +MaskedTextBoxComponent.ctorParameters = function () { return [ + { type: masking_service_1.MaskingService, }, + { type: core_1.Renderer, }, + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, +]; }; +MaskedTextBoxComponent.propDecorators = { + 'disabled': [{ type: core_1.Input },], + 'title': [{ type: core_1.Input },], + 'direction': [{ type: core_1.HostBinding, args: ['attr.dir',] },], + 'hostClasses': [{ type: core_1.HostBinding, args: ['class.k-widget',] }, { type: core_1.HostBinding, args: ['class.k-maskedtextbox',] },], + 'hostFocusedClass': [{ type: core_1.HostBinding, args: ['class.k-state-focused',] },], + 'hostDisabledClass': [{ type: core_1.HostBinding, args: ['class.k-state-disabled',] },], + 'mask': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'rules': [{ type: core_1.Input },], + 'prompt': [{ type: core_1.Input },], + 'promptPlaceholder': [{ type: core_1.Input },], + 'includeLiterals': [{ type: core_1.Input },], + 'maskValidation': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'onFocus': [{ type: core_1.Output, args: ['focus',] },], + 'onBlur': [{ type: core_1.Output, args: ['blur',] },], + 'valueChange': [{ type: core_1.Output },], + 'input': [{ type: core_1.ViewChild, args: ['input',] },], + 'pasteHandler': [{ type: core_1.HostListener, args: ['paste', ['$event'],] },], + 'inputHandler': [{ type: core_1.HostListener, args: ['input', ['$event'],] },], +}; +exports.MaskedTextBoxComponent = MaskedTextBoxComponent; + + +/***/ }), +/* 254 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var result_1 = __webpack_require__(255); +var stream_1 = __webpack_require__(391); +var toArray = function (value) { return (value || '').split(''); }; +var ESCAPE_CHARACTER = '\\'; +/** + * @hidden + */ +var Parser = (function () { + function Parser(parse) { + this.parse = parse; + } + Parser.prototype.run = function (input, control) { + if (control === void 0) { control = ''; } + if (input instanceof stream_1.Stream) { + return this.parse(input); + } + else { + return this.parse(new stream_1.Stream(toArray(input), toArray(control))); + } + }; + //map :: Functor f => f a ~> (a -> b) -> f b + Parser.prototype.map = function (f) { + var _this = this; + return new Parser(function (stream) { return _this.parse(stream).map(f); }); + }; + //chain :: Chain m => m a ~> (a -> m b) -> m b + Parser.prototype.chain = function (f) { + var _this = this; + return new Parser(function (stream) { return _this.parse(stream).chain(function (v, s) { return f(v).run(s); }); }); + }; + Parser.prototype.isLiteral = function (c) { + return this.run(c).type === result_1.ResultType.Literal; + }; + return Parser; +}()); +exports.Parser = Parser; +/** + * @hidden + */ +exports.mask = function (_a) { + var prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder; + return function (rule) { return new Parser(function (stream) { + while (!stream.eof()) { + var _a = stream.peek(), char = _a.char, control = _a.control; + if (char === control && control === prompt) { + stream.eat(); + return new result_1.Result(prompt, stream, result_1.ResultType.Mask); + } + if (rule.test(char)) { + stream.eat(); + return new result_1.Result(char, stream, result_1.ResultType.Mask); + } + if (char === promptPlaceholder) { + stream.eat(); + return new result_1.Result(prompt, stream, result_1.ResultType.Mask); + } + stream.eat_input(); + } + stream.eat(); + return new result_1.Result(prompt, stream, result_1.ResultType.Mask); + }); }; +}; +/** + * @hidden + */ +exports.literal = function (token) { return new Parser(function (stream) { + // let {char, control} = stream.peek(); + var char = stream.peek().char; + if (char === token) { + stream.eat(); + return new result_1.Result(token, stream, result_1.ResultType.Literal); + } + // if (control === token) { + // while (!stream.eof() && char !== token) { + // stream.eat_input(); + // char = stream.peek().char; + // } + // } + // + // if (control !== undefined) { + // stream.eat(); + // } + return new result_1.Result(token, stream, result_1.ResultType.Literal); +}); }; +/** + * @hidden + */ +exports.unmask = function (prompt) { return function (rule) { return new Parser(function (stream) { + while (!stream.eof()) { + var _a = stream.peek(), char = _a.char, control = _a.control; + if (char === prompt && control === prompt) { + stream.eat(); + return new result_1.Result(char, stream); + } + if (rule.test(char)) { + stream.eat(); + return new result_1.Result(char, stream); + } + stream.eat_input(); + } + stream.eat(); + return new result_1.Result('', stream); +}); }; }; +/** + * @hidden + */ +exports.unliteral = function (token) { return new Parser(function (stream) { + if (stream.eof()) { + return new result_1.Result('', stream); + } + var char = stream.peek().char; + if (char === token) { + stream.eat(); + } + return new result_1.Result(token, stream); +}); }; +/** + * @hidden + */ +exports.token = function (rules, creator) { return new Parser(function (stream) { + var char = stream.next().char; + var rule = rules[char]; + if (char === ESCAPE_CHARACTER) { + char = stream.next().char; + return new result_1.Result(creator.literal(char), stream); + } + if (!rule) { + return new result_1.Result(creator.literal(char), stream); + } + return new result_1.Result(creator.mask(rule), stream); +}); }; +/** + * @hidden + */ +exports.rawMask = function (_a) { + var prompt = _a.prompt, promptPlaceholder = _a.promptPlaceholder; + return new Parser(function (stream) { + var char = stream.next().char; + if (char === prompt) { + return new result_1.Result(promptPlaceholder, stream); + } + return new result_1.Result(char, stream); + }); +}; +/** + * @hidden + */ +exports.rawLiteral = function (includeLiterals) { return new Parser(function (stream) { + var char = stream.next().char; + if (includeLiterals) { + return new result_1.Result(char, stream); + } + return new result_1.Result('', stream); +}); }; + + +/***/ }), +/* 255 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +var ResultType; +(function (ResultType) { + ResultType[ResultType["Literal"] = 0] = "Literal"; + ResultType[ResultType["Mask"] = 1] = "Mask"; + ResultType[ResultType["Undefined"] = 2] = "Undefined"; +})(ResultType = exports.ResultType || (exports.ResultType = {})); +/** + * @hidden + */ +var Result = (function () { + function Result(value, rest, type) { + if (type === void 0) { type = ResultType.Undefined; } + this.value = value; + this.rest = rest; + this.type = type; + } + //map :: Functor f => f a ~> (a -> b) -> f b + Result.prototype.map = function (fn) { + return new Result(fn(this.value), this.rest); + }; + //chain :: Chain m => m a ~> (a -> m b) -> m b + Result.prototype.chain = function (fn) { + return fn(this.value, this.rest); + }; + Result.prototype.fold = function (s, _ /*we don't need it*/) { + return s(this.value, this.rest); + }; + Result.prototype.concat = function (r) { + return this.map(function (vs, _) { return r.chain(function (v, __) { return vs.concat([v]); }); }); + }; + Result.prototype.toString = function () { + return "Result({ value: '" + this.value + "', rest: " + this.rest + " })"; + }; + return Result; +}()); +exports.Result = Result; + + +/***/ }), +/* 256 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var numerictextbox_component_1 = __webpack_require__(260); +var common_1 = __webpack_require__(9); +var kendo_angular_intl_1 = __webpack_require__(10); +var localized_messages_directive_1 = __webpack_require__(393); +var custom_messages_component_1 = __webpack_require__(258); +var COMPONENT_DIRECTIVES = [ + numerictextbox_component_1.NumericTextBoxComponent, + custom_messages_component_1.NumericTextBoxCustomMessagesComponent, + localized_messages_directive_1.LocalizedMessagesDirective +]; +/** + * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) + * definition for the NumericTextBox component. + * + * @example + * + * ```ts-no-run + * // Import the NumericTextBox module + * import { NumericTextBoxModule } from '@progress/kendo-angular-inputs'; + * + * // The browser platform with a compiler + * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + * + * import { NgModule } from '@angular/core'; + * + * // Import the app component + * import { AppComponent } from './app.component'; + * + * // Define the app module + * @@NgModule({ + * declarations: [AppComponent], // declare app component + * imports: [BrowserModule, NumericTextBoxModule], // import NumericTextBox module + * bootstrap: [AppComponent] + * }) + * export class AppModule {} + * + * // Compile and launch the module + * platformBrowserDynamic().bootstrapModule(AppModule); + * + * ``` + */ +var NumericTextBoxModule = (function () { + function NumericTextBoxModule() { + } + return NumericTextBoxModule; +}()); +NumericTextBoxModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [COMPONENT_DIRECTIVES], + exports: [COMPONENT_DIRECTIVES], + imports: [common_1.CommonModule], + providers: [ + { provide: kendo_angular_intl_1.IntlService, useClass: kendo_angular_intl_1.CldrIntlService } + ] + },] }, +]; +/** @nocollapse */ +NumericTextBoxModule.ctorParameters = function () { return []; }; +exports.NumericTextBoxModule = NumericTextBoxModule; + + +/***/ }), +/* 257 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * @hidden + */ +exports.MIN_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/inputs/api/NumericTextBoxComponent/#toc-min'; +/** + * @hidden + */ +exports.MAX_DOC_LINK = 'http://www.telerik.com/kendo-angular-ui/components/inputs/api/NumericTextBoxComponent/#toc-max'; +/** + * @hidden + */ +exports.POINT = "."; +/** + * @hidden + */ +exports.INITIAL_SPIN_DELAY = 500; +/** + * @hidden + */ +exports.SPIN_DELAY = 50; +/** + * @hidden + */ +exports.MAX_PRECISION = 20; + + +/***/ }), +/* 258 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +var messages_1 = __webpack_require__(259); +/** + * Custom component messages override default component messages. + */ +var NumericTextBoxCustomMessagesComponent = (function (_super) { + __extends(NumericTextBoxCustomMessagesComponent, _super); + function NumericTextBoxCustomMessagesComponent(service) { + var _this = _super.call(this) || this; + _this.service = service; + return _this; + } + Object.defineProperty(NumericTextBoxCustomMessagesComponent.prototype, "override", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + return NumericTextBoxCustomMessagesComponent; +}(messages_1.Messages)); +NumericTextBoxCustomMessagesComponent.decorators = [ + { type: core_1.Component, args: [{ + providers: [ + { + provide: messages_1.Messages, + useExisting: core_1.forwardRef(function () { return NumericTextBoxCustomMessagesComponent; }) // tslint:disable-line:no-forward-ref + } + ], + selector: 'kendo-numerictextbox-messages', + template: "" + },] }, +]; +/** @nocollapse */ +NumericTextBoxCustomMessagesComponent.ctorParameters = function () { return [ + { type: kendo_angular_l10n_1.LocalizationService, }, +]; }; +exports.NumericTextBoxCustomMessagesComponent = NumericTextBoxCustomMessagesComponent; + + +/***/ }), +/* 259 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var __extends = (this && this.__extends) || (function () { + var extendStatics = Object.setPrototypeOf || + ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || + function (d, b) { for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p]; }; + return function (d, b) { + extendStatics(d, b); + function __() { this.constructor = d; } + d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); + }; +})(); +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * @hidden + */ +var Messages = (function (_super) { + __extends(Messages, _super); + function Messages() { + return _super !== null && _super.apply(this, arguments) || this; + } + return Messages; +}(kendo_angular_l10n_1.ComponentMessages)); +Messages.propDecorators = { + 'decrement': [{ type: core_1.Input },], + 'increment': [{ type: core_1.Input },], +}; +exports.Messages = Messages; + + +/***/ }), +/* 260 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var enums_1 = __webpack_require__(130); +var max_validator_1 = __webpack_require__(395); +var min_validator_1 = __webpack_require__(396); +var forms_1 = __webpack_require__(12); +var kendo_angular_intl_1 = __webpack_require__(10); +var kendo_angular_l10n_1 = __webpack_require__(2); +var constants_1 = __webpack_require__(257); +var utils_1 = __webpack_require__(394); +var arrow_direction_1 = __webpack_require__(392); +/** + * Represents the Kendo UI NumericTextBox component for Angular. + */ +var NumericTextBoxComponent = (function () { + function NumericTextBoxComponent(intl, renderer, localizationService, rtl) { + this.intl = intl; + this.renderer = renderer; + this.localizationService = localizationService; + /** + * Determines whether the component is disabled. + */ + this.disabled = false; + /** + * Sets the title of the input element of the NumericTextBox. + */ + this.title = ''; + /** + * Specifies whether the value will be auto-corrected based on the min and max values. + */ + this.autoCorrect = false; + /** + * Specifies the number of decimals that the user can enter when the input is focused. + */ + this.decimals = null; + /** + * Specifies the value used to increment or decrement the component value. + */ + this.step = 1; + /** + * Specifies whether the **Up** and **Down** spin buttons should be rendered. + */ + this.spinners = true; + /** + * Determines whether the built-in min or max validators are enforced when validating a form. + * + * > The Angular 4.2.0 version introduces the `min` and `max` validation directives. As a result, even if you set `rangeValidation` + * to `false`, the built-in Angular validators will be executed. + */ + this.rangeValidation = true; //TODO: test + /** + * Sets or gets the `tabIndex` property of the NumericTextBox. + * Based on the [HTML tabindex](https://developer.mozilla.org/en-US/docs/Web/HTML/Global_attributes/tabindex) behavior, + * it determines whether the component is focusable. + * . + */ + this.tabIndex = 0; + /** + * Specifies the value of the NumericTextBox component. + */ + this.value = null; + /** + * Fires each time the user selects a new value. + */ + this.valueChange = new core_1.EventEmitter(); + /** + * Fires each time the user focuses the input element. + */ + this.onFocus = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + //TODO: test + /** + * Fires each time the input element gets blurred. + */ + this.onBlur = new core_1.EventEmitter(); //tslint:disable-line:no-output-rename + /** + * @hidden + */ + this.focused = false; + /** + * @hidden + */ + this.ArrowDirection = arrow_direction_1.ArrowDirection; + /** + * @hidden + */ + this.arrowDirection = arrow_direction_1.ArrowDirection.None; + this.inputValue = ''; + this.minValidateFn = utils_1.noop; + this.maxValidateFn = utils_1.noop; + this._format = "n2"; + //TODO: disable tslint and move those to the constructor level + this.ngChange = function (_) { }; + this.ngTouched = function () { }; + this.direction = rtl ? 'rtl' : 'ltr'; + } + Object.defineProperty(NumericTextBoxComponent.prototype, "format", { + /** + * Specifies the number format which is used when the component is not focused. + * If set to `null` or `undefined`, the default format will be used. + */ + get: function () { + var format = this._format; + return format !== null && format !== undefined ? format : 'n2'; + }, + set: function (value) { + this._format = value; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NumericTextBoxComponent.prototype, "widgetClasses", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + */ + NumericTextBoxComponent.prototype.arrowPress = function (direction, e) { + e.preventDefault(); + if (!this.disabled) { + this.focused = true; + this.focus(); + this.arrowDirection = direction; + if (this.step) { + this.spin(direction, constants_1.INITIAL_SPIN_DELAY); + } + else { + this.setInputValue(); + } + } + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.releaseArrow = function () { + clearTimeout(this.spinTimeout); + this.arrowDirection = arrow_direction_1.ArrowDirection.None; + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.ngOnChanges = function (changes) { + this.verifySettings(); + if (utils_1.anyChanged(['min', 'max', 'rangeValidation'], changes)) { + this.minValidateFn = this.rangeValidation ? min_validator_1.createMinValidator(this.min) : utils_1.noop; + this.maxValidateFn = this.rangeValidation ? max_validator_1.createMaxValidator(this.max) : utils_1.noop; + } + if (utils_1.anyChanged(['autoCorrect', 'decimals', 'min'], changes)) { + delete this.numericRegex; + } + if (utils_1.anyChanged(['value', 'format'], changes)) { + this.value = this.restrictModelValue(this.value); + this.setInputValue(); + } + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.ngOnDestroy = function () { + clearTimeout(this.spinTimeout); + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.validate = function (control) { + return this.minValidateFn(control) || this.maxValidateFn(control); + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.writeValue = function (value) { + var restrictedValue = this.restrictModelValue(value); + this.value = restrictedValue; + this.setInputValue(); + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.registerOnChange = function (fn) { + this.ngChange = fn; + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.registerOnTouched = function (fn) { + this.ngTouched = fn; + }; + /** + * @hidden + * Called when the status of the component changes to or from `disabled`. + * Depending on the value, it enables or disables the appropriate DOM element. + * + * @param isDisabled + */ + NumericTextBoxComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + /** + * Focuses the NumericTextBox component. + * + * @example + * ```ts + * @@Component({ + * selector: 'my-app', + * template: ` + * + * + * ` + * }) + * class AppComponent { } + * ``` + */ + NumericTextBoxComponent.prototype.focus = function () { + if (!this.numericInput) { + return; + } + this.renderer.invokeElementMethod(this.numericInput.nativeElement, "focus"); + }; + /** + * Blurs the NumericTextBox component. + */ + NumericTextBoxComponent.prototype.blur = function () { + if (!this.numericInput) { + return; + } + this.renderer.invokeElementMethod(this.numericInput.nativeElement, "blur"); + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.handleInput = function () { + var input = this.numericInput.nativeElement; + var selectionStart = input.selectionStart, selectionEnd = input.selectionEnd, inputValue = input.value; + var valid = this.isValid(inputValue); + if (!valid) { + input.value = this.inputValue; + this.setSelection(selectionStart - 1, selectionEnd - 1); + return; + } + var parsedValue = this.intl.parseNumber(inputValue); + var value = this.restrictDecimals(parsedValue); + if (this.autoCorrect) { + value = this.limitValue(value); + } + if (parsedValue !== value) { + this.setInputValue(value); + this.setSelection(selectionStart, selectionEnd); + } + else { + this.inputValue = inputValue; + } + this.updateValue(value); + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.handleFocus = function () { + var _this = this; + if (!this.focused) { + this.focused = true; + this.setInputValue(); + setTimeout(function () { + _this.setSelection(0, _this.inputValue.length); + }, 0); /* tslint:disable-line align */ + } + this.onFocus.emit(); + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.handleBlur = function () { + this.focused = false; + this.ngTouched(); + this.setInputValue(); + this.onBlur.emit(); + }; + /** + * @hidden + */ + NumericTextBoxComponent.prototype.handleKeyDown = function (e) { + if (this.disabled) { + return; + } + var step; + if (e.keyCode === enums_1.Keys.down) { + step = -1; + } + else if (e.keyCode === enums_1.Keys.up) { + step = 1; + } + if (step && this.step) { + e.preventDefault(); + this.addStep(step); + } + }; + Object.defineProperty(NumericTextBoxComponent.prototype, "incrementTitle", { + /** + * @hidden + */ + get: function () { + return this.localizationService.get('increment'); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NumericTextBoxComponent.prototype, "decrementTitle", { + /** + * @hidden + */ + get: function () { + return this.localizationService.get('decrement'); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(NumericTextBoxComponent.prototype, "decimalSeparator", { + get: function () { + var numberSymbols = this.intl.numberSymbols(); + return numberSymbols.decimal; + }, + enumerable: true, + configurable: true + }); + NumericTextBoxComponent.prototype.isValid = function (value) { + if (!this.numericRegex) { + this.numericRegex = utils_1.numericRegex({ + autoCorrect: this.autoCorrect, + decimals: this.decimals, + min: this.min, + separator: this.decimalSeparator + }); + } + return this.numericRegex.test(value); + }; + NumericTextBoxComponent.prototype.spin = function (step, timeout) { + var _this = this; + clearTimeout(this.spinTimeout); + this.spinTimeout = setTimeout(function () { + _this.spin(step, constants_1.SPIN_DELAY); + }, timeout); /* tslint:disable-line align */ + this.addStep(step); + }; + NumericTextBoxComponent.prototype.addStep = function (step) { + var value = utils_1.addValues(this.value || 0, this.step * step); + value = this.limitValue(value); + value = this.restrictDecimals(value); + this.setInputValue(value); + this.updateValue(value); + }; + NumericTextBoxComponent.prototype.setSelection = function (start, end) { + this.renderer.invokeElementMethod(this.numericInput.nativeElement, "setSelectionRange", [start, end]); + }; + NumericTextBoxComponent.prototype.limitValue = function (value) { + var result = value; + if (value !== null) { + if (utils_1.defined(this.max) && value > this.max) { + result = this.max; + } + if (utils_1.defined(this.min) && value < this.min) { + result = this.min; + } + } + return result; + }; + NumericTextBoxComponent.prototype.restrictModelValue = function (value) { + var result = this.restrictDecimals(value, true); + if (this.autoCorrect && this.limitValue(result) !== result) { + result = null; + } + return result; + }; + NumericTextBoxComponent.prototype.restrictDecimals = function (value, round) { + var decimals = this.decimals; + var result = value; + if (value && decimals !== null && decimals >= 0) { + if (round) { + result = parseFloat(value.toFixed(Math.min(decimals, constants_1.MAX_PRECISION))); + } + else { + var parts = String(value).split(constants_1.POINT); + var fraction = parts[1]; + if (fraction && fraction.length > decimals) { + fraction = fraction.substr(0, decimals); + result = parseFloat("" + parts[0] + constants_1.POINT + fraction); + } + } + } + return result; + }; + NumericTextBoxComponent.prototype.formatInputValue = function (value) { + return String(value).replace(constants_1.POINT, this.decimalSeparator); + }; + NumericTextBoxComponent.prototype.formatValue = function (value) { + var formattedValue; + if (value === null || !utils_1.defined(value) || value === '') { + formattedValue = ''; + } + else if (this.focused) { + formattedValue = this.formatInputValue(value); + } + else { + formattedValue = this.intl.formatNumber(value, this.format); + } + return formattedValue; + }; + NumericTextBoxComponent.prototype.setInputValue = function (value) { + if (value === void 0) { value = this.value; } + var formattedValue = this.formatValue(value); + this.renderer.setElementProperty(this.numericInput.nativeElement, "value", formattedValue); + this.inputValue = formattedValue; + }; + NumericTextBoxComponent.prototype.updateValue = function (candidate) { + if (candidate === this.value) { + return; + } + this.value = candidate; + this.ngChange(candidate); + this.valueChange.emit(candidate); + }; + NumericTextBoxComponent.prototype.verifySettings = function () { + if (!core_1.isDevMode()) { + return; + } + if (this.min !== null && this.max !== null && this.min > this.max) { + throw new Error("The max value should be bigger than the min. See " + constants_1.MIN_DOC_LINK + " and " + constants_1.MAX_DOC_LINK + "."); + } + }; + return NumericTextBoxComponent; +}()); +NumericTextBoxComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoNumericTextBox', + providers: [ + kendo_angular_l10n_1.LocalizationService, + { provide: kendo_angular_l10n_1.L10N_PREFIX, useValue: 'kendo.numerictextbox' }, + { provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(function () { return NumericTextBoxComponent; }), multi: true }, + { provide: forms_1.NG_VALIDATORS, useExisting: core_1.forwardRef(function () { return NumericTextBoxComponent; }), multi: true } /* tslint:disable-line */ + ], + selector: 'kendo-numerictextbox', + template: "\n \n \n \n \n \n \n \n \n \n \n \n \n \n " + },] }, +]; +/** @nocollapse */ +NumericTextBoxComponent.ctorParameters = function () { return [ + { type: kendo_angular_intl_1.IntlService, }, + { type: core_1.Renderer, }, + { type: kendo_angular_l10n_1.LocalizationService, }, + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, +]; }; +NumericTextBoxComponent.propDecorators = { + 'disabled': [{ type: core_1.Input },], + 'title': [{ type: core_1.Input },], + 'autoCorrect': [{ type: core_1.Input },], + 'format': [{ type: core_1.Input },], + 'max': [{ type: core_1.Input },], + 'min': [{ type: core_1.Input },], + 'decimals': [{ type: core_1.Input },], + 'placeholder': [{ type: core_1.Input },], + 'step': [{ type: core_1.Input },], + 'spinners': [{ type: core_1.Input },], + 'rangeValidation': [{ type: core_1.Input },], + 'tabIndex': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'onFocus': [{ type: core_1.Output, args: ['focus',] },], + 'onBlur': [{ type: core_1.Output, args: ['blur',] },], + 'numericInput': [{ type: core_1.ViewChild, args: ['numericInput',] },], + 'direction': [{ type: core_1.HostBinding, args: ['attr.dir',] },], + 'widgetClasses': [{ type: core_1.HostBinding, args: ['class.k-widget',] }, { type: core_1.HostBinding, args: ['class.k-numerictextbox',] },], +}; +exports.NumericTextBoxComponent = NumericTextBoxComponent; + + +/***/ }), +/* 261 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var slider_component_1 = __webpack_require__(263); +var common_1 = __webpack_require__(9); +var slider_ticks_component_1 = __webpack_require__(262); +var draggable_module_1 = __webpack_require__(250); +var kendo_angular_intl_1 = __webpack_require__(10); +var kendo_angular_resize_sensor_1 = __webpack_require__(82); +/** + * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) + * definition for the Slider component. + * + * @example + * + * ```ts-no-run + * // Import the Inputs module + * import { SliderModule } from '@progress/kendo-angular-inputs'; + * + * // The browser platform with a compiler + * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + * + * import { NgModule } from '@angular/core'; + * + * // Import the app component + * import { AppComponent } from './app.component'; + * + * // Define the app module + * @@NgModule({ + * declarations: [AppComponent], // declare app component + * imports: [BrowserModule, SliderModule], // import Slider module + * bootstrap: [AppComponent] + * }) + * export class AppModule {} + * + * // Compile and launch the module + * platformBrowserDynamic().bootstrapModule(AppModule); + * + * ``` + */ +var SliderModule = (function () { + function SliderModule() { + } + return SliderModule; +}()); +SliderModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [slider_component_1.SliderComponent, slider_ticks_component_1.KendoSliderTicksComponent], + exports: [slider_component_1.SliderComponent], + imports: [common_1.CommonModule, draggable_module_1.DraggableModule, kendo_angular_resize_sensor_1.ResizeSensorModule], + providers: [ + { provide: kendo_angular_intl_1.IntlService, useClass: kendo_angular_intl_1.CldrIntlService } + ] + },] }, +]; +/** @nocollapse */ +SliderModule.ctorParameters = function () { return []; }; +exports.SliderModule = SliderModule; + + +/***/ }), +/* 262 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var kendo_angular_l10n_1 = __webpack_require__(2); +/** + * @hidden + */ +var SliderTick = (function () { + function SliderTick(index) { + this.index = index; + this.first = false; + this.last = false; + } + return SliderTick; +}()); +/** + * @hidden + */ +var KendoSliderTicksComponent = (function () { + function KendoSliderTicksComponent(rtl) { + this.rtl = rtl; + this.tickClick = new core_1.EventEmitter(); + this.ticks = []; + } + KendoSliderTicksComponent.prototype.ngOnChanges = function (_) { + this.createTicks(); + }; + KendoSliderTicksComponent.prototype.onClick = function (event) { + this.tickClick.next(event); + }; + KendoSliderTicksComponent.prototype.tickClasses = function (tick) { + return { + 'k-first': (tick.first && !this.vertical) || (tick.last && this.vertical), + 'k-last': (tick.last && !this.vertical) || (tick.first && this.vertical), + 'k-tick': true + }; + }; + KendoSliderTicksComponent.prototype.createTicks = function () { + var result = []; + for (var i = 0; i < this.ticksCount; i++) { + result.push(new SliderTick(i)); + } + if (this.rtl) { + result = result.reverse(); + } + if (result.length > 0) { + result[0].first = true; + result[result.length - 1].last = true; + } + this.ticks = result; + }; + return KendoSliderTicksComponent; +}()); +KendoSliderTicksComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-slider-ticks', + template: "\n
    \n
  •  
  • \n
\n " + },] }, +]; +/** @nocollapse */ +KendoSliderTicksComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, +]; }; +KendoSliderTicksComponent.propDecorators = { + 'tickClick': [{ type: core_1.Output },], + 'vertical': [{ type: core_1.Input },], + 'ticksCount': [{ type: core_1.Input },], + 'title': [{ type: core_1.Input },], + 'step': [{ type: core_1.Input },], + 'container': [{ type: core_1.ViewChild, args: ['container',] },], + 'tickElements': [{ type: core_1.ViewChildren, args: ['tickElement',] },], +}; +exports.KendoSliderTicksComponent = KendoSliderTicksComponent; + + +/***/ }), +/* 263 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +var Observable_1 = __webpack_require__(1); +var Subscription_1 = __webpack_require__(11); +var kendo_inputs_common_1 = __webpack_require__(282); +var kendo_angular_l10n_1 = __webpack_require__(2); +var enums_1 = __webpack_require__(130); +__webpack_require__(21); +__webpack_require__(88); +__webpack_require__(67); +__webpack_require__(33); +__webpack_require__(145); +__webpack_require__(302); +__webpack_require__(91); +/** + * Represents the Kendo UI Slider component for Angular. + */ +var SliderComponent = (function () { + function SliderComponent(el, rtl) { + var _this = this; + this.rtl = rtl; + /** + * Sets the title of the **Increase** button of the Slider. + */ + this.incrementTitle = 'increment'; + /** + * Sets the title of the **Decrease** button of the Slider. + */ + this.decrementTitle = 'decrement'; + /** + * Makes the Slider side arrow buttons appear. When set to `false`, the buttons are not displayed. + */ + this.showButtons = true; + /** + * Denotes the location of the tick marks in the Slider. + * + * The available options are: + * * `before`—Tick marks are located to the top side of the horizontal track or to the left side of a vertical track. + * * `after`—Tick marks are located to the bottom side of the horizontal track or to the right side of the vertical track. + * * `both`—Tick marks are located on both sides of the track. + * * `none`—Tick marks are not visible. The actual elements are not added to the DOM tree. + */ + this.tickPlacement = 'both'; + /** + * Defines the title of the ticks. The default title for each tick is its Slider value. + * If a callback function is used, it accepts an argument holding the value of the component and returns a string with the new title. + */ + this.title = kendo_inputs_common_1.SliderUtil.identity; + /** + * Changes the title attribute of the drag handle, so it can be localized. + */ + this.dragHandleTitle = 'Drag'; + /** + * If set to `true`, it changes the orientation of the Slider from horizontal to vertical. + */ + this.vertical = false; + /** + * The minimum value of the Slider. The attribute accepts both integers and floating-point numbers. + */ + this.min = 0; + /** + * The maximum value of the Slider. The attribute accepts both integers and floating-point numbers. + */ + this.max = 10; + /** + * The step value of the Slider. The attribute accepts only positive numbers. Can be both integer or a float number. + */ + this.smallStep = 1; + /** + * If set to `true`, it disables the Slider. + */ + this.disabled = false; + /** + * The current value of the Slider when initially displayed. + * The component can use either the `value` binging or `NgModel`, but not both of them at the same time. + */ + this.value = 0; + /** + * Fires each time the user selects a new value. + */ + this.valueChange = new core_1.EventEmitter(); + this.dragging = false; + this.decreaseButtonSubscription = Subscription_1.Subscription.EMPTY; + this.increaseButtonSubscription = Subscription_1.Subscription.EMPTY; + /** + * @hidden + */ + this.ifEnabled = function (callback, event) { + if (!_this.disabled) { + callback.call(_this, event); + } + }; + this.ngChange = function (_) { }; + this.ngTouched = function () { }; + this.decreaseValue = function () { + _this.changeValue(kendo_inputs_common_1.SliderUtil.decreaseValueToStep(_this.getProps())); + }; + this.increaseValue = function () { + _this.changeValue(kendo_inputs_common_1.SliderUtil.increaseValueToStep(_this.getProps())); + }; + this.direction = rtl ? 'rtl' : 'ltr'; + this.wrapper = el.nativeElement; + } + Object.defineProperty(SliderComponent.prototype, "horizontalClass", { + get: function () { + return !this.vertical; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "verticalClass", { + get: function () { + return this.vertical; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "sliderClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "transitionsClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "widgetClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "stateDefaultClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "topLeftClass", { + get: function () { + return this.tickPlacement === 'before'; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "bottomRightClass", { + get: function () { + return this.tickPlacement === 'after'; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "disabledClass", { + get: function () { + return this.disabled; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "tabIndex", { + get: function () { + return this.disabled ? undefined : 0; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "ariaDisabled", { + get: function () { + return this.disabled ? true : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "ariaMin", { + get: function () { + return this.min; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "ariaMax", { + get: function () { + return this.max; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "ariaValue", { + get: function () { + return this.value ? this.value : this.min; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "reverse", { + get: function () { + return this.rtl && !this.vertical; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SliderComponent.prototype, "keyBinding", { + get: function () { + var reverse = this.reverse; + var increment = function (_a) { + var value = _a.value, smallStep = _a.smallStep; + return value + smallStep; + }; + var decrement = function (_a) { + var value = _a.value, smallStep = _a.smallStep; + return value - smallStep; + }; + return _a = {}, + _a[enums_1.Keys.left] = reverse ? increment : decrement, + _a[enums_1.Keys.right] = reverse ? decrement : increment, + _a[enums_1.Keys.down] = decrement, + _a[enums_1.Keys.up] = increment, + _a[enums_1.Keys.home] = function (_a) { + var min = _a.min; + return min; + }, + _a[enums_1.Keys.end] = function (_a) { + var max = _a.max; + return max; + }, + _a; + var _a; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + * Called when the status of the component changes to or from `disabled`. + * Depending on the value, it enables or disables the appropriate DOM element. + * + * @param isDisabled + */ + SliderComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + /** + * @hidden + */ + SliderComponent.prototype.active = function () { + this.draghandle.nativeElement.focus(); + }; + /** + * @hidden + */ + SliderComponent.prototype.keydown = function (event) { + this.onKeyDown(event); + }; + /** + * @hidden + */ + SliderComponent.prototype.blur = function () { + this.ngTouched(); + }; + SliderComponent.prototype.ngOnChanges = function (_) { + this.ticksCount = kendo_inputs_common_1.SliderUtil.calculateTicksCount(this.max, this.min, this.smallStep); + }; + SliderComponent.prototype.ngAfterViewInit = function () { + var _this = this; + if (!this.isDocumentAvailable()) { + return; + } + if (this.showButtons) { + var incAction = this.reverse ? function () { return _this.decreaseValue(); } : function () { return _this.increaseValue(); }; + var decAction = this.reverse ? function () { return _this.increaseValue(); } : function () { return _this.decreaseValue(); }; + this.increaseButtonSubscription = this.setValueChangeInterval(this.increaseButton.nativeElement, incAction); + this.decreaseButtonSubscription = this.setValueChangeInterval(this.decreaseButton.nativeElement, decAction); + } + this.sizeComponent(false); + if (this.ticks) { + this.ticks.tickElements + .changes + .subscribe(function () { return _this.sizeComponent(false); }); + } + }; + SliderComponent.prototype.ngOnDestroy = function () { + this.decreaseButtonSubscription.unsubscribe(); + this.increaseButtonSubscription.unsubscribe(); + }; + SliderComponent.prototype.onTickClick = function (event) { + var ticks = this.ticks.tickElements.map(function (element) { return element.nativeElement; }); + var index = ticks.indexOf(event.target); + this.changeValue(kendo_inputs_common_1.SliderUtil.calculateValueFromTick(index, this.getProps())); + }; + /** + * @hidden + */ + SliderComponent.prototype.onTrackClick = function (event) { + var trackClientRect = event.currentTarget.getBoundingClientRect(); + this.changeValue(kendo_inputs_common_1.SliderUtil.calculateValueFromTrack(trackClientRect, event, this.getProps())); + }; + SliderComponent.prototype.onIncrement = function () { + this.increaseValue(); + }; + SliderComponent.prototype.onDecrement = function () { + this.decreaseValue(); + }; + SliderComponent.prototype.isDocumentAvailable = function () { + return typeof document !== 'undefined'; + }; + /** + * @hidden + */ + SliderComponent.prototype.onHandleDrag = function (event) { + this.dragging = true; + var element = this.track.nativeElement.getBoundingClientRect(); + this.changeValue(kendo_inputs_common_1.SliderUtil.calculateValueFromTrack(element, event, this.getProps())); + }; + /** + * @hidden + */ + SliderComponent.prototype.onKeyDown = function (e) { + var options = this.getProps(); + var disabled = options.disabled, max = options.max, min = options.min; + var handler = this.keyBinding[e.keyCode]; + if (handler && !disabled) { + var value = handler(options); + this.changeValue(kendo_inputs_common_1.SliderUtil.trimValue(max, min, value)); + e.preventDefault(); + } + }; + /** + * @hidden + */ + SliderComponent.prototype.onHandleRelease = function () { + this.dragging = false; //needed for animation + }; + //ngModel binding + /** + * @hidden + */ + SliderComponent.prototype.writeValue = function (value) { + this.value = value; + this.sizeComponent(true); + }; + /** + * @hidden + */ + SliderComponent.prototype.registerOnChange = function (fn) { + this.ngChange = fn; + }; + /** + * @hidden + */ + SliderComponent.prototype.registerOnTouched = function (fn) { + this.ngTouched = fn; + }; + /** + * @hidden + */ + SliderComponent.prototype.changeValue = function (value) { + this.value = value; + this.ngChange(value); + this.valueChange.emit(value); + this.sizeComponent(true); + }; + /** + * @hidden + */ + SliderComponent.prototype.sizeComponent = function (animate) { + if (!this.isDocumentAvailable()) { + return; + } + var wrapper = this.wrapper.children[0]; + var props = this.getProps(); + var model = new kendo_inputs_common_1.SliderModel(props, wrapper, this.track.nativeElement); + model.resizeTrack(); + if (this.ticks) { + model.resizeTicks(this.ticks.container.nativeElement, this.ticks.tickElements.map(function (element) { return element.nativeElement; })); + } + this.handleAnimation(animate); //first time the widget is initialized the selection should not be animated + model.positionHandle(this.draghandle.nativeElement); + model.positionSelection(this.draghandle.nativeElement, this.sliderSelection.nativeElement); + if (this.fixedTickWidth) { + model.resizeWrapper(); + } + }; + SliderComponent.prototype.setValueChangeInterval = function (element, callback) { + var _this = this; + var mousedown = Observable_1.Observable.fromEvent(element, 'mousedown'); + var mouseup = Observable_1.Observable.fromEvent(element, 'mouseup'); + var mouseout = Observable_1.Observable.fromEvent(element, 'mouseout'); + var subscription = mousedown + .filter(function (e) { return e.button === 0; }) + .filter(function () { return !_this.disabled; }) + .concatMap(function () { + return Observable_1.Observable.interval(150) + .startWith(-1) + .takeUntil(Observable_1.Observable.merge(mouseup, mouseout)); + }) + .subscribe(function () { return callback(); }); + return subscription; + }; + SliderComponent.prototype.handleAnimation = function (animate) { + var transition = ''; + if (!animate) { + transition = 'none'; + } + this.draghandle.nativeElement.style.transition = transition; + this.sliderSelection.nativeElement.style.transition = transition; + }; + SliderComponent.prototype.getProps = function () { + return { + buttons: this.showButtons, + disabled: this.disabled, + fixedTickWidth: this.fixedTickWidth, + max: this.max, + min: this.min, + reverse: this.reverse, + smallStep: this.smallStep, + value: kendo_inputs_common_1.SliderUtil.trimValue(this.max, this.min, this.value), + vertical: this.vertical + }; + }; + return SliderComponent; +}()); +SliderComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoSlider', + providers: [ + { multi: true, provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(function () { return SliderComponent; }) } /* tslint:disable-line */ + ], + selector: 'kendo-slider', + template: "\n\n
\n \n \n \n \n \n \n \n \n \n \n
\n
\n
\n Drag\n
\n\n \n
\n\n " + },] }, +]; +/** @nocollapse */ +SliderComponent.ctorParameters = function () { return [ + { type: core_1.ElementRef, }, + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, +]; }; +SliderComponent.propDecorators = { + 'incrementTitle': [{ type: core_1.Input },], + 'decrementTitle': [{ type: core_1.Input },], + 'showButtons': [{ type: core_1.Input },], + 'tickPlacement': [{ type: core_1.Input },], + 'title': [{ type: core_1.Input },], + 'dragHandleTitle': [{ type: core_1.Input },], + 'vertical': [{ type: core_1.Input },], + 'min': [{ type: core_1.Input },], + 'max': [{ type: core_1.Input },], + 'smallStep': [{ type: core_1.Input },], + 'fixedTickWidth': [{ type: core_1.Input },], + 'disabled': [{ type: core_1.Input },], + 'value': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'track': [{ type: core_1.ViewChild, args: ['track',] },], + 'draghandle': [{ type: core_1.ViewChild, args: ['draghandle',] },], + 'sliderSelection': [{ type: core_1.ViewChild, args: ['sliderSelection',] },], + 'ticks': [{ type: core_1.ViewChild, args: ['ticks',] },], + 'decreaseButton': [{ type: core_1.ViewChild, args: ['decreaseButton',] },], + 'increaseButton': [{ type: core_1.ViewChild, args: ['increaseButton',] },], + 'direction': [{ type: core_1.HostBinding, args: ['attr.dir',] },], + 'horizontalClass': [{ type: core_1.HostBinding, args: ['class.k-slider-horizontal',] },], + 'verticalClass': [{ type: core_1.HostBinding, args: ['class.k-slider-vertical',] },], + 'sliderClass': [{ type: core_1.HostBinding, args: ['class.k-slider',] },], + 'transitionsClass': [{ type: core_1.HostBinding, args: ['class.k-slider-transitions',] },], + 'widgetClass': [{ type: core_1.HostBinding, args: ['class.k-widget',] },], + 'stateDefaultClass': [{ type: core_1.HostBinding, args: ['class.k-state-default',] },], + 'topLeftClass': [{ type: core_1.HostBinding, args: ['class.k-slider-topleft',] },], + 'bottomRightClass': [{ type: core_1.HostBinding, args: ['class.k-slider-bottomright',] },], + 'disabledClass': [{ type: core_1.HostBinding, args: ['class.k-state-disabled',] },], + 'tabIndex': [{ type: core_1.HostBinding, args: ['tabIndex',] },], + 'ariaDisabled': [{ type: core_1.HostBinding, args: ['attr.aria-disabled',] },], + 'ariaMin': [{ type: core_1.HostBinding, args: ['attr.aria-valuemin',] },], + 'ariaMax': [{ type: core_1.HostBinding, args: ['attr.aria-valuemax',] },], + 'ariaValue': [{ type: core_1.HostBinding, args: ['attr.aria-valuenow',] },], + 'active': [{ type: core_1.HostListener, args: ['click',] }, { type: core_1.HostListener, args: ['focus',] },], + 'keydown': [{ type: core_1.HostListener, args: ['keydown', ['$event'],] },], + 'blur': [{ type: core_1.HostListener, args: ['blur',] },], +}; +exports.SliderComponent = SliderComponent; + + +/***/ }), +/* 264 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var switch_component_1 = __webpack_require__(265); +var common_1 = __webpack_require__(9); +var draggable_module_1 = __webpack_require__(250); +var kendo_angular_intl_1 = __webpack_require__(10); +var kendo_angular_resize_sensor_1 = __webpack_require__(82); +/** + * Represents the [NgModule](https://angular.io/docs/ts/latest/guide/ngmodule.html) + * definition for the Switch component. + * + * @example + * + * ```ts-no-run + * // Import the Switch module + * import { SwitchModule } from '@progress/kendo-angular-inputs'; + * + * // The browser platform with a compiler + * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + * + * import { NgModule } from '@angular/core'; + * + * // Import the app component + * import { AppComponent } from './app.component'; + * + * // Define the app module + * @@NgModule({ + * declarations: [AppComponent], // declare app component + * imports: [BrowserModule, SwitchModule], // import Switch module + * bootstrap: [AppComponent] + * }) + * export class AppModule {} + * + * // Compile and launch the module + * platformBrowserDynamic().bootstrapModule(AppModule); + * + * ``` + */ +var SwitchModule = (function () { + function SwitchModule() { + } + return SwitchModule; +}()); +SwitchModule.decorators = [ + { type: core_1.NgModule, args: [{ + declarations: [switch_component_1.SwitchComponent], + exports: [switch_component_1.SwitchComponent], + imports: [common_1.CommonModule, draggable_module_1.DraggableModule, kendo_angular_resize_sensor_1.ResizeSensorModule], + providers: [ + { provide: kendo_angular_intl_1.IntlService, useClass: kendo_angular_intl_1.CldrIntlService } + ] + },] }, +]; +/** @nocollapse */ +SwitchModule.ctorParameters = function () { return []; }; +exports.SwitchModule = SwitchModule; + + +/***/ }), +/* 265 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var forms_1 = __webpack_require__(12); +var kendo_angular_l10n_1 = __webpack_require__(2); +var enums_1 = __webpack_require__(130); +var kendo_inputs_common_1 = __webpack_require__(282); +/** + * Represents the Kendo UI Switch component for Angular. + */ +var SwitchComponent = (function () { + function SwitchComponent(rtl) { + var _this = this; + this.rtl = rtl; + /** + * Changes the **On** label so it can be localized. + */ + this.onLabel = "ON"; + /** + * Changes the **Off** label so it can be localized. + */ + this.offLabel = "OFF"; + /** + * Sets the current value of the Switch when initially displayed. + */ + this.checked = false; + /** + * Disables the Switch when set to `true`. + */ + this.disabled = false; + /** + * Fires each time the user selects a new value. + */ + this.valueChange = new core_1.EventEmitter(); + /** + * @hidden + */ + this.changeValue = function (value) { + _this.checked = value; + _this.valueChange.emit(value); + _this.ngChange(value); + }; + this.ngChange = function (_) { }; + this.ngTouched = function () { }; + this.keyDownHandler = function (event) { + var keyCode = event.keyCode; + if (keyCode === enums_1.Keys.space || keyCode === enums_1.Keys.enter) { + _this.controller.change(!_this.checked); + } + }; + this.ifEnabled = function (callback, event) { + if (!_this.disabled) { + callback(event); + } + }; + this.applyStyle = function (props) { + Object.keys(props).forEach(function (x) { + _this.dragHandle.nativeElement.style[x] = props[x]; + }); + }; + this.updateView = function (elements) { + if (_this.isDocumentAvailable()) { + _this.applyStyle(_this.controller.addAnimation(elements.handle)); + } + }; + this.direction = rtl ? 'rtl' : 'ltr'; + this.controller = new kendo_inputs_common_1.SwitchController(this.updateView, this.changeValue); + } + /** + * @hidden + */ + SwitchComponent.prototype.keyDown = function (event) { + event.preventDefault(); + this.ifEnabled(this.keyDownHandler, event); + }; + Object.defineProperty(SwitchComponent.prototype, "ariaDisabled", { + get: function () { + return this.disabled ? true : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SwitchComponent.prototype, "ariaChecked", { + get: function () { + return this.checked ? true : undefined; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SwitchComponent.prototype, "widget", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SwitchComponent.prototype, "switchClass", { + get: function () { + return true; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SwitchComponent.prototype, "switchOn", { + get: function () { + return this.checked; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SwitchComponent.prototype, "switchOff", { + get: function () { + return !this.checked; + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(SwitchComponent.prototype, "stateDisabled", { + get: function () { + return this.disabled; + }, + enumerable: true, + configurable: true + }); + /** + * @hidden + * Called when the status of the component changes to or from `disabled`. + * Depending on the value, it enables or disables the appropriate DOM element. + * + * @param isDisabled + */ + SwitchComponent.prototype.setDisabledState = function (isDisabled) { + this.disabled = isDisabled; + }; + /** + * @hidden + */ + SwitchComponent.prototype.onResize = function () { + this.updateState(); + }; + /** + * @hidden + */ + SwitchComponent.prototype.onBlur = function () { + this.ngTouched(); + }; + /** + * @hidden + */ + SwitchComponent.prototype.ngAfterViewInit = function () { + this.updateState(); + }; + /** + * @hidden + */ + SwitchComponent.prototype.onHandleDrag = function (event) { + this.ifEnabled(this.controller.onDrag, event); + }; + /** + * @hidden + */ + SwitchComponent.prototype.onHandlePress = function (event) { + this.ifEnabled(this.controller.onPress, event); + }; + /** + * @hidden + */ + SwitchComponent.prototype.onHandleRelease = function (event) { + this.ifEnabled(this.controller.onRelease, event); + }; + SwitchComponent.prototype.isDocumentAvailable = function () { + return typeof document !== 'undefined'; + }; + SwitchComponent.prototype.updateState = function () { + var coordsLeft = 0; + var coordsRight = 0; + var handleMargin = 0; + var handleOffset = 0; + var wrapperOffset = 0; + if (this.isDocumentAvailable()) { + coordsLeft = this.wrapper.nativeElement.getBoundingClientRect().left; + coordsRight = this.wrapper.nativeElement.getBoundingClientRect().right; + handleMargin = parseInt(getComputedStyle(this.dragHandle.nativeElement)['margin-right'], 10); + handleOffset = this.dragHandle.nativeElement.offsetWidth; + wrapperOffset = this.wrapper.nativeElement.offsetWidth; + } + this.controller.updateState({ + animate: false, + checked: this.checked, + coords: { + left: coordsLeft, + right: coordsRight + }, + handleMargin: handleMargin, + handleOffset: handleOffset, + reverse: this.rtl, + wrapperOffset: wrapperOffset + }); + }; + //ngModel binding + /** + * @hidden + */ + SwitchComponent.prototype.writeValue = function (value) { + this.checked = value === null ? false : value; + this.updateState(); + }; + /** + * @hidden + */ + SwitchComponent.prototype.registerOnChange = function (fn) { + this.ngChange = fn; + }; + /** + * @hidden + */ + SwitchComponent.prototype.registerOnTouched = function (fn) { + this.ngTouched = fn; + }; + return SwitchComponent; +}()); +SwitchComponent.decorators = [ + { type: core_1.Component, args: [{ + exportAs: 'kendoSwitch', + providers: [ + { multi: true, provide: forms_1.NG_VALUE_ACCESSOR, useExisting: core_1.forwardRef(function () { return SwitchComponent; }) } /* tslint:disable-line */ + ], + selector: 'kendo-switch', + template: "\n \n \n \n \n \n {{onLabel}}\n {{offLabel}}\n \n \n \n " + },] }, +]; +/** @nocollapse */ +SwitchComponent.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Optional }, { type: core_1.Inject, args: [kendo_angular_l10n_1.RTL,] },] }, +]; }; +SwitchComponent.propDecorators = { + 'onLabel': [{ type: core_1.Input },], + 'offLabel': [{ type: core_1.Input },], + 'checked': [{ type: core_1.Input },], + 'disabled': [{ type: core_1.Input },], + 'valueChange': [{ type: core_1.Output },], + 'dragHandle': [{ type: core_1.ViewChild, args: ['dragHandle',] },], + 'wrapper': [{ type: core_1.ViewChild, args: ['wrapper',] },], + 'direction': [{ type: core_1.HostBinding, args: ['attr.dir',] },], + 'keyDown': [{ type: core_1.HostListener, args: ['keydown', ['$event'],] },], + 'ariaDisabled': [{ type: core_1.HostBinding, args: ['attr.aria-disabled',] },], + 'ariaChecked': [{ type: core_1.HostBinding, args: ['attr.aria-checked',] },], + 'widget': [{ type: core_1.HostBinding, args: ['class.k-widget',] },], + 'switchClass': [{ type: core_1.HostBinding, args: ['class.k-switch',] },], + 'switchOn': [{ type: core_1.HostBinding, args: ['class.k-switch-on',] },], + 'switchOff': [{ type: core_1.HostBinding, args: ['class.k-switch-off',] },], + 'stateDisabled': [{ type: core_1.HostBinding, args: ['class.k-state-disabled',] },], +}; +exports.SwitchComponent = SwitchComponent; + + +/***/ }), +/* 266 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var intl_members_1 = __webpack_require__(80); +var intl_members_2 = __webpack_require__(80); +var intl_members_3 = __webpack_require__(80); +/** + * The Internationalization service implemented by using + * the CLDR Database via the `@telerik/kendo-intl` package. + */ +var CldrIntlService = (function () { + /** + * Creates a new instance of the service with the ID of the specified locale. + * + * Note that the parts of the locale ID can be separated by either `_` (underscore) + * or `-` (dash). + * + * @param localeId - The default locale ID. + */ + function CldrIntlService(localeId) { + // Angular locales use underscore, e.g. en_US + // while IETF BCP-47 specifies a dash. + // https://tools.ietf.org/html/bcp47 + this.localeId = localeId.replace(/_/g, '-'); + } + /** + * Formats a string with placeholders such as + * `Total amount {0:c}`. + * + * @param format - The format string. + * @param values - One or more values to output in the format string placeholders. + * @return - The formatted string. + */ + CldrIntlService.prototype.format = function (format) { + var values = []; + for (var _i = 1; _i < arguments.length; _i++) { + values[_i - 1] = arguments[_i]; + } + return intl_members_1.format(format, values, this.localeId); + }; + /** + * Converts an object to a string based on the specified format. + * + * @param value - The value to format. + * @param format - The format to use. + * @param localeId - The locale ID to use in place of the default one. Optional. + * @return The formatted object. + */ + CldrIntlService.prototype.toString = function (value, format, localeId) { + return intl_members_1.toString(value, format, localeId || this.localeId); + }; + /** + * Converts a `Date` object to a string based on the specified format. + * If no format is provided, the default short date format is used. + * + * @param value - The date to format. + * @param format - The format string or options. + * @param localeId - The locale ID to use in place of the default one. Optional. + * @return The formatted date. + */ + CldrIntlService.prototype.formatDate = function (value, format, localeId) { + return intl_members_2.formatDate(value, format, localeId || this.localeId); + }; + /** + * Converts a string to a `Date` object based on the specified format. + * + * @param value - The string to convert. + * @param format - The format strings or options. + * @param localeId - The locale ID to use in place of the default one. Optional. + * @return The parsed date. + */ + CldrIntlService.prototype.parseDate = function (value, format, localeId) { + return intl_members_2.parseDate(value, format, localeId || this.localeId); + }; + /** + * Converts a string to a `Number`. + * + * @param value - The string to convert. + * @param format - The format string or options. + * @param localeId - The locale ID to use in place of the default one. Optional. + * @return The parsed number. + */ + CldrIntlService.prototype.parseNumber = function (value, format, localeId) { + return intl_members_3.parseNumber(value, localeId || this.localeId, format); + }; + /** + * Converts a `Number` to a string based on the specified format. + * + * @param value - The number to format. + * @param format - The format string or options. + * @param localeId - The locale ID to use in place of the default one. Optional. + * @return The formatted number. + */ + CldrIntlService.prototype.formatNumber = function (value, format, localeId) { + return intl_members_3.formatNumber(value, format, localeId || this.localeId); + }; + /** + * Returns the date names from the current locale based on the option. + * + * The available `type` values are: + * - `era` + * - `year` + * - `quarter` + * - `month` + * - `week` + * - `day` + * - `dayperiod` + * - `hour` + * - `minute` + * - `second` + * - `zone` + * + * The available `nameType` values are: + * - `wide` + * - `narrow` + * - `short` + * + * @param options - Detailed configuration for the desired date field name. + * @param localeId - The locale ID to use in place of the default one. Optional. + * @return - The day names from the current locale based on the option. + * @returns The localized date field name from the current locale based on the option. + * + * @example + * ``` + * dateFieldName({ type: 'day' }); //returns 'day'; + * dateFieldName({ type: 'day', nameType: 'wide' }); //returns 'day'; + * dateFieldName({ type: 'month', nameType: 'short' }); //returns 'mo.'; + * dateFieldName({ type: 'month', nameType: 'wide' }); //returns 'month'; + * ``` + */ + CldrIntlService.prototype.dateFieldName = function (options, localeId) { + return intl_members_2.dateFieldName(options, localeId || this.localeId); + }; + /** + * Returns a localized date field name based on specific dateFieldName options. + * + * The available type values are: + * - `day` + * - `dayperiod` + * - `months` + * - `quarters` + * - `eras` + * + * @param options - Detailed configuration for the desired date format. + * @param localeId - The locale ID to use in place of the default one. Optional. + * @return - The day names from the current locale based on the option. + */ + CldrIntlService.prototype.dateFormatNames = function (options, localeId) { + return intl_members_2.dateFormatNames(localeId || this.localeId, options); + }; + /** + * Splits the date format into objects containing information about each part of the pattern. + * + * @param format The format string or options. + * @param localeId The optional locale id. If not specified, the `"en"` locale id is used. + * @returns The date format parts. + */ + CldrIntlService.prototype.splitDateFormat = function (format, localeId) { + return intl_members_2.splitDateFormat(format, localeId || this.localeId); + }; + /** + * Returns the number symbols from the current locale based on the option. + * + * @param localeId - The locale ID to use in place of the default one. Optional. + * @return - The number symbols from the current locale. + */ + CldrIntlService.prototype.numberSymbols = function (localeId) { + return intl_members_3.numberSymbols(localeId || this.localeId); + }; + /** + * Returns the first day index starting from Sunday. + * + * @param localeId - The locale ID. Defaults to the current locale ID. + * @return - The index of the first day of the week (0 == Sunday). + */ + CldrIntlService.prototype.firstDay = function (localeId) { + return intl_members_2.firstDay(localeId || this.localeId); + }; + return CldrIntlService; +}()); +CldrIntlService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +CldrIntlService.ctorParameters = function () { return [ + { type: undefined, decorators: [{ type: core_1.Inject, args: [core_1.LOCALE_ID,] },] }, +]; }; +exports.CldrIntlService = CldrIntlService; + + +/***/ }), +/* 267 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var intl_service_1 = __webpack_require__(81); +var isNumeric = function (value) { return !isNaN(value - parseFloat(value)); }; +/** + * Formats a date value to a string based on the requested format. + * This pipe uses the IntlService. + * @see IntlService + * + * @example + * ```ng-template-no-run + *
    + *
  • {{date | kendoDate }}
  • + *
  • {{milliseconds | kendoDate: 'M/dd/yyy' }}
  • + *
  • {{stringDate | kendoDate: 'G' }}
  • + *
+ * ``` + */ +var DatePipe = (function () { + /** + * @hidden + */ + function DatePipe(intlService) { + this.intlService = intlService; + } + /** + * Converts a `Date` object to a string based on the specified format. + * If no format is provided, the default short date format is used. + * + * @param value - The date to format. + * @param format - The format string or options. + * @return - The formatted date. + */ + DatePipe.prototype.transform = function (value, format) { + if (format === void 0) { format = ""; } + value = this.normalize(value); + if (value) { + return this.intlService.formatDate(value, format); + } + return value; + }; + DatePipe.prototype.normalize = function (value) { + if (value && typeof value === 'string') { + value = this.intlService.parseDate(value); + } + else if (value && isNumeric(value)) { + value = new Date(parseFloat(value)); + } + return value; + }; + return DatePipe; +}()); +DatePipe.decorators = [ + { type: core_1.Pipe, args: [{ + name: 'kendoDate' + },] }, +]; +/** @nocollapse */ +DatePipe.ctorParameters = function () { return [ + { type: intl_service_1.IntlService, }, +]; }; +exports.DatePipe = DatePipe; + + +/***/ }), +/* 268 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var intl_service_1 = __webpack_require__(81); +/** + * Formats a number value to a string based on the requested format. + * This pipe uses the `IntlService`. + * @see IntlService + * + * @example + * ```ng-template-no-run + *
    + *
  • {{decimal | kendoNumber:'c' }}
  • + *
  • {{stringNumber | kendoNumber:'p' }}
  • + *
  • {{int | kendoNumber:'##.00' }}
  • + *
+ * ``` + */ +var NumberPipe = (function () { + /** + * @hidden + */ + function NumberPipe(intlService) { + this.intlService = intlService; + } + /** + * Converts a `Number` object to a string based on the specified format. + * If no format is provided, the default short date format is used. + * + * @param value - The date to format. + * @param format - The format string or options. + * @return - The formatted number. + */ + NumberPipe.prototype.transform = function (value, format) { + if (typeof value === 'string') { + value = this.intlService.parseNumber(value); + } + if (value !== null && value !== undefined) { + return this.intlService.formatNumber(value, format); + } + return value; + }; + return NumberPipe; +}()); +NumberPipe.decorators = [ + { type: core_1.Pipe, args: [{ + name: 'kendoNumber' + },] }, +]; +/** @nocollapse */ +NumberPipe.ctorParameters = function () { return [ + { type: intl_service_1.IntlService, }, +]; }; +exports.NumberPipe = NumberPipe; + + +/***/ }), +/* 269 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +/* tslint:disable:max-line-length */ +/** + * An abstract base class for a service that returns localized messages. + * + * For more information, refer to the section on [using the message service]({% slug messages_l10n_kendouiforangular %}#toc-using-the-message-service). + */ +var MessageService = (function () { + function MessageService() { + } + return MessageService; +}()); +MessageService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +MessageService.ctorParameters = function () { return []; }; +exports.MessageService = MessageService; + + +/***/ }), +/* 270 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var popup_component_1 = __webpack_require__(131); +/** + * Used to inject the Popup container. If not provided, the first root component of + * the application is used. + * + * @example + * + * ```ts-no-run + * // Import the Popup module + * import { PopupModule, POPUP_CONTAINER } from '@progress/kendo-angular-popup'; + * + * // The browser platform with a compiler + * import { platformBrowserDynamic } from '@angular/platform-browser-dynamic'; + * + * import { NgModule } from '@angular/core'; + * + * // Import the app component + * import { AppComponent } from './app.component'; + * + * // Define the app module + * @@NgModule({ + * declarations: [AppComponent], // declare app component + * imports: [BrowserModule, PopupModule], // import Popup module + * bootstrap: [AppComponent], + * providers: [{ + * provide: POPUP_CONTAINER, + * useFactory: () => { + * //return the container ElementRef, where the popup will be injected + * } + * }] + * }) + * export class AppModule {} + * + * // Compile and launch the module + * platformBrowserDynamic().bootstrapModule(AppModule); + * ``` + */ +exports.POPUP_CONTAINER = new core_1.InjectionToken('Popup Container'); +/** + * A service for opening Popup components dynamically. + * + * For more information on how to use this class, refer to the article about + * [`PopupService`]({% slug service_popup_kendouiforangular %}). + * + * @export + * @class PopupService + */ +var PopupService = (function () { + function PopupService(applicationRef, componentFactoryResolver, injector, container) { + this.applicationRef = applicationRef; + this.componentFactoryResolver = componentFactoryResolver; + this.injector = injector; + this.container = container; + } + Object.defineProperty(PopupService.prototype, "rootViewContainer", { + /** + * Gets the root view container into which the component will be injected. + * + * @returns {ComponentRef} + */ + get: function () { + //https://github.com/angular/angular/blob/4.0.x/packages/core/src/application_ref.ts#L571 + var rootComponents = this.applicationRef.components || []; + if (rootComponents[0]) { + return rootComponents[0]; + } + throw new Error("\n View Container not found! Inject the POPUP_CONTAINER or define a specific ViewContainerRef via the appendTo option.\n See http://www.telerik.com/kendo-angular-ui/components/popup/api/POPUP_CONTAINER/ for more details.\n "); + }, + enumerable: true, + configurable: true + }); + Object.defineProperty(PopupService.prototype, "rootViewContainerNode", { + /** + * Sets or gets the HTML element of the root component container. + * + * @returns {HTMLElement} + */ + get: function () { + return this.container ? this.container.nativeElement : this.getComponentRootNode(this.rootViewContainer); + }, + enumerable: true, + configurable: true + }); + /** + * Opens a Popup component. + * + * Created Popups are mounted in the DOM directly in the root application component. + * + * @param {PopupSettings} options - The options that define the Popup. + * @returns {ComponentRef} - A reference to the Popup object. + * + * @example + * + * ```ts-no-run + * @@Component({ + * selector: 'my-app', + * template: ` + * + * Popup content + * + * + * ` + * }) + * export class AppComponent { + * public popupRef: PopupRef; + * + * constructor( private popupService: PopupService ) {} + * + * public open(anchor: ElementRef, template: TemplateRef): void { + * if (this.popupRef) { + * this.popupRef.close(); + * this.popupRef = null; + * return; + * } + * + * this.popupRef = this.popupService.open({ + * anchor: anchor, + * content: template + * }); + * } + * } + * ``` + */ + PopupService.prototype.open = function (options) { + if (options === void 0) { options = {}; } + var _a = this.contentFrom(options.content), component = _a.component, nodes = _a.nodes; + var popupComponentRef = this.appendPopup(nodes, options.appendTo); + var popupInstance = popupComponentRef.instance; + this.projectComponentInputs(popupComponentRef, options); + if (component) { + component.changeDetectorRef.detectChanges(); + } + return { + close: function () { + // XXX: Destroy is required due to this bug + // https://github.com/angular/angular/issues/15578 + // + if (component) { + component.destroy(); + } + else { + popupComponentRef.instance.content = null; + popupComponentRef.changeDetectorRef.detectChanges(); + } + popupComponentRef.destroy(); + }, + content: component, + popup: popupComponentRef, + popupAnchorViewportLeave: popupInstance.anchorViewportLeave, + popupClose: popupInstance.close, + popupElement: this.getComponentRootNode(popupComponentRef), + popupOpen: popupInstance.open + }; + }; + PopupService.prototype.appendPopup = function (nodes, container) { + var appRef = this.applicationRef; + var popupComponentRef = this.createComponent(popup_component_1.PopupComponent, nodes, container); + if (!container) { + appRef.attachView(popupComponentRef.hostView); + this.rootViewContainerNode.appendChild(this.getComponentRootNode(popupComponentRef)); + } + return popupComponentRef; + }; + /** + * Gets the HTML element for a component reference. + * + * @param {ComponentRef} componentRef + * @returns {HTMLElement} + */ + PopupService.prototype.getComponentRootNode = function (componentRef) { + return componentRef.hostView.rootNodes[0]; + }; + /** + * Gets the `ComponentFactory` instance by its type. + * + * @param {*} componentClass + * @param {*} nodes + * @returns {ComponentRef} + */ + PopupService.prototype.getComponentFactory = function (componentClass) { + return this.componentFactoryResolver.resolveComponentFactory(componentClass); + }; + /** + * Creates a component reference from a `Component` type class. + * + * @param {*} componentClass + * @param {*} nodes + * @returns {ComponentRef} + */ + PopupService.prototype.createComponent = function (componentClass, nodes, container) { + var factory = this.getComponentFactory(componentClass); + return container ? + container.createComponent(factory, undefined, this.injector, nodes) : + factory.create(this.injector, nodes); + }; + /** + * Projects the inputs onto the component. + * + * @param {ComponentRef} component + * @param {*} options + * @returns {ComponentRef} + */ + PopupService.prototype.projectComponentInputs = function (component, options) { + Object.getOwnPropertyNames(options) + .filter(function (prop) { return prop !== 'content' || options.content instanceof core_1.TemplateRef; }) + .map(function (prop) { + component.instance[prop] = options[prop]; + }); + return component; + }; + /** + * Gets the component and the nodes to append from the `content` option. + * + * @param {*} content + * @returns {any} + */ + PopupService.prototype.contentFrom = function (content) { + if (!content || content instanceof core_1.TemplateRef) { + return { component: null, nodes: [[]] }; + } + var component = this.createComponent(content); + var nodes = component ? [component.location.nativeElement] : []; + return { + component: component, + nodes: [ + nodes // + ] + }; + }; + return PopupService; +}()); +PopupService.decorators = [ + { type: core_1.Injectable }, +]; +/** @nocollapse */ +PopupService.ctorParameters = function () { return [ + { type: core_1.ApplicationRef, }, + { type: core_1.ComponentFactoryResolver, }, + { type: core_1.Injector, }, + { type: core_1.ElementRef, decorators: [{ type: core_1.Inject, args: [exports.POPUP_CONTAINER,] }, { type: core_1.Optional },] }, +]; }; +exports.PopupService = PopupService; + + +/***/ }), +/* 271 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var core_1 = __webpack_require__(0); +var Subject_1 = __webpack_require__(8); +__webpack_require__(89); +/** + * Emit up to 10 resize events per second by default. + * Chosen as a compromise between responsiveness and performance. + */ +var DEFAULT_RATE_LIMIT = 10; +var computedProp = function (elem, prop) { + return getComputedStyle(elem, null).getPropertyValue(prop); +}; +var WRAP_STYLE = 'position: absolute; display: block; left: 0; top: 0; right: 0; bottom: 0; z-index: -1;' + + 'overflow: hidden; visibility: hidden;'; +var EXPAND_CHILD_STYLE = 'position: absolute; left: 0; top: 0; transition: 0s;'; +var SHRINK_CHILD_STYLE = EXPAND_CHILD_STYLE + 'width: 200%; height: 200%;'; +/** + * Resize Sensor Component + * + * Triggers a "resize" event whenever the parent DOM element size changes. + */ +var ResizeSensorComponent = (function () { + function ResizeSensorComponent(element) { + this.element = element; + /** + * The maximum number of resize events to emit per second. + * + * Defaults to 10. + */ + this.rateLimit = DEFAULT_RATE_LIMIT; + /** + * Fires when the parent DOM element has been resized. + */ + this.resize = new core_1.EventEmitter(); + this.source = new Subject_1.Subject(); + this.initialized = false; + } + ResizeSensorComponent.prototype.ngAfterViewChecked = function () { + var _this = this; + if (typeof document === 'undefined') { + return; + } + if (this.initialized) { + this.scroll(); + return; + } + var throttleTime = 1000 / (this.rateLimit || DEFAULT_RATE_LIMIT); + this.subscription = this.source.asObservable() + .auditTime(throttleTime) + .subscribe(function () { + _this.resize.emit(); + }); + this.parentElement = this.element.nativeElement.parentElement; + if (computedProp(this.parentElement, 'position') === 'static') { + this.parentElement.style.position = 'relative'; + } + this.reset(); + this.lastWidth = this.parentElement.offsetWidth; + this.lastHeight = this.parentElement.offsetHeight; + this.initialized = true; + }; + ResizeSensorComponent.prototype.ngOnDestroy = function () { + if (this.subscription) { + this.subscription.unsubscribe(); + } + }; + /** + * @hidden + */ + ResizeSensorComponent.prototype.scroll = function (_event) { + if (!this.parentElement) { + return; + } + var width = this.parentElement.offsetWidth; + var height = this.parentElement.offsetHeight; + var sameSize = width === this.lastWidth && height === this.lastHeight; + if (sameSize) { + return; + } + this.lastWidth = width; + this.lastHeight = height; + this.source.next(); + this.reset(); + }; + ResizeSensorComponent.prototype.reset = function () { + var expandChild = this.expandChild.nativeElement; + expandChild.style.width = 100000 + 'px'; + expandChild.style.height = 100000 + 'px'; + var expand = this.expand.nativeElement; + expand.scrollLeft = 100000; + expand.scrollTop = 100000; + var shrink = this.shrink.nativeElement; + shrink.scrollLeft = 100000; + shrink.scrollTop = 100000; + }; + return ResizeSensorComponent; +}()); +ResizeSensorComponent.decorators = [ + { type: core_1.Component, args: [{ + selector: 'kendo-resize-sensor', + styles: [':host { ' + WRAP_STYLE + ' }'], + template: '
' + + '
' + + '
' + + '
' + + '
' + + '
' + },] }, +]; +/** @nocollapse */ +ResizeSensorComponent.ctorParameters = function () { return [ + { type: core_1.ElementRef, }, +]; }; +ResizeSensorComponent.propDecorators = { + 'rateLimit': [{ type: core_1.Input },], + 'resize': [{ type: core_1.Output },], + 'expand': [{ type: core_1.ViewChild, args: ['expand',] },], + 'expandChild': [{ type: core_1.ViewChild, args: ['expandChild',] },], + 'shrink': [{ type: core_1.ViewChild, args: ['shrink',] },], +}; +exports.ResizeSensorComponent = ResizeSensorComponent; + + +/***/ }), +/* 272 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var utils_1 = __webpack_require__(17); +/** + * @hidden + * Creates a single arity function which based on the provided predicate wrapps the value + * @example + * ``` + * wrapIf(() => ignoreCase) `tolower(${field})` + * //ignoreCase=true -> tolower(${field})` + * //ignoreCase=false -> ${field}` + * ``` + */ +exports.wrapIf = function (predicate) { return function (str) { + var args = []; + for (var _i = 1; _i < arguments.length; _i++) { + args[_i - 1] = arguments[_i]; + } + return predicate() ? "" + str[0] + args[0] + str[1] : args[0]; +}; }; +/** + * @hidden + */ +exports.toUTC = function (date) { + return new Date(Date.UTC(date.getFullYear(), date.getMonth(), date.getDate(), date.getHours(), date.getMinutes(), date.getSeconds(), date.getMilliseconds())); +}; +/** + * @hidden + */ +exports.quote = function (_a) { + var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator; + return ({ + value: "'" + value.replace(/'/g, "''") + "'", + field: field, + ignoreCase: ignoreCase, + operator: operator + }); +}; +/** + * @hidden + */ +exports.formatDate = function (_a) { + var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator; + return ({ + value: JSON.stringify(exports.toUTC(value)).replace(/"/g, ""), + field: field, + ignoreCase: ignoreCase, + operator: operator + }); +}; +/** + * @hidden + */ +exports.toLower = function (_a) { + var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator; + return ({ + field: (_b = ["tolower(", ")"], _b.raw = ["tolower(", ")"], exports.wrapIf(function () { return ignoreCase; })(_b, field)), + value: value, + ignoreCase: ignoreCase, + operator: operator + }); + var _b; +}; +/** + * @hidden + */ +exports.normalizeField = function (_a) { + var field = _a.field, value = _a.value, ignoreCase = _a.ignoreCase, operator = _a.operator; + return ({ + value: value, + field: field.replace(/\./g, "/"), + ignoreCase: ignoreCase, + operator: operator + }); +}; +/** + * @hidden + */ +exports.isStringValue = function (x) { return utils_1.isString(x.value); }; +/** + * @hidden + */ +exports.isDateValue = function (x) { return utils_1.isDate(x.value); }; +/** + * @hidden + */ +exports.serializeFilters = function (map, join) { return function (filter) { + var brackets = exports.wrapIf(function () { return filter.filters.length > 1; }); + return (_a = ["(", ")"], _a.raw = ["(", ")"], brackets(_a, filter.filters + .map(map) + .join(join(filter)))); + var _a; +}; }; + + +/***/ }), +/* 273 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var transducers_1 = __webpack_require__(135); +; +var identity = transducers_1.map(function (x) { return x; }); +/** + * Applies the specified [`AggregateDescriptors`]({% slug api_kendo-data-query_aggregatedescriptor_kendouiforangular %}) to the data. + * + * Returns an [`AggregateResult`]({% slug api_kendo-data-query_aggregateresult_kendouiforangular %}) instance. + * + * @example + * ```ts-no-run + * const data = [ + * { unitPrice: 23, unitsInStock: 21 }, + * { unitPrice: 10, unitsInStock: 12 }, + * { unitPrice: 20, unitsInStock: 33 } + * ]; + * + * const result = aggregateBy(data, [ + * { aggregate: "sum", field: "unitPrice" }, + * { aggregate: "sum", field: "unitsInStock" } + * ]); + * + * //output: + * // { + * // "unitPrice": { "sum": 53 }, + * // "unitsInStock": { "sum": 66 } + * // } + * ``` + * @param {T[]} data - The data on which the calculation will be executed. + * @param {AggregateDescriptor[]} descriptors - The aggregate operations to be executed. + * @param {any} transformers - For internal use. + * @returns {AggregateResult} - The aggregated result. + * For more information, refer to the [`aggregateresult`]({% slug api_kendo-data-query_aggregateresult_kendouiforangular %}) configuration. + */ +exports.aggregateBy = function (data, descriptors, transformers) { + if (descriptors === void 0) { descriptors = []; } + if (transformers === void 0) { transformers = identity; } + var initialValue = {}; + if (!descriptors.length) { + return initialValue; + } + var result = transducers_1.exec(transformers(transducers_1.aggregatesCombinator(descriptors)), initialValue, data); + return transducers_1.expandAggregates(result); +}; + + +/***/ }), +/* 274 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +var utils_1 = __webpack_require__(17); +var accessor_1 = __webpack_require__(45); +var compare = function (a, b) { + if (utils_1.isBlank(a)) { + return a === b ? 0 : -1; + } + if (utils_1.isBlank(b)) { + return 1; + } + if (a.localeCompare) { + return a.localeCompare(b); + } + return a > b ? 1 : (a < b ? -1 : 0); +}; +var compareDesc = function (a, b) { return compare(b, a); }; +var descriptorAsFunc = function (descriptor) { + var prop = accessor_1.getter(descriptor.field); + return function (a, b) { return (descriptor.dir === 'asc' ? compare : compareDesc)(prop(a), prop(b)); }; +}; +var initial = function (_a, _b) { return 0; }; +/** + * Converts the `SortDescriptors` into a [`Comparer`]({% slug api_kendo-data-query_comparer_kendouiforangular %}) + * function that can be used through `Array.sort`. + * + * If multiple descriptors are provided, sorting is applied in a right-to-left order. + * @param {SortDescriptor[]} descriptors - The descriptors which will be converted. + * @returns {Comparer} - The produced function. + * + * @example + * ```ts-no-run + * import { composeSortDescriptors } from '@progress/kendo-data-query'; + * + * const data = [{ name: "Pork" }, { name: "Pepper" }, { name: "Beef" } ]; + * const comparer = composeSortDescriptors([{ field: "name", dir: "asc" }]); + * const result = data.sort(comparer); + * //output: [{ name: "Beef" }, { name: "Pepper" }, { name: "Pork" }]; + * ``` + */ +exports.composeSortDescriptors = function (descriptors) { return (descriptors + .filter(function (x) { return utils_1.isPresent(x.dir); }) + .map(function (descriptor) { return descriptorAsFunc(descriptor); }) + .reduce(function (acc, curr) { return function (a, b) { return acc(a, b) || curr(a, b); }; }, initial)); }; + + +/***/ }), +/* 275 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var create_date_1 = __webpack_require__(63); +/** + * A function returning the passed date with a midnight time portion. + * + * @param date - The initial date. + * @returns - The date with a midnight time portion. + * + * @example + * ```ts-no-run + * getDate(new Date(2016, 0, 15, 14, 30, 30)); // 2016-01-15 00:00:00 + * ``` + */ +exports.getDate = function (date) { + return create_date_1.createDate(date.getFullYear(), date.getMonth(), date.getDate(), 0, 0, 0); +}; + + +/***/ }), +/* 276 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * A function that compares 2 dates. The comparison also includes the time portion. + * + * @param candidate - The candidate date. + * @param expected - The expected date. + * @returns - A Boolean value indicating whether the values are equal. + * + * @example + * ```ts-no-run + * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 1)); // true + * isEqual(new Date(2016, 0, 1), new Date(2016, 0, 2)); // false + * isEqual(new Date(2016, 0, 1, 10), new Date(2016, 0, 1, 20)); // false + * ``` + */ +exports.isEqual = function (candidate, expected) { + if (!candidate && !expected) { + return true; + } + return candidate && expected && candidate.getTime() === expected.getTime(); +}; + + +/***/ }), +/* 277 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var add_days_1 = __webpack_require__(85); +var create_date_1 = __webpack_require__(63); +/** + * A function returning the last date of the month. + * + * @param date - The initial date. + * @returns - The last date of the initial date month. + * + * @example + * ```ts-no-run + * lastDayOfMonth(new Date(2016, 0, 15)); // 2016-01-31 + * ``` + */ +exports.lastDayOfMonth = function (date) { + var newDate = create_date_1.createDate(date.getFullYear(), date.getMonth() + 1, 1); + return add_days_1.addDays(newDate, -1); +}; + + +/***/ }), +/* 278 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +/** + * The duration of the day in milliseconds. + */ +exports.MS_PER_DAY = 86400000; + + +/***/ }), +/* 279 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + +Object.defineProperty(exports, "__esModule", { value: true }); +var direction_enum_1 = __webpack_require__(86); +var day_of_week_1 = __webpack_require__(136); +/** + * A function returning a date by a specific week name. + * For example, `Day.Monday`. + * + * @param date - The date to calculate from. + * @param weekDay - The `Day` enum specifying the desired week day. + * @returns - A `Date` instance. + * + * @example + * ```ts-no-run + * prevDayOfWeek(new Date(2016, 0, 1), Day.Wednesday); // 2015-12-30, Wednesday + * ``` + */ +exports.prevDayOfWeek = function (date, weekDay) { + return day_of_week_1.dayOfWeek(date, weekDay, direction_enum_1.Direction.Backward); +}; + + +/***/ }), +/* 280 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { value: true }); + +function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; } + +var JSZip = _interopDefault(__webpack_require__(438)); + +var TemplateService = function TemplateService () {}; + +TemplateService.register = function register (userImplementation) { + TemplateService.current = userImplementation; +}; + +TemplateService.compile = function compile (template) { + return TemplateService.current.compile(template); +}; + +TemplateService.current = { + compile: function(template) { + return template; + } +}; + +var FIELD_REGEX = /\[(?:(\d+)|['"](.*?)['"])\]|((?:(?!\[.*?\]|\.).)+)/g; +var getterCache = {}; +var UNDEFINED = 'undefined'; + +getterCache[UNDEFINED] = function(obj) { + return obj; +}; + +function getter(field) { + if (getterCache[field]) { + return getterCache[field]; + } + + var fields = []; + field.replace(FIELD_REGEX, function(match, index, indexAccessor, field) { + fields.push(typeof index !== UNDEFINED ? index : (indexAccessor || field)); + }); + + getterCache[field] = function(obj) { + var result = obj; + for (var idx = 0; idx < fields.length && result; idx++) { + result = result[fields[idx]]; + } + + return result; + }; + + return getterCache[field]; +} + +function map(array, func) { + return array.reduce(function (result, el, i) { + var val = func(el, i); + if (val != null) { + result.push(val); + } + return result; + }, []); +} + +function defaultGroupHeaderTemplate(data) { + return ((data.title) + ": " + (data.value)); +} + +function createArray(length, callback) { + var result = []; + + for (var idx = 0; idx < length; idx++) { + result.push(callback(idx)); + } + + return result; +} + +var ExcelExporter = function ExcelExporter(options) { + options.columns = this._trimColumns(options.columns || []); + + this.allColumns = map(this._leafColumns(options.columns || []), this._prepareColumn); + + this.columns = this.allColumns.filter(function(column) { return !column.hidden; }); + + this.options = options; + this.data = options.data || []; + this.aggregates = options.aggregates || {}; + this.groups = [].concat(options.groups || []); + this.hierarchy = options.hierarchy; +}; + +ExcelExporter.prototype.workbook = function workbook () { + var workbook = { + sheets: [ { + columns: this._columns(), + rows: this._rows(), + freezePane: this._freezePane(), + filter: this._filter() + } ] + }; + + return workbook; +}; + +ExcelExporter.prototype._trimColumns = function _trimColumns (columns) { + var this$1 = this; + + return columns.filter(function (column) { + var result = Boolean(column.field); + + if (!result && column.columns) { + result = this$1._trimColumns(column.columns).length > 0; + } + + return result; + }); +}; + +ExcelExporter.prototype._leafColumns = function _leafColumns (columns) { + var this$1 = this; + + var result = []; + + for (var idx = 0; idx < columns.length; idx++) { + if (!columns[idx].columns) { + result.push(columns[idx]); + } else { + result = result.concat(this$1._leafColumns(columns[idx].columns)); + } + } + + return result; +}; + +ExcelExporter.prototype._prepareColumn = function _prepareColumn (column) { + if (!column.field) { + return null; + } + + var value = function(dataItem) { + return getter(column.field)(dataItem); + }; + + var values = null; + + if (column.values) { + values = {}; + + column.values.forEach(function(item) { + values[item.value] = item.text; + }); + + value = function(dataItem) { + return values[getter(column.field)(dataItem)]; + }; + } + + return Object.assign({}, column, { + value: value, + values: values, + groupHeaderTemplate: column.groupHeaderTemplate ? TemplateService.compile(column.groupHeaderTemplate) : defaultGroupHeaderTemplate, + groupFooterTemplate: column.groupFooterTemplate ? TemplateService.compile(column.groupFooterTemplate) : null, + footerTemplate: column.footerTemplate ? TemplateService.compile(column.footerTemplate) : null + }); +}; + +ExcelExporter.prototype._filter = function _filter () { + if (!this.options.filterable) { + return null; + } + + var depth = this._depth(); + + return { + from: depth, + to: depth + this.columns.length - 1 + }; +}; + +ExcelExporter.prototype._createPaddingCells = function _createPaddingCells (length) { + var this$1 = this; + + return createArray(length, function () { return Object.assign({ + background: "#dfdfdf", + color: "#333" + }, this$1.options.paddingCellOptions); }); +}; + +ExcelExporter.prototype._dataRow = function _dataRow (dataItem, itemLevel, depth) { + var this$1 = this; + + var level = itemLevel; + if (this.hierarchy) { + level = this.hierarchy.itemLevel(dataItem) + 1; + } + + var cells = this._createPaddingCells(level); + + // grouped + if (depth && dataItem.items) { + var column = this.allColumns.filter(function(column) { + return column.field === dataItem.field; + })[0]; + + var title = column && column.title ? column.title : dataItem.field; + var template = column ? column.groupHeaderTemplate : null; + var group = Object.assign({ + title: title, + field: dataItem.field, + value: column && column.values ? column.values[dataItem.value] : dataItem.value, + aggregates: dataItem.aggregates, + items: dataItem.items + }, dataItem.aggregates[dataItem.field]); + + var value = title + ": " + (dataItem.value); + + if (template) { + value = template(group); + } + + cells.push(Object.assign({ + value: value, + background: "#dfdfdf", + color: "#333", + colSpan: this.columns.length + depth - level + }, (column || {}).groupHeaderCellOptions)); + + var rows = this._dataRows(dataItem.items, level + 1); + + rows.unshift({ + type: "group-header", + cells: cells + }); + + return rows.concat(this._footer(dataItem)); + } + + var dataCells = []; + + for (var cellIdx = 0; cellIdx < this.columns.length; cellIdx++) { + dataCells[cellIdx] = this$1._cell(dataItem, this$1.columns[cellIdx]); + } + + if (this.hierarchy) { + dataCells[0].colSpan = depth - level + 1; + } + + return [ { + type: "data", + cells: cells.concat(dataCells) + } ]; +}; + +ExcelExporter.prototype._dataRows = function _dataRows (dataItems, level) { + var this$1 = this; + + var depth = this._depth(); + var rows = []; + + for (var idx = 0; idx < dataItems.length; idx++) { + rows.push.apply(rows, this$1._dataRow(dataItems[idx], level, depth)); + } + + return rows; +}; + +ExcelExporter.prototype._footer = function _footer (dataItem) { + var this$1 = this; + + var rows = []; + var footer = false; + + var cells = this.columns.map(function (column) { + if (column.groupFooterTemplate) { + var templateData = Object.assign({}, this$1.aggregates, dataItem.aggregates, dataItem.aggregates[column.field], { + group: { + items: dataItem.items, + field: dataItem.field, + value: dataItem.value + } + }); + + footer = true; + return Object.assign({ + background: "#dfdfdf", + color: "#333", + value: column.groupFooterTemplate(templateData) + }, column.groupFooterCellOptions); + } + + return Object.assign({ + background: "#dfdfdf", + color: "#333" + }, column.groupFooterCellOptions); + }); + + if (footer) { + rows.push({ + type: "group-footer", + cells: this._createPaddingCells(this.groups.length).concat(cells) + }); + } + + return rows; +}; + +ExcelExporter.prototype._isColumnVisible = function _isColumnVisible (column) { + return this._visibleColumns([ column ]).length > 0 && (column.field || column.columns); +}; + +ExcelExporter.prototype._visibleColumns = function _visibleColumns (columns) { + var this$1 = this; + + return columns.filter(function (column) { + var result = !column.hidden; + if (result && column.columns) { + result = this$1._visibleColumns(column.columns).length > 0; + } + return result; + }); +}; + +ExcelExporter.prototype._headerRow = function _headerRow (row, groups) { + var this$1 = this; + + var headers = row.cells.map(function(cell) { + return Object.assign(cell, { + colSpan: cell.colSpan > 1 ? cell.colSpan : 1, + rowSpan: row.rowSpan > 1 && !cell.colSpan ? row.rowSpan : 1 + }); + }); + + if (this.hierarchy) { + headers[0].colSpan = this._depth() + 1; + } + + return { + type: "header", + cells: createArray(groups.length, function () { return Object.assign({ + background: "#7a7a7a", + color: "#fff" + }, this$1.options.headerPaddingCellOptions); }).concat(headers) + }; +}; + +ExcelExporter.prototype._prependHeaderRows = function _prependHeaderRows (rows) { + var this$1 = this; + + var groups = this.groups; + + var headerRows = [ { rowSpan: 1, cells: [], index: 0 } ]; + + this._prepareHeaderRows(headerRows, this.options.columns); + + for (var idx = headerRows.length - 1; idx >= 0; idx--) { + rows.unshift(this$1._headerRow(headerRows[idx], groups)); + } +}; + +ExcelExporter.prototype._prepareHeaderRows = function _prepareHeaderRows (rows, columns, parentCell, parentRow) { + var this$1 = this; + + var row = parentRow || rows[rows.length - 1]; + var childRow = rows[row.index + 1]; + var totalColSpan = 0; + + for (var idx = 0; idx < columns.length; idx++) { + var column = columns[idx]; + if (this$1._isColumnVisible(column)) { + + var cell = Object.assign({ + background: "#7a7a7a", + color: "#fff", + value: column.title || column.field, + colSpan: 0 + }, column.headerCellOptions); + row.cells.push(cell); + + if (column.columns && column.columns.length) { + if (!childRow) { + childRow = { rowSpan: 0, cells: [], index: rows.length }; + rows.push(childRow); + } + cell.colSpan = this$1._trimColumns(this$1._visibleColumns(column.columns)).length; + this$1._prepareHeaderRows(rows, column.columns, cell, childRow); + totalColSpan += cell.colSpan - 1; + row.rowSpan = rows.length - row.index; + } + } + } + + if (parentCell) { + parentCell.colSpan += totalColSpan; + } +}; + +ExcelExporter.prototype._rows = function _rows () { + var this$1 = this; + + var rows = this._dataRows(this.data, 0); + + if (this.columns.length) { + this._prependHeaderRows(rows); + var footer = false; + + var cells = this.columns.map(function (column) { + if (column.footerTemplate) { + footer = true; + + return Object.assign({ + background: "#dfdfdf", + color: "#333", + value: column.footerTemplate(Object.assign({}, this$1.aggregates, this$1.aggregates[column.field])) + }, column.footerCellOptions); + } + + return Object.assign({ + background: "#dfdfdf", + color: "#333" + }, column.footerCellOptions); + }); + + if (footer) { + rows.push({ + type: "footer", + cells: this._createPaddingCells(this.groups.length).concat(cells) + }); + } + } + + return rows; +}; + +ExcelExporter.prototype._headerDepth = function _headerDepth (columns) { + var this$1 = this; + + var result = 1; + var max = 0; + + for (var idx = 0; idx < columns.length; idx++) { + if (columns[idx].columns) { + var temp = this$1._headerDepth(columns[idx].columns); + if (temp > max) { + max = temp; + } + } + } + return result + max; +}; + +ExcelExporter.prototype._freezePane = function _freezePane () { + var columns = this._visibleColumns(this.options.columns || []); + + var colSplit = this._visibleColumns(this._trimColumns(this._leafColumns(columns.filter(function(column) { + return column.locked; + })))).length; + + return { + rowSplit: this._headerDepth(columns), + colSplit: colSplit ? colSplit + this.groups.length : 0 + }; +}; + +ExcelExporter.prototype._cell = function _cell (dataItem, column) { + return Object.assign({ + value: column.value(dataItem) + }, column.cellOptions); +}; + +ExcelExporter.prototype._depth = function _depth () { + var depth = 0; + + if (this.hierarchy) { + depth = this.hierarchy.depth; + } else { + depth = this.groups.length; + } + + return depth; +}; + +ExcelExporter.prototype._columns = function _columns () { + var depth = this._depth(); + var columns = createArray(depth, function () { return ({ width: 20 }); }); + + return columns.concat(this.columns.map(function(column) { + return { + width: parseInt(column.width, 10), + autoWidth: column.width ? false : true + }; + })); +}; + +var DATA_URL_PREFIX = "data:application/vnd.openxmlformats-officedocument.spreadsheetml.sheet;base64,"; +var DATA_URL_OPTIONS = { compression: "DEFLATE", type: "base64" }; +var MS_PER_MINUTE = 60000; +var MS_PER_DAY = 86400000; + +/* eslint-disable key-spacing, no-arrow-condition, indent, no-nested-ternary, consistent-return */ + +function toDataURL(content) { + return DATA_URL_PREFIX + content; +} + +function indexOf(thing, array) { + return array.indexOf(thing); +} + +var parseJSON = JSON.parse.bind(JSON); + +function ESC(val) { + return String(val) + .replace(/&/g, "&") + .replace(//g, ">") + .replace(/\"/g, """) + .replace(/\'/g, "'"); +} + +function repeat(count, func) { + var str = ""; + for (var i = 0; i < count; ++i) { + str += func(i); + } + return str; +} + +function foreach(arr, func) { + var str = ""; + for (var i = 0; i < arr.length; ++i) { + str += func(arr[i], i); + } + return str; +} + +var XMLHEAD = '\r'; + +var RELS = XMLHEAD + "\n \n \n \n \n "; + +var CORE = function (ref) { + var creator = ref.creator; + var lastModifiedBy = ref.lastModifiedBy; + var created = ref.created; + var modified = ref.modified; + + return (XMLHEAD + "\n \n " + (ESC(creator)) + "\n " + (ESC(lastModifiedBy)) + "\n " + (ESC(created)) + "\n " + (ESC(modified)) + "\n"); +}; + +var APP = function (ref) { + var sheets = ref.sheets; + + return (XMLHEAD + "\n\n Microsoft Excel\n 0\n false\n \n \n \n Worksheets\n \n \n " + (sheets.length) + "\n \n \n \n \n " + (foreach(sheets, function (sheet, i) { return sheet.options.title + ? ("" + (ESC(sheet.options.title)) + "") + : ("Sheet" + (i + 1) + ""); } + )) + "\n \n false\n false\n false\n 14.0300\n"); +}; + +var CONTENT_TYPES = function (ref) { + var count = ref.count; + + return (XMLHEAD + "\n\n \n \n \n \n \n " + (repeat(count, function (idx) { return (""); })) + "\n \n \n"); +}; + +var WORKBOOK = function (ref) { + var sheets = ref.sheets; + var filterNames = ref.filterNames; + var userNames = ref.userNames; + + return (XMLHEAD + "\n\n \n \n \n \n \n \n " + (foreach(sheets, function (ref, i) { + var options = ref.options; + + var name = options.name || options.title || ("Sheet" + (i + 1)); + return (""); + })) + "\n \n " + (filterNames.length || userNames.length ? ("\n \n " + (foreach(filterNames, function (f) { return ("\n "); })) + "\n " + (foreach(userNames, function (f) { return ("\n ") : '') + "\n \n"); +}; + +var WORKSHEET = function (ref) { + var frozenColumns = ref.frozenColumns; + var frozenRows = ref.frozenRows; + var columns = ref.columns; + var defaults = ref.defaults; + var data = ref.data; + var index = ref.index; + var mergeCells = ref.mergeCells; + var autoFilter = ref.autoFilter; + var filter = ref.filter; + var showGridLines = ref.showGridLines; + var hyperlinks = ref.hyperlinks; + var validations = ref.validations; + var defaultCellStyleId = ref.defaultCellStyleId; + var rtl = ref.rtl; + + return (XMLHEAD + "\n\n \n\n \n \n " + (frozenRows || frozenColumns ? ("\n ") : '') + "\n \n \n\n \n\n " + (defaultCellStyleId != null || (columns && columns.length > 0) ? ("\n \n " + (!columns || !columns.length ? ("\n ") : '') + "\n " + (foreach(columns, function (column, ci) { + var columnIndex = typeof column.index === "number" ? column.index + 1 : (ci + 1); + if (column.width === 0) { + return (""); + } + return (""); + })) + "\n ") : '') + "\n\n \n " + (foreach(data, function (row, ri) { + var rowIndex = typeof row.index === "number" ? row.index + 1 : (ri + 1); + return ("\n \n " + (foreach(row.data, function (cell) { return ("\n \n " + (cell.formula != null ? ("" + (ESC(cell.formula)) + "") : '') + "\n " + (cell.value != null ? ("" + (ESC(cell.value)) + "") : '') + "\n "); })) + "\n \n ");})) + "\n \n\n " + (autoFilter ? ("") + : filter ? spreadsheetFilters(filter) : '') + "\n\n " + (mergeCells.length ? ("\n \n " + (foreach(mergeCells, function (ref) { return (""); })) + "\n ") : '') + "\n\n " + (validations.length ? ("\n \n " + (foreach(validations, function (val) { return ("\n \n " + (val.formula1 ? ("" + (ESC(val.formula1)) + "") : '') + "\n " + (val.formula2 ? ("" + (ESC(val.formula2)) + "") : '') + "\n "); })) + "\n ") : '') + "\n\n " + (hyperlinks.length ? ("\n \n " + (foreach(hyperlinks, function (link, hi) { return ("\n "); })) + "\n ") : '') + "\n\n \n"); +}; + +var WORKBOOK_RELS = function (ref) { + var count = ref.count; + + return (XMLHEAD + "\n\n " + (repeat(count, function (idx) { return ("\n "); })) + "\n \n \n"); +}; + +var WORKSHEET_RELS = function (ref) { + var hyperlinks = ref.hyperlinks; + + return (XMLHEAD + "\n\n " + (foreach(hyperlinks, function (link, i) { return ("\n "); })) + "\n"); +}; + +var SHARED_STRINGS = function (ref) { + var count = ref.count; + var uniqueCount = ref.uniqueCount; + var indexes = ref.indexes; + + return (XMLHEAD + "\n\n " + (foreach(Object.keys(indexes), function (index) { return ("\n " + (ESC(index.substring(1))) + ""); })) + "\n"); +}; + +var STYLES = function (ref) { + var formats = ref.formats; + var fonts = ref.fonts; + var fills = ref.fills; + var borders = ref.borders; + var styles = ref.styles; + + return (XMLHEAD + "\n\n \n " + (foreach(formats, function (format, fi) { return ("\n "); })) + "\n \n \n \n \n \n \n \n \n \n " + (foreach(fonts, function (font) { return ("\n \n \n " + (font.bold ? '' : '') + "\n " + (font.italic ? '' : '') + "\n " + (font.underline ? '' : '') + "\n " + (font.color ? ("") : '') + "\n " + (font.fontFamily ? ("\n \n \n ") : "\n \n \n \n ") + "\n "); })) + "\n \n \n \n \n " + (foreach(fills, function (fill) { return ("\n " + (fill.background ? ("\n \n \n \n \n \n ") : '')); })) + "\n \n \n \n " + (foreach(borders, borderTemplate)) + "\n \n \n \n \n \n \n " + (foreach(styles, function (style) { return ("\n \n " + (style.textAlign || style.verticalAlign || style.wrap ? ("\n \n ") : '') + "\n \n "); })) + "\n \n \n \n \n \n \n"); +}; + +function numChar(colIndex) { + var letter = Math.floor(colIndex / 26) - 1; + + return (letter >= 0 ? numChar(letter) : "") + String.fromCharCode(65 + (colIndex % 26)); +} + +function ref(rowIndex, colIndex) { + return numChar(colIndex) + (rowIndex + 1); +} + +function $ref(rowIndex, colIndex) { + return numChar(colIndex) + "$" + (rowIndex + 1); +} + +function filterRowIndex(options) { + var frozenRows = options.frozenRows || (options.freezePane || {}).rowSplit || 1; + return frozenRows - 1; +} + +function toWidth(px) { + return ((px / 7) * 100 + 0.5) / 100; +} + +function toHeight(px) { + return px * 0.75; +} + +function stripFunnyChars(value) { + return String(value) + .replace(/[\x00-\x08]/g, "") + .replace(/\n/g, "\r\n"); +} + +var DATE_EPOCH = new Date(1900, 0, 0); + +var Worksheet = function Worksheet(options, sharedStrings, styles, borders) { + this.options = options; + this._strings = sharedStrings; + this._styles = styles; + this._borders = borders; + this._validations = {}; + }; + + Worksheet.prototype.relsToXML = function relsToXML () { + var hyperlinks = this.options.hyperlinks || []; + if (!hyperlinks.length) { + return ""; + } + + return WORKSHEET_RELS({ hyperlinks: hyperlinks }); + }; + + Worksheet.prototype.toXML = function toXML (index) { + var this$1 = this; + + var mergeCells = this.options.mergedCells || []; + var rows = this.options.rows || []; + var data = inflate(rows, mergeCells); + + this._readCells(data); + + var autoFilter = this.options.filter; + var filter; + if (autoFilter && (typeof autoFilter.from === "number") && (typeof autoFilter.to === "number")) { + // Grid enables auto filter + autoFilter = { + from: ref(filterRowIndex(this.options), autoFilter.from), + to: ref(filterRowIndex(this.options), autoFilter.to) + }; + } else if (autoFilter && autoFilter.ref && autoFilter.columns) { + // this is probably from the Spreadsheet + filter = autoFilter; + autoFilter = null; + } + + var validations = []; + for (var i in this._validations) { + if (Object.prototype.hasOwnProperty.call(this$1._validations, i)) { + validations.push(this$1._validations[i]); + } + } + + var defaultCellStyleId = null; + if (this.options.defaultCellStyle) { + defaultCellStyleId = this._lookupStyle(this.options.defaultCellStyle); + } + + var freezePane = this.options.freezePane || {}; + var defaults = this.options.defaults || {}; + return WORKSHEET({ + frozenColumns: this.options.frozenColumns || freezePane.colSplit, + frozenRows: this.options.frozenRows || freezePane.rowSplit, + columns: this.options.columns, + defaults: defaults, + data: data, + index: index, + mergeCells: mergeCells, + autoFilter: autoFilter, + filter: filter, + showGridLines: this.options.showGridLines, + hyperlinks: this.options.hyperlinks || [], + validations: validations, + defaultCellStyleId: defaultCellStyleId, + rtl: this.options.rtl !== undefined ? this.options.rtl : defaults.rtl + }); + }; + + Worksheet.prototype._lookupString = function _lookupString (value) { + var key = "$" + value; + var index = this._strings.indexes[key]; + var result; + + if (index !== undefined) { + result = index; + } else { + result = this._strings.indexes[key] = this._strings.uniqueCount; + this._strings.uniqueCount ++; + } + + this._strings.count ++; + + return result; + }; + + Worksheet.prototype._lookupStyle = function _lookupStyle (style) { + var json = JSON.stringify(style); + + if (json === "{}") { + return 0; + } + + var index = indexOf(json, this._styles); + + if (index < 0) { + index = this._styles.push(json) - 1; + } + + // There is one default style + return index + 1; + }; + + Worksheet.prototype._lookupBorder = function _lookupBorder (border) { + var json = JSON.stringify(border); + if (json === "{}") { + return; + } + + var index = indexOf(json, this._borders); + if (index < 0) { + index = this._borders.push(json) - 1; + } + + // There is one default border + return index + 1; + }; + + Worksheet.prototype._readCells = function _readCells (rowData) { + var this$1 = this; + + for (var i = 0; i < rowData.length; i++) { + var row = rowData[i]; + var cells = row.cells; + + row.data = []; + + for (var j = 0; j < cells.length; j++) { + var cellData = this$1._cell(cells[j], row.index, j); + if (cellData) { + row.data.push(cellData); + } + } + } + }; + + Worksheet.prototype._cell = function _cell (data, rowIndex, cellIndex) { + if (!data || data === EMPTY_CELL) { + return null; + } + + var value = data.value; + + var border = {}; + + if (data.borderLeft) { + border.left = data.borderLeft; + } + + if (data.borderRight) { + border.right = data.borderRight; + } + + if (data.borderTop) { + border.top = data.borderTop; + } + + if (data.borderBottom) { + border.bottom = data.borderBottom; + } + + border = this._lookupBorder(border); + + var defStyle = this.options.defaultCellStyle || {}; + var style = { borderId: border }; + + (function(add) { + add("color"); + add("background"); + add("bold"); + add("italic"); + add("underline"); + if (!add("fontFamily")) { add("fontName", "fontFamily"); } + add("fontSize"); + add("format"); + if (!add("textAlign")) { add("hAlign", "textAlign"); } + if (!add("verticalAlign")) { add("vAlign", "verticalAlign"); } + add("wrap"); + })( + function(prop, target) { + var val = data[prop]; + if (val === undefined) { + val = defStyle[prop]; + } + if (val !== undefined) { + style[target || prop] = val; + return true; + } + } + ); + + var columns = this.options.columns || []; + + var column = columns[cellIndex]; + var type = typeof value; + + if (column && column.autoWidth) { + var displayValue = value; + + // XXX: let's not bring kendo.toString in only for this. + // better wait until the spreadsheet engine is available as a separate + // component, then we can use a real Excel-like formatter. + // + // if (type === "number") { + // // kendo.toString will not behave exactly like the Excel format + // // Still, it's the best we have available for estimating the character count. + // displayValue = kendo.toString(value, data.format); + // } + + column.width = Math.max(column.width || 0, String(displayValue).length); + } + + if (type === "string") { + value = stripFunnyChars(value); + value = this._lookupString(value); + type = "s"; + } else if (type === "number") { + type = "n"; + } else if (type === "boolean") { + type = "b"; + value = Number(value); + } else if (value && value.getTime) { + type = null; + + var offset = (value.getTimezoneOffset() - DATE_EPOCH.getTimezoneOffset()) * MS_PER_MINUTE; + value = (value - DATE_EPOCH - offset) / MS_PER_DAY + 1; + + if (!style.format) { + style.format = "mm-dd-yy"; + } + } else { + type = null; + value = null; + } + + style = this._lookupStyle(style); + + var cellName = ref(rowIndex, cellIndex); + + if (data.validation) { + this._addValidation(data.validation, cellName); + } + + return { + value: value, + formula: data.formula, + type: type, + style: style, + ref: cellName + }; + }; + + Worksheet.prototype._addValidation = function _addValidation (v, ref) { + var tmp = { + showErrorMessage : v.type === "reject" ? 1 : 0, + formula1 : v.from, + formula2 : v.to, + type : MAP_EXCEL_TYPE[v.dataType] || v.dataType, + operator : MAP_EXCEL_OPERATOR[v.comparerType] || v.comparerType, + allowBlank : v.allowNulls ? 1 : 0, + showDropDown : v.showButton ? 0 : 1, // LOL, Excel! + error : v.messageTemplate, + errorTitle : v.titleTemplate + }; + var json = JSON.stringify(tmp); + if (!this._validations[json]) { + this._validations[json] = tmp; + tmp.sqref = []; + } + this._validations[json].sqref.push(ref); + }; + +var MAP_EXCEL_OPERATOR = { + // includes only what differs; key is our operator, value is Excel + // operator. + greaterThanOrEqualTo : "greaterThanOrEqual", + lessThanOrEqualTo : "lessThanOrEqual" +}; + +var MAP_EXCEL_TYPE = { + number: "decimal" +}; + +var defaultFormats = { + "General": 0, + "0": 1, + "0.00": 2, + "#,##0": 3, + "#,##0.00": 4, + "0%": 9, + "0.00%": 10, + "0.00E+00": 11, + "# ?/?": 12, + "# ??/??": 13, + "mm-dd-yy": 14, + "d-mmm-yy": 15, + "d-mmm": 16, + "mmm-yy": 17, + "h:mm AM/PM": 18, + "h:mm:ss AM/PM": 19, + "h:mm": 20, + "h:mm:ss": 21, + "m/d/yy h:mm": 22, + "#,##0 ;(#,##0)": 37, + "#,##0 ;[Red](#,##0)": 38, + "#,##0.00;(#,##0.00)": 39, + "#,##0.00;[Red](#,##0.00)": 40, + "mm:ss": 45, + "[h]:mm:ss": 46, + "mmss.0": 47, + "##0.0E+0": 48, + "@": 49, + "[$-404]e/m/d": 27, + "m/d/yy": 30, + "t0": 59, + "t0.00": 60, + "t#,##0": 61, + "t#,##0.00": 62, + "t0%": 67, + "t0.00%": 68, + "t# ?/?": 69, + "t# ??/??": 70 +}; + +function convertColor(value) { + var color = value; + if (color.length < 6) { + color = color.replace(/(\w)/g, function($0, $1) { + return $1 + $1; + }); + } + + color = color.substring(1).toUpperCase(); + + if (color.length < 8) { + color = "FF" + color; + } + + return color; +} + +var Workbook = function Workbook(options) { + var this$1 = this; + + this.options = options || {}; + this._strings = { + indexes: {}, + count: 0, + uniqueCount: 0 + }; + this._styles = []; + this._borders = []; + + this._sheets = map(this.options.sheets || [], function (options) { + options.defaults = this$1.options; + return new Worksheet(options, this$1._strings, this$1._styles, this$1._borders); + }); + }; + + Workbook.prototype.toZIP = function toZIP () { + var this$1 = this; + + var zip = new JSZip(); + + var docProps = zip.folder("docProps"); + + docProps.file("core.xml", CORE({ + creator: this.options.creator || "Kendo UI", + lastModifiedBy: this.options.creator || "Kendo UI", + created: this.options.date || new Date().toJSON(), + modified: this.options.date || new Date().toJSON() + })); + + var sheetCount = this._sheets.length; + + docProps.file("app.xml", APP({ sheets: this._sheets })); + + var rels = zip.folder("_rels"); + rels.file(".rels", RELS); + + var xl = zip.folder("xl"); + + var xlRels = xl.folder("_rels"); + xlRels.file("workbook.xml.rels", WORKBOOK_RELS({ count: sheetCount })); + + var sheetIds = {}; + + xl.file("workbook.xml", WORKBOOK({ + sheets: this._sheets, + filterNames: map(this._sheets, function(sheet, index) { + var options = sheet.options; + var sheetName = (options.name || options.title || "Sheet" + (index + 1)); + sheetIds[sheetName.toLowerCase()] = index; + var filter = options.filter; + if (filter && typeof filter.from !== "undefined" && typeof filter.to !== "undefined") { + return { + localSheetId: index, + name: sheetName, + from: $ref(filterRowIndex(options), filter.from), + to: $ref(filterRowIndex(options), filter.to) + }; + } + }), + userNames: map(this.options.names || [], function(def) { + return { + name: def.localName, + localSheetId: def.sheet ? sheetIds[def.sheet.toLowerCase()] : null, + value: def.value, + hidden: def.hidden + }; + }) + })); + + var worksheets = xl.folder("worksheets"); + + var sheetRels = worksheets.folder("_rels"); + + for (var idx = 0; idx < sheetCount; idx++) { + var sheet = this$1._sheets[idx]; + var sheetName = "sheet" + (idx + 1) + ".xml"; + var relsXml = sheet.relsToXML(); + + if (relsXml) { + sheetRels.file(sheetName + ".rels", relsXml); + } + + worksheets.file(sheetName, sheet.toXML(idx)); + } + + var borders = map(this._borders, parseJSON); + + var styles = map(this._styles, parseJSON); + + var hasFont = function(style) { + return style.underline || style.bold || style.italic || style.color || style.fontFamily || style.fontSize; + }; + + var fonts = map(styles, function(style) { + if (style.color) { + style.color = convertColor(style.color); + } + + if (hasFont(style)) { + return style; + } + }); + + var formats = map(styles, function(style) { + if (style.format && defaultFormats[style.format] === undefined) { + return style; + } + }); + + var fills = map(styles, function(style) { + if (style.background) { + style.background = convertColor(style.background); + return style; + } + }); + + xl.file("styles.xml", STYLES({ + fonts: fonts, + fills: fills, + formats: formats, + borders: borders, + styles: map(styles, function(style) { + var result = {}; + + if (hasFont(style)) { + result.fontId = indexOf(style, fonts) + 1; + } + + if (style.background) { + result.fillId = indexOf(style, fills) + 2; + } + + result.textAlign = style.textAlign; + result.verticalAlign = style.verticalAlign; + result.wrap = style.wrap; + result.borderId = style.borderId; + + if (style.format) { + if (defaultFormats[style.format] !== undefined) { + result.numFmtId = defaultFormats[style.format]; + } else { + result.numFmtId = 165 + indexOf(style, formats); + } + } + + return result; + }) + })); + + xl.file("sharedStrings.xml", SHARED_STRINGS(this._strings)); + + zip.file("[Content_Types].xml", CONTENT_TYPES( { count: sheetCount })); + + return zip; + }; + + Workbook.prototype.toDataURL = function toDataURL$1 () { + var zip = this.toZIP(); + + return zip.generateAsync ? zip.generateAsync(DATA_URL_OPTIONS).then(toDataURL) : toDataURL(zip.generate(DATA_URL_OPTIONS)); + }; + +function borderStyle(width) { + var alias = "thin"; + + if (width === 2) { + alias = "medium"; + } else if (width === 3) { + alias = "thick"; + } + + return alias; +} + +function borderSideTemplate(name, style) { + var result = ""; + + if (style) { + result += "<" + name + " style=\"" + borderStyle(style.size) + "\">"; + if (style.color) { + result += ""; + } + result += ""; + } + + return result; +} + +function borderTemplate(border) { + return "" + + borderSideTemplate("left", border.left) + + borderSideTemplate("right", border.right) + + borderSideTemplate("top", border.top) + + borderSideTemplate("bottom", border.bottom) + + ""; +} + +var EMPTY_CELL = {}; +function inflate(rows, mergedCells) { + var rowData = []; + var rowsByIndex = []; + + indexRows(rows, function(row, index) { + var data = { + _source: row, + index: index, + height: row.height, + cells: [] + }; + + rowData.push(data); + rowsByIndex[index] = data; + }); + + var sorted = sortByIndex(rowData).slice(0); + var ctx = { + rowData: rowData, + rowsByIndex: rowsByIndex, + mergedCells: mergedCells + }; + + for (var i = 0; i < sorted.length; i++) { + fillCells(sorted[i], ctx); + delete sorted[i]._source; + } + + return sortByIndex(rowData); +} + +function indexRows(rows, callback) { + for (var i = 0; i < rows.length; i++) { + var row = rows[i]; + if (!row) { + continue; + } + + var index = row.index; + if (typeof index !== "number") { + index = i; + } + + callback(row, index); + } +} + +function sortByIndex(items) { + return items.sort(function(a, b) { + return a.index - b.index; + }); +} + +function pushUnique(array, el) { + if (array.indexOf(el) < 0) { + array.push(el); + } +} + +function getSpan(mergedCells, ref) { + for (var i = 0; i < mergedCells.length; ++i) { + var range = mergedCells[i]; + var topLeft = range.substr(0, 2); + if (topLeft === ref) { + var bottomRight = range.substr(3); + topLeft = parseRef(topLeft); + bottomRight = parseRef(bottomRight); + return { + rowSpan: bottomRight.row - topLeft.row + 1, + colSpan: bottomRight.col - topLeft.col + 1 + }; + } + } +} + +function parseRef(ref) { + function getcol(str) { + var upperStr = str.toUpperCase(); + var col = 0; + for (var i = 0; i < upperStr.length; ++i) { + col = col * 26 + upperStr.charCodeAt(i) - 64; + } + return col - 1; + } + + function getrow(str) { + return parseInt(str, 10) - 1; + } + + var m = /^([a-z]+)(\d+)$/i.exec(ref); + return { + row: getrow(m[2]), + col: getcol(m[1]) + }; +} + +function fillCells(data, ctx) { + var row = data._source; + var rowIndex = data.index; + var cells = row.cells; + var cellData = data.cells; + + if (!cells) { + return; + } + + for (var i = 0; i < cells.length; i++) { + var cell = cells[i] || EMPTY_CELL; + + var rowSpan = cell.rowSpan || 1; + var colSpan = cell.colSpan || 1; + + var cellIndex = insertCell(cellData, cell); + var topLeftRef = ref(rowIndex, cellIndex); + + if (rowSpan === 1 && colSpan === 1) { + // could still be merged: the spreadsheet does not send + // rowSpan/colSpan, but mergedCells is already populated. + // https://github.com/telerik/kendo-ui-core/issues/2401 + var tmp = getSpan(ctx.mergedCells, topLeftRef); + if (tmp) { + colSpan = tmp.colSpan; + rowSpan = tmp.rowSpan; + } + } + + spanCell(cell, cellData, cellIndex, colSpan); + + if (rowSpan > 1 || colSpan > 1) { + pushUnique(ctx.mergedCells, + topLeftRef + ":" + ref(rowIndex + rowSpan - 1, + cellIndex + colSpan - 1)); + } + + if (rowSpan > 1) { + for (var ri = rowIndex + 1; ri < rowIndex + rowSpan; ri++) { + var nextRow = ctx.rowsByIndex[ri]; + if (!nextRow) { + nextRow = ctx.rowsByIndex[ri] = { index: ri, cells: [] }; + ctx.rowData.push(nextRow); + } + + spanCell(cell, nextRow.cells, cellIndex - 1, colSpan + 1); + } + } + } +} + +function insertCell(data, cell) { + var index; + + if (typeof cell.index === "number") { + index = cell.index; + insertCellAt(data, cell, cell.index); + } else { + index = appendCell(data, cell); + } + + return index; +} + +function insertCellAt(data, cell, index) { + data[index] = cell; +} + +function appendCell(data, cell) { + var index = data.length; + + for (var i = 0; i < data.length + 1; i++) { + if (!data[i]) { + data[i] = cell; + index = i; + break; + } + } + + return index; +} + +function spanCell(cell, row, startIndex, colSpan) { + for (var i = 1; i < colSpan; i++) { + var tmp = { + borderTop : cell.borderTop, + borderRight : cell.borderRight, + borderBottom : cell.borderBottom, + borderLeft : cell.borderLeft + }; + insertCellAt(row, tmp, startIndex + i); + } +} + +var SPREADSHEET_FILTERS = function (ref$1) { + var ref = ref$1.ref; + var columns = ref$1.columns; + var generators = ref$1.generators; + + return ("\n\n " + (foreach(columns, function (col) { return ("\n \n " + (generators[col.filter](col)) + "\n \n "); })) + "\n"); +}; + +var SPREADSHEET_CUSTOM_FILTER = function (ref) { + var logic = ref.logic; + var criteria = ref.criteria; + + return ("\n\n" + (foreach(criteria, function (f) { + var op = spreadsheetFilters.customOperator(f); + var val = spreadsheetFilters.customValue(f); + return (""); +})) + "\n"); +}; + +var SPREADSHEET_DYNAMIC_FILTER = function (ref) { + var type = ref.type; + + return (""); +}; + +var SPREADSHEET_TOP_FILTER = function (ref) { + var type = ref.type; + var value = ref.value; + + return (""); +}; + +var SPREADSHEET_VALUE_FILTER = function (ref) { + var blanks = ref.blanks; + var values = ref.values; + + return ("\n " + (foreach(values, function (value) { return ("\n "); })) + "\n "); +}; + +function spreadsheetFilters(filter) { + return SPREADSHEET_FILTERS({ + ref: filter.ref, + columns: filter.columns, + generators: { + custom : SPREADSHEET_CUSTOM_FILTER, + dynamic : SPREADSHEET_DYNAMIC_FILTER, + top : SPREADSHEET_TOP_FILTER, + value : SPREADSHEET_VALUE_FILTER + } + }); +} + +spreadsheetFilters.customOperator = function(f) { + return { + eq : "equal", + gt : "greaterThan", + gte : "greaterThanOrEqual", + lt : "lessThan", + lte : "lessThanOrEqual", + ne : "notEqual", + + // These are not in the spec, but seems to be how Excel does + // it (see customValue below). For the non-negated versions, + // the operator attribute is missing completely. + doesnotstartwith: "notEqual", + doesnotendwith: "notEqual", + doesnotcontain: "notEqual", + doesnotmatch: "notEqual" + }[f.operator.toLowerCase()]; +}; + +spreadsheetFilters.customValue = function(f) { + function esc(str) { + return str.replace(/([*?])/g, "~$1"); + } + + switch (f.operator.toLowerCase()) { + case "startswith": + case "doesnotstartwith": + return esc(f.value) + "*"; + + case "endswith": + case "doesnotendwith": + return "*" + esc(f.value); + + case "contains": + case "doesnotcontain": + return "*" + esc(f.value) + "*"; + + default: + return f.value; + } +}; + +spreadsheetFilters.dynamicFilterType = function(type) { + return { + quarter1 : "Q1", + quarter2 : "Q2", + quarter3 : "Q3", + quarter4 : "Q4", + january : "M1", + february : "M2", + march : "M3", + april : "M4", + may : "M5", + june : "M6", + july : "M7", + august : "M8", + september : "M9", + october : "M10", + november : "M11", + december : "M12" + }[type.toLowerCase()] || type; +}; + +exports.ExcelExporter = ExcelExporter; +exports.TemplateService = TemplateService; +exports.Workbook = Workbook; +exports.Worksheet = Worksheet; + +//# sourceMappingURL=main.js.map + + +/***/ }), +/* 281 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { value: true }); + +var proxy = function (a, b) { return function (e) { return b(a(e)); }; }; + +var bind = function (el, event, callback) { return el.addEventListener && el.addEventListener(event, callback); }; + +var unbind = function (el, event, callback) { return el.removeEventListener && el.removeEventListener(event, callback); }; + +var touchRegExp = /touch/; + +function normalizeEvent(e) { + if (e.type.match(touchRegExp)) { + return { + pageX: e.changedTouches[0].pageX, + pageY: e.changedTouches[0].pageY, + type: e.type, + originalEvent: e + }; + } + + return { + pageX: e.pageX, + pageY: e.pageY, + type: e.type, + ctrlKey: e.ctrlKey, + shiftKey: e.shiftKey, + altKey: e.altKey, + originalEvent: e + }; +} + +var noop = function() { }; + +// 300ms is the usual mouse interval; +// However, an underpowered mobile device under a heavy load may queue mouse events for a longer period. +var IGNORE_MOUSE_TIMEOUT = 2000; + +var Draggable = function Draggable(ref) { + var this$1 = this; + var press = ref.press; if ( press === void 0 ) press = noop; + var drag = ref.drag; if ( drag === void 0 ) drag = noop; + var release = ref.release; if ( release === void 0 ) release = noop; + + this._pressHandler = proxy(normalizeEvent, press); + this._dragHandler = proxy(normalizeEvent, drag); + this._releaseHandler = proxy(normalizeEvent, release); + + this._ignoreMouse = false; + + this._touchstart = function (e) { + if (e.touches.length === 1) { + this$1._pressHandler(e); + } + }; + + this._touchmove = function (e) { + if (e.touches.length === 1) { + this$1._dragHandler(e); + } + }; + + this._touchend = function (e) { + // the last finger has been lifted, and the user is not doing gesture. + // there might be a better way to handle this. + if (e.touches.length === 0 && e.changedTouches.length === 1) { + this$1._releaseHandler(e); + this$1._ignoreMouse = true; + setTimeout(this$1._restoreMouse, IGNORE_MOUSE_TIMEOUT); + } + }; + + this._restoreMouse = function () { + this$1._ignoreMouse = false; + }; + + this._mousedown = function (e) { + var which = e.which; + + if ((which && which > 1) || this$1._ignoreMouse) { + return; + } + + bind(document, "mousemove", this$1._mousemove); + bind(document, "mouseup", this$1._mouseup); + this$1._pressHandler(e); + }; + + this._mousemove = function (e) { + this$1._dragHandler(e); + }; + + this._mouseup = function (e) { + unbind(document, "mousemove", this$1._mousemove); + unbind(document, "mouseup", this$1._mouseup); + this$1._releaseHandler(e); + }; +}; + +Draggable.prototype.bindTo = function bindTo (element) { + if (element === this._element) { + return; + } + + if (this._element) { + this._unbindFromCurrent(); + } + + this._element = element; + + bind(element, "mousedown", this._mousedown); + bind(element, "touchstart", this._touchstart); + bind(element, "touchmove", this._touchmove); + bind(element, "touchend", this._touchend); +}; + +Draggable.prototype._unbindFromCurrent = function _unbindFromCurrent () { + unbind(this._element, "mousedown", this._mousedown); + unbind(this._element, "touchstart", this._touchstart); + unbind(this._element, "touchmove", this._touchmove); + unbind(this._element, "touchend", this._touchend); +}; + +Draggable.prototype.destroy = function destroy () { + this._unbindFromCurrent(); + this._element = null; +}; + +exports.Draggable = Draggable; +exports['default'] = Draggable; + +//# sourceMappingURL=main.js.map + + +/***/ }), +/* 282 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +Object.defineProperty(exports, '__esModule', { value: true }); + +var calculateFixedTrackSize = function (ref) { + var max = ref.max; + var min = ref.min; + var smallStep = ref.smallStep; + var fixedTickWidth = ref.fixedTickWidth; + + return ((max - min) / smallStep) * fixedTickWidth; +}; + +var calculateTrackSize = function (wrapperWidth, offset, showButtons) { + if ( showButtons === void 0 ) showButtons = true; + + var BUTTONS_COUNT = 2; + var trackOffset = showButtons ? parseFloat(offset, 10) * BUTTONS_COUNT : 0; + var trackWidth = wrapperWidth - trackOffset - BUTTONS_COUNT; + + return trackWidth; +}; + +var calculateTicksCount = function (max, min, smallStep) { + if ( max === void 0 ) max = 0; + if ( min === void 0 ) min = 0; + if ( smallStep === void 0 ) smallStep = 1; + + return calculateAreasCount(max, min, smallStep) + 1; +}; + +var calculateAreasCount = function (max, min, smallStep) { + if ( max === void 0 ) max = 0; + if ( min === void 0 ) min = 0; + if ( smallStep === void 0 ) smallStep = 1; + + if (smallStep <= 0 ) { + throw new Error("Invalid argument: smallStep must be a positive number"); + } + + return Math.floor(Math.abs(min - max) / smallStep); +}; + +var calculateValueFromTick = function (index, ref) { + var max = ref.max; + var min = ref.min; + var smallStep = ref.smallStep; + var reverse = ref.reverse; + var vertical = ref.vertical; + + var value = min + (index * smallStep); + + return vertical || reverse ? Math.abs(value - max) : value; +}; + +var calculateValueFromTrack = function (clientRect, pageOffset, props) { + var length, wrapperOffset; + + if (props.vertical) { + var top = clientRect.top; + var bottom = clientRect.bottom; + length = top - bottom; + wrapperOffset = pageOffset.pageY - bottom; + } else { + var left = clientRect.left; + var right = clientRect.right; + length = right - left; + wrapperOffset = pageOffset.pageX - left; + } + + return valueFromTrack(props, wrapperOffset, length); +}; + +var valueFromTrack = function (props, wrapperOffset, length) { + var max = props.max; + var min = props.min; + var reverse = props.reverse; + var smallStep = props.smallStep; + var distance = max - min; + var clickOffset = wrapperOffset / length; + var maxTickValue = distance - (distance % smallStep); + var maxOffset = (100 / distance) * maxTickValue / 100; + var absValue = (wrapperOffset / length) * distance; + var value = max; + + if (clickOffset < maxOffset) { + value = reverse ? max - absValue : absValue + min; + } + + return snapValue(extendProps(props, { value: value })); +}; + +var calculateTickSizes = function (trackSize, min, max, step) { + var elementCount = Math.floor((max - min) / step) + 1; + var distStep = trackSize / (max - min); + var result = []; + var usedSpace = 0; + var endPoint = 0; + + for (var i = 0; i < elementCount; i++) { + if (i === 0 || i === elementCount - 1) { + endPoint += (step / 2) * distStep; + } else { + endPoint += step * distStep; + } + + var size = Math.round(endPoint - usedSpace); + + result.push(size); + + usedSpace += size; + } + + return result; +}; + +var calculateHandlePosition = function (ref) { + var handleWidth = ref.handleWidth; + var trackWidth = ref.trackWidth; + var min = ref.min; + var max = ref.max; + var reverse = ref.reverse; + var value = ref.value; + + var halfHandleWidth = Math.floor(handleWidth / 2); + var step = trackWidth / Math.abs(max - min); + var pos = step * (value - min); + if (reverse) { + pos = trackWidth - pos; + } + + return Math.floor(pos - halfHandleWidth); +}; + +var decreaseValueToStep = function (ref) { + var max = ref.max; + var min = ref.min; + var smallStep = ref.smallStep; + var value = ref.value; + + var result; + if (value % smallStep === 0) { + result = value - smallStep; + } else { + result = value - (value % smallStep); + } + return trimValue(max, min, result); +}; + +var increaseValueToStep = function (ref) { + var max = ref.max; + var min = ref.min; + var smallStep = ref.smallStep; + var value = ref.value; + + var result = value - (value % smallStep) + smallStep; + + return trimValue(max, min, result); +}; + +var snapValue = function (props) { + var smallStep = props.smallStep; + var value = props.value; + var left = decreaseValueToStep(props); + var right = increaseValueToStep(props); + + if (value % smallStep === 0) { + return value; + } + + if (right - value <= smallStep / 2) { + return right; + } + + return left; +}; + +var trimValue = function (max, min, value) { + if (value > max) { + return max; + } + + if (value < min) { + return min; + } + + return value; +}; + +var identity = function (value) { return value; }; + +var extendProps = function (target) { + var sources = [], len = arguments.length - 1; + while ( len-- > 0 ) sources[ len ] = arguments[ len + 1 ]; + + return Object.assign.apply(Object, [ {}, target ].concat( sources )); +}; + +var SliderUtil = { + calculateFixedTrackSize: calculateFixedTrackSize, + calculateValueFromTick: calculateValueFromTick, + calculateValueFromTrack: calculateValueFromTrack, + calculateTrackSize: calculateTrackSize, + calculateTicksCount: calculateTicksCount, + calculateTickSizes: calculateTickSizes, + calculateHandlePosition: calculateHandlePosition, + decreaseValueToStep: decreaseValueToStep, + identity: identity, + increaseValueToStep: increaseValueToStep, + trimValue: trimValue, + snapValue: snapValue, + valueFromTrack: valueFromTrack +}; + +var SliderModel = function SliderModel(props, wrapper, track) { + this.props = props; + this.wrapper = wrapper; + this.track = track; + this.tickSizes = this.getTickSizes(); +}; + +SliderModel.prototype.getTickSizes = function getTickSizes () { + var ref = this.props; + var max = ref.max; + var min = ref.min; + var smallStep = ref.smallStep; + var trackWidth = this.trackWidth(); + + return SliderUtil.calculateTickSizes(trackWidth, min, max, smallStep); +}; + +SliderModel.prototype.trackWidth = function trackWidth () { + if (this.props.fixedTickWidth) { + return SliderUtil.calculateFixedTrackSize(this.props); + } + + return SliderUtil.calculateTrackSize( + this.elementSize(this.wrapper), + this.elementOffset(this.track), + this.props.buttons + ); +}; + +SliderModel.prototype.resizeTrack = function resizeTrack () { + var orientation = this.props.vertical ? 'height' : 'width'; + var trackWidth = this.trackWidth(); + + this.track.style[orientation] = trackWidth + "px"; +}; + +SliderModel.prototype.resizeTicks = function resizeTicks (ticksContainer, ticks) { + var this$1 = this; + + var dimension = this.props.vertical ? "height" : "width"; + + Array.prototype.slice.call(ticks).map(function (tick, index) { return tick.style[dimension] = (this$1.tickSizes[index]) + "px"; }); + + if (this.props.vertical) { + this.adjustPadding(ticksContainer); + } +}; + +SliderModel.prototype.resizeWrapper = function resizeWrapper () { + var dimension = this.props.vertical ? "height" : "width"; + var wrapperSize = this.elementSize(this.wrapper); + var trackWidth = SliderUtil.calculateTrackSize(wrapperSize, this.elementOffset(this.track)); + var fixedTrackWidth = SliderUtil.calculateFixedTrackSize(this.props); + + if (trackWidth > fixedTrackWidth) { + this.wrapper.parentElement.style[dimension] = (wrapperSize - (trackWidth - fixedTrackWidth)) + "px"; + } else { + this.wrapper.parentElement.style[dimension] = (wrapperSize + (fixedTrackWidth - trackWidth)) + "px"; + } +}; + +SliderModel.prototype.positionHandle = function positionHandle (dragHandle) { + var ref = this.props; + var max = ref.max; + var min = ref.min; + var reverse = ref.reverse; + var vertical = ref.vertical; + var position = vertical ? 'bottom' : 'left'; + var trackWidth = this.trackWidth(); + var value = SliderUtil.trimValue(max, min, this.props.value); + + this.handlePosition = SliderUtil.calculateHandlePosition({ + min: min, + max: max, + reverse: reverse, + value: value, + trackWidth: trackWidth, + handleWidth: dragHandle.offsetWidth + }); + + dragHandle.style[position] = (this.handlePosition) + "px"; +}; + +SliderModel.prototype.positionSelection = function positionSelection (dragHandle, selection) { + var ref = this.props; + var reverse = ref.reverse; + var vertical = ref.vertical; + var dimension = vertical ? 'height' : 'width'; + var handleWidth = Math.floor(dragHandle.offsetWidth / 2); + var size = this.handlePosition + handleWidth; + + if (reverse) { + size = this.trackWidth() - size; + } + + selection.style[dimension] = size + "px"; +}; + +SliderModel.prototype.adjustPadding = function adjustPadding (ticksContainer) { + var totalTickSize = this.tickSizes.reduce(function (prev, curr) { return prev + curr; }, 0); + var trackWidth = this.trackWidth(); + var reminder = trackWidth - totalTickSize; + + if (reminder !== 0) { + var padding = reminder + this.elementOffset(this.track); + ticksContainer.style.paddingTop = padding + "px"; + } +}; + +SliderModel.prototype.elementOffset = function elementOffset (element) { + var ref = this.props; + var vertical = ref.vertical; + var style = getComputedStyle(element); + + return parseInt(vertical ? style.bottom : style.left, 10); +}; + +SliderModel.prototype.elementSize = function elementSize (element) { + var ref = this.props; + var vertical = ref.vertical; + + return vertical ? element.clientHeight : element.clientWidth; +}; + +var Model = function Model(value, animate) { + if ( value === void 0 ) value = 0; + + this.handle = { + transform: 'translateX(' + value + 'px)', + transition: animate + }; +}; + +var DEFAULT_THRESHOLD = 5; + +var noop = function () { /*noop*/ }; + +var SwitchController = function SwitchController(updateView, onChange) { + var this$1 = this; + if ( updateView === void 0 ) updateView = noop; + if ( onChange === void 0 ) onChange = noop; + + this.handlePosition = 0; + this.wrapperOffset = 0; + this.handleOffset = 0; + this.handleMargin = 4; + + this.updateView = updateView; + this.onChange = onChange; + + this.change = function (checked) { + this$1.checked = checked; + + this$1.updateView(this$1.updateModel(checked ? this$1.constrain : 0)); + + this$1.onChange(checked); + }; + + this.limit = function (value) { + if (value > this$1.constrain) { + return this$1.constrain; + } + + if (value < 0) { + return 0; + } + + return value; + }; + + this.addAnimation = function (model) { + if (model.transition === true) { + model.transition = 'all 200ms ease-out'; + } else { + model.transition = 'none'; + } + return model; + }; + + this.onPress = function (ref) { + var pageX = ref.pageX; + + this$1.lastPressX = this$1.originalPressX = pageX; + }; + + this.onRelease = function (ref) { + var pageX = ref.pageX; + + var delta = Math.abs(this$1.originalPressX - pageX); + var snapPoint = this$1.constrain / 2; + var checked = delta < DEFAULT_THRESHOLD ? !this$1.checked : this$1.handlePosition > snapPoint; + + this$1.change(checked); + }; + + this.onDrag = function (ref) { + var pageX = ref.pageX; + + var ref$1 = this$1.coords; + var left = ref$1.left; + var right = ref$1.right; + var overElement = pageX > left && pageX < right; + + if (overElement) { + var delta = this$1.reverse ? this$1.lastPressX - pageX : pageX - this$1.lastPressX; + var position = this$1.limit(this$1.handlePosition + delta); + + this$1.lastPressX = pageX; + this$1.handlePosition = position; + this$1.updateView(this$1.updateModel(this$1.handlePosition)); + } + if (pageX > right) { + this$1.updateView(this$1.updateModel(this$1.reverse ? 0 : this$1.constrain)); + } + + if (pageX < left) { + this$1.updateView(this$1.updateModel(this$1.reverse ? 0 : this$1.constrain)); + } + }; +}; + +var prototypeAccessors = { constrain: {} }; + +prototypeAccessors.constrain.get = function () { + return this.wrapperOffset - this.handleOffset - this.handleMargin; +}; + +SwitchController.prototype.updateState = function updateState (ref) { + var wrapperOffset = ref.wrapperOffset; + var handleOffset = ref.handleOffset; + var checked = ref.checked; + var animate = ref.animate; if ( animate === void 0 ) animate = true; + var coords = ref.coords; + var handleMargin = ref.handleMargin; + var reverse = ref.reverse; + + this.wrapperOffset = wrapperOffset; + this.handleOffset = handleOffset; + this.coords = coords; + this.handleMargin = handleMargin; + + this.checked = checked; + this.reverse = reverse; + + this.updateView(this.updateModel(checked ? this.constrain : 0, animate)); +}; + +SwitchController.prototype.updateModel = function updateModel (position, animate) { + if ( animate === void 0 ) animate = true; + + var pos = this.reverse ? this.wrapperOffset / 2 - position : position; + return new Model(pos, animate); +}; + +Object.defineProperties( SwitchController.prototype, prototypeAccessors ); + +exports.SliderModel = SliderModel; +exports.SliderUtil = SliderUtil; +exports.SwitchController = SwitchController; + +//# sourceMappingURL=main.js.map + + +/***/ }), +/* 283 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Tokenizer = __webpack_require__(65), + HTML = __webpack_require__(20); + +//Aliases +var $ = HTML.TAG_NAMES, + NS = HTML.NAMESPACES, + ATTRS = HTML.ATTRS; + + +//MIME types +var MIME_TYPES = { + TEXT_HTML: 'text/html', + APPLICATION_XML: 'application/xhtml+xml' +}; + +//Attributes +var DEFINITION_URL_ATTR = 'definitionurl', + ADJUSTED_DEFINITION_URL_ATTR = 'definitionURL', + SVG_ATTRS_ADJUSTMENT_MAP = { + 'attributename': 'attributeName', + 'attributetype': 'attributeType', + 'basefrequency': 'baseFrequency', + 'baseprofile': 'baseProfile', + 'calcmode': 'calcMode', + 'clippathunits': 'clipPathUnits', + 'diffuseconstant': 'diffuseConstant', + 'edgemode': 'edgeMode', + 'filterunits': 'filterUnits', + 'glyphref': 'glyphRef', + 'gradienttransform': 'gradientTransform', + 'gradientunits': 'gradientUnits', + 'kernelmatrix': 'kernelMatrix', + 'kernelunitlength': 'kernelUnitLength', + 'keypoints': 'keyPoints', + 'keysplines': 'keySplines', + 'keytimes': 'keyTimes', + 'lengthadjust': 'lengthAdjust', + 'limitingconeangle': 'limitingConeAngle', + 'markerheight': 'markerHeight', + 'markerunits': 'markerUnits', + 'markerwidth': 'markerWidth', + 'maskcontentunits': 'maskContentUnits', + 'maskunits': 'maskUnits', + 'numoctaves': 'numOctaves', + 'pathlength': 'pathLength', + 'patterncontentunits': 'patternContentUnits', + 'patterntransform': 'patternTransform', + 'patternunits': 'patternUnits', + 'pointsatx': 'pointsAtX', + 'pointsaty': 'pointsAtY', + 'pointsatz': 'pointsAtZ', + 'preservealpha': 'preserveAlpha', + 'preserveaspectratio': 'preserveAspectRatio', + 'primitiveunits': 'primitiveUnits', + 'refx': 'refX', + 'refy': 'refY', + 'repeatcount': 'repeatCount', + 'repeatdur': 'repeatDur', + 'requiredextensions': 'requiredExtensions', + 'requiredfeatures': 'requiredFeatures', + 'specularconstant': 'specularConstant', + 'specularexponent': 'specularExponent', + 'spreadmethod': 'spreadMethod', + 'startoffset': 'startOffset', + 'stddeviation': 'stdDeviation', + 'stitchtiles': 'stitchTiles', + 'surfacescale': 'surfaceScale', + 'systemlanguage': 'systemLanguage', + 'tablevalues': 'tableValues', + 'targetx': 'targetX', + 'targety': 'targetY', + 'textlength': 'textLength', + 'viewbox': 'viewBox', + 'viewtarget': 'viewTarget', + 'xchannelselector': 'xChannelSelector', + 'ychannelselector': 'yChannelSelector', + 'zoomandpan': 'zoomAndPan' + }, + XML_ATTRS_ADJUSTMENT_MAP = { + 'xlink:actuate': {prefix: 'xlink', name: 'actuate', namespace: NS.XLINK}, + 'xlink:arcrole': {prefix: 'xlink', name: 'arcrole', namespace: NS.XLINK}, + 'xlink:href': {prefix: 'xlink', name: 'href', namespace: NS.XLINK}, + 'xlink:role': {prefix: 'xlink', name: 'role', namespace: NS.XLINK}, + 'xlink:show': {prefix: 'xlink', name: 'show', namespace: NS.XLINK}, + 'xlink:title': {prefix: 'xlink', name: 'title', namespace: NS.XLINK}, + 'xlink:type': {prefix: 'xlink', name: 'type', namespace: NS.XLINK}, + 'xml:base': {prefix: 'xml', name: 'base', namespace: NS.XML}, + 'xml:lang': {prefix: 'xml', name: 'lang', namespace: NS.XML}, + 'xml:space': {prefix: 'xml', name: 'space', namespace: NS.XML}, + 'xmlns': {prefix: '', name: 'xmlns', namespace: NS.XMLNS}, + 'xmlns:xlink': {prefix: 'xmlns', name: 'xlink', namespace: NS.XMLNS} + + }; + +//SVG tag names adjustment map +var SVG_TAG_NAMES_ADJUSTMENT_MAP = exports.SVG_TAG_NAMES_ADJUSTMENT_MAP = { + 'altglyph': 'altGlyph', + 'altglyphdef': 'altGlyphDef', + 'altglyphitem': 'altGlyphItem', + 'animatecolor': 'animateColor', + 'animatemotion': 'animateMotion', + 'animatetransform': 'animateTransform', + 'clippath': 'clipPath', + 'feblend': 'feBlend', + 'fecolormatrix': 'feColorMatrix', + 'fecomponenttransfer': 'feComponentTransfer', + 'fecomposite': 'feComposite', + 'feconvolvematrix': 'feConvolveMatrix', + 'fediffuselighting': 'feDiffuseLighting', + 'fedisplacementmap': 'feDisplacementMap', + 'fedistantlight': 'feDistantLight', + 'feflood': 'feFlood', + 'fefunca': 'feFuncA', + 'fefuncb': 'feFuncB', + 'fefuncg': 'feFuncG', + 'fefuncr': 'feFuncR', + 'fegaussianblur': 'feGaussianBlur', + 'feimage': 'feImage', + 'femerge': 'feMerge', + 'femergenode': 'feMergeNode', + 'femorphology': 'feMorphology', + 'feoffset': 'feOffset', + 'fepointlight': 'fePointLight', + 'fespecularlighting': 'feSpecularLighting', + 'fespotlight': 'feSpotLight', + 'fetile': 'feTile', + 'feturbulence': 'feTurbulence', + 'foreignobject': 'foreignObject', + 'glyphref': 'glyphRef', + 'lineargradient': 'linearGradient', + 'radialgradient': 'radialGradient', + 'textpath': 'textPath' +}; + +//Tags that causes exit from foreign content +var EXITS_FOREIGN_CONTENT = Object.create(null); + +EXITS_FOREIGN_CONTENT[$.B] = true; +EXITS_FOREIGN_CONTENT[$.BIG] = true; +EXITS_FOREIGN_CONTENT[$.BLOCKQUOTE] = true; +EXITS_FOREIGN_CONTENT[$.BODY] = true; +EXITS_FOREIGN_CONTENT[$.BR] = true; +EXITS_FOREIGN_CONTENT[$.CENTER] = true; +EXITS_FOREIGN_CONTENT[$.CODE] = true; +EXITS_FOREIGN_CONTENT[$.DD] = true; +EXITS_FOREIGN_CONTENT[$.DIV] = true; +EXITS_FOREIGN_CONTENT[$.DL] = true; +EXITS_FOREIGN_CONTENT[$.DT] = true; +EXITS_FOREIGN_CONTENT[$.EM] = true; +EXITS_FOREIGN_CONTENT[$.EMBED] = true; +EXITS_FOREIGN_CONTENT[$.H1] = true; +EXITS_FOREIGN_CONTENT[$.H2] = true; +EXITS_FOREIGN_CONTENT[$.H3] = true; +EXITS_FOREIGN_CONTENT[$.H4] = true; +EXITS_FOREIGN_CONTENT[$.H5] = true; +EXITS_FOREIGN_CONTENT[$.H6] = true; +EXITS_FOREIGN_CONTENT[$.HEAD] = true; +EXITS_FOREIGN_CONTENT[$.HR] = true; +EXITS_FOREIGN_CONTENT[$.I] = true; +EXITS_FOREIGN_CONTENT[$.IMG] = true; +EXITS_FOREIGN_CONTENT[$.LI] = true; +EXITS_FOREIGN_CONTENT[$.LISTING] = true; +EXITS_FOREIGN_CONTENT[$.MENU] = true; +EXITS_FOREIGN_CONTENT[$.META] = true; +EXITS_FOREIGN_CONTENT[$.NOBR] = true; +EXITS_FOREIGN_CONTENT[$.OL] = true; +EXITS_FOREIGN_CONTENT[$.P] = true; +EXITS_FOREIGN_CONTENT[$.PRE] = true; +EXITS_FOREIGN_CONTENT[$.RUBY] = true; +EXITS_FOREIGN_CONTENT[$.S] = true; +EXITS_FOREIGN_CONTENT[$.SMALL] = true; +EXITS_FOREIGN_CONTENT[$.SPAN] = true; +EXITS_FOREIGN_CONTENT[$.STRONG] = true; +EXITS_FOREIGN_CONTENT[$.STRIKE] = true; +EXITS_FOREIGN_CONTENT[$.SUB] = true; +EXITS_FOREIGN_CONTENT[$.SUP] = true; +EXITS_FOREIGN_CONTENT[$.TABLE] = true; +EXITS_FOREIGN_CONTENT[$.TT] = true; +EXITS_FOREIGN_CONTENT[$.U] = true; +EXITS_FOREIGN_CONTENT[$.UL] = true; +EXITS_FOREIGN_CONTENT[$.VAR] = true; + +//Check exit from foreign content +exports.causesExit = function (startTagToken) { + var tn = startTagToken.tagName; + var isFontWithAttrs = tn === $.FONT && (Tokenizer.getTokenAttr(startTagToken, ATTRS.COLOR) !== null || + Tokenizer.getTokenAttr(startTagToken, ATTRS.SIZE) !== null || + Tokenizer.getTokenAttr(startTagToken, ATTRS.FACE) !== null); + + return isFontWithAttrs ? true : EXITS_FOREIGN_CONTENT[tn]; +}; + +//Token adjustments +exports.adjustTokenMathMLAttrs = function (token) { + for (var i = 0; i < token.attrs.length; i++) { + if (token.attrs[i].name === DEFINITION_URL_ATTR) { + token.attrs[i].name = ADJUSTED_DEFINITION_URL_ATTR; + break; + } + } +}; + +exports.adjustTokenSVGAttrs = function (token) { + for (var i = 0; i < token.attrs.length; i++) { + var adjustedAttrName = SVG_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; + + if (adjustedAttrName) + token.attrs[i].name = adjustedAttrName; + } +}; + +exports.adjustTokenXMLAttrs = function (token) { + for (var i = 0; i < token.attrs.length; i++) { + var adjustedAttrEntry = XML_ATTRS_ADJUSTMENT_MAP[token.attrs[i].name]; + + if (adjustedAttrEntry) { + token.attrs[i].prefix = adjustedAttrEntry.prefix; + token.attrs[i].name = adjustedAttrEntry.name; + token.attrs[i].namespace = adjustedAttrEntry.namespace; + } + } +}; + +exports.adjustTokenSVGTagName = function (token) { + var adjustedTagName = SVG_TAG_NAMES_ADJUSTMENT_MAP[token.tagName]; + + if (adjustedTagName) + token.tagName = adjustedTagName; +}; + +//Integration points +function isMathMLTextIntegrationPoint(tn, ns) { + return ns === NS.MATHML && (tn === $.MI || tn === $.MO || tn === $.MN || tn === $.MS || tn === $.MTEXT); +} + +function isHtmlIntegrationPoint(tn, ns, attrs) { + if (ns === NS.MATHML && tn === $.ANNOTATION_XML) { + for (var i = 0; i < attrs.length; i++) { + if (attrs[i].name === ATTRS.ENCODING) { + var value = attrs[i].value.toLowerCase(); + + return value === MIME_TYPES.TEXT_HTML || value === MIME_TYPES.APPLICATION_XML; + } + } + } + + return ns === NS.SVG && (tn === $.FOREIGN_OBJECT || tn === $.DESC || tn === $.TITLE); +} + +exports.isIntegrationPoint = function (tn, ns, attrs, foreignNS) { + if ((!foreignNS || foreignNS === NS.HTML) && isHtmlIntegrationPoint(tn, ns, attrs)) + return true; + + if ((!foreignNS || foreignNS === NS.MATHML) && isMathMLTextIntegrationPoint(tn, ns)) + return true; + + return false; +}; + + +/***/ }), +/* 284 */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; + + +var Tokenizer = __webpack_require__(65), + OpenElementStack = __webpack_require__(285), + FormattingElementList = __webpack_require__(441), + locationInfoMixin = __webpack_require__(439), + defaultTreeAdapter = __webpack_require__(143), + doctype = __webpack_require__(140), + foreignContent = __webpack_require__(283), + mergeOptions = __webpack_require__(141), + UNICODE = __webpack_require__(64), + HTML = __webpack_require__(20); + +//Aliases +var $ = HTML.TAG_NAMES, + NS = HTML.NAMESPACES, + ATTRS = HTML.ATTRS; + +var DEFAULT_OPTIONS = { + locationInfo: false, + treeAdapter: defaultTreeAdapter +}; + +//Misc constants +var HIDDEN_INPUT_TYPE = 'hidden'; + +//Adoption agency loops iteration count +var AA_OUTER_LOOP_ITER = 8, + AA_INNER_LOOP_ITER = 3; + +//Insertion modes +var INITIAL_MODE = 'INITIAL_MODE', + BEFORE_HTML_MODE = 'BEFORE_HTML_MODE', + BEFORE_HEAD_MODE = 'BEFORE_HEAD_MODE', + IN_HEAD_MODE = 'IN_HEAD_MODE', + AFTER_HEAD_MODE = 'AFTER_HEAD_MODE', + IN_BODY_MODE = 'IN_BODY_MODE', + TEXT_MODE = 'TEXT_MODE', + IN_TABLE_MODE = 'IN_TABLE_MODE', + IN_TABLE_TEXT_MODE = 'IN_TABLE_TEXT_MODE', + IN_CAPTION_MODE = 'IN_CAPTION_MODE', + IN_COLUMN_GROUP_MODE = 'IN_COLUMN_GROUP_MODE', + IN_TABLE_BODY_MODE = 'IN_TABLE_BODY_MODE', + IN_ROW_MODE = 'IN_ROW_MODE', + IN_CELL_MODE = 'IN_CELL_MODE', + IN_SELECT_MODE = 'IN_SELECT_MODE', + IN_SELECT_IN_TABLE_MODE = 'IN_SELECT_IN_TABLE_MODE', + IN_TEMPLATE_MODE = 'IN_TEMPLATE_MODE', + AFTER_BODY_MODE = 'AFTER_BODY_MODE', + IN_FRAMESET_MODE = 'IN_FRAMESET_MODE', + AFTER_FRAMESET_MODE = 'AFTER_FRAMESET_MODE', + AFTER_AFTER_BODY_MODE = 'AFTER_AFTER_BODY_MODE', + AFTER_AFTER_FRAMESET_MODE = 'AFTER_AFTER_FRAMESET_MODE'; + +//Insertion mode reset map +var INSERTION_MODE_RESET_MAP = Object.create(null); + +INSERTION_MODE_RESET_MAP[$.TR] = IN_ROW_MODE; +INSERTION_MODE_RESET_MAP[$.TBODY] = +INSERTION_MODE_RESET_MAP[$.THEAD] = +INSERTION_MODE_RESET_MAP[$.TFOOT] = IN_TABLE_BODY_MODE; +INSERTION_MODE_RESET_MAP[$.CAPTION] = IN_CAPTION_MODE; +INSERTION_MODE_RESET_MAP[$.COLGROUP] = IN_COLUMN_GROUP_MODE; +INSERTION_MODE_RESET_MAP[$.TABLE] = IN_TABLE_MODE; +INSERTION_MODE_RESET_MAP[$.BODY] = IN_BODY_MODE; +INSERTION_MODE_RESET_MAP[$.FRAMESET] = IN_FRAMESET_MODE; + +//Template insertion mode switch map +var TEMPLATE_INSERTION_MODE_SWITCH_MAP = Object.create(null); + +TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.CAPTION] = +TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COLGROUP] = +TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TBODY] = +TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TFOOT] = +TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.THEAD] = IN_TABLE_MODE; +TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.COL] = IN_COLUMN_GROUP_MODE; +TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TR] = IN_TABLE_BODY_MODE; +TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TD] = +TEMPLATE_INSERTION_MODE_SWITCH_MAP[$.TH] = IN_ROW_MODE; + +//Token handlers map for insertion modes +var _ = Object.create(null); + +_[INITIAL_MODE] = Object.create(null); +_[INITIAL_MODE][Tokenizer.CHARACTER_TOKEN] = +_[INITIAL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInInitialMode; +_[INITIAL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; +_[INITIAL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[INITIAL_MODE][Tokenizer.DOCTYPE_TOKEN] = doctypeInInitialMode; +_[INITIAL_MODE][Tokenizer.START_TAG_TOKEN] = +_[INITIAL_MODE][Tokenizer.END_TAG_TOKEN] = +_[INITIAL_MODE][Tokenizer.EOF_TOKEN] = tokenInInitialMode; + +_[BEFORE_HTML_MODE] = Object.create(null); +_[BEFORE_HTML_MODE][Tokenizer.CHARACTER_TOKEN] = +_[BEFORE_HTML_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHtml; +_[BEFORE_HTML_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; +_[BEFORE_HTML_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[BEFORE_HTML_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[BEFORE_HTML_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHtml; +_[BEFORE_HTML_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHtml; +_[BEFORE_HTML_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHtml; + +_[BEFORE_HEAD_MODE] = Object.create(null); +_[BEFORE_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = +_[BEFORE_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenBeforeHead; +_[BEFORE_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = ignoreToken; +_[BEFORE_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[BEFORE_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[BEFORE_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagBeforeHead; +_[BEFORE_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagBeforeHead; +_[BEFORE_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenBeforeHead; + +_[IN_HEAD_MODE] = Object.create(null); +_[IN_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = +_[IN_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInHead; +_[IN_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; +_[IN_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagInHead; +_[IN_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagInHead; +_[IN_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenInHead; + +_[AFTER_HEAD_MODE] = Object.create(null); +_[AFTER_HEAD_MODE][Tokenizer.CHARACTER_TOKEN] = +_[AFTER_HEAD_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterHead; +_[AFTER_HEAD_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; +_[AFTER_HEAD_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[AFTER_HEAD_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[AFTER_HEAD_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterHead; +_[AFTER_HEAD_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterHead; +_[AFTER_HEAD_MODE][Tokenizer.EOF_TOKEN] = tokenAfterHead; + +_[IN_BODY_MODE] = Object.create(null); +_[IN_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; +_[IN_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[IN_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; +_[IN_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInBody; +_[IN_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInBody; +_[IN_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + +_[TEXT_MODE] = Object.create(null); +_[TEXT_MODE][Tokenizer.CHARACTER_TOKEN] = +_[TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = +_[TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; +_[TEXT_MODE][Tokenizer.COMMENT_TOKEN] = +_[TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] = +_[TEXT_MODE][Tokenizer.START_TAG_TOKEN] = ignoreToken; +_[TEXT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInText; +_[TEXT_MODE][Tokenizer.EOF_TOKEN] = eofInText; + +_[IN_TABLE_MODE] = Object.create(null); +_[IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] = +_[IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = +_[IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; +_[IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTable; +_[IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTable; +_[IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + +_[IN_TABLE_TEXT_MODE] = Object.create(null); +_[IN_TABLE_TEXT_MODE][Tokenizer.CHARACTER_TOKEN] = characterInTableText; +_[IN_TABLE_TEXT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[IN_TABLE_TEXT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInTableText; +_[IN_TABLE_TEXT_MODE][Tokenizer.COMMENT_TOKEN] = +_[IN_TABLE_TEXT_MODE][Tokenizer.DOCTYPE_TOKEN] = +_[IN_TABLE_TEXT_MODE][Tokenizer.START_TAG_TOKEN] = +_[IN_TABLE_TEXT_MODE][Tokenizer.END_TAG_TOKEN] = +_[IN_TABLE_TEXT_MODE][Tokenizer.EOF_TOKEN] = tokenInTableText; + +_[IN_CAPTION_MODE] = Object.create(null); +_[IN_CAPTION_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; +_[IN_CAPTION_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[IN_CAPTION_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; +_[IN_CAPTION_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_CAPTION_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_CAPTION_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCaption; +_[IN_CAPTION_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCaption; +_[IN_CAPTION_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + +_[IN_COLUMN_GROUP_MODE] = Object.create(null); +_[IN_COLUMN_GROUP_MODE][Tokenizer.CHARACTER_TOKEN] = +_[IN_COLUMN_GROUP_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenInColumnGroup; +_[IN_COLUMN_GROUP_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; +_[IN_COLUMN_GROUP_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_COLUMN_GROUP_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_COLUMN_GROUP_MODE][Tokenizer.START_TAG_TOKEN] = startTagInColumnGroup; +_[IN_COLUMN_GROUP_MODE][Tokenizer.END_TAG_TOKEN] = endTagInColumnGroup; +_[IN_COLUMN_GROUP_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + +_[IN_TABLE_BODY_MODE] = Object.create(null); +_[IN_TABLE_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = +_[IN_TABLE_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = +_[IN_TABLE_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; +_[IN_TABLE_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_TABLE_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_TABLE_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTableBody; +_[IN_TABLE_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTableBody; +_[IN_TABLE_BODY_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + +_[IN_ROW_MODE] = Object.create(null); +_[IN_ROW_MODE][Tokenizer.CHARACTER_TOKEN] = +_[IN_ROW_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = +_[IN_ROW_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = characterInTable; +_[IN_ROW_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_ROW_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_ROW_MODE][Tokenizer.START_TAG_TOKEN] = startTagInRow; +_[IN_ROW_MODE][Tokenizer.END_TAG_TOKEN] = endTagInRow; +_[IN_ROW_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + +_[IN_CELL_MODE] = Object.create(null); +_[IN_CELL_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; +_[IN_CELL_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[IN_CELL_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; +_[IN_CELL_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_CELL_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_CELL_MODE][Tokenizer.START_TAG_TOKEN] = startTagInCell; +_[IN_CELL_MODE][Tokenizer.END_TAG_TOKEN] = endTagInCell; +_[IN_CELL_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + +_[IN_SELECT_MODE] = Object.create(null); +_[IN_SELECT_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters; +_[IN_SELECT_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[IN_SELECT_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; +_[IN_SELECT_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_SELECT_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_SELECT_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelect; +_[IN_SELECT_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelect; +_[IN_SELECT_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + +_[IN_SELECT_IN_TABLE_MODE] = Object.create(null); +_[IN_SELECT_IN_TABLE_MODE][Tokenizer.CHARACTER_TOKEN] = insertCharacters; +_[IN_SELECT_IN_TABLE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[IN_SELECT_IN_TABLE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; +_[IN_SELECT_IN_TABLE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_SELECT_IN_TABLE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_SELECT_IN_TABLE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInSelectInTable; +_[IN_SELECT_IN_TABLE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInSelectInTable; +_[IN_SELECT_IN_TABLE_MODE][Tokenizer.EOF_TOKEN] = eofInBody; + +_[IN_TEMPLATE_MODE] = Object.create(null); +_[IN_TEMPLATE_MODE][Tokenizer.CHARACTER_TOKEN] = characterInBody; +_[IN_TEMPLATE_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[IN_TEMPLATE_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; +_[IN_TEMPLATE_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_TEMPLATE_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_TEMPLATE_MODE][Tokenizer.START_TAG_TOKEN] = startTagInTemplate; +_[IN_TEMPLATE_MODE][Tokenizer.END_TAG_TOKEN] = endTagInTemplate; +_[IN_TEMPLATE_MODE][Tokenizer.EOF_TOKEN] = eofInTemplate; + +_[AFTER_BODY_MODE] = Object.create(null); +_[AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = +_[AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterBody; +_[AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; +_[AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToRootHtmlElement; +_[AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterBody; +_[AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterBody; +_[AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + +_[IN_FRAMESET_MODE] = Object.create(null); +_[IN_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = +_[IN_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[IN_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; +_[IN_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[IN_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[IN_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagInFrameset; +_[IN_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagInFrameset; +_[IN_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + +_[AFTER_FRAMESET_MODE] = Object.create(null); +_[AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = +_[AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = insertCharacters; +_[AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendComment; +_[AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterFrameset; +_[AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = endTagAfterFrameset; +_[AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + +_[AFTER_AFTER_BODY_MODE] = Object.create(null); +_[AFTER_AFTER_BODY_MODE][Tokenizer.CHARACTER_TOKEN] = tokenAfterAfterBody; +_[AFTER_AFTER_BODY_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = tokenAfterAfterBody; +_[AFTER_AFTER_BODY_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; +_[AFTER_AFTER_BODY_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument; +_[AFTER_AFTER_BODY_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[AFTER_AFTER_BODY_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterBody; +_[AFTER_AFTER_BODY_MODE][Tokenizer.END_TAG_TOKEN] = tokenAfterAfterBody; +_[AFTER_AFTER_BODY_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + +_[AFTER_AFTER_FRAMESET_MODE] = Object.create(null); +_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.CHARACTER_TOKEN] = +_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.NULL_CHARACTER_TOKEN] = ignoreToken; +_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.WHITESPACE_CHARACTER_TOKEN] = whitespaceCharacterInBody; +_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.COMMENT_TOKEN] = appendCommentToDocument; +_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.DOCTYPE_TOKEN] = ignoreToken; +_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.START_TAG_TOKEN] = startTagAfterAfterFrameset; +_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.END_TAG_TOKEN] = ignoreToken; +_[AFTER_AFTER_FRAMESET_MODE][Tokenizer.EOF_TOKEN] = stopParsing; + + +//Parser +var Parser = module.exports = function (options) { + this.options = mergeOptions(DEFAULT_OPTIONS, options); + + this.treeAdapter = this.options.treeAdapter; + this.pendingScript = null; + + if (this.options.locationInfo) + locationInfoMixin.assign(this); +}; + +// API +Parser.prototype.parse = function (html) { + var document = this.treeAdapter.createDocument(); + + this._bootstrap(document, null); + this.tokenizer.write(html, true); + this._runParsingLoop(null); + + return document; +}; + +Parser.prototype.parseFragment = function (html, fragmentContext) { + //NOTE: use